From 90858c755fd59197fa5d5c23888acedadd8c2b8b Mon Sep 17 00:00:00 2001
From: support
Date: Sat, 10 Sep 2022 13:40:55 +0000
Subject: [PATCH] Built motion from commit 94e49db2.|2.6.15
---
apidoc/api_project.js | 2 +-
apidoc/api_project.json | 2 +-
package.json | 4 +++-
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.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, 1205 insertions(+), 1203 deletions(-)
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index c2ba2b1..1d90f6a 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-09-08T14:48:49.478Z",
+ "time": "2022-09-10T13:32:56.874Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 7257d1f..e916266 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-09-08T14:48:49.478Z",
+ "time": "2022-09-10T13:32:56.874Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/package.json b/package.json
index 6d6dbe7..3ccea66 100644
--- a/package.json
+++ b/package.json
@@ -44,7 +44,9 @@
"prettier:write": "prettier --write './**/*'",
"format-all": "npm run js-beautify && npm run prettier:write",
"test": "mocha server/test --timeout 5000",
- "aux-containers": "docker-compose up -d database cache"
+ "aux-containers": "docker-compose up -d database cache",
+ "db-dump": "docker-compose exec -u root database /xmotion_mysql_bk.sh dump",
+ "db-restore": "docker-compose exec -u root database /xmotion_mysql_bk.sh restore"
},
"dependencies": {
"@types/express-serve-static-core": "4.17.28",
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index 064d77a..a25a3ea 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 _0x30d3=['integration','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[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[body]','sequelize','exports','getDataValue','action','STRING','contactManager'];(function(_0x2e04e8,_0x21532f){var _0x2e9994=function(_0x5e69df){while(--_0x5e69df){_0x2e04e8['push'](_0x2e04e8['shift']());}};_0x2e9994(++_0x21532f);}(_0x30d3,0xc6));var _0x330d=function(_0xe178b5,_0x2dffe2){_0xe178b5=_0xe178b5-0x0;var _0x52a9a4=_0x30d3[_0xe178b5];return _0x52a9a4;};'use strict';var Sequelize=require(_0x330d('0x0'));module[_0x330d('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4fe0af){return this[_0x330d('0x2')](_0x330d('0x3'));}},'action':{'type':Sequelize[_0x330d('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x330d('0x5'),_0x330d('0x6'),'motionbar','jscripty',_0x330d('0x7'),_0x330d('0x8'),_0x330d('0x9'),_0x330d('0xa')]],'msg':_0x330d('0xb')}},'comment':_0x330d('0xb')},'data1':{'type':Sequelize[_0x330d('0x4')](0x1000),'comment':_0x330d('0xc')},'data2':{'type':Sequelize[_0x330d('0x4')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x330d('0x4')](0x1000),'comment':_0x330d('0xd')},'data4':{'type':Sequelize[_0x330d('0x4')](0x1000),'comments':_0x330d('0xe')},'data5':{'type':Sequelize[_0x330d('0x4')](0x1000),'comments':_0x330d('0xf')},'data6':{'type':Sequelize[_0x330d('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize['TEXT'],'comments':_0x330d('0x10')}};
\ No newline at end of file
+var _0x11ce=['TEXT','urlForward[body]','sequelize','exports','getDataValue','STRING','contactManager','integration','motionbar','jscripty','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]'];(function(_0x5b077b,_0x50b707){var _0x16faf7=function(_0x41ba83){while(--_0x41ba83){_0x5b077b['push'](_0x5b077b['shift']());}};_0x16faf7(++_0x50b707);}(_0x11ce,0xd3));var _0xe11c=function(_0x14fbf1,_0x31dde1){_0x14fbf1=_0x14fbf1-0x0;var _0x395885=_0x11ce[_0x14fbf1];return _0x395885;};'use strict';var Sequelize=require(_0xe11c('0x0'));module[_0xe11c('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3f4819){return this[_0xe11c('0x2')]('action');}},'action':{'type':Sequelize[_0xe11c('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0xe11c('0x4'),_0xe11c('0x5'),_0xe11c('0x6'),_0xe11c('0x7'),_0xe11c('0x8'),'browser',_0xe11c('0x9'),_0xe11c('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xe11c('0xb')},'data1':{'type':Sequelize[_0xe11c('0x3')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xe11c('0xc')},'data3':{'type':Sequelize[_0xe11c('0x3')](0x1000),'comment':_0xe11c('0xd')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0xe11c('0xe')},'data5':{'type':Sequelize[_0xe11c('0x3')](0x1000),'comments':_0xe11c('0xf')},'data6':{'type':Sequelize['STRING'],'comments':_0xe11c('0x10')},'data7':{'type':Sequelize[_0xe11c('0x11')],'comments':_0xe11c('0x12')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index dc0f091..539eac5 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 _0x8e7d=['params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','limit','count','offset','set','Content-Range','json','apply','save','update','then','destroy','stack','name','send','body','Action','find'];(function(_0x3c7c43,_0x387074){var _0xb0c939=function(_0xbb87d8){while(--_0xbb87d8){_0x3c7c43['push'](_0x3c7c43['shift']());}};_0xb0c939(++_0x387074);}(_0x8e7d,0x1ce));var _0xd8e7=function(_0x317097,_0x4b8a5c){_0x317097=_0x317097-0x0;var _0x9b917c=_0x8e7d[_0x317097];return _0x9b917c;};'use strict';var emlformat=require(_0xd8e7('0x0'));var rimraf=require(_0xd8e7('0x1'));var zipdir=require(_0xd8e7('0x2'));var jsonpatch=require(_0xd8e7('0x3'));var rp=require(_0xd8e7('0x4'));var moment=require('moment');var BPromise=require(_0xd8e7('0x5'));var Mustache=require(_0xd8e7('0x6'));var util=require(_0xd8e7('0x7'));var path=require('path');var sox=require(_0xd8e7('0x8'));var csv=require(_0xd8e7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd8e7('0xa'));var _=require(_0xd8e7('0xb'));var squel=require('squel');var crypto=require(_0xd8e7('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd8e7('0xd'));var toCsv=require(_0xd8e7('0x9'));var querystring=require(_0xd8e7('0xe'));var Papa=require('papaparse');var Redis=require(_0xd8e7('0xf'));var authService=require(_0xd8e7('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd8e7('0x11'));var hardwareService=require(_0xd8e7('0x12'));var logger=require(_0xd8e7('0x13'))(_0xd8e7('0x14'));var utils=require('../../config/utils');var config=require(_0xd8e7('0x15'));var licenseUtil=require(_0xd8e7('0x16'));var db=require(_0xd8e7('0x17'))['db'];function respondWithStatusCode(_0x250887,_0x3d9a83){_0x3d9a83=_0x3d9a83||0xcc;return function(_0x458a78){if(_0x458a78){return _0x250887[_0xd8e7('0x18')](_0x3d9a83);}return _0x250887['status'](_0x3d9a83)[_0xd8e7('0x19')]();};}function respondWithResult(_0x2b7852,_0x261a0e){_0x261a0e=_0x261a0e||0xc8;return function(_0x373f01){if(_0x373f01){return _0x2b7852[_0xd8e7('0x1a')](_0x261a0e)['json'](_0x373f01);}};}function respondWithFilteredResult(_0x42ba06,_0x3e47cd){return function(_0x2f0fe9){if(_0x2f0fe9){var _0x5b66cd=typeof _0x3e47cd['offset']==='undefined'&&typeof _0x3e47cd[_0xd8e7('0x1b')]==='undefined';var _0x2eae48=_0x2f0fe9[_0xd8e7('0x1c')];var _0x21a615=_0x5b66cd?0x0:_0x3e47cd[_0xd8e7('0x1d')];var _0x4a338c=_0x5b66cd?_0x2f0fe9['count']:_0x3e47cd['offset']+_0x3e47cd['limit'];var _0x40a1cc;if(_0x4a338c>=_0x2eae48){_0x4a338c=_0x2eae48;_0x40a1cc=0xc8;}else{_0x40a1cc=0xce;}_0x42ba06[_0xd8e7('0x1a')](_0x40a1cc);return _0x42ba06[_0xd8e7('0x1e')](_0xd8e7('0x1f'),_0x21a615+'-'+_0x4a338c+'/'+_0x2eae48)[_0xd8e7('0x20')](_0x2f0fe9);}return null;};}function patchUpdates(_0x3b7389){return function(_0x1e41b6){try{jsonpatch[_0xd8e7('0x21')](_0x1e41b6,_0x3b7389,!![]);}catch(_0x476531){return BPromise['reject'](_0x476531);}return _0x1e41b6[_0xd8e7('0x22')]();};}function saveUpdates(_0x3d328a,_0x32e475){return function(_0x406e59){if(_0x406e59){return _0x406e59[_0xd8e7('0x23')](_0x3d328a)[_0xd8e7('0x24')](function(_0x3859d4){return _0x3859d4;});}return null;};}function removeEntity(_0x3152db,_0x497b2d){return function(_0x2d5f73){if(_0x2d5f73){return _0x2d5f73[_0xd8e7('0x25')]()[_0xd8e7('0x24')](function(){_0x3152db[_0xd8e7('0x1a')](0xcc)[_0xd8e7('0x19')]();});}};}function handleEntityNotFound(_0x4db2f,_0x10bfa8){return function(_0x269be3){if(!_0x269be3){_0x4db2f[_0xd8e7('0x18')](0x194);}return _0x269be3;};}function handleError(_0x138e6e,_0x4cb8a9){_0x4cb8a9=_0x4cb8a9||0x1f4;return function(_0x50e064){logger['error'](_0x50e064[_0xd8e7('0x26')]);if(_0x50e064[_0xd8e7('0x27')]){delete _0x50e064[_0xd8e7('0x27')];}_0x138e6e['status'](_0x4cb8a9)[_0xd8e7('0x28')](_0x50e064);};}exports[_0xd8e7('0x23')]=function(_0x5e2668,_0x3baf58){if(_0x5e2668[_0xd8e7('0x29')]['id']){delete _0x5e2668[_0xd8e7('0x29')]['id'];}return db[_0xd8e7('0x2a')][_0xd8e7('0x2b')]({'where':{'id':_0x5e2668[_0xd8e7('0x2c')]['id']}})['then'](handleEntityNotFound(_0x3baf58,null))[_0xd8e7('0x24')](saveUpdates(_0x5e2668[_0xd8e7('0x29')],null))[_0xd8e7('0x24')](respondWithResult(_0x3baf58,null))['catch'](handleError(_0x3baf58,null));};exports[_0xd8e7('0x25')]=function(_0xf33e77,_0x5275bb){return db[_0xd8e7('0x2a')][_0xd8e7('0x2b')]({'where':{'id':_0xf33e77[_0xd8e7('0x2c')]['id']}})['then'](handleEntityNotFound(_0x5275bb,null))['then'](removeEntity(_0x5275bb,null))[_0xd8e7('0x2d')](handleError(_0x5275bb,null));};
\ No newline at end of file
+var _0x7636=['destroy','error','name','send','body','Action','find','params','catch','rimraf','zip-dir','request-promise','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then'];(function(_0x55d58f,_0x2bea83){var _0x1ad6e6=function(_0x31447e){while(--_0x31447e){_0x55d58f['push'](_0x55d58f['shift']());}};_0x1ad6e6(++_0x2bea83);}(_0x7636,0xc1));var _0x6763=function(_0xa5bd84,_0x287943){_0xa5bd84=_0xa5bd84-0x0;var _0x22bcca=_0x7636[_0xa5bd84];return _0x22bcca;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6763('0x0'));var zipdir=require(_0x6763('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6763('0x2'));var moment=require('moment');var BPromise=require(_0x6763('0x3'));var Mustache=require('mustache');var util=require(_0x6763('0x4'));var path=require(_0x6763('0x5'));var sox=require(_0x6763('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6763('0x7'));var _=require(_0x6763('0x8'));var squel=require(_0x6763('0x9'));var crypto=require(_0x6763('0xa'));var jsforce=require(_0x6763('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6763('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x6763('0xd'));var as=require(_0x6763('0xe'));var hardwareService=require(_0x6763('0xf'));var logger=require(_0x6763('0x10'))(_0x6763('0x11'));var utils=require(_0x6763('0x12'));var config=require(_0x6763('0x13'));var licenseUtil=require(_0x6763('0x14'));var db=require(_0x6763('0x15'))['db'];function respondWithStatusCode(_0x2ed61b,_0x2056ba){_0x2056ba=_0x2056ba||0xcc;return function(_0x31bec9){if(_0x31bec9){return _0x2ed61b[_0x6763('0x16')](_0x2056ba);}return _0x2ed61b['status'](_0x2056ba)[_0x6763('0x17')]();};}function respondWithResult(_0x2c9733,_0x37f113){_0x37f113=_0x37f113||0xc8;return function(_0x128440){if(_0x128440){return _0x2c9733['status'](_0x37f113)[_0x6763('0x18')](_0x128440);}};}function respondWithFilteredResult(_0x5d08d2,_0xf53bcb){return function(_0x1a7eda){if(_0x1a7eda){var _0x3db698=typeof _0xf53bcb[_0x6763('0x19')]===_0x6763('0x1a')&&typeof _0xf53bcb[_0x6763('0x1b')]===_0x6763('0x1a');var _0x5ce971=_0x1a7eda['count'];var _0x374cb6=_0x3db698?0x0:_0xf53bcb['offset'];var _0x524991=_0x3db698?_0x1a7eda[_0x6763('0x1c')]:_0xf53bcb[_0x6763('0x19')]+_0xf53bcb['limit'];var _0x21caae;if(_0x524991>=_0x5ce971){_0x524991=_0x5ce971;_0x21caae=0xc8;}else{_0x21caae=0xce;}_0x5d08d2[_0x6763('0x1d')](_0x21caae);return _0x5d08d2[_0x6763('0x1e')](_0x6763('0x1f'),_0x374cb6+'-'+_0x524991+'/'+_0x5ce971)['json'](_0x1a7eda);}return null;};}function patchUpdates(_0x151100){return function(_0x1707ea){try{jsonpatch[_0x6763('0x20')](_0x1707ea,_0x151100,!![]);}catch(_0x26ed31){return BPromise[_0x6763('0x21')](_0x26ed31);}return _0x1707ea[_0x6763('0x22')]();};}function saveUpdates(_0x392608,_0x5ee34f){return function(_0x926ebd){if(_0x926ebd){return _0x926ebd[_0x6763('0x23')](_0x392608)[_0x6763('0x24')](function(_0x219a71){return _0x219a71;});}return null;};}function removeEntity(_0x165140,_0xa2e39e){return function(_0x5dd420){if(_0x5dd420){return _0x5dd420[_0x6763('0x25')]()[_0x6763('0x24')](function(){_0x165140[_0x6763('0x1d')](0xcc)[_0x6763('0x17')]();});}};}function handleEntityNotFound(_0x315f9d,_0x338d23){return function(_0x5e84a){if(!_0x5e84a){_0x315f9d['sendStatus'](0x194);}return _0x5e84a;};}function handleError(_0x47786a,_0x33e0c3){_0x33e0c3=_0x33e0c3||0x1f4;return function(_0x3230f0){logger[_0x6763('0x26')](_0x3230f0['stack']);if(_0x3230f0[_0x6763('0x27')]){delete _0x3230f0[_0x6763('0x27')];}_0x47786a[_0x6763('0x1d')](_0x33e0c3)[_0x6763('0x28')](_0x3230f0);};}exports[_0x6763('0x23')]=function(_0x109d1a,_0x2d67ca){if(_0x109d1a['body']['id']){delete _0x109d1a[_0x6763('0x29')]['id'];}return db[_0x6763('0x2a')][_0x6763('0x2b')]({'where':{'id':_0x109d1a[_0x6763('0x2c')]['id']}})['then'](handleEntityNotFound(_0x2d67ca,null))['then'](saveUpdates(_0x109d1a[_0x6763('0x29')],null))[_0x6763('0x24')](respondWithResult(_0x2d67ca,null))[_0x6763('0x2d')](handleError(_0x2d67ca,null));};exports[_0x6763('0x25')]=function(_0x22fdef,_0x5eb179){return db[_0x6763('0x2a')][_0x6763('0x2b')]({'where':{'id':_0x22fdef[_0x6763('0x2c')]['id']}})['then'](handleEntityNotFound(_0x5eb179,null))[_0x6763('0x24')](removeEntity(_0x5eb179,null))[_0x6763('0x2d')](handleError(_0x5eb179,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 518138b..2033625 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 _0x880e=['moment','bluebird','path','../../config/environment','./action.attributes','Action','lodash','../../config/logger','api'];(function(_0x3a0f77,_0x39f605){var _0x54fd0c=function(_0x46208c){while(--_0x46208c){_0x3a0f77['push'](_0x3a0f77['shift']());}};_0x54fd0c(++_0x39f605);}(_0x880e,0x180));var _0xe880=function(_0x37ffea,_0x25b006){_0x37ffea=_0x37ffea-0x0;var _0x2e2615=_0x880e[_0x37ffea];return _0x2e2615;};'use strict';var _=require(_0xe880('0x0'));var util=require('util');var logger=require(_0xe880('0x1'))(_0xe880('0x2'));var moment=require(_0xe880('0x3'));var BPromise=require(_0xe880('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe880('0x5'));var rimraf=require('rimraf');var config=require(_0xe880('0x6'));var attributes=require(_0xe880('0x7'));module['exports']=function(_0x26739b,_0x475649){return _0x26739b['define'](_0xe880('0x8'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4f8f=['path','./action.attributes','define','Action','tools_actions','util','moment','request-promise'];(function(_0x110b2e,_0x29d7d9){var _0x351f1d=function(_0xe80206){while(--_0xe80206){_0x110b2e['push'](_0x110b2e['shift']());}};_0x351f1d(++_0x29d7d9);}(_0x4f8f,0x175));var _0xf4f8=function(_0x3a6d28,_0x20bae7){_0x3a6d28=_0x3a6d28-0x0;var _0x56622e=_0x4f8f[_0x3a6d28];return _0x56622e;};'use strict';var _=require('lodash');var util=require(_0xf4f8('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xf4f8('0x1'));var BPromise=require('bluebird');var rp=require(_0xf4f8('0x2'));var fs=require('fs');var path=require(_0xf4f8('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf4f8('0x4'));module['exports']=function(_0x22d252,_0x409b25){return _0x22d252[_0xf4f8('0x5')](_0xf4f8('0x6'),attributes,{'tableName':_0xf4f8('0x7'),'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 10f9692..ae85351 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 _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x305245,_0x16436){var _0x209d05=function(_0x5a66ba){while(--_0x5a66ba){_0x305245['push'](_0x305245['shift']());}};_0x209d05(++_0x16436);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x49a2f7,_0x1602a3){_0x49a2f7=_0x49a2f7-0x0;var _0x1d015b=_0x7fbe[_0x49a2f7];return _0x1d015b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});}
\ No newline at end of file
+var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x1cb9,0x14e));var _0x91cb=function(_0x1f4b2f,_0x35e603){_0x1f4b2f=_0x1f4b2f-0x0;var _0x15d535=_0x1cb9[_0x1f4b2f];return _0x15d535;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Action,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index cf8616c..6a64c3e 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 _0x2083=['update','delete','isAuthenticated','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id'];(function(_0x415ccf,_0xe2f752){var _0x5603ad=function(_0x25a03c){while(--_0x25a03c){_0x415ccf['push'](_0x415ccf['shift']());}};_0x5603ad(++_0xe2f752);}(_0x2083,0x1a8));var _0x3208=function(_0x5a8d27,_0x188425){_0x5a8d27=_0x5a8d27-0x0;var _0x52dfa5=_0x2083[_0x5a8d27];return _0x52dfa5;};'use strict';var multer=require(_0x3208('0x0'));var util=require(_0x3208('0x1'));var path=require(_0x3208('0x2'));var timeout=require(_0x3208('0x3'));var express=require(_0x3208('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3208('0x5'));var interaction=require(_0x3208('0x6'));var config=require(_0x3208('0x7'));var controller=require(_0x3208('0x8'));router[_0x3208('0x9')](_0x3208('0xa'),auth['isAuthenticated'](),controller[_0x3208('0xb')]);router[_0x3208('0xc')](_0x3208('0xa'),auth[_0x3208('0xd')](),controller[_0x3208('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x3f78=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','delete','/:id'];(function(_0x284e85,_0x1bfec9){var _0x59ba3d=function(_0x559559){while(--_0x559559){_0x284e85['push'](_0x284e85['shift']());}};_0x59ba3d(++_0x1bfec9);}(_0x3f78,0x197));var _0x83f7=function(_0x4aa4e6,_0x278c45){_0x4aa4e6=_0x4aa4e6-0x0;var _0x322588=_0x3f78[_0x4aa4e6];return _0x322588;};'use strict';var multer=require(_0x83f7('0x0'));var util=require(_0x83f7('0x1'));var path=require(_0x83f7('0x2'));var timeout=require('connect-timeout');var express=require(_0x83f7('0x3'));var router=express[_0x83f7('0x4')]();var fs_extra=require(_0x83f7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x83f7('0x6'));var config=require(_0x83f7('0x7'));var controller=require(_0x83f7('0x8'));router[_0x83f7('0x9')]('/:id',auth[_0x83f7('0xa')](),controller['update']);router[_0x83f7('0xb')](_0x83f7('0xc'),auth['isAuthenticated'](),controller[_0x83f7('0xd')]);module[_0x83f7('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index c5021f0..ee9a59b 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 _0x7dfd=['STRING','TEXT','sequelize','exports'];(function(_0x3d12ef,_0x70f9f7){var _0x44ec06=function(_0x425065){while(--_0x425065){_0x3d12ef['push'](_0x3d12ef['shift']());}};_0x44ec06(++_0x70f9f7);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'name':{'type':Sequelize[_0xd7df('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd7df('0x2')]},'parent':{'type':Sequelize[_0xd7df('0x2')]},'table':{'type':Sequelize[_0xd7df('0x2')]},'conditions':{'type':Sequelize[_0xd7df('0x3')]},'joins':{'type':Sequelize[_0xd7df('0x3')]}};
\ No newline at end of file
+var _0xd8fb=['TEXT','sequelize','exports','STRING'];(function(_0x45b156,_0x3bbece){var _0x4c2ffd=function(_0xdb44db){while(--_0xdb44db){_0x45b156['push'](_0x45b156['shift']());}};_0x4c2ffd(++_0x3bbece);}(_0xd8fb,0x99));var _0xbd8f=function(_0x8905f2,_0x2d92a8){_0x8905f2=_0x8905f2-0x0;var _0xe7bbd6=_0xd8fb[_0x8905f2];return _0xe7bbd6;};'use strict';var Sequelize=require(_0xbd8f('0x0'));module[_0xbd8f('0x1')]={'name':{'type':Sequelize[_0xbd8f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xbd8f('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xbd8f('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 50c12be..64930b3 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 _0x23c6=['key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','includeAll','rows','show','include','options','catch','create','user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','function','replace','format','groupBy','DESC','alias','parse','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','COUNT(%s)','MIN(%s)','includes','IS\x20EMPTY','operator','value','ValidationErrorItem','metric','orderBy','output','web','fullPath','%s-%s.%s','csv','custom','AnalyticExtractedReport','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','runReport','IS\x20NULL','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','end','error','stack','name','AnalyticCustomReport','rawAttributes','fieldName','type'];(function(_0x280f4a,_0x2ed8d6){var _0x1bb157=function(_0x37de94){while(--_0x37de94){_0x280f4a['push'](_0x280f4a['shift']());}};_0x1bb157(++_0x2ed8d6);}(_0x23c6,0x118));var _0x623c=function(_0x5a29fd,_0x804af5){_0x5a29fd=_0x5a29fd-0x0;var _0x1c60e2=_0x23c6[_0x5a29fd];return _0x1c60e2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x623c('0x0'));var zipdir=require(_0x623c('0x1'));var jsonpatch=require(_0x623c('0x2'));var rp=require(_0x623c('0x3'));var moment=require(_0x623c('0x4'));var BPromise=require(_0x623c('0x5'));var Mustache=require(_0x623c('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x623c('0x7'));var ejs=require(_0x623c('0x8'));var fs=require('fs');var fs_extra=require(_0x623c('0x9'));var _=require('lodash');var squel=require(_0x623c('0xa'));var crypto=require(_0x623c('0xb'));var jsforce=require(_0x623c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x623c('0x7'));var querystring=require(_0x623c('0xd'));var Papa=require(_0x623c('0xe'));var Redis=require(_0x623c('0xf'));var authService=require(_0x623c('0x10'));var qs=require(_0x623c('0x11'));var as=require(_0x623c('0x12'));var hardwareService=require(_0x623c('0x13'));var logger=require(_0x623c('0x14'))(_0x623c('0x15'));var utils=require(_0x623c('0x16'));var config=require(_0x623c('0x17'));var licenseUtil=require(_0x623c('0x18'));var db=require(_0x623c('0x19'))['db'];var dbH=require(_0x623c('0x19'))['dbH'];function respondWithStatusCode(_0x50e490,_0x262626){_0x262626=_0x262626||0xcc;return function(_0x136b37){if(_0x136b37){return _0x50e490['sendStatus'](_0x262626);}return _0x50e490[_0x623c('0x1a')](_0x262626)['end']();};}function respondWithResult(_0x464adf,_0x332bde){_0x332bde=_0x332bde||0xc8;return function(_0x3e9ba8){if(_0x3e9ba8){return _0x464adf[_0x623c('0x1a')](_0x332bde)['json'](_0x3e9ba8);}};}function respondWithFilteredResult(_0x38794c,_0x4c0e71){return function(_0x243d2a){if(_0x243d2a){var _0x5b4ada=typeof _0x4c0e71[_0x623c('0x1b')]===_0x623c('0x1c')&&typeof _0x4c0e71[_0x623c('0x1d')]===_0x623c('0x1c');var _0x218cf1=_0x243d2a['count'];var _0x16b13f=_0x5b4ada?0x0:_0x4c0e71[_0x623c('0x1b')];var _0x190f9c=_0x5b4ada?_0x243d2a[_0x623c('0x1e')]:_0x4c0e71['offset']+_0x4c0e71[_0x623c('0x1d')];var _0x55b6e6;if(_0x190f9c>=_0x218cf1){_0x190f9c=_0x218cf1;_0x55b6e6=0xc8;}else{_0x55b6e6=0xce;}_0x38794c['status'](_0x55b6e6);return _0x38794c[_0x623c('0x1f')]('Content-Range',_0x16b13f+'-'+_0x190f9c+'/'+_0x218cf1)[_0x623c('0x20')](_0x243d2a);}return null;};}function patchUpdates(_0x4461b8){return function(_0x5733b7){try{jsonpatch[_0x623c('0x21')](_0x5733b7,_0x4461b8,!![]);}catch(_0x98d530){return BPromise[_0x623c('0x22')](_0x98d530);}return _0x5733b7[_0x623c('0x23')]();};}function saveUpdates(_0x4355af,_0x53ee21){return function(_0x13cfaa){if(_0x13cfaa){return _0x13cfaa[_0x623c('0x24')](_0x4355af)[_0x623c('0x25')](function(_0x135585){return _0x135585;});}return null;};}function removeEntity(_0x1acb55,_0x10b663){return function(_0x3fdc45){if(_0x3fdc45){return _0x3fdc45[_0x623c('0x26')]()[_0x623c('0x25')](function(){var _0x47e508=_0x3fdc45[_0x623c('0x27')]({'plain':!![]});var _0x17016b=_0x623c('0x28');return db[_0x623c('0x29')][_0x623c('0x26')]({'where':{'type':_0x17016b,'resourceId':_0x47e508['id']}})['then'](function(){return _0x3fdc45;});})['then'](function(){_0x1acb55[_0x623c('0x1a')](0xcc)[_0x623c('0x2a')]();});}};}function handleEntityNotFound(_0x5ec397,_0x393af5){return function(_0x2117d2){if(!_0x2117d2){_0x5ec397['sendStatus'](0x194);}return _0x2117d2;};}function handleError(_0x4725d8,_0x249895){_0x249895=_0x249895||0x1f4;return function(_0x1e2cf5){logger[_0x623c('0x2b')](_0x1e2cf5[_0x623c('0x2c')]);if(_0x1e2cf5[_0x623c('0x2d')]){delete _0x1e2cf5[_0x623c('0x2d')];}_0x4725d8['status'](_0x249895)['send'](_0x1e2cf5);};}exports['index']=function(_0x4a27f6,_0x37ad36){var _0x2e3ad9={},_0x47edff={},_0x26bd90={'count':0x0,'rows':[]};var _0x51df92=_['map'](db[_0x623c('0x2e')][_0x623c('0x2f')],function(_0x4a0e0c){return{'name':_0x4a0e0c[_0x623c('0x30')],'type':_0x4a0e0c[_0x623c('0x31')][_0x623c('0x32')]};});_0x47edff[_0x623c('0x33')]=_['map'](_0x51df92,_0x623c('0x2d'));_0x47edff[_0x623c('0x34')]=_[_0x623c('0x35')](_0x4a27f6['query']);_0x47edff['filters']=_[_0x623c('0x36')](_0x47edff[_0x623c('0x33')],_0x47edff[_0x623c('0x34')]);_0x2e3ad9['attributes']=_[_0x623c('0x36')](_0x47edff['model'],qs[_0x623c('0x37')](_0x4a27f6['query'][_0x623c('0x37')]));_0x2e3ad9[_0x623c('0x38')]=_0x2e3ad9[_0x623c('0x38')][_0x623c('0x39')]?_0x2e3ad9[_0x623c('0x38')]:_0x47edff['model'];if(!_0x4a27f6[_0x623c('0x34')][_0x623c('0x3a')](_0x623c('0x3b'))){_0x2e3ad9[_0x623c('0x1d')]=qs['limit'](_0x4a27f6['query'][_0x623c('0x1d')]);_0x2e3ad9[_0x623c('0x1b')]=qs['offset'](_0x4a27f6[_0x623c('0x34')]['offset']);}_0x2e3ad9[_0x623c('0x3c')]=qs[_0x623c('0x3d')](_0x4a27f6[_0x623c('0x34')][_0x623c('0x3d')]);_0x2e3ad9[_0x623c('0x3e')]=qs[_0x623c('0x3f')](_[_0x623c('0x40')](_0x4a27f6[_0x623c('0x34')],_0x47edff['filters']),_0x51df92);if(_0x4a27f6[_0x623c('0x34')][_0x623c('0x41')]){_0x2e3ad9[_0x623c('0x3e')]=_[_0x623c('0x42')](_0x2e3ad9[_0x623c('0x3e')],{'$or':_[_0x623c('0x43')](_0x51df92,function(_0x173690){if(_0x173690[_0x623c('0x31')]!=='VIRTUAL'){var _0xd8b4e2={};_0xd8b4e2[_0x173690['name']]={'$like':'%'+_0x4a27f6[_0x623c('0x34')][_0x623c('0x41')]+'%'};return _0xd8b4e2;}})});}_0x2e3ad9=_['merge']({},_0x2e3ad9,_0x4a27f6['options']);var _0x12b377={'where':_0x2e3ad9[_0x623c('0x3e')]};return db[_0x623c('0x2e')][_0x623c('0x1e')](_0x12b377)[_0x623c('0x25')](function(_0x52132c){_0x26bd90[_0x623c('0x1e')]=_0x52132c;if(_0x4a27f6['query'][_0x623c('0x44')]){_0x2e3ad9['include']=[{'all':!![]}];}return db[_0x623c('0x2e')]['findAll'](_0x2e3ad9);})[_0x623c('0x25')](function(_0x3f0a1d){_0x26bd90[_0x623c('0x45')]=_0x3f0a1d;return _0x26bd90;})[_0x623c('0x25')](respondWithFilteredResult(_0x37ad36,_0x2e3ad9))['catch'](handleError(_0x37ad36,null));};exports[_0x623c('0x46')]=function(_0x46251d,_0x276193){var _0xa96730={'raw':![],'where':{'id':_0x46251d['params']['id']}},_0x486dd9={};_0x486dd9[_0x623c('0x33')]=_[_0x623c('0x35')](db[_0x623c('0x2e')][_0x623c('0x2f')]);_0x486dd9[_0x623c('0x34')]=_[_0x623c('0x35')](_0x46251d[_0x623c('0x34')]);_0x486dd9[_0x623c('0x3f')]=_[_0x623c('0x36')](_0x486dd9[_0x623c('0x33')],_0x486dd9[_0x623c('0x34')]);_0xa96730[_0x623c('0x38')]=_[_0x623c('0x36')](_0x486dd9[_0x623c('0x33')],qs['fields'](_0x46251d['query']['fields']));_0xa96730['attributes']=_0xa96730[_0x623c('0x38')][_0x623c('0x39')]?_0xa96730[_0x623c('0x38')]:_0x486dd9[_0x623c('0x33')];if(_0x46251d[_0x623c('0x34')][_0x623c('0x44')]){_0xa96730[_0x623c('0x47')]=[{'all':!![]}];}_0xa96730=_[_0x623c('0x42')]({},_0xa96730,_0x46251d[_0x623c('0x48')]);return db[_0x623c('0x2e')]['find'](_0xa96730)[_0x623c('0x25')](handleEntityNotFound(_0x276193,null))[_0x623c('0x25')](respondWithResult(_0x276193,null))[_0x623c('0x49')](handleError(_0x276193,null));};exports[_0x623c('0x4a')]=function(_0x4cd015,_0x12cc37){return db['AnalyticCustomReport'][_0x623c('0x4a')](_0x4cd015['body'],{})['then'](function(_0x3d9ab2){var _0x1e0ca0=_0x4cd015[_0x623c('0x4b')]['get']({'plain':!![]});if(!_0x1e0ca0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e0ca0[_0x623c('0x4c')]===_0x623c('0x4b')){var _0x231e28=_0x3d9ab2['get']({'plain':!![]});var _0x3de2c2=_0x623c('0x4d');return db[_0x623c('0x4e')][_0x623c('0x4f')]({'where':{'name':_0x3de2c2,'userProfileId':_0x1e0ca0[_0x623c('0x50')]},'raw':!![]})[_0x623c('0x25')](function(_0x57d77b){if(_0x57d77b&&_0x57d77b[_0x623c('0x51')]===0x0){return db['UserProfileResource'][_0x623c('0x4a')]({'name':_0x231e28[_0x623c('0x2d')],'resourceId':_0x231e28['id'],'type':_0x623c('0x28'),'sectionId':_0x57d77b['id']},{})['then'](function(){return _0x3d9ab2;});}else{return _0x3d9ab2;}})[_0x623c('0x49')](function(_0x5ce04d){logger[_0x623c('0x2b')](_0x623c('0x52'),_0x5ce04d);throw _0x5ce04d;});}return _0x3d9ab2;})['then'](respondWithResult(_0x12cc37,0xc9))[_0x623c('0x49')](handleError(_0x12cc37,null));};exports[_0x623c('0x24')]=function(_0x5b73a2,_0x3d336d){if(_0x5b73a2[_0x623c('0x53')]['id']){delete _0x5b73a2['body']['id'];}return db['AnalyticCustomReport'][_0x623c('0x4f')]({'where':{'id':_0x5b73a2[_0x623c('0x54')]['id']}})[_0x623c('0x25')](handleEntityNotFound(_0x3d336d,null))[_0x623c('0x25')](saveUpdates(_0x5b73a2[_0x623c('0x53')],null))[_0x623c('0x25')](respondWithResult(_0x3d336d,null))['catch'](handleError(_0x3d336d,null));};exports[_0x623c('0x26')]=function(_0x27f353,_0x262b29){return db[_0x623c('0x2e')][_0x623c('0x4f')]({'where':{'id':_0x27f353[_0x623c('0x54')]['id']}})[_0x623c('0x25')](handleEntityNotFound(_0x262b29,null))['then'](removeEntity(_0x262b29,null))[_0x623c('0x49')](handleError(_0x262b29,null));};exports[_0x623c('0x55')]=function(_0x45806a,_0x443791){var _0x549aa0=0xa;var _0x1505c0=[_0x623c('0x56'),'left_join',_0x623c('0x57'),_0x623c('0x58')];var _0x3fc1cd={'SUM':_0x623c('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x623c('0x5a'),'MAX':_0x623c('0x5b'),'MIN':'MIN(%s)','AVG':_0x623c('0x5c'),'GROUP_CONCAT':_0x623c('0x5d'),'GROUP_CONCAT ASC':_0x623c('0x5e'),'GROUP_CONCAT DESC':_0x623c('0x5f')};var _0x3ae0ed={'SEC_TO_TIME':_0x623c('0x60'),'DATE':_0x623c('0x61'),'HOUR':_0x623c('0x62'),'ROUND':_0x623c('0x63'),'UNIX_TIMESTAMP':_0x623c('0x64')};var _0x32cd1b=function(_0x11377e){return!_['includes'](['IS\x20NULL',_0x623c('0x65'),'IS\x20EMPTY',_0x623c('0x66')],_0x11377e);};var _0x1c1f19=function(_0x5535f1){if(!_0x5535f1||!_0x5535f1[_0x623c('0x67')][_0x623c('0x39')]){return'';}for(var _0x44c611='(',_0x12d9c0=0x0;_0x12d9c0<_0x5535f1['rules'][_0x623c('0x39')];_0x12d9c0+=0x1){_0x12d9c0>0x0&&(_0x44c611+='\x20'+_0x5535f1['operator']+'\x20');_0x44c611+=_0x5535f1[_0x623c('0x67')][_0x12d9c0][_0x623c('0x68')]?_0x1c1f19(_0x5535f1[_0x623c('0x67')][_0x12d9c0][_0x623c('0x68')]):_0x5535f1[_0x623c('0x67')][_0x12d9c0][_0x623c('0x69')]+'\x20'+_0x5535f1[_0x623c('0x67')][_0x12d9c0][_0x623c('0x6a')]+(_0x32cd1b(_0x5535f1[_0x623c('0x67')][_0x12d9c0][_0x623c('0x6a')])?'\x20'+_0x5535f1[_0x623c('0x67')][_0x12d9c0]['value']:'');}return _0x44c611+')';};var _0x54eae6={'where':{'id':_0x45806a[_0x623c('0x54')]['id']}},_0x25dac9,_0x391757,_0x11e52d,_0xb19406,_0x27df96;_0x54eae6=_['merge']({},_0x54eae6,_0x45806a[_0x623c('0x48')]);return db[_0x623c('0x2e')][_0x623c('0x4f')](_0x54eae6)['then'](function(_0xcffd6f){if(_0xcffd6f){_0x25dac9=_0xcffd6f;return _0xcffd6f[_0x623c('0x6b')]();}return null;})[_0x623c('0x25')](function(_0x1ddee3){if(_0x1ddee3){if(!_0x1ddee3['length']){throw new db[(_0x623c('0x6c'))]['ValidationErrorItem'](_0x623c('0x6d'),0x193);}_0x391757=_0x1ddee3;return db[_0x623c('0x6e')][_0x623c('0x6f')]({'raw':!![]});}return null;})[_0x623c('0x25')](function(_0x50dd1e){if(_0x50dd1e){_0x11e52d=_[_0x623c('0x70')](_0x50dd1e,'id');var _0x108f8a;var _0x1ac25c=squel[_0x623c('0x71')]();_0x1ac25c[_0x623c('0x72')](_0x25dac9[_0x623c('0x73')]);for(var _0x5d5d39=0x0;_0x5d5d39<_0x391757['length'];_0x5d5d39+=0x1){_0x108f8a=_0x391757[_0x5d5d39][_0x623c('0x74')]?_0x11e52d[_0x391757[_0x5d5d39][_0x623c('0x74')]]['metric']:_0x391757[_0x5d5d39][_0x623c('0x69')];_0x108f8a=_0x391757[_0x5d5d39][_0x623c('0x75')]?_['replace'](_0x3fc1cd[_0x391757[_0x5d5d39]['function']],'%s',_0x108f8a):_0x108f8a;_0x108f8a=_0x391757[_0x5d5d39]['format']?_[_0x623c('0x76')](_0x3ae0ed[_0x391757[_0x5d5d39][_0x623c('0x77')]],'%s',_0x108f8a):_0x108f8a;if(_0x391757[_0x5d5d39][_0x623c('0x78')]){_0x1ac25c['group'](_0x108f8a);}_0x391757[_0x5d5d39]['orderBy']&&_0x1ac25c['order'](_0x108f8a,_0x391757[_0x5d5d39]['orderBy']===_0x623c('0x79')?![]:!![]);_0x1ac25c[_0x623c('0x69')](_0x108f8a,_0x391757[_0x5d5d39][_0x623c('0x7a')]||_0x108f8a);}if(_0x25dac9['joins']){_0x25dac9['joins']=JSON[_0x623c('0x7b')](_0x25dac9[_0x623c('0x7c')]);for(var _0x3791bb=0x0;_0x3791bb<_0x25dac9['joins']['length'];_0x3791bb+=0x1){if(_0x25dac9[_0x623c('0x7c')][_0x3791bb][_0x623c('0x31')]&&_['includes'](_0x1505c0,_0x25dac9[_0x623c('0x7c')][_0x3791bb]['type'])&&_0x25dac9[_0x623c('0x7c')][_0x3791bb][_0x623c('0x7d')]&&_0x25dac9[_0x623c('0x7c')][_0x3791bb][_0x623c('0x7e')]&&_0x25dac9[_0x623c('0x7c')][_0x3791bb][_0x623c('0x7f')]){_0x1ac25c[_0x25dac9[_0x623c('0x7c')][_0x3791bb][_0x623c('0x31')]](_0x25dac9[_0x623c('0x7c')][_0x3791bb]['foreignTable'],null,util[_0x623c('0x77')](_0x623c('0x80'),_0x25dac9['table'],_0x25dac9['joins'][_0x3791bb][_0x623c('0x7d')],_0x25dac9['joins'][_0x3791bb][_0x623c('0x7e')],_0x25dac9[_0x623c('0x7c')][_0x3791bb][_0x623c('0x7f')]));}}}if(_0x25dac9[_0x623c('0x81')]){_0x25dac9[_0x623c('0x81')]=JSON[_0x623c('0x7b')](_0x25dac9[_0x623c('0x81')]);_0x1ac25c[_0x623c('0x3e')](_0x1c1f19(_0x25dac9[_0x623c('0x81')]['group']));}_0x27df96=_0x1ac25c[_0x623c('0x82')]();_0x1ac25c['limit'](_0x549aa0);_0x1ac25c[_0x623c('0x1b')](0x0);logger[_0x623c('0x83')](_0x623c('0x84'),_0x1ac25c[_0x623c('0x85')]());return dbH['sequelize'][_0x623c('0x34')](_0x1ac25c[_0x623c('0x85')](),{'type':dbH[_0x623c('0x86')][_0x623c('0x87')][_0x623c('0x88')]});}})[_0x623c('0x25')](respondWithResult(_0x443791,null))[_0x623c('0x49')](handleError(_0x443791,null));};function runReport(_0x5bbca8,_0x40ed23,_0x11e303){var _0x42321d=_0x40ed23['name'];var _0x5d398a=0xa;var _0x3ae76b=['join',_0x623c('0x89'),_0x623c('0x57'),'cross_join'];var _0x805993={'SUM':'SUM(%s)','COUNT':_0x623c('0x8a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x623c('0x5b'),'MIN':_0x623c('0x8b'),'AVG':_0x623c('0x5c'),'GROUP_CONCAT':_0x623c('0x5d'),'GROUP_CONCAT ASC':_0x623c('0x5e'),'GROUP_CONCAT DESC':_0x623c('0x5f')};var _0x506458={'SEC_TO_TIME':_0x623c('0x60'),'DATE':_0x623c('0x61'),'HOUR':'HOUR(%s)','ROUND':_0x623c('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x520373=function(_0x5ecd2c){return!_[_0x623c('0x8c')](['IS\x20NULL',_0x623c('0x65'),_0x623c('0x8d'),_0x623c('0x66')],_0x5ecd2c);};var _0x1d0466=function(_0x988a77){if(!_0x988a77||!_0x988a77[_0x623c('0x67')][_0x623c('0x39')]){return'';}for(var _0x1602dc='(',_0x2b9694=0x0;_0x2b9694<_0x988a77['rules']['length'];_0x2b9694+=0x1){_0x2b9694>0x0&&(_0x1602dc+='\x20'+_0x988a77[_0x623c('0x8e')]+'\x20');_0x1602dc+=_0x988a77['rules'][_0x2b9694][_0x623c('0x68')]?_0x1d0466(_0x988a77[_0x623c('0x67')][_0x2b9694][_0x623c('0x68')]):_0x988a77['rules'][_0x2b9694][_0x623c('0x69')]+'\x20'+_0x988a77['rules'][_0x2b9694][_0x623c('0x6a')]+(_0x520373(_0x988a77[_0x623c('0x67')][_0x2b9694][_0x623c('0x6a')])?'\x20'+_0x988a77[_0x623c('0x67')][_0x2b9694][_0x623c('0x8f')]:'');}return _0x1602dc+')';};var _0x4c59c8={'where':{'id':_0x5bbca8['id']}},_0x90418e,_0x363e30,_0x5888ff,_0x28b9c3,_0x13bcd6;_0x4c59c8=_['merge']({},_0x4c59c8,_0x11e303);return db[_0x623c('0x2e')][_0x623c('0x4f')](_0x4c59c8)[_0x623c('0x25')](function(_0x29beff){if(_0x29beff){_0x90418e=_0x29beff;return _0x29beff[_0x623c('0x6b')]();}return null;})[_0x623c('0x25')](function(_0xbf90da){if(_0xbf90da){if(!_0xbf90da[_0x623c('0x39')]){throw new db[(_0x623c('0x6c'))][(_0x623c('0x90'))](_0x623c('0x6d'),0x193);}_0x363e30=_0xbf90da;return db[_0x623c('0x6e')][_0x623c('0x6f')]({'raw':!![]});}return null;})[_0x623c('0x25')](function(_0x1f743e){if(_0x1f743e){_0x5888ff=_[_0x623c('0x70')](_0x1f743e,'id');var _0x2b7f25;var _0x287e87=squel['select']();_0x287e87[_0x623c('0x72')](_0x90418e[_0x623c('0x73')]);for(var _0x38b83c=0x0;_0x38b83c<_0x363e30['length'];_0x38b83c+=0x1){_0x2b7f25=_0x363e30[_0x38b83c][_0x623c('0x74')]?_0x5888ff[_0x363e30[_0x38b83c][_0x623c('0x74')]][_0x623c('0x91')]:_0x363e30[_0x38b83c][_0x623c('0x69')];_0x2b7f25=_0x363e30[_0x38b83c]['function']?_[_0x623c('0x76')](_0x805993[_0x363e30[_0x38b83c][_0x623c('0x75')]],'%s',_0x2b7f25):_0x2b7f25;_0x2b7f25=_0x363e30[_0x38b83c][_0x623c('0x77')]?_[_0x623c('0x76')](_0x506458[_0x363e30[_0x38b83c][_0x623c('0x77')]],'%s',_0x2b7f25):_0x2b7f25;if(_0x363e30[_0x38b83c][_0x623c('0x78')]){_0x287e87['group'](_0x2b7f25);}_0x363e30[_0x38b83c]['orderBy']&&_0x287e87['order'](_0x2b7f25,_0x363e30[_0x38b83c][_0x623c('0x92')]===_0x623c('0x79')?![]:!![]);_0x287e87['field'](_0x2b7f25,_0x363e30[_0x38b83c]['alias']||_0x2b7f25);}if(_0x90418e[_0x623c('0x7c')]){_0x90418e[_0x623c('0x7c')]=JSON[_0x623c('0x7b')](_0x90418e[_0x623c('0x7c')]);for(var _0x412fba=0x0;_0x412fba<_0x90418e[_0x623c('0x7c')]['length'];_0x412fba+=0x1){if(_0x90418e['joins'][_0x412fba][_0x623c('0x31')]&&_[_0x623c('0x8c')](_0x3ae76b,_0x90418e[_0x623c('0x7c')][_0x412fba][_0x623c('0x31')])&&_0x90418e[_0x623c('0x7c')][_0x412fba]['parentKey']&&_0x90418e[_0x623c('0x7c')][_0x412fba]['foreignTable']&&_0x90418e[_0x623c('0x7c')][_0x412fba][_0x623c('0x7f')]){_0x287e87[_0x90418e['joins'][_0x412fba]['type']](_0x90418e['joins'][_0x412fba][_0x623c('0x7e')],null,util[_0x623c('0x77')](_0x623c('0x80'),_0x90418e[_0x623c('0x73')],_0x90418e['joins'][_0x412fba][_0x623c('0x7d')],_0x90418e[_0x623c('0x7c')][_0x412fba][_0x623c('0x7e')],_0x90418e[_0x623c('0x7c')][_0x412fba][_0x623c('0x7f')]));}}}if(_0x90418e[_0x623c('0x81')]){_0x90418e['conditions']=JSON['parse'](_0x90418e[_0x623c('0x81')]);_0x287e87[_0x623c('0x3e')](_0x1d0466(_0x90418e[_0x623c('0x81')][_0x623c('0x68')]));}_0x13bcd6=_0x287e87['clone']();_0x287e87['limit'](_0x5d398a);_0x287e87['offset'](0x0);return;}})[_0x623c('0x25')](function(){if(_0x40ed23[_0x623c('0x93')]===_0x623c('0x94')){return null;}var _0x4a8ae5=_['merge'](_0x40ed23,{'name':_0x40ed23[_0x623c('0x95')]||_0x40ed23['name']||_0x90418e['name'],'basename':_0x42321d,'savename':util['format'](_0x623c('0x96'),_0x40ed23[_0x623c('0x2d')]||_0x90418e[_0x623c('0x2d')],require('randomstring')['generate'](0x4),_0x40ed23[_0x623c('0x93')]||_0x623c('0x97')),'reportId':_0x90418e['id'],'reportType':_0x623c('0x98')});return db[_0x623c('0x99')][_0x623c('0x4a')](_0x4a8ae5,{'raw':!![]});})[_0x623c('0x25')](function(_0x5392ae){if(_0x90418e[_0x623c('0x73')]==='cdr'){_0x13bcd6[_0x623c('0x3e')](_0x90418e[_0x623c('0x73')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x40ed23['startDate'],_0x40ed23[_0x623c('0x9a')]);}else{_0x13bcd6['where'](_0x90418e[_0x623c('0x73')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x40ed23['startDate'],_0x40ed23[_0x623c('0x9a')]);}if(_0x5392ae){logger[_0x623c('0x9b')](_0x623c('0x9c'),_0x13bcd6['toString']());require(_0x623c('0x9d'))[_0x623c('0x9e')](path['join'](__dirname,_0x623c('0x9f'),_0x5392ae[_0x623c('0x93')]),[_0x5392ae['id'],_0x13bcd6[_0x623c('0x85')](),path[_0x623c('0x56')](__dirname,_0x623c('0xa0'),_0x5392ae[_0x623c('0xa1')]),_0x42321d]);return _0x5392ae;}else{var _0x37eeed=squel['select']();_0x37eeed[_0x623c('0x72')]('('+_0x13bcd6[_0x623c('0x85')]()+')',_0x623c('0xa2'));_0x37eeed['field']('COUNT(*)',_0x623c('0x1e'));_0x13bcd6[_0x623c('0x1d')](_0x40ed23[_0x623c('0x1d')]||_0x5d398a);_0x13bcd6[_0x623c('0x1b')](_0x40ed23[_0x623c('0x1b')]||0x0);return dbH['sequelize'][_0x623c('0x34')](_0x37eeed[_0x623c('0x85')](),{'type':dbH['sequelize'][_0x623c('0x87')]['SELECT']})[_0x623c('0x25')](function(_0x14ab16){if(!_0x14ab16['length']){_0x28b9c3=0x0;}else{_0x28b9c3=_0x14ab16[0x0][_0x623c('0x1e')]||0x0;}return dbH['sequelize'][_0x623c('0x34')](_0x13bcd6[_0x623c('0x85')](),{'type':dbH[_0x623c('0x86')]['QueryTypes'][_0x623c('0x88')]});})[_0x623c('0x25')](function(_0x2c69d1){return{'rows':_0x2c69d1||[],'count':_0x28b9c3};});}});}exports['run']=function(_0x883579,_0x38aaeb){return runReport(_0x883579[_0x623c('0x54')],_0x883579[_0x623c('0x34')],_0x883579[_0x623c('0x48')])['then'](respondWithResult(_0x38aaeb,null))[_0x623c('0x49')](handleError(_0x38aaeb,null));};exports[_0x623c('0xa3')]=runReport;exports[_0x623c('0x34')]=function(_0x1d496f,_0x568b65){var _0x404d99=0xa;var _0x1fde7c=['join',_0x623c('0x89'),'right_join',_0x623c('0x58')];var _0x3b1bf4={'SUM':_0x623c('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x623c('0x5a'),'MAX':_0x623c('0x5b'),'MIN':_0x623c('0x8b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x623c('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x17e56b={'SEC_TO_TIME':_0x623c('0x60'),'DATE':_0x623c('0x61'),'HOUR':'HOUR(%s)','ROUND':_0x623c('0x63'),'UNIX_TIMESTAMP':_0x623c('0x64')};var _0x37038b=function(_0x4b6102){return!_[_0x623c('0x8c')]([_0x623c('0xa4'),_0x623c('0x65'),'IS\x20EMPTY',_0x623c('0x66')],_0x4b6102);};var _0x592bec=function(_0x169108){if(!_0x169108||!_0x169108[_0x623c('0x67')]['length']){return'';}for(var _0x43617f='(',_0x207c1c=0x0;_0x207c1c<_0x169108['rules'][_0x623c('0x39')];_0x207c1c+=0x1){_0x207c1c>0x0&&(_0x43617f+='\x20'+_0x169108['operator']+'\x20');_0x43617f+=_0x169108[_0x623c('0x67')][_0x207c1c][_0x623c('0x68')]?_0x592bec(_0x169108[_0x623c('0x67')][_0x207c1c][_0x623c('0x68')]):_0x169108[_0x623c('0x67')][_0x207c1c][_0x623c('0x69')]+'\x20'+_0x169108['rules'][_0x207c1c][_0x623c('0x6a')]+(_0x37038b(_0x169108[_0x623c('0x67')][_0x207c1c]['condition'])?'\x20'+_0x169108[_0x623c('0x67')][_0x207c1c][_0x623c('0x8f')]:'');}return _0x43617f+')';};var _0x1d5890={'where':{'id':_0x1d496f['params']['id']}},_0x2e54d4,_0x10094c,_0x4b2738,_0x57a449,_0x2bb0e1;_0x1d5890=_[_0x623c('0x42')]({},_0x1d5890,_0x1d496f[_0x623c('0x48')]);return db['AnalyticCustomReport']['find'](_0x1d5890)['then'](function(_0x5acd64){if(_0x5acd64){_0x2e54d4=_0x5acd64;return _0x5acd64['getFields']();}return null;})[_0x623c('0x25')](function(_0x116257){if(_0x116257){if(!_0x116257[_0x623c('0x39')]){throw new db[(_0x623c('0x6c'))][(_0x623c('0x90'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x10094c=_0x116257;return db[_0x623c('0x6e')]['findAll']({'raw':!![]});}return null;})[_0x623c('0x25')](function(_0x44fac5){if(_0x44fac5){_0x4b2738=_['keyBy'](_0x44fac5,'id');var _0x4506a2;var _0x17e9cd=squel['select']();_0x17e9cd[_0x623c('0x72')](_0x2e54d4[_0x623c('0x73')]);for(var _0x15983a=0x0;_0x15983a<_0x10094c[_0x623c('0x39')];_0x15983a+=0x1){_0x4506a2=_0x10094c[_0x15983a]['MetricId']?_0x4b2738[_0x10094c[_0x15983a][_0x623c('0x74')]][_0x623c('0x91')]:_0x10094c[_0x15983a][_0x623c('0x69')];_0x4506a2=_0x10094c[_0x15983a]['function']?_[_0x623c('0x76')](_0x3b1bf4[_0x10094c[_0x15983a][_0x623c('0x75')]],'%s',_0x4506a2):_0x4506a2;_0x4506a2=_0x10094c[_0x15983a]['format']?_[_0x623c('0x76')](_0x17e56b[_0x10094c[_0x15983a][_0x623c('0x77')]],'%s',_0x4506a2):_0x4506a2;if(_0x10094c[_0x15983a][_0x623c('0x78')]){_0x17e9cd[_0x623c('0x68')](_0x4506a2);}_0x10094c[_0x15983a][_0x623c('0x92')]&&_0x17e9cd['order'](_0x4506a2,_0x10094c[_0x15983a][_0x623c('0x92')]===_0x623c('0x79')?![]:!![]);_0x17e9cd[_0x623c('0x69')](_0x4506a2,_0x10094c[_0x15983a]['alias']||_0x4506a2);}if(_0x2e54d4['joins']){_0x2e54d4['joins']=JSON[_0x623c('0x7b')](_0x2e54d4[_0x623c('0x7c')]);for(var _0x4fbd10=0x0;_0x4fbd10<_0x2e54d4['joins'][_0x623c('0x39')];_0x4fbd10+=0x1){if(_0x2e54d4[_0x623c('0x7c')][_0x4fbd10]['type']&&_[_0x623c('0x8c')](_0x1fde7c,_0x2e54d4[_0x623c('0x7c')][_0x4fbd10][_0x623c('0x31')])&&_0x2e54d4['joins'][_0x4fbd10]['parentKey']&&_0x2e54d4[_0x623c('0x7c')][_0x4fbd10][_0x623c('0x7e')]&&_0x2e54d4[_0x623c('0x7c')][_0x4fbd10][_0x623c('0x7f')]){_0x17e9cd[_0x2e54d4['joins'][_0x4fbd10][_0x623c('0x31')]](_0x2e54d4['joins'][_0x4fbd10][_0x623c('0x7e')],null,util['format'](_0x623c('0x80'),_0x2e54d4[_0x623c('0x73')],_0x2e54d4['joins'][_0x4fbd10]['parentKey'],_0x2e54d4['joins'][_0x4fbd10]['foreignTable'],_0x2e54d4[_0x623c('0x7c')][_0x4fbd10]['foreignKey']));}}}if(_0x2e54d4['conditions']){_0x2e54d4['conditions']=JSON['parse'](_0x2e54d4[_0x623c('0x81')]);_0x17e9cd[_0x623c('0x3e')](_0x592bec(_0x2e54d4[_0x623c('0x81')][_0x623c('0x68')]));}_0x2bb0e1=_0x17e9cd['clone']();_0x17e9cd['limit'](_0x404d99);_0x17e9cd[_0x623c('0x1b')](0x0);logger[_0x623c('0x83')](_0x623c('0x84'),_0x17e9cd[_0x623c('0x85')]());return dbH[_0x623c('0x86')][_0x623c('0x34')](_0x17e9cd[_0x623c('0x85')](),{'type':dbH['sequelize']['QueryTypes'][_0x623c('0x88')]});}})[_0x623c('0x25')](function(){return{'sql':_0x2bb0e1[_0x623c('0x85')]()};})[_0x623c('0x25')](respondWithResult(_0x568b65,null))[_0x623c('0x49')](handleError(_0x568b65,null));};
\ No newline at end of file
+var _0x388a=['IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','select','from','table','MetricId','function','format','replace','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','right_join','IS\x20NULL','IS\x20EMPTY','metric','web','randomstring','generate','output','csv','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','fork','../../files/reports','countTable','COUNT(*)','run','Please\x20insert\x20at\x20least\x20one\x20field','clone','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','end','status','json','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','CustomReports','sendStatus','error','stack','name','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','limit','order','sort','where','pick','filter','merge','options','AnalyticCustomReport','includeAll','include','findAll','rows','catch','show','params','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL'];(function(_0xd12961,_0xe4972){var _0x243c7f=function(_0x4042c4){while(--_0x4042c4){_0xd12961['push'](_0xd12961['shift']());}};_0x243c7f(++_0xe4972);}(_0x388a,0xdc));var _0xa388=function(_0x2409e2,_0x3af17c){_0x2409e2=_0x2409e2-0x0;var _0x9142dd=_0x388a[_0x2409e2];return _0x9142dd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa388('0x0'));var zipdir=require(_0xa388('0x1'));var jsonpatch=require(_0xa388('0x2'));var rp=require(_0xa388('0x3'));var moment=require(_0xa388('0x4'));var BPromise=require(_0xa388('0x5'));var Mustache=require(_0xa388('0x6'));var util=require(_0xa388('0x7'));var path=require(_0xa388('0x8'));var sox=require(_0xa388('0x9'));var csv=require(_0xa388('0xa'));var ejs=require(_0xa388('0xb'));var fs=require('fs');var fs_extra=require(_0xa388('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa388('0xa'));var querystring=require(_0xa388('0xd'));var Papa=require(_0xa388('0xe'));var Redis=require(_0xa388('0xf'));var authService=require(_0xa388('0x10'));var qs=require(_0xa388('0x11'));var as=require(_0xa388('0x12'));var hardwareService=require(_0xa388('0x13'));var logger=require('../../config/logger')(_0xa388('0x14'));var utils=require(_0xa388('0x15'));var config=require(_0xa388('0x16'));var licenseUtil=require(_0xa388('0x17'));var db=require(_0xa388('0x18'))['db'];var dbH=require(_0xa388('0x18'))[_0xa388('0x19')];function respondWithStatusCode(_0x32abba,_0x519048){_0x519048=_0x519048||0xcc;return function(_0x198080){if(_0x198080){return _0x32abba['sendStatus'](_0x519048);}return _0x32abba['status'](_0x519048)[_0xa388('0x1a')]();};}function respondWithResult(_0x36f8eb,_0x41c24b){_0x41c24b=_0x41c24b||0xc8;return function(_0x5c37f1){if(_0x5c37f1){return _0x36f8eb[_0xa388('0x1b')](_0x41c24b)[_0xa388('0x1c')](_0x5c37f1);}};}function respondWithFilteredResult(_0xb5a97f,_0xe3ceba){return function(_0x2fc09f){if(_0x2fc09f){var _0x12cfce=typeof _0xe3ceba[_0xa388('0x1d')]==='undefined'&&typeof _0xe3ceba['limit']===_0xa388('0x1e');var _0x882070=_0x2fc09f['count'];var _0x5c8889=_0x12cfce?0x0:_0xe3ceba[_0xa388('0x1d')];var _0x5940ee=_0x12cfce?_0x2fc09f[_0xa388('0x1f')]:_0xe3ceba[_0xa388('0x1d')]+_0xe3ceba['limit'];var _0x4b5e85;if(_0x5940ee>=_0x882070){_0x5940ee=_0x882070;_0x4b5e85=0xc8;}else{_0x4b5e85=0xce;}_0xb5a97f[_0xa388('0x1b')](_0x4b5e85);return _0xb5a97f[_0xa388('0x20')](_0xa388('0x21'),_0x5c8889+'-'+_0x5940ee+'/'+_0x882070)['json'](_0x2fc09f);}return null;};}function patchUpdates(_0xc9c895){return function(_0x26e48d){try{jsonpatch['apply'](_0x26e48d,_0xc9c895,!![]);}catch(_0x1d1da8){return BPromise[_0xa388('0x22')](_0x1d1da8);}return _0x26e48d[_0xa388('0x23')]();};}function saveUpdates(_0x602682,_0x18de3b){return function(_0x2667bf){if(_0x2667bf){return _0x2667bf[_0xa388('0x24')](_0x602682)[_0xa388('0x25')](function(_0x1e9888){return _0x1e9888;});}return null;};}function removeEntity(_0x2f443e,_0x143f31){return function(_0x14eb98){if(_0x14eb98){return _0x14eb98[_0xa388('0x26')]()[_0xa388('0x25')](function(){var _0x27792d=_0x14eb98[_0xa388('0x27')]({'plain':!![]});var _0x381558=_0xa388('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x381558,'resourceId':_0x27792d['id']}})[_0xa388('0x25')](function(){return _0x14eb98;});})[_0xa388('0x25')](function(){_0x2f443e[_0xa388('0x1b')](0xcc)[_0xa388('0x1a')]();});}};}function handleEntityNotFound(_0x4f1b53,_0x5de646){return function(_0x480f8c){if(!_0x480f8c){_0x4f1b53[_0xa388('0x29')](0x194);}return _0x480f8c;};}function handleError(_0x543830,_0x6b541b){_0x6b541b=_0x6b541b||0x1f4;return function(_0xf81fbb){logger[_0xa388('0x2a')](_0xf81fbb[_0xa388('0x2b')]);if(_0xf81fbb[_0xa388('0x2c')]){delete _0xf81fbb[_0xa388('0x2c')];}_0x543830[_0xa388('0x1b')](_0x6b541b)['send'](_0xf81fbb);};}exports[_0xa388('0x2d')]=function(_0xd0edf0,_0xec403f){var _0xa4b59={},_0x568073={},_0x5f51dd={'count':0x0,'rows':[]};var _0x416b09=_['map'](db['AnalyticCustomReport'][_0xa388('0x2e')],function(_0x1018bb){return{'name':_0x1018bb[_0xa388('0x2f')],'type':_0x1018bb[_0xa388('0x30')][_0xa388('0x31')]};});_0x568073['model']=_[_0xa388('0x32')](_0x416b09,_0xa388('0x2c'));_0x568073[_0xa388('0x33')]=_[_0xa388('0x34')](_0xd0edf0[_0xa388('0x33')]);_0x568073[_0xa388('0x35')]=_[_0xa388('0x36')](_0x568073[_0xa388('0x37')],_0x568073[_0xa388('0x33')]);_0xa4b59[_0xa388('0x38')]=_[_0xa388('0x36')](_0x568073[_0xa388('0x37')],qs[_0xa388('0x39')](_0xd0edf0[_0xa388('0x33')]['fields']));_0xa4b59['attributes']=_0xa4b59[_0xa388('0x38')]['length']?_0xa4b59['attributes']:_0x568073[_0xa388('0x37')];if(!_0xd0edf0[_0xa388('0x33')][_0xa388('0x3a')]('nolimit')){_0xa4b59[_0xa388('0x3b')]=qs[_0xa388('0x3b')](_0xd0edf0[_0xa388('0x33')][_0xa388('0x3b')]);_0xa4b59[_0xa388('0x1d')]=qs[_0xa388('0x1d')](_0xd0edf0[_0xa388('0x33')][_0xa388('0x1d')]);}_0xa4b59[_0xa388('0x3c')]=qs[_0xa388('0x3d')](_0xd0edf0[_0xa388('0x33')][_0xa388('0x3d')]);_0xa4b59[_0xa388('0x3e')]=qs['filters'](_[_0xa388('0x3f')](_0xd0edf0['query'],_0x568073[_0xa388('0x35')]),_0x416b09);if(_0xd0edf0['query'][_0xa388('0x40')]){_0xa4b59[_0xa388('0x3e')]=_[_0xa388('0x41')](_0xa4b59['where'],{'$or':_[_0xa388('0x32')](_0x416b09,function(_0x40dd0b){if(_0x40dd0b['type']!=='VIRTUAL'){var _0x3245d5={};_0x3245d5[_0x40dd0b['name']]={'$like':'%'+_0xd0edf0[_0xa388('0x33')][_0xa388('0x40')]+'%'};return _0x3245d5;}})});}_0xa4b59=_[_0xa388('0x41')]({},_0xa4b59,_0xd0edf0[_0xa388('0x42')]);var _0x1dca21={'where':_0xa4b59[_0xa388('0x3e')]};return db[_0xa388('0x43')][_0xa388('0x1f')](_0x1dca21)[_0xa388('0x25')](function(_0x2b1920){_0x5f51dd['count']=_0x2b1920;if(_0xd0edf0['query'][_0xa388('0x44')]){_0xa4b59[_0xa388('0x45')]=[{'all':!![]}];}return db[_0xa388('0x43')][_0xa388('0x46')](_0xa4b59);})[_0xa388('0x25')](function(_0x50f022){_0x5f51dd[_0xa388('0x47')]=_0x50f022;return _0x5f51dd;})[_0xa388('0x25')](respondWithFilteredResult(_0xec403f,_0xa4b59))[_0xa388('0x48')](handleError(_0xec403f,null));};exports[_0xa388('0x49')]=function(_0x3614c8,_0x41b30b){var _0x126892={'raw':![],'where':{'id':_0x3614c8[_0xa388('0x4a')]['id']}},_0x2f3a25={};_0x2f3a25[_0xa388('0x37')]=_[_0xa388('0x34')](db[_0xa388('0x43')][_0xa388('0x2e')]);_0x2f3a25['query']=_[_0xa388('0x34')](_0x3614c8[_0xa388('0x33')]);_0x2f3a25[_0xa388('0x35')]=_[_0xa388('0x36')](_0x2f3a25[_0xa388('0x37')],_0x2f3a25[_0xa388('0x33')]);_0x126892[_0xa388('0x38')]=_[_0xa388('0x36')](_0x2f3a25[_0xa388('0x37')],qs[_0xa388('0x39')](_0x3614c8[_0xa388('0x33')][_0xa388('0x39')]));_0x126892[_0xa388('0x38')]=_0x126892[_0xa388('0x38')][_0xa388('0x4b')]?_0x126892[_0xa388('0x38')]:_0x2f3a25[_0xa388('0x37')];if(_0x3614c8[_0xa388('0x33')][_0xa388('0x44')]){_0x126892[_0xa388('0x45')]=[{'all':!![]}];}_0x126892=_['merge']({},_0x126892,_0x3614c8[_0xa388('0x42')]);return db[_0xa388('0x43')][_0xa388('0x4c')](_0x126892)[_0xa388('0x25')](handleEntityNotFound(_0x41b30b,null))['then'](respondWithResult(_0x41b30b,null))[_0xa388('0x48')](handleError(_0x41b30b,null));};exports['create']=function(_0x88cdf,_0x9e32af){return db[_0xa388('0x43')][_0xa388('0x4d')](_0x88cdf['body'],{})[_0xa388('0x25')](function(_0x2dd92){var _0x1ad952=_0x88cdf[_0xa388('0x4e')][_0xa388('0x27')]({'plain':!![]});if(!_0x1ad952)throw new Error(_0xa388('0x4f'));if(_0x1ad952['role']===_0xa388('0x4e')){var _0x4ba849=_0x2dd92['get']({'plain':!![]});var _0x179d28=_0xa388('0x50');return db[_0xa388('0x51')][_0xa388('0x4c')]({'where':{'name':_0x179d28,'userProfileId':_0x1ad952[_0xa388('0x52')]},'raw':!![]})['then'](function(_0x3bb4dd){if(_0x3bb4dd&&_0x3bb4dd[_0xa388('0x53')]===0x0){return db[_0xa388('0x54')][_0xa388('0x4d')]({'name':_0x4ba849[_0xa388('0x2c')],'resourceId':_0x4ba849['id'],'type':_0xa388('0x28'),'sectionId':_0x3bb4dd['id']},{})['then'](function(){return _0x2dd92;});}else{return _0x2dd92;}})[_0xa388('0x48')](function(_0xb13959){logger[_0xa388('0x2a')](_0xa388('0x55'),_0xb13959);throw _0xb13959;});}return _0x2dd92;})[_0xa388('0x25')](respondWithResult(_0x9e32af,0xc9))[_0xa388('0x48')](handleError(_0x9e32af,null));};exports[_0xa388('0x24')]=function(_0x5c47d5,_0x34eb3e){if(_0x5c47d5[_0xa388('0x56')]['id']){delete _0x5c47d5[_0xa388('0x56')]['id'];}return db[_0xa388('0x43')][_0xa388('0x4c')]({'where':{'id':_0x5c47d5['params']['id']}})['then'](handleEntityNotFound(_0x34eb3e,null))[_0xa388('0x25')](saveUpdates(_0x5c47d5[_0xa388('0x56')],null))['then'](respondWithResult(_0x34eb3e,null))['catch'](handleError(_0x34eb3e,null));};exports[_0xa388('0x26')]=function(_0xd1a4ef,_0x4c1a3a){return db[_0xa388('0x43')][_0xa388('0x4c')]({'where':{'id':_0xd1a4ef[_0xa388('0x4a')]['id']}})[_0xa388('0x25')](handleEntityNotFound(_0x4c1a3a,null))[_0xa388('0x25')](removeEntity(_0x4c1a3a,null))[_0xa388('0x48')](handleError(_0x4c1a3a,null));};exports[_0xa388('0x57')]=function(_0x48c40d,_0x873422){var _0x4c0cc9=0xa;var _0x207029=[_0xa388('0x58'),'left_join','right_join',_0xa388('0x59')];var _0x3b603c={'SUM':_0xa388('0x5a'),'COUNT':_0xa388('0x5b'),'COUNT DISTINCT':_0xa388('0x5c'),'MAX':_0xa388('0x5d'),'MIN':_0xa388('0x5e'),'AVG':_0xa388('0x5f'),'GROUP_CONCAT':_0xa388('0x60'),'GROUP_CONCAT ASC':_0xa388('0x61'),'GROUP_CONCAT DESC':_0xa388('0x62')};var _0x1cf93a={'SEC_TO_TIME':_0xa388('0x63'),'DATE':_0xa388('0x64'),'HOUR':_0xa388('0x65'),'ROUND':_0xa388('0x66'),'UNIX_TIMESTAMP':_0xa388('0x67')};var _0x20cb52=function(_0x8d145c){return!_[_0xa388('0x68')](['IS\x20NULL',_0xa388('0x69'),'IS\x20EMPTY',_0xa388('0x6a')],_0x8d145c);};var _0x2cb5a4=function(_0x4915fd){if(!_0x4915fd||!_0x4915fd[_0xa388('0x6b')]['length']){return'';}for(var _0xda819a='(',_0x2b8dbe=0x0;_0x2b8dbe<_0x4915fd[_0xa388('0x6b')][_0xa388('0x4b')];_0x2b8dbe+=0x1){_0x2b8dbe>0x0&&(_0xda819a+='\x20'+_0x4915fd[_0xa388('0x6c')]+'\x20');_0xda819a+=_0x4915fd[_0xa388('0x6b')][_0x2b8dbe][_0xa388('0x6d')]?_0x2cb5a4(_0x4915fd[_0xa388('0x6b')][_0x2b8dbe][_0xa388('0x6d')]):_0x4915fd['rules'][_0x2b8dbe][_0xa388('0x6e')]+'\x20'+_0x4915fd[_0xa388('0x6b')][_0x2b8dbe][_0xa388('0x6f')]+(_0x20cb52(_0x4915fd[_0xa388('0x6b')][_0x2b8dbe][_0xa388('0x6f')])?'\x20'+_0x4915fd['rules'][_0x2b8dbe][_0xa388('0x70')]:'');}return _0xda819a+')';};var _0x1c6891={'where':{'id':_0x48c40d['params']['id']}},_0x1b2907,_0x5522fd,_0x2d2d70,_0x11c6f8,_0x427c17;_0x1c6891=_[_0xa388('0x41')]({},_0x1c6891,_0x48c40d[_0xa388('0x42')]);return db[_0xa388('0x43')][_0xa388('0x4c')](_0x1c6891)[_0xa388('0x25')](function(_0x3364be){if(_0x3364be){_0x1b2907=_0x3364be;return _0x3364be[_0xa388('0x71')]();}return null;})[_0xa388('0x25')](function(_0xb71bd8){if(_0xb71bd8){if(!_0xb71bd8[_0xa388('0x4b')]){throw new db[(_0xa388('0x72'))][(_0xa388('0x73'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5522fd=_0xb71bd8;return db[_0xa388('0x74')]['findAll']({'raw':!![]});}return null;})[_0xa388('0x25')](function(_0x3aaf72){if(_0x3aaf72){_0x2d2d70=_['keyBy'](_0x3aaf72,'id');var _0x5e42f4;var _0x53e5d9=squel[_0xa388('0x75')]();_0x53e5d9[_0xa388('0x76')](_0x1b2907[_0xa388('0x77')]);for(var _0x7df581=0x0;_0x7df581<_0x5522fd[_0xa388('0x4b')];_0x7df581+=0x1){_0x5e42f4=_0x5522fd[_0x7df581][_0xa388('0x78')]?_0x2d2d70[_0x5522fd[_0x7df581][_0xa388('0x78')]]['metric']:_0x5522fd[_0x7df581][_0xa388('0x6e')];_0x5e42f4=_0x5522fd[_0x7df581][_0xa388('0x79')]?_['replace'](_0x3b603c[_0x5522fd[_0x7df581][_0xa388('0x79')]],'%s',_0x5e42f4):_0x5e42f4;_0x5e42f4=_0x5522fd[_0x7df581][_0xa388('0x7a')]?_[_0xa388('0x7b')](_0x1cf93a[_0x5522fd[_0x7df581][_0xa388('0x7a')]],'%s',_0x5e42f4):_0x5e42f4;if(_0x5522fd[_0x7df581][_0xa388('0x7c')]){_0x53e5d9['group'](_0x5e42f4);}_0x5522fd[_0x7df581][_0xa388('0x7d')]&&_0x53e5d9[_0xa388('0x3c')](_0x5e42f4,_0x5522fd[_0x7df581][_0xa388('0x7d')]===_0xa388('0x7e')?![]:!![]);_0x53e5d9[_0xa388('0x6e')](_0x5e42f4,_0x5522fd[_0x7df581][_0xa388('0x7f')]||_0x5e42f4);}if(_0x1b2907[_0xa388('0x80')]){_0x1b2907[_0xa388('0x80')]=JSON[_0xa388('0x81')](_0x1b2907[_0xa388('0x80')]);for(var _0x2837e2=0x0;_0x2837e2<_0x1b2907['joins'][_0xa388('0x4b')];_0x2837e2+=0x1){if(_0x1b2907[_0xa388('0x80')][_0x2837e2]['type']&&_[_0xa388('0x68')](_0x207029,_0x1b2907['joins'][_0x2837e2][_0xa388('0x30')])&&_0x1b2907['joins'][_0x2837e2][_0xa388('0x82')]&&_0x1b2907[_0xa388('0x80')][_0x2837e2][_0xa388('0x83')]&&_0x1b2907[_0xa388('0x80')][_0x2837e2]['foreignKey']){_0x53e5d9[_0x1b2907['joins'][_0x2837e2][_0xa388('0x30')]](_0x1b2907[_0xa388('0x80')][_0x2837e2][_0xa388('0x83')],null,util[_0xa388('0x7a')](_0xa388('0x84'),_0x1b2907[_0xa388('0x77')],_0x1b2907[_0xa388('0x80')][_0x2837e2][_0xa388('0x82')],_0x1b2907[_0xa388('0x80')][_0x2837e2][_0xa388('0x83')],_0x1b2907[_0xa388('0x80')][_0x2837e2][_0xa388('0x85')]));}}}if(_0x1b2907[_0xa388('0x86')]){_0x1b2907['conditions']=JSON[_0xa388('0x81')](_0x1b2907[_0xa388('0x86')]);_0x53e5d9['where'](_0x2cb5a4(_0x1b2907[_0xa388('0x86')][_0xa388('0x6d')]));}_0x427c17=_0x53e5d9['clone']();_0x53e5d9['limit'](_0x4c0cc9);_0x53e5d9[_0xa388('0x1d')](0x0);logger[_0xa388('0x87')](_0xa388('0x88'),_0x53e5d9[_0xa388('0x89')]());return dbH[_0xa388('0x8a')][_0xa388('0x33')](_0x53e5d9[_0xa388('0x89')](),{'type':dbH[_0xa388('0x8a')][_0xa388('0x8b')][_0xa388('0x8c')]});}})[_0xa388('0x25')](respondWithResult(_0x873422,null))[_0xa388('0x48')](handleError(_0x873422,null));};function runReport(_0x5649fd,_0x3ce624,_0x1b4c6c){var _0x2f907c=_0x3ce624[_0xa388('0x2c')];var _0x128b43=0xa;var _0x349e24=[_0xa388('0x58'),_0xa388('0x8d'),_0xa388('0x8e'),_0xa388('0x59')];var _0x456cbc={'SUM':_0xa388('0x5a'),'COUNT':_0xa388('0x5b'),'COUNT DISTINCT':_0xa388('0x5c'),'MAX':_0xa388('0x5d'),'MIN':_0xa388('0x5e'),'AVG':_0xa388('0x5f'),'GROUP_CONCAT':_0xa388('0x60'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x421ec0={'SEC_TO_TIME':_0xa388('0x63'),'DATE':_0xa388('0x64'),'HOUR':_0xa388('0x65'),'ROUND':_0xa388('0x66'),'UNIX_TIMESTAMP':_0xa388('0x67')};var _0x4f7330=function(_0x3860a0){return!_[_0xa388('0x68')]([_0xa388('0x8f'),'IS\x20NOT\x20NULL',_0xa388('0x90'),'IS\x20NOT\x20EMPTY'],_0x3860a0);};var _0x4bf693=function(_0x408620){if(!_0x408620||!_0x408620['rules'][_0xa388('0x4b')]){return'';}for(var _0x34a47c='(',_0x2acf97=0x0;_0x2acf97<_0x408620['rules'][_0xa388('0x4b')];_0x2acf97+=0x1){_0x2acf97>0x0&&(_0x34a47c+='\x20'+_0x408620[_0xa388('0x6c')]+'\x20');_0x34a47c+=_0x408620[_0xa388('0x6b')][_0x2acf97][_0xa388('0x6d')]?_0x4bf693(_0x408620[_0xa388('0x6b')][_0x2acf97]['group']):_0x408620[_0xa388('0x6b')][_0x2acf97]['field']+'\x20'+_0x408620[_0xa388('0x6b')][_0x2acf97]['condition']+(_0x4f7330(_0x408620[_0xa388('0x6b')][_0x2acf97][_0xa388('0x6f')])?'\x20'+_0x408620[_0xa388('0x6b')][_0x2acf97][_0xa388('0x70')]:'');}return _0x34a47c+')';};var _0x41621a={'where':{'id':_0x5649fd['id']}},_0x35e354,_0x203983,_0x5935c5,_0x21af5d,_0x2cd201;_0x41621a=_[_0xa388('0x41')]({},_0x41621a,_0x1b4c6c);return db[_0xa388('0x43')][_0xa388('0x4c')](_0x41621a)[_0xa388('0x25')](function(_0x2f0201){if(_0x2f0201){_0x35e354=_0x2f0201;return _0x2f0201[_0xa388('0x71')]();}return null;})[_0xa388('0x25')](function(_0x31ae1f){if(_0x31ae1f){if(!_0x31ae1f[_0xa388('0x4b')]){throw new db['Sequelize'][(_0xa388('0x73'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x203983=_0x31ae1f;return db['AnalyticMetric'][_0xa388('0x46')]({'raw':!![]});}return null;})['then'](function(_0x3583a3){if(_0x3583a3){_0x5935c5=_['keyBy'](_0x3583a3,'id');var _0x14dcdb;var _0x33911c=squel['select']();_0x33911c[_0xa388('0x76')](_0x35e354[_0xa388('0x77')]);for(var _0x2bee19=0x0;_0x2bee19<_0x203983['length'];_0x2bee19+=0x1){_0x14dcdb=_0x203983[_0x2bee19]['MetricId']?_0x5935c5[_0x203983[_0x2bee19]['MetricId']][_0xa388('0x91')]:_0x203983[_0x2bee19][_0xa388('0x6e')];_0x14dcdb=_0x203983[_0x2bee19][_0xa388('0x79')]?_[_0xa388('0x7b')](_0x456cbc[_0x203983[_0x2bee19][_0xa388('0x79')]],'%s',_0x14dcdb):_0x14dcdb;_0x14dcdb=_0x203983[_0x2bee19]['format']?_[_0xa388('0x7b')](_0x421ec0[_0x203983[_0x2bee19][_0xa388('0x7a')]],'%s',_0x14dcdb):_0x14dcdb;if(_0x203983[_0x2bee19][_0xa388('0x7c')]){_0x33911c[_0xa388('0x6d')](_0x14dcdb);}_0x203983[_0x2bee19][_0xa388('0x7d')]&&_0x33911c[_0xa388('0x3c')](_0x14dcdb,_0x203983[_0x2bee19]['orderBy']===_0xa388('0x7e')?![]:!![]);_0x33911c[_0xa388('0x6e')](_0x14dcdb,_0x203983[_0x2bee19][_0xa388('0x7f')]||_0x14dcdb);}if(_0x35e354['joins']){_0x35e354[_0xa388('0x80')]=JSON['parse'](_0x35e354['joins']);for(var _0x241b45=0x0;_0x241b45<_0x35e354[_0xa388('0x80')]['length'];_0x241b45+=0x1){if(_0x35e354[_0xa388('0x80')][_0x241b45][_0xa388('0x30')]&&_['includes'](_0x349e24,_0x35e354[_0xa388('0x80')][_0x241b45][_0xa388('0x30')])&&_0x35e354['joins'][_0x241b45][_0xa388('0x82')]&&_0x35e354[_0xa388('0x80')][_0x241b45][_0xa388('0x83')]&&_0x35e354[_0xa388('0x80')][_0x241b45]['foreignKey']){_0x33911c[_0x35e354[_0xa388('0x80')][_0x241b45][_0xa388('0x30')]](_0x35e354['joins'][_0x241b45][_0xa388('0x83')],null,util[_0xa388('0x7a')]('%s.%s\x20=\x20%s.%s',_0x35e354['table'],_0x35e354[_0xa388('0x80')][_0x241b45][_0xa388('0x82')],_0x35e354[_0xa388('0x80')][_0x241b45][_0xa388('0x83')],_0x35e354[_0xa388('0x80')][_0x241b45][_0xa388('0x85')]));}}}if(_0x35e354[_0xa388('0x86')]){_0x35e354[_0xa388('0x86')]=JSON[_0xa388('0x81')](_0x35e354[_0xa388('0x86')]);_0x33911c[_0xa388('0x3e')](_0x4bf693(_0x35e354[_0xa388('0x86')][_0xa388('0x6d')]));}_0x2cd201=_0x33911c['clone']();_0x33911c[_0xa388('0x3b')](_0x128b43);_0x33911c[_0xa388('0x1d')](0x0);return;}})[_0xa388('0x25')](function(){if(_0x3ce624['output']===_0xa388('0x92')){return null;}var _0x4fd505=_[_0xa388('0x41')](_0x3ce624,{'name':_0x3ce624['fullPath']||_0x3ce624[_0xa388('0x2c')]||_0x35e354[_0xa388('0x2c')],'basename':_0x2f907c,'savename':util[_0xa388('0x7a')]('%s-%s.%s',_0x3ce624[_0xa388('0x2c')]||_0x35e354[_0xa388('0x2c')],require(_0xa388('0x93'))[_0xa388('0x94')](0x4),_0x3ce624[_0xa388('0x95')]||_0xa388('0x96')),'reportId':_0x35e354['id'],'reportType':'custom'});return db[_0xa388('0x97')]['create'](_0x4fd505,{'raw':!![]});})[_0xa388('0x25')](function(_0x278596){if(_0x35e354[_0xa388('0x77')]===_0xa388('0x98')){_0x2cd201[_0xa388('0x3e')](_0x35e354[_0xa388('0x77')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x3ce624[_0xa388('0x99')],_0x3ce624[_0xa388('0x9a')]);}else{_0x2cd201[_0xa388('0x3e')](_0x35e354['table']+_0xa388('0x9b'),_0x3ce624[_0xa388('0x99')],_0x3ce624[_0xa388('0x9a')]);}if(_0x278596){logger['info']('Run\x20Query:',_0x2cd201['toString']());require('child_process')[_0xa388('0x9c')](path[_0xa388('0x58')](__dirname,'../../components/export/',_0x278596['output']),[_0x278596['id'],_0x2cd201[_0xa388('0x89')](),path[_0xa388('0x58')](__dirname,_0xa388('0x9d'),_0x278596['savename']),_0x2f907c]);return _0x278596;}else{var _0x5c451c=squel[_0xa388('0x75')]();_0x5c451c[_0xa388('0x76')]('('+_0x2cd201['toString']()+')',_0xa388('0x9e'));_0x5c451c['field'](_0xa388('0x9f'),_0xa388('0x1f'));_0x2cd201['limit'](_0x3ce624['limit']||_0x128b43);_0x2cd201['offset'](_0x3ce624[_0xa388('0x1d')]||0x0);return dbH['sequelize'][_0xa388('0x33')](_0x5c451c['toString'](),{'type':dbH[_0xa388('0x8a')]['QueryTypes'][_0xa388('0x8c')]})[_0xa388('0x25')](function(_0x46a52d){if(!_0x46a52d[_0xa388('0x4b')]){_0x21af5d=0x0;}else{_0x21af5d=_0x46a52d[0x0]['count']||0x0;}return dbH[_0xa388('0x8a')][_0xa388('0x33')](_0x2cd201[_0xa388('0x89')](),{'type':dbH[_0xa388('0x8a')][_0xa388('0x8b')][_0xa388('0x8c')]});})['then'](function(_0x57d151){return{'rows':_0x57d151||[],'count':_0x21af5d};});}});}exports[_0xa388('0xa0')]=function(_0x1e4c81,_0x337483){return runReport(_0x1e4c81[_0xa388('0x4a')],_0x1e4c81['query'],_0x1e4c81[_0xa388('0x42')])[_0xa388('0x25')](respondWithResult(_0x337483,null))[_0xa388('0x48')](handleError(_0x337483,null));};exports['runReport']=runReport;exports[_0xa388('0x33')]=function(_0x3f3760,_0x4a93c8){var _0x18040b=0xa;var _0x39ab6e=[_0xa388('0x58'),_0xa388('0x8d'),_0xa388('0x8e'),_0xa388('0x59')];var _0x17cd25={'SUM':'SUM(%s)','COUNT':_0xa388('0x5b'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xa388('0x5e'),'AVG':_0xa388('0x5f'),'GROUP_CONCAT':_0xa388('0x60'),'GROUP_CONCAT ASC':_0xa388('0x61'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x318471={'SEC_TO_TIME':_0xa388('0x63'),'DATE':'DATE(%s)','HOUR':_0xa388('0x65'),'ROUND':_0xa388('0x66'),'UNIX_TIMESTAMP':_0xa388('0x67')};var _0x2548e4=function(_0x4fcdf5){return!_[_0xa388('0x68')]([_0xa388('0x8f'),_0xa388('0x69'),_0xa388('0x90'),_0xa388('0x6a')],_0x4fcdf5);};var _0x24aded=function(_0x15f97d){if(!_0x15f97d||!_0x15f97d[_0xa388('0x6b')][_0xa388('0x4b')]){return'';}for(var _0x31ae87='(',_0x4b72f9=0x0;_0x4b72f9<_0x15f97d[_0xa388('0x6b')][_0xa388('0x4b')];_0x4b72f9+=0x1){_0x4b72f9>0x0&&(_0x31ae87+='\x20'+_0x15f97d[_0xa388('0x6c')]+'\x20');_0x31ae87+=_0x15f97d['rules'][_0x4b72f9][_0xa388('0x6d')]?_0x24aded(_0x15f97d[_0xa388('0x6b')][_0x4b72f9][_0xa388('0x6d')]):_0x15f97d[_0xa388('0x6b')][_0x4b72f9]['field']+'\x20'+_0x15f97d['rules'][_0x4b72f9][_0xa388('0x6f')]+(_0x2548e4(_0x15f97d[_0xa388('0x6b')][_0x4b72f9][_0xa388('0x6f')])?'\x20'+_0x15f97d[_0xa388('0x6b')][_0x4b72f9][_0xa388('0x70')]:'');}return _0x31ae87+')';};var _0x3713e7={'where':{'id':_0x3f3760['params']['id']}},_0xfd1056,_0x40d1ab,_0x3e3724,_0x40f55b,_0x28feac;_0x3713e7=_[_0xa388('0x41')]({},_0x3713e7,_0x3f3760[_0xa388('0x42')]);return db[_0xa388('0x43')][_0xa388('0x4c')](_0x3713e7)['then'](function(_0x49aa61){if(_0x49aa61){_0xfd1056=_0x49aa61;return _0x49aa61['getFields']();}return null;})[_0xa388('0x25')](function(_0x52f176){if(_0x52f176){if(!_0x52f176[_0xa388('0x4b')]){throw new db[(_0xa388('0x72'))][(_0xa388('0x73'))](_0xa388('0xa1'),0x193);}_0x40d1ab=_0x52f176;return db['AnalyticMetric'][_0xa388('0x46')]({'raw':!![]});}return null;})['then'](function(_0x3fb1ff){if(_0x3fb1ff){_0x3e3724=_['keyBy'](_0x3fb1ff,'id');var _0xef194d;var _0xf23df7=squel[_0xa388('0x75')]();_0xf23df7['from'](_0xfd1056['table']);for(var _0x27896e=0x0;_0x27896e<_0x40d1ab[_0xa388('0x4b')];_0x27896e+=0x1){_0xef194d=_0x40d1ab[_0x27896e][_0xa388('0x78')]?_0x3e3724[_0x40d1ab[_0x27896e]['MetricId']]['metric']:_0x40d1ab[_0x27896e][_0xa388('0x6e')];_0xef194d=_0x40d1ab[_0x27896e][_0xa388('0x79')]?_[_0xa388('0x7b')](_0x17cd25[_0x40d1ab[_0x27896e][_0xa388('0x79')]],'%s',_0xef194d):_0xef194d;_0xef194d=_0x40d1ab[_0x27896e][_0xa388('0x7a')]?_[_0xa388('0x7b')](_0x318471[_0x40d1ab[_0x27896e][_0xa388('0x7a')]],'%s',_0xef194d):_0xef194d;if(_0x40d1ab[_0x27896e]['groupBy']){_0xf23df7[_0xa388('0x6d')](_0xef194d);}_0x40d1ab[_0x27896e][_0xa388('0x7d')]&&_0xf23df7[_0xa388('0x3c')](_0xef194d,_0x40d1ab[_0x27896e][_0xa388('0x7d')]==='DESC'?![]:!![]);_0xf23df7['field'](_0xef194d,_0x40d1ab[_0x27896e][_0xa388('0x7f')]||_0xef194d);}if(_0xfd1056[_0xa388('0x80')]){_0xfd1056['joins']=JSON[_0xa388('0x81')](_0xfd1056['joins']);for(var _0x114c13=0x0;_0x114c13<_0xfd1056[_0xa388('0x80')][_0xa388('0x4b')];_0x114c13+=0x1){if(_0xfd1056['joins'][_0x114c13][_0xa388('0x30')]&&_[_0xa388('0x68')](_0x39ab6e,_0xfd1056['joins'][_0x114c13][_0xa388('0x30')])&&_0xfd1056[_0xa388('0x80')][_0x114c13]['parentKey']&&_0xfd1056[_0xa388('0x80')][_0x114c13][_0xa388('0x83')]&&_0xfd1056[_0xa388('0x80')][_0x114c13][_0xa388('0x85')]){_0xf23df7[_0xfd1056[_0xa388('0x80')][_0x114c13][_0xa388('0x30')]](_0xfd1056['joins'][_0x114c13][_0xa388('0x83')],null,util[_0xa388('0x7a')](_0xa388('0x84'),_0xfd1056[_0xa388('0x77')],_0xfd1056['joins'][_0x114c13][_0xa388('0x82')],_0xfd1056[_0xa388('0x80')][_0x114c13]['foreignTable'],_0xfd1056[_0xa388('0x80')][_0x114c13][_0xa388('0x85')]));}}}if(_0xfd1056[_0xa388('0x86')]){_0xfd1056[_0xa388('0x86')]=JSON[_0xa388('0x81')](_0xfd1056['conditions']);_0xf23df7[_0xa388('0x3e')](_0x24aded(_0xfd1056[_0xa388('0x86')][_0xa388('0x6d')]));}_0x28feac=_0xf23df7[_0xa388('0xa2')]();_0xf23df7[_0xa388('0x3b')](_0x18040b);_0xf23df7['offset'](0x0);logger[_0xa388('0x87')](_0xa388('0x88'),_0xf23df7[_0xa388('0x89')]());return dbH[_0xa388('0x8a')][_0xa388('0x33')](_0xf23df7[_0xa388('0x89')](),{'type':dbH[_0xa388('0x8a')][_0xa388('0x8b')][_0xa388('0x8c')]});}})[_0xa388('0x25')](function(){return{'sql':_0x28feac[_0xa388('0x89')]()};})[_0xa388('0x25')](respondWithResult(_0x4a93c8,null))[_0xa388('0x48')](handleError(_0x4a93c8,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index bc2b2bf..06d12c0 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 _0xc4d2=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc4d2,0x144));var _0x2c4d=function(_0x5ee6ed,_0xa13bc2){_0x5ee6ed=_0x5ee6ed-0x0;var _0x1177b2=_0xc4d2[_0x5ee6ed];return _0x1177b2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2c4d('0x0'))(_0x2c4d('0x1'));var moment=require(_0x2c4d('0x2'));var BPromise=require(_0x2c4d('0x3'));var rp=require(_0x2c4d('0x4'));var fs=require('fs');var path=require(_0x2c4d('0x5'));var rimraf=require(_0x2c4d('0x6'));var config=require(_0x2c4d('0x7'));var attributes=require(_0x2c4d('0x8'));module[_0x2c4d('0x9')]=function(_0x308cb5,_0x512542){return _0x308cb5[_0x2c4d('0xa')](_0x2c4d('0xb'),attributes,{'tableName':_0x2c4d('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4331=['analytics_custom_reports','lodash','../../config/logger','api','moment','request-promise','path','./analyticCustomReport.attributes','exports','define'];(function(_0x47de9a,_0x40cf23){var _0x4b9d6c=function(_0x507054){while(--_0x507054){_0x47de9a['push'](_0x47de9a['shift']());}};_0x4b9d6c(++_0x40cf23);}(_0x4331,0x1a5));var _0x1433=function(_0x1111ac,_0x27f3d9){_0x1111ac=_0x1111ac-0x0;var _0x2b30c6=_0x4331[_0x1111ac];return _0x2b30c6;};'use strict';var _=require(_0x1433('0x0'));var util=require('util');var logger=require(_0x1433('0x1'))(_0x1433('0x2'));var moment=require(_0x1433('0x3'));var BPromise=require('bluebird');var rp=require(_0x1433('0x4'));var fs=require('fs');var path=require(_0x1433('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1433('0x6'));module[_0x1433('0x7')]=function(_0xe4f9f2,_0x176599){return _0xe4f9f2[_0x1433('0x8')]('AnalyticCustomReport',attributes,{'tableName':_0x1433('0x9'),'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 bcf362a..d0a32ab 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 _0x8de6=['catch','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result'];(function(_0x5e9631,_0xc91d9a){var _0x27fc53=function(_0x4991e9){while(--_0x4991e9){_0x5e9631['push'](_0x5e9631['shift']());}};_0x27fc53(++_0xc91d9a);}(_0x8de6,0x19f));var _0x68de=function(_0x18cf8a,_0xcc5571){_0x18cf8a=_0x18cf8a-0x0;var _0x1f13c9=_0x8de6[_0x18cf8a];return _0x1f13c9;};'use strict';var _=require('lodash');var util=require(_0x68de('0x0'));var moment=require(_0x68de('0x1'));var BPromise=require(_0x68de('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x68de('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x68de('0x4'))(_0x68de('0x5'));var config=require(_0x68de('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1349d2,_0x4b501c,_0x142484){return new BPromise(function(_0x578df6,_0x33aaf1){return client[_0x68de('0x7')](_0x1349d2,_0x142484)[_0x68de('0x8')](function(_0x36cc04){logger['info'](_0x68de('0x9'),_0x4b501c,_0x68de('0xa'));logger['debug'](_0x68de('0xb'),_0x4b501c,_0x68de('0xa'),JSON['stringify'](_0x36cc04));if(_0x36cc04[_0x68de('0xc')]){if(_0x36cc04[_0x68de('0xc')][_0x68de('0xd')]===0x1f4){logger[_0x68de('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4b501c,_0x36cc04[_0x68de('0xc')][_0x68de('0xe')]);return _0x33aaf1(_0x36cc04[_0x68de('0xc')]['message']);}logger[_0x68de('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4b501c,_0x36cc04['error']['message']);return _0x578df6(_0x36cc04[_0x68de('0xc')][_0x68de('0xe')]);}else{logger[_0x68de('0xf')](_0x68de('0x9'),_0x4b501c,_0x68de('0xa'));_0x578df6(_0x36cc04[_0x68de('0x10')]['message']);}})[_0x68de('0x11')](function(_0x22ce71){logger['error'](_0x68de('0x9'),_0x4b501c,_0x22ce71);_0x33aaf1(_0x22ce71);});});}
\ No newline at end of file
+var _0xe482=['code','AnalyticCustomReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','error'];(function(_0x2262f5,_0x5a409f){var _0x25fc8c=function(_0x48c10a){while(--_0x48c10a){_0x2262f5['push'](_0x2262f5['shift']());}};_0x25fc8c(++_0x5a409f);}(_0xe482,0x9f));var _0x2e48=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xe482[_0x2b7764];return _0x848dcb;};'use strict';var _=require(_0x2e48('0x0'));var util=require('util');var moment=require(_0x2e48('0x1'));var BPromise=require(_0x2e48('0x2'));var rs=require(_0x2e48('0x3'));var fs=require('fs');var Redis=require(_0x2e48('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2e48('0x5'));var logger=require(_0x2e48('0x6'))(_0x2e48('0x7'));var config=require(_0x2e48('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2e48('0x9')][_0x2e48('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e8850,_0x5aa318,_0x4da8bd){return new BPromise(function(_0x3c752a,_0x3a0d70){return client[_0x2e48('0xb')](_0x3e8850,_0x4da8bd)[_0x2e48('0xc')](function(_0x34b335){logger[_0x2e48('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5aa318,_0x2e48('0xe'));logger[_0x2e48('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x5aa318,_0x2e48('0xe'),JSON['stringify'](_0x34b335));if(_0x34b335[_0x2e48('0x10')]){if(_0x34b335['error'][_0x2e48('0x11')]===0x1f4){logger[_0x2e48('0x10')](_0x2e48('0x12'),_0x5aa318,_0x34b335['error'][_0x2e48('0x13')]);return _0x3a0d70(_0x34b335['error'][_0x2e48('0x13')]);}logger[_0x2e48('0x10')](_0x2e48('0x12'),_0x5aa318,_0x34b335[_0x2e48('0x10')][_0x2e48('0x13')]);return _0x3c752a(_0x34b335[_0x2e48('0x10')][_0x2e48('0x13')]);}else{logger[_0x2e48('0xd')](_0x2e48('0x12'),_0x5aa318,_0x2e48('0xe'));_0x3c752a(_0x34b335[_0x2e48('0x14')]['message']);}})[_0x2e48('0x15')](function(_0x272cd8){logger['error'](_0x2e48('0x12'),_0x5aa318,_0x272cd8);_0x3a0d70(_0x272cd8);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 29d2202..d34db8e 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 _0x9a16=['multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','run','create','update','destroy'];(function(_0x296fe2,_0x2257b8){var _0x1a05eb=function(_0x4462db){while(--_0x4462db){_0x296fe2['push'](_0x296fe2['shift']());}};_0x1a05eb(++_0x2257b8);}(_0x9a16,0x1a2));var _0x69a1=function(_0x467843,_0x372b3b){_0x467843=_0x467843-0x0;var _0x9c5ce=_0x9a16[_0x467843];return _0x9c5ce;};'use strict';var multer=require(_0x69a1('0x0'));var util=require('util');var path=require(_0x69a1('0x1'));var timeout=require(_0x69a1('0x2'));var express=require(_0x69a1('0x3'));var router=express[_0x69a1('0x4')]();var fs_extra=require(_0x69a1('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x69a1('0x6'));var controller=require(_0x69a1('0x7'));router[_0x69a1('0x8')]('/',auth[_0x69a1('0x9')](),controller[_0x69a1('0xa')]);router[_0x69a1('0x8')](_0x69a1('0xb'),auth[_0x69a1('0x9')](),controller[_0x69a1('0xc')]);router[_0x69a1('0x8')](_0x69a1('0xd'),auth[_0x69a1('0x9')](),controller[_0x69a1('0xe')]);router['get']('/:id/run',auth['isAuthenticated'](),controller[_0x69a1('0xf')]);router[_0x69a1('0x8')]('/:id/query',auth[_0x69a1('0x9')](),controller['query']);router['post']('/',auth['isAuthenticated'](),controller[_0x69a1('0x10')]);router['put'](_0x69a1('0xb'),auth[_0x69a1('0x9')](),controller[_0x69a1('0x11')]);router['delete'](_0x69a1('0xb'),auth[_0x69a1('0x9')](),controller[_0x69a1('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xb3aa=['preview','/:id/run','run','/:id/query','query','create','update','delete','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview'];(function(_0x2c2bb5,_0x2bf4ff){var _0x3a4d6d=function(_0x161e2d){while(--_0x161e2d){_0x2c2bb5['push'](_0x2c2bb5['shift']());}};_0x3a4d6d(++_0x2bf4ff);}(_0xb3aa,0x134));var _0xab3a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb3aa[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0xab3a('0x0'));var path=require('path');var timeout=require(_0xab3a('0x1'));var express=require(_0xab3a('0x2'));var router=express[_0xab3a('0x3')]();var fs_extra=require(_0xab3a('0x4'));var auth=require(_0xab3a('0x5'));var interaction=require(_0xab3a('0x6'));var config=require(_0xab3a('0x7'));var controller=require('./analyticCustomReport.controller');router[_0xab3a('0x8')]('/',auth[_0xab3a('0x9')](),controller[_0xab3a('0xa')]);router[_0xab3a('0x8')](_0xab3a('0xb'),auth[_0xab3a('0x9')](),controller[_0xab3a('0xc')]);router['get'](_0xab3a('0xd'),auth[_0xab3a('0x9')](),controller[_0xab3a('0xe')]);router[_0xab3a('0x8')](_0xab3a('0xf'),auth[_0xab3a('0x9')](),controller[_0xab3a('0x10')]);router[_0xab3a('0x8')](_0xab3a('0x11'),auth[_0xab3a('0x9')](),controller[_0xab3a('0x12')]);router['post']('/',auth[_0xab3a('0x9')](),controller[_0xab3a('0x13')]);router['put'](_0xab3a('0xb'),auth['isAuthenticated'](),controller[_0xab3a('0x14')]);router[_0xab3a('0x15')]('/:id',auth[_0xab3a('0x9')](),controller[_0xab3a('0x16')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 8a7f6d2..30ce100 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 _0xd8fb=['TEXT','sequelize','exports','STRING'];(function(_0x44822c,_0x2288af){var _0x4e57a2=function(_0x5a3d25){while(--_0x5a3d25){_0x44822c['push'](_0x44822c['shift']());}};_0x4e57a2(++_0x2288af);}(_0xd8fb,0x99));var _0xbd8f=function(_0x6191c2,_0x40f384){_0x6191c2=_0x6191c2-0x0;var _0x31dd43=_0xd8fb[_0x6191c2];return _0x31dd43;};'use strict';var Sequelize=require(_0xbd8f('0x0'));module[_0xbd8f('0x1')]={'name':{'type':Sequelize[_0xbd8f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xbd8f('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xbd8f('0x3')]}};
\ No newline at end of file
+var _0x71ab=['TEXT','exports','STRING'];(function(_0x1c3be6,_0x5b43a6){var _0x5e7329=function(_0x1a3427){while(--_0x1a3427){_0x1c3be6['push'](_0x1c3be6['shift']());}};_0x5e7329(++_0x5b43a6);}(_0x71ab,0x64));var _0xb71a=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x71ab[_0x432682];return _0x463d05;};'use strict';var Sequelize=require('sequelize');module[_0xb71a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb71a('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xb71a('0x1')]},'conditions':{'type':Sequelize[_0xb71a('0x2')]},'joins':{'type':Sequelize[_0xb71a('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 8594d7b..6f6ff6e 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 _0x53ec=['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','format','replace','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','HOUR(%s)','ROUND(%s)','condition','Sequelize','groupBy','foreignKey','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','SELECT','runReport','cross_join','COUNT(%s)','MIN(%s)','ValidationErrorItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','type','include','AnalyticDefaultReport','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','preview','join','left_join','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes'];(function(_0x1ad8c3,_0x451bed){var _0x4043a2=function(_0x4b6a50){while(--_0x4b6a50){_0x1ad8c3['push'](_0x1ad8c3['shift']());}};_0x4043a2(++_0x451bed);}(_0x53ec,0x192));var _0xc53e=function(_0x4727b7,_0x585a61){_0x4727b7=_0x4727b7-0x0;var _0xce9394=_0x53ec[_0x4727b7];return _0xce9394;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require(_0xc53e('0x2'));var jsonpatch=require(_0xc53e('0x3'));var rp=require(_0xc53e('0x4'));var moment=require(_0xc53e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc53e('0x6'));var util=require('util');var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require('to-csv');var ejs=require(_0xc53e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0xe'));var querystring=require(_0xc53e('0xf'));var Papa=require(_0xc53e('0x10'));var Redis=require(_0xc53e('0x11'));var authService=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var as=require(_0xc53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc53e('0x16'));var db=require(_0xc53e('0x17'))['db'];var dbH=require(_0xc53e('0x17'))[_0xc53e('0x18')];function respondWithStatusCode(_0x56f0e5,_0x4e74c9){_0x4e74c9=_0x4e74c9||0xcc;return function(_0x1c06cd){if(_0x1c06cd){return _0x56f0e5[_0xc53e('0x19')](_0x4e74c9);}return _0x56f0e5[_0xc53e('0x1a')](_0x4e74c9)[_0xc53e('0x1b')]();};}function respondWithResult(_0x358ef3,_0x382e87){_0x382e87=_0x382e87||0xc8;return function(_0x3dc2fa){if(_0x3dc2fa){return _0x358ef3[_0xc53e('0x1a')](_0x382e87)[_0xc53e('0x1c')](_0x3dc2fa);}};}function respondWithFilteredResult(_0x2ad6eb,_0x5b0a88){return function(_0x8a522e){if(_0x8a522e){var _0x191567=typeof _0x5b0a88[_0xc53e('0x1d')]===_0xc53e('0x1e')&&typeof _0x5b0a88[_0xc53e('0x1f')]===_0xc53e('0x1e');var _0x164016=_0x8a522e[_0xc53e('0x20')];var _0x3b550e=_0x191567?0x0:_0x5b0a88['offset'];var _0x546fab=_0x191567?_0x8a522e[_0xc53e('0x20')]:_0x5b0a88[_0xc53e('0x1d')]+_0x5b0a88[_0xc53e('0x1f')];var _0x2e85df;if(_0x546fab>=_0x164016){_0x546fab=_0x164016;_0x2e85df=0xc8;}else{_0x2e85df=0xce;}_0x2ad6eb[_0xc53e('0x1a')](_0x2e85df);return _0x2ad6eb[_0xc53e('0x21')](_0xc53e('0x22'),_0x3b550e+'-'+_0x546fab+'/'+_0x164016)[_0xc53e('0x1c')](_0x8a522e);}return null;};}function patchUpdates(_0x364c80){return function(_0x401af6){try{jsonpatch[_0xc53e('0x23')](_0x401af6,_0x364c80,!![]);}catch(_0x44fd93){return BPromise[_0xc53e('0x24')](_0x44fd93);}return _0x401af6['save']();};}function saveUpdates(_0x47cfdd,_0x531ede){return function(_0x4f4304){if(_0x4f4304){return _0x4f4304[_0xc53e('0x25')](_0x47cfdd)[_0xc53e('0x26')](function(_0x4015c8){return _0x4015c8;});}return null;};}function removeEntity(_0x180811,_0x5009e1){return function(_0x5e5377){if(_0x5e5377){return _0x5e5377[_0xc53e('0x27')]()['then'](function(){var _0x1ae55e=_0x5e5377[_0xc53e('0x28')]({'plain':!![]});var _0x443179=_0xc53e('0x29');return db[_0xc53e('0x2a')]['destroy']({'where':{'type':_0x443179,'resourceId':_0x1ae55e['id']}})[_0xc53e('0x26')](function(){return _0x5e5377;});})['then'](function(){_0x180811['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c5056,_0x57a1f5){return function(_0x28240a){if(!_0x28240a){_0x3c5056['sendStatus'](0x194);}return _0x28240a;};}function handleError(_0x24a77e,_0x5112d2){_0x5112d2=_0x5112d2||0x1f4;return function(_0x5ce216){logger[_0xc53e('0x2b')](_0x5ce216[_0xc53e('0x2c')]);if(_0x5ce216[_0xc53e('0x2d')]){delete _0x5ce216[_0xc53e('0x2d')];}_0x24a77e[_0xc53e('0x1a')](_0x5112d2)[_0xc53e('0x2e')](_0x5ce216);};}exports[_0xc53e('0x2f')]=function(_0x2a2ca9,_0x4ace0b){var _0x437893={},_0x311835={},_0x2d36c0={'count':0x0,'rows':[]};var _0x56206b=_[_0xc53e('0x30')](db['AnalyticDefaultReport'][_0xc53e('0x31')],function(_0x2467f4){return{'name':_0x2467f4['fieldName'],'type':_0x2467f4['type'][_0xc53e('0x32')]};});_0x311835[_0xc53e('0x33')]=_[_0xc53e('0x30')](_0x56206b,_0xc53e('0x2d'));_0x311835[_0xc53e('0x34')]=_[_0xc53e('0x35')](_0x2a2ca9[_0xc53e('0x34')]);_0x311835[_0xc53e('0x36')]=_['intersection'](_0x311835[_0xc53e('0x33')],_0x311835[_0xc53e('0x34')]);_0x437893[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x311835[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x39')]));_0x437893[_0xc53e('0x37')]=_0x437893['attributes'][_0xc53e('0x3a')]?_0x437893['attributes']:_0x311835[_0xc53e('0x33')];if(!_0x2a2ca9[_0xc53e('0x34')]['hasOwnProperty'](_0xc53e('0x3b'))){_0x437893[_0xc53e('0x1f')]=qs[_0xc53e('0x1f')](_0x2a2ca9['query'][_0xc53e('0x1f')]);_0x437893[_0xc53e('0x1d')]=qs[_0xc53e('0x1d')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x1d')]);}_0x437893[_0xc53e('0x3c')]=qs[_0xc53e('0x3d')](_0x2a2ca9['query'][_0xc53e('0x3d')]);_0x437893[_0xc53e('0x3e')]=qs[_0xc53e('0x36')](_['pick'](_0x2a2ca9[_0xc53e('0x34')],_0x311835['filters']),_0x56206b);if(_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x3f')]){_0x437893[_0xc53e('0x3e')]=_[_0xc53e('0x40')](_0x437893[_0xc53e('0x3e')],{'$or':_['map'](_0x56206b,function(_0x3dda55){if(_0x3dda55[_0xc53e('0x41')]!=='VIRTUAL'){var _0x5b7354={};_0x5b7354[_0x3dda55['name']]={'$like':'%'+_0x2a2ca9['query'][_0xc53e('0x3f')]+'%'};return _0x5b7354;}})});}_0x437893=_[_0xc53e('0x40')]({},_0x437893,_0x2a2ca9['options']);var _0x460ee6={'where':_0x437893['where']};return db['AnalyticDefaultReport']['count'](_0x460ee6)[_0xc53e('0x26')](function(_0x4ba96f){_0x2d36c0['count']=_0x4ba96f;if(_0x2a2ca9[_0xc53e('0x34')]['includeAll']){_0x437893[_0xc53e('0x42')]=[{'all':!![]}];}return db[_0xc53e('0x43')]['findAll'](_0x437893);})[_0xc53e('0x26')](function(_0x3a4ebc){_0x2d36c0['rows']=_0x3a4ebc;return _0x2d36c0;})[_0xc53e('0x26')](respondWithFilteredResult(_0x4ace0b,_0x437893))['catch'](handleError(_0x4ace0b,null));};exports['show']=function(_0x481e6d,_0x4efee5){var _0x887d78={'raw':!![],'where':{'id':_0x481e6d[_0xc53e('0x44')]['id']}},_0x17b586={};_0x17b586['model']=_[_0xc53e('0x35')](db[_0xc53e('0x43')]['rawAttributes']);_0x17b586['query']=_[_0xc53e('0x35')](_0x481e6d[_0xc53e('0x34')]);_0x17b586[_0xc53e('0x36')]=_['intersection'](_0x17b586[_0xc53e('0x33')],_0x17b586[_0xc53e('0x34')]);_0x887d78[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x17b586[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x481e6d[_0xc53e('0x34')]['fields']));_0x887d78[_0xc53e('0x37')]=_0x887d78[_0xc53e('0x37')][_0xc53e('0x3a')]?_0x887d78['attributes']:_0x17b586[_0xc53e('0x33')];if(_0x481e6d[_0xc53e('0x34')][_0xc53e('0x45')]){_0x887d78[_0xc53e('0x42')]=[{'all':!![]}];}_0x887d78=_[_0xc53e('0x40')]({},_0x887d78,_0x481e6d[_0xc53e('0x46')]);return db['AnalyticDefaultReport'][_0xc53e('0x47')](_0x887d78)[_0xc53e('0x26')](handleEntityNotFound(_0x4efee5,null))[_0xc53e('0x26')](respondWithResult(_0x4efee5,null))['catch'](handleError(_0x4efee5,null));};exports[_0xc53e('0x48')]=function(_0x1d2491,_0x1eeb65){return db[_0xc53e('0x43')][_0xc53e('0x48')](_0x1d2491[_0xc53e('0x49')],{})[_0xc53e('0x26')](function(_0x2ba2b4){var _0x34de2d=_0x1d2491[_0xc53e('0x4a')]['get']({'plain':!![]});if(!_0x34de2d)throw new Error(_0xc53e('0x4b'));if(_0x34de2d[_0xc53e('0x4c')]===_0xc53e('0x4a')){var _0x3d74ac=_0x2ba2b4[_0xc53e('0x28')]({'plain':!![]});var _0x52dac7='Reports';return db[_0xc53e('0x4d')]['find']({'where':{'name':_0x52dac7,'userProfileId':_0x34de2d[_0xc53e('0x4e')]},'raw':!![]})['then'](function(_0x3a49a4){if(_0x3a49a4&&_0x3a49a4[_0xc53e('0x4f')]===0x0){return db[_0xc53e('0x2a')]['create']({'name':_0x3d74ac[_0xc53e('0x2d')],'resourceId':_0x3d74ac['id'],'type':_0xc53e('0x29'),'sectionId':_0x3a49a4['id']},{})[_0xc53e('0x26')](function(){return _0x2ba2b4;});}else{return _0x2ba2b4;}})['catch'](function(_0x2f7df2){logger['error'](_0xc53e('0x50'),_0x2f7df2);throw _0x2f7df2;});}return _0x2ba2b4;})[_0xc53e('0x26')](respondWithResult(_0x1eeb65,0xc9))['catch'](handleError(_0x1eeb65,null));};exports[_0xc53e('0x25')]=function(_0x1515ea,_0x5bba72){if(_0x1515ea[_0xc53e('0x49')]['id']){delete _0x1515ea[_0xc53e('0x49')]['id'];}return db[_0xc53e('0x43')][_0xc53e('0x47')]({'where':{'id':_0x1515ea[_0xc53e('0x44')]['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x5bba72,null))[_0xc53e('0x26')](saveUpdates(_0x1515ea[_0xc53e('0x49')],null))[_0xc53e('0x26')](respondWithResult(_0x5bba72,null))[_0xc53e('0x51')](handleError(_0x5bba72,null));};exports[_0xc53e('0x27')]=function(_0x47dd5a,_0x8364f6){return db['AnalyticDefaultReport'][_0xc53e('0x47')]({'where':{'id':_0x47dd5a['params']['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x8364f6,null))[_0xc53e('0x26')](removeEntity(_0x8364f6,null))['catch'](handleError(_0x8364f6,null));};exports[_0xc53e('0x52')]=function(_0x7f0bc0,_0x9c0112){var _0x432a91=0xa;var _0x53083b=[_0xc53e('0x53'),_0xc53e('0x54'),'right_join','cross_join'];var _0x3c0aa1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x5fcd58={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x37b091=function(_0x31e22b){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x31e22b);};var _0x13bf71=function(_0x16d8a1){if(!_0x16d8a1||!_0x16d8a1[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xdc0e49='(',_0x520738=0x0;_0x520738<_0x16d8a1[_0xc53e('0x61')]['length'];_0x520738+=0x1){_0x520738>0x0&&(_0xdc0e49+='\x20'+_0x16d8a1[_0xc53e('0x62')]+'\x20');_0xdc0e49+=_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]?_0x13bf71(_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]):_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x64')]+'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738]['condition']+(_0x37b091(_0x16d8a1['rules'][_0x520738]['condition'])?'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x65')]:'');}return _0xdc0e49+')';};var _0x37ac78={'where':{'id':_0x7f0bc0['params']['id']}},_0x25e4b6,_0x247d99,_0x160ca3,_0x3581ab,_0x5a9596;_0x37ac78=_['merge']({},_0x37ac78,_0x7f0bc0[_0xc53e('0x46')]);return db[_0xc53e('0x43')]['find'](_0x37ac78)[_0xc53e('0x26')](function(_0x235a6b){if(_0x235a6b){_0x25e4b6=_0x235a6b;return _0x235a6b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x22829b){if(_0x22829b){if(!_0x22829b[_0xc53e('0x3a')]){throw new db['Sequelize']['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x247d99=_0x22829b;return db[_0xc53e('0x68')][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x29ee08){if(_0x29ee08){_0x160ca3=_[_0xc53e('0x6a')](_0x29ee08,'id');var _0x5a1a4b;var _0x2b6734=squel[_0xc53e('0x6b')]();_0x2b6734[_0xc53e('0x6c')](_0x25e4b6[_0xc53e('0x6d')]);for(var _0x4d2609=0x0;_0x4d2609<_0x247d99[_0xc53e('0x3a')];_0x4d2609+=0x1){_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x6e')]?_0x160ca3[_0x247d99[_0x4d2609][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x247d99[_0x4d2609][_0xc53e('0x64')];_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x70')]?_['replace'](_0x3c0aa1[_0x247d99[_0x4d2609][_0xc53e('0x70')]],'%s',_0x5a1a4b):_0x5a1a4b;_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x71')]?_[_0xc53e('0x72')](_0x5fcd58[_0x247d99[_0x4d2609][_0xc53e('0x71')]],'%s',_0x5a1a4b):_0x5a1a4b;if(_0x247d99[_0x4d2609]['groupBy']){_0x2b6734['group'](_0x5a1a4b);}_0x247d99[_0x4d2609][_0xc53e('0x73')]&&_0x2b6734[_0xc53e('0x3c')](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x2b6734['field'](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x75')]||_0x5a1a4b);}if(_0x25e4b6['joins']){_0x25e4b6[_0xc53e('0x76')]=JSON['parse'](_0x25e4b6[_0xc53e('0x76')]);for(var _0x4e128a=0x0;_0x4e128a<_0x25e4b6[_0xc53e('0x76')][_0xc53e('0x3a')];_0x4e128a+=0x1){if(_0x25e4b6['joins'][_0x4e128a][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x53083b,_0x25e4b6['joins'][_0x4e128a]['type'])&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')]&&_0x25e4b6['joins'][_0x4e128a]['foreignTable']&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']){_0x2b6734[_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['type']](_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x25e4b6[_0xc53e('0x6d')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']));}}}if(_0x25e4b6[_0xc53e('0x7a')]){_0x25e4b6['conditions']=JSON[_0xc53e('0x7b')](_0x25e4b6[_0xc53e('0x7a')]);_0x2b6734[_0xc53e('0x3e')](_0x13bf71(_0x25e4b6[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x5a9596=_0x2b6734[_0xc53e('0x7c')]();_0x2b6734[_0xc53e('0x1f')](_0x432a91);_0x2b6734[_0xc53e('0x1d')](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x2b6734['toString']());return dbH[_0xc53e('0x7f')]['query'](_0x2b6734[_0xc53e('0x80')](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']});}})[_0xc53e('0x26')](respondWithResult(_0x9c0112,null))[_0xc53e('0x51')](handleError(_0x9c0112,null));};function runReport(_0x381652,_0xec3738,_0x3a84a2){var _0x508671=_0xec3738[_0xc53e('0x2d')];var _0x48e337=0xa;var _0x56c66f=[_0xc53e('0x53'),_0xc53e('0x54'),_0xc53e('0x82'),'cross_join'];var _0x35b6dc={'SUM':_0xc53e('0x83'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xc53e('0x85'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x3d2636={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':'DATE(%s)','HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x4c8112=function(_0x1a8ae4){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),'IS\x20NOT\x20EMPTY'],_0x1a8ae4);};var _0x3dac82=function(_0x325287){if(!_0x325287||!_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xe6a976='(',_0x4102bc=0x0;_0x4102bc<_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')];_0x4102bc+=0x1){_0x4102bc>0x0&&(_0xe6a976+='\x20'+_0x325287[_0xc53e('0x62')]+'\x20');_0xe6a976+=_0x325287['rules'][_0x4102bc][_0xc53e('0x63')]?_0x3dac82(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x63')]):_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x64')]+'\x20'+_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')]+(_0x4c8112(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')])?'\x20'+_0x325287['rules'][_0x4102bc][_0xc53e('0x65')]:'');}return _0xe6a976+')';};var _0x190509={'where':{'id':_0x381652['id']}},_0x110e32,_0x2135d4,_0x4bbf8a,_0x31b06d,_0x21fc8d;_0x190509=_[_0xc53e('0x40')]({},_0x190509,_0x3a84a2);return db[_0xc53e('0x43')]['find'](_0x190509)[_0xc53e('0x26')](function(_0x138870){if(_0x138870){_0x110e32=_0x138870;return _0x138870[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x621e78){if(_0x621e78){if(!_0x621e78[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))]['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x2135d4=_0x621e78;return db['AnalyticMetric'][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x3fe278){if(_0x3fe278){_0x4bbf8a=_['keyBy'](_0x3fe278,'id');var _0x7c56eb;var _0x36dffe=squel[_0xc53e('0x6b')]();_0x36dffe['from'](_0x110e32[_0xc53e('0x6d')]);for(var _0xedb93a=0x0;_0xedb93a<_0x2135d4[_0xc53e('0x3a')];_0xedb93a+=0x1){_0x7c56eb=_0x2135d4[_0xedb93a]['MetricId']?_0x4bbf8a[_0x2135d4[_0xedb93a][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x2135d4[_0xedb93a][_0xc53e('0x64')];_0x7c56eb=_0x2135d4[_0xedb93a][_0xc53e('0x70')]?_[_0xc53e('0x72')](_0x35b6dc[_0x2135d4[_0xedb93a]['function']],'%s',_0x7c56eb):_0x7c56eb;_0x7c56eb=_0x2135d4[_0xedb93a]['format']?_['replace'](_0x3d2636[_0x2135d4[_0xedb93a][_0xc53e('0x71')]],'%s',_0x7c56eb):_0x7c56eb;if(_0x2135d4[_0xedb93a][_0xc53e('0x8a')]){_0x36dffe[_0xc53e('0x63')](_0x7c56eb);}_0x2135d4[_0xedb93a][_0xc53e('0x73')]&&_0x36dffe['order'](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x73')]==='DESC'?![]:!![]);_0x36dffe[_0xc53e('0x64')](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x75')]||_0x7c56eb);}if(_0x110e32[_0xc53e('0x76')]){_0x110e32[_0xc53e('0x76')]=JSON['parse'](_0x110e32[_0xc53e('0x76')]);for(var _0xc23eef=0x0;_0xc23eef<_0x110e32[_0xc53e('0x76')][_0xc53e('0x3a')];_0xc23eef+=0x1){if(_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x56c66f,_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')])&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x8b')]){_0x36dffe[_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]](_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x110e32[_0xc53e('0x6d')],_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignTable'],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignKey']));}}}if(_0x110e32[_0xc53e('0x7a')]){_0x110e32[_0xc53e('0x7a')]=JSON['parse'](_0x110e32[_0xc53e('0x7a')]);_0x36dffe[_0xc53e('0x3e')](_0x3dac82(_0x110e32[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x21fc8d=_0x36dffe[_0xc53e('0x7c')]();_0x36dffe[_0xc53e('0x1f')](_0x48e337);_0x36dffe[_0xc53e('0x1d')](0x0);return;}})[_0xc53e('0x26')](function(){if(_0xec3738[_0xc53e('0x8c')]==='web'){return null;}var _0x37c8e6=_['merge'](_0xec3738,{'name':_0xec3738[_0xc53e('0x8d')]||_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],'basename':_0x508671,'savename':util[_0xc53e('0x71')](_0xc53e('0x8e'),_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],require(_0xc53e('0x8f'))[_0xc53e('0x90')](0x4),_0xec3738[_0xc53e('0x8c')]||_0xc53e('0x91')),'reportId':_0x110e32['id'],'reportType':_0xc53e('0x92')});return db[_0xc53e('0x93')]['create'](_0x37c8e6,{'raw':!![]});})[_0xc53e('0x26')](function(_0x575ef5){if(_0x110e32[_0xc53e('0x6d')]===_0xc53e('0x94')){_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xec3738['startDate'],_0xec3738[_0xc53e('0x95')]);}else{_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+_0xc53e('0x96'),_0xec3738['startDate'],_0xec3738['endDate']);}if(_0x575ef5){logger[_0xc53e('0x97')](_0xc53e('0x98'),_0x21fc8d[_0xc53e('0x80')]());require(_0xc53e('0x99'))[_0xc53e('0x9a')](path[_0xc53e('0x53')](__dirname,'../../components/export/',_0x575ef5[_0xc53e('0x8c')]),[_0x575ef5['id'],_0x21fc8d[_0xc53e('0x80')](),path[_0xc53e('0x53')](__dirname,_0xc53e('0x9b'),_0x575ef5[_0xc53e('0x9c')]),_0x508671]);return _0x575ef5;}else{var _0x4f527e=squel[_0xc53e('0x6b')]();_0x4f527e[_0xc53e('0x6c')]('('+_0x21fc8d[_0xc53e('0x80')]()+')',_0xc53e('0x9d'));_0x4f527e[_0xc53e('0x64')](_0xc53e('0x9e'),_0xc53e('0x20'));_0x21fc8d[_0xc53e('0x1f')](_0xec3738[_0xc53e('0x1f')]||_0x48e337);_0x21fc8d[_0xc53e('0x1d')](_0xec3738[_0xc53e('0x1d')]||0x0);return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x4f527e['toString'](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']})[_0xc53e('0x26')](function(_0x4ee56b){if(!_0x4ee56b['length']){_0x31b06d=0x0;}else{_0x31b06d=_0x4ee56b[0x0][_0xc53e('0x20')]||0x0;}return dbH['sequelize'][_0xc53e('0x34')](_0x21fc8d['toString'](),{'type':dbH[_0xc53e('0x7f')]['QueryTypes'][_0xc53e('0x9f')]});})[_0xc53e('0x26')](function(_0x10ad32){return{'rows':_0x10ad32||[],'count':_0x31b06d};});}});}exports['run']=function(_0xf3f34a,_0x5dd87e){return runReport(_0xf3f34a[_0xc53e('0x44')],_0xf3f34a[_0xc53e('0x34')],_0xf3f34a[_0xc53e('0x46')])[_0xc53e('0x26')](respondWithResult(_0x5dd87e,null))[_0xc53e('0x51')](handleError(_0x5dd87e,null));};exports[_0xc53e('0xa0')]=runReport;exports[_0xc53e('0x34')]=function(_0x265292,_0x2c776c){var _0x383f22=0xa;var _0x51f2a4=['join',_0xc53e('0x54'),'right_join',_0xc53e('0xa1')];var _0xbc960={'SUM':_0xc53e('0x83'),'COUNT':_0xc53e('0xa2'),'COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':_0xc53e('0xa3'),'AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x34cb12={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x227e0c=function(_0x4c0802){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x4c0802);};var _0x590fb6=function(_0x15d269){if(!_0x15d269||!_0x15d269[_0xc53e('0x61')]['length']){return'';}for(var _0x5253b1='(',_0x208c17=0x0;_0x208c17<_0x15d269['rules'][_0xc53e('0x3a')];_0x208c17+=0x1){_0x208c17>0x0&&(_0x5253b1+='\x20'+_0x15d269[_0xc53e('0x62')]+'\x20');_0x5253b1+=_0x15d269['rules'][_0x208c17]['group']?_0x590fb6(_0x15d269[_0xc53e('0x61')][_0x208c17]['group']):_0x15d269[_0xc53e('0x61')][_0x208c17]['field']+'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')]+(_0x227e0c(_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')])?'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17]['value']:'');}return _0x5253b1+')';};var _0x2f5d22={'where':{'id':_0x265292[_0xc53e('0x44')]['id']}},_0x478e57,_0x5e427a,_0x3e666b,_0x365a98,_0x375d8b;_0x2f5d22=_[_0xc53e('0x40')]({},_0x2f5d22,_0x265292[_0xc53e('0x46')]);return db[_0xc53e('0x43')][_0xc53e('0x47')](_0x2f5d22)[_0xc53e('0x26')](function(_0x3b778b){if(_0x3b778b){_0x478e57=_0x3b778b;return _0x3b778b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x55581a){if(_0x55581a){if(!_0x55581a[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))][(_0xc53e('0xa4'))](_0xc53e('0x67'),0x193);}_0x5e427a=_0x55581a;return db[_0xc53e('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x34c717){if(_0x34c717){_0x3e666b=_[_0xc53e('0x6a')](_0x34c717,'id');var _0x2718fe;var _0x15014e=squel[_0xc53e('0x6b')]();_0x15014e[_0xc53e('0x6c')](_0x478e57[_0xc53e('0x6d')]);for(var _0x2d80f5=0x0;_0x2d80f5<_0x5e427a[_0xc53e('0x3a')];_0x2d80f5+=0x1){_0x2718fe=_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]?_0x3e666b[_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x5e427a[_0x2d80f5][_0xc53e('0x64')];_0x2718fe=_0x5e427a[_0x2d80f5]['function']?_[_0xc53e('0x72')](_0xbc960[_0x5e427a[_0x2d80f5][_0xc53e('0x70')]],'%s',_0x2718fe):_0x2718fe;_0x2718fe=_0x5e427a[_0x2d80f5]['format']?_[_0xc53e('0x72')](_0x34cb12[_0x5e427a[_0x2d80f5][_0xc53e('0x71')]],'%s',_0x2718fe):_0x2718fe;if(_0x5e427a[_0x2d80f5][_0xc53e('0x8a')]){_0x15014e['group'](_0x2718fe);}_0x5e427a[_0x2d80f5]['orderBy']&&_0x15014e[_0xc53e('0x3c')](_0x2718fe,_0x5e427a[_0x2d80f5][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x15014e[_0xc53e('0x64')](_0x2718fe,_0x5e427a[_0x2d80f5]['alias']||_0x2718fe);}if(_0x478e57[_0xc53e('0x76')]){_0x478e57[_0xc53e('0x76')]=JSON[_0xc53e('0x7b')](_0x478e57['joins']);for(var _0x48d301=0x0;_0x48d301<_0x478e57[_0xc53e('0x76')][_0xc53e('0x3a')];_0x48d301+=0x1){if(_0x478e57[_0xc53e('0x76')][_0x48d301]['type']&&_[_0xc53e('0x5c')](_0x51f2a4,_0x478e57[_0xc53e('0x76')][_0x48d301]['type'])&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')]&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x78')]&&_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']){_0x15014e[_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x41')]](_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],null,util['format'](_0xc53e('0x79'),_0x478e57[_0xc53e('0x6d')],_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']));}}}if(_0x478e57[_0xc53e('0x7a')]){_0x478e57[_0xc53e('0x7a')]=JSON[_0xc53e('0x7b')](_0x478e57[_0xc53e('0x7a')]);_0x15014e[_0xc53e('0x3e')](_0x590fb6(_0x478e57[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x375d8b=_0x15014e[_0xc53e('0x7c')]();_0x15014e[_0xc53e('0x1f')](_0x383f22);_0x15014e['offset'](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x15014e[_0xc53e('0x80')]());return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x15014e[_0xc53e('0x80')](),{'type':dbH['sequelize'][_0xc53e('0x81')][_0xc53e('0x9f')]});}})[_0xc53e('0x26')](function(){return{'sql':_0x375d8b[_0xc53e('0x80')]()};})[_0xc53e('0x26')](respondWithResult(_0x2c776c,null))[_0xc53e('0x51')](handleError(_0x2c776c,null));};
\ No newline at end of file
+var _0x1967=['conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','table','web','%s-%s.%s','randomstring','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','select','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','get','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','DefaultReports','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey'];(function(_0xa98890,_0x25eca7){var _0x390b97=function(_0x6b0dbf){while(--_0x6b0dbf){_0xa98890['push'](_0xa98890['shift']());}};_0x390b97(++_0x25eca7);}(_0x1967,0x173));var _0x7196=function(_0x18c57f,_0x5c9e22){_0x18c57f=_0x18c57f-0x0;var _0x1f3c84=_0x1967[_0x18c57f];return _0x1f3c84;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];var dbH=require(_0x7196('0x1b'))[_0x7196('0x1c')];function respondWithStatusCode(_0xba707b,_0x154101){_0x154101=_0x154101||0xcc;return function(_0x4e8c4c){if(_0x4e8c4c){return _0xba707b[_0x7196('0x1d')](_0x154101);}return _0xba707b[_0x7196('0x1e')](_0x154101)[_0x7196('0x1f')]();};}function respondWithResult(_0xf098c1,_0x511aa1){_0x511aa1=_0x511aa1||0xc8;return function(_0x31c778){if(_0x31c778){return _0xf098c1['status'](_0x511aa1)[_0x7196('0x20')](_0x31c778);}};}function respondWithFilteredResult(_0x2590a6,_0xf7e97){return function(_0x3ed1ad){if(_0x3ed1ad){var _0x12dce7=typeof _0xf7e97[_0x7196('0x21')]===_0x7196('0x22')&&typeof _0xf7e97[_0x7196('0x23')]===_0x7196('0x22');var _0x32fe2b=_0x3ed1ad[_0x7196('0x24')];var _0x5b716a=_0x12dce7?0x0:_0xf7e97['offset'];var _0x448f13=_0x12dce7?_0x3ed1ad[_0x7196('0x24')]:_0xf7e97[_0x7196('0x21')]+_0xf7e97['limit'];var _0x39b944;if(_0x448f13>=_0x32fe2b){_0x448f13=_0x32fe2b;_0x39b944=0xc8;}else{_0x39b944=0xce;}_0x2590a6['status'](_0x39b944);return _0x2590a6['set'](_0x7196('0x25'),_0x5b716a+'-'+_0x448f13+'/'+_0x32fe2b)[_0x7196('0x20')](_0x3ed1ad);}return null;};}function patchUpdates(_0x8dee9d){return function(_0x4ddf78){try{jsonpatch['apply'](_0x4ddf78,_0x8dee9d,!![]);}catch(_0x38d291){return BPromise[_0x7196('0x26')](_0x38d291);}return _0x4ddf78['save']();};}function saveUpdates(_0x18649b,_0x27ff84){return function(_0x6e22e5){if(_0x6e22e5){return _0x6e22e5[_0x7196('0x27')](_0x18649b)[_0x7196('0x28')](function(_0x549f34){return _0x549f34;});}return null;};}function removeEntity(_0x3f8178,_0x520d01){return function(_0x3ce9a0){if(_0x3ce9a0){return _0x3ce9a0[_0x7196('0x29')]()[_0x7196('0x28')](function(){var _0xa69810=_0x3ce9a0[_0x7196('0x2a')]({'plain':!![]});var _0x43f6a2='DefaultReports';return db['UserProfileResource'][_0x7196('0x29')]({'where':{'type':_0x43f6a2,'resourceId':_0xa69810['id']}})[_0x7196('0x28')](function(){return _0x3ce9a0;});})[_0x7196('0x28')](function(){_0x3f8178['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41cfd2,_0x162cfc){return function(_0x675e64){if(!_0x675e64){_0x41cfd2['sendStatus'](0x194);}return _0x675e64;};}function handleError(_0x35eef9,_0x4ecea1){_0x4ecea1=_0x4ecea1||0x1f4;return function(_0x4fd339){logger['error'](_0x4fd339[_0x7196('0x2b')]);if(_0x4fd339[_0x7196('0x2c')]){delete _0x4fd339[_0x7196('0x2c')];}_0x35eef9['status'](_0x4ecea1)[_0x7196('0x2d')](_0x4fd339);};}exports[_0x7196('0x2e')]=function(_0x2f9583,_0xf999e9){var _0x50c386={},_0x39710d={},_0x429160={'count':0x0,'rows':[]};var _0xd07f22=_[_0x7196('0x2f')](db[_0x7196('0x30')][_0x7196('0x31')],function(_0x15c5f0){return{'name':_0x15c5f0[_0x7196('0x32')],'type':_0x15c5f0[_0x7196('0x33')][_0x7196('0x34')]};});_0x39710d[_0x7196('0x35')]=_['map'](_0xd07f22,_0x7196('0x2c'));_0x39710d['query']=_[_0x7196('0x36')](_0x2f9583['query']);_0x39710d[_0x7196('0x37')]=_[_0x7196('0x38')](_0x39710d['model'],_0x39710d[_0x7196('0x39')]);_0x50c386[_0x7196('0x3a')]=_[_0x7196('0x38')](_0x39710d[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x2f9583['query'][_0x7196('0x3b')]));_0x50c386[_0x7196('0x3a')]=_0x50c386[_0x7196('0x3a')][_0x7196('0x3c')]?_0x50c386[_0x7196('0x3a')]:_0x39710d[_0x7196('0x35')];if(!_0x2f9583['query'][_0x7196('0x3d')](_0x7196('0x3e'))){_0x50c386[_0x7196('0x23')]=qs['limit'](_0x2f9583[_0x7196('0x39')][_0x7196('0x23')]);_0x50c386[_0x7196('0x21')]=qs[_0x7196('0x21')](_0x2f9583[_0x7196('0x39')][_0x7196('0x21')]);}_0x50c386[_0x7196('0x3f')]=qs[_0x7196('0x40')](_0x2f9583[_0x7196('0x39')][_0x7196('0x40')]);_0x50c386['where']=qs[_0x7196('0x37')](_[_0x7196('0x41')](_0x2f9583['query'],_0x39710d[_0x7196('0x37')]),_0xd07f22);if(_0x2f9583['query']['filter']){_0x50c386[_0x7196('0x42')]=_[_0x7196('0x43')](_0x50c386['where'],{'$or':_['map'](_0xd07f22,function(_0x1bad95){if(_0x1bad95[_0x7196('0x33')]!==_0x7196('0x44')){var _0x4c2341={};_0x4c2341[_0x1bad95[_0x7196('0x2c')]]={'$like':'%'+_0x2f9583[_0x7196('0x39')][_0x7196('0x45')]+'%'};return _0x4c2341;}})});}_0x50c386=_[_0x7196('0x43')]({},_0x50c386,_0x2f9583[_0x7196('0x46')]);var _0x428d76={'where':_0x50c386[_0x7196('0x42')]};return db[_0x7196('0x30')]['count'](_0x428d76)[_0x7196('0x28')](function(_0xa852e1){_0x429160['count']=_0xa852e1;if(_0x2f9583[_0x7196('0x39')][_0x7196('0x47')]){_0x50c386['include']=[{'all':!![]}];}return db[_0x7196('0x30')][_0x7196('0x48')](_0x50c386);})[_0x7196('0x28')](function(_0x5749e2){_0x429160[_0x7196('0x49')]=_0x5749e2;return _0x429160;})[_0x7196('0x28')](respondWithFilteredResult(_0xf999e9,_0x50c386))['catch'](handleError(_0xf999e9,null));};exports[_0x7196('0x4a')]=function(_0x1a7052,_0x4f0c6c){var _0x335e6f={'raw':!![],'where':{'id':_0x1a7052['params']['id']}},_0x53a5e6={};_0x53a5e6['model']=_['keys'](db['AnalyticDefaultReport'][_0x7196('0x31')]);_0x53a5e6['query']=_[_0x7196('0x36')](_0x1a7052[_0x7196('0x39')]);_0x53a5e6[_0x7196('0x37')]=_[_0x7196('0x38')](_0x53a5e6['model'],_0x53a5e6[_0x7196('0x39')]);_0x335e6f['attributes']=_[_0x7196('0x38')](_0x53a5e6[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x1a7052['query'][_0x7196('0x3b')]));_0x335e6f[_0x7196('0x3a')]=_0x335e6f[_0x7196('0x3a')]['length']?_0x335e6f['attributes']:_0x53a5e6[_0x7196('0x35')];if(_0x1a7052['query'][_0x7196('0x47')]){_0x335e6f['include']=[{'all':!![]}];}_0x335e6f=_['merge']({},_0x335e6f,_0x1a7052[_0x7196('0x46')]);return db['AnalyticDefaultReport']['find'](_0x335e6f)['then'](handleEntityNotFound(_0x4f0c6c,null))[_0x7196('0x28')](respondWithResult(_0x4f0c6c,null))['catch'](handleError(_0x4f0c6c,null));};exports['create']=function(_0x28591e,_0x182c8b){return db[_0x7196('0x30')][_0x7196('0x4b')](_0x28591e['body'],{})[_0x7196('0x28')](function(_0x564688){var _0x36844f=_0x28591e[_0x7196('0x4c')]['get']({'plain':!![]});if(!_0x36844f)throw new Error(_0x7196('0x4d'));if(_0x36844f[_0x7196('0x4e')]===_0x7196('0x4c')){var _0x4fa18f=_0x564688[_0x7196('0x2a')]({'plain':!![]});var _0x5d51aa=_0x7196('0x4f');return db[_0x7196('0x50')][_0x7196('0x51')]({'where':{'name':_0x5d51aa,'userProfileId':_0x36844f[_0x7196('0x52')]},'raw':!![]})[_0x7196('0x28')](function(_0x19733a){if(_0x19733a&&_0x19733a[_0x7196('0x53')]===0x0){return db[_0x7196('0x54')]['create']({'name':_0x4fa18f['name'],'resourceId':_0x4fa18f['id'],'type':_0x7196('0x55'),'sectionId':_0x19733a['id']},{})[_0x7196('0x28')](function(){return _0x564688;});}else{return _0x564688;}})[_0x7196('0x56')](function(_0xe4b032){logger['error'](_0x7196('0x57'),_0xe4b032);throw _0xe4b032;});}return _0x564688;})[_0x7196('0x28')](respondWithResult(_0x182c8b,0xc9))[_0x7196('0x56')](handleError(_0x182c8b,null));};exports[_0x7196('0x27')]=function(_0x9fcfd4,_0x3177c2){if(_0x9fcfd4[_0x7196('0x58')]['id']){delete _0x9fcfd4[_0x7196('0x58')]['id'];}return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x9fcfd4[_0x7196('0x59')]['id']}})['then'](handleEntityNotFound(_0x3177c2,null))[_0x7196('0x28')](saveUpdates(_0x9fcfd4[_0x7196('0x58')],null))[_0x7196('0x28')](respondWithResult(_0x3177c2,null))['catch'](handleError(_0x3177c2,null));};exports[_0x7196('0x29')]=function(_0x5ca1ca,_0x34407d){return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x5ca1ca[_0x7196('0x59')]['id']}})[_0x7196('0x28')](handleEntityNotFound(_0x34407d,null))['then'](removeEntity(_0x34407d,null))[_0x7196('0x56')](handleError(_0x34407d,null));};exports['preview']=function(_0x4be36d,_0x5b9824){var _0x1bc358=0xa;var _0x3be180=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x2d8b3d={'SUM':'SUM(%s)','COUNT':_0x7196('0x5e'),'COUNT DISTINCT':_0x7196('0x5f'),'MAX':_0x7196('0x60'),'MIN':_0x7196('0x61'),'AVG':_0x7196('0x62'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7196('0x63')};var _0x1c7eb2={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x43ee13=function(_0x13e9d0){return!_[_0x7196('0x69')]([_0x7196('0x6a'),'IS\x20NOT\x20NULL',_0x7196('0x6b'),_0x7196('0x6c')],_0x13e9d0);};var _0x27d5d7=function(_0x33f43b){if(!_0x33f43b||!_0x33f43b['rules'][_0x7196('0x3c')]){return'';}for(var _0x204c3a='(',_0x1f3acc=0x0;_0x1f3acc<_0x33f43b[_0x7196('0x6d')][_0x7196('0x3c')];_0x1f3acc+=0x1){_0x1f3acc>0x0&&(_0x204c3a+='\x20'+_0x33f43b[_0x7196('0x6e')]+'\x20');_0x204c3a+=_0x33f43b[_0x7196('0x6d')][_0x1f3acc]['group']?_0x27d5d7(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x6f')]):_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x70')]+'\x20'+_0x33f43b['rules'][_0x1f3acc][_0x7196('0x71')]+(_0x43ee13(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x71')])?'\x20'+_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x72')]:'');}return _0x204c3a+')';};var _0x37c6be={'where':{'id':_0x4be36d['params']['id']}},_0x57065,_0x517dfb,_0x56b2eb,_0x56955e,_0x72f6f1;_0x37c6be=_[_0x7196('0x43')]({},_0x37c6be,_0x4be36d[_0x7196('0x46')]);return db[_0x7196('0x30')][_0x7196('0x51')](_0x37c6be)[_0x7196('0x28')](function(_0x30d44f){if(_0x30d44f){_0x57065=_0x30d44f;return _0x30d44f[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x3881a5){if(_0x3881a5){if(!_0x3881a5['length']){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x517dfb=_0x3881a5;return db[_0x7196('0x76')][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x45e21f){if(_0x45e21f){_0x56b2eb=_[_0x7196('0x77')](_0x45e21f,'id');var _0x2f36f8;var _0x4cc5e3=squel['select']();_0x4cc5e3[_0x7196('0x78')](_0x57065['table']);for(var _0x30d114=0x0;_0x30d114<_0x517dfb['length'];_0x30d114+=0x1){_0x2f36f8=_0x517dfb[_0x30d114][_0x7196('0x79')]?_0x56b2eb[_0x517dfb[_0x30d114][_0x7196('0x79')]][_0x7196('0x7a')]:_0x517dfb[_0x30d114][_0x7196('0x70')];_0x2f36f8=_0x517dfb[_0x30d114]['function']?_['replace'](_0x2d8b3d[_0x517dfb[_0x30d114][_0x7196('0x7b')]],'%s',_0x2f36f8):_0x2f36f8;_0x2f36f8=_0x517dfb[_0x30d114]['format']?_[_0x7196('0x7c')](_0x1c7eb2[_0x517dfb[_0x30d114][_0x7196('0x7d')]],'%s',_0x2f36f8):_0x2f36f8;if(_0x517dfb[_0x30d114][_0x7196('0x7e')]){_0x4cc5e3[_0x7196('0x6f')](_0x2f36f8);}_0x517dfb[_0x30d114][_0x7196('0x7f')]&&_0x4cc5e3[_0x7196('0x3f')](_0x2f36f8,_0x517dfb[_0x30d114]['orderBy']===_0x7196('0x80')?![]:!![]);_0x4cc5e3[_0x7196('0x70')](_0x2f36f8,_0x517dfb[_0x30d114][_0x7196('0x81')]||_0x2f36f8);}if(_0x57065[_0x7196('0x82')]){_0x57065[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x82')]);for(var _0x473c0e=0x0;_0x473c0e<_0x57065[_0x7196('0x82')][_0x7196('0x3c')];_0x473c0e+=0x1){if(_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')]&&_['includes'](_0x3be180,_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')])&&_0x57065['joins'][_0x473c0e]['parentKey']&&_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')]&&_0x57065[_0x7196('0x82')][_0x473c0e]['foreignKey']){_0x4cc5e3[_0x57065[_0x7196('0x82')][_0x473c0e]['type']](_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],null,util['format'](_0x7196('0x85'),_0x57065['table'],_0x57065['joins'][_0x473c0e][_0x7196('0x86')],_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],_0x57065['joins'][_0x473c0e][_0x7196('0x87')]));}}}if(_0x57065['conditions']){_0x57065[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x88')]);_0x4cc5e3[_0x7196('0x42')](_0x27d5d7(_0x57065[_0x7196('0x88')]['group']));}_0x72f6f1=_0x4cc5e3[_0x7196('0x89')]();_0x4cc5e3[_0x7196('0x23')](_0x1bc358);_0x4cc5e3[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x4cc5e3[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x4cc5e3['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});}})[_0x7196('0x28')](respondWithResult(_0x5b9824,null))['catch'](handleError(_0x5b9824,null));};function runReport(_0x1364f5,_0x2cb53c,_0x4fe2cb){var _0x2e4807=_0x2cb53c['name'];var _0xd6d8cf=0xa;var _0x5318c1=[_0x7196('0x5a'),_0x7196('0x5b'),'right_join',_0x7196('0x5d')];var _0x2b52c0={'SUM':_0x7196('0x90'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7196('0x60'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0x509c4a={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x26048c=function(_0x1a4d17){return!_[_0x7196('0x69')]([_0x7196('0x6a'),_0x7196('0x93'),_0x7196('0x6b'),'IS\x20NOT\x20EMPTY'],_0x1a4d17);};var _0x5acff1=function(_0x32ab6c){if(!_0x32ab6c||!_0x32ab6c['rules']['length']){return'';}for(var _0x2bfdc4='(',_0x1604fa=0x0;_0x1604fa<_0x32ab6c[_0x7196('0x6d')][_0x7196('0x3c')];_0x1604fa+=0x1){_0x1604fa>0x0&&(_0x2bfdc4+='\x20'+_0x32ab6c['operator']+'\x20');_0x2bfdc4+=_0x32ab6c['rules'][_0x1604fa][_0x7196('0x6f')]?_0x5acff1(_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x6f')]):_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['field']+'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['condition']+(_0x26048c(_0x32ab6c['rules'][_0x1604fa][_0x7196('0x71')])?'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x72')]:'');}return _0x2bfdc4+')';};var _0x494418={'where':{'id':_0x1364f5['id']}},_0x400aa5,_0x40d4c3,_0x1824e2,_0x30c54b,_0x10712f;_0x494418=_[_0x7196('0x43')]({},_0x494418,_0x4fe2cb);return db[_0x7196('0x30')][_0x7196('0x51')](_0x494418)['then'](function(_0x9bd2ea){if(_0x9bd2ea){_0x400aa5=_0x9bd2ea;return _0x9bd2ea[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x408760){if(_0x408760){if(!_0x408760[_0x7196('0x3c')]){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x40d4c3=_0x408760;return db[_0x7196('0x76')]['findAll']({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x4b98de){if(_0x4b98de){_0x1824e2=_['keyBy'](_0x4b98de,'id');var _0x1dcf93;var _0x25d323=squel['select']();_0x25d323[_0x7196('0x78')](_0x400aa5[_0x7196('0x94')]);for(var _0x48ceda=0x0;_0x48ceda<_0x40d4c3[_0x7196('0x3c')];_0x48ceda+=0x1){_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x79')]?_0x1824e2[_0x40d4c3[_0x48ceda][_0x7196('0x79')]][_0x7196('0x7a')]:_0x40d4c3[_0x48ceda][_0x7196('0x70')];_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7b')]?_['replace'](_0x2b52c0[_0x40d4c3[_0x48ceda][_0x7196('0x7b')]],'%s',_0x1dcf93):_0x1dcf93;_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0x509c4a[_0x40d4c3[_0x48ceda]['format']],'%s',_0x1dcf93):_0x1dcf93;if(_0x40d4c3[_0x48ceda]['groupBy']){_0x25d323['group'](_0x1dcf93);}_0x40d4c3[_0x48ceda][_0x7196('0x7f')]&&_0x25d323[_0x7196('0x3f')](_0x1dcf93,_0x40d4c3[_0x48ceda][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x25d323[_0x7196('0x70')](_0x1dcf93,_0x40d4c3[_0x48ceda]['alias']||_0x1dcf93);}if(_0x400aa5[_0x7196('0x82')]){_0x400aa5['joins']=JSON[_0x7196('0x83')](_0x400aa5[_0x7196('0x82')]);for(var _0x33d5bf=0x0;_0x33d5bf<_0x400aa5[_0x7196('0x82')][_0x7196('0x3c')];_0x33d5bf+=0x1){if(_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x33')]&&_['includes'](_0x5318c1,_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type'])&&_0x400aa5['joins'][_0x33d5bf]['parentKey']&&_0x400aa5['joins'][_0x33d5bf]['foreignTable']&&_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]){_0x25d323[_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type']](_0x400aa5[_0x7196('0x82')][_0x33d5bf]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x400aa5[_0x7196('0x94')],_0x400aa5['joins'][_0x33d5bf][_0x7196('0x86')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x84')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]));}}}if(_0x400aa5[_0x7196('0x88')]){_0x400aa5[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x400aa5['conditions']);_0x25d323[_0x7196('0x42')](_0x5acff1(_0x400aa5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x10712f=_0x25d323['clone']();_0x25d323[_0x7196('0x23')](_0xd6d8cf);_0x25d323[_0x7196('0x21')](0x0);return;}})[_0x7196('0x28')](function(){if(_0x2cb53c['output']===_0x7196('0x95')){return null;}var _0x46a563=_[_0x7196('0x43')](_0x2cb53c,{'name':_0x2cb53c['fullPath']||_0x2cb53c[_0x7196('0x2c')]||_0x400aa5[_0x7196('0x2c')],'basename':_0x2e4807,'savename':util['format'](_0x7196('0x96'),_0x2cb53c['name']||_0x400aa5[_0x7196('0x2c')],require(_0x7196('0x97'))['generate'](0x4),_0x2cb53c[_0x7196('0x98')]||'csv'),'reportId':_0x400aa5['id'],'reportType':_0x7196('0x99')});return db[_0x7196('0x9a')][_0x7196('0x4b')](_0x46a563,{'raw':!![]});})['then'](function(_0xd9619d){if(_0x400aa5[_0x7196('0x94')]===_0x7196('0x9b')){_0x10712f[_0x7196('0x42')](_0x400aa5['table']+_0x7196('0x9c'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}else{_0x10712f['where'](_0x400aa5['table']+_0x7196('0x9f'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}if(_0xd9619d){logger[_0x7196('0xa0')]('Run\x20Query:',_0x10712f[_0x7196('0x8c')]());require('child_process')[_0x7196('0xa1')](path['join'](__dirname,_0x7196('0xa2'),_0xd9619d[_0x7196('0x98')]),[_0xd9619d['id'],_0x10712f[_0x7196('0x8c')](),path[_0x7196('0x5a')](__dirname,_0x7196('0xa3'),_0xd9619d[_0x7196('0xa4')]),_0x2e4807]);return _0xd9619d;}else{var _0x342fb1=squel['select']();_0x342fb1[_0x7196('0x78')]('('+_0x10712f[_0x7196('0x8c')]()+')',_0x7196('0xa5'));_0x342fb1[_0x7196('0x70')](_0x7196('0xa6'),_0x7196('0x24'));_0x10712f[_0x7196('0x23')](_0x2cb53c[_0x7196('0x23')]||_0xd6d8cf);_0x10712f['offset'](_0x2cb53c[_0x7196('0x21')]||0x0);return dbH[_0x7196('0x8d')]['query'](_0x342fb1[_0x7196('0x8c')](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]})[_0x7196('0x28')](function(_0xdf1ede){if(!_0xdf1ede[_0x7196('0x3c')]){_0x30c54b=0x0;}else{_0x30c54b=_0xdf1ede[0x0]['count']||0x0;}return dbH['sequelize'][_0x7196('0x39')](_0x10712f['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});})[_0x7196('0x28')](function(_0x2df80a){return{'rows':_0x2df80a||[],'count':_0x30c54b};});}});}exports['run']=function(_0x392e74,_0x17ba6d){return runReport(_0x392e74[_0x7196('0x59')],_0x392e74[_0x7196('0x39')],_0x392e74[_0x7196('0x46')])[_0x7196('0x28')](respondWithResult(_0x17ba6d,null))[_0x7196('0x56')](handleError(_0x17ba6d,null));};exports[_0x7196('0xa7')]=runReport;exports[_0x7196('0x39')]=function(_0x5a3c87,_0x58fb86){var _0x51da79=0xa;var _0x144613=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x9055af={'SUM':_0x7196('0x90'),'COUNT':_0x7196('0x5e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0xab9595={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':'HOUR(%s)','ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5236a0=function(_0x520fe8){return!_['includes'](['IS\x20NULL',_0x7196('0x93'),'IS\x20EMPTY',_0x7196('0x6c')],_0x520fe8);};var _0x425a57=function(_0x302728){if(!_0x302728||!_0x302728[_0x7196('0x6d')][_0x7196('0x3c')]){return'';}for(var _0x14492e='(',_0x58df43=0x0;_0x58df43<_0x302728[_0x7196('0x6d')][_0x7196('0x3c')];_0x58df43+=0x1){_0x58df43>0x0&&(_0x14492e+='\x20'+_0x302728[_0x7196('0x6e')]+'\x20');_0x14492e+=_0x302728['rules'][_0x58df43][_0x7196('0x6f')]?_0x425a57(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x6f')]):_0x302728['rules'][_0x58df43]['field']+'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')]+(_0x5236a0(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')])?'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x72')]:'');}return _0x14492e+')';};var _0x1a8a5a={'where':{'id':_0x5a3c87[_0x7196('0x59')]['id']}},_0x2944e5,_0x3f9385,_0xbd94ef,_0x5d2a56,_0x2fb552;_0x1a8a5a=_['merge']({},_0x1a8a5a,_0x5a3c87[_0x7196('0x46')]);return db[_0x7196('0x30')]['find'](_0x1a8a5a)[_0x7196('0x28')](function(_0x386259){if(_0x386259){_0x2944e5=_0x386259;return _0x386259[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x1e7a64){if(_0x1e7a64){if(!_0x1e7a64[_0x7196('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0x7196('0x75'),0x193);}_0x3f9385=_0x1e7a64;return db['AnalyticMetric'][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x30db09){if(_0x30db09){_0xbd94ef=_['keyBy'](_0x30db09,'id');var _0x4729e1;var _0x66e1e6=squel[_0x7196('0xa8')]();_0x66e1e6[_0x7196('0x78')](_0x2944e5[_0x7196('0x94')]);for(var _0x1e2105=0x0;_0x1e2105<_0x3f9385[_0x7196('0x3c')];_0x1e2105+=0x1){_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x79')]?_0xbd94ef[_0x3f9385[_0x1e2105][_0x7196('0x79')]]['metric']:_0x3f9385[_0x1e2105][_0x7196('0x70')];_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7b')]?_[_0x7196('0x7c')](_0x9055af[_0x3f9385[_0x1e2105][_0x7196('0x7b')]],'%s',_0x4729e1):_0x4729e1;_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0xab9595[_0x3f9385[_0x1e2105]['format']],'%s',_0x4729e1):_0x4729e1;if(_0x3f9385[_0x1e2105][_0x7196('0x7e')]){_0x66e1e6['group'](_0x4729e1);}_0x3f9385[_0x1e2105][_0x7196('0x7f')]&&_0x66e1e6[_0x7196('0x3f')](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x66e1e6['field'](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x81')]||_0x4729e1);}if(_0x2944e5[_0x7196('0x82')]){_0x2944e5[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x2944e5[_0x7196('0x82')]);for(var _0x220315=0x0;_0x220315<_0x2944e5[_0x7196('0x82')][_0x7196('0x3c')];_0x220315+=0x1){if(_0x2944e5['joins'][_0x220315][_0x7196('0x33')]&&_[_0x7196('0x69')](_0x144613,_0x2944e5['joins'][_0x220315][_0x7196('0x33')])&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')]&&_0x2944e5['joins'][_0x220315][_0x7196('0x84')]&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]){_0x66e1e6[_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x33')]](_0x2944e5['joins'][_0x220315]['foreignTable'],null,util[_0x7196('0x7d')](_0x7196('0x85'),_0x2944e5[_0x7196('0x94')],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')],_0x2944e5[_0x7196('0x82')][_0x220315]['foreignTable'],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]));}}}if(_0x2944e5[_0x7196('0x88')]){_0x2944e5[_0x7196('0x88')]=JSON['parse'](_0x2944e5[_0x7196('0x88')]);_0x66e1e6[_0x7196('0x42')](_0x425a57(_0x2944e5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x2fb552=_0x66e1e6[_0x7196('0x89')]();_0x66e1e6[_0x7196('0x23')](_0x51da79);_0x66e1e6[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x66e1e6[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x66e1e6['toString'](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]});}})['then'](function(){return{'sql':_0x2fb552[_0x7196('0x8c')]()};})['then'](respondWithResult(_0x58fb86,null))[_0x7196('0x56')](handleError(_0x58fb86,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index a422551..603db3e 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 _0x92bb=['define','analytics_default_reports','lodash','util','../../config/logger','api','moment','path','./analyticDefaultReport.attributes','exports'];(function(_0x29510c,_0x554dc6){var _0x43c39f=function(_0x47e9dd){while(--_0x47e9dd){_0x29510c['push'](_0x29510c['shift']());}};_0x43c39f(++_0x554dc6);}(_0x92bb,0x70));var _0xb92b=function(_0x3ee55a,_0x19aeea){_0x3ee55a=_0x3ee55a-0x0;var _0x581800=_0x92bb[_0x3ee55a];return _0x581800;};'use strict';var _=require(_0xb92b('0x0'));var util=require(_0xb92b('0x1'));var logger=require(_0xb92b('0x2'))(_0xb92b('0x3'));var moment=require(_0xb92b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb92b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb92b('0x6'));module[_0xb92b('0x7')]=function(_0x2fd9b7,_0x2d376b){return _0x2fd9b7[_0xb92b('0x8')]('AnalyticDefaultReport',attributes,{'tableName':_0xb92b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x73fa=['moment','bluebird','request-promise','rimraf','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','lodash','util','api'];(function(_0x1cd5c7,_0x597bf0){var _0x1c698f=function(_0x267a10){while(--_0x267a10){_0x1cd5c7['push'](_0x1cd5c7['shift']());}};_0x1c698f(++_0x597bf0);}(_0x73fa,0x1cb));var _0xa73f=function(_0x55da99,_0x4a6b0c){_0x55da99=_0x55da99-0x0;var _0x575612=_0x73fa[_0x55da99];return _0x575612;};'use strict';var _=require(_0xa73f('0x0'));var util=require(_0xa73f('0x1'));var logger=require('../../config/logger')(_0xa73f('0x2'));var moment=require(_0xa73f('0x3'));var BPromise=require(_0xa73f('0x4'));var rp=require(_0xa73f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa73f('0x6'));var config=require('../../config/environment');var attributes=require(_0xa73f('0x7'));module[_0xa73f('0x8')]=function(_0xc9b0ae,_0xd6c7c9){return _0xc9b0ae[_0xa73f('0x9')](_0xa73f('0xa'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 9b4b925..0abcacd 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 _0x9c3a=['request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x5384b9,_0x535d02){var _0x21bc21=function(_0x2ec201){while(--_0x2ec201){_0x5384b9['push'](_0x5384b9['shift']());}};_0x21bc21(++_0x535d02);}(_0x9c3a,0x1be));var _0xa9c3=function(_0x3053a1,_0x50ecea){_0x3053a1=_0x3053a1-0x0;var _0x3a78a3=_0x9c3a[_0x3053a1];return _0x3a78a3;};'use strict';var _=require(_0xa9c3('0x0'));var util=require('util');var moment=require(_0xa9c3('0x1'));var BPromise=require(_0xa9c3('0x2'));var rs=require(_0xa9c3('0x3'));var fs=require('fs');var Redis=require(_0xa9c3('0x4'));var db=require(_0xa9c3('0x5'))['db'];var utils=require(_0xa9c3('0x6'));var logger=require('../../config/logger')(_0xa9c3('0x7'));var config=require(_0xa9c3('0x8'));var jayson=require(_0xa9c3('0x9'));var client=jayson[_0xa9c3('0xa')][_0xa9c3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3fd4f3,_0xf11c3d,_0x86bed4){return new BPromise(function(_0x29c0d7,_0x335754){return client[_0xa9c3('0xc')](_0x3fd4f3,_0x86bed4)[_0xa9c3('0xd')](function(_0x98cb27){logger[_0xa9c3('0xe')](_0xa9c3('0xf'),_0xf11c3d,_0xa9c3('0x10'));logger['debug'](_0xa9c3('0x11'),_0xf11c3d,_0xa9c3('0x10'),JSON['stringify'](_0x98cb27));if(_0x98cb27[_0xa9c3('0x12')]){if(_0x98cb27[_0xa9c3('0x12')]['code']===0x1f4){logger[_0xa9c3('0x12')](_0xa9c3('0xf'),_0xf11c3d,_0x98cb27[_0xa9c3('0x12')]['message']);return _0x335754(_0x98cb27[_0xa9c3('0x12')]['message']);}logger[_0xa9c3('0x12')](_0xa9c3('0xf'),_0xf11c3d,_0x98cb27[_0xa9c3('0x12')][_0xa9c3('0x13')]);return _0x29c0d7(_0x98cb27[_0xa9c3('0x12')][_0xa9c3('0x13')]);}else{logger[_0xa9c3('0xe')](_0xa9c3('0xf'),_0xf11c3d,_0xa9c3('0x10'));_0x29c0d7(_0x98cb27[_0xa9c3('0x14')][_0xa9c3('0x13')]);}})[_0xa9c3('0x15')](function(_0x46c3ef){logger[_0xa9c3('0x12')](_0xa9c3('0xf'),_0xf11c3d,_0x46c3ef);_0x335754(_0x46c3ef);});});}
\ No newline at end of file
+var _0x2eed=['http','request','then','info','request\x20sent','debug','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x386511,_0x2d2dd1){var _0x2a629f=function(_0x5cccf5){while(--_0x5cccf5){_0x386511['push'](_0x386511['shift']());}};_0x2a629f(++_0x2d2dd1);}(_0x2eed,0x166));var _0xd2ee=function(_0xc9f3ab,_0x403680){_0xc9f3ab=_0xc9f3ab-0x0;var _0x197589=_0x2eed[_0xc9f3ab];return _0x197589;};'use strict';var _=require(_0xd2ee('0x0'));var util=require(_0xd2ee('0x1'));var moment=require(_0xd2ee('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd2ee('0x3'));var db=require(_0xd2ee('0x4'))['db'];var utils=require(_0xd2ee('0x5'));var logger=require('../../config/logger')(_0xd2ee('0x6'));var config=require(_0xd2ee('0x7'));var jayson=require(_0xd2ee('0x8'));var client=jayson[_0xd2ee('0x9')][_0xd2ee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x540c07,_0x325ca1,_0x232313){return new BPromise(function(_0x4c2894,_0x21cc81){return client[_0xd2ee('0xb')](_0x540c07,_0x232313)[_0xd2ee('0xc')](function(_0x1c3df1){logger[_0xd2ee('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x325ca1,_0xd2ee('0xe'));logger[_0xd2ee('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x325ca1,_0xd2ee('0xe'),JSON[_0xd2ee('0x10')](_0x1c3df1));if(_0x1c3df1['error']){if(_0x1c3df1[_0xd2ee('0x11')][_0xd2ee('0x12')]===0x1f4){logger[_0xd2ee('0x11')](_0xd2ee('0x13'),_0x325ca1,_0x1c3df1[_0xd2ee('0x11')][_0xd2ee('0x14')]);return _0x21cc81(_0x1c3df1[_0xd2ee('0x11')][_0xd2ee('0x14')]);}logger[_0xd2ee('0x11')](_0xd2ee('0x13'),_0x325ca1,_0x1c3df1[_0xd2ee('0x11')][_0xd2ee('0x14')]);return _0x4c2894(_0x1c3df1[_0xd2ee('0x11')][_0xd2ee('0x14')]);}else{logger[_0xd2ee('0xd')](_0xd2ee('0x13'),_0x325ca1,'request\x20sent');_0x4c2894(_0x1c3df1[_0xd2ee('0x15')][_0xd2ee('0x14')]);}})[_0xd2ee('0x16')](function(_0x2a10af){logger[_0xd2ee('0x11')](_0xd2ee('0x13'),_0x325ca1,_0x2a10af);_0x21cc81(_0x2a10af);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index c055c48..b465486 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 _0x1574=['get','isAuthenticated','index','/:id','show','/:id/preview','preview','run','/:id/query','query','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller'];(function(_0x2ef44b,_0x553359){var _0x2405b9=function(_0x278290){while(--_0x278290){_0x2ef44b['push'](_0x2ef44b['shift']());}};_0x2405b9(++_0x553359);}(_0x1574,0x148));var _0x4157=function(_0x4a5065,_0x4820f7){_0x4a5065=_0x4a5065-0x0;var _0x122c97=_0x1574[_0x4a5065];return _0x122c97;};'use strict';var multer=require(_0x4157('0x0'));var util=require(_0x4157('0x1'));var path=require(_0x4157('0x2'));var timeout=require(_0x4157('0x3'));var express=require('express');var router=express[_0x4157('0x4')]();var fs_extra=require(_0x4157('0x5'));var auth=require(_0x4157('0x6'));var interaction=require(_0x4157('0x7'));var config=require(_0x4157('0x8'));var controller=require(_0x4157('0x9'));router[_0x4157('0xa')]('/',auth[_0x4157('0xb')](),controller[_0x4157('0xc')]);router[_0x4157('0xa')](_0x4157('0xd'),auth[_0x4157('0xb')](),controller[_0x4157('0xe')]);router[_0x4157('0xa')](_0x4157('0xf'),auth['isAuthenticated'](),controller[_0x4157('0x10')]);router['get']('/:id/run',auth['isAuthenticated'](),controller[_0x4157('0x11')]);router[_0x4157('0xa')](_0x4157('0x12'),auth['isAuthenticated'](),controller[_0x4157('0x13')]);router[_0x4157('0x14')]('/',auth[_0x4157('0xb')](),controller[_0x4157('0x15')]);router[_0x4157('0x16')](_0x4157('0xd'),auth[_0x4157('0xb')](),controller[_0x4157('0x17')]);router[_0x4157('0x18')](_0x4157('0xd'),auth[_0x4157('0xb')](),controller[_0x4157('0x19')]);module['exports']=router;
\ No newline at end of file
+var _0x0eaf=['preview','/:id/run','run','/:id/query','query','post','create','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','index','/:id','isAuthenticated','/:id/preview'];(function(_0x274dac,_0x1db3d){var _0x25eb16=function(_0x13853e){while(--_0x13853e){_0x274dac['push'](_0x274dac['shift']());}};_0x25eb16(++_0x1db3d);}(_0x0eaf,0x1ed));var _0xf0ea=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x0eaf[_0x46698a];return _0x356db0;};'use strict';var multer=require(_0xf0ea('0x0'));var util=require(_0xf0ea('0x1'));var path=require(_0xf0ea('0x2'));var timeout=require(_0xf0ea('0x3'));var express=require('express');var router=express[_0xf0ea('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf0ea('0x5'));var interaction=require(_0xf0ea('0x6'));var config=require('../../config/environment');var controller=require(_0xf0ea('0x7'));router[_0xf0ea('0x8')]('/',auth['isAuthenticated'](),controller[_0xf0ea('0x9')]);router[_0xf0ea('0x8')](_0xf0ea('0xa'),auth[_0xf0ea('0xb')](),controller['show']);router[_0xf0ea('0x8')](_0xf0ea('0xc'),auth[_0xf0ea('0xb')](),controller[_0xf0ea('0xd')]);router[_0xf0ea('0x8')](_0xf0ea('0xe'),auth['isAuthenticated'](),controller[_0xf0ea('0xf')]);router[_0xf0ea('0x8')](_0xf0ea('0x10'),auth[_0xf0ea('0xb')](),controller[_0xf0ea('0x11')]);router[_0xf0ea('0x12')]('/',auth[_0xf0ea('0xb')](),controller[_0xf0ea('0x13')]);router['put']('/:id',auth[_0xf0ea('0xb')](),controller['update']);router[_0xf0ea('0x14')](_0xf0ea('0xa'),auth[_0xf0ea('0xb')](),controller[_0xf0ea('0x15')]);module[_0xf0ea('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 8b9a8c7..3281331 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 _0xf463=['STRING','ENUM','csv','xlsx','DATE','Loading','manual','INTEGER','sequelize','moment','exports'];(function(_0x47e7dd,_0x51b041){var _0x38501f=function(_0x5ba66d){while(--_0x5ba66d){_0x47e7dd['push'](_0x47e7dd['shift']());}};_0x38501f(++_0x51b041);}(_0xf463,0x13c));var _0x3f46=function(_0x471878,_0x593a5a){_0x471878=_0x471878-0x0;var _0x4fd0bf=_0xf463[_0x471878];return _0x4fd0bf;};'use strict';var Sequelize=require(_0x3f46('0x0'));var moment=require(_0x3f46('0x1'));module[_0x3f46('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x3f46('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x3f46('0x4')](_0x3f46('0x5'),'pdf',_0x3f46('0x6')),'allowNull':![],'defaultValue':_0x3f46('0x5')},'savename':{'type':Sequelize[_0x3f46('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x3f46('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x3f46('0x3')],'defaultValue':_0x3f46('0x8')},'type':{'type':Sequelize[_0x3f46('0x4')](_0x3f46('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0x3f46('0x9')},'reportId':{'type':Sequelize[_0x3f46('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x3f46('0x3')]}};
\ No newline at end of file
+var _0x23f5=['xlsx','DATE','manual','scheduled','INTEGER','UNSIGNED','moment','STRING','csv','pdf'];(function(_0x1773f7,_0x54318f){var _0x1983fb=function(_0x50b543){while(--_0x50b543){_0x1773f7['push'](_0x1773f7['shift']());}};_0x1983fb(++_0x54318f);}(_0x23f5,0x164));var _0x523f=function(_0x231a47,_0x46a963){_0x231a47=_0x231a47-0x0;var _0x48d7c9=_0x23f5[_0x231a47];return _0x48d7c9;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x523f('0x0'));module['exports']={'name':{'type':Sequelize[_0x523f('0x1')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x523f('0x2'),_0x523f('0x3'),_0x523f('0x4')),'allowNull':![],'defaultValue':_0x523f('0x2')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x523f('0x5')]},'endDate':{'type':Sequelize[_0x523f('0x5')]},'status':{'type':Sequelize[_0x523f('0x1')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x523f('0x6'),_0x523f('0x7')),'allowNull':![],'defaultValue':_0x523f('0x6')},'reportId':{'type':Sequelize[_0x523f('0x8')](0xb)[_0x523f('0x9')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 84ea0c6..1dd2a8e 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 _0xc6fd=['rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','destroy','then','UserProfileResource','error','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','AnalyticExtractedReport','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','ExtractedReports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','output','existsSync','root','server/files/reports','savename','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join','format','%s.%s','toLowerCase','eml-format'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xc6fd,0x1d5));var _0xdc6f=function(_0x2ab14a,_0x49617e){_0x2ab14a=_0x2ab14a-0x0;var _0x10059c=_0xc6fd[_0x2ab14a];return _0x10059c;};'use strict';var emlformat=require(_0xdc6f('0x0'));var rimraf=require(_0xdc6f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdc6f('0x2'));var rp=require(_0xdc6f('0x3'));var moment=require(_0xdc6f('0x4'));var BPromise=require(_0xdc6f('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xdc6f('0x6'));var sox=require(_0xdc6f('0x7'));var csv=require(_0xdc6f('0x8'));var ejs=require(_0xdc6f('0x9'));var fs=require('fs');var fs_extra=require(_0xdc6f('0xa'));var _=require(_0xdc6f('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdc6f('0xc'));var deskjs=require(_0xdc6f('0xd'));var toCsv=require(_0xdc6f('0x8'));var querystring=require(_0xdc6f('0xe'));var Papa=require(_0xdc6f('0xf'));var Redis=require('ioredis');var authService=require(_0xdc6f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xdc6f('0x11'));var hardwareService=require(_0xdc6f('0x12'));var logger=require(_0xdc6f('0x13'))(_0xdc6f('0x14'));var utils=require(_0xdc6f('0x15'));var config=require(_0xdc6f('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x441e8,_0xe184d7){_0xe184d7=_0xe184d7||0xcc;return function(_0x4d4d3c){if(_0x4d4d3c){return _0x441e8[_0xdc6f('0x17')](_0xe184d7);}return _0x441e8[_0xdc6f('0x18')](_0xe184d7)[_0xdc6f('0x19')]();};}function respondWithResult(_0x5b47c3,_0x1c0d17){_0x1c0d17=_0x1c0d17||0xc8;return function(_0x25c879){if(_0x25c879){return _0x5b47c3[_0xdc6f('0x18')](_0x1c0d17)[_0xdc6f('0x1a')](_0x25c879);}};}function respondWithFilteredResult(_0x414e38,_0x1ca5dc){return function(_0xb607bb){if(_0xb607bb){var _0x12263c=typeof _0x1ca5dc['offset']===_0xdc6f('0x1b')&&typeof _0x1ca5dc[_0xdc6f('0x1c')]===_0xdc6f('0x1b');var _0xee96dc=_0xb607bb[_0xdc6f('0x1d')];var _0x2d930c=_0x12263c?0x0:_0x1ca5dc['offset'];var _0x5e4ac0=_0x12263c?_0xb607bb[_0xdc6f('0x1d')]:_0x1ca5dc[_0xdc6f('0x1e')]+_0x1ca5dc[_0xdc6f('0x1c')];var _0x410e6a;if(_0x5e4ac0>=_0xee96dc){_0x5e4ac0=_0xee96dc;_0x410e6a=0xc8;}else{_0x410e6a=0xce;}_0x414e38[_0xdc6f('0x18')](_0x410e6a);return _0x414e38[_0xdc6f('0x1f')](_0xdc6f('0x20'),_0x2d930c+'-'+_0x5e4ac0+'/'+_0xee96dc)['json'](_0xb607bb);}return null;};}function patchUpdates(_0x31c6bf){return function(_0x2eacb1){try{jsonpatch[_0xdc6f('0x21')](_0x2eacb1,_0x31c6bf,!![]);}catch(_0x1e7de5){return BPromise[_0xdc6f('0x22')](_0x1e7de5);}return _0x2eacb1['save']();};}function saveUpdates(_0x20fec9,_0x10d791){return function(_0x51c2fb){if(_0x51c2fb){return _0x51c2fb[_0xdc6f('0x23')](_0x20fec9)['then'](function(_0x4810f3){return _0x4810f3;});}return null;};}function removeEntity(_0x6a0877,_0x1f07a6){return function(_0x205f23){if(_0x205f23){return _0x205f23[_0xdc6f('0x24')]()[_0xdc6f('0x25')](function(){var _0x1d9098=_0x205f23['get']({'plain':!![]});var _0xf8ca='ExtractedReports';return db[_0xdc6f('0x26')]['destroy']({'where':{'type':_0xf8ca,'resourceId':_0x1d9098['id']}})[_0xdc6f('0x25')](function(){return _0x205f23;});})[_0xdc6f('0x25')](function(){_0x6a0877['status'](0xcc)[_0xdc6f('0x19')]();});}};}function handleEntityNotFound(_0x30571b,_0x5ca47e){return function(_0x173cfe){if(!_0x173cfe){_0x30571b['sendStatus'](0x194);}return _0x173cfe;};}function handleError(_0x4b19d9,_0x2089da){_0x2089da=_0x2089da||0x1f4;return function(_0x399ada){logger[_0xdc6f('0x27')](_0x399ada['stack']);if(_0x399ada[_0xdc6f('0x28')]){delete _0x399ada[_0xdc6f('0x28')];}_0x4b19d9[_0xdc6f('0x18')](_0x2089da)[_0xdc6f('0x29')](_0x399ada);};}exports[_0xdc6f('0x2a')]=function(_0x353cf9,_0x1527a6){var _0x1b4b9b={},_0x2024c4={},_0x583e7b={'count':0x0,'rows':[]};var _0x3c3d05=_[_0xdc6f('0x2b')](db['AnalyticExtractedReport'][_0xdc6f('0x2c')],function(_0x4c53bb){return{'name':_0x4c53bb['fieldName'],'type':_0x4c53bb[_0xdc6f('0x2d')][_0xdc6f('0x2e')]};});_0x2024c4[_0xdc6f('0x2f')]=_[_0xdc6f('0x2b')](_0x3c3d05,_0xdc6f('0x28'));_0x2024c4[_0xdc6f('0x30')]=_[_0xdc6f('0x31')](_0x353cf9[_0xdc6f('0x30')]);_0x2024c4[_0xdc6f('0x32')]=_['intersection'](_0x2024c4[_0xdc6f('0x2f')],_0x2024c4[_0xdc6f('0x30')]);_0x1b4b9b['attributes']=_[_0xdc6f('0x33')](_0x2024c4[_0xdc6f('0x2f')],qs[_0xdc6f('0x34')](_0x353cf9['query'][_0xdc6f('0x34')]));_0x1b4b9b[_0xdc6f('0x35')]=_0x1b4b9b[_0xdc6f('0x35')][_0xdc6f('0x36')]?_0x1b4b9b[_0xdc6f('0x35')]:_0x2024c4['model'];if(!_0x353cf9[_0xdc6f('0x30')]['hasOwnProperty'](_0xdc6f('0x37'))){_0x1b4b9b['limit']=qs[_0xdc6f('0x1c')](_0x353cf9[_0xdc6f('0x30')][_0xdc6f('0x1c')]);_0x1b4b9b[_0xdc6f('0x1e')]=qs[_0xdc6f('0x1e')](_0x353cf9[_0xdc6f('0x30')][_0xdc6f('0x1e')]);}_0x1b4b9b[_0xdc6f('0x38')]=qs['sort'](_0x353cf9[_0xdc6f('0x30')][_0xdc6f('0x39')]);_0x1b4b9b[_0xdc6f('0x3a')]=qs[_0xdc6f('0x32')](_['pick'](_0x353cf9[_0xdc6f('0x30')],_0x2024c4[_0xdc6f('0x32')]),_0x3c3d05);if(_0x353cf9[_0xdc6f('0x30')][_0xdc6f('0x3b')]){_0x1b4b9b[_0xdc6f('0x3a')]=_['merge'](_0x1b4b9b['where'],{'$or':_[_0xdc6f('0x2b')](_0x3c3d05,function(_0x18a3f9){if(_0x18a3f9[_0xdc6f('0x2d')]!==_0xdc6f('0x3c')){var _0x472c50={};_0x472c50[_0x18a3f9[_0xdc6f('0x28')]]={'$like':'%'+_0x353cf9[_0xdc6f('0x30')]['filter']+'%'};return _0x472c50;}})});}_0x1b4b9b=_[_0xdc6f('0x3d')]({},_0x1b4b9b,_0x353cf9[_0xdc6f('0x3e')]);var _0x4c7a7e={'where':_0x1b4b9b[_0xdc6f('0x3a')]};return db[_0xdc6f('0x3f')]['count'](_0x4c7a7e)[_0xdc6f('0x25')](function(_0x437cfb){_0x583e7b['count']=_0x437cfb;if(_0x353cf9[_0xdc6f('0x30')][_0xdc6f('0x40')]){_0x1b4b9b['include']=[{'all':!![]}];}return db[_0xdc6f('0x3f')][_0xdc6f('0x41')](_0x1b4b9b);})[_0xdc6f('0x25')](function(_0x1b51c7){_0x583e7b[_0xdc6f('0x42')]=_0x1b51c7;return _0x583e7b;})[_0xdc6f('0x25')](respondWithFilteredResult(_0x1527a6,_0x1b4b9b))[_0xdc6f('0x43')](handleError(_0x1527a6,null));};exports[_0xdc6f('0x44')]=function(_0x1d8c32,_0x2d94ce){var _0x136c17={'raw':!![],'where':{'id':_0x1d8c32[_0xdc6f('0x45')]['id']}},_0x1a4cff={};_0x1a4cff[_0xdc6f('0x2f')]=_[_0xdc6f('0x31')](db['AnalyticExtractedReport'][_0xdc6f('0x2c')]);_0x1a4cff[_0xdc6f('0x30')]=_['keys'](_0x1d8c32['query']);_0x1a4cff[_0xdc6f('0x32')]=_[_0xdc6f('0x33')](_0x1a4cff[_0xdc6f('0x2f')],_0x1a4cff['query']);_0x136c17[_0xdc6f('0x35')]=_['intersection'](_0x1a4cff[_0xdc6f('0x2f')],qs[_0xdc6f('0x34')](_0x1d8c32['query'][_0xdc6f('0x34')]));_0x136c17[_0xdc6f('0x35')]=_0x136c17[_0xdc6f('0x35')]['length']?_0x136c17[_0xdc6f('0x35')]:_0x1a4cff[_0xdc6f('0x2f')];if(_0x1d8c32[_0xdc6f('0x30')][_0xdc6f('0x40')]){_0x136c17[_0xdc6f('0x46')]=[{'all':!![]}];}_0x136c17=_[_0xdc6f('0x3d')]({},_0x136c17,_0x1d8c32[_0xdc6f('0x3e')]);return db[_0xdc6f('0x3f')][_0xdc6f('0x47')](_0x136c17)['then'](handleEntityNotFound(_0x2d94ce,null))[_0xdc6f('0x25')](respondWithResult(_0x2d94ce,null))[_0xdc6f('0x43')](handleError(_0x2d94ce,null));};exports[_0xdc6f('0x48')]=function(_0x4f48cc,_0x3160c4){return db[_0xdc6f('0x3f')]['create'](_0x4f48cc[_0xdc6f('0x49')],{})[_0xdc6f('0x25')](function(_0xcbe954){var _0x39c151=_0x4f48cc[_0xdc6f('0x4a')][_0xdc6f('0x4b')]({'plain':!![]});if(!_0x39c151)throw new Error(_0xdc6f('0x4c'));if(_0x39c151['role']==='user'){var _0xa7e5ca=_0xcbe954[_0xdc6f('0x4b')]({'plain':!![]});var _0x220268=_0xdc6f('0x4d');return db['UserProfileSection'][_0xdc6f('0x47')]({'where':{'name':_0x220268,'userProfileId':_0x39c151[_0xdc6f('0x4e')]},'raw':!![]})[_0xdc6f('0x25')](function(_0x5a462d){if(_0x5a462d&&_0x5a462d[_0xdc6f('0x4f')]===0x0){return db[_0xdc6f('0x26')][_0xdc6f('0x48')]({'name':_0xa7e5ca[_0xdc6f('0x28')],'resourceId':_0xa7e5ca['id'],'type':_0x5a462d['name'],'sectionId':_0x5a462d['id']},{})[_0xdc6f('0x25')](function(){return _0xcbe954;});}else{return _0xcbe954;}})['catch'](function(_0x1c52d0){logger['error'](_0xdc6f('0x50'),_0x1c52d0);throw _0x1c52d0;});}return _0xcbe954;})[_0xdc6f('0x25')](respondWithResult(_0x3160c4,0xc9))[_0xdc6f('0x43')](handleError(_0x3160c4,null));};exports[_0xdc6f('0x23')]=function(_0x10e3a3,_0x48264f){if(_0x10e3a3['body']['id']){delete _0x10e3a3['body']['id'];}return db[_0xdc6f('0x3f')][_0xdc6f('0x47')]({'where':{'id':_0x10e3a3[_0xdc6f('0x45')]['id']}})[_0xdc6f('0x25')](handleEntityNotFound(_0x48264f,null))[_0xdc6f('0x25')](saveUpdates(_0x10e3a3[_0xdc6f('0x49')],null))['then'](respondWithResult(_0x48264f,null))[_0xdc6f('0x43')](handleError(_0x48264f,null));};exports[_0xdc6f('0x24')]=function(_0x449e9f,_0x4ce08c){return db[_0xdc6f('0x3f')][_0xdc6f('0x47')]({'where':{'id':_0x449e9f['params']['id']}})[_0xdc6f('0x25')](handleEntityNotFound(_0x4ce08c,null))[_0xdc6f('0x25')](removeEntity(_0x4ce08c,null))[_0xdc6f('0x43')](handleError(_0x4ce08c,null));};exports['download']=function(_0x1c7875,_0x3a06a2,_0x2fcab1){return db[_0xdc6f('0x3f')][_0xdc6f('0x47')]({'where':{'id':_0x1c7875[_0xdc6f('0x45')]['id']},'attributes':[_0xdc6f('0x28'),_0xdc6f('0x51'),'savename',_0xdc6f('0x52')],'raw':!![]})[_0xdc6f('0x25')](handleEntityNotFound(_0x3a06a2,null))[_0xdc6f('0x25')](function(_0x4be902){if(_0x4be902){if(!fs[_0xdc6f('0x53')](path['join'](config[_0xdc6f('0x54')],_0xdc6f('0x55'),_0x4be902[_0xdc6f('0x56')]))){throw new db['Sequelize'][(_0xdc6f('0x57'))](_0xdc6f('0x58'));}if(_0x1c7875[_0xdc6f('0x30')][_0xdc6f('0x59')]){return _0x3a06a2['sendStatus'](0xc8);}return _0x3a06a2['download'](path[_0xdc6f('0x5a')](config[_0xdc6f('0x54')],_0xdc6f('0x55'),_0x4be902[_0xdc6f('0x56')]),util[_0xdc6f('0x5b')](_0xdc6f('0x5c'),_0x4be902[_0xdc6f('0x51')]||_0x4be902[_0xdc6f('0x28')],_0x4be902[_0xdc6f('0x52')][_0xdc6f('0x5d')]()));}})['catch'](handleError(_0x3a06a2,null));};
\ No newline at end of file
+var _0x1f13=['../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','ExtractedReports','UserProfileResource','stack','name','send','index','map','AnalyticExtractedReport','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','options','includeAll','include','findAll','rows','catch','params','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','exists','sendStatus','format','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils'];(function(_0x36b61,_0x73573c){var _0x54ead8=function(_0x4daf46){while(--_0x4daf46){_0x36b61['push'](_0x36b61['shift']());}};_0x54ead8(++_0x73573c);}(_0x1f13,0x1b3));var _0x31f1=function(_0x9b25cc,_0x3ce8d9){_0x9b25cc=_0x9b25cc-0x0;var _0x21f391=_0x1f13[_0x9b25cc];return _0x21f391;};'use strict';var emlformat=require(_0x31f1('0x0'));var rimraf=require(_0x31f1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x31f1('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x31f1('0x3'));var Mustache=require(_0x31f1('0x4'));var util=require(_0x31f1('0x5'));var path=require(_0x31f1('0x6'));var sox=require(_0x31f1('0x7'));var csv=require(_0x31f1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x31f1('0x9'));var _=require(_0x31f1('0xa'));var squel=require('squel');var crypto=require(_0x31f1('0xb'));var jsforce=require(_0x31f1('0xc'));var deskjs=require(_0x31f1('0xd'));var toCsv=require(_0x31f1('0x8'));var querystring=require(_0x31f1('0xe'));var Papa=require(_0x31f1('0xf'));var Redis=require(_0x31f1('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x31f1('0x11'))(_0x31f1('0x12'));var utils=require(_0x31f1('0x13'));var config=require(_0x31f1('0x14'));var licenseUtil=require(_0x31f1('0x15'));var db=require(_0x31f1('0x16'))['db'];function respondWithStatusCode(_0x6e09c2,_0x26945a){_0x26945a=_0x26945a||0xcc;return function(_0x44e3d3){if(_0x44e3d3){return _0x6e09c2['sendStatus'](_0x26945a);}return _0x6e09c2[_0x31f1('0x17')](_0x26945a)[_0x31f1('0x18')]();};}function respondWithResult(_0x4a36b9,_0x17a242){_0x17a242=_0x17a242||0xc8;return function(_0x1271c7){if(_0x1271c7){return _0x4a36b9[_0x31f1('0x17')](_0x17a242)[_0x31f1('0x19')](_0x1271c7);}};}function respondWithFilteredResult(_0x54081d,_0x13f369){return function(_0x378ad1){if(_0x378ad1){var _0x579259=typeof _0x13f369[_0x31f1('0x1a')]===_0x31f1('0x1b')&&typeof _0x13f369[_0x31f1('0x1c')]===_0x31f1('0x1b');var _0x19b5a6=_0x378ad1['count'];var _0x1d5ff3=_0x579259?0x0:_0x13f369[_0x31f1('0x1a')];var _0x3eb92a=_0x579259?_0x378ad1[_0x31f1('0x1d')]:_0x13f369[_0x31f1('0x1a')]+_0x13f369[_0x31f1('0x1c')];var _0x4901e5;if(_0x3eb92a>=_0x19b5a6){_0x3eb92a=_0x19b5a6;_0x4901e5=0xc8;}else{_0x4901e5=0xce;}_0x54081d[_0x31f1('0x17')](_0x4901e5);return _0x54081d['set'](_0x31f1('0x1e'),_0x1d5ff3+'-'+_0x3eb92a+'/'+_0x19b5a6)[_0x31f1('0x19')](_0x378ad1);}return null;};}function patchUpdates(_0x5a7ee3){return function(_0x4bf3fa){try{jsonpatch['apply'](_0x4bf3fa,_0x5a7ee3,!![]);}catch(_0xaeff41){return BPromise['reject'](_0xaeff41);}return _0x4bf3fa[_0x31f1('0x1f')]();};}function saveUpdates(_0x3da33,_0x3ff5b1){return function(_0x2976d2){if(_0x2976d2){return _0x2976d2[_0x31f1('0x20')](_0x3da33)[_0x31f1('0x21')](function(_0x346eab){return _0x346eab;});}return null;};}function removeEntity(_0x1bd99b,_0x2dad94){return function(_0xd388e9){if(_0xd388e9){return _0xd388e9[_0x31f1('0x22')]()[_0x31f1('0x21')](function(){var _0x3fe590=_0xd388e9['get']({'plain':!![]});var _0x53770f=_0x31f1('0x23');return db[_0x31f1('0x24')][_0x31f1('0x22')]({'where':{'type':_0x53770f,'resourceId':_0x3fe590['id']}})[_0x31f1('0x21')](function(){return _0xd388e9;});})[_0x31f1('0x21')](function(){_0x1bd99b[_0x31f1('0x17')](0xcc)[_0x31f1('0x18')]();});}};}function handleEntityNotFound(_0x228055,_0x447a59){return function(_0x48edfc){if(!_0x48edfc){_0x228055['sendStatus'](0x194);}return _0x48edfc;};}function handleError(_0x15727f,_0x5cb42e){_0x5cb42e=_0x5cb42e||0x1f4;return function(_0x5d60fa){logger['error'](_0x5d60fa[_0x31f1('0x25')]);if(_0x5d60fa[_0x31f1('0x26')]){delete _0x5d60fa[_0x31f1('0x26')];}_0x15727f[_0x31f1('0x17')](_0x5cb42e)[_0x31f1('0x27')](_0x5d60fa);};}exports[_0x31f1('0x28')]=function(_0x1c4a96,_0x43e5a0){var _0x5e1758={},_0x1aecd6={},_0x2199ce={'count':0x0,'rows':[]};var _0x3a86bf=_[_0x31f1('0x29')](db[_0x31f1('0x2a')]['rawAttributes'],function(_0xf7be85){return{'name':_0xf7be85[_0x31f1('0x2b')],'type':_0xf7be85[_0x31f1('0x2c')]['key']};});_0x1aecd6[_0x31f1('0x2d')]=_[_0x31f1('0x29')](_0x3a86bf,_0x31f1('0x26'));_0x1aecd6['query']=_[_0x31f1('0x2e')](_0x1c4a96[_0x31f1('0x2f')]);_0x1aecd6[_0x31f1('0x30')]=_[_0x31f1('0x31')](_0x1aecd6[_0x31f1('0x2d')],_0x1aecd6[_0x31f1('0x2f')]);_0x5e1758[_0x31f1('0x32')]=_[_0x31f1('0x31')](_0x1aecd6['model'],qs[_0x31f1('0x33')](_0x1c4a96[_0x31f1('0x2f')][_0x31f1('0x33')]));_0x5e1758[_0x31f1('0x32')]=_0x5e1758[_0x31f1('0x32')][_0x31f1('0x34')]?_0x5e1758['attributes']:_0x1aecd6['model'];if(!_0x1c4a96[_0x31f1('0x2f')][_0x31f1('0x35')]('nolimit')){_0x5e1758[_0x31f1('0x1c')]=qs[_0x31f1('0x1c')](_0x1c4a96['query'][_0x31f1('0x1c')]);_0x5e1758[_0x31f1('0x1a')]=qs['offset'](_0x1c4a96[_0x31f1('0x2f')][_0x31f1('0x1a')]);}_0x5e1758[_0x31f1('0x36')]=qs[_0x31f1('0x37')](_0x1c4a96[_0x31f1('0x2f')][_0x31f1('0x37')]);_0x5e1758['where']=qs['filters'](_['pick'](_0x1c4a96[_0x31f1('0x2f')],_0x1aecd6[_0x31f1('0x30')]),_0x3a86bf);if(_0x1c4a96[_0x31f1('0x2f')][_0x31f1('0x38')]){_0x5e1758[_0x31f1('0x39')]=_[_0x31f1('0x3a')](_0x5e1758[_0x31f1('0x39')],{'$or':_[_0x31f1('0x29')](_0x3a86bf,function(_0x1456c5){if(_0x1456c5[_0x31f1('0x2c')]!=='VIRTUAL'){var _0x134a88={};_0x134a88[_0x1456c5[_0x31f1('0x26')]]={'$like':'%'+_0x1c4a96[_0x31f1('0x2f')]['filter']+'%'};return _0x134a88;}})});}_0x5e1758=_[_0x31f1('0x3a')]({},_0x5e1758,_0x1c4a96[_0x31f1('0x3b')]);var _0x23b5dc={'where':_0x5e1758[_0x31f1('0x39')]};return db[_0x31f1('0x2a')][_0x31f1('0x1d')](_0x23b5dc)[_0x31f1('0x21')](function(_0x189c57){_0x2199ce['count']=_0x189c57;if(_0x1c4a96[_0x31f1('0x2f')][_0x31f1('0x3c')]){_0x5e1758[_0x31f1('0x3d')]=[{'all':!![]}];}return db[_0x31f1('0x2a')][_0x31f1('0x3e')](_0x5e1758);})['then'](function(_0x2cc26a){_0x2199ce[_0x31f1('0x3f')]=_0x2cc26a;return _0x2199ce;})[_0x31f1('0x21')](respondWithFilteredResult(_0x43e5a0,_0x5e1758))[_0x31f1('0x40')](handleError(_0x43e5a0,null));};exports['show']=function(_0x5d01d3,_0x1053be){var _0x3f3b65={'raw':!![],'where':{'id':_0x5d01d3[_0x31f1('0x41')]['id']}},_0x5ba9ba={};_0x5ba9ba[_0x31f1('0x2d')]=_[_0x31f1('0x2e')](db[_0x31f1('0x2a')]['rawAttributes']);_0x5ba9ba['query']=_[_0x31f1('0x2e')](_0x5d01d3[_0x31f1('0x2f')]);_0x5ba9ba[_0x31f1('0x30')]=_[_0x31f1('0x31')](_0x5ba9ba[_0x31f1('0x2d')],_0x5ba9ba[_0x31f1('0x2f')]);_0x3f3b65['attributes']=_[_0x31f1('0x31')](_0x5ba9ba['model'],qs[_0x31f1('0x33')](_0x5d01d3[_0x31f1('0x2f')][_0x31f1('0x33')]));_0x3f3b65[_0x31f1('0x32')]=_0x3f3b65[_0x31f1('0x32')][_0x31f1('0x34')]?_0x3f3b65[_0x31f1('0x32')]:_0x5ba9ba[_0x31f1('0x2d')];if(_0x5d01d3['query'][_0x31f1('0x3c')]){_0x3f3b65['include']=[{'all':!![]}];}_0x3f3b65=_[_0x31f1('0x3a')]({},_0x3f3b65,_0x5d01d3[_0x31f1('0x3b')]);return db[_0x31f1('0x2a')]['find'](_0x3f3b65)[_0x31f1('0x21')](handleEntityNotFound(_0x1053be,null))['then'](respondWithResult(_0x1053be,null))[_0x31f1('0x40')](handleError(_0x1053be,null));};exports['create']=function(_0x3fbdbd,_0x390c56){return db[_0x31f1('0x2a')][_0x31f1('0x42')](_0x3fbdbd[_0x31f1('0x43')],{})['then'](function(_0x508eb0){var _0x4428db=_0x3fbdbd['user'][_0x31f1('0x44')]({'plain':!![]});if(!_0x4428db)throw new Error(_0x31f1('0x45'));if(_0x4428db[_0x31f1('0x46')]===_0x31f1('0x47')){var _0x4797dc=_0x508eb0[_0x31f1('0x44')]({'plain':!![]});var _0x39add9=_0x31f1('0x23');return db[_0x31f1('0x48')][_0x31f1('0x49')]({'where':{'name':_0x39add9,'userProfileId':_0x4428db[_0x31f1('0x4a')]},'raw':!![]})[_0x31f1('0x21')](function(_0x3757db){if(_0x3757db&&_0x3757db[_0x31f1('0x4b')]===0x0){return db['UserProfileResource'][_0x31f1('0x42')]({'name':_0x4797dc[_0x31f1('0x26')],'resourceId':_0x4797dc['id'],'type':_0x3757db['name'],'sectionId':_0x3757db['id']},{})['then'](function(){return _0x508eb0;});}else{return _0x508eb0;}})[_0x31f1('0x40')](function(_0x30daba){logger[_0x31f1('0x4c')](_0x31f1('0x4d'),_0x30daba);throw _0x30daba;});}return _0x508eb0;})[_0x31f1('0x21')](respondWithResult(_0x390c56,0xc9))[_0x31f1('0x40')](handleError(_0x390c56,null));};exports[_0x31f1('0x20')]=function(_0x41bc42,_0x21d333){if(_0x41bc42[_0x31f1('0x43')]['id']){delete _0x41bc42[_0x31f1('0x43')]['id'];}return db[_0x31f1('0x2a')][_0x31f1('0x49')]({'where':{'id':_0x41bc42['params']['id']}})[_0x31f1('0x21')](handleEntityNotFound(_0x21d333,null))[_0x31f1('0x21')](saveUpdates(_0x41bc42[_0x31f1('0x43')],null))[_0x31f1('0x21')](respondWithResult(_0x21d333,null))[_0x31f1('0x40')](handleError(_0x21d333,null));};exports['destroy']=function(_0x2a12b1,_0x2f91ff){return db['AnalyticExtractedReport'][_0x31f1('0x49')]({'where':{'id':_0x2a12b1[_0x31f1('0x41')]['id']}})[_0x31f1('0x21')](handleEntityNotFound(_0x2f91ff,null))['then'](removeEntity(_0x2f91ff,null))['catch'](handleError(_0x2f91ff,null));};exports[_0x31f1('0x4e')]=function(_0x60a32e,_0x225eaa,_0x44e905){return db[_0x31f1('0x2a')][_0x31f1('0x49')]({'where':{'id':_0x60a32e['params']['id']},'attributes':[_0x31f1('0x26'),_0x31f1('0x4f'),_0x31f1('0x50'),_0x31f1('0x51')],'raw':!![]})[_0x31f1('0x21')](handleEntityNotFound(_0x225eaa,null))[_0x31f1('0x21')](function(_0x47dc27){if(_0x47dc27){if(!fs[_0x31f1('0x52')](path[_0x31f1('0x53')](config[_0x31f1('0x54')],_0x31f1('0x55'),_0x47dc27[_0x31f1('0x50')]))){throw new db[(_0x31f1('0x56'))][(_0x31f1('0x57'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x60a32e[_0x31f1('0x2f')][_0x31f1('0x58')]){return _0x225eaa[_0x31f1('0x59')](0xc8);}return _0x225eaa[_0x31f1('0x4e')](path[_0x31f1('0x53')](config[_0x31f1('0x54')],_0x31f1('0x55'),_0x47dc27[_0x31f1('0x50')]),util[_0x31f1('0x5a')]('%s.%s',_0x47dc27[_0x31f1('0x4f')]||_0x47dc27['name'],_0x47dc27[_0x31f1('0x51')]['toLowerCase']()));}})[_0x31f1('0x40')](handleError(_0x225eaa,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index ab54808..f256b8a 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 _0x1c3f=['request-promise','path','rimraf','./analyticExtractedReport.attributes','lodash','util','../../config/logger','moment','bluebird'];(function(_0x348b2f,_0x1c19a2){var _0x8beda=function(_0x3f7a63){while(--_0x3f7a63){_0x348b2f['push'](_0x348b2f['shift']());}};_0x8beda(++_0x1c19a2);}(_0x1c3f,0xd3));var _0xf1c3=function(_0x13659a,_0x41453c){_0x13659a=_0x13659a-0x0;var _0x4b1c49=_0x1c3f[_0x13659a];return _0x4b1c49;};'use strict';var _=require(_0xf1c3('0x0'));var util=require(_0xf1c3('0x1'));var logger=require(_0xf1c3('0x2'))('api');var moment=require(_0xf1c3('0x3'));var BPromise=require(_0xf1c3('0x4'));var rp=require(_0xf1c3('0x5'));var fs=require('fs');var path=require(_0xf1c3('0x6'));var rimraf=require(_0xf1c3('0x7'));var config=require('../../config/environment');var attributes=require(_0xf1c3('0x8'));module['exports']=function(_0x1a143a,_0x4e9f92){return _0x1a143a['define']('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0e8c=['analytics_extracted_reports','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport'];(function(_0x56fa47,_0xfed988){var _0x5af53f=function(_0x5513b0){while(--_0x5513b0){_0x56fa47['push'](_0x56fa47['shift']());}};_0x5af53f(++_0xfed988);}(_0x0e8c,0xde));var _0xc0e8=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x0e8c[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xc0e8('0x0'));var util=require(_0xc0e8('0x1'));var logger=require(_0xc0e8('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc0e8('0x3'));var rp=require(_0xc0e8('0x4'));var fs=require('fs');var path=require(_0xc0e8('0x5'));var rimraf=require(_0xc0e8('0x6'));var config=require(_0xc0e8('0x7'));var attributes=require(_0xc0e8('0x8'));module[_0xc0e8('0x9')]=function(_0x4fc034,_0x36625e){return _0x4fc034[_0xc0e8('0xa')](_0xc0e8('0xb'),attributes,{'tableName':_0xc0e8('0xc'),'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 540ea73..a8ef3f8 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 _0xad1b=['AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xad1b,0x1b0));var _0xbad1=function(_0x202067,_0x25e057){_0x202067=_0x202067-0x0;var _0x4c792e=_0xad1b[_0x202067];return _0x4c792e;};'use strict';var _=require(_0xbad1('0x0'));var util=require(_0xbad1('0x1'));var moment=require(_0xbad1('0x2'));var BPromise=require(_0xbad1('0x3'));var rs=require(_0xbad1('0x4'));var fs=require('fs');var Redis=require(_0xbad1('0x5'));var db=require(_0xbad1('0x6'))['db'];var utils=require(_0xbad1('0x7'));var logger=require(_0xbad1('0x8'))(_0xbad1('0x9'));var config=require(_0xbad1('0xa'));var jayson=require(_0xbad1('0xb'));var client=jayson[_0xbad1('0xc')][_0xbad1('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x105a91,_0x321c32,_0x32790e){return new BPromise(function(_0x9fc7b4,_0x5e4932){return client['request'](_0x105a91,_0x32790e)[_0xbad1('0xe')](function(_0x413873){logger['info'](_0xbad1('0xf'),_0x321c32,_0xbad1('0x10'));logger[_0xbad1('0x11')](_0xbad1('0x12'),_0x321c32,_0xbad1('0x10'),JSON[_0xbad1('0x13')](_0x413873));if(_0x413873[_0xbad1('0x14')]){if(_0x413873[_0xbad1('0x14')][_0xbad1('0x15')]===0x1f4){logger[_0xbad1('0x14')](_0xbad1('0xf'),_0x321c32,_0x413873[_0xbad1('0x14')][_0xbad1('0x16')]);return _0x5e4932(_0x413873[_0xbad1('0x14')][_0xbad1('0x16')]);}logger[_0xbad1('0x14')](_0xbad1('0xf'),_0x321c32,_0x413873[_0xbad1('0x14')]['message']);return _0x9fc7b4(_0x413873['error'][_0xbad1('0x16')]);}else{logger[_0xbad1('0x17')](_0xbad1('0xf'),_0x321c32,_0xbad1('0x10'));_0x9fc7b4(_0x413873['result']['message']);}})[_0xbad1('0x18')](function(_0x4614b3){logger[_0xbad1('0x14')](_0xbad1('0xf'),_0x321c32,_0x4614b3);_0x5e4932(_0x4614b3);});});}
\ No newline at end of file
+var _0x7ace=['error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x21fc05,_0x193b4e){var _0x18ccd5=function(_0x5bf919){while(--_0x5bf919){_0x21fc05['push'](_0x21fc05['shift']());}};_0x18ccd5(++_0x193b4e);}(_0x7ace,0xd6));var _0xe7ac=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x7ace[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0xe7ac('0x0'));var util=require(_0xe7ac('0x1'));var moment=require(_0xe7ac('0x2'));var BPromise=require(_0xe7ac('0x3'));var rs=require(_0xe7ac('0x4'));var fs=require('fs');var Redis=require(_0xe7ac('0x5'));var db=require(_0xe7ac('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xe7ac('0x7'));var jayson=require(_0xe7ac('0x8'));var client=jayson[_0xe7ac('0x9')][_0xe7ac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31f22a,_0x22762b,_0x29a04f){return new BPromise(function(_0x110917,_0x436f79){return client['request'](_0x31f22a,_0x29a04f)[_0xe7ac('0xb')](function(_0xb4ee7f){logger[_0xe7ac('0xc')](_0xe7ac('0xd'),_0x22762b,_0xe7ac('0xe'));logger['debug'](_0xe7ac('0xf'),_0x22762b,'request\x20sent',JSON[_0xe7ac('0x10')](_0xb4ee7f));if(_0xb4ee7f[_0xe7ac('0x11')]){if(_0xb4ee7f[_0xe7ac('0x11')]['code']===0x1f4){logger[_0xe7ac('0x11')](_0xe7ac('0xd'),_0x22762b,_0xb4ee7f[_0xe7ac('0x11')][_0xe7ac('0x12')]);return _0x436f79(_0xb4ee7f['error'][_0xe7ac('0x12')]);}logger[_0xe7ac('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x22762b,_0xb4ee7f[_0xe7ac('0x11')][_0xe7ac('0x12')]);return _0x110917(_0xb4ee7f[_0xe7ac('0x11')][_0xe7ac('0x12')]);}else{logger[_0xe7ac('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x22762b,_0xe7ac('0xe'));_0x110917(_0xb4ee7f[_0xe7ac('0x13')][_0xe7ac('0x12')]);}})[_0xe7ac('0x14')](function(_0x901569){logger[_0xe7ac('0x11')](_0xe7ac('0xd'),_0x22762b,_0x901569);_0x436f79(_0x901569);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index ee28e64..9b2a174 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 _0x87ee=['put','/:id','update','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','index','show','/:id/download','download','post','create'];(function(_0x53d147,_0x259f9e){var _0x3bc064=function(_0x2ef6d5){while(--_0x2ef6d5){_0x53d147['push'](_0x53d147['shift']());}};_0x3bc064(++_0x259f9e);}(_0x87ee,0xe8));var _0xe87e=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x87ee[_0x273c39];return _0x46d6b5;};'use strict';var multer=require('multer');var util=require(_0xe87e('0x0'));var path=require(_0xe87e('0x1'));var timeout=require(_0xe87e('0x2'));var express=require(_0xe87e('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe87e('0x4'));var interaction=require(_0xe87e('0x5'));var config=require('../../config/environment');var controller=require(_0xe87e('0x6'));router[_0xe87e('0x7')]('/',auth[_0xe87e('0x8')](),controller[_0xe87e('0x9')]);router[_0xe87e('0x7')]('/:id',auth[_0xe87e('0x8')](),controller[_0xe87e('0xa')]);router[_0xe87e('0x7')](_0xe87e('0xb'),auth[_0xe87e('0x8')](),controller[_0xe87e('0xc')]);router[_0xe87e('0xd')]('/',auth[_0xe87e('0x8')](),controller[_0xe87e('0xe')]);router[_0xe87e('0xf')](_0xe87e('0x10'),auth[_0xe87e('0x8')](),controller[_0xe87e('0x11')]);router['delete'](_0xe87e('0x10'),auth[_0xe87e('0x8')](),controller['destroy']);module[_0xe87e('0x12')]=router;
\ No newline at end of file
+var _0x882b=['show','/:id/download','create','put','update','delete','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id'];(function(_0x234a07,_0x239330){var _0x11f0cb=function(_0x1c07e4){while(--_0x1c07e4){_0x234a07['push'](_0x234a07['shift']());}};_0x11f0cb(++_0x239330);}(_0x882b,0x7a));var _0xb882=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x882b[_0x1d1779];return _0x2377e9;};'use strict';var multer=require(_0xb882('0x0'));var util=require('util');var path=require(_0xb882('0x1'));var timeout=require('connect-timeout');var express=require(_0xb882('0x2'));var router=express['Router']();var fs_extra=require(_0xb882('0x3'));var auth=require(_0xb882('0x4'));var interaction=require(_0xb882('0x5'));var config=require('../../config/environment');var controller=require(_0xb882('0x6'));router[_0xb882('0x7')]('/',auth[_0xb882('0x8')](),controller[_0xb882('0x9')]);router[_0xb882('0x7')](_0xb882('0xa'),auth[_0xb882('0x8')](),controller[_0xb882('0xb')]);router[_0xb882('0x7')](_0xb882('0xc'),auth[_0xb882('0x8')](),controller['download']);router['post']('/',auth[_0xb882('0x8')](),controller[_0xb882('0xd')]);router[_0xb882('0xe')](_0xb882('0xa'),auth[_0xb882('0x8')](),controller[_0xb882('0xf')]);router[_0xb882('0x10')](_0xb882('0xa'),auth[_0xb882('0x8')](),controller[_0xb882('0x11')]);module[_0xb882('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index e0abf0c..0434dd9 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 _0x55f2=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x818d8f,_0x173813){var _0x1bb382=function(_0x1774e9){while(--_0x1774e9){_0x818d8f['push'](_0x818d8f['shift']());}};_0x1bb382(++_0x173813);}(_0x55f2,0x13c));var _0x255f=function(_0x3852b0,_0x45dbf1){_0x3852b0=_0x3852b0-0x0;var _0x2a307a=_0x55f2[_0x3852b0];return _0x2a307a;};'use strict';var Sequelize=require(_0x255f('0x0'));module[_0x255f('0x1')]={'field':{'type':Sequelize[_0x255f('0x2')]},'alias':{'type':Sequelize[_0x255f('0x3')]},'function':{'type':Sequelize[_0x255f('0x3')]},'format':{'type':Sequelize[_0x255f('0x3')]},'groupBy':{'type':Sequelize[_0x255f('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x255f('0x3')]},'custom':{'type':Sequelize[_0x255f('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xdae3=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x5e1b91,_0x236f17){var _0x59b52f=function(_0x5c05ed){while(--_0x5c05ed){_0x5e1b91['push'](_0x5e1b91['shift']());}};_0x59b52f(++_0x236f17);}(_0xdae3,0x1e8));var _0x3dae=function(_0x1dd634,_0x1a35f3){_0x1dd634=_0x1dd634-0x0;var _0x3e1c38=_0xdae3[_0x1dd634];return _0x3e1c38;};'use strict';var Sequelize=require(_0x3dae('0x0'));module[_0x3dae('0x1')]={'field':{'type':Sequelize[_0x3dae('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x3dae('0x3')]},'format':{'type':Sequelize[_0x3dae('0x3')]},'groupBy':{'type':Sequelize[_0x3dae('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x3dae('0x3')]},'custom':{'type':Sequelize[_0x3dae('0x4')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 2b9fb27..d52a8c9 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 _0x8efe=['to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','name','index','map','AnalyticFieldReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','where','include','findAll','rows','catch','params','options','find','create','body','bulkCreate','bulkDestroy','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','fs-extra','lodash','squel','jsforce'];(function(_0x491e18,_0x38a578){var _0x309378=function(_0x1afe47){while(--_0x1afe47){_0x491e18['push'](_0x491e18['shift']());}};_0x309378(++_0x38a578);}(_0x8efe,0x90));var _0xe8ef=function(_0x4da1ec,_0x3039b8){_0x4da1ec=_0x4da1ec-0x0;var _0x3fc0cc=_0x8efe[_0x4da1ec];return _0x3fc0cc;};'use strict';var emlformat=require(_0xe8ef('0x0'));var rimraf=require(_0xe8ef('0x1'));var zipdir=require(_0xe8ef('0x2'));var jsonpatch=require(_0xe8ef('0x3'));var rp=require(_0xe8ef('0x4'));var moment=require(_0xe8ef('0x5'));var BPromise=require(_0xe8ef('0x6'));var Mustache=require(_0xe8ef('0x7'));var util=require('util');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(_0xe8ef('0x8'));var _=require(_0xe8ef('0x9'));var squel=require(_0xe8ef('0xa'));var crypto=require('crypto');var jsforce=require(_0xe8ef('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xe8ef('0xc'));var querystring=require(_0xe8ef('0xd'));var Papa=require(_0xe8ef('0xe'));var Redis=require(_0xe8ef('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe8ef('0x10'));var as=require(_0xe8ef('0x11'));var hardwareService=require(_0xe8ef('0x12'));var logger=require('../../config/logger')(_0xe8ef('0x13'));var utils=require(_0xe8ef('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xe8ef('0x15'));var db=require(_0xe8ef('0x16'))['db'];function respondWithStatusCode(_0x28d858,_0x1d0b63){_0x1d0b63=_0x1d0b63||0xcc;return function(_0x17b41c){if(_0x17b41c){return _0x28d858[_0xe8ef('0x17')](_0x1d0b63);}return _0x28d858['status'](_0x1d0b63)['end']();};}function respondWithResult(_0x7791f3,_0x53dab6){_0x53dab6=_0x53dab6||0xc8;return function(_0x84de69){if(_0x84de69){return _0x7791f3[_0xe8ef('0x18')](_0x53dab6)[_0xe8ef('0x19')](_0x84de69);}};}function respondWithFilteredResult(_0x26db6c,_0x323e7a){return function(_0xfbfa4e){if(_0xfbfa4e){var _0x47f50a=typeof _0x323e7a[_0xe8ef('0x1a')]===_0xe8ef('0x1b')&&typeof _0x323e7a['limit']===_0xe8ef('0x1b');var _0x544c3a=_0xfbfa4e[_0xe8ef('0x1c')];var _0x11f5e6=_0x47f50a?0x0:_0x323e7a['offset'];var _0xba9dd5=_0x47f50a?_0xfbfa4e['count']:_0x323e7a[_0xe8ef('0x1a')]+_0x323e7a[_0xe8ef('0x1d')];var _0x44a169;if(_0xba9dd5>=_0x544c3a){_0xba9dd5=_0x544c3a;_0x44a169=0xc8;}else{_0x44a169=0xce;}_0x26db6c['status'](_0x44a169);return _0x26db6c[_0xe8ef('0x1e')](_0xe8ef('0x1f'),_0x11f5e6+'-'+_0xba9dd5+'/'+_0x544c3a)[_0xe8ef('0x19')](_0xfbfa4e);}return null;};}function patchUpdates(_0x809943){return function(_0x4e219c){try{jsonpatch[_0xe8ef('0x20')](_0x4e219c,_0x809943,!![]);}catch(_0x4731e8){return BPromise[_0xe8ef('0x21')](_0x4731e8);}return _0x4e219c[_0xe8ef('0x22')]();};}function saveUpdates(_0x142bc6,_0x406ed7){return function(_0x99a482){if(_0x99a482){return _0x99a482[_0xe8ef('0x23')](_0x142bc6)[_0xe8ef('0x24')](function(_0x2c3261){return _0x2c3261;});}return null;};}function removeEntity(_0x15a6f4,_0x3e4d9){return function(_0x47b3d7){if(_0x47b3d7){return _0x47b3d7[_0xe8ef('0x25')]()[_0xe8ef('0x24')](function(){_0x15a6f4[_0xe8ef('0x18')](0xcc)[_0xe8ef('0x26')]();});}};}function handleEntityNotFound(_0x58a945,_0x13a835){return function(_0x44f87a){if(!_0x44f87a){_0x58a945[_0xe8ef('0x17')](0x194);}return _0x44f87a;};}function handleError(_0x37c1a0,_0x362244){_0x362244=_0x362244||0x1f4;return function(_0x51d977){logger['error'](_0x51d977['stack']);if(_0x51d977[_0xe8ef('0x27')]){delete _0x51d977[_0xe8ef('0x27')];}_0x37c1a0[_0xe8ef('0x18')](_0x362244)['send'](_0x51d977);};}exports[_0xe8ef('0x28')]=function(_0x1f1eac,_0x4cea44){var _0x4e2330={},_0x3a25c6={},_0x487982={'count':0x0,'rows':[]};var _0x1918c9=_[_0xe8ef('0x29')](db[_0xe8ef('0x2a')][_0xe8ef('0x2b')],function(_0x52ea2c){return{'name':_0x52ea2c[_0xe8ef('0x2c')],'type':_0x52ea2c['type'][_0xe8ef('0x2d')]};});_0x3a25c6[_0xe8ef('0x2e')]=_['map'](_0x1918c9,_0xe8ef('0x27'));_0x3a25c6[_0xe8ef('0x2f')]=_[_0xe8ef('0x30')](_0x1f1eac[_0xe8ef('0x2f')]);_0x3a25c6[_0xe8ef('0x31')]=_[_0xe8ef('0x32')](_0x3a25c6['model'],_0x3a25c6['query']);_0x4e2330[_0xe8ef('0x33')]=_[_0xe8ef('0x32')](_0x3a25c6[_0xe8ef('0x2e')],qs[_0xe8ef('0x34')](_0x1f1eac[_0xe8ef('0x2f')][_0xe8ef('0x34')]));_0x4e2330['attributes']=_0x4e2330[_0xe8ef('0x33')][_0xe8ef('0x35')]?_0x4e2330[_0xe8ef('0x33')]:_0x3a25c6[_0xe8ef('0x2e')];if(!_0x1f1eac['query'][_0xe8ef('0x36')](_0xe8ef('0x37'))){_0x4e2330[_0xe8ef('0x1d')]=qs[_0xe8ef('0x1d')](_0x1f1eac[_0xe8ef('0x2f')][_0xe8ef('0x1d')]);_0x4e2330['offset']=qs[_0xe8ef('0x1a')](_0x1f1eac['query']['offset']);}_0x4e2330[_0xe8ef('0x38')]=qs[_0xe8ef('0x39')](_0x1f1eac['query']['sort']);_0x4e2330['where']=qs[_0xe8ef('0x31')](_[_0xe8ef('0x3a')](_0x1f1eac[_0xe8ef('0x2f')],_0x3a25c6['filters']),_0x1918c9);if(_0x1f1eac['query'][_0xe8ef('0x3b')]){_0x4e2330['where']=_[_0xe8ef('0x3c')](_0x4e2330['where'],{'$or':_[_0xe8ef('0x29')](_0x1918c9,function(_0x379332){if(_0x379332['type']!==_0xe8ef('0x3d')){var _0xd596ab={};_0xd596ab[_0x379332[_0xe8ef('0x27')]]={'$like':'%'+_0x1f1eac[_0xe8ef('0x2f')][_0xe8ef('0x3b')]+'%'};return _0xd596ab;}})});}_0x4e2330=_['merge']({},_0x4e2330,_0x1f1eac['options']);var _0x1ac927={'where':_0x4e2330[_0xe8ef('0x3e')]};return db['AnalyticFieldReport']['count'](_0x1ac927)[_0xe8ef('0x24')](function(_0x5dcb82){_0x487982[_0xe8ef('0x1c')]=_0x5dcb82;if(_0x1f1eac['query']['includeAll']){_0x4e2330[_0xe8ef('0x3f')]=[{'all':!![]}];}return db[_0xe8ef('0x2a')][_0xe8ef('0x40')](_0x4e2330);})[_0xe8ef('0x24')](function(_0x484d70){_0x487982[_0xe8ef('0x41')]=_0x484d70;return _0x487982;})[_0xe8ef('0x24')](respondWithFilteredResult(_0x4cea44,_0x4e2330))[_0xe8ef('0x42')](handleError(_0x4cea44,null));};exports['show']=function(_0x87e46e,_0xaa29ba){var _0x4005a0={'raw':![],'where':{'id':_0x87e46e[_0xe8ef('0x43')]['id']}},_0x1ddc98={};_0x1ddc98[_0xe8ef('0x2e')]=_[_0xe8ef('0x30')](db[_0xe8ef('0x2a')][_0xe8ef('0x2b')]);_0x1ddc98['query']=_[_0xe8ef('0x30')](_0x87e46e['query']);_0x1ddc98['filters']=_['intersection'](_0x1ddc98[_0xe8ef('0x2e')],_0x1ddc98[_0xe8ef('0x2f')]);_0x4005a0['attributes']=_[_0xe8ef('0x32')](_0x1ddc98['model'],qs['fields'](_0x87e46e[_0xe8ef('0x2f')][_0xe8ef('0x34')]));_0x4005a0[_0xe8ef('0x33')]=_0x4005a0['attributes']['length']?_0x4005a0['attributes']:_0x1ddc98[_0xe8ef('0x2e')];if(_0x87e46e[_0xe8ef('0x2f')]['includeAll']){_0x4005a0['include']=[{'all':!![]}];}_0x4005a0=_[_0xe8ef('0x3c')]({},_0x4005a0,_0x87e46e[_0xe8ef('0x44')]);return db[_0xe8ef('0x2a')][_0xe8ef('0x45')](_0x4005a0)[_0xe8ef('0x24')](handleEntityNotFound(_0xaa29ba,null))[_0xe8ef('0x24')](respondWithResult(_0xaa29ba,null))[_0xe8ef('0x42')](handleError(_0xaa29ba,null));};exports[_0xe8ef('0x46')]=function(_0x2ec408,_0x3f513e){return db[_0xe8ef('0x2a')]['create'](_0x2ec408[_0xe8ef('0x47')],{})[_0xe8ef('0x24')](respondWithResult(_0x3f513e,0xc9))['catch'](handleError(_0x3f513e,null));};exports[_0xe8ef('0x48')]=function(_0x113dd8,_0x2d1143){return db[_0xe8ef('0x2a')][_0xe8ef('0x48')](_0x113dd8[_0xe8ef('0x47')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x2d1143,0xc9))['catch'](handleError(_0x2d1143,null));};exports['update']=function(_0x1797b0,_0x430957){if(_0x1797b0[_0xe8ef('0x47')]['id']){delete _0x1797b0[_0xe8ef('0x47')]['id'];}return db[_0xe8ef('0x2a')][_0xe8ef('0x45')]({'where':{'id':_0x1797b0['params']['id']}})['then'](handleEntityNotFound(_0x430957,null))[_0xe8ef('0x24')](saveUpdates(_0x1797b0[_0xe8ef('0x47')],null))[_0xe8ef('0x24')](respondWithResult(_0x430957,null))[_0xe8ef('0x42')](handleError(_0x430957,null));};exports[_0xe8ef('0x25')]=function(_0x3e27d5,_0x26a4b4){return db[_0xe8ef('0x2a')][_0xe8ef('0x45')]({'where':{'id':_0x3e27d5[_0xe8ef('0x43')]['id']}})[_0xe8ef('0x24')](handleEntityNotFound(_0x26a4b4,null))[_0xe8ef('0x24')](removeEntity(_0x26a4b4,null))[_0xe8ef('0x42')](handleError(_0x26a4b4,null));};exports[_0xe8ef('0x49')]=function(_0x425031,_0xcb0940){return db[_0xe8ef('0x2a')][_0xe8ef('0x25')]({'where':{'id':_0x425031['query']['ids']||[]},'raw':![],'individualHooks':!![]})[_0xe8ef('0x24')](respondWithResult(_0xcb0940,0xcc))[_0xe8ef('0x42')](handleError(_0xcb0940,null));};exports['addFields']=function(_0x40772b,_0x430710,_0x5c29fc){return db[_0xe8ef('0x4a')][_0xe8ef('0x4b')]({'where':{'id':_0x40772b[_0xe8ef('0x43')]['id']}})['then'](handleEntityNotFound(_0x430710,null))[_0xe8ef('0x24')](function(_0x3e4788){if(_0x3e4788){return db['sequelize'][_0xe8ef('0x4c')](function(_0x360358){return db[_0xe8ef('0x2a')][_0xe8ef('0x25')]({'where':{'CustomReportId':_0x40772b[_0xe8ef('0x43')]['id']},'transaction':_0x360358})[_0xe8ef('0x24')](function(_0x23205b){var _0x326a64=_['map'](_0x40772b[_0xe8ef('0x47')],function(_0x16720b){delete _0x16720b['id'];_0x16720b[_0xe8ef('0x4d')]=_0x40772b[_0xe8ef('0x43')]['id'];return _0x16720b;});return db[_0xe8ef('0x2a')][_0xe8ef('0x48')](_0x326a64,{'transaction':_0x360358});});})['then'](function(){return db['AnalyticFieldReport'][_0xe8ef('0x40')]({'where':{'CustomReportId':_0x40772b[_0xe8ef('0x43')]['id']}});});}})[_0xe8ef('0x24')](respondWithResult(_0x430710,null))['catch'](handleError(_0x430710,null));};
\ No newline at end of file
+var _0xfc3c=['key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','fields','create','body','bulkCreate','find','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','findAll','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','name','index','map','AnalyticFieldReport','rawAttributes','fieldName','type'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0xfc3c,0x121));var _0xcfc3=function(_0xc069,_0x3005d6){_0xc069=_0xc069-0x0;var _0x3f143c=_0xfc3c[_0xc069];return _0x3f143c;};'use strict';var emlformat=require(_0xcfc3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcfc3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcfc3('0x2'));var moment=require(_0xcfc3('0x3'));var BPromise=require(_0xcfc3('0x4'));var Mustache=require(_0xcfc3('0x5'));var util=require(_0xcfc3('0x6'));var path=require(_0xcfc3('0x7'));var sox=require(_0xcfc3('0x8'));var csv=require(_0xcfc3('0x9'));var ejs=require(_0xcfc3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcfc3('0xb'));var squel=require(_0xcfc3('0xc'));var crypto=require(_0xcfc3('0xd'));var jsforce=require(_0xcfc3('0xe'));var deskjs=require(_0xcfc3('0xf'));var toCsv=require(_0xcfc3('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcfc3('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcfc3('0x11'));var as=require(_0xcfc3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcfc3('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xcfc3('0x14'));var licenseUtil=require(_0xcfc3('0x15'));var db=require(_0xcfc3('0x16'))['db'];function respondWithStatusCode(_0x4c17a4,_0x58c663){_0x58c663=_0x58c663||0xcc;return function(_0x2a0cec){if(_0x2a0cec){return _0x4c17a4['sendStatus'](_0x58c663);}return _0x4c17a4['status'](_0x58c663)['end']();};}function respondWithResult(_0x2057ec,_0x17b0ed){_0x17b0ed=_0x17b0ed||0xc8;return function(_0x3b3bc4){if(_0x3b3bc4){return _0x2057ec[_0xcfc3('0x17')](_0x17b0ed)[_0xcfc3('0x18')](_0x3b3bc4);}};}function respondWithFilteredResult(_0x33d598,_0x55a6f3){return function(_0xac6465){if(_0xac6465){var _0x29b922=typeof _0x55a6f3[_0xcfc3('0x19')]===_0xcfc3('0x1a')&&typeof _0x55a6f3['limit']==='undefined';var _0x3198c1=_0xac6465[_0xcfc3('0x1b')];var _0x196698=_0x29b922?0x0:_0x55a6f3[_0xcfc3('0x19')];var _0x1ad128=_0x29b922?_0xac6465[_0xcfc3('0x1b')]:_0x55a6f3[_0xcfc3('0x19')]+_0x55a6f3[_0xcfc3('0x1c')];var _0xb2a936;if(_0x1ad128>=_0x3198c1){_0x1ad128=_0x3198c1;_0xb2a936=0xc8;}else{_0xb2a936=0xce;}_0x33d598[_0xcfc3('0x17')](_0xb2a936);return _0x33d598[_0xcfc3('0x1d')](_0xcfc3('0x1e'),_0x196698+'-'+_0x1ad128+'/'+_0x3198c1)[_0xcfc3('0x18')](_0xac6465);}return null;};}function patchUpdates(_0x2eae73){return function(_0x1511a7){try{jsonpatch[_0xcfc3('0x1f')](_0x1511a7,_0x2eae73,!![]);}catch(_0x13013d){return BPromise[_0xcfc3('0x20')](_0x13013d);}return _0x1511a7[_0xcfc3('0x21')]();};}function saveUpdates(_0x1d2919,_0x225221){return function(_0x3769d5){if(_0x3769d5){return _0x3769d5[_0xcfc3('0x22')](_0x1d2919)[_0xcfc3('0x23')](function(_0x4cc4ed){return _0x4cc4ed;});}return null;};}function removeEntity(_0x55ec2f,_0x29a7e8){return function(_0x30c4d4){if(_0x30c4d4){return _0x30c4d4[_0xcfc3('0x24')]()[_0xcfc3('0x23')](function(){_0x55ec2f[_0xcfc3('0x17')](0xcc)[_0xcfc3('0x25')]();});}};}function handleEntityNotFound(_0x4a93d9,_0x7f603a){return function(_0x202ae5){if(!_0x202ae5){_0x4a93d9[_0xcfc3('0x26')](0x194);}return _0x202ae5;};}function handleError(_0x363ea5,_0x3217dc){_0x3217dc=_0x3217dc||0x1f4;return function(_0x517127){logger[_0xcfc3('0x27')](_0x517127['stack']);if(_0x517127['name']){delete _0x517127[_0xcfc3('0x28')];}_0x363ea5[_0xcfc3('0x17')](_0x3217dc)['send'](_0x517127);};}exports[_0xcfc3('0x29')]=function(_0x2647ff,_0x1bd8b0){var _0x2d9613={},_0x524323={},_0x1a24b8={'count':0x0,'rows':[]};var _0x769c5c=_[_0xcfc3('0x2a')](db[_0xcfc3('0x2b')][_0xcfc3('0x2c')],function(_0x285332){return{'name':_0x285332[_0xcfc3('0x2d')],'type':_0x285332[_0xcfc3('0x2e')][_0xcfc3('0x2f')]};});_0x524323[_0xcfc3('0x30')]=_[_0xcfc3('0x2a')](_0x769c5c,_0xcfc3('0x28'));_0x524323[_0xcfc3('0x31')]=_[_0xcfc3('0x32')](_0x2647ff[_0xcfc3('0x31')]);_0x524323[_0xcfc3('0x33')]=_[_0xcfc3('0x34')](_0x524323['model'],_0x524323[_0xcfc3('0x31')]);_0x2d9613[_0xcfc3('0x35')]=_[_0xcfc3('0x34')](_0x524323[_0xcfc3('0x30')],qs['fields'](_0x2647ff[_0xcfc3('0x31')]['fields']));_0x2d9613[_0xcfc3('0x35')]=_0x2d9613['attributes'][_0xcfc3('0x36')]?_0x2d9613['attributes']:_0x524323['model'];if(!_0x2647ff['query'][_0xcfc3('0x37')](_0xcfc3('0x38'))){_0x2d9613[_0xcfc3('0x1c')]=qs['limit'](_0x2647ff[_0xcfc3('0x31')][_0xcfc3('0x1c')]);_0x2d9613[_0xcfc3('0x19')]=qs['offset'](_0x2647ff[_0xcfc3('0x31')][_0xcfc3('0x19')]);}_0x2d9613[_0xcfc3('0x39')]=qs[_0xcfc3('0x3a')](_0x2647ff[_0xcfc3('0x31')][_0xcfc3('0x3a')]);_0x2d9613[_0xcfc3('0x3b')]=qs[_0xcfc3('0x33')](_[_0xcfc3('0x3c')](_0x2647ff[_0xcfc3('0x31')],_0x524323['filters']),_0x769c5c);if(_0x2647ff[_0xcfc3('0x31')][_0xcfc3('0x3d')]){_0x2d9613['where']=_['merge'](_0x2d9613[_0xcfc3('0x3b')],{'$or':_[_0xcfc3('0x2a')](_0x769c5c,function(_0x738713){if(_0x738713['type']!==_0xcfc3('0x3e')){var _0x5c6b45={};_0x5c6b45[_0x738713[_0xcfc3('0x28')]]={'$like':'%'+_0x2647ff['query'][_0xcfc3('0x3d')]+'%'};return _0x5c6b45;}})});}_0x2d9613=_[_0xcfc3('0x3f')]({},_0x2d9613,_0x2647ff[_0xcfc3('0x40')]);var _0x4cbded={'where':_0x2d9613['where']};return db[_0xcfc3('0x2b')][_0xcfc3('0x1b')](_0x4cbded)[_0xcfc3('0x23')](function(_0x50c3d2){_0x1a24b8[_0xcfc3('0x1b')]=_0x50c3d2;if(_0x2647ff[_0xcfc3('0x31')][_0xcfc3('0x41')]){_0x2d9613[_0xcfc3('0x42')]=[{'all':!![]}];}return db[_0xcfc3('0x2b')]['findAll'](_0x2d9613);})[_0xcfc3('0x23')](function(_0x21ad5d){_0x1a24b8[_0xcfc3('0x43')]=_0x21ad5d;return _0x1a24b8;})[_0xcfc3('0x23')](respondWithFilteredResult(_0x1bd8b0,_0x2d9613))[_0xcfc3('0x44')](handleError(_0x1bd8b0,null));};exports[_0xcfc3('0x45')]=function(_0xe712d2,_0x342300){var _0x310f79={'raw':![],'where':{'id':_0xe712d2[_0xcfc3('0x46')]['id']}},_0x49a05d={};_0x49a05d[_0xcfc3('0x30')]=_['keys'](db[_0xcfc3('0x2b')][_0xcfc3('0x2c')]);_0x49a05d[_0xcfc3('0x31')]=_['keys'](_0xe712d2[_0xcfc3('0x31')]);_0x49a05d[_0xcfc3('0x33')]=_[_0xcfc3('0x34')](_0x49a05d['model'],_0x49a05d[_0xcfc3('0x31')]);_0x310f79[_0xcfc3('0x35')]=_['intersection'](_0x49a05d[_0xcfc3('0x30')],qs[_0xcfc3('0x47')](_0xe712d2[_0xcfc3('0x31')]['fields']));_0x310f79['attributes']=_0x310f79['attributes'][_0xcfc3('0x36')]?_0x310f79[_0xcfc3('0x35')]:_0x49a05d[_0xcfc3('0x30')];if(_0xe712d2[_0xcfc3('0x31')][_0xcfc3('0x41')]){_0x310f79['include']=[{'all':!![]}];}_0x310f79=_[_0xcfc3('0x3f')]({},_0x310f79,_0xe712d2[_0xcfc3('0x40')]);return db[_0xcfc3('0x2b')]['find'](_0x310f79)['then'](handleEntityNotFound(_0x342300,null))[_0xcfc3('0x23')](respondWithResult(_0x342300,null))['catch'](handleError(_0x342300,null));};exports['create']=function(_0x4ceac2,_0x2cf389){return db[_0xcfc3('0x2b')][_0xcfc3('0x48')](_0x4ceac2[_0xcfc3('0x49')],{})['then'](respondWithResult(_0x2cf389,0xc9))[_0xcfc3('0x44')](handleError(_0x2cf389,null));};exports[_0xcfc3('0x4a')]=function(_0x193145,_0x31ea7b){return db[_0xcfc3('0x2b')][_0xcfc3('0x4a')](_0x193145[_0xcfc3('0x49')],{'raw':![],'individualHooks':!![]})[_0xcfc3('0x23')](respondWithResult(_0x31ea7b,0xc9))[_0xcfc3('0x44')](handleError(_0x31ea7b,null));};exports[_0xcfc3('0x22')]=function(_0x4e97e7,_0x144c94){if(_0x4e97e7[_0xcfc3('0x49')]['id']){delete _0x4e97e7[_0xcfc3('0x49')]['id'];}return db[_0xcfc3('0x2b')]['find']({'where':{'id':_0x4e97e7[_0xcfc3('0x46')]['id']}})[_0xcfc3('0x23')](handleEntityNotFound(_0x144c94,null))[_0xcfc3('0x23')](saveUpdates(_0x4e97e7['body'],null))[_0xcfc3('0x23')](respondWithResult(_0x144c94,null))[_0xcfc3('0x44')](handleError(_0x144c94,null));};exports[_0xcfc3('0x24')]=function(_0x22ab9c,_0x29153d){return db[_0xcfc3('0x2b')][_0xcfc3('0x4b')]({'where':{'id':_0x22ab9c[_0xcfc3('0x46')]['id']}})[_0xcfc3('0x23')](handleEntityNotFound(_0x29153d,null))[_0xcfc3('0x23')](removeEntity(_0x29153d,null))[_0xcfc3('0x44')](handleError(_0x29153d,null));};exports[_0xcfc3('0x4c')]=function(_0x66d4b6,_0x1c9c53){return db[_0xcfc3('0x2b')][_0xcfc3('0x24')]({'where':{'id':_0x66d4b6[_0xcfc3('0x31')][_0xcfc3('0x4d')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x1c9c53,0xcc))[_0xcfc3('0x44')](handleError(_0x1c9c53,null));};exports[_0xcfc3('0x4e')]=function(_0xf85699,_0x1df7a1,_0x382c97){return db[_0xcfc3('0x4f')]['findOne']({'where':{'id':_0xf85699['params']['id']}})[_0xcfc3('0x23')](handleEntityNotFound(_0x1df7a1,null))[_0xcfc3('0x23')](function(_0x566f88){if(_0x566f88){return db[_0xcfc3('0x50')][_0xcfc3('0x51')](function(_0x2e0ce1){return db[_0xcfc3('0x2b')]['destroy']({'where':{'CustomReportId':_0xf85699['params']['id']},'transaction':_0x2e0ce1})[_0xcfc3('0x23')](function(_0x3a47ee){var _0x1a5711=_[_0xcfc3('0x2a')](_0xf85699[_0xcfc3('0x49')],function(_0x47e791){delete _0x47e791['id'];_0x47e791[_0xcfc3('0x52')]=_0xf85699[_0xcfc3('0x46')]['id'];return _0x47e791;});return db['AnalyticFieldReport']['bulkCreate'](_0x1a5711,{'transaction':_0x2e0ce1});});})[_0xcfc3('0x23')](function(){return db[_0xcfc3('0x2b')][_0xcfc3('0x53')]({'where':{'CustomReportId':_0xf85699[_0xcfc3('0x46')]['id']}});});}})[_0xcfc3('0x23')](respondWithResult(_0x1df7a1,null))['catch'](handleError(_0x1df7a1,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 1b1e8b1..3863a94 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 _0xd7f5=['./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','../../config/logger','api','moment','request-promise','path'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xd7f5,0x1bd));var _0x5d7f=function(_0x51d3ac,_0x2cdcfc){_0x51d3ac=_0x51d3ac-0x0;var _0x29b333=_0xd7f5[_0x51d3ac];return _0x29b333;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5d7f('0x0'))(_0x5d7f('0x1'));var moment=require(_0x5d7f('0x2'));var BPromise=require('bluebird');var rp=require(_0x5d7f('0x3'));var fs=require('fs');var path=require(_0x5d7f('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5d7f('0x5'));module[_0x5d7f('0x6')]=function(_0x1efba9,_0x36f1a8){return _0x1efba9['define'](_0x5d7f('0x7'),attributes,{'tableName':_0x5d7f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8eb2=['../../config/environment','exports','define','AnalyticFieldReport','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x9b3efc,_0x577a0d){var _0x200f05=function(_0x15ad7c){while(--_0x15ad7c){_0x9b3efc['push'](_0x9b3efc['shift']());}};_0x200f05(++_0x577a0d);}(_0x8eb2,0x64));var _0x28eb=function(_0x235cea,_0x4c3504){_0x235cea=_0x235cea-0x0;var _0x15ee93=_0x8eb2[_0x235cea];return _0x15ee93;};'use strict';var _=require(_0x28eb('0x0'));var util=require(_0x28eb('0x1'));var logger=require('../../config/logger')(_0x28eb('0x2'));var moment=require(_0x28eb('0x3'));var BPromise=require(_0x28eb('0x4'));var rp=require(_0x28eb('0x5'));var fs=require('fs');var path=require(_0x28eb('0x6'));var rimraf=require(_0x28eb('0x7'));var config=require(_0x28eb('0x8'));var attributes=require('./analyticFieldReport.attributes');module[_0x28eb('0x9')]=function(_0x1d80eb,_0x4d3d9f){return _0x1d80eb[_0x28eb('0xa')](_0x28eb('0xb'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 25e7f54..9db0b89 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 _0x02b6=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','info','result','catch'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x02b6,0xf0));var _0x602b=function(_0x379411,_0x20ad86){_0x379411=_0x379411-0x0;var _0x5a94d6=_0x02b6[_0x379411];return _0x5a94d6;};'use strict';var _=require(_0x602b('0x0'));var util=require(_0x602b('0x1'));var moment=require(_0x602b('0x2'));var BPromise=require(_0x602b('0x3'));var rs=require(_0x602b('0x4'));var fs=require('fs');var Redis=require(_0x602b('0x5'));var db=require(_0x602b('0x6'))['db'];var utils=require(_0x602b('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x602b('0x8'));var jayson=require(_0x602b('0x9'));var client=jayson[_0x602b('0xa')][_0x602b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x32b20b,_0x7f2bd3,_0xbde44f){return new BPromise(function(_0x577809,_0x1ed58d){return client[_0x602b('0xc')](_0x32b20b,_0xbde44f)['then'](function(_0x5d3803){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x7f2bd3,_0x602b('0xd'));logger[_0x602b('0xe')](_0x602b('0xf'),_0x7f2bd3,'request\x20sent',JSON[_0x602b('0x10')](_0x5d3803));if(_0x5d3803[_0x602b('0x11')]){if(_0x5d3803['error'][_0x602b('0x12')]===0x1f4){logger[_0x602b('0x11')](_0x602b('0x13'),_0x7f2bd3,_0x5d3803[_0x602b('0x11')]['message']);return _0x1ed58d(_0x5d3803[_0x602b('0x11')][_0x602b('0x14')]);}logger[_0x602b('0x11')](_0x602b('0x13'),_0x7f2bd3,_0x5d3803[_0x602b('0x11')][_0x602b('0x14')]);return _0x577809(_0x5d3803[_0x602b('0x11')][_0x602b('0x14')]);}else{logger[_0x602b('0x15')](_0x602b('0x13'),_0x7f2bd3,_0x602b('0xd'));_0x577809(_0x5d3803[_0x602b('0x16')][_0x602b('0x14')]);}})[_0x602b('0x17')](function(_0x3a88aa){logger[_0x602b('0x11')](_0x602b('0x13'),_0x7f2bd3,_0x3a88aa);_0x1ed58d(_0x3a88aa);});});}
\ No newline at end of file
+var _0x886f=['http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x323d37,_0x53afac){var _0x5086d3=function(_0x434845){while(--_0x434845){_0x323d37['push'](_0x323d37['shift']());}};_0x5086d3(++_0x53afac);}(_0x886f,0x12a));var _0xf886=function(_0x279bf1,_0xe55ebd){_0x279bf1=_0x279bf1-0x0;var _0x5d64bb=_0x886f[_0x279bf1];return _0x5d64bb;};'use strict';var _=require('lodash');var util=require(_0xf886('0x0'));var moment=require(_0xf886('0x1'));var BPromise=require(_0xf886('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf886('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf886('0x4'));var logger=require(_0xf886('0x5'))(_0xf886('0x6'));var config=require(_0xf886('0x7'));var jayson=require(_0xf886('0x8'));var client=jayson[_0xf886('0x9')][_0xf886('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ccb75,_0x2cb8cc,_0x51e775){return new BPromise(function(_0x480ba5,_0x5a3872){return client[_0xf886('0xb')](_0x3ccb75,_0x51e775)[_0xf886('0xc')](function(_0x3383ef){logger[_0xf886('0xd')](_0xf886('0xe'),_0x2cb8cc,_0xf886('0xf'));logger[_0xf886('0x10')](_0xf886('0x11'),_0x2cb8cc,_0xf886('0xf'),JSON['stringify'](_0x3383ef));if(_0x3383ef[_0xf886('0x12')]){if(_0x3383ef[_0xf886('0x12')]['code']===0x1f4){logger[_0xf886('0x12')](_0xf886('0xe'),_0x2cb8cc,_0x3383ef[_0xf886('0x12')]['message']);return _0x5a3872(_0x3383ef[_0xf886('0x12')]['message']);}logger[_0xf886('0x12')](_0xf886('0xe'),_0x2cb8cc,_0x3383ef[_0xf886('0x12')]['message']);return _0x480ba5(_0x3383ef[_0xf886('0x12')][_0xf886('0x13')]);}else{logger[_0xf886('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2cb8cc,_0xf886('0xf'));_0x480ba5(_0x3383ef[_0xf886('0x14')]['message']);}})[_0xf886('0x15')](function(_0x2a887e){logger[_0xf886('0x12')](_0xf886('0xe'),_0x2cb8cc,_0x2a887e);_0x5a3872(_0x2a887e);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 8b7cc58..daf5510 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(_0x2a0926,_0x369af6){var _0xd54864=function(_0x1f3685){while(--_0x1f3685){_0x2a0926['push'](_0x2a0926['shift']());}};_0xd54864(++_0x369af6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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(_0x432874,_0x49bab7){var _0x202325=function(_0x4226f5){while(--_0x4226f5){_0x432874['push'](_0x432874['shift']());}};_0x202325(++_0x49bab7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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 9b8563f..6160aa2 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 _0x2b4f=['STRING','TEXT','exports','name'];(function(_0x2ec905,_0x442fb6){var _0xc98bd=function(_0x363b91){while(--_0x363b91){_0x2ec905['push'](_0x2ec905['shift']());}};_0xc98bd(++_0x442fb6);}(_0x2b4f,0x142));var _0xf2b4=function(_0xabbde1,_0x4e8c81){_0xabbde1=_0xabbde1-0x0;var _0x428696=_0x2b4f[_0xabbde1];return _0x428696;};'use strict';var Sequelize=require('sequelize');module[_0xf2b4('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf2b4('0x1')},'table':{'type':Sequelize[_0xf2b4('0x2')]},'metric':{'type':Sequelize[_0xf2b4('0x3')]},'description':{'type':Sequelize[_0xf2b4('0x2')]}};
\ No newline at end of file
+var _0x4dc0=['name','TEXT','STRING'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x4dc0,0x13d));var _0x04dc=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x4dc0[_0x28947d];return _0x12d2ee;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x04dc('0x0')],'allowNull':![],'unique':_0x04dc('0x1')},'table':{'type':Sequelize[_0x04dc('0x0')]},'metric':{'type':Sequelize[_0x04dc('0x2')]},'description':{'type':Sequelize[_0x04dc('0x0')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 6ceda20..bae1c56 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 _0x425d=['VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','where','merge'];(function(_0xce3e5c,_0x5ef695){var _0x5ac033=function(_0x3e38f3){while(--_0x3e38f3){_0xce3e5c['push'](_0xce3e5c['shift']());}};_0x5ac033(++_0x5ef695);}(_0x425d,0x1e0));var _0xd425=function(_0x52a073,_0x225c33){_0x52a073=_0x52a073-0x0;var _0x14c817=_0x425d[_0x52a073];return _0x14c817;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];function respondWithStatusCode(_0x9bb611,_0x3cacf7){_0x3cacf7=_0x3cacf7||0xcc;return function(_0x3b5de8){if(_0x3b5de8){return _0x9bb611[_0xd425('0x1d')](_0x3cacf7);}return _0x9bb611['status'](_0x3cacf7)[_0xd425('0x1e')]();};}function respondWithResult(_0x17a498,_0x336dc3){_0x336dc3=_0x336dc3||0xc8;return function(_0x5d3d60){if(_0x5d3d60){return _0x17a498[_0xd425('0x1f')](_0x336dc3)[_0xd425('0x20')](_0x5d3d60);}};}function respondWithFilteredResult(_0x643fd2,_0x41f34d){return function(_0x1fc822){if(_0x1fc822){var _0x538a0a=typeof _0x41f34d[_0xd425('0x21')]===_0xd425('0x22')&&typeof _0x41f34d[_0xd425('0x23')]===_0xd425('0x22');var _0x5d6585=_0x1fc822[_0xd425('0x24')];var _0x434d97=_0x538a0a?0x0:_0x41f34d[_0xd425('0x21')];var _0x1155bc=_0x538a0a?_0x1fc822['count']:_0x41f34d['offset']+_0x41f34d['limit'];var _0x4b293a;if(_0x1155bc>=_0x5d6585){_0x1155bc=_0x5d6585;_0x4b293a=0xc8;}else{_0x4b293a=0xce;}_0x643fd2[_0xd425('0x1f')](_0x4b293a);return _0x643fd2[_0xd425('0x25')](_0xd425('0x26'),_0x434d97+'-'+_0x1155bc+'/'+_0x5d6585)['json'](_0x1fc822);}return null;};}function patchUpdates(_0x355af0){return function(_0x7e982e){try{jsonpatch['apply'](_0x7e982e,_0x355af0,!![]);}catch(_0x2e1ec4){return BPromise[_0xd425('0x27')](_0x2e1ec4);}return _0x7e982e[_0xd425('0x28')]();};}function saveUpdates(_0x1d3fc0,_0x3e93db){return function(_0xb240c4){if(_0xb240c4){return _0xb240c4[_0xd425('0x29')](_0x1d3fc0)[_0xd425('0x2a')](function(_0x314201){return _0x314201;});}return null;};}function removeEntity(_0x2b030b,_0x151ad9){return function(_0x40e84b){if(_0x40e84b){return _0x40e84b['destroy']()[_0xd425('0x2a')](function(){var _0x264b0e=_0x40e84b[_0xd425('0x2b')]({'plain':!![]});var _0x1908a5=_0xd425('0x2c');return db[_0xd425('0x2d')][_0xd425('0x2e')]({'where':{'type':_0x1908a5,'resourceId':_0x264b0e['id']}})['then'](function(){return _0x40e84b;});})[_0xd425('0x2a')](function(){_0x2b030b[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();});}};}function handleEntityNotFound(_0x57c950,_0x27ef8a){return function(_0x3ad9bd){if(!_0x3ad9bd){_0x57c950[_0xd425('0x1d')](0x194);}return _0x3ad9bd;};}function handleError(_0x999fb9,_0x27d29a){_0x27d29a=_0x27d29a||0x1f4;return function(_0x185d7e){logger[_0xd425('0x2f')](_0x185d7e[_0xd425('0x30')]);if(_0x185d7e[_0xd425('0x31')]){delete _0x185d7e[_0xd425('0x31')];}_0x999fb9['status'](_0x27d29a)[_0xd425('0x32')](_0x185d7e);};}exports[_0xd425('0x33')]=function(_0x298602,_0x3695dd){var _0x3275b1={},_0x1abf33={},_0x47405f={'count':0x0,'rows':[]};var _0x40c392=_[_0xd425('0x34')](db[_0xd425('0x35')][_0xd425('0x36')],function(_0x5f3dab){return{'name':_0x5f3dab[_0xd425('0x37')],'type':_0x5f3dab[_0xd425('0x38')][_0xd425('0x39')]};});_0x1abf33[_0xd425('0x3a')]=_[_0xd425('0x34')](_0x40c392,'name');_0x1abf33[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x298602['query']);_0x1abf33['filters']=_['intersection'](_0x1abf33[_0xd425('0x3a')],_0x1abf33[_0xd425('0x3b')]);_0x3275b1[_0xd425('0x3d')]=_[_0xd425('0x3e')](_0x1abf33['model'],qs[_0xd425('0x3f')](_0x298602[_0xd425('0x3b')][_0xd425('0x3f')]));_0x3275b1[_0xd425('0x3d')]=_0x3275b1[_0xd425('0x3d')][_0xd425('0x40')]?_0x3275b1[_0xd425('0x3d')]:_0x1abf33['model'];if(!_0x298602[_0xd425('0x3b')]['hasOwnProperty'](_0xd425('0x41'))){_0x3275b1[_0xd425('0x23')]=qs[_0xd425('0x23')](_0x298602['query'][_0xd425('0x23')]);_0x3275b1[_0xd425('0x21')]=qs[_0xd425('0x21')](_0x298602[_0xd425('0x3b')]['offset']);}_0x3275b1[_0xd425('0x42')]=qs[_0xd425('0x43')](_0x298602['query']['sort']);_0x3275b1['where']=qs[_0xd425('0x44')](_[_0xd425('0x45')](_0x298602[_0xd425('0x3b')],_0x1abf33['filters']),_0x40c392);if(_0x298602['query']['filter']){_0x3275b1[_0xd425('0x46')]=_[_0xd425('0x47')](_0x3275b1[_0xd425('0x46')],{'$or':_[_0xd425('0x34')](_0x40c392,function(_0xa9fd7c){if(_0xa9fd7c[_0xd425('0x38')]!==_0xd425('0x48')){var _0x4b922f={};_0x4b922f[_0xa9fd7c[_0xd425('0x31')]]={'$like':'%'+_0x298602[_0xd425('0x3b')][_0xd425('0x49')]+'%'};return _0x4b922f;}})});}_0x3275b1=_['merge']({},_0x3275b1,_0x298602[_0xd425('0x4a')]);var _0x2dffc7={'where':_0x3275b1[_0xd425('0x46')]};return db['AnalyticMetric'][_0xd425('0x24')](_0x2dffc7)[_0xd425('0x2a')](function(_0x1c5ba6){_0x47405f[_0xd425('0x24')]=_0x1c5ba6;if(_0x298602['query'][_0xd425('0x4b')]){_0x3275b1[_0xd425('0x4c')]=[{'all':!![]}];}return db[_0xd425('0x35')][_0xd425('0x4d')](_0x3275b1);})[_0xd425('0x2a')](function(_0x2f6bf7){_0x47405f[_0xd425('0x4e')]=_0x2f6bf7;return _0x47405f;})['then'](respondWithFilteredResult(_0x3695dd,_0x3275b1))[_0xd425('0x4f')](handleError(_0x3695dd,null));};exports[_0xd425('0x50')]=function(_0x5b65fe,_0x1a44a8){var _0x491c51={'raw':!![],'where':{'id':_0x5b65fe[_0xd425('0x51')]['id']}},_0x5e12bf={};_0x5e12bf['model']=_[_0xd425('0x3c')](db['AnalyticMetric'][_0xd425('0x36')]);_0x5e12bf[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x5b65fe[_0xd425('0x3b')]);_0x5e12bf[_0xd425('0x44')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],_0x5e12bf['query']);_0x491c51[_0xd425('0x3d')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],qs[_0xd425('0x3f')](_0x5b65fe[_0xd425('0x3b')][_0xd425('0x3f')]));_0x491c51[_0xd425('0x3d')]=_0x491c51['attributes'][_0xd425('0x40')]?_0x491c51[_0xd425('0x3d')]:_0x5e12bf[_0xd425('0x3a')];if(_0x5b65fe[_0xd425('0x3b')][_0xd425('0x4b')]){_0x491c51['include']=[{'all':!![]}];}_0x491c51=_[_0xd425('0x47')]({},_0x491c51,_0x5b65fe[_0xd425('0x4a')]);return db[_0xd425('0x35')][_0xd425('0x52')](_0x491c51)[_0xd425('0x2a')](handleEntityNotFound(_0x1a44a8,null))[_0xd425('0x2a')](respondWithResult(_0x1a44a8,null))['catch'](handleError(_0x1a44a8,null));};exports[_0xd425('0x53')]=function(_0x128cb3,_0x5bfac6){return db[_0xd425('0x35')][_0xd425('0x53')](_0x128cb3[_0xd425('0x54')],{})[_0xd425('0x2a')](function(_0x5c0219){var _0x54f1d=_0x128cb3[_0xd425('0x55')][_0xd425('0x2b')]({'plain':!![]});if(!_0x54f1d)throw new Error(_0xd425('0x56'));if(_0x54f1d[_0xd425('0x57')]==='user'){var _0x4be6fa=_0x5c0219[_0xd425('0x2b')]({'plain':!![]});var _0x5496d8=_0xd425('0x2c');return db[_0xd425('0x58')]['find']({'where':{'name':_0x5496d8,'userProfileId':_0x54f1d[_0xd425('0x59')]},'raw':!![]})['then'](function(_0x48d5b8){if(_0x48d5b8&&_0x48d5b8[_0xd425('0x5a')]===0x0){return db[_0xd425('0x2d')][_0xd425('0x53')]({'name':_0x4be6fa[_0xd425('0x31')],'resourceId':_0x4be6fa['id'],'type':_0x48d5b8[_0xd425('0x31')],'sectionId':_0x48d5b8['id']},{})[_0xd425('0x2a')](function(){return _0x5c0219;});}else{return _0x5c0219;}})[_0xd425('0x4f')](function(_0x4118fe){logger['error'](_0xd425('0x5b'),_0x4118fe);throw _0x4118fe;});}return _0x5c0219;})[_0xd425('0x2a')](respondWithResult(_0x5bfac6,0xc9))[_0xd425('0x4f')](handleError(_0x5bfac6,null));};exports[_0xd425('0x29')]=function(_0x7b1080,_0x1c80c2){if(_0x7b1080[_0xd425('0x54')]['id']){delete _0x7b1080[_0xd425('0x54')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0x7b1080['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x1c80c2,null))[_0xd425('0x2a')](saveUpdates(_0x7b1080[_0xd425('0x54')],null))[_0xd425('0x2a')](respondWithResult(_0x1c80c2,null))['catch'](handleError(_0x1c80c2,null));};exports['destroy']=function(_0x499a60,_0x5e1294){return db[_0xd425('0x35')][_0xd425('0x52')]({'where':{'id':_0x499a60['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x5e1294,null))[_0xd425('0x2a')](removeEntity(_0x5e1294,null))[_0xd425('0x4f')](handleError(_0x5e1294,null));};
\ No newline at end of file
+var _0xabce=['includeAll','rows','show','params','intersection','length','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','order','filter','merge','VIRTUAL','options'];(function(_0x2a3182,_0x1dcadc){var _0x3a5ca4=function(_0x4d4c72){while(--_0x4d4c72){_0x2a3182['push'](_0x2a3182['shift']());}};_0x3a5ca4(++_0x1dcadc);}(_0xabce,0x103));var _0xeabc=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xabce[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];function respondWithStatusCode(_0x3fd0b5,_0x36a92e){_0x36a92e=_0x36a92e||0xcc;return function(_0xcfbf06){if(_0xcfbf06){return _0x3fd0b5['sendStatus'](_0x36a92e);}return _0x3fd0b5[_0xeabc('0x1a')](_0x36a92e)[_0xeabc('0x1b')]();};}function respondWithResult(_0x3251c6,_0x55f0de){_0x55f0de=_0x55f0de||0xc8;return function(_0x5f4ee8){if(_0x5f4ee8){return _0x3251c6[_0xeabc('0x1a')](_0x55f0de)[_0xeabc('0x1c')](_0x5f4ee8);}};}function respondWithFilteredResult(_0x326bac,_0x53d5cb){return function(_0xf913d7){if(_0xf913d7){var _0x638976=typeof _0x53d5cb['offset']==='undefined'&&typeof _0x53d5cb[_0xeabc('0x1d')]==='undefined';var _0x3d0e21=_0xf913d7[_0xeabc('0x1e')];var _0x58a3c0=_0x638976?0x0:_0x53d5cb[_0xeabc('0x1f')];var _0x31dd53=_0x638976?_0xf913d7[_0xeabc('0x1e')]:_0x53d5cb[_0xeabc('0x1f')]+_0x53d5cb[_0xeabc('0x1d')];var _0x5d92e5;if(_0x31dd53>=_0x3d0e21){_0x31dd53=_0x3d0e21;_0x5d92e5=0xc8;}else{_0x5d92e5=0xce;}_0x326bac[_0xeabc('0x1a')](_0x5d92e5);return _0x326bac['set'](_0xeabc('0x20'),_0x58a3c0+'-'+_0x31dd53+'/'+_0x3d0e21)[_0xeabc('0x1c')](_0xf913d7);}return null;};}function patchUpdates(_0x502947){return function(_0x28063a){try{jsonpatch[_0xeabc('0x21')](_0x28063a,_0x502947,!![]);}catch(_0x254590){return BPromise[_0xeabc('0x22')](_0x254590);}return _0x28063a[_0xeabc('0x23')]();};}function saveUpdates(_0x4e99a4,_0xecdbf){return function(_0x10c675){if(_0x10c675){return _0x10c675[_0xeabc('0x24')](_0x4e99a4)['then'](function(_0x457f27){return _0x457f27;});}return null;};}function removeEntity(_0x3854d2,_0x214953){return function(_0x319119){if(_0x319119){return _0x319119['destroy']()[_0xeabc('0x25')](function(){var _0x480440=_0x319119[_0xeabc('0x26')]({'plain':!![]});var _0x4d4e29=_0xeabc('0x27');return db[_0xeabc('0x28')][_0xeabc('0x29')]({'where':{'type':_0x4d4e29,'resourceId':_0x480440['id']}})[_0xeabc('0x25')](function(){return _0x319119;});})[_0xeabc('0x25')](function(){_0x3854d2[_0xeabc('0x1a')](0xcc)[_0xeabc('0x1b')]();});}};}function handleEntityNotFound(_0x4c2693,_0x5b2934){return function(_0x459c8a){if(!_0x459c8a){_0x4c2693['sendStatus'](0x194);}return _0x459c8a;};}function handleError(_0x3c1b5b,_0x2b342c){_0x2b342c=_0x2b342c||0x1f4;return function(_0x48fb52){logger[_0xeabc('0x2a')](_0x48fb52[_0xeabc('0x2b')]);if(_0x48fb52[_0xeabc('0x2c')]){delete _0x48fb52[_0xeabc('0x2c')];}_0x3c1b5b[_0xeabc('0x1a')](_0x2b342c)[_0xeabc('0x2d')](_0x48fb52);};}exports[_0xeabc('0x2e')]=function(_0x38dc0a,_0x2915c1){var _0x5ebb86={},_0x5b34dd={},_0x5bb1f1={'count':0x0,'rows':[]};var _0x2f03e8=_[_0xeabc('0x2f')](db[_0xeabc('0x30')][_0xeabc('0x31')],function(_0x73c8d4){return{'name':_0x73c8d4[_0xeabc('0x32')],'type':_0x73c8d4[_0xeabc('0x33')]['key']};});_0x5b34dd[_0xeabc('0x34')]=_[_0xeabc('0x2f')](_0x2f03e8,_0xeabc('0x2c'));_0x5b34dd['query']=_[_0xeabc('0x35')](_0x38dc0a[_0xeabc('0x36')]);_0x5b34dd[_0xeabc('0x37')]=_['intersection'](_0x5b34dd[_0xeabc('0x34')],_0x5b34dd[_0xeabc('0x36')]);_0x5ebb86[_0xeabc('0x38')]=_['intersection'](_0x5b34dd[_0xeabc('0x34')],qs[_0xeabc('0x39')](_0x38dc0a['query']['fields']));_0x5ebb86[_0xeabc('0x38')]=_0x5ebb86[_0xeabc('0x38')]['length']?_0x5ebb86[_0xeabc('0x38')]:_0x5b34dd[_0xeabc('0x34')];if(!_0x38dc0a[_0xeabc('0x36')][_0xeabc('0x3a')](_0xeabc('0x3b'))){_0x5ebb86['limit']=qs[_0xeabc('0x1d')](_0x38dc0a['query'][_0xeabc('0x1d')]);_0x5ebb86[_0xeabc('0x1f')]=qs[_0xeabc('0x1f')](_0x38dc0a['query']['offset']);}_0x5ebb86[_0xeabc('0x3c')]=qs['sort'](_0x38dc0a[_0xeabc('0x36')]['sort']);_0x5ebb86['where']=qs['filters'](_['pick'](_0x38dc0a[_0xeabc('0x36')],_0x5b34dd['filters']),_0x2f03e8);if(_0x38dc0a[_0xeabc('0x36')][_0xeabc('0x3d')]){_0x5ebb86['where']=_[_0xeabc('0x3e')](_0x5ebb86['where'],{'$or':_[_0xeabc('0x2f')](_0x2f03e8,function(_0x58aafe){if(_0x58aafe[_0xeabc('0x33')]!==_0xeabc('0x3f')){var _0xeeef02={};_0xeeef02[_0x58aafe['name']]={'$like':'%'+_0x38dc0a['query']['filter']+'%'};return _0xeeef02;}})});}_0x5ebb86=_[_0xeabc('0x3e')]({},_0x5ebb86,_0x38dc0a[_0xeabc('0x40')]);var _0xafa59b={'where':_0x5ebb86['where']};return db['AnalyticMetric'][_0xeabc('0x1e')](_0xafa59b)[_0xeabc('0x25')](function(_0x5e9cb3){_0x5bb1f1[_0xeabc('0x1e')]=_0x5e9cb3;if(_0x38dc0a['query'][_0xeabc('0x41')]){_0x5ebb86['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x5ebb86);})[_0xeabc('0x25')](function(_0x37c926){_0x5bb1f1[_0xeabc('0x42')]=_0x37c926;return _0x5bb1f1;})[_0xeabc('0x25')](respondWithFilteredResult(_0x2915c1,_0x5ebb86))['catch'](handleError(_0x2915c1,null));};exports[_0xeabc('0x43')]=function(_0x555d26,_0x7d5add){var _0x1a4bbe={'raw':!![],'where':{'id':_0x555d26[_0xeabc('0x44')]['id']}},_0x3a7807={};_0x3a7807[_0xeabc('0x34')]=_['keys'](db['AnalyticMetric'][_0xeabc('0x31')]);_0x3a7807['query']=_[_0xeabc('0x35')](_0x555d26[_0xeabc('0x36')]);_0x3a7807['filters']=_[_0xeabc('0x45')](_0x3a7807[_0xeabc('0x34')],_0x3a7807[_0xeabc('0x36')]);_0x1a4bbe[_0xeabc('0x38')]=_[_0xeabc('0x45')](_0x3a7807[_0xeabc('0x34')],qs[_0xeabc('0x39')](_0x555d26['query'][_0xeabc('0x39')]));_0x1a4bbe[_0xeabc('0x38')]=_0x1a4bbe[_0xeabc('0x38')][_0xeabc('0x46')]?_0x1a4bbe[_0xeabc('0x38')]:_0x3a7807[_0xeabc('0x34')];if(_0x555d26[_0xeabc('0x36')][_0xeabc('0x41')]){_0x1a4bbe[_0xeabc('0x47')]=[{'all':!![]}];}_0x1a4bbe=_[_0xeabc('0x3e')]({},_0x1a4bbe,_0x555d26['options']);return db[_0xeabc('0x30')][_0xeabc('0x48')](_0x1a4bbe)[_0xeabc('0x25')](handleEntityNotFound(_0x7d5add,null))[_0xeabc('0x25')](respondWithResult(_0x7d5add,null))[_0xeabc('0x49')](handleError(_0x7d5add,null));};exports[_0xeabc('0x4a')]=function(_0x268d95,_0x48df43){return db[_0xeabc('0x30')][_0xeabc('0x4a')](_0x268d95[_0xeabc('0x4b')],{})[_0xeabc('0x25')](function(_0x47440e){var _0x58e2c1=_0x268d95[_0xeabc('0x4c')][_0xeabc('0x26')]({'plain':!![]});if(!_0x58e2c1)throw new Error(_0xeabc('0x4d'));if(_0x58e2c1[_0xeabc('0x4e')]==='user'){var _0x400b82=_0x47440e[_0xeabc('0x26')]({'plain':!![]});var _0x568847=_0xeabc('0x27');return db['UserProfileSection'][_0xeabc('0x48')]({'where':{'name':_0x568847,'userProfileId':_0x58e2c1['userProfileId']},'raw':!![]})[_0xeabc('0x25')](function(_0x2ec94c){if(_0x2ec94c&&_0x2ec94c[_0xeabc('0x4f')]===0x0){return db[_0xeabc('0x28')][_0xeabc('0x4a')]({'name':_0x400b82[_0xeabc('0x2c')],'resourceId':_0x400b82['id'],'type':_0x2ec94c[_0xeabc('0x2c')],'sectionId':_0x2ec94c['id']},{})[_0xeabc('0x25')](function(){return _0x47440e;});}else{return _0x47440e;}})[_0xeabc('0x49')](function(_0x6423f3){logger['error'](_0xeabc('0x50'),_0x6423f3);throw _0x6423f3;});}return _0x47440e;})[_0xeabc('0x25')](respondWithResult(_0x48df43,0xc9))[_0xeabc('0x49')](handleError(_0x48df43,null));};exports[_0xeabc('0x24')]=function(_0x555d6b,_0x1cef45){if(_0x555d6b[_0xeabc('0x4b')]['id']){delete _0x555d6b[_0xeabc('0x4b')]['id'];}return db[_0xeabc('0x30')]['find']({'where':{'id':_0x555d6b[_0xeabc('0x44')]['id']}})[_0xeabc('0x25')](handleEntityNotFound(_0x1cef45,null))[_0xeabc('0x25')](saveUpdates(_0x555d6b[_0xeabc('0x4b')],null))[_0xeabc('0x25')](respondWithResult(_0x1cef45,null))[_0xeabc('0x49')](handleError(_0x1cef45,null));};exports[_0xeabc('0x29')]=function(_0x3ff38c,_0x17acf8){return db['AnalyticMetric'][_0xeabc('0x48')]({'where':{'id':_0x3ff38c['params']['id']}})['then'](handleEntityNotFound(_0x17acf8,null))['then'](removeEntity(_0x17acf8,null))[_0xeabc('0x49')](handleError(_0x17acf8,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index dff2fc3..43b9c0d 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 _0x885a=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0x885a,0x180));var _0xa885=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x885a[_0x2be8c2];return _0x97f531;};'use strict';var _=require('lodash');var util=require(_0xa885('0x0'));var logger=require(_0xa885('0x1'))(_0xa885('0x2'));var moment=require(_0xa885('0x3'));var BPromise=require('bluebird');var rp=require(_0xa885('0x4'));var fs=require('fs');var path=require(_0xa885('0x5'));var rimraf=require(_0xa885('0x6'));var config=require(_0xa885('0x7'));var attributes=require(_0xa885('0x8'));module[_0xa885('0x9')]=function(_0x5dfd7e,_0x7ac6bd){return _0x5dfd7e[_0xa885('0xa')](_0xa885('0xb'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfdbd=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticMetric.attributes'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x57add2,_0x4f2b7d){_0x57add2=_0x57add2-0x0;var _0x4e3670=_0xfdbd[_0x57add2];return _0x4e3670;};'use strict';var _=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var logger=require(_0xdfdb('0x2'))(_0xdfdb('0x3'));var moment=require(_0xdfdb('0x4'));var BPromise=require(_0xdfdb('0x5'));var rp=require(_0xdfdb('0x6'));var fs=require('fs');var path=require(_0xdfdb('0x7'));var rimraf=require(_0xdfdb('0x8'));var config=require('../../config/environment');var attributes=require(_0xdfdb('0x9'));module['exports']=function(_0x453ef6,_0x41bd5e){return _0x453ef6['define']('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 5ee163d..4638846 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 _0x88aa=['AnalyticMetric,\x20%s,\x20%s','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x4448f4,_0x52347e){var _0x142d7d=function(_0x53bf3c){while(--_0x53bf3c){_0x4448f4['push'](_0x4448f4['shift']());}};_0x142d7d(++_0x52347e);}(_0x88aa,0x1bc));var _0xa88a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x88aa[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xa88a('0x0'));var util=require('util');var moment=require(_0xa88a('0x1'));var BPromise=require('bluebird');var rs=require(_0xa88a('0x2'));var fs=require('fs');var Redis=require(_0xa88a('0x3'));var db=require(_0xa88a('0x4'))['db'];var utils=require(_0xa88a('0x5'));var logger=require(_0xa88a('0x6'))(_0xa88a('0x7'));var config=require(_0xa88a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa88a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b6741,_0x3488f1,_0xb68a45){return new BPromise(function(_0x7c5c42,_0x4376fa){return client[_0xa88a('0xa')](_0x5b6741,_0xb68a45)[_0xa88a('0xb')](function(_0x24af37){logger[_0xa88a('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x3488f1,_0xa88a('0xd'));logger[_0xa88a('0xe')](_0xa88a('0xf'),_0x3488f1,_0xa88a('0xd'),JSON['stringify'](_0x24af37));if(_0x24af37[_0xa88a('0x10')]){if(_0x24af37['error'][_0xa88a('0x11')]===0x1f4){logger['error'](_0xa88a('0x12'),_0x3488f1,_0x24af37[_0xa88a('0x10')][_0xa88a('0x13')]);return _0x4376fa(_0x24af37['error']['message']);}logger[_0xa88a('0x10')](_0xa88a('0x12'),_0x3488f1,_0x24af37['error'][_0xa88a('0x13')]);return _0x7c5c42(_0x24af37['error']['message']);}else{logger[_0xa88a('0xc')](_0xa88a('0x12'),_0x3488f1,'request\x20sent');_0x7c5c42(_0x24af37[_0xa88a('0x14')]['message']);}})['catch'](function(_0x339f3b){logger[_0xa88a('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x3488f1,_0x339f3b);_0x4376fa(_0x339f3b);});});}
\ No newline at end of file
+var _0x8de5=['error','AnalyticMetric,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','http','request','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x48bdfa,_0x479bd5){var _0x1dc402=function(_0x123fc8){while(--_0x123fc8){_0x48bdfa['push'](_0x48bdfa['shift']());}};_0x1dc402(++_0x479bd5);}(_0x8de5,0x97));var _0x58de=function(_0xdc5cfe,_0x3ebe62){_0xdc5cfe=_0xdc5cfe-0x0;var _0x50369d=_0x8de5[_0xdc5cfe];return _0x50369d;};'use strict';var _=require(_0x58de('0x0'));var util=require(_0x58de('0x1'));var moment=require(_0x58de('0x2'));var BPromise=require('bluebird');var rs=require(_0x58de('0x3'));var fs=require('fs');var Redis=require(_0x58de('0x4'));var db=require(_0x58de('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x58de('0x6'))(_0x58de('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x58de('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x303f46,_0x58389b,_0x3a3d52){return new BPromise(function(_0x1302ab,_0x5163df){return client[_0x58de('0x9')](_0x303f46,_0x3a3d52)[_0x58de('0xa')](function(_0x2d77d0){logger[_0x58de('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x58389b,_0x58de('0xc'));logger[_0x58de('0xd')](_0x58de('0xe'),_0x58389b,_0x58de('0xc'),JSON[_0x58de('0xf')](_0x2d77d0));if(_0x2d77d0['error']){if(_0x2d77d0['error'][_0x58de('0x10')]===0x1f4){logger[_0x58de('0x11')](_0x58de('0x12'),_0x58389b,_0x2d77d0[_0x58de('0x11')][_0x58de('0x13')]);return _0x5163df(_0x2d77d0[_0x58de('0x11')]['message']);}logger[_0x58de('0x11')](_0x58de('0x12'),_0x58389b,_0x2d77d0['error'][_0x58de('0x13')]);return _0x1302ab(_0x2d77d0[_0x58de('0x11')]['message']);}else{logger[_0x58de('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x58389b,'request\x20sent');_0x1302ab(_0x2d77d0['result'][_0x58de('0x13')]);}})[_0x58de('0x14')](function(_0x20ffc3){logger[_0x58de('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x58389b,_0x20ffc3);_0x5163df(_0x20ffc3);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 19e4ead..df389ff 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 _0xcf12=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy','exports','util','connect-timeout','express','Router'];(function(_0x29db36,_0x410ae9){var _0x234e87=function(_0x48697b){while(--_0x48697b){_0x29db36['push'](_0x29db36['shift']());}};_0x234e87(++_0x410ae9);}(_0xcf12,0x140));var _0x2cf1=function(_0x42c97b,_0x3e401a){_0x42c97b=_0x42c97b-0x0;var _0x5ee945=_0xcf12[_0x42c97b];return _0x5ee945;};'use strict';var multer=require('multer');var util=require(_0x2cf1('0x0'));var path=require('path');var timeout=require(_0x2cf1('0x1'));var express=require(_0x2cf1('0x2'));var router=express[_0x2cf1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2cf1('0x4'));var interaction=require(_0x2cf1('0x5'));var config=require(_0x2cf1('0x6'));var controller=require(_0x2cf1('0x7'));router[_0x2cf1('0x8')]('/',auth[_0x2cf1('0x9')](),controller[_0x2cf1('0xa')]);router[_0x2cf1('0x8')](_0x2cf1('0xb'),auth['isAuthenticated'](),controller[_0x2cf1('0xc')]);router[_0x2cf1('0xd')]('/',auth[_0x2cf1('0x9')](),controller[_0x2cf1('0xe')]);router[_0x2cf1('0xf')](_0x2cf1('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x2cf1('0xb'),auth['isAuthenticated'](),controller[_0x2cf1('0x10')]);module[_0x2cf1('0x11')]=router;
\ No newline at end of file
+var _0x37c5=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','isAuthenticated','index','get','show','post','put','/:id','delete','destroy','util','path','connect-timeout','express'];(function(_0x37620e,_0x4d8848){var _0x5a55af=function(_0x235cee){while(--_0x235cee){_0x37620e['push'](_0x37620e['shift']());}};_0x5a55af(++_0x4d8848);}(_0x37c5,0xa7));var _0x537c=function(_0x39b6f9,_0x1a60e1){_0x39b6f9=_0x39b6f9-0x0;var _0x309f1e=_0x37c5[_0x39b6f9];return _0x309f1e;};'use strict';var multer=require('multer');var util=require(_0x537c('0x0'));var path=require(_0x537c('0x1'));var timeout=require(_0x537c('0x2'));var express=require(_0x537c('0x3'));var router=express[_0x537c('0x4')]();var fs_extra=require(_0x537c('0x5'));var auth=require(_0x537c('0x6'));var interaction=require(_0x537c('0x7'));var config=require(_0x537c('0x8'));var controller=require(_0x537c('0x9'));router['get']('/',auth[_0x537c('0xa')](),controller[_0x537c('0xb')]);router[_0x537c('0xc')]('/:id',auth[_0x537c('0xa')](),controller[_0x537c('0xd')]);router[_0x537c('0xe')]('/',auth[_0x537c('0xa')](),controller['create']);router[_0x537c('0xf')](_0x537c('0x10'),auth[_0x537c('0xa')](),controller['update']);router[_0x537c('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x537c('0x12')]);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 4782450..cdf1636 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 _0xac25=['exports','TEXT','sequelize'];(function(_0xd4636c,_0x34dbf6){var _0x5ee17d=function(_0x223c38){while(--_0x223c38){_0xd4636c['push'](_0xd4636c['shift']());}};_0x5ee17d(++_0x34dbf6);}(_0xac25,0x1e5));var _0x5ac2=function(_0x10df18,_0x13338c){_0x10df18=_0x10df18-0x0;var _0x1f9a1d=_0xac25[_0x10df18];return _0x1f9a1d;};'use strict';var Sequelize=require(_0x5ac2('0x0'));module[_0x5ac2('0x1')]={'tree':{'type':Sequelize[_0x5ac2('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x124f=['sequelize','exports','TEXT'];(function(_0x55e06c,_0x360cf9){var _0x203720=function(_0x3888ab){while(--_0x3888ab){_0x55e06c['push'](_0x55e06c['shift']());}};_0x203720(++_0x360cf9);}(_0x124f,0x1b0));var _0xf124=function(_0x36e139,_0x4ad031){_0x36e139=_0x36e139-0x0;var _0x97cc40=_0x124f[_0x36e139];return _0x97cc40;};'use strict';var Sequelize=require(_0xf124('0x0'));module[_0xf124('0x1')]={'tree':{'type':Sequelize[_0xf124('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 5d6f70c..85c637a 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 _0x1dfe=['../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','apply','reject','save','update','then','destroy','error','stack','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','include','findAll','rows','catch','show','params','keys','includeAll','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x1dfe,0x7b));var _0xe1df=function(_0x3af903,_0x5ec680){_0x3af903=_0x3af903-0x0;var _0x162851=_0x1dfe[_0x3af903];return _0x162851;};'use strict';var emlformat=require(_0xe1df('0x0'));var rimraf=require(_0xe1df('0x1'));var zipdir=require(_0xe1df('0x2'));var jsonpatch=require(_0xe1df('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe1df('0x4'));var Mustache=require(_0xe1df('0x5'));var util=require(_0xe1df('0x6'));var path=require(_0xe1df('0x7'));var sox=require(_0xe1df('0x8'));var csv=require('to-csv');var ejs=require(_0xe1df('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe1df('0xa'));var squel=require(_0xe1df('0xb'));var crypto=require('crypto');var jsforce=require(_0xe1df('0xc'));var deskjs=require(_0xe1df('0xd'));var toCsv=require(_0xe1df('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe1df('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe1df('0x10'));var as=require(_0xe1df('0x11'));var hardwareService=require(_0xe1df('0x12'));var logger=require(_0xe1df('0x13'))(_0xe1df('0x14'));var utils=require(_0xe1df('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe1df('0x16'));var db=require(_0xe1df('0x17'))['db'];function respondWithStatusCode(_0x132043,_0x1fc443){_0x1fc443=_0x1fc443||0xcc;return function(_0x4e9b24){if(_0x4e9b24){return _0x132043['sendStatus'](_0x1fc443);}return _0x132043[_0xe1df('0x18')](_0x1fc443)[_0xe1df('0x19')]();};}function respondWithResult(_0x2f3f19,_0x324235){_0x324235=_0x324235||0xc8;return function(_0x2f0e27){if(_0x2f0e27){return _0x2f3f19[_0xe1df('0x18')](_0x324235)[_0xe1df('0x1a')](_0x2f0e27);}};}function respondWithFilteredResult(_0x3b4bb7,_0x4fcf8e){return function(_0x3e4ae8){if(_0x3e4ae8){var _0x166f91=typeof _0x4fcf8e[_0xe1df('0x1b')]==='undefined'&&typeof _0x4fcf8e[_0xe1df('0x1c')]==='undefined';var _0x285a8f=_0x3e4ae8[_0xe1df('0x1d')];var _0x420675=_0x166f91?0x0:_0x4fcf8e[_0xe1df('0x1b')];var _0xede302=_0x166f91?_0x3e4ae8[_0xe1df('0x1d')]:_0x4fcf8e['offset']+_0x4fcf8e[_0xe1df('0x1c')];var _0x1fba1d;if(_0xede302>=_0x285a8f){_0xede302=_0x285a8f;_0x1fba1d=0xc8;}else{_0x1fba1d=0xce;}_0x3b4bb7[_0xe1df('0x18')](_0x1fba1d);return _0x3b4bb7[_0xe1df('0x1e')]('Content-Range',_0x420675+'-'+_0xede302+'/'+_0x285a8f)[_0xe1df('0x1a')](_0x3e4ae8);}return null;};}function patchUpdates(_0x16a277){return function(_0x51013b){try{jsonpatch[_0xe1df('0x1f')](_0x51013b,_0x16a277,!![]);}catch(_0x20d300){return BPromise[_0xe1df('0x20')](_0x20d300);}return _0x51013b[_0xe1df('0x21')]();};}function saveUpdates(_0x36d8fd,_0x4fcabb){return function(_0x41c793){if(_0x41c793){return _0x41c793[_0xe1df('0x22')](_0x36d8fd)[_0xe1df('0x23')](function(_0x204e9d){return _0x204e9d;});}return null;};}function removeEntity(_0x580cc8,_0x32e4ed){return function(_0x49aea8){if(_0x49aea8){return _0x49aea8[_0xe1df('0x24')]()[_0xe1df('0x23')](function(){_0x580cc8[_0xe1df('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46e80c,_0x24c409){return function(_0x12050c){if(!_0x12050c){_0x46e80c['sendStatus'](0x194);}return _0x12050c;};}function handleError(_0x2f8382,_0x10319d){_0x10319d=_0x10319d||0x1f4;return function(_0x10013d){logger[_0xe1df('0x25')](_0x10013d[_0xe1df('0x26')]);if(_0x10013d['name']){delete _0x10013d['name'];}_0x2f8382[_0xe1df('0x18')](_0x10319d)['send'](_0x10013d);};}exports[_0xe1df('0x27')]=function(_0x368d38,_0x18bd9b){var _0x314310={},_0x5ca2eb={},_0x299ac3={'count':0x0,'rows':[]};var _0x14e501=_[_0xe1df('0x28')](db[_0xe1df('0x29')][_0xe1df('0x2a')],function(_0xb4d5b1){return{'name':_0xb4d5b1[_0xe1df('0x2b')],'type':_0xb4d5b1[_0xe1df('0x2c')][_0xe1df('0x2d')]};});_0x5ca2eb[_0xe1df('0x2e')]=_[_0xe1df('0x28')](_0x14e501,_0xe1df('0x2f'));_0x5ca2eb['query']=_['keys'](_0x368d38[_0xe1df('0x30')]);_0x5ca2eb[_0xe1df('0x31')]=_[_0xe1df('0x32')](_0x5ca2eb[_0xe1df('0x2e')],_0x5ca2eb[_0xe1df('0x30')]);_0x314310[_0xe1df('0x33')]=_[_0xe1df('0x32')](_0x5ca2eb[_0xe1df('0x2e')],qs[_0xe1df('0x34')](_0x368d38[_0xe1df('0x30')][_0xe1df('0x34')]));_0x314310[_0xe1df('0x33')]=_0x314310[_0xe1df('0x33')][_0xe1df('0x35')]?_0x314310[_0xe1df('0x33')]:_0x5ca2eb[_0xe1df('0x2e')];if(!_0x368d38[_0xe1df('0x30')][_0xe1df('0x36')](_0xe1df('0x37'))){_0x314310[_0xe1df('0x1c')]=qs['limit'](_0x368d38[_0xe1df('0x30')][_0xe1df('0x1c')]);_0x314310[_0xe1df('0x1b')]=qs[_0xe1df('0x1b')](_0x368d38[_0xe1df('0x30')][_0xe1df('0x1b')]);}_0x314310['order']=qs[_0xe1df('0x38')](_0x368d38[_0xe1df('0x30')]['sort']);_0x314310[_0xe1df('0x39')]=qs['filters'](_['pick'](_0x368d38[_0xe1df('0x30')],_0x5ca2eb[_0xe1df('0x31')]),_0x14e501);if(_0x368d38['query'][_0xe1df('0x3a')]){_0x314310['where']=_[_0xe1df('0x3b')](_0x314310[_0xe1df('0x39')],{'$or':_[_0xe1df('0x28')](_0x14e501,function(_0x2372aa){if(_0x2372aa['type']!=='VIRTUAL'){var _0x5c16d3={};_0x5c16d3[_0x2372aa[_0xe1df('0x2f')]]={'$like':'%'+_0x368d38[_0xe1df('0x30')][_0xe1df('0x3a')]+'%'};return _0x5c16d3;}})});}_0x314310=_[_0xe1df('0x3b')]({},_0x314310,_0x368d38[_0xe1df('0x3c')]);var _0x71e562={'where':_0x314310[_0xe1df('0x39')]};return db[_0xe1df('0x29')]['count'](_0x71e562)[_0xe1df('0x23')](function(_0x5cec85){_0x299ac3['count']=_0x5cec85;if(_0x368d38[_0xe1df('0x30')]['includeAll']){_0x314310[_0xe1df('0x3d')]=[{'all':!![]}];}return db[_0xe1df('0x29')][_0xe1df('0x3e')](_0x314310);})[_0xe1df('0x23')](function(_0xe0b9d3){_0x299ac3[_0xe1df('0x3f')]=_0xe0b9d3;return _0x299ac3;})['then'](respondWithFilteredResult(_0x18bd9b,_0x314310))[_0xe1df('0x40')](handleError(_0x18bd9b,null));};exports[_0xe1df('0x41')]=function(_0x3b5d69,_0x4311de){var _0x7400e9={'raw':!![],'where':{'id':_0x3b5d69[_0xe1df('0x42')]['id']}},_0x196dac={};_0x196dac[_0xe1df('0x2e')]=_[_0xe1df('0x43')](db['AnalyticTreeReport'][_0xe1df('0x2a')]);_0x196dac['query']=_[_0xe1df('0x43')](_0x3b5d69[_0xe1df('0x30')]);_0x196dac[_0xe1df('0x31')]=_[_0xe1df('0x32')](_0x196dac[_0xe1df('0x2e')],_0x196dac['query']);_0x7400e9[_0xe1df('0x33')]=_[_0xe1df('0x32')](_0x196dac[_0xe1df('0x2e')],qs['fields'](_0x3b5d69[_0xe1df('0x30')][_0xe1df('0x34')]));_0x7400e9[_0xe1df('0x33')]=_0x7400e9['attributes'][_0xe1df('0x35')]?_0x7400e9[_0xe1df('0x33')]:_0x196dac[_0xe1df('0x2e')];if(_0x3b5d69['query'][_0xe1df('0x44')]){_0x7400e9['include']=[{'all':!![]}];}_0x7400e9=_[_0xe1df('0x3b')]({},_0x7400e9,_0x3b5d69[_0xe1df('0x3c')]);return db[_0xe1df('0x29')]['find'](_0x7400e9)[_0xe1df('0x23')](handleEntityNotFound(_0x4311de,null))[_0xe1df('0x23')](respondWithResult(_0x4311de,null))[_0xe1df('0x40')](handleError(_0x4311de,null));};exports[_0xe1df('0x45')]=function(_0x12bfb8,_0x17c915){return db['AnalyticTreeReport'][_0xe1df('0x45')](_0x12bfb8['body'],{})[_0xe1df('0x23')](respondWithResult(_0x17c915,0xc9))['catch'](handleError(_0x17c915,null));};exports[_0xe1df('0x22')]=function(_0x3e4a3a,_0x4023f5){if(_0x3e4a3a[_0xe1df('0x46')]['id']){delete _0x3e4a3a[_0xe1df('0x46')]['id'];}return db[_0xe1df('0x29')]['find']({'where':{'id':_0x3e4a3a[_0xe1df('0x42')]['id']}})[_0xe1df('0x23')](handleEntityNotFound(_0x4023f5,null))[_0xe1df('0x23')](saveUpdates(_0x3e4a3a[_0xe1df('0x46')],null))['then'](respondWithResult(_0x4023f5,null))[_0xe1df('0x40')](handleError(_0x4023f5,null));};exports['destroy']=function(_0x42f684,_0x518246){return db[_0xe1df('0x29')][_0xe1df('0x47')]({'where':{'id':_0x42f684['params']['id']}})[_0xe1df('0x23')](handleEntityNotFound(_0x518246,null))['then'](removeEntity(_0x518246,null))[_0xe1df('0x40')](handleError(_0x518246,null));};
\ No newline at end of file
+var _0x37aa=['end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','AnalyticTreeReport','includeAll','include','rows','catch','keys','find','create','body','params','eml-format','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','sendStatus'];(function(_0x5b4dbc,_0x314783){var _0x4c8fe5=function(_0x1f5b83){while(--_0x1f5b83){_0x5b4dbc['push'](_0x5b4dbc['shift']());}};_0x4c8fe5(++_0x314783);}(_0x37aa,0x13f));var _0xa37a=function(_0x403cff,_0x1cf463){_0x403cff=_0x403cff-0x0;var _0x5a7c56=_0x37aa[_0x403cff];return _0x5a7c56;};'use strict';var emlformat=require(_0xa37a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa37a('0x1'));var rp=require('request-promise');var moment=require(_0xa37a('0x2'));var BPromise=require(_0xa37a('0x3'));var Mustache=require(_0xa37a('0x4'));var util=require('util');var path=require(_0xa37a('0x5'));var sox=require(_0xa37a('0x6'));var csv=require(_0xa37a('0x7'));var ejs=require(_0xa37a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa37a('0x9'));var crypto=require(_0xa37a('0xa'));var jsforce=require(_0xa37a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa37a('0x7'));var querystring=require(_0xa37a('0xc'));var Papa=require(_0xa37a('0xd'));var Redis=require('ioredis');var authService=require(_0xa37a('0xe'));var qs=require(_0xa37a('0xf'));var as=require(_0xa37a('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa37a('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xa37a('0x12'));var licenseUtil=require(_0xa37a('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48e9c7,_0x1a38c6){_0x1a38c6=_0x1a38c6||0xcc;return function(_0x57b312){if(_0x57b312){return _0x48e9c7[_0xa37a('0x14')](_0x1a38c6);}return _0x48e9c7['status'](_0x1a38c6)[_0xa37a('0x15')]();};}function respondWithResult(_0x2db765,_0x2af7c9){_0x2af7c9=_0x2af7c9||0xc8;return function(_0x3c5904){if(_0x3c5904){return _0x2db765[_0xa37a('0x16')](_0x2af7c9)[_0xa37a('0x17')](_0x3c5904);}};}function respondWithFilteredResult(_0x5b8a7d,_0x2b9819){return function(_0x2c4970){if(_0x2c4970){var _0x10aa0d=typeof _0x2b9819[_0xa37a('0x18')]===_0xa37a('0x19')&&typeof _0x2b9819[_0xa37a('0x1a')]===_0xa37a('0x19');var _0x50be6b=_0x2c4970[_0xa37a('0x1b')];var _0x57d282=_0x10aa0d?0x0:_0x2b9819[_0xa37a('0x18')];var _0x7e9b84=_0x10aa0d?_0x2c4970[_0xa37a('0x1b')]:_0x2b9819[_0xa37a('0x18')]+_0x2b9819['limit'];var _0x47d5a5;if(_0x7e9b84>=_0x50be6b){_0x7e9b84=_0x50be6b;_0x47d5a5=0xc8;}else{_0x47d5a5=0xce;}_0x5b8a7d['status'](_0x47d5a5);return _0x5b8a7d[_0xa37a('0x1c')](_0xa37a('0x1d'),_0x57d282+'-'+_0x7e9b84+'/'+_0x50be6b)[_0xa37a('0x17')](_0x2c4970);}return null;};}function patchUpdates(_0x89bbfe){return function(_0x4a11da){try{jsonpatch[_0xa37a('0x1e')](_0x4a11da,_0x89bbfe,!![]);}catch(_0x9a303d){return BPromise[_0xa37a('0x1f')](_0x9a303d);}return _0x4a11da['save']();};}function saveUpdates(_0x4f3d0f,_0x70df0c){return function(_0x555c21){if(_0x555c21){return _0x555c21[_0xa37a('0x20')](_0x4f3d0f)[_0xa37a('0x21')](function(_0x416be9){return _0x416be9;});}return null;};}function removeEntity(_0x7f3082,_0x4f6a89){return function(_0x190847){if(_0x190847){return _0x190847[_0xa37a('0x22')]()[_0xa37a('0x21')](function(){_0x7f3082[_0xa37a('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19ba68,_0x3ce60e){return function(_0x54cf5d){if(!_0x54cf5d){_0x19ba68[_0xa37a('0x14')](0x194);}return _0x54cf5d;};}function handleError(_0x24d661,_0x2468dc){_0x2468dc=_0x2468dc||0x1f4;return function(_0x1324f3){logger[_0xa37a('0x23')](_0x1324f3['stack']);if(_0x1324f3[_0xa37a('0x24')]){delete _0x1324f3[_0xa37a('0x24')];}_0x24d661[_0xa37a('0x16')](_0x2468dc)[_0xa37a('0x25')](_0x1324f3);};}exports[_0xa37a('0x26')]=function(_0x970c4f,_0x2385bd){var _0x42c55e={},_0x29710a={},_0x15003a={'count':0x0,'rows':[]};var _0x26c742=_[_0xa37a('0x27')](db['AnalyticTreeReport'][_0xa37a('0x28')],function(_0x36b1ec){return{'name':_0x36b1ec['fieldName'],'type':_0x36b1ec[_0xa37a('0x29')][_0xa37a('0x2a')]};});_0x29710a[_0xa37a('0x2b')]=_[_0xa37a('0x27')](_0x26c742,_0xa37a('0x24'));_0x29710a['query']=_['keys'](_0x970c4f[_0xa37a('0x2c')]);_0x29710a[_0xa37a('0x2d')]=_[_0xa37a('0x2e')](_0x29710a['model'],_0x29710a[_0xa37a('0x2c')]);_0x42c55e[_0xa37a('0x2f')]=_[_0xa37a('0x2e')](_0x29710a['model'],qs[_0xa37a('0x30')](_0x970c4f[_0xa37a('0x2c')]['fields']));_0x42c55e[_0xa37a('0x2f')]=_0x42c55e['attributes']['length']?_0x42c55e[_0xa37a('0x2f')]:_0x29710a[_0xa37a('0x2b')];if(!_0x970c4f['query'][_0xa37a('0x31')]('nolimit')){_0x42c55e[_0xa37a('0x1a')]=qs[_0xa37a('0x1a')](_0x970c4f['query'][_0xa37a('0x1a')]);_0x42c55e['offset']=qs[_0xa37a('0x18')](_0x970c4f[_0xa37a('0x2c')]['offset']);}_0x42c55e[_0xa37a('0x32')]=qs[_0xa37a('0x33')](_0x970c4f[_0xa37a('0x2c')][_0xa37a('0x33')]);_0x42c55e['where']=qs[_0xa37a('0x2d')](_[_0xa37a('0x34')](_0x970c4f['query'],_0x29710a['filters']),_0x26c742);if(_0x970c4f[_0xa37a('0x2c')][_0xa37a('0x35')]){_0x42c55e['where']=_[_0xa37a('0x36')](_0x42c55e[_0xa37a('0x37')],{'$or':_[_0xa37a('0x27')](_0x26c742,function(_0x5b5da3){if(_0x5b5da3['type']!==_0xa37a('0x38')){var _0x5d6e4d={};_0x5d6e4d[_0x5b5da3[_0xa37a('0x24')]]={'$like':'%'+_0x970c4f[_0xa37a('0x2c')]['filter']+'%'};return _0x5d6e4d;}})});}_0x42c55e=_[_0xa37a('0x36')]({},_0x42c55e,_0x970c4f[_0xa37a('0x39')]);var _0xf65581={'where':_0x42c55e[_0xa37a('0x37')]};return db[_0xa37a('0x3a')][_0xa37a('0x1b')](_0xf65581)['then'](function(_0x24fa9d){_0x15003a[_0xa37a('0x1b')]=_0x24fa9d;if(_0x970c4f[_0xa37a('0x2c')][_0xa37a('0x3b')]){_0x42c55e[_0xa37a('0x3c')]=[{'all':!![]}];}return db[_0xa37a('0x3a')]['findAll'](_0x42c55e);})[_0xa37a('0x21')](function(_0xabde74){_0x15003a[_0xa37a('0x3d')]=_0xabde74;return _0x15003a;})[_0xa37a('0x21')](respondWithFilteredResult(_0x2385bd,_0x42c55e))[_0xa37a('0x3e')](handleError(_0x2385bd,null));};exports['show']=function(_0x435f95,_0x3e9d68){var _0x1970c7={'raw':!![],'where':{'id':_0x435f95['params']['id']}},_0x394f6b={};_0x394f6b['model']=_[_0xa37a('0x3f')](db[_0xa37a('0x3a')][_0xa37a('0x28')]);_0x394f6b[_0xa37a('0x2c')]=_['keys'](_0x435f95[_0xa37a('0x2c')]);_0x394f6b[_0xa37a('0x2d')]=_[_0xa37a('0x2e')](_0x394f6b[_0xa37a('0x2b')],_0x394f6b[_0xa37a('0x2c')]);_0x1970c7[_0xa37a('0x2f')]=_[_0xa37a('0x2e')](_0x394f6b[_0xa37a('0x2b')],qs[_0xa37a('0x30')](_0x435f95[_0xa37a('0x2c')]['fields']));_0x1970c7[_0xa37a('0x2f')]=_0x1970c7[_0xa37a('0x2f')]['length']?_0x1970c7['attributes']:_0x394f6b[_0xa37a('0x2b')];if(_0x435f95['query'][_0xa37a('0x3b')]){_0x1970c7[_0xa37a('0x3c')]=[{'all':!![]}];}_0x1970c7=_[_0xa37a('0x36')]({},_0x1970c7,_0x435f95[_0xa37a('0x39')]);return db[_0xa37a('0x3a')][_0xa37a('0x40')](_0x1970c7)[_0xa37a('0x21')](handleEntityNotFound(_0x3e9d68,null))[_0xa37a('0x21')](respondWithResult(_0x3e9d68,null))[_0xa37a('0x3e')](handleError(_0x3e9d68,null));};exports['create']=function(_0x26cfc9,_0x3a3e98){return db['AnalyticTreeReport'][_0xa37a('0x41')](_0x26cfc9['body'],{})[_0xa37a('0x21')](respondWithResult(_0x3a3e98,0xc9))['catch'](handleError(_0x3a3e98,null));};exports['update']=function(_0x402d6d,_0x4b5338){if(_0x402d6d[_0xa37a('0x42')]['id']){delete _0x402d6d['body']['id'];}return db[_0xa37a('0x3a')][_0xa37a('0x40')]({'where':{'id':_0x402d6d[_0xa37a('0x43')]['id']}})[_0xa37a('0x21')](handleEntityNotFound(_0x4b5338,null))[_0xa37a('0x21')](saveUpdates(_0x402d6d[_0xa37a('0x42')],null))[_0xa37a('0x21')](respondWithResult(_0x4b5338,null))['catch'](handleError(_0x4b5338,null));};exports[_0xa37a('0x22')]=function(_0x4ae1c2,_0x4213e5){return db[_0xa37a('0x3a')]['find']({'where':{'id':_0x4ae1c2['params']['id']}})[_0xa37a('0x21')](handleEntityNotFound(_0x4213e5,null))[_0xa37a('0x21')](removeEntity(_0x4213e5,null))[_0xa37a('0x3e')](handleError(_0x4213e5,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index d7e25d9..28b6e67 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 _0xc43d=['../../config/environment','./analyticTreeReport.attributes','exports','AnalyticTreeReport','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc43d,0x19b));var _0xdc43=function(_0x4b1032,_0x36952e){_0x4b1032=_0x4b1032-0x0;var _0x5a1d55=_0xc43d[_0x4b1032];return _0x5a1d55;};'use strict';var _=require(_0xdc43('0x0'));var util=require(_0xdc43('0x1'));var logger=require(_0xdc43('0x2'))(_0xdc43('0x3'));var moment=require('moment');var BPromise=require(_0xdc43('0x4'));var rp=require(_0xdc43('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdc43('0x6'));var config=require(_0xdc43('0x7'));var attributes=require(_0xdc43('0x8'));module[_0xdc43('0x9')]=function(_0x2bc889,_0x1bdd5b){return _0x2bc889['define'](_0xdc43('0xa'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x30f3=['rimraf','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','lodash','util','../../config/logger','bluebird'];(function(_0x4dcce5,_0x958f58){var _0x3518c1=function(_0x22ec20){while(--_0x22ec20){_0x4dcce5['push'](_0x4dcce5['shift']());}};_0x3518c1(++_0x958f58);}(_0x30f3,0x1e2));var _0x330f=function(_0xd9caad,_0x5856b7){_0xd9caad=_0xd9caad-0x0;var _0x3127e6=_0x30f3[_0xd9caad];return _0x3127e6;};'use strict';var _=require(_0x330f('0x0'));var util=require(_0x330f('0x1'));var logger=require(_0x330f('0x2'))('api');var moment=require('moment');var BPromise=require(_0x330f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x330f('0x4'));var config=require('../../config/environment');var attributes=require(_0x330f('0x5'));module[_0x330f('0x6')]=function(_0xd9597c,_0xf88e92){return _0xd9597c[_0x330f('0x7')](_0x330f('0x8'),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 5c9c658..e43caa0 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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x2e2374,_0xc82fcf){var _0x190252=function(_0x27a98e){while(--_0x27a98e){_0x2e2374['push'](_0x2e2374['shift']());}};_0x190252(++_0xc82fcf);}(_0x5f2f,0x73));var _0xf5f2=function(_0x332195,_0x55907d){_0x332195=_0x332195-0x0;var _0x19996d=_0x5f2f[_0x332195];return _0x19996d;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
+var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x1db481,_0x1627b2){var _0x3db95b=function(_0x2d54e4){while(--_0x2d54e4){_0x1db481['push'](_0x1db481['shift']());}};_0x3db95b(++_0x1627b2);}(_0x2ef3,0xba));var _0x32ef=function(_0x5ddd84,_0x3076c3){_0x5ddd84=_0x5ddd84-0x0;var _0xe5d227=_0x2ef3[_0x5ddd84];return _0xe5d227;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index c87c9a1..8564385 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 _0x1495=['isAuthenticated','index','/:id','show','post','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get'];(function(_0x408d22,_0x53eef9){var _0x58effd=function(_0x4ab8ee){while(--_0x4ab8ee){_0x408d22['push'](_0x408d22['shift']());}};_0x58effd(++_0x53eef9);}(_0x1495,0x14b));var _0x5149=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1495[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x5149('0x0'));var util=require(_0x5149('0x1'));var path=require('path');var timeout=require(_0x5149('0x2'));var express=require(_0x5149('0x3'));var router=express[_0x5149('0x4')]();var fs_extra=require(_0x5149('0x5'));var auth=require(_0x5149('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5149('0x7'));var controller=require('./analyticTreeReport.controller');router[_0x5149('0x8')]('/',auth[_0x5149('0x9')](),controller[_0x5149('0xa')]);router[_0x5149('0x8')](_0x5149('0xb'),auth[_0x5149('0x9')](),controller[_0x5149('0xc')]);router[_0x5149('0xd')]('/',auth[_0x5149('0x9')](),controller['create']);router['put'](_0x5149('0xb'),auth[_0x5149('0x9')](),controller[_0x5149('0xe')]);router['delete']('/:id',auth[_0x5149('0x9')](),controller[_0x5149('0xf')]);module[_0x5149('0x10')]=router;
\ No newline at end of file
+var _0x8492=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','index','show','post','create','/:id','update','delete','destroy','exports','util','path'];(function(_0x126974,_0x4fd4fd){var _0x41f2ec=function(_0x327890){while(--_0x327890){_0x126974['push'](_0x126974['shift']());}};_0x41f2ec(++_0x4fd4fd);}(_0x8492,0x1b3));var _0x2849=function(_0x48e623,_0x5206a0){_0x48e623=_0x48e623-0x0;var _0x37aa94=_0x8492[_0x48e623];return _0x37aa94;};'use strict';var multer=require('multer');var util=require(_0x2849('0x0'));var path=require(_0x2849('0x1'));var timeout=require(_0x2849('0x2'));var express=require(_0x2849('0x3'));var router=express[_0x2849('0x4')]();var fs_extra=require(_0x2849('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2849('0x6'));var config=require('../../config/environment');var controller=require(_0x2849('0x7'));router[_0x2849('0x8')]('/',auth[_0x2849('0x9')](),controller[_0x2849('0xa')]);router['get']('/:id',auth[_0x2849('0x9')](),controller[_0x2849('0xb')]);router[_0x2849('0xc')]('/',auth['isAuthenticated'](),controller[_0x2849('0xd')]);router['put'](_0x2849('0xe'),auth[_0x2849('0x9')](),controller[_0x2849('0xf')]);router[_0x2849('0x10')](_0x2849('0xe'),auth['isAuthenticated'](),controller[_0x2849('0x11')]);module[_0x2849('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 44c524e..97c310b 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 _0xa276=['exports','STRING'];(function(_0x565237,_0x589530){var _0x2ababf=function(_0x54d56c){while(--_0x54d56c){_0x565237['push'](_0x565237['shift']());}};_0x2ababf(++_0x589530);}(_0xa276,0x9a));var _0x6a27=function(_0x925a95,_0x422b1c){_0x925a95=_0x925a95-0x0;var _0x251765=_0xa276[_0x925a95];return _0x251765;};'use strict';var Sequelize=require('sequelize');module[_0x6a27('0x0')]={'name':{'type':Sequelize[_0x6a27('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x6a27('0x1')]}};
\ No newline at end of file
+var _0x21d1=['STRING','sequelize','exports'];(function(_0x5c7883,_0x2d0e2e){var _0x2e4777=function(_0x86e0cc){while(--_0x86e0cc){_0x5c7883['push'](_0x5c7883['shift']());}};_0x2e4777(++_0x2d0e2e);}(_0x21d1,0x1c9));var _0x121d=function(_0x3c4d80,_0x27db31){_0x3c4d80=_0x3c4d80-0x0;var _0x2f8800=_0x21d1[_0x3c4d80];return _0x2f8800;};'use strict';var Sequelize=require(_0x121d('0x0'));module[_0x121d('0x1')]={'name':{'type':Sequelize[_0x121d('0x2')]},'basename':{'type':Sequelize[_0x121d('0x2')]},'type':{'type':Sequelize[_0x121d('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 09c810a..21bc576 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 _0xac7a=['VIRTUAL','options','includeAll','findAll','then','catch','show','params','keys','include','find','clone','rawAttributes','get','omit','createdAt','body','updatedAt','create','update','file','originalname','basename','root','server/files/attachments/','join','offline-chat/','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','destroy','error','stack','name','index','map','Attachment','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0xac7a,0x6e));var _0xaac7=function(_0x4e136c,_0x1572c2){_0x4e136c=_0x4e136c-0x0;var _0x472f43=_0xac7a[_0x4e136c];return _0x472f43;};'use strict';var emlformat=require(_0xaac7('0x0'));var rimraf=require(_0xaac7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaac7('0x2'));var rp=require('request-promise');var moment=require(_0xaac7('0x3'));var BPromise=require(_0xaac7('0x4'));var Mustache=require(_0xaac7('0x5'));var util=require(_0xaac7('0x6'));var path=require(_0xaac7('0x7'));var sox=require(_0xaac7('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaac7('0x9'));var _=require('lodash');var squel=require(_0xaac7('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xaac7('0xb'));var querystring=require(_0xaac7('0xc'));var Papa=require(_0xaac7('0xd'));var Redis=require(_0xaac7('0xe'));var authService=require(_0xaac7('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaac7('0x10'));var logger=require(_0xaac7('0x11'))('api');var utils=require(_0xaac7('0x12'));var config=require(_0xaac7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xaac7('0x14'))['db'];function respondWithStatusCode(_0x4945bf,_0x5cf22f){_0x5cf22f=_0x5cf22f||0xcc;return function(_0x25e00e){if(_0x25e00e){return _0x4945bf[_0xaac7('0x15')](_0x5cf22f);}return _0x4945bf[_0xaac7('0x16')](_0x5cf22f)[_0xaac7('0x17')]();};}function respondWithResult(_0x2fd2ab,_0x324d64){_0x324d64=_0x324d64||0xc8;return function(_0x584dcd){if(_0x584dcd){return _0x2fd2ab[_0xaac7('0x16')](_0x324d64)['json'](_0x584dcd);}};}function respondWithFilteredResult(_0x34ad15,_0x527269){return function(_0x84c750){if(_0x84c750){var _0x53fc31=typeof _0x527269[_0xaac7('0x18')]==='undefined'&&typeof _0x527269[_0xaac7('0x19')]===_0xaac7('0x1a');var _0x2a8a13=_0x84c750[_0xaac7('0x1b')];var _0x57f382=_0x53fc31?0x0:_0x527269[_0xaac7('0x18')];var _0x4ed670=_0x53fc31?_0x84c750['count']:_0x527269['offset']+_0x527269[_0xaac7('0x19')];var _0x325a79;if(_0x4ed670>=_0x2a8a13){_0x4ed670=_0x2a8a13;_0x325a79=0xc8;}else{_0x325a79=0xce;}_0x34ad15[_0xaac7('0x16')](_0x325a79);return _0x34ad15[_0xaac7('0x1c')](_0xaac7('0x1d'),_0x57f382+'-'+_0x4ed670+'/'+_0x2a8a13)[_0xaac7('0x1e')](_0x84c750);}return null;};}function patchUpdates(_0x13b0c1){return function(_0x3b03cd){try{jsonpatch[_0xaac7('0x1f')](_0x3b03cd,_0x13b0c1,!![]);}catch(_0x337fc8){return BPromise[_0xaac7('0x20')](_0x337fc8);}return _0x3b03cd[_0xaac7('0x21')]();};}function saveUpdates(_0x328296,_0x216453){return function(_0x1bdb62){if(_0x1bdb62){return _0x1bdb62['update'](_0x328296)['then'](function(_0x1d7f2c){return _0x1d7f2c;});}return null;};}function removeEntity(_0x13b7fb,_0x31d962){return function(_0xe852ca){if(_0xe852ca){return _0xe852ca[_0xaac7('0x22')]()['then'](function(){_0x13b7fb[_0xaac7('0x16')](0xcc)[_0xaac7('0x17')]();});}};}function handleEntityNotFound(_0x472b7c,_0x3ed790){return function(_0x1d8507){if(!_0x1d8507){_0x472b7c[_0xaac7('0x15')](0x194);}return _0x1d8507;};}function handleError(_0x342f84,_0x50d4fd){_0x50d4fd=_0x50d4fd||0x1f4;return function(_0x124a14){logger[_0xaac7('0x23')](_0x124a14[_0xaac7('0x24')]);if(_0x124a14[_0xaac7('0x25')]){delete _0x124a14[_0xaac7('0x25')];}_0x342f84[_0xaac7('0x16')](_0x50d4fd)['send'](_0x124a14);};}exports[_0xaac7('0x26')]=function(_0xf8e27b,_0x2f4c37){var _0x39451e={},_0x24f898={},_0x374244={'count':0x0,'rows':[]};var _0x4e3b88=_[_0xaac7('0x27')](db[_0xaac7('0x28')]['rawAttributes'],function(_0x1cfe11){return{'name':_0x1cfe11['fieldName'],'type':_0x1cfe11[_0xaac7('0x29')]['key']};});_0x24f898[_0xaac7('0x2a')]=_[_0xaac7('0x27')](_0x4e3b88,_0xaac7('0x25'));_0x24f898['query']=_['keys'](_0xf8e27b[_0xaac7('0x2b')]);_0x24f898[_0xaac7('0x2c')]=_[_0xaac7('0x2d')](_0x24f898[_0xaac7('0x2a')],_0x24f898[_0xaac7('0x2b')]);_0x39451e[_0xaac7('0x2e')]=_['intersection'](_0x24f898[_0xaac7('0x2a')],qs[_0xaac7('0x2f')](_0xf8e27b[_0xaac7('0x2b')][_0xaac7('0x2f')]));_0x39451e['attributes']=_0x39451e[_0xaac7('0x2e')][_0xaac7('0x30')]?_0x39451e['attributes']:_0x24f898[_0xaac7('0x2a')];if(!_0xf8e27b[_0xaac7('0x2b')][_0xaac7('0x31')](_0xaac7('0x32'))){_0x39451e[_0xaac7('0x19')]=qs[_0xaac7('0x19')](_0xf8e27b[_0xaac7('0x2b')]['limit']);_0x39451e[_0xaac7('0x18')]=qs[_0xaac7('0x18')](_0xf8e27b[_0xaac7('0x2b')][_0xaac7('0x18')]);}_0x39451e['order']=qs[_0xaac7('0x33')](_0xf8e27b[_0xaac7('0x2b')][_0xaac7('0x33')]);_0x39451e[_0xaac7('0x34')]=qs[_0xaac7('0x2c')](_[_0xaac7('0x35')](_0xf8e27b[_0xaac7('0x2b')],_0x24f898[_0xaac7('0x2c')]),_0x4e3b88);if(_0xf8e27b[_0xaac7('0x2b')][_0xaac7('0x36')]){_0x39451e[_0xaac7('0x34')]=_[_0xaac7('0x37')](_0x39451e[_0xaac7('0x34')],{'$or':_[_0xaac7('0x27')](_0x4e3b88,function(_0x42bf4e){if(_0x42bf4e['type']!==_0xaac7('0x38')){var _0x25872f={};_0x25872f[_0x42bf4e[_0xaac7('0x25')]]={'$like':'%'+_0xf8e27b[_0xaac7('0x2b')][_0xaac7('0x36')]+'%'};return _0x25872f;}})});}_0x39451e=_[_0xaac7('0x37')]({},_0x39451e,_0xf8e27b[_0xaac7('0x39')]);var _0x24f97f={'where':_0x39451e[_0xaac7('0x34')]};return db['Attachment'][_0xaac7('0x1b')](_0x24f97f)['then'](function(_0x112fe1){_0x374244[_0xaac7('0x1b')]=_0x112fe1;if(_0xf8e27b[_0xaac7('0x2b')][_0xaac7('0x3a')]){_0x39451e['include']=[{'all':!![]}];}return db[_0xaac7('0x28')][_0xaac7('0x3b')](_0x39451e);})['then'](function(_0x44bb32){_0x374244['rows']=_0x44bb32;return _0x374244;})[_0xaac7('0x3c')](respondWithFilteredResult(_0x2f4c37,_0x39451e))[_0xaac7('0x3d')](handleError(_0x2f4c37,null));};exports[_0xaac7('0x3e')]=function(_0x21af3e,_0x92bc88){var _0x17d20b={'raw':!![],'where':{'id':_0x21af3e[_0xaac7('0x3f')]['id']}},_0x1c48fc={};_0x1c48fc[_0xaac7('0x2a')]=_[_0xaac7('0x40')](db[_0xaac7('0x28')]['rawAttributes']);_0x1c48fc[_0xaac7('0x2b')]=_[_0xaac7('0x40')](_0x21af3e[_0xaac7('0x2b')]);_0x1c48fc[_0xaac7('0x2c')]=_[_0xaac7('0x2d')](_0x1c48fc[_0xaac7('0x2a')],_0x1c48fc[_0xaac7('0x2b')]);_0x17d20b[_0xaac7('0x2e')]=_['intersection'](_0x1c48fc['model'],qs[_0xaac7('0x2f')](_0x21af3e[_0xaac7('0x2b')][_0xaac7('0x2f')]));_0x17d20b[_0xaac7('0x2e')]=_0x17d20b['attributes'][_0xaac7('0x30')]?_0x17d20b['attributes']:_0x1c48fc[_0xaac7('0x2a')];if(_0x21af3e['query'][_0xaac7('0x3a')]){_0x17d20b[_0xaac7('0x41')]=[{'all':!![]}];}_0x17d20b=_[_0xaac7('0x37')]({},_0x17d20b,_0x21af3e[_0xaac7('0x39')]);return db['Attachment'][_0xaac7('0x42')](_0x17d20b)['then'](handleEntityNotFound(_0x92bc88,null))[_0xaac7('0x3c')](respondWithResult(_0x92bc88,null))[_0xaac7('0x3d')](handleError(_0x92bc88,null));};exports[_0xaac7('0x43')]=function(_0x3ac9b9,_0x411ace){var _0x4ee50b={'where':{'id':_0x3ac9b9['params']['id']}},_0x1d1dbb={};_0x1d1dbb[_0xaac7('0x2a')]=_[_0xaac7('0x40')](db[_0xaac7('0x28')][_0xaac7('0x44')]);_0x4ee50b[_0xaac7('0x2e')]=_[_0xaac7('0x2d')](_0x1d1dbb[_0xaac7('0x2a')],qs[_0xaac7('0x2f')](_0x3ac9b9[_0xaac7('0x2b')][_0xaac7('0x2f')]));_0x4ee50b[_0xaac7('0x2e')]=_0x4ee50b[_0xaac7('0x2e')]['length']?_0x4ee50b[_0xaac7('0x2e')]:_0x1d1dbb[_0xaac7('0x2a')];if(_0x3ac9b9[_0xaac7('0x2b')]['includeAll']){_0x4ee50b[_0xaac7('0x41')]=[{'all':!![]}];}_0x4ee50b=_[_0xaac7('0x37')]({},_0x4ee50b,_0x3ac9b9[_0xaac7('0x39')]);return db[_0xaac7('0x28')][_0xaac7('0x42')](_0x4ee50b)['then'](handleEntityNotFound(_0x411ace,null))[_0xaac7('0x3c')](function(_0x5ab07f){if(_0x5ab07f){var _0x3e9748=_0x5ab07f[_0xaac7('0x45')]({'plain':!![]});_0x3e9748=qs[_0xaac7('0x46')](_0x3e9748,['id',_0xaac7('0x47'),'updatedAt']);_0x3ac9b9[_0xaac7('0x48')]=_[_0xaac7('0x46')](_0x3ac9b9[_0xaac7('0x48')],['id',_0xaac7('0x47'),_0xaac7('0x49')]);return db[_0xaac7('0x28')][_0xaac7('0x4a')](_[_0xaac7('0x37')](_0x3e9748,_0x3ac9b9['body']),{'include':_0x3ac9b9[_0xaac7('0x2b')][_0xaac7('0x3a')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x411ace,0xc9))[_0xaac7('0x3d')](handleError(_0x411ace,null));};exports[_0xaac7('0x4b')]=function(_0x26ca88,_0x3aa8dd){if(_0x26ca88[_0xaac7('0x48')]['id']){delete _0x26ca88['body']['id'];}return db[_0xaac7('0x28')][_0xaac7('0x42')]({'where':{'id':_0x26ca88[_0xaac7('0x3f')]['id']}})[_0xaac7('0x3c')](handleEntityNotFound(_0x3aa8dd,null))[_0xaac7('0x3c')](saveUpdates(_0x26ca88['body'],null))[_0xaac7('0x3c')](respondWithResult(_0x3aa8dd,null))[_0xaac7('0x3d')](handleError(_0x3aa8dd,null));};exports[_0xaac7('0x22')]=function(_0xdd01c5,_0x47b5a8){return db[_0xaac7('0x28')][_0xaac7('0x42')]({'where':{'id':_0xdd01c5['params']['id']}})['then'](handleEntityNotFound(_0x47b5a8,null))[_0xaac7('0x3c')](removeEntity(_0x47b5a8,null))[_0xaac7('0x3d')](handleError(_0x47b5a8,null));};exports['create']=function(_0x313a73,_0x164519,_0x48345d){_0x313a73[_0xaac7('0x48')][_0xaac7('0x25')]=_0x313a73[_0xaac7('0x4c')][_0xaac7('0x4d')];_0x313a73[_0xaac7('0x48')][_0xaac7('0x4e')]=_0x313a73[_0xaac7('0x4c')]['filename'];_0x313a73[_0xaac7('0x48')][_0xaac7('0x29')]=_0x313a73['file']['mimetype'];return db['Attachment'][_0xaac7('0x4a')](_0x313a73[_0xaac7('0x48')])[_0xaac7('0x3c')](respondWithResult(_0x164519,0xc9))[_0xaac7('0x3d')](handleError(_0x164519,null));};exports['download']=function(_0x4f9b5e,_0x5bc6aa,_0x109998){return db['Attachment']['findOne']({'where':{'id':_0x4f9b5e[_0xaac7('0x3f')]['id']},'raw':!![]})[_0xaac7('0x3c')](handleEntityNotFound(_0x5bc6aa,null))[_0xaac7('0x3c')](function(_0x48240d){if(_0x48240d){var _0x316719=_0x48240d['ChatOfflineMessageId']!==null;var _0x14354b=path['join'](config[_0xaac7('0x4f')],_0xaac7('0x50'));if(_0x316719){_0x14354b=path[_0xaac7('0x51')](_0x14354b,_0xaac7('0x52'));}var _0x1c58b6=path['join'](_0x14354b,_0x48240d[_0xaac7('0x4e')]);return _0x5bc6aa['download'](_0x1c58b6);}})['catch'](handleError(_0x5bc6aa,null));};
\ No newline at end of file
+var _0xa8ac=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','includeAll','include','findAll','rows','catch','length','options','find','clone','params','omit','createdAt','updatedAt','body','create','file','originalname','basename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','destroy','then','error','stack','send','index','Attachment','rawAttributes','fieldName','key','model','map','name','query','keys','filters','intersection','attributes','fields'];(function(_0x22ee1e,_0x3eff80){var _0x49a5c9=function(_0x373480){while(--_0x373480){_0x22ee1e['push'](_0x22ee1e['shift']());}};_0x49a5c9(++_0x3eff80);}(_0xa8ac,0x1db));var _0xca8a=function(_0xe00dc2,_0x122bbb){_0xe00dc2=_0xe00dc2-0x0;var _0x91e9ab=_0xa8ac[_0xe00dc2];return _0x91e9ab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xca8a('0x0'));var zipdir=require(_0xca8a('0x1'));var jsonpatch=require(_0xca8a('0x2'));var rp=require('request-promise');var moment=require(_0xca8a('0x3'));var BPromise=require(_0xca8a('0x4'));var Mustache=require('mustache');var util=require(_0xca8a('0x5'));var path=require(_0xca8a('0x6'));var sox=require(_0xca8a('0x7'));var csv=require(_0xca8a('0x8'));var ejs=require(_0xca8a('0x9'));var fs=require('fs');var fs_extra=require(_0xca8a('0xa'));var _=require('lodash');var squel=require(_0xca8a('0xb'));var crypto=require('crypto');var jsforce=require(_0xca8a('0xc'));var deskjs=require(_0xca8a('0xd'));var toCsv=require(_0xca8a('0x8'));var querystring=require(_0xca8a('0xe'));var Papa=require(_0xca8a('0xf'));var Redis=require('ioredis');var authService=require(_0xca8a('0x10'));var qs=require(_0xca8a('0x11'));var as=require(_0xca8a('0x12'));var hardwareService=require(_0xca8a('0x13'));var logger=require(_0xca8a('0x14'))(_0xca8a('0x15'));var utils=require('../../config/utils');var config=require(_0xca8a('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14075c,_0x26cf16){_0x26cf16=_0x26cf16||0xcc;return function(_0x376bf7){if(_0x376bf7){return _0x14075c[_0xca8a('0x17')](_0x26cf16);}return _0x14075c[_0xca8a('0x18')](_0x26cf16)[_0xca8a('0x19')]();};}function respondWithResult(_0x28695b,_0x2d57d4){_0x2d57d4=_0x2d57d4||0xc8;return function(_0x4415a4){if(_0x4415a4){return _0x28695b[_0xca8a('0x18')](_0x2d57d4)[_0xca8a('0x1a')](_0x4415a4);}};}function respondWithFilteredResult(_0x30452f,_0x25e85b){return function(_0x25e9c0){if(_0x25e9c0){var _0x24a167=typeof _0x25e85b[_0xca8a('0x1b')]===_0xca8a('0x1c')&&typeof _0x25e85b[_0xca8a('0x1d')]===_0xca8a('0x1c');var _0x28a86a=_0x25e9c0[_0xca8a('0x1e')];var _0x1861a=_0x24a167?0x0:_0x25e85b['offset'];var _0x46b4a7=_0x24a167?_0x25e9c0['count']:_0x25e85b[_0xca8a('0x1b')]+_0x25e85b[_0xca8a('0x1d')];var _0x137019;if(_0x46b4a7>=_0x28a86a){_0x46b4a7=_0x28a86a;_0x137019=0xc8;}else{_0x137019=0xce;}_0x30452f[_0xca8a('0x18')](_0x137019);return _0x30452f['set'](_0xca8a('0x1f'),_0x1861a+'-'+_0x46b4a7+'/'+_0x28a86a)[_0xca8a('0x1a')](_0x25e9c0);}return null;};}function patchUpdates(_0x2a7d27){return function(_0xf78572){try{jsonpatch['apply'](_0xf78572,_0x2a7d27,!![]);}catch(_0x45a607){return BPromise[_0xca8a('0x20')](_0x45a607);}return _0xf78572['save']();};}function saveUpdates(_0x1af721,_0x4aa14d){return function(_0x3e4c01){if(_0x3e4c01){return _0x3e4c01[_0xca8a('0x21')](_0x1af721)['then'](function(_0x2c9ac5){return _0x2c9ac5;});}return null;};}function removeEntity(_0x58901d,_0x65c0e8){return function(_0x265ca6){if(_0x265ca6){return _0x265ca6[_0xca8a('0x22')]()[_0xca8a('0x23')](function(){_0x58901d[_0xca8a('0x18')](0xcc)[_0xca8a('0x19')]();});}};}function handleEntityNotFound(_0x1d7c1f,_0x530e48){return function(_0xe6e57a){if(!_0xe6e57a){_0x1d7c1f[_0xca8a('0x17')](0x194);}return _0xe6e57a;};}function handleError(_0x4d4c69,_0x3fe248){_0x3fe248=_0x3fe248||0x1f4;return function(_0x4a474a){logger[_0xca8a('0x24')](_0x4a474a[_0xca8a('0x25')]);if(_0x4a474a['name']){delete _0x4a474a['name'];}_0x4d4c69[_0xca8a('0x18')](_0x3fe248)[_0xca8a('0x26')](_0x4a474a);};}exports[_0xca8a('0x27')]=function(_0x38fc7e,_0x6eb3b1){var _0xb16c7e={},_0x317860={},_0x3baa86={'count':0x0,'rows':[]};var _0xde35a2=_['map'](db[_0xca8a('0x28')][_0xca8a('0x29')],function(_0xcf7dac){return{'name':_0xcf7dac[_0xca8a('0x2a')],'type':_0xcf7dac['type'][_0xca8a('0x2b')]};});_0x317860[_0xca8a('0x2c')]=_[_0xca8a('0x2d')](_0xde35a2,_0xca8a('0x2e'));_0x317860[_0xca8a('0x2f')]=_[_0xca8a('0x30')](_0x38fc7e[_0xca8a('0x2f')]);_0x317860[_0xca8a('0x31')]=_[_0xca8a('0x32')](_0x317860['model'],_0x317860[_0xca8a('0x2f')]);_0xb16c7e[_0xca8a('0x33')]=_[_0xca8a('0x32')](_0x317860[_0xca8a('0x2c')],qs[_0xca8a('0x34')](_0x38fc7e[_0xca8a('0x2f')][_0xca8a('0x34')]));_0xb16c7e[_0xca8a('0x33')]=_0xb16c7e[_0xca8a('0x33')]['length']?_0xb16c7e[_0xca8a('0x33')]:_0x317860[_0xca8a('0x2c')];if(!_0x38fc7e[_0xca8a('0x2f')][_0xca8a('0x35')](_0xca8a('0x36'))){_0xb16c7e[_0xca8a('0x1d')]=qs[_0xca8a('0x1d')](_0x38fc7e[_0xca8a('0x2f')]['limit']);_0xb16c7e['offset']=qs[_0xca8a('0x1b')](_0x38fc7e[_0xca8a('0x2f')][_0xca8a('0x1b')]);}_0xb16c7e[_0xca8a('0x37')]=qs[_0xca8a('0x38')](_0x38fc7e[_0xca8a('0x2f')][_0xca8a('0x38')]);_0xb16c7e[_0xca8a('0x39')]=qs[_0xca8a('0x31')](_[_0xca8a('0x3a')](_0x38fc7e[_0xca8a('0x2f')],_0x317860['filters']),_0xde35a2);if(_0x38fc7e['query'][_0xca8a('0x3b')]){_0xb16c7e[_0xca8a('0x39')]=_[_0xca8a('0x3c')](_0xb16c7e[_0xca8a('0x39')],{'$or':_[_0xca8a('0x2d')](_0xde35a2,function(_0x3ed5d8){if(_0x3ed5d8[_0xca8a('0x3d')]!=='VIRTUAL'){var _0x270748={};_0x270748[_0x3ed5d8[_0xca8a('0x2e')]]={'$like':'%'+_0x38fc7e[_0xca8a('0x2f')]['filter']+'%'};return _0x270748;}})});}_0xb16c7e=_[_0xca8a('0x3c')]({},_0xb16c7e,_0x38fc7e['options']);var _0x5f4a78={'where':_0xb16c7e[_0xca8a('0x39')]};return db['Attachment'][_0xca8a('0x1e')](_0x5f4a78)[_0xca8a('0x23')](function(_0x21b1e2){_0x3baa86['count']=_0x21b1e2;if(_0x38fc7e[_0xca8a('0x2f')][_0xca8a('0x3e')]){_0xb16c7e[_0xca8a('0x3f')]=[{'all':!![]}];}return db['Attachment'][_0xca8a('0x40')](_0xb16c7e);})['then'](function(_0x2e35b9){_0x3baa86[_0xca8a('0x41')]=_0x2e35b9;return _0x3baa86;})[_0xca8a('0x23')](respondWithFilteredResult(_0x6eb3b1,_0xb16c7e))[_0xca8a('0x42')](handleError(_0x6eb3b1,null));};exports['show']=function(_0x557e6e,_0x20e5ca){var _0x5eca5f={'raw':!![],'where':{'id':_0x557e6e['params']['id']}},_0x2eb0bf={};_0x2eb0bf['model']=_[_0xca8a('0x30')](db['Attachment'][_0xca8a('0x29')]);_0x2eb0bf['query']=_['keys'](_0x557e6e['query']);_0x2eb0bf[_0xca8a('0x31')]=_[_0xca8a('0x32')](_0x2eb0bf[_0xca8a('0x2c')],_0x2eb0bf[_0xca8a('0x2f')]);_0x5eca5f['attributes']=_['intersection'](_0x2eb0bf['model'],qs['fields'](_0x557e6e[_0xca8a('0x2f')][_0xca8a('0x34')]));_0x5eca5f[_0xca8a('0x33')]=_0x5eca5f[_0xca8a('0x33')][_0xca8a('0x43')]?_0x5eca5f[_0xca8a('0x33')]:_0x2eb0bf[_0xca8a('0x2c')];if(_0x557e6e[_0xca8a('0x2f')][_0xca8a('0x3e')]){_0x5eca5f[_0xca8a('0x3f')]=[{'all':!![]}];}_0x5eca5f=_[_0xca8a('0x3c')]({},_0x5eca5f,_0x557e6e[_0xca8a('0x44')]);return db[_0xca8a('0x28')][_0xca8a('0x45')](_0x5eca5f)[_0xca8a('0x23')](handleEntityNotFound(_0x20e5ca,null))[_0xca8a('0x23')](respondWithResult(_0x20e5ca,null))['catch'](handleError(_0x20e5ca,null));};exports[_0xca8a('0x46')]=function(_0x2554ed,_0x1e947d){var _0x3d3c4d={'where':{'id':_0x2554ed[_0xca8a('0x47')]['id']}},_0x32e365={};_0x32e365[_0xca8a('0x2c')]=_[_0xca8a('0x30')](db[_0xca8a('0x28')]['rawAttributes']);_0x3d3c4d[_0xca8a('0x33')]=_['intersection'](_0x32e365['model'],qs[_0xca8a('0x34')](_0x2554ed[_0xca8a('0x2f')][_0xca8a('0x34')]));_0x3d3c4d[_0xca8a('0x33')]=_0x3d3c4d[_0xca8a('0x33')][_0xca8a('0x43')]?_0x3d3c4d[_0xca8a('0x33')]:_0x32e365[_0xca8a('0x2c')];if(_0x2554ed[_0xca8a('0x2f')]['includeAll']){_0x3d3c4d['include']=[{'all':!![]}];}_0x3d3c4d=_[_0xca8a('0x3c')]({},_0x3d3c4d,_0x2554ed[_0xca8a('0x44')]);return db[_0xca8a('0x28')][_0xca8a('0x45')](_0x3d3c4d)[_0xca8a('0x23')](handleEntityNotFound(_0x1e947d,null))[_0xca8a('0x23')](function(_0x13dc18){if(_0x13dc18){var _0x570453=_0x13dc18['get']({'plain':!![]});_0x570453=qs[_0xca8a('0x48')](_0x570453,['id',_0xca8a('0x49'),_0xca8a('0x4a')]);_0x2554ed[_0xca8a('0x4b')]=_['omit'](_0x2554ed['body'],['id',_0xca8a('0x49'),'updatedAt']);return db[_0xca8a('0x28')][_0xca8a('0x4c')](_[_0xca8a('0x3c')](_0x570453,_0x2554ed['body']),{'include':_0x2554ed['query'][_0xca8a('0x3e')]?[{'all':!![]}]:undefined});}})[_0xca8a('0x23')](respondWithResult(_0x1e947d,0xc9))[_0xca8a('0x42')](handleError(_0x1e947d,null));};exports[_0xca8a('0x21')]=function(_0x58e76d,_0x7639b5){if(_0x58e76d[_0xca8a('0x4b')]['id']){delete _0x58e76d[_0xca8a('0x4b')]['id'];}return db[_0xca8a('0x28')][_0xca8a('0x45')]({'where':{'id':_0x58e76d['params']['id']}})[_0xca8a('0x23')](handleEntityNotFound(_0x7639b5,null))[_0xca8a('0x23')](saveUpdates(_0x58e76d[_0xca8a('0x4b')],null))['then'](respondWithResult(_0x7639b5,null))[_0xca8a('0x42')](handleError(_0x7639b5,null));};exports[_0xca8a('0x22')]=function(_0x448247,_0x58ba75){return db[_0xca8a('0x28')]['find']({'where':{'id':_0x448247[_0xca8a('0x47')]['id']}})['then'](handleEntityNotFound(_0x58ba75,null))[_0xca8a('0x23')](removeEntity(_0x58ba75,null))[_0xca8a('0x42')](handleError(_0x58ba75,null));};exports[_0xca8a('0x4c')]=function(_0x4261fd,_0x3e8532,_0x412950){_0x4261fd[_0xca8a('0x4b')]['name']=_0x4261fd[_0xca8a('0x4d')][_0xca8a('0x4e')];_0x4261fd[_0xca8a('0x4b')][_0xca8a('0x4f')]=_0x4261fd[_0xca8a('0x4d')]['filename'];_0x4261fd[_0xca8a('0x4b')][_0xca8a('0x3d')]=_0x4261fd[_0xca8a('0x4d')][_0xca8a('0x50')];return db[_0xca8a('0x28')][_0xca8a('0x4c')](_0x4261fd[_0xca8a('0x4b')])['then'](respondWithResult(_0x3e8532,0xc9))[_0xca8a('0x42')](handleError(_0x3e8532,null));};exports[_0xca8a('0x51')]=function(_0x122f87,_0x487102,_0x4ec001){return db['Attachment'][_0xca8a('0x52')]({'where':{'id':_0x122f87[_0xca8a('0x47')]['id']},'raw':!![]})[_0xca8a('0x23')](handleEntityNotFound(_0x487102,null))['then'](function(_0x179baa){if(_0x179baa){var _0x1fe29a=_0x179baa[_0xca8a('0x53')]!==null;var _0xd87039=path[_0xca8a('0x54')](config[_0xca8a('0x55')],_0xca8a('0x56'));if(_0x1fe29a){_0xd87039=path['join'](_0xd87039,_0xca8a('0x57'));}var _0x4de352=path[_0xca8a('0x54')](_0xd87039,_0x179baa[_0xca8a('0x4f')]);return _0x487102['download'](_0x4de352);}})[_0xca8a('0x42')](handleError(_0x487102,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index c450ac5..29fadd8 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 _0xfce4=['bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','attachments','util','../../config/logger','api','moment'];(function(_0x2b23d8,_0x4bacbb){var _0x2bf397=function(_0x30ba12){while(--_0x30ba12){_0x2b23d8['push'](_0x2b23d8['shift']());}};_0x2bf397(++_0x4bacbb);}(_0xfce4,0x134));var _0x4fce=function(_0x295ea9,_0x19d658){_0x295ea9=_0x295ea9-0x0;var _0x59a3fe=_0xfce4[_0x295ea9];return _0x59a3fe;};'use strict';var _=require('lodash');var util=require(_0x4fce('0x0'));var logger=require(_0x4fce('0x1'))(_0x4fce('0x2'));var moment=require(_0x4fce('0x3'));var BPromise=require(_0x4fce('0x4'));var rp=require(_0x4fce('0x5'));var fs=require('fs');var path=require(_0x4fce('0x6'));var rimraf=require(_0x4fce('0x7'));var config=require(_0x4fce('0x8'));var attributes=require(_0x4fce('0x9'));module[_0x4fce('0xa')]=function(_0x52acfb,_0x2d004c){return _0x52acfb[_0x4fce('0xb')]('Attachment',attributes,{'tableName':_0x4fce('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x56fc=['moment','path','../../config/environment','./attachment.attributes','define','Attachment','attachments','lodash','../../config/logger','api'];(function(_0x1a5be0,_0x402acf){var _0x7875fe=function(_0x346de6){while(--_0x346de6){_0x1a5be0['push'](_0x1a5be0['shift']());}};_0x7875fe(++_0x402acf);}(_0x56fc,0xd9));var _0xc56f=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x56fc[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0xc56f('0x0'));var util=require('util');var logger=require(_0xc56f('0x1'))(_0xc56f('0x2'));var moment=require(_0xc56f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc56f('0x4'));var rimraf=require('rimraf');var config=require(_0xc56f('0x5'));var attributes=require(_0xc56f('0x6'));module['exports']=function(_0x1712f2,_0x238661){return _0x1712f2[_0xc56f('0x7')](_0xc56f('0x8'),attributes,{'tableName':_0xc56f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 4bbedc7..76aa083 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 _0x24cf=['code','message','catch','CreateAttachment','Attachment','create','body','options','raw','stringify','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error'];(function(_0x3c31e9,_0x1f2046){var _0x419260=function(_0x2a87c5){while(--_0x2a87c5){_0x3c31e9['push'](_0x3c31e9['shift']());}};_0x419260(++_0x1f2046);}(_0x24cf,0x1d5));var _0xf24c=function(_0x1f222d,_0x3fed85){_0x1f222d=_0x1f222d-0x0;var _0x26dca0=_0x24cf[_0x1f222d];return _0x26dca0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf24c('0x0'));var BPromise=require(_0xf24c('0x1'));var rs=require(_0xf24c('0x2'));var fs=require('fs');var Redis=require(_0xf24c('0x3'));var db=require(_0xf24c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf24c('0x5'))(_0xf24c('0x6'));var config=require(_0xf24c('0x7'));var jayson=require(_0xf24c('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5104bd,_0x272d25,_0x596e81){return new BPromise(function(_0x3b7cf1,_0x13163e){return client[_0xf24c('0x9')](_0x5104bd,_0x596e81)[_0xf24c('0xa')](function(_0x4b3ea3){logger[_0xf24c('0xb')](_0xf24c('0xc'),_0x272d25,_0xf24c('0xd'));logger[_0xf24c('0xe')](_0xf24c('0xf'),_0x272d25,_0xf24c('0xd'),JSON['stringify'](_0x4b3ea3));if(_0x4b3ea3[_0xf24c('0x10')]){if(_0x4b3ea3[_0xf24c('0x10')][_0xf24c('0x11')]===0x1f4){logger['error'](_0xf24c('0xc'),_0x272d25,_0x4b3ea3[_0xf24c('0x10')]['message']);return _0x13163e(_0x4b3ea3['error'][_0xf24c('0x12')]);}logger['error'](_0xf24c('0xc'),_0x272d25,_0x4b3ea3[_0xf24c('0x10')]['message']);return _0x3b7cf1(_0x4b3ea3[_0xf24c('0x10')][_0xf24c('0x12')]);}else{logger[_0xf24c('0xb')](_0xf24c('0xc'),_0x272d25,_0xf24c('0xd'));_0x3b7cf1(_0x4b3ea3['result']['message']);}})[_0xf24c('0x13')](function(_0x462801){logger['error'](_0xf24c('0xc'),_0x272d25,_0x462801);_0x13163e(_0x462801);});});}exports[_0xf24c('0x14')]=function(_0x2d9015){var _0x3eb8e1=this;return new Promise(function(_0x1a17c6,_0x3a0b61){return db[_0xf24c('0x15')][_0xf24c('0x16')](_0x2d9015[_0xf24c('0x17')],{'raw':_0x2d9015[_0xf24c('0x18')]?_0x2d9015[_0xf24c('0x18')][_0xf24c('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x24bf58){logger[_0xf24c('0xb')]('CreateAttachment',_0x2d9015);logger[_0xf24c('0xe')](_0xf24c('0x14'),_0x2d9015,JSON[_0xf24c('0x1a')](_0x24bf58));_0x1a17c6(_0x24bf58);})['catch'](function(_0x5885a5){logger['error'](_0xf24c('0x14'),_0x5885a5[_0xf24c('0x12')],_0x2d9015);_0x3a0b61(_0x3eb8e1['error'](0x1f4,_0x5885a5[_0xf24c('0x12')]));});});};
\ No newline at end of file
+var _0x7764=['debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateAttachment','Attachment','create','options','raw','then','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent'];(function(_0x44afa4,_0x5be27b){var _0xcad289=function(_0x206272){while(--_0x206272){_0x44afa4['push'](_0x44afa4['shift']());}};_0xcad289(++_0x5be27b);}(_0x7764,0xa4));var _0x4776=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x7764[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0x4776('0x0'));var util=require(_0x4776('0x1'));var moment=require(_0x4776('0x2'));var BPromise=require(_0x4776('0x3'));var rs=require(_0x4776('0x4'));var fs=require('fs');var Redis=require(_0x4776('0x5'));var db=require(_0x4776('0x6'))['db'];var utils=require(_0x4776('0x7'));var logger=require(_0x4776('0x8'))(_0x4776('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4776('0xa')][_0x4776('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52f59e,_0x1f9a45,_0x2b61c7){return new BPromise(function(_0x4fcbcc,_0x53f976){return client[_0x4776('0xc')](_0x52f59e,_0x2b61c7)['then'](function(_0x35bf06){logger[_0x4776('0xd')](_0x4776('0xe'),_0x1f9a45,_0x4776('0xf'));logger[_0x4776('0x10')](_0x4776('0x11'),_0x1f9a45,_0x4776('0xf'),JSON[_0x4776('0x12')](_0x35bf06));if(_0x35bf06[_0x4776('0x13')]){if(_0x35bf06[_0x4776('0x13')][_0x4776('0x14')]===0x1f4){logger[_0x4776('0x13')](_0x4776('0xe'),_0x1f9a45,_0x35bf06[_0x4776('0x13')][_0x4776('0x15')]);return _0x53f976(_0x35bf06[_0x4776('0x13')]['message']);}logger['error'](_0x4776('0xe'),_0x1f9a45,_0x35bf06[_0x4776('0x13')][_0x4776('0x15')]);return _0x4fcbcc(_0x35bf06[_0x4776('0x13')][_0x4776('0x15')]);}else{logger[_0x4776('0xd')](_0x4776('0xe'),_0x1f9a45,_0x4776('0xf'));_0x4fcbcc(_0x35bf06[_0x4776('0x16')][_0x4776('0x15')]);}})['catch'](function(_0x46fec7){logger['error'](_0x4776('0xe'),_0x1f9a45,_0x46fec7);_0x53f976(_0x46fec7);});});}exports[_0x4776('0x17')]=function(_0x2366da){var _0xed81b5=this;return new Promise(function(_0xb5c938,_0x4b5f50){return db[_0x4776('0x18')][_0x4776('0x19')](_0x2366da['body'],{'raw':_0x2366da[_0x4776('0x1a')]?_0x2366da[_0x4776('0x1a')][_0x4776('0x1b')]===undefined?!![]:![]:!![]})[_0x4776('0x1c')](function(_0x59b540){logger[_0x4776('0xd')](_0x4776('0x17'),_0x2366da);logger[_0x4776('0x10')](_0x4776('0x17'),_0x2366da,JSON['stringify'](_0x59b540));_0xb5c938(_0x59b540);})[_0x4776('0x1d')](function(_0xaa89dc){logger[_0x4776('0x13')]('CreateAttachment',_0xaa89dc[_0x4776('0x15')],_0x2366da);_0x4b5f50(_0xed81b5[_0x4776('0x13')](0x1f4,_0xaa89dc[_0x4776('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 9bf3e11..a2b76b2 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 _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x5df0e6,_0xa65e2){var _0x370c8f=function(_0x2fa3ab){while(--_0x2fa3ab){_0x5df0e6['push'](_0x5df0e6['shift']());}};_0x370c8f(++_0xa65e2);}(_0x2032,0xd9));var _0x2203=function(_0x480d6d,_0x5392d2){_0x480d6d=_0x480d6d-0x0;var _0x4169e0=_0x2032[_0x480d6d];return _0x4169e0;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router;
\ No newline at end of file
+var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x4dab14,_0x164ea0){var _0xf41aa=function(_0x305d50){while(--_0x305d50){_0x4dab14['push'](_0x4dab14['shift']());}};_0xf41aa(++_0x164ea0);}(_0x5f66,0x1a0));var _0x65f6=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x5f66[_0x13d07a];return _0x5ee0ee;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 6237f40..342fe07 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 _0x1fd9=['url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','then','adSsoEnabled','password','disabled','blocked','blockedAt','online','admin','user','name','add','clearBlockUser','getLicense','catch','send','message','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','use','ad-login','User','passport','passport-local','Strategy','moment','activedirectory2','../../mysqldb','../../components/auth/service','../../config/logger','api','activedirectory','undefined','baseDN'];(function(_0x562163,_0x264e2a){var _0x551eed=function(_0x5ecde8){while(--_0x5ecde8){_0x562163['push'](_0x562163['shift']());}};_0x551eed(++_0x264e2a);}(_0x1fd9,0x19b));var _0x91fd=function(_0x1fbbb6,_0x5d0e64){_0x1fbbb6=_0x1fbbb6-0x0;var _0x212b5e=_0x1fd9[_0x1fbbb6];return _0x212b5e;};'use strict';var passport=require(_0x91fd('0x0'));var LocalStrategy=require(_0x91fd('0x1'))[_0x91fd('0x2')];var moment=require(_0x91fd('0x3'));var ActiveDirectory=require(_0x91fd('0x4'));var BPromise=require('bluebird');var util=require('util');var db=require(_0x91fd('0x5'))['db'];var authService=require(_0x91fd('0x6'));var utils=require('../../config/utils');var config=require('../../config/environment');var logger=require(_0x91fd('0x7'))(_0x91fd('0x8'));function isActiveDirectoryConfigured(_0x1eaa48){var _0xe0364f=![];if(typeof _0x1eaa48[_0x91fd('0x9')]!==_0x91fd('0xa')){_0xe0364f=_0x1eaa48['activedirectory'][_0x91fd('0xb')]&&_0x1eaa48['activedirectory'][_0x91fd('0xc')]&&_0x1eaa48[_0x91fd('0x9')][_0x91fd('0xd')];}return _0xe0364f;}function adAuthenticate(_0x14f69c,_0x5b4d56,_0x4f711a){return new BPromise(function(_0x1ce670,_0x17e508){try{var _0x3748d3=new ActiveDirectory(_0x14f69c);_0x3748d3[_0x91fd('0xe')](_0x5b4d56,_0x4f711a,function(_0x55542c,_0x3bd698){if(_0x55542c){logger[_0x91fd('0xf')](_0x91fd('0x10'),_0x5b4d56,util[_0x91fd('0x11')](_0x55542c,{'showHidden':![],'depth':null}));_0x17e508(_0x91fd('0x12'));}else if(!_0x3bd698){logger[_0x91fd('0xf')](_0x91fd('0x13'),_0x5b4d56);_0x17e508('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x1ce670(_0x3bd698);}});}catch(_0x281216){_0x17e508(_0x281216);}});}function ActiveDirectoryAuthenticate(_0x6d6fbf,_0x5b0304,_0x18f348,_0x4858f3){var _0x4d22e3,_0x4437c2;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x91fd('0x14'),_0x5b0304);return _0x4858f3(null,![],{'message':_0x91fd('0x12')});}return db[_0x91fd('0x15')][_0x91fd('0x16')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x91fd('0x17')],'raw':!![]})[_0x91fd('0x18')](function(_0x1892e6){_0x4d22e3=_0x1892e6;if(!_0x4d22e3[_0x91fd('0x19')]){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x5b0304);throw new Error(_0x91fd('0x12'));}return _0x6d6fbf[_0x91fd('0x16')]({'attributes':['id','name',_0x91fd('0x1a'),'salt','role',_0x91fd('0x1b'),_0x91fd('0x1c'),_0x91fd('0x1d'),_0x91fd('0x1e')],'where':{'name':_0x5b0304,'role':{'$or':[_0x91fd('0x1f'),_0x91fd('0x20'),'agent']},'adSsoEnabled':!![]}});})['then'](function(_0x3e325f){if(!_0x3e325f||_0x3e325f&&_0x3e325f[_0x91fd('0x21')]!==_0x5b0304){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x4437c2=_0x3e325f;var _0x10225e=_0x4437c2[_0x91fd('0x21')]+'@'+config[_0x91fd('0x9')]['domain'];return adAuthenticate(config['activedirectory'],_0x10225e,_0x18f348);})[_0x91fd('0x18')](function(_0x5a4bba){if(_0x4437c2['disabled']){throw new Error(_0x91fd('0x12'));}if(_0x4d22e3[_0x91fd('0x17')]>0x0){if(_0x4437c2['blocked']){if(moment(_0x4437c2[_0x91fd('0x1d')])[_0x91fd('0x22')](_0x4d22e3['blockDuration'],'minutes')>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x91fd('0x23')](_0x4437c2,0x0,![],null)[_0x91fd('0x18')](function(){return utils[_0x91fd('0x24')](_0x4437c2);})['then'](function(){return _0x4858f3(null,_0x4437c2);});}else{return utils['getLicense'](_0x4437c2)[_0x91fd('0x18')](function(){return _0x4858f3(null,_0x4437c2);});}}else{return utils[_0x91fd('0x24')](_0x4437c2)[_0x91fd('0x18')](function(){return _0x4858f3(null,_0x4437c2);});}})[_0x91fd('0x25')](function(_0xf27df8){return _0x4858f3(null,![],_0xf27df8);});}function handleError(_0xdd1249,_0x566bcb,_0x399728){return _0xdd1249['status'](_0x566bcb||0x1f4)[_0x91fd('0x26')]({'message':_0x399728?_0x399728[_0x91fd('0x27')]||_0x399728:''});}exports['login']=function(_0x23b083,_0x239485,_0x584298){passport[_0x91fd('0xe')]('ad-login',function(_0x32c248,_0x35c57a,_0x437166){var _0x54dbe2=_0x32c248||_0x437166;if(_0x54dbe2){return handleError(_0x239485,0x191,_0x54dbe2);}if(!_0x35c57a){return handleError(_0x239485,0x194,{'message':_0x91fd('0x28')});}else{var _0x3c4988={'payload':{'id':_0x35c57a['id'],'role':_0x35c57a[_0x91fd('0x29')]},'options':{'expiresIn':0x15180}};return authService[_0x91fd('0x2a')](_0x3c4988)[_0x91fd('0x18')](function(_0x510e5a){_0x239485[_0x91fd('0x2b')]({'id':_0x35c57a['id'],'token':_0x510e5a,'statusCall':'','isAlreadyLogged':_0x35c57a['online']});});}})(_0x23b083,_0x239485,_0x584298);};passport[_0x91fd('0x2c')](_0x91fd('0x2d'),new LocalStrategy({'usernameField':_0x91fd('0x21'),'passwordField':_0x91fd('0x1a')},function(_0x5c4f91,_0x1ba9f8,_0x55301a){return ActiveDirectoryAuthenticate(db[_0x91fd('0x2e')],_0x5c4f91,_0x1ba9f8,_0x55301a);}));
\ No newline at end of file
+var _0x71c8=['status','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','ad-login','User','passport','passport-local','Strategy','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Setting','findOne','adSsoEnabled','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blocked','blockedAt','online','admin','user','agent','then','clearBlockUser','getLicense','catch'];(function(_0x240744,_0x5e0c7e){var _0x1a0e81=function(_0x3d9e8a){while(--_0x3d9e8a){_0x240744['push'](_0x240744['shift']());}};_0x1a0e81(++_0x5e0c7e);}(_0x71c8,0x1a2));var _0x871c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x71c8[_0x3dd15e];return _0x231fd0;};'use strict';var passport=require(_0x871c('0x0'));var LocalStrategy=require(_0x871c('0x1'))[_0x871c('0x2')];var moment=require('moment');var ActiveDirectory=require(_0x871c('0x3'));var BPromise=require(_0x871c('0x4'));var util=require(_0x871c('0x5'));var db=require(_0x871c('0x6'))['db'];var authService=require(_0x871c('0x7'));var utils=require('../../config/utils');var config=require(_0x871c('0x8'));var logger=require(_0x871c('0x9'))(_0x871c('0xa'));function isActiveDirectoryConfigured(_0x3f7930){var _0xc4eb4=![];if(typeof _0x3f7930[_0x871c('0xb')]!==_0x871c('0xc')){_0xc4eb4=_0x3f7930['activedirectory'][_0x871c('0xd')]&&_0x3f7930['activedirectory']['url']&&_0x3f7930[_0x871c('0xb')][_0x871c('0xe')];}return _0xc4eb4;}function adAuthenticate(_0x9b4c67,_0x2866f8,_0x407f15){return new BPromise(function(_0x31a0af,_0x5494ac){try{var _0xe28a00=new ActiveDirectory(_0x9b4c67);_0xe28a00[_0x871c('0xf')](_0x2866f8,_0x407f15,function(_0x16bb1a,_0x24c877){if(_0x16bb1a){logger[_0x871c('0x10')](_0x871c('0x11'),_0x2866f8,util[_0x871c('0x12')](_0x16bb1a,{'showHidden':![],'depth':null}));_0x5494ac(_0x871c('0x13'));}else if(!_0x24c877){logger[_0x871c('0x10')](_0x871c('0x14'),_0x2866f8);_0x5494ac(_0x871c('0x13'));}else{_0x31a0af(_0x24c877);}});}catch(_0x2d6dd5){_0x5494ac(_0x2d6dd5);}});}function ActiveDirectoryAuthenticate(_0x6ed964,_0x4c1911,_0x573c25,_0x93b1a3){var _0x4ef4e1,_0x1ee7e6;if(!isActiveDirectoryConfigured(config)){logger[_0x871c('0x10')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x4c1911);return _0x93b1a3(null,![],{'message':_0x871c('0x13')});}return db[_0x871c('0x15')][_0x871c('0x16')]({'where':{'id':0x1},'attributes':[_0x871c('0x17'),_0x871c('0x18')],'raw':!![]})['then'](function(_0x22ca46){_0x4ef4e1=_0x22ca46;if(!_0x4ef4e1[_0x871c('0x17')]){logger['error'](_0x871c('0x19'),_0x4c1911);throw new Error(_0x871c('0x13'));}return _0x6ed964[_0x871c('0x16')]({'attributes':['id',_0x871c('0x1a'),_0x871c('0x1b'),_0x871c('0x1c'),_0x871c('0x1d'),_0x871c('0x1e'),_0x871c('0x1f'),_0x871c('0x20'),_0x871c('0x21')],'where':{'name':_0x4c1911,'role':{'$or':[_0x871c('0x22'),_0x871c('0x23'),_0x871c('0x24')]},'adSsoEnabled':!![]}});})[_0x871c('0x25')](function(_0xa7686){if(!_0xa7686||_0xa7686&&_0xa7686[_0x871c('0x1a')]!==_0x4c1911){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x1ee7e6=_0xa7686;var _0x510155=_0x1ee7e6[_0x871c('0x1a')]+'@'+config[_0x871c('0xb')]['domain'];return adAuthenticate(config[_0x871c('0xb')],_0x510155,_0x573c25);})[_0x871c('0x25')](function(_0x3ccad4){if(_0x1ee7e6['disabled']){throw new Error(_0x871c('0x13'));}if(_0x4ef4e1[_0x871c('0x18')]>0x0){if(_0x1ee7e6[_0x871c('0x1f')]){if(moment(_0x1ee7e6[_0x871c('0x20')])['add'](_0x4ef4e1[_0x871c('0x18')],'minutes')>moment()){throw new Error(_0x871c('0x13'));}return utils[_0x871c('0x26')](_0x1ee7e6,0x0,![],null)[_0x871c('0x25')](function(){return utils[_0x871c('0x27')](_0x1ee7e6);})[_0x871c('0x25')](function(){return _0x93b1a3(null,_0x1ee7e6);});}else{return utils['getLicense'](_0x1ee7e6)['then'](function(){return _0x93b1a3(null,_0x1ee7e6);});}}else{return utils[_0x871c('0x27')](_0x1ee7e6)[_0x871c('0x25')](function(){return _0x93b1a3(null,_0x1ee7e6);});}})[_0x871c('0x28')](function(_0x2e7f1a){return _0x93b1a3(null,![],_0x2e7f1a);});}function handleError(_0xad5a5c,_0x2f46ed,_0x2a9654){return _0xad5a5c[_0x871c('0x29')](_0x2f46ed||0x1f4)[_0x871c('0x2a')]({'message':_0x2a9654?_0x2a9654[_0x871c('0x2b')]||_0x2a9654:''});}exports[_0x871c('0x2c')]=function(_0x24f8e8,_0x39dcd2,_0x47a3ec){passport[_0x871c('0xf')]('ad-login',function(_0x59541d,_0x4c24bb,_0x3480fc){var _0x3b8636=_0x59541d||_0x3480fc;if(_0x3b8636){return handleError(_0x39dcd2,0x191,_0x3b8636);}if(!_0x4c24bb){return handleError(_0x39dcd2,0x194,{'message':_0x871c('0x2d')});}else{var _0x3c32ef={'payload':{'id':_0x4c24bb['id'],'role':_0x4c24bb[_0x871c('0x1d')]},'options':{'expiresIn':0x15180}};return authService[_0x871c('0x2e')](_0x3c32ef)[_0x871c('0x25')](function(_0xf05061){_0x39dcd2[_0x871c('0x2f')]({'id':_0x4c24bb['id'],'token':_0xf05061,'statusCall':'','isAlreadyLogged':_0x4c24bb['online']});});}})(_0x24f8e8,_0x39dcd2,_0x47a3ec);};passport[_0x871c('0x30')](_0x871c('0x31'),new LocalStrategy({'usernameField':_0x871c('0x1a'),'passwordField':'password'},function(_0x46e0eb,_0x304e97,_0xe3f195){return ActiveDirectoryAuthenticate(db[_0x871c('0x32')],_0x46e0eb,_0x304e97,_0xe3f195);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index bb2309c..3d5f130 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 _0xebe0=['exports','express','./authActiveDirectory.controller','post','login'];(function(_0x9f9b55,_0x39a274){var _0x3b10c4=function(_0x44ebf8){while(--_0x44ebf8){_0x9f9b55['push'](_0x9f9b55['shift']());}};_0x3b10c4(++_0x39a274);}(_0xebe0,0xe7));var _0x0ebe=function(_0x315d14,_0x231788){_0x315d14=_0x315d14-0x0;var _0x479f4f=_0xebe0[_0x315d14];return _0x479f4f;};'use strict';var express=require(_0x0ebe('0x0'));var router=express['Router']();var controller=require(_0x0ebe('0x1'));router[_0x0ebe('0x2')]('/',controller[_0x0ebe('0x3')]);module[_0x0ebe('0x4')]=router;
\ No newline at end of file
+var _0xe6a6=['express','Router','login'];(function(_0x305c31,_0x466b17){var _0x17f39f=function(_0x53ae03){while(--_0x53ae03){_0x305c31['push'](_0x305c31['shift']());}};_0x17f39f(++_0x466b17);}(_0xe6a6,0xde));var _0x6e6a=function(_0x309dd0,_0x526ca1){_0x309dd0=_0x309dd0-0x0;var _0x2bd51b=_0xe6a6[_0x309dd0];return _0x2bd51b;};'use strict';var express=require(_0x6e6a('0x0'));var router=express[_0x6e6a('0x1')]();var controller=require('./authActiveDirectory.controller');router['post']('/',controller[_0x6e6a('0x2')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 78b4c9d..31d3699 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0x7a54,0x106));var _0x47a5=function(_0x30dfaf,_0x19d6bc){_0x30dfaf=_0x30dfaf-0x0;var _0x26c17d=_0x7a54[_0x30dfaf];return _0x26c17d;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _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(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x7a54,0x106));var _0x47a5=function(_0x1c5853,_0x2e90f0){_0x1c5853=_0x1c5853-0x0;var _0x230e42=_0x7a54[_0x1c5853];return _0x230e42;};'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 1aaf2bd..192c636 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 _0x7118=['/callback','callback','isMiddleware','setTokenCookie','exports','Router','./authGoogle.controller','../../components/auth/service','get','login'];(function(_0x286726,_0x20a337){var _0xcd4fe9=function(_0x4d7da6){while(--_0x4d7da6){_0x286726['push'](_0x286726['shift']());}};_0xcd4fe9(++_0x20a337);}(_0x7118,0x159));var _0x8711=function(_0x1e6e52,_0x507b9a){_0x1e6e52=_0x1e6e52-0x0;var _0x216ff8=_0x7118[_0x1e6e52];return _0x216ff8;};'use strict';var express=require('express');var passport=require('passport');var router=express[_0x8711('0x0')]();var controller=require(_0x8711('0x1'));var userController=require('../user/user.controller.js');var authService=require(_0x8711('0x2'));router[_0x8711('0x3')]('/',controller[_0x8711('0x4')]);router[_0x8711('0x3')](_0x8711('0x5'),controller[_0x8711('0x6')],authService[_0x8711('0x7')],userController['login'],authService[_0x8711('0x8')]);module[_0x8711('0x9')]=router;
\ No newline at end of file
+var _0x7dc0=['isMiddleware','login','setTokenCookie','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback','callback'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7dc0,0x18f));var _0x07dc=function(_0x4f34d8,_0x40f022){_0x4f34d8=_0x4f34d8-0x0;var _0xc97536=_0x7dc0[_0x4f34d8];return _0xc97536;};'use strict';var express=require(_0x07dc('0x0'));var passport=require(_0x07dc('0x1'));var router=express[_0x07dc('0x2')]();var controller=require(_0x07dc('0x3'));var userController=require(_0x07dc('0x4'));var authService=require(_0x07dc('0x5'));router[_0x07dc('0x6')]('/',controller['login']);router[_0x07dc('0x6')](_0x07dc('0x7'),controller[_0x07dc('0x8')],authService[_0x07dc('0x9')],userController[_0x07dc('0xa')],authService[_0x07dc('0xb')]);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 9cda3b1..467ab43 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 _0x69cf=['lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','blockDuration','then','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','name','add','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch','MailAccount','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','format','\x22%s\x22\x20<%s>','Smtp','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','Email\x20parameter\x20is\x20missing','generate','body','trim','User','find','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','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','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','use','util','passport','passport-local','Strategy','jayson/promise'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x69cf,0xa3));var _0xf69c=function(_0x2d16d8,_0x295ba2){_0x2d16d8=_0x2d16d8-0x0;var _0x40e2bf=_0x69cf[_0x2d16d8];return _0x40e2bf;};'use strict';var util=require(_0xf69c('0x0'));var passport=require(_0xf69c('0x1'));var LocalStrategy=require(_0xf69c('0x2'))[_0xf69c('0x3')];var jayson=require(_0xf69c('0x4'));var _=require(_0xf69c('0x5'));var rs=require('randomstring');var moment=require(_0xf69c('0x6'));var db=require(_0xf69c('0x7'))['db'];var authService=require(_0xf69c('0x8'));var utils=require(_0xf69c('0x9'));var client=jayson[_0xf69c('0xa')][_0xf69c('0xb')]({'port':0x232b});function localAuthenticate(_0x9afa08,_0x7d12de,_0x401d16,_0x572d57){var _0x33c094,_0x3ebe1f;return db['Setting'][_0xf69c('0xc')]({'where':{'id':0x1},'attributes':[_0xf69c('0xd'),_0xf69c('0xe')],'raw':!![]})[_0xf69c('0xf')](function(_0x35f5d8){_0x33c094=_0x35f5d8;return _0x9afa08[_0xf69c('0xc')]({'attributes':['id','name','password','salt',_0xf69c('0x10'),_0xf69c('0x11'),_0xf69c('0x12'),_0xf69c('0x13'),_0xf69c('0x14')],'where':{'name':_0x7d12de,'role':{'$or':[_0xf69c('0x15'),_0xf69c('0x16'),_0xf69c('0x17')]}}});})[_0xf69c('0xf')](function(_0x23457a){if(!_0x23457a||_0x23457a&&_0x23457a[_0xf69c('0x18')]!==_0x7d12de){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x3ebe1f=_0x23457a;return _0x3ebe1f;}})[_0xf69c('0xf')](function(){_0x3ebe1f['authenticate'](_0x401d16,function(_0x5ed183,_0x48f78c){var _0x1a2a40=_0x3ebe1f[_0xf69c('0x14')]+0x1;if(_0x5ed183){return _0x572d57(_0x5ed183);}else if(!_0x48f78c){if(_0x3ebe1f['disabled']){return _0x572d57(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x33c094[_0xf69c('0xd')]>0x0){if(_0x3ebe1f[_0xf69c('0x12')]){if(_0x33c094['blockDuration']>0x0){if(moment(_0x3ebe1f[_0xf69c('0x13')])[_0xf69c('0x19')](_0x33c094['blockDuration'],_0xf69c('0x1a'))>moment()){return _0x572d57(null,![],{'message':_0xf69c('0x1b')});}else{return utils['clearBlockUser'](_0x3ebe1f,_0x1a2a40,![],null)[_0xf69c('0xf')](function(){return _0x572d57(null,![],{'message':_0xf69c('0x1b')});});}}else{return _0x572d57(null,![],{'message':_0xf69c('0x1b')});}}else{if(_0x1a2a40>=_0x33c094['allowedLoginAttempts']){return utils[_0xf69c('0x1c')](_0x3ebe1f,0x0,!![],moment())['then'](function(){return _0x572d57(null,![],{'message':_0xf69c('0x1b')});});}else{return utils[_0xf69c('0x1c')](_0x3ebe1f,_0x1a2a40,![],null)['then'](function(){return _0x572d57(null,![],{'message':_0xf69c('0x1b')});});}}}else{return _0x572d57(null,![],{'message':_0xf69c('0x1b')});}}else{if(_0x3ebe1f[_0xf69c('0x11')]){return _0x572d57(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x33c094[_0xf69c('0xd')]>0x0){if(_0x3ebe1f[_0xf69c('0x12')]){if(_0x33c094[_0xf69c('0xe')]>0x0){if(moment(_0x3ebe1f[_0xf69c('0x13')])['add'](_0x33c094['blockDuration'],_0xf69c('0x1a'))>moment()){return _0x572d57(null,![],{'message':_0xf69c('0x1b')});}else{return utils[_0xf69c('0x1c')](_0x3ebe1f,0x0,![],null)[_0xf69c('0xf')](function(){return utils['getLicense'](_0x3ebe1f);})['then'](function(){return _0x572d57(null,_0x3ebe1f);});}}else{return _0x572d57(null,![],{'message':_0xf69c('0x1b')});}}else{return utils[_0xf69c('0x1c')](_0x3ebe1f,0x0,![],null)[_0xf69c('0xf')](function(){return utils[_0xf69c('0x1d')](_0x3ebe1f);})[_0xf69c('0xf')](function(){return _0x572d57(null,_0x3ebe1f);})[_0xf69c('0x1e')](function(_0x48d511){return _0x572d57(null,![],_0x48d511);});}}else{if(_0x3ebe1f[_0xf69c('0x12')]){return _0x572d57(null,![],{'message':_0xf69c('0x1b')});}else{return utils['getLicense'](_0x3ebe1f)['then'](function(){return _0x572d57(null,_0x3ebe1f);});}}}});})[_0xf69c('0x1e')](function(_0x483474){return _0x572d57(null,![],_0x483474);});}function sendServiceMail(_0x4b094d){return db[_0xf69c('0x1f')]['find']({'where':{'service':!![]},'attributes':['id',_0xf69c('0x18'),_0xf69c('0x20')],'include':[{'model':db[_0xf69c('0x21')],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':_0xf69c('0x22')}]}]})['then'](function(_0x854726){if(!_0x854726){throw new Error(_0xf69c('0x23'));}var _0x178451=_0x854726['getSmtpOptions']();var _0x2fad15={'account':_0x178451,'message':_['merge']({'from':util[_0xf69c('0x24')](_0xf69c('0x25'),_0x854726[_0xf69c('0x18')],_0x854726[_0xf69c('0x20')]||_0x854726[_0xf69c('0x26')][_0xf69c('0x16')])},_0x4b094d)};return client[_0xf69c('0x27')](_0xf69c('0x28'),_0x2fad15);})[_0xf69c('0xf')](function(_0x1064ca){if(_0x1064ca[_0xf69c('0x29')]){throw new Error(util[_0xf69c('0x24')](_0xf69c('0x2a'),_0x1064ca[_0xf69c('0x29')][_0xf69c('0x2b')]||JSON[_0xf69c('0x2c')](_0x1064ca[_0xf69c('0x29')])));}return!![];});}function handleError(_0x8b7fc9,_0x3413b6,_0x1378fa){return _0x8b7fc9[_0xf69c('0x2d')](_0x3413b6||0x1f4)[_0xf69c('0x2e')]({'message':_0x1378fa?_0x1378fa['message']||_0x1378fa:''});}exports[_0xf69c('0x2f')]=function(_0x5722e4,_0x41f80f,_0x185116){passport[_0xf69c('0x30')](_0xf69c('0x31'),function(_0x46e307,_0x155d83,_0x32875){var _0x374b9c=_0x46e307||_0x32875;if(_0x374b9c){return handleError(_0x41f80f,0x191,_0x374b9c);}if(!_0x155d83){return handleError(_0x41f80f,0x194,{'message':_0xf69c('0x32')});}else{var _0x54cd81={'payload':{'id':_0x155d83['id'],'role':_0x155d83[_0xf69c('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0xf69c('0x33')](_0x54cd81)[_0xf69c('0xf')](function(_0x38080c){_0x41f80f[_0xf69c('0x34')]({'id':_0x155d83['id'],'token':_0x38080c,'statusCall':'','isAlreadyLogged':_0x155d83[_0xf69c('0x35')]});});}})(_0x5722e4,_0x41f80f,_0x185116);};exports['forgot']=function(_0x2c8d08,_0x2e9462){if(!_0x2c8d08['body'][_0xf69c('0x20')]){return handleError(_0x2e9462,0x1f4,{'message':_0xf69c('0x36')});}var _0x2ce82d=rs[_0xf69c('0x37')]();_0x2c8d08[_0xf69c('0x38')][_0xf69c('0x20')]=_0x2c8d08[_0xf69c('0x38')]['email'][_0xf69c('0x39')]()['toLowerCase']();var _0x441c52;return db['Setting'][_0xf69c('0xc')]({'where':{'id':0x1},'attributes':[_0xf69c('0xd'),'blockDuration'],'raw':!![]})['then'](function(_0x3d7572){_0x441c52=_0x3d7572;return db[_0xf69c('0x3a')][_0xf69c('0x3b')]({'where':{'email':_0x2c8d08['body'][_0xf69c('0x20')]}});})[_0xf69c('0xf')](function(_0x1f4971){if(!_0x1f4971){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x1f4971[_0xf69c('0x11')]){throw new Error(_0xf69c('0x3c'));}if(_0x1f4971['blocked']){if(moment(_0x1f4971[_0xf69c('0x13')])[_0xf69c('0x19')](_0x441c52[_0xf69c('0xe')],_0xf69c('0x1a'))>moment()){throw new Error(_0xf69c('0x3d'));}else{_0x1f4971[_0xf69c('0x12')]=![];_0x1f4971[_0xf69c('0x13')]=null;}}_0x1f4971['resetPasswordToken']=_0x2ce82d;_0x1f4971[_0xf69c('0x3e')]=Date[_0xf69c('0x3f')]()+0x36ee80;return _0x1f4971['save']();})[_0xf69c('0xf')](function(){return sendServiceMail({'to':_0x2c8d08[_0xf69c('0x38')][_0xf69c('0x20')],'subject':_0xf69c('0x40'),'text':_0xf69c('0x41')+_0xf69c('0x42')+_0xf69c('0x43')+_0x2c8d08[_0xf69c('0x44')][_0xf69c('0x45')]+_0xf69c('0x46')+_0x2ce82d+'\x0a\x0a'+_0xf69c('0x47')});})[_0xf69c('0xf')](function(){_0x2e9462[_0xf69c('0x2d')](0xc8)[_0xf69c('0x2e')]({'message':_0xf69c('0x48')});})['catch'](function(_0x4c1428){return handleError(_0x2e9462,0x1f4,_0x4c1428);});};exports[_0xf69c('0x49')]=function(_0x187ce9,_0x458442){return db[_0xf69c('0x3a')][_0xf69c('0x3b')]({'where':{'resetPasswordToken':_0x187ce9[_0xf69c('0x4a')][_0xf69c('0x4b')],'resetPasswordExpires':{'$gt':Date[_0xf69c('0x3f')]()}}})[_0xf69c('0xf')](function(_0x549a79){if(!_0x549a79){throw new Error(_0xf69c('0x4c'));}return db['Setting'][_0xf69c('0xc')]({'attributes':['id',_0xf69c('0x4d'),_0xf69c('0x4e'),_0xf69c('0x4f')]})['then'](function(_0x52f200){if(_0x52f200[_0xf69c('0x4d')])authService[_0xf69c('0x50')](_0x187ce9[_0xf69c('0x38')][_0xf69c('0x51')]);if(!_0x52f200['enforcePasswordHistory']||!_0x549a79[_0xf69c('0x52')])return _0x549a79;authService['validatePasswordHistory'](_0x187ce9[_0xf69c('0x38')][_0xf69c('0x51')],_0x549a79[_0xf69c('0x52')],_0x52f200[_0xf69c('0x4f')]);return _0x549a79;})['then'](function(){_0x549a79[_0xf69c('0x51')]=_0x187ce9[_0xf69c('0x38')]['password'];_0x549a79['resetPasswordToken']=null;_0x549a79[_0xf69c('0x3e')]=null;return _0x549a79['save']();});})[_0xf69c('0xf')](function(){_0x458442['status'](0xc8)['send']({'message':'Password\x20reset!'});})[_0xf69c('0x1e')](function(_0xa22e1e){return handleError(_0x458442,0x1f4,_0xa22e1e);});};passport[_0xf69c('0x53')](_0xf69c('0x31'),new LocalStrategy({'usernameField':_0xf69c('0x18'),'passwordField':_0xf69c('0x51')},function(_0xcdb718,_0x5a67ee,_0x1ea916){return localAuthenticate(db[_0xf69c('0x3a')],_0xcdb718,_0x5a67ee,_0x1ea916);}));
\ No newline at end of file
+var _0x85e8=['online','forgot','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','User','params','securePassword','passwordHistoryLimit','validatePasswordPattern','password','enforcePasswordHistory','previousPasswords','Password\x20reset!','use','util','passport','passport-local','jayson/promise','lodash','moment','../../components/auth/service','../../config/utils','client','Setting','findOne','allowedLoginAttempts','blockDuration','name','salt','blocked','blockedAt','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','then','authenticate','disabled','add','clearBlockUser','minutes','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','error','status','send','message','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role'];(function(_0x5ad0d7,_0x2645f8){var _0xd83bd=function(_0x33d3bd){while(--_0x33d3bd){_0x5ad0d7['push'](_0x5ad0d7['shift']());}};_0xd83bd(++_0x2645f8);}(_0x85e8,0xc9));var _0x885e=function(_0x459291,_0xd93796){_0x459291=_0x459291-0x0;var _0x4c4848=_0x85e8[_0x459291];return _0x4c4848;};'use strict';var util=require(_0x885e('0x0'));var passport=require(_0x885e('0x1'));var LocalStrategy=require(_0x885e('0x2'))['Strategy'];var jayson=require(_0x885e('0x3'));var _=require(_0x885e('0x4'));var rs=require('randomstring');var moment=require(_0x885e('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x885e('0x6'));var utils=require(_0x885e('0x7'));var client=jayson[_0x885e('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x446f60,_0x2cfbf9,_0x4d164b,_0x2d3214){var _0x452846,_0x1b7292;return db[_0x885e('0x9')][_0x885e('0xa')]({'where':{'id':0x1},'attributes':[_0x885e('0xb'),_0x885e('0xc')],'raw':!![]})['then'](function(_0x28054c){_0x452846=_0x28054c;return _0x446f60[_0x885e('0xa')]({'attributes':['id',_0x885e('0xd'),'password',_0x885e('0xe'),'role','disabled',_0x885e('0xf'),_0x885e('0x10'),'loginAttempts'],'where':{'name':_0x2cfbf9,'role':{'$or':[_0x885e('0x11'),_0x885e('0x12'),_0x885e('0x13')]}}});})['then'](function(_0x498633){if(!_0x498633||_0x498633&&_0x498633[_0x885e('0xd')]!==_0x2cfbf9){throw new Error(_0x885e('0x14'));}else{_0x1b7292=_0x498633;return _0x1b7292;}})[_0x885e('0x15')](function(){_0x1b7292[_0x885e('0x16')](_0x4d164b,function(_0x44e453,_0x2b3d06){var _0x57fec0=_0x1b7292['loginAttempts']+0x1;if(_0x44e453){return _0x2d3214(_0x44e453);}else if(!_0x2b3d06){if(_0x1b7292[_0x885e('0x17')]){return _0x2d3214(null,![],{'message':_0x885e('0x14')});}else if(_0x452846['allowedLoginAttempts']>0x0){if(_0x1b7292['blocked']){if(_0x452846['blockDuration']>0x0){if(moment(_0x1b7292[_0x885e('0x10')])[_0x885e('0x18')](_0x452846[_0x885e('0xc')],'minutes')>moment()){return _0x2d3214(null,![],{'message':_0x885e('0x14')});}else{return utils[_0x885e('0x19')](_0x1b7292,_0x57fec0,![],null)[_0x885e('0x15')](function(){return _0x2d3214(null,![],{'message':_0x885e('0x14')});});}}else{return _0x2d3214(null,![],{'message':_0x885e('0x14')});}}else{if(_0x57fec0>=_0x452846[_0x885e('0xb')]){return utils['clearBlockUser'](_0x1b7292,0x0,!![],moment())['then'](function(){return _0x2d3214(null,![],{'message':_0x885e('0x14')});});}else{return utils[_0x885e('0x19')](_0x1b7292,_0x57fec0,![],null)[_0x885e('0x15')](function(){return _0x2d3214(null,![],{'message':_0x885e('0x14')});});}}}else{return _0x2d3214(null,![],{'message':_0x885e('0x14')});}}else{if(_0x1b7292[_0x885e('0x17')]){return _0x2d3214(null,![],{'message':_0x885e('0x14')});}else if(_0x452846[_0x885e('0xb')]>0x0){if(_0x1b7292[_0x885e('0xf')]){if(_0x452846['blockDuration']>0x0){if(moment(_0x1b7292[_0x885e('0x10')])[_0x885e('0x18')](_0x452846[_0x885e('0xc')],_0x885e('0x1a'))>moment()){return _0x2d3214(null,![],{'message':_0x885e('0x14')});}else{return utils[_0x885e('0x19')](_0x1b7292,0x0,![],null)[_0x885e('0x15')](function(){return utils[_0x885e('0x1b')](_0x1b7292);})['then'](function(){return _0x2d3214(null,_0x1b7292);});}}else{return _0x2d3214(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x885e('0x19')](_0x1b7292,0x0,![],null)[_0x885e('0x15')](function(){return utils[_0x885e('0x1b')](_0x1b7292);})[_0x885e('0x15')](function(){return _0x2d3214(null,_0x1b7292);})[_0x885e('0x1c')](function(_0xad249){return _0x2d3214(null,![],_0xad249);});}}else{if(_0x1b7292[_0x885e('0xf')]){return _0x2d3214(null,![],{'message':_0x885e('0x14')});}else{return utils['getLicense'](_0x1b7292)[_0x885e('0x15')](function(){return _0x2d3214(null,_0x1b7292);});}}}});})[_0x885e('0x1c')](function(_0x53f5ce){return _0x2d3214(null,![],_0x53f5ce);});}function sendServiceMail(_0x3e48bb){return db[_0x885e('0x1d')][_0x885e('0x1e')]({'where':{'service':!![]},'attributes':['id','name',_0x885e('0x1f')],'include':[{'model':db[_0x885e('0x20')],'as':_0x885e('0x21'),'include':[{'model':db[_0x885e('0x22')],'as':'CloudProvider'}]}]})[_0x885e('0x15')](function(_0x733215){if(!_0x733215){throw new Error(_0x885e('0x23'));}var _0x45cf2d=_0x733215[_0x885e('0x24')]();var _0x2d332d={'account':_0x45cf2d,'message':_[_0x885e('0x25')]({'from':util[_0x885e('0x26')](_0x885e('0x27'),_0x733215[_0x885e('0xd')],_0x733215[_0x885e('0x1f')]||_0x733215[_0x885e('0x21')][_0x885e('0x12')])},_0x3e48bb)};return client[_0x885e('0x28')]('SendMail',_0x2d332d);})['then'](function(_0x2ad361){if(_0x2ad361['error']){throw new Error(util['format'](_0x885e('0x29'),_0x2ad361['error']['message']||JSON[_0x885e('0x2a')](_0x2ad361[_0x885e('0x2b')])));}return!![];});}function handleError(_0x216e00,_0x17b52a,_0x18ad5a){return _0x216e00[_0x885e('0x2c')](_0x17b52a||0x1f4)[_0x885e('0x2d')]({'message':_0x18ad5a?_0x18ad5a[_0x885e('0x2e')]||_0x18ad5a:''});}exports[_0x885e('0x2f')]=function(_0x55c215,_0x135c4f,_0x3acc03){passport['authenticate'](_0x885e('0x30'),function(_0x3e35ae,_0x69a314,_0x4baf56){var _0x2c59d7=_0x3e35ae||_0x4baf56;if(_0x2c59d7){return handleError(_0x135c4f,0x191,_0x2c59d7);}if(!_0x69a314){return handleError(_0x135c4f,0x194,{'message':_0x885e('0x31')});}else{var _0xc66427={'payload':{'id':_0x69a314['id'],'role':_0x69a314[_0x885e('0x32')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0xc66427)[_0x885e('0x15')](function(_0x165e61){_0x135c4f['json']({'id':_0x69a314['id'],'token':_0x165e61,'statusCall':'','isAlreadyLogged':_0x69a314[_0x885e('0x33')]});});}})(_0x55c215,_0x135c4f,_0x3acc03);};exports[_0x885e('0x34')]=function(_0x27e135,_0x11f308){if(!_0x27e135[_0x885e('0x35')][_0x885e('0x1f')]){return handleError(_0x11f308,0x1f4,{'message':_0x885e('0x36')});}var _0x47d343=rs['generate']();_0x27e135[_0x885e('0x35')]['email']=_0x27e135[_0x885e('0x35')][_0x885e('0x1f')][_0x885e('0x37')]()[_0x885e('0x38')]();var _0x29d381;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x885e('0xb'),_0x885e('0xc')],'raw':!![]})['then'](function(_0x2a5e3b){_0x29d381=_0x2a5e3b;return db['User'][_0x885e('0x1e')]({'where':{'email':_0x27e135['body'][_0x885e('0x1f')]}});})[_0x885e('0x15')](function(_0x515eb8){if(!_0x515eb8){throw new Error(_0x885e('0x39'));}if(_0x515eb8['disabled']){throw new Error(_0x885e('0x3a'));}if(_0x515eb8[_0x885e('0xf')]){if(moment(_0x515eb8[_0x885e('0x10')])[_0x885e('0x18')](_0x29d381['blockDuration'],_0x885e('0x1a'))>moment()){throw new Error(_0x885e('0x3b'));}else{_0x515eb8['blocked']=![];_0x515eb8[_0x885e('0x10')]=null;}}_0x515eb8[_0x885e('0x3c')]=_0x47d343;_0x515eb8[_0x885e('0x3d')]=Date[_0x885e('0x3e')]()+0x36ee80;return _0x515eb8[_0x885e('0x3f')]();})['then'](function(){return sendServiceMail({'to':_0x27e135[_0x885e('0x35')][_0x885e('0x1f')],'subject':_0x885e('0x40'),'text':_0x885e('0x41')+_0x885e('0x42')+_0x885e('0x43')+_0x27e135[_0x885e('0x44')][_0x885e('0x45')]+_0x885e('0x46')+_0x47d343+'\x0a\x0a'+_0x885e('0x47')});})[_0x885e('0x15')](function(){_0x11f308[_0x885e('0x2c')](0xc8)[_0x885e('0x2d')]({'message':_0x885e('0x48')});})['catch'](function(_0x1ee43f){return handleError(_0x11f308,0x1f4,_0x1ee43f);});};exports[_0x885e('0x49')]=function(_0x539cf5,_0x56fbc5){return db[_0x885e('0x4a')][_0x885e('0x1e')]({'where':{'resetPasswordToken':_0x539cf5[_0x885e('0x4b')]['token'],'resetPasswordExpires':{'$gt':Date[_0x885e('0x3e')]()}}})[_0x885e('0x15')](function(_0x5a9343){if(!_0x5a9343){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x885e('0x9')][_0x885e('0xa')]({'attributes':['id',_0x885e('0x4c'),'enforcePasswordHistory',_0x885e('0x4d')]})[_0x885e('0x15')](function(_0x10ec50){if(_0x10ec50[_0x885e('0x4c')])authService[_0x885e('0x4e')](_0x539cf5['body'][_0x885e('0x4f')]);if(!_0x10ec50[_0x885e('0x50')]||!_0x5a9343[_0x885e('0x51')])return _0x5a9343;authService['validatePasswordHistory'](_0x539cf5[_0x885e('0x35')][_0x885e('0x4f')],_0x5a9343['previousPasswords'],_0x10ec50[_0x885e('0x4d')]);return _0x5a9343;})[_0x885e('0x15')](function(){_0x5a9343[_0x885e('0x4f')]=_0x539cf5[_0x885e('0x35')][_0x885e('0x4f')];_0x5a9343[_0x885e('0x3c')]=null;_0x5a9343[_0x885e('0x3d')]=null;return _0x5a9343['save']();});})[_0x885e('0x15')](function(){_0x56fbc5[_0x885e('0x2c')](0xc8)[_0x885e('0x2d')]({'message':_0x885e('0x52')});})[_0x885e('0x1c')](function(_0x27768e){return handleError(_0x56fbc5,0x1f4,_0x27768e);});};passport[_0x885e('0x53')](_0x885e('0x30'),new LocalStrategy({'usernameField':_0x885e('0xd'),'passwordField':_0x885e('0x4f')},function(_0x378122,_0x19d2ca,_0x24400c){return localAuthenticate(db[_0x885e('0x4a')],_0x378122,_0x19d2ca,_0x24400c);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index abc8568..f319f01 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 _0x603b=['./authLocal.controller','post','login','/forgot','forgot','/reset/:token','reset','exports','Router'];(function(_0x1d64d2,_0x1219df){var _0x3ed909=function(_0x11fb58){while(--_0x11fb58){_0x1d64d2['push'](_0x1d64d2['shift']());}};_0x3ed909(++_0x1219df);}(_0x603b,0xbc));var _0xb603=function(_0x2da020,_0x3db0ec){_0x2da020=_0x2da020-0x0;var _0x368846=_0x603b[_0x2da020];return _0x368846;};'use strict';var express=require('express');var router=express[_0xb603('0x0')]();var controller=require(_0xb603('0x1'));router[_0xb603('0x2')]('/',controller[_0xb603('0x3')]);router[_0xb603('0x2')](_0xb603('0x4'),controller[_0xb603('0x5')]);router['post'](_0xb603('0x6'),controller[_0xb603('0x7')]);module[_0xb603('0x8')]=router;
\ No newline at end of file
+var _0xb403=['login','forgot','/reset/:token','reset','exports','express','Router','post'];(function(_0x129e08,_0x1dedbd){var _0x311f9e=function(_0x380bc8){while(--_0x380bc8){_0x129e08['push'](_0x129e08['shift']());}};_0x311f9e(++_0x1dedbd);}(_0xb403,0x11d));var _0x3b40=function(_0x226879,_0x30a56b){_0x226879=_0x226879-0x0;var _0x20964c=_0xb403[_0x226879];return _0x20964c;};'use strict';var express=require(_0x3b40('0x0'));var router=express[_0x3b40('0x1')]();var controller=require('./authLocal.controller');router[_0x3b40('0x2')]('/',controller[_0x3b40('0x3')]);router['post']('/forgot',controller[_0x3b40('0x4')]);router[_0x3b40('0x2')](_0x3b40('0x5'),controller[_0x3b40('0x6')]);module[_0x3b40('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 0ea2800..4e6ca6d 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 _0x98a9=['exports','STRING','BOOLEAN','INTEGER'];(function(_0x26d386,_0x1660c0){var _0x4ef9a8=function(_0x55e2d3){while(--_0x55e2d3){_0x26d386['push'](_0x26d386['shift']());}};_0x4ef9a8(++_0x1660c0);}(_0x98a9,0x180));var _0x998a=function(_0x348310,_0x462221){_0x348310=_0x348310-0x0;var _0x5122b6=_0x98a9[_0x348310];return _0x5122b6;};'use strict';var Sequelize=require('sequelize');module[_0x998a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x998a('0x1')]},'description':{'type':Sequelize[_0x998a('0x1')]},'status':{'type':Sequelize[_0x998a('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x998a('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xcfc8=['exports','STRING','INTEGER','sequelize'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xcfc8,0x147));var _0x8cfc=function(_0x1c9772,_0x43bf82){_0x1c9772=_0x1c9772-0x0;var _0x5b8409=_0xcfc8[_0x1c9772];return _0x5b8409;};'use strict';var Sequelize=require(_0x8cfc('0x0'));module[_0x8cfc('0x1')]={'name':{'type':Sequelize[_0x8cfc('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x8cfc('0x2')]},'description':{'type':Sequelize[_0x8cfc('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x8cfc('0x3')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 323de06..91751b2 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 _0x663a=['status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','Automation','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','catch','show','length','include','find','create','body','params','destroy','addConditions','Condition','ids','omit','findOne','getConditions','addActions','Action','getActions','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x5806c3,_0x5105d8){var _0x48ac77=function(_0x4826ec){while(--_0x4826ec){_0x5806c3['push'](_0x5806c3['shift']());}};_0x48ac77(++_0x5105d8);}(_0x663a,0x92));var _0xa663=function(_0x4286d3,_0x5e133f){_0x4286d3=_0x4286d3-0x0;var _0x41e58d=_0x663a[_0x4286d3];return _0x41e58d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa663('0x0'));var zipdir=require(_0xa663('0x1'));var jsonpatch=require(_0xa663('0x2'));var rp=require(_0xa663('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa663('0x4'));var util=require(_0xa663('0x5'));var path=require('path');var sox=require(_0xa663('0x6'));var csv=require(_0xa663('0x7'));var ejs=require(_0xa663('0x8'));var fs=require('fs');var fs_extra=require(_0xa663('0x9'));var _=require(_0xa663('0xa'));var squel=require(_0xa663('0xb'));var crypto=require(_0xa663('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa663('0xd'));var toCsv=require(_0xa663('0x7'));var querystring=require('querystring');var Papa=require(_0xa663('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa663('0xf'));var as=require(_0xa663('0x10'));var hardwareService=require(_0xa663('0x11'));var logger=require(_0xa663('0x12'))(_0xa663('0x13'));var utils=require('../../config/utils');var config=require(_0xa663('0x14'));var licenseUtil=require(_0xa663('0x15'));var db=require(_0xa663('0x16'))['db'];function respondWithStatusCode(_0x89c467,_0x3c106f){_0x3c106f=_0x3c106f||0xcc;return function(_0x5ab340){if(_0x5ab340){return _0x89c467[_0xa663('0x17')](_0x3c106f);}return _0x89c467[_0xa663('0x18')](_0x3c106f)['end']();};}function respondWithResult(_0x20cfab,_0x185e60){_0x185e60=_0x185e60||0xc8;return function(_0x2ea37e){if(_0x2ea37e){return _0x20cfab[_0xa663('0x18')](_0x185e60)[_0xa663('0x19')](_0x2ea37e);}};}function respondWithFilteredResult(_0x22c44b,_0x3e05cf){return function(_0x3e8d3e){if(_0x3e8d3e){var _0x4a030f=typeof _0x3e05cf[_0xa663('0x1a')]===_0xa663('0x1b')&&typeof _0x3e05cf[_0xa663('0x1c')]===_0xa663('0x1b');var _0x1a08a6=_0x3e8d3e[_0xa663('0x1d')];var _0x4df8ae=_0x4a030f?0x0:_0x3e05cf[_0xa663('0x1a')];var _0xe121cd=_0x4a030f?_0x3e8d3e[_0xa663('0x1d')]:_0x3e05cf['offset']+_0x3e05cf[_0xa663('0x1c')];var _0x4da88c;if(_0xe121cd>=_0x1a08a6){_0xe121cd=_0x1a08a6;_0x4da88c=0xc8;}else{_0x4da88c=0xce;}_0x22c44b[_0xa663('0x18')](_0x4da88c);return _0x22c44b[_0xa663('0x1e')](_0xa663('0x1f'),_0x4df8ae+'-'+_0xe121cd+'/'+_0x1a08a6)[_0xa663('0x19')](_0x3e8d3e);}return null;};}function patchUpdates(_0x3d8dfd){return function(_0x5c8d02){try{jsonpatch[_0xa663('0x20')](_0x5c8d02,_0x3d8dfd,!![]);}catch(_0x5ed504){return BPromise[_0xa663('0x21')](_0x5ed504);}return _0x5c8d02[_0xa663('0x22')]();};}function saveUpdates(_0x87d01a,_0x14f38d){return function(_0x168128){if(_0x168128){return _0x168128[_0xa663('0x23')](_0x87d01a)[_0xa663('0x24')](function(_0x950813){return _0x950813;});}return null;};}function removeEntity(_0x456a61,_0x4cfe91){return function(_0x18590e){if(_0x18590e){return _0x18590e['destroy']()[_0xa663('0x24')](function(){_0x456a61['status'](0xcc)[_0xa663('0x25')]();});}};}function handleEntityNotFound(_0x23ac51,_0x4b693e){return function(_0x42b66b){if(!_0x42b66b){_0x23ac51[_0xa663('0x17')](0x194);}return _0x42b66b;};}function handleError(_0x5a3349,_0x3ffce0){_0x3ffce0=_0x3ffce0||0x1f4;return function(_0x538991){logger[_0xa663('0x26')](_0x538991[_0xa663('0x27')]);if(_0x538991[_0xa663('0x28')]){delete _0x538991[_0xa663('0x28')];}_0x5a3349[_0xa663('0x18')](_0x3ffce0)[_0xa663('0x29')](_0x538991);};}exports[_0xa663('0x2a')]=function(_0x43ad88,_0x40174c){var _0x2ccead={},_0x278559={},_0x66ae71={'count':0x0,'rows':[]};var _0xe846d9=_['map'](db[_0xa663('0x2b')][_0xa663('0x2c')],function(_0x4d512f){return{'name':_0x4d512f[_0xa663('0x2d')],'type':_0x4d512f[_0xa663('0x2e')][_0xa663('0x2f')]};});_0x278559['model']=_[_0xa663('0x30')](_0xe846d9,_0xa663('0x28'));_0x278559[_0xa663('0x31')]=_[_0xa663('0x32')](_0x43ad88[_0xa663('0x31')]);_0x278559[_0xa663('0x33')]=_['intersection'](_0x278559[_0xa663('0x34')],_0x278559[_0xa663('0x31')]);_0x2ccead[_0xa663('0x35')]=_[_0xa663('0x36')](_0x278559[_0xa663('0x34')],qs[_0xa663('0x37')](_0x43ad88[_0xa663('0x31')][_0xa663('0x37')]));_0x2ccead['attributes']=_0x2ccead['attributes']['length']?_0x2ccead[_0xa663('0x35')]:_0x278559[_0xa663('0x34')];if(!_0x43ad88['query'][_0xa663('0x38')](_0xa663('0x39'))){_0x2ccead[_0xa663('0x1c')]=qs[_0xa663('0x1c')](_0x43ad88[_0xa663('0x31')][_0xa663('0x1c')]);_0x2ccead['offset']=qs[_0xa663('0x1a')](_0x43ad88[_0xa663('0x31')]['offset']);}_0x2ccead[_0xa663('0x3a')]=qs['sort'](_0x43ad88[_0xa663('0x31')][_0xa663('0x3b')]);_0x2ccead[_0xa663('0x3c')]=qs['filters'](_[_0xa663('0x3d')](_0x43ad88[_0xa663('0x31')],_0x278559[_0xa663('0x33')]),_0xe846d9);if(_0x43ad88[_0xa663('0x31')][_0xa663('0x3e')]){_0x2ccead[_0xa663('0x3c')]=_[_0xa663('0x3f')](_0x2ccead[_0xa663('0x3c')],{'$or':_['map'](_0xe846d9,function(_0x636305){if(_0x636305[_0xa663('0x2e')]!==_0xa663('0x40')){var _0x196df2={};_0x196df2[_0x636305['name']]={'$like':'%'+_0x43ad88[_0xa663('0x31')][_0xa663('0x3e')]+'%'};return _0x196df2;}})});}_0x2ccead=_[_0xa663('0x3f')]({},_0x2ccead,_0x43ad88[_0xa663('0x41')]);var _0x4c0941={'where':_0x2ccead['where']};return db[_0xa663('0x2b')]['count'](_0x4c0941)[_0xa663('0x24')](function(_0x52e917){_0x66ae71['count']=_0x52e917;if(_0x43ad88[_0xa663('0x31')][_0xa663('0x42')]){_0x2ccead['include']=[{'all':!![]}];}return db[_0xa663('0x2b')]['findAll'](_0x2ccead);})['then'](function(_0x28a528){_0x66ae71['rows']=_0x28a528;return _0x66ae71;})[_0xa663('0x24')](respondWithFilteredResult(_0x40174c,_0x2ccead))[_0xa663('0x43')](handleError(_0x40174c,null));};exports[_0xa663('0x44')]=function(_0x36b759,_0xd656d7){var _0x5f21b4={'raw':![],'where':{'id':_0x36b759['params']['id']}},_0x412ff7={};_0x412ff7['model']=_['keys'](db[_0xa663('0x2b')]['rawAttributes']);_0x412ff7[_0xa663('0x31')]=_[_0xa663('0x32')](_0x36b759[_0xa663('0x31')]);_0x412ff7[_0xa663('0x33')]=_[_0xa663('0x36')](_0x412ff7['model'],_0x412ff7[_0xa663('0x31')]);_0x5f21b4[_0xa663('0x35')]=_[_0xa663('0x36')](_0x412ff7[_0xa663('0x34')],qs[_0xa663('0x37')](_0x36b759[_0xa663('0x31')][_0xa663('0x37')]));_0x5f21b4['attributes']=_0x5f21b4[_0xa663('0x35')][_0xa663('0x45')]?_0x5f21b4[_0xa663('0x35')]:_0x412ff7['model'];if(_0x36b759['query'][_0xa663('0x42')]){_0x5f21b4[_0xa663('0x46')]=[{'all':!![]}];}_0x5f21b4=_[_0xa663('0x3f')]({},_0x5f21b4,_0x36b759['options']);return db['Automation'][_0xa663('0x47')](_0x5f21b4)[_0xa663('0x24')](handleEntityNotFound(_0xd656d7,null))['then'](respondWithResult(_0xd656d7,null))[_0xa663('0x43')](handleError(_0xd656d7,null));};exports[_0xa663('0x48')]=function(_0x507eb1,_0x7dada6){return db[_0xa663('0x2b')][_0xa663('0x48')](_0x507eb1['body'],{})[_0xa663('0x24')](respondWithResult(_0x7dada6,0xc9))[_0xa663('0x43')](handleError(_0x7dada6,null));};exports[_0xa663('0x23')]=function(_0x317996,_0x3085ed){if(_0x317996[_0xa663('0x49')]['id']){delete _0x317996['body']['id'];}return db[_0xa663('0x2b')][_0xa663('0x47')]({'where':{'id':_0x317996[_0xa663('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3085ed,null))['then'](saveUpdates(_0x317996['body'],null))[_0xa663('0x24')](respondWithResult(_0x3085ed,null))[_0xa663('0x43')](handleError(_0x3085ed,null));};exports[_0xa663('0x4b')]=function(_0x15ccc0,_0x5e8f6a){return db['Automation'][_0xa663('0x47')]({'where':{'id':_0x15ccc0['params']['id']}})[_0xa663('0x24')](handleEntityNotFound(_0x5e8f6a,null))[_0xa663('0x24')](removeEntity(_0x5e8f6a,null))[_0xa663('0x43')](handleError(_0x5e8f6a,null));};exports[_0xa663('0x4c')]=function(_0x3e8b5a,_0x580ce8,_0x4381f0){return db[_0xa663('0x4d')]['find']({'where':{'id':_0x3e8b5a[_0xa663('0x4a')]['id']}})[_0xa663('0x24')](handleEntityNotFound(_0x580ce8,null))[_0xa663('0x24')](function(_0x37f938){if(_0x37f938){return _0x37f938['addConditions'](_0x3e8b5a['body'][_0xa663('0x4e')],_[_0xa663('0x4f')](_0x3e8b5a[_0xa663('0x49')],['ids','id'])||{});}})['then'](respondWithResult(_0x580ce8,null))[_0xa663('0x43')](handleError(_0x580ce8,null));};exports['getConditions']=function(_0x4362ec,_0x56ee73,_0x542bdd){var _0x7029d0={};var _0x436430={};var _0x40c214;var _0x230626;return db[_0xa663('0x2b')][_0xa663('0x50')]({'where':{'id':_0x4362ec[_0xa663('0x4a')]['id']}})['then'](handleEntityNotFound(_0x56ee73,null))[_0xa663('0x24')](function(_0x235c90){if(_0x235c90){_0x40c214=_0x235c90;_0x436430[_0xa663('0x34')]=_[_0xa663('0x32')](db['Condition'][_0xa663('0x2c')]);_0x436430[_0xa663('0x31')]=_[_0xa663('0x32')](_0x4362ec[_0xa663('0x31')]);_0x436430[_0xa663('0x33')]=_[_0xa663('0x36')](_0x436430[_0xa663('0x34')],_0x436430['query']);_0x7029d0['attributes']=_[_0xa663('0x36')](_0x436430[_0xa663('0x34')],qs[_0xa663('0x37')](_0x4362ec['query'][_0xa663('0x37')]));_0x7029d0[_0xa663('0x35')]=_0x7029d0[_0xa663('0x35')][_0xa663('0x45')]?_0x7029d0['attributes']:_0x436430[_0xa663('0x34')];_0x7029d0[_0xa663('0x3a')]=qs[_0xa663('0x3b')](_0x4362ec[_0xa663('0x31')][_0xa663('0x3b')]);_0x7029d0['where']=qs[_0xa663('0x33')](_[_0xa663('0x3d')](_0x4362ec['query'],_0x436430[_0xa663('0x33')]));if(_0x4362ec[_0xa663('0x31')]['filter']){_0x7029d0[_0xa663('0x3c')]=_['merge'](_0x7029d0[_0xa663('0x3c')],{'$or':_[_0xa663('0x30')](_0x7029d0['attributes'],function(_0x404b3d){var _0x953b3c={};_0x953b3c[_0x404b3d]={'$like':'%'+_0x4362ec[_0xa663('0x31')]['filter']+'%'};return _0x953b3c;})});}_0x7029d0=_['merge']({},_0x7029d0,_0x4362ec[_0xa663('0x41')]);return _0x40c214[_0xa663('0x51')](_0x7029d0);}})[_0xa663('0x24')](function(_0x168f31){if(_0x168f31){_0x230626=_0x168f31['length'];if(!_0x4362ec['query'][_0xa663('0x38')](_0xa663('0x39'))){_0x7029d0[_0xa663('0x1c')]=qs['limit'](_0x4362ec[_0xa663('0x31')]['limit']);_0x7029d0[_0xa663('0x1a')]=qs[_0xa663('0x1a')](_0x4362ec[_0xa663('0x31')][_0xa663('0x1a')]);}return _0x40c214[_0xa663('0x51')](_0x7029d0);}})['then'](function(_0x3ec1db){if(_0x3ec1db){return _0x3ec1db?{'count':_0x230626,'rows':_0x3ec1db}:null;}})[_0xa663('0x24')](respondWithResult(_0x56ee73,null))['catch'](handleError(_0x56ee73,null));};exports[_0xa663('0x52')]=function(_0x20c340,_0x410140,_0x282c13){return db[_0xa663('0x53')][_0xa663('0x47')]({'where':{'id':_0x20c340[_0xa663('0x4a')]['id']}})['then'](handleEntityNotFound(_0x410140,null))[_0xa663('0x24')](function(_0x2109eb){if(_0x2109eb){return _0x2109eb[_0xa663('0x52')](_0x20c340[_0xa663('0x49')]['ids'],_[_0xa663('0x4f')](_0x20c340[_0xa663('0x49')],[_0xa663('0x4e'),'id'])||{});}})['then'](respondWithResult(_0x410140,null))[_0xa663('0x43')](handleError(_0x410140,null));};exports['getActions']=function(_0x53691b,_0xb15937,_0x1b50e9){var _0x369461={};var _0x287829={};var _0x579c84;var _0xa15f6b;return db[_0xa663('0x2b')][_0xa663('0x50')]({'where':{'id':_0x53691b['params']['id']}})[_0xa663('0x24')](handleEntityNotFound(_0xb15937,null))[_0xa663('0x24')](function(_0x25e1ce){if(_0x25e1ce){_0x579c84=_0x25e1ce;_0x287829[_0xa663('0x34')]=_[_0xa663('0x32')](db['Action'][_0xa663('0x2c')]);_0x287829[_0xa663('0x31')]=_[_0xa663('0x32')](_0x53691b[_0xa663('0x31')]);_0x287829['filters']=_[_0xa663('0x36')](_0x287829[_0xa663('0x34')],_0x287829[_0xa663('0x31')]);_0x369461[_0xa663('0x35')]=_[_0xa663('0x36')](_0x287829[_0xa663('0x34')],qs['fields'](_0x53691b[_0xa663('0x31')][_0xa663('0x37')]));_0x369461['attributes']=_0x369461[_0xa663('0x35')][_0xa663('0x45')]?_0x369461[_0xa663('0x35')]:_0x287829['model'];_0x369461['order']=qs[_0xa663('0x3b')](_0x53691b['query'][_0xa663('0x3b')]);_0x369461['where']=qs[_0xa663('0x33')](_[_0xa663('0x3d')](_0x53691b[_0xa663('0x31')],_0x287829[_0xa663('0x33')]));if(_0x53691b['query'][_0xa663('0x3e')]){_0x369461['where']=_[_0xa663('0x3f')](_0x369461[_0xa663('0x3c')],{'$or':_['map'](_0x369461['attributes'],function(_0x18c0a9){var _0x2f4942={};_0x2f4942[_0x18c0a9]={'$like':'%'+_0x53691b[_0xa663('0x31')][_0xa663('0x3e')]+'%'};return _0x2f4942;})});}_0x369461=_['merge']({},_0x369461,_0x53691b[_0xa663('0x41')]);return _0x579c84[_0xa663('0x54')](_0x369461);}})[_0xa663('0x24')](function(_0x36bc3d){if(_0x36bc3d){_0xa15f6b=_0x36bc3d[_0xa663('0x45')];if(!_0x53691b[_0xa663('0x31')][_0xa663('0x38')]('nolimit')){_0x369461['limit']=qs[_0xa663('0x1c')](_0x53691b[_0xa663('0x31')][_0xa663('0x1c')]);_0x369461[_0xa663('0x1a')]=qs[_0xa663('0x1a')](_0x53691b[_0xa663('0x31')]['offset']);}return _0x579c84[_0xa663('0x54')](_0x369461);}})[_0xa663('0x24')](function(_0x451c68){if(_0x451c68){return _0x451c68?{'count':_0xa15f6b,'rows':_0x451c68}:null;}})[_0xa663('0x24')](respondWithResult(_0xb15937,null))[_0xa663('0x43')](handleError(_0xb15937,null));};
\ No newline at end of file
+var _0x95dc=['filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','options','includeAll','include','findAll','catch','params','intersection','create','body','find','addConditions','Condition','ids','getConditions','findOne','pick','Action','addActions','omit','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','then','destroy','end','name','map','Automation','fieldName','key','query','keys'];(function(_0x1e4150,_0x55b02a){var _0x1ce3ee=function(_0x59324e){while(--_0x59324e){_0x1e4150['push'](_0x1e4150['shift']());}};_0x1ce3ee(++_0x55b02a);}(_0x95dc,0x108));var _0xc95d=function(_0x148893,_0x512217){_0x148893=_0x148893-0x0;var _0x64083f=_0x95dc[_0x148893];return _0x64083f;};'use strict';var emlformat=require(_0xc95d('0x0'));var rimraf=require(_0xc95d('0x1'));var zipdir=require(_0xc95d('0x2'));var jsonpatch=require(_0xc95d('0x3'));var rp=require(_0xc95d('0x4'));var moment=require('moment');var BPromise=require(_0xc95d('0x5'));var Mustache=require(_0xc95d('0x6'));var util=require(_0xc95d('0x7'));var path=require(_0xc95d('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc95d('0x9'));var fs=require('fs');var fs_extra=require(_0xc95d('0xa'));var _=require('lodash');var squel=require(_0xc95d('0xb'));var crypto=require(_0xc95d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc95d('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc95d('0xe'));var Redis=require(_0xc95d('0xf'));var authService=require(_0xc95d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc95d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc95d('0x12'))(_0xc95d('0x13'));var utils=require(_0xc95d('0x14'));var config=require(_0xc95d('0x15'));var licenseUtil=require(_0xc95d('0x16'));var db=require(_0xc95d('0x17'))['db'];function respondWithStatusCode(_0x4b6434,_0x6c84ed){_0x6c84ed=_0x6c84ed||0xcc;return function(_0x5d5446){if(_0x5d5446){return _0x4b6434[_0xc95d('0x18')](_0x6c84ed);}return _0x4b6434[_0xc95d('0x19')](_0x6c84ed)['end']();};}function respondWithResult(_0xdf8549,_0x53628c){_0x53628c=_0x53628c||0xc8;return function(_0x3272cd){if(_0x3272cd){return _0xdf8549[_0xc95d('0x19')](_0x53628c)[_0xc95d('0x1a')](_0x3272cd);}};}function respondWithFilteredResult(_0xc2295,_0x2d1770){return function(_0x22d7f2){if(_0x22d7f2){var _0x21174d=typeof _0x2d1770[_0xc95d('0x1b')]===_0xc95d('0x1c')&&typeof _0x2d1770[_0xc95d('0x1d')]===_0xc95d('0x1c');var _0x11a764=_0x22d7f2['count'];var _0x2c9fa7=_0x21174d?0x0:_0x2d1770[_0xc95d('0x1b')];var _0x38dfef=_0x21174d?_0x22d7f2[_0xc95d('0x1e')]:_0x2d1770['offset']+_0x2d1770[_0xc95d('0x1d')];var _0x18a15f;if(_0x38dfef>=_0x11a764){_0x38dfef=_0x11a764;_0x18a15f=0xc8;}else{_0x18a15f=0xce;}_0xc2295['status'](_0x18a15f);return _0xc2295['set']('Content-Range',_0x2c9fa7+'-'+_0x38dfef+'/'+_0x11a764)[_0xc95d('0x1a')](_0x22d7f2);}return null;};}function patchUpdates(_0x26fb36){return function(_0x58e393){try{jsonpatch[_0xc95d('0x1f')](_0x58e393,_0x26fb36,!![]);}catch(_0x48511f){return BPromise[_0xc95d('0x20')](_0x48511f);}return _0x58e393[_0xc95d('0x21')]();};}function saveUpdates(_0x1a51e3,_0x2a6375){return function(_0x12f49c){if(_0x12f49c){return _0x12f49c['update'](_0x1a51e3)[_0xc95d('0x22')](function(_0x405063){return _0x405063;});}return null;};}function removeEntity(_0x2cb983,_0x4724d4){return function(_0x2a2bb3){if(_0x2a2bb3){return _0x2a2bb3[_0xc95d('0x23')]()[_0xc95d('0x22')](function(){_0x2cb983[_0xc95d('0x19')](0xcc)[_0xc95d('0x24')]();});}};}function handleEntityNotFound(_0x314ba8,_0x24cbd0){return function(_0x275444){if(!_0x275444){_0x314ba8[_0xc95d('0x18')](0x194);}return _0x275444;};}function handleError(_0x357d7a,_0x547770){_0x547770=_0x547770||0x1f4;return function(_0x1f14e8){logger['error'](_0x1f14e8['stack']);if(_0x1f14e8[_0xc95d('0x25')]){delete _0x1f14e8[_0xc95d('0x25')];}_0x357d7a[_0xc95d('0x19')](_0x547770)['send'](_0x1f14e8);};}exports['index']=function(_0x1e17c2,_0x284136){var _0x25b9b8={},_0x58daff={},_0x21d7f4={'count':0x0,'rows':[]};var _0x4c48c6=_[_0xc95d('0x26')](db[_0xc95d('0x27')]['rawAttributes'],function(_0x114152){return{'name':_0x114152[_0xc95d('0x28')],'type':_0x114152['type'][_0xc95d('0x29')]};});_0x58daff['model']=_[_0xc95d('0x26')](_0x4c48c6,'name');_0x58daff[_0xc95d('0x2a')]=_[_0xc95d('0x2b')](_0x1e17c2['query']);_0x58daff[_0xc95d('0x2c')]=_['intersection'](_0x58daff[_0xc95d('0x2d')],_0x58daff[_0xc95d('0x2a')]);_0x25b9b8[_0xc95d('0x2e')]=_['intersection'](_0x58daff['model'],qs[_0xc95d('0x2f')](_0x1e17c2[_0xc95d('0x2a')][_0xc95d('0x2f')]));_0x25b9b8[_0xc95d('0x2e')]=_0x25b9b8['attributes'][_0xc95d('0x30')]?_0x25b9b8[_0xc95d('0x2e')]:_0x58daff[_0xc95d('0x2d')];if(!_0x1e17c2[_0xc95d('0x2a')][_0xc95d('0x31')](_0xc95d('0x32'))){_0x25b9b8[_0xc95d('0x1d')]=qs[_0xc95d('0x1d')](_0x1e17c2[_0xc95d('0x2a')][_0xc95d('0x1d')]);_0x25b9b8['offset']=qs[_0xc95d('0x1b')](_0x1e17c2['query'][_0xc95d('0x1b')]);}_0x25b9b8[_0xc95d('0x33')]=qs[_0xc95d('0x34')](_0x1e17c2[_0xc95d('0x2a')]['sort']);_0x25b9b8['where']=qs[_0xc95d('0x2c')](_['pick'](_0x1e17c2[_0xc95d('0x2a')],_0x58daff[_0xc95d('0x2c')]),_0x4c48c6);if(_0x1e17c2[_0xc95d('0x2a')][_0xc95d('0x35')]){_0x25b9b8[_0xc95d('0x36')]=_[_0xc95d('0x37')](_0x25b9b8[_0xc95d('0x36')],{'$or':_[_0xc95d('0x26')](_0x4c48c6,function(_0x1a5256){if(_0x1a5256[_0xc95d('0x38')]!=='VIRTUAL'){var _0xdbb612={};_0xdbb612[_0x1a5256[_0xc95d('0x25')]]={'$like':'%'+_0x1e17c2['query'][_0xc95d('0x35')]+'%'};return _0xdbb612;}})});}_0x25b9b8=_[_0xc95d('0x37')]({},_0x25b9b8,_0x1e17c2[_0xc95d('0x39')]);var _0x352151={'where':_0x25b9b8['where']};return db[_0xc95d('0x27')][_0xc95d('0x1e')](_0x352151)[_0xc95d('0x22')](function(_0x3928f7){_0x21d7f4[_0xc95d('0x1e')]=_0x3928f7;if(_0x1e17c2[_0xc95d('0x2a')][_0xc95d('0x3a')]){_0x25b9b8[_0xc95d('0x3b')]=[{'all':!![]}];}return db[_0xc95d('0x27')][_0xc95d('0x3c')](_0x25b9b8);})[_0xc95d('0x22')](function(_0x4e7142){_0x21d7f4['rows']=_0x4e7142;return _0x21d7f4;})['then'](respondWithFilteredResult(_0x284136,_0x25b9b8))[_0xc95d('0x3d')](handleError(_0x284136,null));};exports['show']=function(_0x1b76ec,_0x4c967c){var _0x107001={'raw':![],'where':{'id':_0x1b76ec[_0xc95d('0x3e')]['id']}},_0x11eba2={};_0x11eba2[_0xc95d('0x2d')]=_['keys'](db[_0xc95d('0x27')]['rawAttributes']);_0x11eba2[_0xc95d('0x2a')]=_[_0xc95d('0x2b')](_0x1b76ec[_0xc95d('0x2a')]);_0x11eba2[_0xc95d('0x2c')]=_['intersection'](_0x11eba2['model'],_0x11eba2[_0xc95d('0x2a')]);_0x107001[_0xc95d('0x2e')]=_[_0xc95d('0x3f')](_0x11eba2[_0xc95d('0x2d')],qs[_0xc95d('0x2f')](_0x1b76ec[_0xc95d('0x2a')][_0xc95d('0x2f')]));_0x107001['attributes']=_0x107001[_0xc95d('0x2e')][_0xc95d('0x30')]?_0x107001['attributes']:_0x11eba2[_0xc95d('0x2d')];if(_0x1b76ec[_0xc95d('0x2a')]['includeAll']){_0x107001[_0xc95d('0x3b')]=[{'all':!![]}];}_0x107001=_[_0xc95d('0x37')]({},_0x107001,_0x1b76ec['options']);return db[_0xc95d('0x27')]['find'](_0x107001)['then'](handleEntityNotFound(_0x4c967c,null))['then'](respondWithResult(_0x4c967c,null))[_0xc95d('0x3d')](handleError(_0x4c967c,null));};exports['create']=function(_0x49414b,_0x50432d){return db['Automation'][_0xc95d('0x40')](_0x49414b[_0xc95d('0x41')],{})[_0xc95d('0x22')](respondWithResult(_0x50432d,0xc9))[_0xc95d('0x3d')](handleError(_0x50432d,null));};exports['update']=function(_0x14541b,_0x222b43){if(_0x14541b['body']['id']){delete _0x14541b[_0xc95d('0x41')]['id'];}return db[_0xc95d('0x27')][_0xc95d('0x42')]({'where':{'id':_0x14541b[_0xc95d('0x3e')]['id']}})[_0xc95d('0x22')](handleEntityNotFound(_0x222b43,null))[_0xc95d('0x22')](saveUpdates(_0x14541b[_0xc95d('0x41')],null))[_0xc95d('0x22')](respondWithResult(_0x222b43,null))[_0xc95d('0x3d')](handleError(_0x222b43,null));};exports[_0xc95d('0x23')]=function(_0x44d0b2,_0xe2a06b){return db['Automation'][_0xc95d('0x42')]({'where':{'id':_0x44d0b2['params']['id']}})[_0xc95d('0x22')](handleEntityNotFound(_0xe2a06b,null))[_0xc95d('0x22')](removeEntity(_0xe2a06b,null))[_0xc95d('0x3d')](handleError(_0xe2a06b,null));};exports[_0xc95d('0x43')]=function(_0x41dd33,_0x544e97,_0x40a212){return db[_0xc95d('0x44')]['find']({'where':{'id':_0x41dd33[_0xc95d('0x3e')]['id']}})[_0xc95d('0x22')](handleEntityNotFound(_0x544e97,null))[_0xc95d('0x22')](function(_0xf3a8e1){if(_0xf3a8e1){return _0xf3a8e1[_0xc95d('0x43')](_0x41dd33[_0xc95d('0x41')][_0xc95d('0x45')],_['omit'](_0x41dd33[_0xc95d('0x41')],[_0xc95d('0x45'),'id'])||{});}})[_0xc95d('0x22')](respondWithResult(_0x544e97,null))[_0xc95d('0x3d')](handleError(_0x544e97,null));};exports[_0xc95d('0x46')]=function(_0x860244,_0x2e7d6c,_0x35ee28){var _0x17f81e={};var _0x582cfd={};var _0x3e7af0;var _0x234185;return db[_0xc95d('0x27')][_0xc95d('0x47')]({'where':{'id':_0x860244[_0xc95d('0x3e')]['id']}})[_0xc95d('0x22')](handleEntityNotFound(_0x2e7d6c,null))[_0xc95d('0x22')](function(_0x3fe235){if(_0x3fe235){_0x3e7af0=_0x3fe235;_0x582cfd[_0xc95d('0x2d')]=_[_0xc95d('0x2b')](db[_0xc95d('0x44')]['rawAttributes']);_0x582cfd['query']=_[_0xc95d('0x2b')](_0x860244[_0xc95d('0x2a')]);_0x582cfd['filters']=_[_0xc95d('0x3f')](_0x582cfd[_0xc95d('0x2d')],_0x582cfd[_0xc95d('0x2a')]);_0x17f81e['attributes']=_['intersection'](_0x582cfd[_0xc95d('0x2d')],qs[_0xc95d('0x2f')](_0x860244[_0xc95d('0x2a')][_0xc95d('0x2f')]));_0x17f81e[_0xc95d('0x2e')]=_0x17f81e[_0xc95d('0x2e')][_0xc95d('0x30')]?_0x17f81e[_0xc95d('0x2e')]:_0x582cfd[_0xc95d('0x2d')];_0x17f81e['order']=qs[_0xc95d('0x34')](_0x860244[_0xc95d('0x2a')][_0xc95d('0x34')]);_0x17f81e['where']=qs['filters'](_[_0xc95d('0x48')](_0x860244[_0xc95d('0x2a')],_0x582cfd[_0xc95d('0x2c')]));if(_0x860244['query'][_0xc95d('0x35')]){_0x17f81e[_0xc95d('0x36')]=_[_0xc95d('0x37')](_0x17f81e[_0xc95d('0x36')],{'$or':_['map'](_0x17f81e[_0xc95d('0x2e')],function(_0x13604c){var _0x250b5c={};_0x250b5c[_0x13604c]={'$like':'%'+_0x860244[_0xc95d('0x2a')]['filter']+'%'};return _0x250b5c;})});}_0x17f81e=_['merge']({},_0x17f81e,_0x860244['options']);return _0x3e7af0['getConditions'](_0x17f81e);}})['then'](function(_0x29fc52){if(_0x29fc52){_0x234185=_0x29fc52[_0xc95d('0x30')];if(!_0x860244[_0xc95d('0x2a')]['hasOwnProperty'](_0xc95d('0x32'))){_0x17f81e['limit']=qs[_0xc95d('0x1d')](_0x860244[_0xc95d('0x2a')][_0xc95d('0x1d')]);_0x17f81e[_0xc95d('0x1b')]=qs[_0xc95d('0x1b')](_0x860244[_0xc95d('0x2a')][_0xc95d('0x1b')]);}return _0x3e7af0[_0xc95d('0x46')](_0x17f81e);}})[_0xc95d('0x22')](function(_0x2b838a){if(_0x2b838a){return _0x2b838a?{'count':_0x234185,'rows':_0x2b838a}:null;}})['then'](respondWithResult(_0x2e7d6c,null))['catch'](handleError(_0x2e7d6c,null));};exports['addActions']=function(_0x1dcb42,_0x23f8a4,_0xe3b917){return db[_0xc95d('0x49')][_0xc95d('0x42')]({'where':{'id':_0x1dcb42[_0xc95d('0x3e')]['id']}})[_0xc95d('0x22')](handleEntityNotFound(_0x23f8a4,null))[_0xc95d('0x22')](function(_0x4a9f69){if(_0x4a9f69){return _0x4a9f69[_0xc95d('0x4a')](_0x1dcb42[_0xc95d('0x41')][_0xc95d('0x45')],_[_0xc95d('0x4b')](_0x1dcb42[_0xc95d('0x41')],[_0xc95d('0x45'),'id'])||{});}})[_0xc95d('0x22')](respondWithResult(_0x23f8a4,null))[_0xc95d('0x3d')](handleError(_0x23f8a4,null));};exports['getActions']=function(_0x3f20b3,_0x1141c6,_0x2e8b72){var _0x1b2014={};var _0x5a6718={};var _0x6939b4;var _0x4d2183;return db[_0xc95d('0x27')][_0xc95d('0x47')]({'where':{'id':_0x3f20b3[_0xc95d('0x3e')]['id']}})[_0xc95d('0x22')](handleEntityNotFound(_0x1141c6,null))['then'](function(_0x4210a5){if(_0x4210a5){_0x6939b4=_0x4210a5;_0x5a6718[_0xc95d('0x2d')]=_[_0xc95d('0x2b')](db[_0xc95d('0x49')]['rawAttributes']);_0x5a6718[_0xc95d('0x2a')]=_[_0xc95d('0x2b')](_0x3f20b3[_0xc95d('0x2a')]);_0x5a6718['filters']=_[_0xc95d('0x3f')](_0x5a6718['model'],_0x5a6718[_0xc95d('0x2a')]);_0x1b2014[_0xc95d('0x2e')]=_['intersection'](_0x5a6718[_0xc95d('0x2d')],qs[_0xc95d('0x2f')](_0x3f20b3[_0xc95d('0x2a')][_0xc95d('0x2f')]));_0x1b2014[_0xc95d('0x2e')]=_0x1b2014[_0xc95d('0x2e')][_0xc95d('0x30')]?_0x1b2014['attributes']:_0x5a6718['model'];_0x1b2014[_0xc95d('0x33')]=qs[_0xc95d('0x34')](_0x3f20b3[_0xc95d('0x2a')][_0xc95d('0x34')]);_0x1b2014[_0xc95d('0x36')]=qs[_0xc95d('0x2c')](_[_0xc95d('0x48')](_0x3f20b3[_0xc95d('0x2a')],_0x5a6718[_0xc95d('0x2c')]));if(_0x3f20b3[_0xc95d('0x2a')][_0xc95d('0x35')]){_0x1b2014[_0xc95d('0x36')]=_[_0xc95d('0x37')](_0x1b2014[_0xc95d('0x36')],{'$or':_['map'](_0x1b2014[_0xc95d('0x2e')],function(_0x141381){var _0x2f7132={};_0x2f7132[_0x141381]={'$like':'%'+_0x3f20b3[_0xc95d('0x2a')]['filter']+'%'};return _0x2f7132;})});}_0x1b2014=_[_0xc95d('0x37')]({},_0x1b2014,_0x3f20b3[_0xc95d('0x39')]);return _0x6939b4[_0xc95d('0x4c')](_0x1b2014);}})[_0xc95d('0x22')](function(_0x256943){if(_0x256943){_0x4d2183=_0x256943[_0xc95d('0x30')];if(!_0x3f20b3['query']['hasOwnProperty'](_0xc95d('0x32'))){_0x1b2014[_0xc95d('0x1d')]=qs[_0xc95d('0x1d')](_0x3f20b3['query'][_0xc95d('0x1d')]);_0x1b2014[_0xc95d('0x1b')]=qs[_0xc95d('0x1b')](_0x3f20b3[_0xc95d('0x2a')][_0xc95d('0x1b')]);}return _0x6939b4['getActions'](_0x1b2014);}})[_0xc95d('0x22')](function(_0x2bcf0b){if(_0x2bcf0b){return _0x2bcf0b?{'count':_0x4d2183,'rows':_0x2bcf0b}:null;}})[_0xc95d('0x22')](respondWithResult(_0x1141c6,null))[_0xc95d('0x3d')](handleError(_0x1141c6,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index ac4b1d7..2d38144 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 _0x7ed6=['Automation','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define'];(function(_0x333969,_0x2fed30){var _0x5daea9=function(_0x1e7ecd){while(--_0x1e7ecd){_0x333969['push'](_0x333969['shift']());}};_0x5daea9(++_0x2fed30);}(_0x7ed6,0x151));var _0x67ed=function(_0x1c7e47,_0x40b6bd){_0x1c7e47=_0x1c7e47-0x0;var _0x57ba61=_0x7ed6[_0x1c7e47];return _0x57ba61;};'use strict';var _=require(_0x67ed('0x0'));var util=require(_0x67ed('0x1'));var logger=require(_0x67ed('0x2'))(_0x67ed('0x3'));var moment=require(_0x67ed('0x4'));var BPromise=require(_0x67ed('0x5'));var rp=require(_0x67ed('0x6'));var fs=require('fs');var path=require(_0x67ed('0x7'));var rimraf=require(_0x67ed('0x8'));var config=require(_0x67ed('0x9'));var attributes=require(_0x67ed('0xa'));module[_0x67ed('0xb')]=function(_0x1a39ea,_0x2b0492){return _0x1a39ea[_0x67ed('0xc')](_0x67ed('0xd'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x864a=['path','rimraf','../../config/environment','define','Automation','tools_automations','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x27a5da,_0xeabcd8){var _0x1885cd=function(_0x1827f0){while(--_0x1827f0){_0x27a5da['push'](_0x27a5da['shift']());}};_0x1885cd(++_0xeabcd8);}(_0x864a,0x7e));var _0xa864=function(_0x50bd70,_0x31bd97){_0x50bd70=_0x50bd70-0x0;var _0x7f9a09=_0x864a[_0x50bd70];return _0x7f9a09;};'use strict';var _=require(_0xa864('0x0'));var util=require(_0xa864('0x1'));var logger=require(_0xa864('0x2'))('api');var moment=require(_0xa864('0x3'));var BPromise=require(_0xa864('0x4'));var rp=require(_0xa864('0x5'));var fs=require('fs');var path=require(_0xa864('0x6'));var rimraf=require(_0xa864('0x7'));var config=require(_0xa864('0x8'));var attributes=require('./automation.attributes');module['exports']=function(_0x4aede3,_0x147510){return _0x4aede3[_0xa864('0x9')](_0xa864('0xa'),attributes,{'tableName':_0xa864('0xb'),'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 dc0416f..ec2dfef 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 _0xa3db=['client','http','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Automation,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0xa3db,0x10c));var _0xba3d=function(_0x4bdb73,_0x2e6916){_0x4bdb73=_0x4bdb73-0x0;var _0x56a18a=_0xa3db[_0x4bdb73];return _0x56a18a;};'use strict';var _=require(_0xba3d('0x0'));var util=require(_0xba3d('0x1'));var moment=require(_0xba3d('0x2'));var BPromise=require(_0xba3d('0x3'));var rs=require(_0xba3d('0x4'));var fs=require('fs');var Redis=require(_0xba3d('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xba3d('0x6'))('rpc');var config=require(_0xba3d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xba3d('0x8')][_0xba3d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x477583,_0x1bacd7,_0x1bd181){return new BPromise(function(_0x426868,_0x3b69e9){return client[_0xba3d('0xa')](_0x477583,_0x1bd181)[_0xba3d('0xb')](function(_0x102fe6){logger[_0xba3d('0xc')]('Automation,\x20%s,\x20%s',_0x1bacd7,_0xba3d('0xd'));logger[_0xba3d('0xe')](_0xba3d('0xf'),_0x1bacd7,_0xba3d('0xd'),JSON[_0xba3d('0x10')](_0x102fe6));if(_0x102fe6['error']){if(_0x102fe6[_0xba3d('0x11')][_0xba3d('0x12')]===0x1f4){logger[_0xba3d('0x11')]('Automation,\x20%s,\x20%s',_0x1bacd7,_0x102fe6['error'][_0xba3d('0x13')]);return _0x3b69e9(_0x102fe6[_0xba3d('0x11')]['message']);}logger['error'](_0xba3d('0x14'),_0x1bacd7,_0x102fe6['error'][_0xba3d('0x13')]);return _0x426868(_0x102fe6[_0xba3d('0x11')][_0xba3d('0x13')]);}else{logger[_0xba3d('0xc')](_0xba3d('0x14'),_0x1bacd7,_0xba3d('0xd'));_0x426868(_0x102fe6[_0xba3d('0x15')][_0xba3d('0x13')]);}})[_0xba3d('0x16')](function(_0x2ce092){logger['error'](_0xba3d('0x14'),_0x1bacd7,_0x2ce092);_0x3b69e9(_0x2ce092);});});}
\ No newline at end of file
+var _0x25a9=['../../config/logger','jayson/promise','http','request','debug','request\x20sent','stringify','error','code','message','Automation,\x20%s,\x20%s','info','result','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x27b654,_0x3c5b66){var _0x5cd6ff=function(_0x26ab99){while(--_0x26ab99){_0x27b654['push'](_0x27b654['shift']());}};_0x5cd6ff(++_0x3c5b66);}(_0x25a9,0xf1));var _0x925a=function(_0x254abd,_0x1ab7f0){_0x254abd=_0x254abd-0x0;var _0x31bf1b=_0x25a9[_0x254abd];return _0x31bf1b;};'use strict';var _=require('lodash');var util=require(_0x925a('0x0'));var moment=require(_0x925a('0x1'));var BPromise=require(_0x925a('0x2'));var rs=require(_0x925a('0x3'));var fs=require('fs');var Redis=require(_0x925a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x925a('0x5'));var logger=require(_0x925a('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x925a('0x7'));var client=jayson['client'][_0x925a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x217ed5,_0x29a50d,_0x4f049e){return new BPromise(function(_0x3c70f5,_0x407ee4){return client[_0x925a('0x9')](_0x217ed5,_0x4f049e)['then'](function(_0x3ed56d){logger['info']('Automation,\x20%s,\x20%s',_0x29a50d,'request\x20sent');logger[_0x925a('0xa')]('Automation,\x20%s,\x20%s,\x20%s',_0x29a50d,_0x925a('0xb'),JSON[_0x925a('0xc')](_0x3ed56d));if(_0x3ed56d[_0x925a('0xd')]){if(_0x3ed56d[_0x925a('0xd')][_0x925a('0xe')]===0x1f4){logger[_0x925a('0xd')]('Automation,\x20%s,\x20%s',_0x29a50d,_0x3ed56d[_0x925a('0xd')][_0x925a('0xf')]);return _0x407ee4(_0x3ed56d[_0x925a('0xd')][_0x925a('0xf')]);}logger[_0x925a('0xd')](_0x925a('0x10'),_0x29a50d,_0x3ed56d[_0x925a('0xd')]['message']);return _0x3c70f5(_0x3ed56d[_0x925a('0xd')][_0x925a('0xf')]);}else{logger[_0x925a('0x11')](_0x925a('0x10'),_0x29a50d,'request\x20sent');_0x3c70f5(_0x3ed56d[_0x925a('0x12')][_0x925a('0xf')]);}})['catch'](function(_0x425afe){logger[_0x925a('0xd')](_0x925a('0x10'),_0x29a50d,_0x425afe);_0x407ee4(_0x425afe);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 55eaedc..5eca2f3 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 _0xc078=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','addConditions','post','put'];(function(_0xf97e38,_0x54e286){var _0x1edd6b=function(_0x35acc8){while(--_0x35acc8){_0xf97e38['push'](_0xf97e38['shift']());}};_0x1edd6b(++_0x54e286);}(_0xc078,0xfd));var _0x8c07=function(_0x1b51b0,_0x45a38d){_0x1b51b0=_0x1b51b0-0x0;var _0x263ec3=_0xc078[_0x1b51b0];return _0x263ec3;};'use strict';var multer=require('multer');var util=require(_0x8c07('0x0'));var path=require(_0x8c07('0x1'));var timeout=require(_0x8c07('0x2'));var express=require(_0x8c07('0x3'));var router=express[_0x8c07('0x4')]();var fs_extra=require(_0x8c07('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8c07('0x6'));var config=require(_0x8c07('0x7'));var controller=require(_0x8c07('0x8'));router[_0x8c07('0x9')]('/',auth[_0x8c07('0xa')](),controller['index']);router['get'](_0x8c07('0xb'),auth[_0x8c07('0xa')](),controller[_0x8c07('0xc')]);router['get'](_0x8c07('0xd'),auth[_0x8c07('0xa')](),controller[_0x8c07('0xe')]);router[_0x8c07('0x9')](_0x8c07('0xf'),auth[_0x8c07('0xa')](),controller[_0x8c07('0x10')]);router['post']('/',auth[_0x8c07('0xa')](),controller['create']);router['post'](_0x8c07('0xd'),auth[_0x8c07('0xa')](),controller[_0x8c07('0x11')]);router[_0x8c07('0x12')](_0x8c07('0xf'),auth['isAuthenticated'](),controller['addActions']);router[_0x8c07('0x13')]('/:id',auth[_0x8c07('0xa')](),controller['update']);router['delete'](_0x8c07('0xb'),auth[_0x8c07('0xa')](),controller['destroy']);module[_0x8c07('0x14')]=router;
\ No newline at end of file
+var _0x45c9=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','update','delete','destroy','exports'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x45c9,0x96));var _0x945c=function(_0x3c9dad,_0x1f3e24){_0x3c9dad=_0x3c9dad-0x0;var _0x4a790f=_0x45c9[_0x3c9dad];return _0x4a790f;};'use strict';var multer=require('multer');var util=require(_0x945c('0x0'));var path=require('path');var timeout=require(_0x945c('0x1'));var express=require(_0x945c('0x2'));var router=express[_0x945c('0x3')]();var fs_extra=require(_0x945c('0x4'));var auth=require(_0x945c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x945c('0x6'));var controller=require('./automation.controller');router[_0x945c('0x7')]('/',auth[_0x945c('0x8')](),controller[_0x945c('0x9')]);router[_0x945c('0x7')](_0x945c('0xa'),auth[_0x945c('0x8')](),controller[_0x945c('0xb')]);router['get'](_0x945c('0xc'),auth['isAuthenticated'](),controller[_0x945c('0xd')]);router['get'](_0x945c('0xe'),auth['isAuthenticated'](),controller[_0x945c('0xf')]);router[_0x945c('0x10')]('/',auth[_0x945c('0x8')](),controller[_0x945c('0x11')]);router[_0x945c('0x10')](_0x945c('0xc'),auth[_0x945c('0x8')](),controller[_0x945c('0x12')]);router[_0x945c('0x10')](_0x945c('0xe'),auth[_0x945c('0x8')](),controller[_0x945c('0x13')]);router[_0x945c('0x14')](_0x945c('0xa'),auth['isAuthenticated'](),controller[_0x945c('0x15')]);router[_0x945c('0x16')](_0x945c('0xa'),auth[_0x945c('0x8')](),controller[_0x945c('0x17')]);module[_0x945c('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index f3a7eee..f06c590 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 _0xb3bb=['STRING','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','ENUM','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports'];(function(_0x2aeee8,_0x707070){var _0x3aeef5=function(_0x25c910){while(--_0x25c910){_0x2aeee8['push'](_0x2aeee8['shift']());}};_0x3aeef5(++_0x707070);}(_0xb3bb,0x1ed));var _0xbb3b=function(_0x57e165,_0x4d6b88){_0x57e165=_0x57e165-0x0;var _0x2fbb4a=_0xb3bb[_0x57e165];return _0x2fbb4a;};'use strict';var Sequelize=require(_0xbb3b('0x0'));module[_0xbb3b('0x1')]={'name':{'type':Sequelize[_0xbb3b('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':_0xbb3b('0x3')},'description':{'type':Sequelize[_0xbb3b('0x2')]},'active':{'type':Sequelize[_0xbb3b('0x4')],'defaultValue':0x0,'comment':_0xbb3b('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xbb3b('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xbb3b('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xbb3b('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xbb3b('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xbb3b('0x8')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbb3b('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xbb3b('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xbb3b('0x8')](0x5)[_0xbb3b('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbb3b('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xbb3b('0x8')](0x3)[_0xbb3b('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xbb3b('0x8')](0x5)[_0xbb3b('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbb3b('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xbb3b('0x8')](0x3)[_0xbb3b('0x6')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xbb3b('0x8')](0x5)[_0xbb3b('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbb3b('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0xbb3b('0x8')](0x3)[_0xbb3b('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xbb3b('0xd')},'dialTimezone':{'type':Sequelize[_0xbb3b('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xbb3b('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xbb3b('0xe')](_0xbb3b('0xf'),'never',_0xbb3b('0x10')),'defaultValue':_0xbb3b('0xf')},'dialAMDActive':{'type':Sequelize[_0xbb3b('0x4')],'defaultValue':0x0,'comment':_0xbb3b('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0xbb3b('0x8')](0x9)[_0xbb3b('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xbb3b('0x8')](0x9)[_0xbb3b('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xbb3b('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xbb3b('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xbb3b('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xbb3b('0x8')](0x9)[_0xbb3b('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xbb3b('0x8')](0x9)[_0xbb3b('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xbb3b('0x13')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xbb3b('0x8')](0x9)[_0xbb3b('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xbb3b('0x14')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xbb3b('0x8')](0x5)[_0xbb3b('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xbb3b('0x8')](0x9)[_0xbb3b('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xbb3b('0xe')](_0xbb3b('0x15'),'ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xbb3b('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xbb3b('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xbb3b('0x16')},'dialCutDigit':{'type':Sequelize[_0xbb3b('0x8')](0x3)[_0xbb3b('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xbb3b('0x17')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xbb3b('0x8')](0x3)[_0xbb3b('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbb3b('0x18')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xbb3b('0x8')](0x5)[_0xbb3b('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbb3b('0x19')},'dialDropMaxRetry':{'type':Sequelize[_0xbb3b('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbb3b('0x1a')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xbb3b('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbb3b('0x1b')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xbb3b('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbb3b('0x1c')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xbb3b('0x8')](0x5)[_0xbb3b('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbb3b('0x1d')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xbb3b('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbb3b('0x1e')},'dialMachineRetryFrequency':{'type':Sequelize[_0xbb3b('0x8')](0x5)[_0xbb3b('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xbb3b('0x8')](0x3)[_0xbb3b('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbb3b('0x1f')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xbb3b('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbb3b('0x20')}};
\ No newline at end of file
+var _0xdabc=['Max\x20200\x20calls.','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign'];(function(_0x9da77a,_0x340b52){var _0x596a93=function(_0x366c11){while(--_0x366c11){_0x9da77a['push'](_0x9da77a['shift']());}};_0x596a93(++_0x340b52);}(_0xdabc,0x1ce));var _0xcdab=function(_0x2d6533,_0x19f68c){_0x2d6533=_0x2d6533-0x0;var _0x26c12f=_0xdabc[_0x2d6533];return _0x26c12f;};'use strict';var Sequelize=require(_0xcdab('0x0'));module['exports']={'name':{'type':Sequelize[_0xcdab('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xcdab('0x2')](_0xcdab('0x3')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xcdab('0x1')]},'active':{'type':Sequelize[_0xcdab('0x4')],'defaultValue':0x0,'comment':_0xcdab('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xcdab('0x6')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xcdab('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xcdab('0x7')](0x3)[_0xcdab('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcdab('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xcdab('0x7')](0x3)[_0xcdab('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcdab('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xcdab('0x7')](0x5)[_0xcdab('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcdab('0xb')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcdab('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xcdab('0x7')](0x5)[_0xcdab('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcdab('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xcdab('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xcdab('0x7')](0x5)[_0xcdab('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xcdab('0xe')},'dialTimezone':{'type':Sequelize[_0xcdab('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xcdab('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xcdab('0x2')](_0xcdab('0x10'),'never',_0xcdab('0x11')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xcdab('0x4')],'defaultValue':0x0,'comment':_0xcdab('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0xcdab('0x7')](0x9)[_0xcdab('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xcdab('0x13')},'dialAMDGreeting':{'type':Sequelize[_0xcdab('0x7')](0x9)[_0xcdab('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xcdab('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xcdab('0x7')](0x9)[_0xcdab('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xcdab('0x7')](0x9)[_0xcdab('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xcdab('0x15')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xcdab('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xcdab('0x7')](0x9)[_0xcdab('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xcdab('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xcdab('0x7')](0x9)[_0xcdab('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xcdab('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xcdab('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xcdab('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xcdab('0x7')](0x9)[_0xcdab('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xcdab('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xcdab('0x2')](_0xcdab('0x1b'),_0xcdab('0x1c')),'defaultValue':_0xcdab('0x1b')},'dialPrefix':{'type':Sequelize[_0xcdab('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xcdab('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xcdab('0x1d')},'dialCutDigit':{'type':Sequelize[_0xcdab('0x7')](0x3)[_0xcdab('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xcdab('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xcdab('0x7')](0x3)[_0xcdab('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcdab('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xcdab('0x7')](0x5)[_0xcdab('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcdab('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0xcdab('0x7')](0x3)[_0xcdab('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xcdab('0x7')](0x5)[_0xcdab('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcdab('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xcdab('0x7')](0x3)[_0xcdab('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xcdab('0x7')](0x5)[_0xcdab('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xcdab('0x7')](0x3)[_0xcdab('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcdab('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0xcdab('0x7')](0x5)[_0xcdab('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcdab('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xcdab('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 79ee4bb..c9ed3fe 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 _0x4b07=['NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','ListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','Content-Range','json','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','Campaign','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','findAll','rows','catch','show','params','length','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','createdAt','body','getHoppers','findOne','CmHopper','CampaignId','include','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','into','cm_hopper','fromQuery','scheduledAt','ContactId','select','field','phone'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x4b07,0x1d6));var _0x74b0=function(_0x12c1c4,_0x5493a1){_0x12c1c4=_0x12c1c4-0x0;var _0x159e2a=_0x4b07[_0x12c1c4];return _0x159e2a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x74b0('0x0'));var zipdir=require(_0x74b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x74b0('0x2'));var moment=require(_0x74b0('0x3'));var BPromise=require(_0x74b0('0x4'));var Mustache=require(_0x74b0('0x5'));var util=require('util');var path=require(_0x74b0('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x74b0('0x7'));var _=require(_0x74b0('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x74b0('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x74b0('0xa'));var querystring=require(_0x74b0('0xb'));var Papa=require(_0x74b0('0xc'));var Redis=require(_0x74b0('0xd'));var authService=require(_0x74b0('0xe'));var qs=require(_0x74b0('0xf'));var as=require(_0x74b0('0x10'));var hardwareService=require(_0x74b0('0x11'));var logger=require(_0x74b0('0x12'))(_0x74b0('0x13'));var utils=require(_0x74b0('0x14'));var config=require(_0x74b0('0x15'));var licenseUtil=require(_0x74b0('0x16'));var db=require(_0x74b0('0x17'))['db'];function respondWithStatusCode(_0xf1ec58,_0x200f36){_0x200f36=_0x200f36||0xcc;return function(_0x4e9f47){if(_0x4e9f47){return _0xf1ec58[_0x74b0('0x18')](_0x200f36);}return _0xf1ec58[_0x74b0('0x19')](_0x200f36)['end']();};}function respondWithResult(_0xefd5f7,_0x49f519){_0x49f519=_0x49f519||0xc8;return function(_0x72f633){if(_0x72f633){return _0xefd5f7[_0x74b0('0x19')](_0x49f519)['json'](_0x72f633);}};}function respondWithFilteredResult(_0x4004d7,_0x50aa7d){return function(_0x3b002a){if(_0x3b002a){var _0x539172=typeof _0x50aa7d[_0x74b0('0x1a')]==='undefined'&&typeof _0x50aa7d[_0x74b0('0x1b')]===_0x74b0('0x1c');var _0x397ee4=_0x3b002a[_0x74b0('0x1d')];var _0x26deb1=_0x539172?0x0:_0x50aa7d[_0x74b0('0x1a')];var _0x8425cc=_0x539172?_0x3b002a[_0x74b0('0x1d')]:_0x50aa7d['offset']+_0x50aa7d['limit'];var _0x55ccc1;if(_0x8425cc>=_0x397ee4){_0x8425cc=_0x397ee4;_0x55ccc1=0xc8;}else{_0x55ccc1=0xce;}_0x4004d7[_0x74b0('0x19')](_0x55ccc1);return _0x4004d7['set'](_0x74b0('0x1e'),_0x26deb1+'-'+_0x8425cc+'/'+_0x397ee4)[_0x74b0('0x1f')](_0x3b002a);}return null;};}function patchUpdates(_0xc17e43){return function(_0x28a89e){try{jsonpatch['apply'](_0x28a89e,_0xc17e43,!![]);}catch(_0x18004b){return BPromise[_0x74b0('0x20')](_0x18004b);}return _0x28a89e[_0x74b0('0x21')]();};}function saveUpdates(_0xc6c020,_0x550ff7){return function(_0x44f568){if(_0x44f568){return _0x44f568[_0x74b0('0x22')](_0xc6c020)[_0x74b0('0x23')](function(_0x167dd7){return _0x167dd7;});}return null;};}function removeEntity(_0x3e70d5,_0x1396f3){return function(_0x7259f4){if(_0x7259f4){return _0x7259f4[_0x74b0('0x24')]()[_0x74b0('0x23')](function(){var _0x54e2fd=_0x7259f4[_0x74b0('0x25')]({'plain':!![]});var _0x5b6b58='IvrCampaigns';return db[_0x74b0('0x26')][_0x74b0('0x24')]({'where':{'type':_0x5b6b58,'resourceId':_0x54e2fd['id']}})[_0x74b0('0x23')](function(){return _0x7259f4;});})['then'](function(){_0x3e70d5[_0x74b0('0x19')](0xcc)[_0x74b0('0x27')]();});}};}function handleEntityNotFound(_0x1f8b2a,_0x531fee){return function(_0x57c283){if(!_0x57c283){_0x1f8b2a[_0x74b0('0x18')](0x194);}return _0x57c283;};}function handleError(_0x3b84f0,_0x2d061b){_0x2d061b=_0x2d061b||0x1f4;return function(_0x2163f4){logger[_0x74b0('0x28')](_0x2163f4[_0x74b0('0x29')]);if(_0x2163f4['name']){delete _0x2163f4[_0x74b0('0x2a')];}_0x3b84f0['status'](_0x2d061b)[_0x74b0('0x2b')](_0x2163f4);};}exports[_0x74b0('0x2c')]=function(_0x4dfbdb,_0x2b93ae){var _0x25db17={},_0x143093={},_0x5e0560={'count':0x0,'rows':[]};var _0x529abb=_['map'](db[_0x74b0('0x2d')][_0x74b0('0x2e')],function(_0x57f04e){return{'name':_0x57f04e[_0x74b0('0x2f')],'type':_0x57f04e[_0x74b0('0x30')][_0x74b0('0x31')]};});_0x143093[_0x74b0('0x32')]=_[_0x74b0('0x33')](_0x529abb,_0x74b0('0x2a'));_0x143093['query']=_[_0x74b0('0x34')](_0x4dfbdb[_0x74b0('0x35')]);_0x143093[_0x74b0('0x36')]=_['intersection'](_0x143093[_0x74b0('0x32')],_0x143093[_0x74b0('0x35')]);_0x25db17['attributes']=_[_0x74b0('0x37')](_0x143093[_0x74b0('0x32')],qs[_0x74b0('0x38')](_0x4dfbdb['query'][_0x74b0('0x38')]));_0x25db17[_0x74b0('0x39')]=_0x25db17[_0x74b0('0x39')]['length']?_0x25db17['attributes']:_0x143093[_0x74b0('0x32')];if(!_0x4dfbdb['query'][_0x74b0('0x3a')](_0x74b0('0x3b'))){_0x25db17[_0x74b0('0x1b')]=qs[_0x74b0('0x1b')](_0x4dfbdb[_0x74b0('0x35')][_0x74b0('0x1b')]);_0x25db17[_0x74b0('0x1a')]=qs[_0x74b0('0x1a')](_0x4dfbdb[_0x74b0('0x35')][_0x74b0('0x1a')]);}_0x25db17[_0x74b0('0x3c')]=qs[_0x74b0('0x3d')](_0x4dfbdb[_0x74b0('0x35')][_0x74b0('0x3d')]);_0x25db17[_0x74b0('0x3e')]=qs[_0x74b0('0x36')](_[_0x74b0('0x3f')](_0x4dfbdb[_0x74b0('0x35')],_0x143093[_0x74b0('0x36')]),_0x529abb);if(_0x4dfbdb[_0x74b0('0x35')][_0x74b0('0x40')]){_0x25db17[_0x74b0('0x3e')]=_[_0x74b0('0x41')](_0x25db17[_0x74b0('0x3e')],{'$or':_['map'](_0x529abb,function(_0x83be1d){if(_0x83be1d['type']!=='VIRTUAL'){var _0x4fe7da={};_0x4fe7da[_0x83be1d[_0x74b0('0x2a')]]={'$like':'%'+_0x4dfbdb[_0x74b0('0x35')][_0x74b0('0x40')]+'%'};return _0x4fe7da;}})});}_0x25db17=_[_0x74b0('0x41')]({},_0x25db17,_0x4dfbdb[_0x74b0('0x42')]);var _0x145f01={'where':_0x25db17['where']};return db['Campaign'][_0x74b0('0x1d')](_0x145f01)[_0x74b0('0x23')](function(_0x409c65){_0x5e0560[_0x74b0('0x1d')]=_0x409c65;if(_0x4dfbdb[_0x74b0('0x35')]['includeAll']){_0x25db17['include']=[{'all':!![]}];}return db['Campaign'][_0x74b0('0x43')](_0x25db17);})[_0x74b0('0x23')](function(_0xffc84){_0x5e0560[_0x74b0('0x44')]=_0xffc84;return _0x5e0560;})['then'](respondWithFilteredResult(_0x2b93ae,_0x25db17))[_0x74b0('0x45')](handleError(_0x2b93ae,null));};exports[_0x74b0('0x46')]=function(_0x5ce200,_0x24dcbd){var _0x3c6973={'raw':![],'where':{'id':_0x5ce200[_0x74b0('0x47')]['id']}},_0x5bee95={};_0x5bee95['model']=_[_0x74b0('0x34')](db[_0x74b0('0x2d')][_0x74b0('0x2e')]);_0x5bee95['query']=_['keys'](_0x5ce200[_0x74b0('0x35')]);_0x5bee95['filters']=_[_0x74b0('0x37')](_0x5bee95['model'],_0x5bee95[_0x74b0('0x35')]);_0x3c6973[_0x74b0('0x39')]=_[_0x74b0('0x37')](_0x5bee95[_0x74b0('0x32')],qs[_0x74b0('0x38')](_0x5ce200[_0x74b0('0x35')][_0x74b0('0x38')]));_0x3c6973[_0x74b0('0x39')]=_0x3c6973[_0x74b0('0x39')][_0x74b0('0x48')]?_0x3c6973[_0x74b0('0x39')]:_0x5bee95[_0x74b0('0x32')];if(_0x5ce200['query'][_0x74b0('0x49')]){_0x3c6973['include']=[{'all':!![]}];}_0x3c6973=_[_0x74b0('0x41')]({},_0x3c6973,_0x5ce200[_0x74b0('0x42')]);return db[_0x74b0('0x2d')][_0x74b0('0x4a')](_0x3c6973)[_0x74b0('0x23')](handleEntityNotFound(_0x24dcbd,null))[_0x74b0('0x23')](respondWithResult(_0x24dcbd,null))['catch'](handleError(_0x24dcbd,null));};exports['create']=function(_0x4edafa,_0x53551f){return db[_0x74b0('0x2d')][_0x74b0('0x4b')](_0x4edafa['body'],{})[_0x74b0('0x23')](function(_0x14cc33){var _0x163af6=_0x4edafa['user'][_0x74b0('0x25')]({'plain':!![]});if(!_0x163af6)throw new Error(_0x74b0('0x4c'));if(_0x163af6[_0x74b0('0x4d')]===_0x74b0('0x4e')){var _0x53bfb8=_0x14cc33[_0x74b0('0x25')]({'plain':!![]});var _0x2e3192=_0x74b0('0x4f');return db[_0x74b0('0x50')]['find']({'where':{'name':_0x2e3192,'userProfileId':_0x163af6[_0x74b0('0x51')]},'raw':!![]})[_0x74b0('0x23')](function(_0x24de7a){if(_0x24de7a&&_0x24de7a[_0x74b0('0x52')]===0x0){return db[_0x74b0('0x26')][_0x74b0('0x4b')]({'name':_0x53bfb8['name'],'resourceId':_0x53bfb8['id'],'type':_0x24de7a['name'],'sectionId':_0x24de7a['id']},{})['then'](function(){return _0x14cc33;});}else{return _0x14cc33;}})[_0x74b0('0x45')](function(_0x1a11ca){logger[_0x74b0('0x28')](_0x74b0('0x53'),_0x1a11ca);throw _0x1a11ca;});}return _0x14cc33;})[_0x74b0('0x23')](respondWithResult(_0x53551f,0xc9))[_0x74b0('0x45')](handleError(_0x53551f,null));};exports['clone']=function(_0x5235d4,_0x239a1){var _0x4f433a={'where':{'id':_0x5235d4[_0x74b0('0x47')]['id']}},_0x9b5c32={};_0x9b5c32[_0x74b0('0x32')]=_[_0x74b0('0x34')](db['Campaign']['rawAttributes']);_0x4f433a[_0x74b0('0x39')]=_[_0x74b0('0x37')](_0x9b5c32[_0x74b0('0x32')],qs['fields'](_0x5235d4[_0x74b0('0x35')]['fields']));_0x4f433a[_0x74b0('0x39')]=_0x4f433a[_0x74b0('0x39')]['length']?_0x4f433a['attributes']:_0x9b5c32[_0x74b0('0x32')];if(_0x5235d4[_0x74b0('0x35')][_0x74b0('0x49')]){_0x4f433a['include']=[{'all':!![]}];}_0x4f433a=_['merge']({},_0x4f433a,_0x5235d4['options']);return db[_0x74b0('0x2d')][_0x74b0('0x4a')](_0x4f433a)[_0x74b0('0x23')](handleEntityNotFound(_0x239a1,null))[_0x74b0('0x23')](function(_0x187904){if(_0x187904){var _0x52c185=_0x187904[_0x74b0('0x25')]({'plain':!![]});_0x52c185=qs[_0x74b0('0x54')](_0x52c185,['id','createdAt',_0x74b0('0x55')]);_0x5235d4['body']=_['omit'](_0x5235d4['body'],['id',_0x74b0('0x56'),'updatedAt']);return db[_0x74b0('0x2d')][_0x74b0('0x4b')](_[_0x74b0('0x41')](_0x52c185,_0x5235d4['body']),{'include':_0x5235d4[_0x74b0('0x35')][_0x74b0('0x49')]?[{'all':!![]}]:undefined})[_0x74b0('0x23')](function(_0x3cb5f6){var _0x59d4b1=_0x5235d4[_0x74b0('0x4e')]['get']({'plain':!![]});if(!_0x59d4b1)throw new Error(_0x74b0('0x4c'));if(_0x59d4b1['role']===_0x74b0('0x4e')){var _0x1c1881=_0x3cb5f6[_0x74b0('0x25')]({'plain':!![]});var _0x7e7b11='IvrCampaigns';return db[_0x74b0('0x50')][_0x74b0('0x4a')]({'where':{'name':_0x7e7b11,'userProfileId':_0x59d4b1[_0x74b0('0x51')]},'raw':!![]})[_0x74b0('0x23')](function(_0x5a928f){if(_0x5a928f&&_0x5a928f[_0x74b0('0x52')]===0x0){return db[_0x74b0('0x26')][_0x74b0('0x4b')]({'name':_0x1c1881['name'],'resourceId':_0x1c1881['id'],'type':_0x5a928f['name'],'sectionId':_0x5a928f['id']},{})[_0x74b0('0x23')](function(){return _0x3cb5f6;});}else{return _0x3cb5f6;}})[_0x74b0('0x45')](function(_0x5ad44f){logger['error'](_0x74b0('0x53'),_0x5ad44f);throw _0x5ad44f;});}return _0x3cb5f6;});}})[_0x74b0('0x23')](respondWithResult(_0x239a1,0xc9))[_0x74b0('0x45')](handleError(_0x239a1,null));};exports[_0x74b0('0x22')]=function(_0x12124f,_0x2a39bf){if(_0x12124f[_0x74b0('0x57')]['id']){delete _0x12124f['body']['id'];}return db[_0x74b0('0x2d')][_0x74b0('0x4a')]({'where':{'id':_0x12124f['params']['id']}})[_0x74b0('0x23')](handleEntityNotFound(_0x2a39bf,null))[_0x74b0('0x23')](saveUpdates(_0x12124f[_0x74b0('0x57')],null))['then'](respondWithResult(_0x2a39bf,null))[_0x74b0('0x45')](handleError(_0x2a39bf,null));};exports[_0x74b0('0x24')]=function(_0x259b37,_0x5c4e42){return db[_0x74b0('0x2d')][_0x74b0('0x4a')]({'where':{'id':_0x259b37[_0x74b0('0x47')]['id']}})['then'](handleEntityNotFound(_0x5c4e42,null))[_0x74b0('0x23')](removeEntity(_0x5c4e42,null))['catch'](handleError(_0x5c4e42,null));};exports[_0x74b0('0x58')]=function(_0x564701,_0x2774fc,_0xc7ded0){var _0x56657e={'raw':!![],'where':{}};var _0x4bf99b={};var _0x33682e={'count':0x0,'rows':[]};return db[_0x74b0('0x2d')][_0x74b0('0x59')]({'where':{'id':_0x564701[_0x74b0('0x47')]['id']}})[_0x74b0('0x23')](handleEntityNotFound(_0x2774fc,null))[_0x74b0('0x23')](function(_0x101d0c){if(_0x101d0c){_0x4bf99b[_0x74b0('0x32')]=_[_0x74b0('0x34')](db[_0x74b0('0x5a')][_0x74b0('0x2e')]);_0x4bf99b[_0x74b0('0x35')]=_[_0x74b0('0x34')](_0x564701[_0x74b0('0x35')]);_0x4bf99b['filters']=_[_0x74b0('0x37')](_0x4bf99b[_0x74b0('0x32')],_0x4bf99b['query']);_0x56657e['attributes']=_[_0x74b0('0x37')](_0x4bf99b[_0x74b0('0x32')],qs[_0x74b0('0x38')](_0x564701['query'][_0x74b0('0x38')]));_0x56657e[_0x74b0('0x39')]=_0x56657e[_0x74b0('0x39')][_0x74b0('0x48')]?_0x56657e[_0x74b0('0x39')]:_0x4bf99b[_0x74b0('0x32')];if(!_0x564701[_0x74b0('0x35')][_0x74b0('0x3a')]('nolimit')){_0x56657e[_0x74b0('0x1b')]=qs[_0x74b0('0x1b')](_0x564701[_0x74b0('0x35')]['limit']);_0x56657e[_0x74b0('0x1a')]=qs[_0x74b0('0x1a')](_0x564701[_0x74b0('0x35')][_0x74b0('0x1a')]);}_0x56657e[_0x74b0('0x3c')]=qs[_0x74b0('0x3d')](_0x564701[_0x74b0('0x35')][_0x74b0('0x3d')]);_0x56657e[_0x74b0('0x3e')]=qs[_0x74b0('0x36')](_[_0x74b0('0x3f')](_0x564701['query'],_0x4bf99b[_0x74b0('0x36')]));_0x56657e[_0x74b0('0x3e')][_0x74b0('0x5b')]=_0x101d0c['id'];if(_0x564701['query'][_0x74b0('0x40')]){_0x56657e[_0x74b0('0x3e')]=_['merge'](_0x56657e[_0x74b0('0x3e')],{'$or':_[_0x74b0('0x33')](_0x56657e[_0x74b0('0x39')],function(_0xc671b){var _0x35a3e6={};_0x35a3e6[_0xc671b]={'$like':'%'+_0x564701[_0x74b0('0x35')]['filter']+'%'};return _0x35a3e6;})});}_0x56657e=_['merge']({},_0x56657e,_0x564701[_0x74b0('0x42')]);return db[_0x74b0('0x5a')][_0x74b0('0x1d')]({'where':_0x56657e[_0x74b0('0x3e')]})[_0x74b0('0x23')](function(_0x5d5339){_0x33682e['count']=_0x5d5339;if(_0x564701[_0x74b0('0x35')][_0x74b0('0x49')]){_0x56657e[_0x74b0('0x5c')]=[{'all':!![]}];}return db['CmHopper'][_0x74b0('0x43')](_0x56657e);})['then'](function(_0x4e9abd){_0x33682e['rows']=_0x4e9abd;return _0x33682e;});}})[_0x74b0('0x23')](respondWithFilteredResult(_0x2774fc,_0x56657e))[_0x74b0('0x45')](handleError(_0x2774fc,null));};exports[_0x74b0('0x5d')]=function(_0x3b6a69,_0x23bc89,_0x316c58){var _0x4cbfc5={'raw':!![],'where':{}};var _0x29bb53={};var _0x388891={'count':0x0,'rows':[]};return db[_0x74b0('0x2d')]['findOne']({'where':{'id':_0x3b6a69['params']['id']}})[_0x74b0('0x23')](handleEntityNotFound(_0x23bc89,null))['then'](function(_0x16b216){if(_0x16b216){_0x29bb53['model']=_[_0x74b0('0x34')](db[_0x74b0('0x5e')][_0x74b0('0x2e')]);_0x29bb53[_0x74b0('0x35')]=_[_0x74b0('0x34')](_0x3b6a69['query']);_0x29bb53[_0x74b0('0x36')]=_[_0x74b0('0x37')](_0x29bb53[_0x74b0('0x32')],_0x29bb53['query']);_0x4cbfc5['attributes']=_['intersection'](_0x29bb53['model'],qs[_0x74b0('0x38')](_0x3b6a69['query'][_0x74b0('0x38')]));_0x4cbfc5[_0x74b0('0x39')]=_0x4cbfc5['attributes'][_0x74b0('0x48')]?_0x4cbfc5[_0x74b0('0x39')]:_0x29bb53[_0x74b0('0x32')];if(!_0x3b6a69['query']['hasOwnProperty'](_0x74b0('0x3b'))){_0x4cbfc5[_0x74b0('0x1b')]=qs['limit'](_0x3b6a69[_0x74b0('0x35')][_0x74b0('0x1b')]);_0x4cbfc5[_0x74b0('0x1a')]=qs[_0x74b0('0x1a')](_0x3b6a69['query']['offset']);}_0x4cbfc5[_0x74b0('0x3c')]=qs[_0x74b0('0x3d')](_0x3b6a69['query'][_0x74b0('0x3d')]);_0x4cbfc5['where']=qs[_0x74b0('0x36')](_['pick'](_0x3b6a69['query'],_0x29bb53[_0x74b0('0x36')]));_0x4cbfc5[_0x74b0('0x3e')][_0x74b0('0x5b')]=_0x16b216['id'];if(_0x3b6a69['query']['filter']){_0x4cbfc5['where']=_[_0x74b0('0x41')](_0x4cbfc5[_0x74b0('0x3e')],{'$or':_['map'](_0x4cbfc5['attributes'],function(_0x1f9e24){var _0x76cc1c={};_0x76cc1c[_0x1f9e24]={'$like':'%'+_0x3b6a69['query']['filter']+'%'};return _0x76cc1c;})});}_0x4cbfc5=_[_0x74b0('0x41')]({},_0x4cbfc5,_0x3b6a69['options']);return db[_0x74b0('0x5e')][_0x74b0('0x1d')]({'where':_0x4cbfc5[_0x74b0('0x3e')]})[_0x74b0('0x23')](function(_0x22f981){_0x388891[_0x74b0('0x1d')]=_0x22f981;if(_0x3b6a69[_0x74b0('0x35')]['includeAll']){_0x4cbfc5[_0x74b0('0x5c')]=[{'all':!![]}];}return db[_0x74b0('0x5e')]['findAll'](_0x4cbfc5);})[_0x74b0('0x23')](function(_0x17cf1a){_0x388891[_0x74b0('0x44')]=_0x17cf1a;return _0x388891;});}})['then'](respondWithFilteredResult(_0x23bc89,_0x4cbfc5))['catch'](handleError(_0x23bc89,null));};exports['getHopperFinals']=function(_0x23970,_0x1a2bb2,_0x228b62){var _0x34e1ef={'raw':!![],'where':{}};var _0x504157={};var _0xcafc5b={'count':0x0,'rows':[]};return db['Campaign'][_0x74b0('0x59')]({'where':{'id':_0x23970[_0x74b0('0x47')]['id']}})[_0x74b0('0x23')](handleEntityNotFound(_0x1a2bb2,null))[_0x74b0('0x23')](function(_0x18e4e2){if(_0x18e4e2){_0x504157[_0x74b0('0x32')]=_['keys'](db[_0x74b0('0x5f')]['rawAttributes']);_0x504157[_0x74b0('0x35')]=_[_0x74b0('0x34')](_0x23970[_0x74b0('0x35')]);_0x504157['filters']=_['intersection'](_0x504157[_0x74b0('0x32')],_0x504157['query']);_0x34e1ef[_0x74b0('0x39')]=_[_0x74b0('0x37')](_0x504157[_0x74b0('0x32')],qs[_0x74b0('0x38')](_0x23970[_0x74b0('0x35')][_0x74b0('0x38')]));_0x34e1ef[_0x74b0('0x39')]=_0x34e1ef['attributes']['length']?_0x34e1ef[_0x74b0('0x39')]:_0x504157[_0x74b0('0x32')];if(!_0x23970['query'][_0x74b0('0x3a')](_0x74b0('0x3b'))){_0x34e1ef[_0x74b0('0x1b')]=qs[_0x74b0('0x1b')](_0x23970[_0x74b0('0x35')][_0x74b0('0x1b')]);_0x34e1ef[_0x74b0('0x1a')]=qs[_0x74b0('0x1a')](_0x23970[_0x74b0('0x35')][_0x74b0('0x1a')]);}_0x34e1ef[_0x74b0('0x3c')]=qs[_0x74b0('0x3d')](_0x23970[_0x74b0('0x35')][_0x74b0('0x3d')]);_0x34e1ef[_0x74b0('0x3e')]=qs[_0x74b0('0x36')](_[_0x74b0('0x3f')](_0x23970[_0x74b0('0x35')],_0x504157[_0x74b0('0x36')]));_0x34e1ef[_0x74b0('0x3e')][_0x74b0('0x5b')]=_0x18e4e2['id'];if(_0x23970[_0x74b0('0x35')][_0x74b0('0x40')]){_0x34e1ef[_0x74b0('0x3e')]=_[_0x74b0('0x41')](_0x34e1ef[_0x74b0('0x3e')],{'$or':_['map'](_0x34e1ef[_0x74b0('0x39')],function(_0x574491){var _0xbf0283={};_0xbf0283[_0x574491]={'$like':'%'+_0x23970[_0x74b0('0x35')][_0x74b0('0x40')]+'%'};return _0xbf0283;})});}_0x34e1ef=_['merge']({},_0x34e1ef,_0x23970[_0x74b0('0x42')]);return db[_0x74b0('0x5f')][_0x74b0('0x1d')]({'where':_0x34e1ef[_0x74b0('0x3e')]})[_0x74b0('0x23')](function(_0x2243ea){_0xcafc5b[_0x74b0('0x1d')]=_0x2243ea;if(_0x23970[_0x74b0('0x35')][_0x74b0('0x49')]){_0x34e1ef[_0x74b0('0x5c')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x74b0('0x43')](_0x34e1ef);})[_0x74b0('0x23')](function(_0x2841dc){_0xcafc5b['rows']=_0x2841dc;return _0xcafc5b;});}})['then'](respondWithFilteredResult(_0x1a2bb2,_0x34e1ef))['catch'](handleError(_0x1a2bb2,null));};exports[_0x74b0('0x60')]=function(_0x49816e,_0x16692c,_0xb62734){var _0x419b2d={'raw':!![],'where':{}};var _0x38ef7f={};var _0x5a32be={'count':0x0,'rows':[]};return db['Campaign'][_0x74b0('0x59')]({'where':{'id':_0x49816e[_0x74b0('0x47')]['id']}})[_0x74b0('0x23')](handleEntityNotFound(_0x16692c,null))[_0x74b0('0x23')](function(_0x829bdb){if(_0x829bdb){_0x38ef7f[_0x74b0('0x32')]=_[_0x74b0('0x34')](db[_0x74b0('0x61')][_0x74b0('0x2e')]);_0x38ef7f[_0x74b0('0x35')]=_[_0x74b0('0x34')](_0x49816e['query']);_0x38ef7f['filters']=_[_0x74b0('0x37')](_0x38ef7f[_0x74b0('0x32')],_0x38ef7f[_0x74b0('0x35')]);_0x419b2d['attributes']=_['intersection'](_0x38ef7f['model'],qs['fields'](_0x49816e[_0x74b0('0x35')]['fields']));_0x419b2d['attributes']=_0x419b2d['attributes']['length']?_0x419b2d[_0x74b0('0x39')]:_0x38ef7f[_0x74b0('0x32')];if(!_0x49816e[_0x74b0('0x35')][_0x74b0('0x3a')](_0x74b0('0x3b'))){_0x419b2d[_0x74b0('0x1b')]=qs[_0x74b0('0x1b')](_0x49816e[_0x74b0('0x35')][_0x74b0('0x1b')]);_0x419b2d[_0x74b0('0x1a')]=qs['offset'](_0x49816e[_0x74b0('0x35')][_0x74b0('0x1a')]);}_0x419b2d['order']=qs[_0x74b0('0x3d')](_0x49816e['query'][_0x74b0('0x3d')]);_0x419b2d[_0x74b0('0x3e')]=qs['filters'](_[_0x74b0('0x3f')](_0x49816e['query'],_0x38ef7f[_0x74b0('0x36')]));_0x419b2d['where'][_0x74b0('0x5b')]=_0x829bdb['id'];if(_0x49816e[_0x74b0('0x35')][_0x74b0('0x40')]){_0x419b2d['where']=_[_0x74b0('0x41')](_0x419b2d['where'],{'$or':_['map'](_0x419b2d['attributes'],function(_0x371f52){var _0x3ec87c={};_0x3ec87c[_0x371f52]={'$like':'%'+_0x49816e['query'][_0x74b0('0x40')]+'%'};return _0x3ec87c;})});}_0x419b2d=_[_0x74b0('0x41')]({},_0x419b2d,_0x49816e[_0x74b0('0x42')]);return db[_0x74b0('0x61')][_0x74b0('0x1d')]({'where':_0x419b2d[_0x74b0('0x3e')]})[_0x74b0('0x23')](function(_0x5d3ef7){_0x5a32be[_0x74b0('0x1d')]=_0x5d3ef7;if(_0x49816e[_0x74b0('0x35')][_0x74b0('0x49')]){_0x419b2d[_0x74b0('0x5c')]=[{'all':!![]}];}return db[_0x74b0('0x61')][_0x74b0('0x43')](_0x419b2d);})[_0x74b0('0x23')](function(_0x2881e1){_0x5a32be[_0x74b0('0x44')]=_0x2881e1;return _0x5a32be;});}})[_0x74b0('0x23')](respondWithFilteredResult(_0x16692c,_0x419b2d))['catch'](handleError(_0x16692c,null));};exports[_0x74b0('0x62')]=function(_0x1ee531,_0x4aab75,_0x5c614f){var _0x537b47={};var _0x1f68c5={};var _0x4d4a98;var _0x3187e;return db['Campaign'][_0x74b0('0x59')]({'where':{'id':_0x1ee531[_0x74b0('0x47')]['id']}})['then'](handleEntityNotFound(_0x4aab75,null))['then'](function(_0x2a4126){if(_0x2a4126){_0x4d4a98=_0x2a4126;_0x1f68c5[_0x74b0('0x32')]=_[_0x74b0('0x34')](db[_0x74b0('0x63')]['rawAttributes']);_0x1f68c5['query']=_[_0x74b0('0x34')](_0x1ee531[_0x74b0('0x35')]);_0x1f68c5[_0x74b0('0x36')]=_['intersection'](_0x1f68c5[_0x74b0('0x32')],_0x1f68c5[_0x74b0('0x35')]);_0x537b47[_0x74b0('0x39')]=_[_0x74b0('0x37')](_0x1f68c5[_0x74b0('0x32')],qs['fields'](_0x1ee531[_0x74b0('0x35')][_0x74b0('0x38')]));_0x537b47[_0x74b0('0x39')]=_0x537b47[_0x74b0('0x39')][_0x74b0('0x48')]?_0x537b47[_0x74b0('0x39')]:_0x1f68c5['model'];_0x537b47['order']=qs[_0x74b0('0x3d')](_0x1ee531[_0x74b0('0x35')]['sort']);_0x537b47[_0x74b0('0x3e')]=qs[_0x74b0('0x36')](_[_0x74b0('0x3f')](_0x1ee531[_0x74b0('0x35')],_0x1f68c5[_0x74b0('0x36')]));if(_0x1ee531[_0x74b0('0x35')]['filter']){_0x537b47['where']=_[_0x74b0('0x41')](_0x537b47[_0x74b0('0x3e')],{'$or':_[_0x74b0('0x33')](_0x537b47[_0x74b0('0x39')],function(_0x3e10f7){var _0x28cb2e={};_0x28cb2e[_0x3e10f7]={'$like':'%'+_0x1ee531[_0x74b0('0x35')][_0x74b0('0x40')]+'%'};return _0x28cb2e;})});}_0x537b47=_[_0x74b0('0x41')]({},_0x537b47,_0x1ee531[_0x74b0('0x42')]);return _0x4d4a98[_0x74b0('0x62')](_0x537b47);}})[_0x74b0('0x23')](function(_0xfdd8a1){if(_0xfdd8a1){_0x3187e=_0xfdd8a1[_0x74b0('0x48')];if(!_0x1ee531['query'][_0x74b0('0x3a')]('nolimit')){_0x537b47[_0x74b0('0x1b')]=qs[_0x74b0('0x1b')](_0x1ee531[_0x74b0('0x35')]['limit']);_0x537b47[_0x74b0('0x1a')]=qs[_0x74b0('0x1a')](_0x1ee531[_0x74b0('0x35')]['offset']);}return _0x4d4a98[_0x74b0('0x62')](_0x537b47);}})[_0x74b0('0x23')](function(_0x45feb3){if(_0x45feb3){return _0x45feb3?{'count':_0x3187e,'rows':_0x45feb3}:null;}})[_0x74b0('0x23')](respondWithResult(_0x4aab75,null))['catch'](handleError(_0x4aab75,null));};exports[_0x74b0('0x64')]=function(_0x243468,_0x4b6174,_0x43452f){var _0x3dae36,_0x490fa8;var _0x21e057=[];var _0x2b9391=moment()[_0x74b0('0x65')](_0x74b0('0x66'));return db[_0x74b0('0x2d')]['find']({'where':{'id':_0x243468[_0x74b0('0x47')]['id']}})['then'](handleEntityNotFound(_0x4b6174,null))['then'](function(_0xf3fc16){if(_0xf3fc16){_0x490fa8=_0xf3fc16;return _0xf3fc16[_0x74b0('0x64')](_0x243468['body'][_0x74b0('0x67')],_[_0x74b0('0x54')](_0x243468['body'],[_0x74b0('0x67'),'id'])||{});}return null;})[_0x74b0('0x68')](function(_0x22ac25){var _0x3df996;var _0x393323;_0x3dae36=_0x22ac25||[];var _0x454fd6=[];if(_0x22ac25){for(var _0x2b755c=0x0;_0x2b755c<_0x22ac25[_0x74b0('0x48')];_0x2b755c+=0x1){var _0x58e0d1=_0x22ac25[_0x2b755c][_0x74b0('0x25')]({'plain':!![]});_0x490fa8['dialCheckDuplicateType']=_0x243468['body'][_0x74b0('0x69')]?_0x243468['body']['dialCheckDuplicateType']:_0x490fa8['dialCheckDuplicateType'];switch(_0x490fa8[_0x74b0('0x69')]){case'always':_0x3df996=squel['insert']()[_0x74b0('0x6a')](_0x74b0('0x6b'))[_0x74b0('0x6c')](['phone',_0x74b0('0x6d'),_0x74b0('0x6e'),'ListId',_0x74b0('0x5b'),_0x74b0('0x56'),_0x74b0('0x55')],squel[_0x74b0('0x6f')]()[_0x74b0('0x70')]('phone',_0x74b0('0x71'))['field'](_0x74b0('0x72'),_0x74b0('0x6d'))[_0x74b0('0x70')]('id',_0x74b0('0x6e'))[_0x74b0('0x70')](_0x58e0d1[_0x74b0('0x73')][_0x74b0('0x74')](),'ListId')[_0x74b0('0x70')](_0x243468['params']['id'][_0x74b0('0x74')](),_0x74b0('0x5b'))[_0x74b0('0x70')]('\x27'+_0x2b9391+'\x27','createdAt')[_0x74b0('0x70')]('\x27'+_0x2b9391+'\x27',_0x74b0('0x55'))[_0x74b0('0x75')](_0x74b0('0x76'))['where'](_0x74b0('0x77'))[_0x74b0('0x3e')](_0x74b0('0x78'),_0x58e0d1[_0x74b0('0x73')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x74b0('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0x74b0('0x6f')]()[_0x74b0('0x70')](_0x74b0('0x79'))[_0x74b0('0x75')]('cm_hopper_final')[_0x74b0('0x3e')](_0x74b0('0x7a'),_0x243468[_0x74b0('0x47')]['id'][_0x74b0('0x74')]()))[_0x74b0('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0x74b0('0x6f')]()['field'](_0x74b0('0x7b'))[_0x74b0('0x75')](_0x74b0('0x6b'))['where'](_0x74b0('0x7a'),_0x243468['params']['id'][_0x74b0('0x74')]())))[_0x74b0('0x74')]();break;case _0x74b0('0x7c'):_0x3df996=squel[_0x74b0('0x7d')]()['into'](_0x74b0('0x6b'))['fromQuery']([_0x74b0('0x71'),_0x74b0('0x6d'),'ContactId',_0x74b0('0x7e'),_0x74b0('0x5b'),_0x74b0('0x56'),_0x74b0('0x55')],squel[_0x74b0('0x6f')]()[_0x74b0('0x70')](_0x74b0('0x71'),_0x74b0('0x71'))['field'](_0x74b0('0x72'),_0x74b0('0x6d'))[_0x74b0('0x70')]('id',_0x74b0('0x6e'))['field'](_0x58e0d1[_0x74b0('0x73')][_0x74b0('0x74')](),_0x74b0('0x7e'))['field'](_0x243468[_0x74b0('0x47')]['id']['toString'](),_0x74b0('0x5b'))['field']('\x27'+_0x2b9391+'\x27',_0x74b0('0x56'))[_0x74b0('0x70')]('\x27'+_0x2b9391+'\x27',_0x74b0('0x55'))[_0x74b0('0x75')]('cm_contacts')[_0x74b0('0x3e')](_0x74b0('0x77'))[_0x74b0('0x3e')](_0x74b0('0x78'),_0x58e0d1['CmListId'][_0x74b0('0x74')]())[_0x74b0('0x3e')](_0x74b0('0x7f'))[_0x74b0('0x3e')](_0x74b0('0x80'),squel[_0x74b0('0x6f')]()[_0x74b0('0x70')](_0x74b0('0x7b'))[_0x74b0('0x75')](_0x74b0('0x6b'))['where'](_0x74b0('0x7a'),_0x243468[_0x74b0('0x47')]['id']['toString']())))['toString']();break;default:_0x3df996=squel[_0x74b0('0x7d')]()[_0x74b0('0x6a')]('cm_hopper')[_0x74b0('0x6c')]([_0x74b0('0x71'),'scheduledAt',_0x74b0('0x6e'),_0x74b0('0x7e'),_0x74b0('0x5b'),_0x74b0('0x56'),_0x74b0('0x55')],squel['select']()[_0x74b0('0x70')]('phone',_0x74b0('0x71'))[_0x74b0('0x70')]('NOW()',_0x74b0('0x6d'))[_0x74b0('0x70')]('id','ContactId')[_0x74b0('0x70')](_0x58e0d1['CmListId'][_0x74b0('0x74')](),_0x74b0('0x7e'))['field'](_0x243468['params']['id']['toString'](),_0x74b0('0x5b'))[_0x74b0('0x70')]('\x27'+_0x2b9391+'\x27',_0x74b0('0x56'))[_0x74b0('0x70')]('\x27'+_0x2b9391+'\x27','updatedAt')[_0x74b0('0x75')]('cm_contacts')[_0x74b0('0x3e')](_0x74b0('0x77'))['where']('ListId\x20=\x20?',_0x58e0d1[_0x74b0('0x73')][_0x74b0('0x74')]())[_0x74b0('0x3e')]('phone\x20IS\x20NOT\x20NULL'))[_0x74b0('0x74')]();}_0x393323=squel[_0x74b0('0x7d')]()[_0x74b0('0x6a')](_0x74b0('0x81'))[_0x74b0('0x6c')]([_0x74b0('0x82'),_0x74b0('0x6d'),_0x74b0('0x71'),_0x74b0('0x83'),'createdAt','updatedAt'],squel[_0x74b0('0x6f')]()[_0x74b0('0x70')](_0x74b0('0x84'),'id')[_0x74b0('0x70')](_0x74b0('0x72'),_0x74b0('0x6d'))['field'](_0x74b0('0x85'),'phone')[_0x74b0('0x70')](_0x74b0('0x86'),'OrderBy')[_0x74b0('0x70')]('\x27'+_0x2b9391+'\x27',_0x74b0('0x56'))['field']('\x27'+_0x2b9391+'\x27','updatedAt')[_0x74b0('0x75')](_0x74b0('0x87'),'ci')[_0x74b0('0x88')](_0x74b0('0x6b'),'h','h.ContactId\x20=\x20ci.CmContactId')['where']('h.ListId\x20=\x20?',_0x58e0d1['CmListId'][_0x74b0('0x74')]())[_0x74b0('0x3e')](_0x74b0('0x89'),_0x243468['params']['id'][_0x74b0('0x74')]())[_0x74b0('0x3e')]('h.createdAt\x20=\x20?',_0x2b9391))[_0x74b0('0x74')]();_0x454fd6[_0x74b0('0x8a')](db['sequelize'][_0x74b0('0x35')](_0x3df996));_0x21e057['push'](db[_0x74b0('0x8b')]['query'](_0x393323));}return BPromise[_0x74b0('0x8c')](_0x454fd6);}})[_0x74b0('0x23')](function(){return BPromise[_0x74b0('0x8c')](_0x21e057);})[_0x74b0('0x23')](function(){return _0x3dae36;})['then'](respondWithResult(_0x4b6174,null))[_0x74b0('0x45')](handleError(_0x4b6174,null));};exports['removeLists']=function(_0x810174,_0x92aa60,_0x36b312){return db[_0x74b0('0x2d')]['find']({'where':{'id':_0x810174[_0x74b0('0x47')]['id']}})[_0x74b0('0x23')](handleEntityNotFound(_0x92aa60,null))[_0x74b0('0x23')](function(_0x57d79e){if(_0x57d79e){return _0x57d79e[_0x74b0('0x8d')](_0x810174[_0x74b0('0x35')]['ids']);}})[_0x74b0('0x23')](function(_0x1e7dc4){if(_0x1e7dc4){return db[_0x74b0('0x5a')]['destroy']({'where':{'ListId':_0x810174[_0x74b0('0x35')]['ids'],'CampaignId':_0x810174[_0x74b0('0x47')]['id']}})['then'](function(){return _0x1e7dc4;});}})[_0x74b0('0x23')](respondWithStatusCode(_0x92aa60,null))[_0x74b0('0x45')](handleError(_0x92aa60,null));};exports[_0x74b0('0x8e')]=function(_0x2db002,_0x37e172,_0x625064){var _0x43fa6c={};var _0x2edd85={};var _0x57769d;var _0x43b46;return db['Campaign'][_0x74b0('0x59')]({'where':{'id':_0x2db002['params']['id']}})['then'](handleEntityNotFound(_0x37e172,null))[_0x74b0('0x23')](function(_0x30e49f){if(_0x30e49f){_0x57769d=_0x30e49f;_0x2edd85['model']=_[_0x74b0('0x34')](db[_0x74b0('0x63')][_0x74b0('0x2e')]);_0x2edd85[_0x74b0('0x35')]=_[_0x74b0('0x34')](_0x2db002[_0x74b0('0x35')]);_0x2edd85['filters']=_[_0x74b0('0x37')](_0x2edd85[_0x74b0('0x32')],_0x2edd85['query']);_0x43fa6c['attributes']=_['intersection'](_0x2edd85['model'],qs[_0x74b0('0x38')](_0x2db002[_0x74b0('0x35')][_0x74b0('0x38')]));_0x43fa6c[_0x74b0('0x39')]=_0x43fa6c['attributes'][_0x74b0('0x48')]?_0x43fa6c[_0x74b0('0x39')]:_0x2edd85[_0x74b0('0x32')];_0x43fa6c[_0x74b0('0x3c')]=qs[_0x74b0('0x3d')](_0x2db002[_0x74b0('0x35')][_0x74b0('0x3d')]);_0x43fa6c['where']=qs[_0x74b0('0x36')](_['pick'](_0x2db002['query'],_0x2edd85[_0x74b0('0x36')]));if(_0x2db002[_0x74b0('0x35')][_0x74b0('0x40')]){_0x43fa6c['where']=_[_0x74b0('0x41')](_0x43fa6c['where'],{'$or':_['map'](_0x43fa6c[_0x74b0('0x39')],function(_0x47364d){var _0x189918={};_0x189918[_0x47364d]={'$like':'%'+_0x2db002['query'][_0x74b0('0x40')]+'%'};return _0x189918;})});}_0x43fa6c=_[_0x74b0('0x41')]({},_0x43fa6c,_0x2db002[_0x74b0('0x42')]);return _0x57769d[_0x74b0('0x8e')](_0x43fa6c);}})['then'](function(_0x21e73c){if(_0x21e73c){_0x43b46=_0x21e73c[_0x74b0('0x48')];if(!_0x2db002[_0x74b0('0x35')][_0x74b0('0x3a')]('nolimit')){_0x43fa6c[_0x74b0('0x1b')]=qs[_0x74b0('0x1b')](_0x2db002[_0x74b0('0x35')]['limit']);_0x43fa6c[_0x74b0('0x1a')]=qs[_0x74b0('0x1a')](_0x2db002[_0x74b0('0x35')][_0x74b0('0x1a')]);}return _0x57769d[_0x74b0('0x8e')](_0x43fa6c);}})[_0x74b0('0x23')](function(_0x322a3c){if(_0x322a3c){return _0x322a3c?{'count':_0x43b46,'rows':_0x322a3c}:null;}})[_0x74b0('0x23')](respondWithResult(_0x37e172,null))[_0x74b0('0x45')](handleError(_0x37e172,null));};exports['addBlackLists']=function(_0x349586,_0x536583,_0x583bbf){var _0xc03b33,_0x2678da;var _0x5da5d2=[];var _0x54f899=moment()['format'](_0x74b0('0x66'));return db[_0x74b0('0x2d')][_0x74b0('0x4a')]({'where':{'id':_0x349586['params']['id']}})[_0x74b0('0x23')](handleEntityNotFound(_0x536583,null))[_0x74b0('0x23')](function(_0x1d83db){if(_0x1d83db){_0x2678da=_0x1d83db;return _0x1d83db[_0x74b0('0x8f')](_0x349586[_0x74b0('0x57')][_0x74b0('0x67')],_[_0x74b0('0x54')](_0x349586[_0x74b0('0x57')],['ids','id'])||{});}return null;})[_0x74b0('0x68')](function(_0x37bf70){var _0x502f10;var _0x15c4cc;_0xc03b33=_0x37bf70||[];var _0x240087=[];if(_0x37bf70){for(var _0xd8d8f3=0x0;_0xd8d8f3<_0x37bf70[_0x74b0('0x48')];_0xd8d8f3+=0x1){var _0x2a4fe7=_0x37bf70[_0xd8d8f3][_0x74b0('0x25')]({'plain':!![]});_0x502f10=squel[_0x74b0('0x7d')]()[_0x74b0('0x6a')](_0x74b0('0x90'))[_0x74b0('0x6c')]([_0x74b0('0x71'),_0x74b0('0x6e'),'ListId',_0x74b0('0x5b'),_0x74b0('0x56'),_0x74b0('0x55')],squel[_0x74b0('0x6f')]()['field'](_0x74b0('0x71'),_0x74b0('0x71'))[_0x74b0('0x70')]('id',_0x74b0('0x6e'))['field'](_0x2a4fe7[_0x74b0('0x73')][_0x74b0('0x74')](),_0x74b0('0x7e'))[_0x74b0('0x70')](_0x349586[_0x74b0('0x47')]['id'][_0x74b0('0x74')](),'CampaignId')['field'](_0x74b0('0x72'),_0x74b0('0x56'))[_0x74b0('0x70')](_0x74b0('0x72'),'updatedAt')[_0x74b0('0x75')](_0x74b0('0x76'))[_0x74b0('0x3e')](_0x74b0('0x77'))[_0x74b0('0x3e')](_0x74b0('0x78'),_0x2a4fe7['CmListId']['toString']())[_0x74b0('0x3e')](_0x74b0('0x7f')))[_0x74b0('0x74')]();_0x240087[_0x74b0('0x8a')](db[_0x74b0('0x8b')][_0x74b0('0x35')](_0x502f10));}return BPromise['all'](_0x240087);}})[_0x74b0('0x23')](function(){return _0xc03b33;})[_0x74b0('0x23')](respondWithResult(_0x536583,null))['catch'](handleError(_0x536583,null));};exports[_0x74b0('0x91')]=function(_0x36dd0a,_0x550108,_0x578110){return db[_0x74b0('0x2d')]['find']({'where':{'id':_0x36dd0a['params']['id']}})['then'](handleEntityNotFound(_0x550108,null))[_0x74b0('0x23')](function(_0x38726b){if(_0x38726b){return _0x38726b[_0x74b0('0x91')](_0x36dd0a['query']['ids']);}})[_0x74b0('0x23')](function(_0x34a597){if(_0x34a597){return db['CmHopperBlack'][_0x74b0('0x24')]({'where':{'ListId':_0x36dd0a[_0x74b0('0x35')][_0x74b0('0x67')],'CampaignId':_0x36dd0a[_0x74b0('0x47')]['id']}})['then'](function(){return _0x34a597;});}})[_0x74b0('0x23')](respondWithStatusCode(_0x550108,null))['catch'](handleError(_0x550108,null));};
\ No newline at end of file
+var _0x60d7=['phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','fromQuery','from','cm_hopper_additional_phones','OrderBy','cm_contact_has_items','join','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','ids','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','catch','show','params','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','omit','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','findOne','CmHopper','hasOwnProperty','nolimit','CampaignId','CmHopperHistory','findAll','rows','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','spread','dialCheckDuplicateType','always','insert','into','phone','scheduledAt','ContactId','ListId','select','field','NOW()','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x60d7,0x139));var _0x760d=function(_0x240a1e,_0x2197e4){_0x240a1e=_0x240a1e-0x0;var _0x57d810=_0x60d7[_0x240a1e];return _0x57d810;};'use strict';var emlformat=require(_0x760d('0x0'));var rimraf=require(_0x760d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x760d('0x2'));var rp=require('request-promise');var moment=require(_0x760d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x760d('0x4'));var util=require(_0x760d('0x5'));var path=require(_0x760d('0x6'));var sox=require(_0x760d('0x7'));var csv=require('to-csv');var ejs=require(_0x760d('0x8'));var fs=require('fs');var fs_extra=require(_0x760d('0x9'));var _=require(_0x760d('0xa'));var squel=require(_0x760d('0xb'));var crypto=require(_0x760d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x760d('0xd'));var toCsv=require(_0x760d('0xe'));var querystring=require(_0x760d('0xf'));var Papa=require('papaparse');var Redis=require(_0x760d('0x10'));var authService=require(_0x760d('0x11'));var qs=require(_0x760d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x760d('0x13'));var logger=require(_0x760d('0x14'))('api');var utils=require(_0x760d('0x15'));var config=require(_0x760d('0x16'));var licenseUtil=require(_0x760d('0x17'));var db=require(_0x760d('0x18'))['db'];function respondWithStatusCode(_0x1c6d0d,_0x40b3ee){_0x40b3ee=_0x40b3ee||0xcc;return function(_0xffb1f9){if(_0xffb1f9){return _0x1c6d0d[_0x760d('0x19')](_0x40b3ee);}return _0x1c6d0d[_0x760d('0x1a')](_0x40b3ee)[_0x760d('0x1b')]();};}function respondWithResult(_0x28bd1b,_0x543d6e){_0x543d6e=_0x543d6e||0xc8;return function(_0x1fed3a){if(_0x1fed3a){return _0x28bd1b['status'](_0x543d6e)[_0x760d('0x1c')](_0x1fed3a);}};}function respondWithFilteredResult(_0x62b5e9,_0x13118d){return function(_0x86e62a){if(_0x86e62a){var _0x49c0d4=typeof _0x13118d['offset']===_0x760d('0x1d')&&typeof _0x13118d[_0x760d('0x1e')]===_0x760d('0x1d');var _0x436bbd=_0x86e62a[_0x760d('0x1f')];var _0x1bed8=_0x49c0d4?0x0:_0x13118d['offset'];var _0x49cac3=_0x49c0d4?_0x86e62a[_0x760d('0x1f')]:_0x13118d[_0x760d('0x20')]+_0x13118d[_0x760d('0x1e')];var _0x2bbf82;if(_0x49cac3>=_0x436bbd){_0x49cac3=_0x436bbd;_0x2bbf82=0xc8;}else{_0x2bbf82=0xce;}_0x62b5e9[_0x760d('0x1a')](_0x2bbf82);return _0x62b5e9[_0x760d('0x21')](_0x760d('0x22'),_0x1bed8+'-'+_0x49cac3+'/'+_0x436bbd)[_0x760d('0x1c')](_0x86e62a);}return null;};}function patchUpdates(_0x37d5a5){return function(_0x2f74b5){try{jsonpatch['apply'](_0x2f74b5,_0x37d5a5,!![]);}catch(_0xf3c65f){return BPromise[_0x760d('0x23')](_0xf3c65f);}return _0x2f74b5[_0x760d('0x24')]();};}function saveUpdates(_0x2797bf,_0x234934){return function(_0x57dcea){if(_0x57dcea){return _0x57dcea[_0x760d('0x25')](_0x2797bf)[_0x760d('0x26')](function(_0x1fac3c){return _0x1fac3c;});}return null;};}function removeEntity(_0x516133,_0x55b45a){return function(_0x44b653){if(_0x44b653){return _0x44b653[_0x760d('0x27')]()[_0x760d('0x26')](function(){var _0x19cd53=_0x44b653[_0x760d('0x28')]({'plain':!![]});var _0x16bbdb=_0x760d('0x29');return db[_0x760d('0x2a')]['destroy']({'where':{'type':_0x16bbdb,'resourceId':_0x19cd53['id']}})[_0x760d('0x26')](function(){return _0x44b653;});})[_0x760d('0x26')](function(){_0x516133[_0x760d('0x1a')](0xcc)[_0x760d('0x1b')]();});}};}function handleEntityNotFound(_0x47c5e6,_0x2b2251){return function(_0x58b4fb){if(!_0x58b4fb){_0x47c5e6['sendStatus'](0x194);}return _0x58b4fb;};}function handleError(_0x10696b,_0x4619ed){_0x4619ed=_0x4619ed||0x1f4;return function(_0x3bb676){logger[_0x760d('0x2b')](_0x3bb676[_0x760d('0x2c')]);if(_0x3bb676[_0x760d('0x2d')]){delete _0x3bb676[_0x760d('0x2d')];}_0x10696b[_0x760d('0x1a')](_0x4619ed)['send'](_0x3bb676);};}exports[_0x760d('0x2e')]=function(_0xc4fec8,_0x27cb58){var _0x149732={},_0x4b5bfb={},_0x5584c7={'count':0x0,'rows':[]};var _0x47ef8f=_[_0x760d('0x2f')](db[_0x760d('0x30')][_0x760d('0x31')],function(_0x3cd782){return{'name':_0x3cd782[_0x760d('0x32')],'type':_0x3cd782[_0x760d('0x33')][_0x760d('0x34')]};});_0x4b5bfb[_0x760d('0x35')]=_[_0x760d('0x2f')](_0x47ef8f,_0x760d('0x2d'));_0x4b5bfb[_0x760d('0x36')]=_[_0x760d('0x37')](_0xc4fec8['query']);_0x4b5bfb[_0x760d('0x38')]=_[_0x760d('0x39')](_0x4b5bfb['model'],_0x4b5bfb['query']);_0x149732[_0x760d('0x3a')]=_[_0x760d('0x39')](_0x4b5bfb['model'],qs[_0x760d('0x3b')](_0xc4fec8['query']['fields']));_0x149732[_0x760d('0x3a')]=_0x149732[_0x760d('0x3a')][_0x760d('0x3c')]?_0x149732[_0x760d('0x3a')]:_0x4b5bfb[_0x760d('0x35')];if(!_0xc4fec8['query']['hasOwnProperty']('nolimit')){_0x149732['limit']=qs[_0x760d('0x1e')](_0xc4fec8[_0x760d('0x36')][_0x760d('0x1e')]);_0x149732[_0x760d('0x20')]=qs[_0x760d('0x20')](_0xc4fec8[_0x760d('0x36')]['offset']);}_0x149732[_0x760d('0x3d')]=qs[_0x760d('0x3e')](_0xc4fec8[_0x760d('0x36')][_0x760d('0x3e')]);_0x149732[_0x760d('0x3f')]=qs[_0x760d('0x38')](_[_0x760d('0x40')](_0xc4fec8[_0x760d('0x36')],_0x4b5bfb['filters']),_0x47ef8f);if(_0xc4fec8[_0x760d('0x36')]['filter']){_0x149732[_0x760d('0x3f')]=_[_0x760d('0x41')](_0x149732['where'],{'$or':_[_0x760d('0x2f')](_0x47ef8f,function(_0x551e9d){if(_0x551e9d['type']!==_0x760d('0x42')){var _0x4ef63f={};_0x4ef63f[_0x551e9d['name']]={'$like':'%'+_0xc4fec8[_0x760d('0x36')][_0x760d('0x43')]+'%'};return _0x4ef63f;}})});}_0x149732=_[_0x760d('0x41')]({},_0x149732,_0xc4fec8['options']);var _0x57d950={'where':_0x149732['where']};return db[_0x760d('0x30')][_0x760d('0x1f')](_0x57d950)[_0x760d('0x26')](function(_0x3be521){_0x5584c7[_0x760d('0x1f')]=_0x3be521;if(_0xc4fec8[_0x760d('0x36')][_0x760d('0x44')]){_0x149732[_0x760d('0x45')]=[{'all':!![]}];}return db[_0x760d('0x30')]['findAll'](_0x149732);})['then'](function(_0x3dbc36){_0x5584c7['rows']=_0x3dbc36;return _0x5584c7;})[_0x760d('0x26')](respondWithFilteredResult(_0x27cb58,_0x149732))[_0x760d('0x46')](handleError(_0x27cb58,null));};exports[_0x760d('0x47')]=function(_0xe11b50,_0x2e4df3){var _0x974af2={'raw':![],'where':{'id':_0xe11b50[_0x760d('0x48')]['id']}},_0x18d132={};_0x18d132[_0x760d('0x35')]=_[_0x760d('0x37')](db[_0x760d('0x30')][_0x760d('0x31')]);_0x18d132[_0x760d('0x36')]=_[_0x760d('0x37')](_0xe11b50[_0x760d('0x36')]);_0x18d132[_0x760d('0x38')]=_[_0x760d('0x39')](_0x18d132['model'],_0x18d132['query']);_0x974af2['attributes']=_['intersection'](_0x18d132[_0x760d('0x35')],qs[_0x760d('0x3b')](_0xe11b50[_0x760d('0x36')]['fields']));_0x974af2[_0x760d('0x3a')]=_0x974af2[_0x760d('0x3a')][_0x760d('0x3c')]?_0x974af2[_0x760d('0x3a')]:_0x18d132[_0x760d('0x35')];if(_0xe11b50[_0x760d('0x36')]['includeAll']){_0x974af2[_0x760d('0x45')]=[{'all':!![]}];}_0x974af2=_[_0x760d('0x41')]({},_0x974af2,_0xe11b50[_0x760d('0x49')]);return db[_0x760d('0x30')][_0x760d('0x4a')](_0x974af2)[_0x760d('0x26')](handleEntityNotFound(_0x2e4df3,null))[_0x760d('0x26')](respondWithResult(_0x2e4df3,null))[_0x760d('0x46')](handleError(_0x2e4df3,null));};exports[_0x760d('0x4b')]=function(_0x823b7b,_0x5b7555){return db['Campaign'][_0x760d('0x4b')](_0x823b7b[_0x760d('0x4c')],{})['then'](function(_0xa211d6){var _0x5f1e09=_0x823b7b[_0x760d('0x4d')]['get']({'plain':!![]});if(!_0x5f1e09)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5f1e09[_0x760d('0x4e')]===_0x760d('0x4d')){var _0x3dbfa5=_0xa211d6[_0x760d('0x28')]({'plain':!![]});var _0x5d6426=_0x760d('0x29');return db[_0x760d('0x4f')]['find']({'where':{'name':_0x5d6426,'userProfileId':_0x5f1e09[_0x760d('0x50')]},'raw':!![]})['then'](function(_0x453582){if(_0x453582&&_0x453582[_0x760d('0x51')]===0x0){return db[_0x760d('0x2a')]['create']({'name':_0x3dbfa5[_0x760d('0x2d')],'resourceId':_0x3dbfa5['id'],'type':_0x453582[_0x760d('0x2d')],'sectionId':_0x453582['id']},{})[_0x760d('0x26')](function(){return _0xa211d6;});}else{return _0xa211d6;}})[_0x760d('0x46')](function(_0x102e7d){logger[_0x760d('0x2b')](_0x760d('0x52'),_0x102e7d);throw _0x102e7d;});}return _0xa211d6;})['then'](respondWithResult(_0x5b7555,0xc9))[_0x760d('0x46')](handleError(_0x5b7555,null));};exports[_0x760d('0x53')]=function(_0x6dbc5b,_0xc7610d){var _0x187e28={'where':{'id':_0x6dbc5b['params']['id']}},_0x83749a={};_0x83749a['model']=_[_0x760d('0x37')](db[_0x760d('0x30')]['rawAttributes']);_0x187e28[_0x760d('0x3a')]=_[_0x760d('0x39')](_0x83749a['model'],qs[_0x760d('0x3b')](_0x6dbc5b['query'][_0x760d('0x3b')]));_0x187e28[_0x760d('0x3a')]=_0x187e28[_0x760d('0x3a')][_0x760d('0x3c')]?_0x187e28[_0x760d('0x3a')]:_0x83749a['model'];if(_0x6dbc5b[_0x760d('0x36')][_0x760d('0x44')]){_0x187e28[_0x760d('0x45')]=[{'all':!![]}];}_0x187e28=_[_0x760d('0x41')]({},_0x187e28,_0x6dbc5b[_0x760d('0x49')]);return db[_0x760d('0x30')][_0x760d('0x4a')](_0x187e28)[_0x760d('0x26')](handleEntityNotFound(_0xc7610d,null))[_0x760d('0x26')](function(_0x23fc40){if(_0x23fc40){var _0x42b713=_0x23fc40[_0x760d('0x28')]({'plain':!![]});_0x42b713=qs['omit'](_0x42b713,['id','createdAt',_0x760d('0x54')]);_0x6dbc5b[_0x760d('0x4c')]=_[_0x760d('0x55')](_0x6dbc5b[_0x760d('0x4c')],['id',_0x760d('0x56'),_0x760d('0x54')]);return db[_0x760d('0x30')][_0x760d('0x4b')](_[_0x760d('0x41')](_0x42b713,_0x6dbc5b[_0x760d('0x4c')]),{'include':_0x6dbc5b[_0x760d('0x36')][_0x760d('0x44')]?[{'all':!![]}]:undefined})[_0x760d('0x26')](function(_0x4084a8){var _0x322be2=_0x6dbc5b[_0x760d('0x4d')]['get']({'plain':!![]});if(!_0x322be2)throw new Error(_0x760d('0x57'));if(_0x322be2[_0x760d('0x4e')]===_0x760d('0x4d')){var _0x36dfa0=_0x4084a8[_0x760d('0x28')]({'plain':!![]});var _0x5ca3f7=_0x760d('0x29');return db['UserProfileSection'][_0x760d('0x4a')]({'where':{'name':_0x5ca3f7,'userProfileId':_0x322be2[_0x760d('0x50')]},'raw':!![]})[_0x760d('0x26')](function(_0x1fddbe){if(_0x1fddbe&&_0x1fddbe['autoAssociation']===0x0){return db[_0x760d('0x2a')][_0x760d('0x4b')]({'name':_0x36dfa0['name'],'resourceId':_0x36dfa0['id'],'type':_0x1fddbe[_0x760d('0x2d')],'sectionId':_0x1fddbe['id']},{})[_0x760d('0x26')](function(){return _0x4084a8;});}else{return _0x4084a8;}})[_0x760d('0x46')](function(_0x30d6ec){logger[_0x760d('0x2b')](_0x760d('0x52'),_0x30d6ec);throw _0x30d6ec;});}return _0x4084a8;});}})[_0x760d('0x26')](respondWithResult(_0xc7610d,0xc9))['catch'](handleError(_0xc7610d,null));};exports[_0x760d('0x25')]=function(_0x509100,_0x3ad4bc){if(_0x509100[_0x760d('0x4c')]['id']){delete _0x509100[_0x760d('0x4c')]['id'];}return db['Campaign'][_0x760d('0x4a')]({'where':{'id':_0x509100['params']['id']}})[_0x760d('0x26')](handleEntityNotFound(_0x3ad4bc,null))[_0x760d('0x26')](saveUpdates(_0x509100[_0x760d('0x4c')],null))[_0x760d('0x26')](respondWithResult(_0x3ad4bc,null))[_0x760d('0x46')](handleError(_0x3ad4bc,null));};exports['destroy']=function(_0x1c52f5,_0x17baa4){return db[_0x760d('0x30')]['find']({'where':{'id':_0x1c52f5[_0x760d('0x48')]['id']}})[_0x760d('0x26')](handleEntityNotFound(_0x17baa4,null))[_0x760d('0x26')](removeEntity(_0x17baa4,null))['catch'](handleError(_0x17baa4,null));};exports['getHoppers']=function(_0x5aea04,_0x292b0f,_0x356959){var _0x56b2c2={'raw':!![],'where':{}};var _0x55bd28={};var _0x2ccd9b={'count':0x0,'rows':[]};return db[_0x760d('0x30')][_0x760d('0x58')]({'where':{'id':_0x5aea04[_0x760d('0x48')]['id']}})[_0x760d('0x26')](handleEntityNotFound(_0x292b0f,null))[_0x760d('0x26')](function(_0x1483db){if(_0x1483db){_0x55bd28[_0x760d('0x35')]=_[_0x760d('0x37')](db[_0x760d('0x59')]['rawAttributes']);_0x55bd28[_0x760d('0x36')]=_[_0x760d('0x37')](_0x5aea04['query']);_0x55bd28['filters']=_[_0x760d('0x39')](_0x55bd28[_0x760d('0x35')],_0x55bd28['query']);_0x56b2c2[_0x760d('0x3a')]=_[_0x760d('0x39')](_0x55bd28['model'],qs[_0x760d('0x3b')](_0x5aea04['query'][_0x760d('0x3b')]));_0x56b2c2['attributes']=_0x56b2c2[_0x760d('0x3a')][_0x760d('0x3c')]?_0x56b2c2['attributes']:_0x55bd28['model'];if(!_0x5aea04[_0x760d('0x36')][_0x760d('0x5a')](_0x760d('0x5b'))){_0x56b2c2['limit']=qs[_0x760d('0x1e')](_0x5aea04['query']['limit']);_0x56b2c2[_0x760d('0x20')]=qs[_0x760d('0x20')](_0x5aea04[_0x760d('0x36')]['offset']);}_0x56b2c2['order']=qs[_0x760d('0x3e')](_0x5aea04[_0x760d('0x36')][_0x760d('0x3e')]);_0x56b2c2[_0x760d('0x3f')]=qs[_0x760d('0x38')](_[_0x760d('0x40')](_0x5aea04['query'],_0x55bd28[_0x760d('0x38')]));_0x56b2c2[_0x760d('0x3f')][_0x760d('0x5c')]=_0x1483db['id'];if(_0x5aea04[_0x760d('0x36')]['filter']){_0x56b2c2[_0x760d('0x3f')]=_[_0x760d('0x41')](_0x56b2c2['where'],{'$or':_[_0x760d('0x2f')](_0x56b2c2['attributes'],function(_0xee30f9){var _0x3702b2={};_0x3702b2[_0xee30f9]={'$like':'%'+_0x5aea04[_0x760d('0x36')][_0x760d('0x43')]+'%'};return _0x3702b2;})});}_0x56b2c2=_[_0x760d('0x41')]({},_0x56b2c2,_0x5aea04['options']);return db['CmHopper'][_0x760d('0x1f')]({'where':_0x56b2c2[_0x760d('0x3f')]})['then'](function(_0x33cb84){_0x2ccd9b[_0x760d('0x1f')]=_0x33cb84;if(_0x5aea04['query'][_0x760d('0x44')]){_0x56b2c2[_0x760d('0x45')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x56b2c2);})[_0x760d('0x26')](function(_0x10de79){_0x2ccd9b['rows']=_0x10de79;return _0x2ccd9b;});}})[_0x760d('0x26')](respondWithFilteredResult(_0x292b0f,_0x56b2c2))[_0x760d('0x46')](handleError(_0x292b0f,null));};exports['getHopperHistories']=function(_0x28e84a,_0x571519,_0x45804b){var _0x3c6431={'raw':!![],'where':{}};var _0x4dbb24={};var _0x429579={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x28e84a[_0x760d('0x48')]['id']}})['then'](handleEntityNotFound(_0x571519,null))['then'](function(_0x5d7a8e){if(_0x5d7a8e){_0x4dbb24['model']=_[_0x760d('0x37')](db[_0x760d('0x5d')][_0x760d('0x31')]);_0x4dbb24[_0x760d('0x36')]=_[_0x760d('0x37')](_0x28e84a[_0x760d('0x36')]);_0x4dbb24['filters']=_['intersection'](_0x4dbb24[_0x760d('0x35')],_0x4dbb24['query']);_0x3c6431[_0x760d('0x3a')]=_[_0x760d('0x39')](_0x4dbb24[_0x760d('0x35')],qs['fields'](_0x28e84a[_0x760d('0x36')][_0x760d('0x3b')]));_0x3c6431[_0x760d('0x3a')]=_0x3c6431[_0x760d('0x3a')][_0x760d('0x3c')]?_0x3c6431[_0x760d('0x3a')]:_0x4dbb24[_0x760d('0x35')];if(!_0x28e84a[_0x760d('0x36')][_0x760d('0x5a')](_0x760d('0x5b'))){_0x3c6431[_0x760d('0x1e')]=qs[_0x760d('0x1e')](_0x28e84a[_0x760d('0x36')][_0x760d('0x1e')]);_0x3c6431[_0x760d('0x20')]=qs[_0x760d('0x20')](_0x28e84a['query']['offset']);}_0x3c6431[_0x760d('0x3d')]=qs[_0x760d('0x3e')](_0x28e84a[_0x760d('0x36')][_0x760d('0x3e')]);_0x3c6431['where']=qs[_0x760d('0x38')](_['pick'](_0x28e84a['query'],_0x4dbb24[_0x760d('0x38')]));_0x3c6431[_0x760d('0x3f')][_0x760d('0x5c')]=_0x5d7a8e['id'];if(_0x28e84a['query'][_0x760d('0x43')]){_0x3c6431[_0x760d('0x3f')]=_[_0x760d('0x41')](_0x3c6431[_0x760d('0x3f')],{'$or':_[_0x760d('0x2f')](_0x3c6431[_0x760d('0x3a')],function(_0x211a08){var _0x31d6ee={};_0x31d6ee[_0x211a08]={'$like':'%'+_0x28e84a[_0x760d('0x36')]['filter']+'%'};return _0x31d6ee;})});}_0x3c6431=_[_0x760d('0x41')]({},_0x3c6431,_0x28e84a[_0x760d('0x49')]);return db['CmHopperHistory'][_0x760d('0x1f')]({'where':_0x3c6431[_0x760d('0x3f')]})[_0x760d('0x26')](function(_0x27e44b){_0x429579['count']=_0x27e44b;if(_0x28e84a[_0x760d('0x36')][_0x760d('0x44')]){_0x3c6431['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x760d('0x5e')](_0x3c6431);})[_0x760d('0x26')](function(_0x7ce645){_0x429579[_0x760d('0x5f')]=_0x7ce645;return _0x429579;});}})['then'](respondWithFilteredResult(_0x571519,_0x3c6431))[_0x760d('0x46')](handleError(_0x571519,null));};exports[_0x760d('0x60')]=function(_0x282c3b,_0x4dd845,_0x48f562){var _0x5f24c3={'raw':!![],'where':{}};var _0x135544={};var _0x29219d={'count':0x0,'rows':[]};return db[_0x760d('0x30')][_0x760d('0x58')]({'where':{'id':_0x282c3b[_0x760d('0x48')]['id']}})[_0x760d('0x26')](handleEntityNotFound(_0x4dd845,null))[_0x760d('0x26')](function(_0x18bc64){if(_0x18bc64){_0x135544[_0x760d('0x35')]=_['keys'](db['CmHopperFinal'][_0x760d('0x31')]);_0x135544[_0x760d('0x36')]=_[_0x760d('0x37')](_0x282c3b[_0x760d('0x36')]);_0x135544[_0x760d('0x38')]=_[_0x760d('0x39')](_0x135544[_0x760d('0x35')],_0x135544[_0x760d('0x36')]);_0x5f24c3[_0x760d('0x3a')]=_[_0x760d('0x39')](_0x135544[_0x760d('0x35')],qs[_0x760d('0x3b')](_0x282c3b[_0x760d('0x36')]['fields']));_0x5f24c3['attributes']=_0x5f24c3[_0x760d('0x3a')][_0x760d('0x3c')]?_0x5f24c3['attributes']:_0x135544['model'];if(!_0x282c3b[_0x760d('0x36')][_0x760d('0x5a')](_0x760d('0x5b'))){_0x5f24c3[_0x760d('0x1e')]=qs['limit'](_0x282c3b['query'][_0x760d('0x1e')]);_0x5f24c3[_0x760d('0x20')]=qs[_0x760d('0x20')](_0x282c3b[_0x760d('0x36')]['offset']);}_0x5f24c3[_0x760d('0x3d')]=qs[_0x760d('0x3e')](_0x282c3b[_0x760d('0x36')][_0x760d('0x3e')]);_0x5f24c3[_0x760d('0x3f')]=qs['filters'](_[_0x760d('0x40')](_0x282c3b[_0x760d('0x36')],_0x135544['filters']));_0x5f24c3[_0x760d('0x3f')][_0x760d('0x5c')]=_0x18bc64['id'];if(_0x282c3b[_0x760d('0x36')][_0x760d('0x43')]){_0x5f24c3[_0x760d('0x3f')]=_['merge'](_0x5f24c3[_0x760d('0x3f')],{'$or':_[_0x760d('0x2f')](_0x5f24c3[_0x760d('0x3a')],function(_0x3265d3){var _0x275662={};_0x275662[_0x3265d3]={'$like':'%'+_0x282c3b[_0x760d('0x36')][_0x760d('0x43')]+'%'};return _0x275662;})});}_0x5f24c3=_[_0x760d('0x41')]({},_0x5f24c3,_0x282c3b['options']);return db[_0x760d('0x61')][_0x760d('0x1f')]({'where':_0x5f24c3[_0x760d('0x3f')]})['then'](function(_0x26ffbe){_0x29219d[_0x760d('0x1f')]=_0x26ffbe;if(_0x282c3b[_0x760d('0x36')]['includeAll']){_0x5f24c3[_0x760d('0x45')]=[{'all':!![]}];}return db[_0x760d('0x61')]['findAll'](_0x5f24c3);})[_0x760d('0x26')](function(_0x189885){_0x29219d[_0x760d('0x5f')]=_0x189885;return _0x29219d;});}})['then'](respondWithFilteredResult(_0x4dd845,_0x5f24c3))[_0x760d('0x46')](handleError(_0x4dd845,null));};exports[_0x760d('0x62')]=function(_0x3ff551,_0x35116b,_0x52e16a){var _0x356602={'raw':!![],'where':{}};var _0x28576f={};var _0x165985={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x3ff551[_0x760d('0x48')]['id']}})[_0x760d('0x26')](handleEntityNotFound(_0x35116b,null))['then'](function(_0x364036){if(_0x364036){_0x28576f[_0x760d('0x35')]=_['keys'](db[_0x760d('0x63')][_0x760d('0x31')]);_0x28576f[_0x760d('0x36')]=_['keys'](_0x3ff551[_0x760d('0x36')]);_0x28576f[_0x760d('0x38')]=_[_0x760d('0x39')](_0x28576f['model'],_0x28576f[_0x760d('0x36')]);_0x356602['attributes']=_[_0x760d('0x39')](_0x28576f[_0x760d('0x35')],qs[_0x760d('0x3b')](_0x3ff551[_0x760d('0x36')][_0x760d('0x3b')]));_0x356602[_0x760d('0x3a')]=_0x356602[_0x760d('0x3a')]['length']?_0x356602[_0x760d('0x3a')]:_0x28576f[_0x760d('0x35')];if(!_0x3ff551[_0x760d('0x36')]['hasOwnProperty'](_0x760d('0x5b'))){_0x356602[_0x760d('0x1e')]=qs[_0x760d('0x1e')](_0x3ff551[_0x760d('0x36')][_0x760d('0x1e')]);_0x356602[_0x760d('0x20')]=qs['offset'](_0x3ff551[_0x760d('0x36')]['offset']);}_0x356602[_0x760d('0x3d')]=qs[_0x760d('0x3e')](_0x3ff551['query']['sort']);_0x356602[_0x760d('0x3f')]=qs[_0x760d('0x38')](_[_0x760d('0x40')](_0x3ff551[_0x760d('0x36')],_0x28576f['filters']));_0x356602['where']['CampaignId']=_0x364036['id'];if(_0x3ff551[_0x760d('0x36')][_0x760d('0x43')]){_0x356602[_0x760d('0x3f')]=_['merge'](_0x356602[_0x760d('0x3f')],{'$or':_[_0x760d('0x2f')](_0x356602[_0x760d('0x3a')],function(_0x5e13e5){var _0x6a2688={};_0x6a2688[_0x5e13e5]={'$like':'%'+_0x3ff551[_0x760d('0x36')]['filter']+'%'};return _0x6a2688;})});}_0x356602=_['merge']({},_0x356602,_0x3ff551['options']);return db[_0x760d('0x63')][_0x760d('0x1f')]({'where':_0x356602[_0x760d('0x3f')]})[_0x760d('0x26')](function(_0x4ccd36){_0x165985[_0x760d('0x1f')]=_0x4ccd36;if(_0x3ff551[_0x760d('0x36')][_0x760d('0x44')]){_0x356602['include']=[{'all':!![]}];}return db[_0x760d('0x63')][_0x760d('0x5e')](_0x356602);})[_0x760d('0x26')](function(_0x24006a){_0x165985[_0x760d('0x5f')]=_0x24006a;return _0x165985;});}})['then'](respondWithFilteredResult(_0x35116b,_0x356602))[_0x760d('0x46')](handleError(_0x35116b,null));};exports[_0x760d('0x64')]=function(_0x3082ed,_0x4c2377,_0x49085c){var _0x18a1ef={};var _0x2b3fb9={};var _0x2eef8e;var _0x8e8791;return db[_0x760d('0x30')][_0x760d('0x58')]({'where':{'id':_0x3082ed[_0x760d('0x48')]['id']}})['then'](handleEntityNotFound(_0x4c2377,null))[_0x760d('0x26')](function(_0x2a6b76){if(_0x2a6b76){_0x2eef8e=_0x2a6b76;_0x2b3fb9[_0x760d('0x35')]=_[_0x760d('0x37')](db['CmList'][_0x760d('0x31')]);_0x2b3fb9['query']=_[_0x760d('0x37')](_0x3082ed[_0x760d('0x36')]);_0x2b3fb9[_0x760d('0x38')]=_[_0x760d('0x39')](_0x2b3fb9[_0x760d('0x35')],_0x2b3fb9[_0x760d('0x36')]);_0x18a1ef[_0x760d('0x3a')]=_[_0x760d('0x39')](_0x2b3fb9['model'],qs[_0x760d('0x3b')](_0x3082ed[_0x760d('0x36')][_0x760d('0x3b')]));_0x18a1ef[_0x760d('0x3a')]=_0x18a1ef[_0x760d('0x3a')][_0x760d('0x3c')]?_0x18a1ef[_0x760d('0x3a')]:_0x2b3fb9[_0x760d('0x35')];_0x18a1ef[_0x760d('0x3d')]=qs['sort'](_0x3082ed[_0x760d('0x36')][_0x760d('0x3e')]);_0x18a1ef[_0x760d('0x3f')]=qs[_0x760d('0x38')](_[_0x760d('0x40')](_0x3082ed['query'],_0x2b3fb9[_0x760d('0x38')]));if(_0x3082ed['query']['filter']){_0x18a1ef[_0x760d('0x3f')]=_[_0x760d('0x41')](_0x18a1ef[_0x760d('0x3f')],{'$or':_[_0x760d('0x2f')](_0x18a1ef['attributes'],function(_0x463d20){var _0x4b96fd={};_0x4b96fd[_0x463d20]={'$like':'%'+_0x3082ed[_0x760d('0x36')]['filter']+'%'};return _0x4b96fd;})});}_0x18a1ef=_[_0x760d('0x41')]({},_0x18a1ef,_0x3082ed[_0x760d('0x49')]);return _0x2eef8e[_0x760d('0x64')](_0x18a1ef);}})[_0x760d('0x26')](function(_0x58835d){if(_0x58835d){_0x8e8791=_0x58835d['length'];if(!_0x3082ed[_0x760d('0x36')][_0x760d('0x5a')](_0x760d('0x5b'))){_0x18a1ef[_0x760d('0x1e')]=qs[_0x760d('0x1e')](_0x3082ed[_0x760d('0x36')]['limit']);_0x18a1ef['offset']=qs[_0x760d('0x20')](_0x3082ed[_0x760d('0x36')]['offset']);}return _0x2eef8e['getLists'](_0x18a1ef);}})[_0x760d('0x26')](function(_0x475940){if(_0x475940){return _0x475940?{'count':_0x8e8791,'rows':_0x475940}:null;}})[_0x760d('0x26')](respondWithResult(_0x4c2377,null))[_0x760d('0x46')](handleError(_0x4c2377,null));};exports[_0x760d('0x65')]=function(_0x35bb84,_0x5f5aa3,_0x151416){var _0xbbfbde,_0x440539;var _0x4525a0=[];var _0x6cf52=moment()[_0x760d('0x66')](_0x760d('0x67'));return db[_0x760d('0x30')]['find']({'where':{'id':_0x35bb84['params']['id']}})[_0x760d('0x26')](handleEntityNotFound(_0x5f5aa3,null))[_0x760d('0x26')](function(_0x5d6d3c){if(_0x5d6d3c){_0x440539=_0x5d6d3c;return _0x5d6d3c['addLists'](_0x35bb84[_0x760d('0x4c')]['ids'],_[_0x760d('0x55')](_0x35bb84[_0x760d('0x4c')],['ids','id'])||{});}return null;})[_0x760d('0x68')](function(_0x26c5c8){var _0x260404;var _0x589503;_0xbbfbde=_0x26c5c8||[];var _0x213958=[];if(_0x26c5c8){for(var _0x55c677=0x0;_0x55c677<_0x26c5c8['length'];_0x55c677+=0x1){var _0x1b8928=_0x26c5c8[_0x55c677][_0x760d('0x28')]({'plain':!![]});_0x440539[_0x760d('0x69')]=_0x35bb84[_0x760d('0x4c')][_0x760d('0x69')]?_0x35bb84[_0x760d('0x4c')][_0x760d('0x69')]:_0x440539[_0x760d('0x69')];switch(_0x440539[_0x760d('0x69')]){case _0x760d('0x6a'):_0x260404=squel[_0x760d('0x6b')]()[_0x760d('0x6c')]('cm_hopper')['fromQuery']([_0x760d('0x6d'),_0x760d('0x6e'),_0x760d('0x6f'),_0x760d('0x70'),_0x760d('0x5c'),'createdAt',_0x760d('0x54')],squel[_0x760d('0x71')]()[_0x760d('0x72')]('phone',_0x760d('0x6d'))[_0x760d('0x72')](_0x760d('0x73'),'scheduledAt')[_0x760d('0x72')]('id',_0x760d('0x6f'))['field'](_0x1b8928['CmListId'][_0x760d('0x74')](),'ListId')[_0x760d('0x72')](_0x35bb84['params']['id'][_0x760d('0x74')](),_0x760d('0x5c'))[_0x760d('0x72')]('\x27'+_0x6cf52+'\x27','createdAt')['field']('\x27'+_0x6cf52+'\x27',_0x760d('0x54'))['from'](_0x760d('0x75'))[_0x760d('0x3f')](_0x760d('0x76'))[_0x760d('0x3f')](_0x760d('0x77'),_0x1b8928[_0x760d('0x78')][_0x760d('0x74')]())[_0x760d('0x3f')](_0x760d('0x79'))[_0x760d('0x3f')](_0x760d('0x7a'),squel[_0x760d('0x71')]()[_0x760d('0x72')](_0x760d('0x7b'))['from']('cm_hopper_final')[_0x760d('0x3f')](_0x760d('0x7c'),_0x35bb84[_0x760d('0x48')]['id'][_0x760d('0x74')]()))['where'](_0x760d('0x7a'),squel[_0x760d('0x71')]()['field'](_0x760d('0x7d'))['from'](_0x760d('0x7e'))[_0x760d('0x3f')](_0x760d('0x7c'),_0x35bb84[_0x760d('0x48')]['id']['toString']())))[_0x760d('0x74')]();break;case _0x760d('0x7f'):_0x260404=squel['insert']()[_0x760d('0x6c')](_0x760d('0x7e'))[_0x760d('0x80')]([_0x760d('0x6d'),_0x760d('0x6e'),_0x760d('0x6f'),'ListId',_0x760d('0x5c'),_0x760d('0x56'),_0x760d('0x54')],squel['select']()['field'](_0x760d('0x6d'),_0x760d('0x6d'))['field'](_0x760d('0x73'),'scheduledAt')[_0x760d('0x72')]('id',_0x760d('0x6f'))[_0x760d('0x72')](_0x1b8928[_0x760d('0x78')][_0x760d('0x74')](),_0x760d('0x70'))['field'](_0x35bb84[_0x760d('0x48')]['id'][_0x760d('0x74')](),_0x760d('0x5c'))['field']('\x27'+_0x6cf52+'\x27','createdAt')[_0x760d('0x72')]('\x27'+_0x6cf52+'\x27',_0x760d('0x54'))['from']('cm_contacts')['where'](_0x760d('0x76'))[_0x760d('0x3f')](_0x760d('0x77'),_0x1b8928['CmListId']['toString']())[_0x760d('0x3f')](_0x760d('0x79'))[_0x760d('0x3f')](_0x760d('0x7a'),squel[_0x760d('0x71')]()[_0x760d('0x72')](_0x760d('0x7d'))[_0x760d('0x81')]('cm_hopper')['where'](_0x760d('0x7c'),_0x35bb84[_0x760d('0x48')]['id']['toString']())))[_0x760d('0x74')]();break;default:_0x260404=squel['insert']()[_0x760d('0x6c')](_0x760d('0x7e'))['fromQuery']([_0x760d('0x6d'),_0x760d('0x6e'),_0x760d('0x6f'),'ListId','CampaignId',_0x760d('0x56'),_0x760d('0x54')],squel['select']()[_0x760d('0x72')](_0x760d('0x6d'),_0x760d('0x6d'))[_0x760d('0x72')](_0x760d('0x73'),_0x760d('0x6e'))[_0x760d('0x72')]('id',_0x760d('0x6f'))['field'](_0x1b8928[_0x760d('0x78')][_0x760d('0x74')](),_0x760d('0x70'))[_0x760d('0x72')](_0x35bb84[_0x760d('0x48')]['id']['toString'](),_0x760d('0x5c'))['field']('\x27'+_0x6cf52+'\x27',_0x760d('0x56'))[_0x760d('0x72')]('\x27'+_0x6cf52+'\x27',_0x760d('0x54'))['from'](_0x760d('0x75'))['where'](_0x760d('0x76'))[_0x760d('0x3f')](_0x760d('0x77'),_0x1b8928['CmListId'][_0x760d('0x74')]())[_0x760d('0x3f')](_0x760d('0x79')))['toString']();}_0x589503=squel['insert']()['into'](_0x760d('0x82'))[_0x760d('0x80')](['cmHopperId','scheduledAt',_0x760d('0x6d'),'OrderBy','createdAt',_0x760d('0x54')],squel['select']()[_0x760d('0x72')]('h.id','id')[_0x760d('0x72')](_0x760d('0x73'),_0x760d('0x6e'))[_0x760d('0x72')]('ci.item',_0x760d('0x6d'))[_0x760d('0x72')]('ci.OrderBY',_0x760d('0x83'))['field']('\x27'+_0x6cf52+'\x27',_0x760d('0x56'))[_0x760d('0x72')]('\x27'+_0x6cf52+'\x27',_0x760d('0x54'))[_0x760d('0x81')](_0x760d('0x84'),'ci')[_0x760d('0x85')](_0x760d('0x7e'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0x760d('0x3f')]('h.ListId\x20=\x20?',_0x1b8928[_0x760d('0x78')][_0x760d('0x74')]())[_0x760d('0x3f')](_0x760d('0x86'),_0x35bb84['params']['id'][_0x760d('0x74')]())[_0x760d('0x3f')](_0x760d('0x87'),_0x6cf52))[_0x760d('0x74')]();_0x213958[_0x760d('0x88')](db[_0x760d('0x89')][_0x760d('0x36')](_0x260404));_0x4525a0[_0x760d('0x88')](db[_0x760d('0x89')][_0x760d('0x36')](_0x589503));}return BPromise[_0x760d('0x8a')](_0x213958);}})[_0x760d('0x26')](function(){return BPromise[_0x760d('0x8a')](_0x4525a0);})[_0x760d('0x26')](function(){return _0xbbfbde;})['then'](respondWithResult(_0x5f5aa3,null))[_0x760d('0x46')](handleError(_0x5f5aa3,null));};exports[_0x760d('0x8b')]=function(_0x5a3dd0,_0x13e10c,_0x1e02d2){return db['Campaign'][_0x760d('0x4a')]({'where':{'id':_0x5a3dd0['params']['id']}})[_0x760d('0x26')](handleEntityNotFound(_0x13e10c,null))[_0x760d('0x26')](function(_0x56db54){if(_0x56db54){return _0x56db54[_0x760d('0x8b')](_0x5a3dd0['query'][_0x760d('0x8c')]);}})['then'](function(_0x434173){if(_0x434173){return db['CmHopper']['destroy']({'where':{'ListId':_0x5a3dd0['query'][_0x760d('0x8c')],'CampaignId':_0x5a3dd0[_0x760d('0x48')]['id']}})['then'](function(){return _0x434173;});}})['then'](respondWithStatusCode(_0x13e10c,null))[_0x760d('0x46')](handleError(_0x13e10c,null));};exports[_0x760d('0x8d')]=function(_0xeac13,_0x56e2ae,_0x559f2e){var _0x56f9cf={};var _0x176814={};var _0x3dc8ad;var _0x25927b;return db[_0x760d('0x30')][_0x760d('0x58')]({'where':{'id':_0xeac13['params']['id']}})['then'](handleEntityNotFound(_0x56e2ae,null))['then'](function(_0x519188){if(_0x519188){_0x3dc8ad=_0x519188;_0x176814[_0x760d('0x35')]=_[_0x760d('0x37')](db['CmList'][_0x760d('0x31')]);_0x176814[_0x760d('0x36')]=_[_0x760d('0x37')](_0xeac13['query']);_0x176814[_0x760d('0x38')]=_[_0x760d('0x39')](_0x176814['model'],_0x176814[_0x760d('0x36')]);_0x56f9cf[_0x760d('0x3a')]=_[_0x760d('0x39')](_0x176814['model'],qs[_0x760d('0x3b')](_0xeac13[_0x760d('0x36')]['fields']));_0x56f9cf[_0x760d('0x3a')]=_0x56f9cf[_0x760d('0x3a')][_0x760d('0x3c')]?_0x56f9cf[_0x760d('0x3a')]:_0x176814[_0x760d('0x35')];_0x56f9cf[_0x760d('0x3d')]=qs['sort'](_0xeac13[_0x760d('0x36')][_0x760d('0x3e')]);_0x56f9cf[_0x760d('0x3f')]=qs[_0x760d('0x38')](_[_0x760d('0x40')](_0xeac13[_0x760d('0x36')],_0x176814[_0x760d('0x38')]));if(_0xeac13['query'][_0x760d('0x43')]){_0x56f9cf[_0x760d('0x3f')]=_[_0x760d('0x41')](_0x56f9cf[_0x760d('0x3f')],{'$or':_[_0x760d('0x2f')](_0x56f9cf[_0x760d('0x3a')],function(_0x5ae107){var _0xf38411={};_0xf38411[_0x5ae107]={'$like':'%'+_0xeac13['query']['filter']+'%'};return _0xf38411;})});}_0x56f9cf=_[_0x760d('0x41')]({},_0x56f9cf,_0xeac13[_0x760d('0x49')]);return _0x3dc8ad[_0x760d('0x8d')](_0x56f9cf);}})['then'](function(_0x53369d){if(_0x53369d){_0x25927b=_0x53369d[_0x760d('0x3c')];if(!_0xeac13[_0x760d('0x36')][_0x760d('0x5a')](_0x760d('0x5b'))){_0x56f9cf[_0x760d('0x1e')]=qs[_0x760d('0x1e')](_0xeac13['query'][_0x760d('0x1e')]);_0x56f9cf[_0x760d('0x20')]=qs[_0x760d('0x20')](_0xeac13[_0x760d('0x36')][_0x760d('0x20')]);}return _0x3dc8ad[_0x760d('0x8d')](_0x56f9cf);}})['then'](function(_0x1e241f){if(_0x1e241f){return _0x1e241f?{'count':_0x25927b,'rows':_0x1e241f}:null;}})[_0x760d('0x26')](respondWithResult(_0x56e2ae,null))[_0x760d('0x46')](handleError(_0x56e2ae,null));};exports['addBlackLists']=function(_0xecae35,_0xf3cd8b,_0x59b57b){var _0x5aa429,_0xfcb74e;var _0x5b8487=[];var _0x4ecd17=moment()['format'](_0x760d('0x67'));return db[_0x760d('0x30')][_0x760d('0x4a')]({'where':{'id':_0xecae35[_0x760d('0x48')]['id']}})[_0x760d('0x26')](handleEntityNotFound(_0xf3cd8b,null))['then'](function(_0x2117ad){if(_0x2117ad){_0xfcb74e=_0x2117ad;return _0x2117ad[_0x760d('0x8e')](_0xecae35[_0x760d('0x4c')][_0x760d('0x8c')],_[_0x760d('0x55')](_0xecae35['body'],[_0x760d('0x8c'),'id'])||{});}return null;})['spread'](function(_0x3bd7ba){var _0x391200;var _0x228c03;_0x5aa429=_0x3bd7ba||[];var _0x2bdbfe=[];if(_0x3bd7ba){for(var _0x10d180=0x0;_0x10d180<_0x3bd7ba[_0x760d('0x3c')];_0x10d180+=0x1){var _0x3c1c13=_0x3bd7ba[_0x10d180][_0x760d('0x28')]({'plain':!![]});_0x391200=squel['insert']()[_0x760d('0x6c')](_0x760d('0x8f'))[_0x760d('0x80')](['phone',_0x760d('0x6f'),'ListId','CampaignId',_0x760d('0x56'),'updatedAt'],squel['select']()[_0x760d('0x72')](_0x760d('0x6d'),_0x760d('0x6d'))[_0x760d('0x72')]('id','ContactId')[_0x760d('0x72')](_0x3c1c13[_0x760d('0x78')]['toString'](),_0x760d('0x70'))[_0x760d('0x72')](_0xecae35[_0x760d('0x48')]['id'][_0x760d('0x74')](),_0x760d('0x5c'))[_0x760d('0x72')](_0x760d('0x73'),_0x760d('0x56'))['field'](_0x760d('0x73'),_0x760d('0x54'))[_0x760d('0x81')]('cm_contacts')[_0x760d('0x3f')](_0x760d('0x76'))[_0x760d('0x3f')](_0x760d('0x77'),_0x3c1c13['CmListId'][_0x760d('0x74')]())[_0x760d('0x3f')](_0x760d('0x79')))['toString']();_0x2bdbfe[_0x760d('0x88')](db[_0x760d('0x89')][_0x760d('0x36')](_0x391200));}return BPromise[_0x760d('0x8a')](_0x2bdbfe);}})[_0x760d('0x26')](function(){return _0x5aa429;})[_0x760d('0x26')](respondWithResult(_0xf3cd8b,null))[_0x760d('0x46')](handleError(_0xf3cd8b,null));};exports[_0x760d('0x90')]=function(_0x58bb24,_0x3e7f75,_0x428f7f){return db[_0x760d('0x30')][_0x760d('0x4a')]({'where':{'id':_0x58bb24['params']['id']}})[_0x760d('0x26')](handleEntityNotFound(_0x3e7f75,null))[_0x760d('0x26')](function(_0x3b8ad3){if(_0x3b8ad3){return _0x3b8ad3[_0x760d('0x90')](_0x58bb24['query'][_0x760d('0x8c')]);}})[_0x760d('0x26')](function(_0x4a9598){if(_0x4a9598){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x58bb24[_0x760d('0x36')][_0x760d('0x8c')],'CampaignId':_0x58bb24[_0x760d('0x48')]['id']}})[_0x760d('0x26')](function(){return _0x4a9598;});}})['then'](respondWithStatusCode(_0x3e7f75,null))[_0x760d('0x46')](handleError(_0x3e7f75,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 567b198..996a35f 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(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x527dc5,_0x1de7e7){var _0x216de9=function(_0xde9c52){while(--_0xde9c52){_0x527dc5['push'](_0x527dc5['shift']());}};_0x216de9(++_0x1de7e7);}(_0x7a54,0x106));var _0x47a5=function(_0x110d2d,_0x292855){_0x110d2d=_0x110d2d-0x0;var _0x4dfb30=_0x7a54[_0x110d2d];return _0x4dfb30;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 6eb2a9c..ab849ec 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 _0x57d4=['Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Campaign,\x20%s,\x20%s','message','info','catch','GetCampaign','Campaign','options','raw','where','attributes','include','model','map','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x57d4,0x78));var _0x457d=function(_0x4bb702,_0x4a860c){_0x4bb702=_0x4bb702-0x0;var _0x5eca00=_0x57d4[_0x4bb702];return _0x5eca00;};'use strict';var _=require(_0x457d('0x0'));var util=require(_0x457d('0x1'));var moment=require('moment');var BPromise=require(_0x457d('0x2'));var rs=require(_0x457d('0x3'));var fs=require('fs');var Redis=require(_0x457d('0x4'));var db=require(_0x457d('0x5'))['db'];var utils=require(_0x457d('0x6'));var logger=require(_0x457d('0x7'))(_0x457d('0x8'));var config=require(_0x457d('0x9'));var jayson=require(_0x457d('0xa'));var client=jayson[_0x457d('0xb')][_0x457d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5c6816,_0x1fc199,_0x381e22){return new BPromise(function(_0x4e32c0,_0x5dff56){return client[_0x457d('0xd')](_0x5c6816,_0x381e22)[_0x457d('0xe')](function(_0x127b89){logger['info']('Campaign,\x20%s,\x20%s',_0x1fc199,'request\x20sent');logger[_0x457d('0xf')](_0x457d('0x10'),_0x1fc199,_0x457d('0x11'),JSON[_0x457d('0x12')](_0x127b89));if(_0x127b89[_0x457d('0x13')]){if(_0x127b89[_0x457d('0x13')][_0x457d('0x14')]===0x1f4){logger[_0x457d('0x13')](_0x457d('0x15'),_0x1fc199,_0x127b89['error'][_0x457d('0x16')]);return _0x5dff56(_0x127b89[_0x457d('0x13')]['message']);}logger['error'](_0x457d('0x15'),_0x1fc199,_0x127b89[_0x457d('0x13')][_0x457d('0x16')]);return _0x4e32c0(_0x127b89[_0x457d('0x13')][_0x457d('0x16')]);}else{logger[_0x457d('0x17')](_0x457d('0x15'),_0x1fc199,_0x457d('0x11'));_0x4e32c0(_0x127b89['result'][_0x457d('0x16')]);}})[_0x457d('0x18')](function(_0x2c05ca){logger['error']('Campaign,\x20%s,\x20%s',_0x1fc199,_0x2c05ca);_0x5dff56(_0x2c05ca);});});}exports[_0x457d('0x19')]=function(_0x4d988f){var _0x151416=this;return new Promise(function(_0x802f2b,_0x50e78f){return db[_0x457d('0x1a')]['findAll']({'raw':_0x4d988f['options']?_0x4d988f[_0x457d('0x1b')][_0x457d('0x1c')]===undefined?!![]:![]:!![],'where':_0x4d988f[_0x457d('0x1b')]?_0x4d988f[_0x457d('0x1b')][_0x457d('0x1d')]||null:null,'attributes':_0x4d988f[_0x457d('0x1b')]?_0x4d988f[_0x457d('0x1b')][_0x457d('0x1e')]||null:null,'limit':_0x4d988f[_0x457d('0x1b')]?_0x4d988f[_0x457d('0x1b')]['limit']||null:null,'include':_0x4d988f['options']?_0x4d988f['options'][_0x457d('0x1f')]?_['map'](_0x4d988f['options']['include'],function(_0x206fdc){return{'model':db[_0x206fdc[_0x457d('0x20')]],'as':_0x206fdc['as'],'attributes':_0x206fdc['attributes'],'include':_0x206fdc[_0x457d('0x1f')]?_[_0x457d('0x21')](_0x206fdc[_0x457d('0x1f')],function(_0x152cfc){return{'model':db[_0x152cfc['model']],'as':_0x152cfc['as'],'attributes':_0x152cfc['attributes'],'include':_0x152cfc[_0x457d('0x1f')]?_['map'](_0x152cfc[_0x457d('0x1f')],function(_0x21a102){return{'model':db[_0x21a102[_0x457d('0x20')]],'as':_0x21a102['as'],'attributes':_0x21a102[_0x457d('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x298dd4){logger['info']('GetCampaign',_0x4d988f);logger[_0x457d('0xf')](_0x457d('0x19'),_0x4d988f,JSON['stringify'](_0x298dd4));_0x802f2b(_0x298dd4);})[_0x457d('0x18')](function(_0x2d69d2){logger['error'](_0x457d('0x19'),_0x2d69d2[_0x457d('0x16')],_0x4d988f);_0x50e78f(_0x151416[_0x457d('0x13')](0x1f4,_0x2d69d2[_0x457d('0x16')]));});});};
\ No newline at end of file
+var _0xc02d=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','info','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x265686,_0x34c36b){var _0x563f47=function(_0x23bada){while(--_0x23bada){_0x265686['push'](_0x265686['shift']());}};_0x563f47(++_0x34c36b);}(_0xc02d,0x1aa));var _0xdc02=function(_0x3cf8dd,_0x22a6cd){_0x3cf8dd=_0x3cf8dd-0x0;var _0x28c302=_0xc02d[_0x3cf8dd];return _0x28c302;};'use strict';var _=require('lodash');var util=require(_0xdc02('0x0'));var moment=require(_0xdc02('0x1'));var BPromise=require(_0xdc02('0x2'));var rs=require(_0xdc02('0x3'));var fs=require('fs');var Redis=require(_0xdc02('0x4'));var db=require(_0xdc02('0x5'))['db'];var utils=require(_0xdc02('0x6'));var logger=require(_0xdc02('0x7'))(_0xdc02('0x8'));var config=require(_0xdc02('0x9'));var jayson=require(_0xdc02('0xa'));var client=jayson['client'][_0xdc02('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc472b,_0x30e0ad,_0x1560da){return new BPromise(function(_0x4a678f,_0x50a902){return client[_0xdc02('0xc')](_0xc472b,_0x1560da)[_0xdc02('0xd')](function(_0x1fed26){logger['info'](_0xdc02('0xe'),_0x30e0ad,'request\x20sent');logger[_0xdc02('0xf')](_0xdc02('0x10'),_0x30e0ad,_0xdc02('0x11'),JSON[_0xdc02('0x12')](_0x1fed26));if(_0x1fed26['error']){if(_0x1fed26[_0xdc02('0x13')][_0xdc02('0x14')]===0x1f4){logger[_0xdc02('0x13')](_0xdc02('0xe'),_0x30e0ad,_0x1fed26['error'][_0xdc02('0x15')]);return _0x50a902(_0x1fed26[_0xdc02('0x13')][_0xdc02('0x15')]);}logger['error'](_0xdc02('0xe'),_0x30e0ad,_0x1fed26['error'][_0xdc02('0x15')]);return _0x4a678f(_0x1fed26[_0xdc02('0x13')][_0xdc02('0x15')]);}else{logger['info'](_0xdc02('0xe'),_0x30e0ad,_0xdc02('0x11'));_0x4a678f(_0x1fed26[_0xdc02('0x16')]['message']);}})[_0xdc02('0x17')](function(_0x4d96ef){logger[_0xdc02('0x13')](_0xdc02('0xe'),_0x30e0ad,_0x4d96ef);_0x50a902(_0x4d96ef);});});}exports[_0xdc02('0x18')]=function(_0x26be9e){var _0x532a50=this;return new Promise(function(_0x4f731f,_0x88b0b2){return db[_0xdc02('0x19')][_0xdc02('0x1a')]({'raw':_0x26be9e[_0xdc02('0x1b')]?_0x26be9e[_0xdc02('0x1b')][_0xdc02('0x1c')]===undefined?!![]:![]:!![],'where':_0x26be9e[_0xdc02('0x1b')]?_0x26be9e[_0xdc02('0x1b')][_0xdc02('0x1d')]||null:null,'attributes':_0x26be9e[_0xdc02('0x1b')]?_0x26be9e[_0xdc02('0x1b')][_0xdc02('0x1e')]||null:null,'limit':_0x26be9e['options']?_0x26be9e[_0xdc02('0x1b')][_0xdc02('0x1f')]||null:null,'include':_0x26be9e[_0xdc02('0x1b')]?_0x26be9e['options'][_0xdc02('0x20')]?_[_0xdc02('0x21')](_0x26be9e[_0xdc02('0x1b')][_0xdc02('0x20')],function(_0x4017d4){return{'model':db[_0x4017d4[_0xdc02('0x22')]],'as':_0x4017d4['as'],'attributes':_0x4017d4[_0xdc02('0x1e')],'include':_0x4017d4['include']?_[_0xdc02('0x21')](_0x4017d4[_0xdc02('0x20')],function(_0x11b57c){return{'model':db[_0x11b57c[_0xdc02('0x22')]],'as':_0x11b57c['as'],'attributes':_0x11b57c[_0xdc02('0x1e')],'include':_0x11b57c['include']?_[_0xdc02('0x21')](_0x11b57c[_0xdc02('0x20')],function(_0x54ecd7){return{'model':db[_0x54ecd7[_0xdc02('0x22')]],'as':_0x54ecd7['as'],'attributes':_0x54ecd7[_0xdc02('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xdc02('0xd')](function(_0x4492f8){logger[_0xdc02('0x23')](_0xdc02('0x18'),_0x26be9e);logger['debug']('GetCampaign',_0x26be9e,JSON[_0xdc02('0x12')](_0x4492f8));_0x4f731f(_0x4492f8);})[_0xdc02('0x17')](function(_0x5eb292){logger[_0xdc02('0x13')](_0xdc02('0x18'),_0x5eb292[_0xdc02('0x15')],_0x26be9e);_0x88b0b2(_0x532a50['error'](0x1f4,_0x5eb292[_0xdc02('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index f0cda2b..eb63ac9 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 _0xda62=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','delete','destroy','removeLists','removeBlackLists','exports'];(function(_0x29581c,_0x3cf545){var _0x25884b=function(_0x38da2b){while(--_0x38da2b){_0x29581c['push'](_0x29581c['shift']());}};_0x25884b(++_0x3cf545);}(_0xda62,0x1ba));var _0x2da6=function(_0xaff9d6,_0x4e3df1){_0xaff9d6=_0xaff9d6-0x0;var _0xdeacd5=_0xda62[_0xaff9d6];return _0xdeacd5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2da6('0x0'));var timeout=require('connect-timeout');var express=require(_0x2da6('0x1'));var router=express[_0x2da6('0x2')]();var fs_extra=require(_0x2da6('0x3'));var auth=require(_0x2da6('0x4'));var interaction=require(_0x2da6('0x5'));var config=require(_0x2da6('0x6'));var controller=require(_0x2da6('0x7'));router[_0x2da6('0x8')]('/',auth[_0x2da6('0x9')](),controller[_0x2da6('0xa')]);router[_0x2da6('0x8')](_0x2da6('0xb'),auth[_0x2da6('0x9')](),controller['show']);router[_0x2da6('0x8')](_0x2da6('0xc'),auth[_0x2da6('0x9')](),controller[_0x2da6('0xd')]);router[_0x2da6('0x8')](_0x2da6('0xe'),auth[_0x2da6('0x9')](),controller['getHopperHistories']);router[_0x2da6('0x8')](_0x2da6('0xf'),auth['isAuthenticated'](),controller['getHopperFinals']);router[_0x2da6('0x8')](_0x2da6('0x10'),auth['isAuthenticated'](),controller[_0x2da6('0x11')]);router[_0x2da6('0x8')](_0x2da6('0x12'),auth[_0x2da6('0x9')](),controller[_0x2da6('0x13')]);router[_0x2da6('0x8')](_0x2da6('0x14'),auth[_0x2da6('0x9')](),controller[_0x2da6('0x15')]);router[_0x2da6('0x16')]('/',auth[_0x2da6('0x9')](),controller[_0x2da6('0x17')]);router[_0x2da6('0x16')](_0x2da6('0x18'),auth[_0x2da6('0x9')](),controller[_0x2da6('0x19')]);router[_0x2da6('0x16')]('/:id/lists',auth[_0x2da6('0x9')](),controller[_0x2da6('0x1a')]);router['post'](_0x2da6('0x14'),auth['isAuthenticated'](),controller[_0x2da6('0x1b')]);router[_0x2da6('0x1c')](_0x2da6('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x2da6('0x1d')](_0x2da6('0xb'),auth['isAuthenticated'](),controller[_0x2da6('0x1e')]);router[_0x2da6('0x1d')](_0x2da6('0x12'),auth[_0x2da6('0x9')](),controller[_0x2da6('0x1f')]);router[_0x2da6('0x1d')](_0x2da6('0x14'),auth['isAuthenticated'](),controller[_0x2da6('0x20')]);module[_0x2da6('0x21')]=router;
\ No newline at end of file
+var _0x8828=['post','create','/:id/clone','clone','/:id/lists','addLists','addBlackLists','/:id','update','delete','destroy','removeLists','removeBlackLists','exports','multer','path','express','Router','fs-extra','../../config/environment','./campaign.controller','get','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','getBlackLists'];(function(_0x3aa2d6,_0x3c8759){var _0x283bbc=function(_0x448c5d){while(--_0x448c5d){_0x3aa2d6['push'](_0x3aa2d6['shift']());}};_0x283bbc(++_0x3c8759);}(_0x8828,0x184));var _0x8882=function(_0x5a6ea1,_0x5011a3){_0x5a6ea1=_0x5a6ea1-0x0;var _0x195a95=_0x8828[_0x5a6ea1];return _0x195a95;};'use strict';var multer=require(_0x8882('0x0'));var util=require('util');var path=require(_0x8882('0x1'));var timeout=require('connect-timeout');var express=require(_0x8882('0x2'));var router=express[_0x8882('0x3')]();var fs_extra=require(_0x8882('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8882('0x5'));var controller=require(_0x8882('0x6'));router[_0x8882('0x7')]('/',auth[_0x8882('0x8')](),controller['index']);router[_0x8882('0x7')]('/:id',auth[_0x8882('0x8')](),controller[_0x8882('0x9')]);router[_0x8882('0x7')](_0x8882('0xa'),auth[_0x8882('0x8')](),controller[_0x8882('0xb')]);router[_0x8882('0x7')](_0x8882('0xc'),auth[_0x8882('0x8')](),controller[_0x8882('0xd')]);router[_0x8882('0x7')](_0x8882('0xe'),auth[_0x8882('0x8')](),controller['getHopperFinals']);router[_0x8882('0x7')](_0x8882('0xf'),auth[_0x8882('0x8')](),controller[_0x8882('0x10')]);router[_0x8882('0x7')]('/:id/lists',auth[_0x8882('0x8')](),controller[_0x8882('0x11')]);router['get'](_0x8882('0x12'),auth[_0x8882('0x8')](),controller[_0x8882('0x13')]);router[_0x8882('0x14')]('/',auth[_0x8882('0x8')](),controller[_0x8882('0x15')]);router[_0x8882('0x14')](_0x8882('0x16'),auth[_0x8882('0x8')](),controller[_0x8882('0x17')]);router['post'](_0x8882('0x18'),auth[_0x8882('0x8')](),controller[_0x8882('0x19')]);router[_0x8882('0x14')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x8882('0x1a')]);router['put'](_0x8882('0x1b'),auth['isAuthenticated'](),controller[_0x8882('0x1c')]);router[_0x8882('0x1d')](_0x8882('0x1b'),auth[_0x8882('0x8')](),controller[_0x8882('0x1e')]);router['delete'](_0x8882('0x18'),auth[_0x8882('0x8')](),controller[_0x8882('0x1f')]);router[_0x8882('0x1d')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x8882('0x20')]);module[_0x8882('0x21')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 56d2943..3a40e45 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 _0xb392=['exports','TEXT','VIRTUAL','getDataValue'];(function(_0x3c6c36,_0x27fad9){var _0x2670ae=function(_0x545097){while(--_0x545097){_0x3c6c36['push'](_0x3c6c36['shift']());}};_0x2670ae(++_0x27fad9);}(_0xb392,0xc4));var _0x2b39=function(_0xf82a6e,_0x344ee1){_0xf82a6e=_0xf82a6e-0x0;var _0x44f2e3=_0xb392[_0xf82a6e];return _0x44f2e3;};'use strict';var Sequelize=require('sequelize');module[_0x2b39('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x2b39('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x2b39('0x2')],'get':function(){return this[_0x2b39('0x3')]('key');}}};
\ No newline at end of file
+var _0xb2eb=['sequelize','STRING','TEXT','getDataValue','key'];(function(_0x13068f,_0x26db9c){var _0x4a93b3=function(_0x2863b2){while(--_0x2863b2){_0x13068f['push'](_0x13068f['shift']());}};_0x4a93b3(++_0x26db9c);}(_0xb2eb,0xe1));var _0xbb2e=function(_0x22ba44,_0x50e3c3){_0x22ba44=_0x22ba44-0x0;var _0x2b35fa=_0xb2eb[_0x22ba44];return _0x2b35fa;};'use strict';var Sequelize=require(_0xbb2e('0x0'));module['exports']={'key':{'type':Sequelize[_0xbb2e('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xbb2e('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xbb2e('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xbb2e('0x3')](_0xbb2e('0x4'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 1876450..7408741 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 _0x05f0=['attributes','length','hasOwnProperty','sort','where','pick','filter','merge','options','include','rows','catch','params','keys','fields','includeAll','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','get','CannedAnswers','destroy','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','filters','intersection','query'];(function(_0x19c7a8,_0x10508d){var _0x1462ce=function(_0x33f2c8){while(--_0x33f2c8){_0x19c7a8['push'](_0x19c7a8['shift']());}};_0x1462ce(++_0x10508d);}(_0x05f0,0x12d));var _0x005f=function(_0x44dba1,_0x270ad5){_0x44dba1=_0x44dba1-0x0;var _0x2fbd3f=_0x05f0[_0x44dba1];return _0x2fbd3f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x005f('0x0'));var zipdir=require(_0x005f('0x1'));var jsonpatch=require(_0x005f('0x2'));var rp=require(_0x005f('0x3'));var moment=require(_0x005f('0x4'));var BPromise=require(_0x005f('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x005f('0x6'));var sox=require(_0x005f('0x7'));var csv=require(_0x005f('0x8'));var ejs=require(_0x005f('0x9'));var fs=require('fs');var fs_extra=require(_0x005f('0xa'));var _=require(_0x005f('0xb'));var squel=require('squel');var crypto=require(_0x005f('0xc'));var jsforce=require(_0x005f('0xd'));var deskjs=require(_0x005f('0xe'));var toCsv=require(_0x005f('0x8'));var querystring=require(_0x005f('0xf'));var Papa=require('papaparse');var Redis=require(_0x005f('0x10'));var authService=require(_0x005f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x005f('0x12'));var hardwareService=require(_0x005f('0x13'));var logger=require(_0x005f('0x14'))(_0x005f('0x15'));var utils=require(_0x005f('0x16'));var config=require(_0x005f('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x005f('0x18'))['db'];function respondWithStatusCode(_0x309b3b,_0x2b96da){_0x2b96da=_0x2b96da||0xcc;return function(_0x219f57){if(_0x219f57){return _0x309b3b[_0x005f('0x19')](_0x2b96da);}return _0x309b3b['status'](_0x2b96da)[_0x005f('0x1a')]();};}function respondWithResult(_0x17a0e8,_0x4beebc){_0x4beebc=_0x4beebc||0xc8;return function(_0x32fd16){if(_0x32fd16){return _0x17a0e8[_0x005f('0x1b')](_0x4beebc)[_0x005f('0x1c')](_0x32fd16);}};}function respondWithFilteredResult(_0x2875d9,_0x2fe32c){return function(_0x37d808){if(_0x37d808){var _0x119d0e=typeof _0x2fe32c[_0x005f('0x1d')]===_0x005f('0x1e')&&typeof _0x2fe32c[_0x005f('0x1f')]===_0x005f('0x1e');var _0x2e931b=_0x37d808['count'];var _0x41709e=_0x119d0e?0x0:_0x2fe32c[_0x005f('0x1d')];var _0x211bc8=_0x119d0e?_0x37d808[_0x005f('0x20')]:_0x2fe32c[_0x005f('0x1d')]+_0x2fe32c[_0x005f('0x1f')];var _0x12fa93;if(_0x211bc8>=_0x2e931b){_0x211bc8=_0x2e931b;_0x12fa93=0xc8;}else{_0x12fa93=0xce;}_0x2875d9[_0x005f('0x1b')](_0x12fa93);return _0x2875d9[_0x005f('0x21')]('Content-Range',_0x41709e+'-'+_0x211bc8+'/'+_0x2e931b)[_0x005f('0x1c')](_0x37d808);}return null;};}function patchUpdates(_0x31cc99){return function(_0x3df156){try{jsonpatch[_0x005f('0x22')](_0x3df156,_0x31cc99,!![]);}catch(_0x3a3158){return BPromise[_0x005f('0x23')](_0x3a3158);}return _0x3df156[_0x005f('0x24')]();};}function saveUpdates(_0x673b51,_0x3ea6e2){return function(_0x46b105){if(_0x46b105){return _0x46b105[_0x005f('0x25')](_0x673b51)[_0x005f('0x26')](function(_0xcb52e){return _0xcb52e;});}return null;};}function removeEntity(_0x4835c1,_0x14ea58){return function(_0x19cccc){if(_0x19cccc){return _0x19cccc['destroy']()[_0x005f('0x26')](function(){var _0x88d408=_0x19cccc[_0x005f('0x27')]({'plain':!![]});var _0x334321=_0x005f('0x28');return db['UserProfileResource'][_0x005f('0x29')]({'where':{'type':_0x334321,'resourceId':_0x88d408['id']}})['then'](function(){return _0x19cccc;});})[_0x005f('0x26')](function(){_0x4835c1[_0x005f('0x1b')](0xcc)[_0x005f('0x1a')]();});}};}function handleEntityNotFound(_0x25bd2a,_0x3001b6){return function(_0x49156a){if(!_0x49156a){_0x25bd2a[_0x005f('0x19')](0x194);}return _0x49156a;};}function handleError(_0x27dc8b,_0x1c5082){_0x1c5082=_0x1c5082||0x1f4;return function(_0x1b3386){logger['error'](_0x1b3386['stack']);if(_0x1b3386[_0x005f('0x2a')]){delete _0x1b3386[_0x005f('0x2a')];}_0x27dc8b['status'](_0x1c5082)[_0x005f('0x2b')](_0x1b3386);};}exports[_0x005f('0x2c')]=function(_0x4fd3a7,_0x433a75){var _0x1334b4={},_0x3e09e5={},_0x59aab9={'count':0x0,'rows':[]};var _0x27f869=_[_0x005f('0x2d')](db[_0x005f('0x2e')][_0x005f('0x2f')],function(_0x3bfd57){return{'name':_0x3bfd57[_0x005f('0x30')],'type':_0x3bfd57[_0x005f('0x31')][_0x005f('0x32')]};});_0x3e09e5[_0x005f('0x33')]=_[_0x005f('0x2d')](_0x27f869,_0x005f('0x2a'));_0x3e09e5['query']=_['keys'](_0x4fd3a7['query']);_0x3e09e5[_0x005f('0x34')]=_[_0x005f('0x35')](_0x3e09e5['model'],_0x3e09e5[_0x005f('0x36')]);_0x1334b4['attributes']=_['intersection'](_0x3e09e5[_0x005f('0x33')],qs['fields'](_0x4fd3a7[_0x005f('0x36')]['fields']));_0x1334b4['attributes']=_0x1334b4[_0x005f('0x37')][_0x005f('0x38')]?_0x1334b4[_0x005f('0x37')]:_0x3e09e5[_0x005f('0x33')];if(!_0x4fd3a7['query'][_0x005f('0x39')]('nolimit')){_0x1334b4[_0x005f('0x1f')]=qs[_0x005f('0x1f')](_0x4fd3a7[_0x005f('0x36')][_0x005f('0x1f')]);_0x1334b4[_0x005f('0x1d')]=qs[_0x005f('0x1d')](_0x4fd3a7[_0x005f('0x36')][_0x005f('0x1d')]);}_0x1334b4['order']=qs[_0x005f('0x3a')](_0x4fd3a7['query']['sort']);_0x1334b4[_0x005f('0x3b')]=qs['filters'](_[_0x005f('0x3c')](_0x4fd3a7['query'],_0x3e09e5[_0x005f('0x34')]),_0x27f869);if(_0x4fd3a7['query'][_0x005f('0x3d')]){_0x1334b4[_0x005f('0x3b')]=_[_0x005f('0x3e')](_0x1334b4['where'],{'$or':[{'key':{'$like':'%'+_0x4fd3a7['query']['filter']+'%'}},{'value':{'$like':'%'+_0x4fd3a7[_0x005f('0x36')][_0x005f('0x3d')]+'%'}}]});}_0x1334b4=_['merge']({},_0x1334b4,_0x4fd3a7[_0x005f('0x3f')]);var _0x2b228b={'where':_0x1334b4['where']};return db[_0x005f('0x2e')]['count'](_0x2b228b)[_0x005f('0x26')](function(_0x5b149b){_0x59aab9['count']=_0x5b149b;if(_0x4fd3a7[_0x005f('0x36')]['includeAll']){_0x1334b4[_0x005f('0x40')]=[{'all':!![]}];}return db[_0x005f('0x2e')]['findAll'](_0x1334b4);})[_0x005f('0x26')](function(_0x56db30){_0x59aab9[_0x005f('0x41')]=_0x56db30;return _0x59aab9;})[_0x005f('0x26')](respondWithFilteredResult(_0x433a75,_0x1334b4))[_0x005f('0x42')](handleError(_0x433a75,null));};exports['show']=function(_0x295130,_0x182b18){var _0x5dfad7={'raw':!![],'where':{'id':_0x295130[_0x005f('0x43')]['id']}},_0x5a1964={};_0x5a1964['model']=_['keys'](db[_0x005f('0x2e')][_0x005f('0x2f')]);_0x5a1964[_0x005f('0x36')]=_[_0x005f('0x44')](_0x295130[_0x005f('0x36')]);_0x5a1964['filters']=_[_0x005f('0x35')](_0x5a1964[_0x005f('0x33')],_0x5a1964['query']);_0x5dfad7['attributes']=_[_0x005f('0x35')](_0x5a1964[_0x005f('0x33')],qs['fields'](_0x295130[_0x005f('0x36')][_0x005f('0x45')]));_0x5dfad7[_0x005f('0x37')]=_0x5dfad7[_0x005f('0x37')]['length']?_0x5dfad7['attributes']:_0x5a1964['model'];if(_0x295130[_0x005f('0x36')][_0x005f('0x46')]){_0x5dfad7[_0x005f('0x40')]=[{'all':!![]}];}_0x5dfad7=_[_0x005f('0x3e')]({},_0x5dfad7,_0x295130['options']);return db[_0x005f('0x2e')]['find'](_0x5dfad7)['then'](handleEntityNotFound(_0x182b18,null))[_0x005f('0x26')](respondWithResult(_0x182b18,null))[_0x005f('0x42')](handleError(_0x182b18,null));};exports[_0x005f('0x25')]=function(_0x5ae144,_0x345db1){if(_0x5ae144['body']['id']){delete _0x5ae144[_0x005f('0x47')]['id'];}return db[_0x005f('0x2e')][_0x005f('0x48')]({'where':{'id':_0x5ae144[_0x005f('0x43')]['id']}})[_0x005f('0x26')](handleEntityNotFound(_0x345db1,null))[_0x005f('0x26')](saveUpdates(_0x5ae144[_0x005f('0x47')],null))[_0x005f('0x26')](respondWithResult(_0x345db1,null))['catch'](handleError(_0x345db1,null));};exports[_0x005f('0x29')]=function(_0xa51057,_0x2ca944){return db[_0x005f('0x2e')][_0x005f('0x48')]({'where':{'id':_0xa51057[_0x005f('0x43')]['id']}})[_0x005f('0x26')](handleEntityNotFound(_0x2ca944,null))[_0x005f('0x26')](removeEntity(_0x2ca944,null))[_0x005f('0x42')](handleError(_0x2ca944,null));};exports[_0x005f('0x49')]=function(_0x30ccbf,_0x163240){var _0x299430={'key':_0x30ccbf[_0x005f('0x47')]['key']};if(_0x30ccbf[_0x005f('0x47')][_0x005f('0x4a')]){_0x299430[_0x005f('0x4a')]=_0x30ccbf[_0x005f('0x47')][_0x005f('0x4a')];}else if(_0x30ccbf[_0x005f('0x47')][_0x005f('0x4b')]){_0x299430[_0x005f('0x4b')]=_0x30ccbf[_0x005f('0x47')][_0x005f('0x4b')];}else if(_0x30ccbf[_0x005f('0x47')]['OpenchannelAccountId']){_0x299430[_0x005f('0x4c')]=_0x30ccbf['body']['OpenchannelAccountId'];}else if(_0x30ccbf[_0x005f('0x47')][_0x005f('0x4d')]){_0x299430[_0x005f('0x4d')]=_0x30ccbf[_0x005f('0x47')][_0x005f('0x4d')];}return db[_0x005f('0x2e')][_0x005f('0x48')]({'where':_0x299430})[_0x005f('0x26')](function(_0x4e0dc2){if(_0x4e0dc2){throw new db[(_0x005f('0x4e'))][(_0x005f('0x4f'))](_0x005f('0x50'));}return db[_0x005f('0x2e')][_0x005f('0x49')](_0x30ccbf[_0x005f('0x47')]);})[_0x005f('0x26')](function(_0x531f3e){var _0x3a4fcd=_0x30ccbf[_0x005f('0x51')][_0x005f('0x27')]({'plain':!![]});if(!_0x3a4fcd)throw new Error(_0x005f('0x52'));if(_0x3a4fcd[_0x005f('0x53')]===_0x005f('0x51')){var _0x4f40d6=_0x531f3e[_0x005f('0x27')]({'plain':!![]});return db[_0x005f('0x54')]['find']({'where':{'name':_0x005f('0x28'),'userProfileId':_0x3a4fcd[_0x005f('0x55')]},'raw':!![]})[_0x005f('0x26')](function(_0x19d031){if(_0x19d031&&_0x19d031[_0x005f('0x56')]===0x0){return db[_0x005f('0x57')]['create']({'name':_0x4f40d6[_0x005f('0x2a')],'resourceId':_0x4f40d6['id'],'type':_0x19d031[_0x005f('0x2a')],'sectionId':_0x19d031['id']},{})[_0x005f('0x26')](function(){return _0x531f3e;});}else{return _0x531f3e;}})['catch'](function(_0x2ea0b0){logger['error'](_0x005f('0x58'),_0x2ea0b0);throw _0x2ea0b0;});}return _0x531f3e;})['then'](respondWithResult(_0x163240,0xc9))[_0x005f('0x42')](handleError(_0x163240,null));};
\ No newline at end of file
+var _0xf832=['set','Content-Range','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','name','send','index','rawAttributes','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','CannedAnswer','includeAll','include','findAll','rows','catch','show','params','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x43e97d,_0x56a06b){var _0x424cd9=function(_0x4f574b){while(--_0x4f574b){_0x43e97d['push'](_0x43e97d['shift']());}};_0x424cd9(++_0x56a06b);}(_0xf832,0x1f0));var _0x2f83=function(_0x29a4fb,_0x537211){_0x29a4fb=_0x29a4fb-0x0;var _0x20d5cf=_0xf832[_0x29a4fb];return _0x20d5cf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2f83('0x0'));var zipdir=require(_0x2f83('0x1'));var jsonpatch=require(_0x2f83('0x2'));var rp=require(_0x2f83('0x3'));var moment=require('moment');var BPromise=require(_0x2f83('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2f83('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2f83('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2f83('0x7'));var crypto=require(_0x2f83('0x8'));var jsforce=require(_0x2f83('0x9'));var deskjs=require(_0x2f83('0xa'));var toCsv=require(_0x2f83('0xb'));var querystring=require(_0x2f83('0xc'));var Papa=require(_0x2f83('0xd'));var Redis=require('ioredis');var authService=require(_0x2f83('0xe'));var qs=require(_0x2f83('0xf'));var as=require(_0x2f83('0x10'));var hardwareService=require(_0x2f83('0x11'));var logger=require(_0x2f83('0x12'))(_0x2f83('0x13'));var utils=require(_0x2f83('0x14'));var config=require(_0x2f83('0x15'));var licenseUtil=require(_0x2f83('0x16'));var db=require(_0x2f83('0x17'))['db'];function respondWithStatusCode(_0x1fd7d6,_0x54fd78){_0x54fd78=_0x54fd78||0xcc;return function(_0x1feba1){if(_0x1feba1){return _0x1fd7d6[_0x2f83('0x18')](_0x54fd78);}return _0x1fd7d6[_0x2f83('0x19')](_0x54fd78)[_0x2f83('0x1a')]();};}function respondWithResult(_0x2c9bd2,_0x56a86b){_0x56a86b=_0x56a86b||0xc8;return function(_0x392d3b){if(_0x392d3b){return _0x2c9bd2[_0x2f83('0x19')](_0x56a86b)[_0x2f83('0x1b')](_0x392d3b);}};}function respondWithFilteredResult(_0x14f9b7,_0x369ed9){return function(_0xa9764e){if(_0xa9764e){var _0x130672=typeof _0x369ed9[_0x2f83('0x1c')]===_0x2f83('0x1d')&&typeof _0x369ed9[_0x2f83('0x1e')]===_0x2f83('0x1d');var _0x359b31=_0xa9764e[_0x2f83('0x1f')];var _0x3b6375=_0x130672?0x0:_0x369ed9[_0x2f83('0x1c')];var _0xf5cb21=_0x130672?_0xa9764e[_0x2f83('0x1f')]:_0x369ed9[_0x2f83('0x1c')]+_0x369ed9[_0x2f83('0x1e')];var _0x43515e;if(_0xf5cb21>=_0x359b31){_0xf5cb21=_0x359b31;_0x43515e=0xc8;}else{_0x43515e=0xce;}_0x14f9b7[_0x2f83('0x19')](_0x43515e);return _0x14f9b7[_0x2f83('0x20')](_0x2f83('0x21'),_0x3b6375+'-'+_0xf5cb21+'/'+_0x359b31)['json'](_0xa9764e);}return null;};}function patchUpdates(_0x52f8d0){return function(_0x3a6482){try{jsonpatch['apply'](_0x3a6482,_0x52f8d0,!![]);}catch(_0x4e24d5){return BPromise[_0x2f83('0x22')](_0x4e24d5);}return _0x3a6482[_0x2f83('0x23')]();};}function saveUpdates(_0x593b15,_0x558c1f){return function(_0x14880c){if(_0x14880c){return _0x14880c[_0x2f83('0x24')](_0x593b15)[_0x2f83('0x25')](function(_0x573448){return _0x573448;});}return null;};}function removeEntity(_0x20c015,_0x3b0da9){return function(_0x4e741e){if(_0x4e741e){return _0x4e741e[_0x2f83('0x26')]()[_0x2f83('0x25')](function(){var _0x32c42c=_0x4e741e[_0x2f83('0x27')]({'plain':!![]});var _0x148622=_0x2f83('0x28');return db[_0x2f83('0x29')][_0x2f83('0x26')]({'where':{'type':_0x148622,'resourceId':_0x32c42c['id']}})[_0x2f83('0x25')](function(){return _0x4e741e;});})[_0x2f83('0x25')](function(){_0x20c015['status'](0xcc)[_0x2f83('0x1a')]();});}};}function handleEntityNotFound(_0x11ae67,_0x4ac843){return function(_0x4b4ca9){if(!_0x4b4ca9){_0x11ae67['sendStatus'](0x194);}return _0x4b4ca9;};}function handleError(_0x390e4a,_0x46d39b){_0x46d39b=_0x46d39b||0x1f4;return function(_0x573434){logger['error'](_0x573434['stack']);if(_0x573434[_0x2f83('0x2a')]){delete _0x573434['name'];}_0x390e4a[_0x2f83('0x19')](_0x46d39b)[_0x2f83('0x2b')](_0x573434);};}exports[_0x2f83('0x2c')]=function(_0x482370,_0x307aac){var _0x347f15={},_0x41a0d5={},_0x545420={'count':0x0,'rows':[]};var _0x116c68=_['map'](db['CannedAnswer'][_0x2f83('0x2d')],function(_0x53f518){return{'name':_0x53f518['fieldName'],'type':_0x53f518['type'][_0x2f83('0x2e')]};});_0x41a0d5[_0x2f83('0x2f')]=_[_0x2f83('0x30')](_0x116c68,_0x2f83('0x2a'));_0x41a0d5[_0x2f83('0x31')]=_[_0x2f83('0x32')](_0x482370[_0x2f83('0x31')]);_0x41a0d5[_0x2f83('0x33')]=_[_0x2f83('0x34')](_0x41a0d5[_0x2f83('0x2f')],_0x41a0d5[_0x2f83('0x31')]);_0x347f15['attributes']=_['intersection'](_0x41a0d5[_0x2f83('0x2f')],qs[_0x2f83('0x35')](_0x482370['query']['fields']));_0x347f15[_0x2f83('0x36')]=_0x347f15['attributes'][_0x2f83('0x37')]?_0x347f15[_0x2f83('0x36')]:_0x41a0d5[_0x2f83('0x2f')];if(!_0x482370[_0x2f83('0x31')][_0x2f83('0x38')]('nolimit')){_0x347f15['limit']=qs[_0x2f83('0x1e')](_0x482370[_0x2f83('0x31')][_0x2f83('0x1e')]);_0x347f15[_0x2f83('0x1c')]=qs[_0x2f83('0x1c')](_0x482370['query']['offset']);}_0x347f15[_0x2f83('0x39')]=qs[_0x2f83('0x3a')](_0x482370[_0x2f83('0x31')]['sort']);_0x347f15['where']=qs[_0x2f83('0x33')](_[_0x2f83('0x3b')](_0x482370[_0x2f83('0x31')],_0x41a0d5[_0x2f83('0x33')]),_0x116c68);if(_0x482370[_0x2f83('0x31')][_0x2f83('0x3c')]){_0x347f15[_0x2f83('0x3d')]=_[_0x2f83('0x3e')](_0x347f15['where'],{'$or':[{'key':{'$like':'%'+_0x482370[_0x2f83('0x31')][_0x2f83('0x3c')]+'%'}},{'value':{'$like':'%'+_0x482370['query'][_0x2f83('0x3c')]+'%'}}]});}_0x347f15=_['merge']({},_0x347f15,_0x482370[_0x2f83('0x3f')]);var _0x2f15dd={'where':_0x347f15[_0x2f83('0x3d')]};return db[_0x2f83('0x40')][_0x2f83('0x1f')](_0x2f15dd)[_0x2f83('0x25')](function(_0x404db3){_0x545420['count']=_0x404db3;if(_0x482370[_0x2f83('0x31')][_0x2f83('0x41')]){_0x347f15[_0x2f83('0x42')]=[{'all':!![]}];}return db[_0x2f83('0x40')][_0x2f83('0x43')](_0x347f15);})[_0x2f83('0x25')](function(_0x2efc5d){_0x545420[_0x2f83('0x44')]=_0x2efc5d;return _0x545420;})['then'](respondWithFilteredResult(_0x307aac,_0x347f15))[_0x2f83('0x45')](handleError(_0x307aac,null));};exports[_0x2f83('0x46')]=function(_0x1e467e,_0x8eb833){var _0x2d77e8={'raw':!![],'where':{'id':_0x1e467e[_0x2f83('0x47')]['id']}},_0x55b1fd={};_0x55b1fd['model']=_[_0x2f83('0x32')](db['CannedAnswer'][_0x2f83('0x2d')]);_0x55b1fd['query']=_[_0x2f83('0x32')](_0x1e467e[_0x2f83('0x31')]);_0x55b1fd[_0x2f83('0x33')]=_[_0x2f83('0x34')](_0x55b1fd[_0x2f83('0x2f')],_0x55b1fd[_0x2f83('0x31')]);_0x2d77e8[_0x2f83('0x36')]=_['intersection'](_0x55b1fd[_0x2f83('0x2f')],qs[_0x2f83('0x35')](_0x1e467e[_0x2f83('0x31')][_0x2f83('0x35')]));_0x2d77e8[_0x2f83('0x36')]=_0x2d77e8['attributes']['length']?_0x2d77e8[_0x2f83('0x36')]:_0x55b1fd[_0x2f83('0x2f')];if(_0x1e467e[_0x2f83('0x31')][_0x2f83('0x41')]){_0x2d77e8[_0x2f83('0x42')]=[{'all':!![]}];}_0x2d77e8=_['merge']({},_0x2d77e8,_0x1e467e['options']);return db[_0x2f83('0x40')][_0x2f83('0x48')](_0x2d77e8)[_0x2f83('0x25')](handleEntityNotFound(_0x8eb833,null))[_0x2f83('0x25')](respondWithResult(_0x8eb833,null))[_0x2f83('0x45')](handleError(_0x8eb833,null));};exports[_0x2f83('0x24')]=function(_0x19d382,_0x4acbe0){if(_0x19d382[_0x2f83('0x49')]['id']){delete _0x19d382[_0x2f83('0x49')]['id'];}return db[_0x2f83('0x40')][_0x2f83('0x48')]({'where':{'id':_0x19d382[_0x2f83('0x47')]['id']}})[_0x2f83('0x25')](handleEntityNotFound(_0x4acbe0,null))['then'](saveUpdates(_0x19d382[_0x2f83('0x49')],null))[_0x2f83('0x25')](respondWithResult(_0x4acbe0,null))[_0x2f83('0x45')](handleError(_0x4acbe0,null));};exports[_0x2f83('0x26')]=function(_0x705680,_0x541d4b){return db[_0x2f83('0x40')][_0x2f83('0x48')]({'where':{'id':_0x705680[_0x2f83('0x47')]['id']}})['then'](handleEntityNotFound(_0x541d4b,null))['then'](removeEntity(_0x541d4b,null))['catch'](handleError(_0x541d4b,null));};exports[_0x2f83('0x4a')]=function(_0x21336d,_0x57131e){var _0x4012e1={'key':_0x21336d['body'][_0x2f83('0x2e')]};if(_0x21336d['body']['MailAccountId']){_0x4012e1['MailAccountId']=_0x21336d[_0x2f83('0x49')][_0x2f83('0x4b')];}else if(_0x21336d['body'][_0x2f83('0x4c')]){_0x4012e1[_0x2f83('0x4c')]=_0x21336d[_0x2f83('0x49')][_0x2f83('0x4c')];}else if(_0x21336d['body'][_0x2f83('0x4d')]){_0x4012e1[_0x2f83('0x4d')]=_0x21336d[_0x2f83('0x49')]['OpenchannelAccountId'];}else if(_0x21336d[_0x2f83('0x49')][_0x2f83('0x4e')]){_0x4012e1['ChatWebsiteId']=_0x21336d[_0x2f83('0x49')][_0x2f83('0x4e')];}return db['CannedAnswer'][_0x2f83('0x48')]({'where':_0x4012e1})[_0x2f83('0x25')](function(_0x332da9){if(_0x332da9){throw new db[(_0x2f83('0x4f'))][(_0x2f83('0x50'))](_0x2f83('0x51'));}return db[_0x2f83('0x40')][_0x2f83('0x4a')](_0x21336d[_0x2f83('0x49')]);})[_0x2f83('0x25')](function(_0x43544b){var _0x159b5d=_0x21336d[_0x2f83('0x52')][_0x2f83('0x27')]({'plain':!![]});if(!_0x159b5d)throw new Error(_0x2f83('0x53'));if(_0x159b5d['role']==='user'){var _0x900780=_0x43544b[_0x2f83('0x27')]({'plain':!![]});return db[_0x2f83('0x54')][_0x2f83('0x48')]({'where':{'name':'CannedAnswers','userProfileId':_0x159b5d[_0x2f83('0x55')]},'raw':!![]})['then'](function(_0x128419){if(_0x128419&&_0x128419[_0x2f83('0x56')]===0x0){return db[_0x2f83('0x29')]['create']({'name':_0x900780[_0x2f83('0x2a')],'resourceId':_0x900780['id'],'type':_0x128419['name'],'sectionId':_0x128419['id']},{})['then'](function(){return _0x43544b;});}else{return _0x43544b;}})[_0x2f83('0x45')](function(_0x48c499){logger[_0x2f83('0x57')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x48c499);throw _0x48c499;});}return _0x43544b;})['then'](respondWithResult(_0x57131e,0xc9))[_0x2f83('0x45')](handleError(_0x57131e,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 5ed2be1..545d750 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 _0xa769=['../../config/logger','api','moment','request-promise','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x396e90,_0x4c7718){var _0xaf7e4c=function(_0x2a96bc){while(--_0x2a96bc){_0x396e90['push'](_0x396e90['shift']());}};_0xaf7e4c(++_0x4c7718);}(_0xa769,0xfb));var _0x9a76=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xa769[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x9a76('0x0'));var util=require('util');var logger=require(_0x9a76('0x1'))(_0x9a76('0x2'));var moment=require(_0x9a76('0x3'));var BPromise=require('bluebird');var rp=require(_0x9a76('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9a76('0x5'));var attributes=require(_0x9a76('0x6'));module['exports']=function(_0x24761d,_0x29af51){return _0x24761d[_0x9a76('0x7')](_0x9a76('0x8'),attributes,{'tableName':_0x9a76('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9a76('0xa'),'collate':_0x9a76('0xb')});};
\ No newline at end of file
+var _0xb5a6=['bluebird','request-promise','path','rimraf','exports','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x14ee9f,_0x32dbd5){var _0x4c8ae3=function(_0x1bd4af){while(--_0x1bd4af){_0x14ee9f['push'](_0x14ee9f['shift']());}};_0x4c8ae3(++_0x32dbd5);}(_0xb5a6,0x159));var _0x6b5a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xb5a6[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x6b5a('0x0'));var util=require(_0x6b5a('0x1'));var logger=require('../../config/logger')(_0x6b5a('0x2'));var moment=require('moment');var BPromise=require(_0x6b5a('0x3'));var rp=require(_0x6b5a('0x4'));var fs=require('fs');var path=require(_0x6b5a('0x5'));var rimraf=require(_0x6b5a('0x6'));var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0x6b5a('0x7')]=function(_0x598dde,_0x50affd){return _0x598dde[_0x6b5a('0x8')]('CannedAnswer',attributes,{'tableName':_0x6b5a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6b5a('0xa'),'collate':_0x6b5a('0xb')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 231fc01..4de016d 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(_0x51d11d,_0x16415b){var _0x27472b=function(_0xd6c976){while(--_0xd6c976){_0x51d11d['push'](_0x51d11d['shift']());}};_0x27472b(++_0x16415b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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(_0x593769,_0x433da8){var _0x2f4aed=function(_0x108e9f){while(--_0x108e9f){_0x593769['push'](_0x593769['shift']());}};_0x2f4aed(++_0x433da8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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 435ba6c..0798b66 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 _0x3c45=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get','/:id','post','put','update','delete','destroy','exports','multer'];(function(_0x87be39,_0x15f972){var _0x506e93=function(_0x579ce4){while(--_0x579ce4){_0x87be39['push'](_0x87be39['shift']());}};_0x506e93(++_0x15f972);}(_0x3c45,0x11c));var _0x53c4=function(_0x37fdd2,_0x44e51e){_0x37fdd2=_0x37fdd2-0x0;var _0x5c6b7c=_0x3c45[_0x37fdd2];return _0x5c6b7c;};'use strict';var multer=require(_0x53c4('0x0'));var util=require(_0x53c4('0x1'));var path=require('path');var timeout=require(_0x53c4('0x2'));var express=require(_0x53c4('0x3'));var router=express[_0x53c4('0x4')]();var fs_extra=require(_0x53c4('0x5'));var auth=require(_0x53c4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x53c4('0x7'));var controller=require(_0x53c4('0x8'));router['get']('/',auth[_0x53c4('0x9')](),controller[_0x53c4('0xa')]);router[_0x53c4('0xb')](_0x53c4('0xc'),auth[_0x53c4('0x9')](),controller['show']);router[_0x53c4('0xd')]('/',auth[_0x53c4('0x9')](),controller['create']);router[_0x53c4('0xe')](_0x53c4('0xc'),auth['isAuthenticated'](),controller[_0x53c4('0xf')]);router[_0x53c4('0x10')](_0x53c4('0xc'),auth[_0x53c4('0x9')](),controller[_0x53c4('0x11')]);module[_0x53c4('0x12')]=router;
\ No newline at end of file
+var _0x999f=['./cannedAnswer.controller','get','isAuthenticated','index','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x1778e1,_0x3e1727){var _0x2bc4c6=function(_0x359c65){while(--_0x359c65){_0x1778e1['push'](_0x1778e1['shift']());}};_0x2bc4c6(++_0x3e1727);}(_0x999f,0x1d7));var _0xf999=function(_0x87239,_0x38c793){_0x87239=_0x87239-0x0;var _0x53af1e=_0x999f[_0x87239];return _0x53af1e;};'use strict';var multer=require(_0xf999('0x0'));var util=require(_0xf999('0x1'));var path=require(_0xf999('0x2'));var timeout=require(_0xf999('0x3'));var express=require(_0xf999('0x4'));var router=express[_0xf999('0x5')]();var fs_extra=require(_0xf999('0x6'));var auth=require(_0xf999('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xf999('0x8'));var controller=require(_0xf999('0x9'));router[_0xf999('0xa')]('/',auth[_0xf999('0xb')](),controller[_0xf999('0xc')]);router[_0xf999('0xa')]('/:id',auth[_0xf999('0xb')](),controller['show']);router[_0xf999('0xd')]('/',auth[_0xf999('0xb')](),controller[_0xf999('0xe')]);router[_0xf999('0xf')](_0xf999('0x10'),auth[_0xf999('0xb')](),controller[_0xf999('0x11')]);router[_0xf999('0x12')](_0xf999('0x10'),auth[_0xf999('0xb')](),controller[_0xf999('0x13')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 16711f2..68fc559 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 _0x3e0f=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x3e0f,0xfc));var _0xf3e0=function(_0xcfeda9,_0xd418ae){_0xcfeda9=_0xcfeda9-0x0;var _0x4826c7=_0x3e0f[_0xcfeda9];return _0x4826c7;};'use strict';var Sequelize=require(_0xf3e0('0x0'));module[_0xf3e0('0x1')]={'calldate':{'type':Sequelize[_0xf3e0('0x2')],'allowNull':![],'defaultValue':_0xf3e0('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xf3e0('0x4')]},'dst':{'type':Sequelize[_0xf3e0('0x4')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xf3e0('0x4')]},'dstchannel':{'type':Sequelize[_0xf3e0('0x4')]},'lastapp':{'type':Sequelize[_0xf3e0('0x4')]},'lastdata':{'type':Sequelize[_0xf3e0('0x4')]},'duration':{'type':Sequelize[_0xf3e0('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xf3e0('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xf3e0('0x4')]},'userfield':{'type':Sequelize[_0xf3e0('0x4')]},'uniqueid':{'type':Sequelize[_0xf3e0('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xf3e0('0x4')]},'peeraccount':{'type':Sequelize[_0xf3e0('0x4')]},'type':{'type':Sequelize[_0xf3e0('0x4')]},'tag':{'type':Sequelize[_0xf3e0('0x4')]}};
\ No newline at end of file
+var _0x3512=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x1ea2d3,_0x52b66c){var _0x585cf4=function(_0x5a3f1e){while(--_0x5a3f1e){_0x1ea2d3['push'](_0x1ea2d3['shift']());}};_0x585cf4(++_0x52b66c);}(_0x3512,0x13b));var _0x2351=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x3512[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require('sequelize');module[_0x2351('0x0')]={'calldate':{'type':Sequelize[_0x2351('0x1')],'allowNull':![],'defaultValue':_0x2351('0x2')},'clid':{'type':Sequelize[_0x2351('0x3')]},'src':{'type':Sequelize[_0x2351('0x3')]},'dst':{'type':Sequelize[_0x2351('0x3')]},'dcontext':{'type':Sequelize[_0x2351('0x3')]},'channel':{'type':Sequelize[_0x2351('0x3')]},'dstchannel':{'type':Sequelize[_0x2351('0x3')]},'lastapp':{'type':Sequelize[_0x2351('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x2351('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x2351('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x2351('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x2351('0x3')]},'userfield':{'type':Sequelize[_0x2351('0x3')]},'uniqueid':{'type':Sequelize[_0x2351('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x2351('0x3')]},'type':{'type':Sequelize[_0x2351('0x3')]},'tag':{'type':Sequelize[_0x2351('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 1d64f04..cb40544 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 _0x29d4=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','set','Content-Range','apply','reject','update','then','end','stack','name','send','index','Cdr','rawAttributes','fieldName','type','model','map','query','keys','fields','attributes','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','intersection','find','create','body','destroy','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce'];(function(_0x1d309a,_0x3cb540){var _0x5c7317=function(_0x5c4bf5){while(--_0x5c4bf5){_0x1d309a['push'](_0x1d309a['shift']());}};_0x5c7317(++_0x3cb540);}(_0x29d4,0x1a1));var _0x429d=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0x29d4[_0x102e37];return _0x35a07c;};'use strict';var emlformat=require(_0x429d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x429d('0x1'));var jsonpatch=require(_0x429d('0x2'));var rp=require(_0x429d('0x3'));var moment=require(_0x429d('0x4'));var BPromise=require(_0x429d('0x5'));var Mustache=require('mustache');var util=require(_0x429d('0x6'));var path=require(_0x429d('0x7'));var sox=require(_0x429d('0x8'));var csv=require(_0x429d('0x9'));var ejs=require(_0x429d('0xa'));var fs=require('fs');var fs_extra=require(_0x429d('0xb'));var _=require(_0x429d('0xc'));var squel=require(_0x429d('0xd'));var crypto=require('crypto');var jsforce=require(_0x429d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x429d('0x9'));var querystring=require(_0x429d('0xf'));var Papa=require(_0x429d('0x10'));var Redis=require('ioredis');var authService=require(_0x429d('0x11'));var qs=require(_0x429d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x429d('0x13'));var logger=require(_0x429d('0x14'))(_0x429d('0x15'));var utils=require('../../config/utils');var config=require(_0x429d('0x16'));var licenseUtil=require(_0x429d('0x17'));var db=require(_0x429d('0x18'))['db'];function respondWithStatusCode(_0x1cb1cf,_0x4843af){_0x4843af=_0x4843af||0xcc;return function(_0x1c542c){if(_0x1c542c){return _0x1cb1cf[_0x429d('0x19')](_0x4843af);}return _0x1cb1cf[_0x429d('0x1a')](_0x4843af)['end']();};}function respondWithResult(_0x315d8d,_0x5dc247){_0x5dc247=_0x5dc247||0xc8;return function(_0x5c32ab){if(_0x5c32ab){return _0x315d8d[_0x429d('0x1a')](_0x5dc247)[_0x429d('0x1b')](_0x5c32ab);}};}function respondWithFilteredResult(_0x1bfbdb,_0x2ee97b){return function(_0x8c8a15){if(_0x8c8a15){var _0x2363a0=typeof _0x2ee97b['offset']===_0x429d('0x1c')&&typeof _0x2ee97b['limit']===_0x429d('0x1c');var _0x35830e=_0x8c8a15[_0x429d('0x1d')];var _0x2dc57a=_0x2363a0?0x0:_0x2ee97b['offset'];var _0x240a7d=_0x2363a0?_0x8c8a15[_0x429d('0x1d')]:_0x2ee97b[_0x429d('0x1e')]+_0x2ee97b['limit'];var _0x329d67;if(_0x240a7d>=_0x35830e){_0x240a7d=_0x35830e;_0x329d67=0xc8;}else{_0x329d67=0xce;}_0x1bfbdb[_0x429d('0x1a')](_0x329d67);return _0x1bfbdb[_0x429d('0x1f')](_0x429d('0x20'),_0x2dc57a+'-'+_0x240a7d+'/'+_0x35830e)[_0x429d('0x1b')](_0x8c8a15);}return null;};}function patchUpdates(_0x4534bd){return function(_0x5a4093){try{jsonpatch[_0x429d('0x21')](_0x5a4093,_0x4534bd,!![]);}catch(_0x165e4d){return BPromise[_0x429d('0x22')](_0x165e4d);}return _0x5a4093['save']();};}function saveUpdates(_0x1492f1,_0x13fc71){return function(_0x452572){if(_0x452572){return _0x452572[_0x429d('0x23')](_0x1492f1)[_0x429d('0x24')](function(_0x1023e6){return _0x1023e6;});}return null;};}function removeEntity(_0x4c6d89,_0x28f84e){return function(_0x3a9a75){if(_0x3a9a75){return _0x3a9a75['destroy']()[_0x429d('0x24')](function(){_0x4c6d89[_0x429d('0x1a')](0xcc)[_0x429d('0x25')]();});}};}function handleEntityNotFound(_0x11c423,_0x5d2e06){return function(_0x3b12f6){if(!_0x3b12f6){_0x11c423[_0x429d('0x19')](0x194);}return _0x3b12f6;};}function handleError(_0x387639,_0x3896ee){_0x3896ee=_0x3896ee||0x1f4;return function(_0x3e4e73){logger['error'](_0x3e4e73[_0x429d('0x26')]);if(_0x3e4e73[_0x429d('0x27')]){delete _0x3e4e73[_0x429d('0x27')];}_0x387639[_0x429d('0x1a')](_0x3896ee)[_0x429d('0x28')](_0x3e4e73);};}exports[_0x429d('0x29')]=function(_0x2351c9,_0xdc7bf9){var _0x2ceb54={},_0x50ef02={},_0x31cae6={'count':0x0,'rows':[]};var _0x3ca640=_['map'](db[_0x429d('0x2a')][_0x429d('0x2b')],function(_0x2e95b5){return{'name':_0x2e95b5[_0x429d('0x2c')],'type':_0x2e95b5[_0x429d('0x2d')]['key']};});_0x50ef02[_0x429d('0x2e')]=_[_0x429d('0x2f')](_0x3ca640,_0x429d('0x27'));_0x50ef02[_0x429d('0x30')]=_[_0x429d('0x31')](_0x2351c9[_0x429d('0x30')]);_0x50ef02['filters']=_['intersection'](_0x50ef02[_0x429d('0x2e')],_0x50ef02[_0x429d('0x30')]);_0x2ceb54['attributes']=_['intersection'](_0x50ef02[_0x429d('0x2e')],qs['fields'](_0x2351c9[_0x429d('0x30')][_0x429d('0x32')]));_0x2ceb54[_0x429d('0x33')]=_0x2ceb54[_0x429d('0x33')]['length']?_0x2ceb54[_0x429d('0x33')]:_0x50ef02[_0x429d('0x2e')];if(!_0x2351c9['query']['hasOwnProperty']('nolimit')){_0x2ceb54['limit']=qs['limit'](_0x2351c9[_0x429d('0x30')]['limit']);_0x2ceb54['offset']=qs[_0x429d('0x1e')](_0x2351c9[_0x429d('0x30')][_0x429d('0x1e')]);}_0x2ceb54[_0x429d('0x34')]=qs[_0x429d('0x35')](_0x2351c9[_0x429d('0x30')]['sort']);_0x2ceb54[_0x429d('0x36')]=qs[_0x429d('0x37')](_[_0x429d('0x38')](_0x2351c9[_0x429d('0x30')],_0x50ef02[_0x429d('0x37')]),_0x3ca640);if(_0x2351c9[_0x429d('0x30')][_0x429d('0x39')]){_0x2ceb54[_0x429d('0x36')]=_[_0x429d('0x3a')](_0x2ceb54[_0x429d('0x36')],{'$or':_[_0x429d('0x2f')](_0x3ca640,function(_0x1e3924){if(_0x1e3924[_0x429d('0x2d')]!==_0x429d('0x3b')){var _0x1a80bc={};_0x1a80bc[_0x1e3924[_0x429d('0x27')]]={'$like':'%'+_0x2351c9['query']['filter']+'%'};return _0x1a80bc;}})});}_0x2ceb54=_[_0x429d('0x3a')]({},_0x2ceb54,_0x2351c9[_0x429d('0x3c')]);var _0x569811={'where':_0x2ceb54[_0x429d('0x36')]};return db[_0x429d('0x2a')][_0x429d('0x1d')](_0x569811)['then'](function(_0x50a907){_0x31cae6[_0x429d('0x1d')]=_0x50a907;if(_0x2351c9[_0x429d('0x30')]['includeAll']){_0x2ceb54[_0x429d('0x3d')]=[{'all':!![]}];}return db[_0x429d('0x2a')]['findAll'](_0x2ceb54);})[_0x429d('0x24')](function(_0x5182d3){_0x31cae6[_0x429d('0x3e')]=_0x5182d3;return _0x31cae6;})[_0x429d('0x24')](respondWithFilteredResult(_0xdc7bf9,_0x2ceb54))[_0x429d('0x3f')](handleError(_0xdc7bf9,null));};exports[_0x429d('0x40')]=function(_0x4da740,_0x34a79c){var _0x38b40c={'raw':!![],'where':{'id':_0x4da740['params']['id']}},_0x2a97c1={};_0x2a97c1['model']=_[_0x429d('0x31')](db[_0x429d('0x2a')][_0x429d('0x2b')]);_0x2a97c1[_0x429d('0x30')]=_['keys'](_0x4da740[_0x429d('0x30')]);_0x2a97c1[_0x429d('0x37')]=_[_0x429d('0x41')](_0x2a97c1[_0x429d('0x2e')],_0x2a97c1[_0x429d('0x30')]);_0x38b40c[_0x429d('0x33')]=_[_0x429d('0x41')](_0x2a97c1[_0x429d('0x2e')],qs[_0x429d('0x32')](_0x4da740[_0x429d('0x30')]['fields']));_0x38b40c[_0x429d('0x33')]=_0x38b40c['attributes']['length']?_0x38b40c['attributes']:_0x2a97c1[_0x429d('0x2e')];if(_0x4da740[_0x429d('0x30')]['includeAll']){_0x38b40c[_0x429d('0x3d')]=[{'all':!![]}];}_0x38b40c=_[_0x429d('0x3a')]({},_0x38b40c,_0x4da740['options']);return db[_0x429d('0x2a')][_0x429d('0x42')](_0x38b40c)[_0x429d('0x24')](handleEntityNotFound(_0x34a79c,null))[_0x429d('0x24')](respondWithResult(_0x34a79c,null))[_0x429d('0x3f')](handleError(_0x34a79c,null));};exports['create']=function(_0x29c7a2,_0xd9451b){return db[_0x429d('0x2a')][_0x429d('0x43')](_0x29c7a2['body'],{})[_0x429d('0x24')](respondWithResult(_0xd9451b,0xc9))[_0x429d('0x3f')](handleError(_0xd9451b,null));};exports[_0x429d('0x23')]=function(_0x58b6c7,_0x471ba5){if(_0x58b6c7['body']['id']){delete _0x58b6c7[_0x429d('0x44')]['id'];}return db[_0x429d('0x2a')][_0x429d('0x42')]({'where':{'id':_0x58b6c7['params']['id']}})['then'](handleEntityNotFound(_0x471ba5,null))[_0x429d('0x24')](saveUpdates(_0x58b6c7['body'],null))[_0x429d('0x24')](respondWithResult(_0x471ba5,null))[_0x429d('0x3f')](handleError(_0x471ba5,null));};exports[_0x429d('0x45')]=function(_0x25121e,_0x31d1e7){return db[_0x429d('0x2a')][_0x429d('0x42')]({'where':{'id':_0x25121e[_0x429d('0x46')]['id']}})['then'](handleEntityNotFound(_0x31d1e7,null))['then'](removeEntity(_0x31d1e7,null))[_0x429d('0x3f')](handleError(_0x31d1e7,null));};exports[_0x429d('0x47')]=function(_0x18f172,_0x3a15d1){return db['Cdr'][_0x429d('0x47')]()[_0x429d('0x24')](respondWithResult(_0x3a15d1,null))[_0x429d('0x3f')](handleError(_0x3a15d1,null));};
\ No newline at end of file
+var _0x7fbe=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','include','find','body','catch','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','end','error','stack','send','index','map','Cdr','rawAttributes','fieldName','type','key','name','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit'];(function(_0xa267e0,_0x105c55){var _0x41a923=function(_0x22edaf){while(--_0x22edaf){_0xa267e0['push'](_0xa267e0['shift']());}};_0x41a923(++_0x105c55);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x409deb,_0x2b731){_0x409deb=_0x409deb-0x0;var _0x15a4f7=_0x7fbe[_0x409deb];return _0x15a4f7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x27')]();});}};}function handleEntityNotFound(_0x2996ae,_0x4f6c73){return function(_0x6c930){if(!_0x6c930){_0x2996ae[_0xe7fb('0x1b')](0x194);}return _0x6c930;};}function handleError(_0x390f32,_0x1ceed8){_0x1ceed8=_0x1ceed8||0x1f4;return function(_0x392d75){logger[_0xe7fb('0x28')](_0x392d75[_0xe7fb('0x29')]);if(_0x392d75['name']){delete _0x392d75['name'];}_0x390f32[_0xe7fb('0x1c')](_0x1ceed8)[_0xe7fb('0x2a')](_0x392d75);};}exports[_0xe7fb('0x2b')]=function(_0x4fd290,_0xb1f2f4){var _0x251807={},_0xd3fffe={},_0x5f265f={'count':0x0,'rows':[]};var _0x219554=_[_0xe7fb('0x2c')](db[_0xe7fb('0x2d')][_0xe7fb('0x2e')],function(_0x4ce993){return{'name':_0x4ce993[_0xe7fb('0x2f')],'type':_0x4ce993[_0xe7fb('0x30')][_0xe7fb('0x31')]};});_0xd3fffe['model']=_['map'](_0x219554,_0xe7fb('0x32'));_0xd3fffe['query']=_[_0xe7fb('0x33')](_0x4fd290[_0xe7fb('0x34')]);_0xd3fffe[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0xd3fffe['model'],_0xd3fffe[_0xe7fb('0x34')]);_0x251807[_0xe7fb('0x37')]=_[_0xe7fb('0x36')](_0xd3fffe[_0xe7fb('0x38')],qs[_0xe7fb('0x39')](_0x4fd290['query'][_0xe7fb('0x39')]));_0x251807[_0xe7fb('0x37')]=_0x251807[_0xe7fb('0x37')][_0xe7fb('0x3a')]?_0x251807[_0xe7fb('0x37')]:_0xd3fffe[_0xe7fb('0x38')];if(!_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x3b')](_0xe7fb('0x3c'))){_0x251807['limit']=qs[_0xe7fb('0x20')](_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x20')]);_0x251807['offset']=qs[_0xe7fb('0x1e')](_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x1e')]);}_0x251807[_0xe7fb('0x3d')]=qs[_0xe7fb('0x3e')](_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x3e')]);_0x251807[_0xe7fb('0x3f')]=qs[_0xe7fb('0x35')](_[_0xe7fb('0x40')](_0x4fd290[_0xe7fb('0x34')],_0xd3fffe[_0xe7fb('0x35')]),_0x219554);if(_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x41')]){_0x251807[_0xe7fb('0x3f')]=_[_0xe7fb('0x42')](_0x251807[_0xe7fb('0x3f')],{'$or':_[_0xe7fb('0x2c')](_0x219554,function(_0x21e35c){if(_0x21e35c['type']!==_0xe7fb('0x43')){var _0x23f9f9={};_0x23f9f9[_0x21e35c[_0xe7fb('0x32')]]={'$like':'%'+_0x4fd290[_0xe7fb('0x34')]['filter']+'%'};return _0x23f9f9;}})});}_0x251807=_[_0xe7fb('0x42')]({},_0x251807,_0x4fd290[_0xe7fb('0x44')]);var _0xd472d={'where':_0x251807[_0xe7fb('0x3f')]};return db['Cdr'][_0xe7fb('0x21')](_0xd472d)[_0xe7fb('0x26')](function(_0x34265f){_0x5f265f[_0xe7fb('0x21')]=_0x34265f;if(_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x45')]){_0x251807['include']=[{'all':!![]}];}return db[_0xe7fb('0x2d')][_0xe7fb('0x46')](_0x251807);})[_0xe7fb('0x26')](function(_0x4b263d){_0x5f265f[_0xe7fb('0x47')]=_0x4b263d;return _0x5f265f;})[_0xe7fb('0x26')](respondWithFilteredResult(_0xb1f2f4,_0x251807))['catch'](handleError(_0xb1f2f4,null));};exports['show']=function(_0x5a01ae,_0x5ed3d4){var _0x5e0153={'raw':!![],'where':{'id':_0x5a01ae[_0xe7fb('0x48')]['id']}},_0x900d67={};_0x900d67[_0xe7fb('0x38')]=_['keys'](db[_0xe7fb('0x2d')]['rawAttributes']);_0x900d67[_0xe7fb('0x34')]=_[_0xe7fb('0x33')](_0x5a01ae['query']);_0x900d67[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x900d67[_0xe7fb('0x38')],_0x900d67[_0xe7fb('0x34')]);_0x5e0153['attributes']=_[_0xe7fb('0x36')](_0x900d67[_0xe7fb('0x38')],qs[_0xe7fb('0x39')](_0x5a01ae['query'][_0xe7fb('0x39')]));_0x5e0153[_0xe7fb('0x37')]=_0x5e0153[_0xe7fb('0x37')][_0xe7fb('0x3a')]?_0x5e0153[_0xe7fb('0x37')]:_0x900d67['model'];if(_0x5a01ae[_0xe7fb('0x34')]['includeAll']){_0x5e0153[_0xe7fb('0x49')]=[{'all':!![]}];}_0x5e0153=_[_0xe7fb('0x42')]({},_0x5e0153,_0x5a01ae[_0xe7fb('0x44')]);return db[_0xe7fb('0x2d')][_0xe7fb('0x4a')](_0x5e0153)['then'](handleEntityNotFound(_0x5ed3d4,null))[_0xe7fb('0x26')](respondWithResult(_0x5ed3d4,null))['catch'](handleError(_0x5ed3d4,null));};exports['create']=function(_0x12c828,_0x3d740f){return db[_0xe7fb('0x2d')]['create'](_0x12c828[_0xe7fb('0x4b')],{})[_0xe7fb('0x26')](respondWithResult(_0x3d740f,0xc9))['catch'](handleError(_0x3d740f,null));};exports['update']=function(_0x284bcb,_0x42270b){if(_0x284bcb[_0xe7fb('0x4b')]['id']){delete _0x284bcb[_0xe7fb('0x4b')]['id'];}return db[_0xe7fb('0x2d')][_0xe7fb('0x4a')]({'where':{'id':_0x284bcb[_0xe7fb('0x48')]['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x42270b,null))['then'](saveUpdates(_0x284bcb[_0xe7fb('0x4b')],null))['then'](respondWithResult(_0x42270b,null))[_0xe7fb('0x4c')](handleError(_0x42270b,null));};exports[_0xe7fb('0x4d')]=function(_0x5cedfb,_0x25347b){return db['Cdr'][_0xe7fb('0x4a')]({'where':{'id':_0x5cedfb['params']['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x25347b,null))['then'](removeEntity(_0x25347b,null))[_0xe7fb('0x4c')](handleError(_0x25347b,null));};exports['describe']=function(_0x1fff6c,_0x1b6442){return db[_0xe7fb('0x2d')][_0xe7fb('0x4e')]()[_0xe7fb('0x26')](respondWithResult(_0x1b6442,null))[_0xe7fb('0x4c')](handleError(_0x1b6442,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index c9a1c29..e6624c2 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x62ce80,_0x3f4bf3){var _0x13129b=function(_0x3a48ce){while(--_0x3a48ce){_0x62ce80['push'](_0x62ce80['shift']());}};_0x13129b(++_0x3f4bf3);}(_0x7a54,0x106));var _0x47a5=function(_0x3b1833,_0xd05fd0){_0x3b1833=_0x3b1833-0x0;var _0x4b61aa=_0x7a54[_0x3b1833];return _0x4b61aa;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x34574a,_0x413644){var _0x5dff3f=function(_0x428c50){while(--_0x428c50){_0x34574a['push'](_0x34574a['shift']());}};_0x5dff3f(++_0x413644);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 07905d2..8a9fb6a 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 _0x0d10=['lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','Cdr,\x20%s,\x20%s','message','result','catch'];(function(_0x30f967,_0xf75f39){var _0x760297=function(_0x275d2e){while(--_0x275d2e){_0x30f967['push'](_0x30f967['shift']());}};_0x760297(++_0xf75f39);}(_0x0d10,0x11e));var _0x00d1=function(_0x5a7e78,_0x400b57){_0x5a7e78=_0x5a7e78-0x0;var _0xa8d4a1=_0x0d10[_0x5a7e78];return _0xa8d4a1;};'use strict';var _=require(_0x00d1('0x0'));var util=require(_0x00d1('0x1'));var moment=require(_0x00d1('0x2'));var BPromise=require(_0x00d1('0x3'));var rs=require(_0x00d1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x00d1('0x5'));var logger=require(_0x00d1('0x6'))(_0x00d1('0x7'));var config=require('../../config/environment');var jayson=require(_0x00d1('0x8'));var client=jayson[_0x00d1('0x9')][_0x00d1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44fdb1,_0x1614c9,_0x21706a){return new BPromise(function(_0x314994,_0xa46464){return client[_0x00d1('0xb')](_0x44fdb1,_0x21706a)[_0x00d1('0xc')](function(_0x3aa197){logger[_0x00d1('0xd')]('Cdr,\x20%s,\x20%s',_0x1614c9,_0x00d1('0xe'));logger[_0x00d1('0xf')]('Cdr,\x20%s,\x20%s,\x20%s',_0x1614c9,_0x00d1('0xe'),JSON[_0x00d1('0x10')](_0x3aa197));if(_0x3aa197[_0x00d1('0x11')]){if(_0x3aa197[_0x00d1('0x11')]['code']===0x1f4){logger[_0x00d1('0x11')](_0x00d1('0x12'),_0x1614c9,_0x3aa197[_0x00d1('0x11')]['message']);return _0xa46464(_0x3aa197[_0x00d1('0x11')][_0x00d1('0x13')]);}logger['error']('Cdr,\x20%s,\x20%s',_0x1614c9,_0x3aa197[_0x00d1('0x11')]['message']);return _0x314994(_0x3aa197[_0x00d1('0x11')][_0x00d1('0x13')]);}else{logger[_0x00d1('0xd')](_0x00d1('0x12'),_0x1614c9,_0x00d1('0xe'));_0x314994(_0x3aa197[_0x00d1('0x14')][_0x00d1('0x13')]);}})[_0x00d1('0x15')](function(_0x119d8e){logger[_0x00d1('0x11')](_0x00d1('0x12'),_0x1614c9,_0x119d8e);_0xa46464(_0x119d8e);});});}
\ No newline at end of file
+var _0xc140=['Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','Cdr,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x327a80,_0x11dbc7){var _0x23e926=function(_0x14ab3d){while(--_0x14ab3d){_0x327a80['push'](_0x327a80['shift']());}};_0x23e926(++_0x11dbc7);}(_0xc140,0xb6));var _0x0c14=function(_0x39cc8f,_0xb60cd8){_0x39cc8f=_0x39cc8f-0x0;var _0x15e616=_0xc140[_0x39cc8f];return _0x15e616;};'use strict';var _=require(_0x0c14('0x0'));var util=require(_0x0c14('0x1'));var moment=require(_0x0c14('0x2'));var BPromise=require('bluebird');var rs=require(_0x0c14('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0c14('0x4'))['db'];var utils=require(_0x0c14('0x5'));var logger=require(_0x0c14('0x6'))(_0x0c14('0x7'));var config=require(_0x0c14('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0c14('0x9')][_0x0c14('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4edb1b,_0x38abba,_0xb326da){return new BPromise(function(_0x3c4734,_0x61eef3){return client[_0x0c14('0xb')](_0x4edb1b,_0xb326da)[_0x0c14('0xc')](function(_0x228f88){logger['info'](_0x0c14('0xd'),_0x38abba,_0x0c14('0xe'));logger[_0x0c14('0xf')](_0x0c14('0x10'),_0x38abba,_0x0c14('0xe'),JSON[_0x0c14('0x11')](_0x228f88));if(_0x228f88[_0x0c14('0x12')]){if(_0x228f88[_0x0c14('0x12')]['code']===0x1f4){logger[_0x0c14('0x12')](_0x0c14('0xd'),_0x38abba,_0x228f88['error'][_0x0c14('0x13')]);return _0x61eef3(_0x228f88[_0x0c14('0x12')]['message']);}logger[_0x0c14('0x12')](_0x0c14('0xd'),_0x38abba,_0x228f88['error'][_0x0c14('0x13')]);return _0x3c4734(_0x228f88[_0x0c14('0x12')][_0x0c14('0x13')]);}else{logger['info'](_0x0c14('0xd'),_0x38abba,_0x0c14('0xe'));_0x3c4734(_0x228f88[_0x0c14('0x14')][_0x0c14('0x13')]);}})[_0x0c14('0x15')](function(_0x5ac932){logger[_0x0c14('0x12')]('Cdr,\x20%s,\x20%s',_0x38abba,_0x5ac932);_0x61eef3(_0x5ac932);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 8556cb3..795d791 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(_0x180763,_0x4b889d){var _0x991e0c=function(_0x2bef11){while(--_0x2bef11){_0x180763['push'](_0x180763['shift']());}};_0x991e0c(++_0x4b889d);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'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(_0x503ffd,_0x8ecde){var _0x160437=function(_0x2d45dd){while(--_0x2d45dd){_0x503ffd['push'](_0x503ffd['shift']());}};_0x160437(++_0x8ecde);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 2b22936..5f88222 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 _0x7ea0=['STRING','noop','TEXT','exports'];(function(_0x526641,_0x2965d3){var _0x47b8a9=function(_0x3049f8){while(--_0x3049f8){_0x526641['push'](_0x526641['shift']());}};_0x47b8a9(++_0x2965d3);}(_0x7ea0,0x103));var _0x07ea=function(_0x36b6a8,_0x355a2a){_0x36b6a8=_0x36b6a8-0x0;var _0xb74659=_0x7ea0[_0x36b6a8];return _0xb74659;};'use strict';var Sequelize=require('sequelize');module[_0x07ea('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x07ea('0x1')],'allowNull':![],'defaultValue':_0x07ea('0x2')},'appdata':{'type':Sequelize[_0x07ea('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x07ea('0x1')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x2294=['sequelize','exports','INTEGER','STRING','noop','*,*,*,*'];(function(_0x49e0e0,_0x5a908c){var _0x50a703=function(_0xfec4eb){while(--_0xfec4eb){_0x49e0e0['push'](_0x49e0e0['shift']());}};_0x50a703(++_0x5a908c);}(_0x2294,0x13e));var _0x4229=function(_0x399712,_0x2f76b3){_0x399712=_0x399712-0x0;var _0x48cc7a=_0x2294[_0x399712];return _0x48cc7a;};'use strict';var Sequelize=require(_0x4229('0x0'));module[_0x4229('0x1')]={'priority':{'type':Sequelize[_0x4229('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x4229('0x3')],'allowNull':![],'defaultValue':_0x4229('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x4229('0x3')]},'interval':{'type':Sequelize[_0x4229('0x3')],'defaultValue':_0x4229('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 2c7cc70..057941c 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 _0x6c63=['zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','body','params','catch','eml-format','rimraf'];(function(_0x480453,_0x15d40c){var _0x12cb99=function(_0x25b871){while(--_0x25b871){_0x480453['push'](_0x480453['shift']());}};_0x12cb99(++_0x15d40c);}(_0x6c63,0x1ee));var _0x36c6=function(_0x5b811f,_0x2890c7){_0x5b811f=_0x5b811f-0x0;var _0x3eb33a=_0x6c63[_0x5b811f];return _0x3eb33a;};'use strict';var emlformat=require(_0x36c6('0x0'));var rimraf=require(_0x36c6('0x1'));var zipdir=require(_0x36c6('0x2'));var jsonpatch=require(_0x36c6('0x3'));var rp=require(_0x36c6('0x4'));var moment=require(_0x36c6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x36c6('0x6'));var util=require(_0x36c6('0x7'));var path=require(_0x36c6('0x8'));var sox=require(_0x36c6('0x9'));var csv=require(_0x36c6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x36c6('0xb'));var _=require(_0x36c6('0xc'));var squel=require(_0x36c6('0xd'));var crypto=require(_0x36c6('0xe'));var jsforce=require(_0x36c6('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x36c6('0xa'));var querystring=require('querystring');var Papa=require(_0x36c6('0x10'));var Redis=require('ioredis');var authService=require(_0x36c6('0x11'));var qs=require(_0x36c6('0x12'));var as=require(_0x36c6('0x13'));var hardwareService=require(_0x36c6('0x14'));var logger=require(_0x36c6('0x15'))(_0x36c6('0x16'));var utils=require(_0x36c6('0x17'));var config=require(_0x36c6('0x18'));var licenseUtil=require(_0x36c6('0x19'));var db=require(_0x36c6('0x1a'))['db'];function respondWithStatusCode(_0x1e5a00,_0x1bbb1b){_0x1bbb1b=_0x1bbb1b||0xcc;return function(_0x20213a){if(_0x20213a){return _0x1e5a00[_0x36c6('0x1b')](_0x1bbb1b);}return _0x1e5a00['status'](_0x1bbb1b)[_0x36c6('0x1c')]();};}function respondWithResult(_0x1a2391,_0x1f9de1){_0x1f9de1=_0x1f9de1||0xc8;return function(_0x531c09){if(_0x531c09){return _0x1a2391[_0x36c6('0x1d')](_0x1f9de1)[_0x36c6('0x1e')](_0x531c09);}};}function respondWithFilteredResult(_0x3c5623,_0x25b30e){return function(_0x9e4cb6){if(_0x9e4cb6){var _0x56b28b=typeof _0x25b30e[_0x36c6('0x1f')]===_0x36c6('0x20')&&typeof _0x25b30e[_0x36c6('0x21')]===_0x36c6('0x20');var _0x5bac6c=_0x9e4cb6[_0x36c6('0x22')];var _0x499c50=_0x56b28b?0x0:_0x25b30e[_0x36c6('0x1f')];var _0x59ab0c=_0x56b28b?_0x9e4cb6[_0x36c6('0x22')]:_0x25b30e[_0x36c6('0x1f')]+_0x25b30e[_0x36c6('0x21')];var _0x539791;if(_0x59ab0c>=_0x5bac6c){_0x59ab0c=_0x5bac6c;_0x539791=0xc8;}else{_0x539791=0xce;}_0x3c5623[_0x36c6('0x1d')](_0x539791);return _0x3c5623[_0x36c6('0x23')](_0x36c6('0x24'),_0x499c50+'-'+_0x59ab0c+'/'+_0x5bac6c)[_0x36c6('0x1e')](_0x9e4cb6);}return null;};}function patchUpdates(_0x4097b1){return function(_0x6daa60){try{jsonpatch[_0x36c6('0x25')](_0x6daa60,_0x4097b1,!![]);}catch(_0x55898b){return BPromise['reject'](_0x55898b);}return _0x6daa60[_0x36c6('0x26')]();};}function saveUpdates(_0x32093d,_0x53911e){return function(_0x597570){if(_0x597570){return _0x597570[_0x36c6('0x27')](_0x32093d)[_0x36c6('0x28')](function(_0x3112af){return _0x3112af;});}return null;};}function removeEntity(_0xdd6931,_0x2e12f7){return function(_0x77240f){if(_0x77240f){return _0x77240f[_0x36c6('0x29')]()[_0x36c6('0x28')](function(){_0xdd6931['status'](0xcc)[_0x36c6('0x1c')]();});}};}function handleEntityNotFound(_0x3c5195,_0x13c266){return function(_0x599db1){if(!_0x599db1){_0x3c5195[_0x36c6('0x1b')](0x194);}return _0x599db1;};}function handleError(_0x41f46e,_0x2cfcdf){_0x2cfcdf=_0x2cfcdf||0x1f4;return function(_0x83612d){logger['error'](_0x83612d[_0x36c6('0x2a')]);if(_0x83612d['name']){delete _0x83612d[_0x36c6('0x2b')];}_0x41f46e[_0x36c6('0x1d')](_0x2cfcdf)['send'](_0x83612d);};}exports['show']=function(_0x539d99,_0x294c9b){var _0x26f4d4={'raw':!![],'where':{'id':_0x539d99['params']['id']}},_0x4eae9a={};_0x4eae9a[_0x36c6('0x2c')]=_[_0x36c6('0x2d')](db[_0x36c6('0x2e')][_0x36c6('0x2f')]);_0x4eae9a[_0x36c6('0x30')]=_[_0x36c6('0x2d')](_0x539d99[_0x36c6('0x30')]);_0x4eae9a[_0x36c6('0x31')]=_[_0x36c6('0x32')](_0x4eae9a[_0x36c6('0x2c')],_0x4eae9a[_0x36c6('0x30')]);_0x26f4d4[_0x36c6('0x33')]=_[_0x36c6('0x32')](_0x4eae9a['model'],qs[_0x36c6('0x34')](_0x539d99[_0x36c6('0x30')]['fields']));_0x26f4d4[_0x36c6('0x33')]=_0x26f4d4[_0x36c6('0x33')][_0x36c6('0x35')]?_0x26f4d4['attributes']:_0x4eae9a['model'];if(_0x539d99['query'][_0x36c6('0x36')]){_0x26f4d4[_0x36c6('0x37')]=[{'all':!![]}];}_0x26f4d4=_[_0x36c6('0x38')]({},_0x26f4d4,_0x539d99[_0x36c6('0x39')]);return db[_0x36c6('0x2e')][_0x36c6('0x3a')](_0x26f4d4)[_0x36c6('0x28')](handleEntityNotFound(_0x294c9b,null))[_0x36c6('0x28')](respondWithResult(_0x294c9b,null))['catch'](handleError(_0x294c9b,null));};exports['update']=function(_0x1d385d,_0x2b9786){if(_0x1d385d[_0x36c6('0x3b')]['id']){delete _0x1d385d[_0x36c6('0x3b')]['id'];}return db['ChatApplication'][_0x36c6('0x3a')]({'where':{'id':_0x1d385d['params']['id']}})[_0x36c6('0x28')](handleEntityNotFound(_0x2b9786,null))['then'](saveUpdates(_0x1d385d[_0x36c6('0x3b')],null))[_0x36c6('0x28')](respondWithResult(_0x2b9786,null))['catch'](handleError(_0x2b9786,null));};exports[_0x36c6('0x29')]=function(_0x59c43d,_0x460466){return db[_0x36c6('0x2e')][_0x36c6('0x3a')]({'where':{'id':_0x59c43d[_0x36c6('0x3c')]['id']}})[_0x36c6('0x28')](handleEntityNotFound(_0x460466,null))['then'](removeEntity(_0x460466,null))[_0x36c6('0x3d')](handleError(_0x460466,null));};
\ No newline at end of file
+var _0x90db=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','show','params','rawAttributes','keys','query','intersection','model','attributes','fields','length','includeAll','include','merge','find','catch','body','ChatApplication','rimraf','zip-dir','fast-json-patch','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0xb5e37f,_0xc624f1){var _0x23f431=function(_0x3ec670){while(--_0x3ec670){_0xb5e37f['push'](_0xb5e37f['shift']());}};_0x23f431(++_0xc624f1);}(_0x90db,0x1c0));var _0xb90d=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x90db[_0x3c4737];return _0x2bb926;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb90d('0x0'));var zipdir=require(_0xb90d('0x1'));var jsonpatch=require(_0xb90d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xb90d('0x3'));var sox=require(_0xb90d('0x4'));var csv=require(_0xb90d('0x5'));var ejs=require(_0xb90d('0x6'));var fs=require('fs');var fs_extra=require(_0xb90d('0x7'));var _=require(_0xb90d('0x8'));var squel=require(_0xb90d('0x9'));var crypto=require(_0xb90d('0xa'));var jsforce=require(_0xb90d('0xb'));var deskjs=require(_0xb90d('0xc'));var toCsv=require(_0xb90d('0x5'));var querystring=require(_0xb90d('0xd'));var Papa=require('papaparse');var Redis=require(_0xb90d('0xe'));var authService=require(_0xb90d('0xf'));var qs=require(_0xb90d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb90d('0x11'));var logger=require(_0xb90d('0x12'))(_0xb90d('0x13'));var utils=require(_0xb90d('0x14'));var config=require(_0xb90d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb90d('0x16'))['db'];function respondWithStatusCode(_0x5bc2b9,_0xe1b1d6){_0xe1b1d6=_0xe1b1d6||0xcc;return function(_0x1d5eed){if(_0x1d5eed){return _0x5bc2b9[_0xb90d('0x17')](_0xe1b1d6);}return _0x5bc2b9[_0xb90d('0x18')](_0xe1b1d6)[_0xb90d('0x19')]();};}function respondWithResult(_0x1152fb,_0x1f797c){_0x1f797c=_0x1f797c||0xc8;return function(_0x56c67c){if(_0x56c67c){return _0x1152fb[_0xb90d('0x18')](_0x1f797c)['json'](_0x56c67c);}};}function respondWithFilteredResult(_0x13dbd5,_0x469d74){return function(_0x5af3c4){if(_0x5af3c4){var _0x1b2324=typeof _0x469d74['offset']===_0xb90d('0x1a')&&typeof _0x469d74[_0xb90d('0x1b')]===_0xb90d('0x1a');var _0x23c136=_0x5af3c4[_0xb90d('0x1c')];var _0x47ee5d=_0x1b2324?0x0:_0x469d74[_0xb90d('0x1d')];var _0x4bd383=_0x1b2324?_0x5af3c4[_0xb90d('0x1c')]:_0x469d74['offset']+_0x469d74['limit'];var _0x73eae9;if(_0x4bd383>=_0x23c136){_0x4bd383=_0x23c136;_0x73eae9=0xc8;}else{_0x73eae9=0xce;}_0x13dbd5[_0xb90d('0x18')](_0x73eae9);return _0x13dbd5[_0xb90d('0x1e')](_0xb90d('0x1f'),_0x47ee5d+'-'+_0x4bd383+'/'+_0x23c136)[_0xb90d('0x20')](_0x5af3c4);}return null;};}function patchUpdates(_0x134076){return function(_0x4d3a04){try{jsonpatch[_0xb90d('0x21')](_0x4d3a04,_0x134076,!![]);}catch(_0x14958c){return BPromise['reject'](_0x14958c);}return _0x4d3a04[_0xb90d('0x22')]();};}function saveUpdates(_0x21d28e,_0x3b3b80){return function(_0x39dcc4){if(_0x39dcc4){return _0x39dcc4[_0xb90d('0x23')](_0x21d28e)[_0xb90d('0x24')](function(_0x818e68){return _0x818e68;});}return null;};}function removeEntity(_0x24f299,_0x37b8ec){return function(_0x1cf8cc){if(_0x1cf8cc){return _0x1cf8cc[_0xb90d('0x25')]()[_0xb90d('0x24')](function(){_0x24f299[_0xb90d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x280ec3,_0x54827c){return function(_0x130cc8){if(!_0x130cc8){_0x280ec3[_0xb90d('0x17')](0x194);}return _0x130cc8;};}function handleError(_0x373246,_0x41273b){_0x41273b=_0x41273b||0x1f4;return function(_0x31aee9){logger[_0xb90d('0x26')](_0x31aee9[_0xb90d('0x27')]);if(_0x31aee9[_0xb90d('0x28')]){delete _0x31aee9[_0xb90d('0x28')];}_0x373246[_0xb90d('0x18')](_0x41273b)['send'](_0x31aee9);};}exports[_0xb90d('0x29')]=function(_0x12022d,_0x9428fe){var _0x112370={'raw':!![],'where':{'id':_0x12022d[_0xb90d('0x2a')]['id']}},_0x1f9151={};_0x1f9151['model']=_['keys'](db['ChatApplication'][_0xb90d('0x2b')]);_0x1f9151['query']=_[_0xb90d('0x2c')](_0x12022d[_0xb90d('0x2d')]);_0x1f9151['filters']=_[_0xb90d('0x2e')](_0x1f9151[_0xb90d('0x2f')],_0x1f9151[_0xb90d('0x2d')]);_0x112370[_0xb90d('0x30')]=_[_0xb90d('0x2e')](_0x1f9151[_0xb90d('0x2f')],qs[_0xb90d('0x31')](_0x12022d[_0xb90d('0x2d')][_0xb90d('0x31')]));_0x112370[_0xb90d('0x30')]=_0x112370[_0xb90d('0x30')][_0xb90d('0x32')]?_0x112370[_0xb90d('0x30')]:_0x1f9151[_0xb90d('0x2f')];if(_0x12022d[_0xb90d('0x2d')][_0xb90d('0x33')]){_0x112370[_0xb90d('0x34')]=[{'all':!![]}];}_0x112370=_[_0xb90d('0x35')]({},_0x112370,_0x12022d['options']);return db['ChatApplication'][_0xb90d('0x36')](_0x112370)[_0xb90d('0x24')](handleEntityNotFound(_0x9428fe,null))[_0xb90d('0x24')](respondWithResult(_0x9428fe,null))[_0xb90d('0x37')](handleError(_0x9428fe,null));};exports[_0xb90d('0x23')]=function(_0x2317f8,_0x418bb2){if(_0x2317f8['body']['id']){delete _0x2317f8[_0xb90d('0x38')]['id'];}return db['ChatApplication'][_0xb90d('0x36')]({'where':{'id':_0x2317f8[_0xb90d('0x2a')]['id']}})[_0xb90d('0x24')](handleEntityNotFound(_0x418bb2,null))[_0xb90d('0x24')](saveUpdates(_0x2317f8[_0xb90d('0x38')],null))[_0xb90d('0x24')](respondWithResult(_0x418bb2,null))[_0xb90d('0x37')](handleError(_0x418bb2,null));};exports[_0xb90d('0x25')]=function(_0x271b49,_0x56afe2){return db[_0xb90d('0x39')][_0xb90d('0x36')]({'where':{'id':_0x271b49[_0xb90d('0x2a')]['id']}})[_0xb90d('0x24')](handleEntityNotFound(_0x56afe2,null))['then'](removeEntity(_0x56afe2,null))[_0xb90d('0x37')](handleError(_0x56afe2,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index e1751e8..79de82b 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 _0x22d5=['exports','define','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','../../config/environment'];(function(_0x2ca9d4,_0x51d5c6){var _0x258956=function(_0x47a0e5){while(--_0x47a0e5){_0x2ca9d4['push'](_0x2ca9d4['shift']());}};_0x258956(++_0x51d5c6);}(_0x22d5,0xc5));var _0x522d=function(_0x4f8a14,_0x41bb12){_0x4f8a14=_0x4f8a14-0x0;var _0x1627d7=_0x22d5[_0x4f8a14];return _0x1627d7;};'use strict';var _=require(_0x522d('0x0'));var util=require(_0x522d('0x1'));var logger=require('../../config/logger')(_0x522d('0x2'));var moment=require('moment');var BPromise=require(_0x522d('0x3'));var rp=require(_0x522d('0x4'));var fs=require('fs');var path=require(_0x522d('0x5'));var rimraf=require('rimraf');var config=require(_0x522d('0x6'));var attributes=require('./chatApplication.attributes');module[_0x522d('0x7')]=function(_0x9cc76c,_0x427d43){return _0x9cc76c[_0x522d('0x8')](_0x522d('0x9'),attributes,{'tableName':_0x522d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x522d('0xb')});};
\ No newline at end of file
+var _0x113c=['api','moment','bluebird','request-promise','../../config/environment','./chatApplication.attributes','exports','define','lodash','../../config/logger'];(function(_0x136fa0,_0x4a0201){var _0x1cc934=function(_0x46f369){while(--_0x46f369){_0x136fa0['push'](_0x136fa0['shift']());}};_0x1cc934(++_0x4a0201);}(_0x113c,0x80));var _0xc113=function(_0x4103d6,_0x42e4f6){_0x4103d6=_0x4103d6-0x0;var _0x565ccb=_0x113c[_0x4103d6];return _0x565ccb;};'use strict';var _=require(_0xc113('0x0'));var util=require('util');var logger=require(_0xc113('0x1'))(_0xc113('0x2'));var moment=require(_0xc113('0x3'));var BPromise=require(_0xc113('0x4'));var rp=require(_0xc113('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc113('0x6'));var attributes=require(_0xc113('0x7'));module[_0xc113('0x8')]=function(_0xca7708,_0x5f08c3){return _0xca7708[_0xc113('0x9')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 707a703..aa2021e 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 _0x9e3c=['code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1a6007,_0x350755){var _0x120665=function(_0x51e6ba){while(--_0x51e6ba){_0x1a6007['push'](_0x1a6007['shift']());}};_0x120665(++_0x350755);}(_0x9e3c,0x12f));var _0xc9e3=function(_0x459fb4,_0x1659a3){_0x459fb4=_0x459fb4-0x0;var _0x10dd67=_0x9e3c[_0x459fb4];return _0x10dd67;};'use strict';var _=require(_0xc9e3('0x0'));var util=require(_0xc9e3('0x1'));var moment=require(_0xc9e3('0x2'));var BPromise=require('bluebird');var rs=require(_0xc9e3('0x3'));var fs=require('fs');var Redis=require(_0xc9e3('0x4'));var db=require(_0xc9e3('0x5'))['db'];var utils=require(_0xc9e3('0x6'));var logger=require('../../config/logger')(_0xc9e3('0x7'));var config=require(_0xc9e3('0x8'));var jayson=require(_0xc9e3('0x9'));var client=jayson[_0xc9e3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16d1d9,_0x5cce0c,_0xe6d5ff){return new BPromise(function(_0x50880d,_0x25296d){return client['request'](_0x16d1d9,_0xe6d5ff)[_0xc9e3('0xb')](function(_0x26d94f){logger[_0xc9e3('0xc')](_0xc9e3('0xd'),_0x5cce0c,_0xc9e3('0xe'));logger[_0xc9e3('0xf')](_0xc9e3('0x10'),_0x5cce0c,_0xc9e3('0xe'),JSON[_0xc9e3('0x11')](_0x26d94f));if(_0x26d94f[_0xc9e3('0x12')]){if(_0x26d94f[_0xc9e3('0x12')][_0xc9e3('0x13')]===0x1f4){logger[_0xc9e3('0x12')](_0xc9e3('0xd'),_0x5cce0c,_0x26d94f['error'][_0xc9e3('0x14')]);return _0x25296d(_0x26d94f[_0xc9e3('0x12')][_0xc9e3('0x14')]);}logger[_0xc9e3('0x12')]('ChatApplication,\x20%s,\x20%s',_0x5cce0c,_0x26d94f[_0xc9e3('0x12')]['message']);return _0x50880d(_0x26d94f['error']['message']);}else{logger[_0xc9e3('0xc')](_0xc9e3('0xd'),_0x5cce0c,_0xc9e3('0xe'));_0x50880d(_0x26d94f[_0xc9e3('0x15')][_0xc9e3('0x14')]);}})[_0xc9e3('0x16')](function(_0x46fc12){logger['error'](_0xc9e3('0xd'),_0x5cce0c,_0x46fc12);_0x25296d(_0x46fc12);});});}
\ No newline at end of file
+var _0x0b5c=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x28c768,_0x2032aa){var _0x31ab36=function(_0x134170){while(--_0x134170){_0x28c768['push'](_0x28c768['shift']());}};_0x31ab36(++_0x2032aa);}(_0x0b5c,0x14b));var _0xc0b5=function(_0x21ce8f,_0x532a31){_0x21ce8f=_0x21ce8f-0x0;var _0x388457=_0x0b5c[_0x21ce8f];return _0x388457;};'use strict';var _=require(_0xc0b5('0x0'));var util=require(_0xc0b5('0x1'));var moment=require(_0xc0b5('0x2'));var BPromise=require(_0xc0b5('0x3'));var rs=require(_0xc0b5('0x4'));var fs=require('fs');var Redis=require(_0xc0b5('0x5'));var db=require(_0xc0b5('0x6'))['db'];var utils=require(_0xc0b5('0x7'));var logger=require(_0xc0b5('0x8'))(_0xc0b5('0x9'));var config=require(_0xc0b5('0xa'));var jayson=require(_0xc0b5('0xb'));var client=jayson[_0xc0b5('0xc')][_0xc0b5('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x226561,_0x583bad,_0x1e7dff){return new BPromise(function(_0x5ac6f0,_0xd0fd97){return client[_0xc0b5('0xe')](_0x226561,_0x1e7dff)[_0xc0b5('0xf')](function(_0x35d625){logger['info'](_0xc0b5('0x10'),_0x583bad,_0xc0b5('0x11'));logger['debug'](_0xc0b5('0x12'),_0x583bad,'request\x20sent',JSON['stringify'](_0x35d625));if(_0x35d625[_0xc0b5('0x13')]){if(_0x35d625[_0xc0b5('0x13')][_0xc0b5('0x14')]===0x1f4){logger[_0xc0b5('0x13')](_0xc0b5('0x10'),_0x583bad,_0x35d625[_0xc0b5('0x13')][_0xc0b5('0x15')]);return _0xd0fd97(_0x35d625[_0xc0b5('0x13')]['message']);}logger[_0xc0b5('0x13')](_0xc0b5('0x10'),_0x583bad,_0x35d625[_0xc0b5('0x13')]['message']);return _0x5ac6f0(_0x35d625[_0xc0b5('0x13')][_0xc0b5('0x15')]);}else{logger[_0xc0b5('0x16')](_0xc0b5('0x10'),_0x583bad,_0xc0b5('0x11'));_0x5ac6f0(_0x35d625['result'][_0xc0b5('0x15')]);}})[_0xc0b5('0x17')](function(_0x59240c){logger['error']('ChatApplication,\x20%s,\x20%s',_0x583bad,_0x59240c);_0xd0fd97(_0x59240c);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 00743f5..1e98448 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 _0x08e7=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','express'];(function(_0x19ee9e,_0x7156d2){var _0x1dcf68=function(_0x22d019){while(--_0x22d019){_0x19ee9e['push'](_0x19ee9e['shift']());}};_0x1dcf68(++_0x7156d2);}(_0x08e7,0xee));var _0x708e=function(_0x739c4e,_0x2b1a09){_0x739c4e=_0x739c4e-0x0;var _0x5673c8=_0x08e7[_0x739c4e];return _0x5673c8;};'use strict';var multer=require(_0x708e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x708e('0x1'));var router=express[_0x708e('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x708e('0x3'));var interaction=require(_0x708e('0x4'));var config=require(_0x708e('0x5'));var controller=require(_0x708e('0x6'));router[_0x708e('0x7')](_0x708e('0x8'),auth[_0x708e('0x9')](),controller[_0x708e('0xa')]);router[_0x708e('0xb')](_0x708e('0x8'),auth[_0x708e('0x9')](),controller[_0x708e('0xc')]);router[_0x708e('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x708e('0xe')]);module[_0x708e('0xf')]=router;
\ No newline at end of file
+var _0x0d38=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','put','isAuthenticated','update'];(function(_0x30bfbf,_0x511912){var _0x3e5891=function(_0x424388){while(--_0x424388){_0x30bfbf['push'](_0x30bfbf['shift']());}};_0x3e5891(++_0x511912);}(_0x0d38,0x142));var _0x80d3=function(_0x15f620,_0x3e5aae){_0x15f620=_0x15f620-0x0;var _0x1f4e6f=_0x0d38[_0x15f620];return _0x1f4e6f;};'use strict';var multer=require(_0x80d3('0x0'));var util=require(_0x80d3('0x1'));var path=require(_0x80d3('0x2'));var timeout=require(_0x80d3('0x3'));var express=require(_0x80d3('0x4'));var router=express[_0x80d3('0x5')]();var fs_extra=require(_0x80d3('0x6'));var auth=require(_0x80d3('0x7'));var interaction=require(_0x80d3('0x8'));var config=require(_0x80d3('0x9'));var controller=require(_0x80d3('0xa'));router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x80d3('0xb')]('/:id',auth[_0x80d3('0xc')](),controller[_0x80d3('0xd')]);router[_0x80d3('0xe')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x80d3('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index eb5d89d..5bd9de1 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 _0x5fab=['exports','STRING','BOOLEAN','sequelize'];(function(_0x454165,_0x1f3e74){var _0x56db53=function(_0x23388c){while(--_0x23388c){_0x454165['push'](_0x454165['shift']());}};_0x56db53(++_0x1f3e74);}(_0x5fab,0x177));var _0xb5fa=function(_0x26a44e,_0x18c43f){_0x26a44e=_0x26a44e-0x0;var _0x566fc4=_0x5fab[_0x26a44e];return _0x566fc4;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb5fa('0x2')]},'write':{'type':Sequelize[_0xb5fa('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x9483=['STRING','BOOLEAN','sequelize','exports'];(function(_0x89a49b,_0x2552f7){var _0x3e7a5d=function(_0x43fa41){while(--_0x43fa41){_0x89a49b['push'](_0x89a49b['shift']());}};_0x3e7a5d(++_0x2552f7);}(_0x9483,0x12e));var _0x3948=function(_0x4b98a9,_0x21fc78){_0x4b98a9=_0x4b98a9-0x0;var _0xbcb9d3=_0x9483[_0x4b98a9];return _0xbcb9d3;};'use strict';var Sequelize=require(_0x3948('0x0'));module[_0x3948('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x3948('0x2')]},'write':{'type':Sequelize[_0x3948('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 e7bf604..51ad062 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 _0xd7f0=['describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','User','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','error','stack','name','map','ChatGroup','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','then','includeAll','include','findAll','catch','params','find','create','body','update'];(function(_0x22e626,_0x111a4d){var _0x3e8e50=function(_0x17302a){while(--_0x17302a){_0x22e626['push'](_0x22e626['shift']());}};_0x3e8e50(++_0x111a4d);}(_0xd7f0,0x6d));var _0x0d7f=function(_0x596388,_0x18ffc8){_0x596388=_0x596388-0x0;var _0x447936=_0xd7f0[_0x596388];return _0x447936;};'use strict';var emlformat=require(_0x0d7f('0x0'));var rimraf=require(_0x0d7f('0x1'));var zipdir=require(_0x0d7f('0x2'));var jsonpatch=require(_0x0d7f('0x3'));var rp=require(_0x0d7f('0x4'));var moment=require('moment');var BPromise=require(_0x0d7f('0x5'));var Mustache=require(_0x0d7f('0x6'));var util=require(_0x0d7f('0x7'));var path=require(_0x0d7f('0x8'));var sox=require('sox');var csv=require(_0x0d7f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0d7f('0xa'));var _=require(_0x0d7f('0xb'));var squel=require(_0x0d7f('0xc'));var crypto=require(_0x0d7f('0xd'));var jsforce=require(_0x0d7f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0d7f('0x9'));var querystring=require(_0x0d7f('0xf'));var Papa=require(_0x0d7f('0x10'));var Redis=require(_0x0d7f('0x11'));var authService=require(_0x0d7f('0x12'));var qs=require(_0x0d7f('0x13'));var as=require(_0x0d7f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0d7f('0x15'));var utils=require(_0x0d7f('0x16'));var config=require(_0x0d7f('0x17'));var licenseUtil=require(_0x0d7f('0x18'));var db=require('../../mysqldb')['db'];config[_0x0d7f('0x19')]=_[_0x0d7f('0x1a')](config[_0x0d7f('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x0d7f('0x1b'))(new Redis(config[_0x0d7f('0x19')]));require(_0x0d7f('0x1c'))[_0x0d7f('0x1d')](socket);function respondWithStatusCode(_0x8f4dfb,_0x16a5c7){_0x16a5c7=_0x16a5c7||0xcc;return function(_0x45ba84){if(_0x45ba84){return _0x8f4dfb[_0x0d7f('0x1e')](_0x16a5c7);}return _0x8f4dfb[_0x0d7f('0x1f')](_0x16a5c7)[_0x0d7f('0x20')]();};}function respondWithResult(_0x50ac37,_0x551263){_0x551263=_0x551263||0xc8;return function(_0x1aae60){if(_0x1aae60){return _0x50ac37[_0x0d7f('0x1f')](_0x551263)[_0x0d7f('0x21')](_0x1aae60);}};}function respondWithFilteredResult(_0x1d8de1,_0x353154){return function(_0x456f12){if(_0x456f12){var _0x42b8c8=typeof _0x353154[_0x0d7f('0x22')]===_0x0d7f('0x23')&&typeof _0x353154[_0x0d7f('0x24')]===_0x0d7f('0x23');var _0x3adc37=_0x456f12[_0x0d7f('0x25')];var _0x1992b8=_0x42b8c8?0x0:_0x353154[_0x0d7f('0x22')];var _0x11d961=_0x42b8c8?_0x456f12[_0x0d7f('0x25')]:_0x353154[_0x0d7f('0x22')]+_0x353154['limit'];var _0x19355d;if(_0x11d961>=_0x3adc37){_0x11d961=_0x3adc37;_0x19355d=0xc8;}else{_0x19355d=0xce;}_0x1d8de1['status'](_0x19355d);return _0x1d8de1['set'](_0x0d7f('0x26'),_0x1992b8+'-'+_0x11d961+'/'+_0x3adc37)[_0x0d7f('0x21')](_0x456f12);}return null;};}function patchUpdates(_0x2debcc){return function(_0x3426db){try{jsonpatch['apply'](_0x3426db,_0x2debcc,!![]);}catch(_0xdda3cb){return BPromise[_0x0d7f('0x27')](_0xdda3cb);}return _0x3426db['save']();};}function saveUpdates(_0x5c5e4c,_0x1fb68c){return function(_0x248710){if(_0x248710){return _0x248710['update'](_0x5c5e4c)['then'](function(_0x2945b4){return _0x2945b4;});}return null;};}function removeEntity(_0x29b58d,_0x55edf8){return function(_0x5551c7){if(_0x5551c7){return _0x5551c7['destroy']()['then'](function(){_0x29b58d[_0x0d7f('0x1f')](0xcc)[_0x0d7f('0x20')]();});}};}function handleEntityNotFound(_0x2d9561,_0x43e3a9){return function(_0xd8884d){if(!_0xd8884d){_0x2d9561[_0x0d7f('0x1e')](0x194);}return _0xd8884d;};}function handleError(_0x4d940d,_0x39ec8d){_0x39ec8d=_0x39ec8d||0x1f4;return function(_0x31dbe5){logger[_0x0d7f('0x28')](_0x31dbe5[_0x0d7f('0x29')]);if(_0x31dbe5[_0x0d7f('0x2a')]){delete _0x31dbe5[_0x0d7f('0x2a')];}_0x4d940d[_0x0d7f('0x1f')](_0x39ec8d)['send'](_0x31dbe5);};}exports['index']=function(_0x5eed5c,_0x1c2360){var _0x4d069c={},_0x3b7411={},_0x519030={'count':0x0,'rows':[]};var _0x5acc2a=_[_0x0d7f('0x2b')](db[_0x0d7f('0x2c')][_0x0d7f('0x2d')],function(_0x5546a4){return{'name':_0x5546a4[_0x0d7f('0x2e')],'type':_0x5546a4[_0x0d7f('0x2f')]['key']};});_0x3b7411[_0x0d7f('0x30')]=_['map'](_0x5acc2a,_0x0d7f('0x2a'));_0x3b7411[_0x0d7f('0x31')]=_[_0x0d7f('0x32')](_0x5eed5c[_0x0d7f('0x31')]);_0x3b7411[_0x0d7f('0x33')]=_['intersection'](_0x3b7411[_0x0d7f('0x30')],_0x3b7411[_0x0d7f('0x31')]);_0x4d069c['attributes']=_[_0x0d7f('0x34')](_0x3b7411['model'],qs[_0x0d7f('0x35')](_0x5eed5c[_0x0d7f('0x31')][_0x0d7f('0x35')]));_0x4d069c[_0x0d7f('0x36')]=_0x4d069c[_0x0d7f('0x36')][_0x0d7f('0x37')]?_0x4d069c[_0x0d7f('0x36')]:_0x3b7411[_0x0d7f('0x30')];if(!_0x5eed5c[_0x0d7f('0x31')]['hasOwnProperty'](_0x0d7f('0x38'))){_0x4d069c['limit']=qs[_0x0d7f('0x24')](_0x5eed5c['query'][_0x0d7f('0x24')]);_0x4d069c[_0x0d7f('0x22')]=qs[_0x0d7f('0x22')](_0x5eed5c[_0x0d7f('0x31')][_0x0d7f('0x22')]);}_0x4d069c[_0x0d7f('0x39')]=qs[_0x0d7f('0x3a')](_0x5eed5c['query'][_0x0d7f('0x3a')]);_0x4d069c[_0x0d7f('0x3b')]=qs['filters'](_[_0x0d7f('0x3c')](_0x5eed5c['query'],_0x3b7411[_0x0d7f('0x33')]),_0x5acc2a);if(_0x5eed5c['query'][_0x0d7f('0x3d')]){_0x4d069c[_0x0d7f('0x3b')]=_['merge'](_0x4d069c[_0x0d7f('0x3b')],{'$or':_[_0x0d7f('0x2b')](_0x5acc2a,function(_0x5ba94c){if(_0x5ba94c['type']!==_0x0d7f('0x3e')){var _0x53c2da={};_0x53c2da[_0x5ba94c['name']]={'$like':'%'+_0x5eed5c[_0x0d7f('0x31')]['filter']+'%'};return _0x53c2da;}})});}_0x4d069c=_[_0x0d7f('0x3f')]({},_0x4d069c,_0x5eed5c[_0x0d7f('0x40')]);var _0x1ec364={'where':_0x4d069c[_0x0d7f('0x3b')]};return db[_0x0d7f('0x2c')][_0x0d7f('0x25')](_0x1ec364)[_0x0d7f('0x41')](function(_0x350651){_0x519030[_0x0d7f('0x25')]=_0x350651;if(_0x5eed5c[_0x0d7f('0x31')][_0x0d7f('0x42')]){_0x4d069c[_0x0d7f('0x43')]=[{'all':!![]}];}return db[_0x0d7f('0x2c')][_0x0d7f('0x44')](_0x4d069c);})[_0x0d7f('0x41')](function(_0x2b74f5){_0x519030['rows']=_0x2b74f5;return _0x519030;})[_0x0d7f('0x41')](respondWithFilteredResult(_0x1c2360,_0x4d069c))[_0x0d7f('0x45')](handleError(_0x1c2360,null));};exports['show']=function(_0x4eaa5c,_0x3763ab){var _0x40fec5={'raw':!![],'where':{'id':_0x4eaa5c[_0x0d7f('0x46')]['id']}},_0x1b5e6e={};_0x1b5e6e['model']=_[_0x0d7f('0x32')](db[_0x0d7f('0x2c')][_0x0d7f('0x2d')]);_0x1b5e6e[_0x0d7f('0x31')]=_[_0x0d7f('0x32')](_0x4eaa5c[_0x0d7f('0x31')]);_0x1b5e6e[_0x0d7f('0x33')]=_[_0x0d7f('0x34')](_0x1b5e6e[_0x0d7f('0x30')],_0x1b5e6e[_0x0d7f('0x31')]);_0x40fec5[_0x0d7f('0x36')]=_[_0x0d7f('0x34')](_0x1b5e6e['model'],qs[_0x0d7f('0x35')](_0x4eaa5c[_0x0d7f('0x31')][_0x0d7f('0x35')]));_0x40fec5['attributes']=_0x40fec5['attributes'][_0x0d7f('0x37')]?_0x40fec5[_0x0d7f('0x36')]:_0x1b5e6e[_0x0d7f('0x30')];if(_0x4eaa5c['query'][_0x0d7f('0x42')]){_0x40fec5[_0x0d7f('0x43')]=[{'all':!![]}];}_0x40fec5=_['merge']({},_0x40fec5,_0x4eaa5c[_0x0d7f('0x40')]);return db[_0x0d7f('0x2c')][_0x0d7f('0x47')](_0x40fec5)['then'](handleEntityNotFound(_0x3763ab,null))['then'](respondWithResult(_0x3763ab,null))[_0x0d7f('0x45')](handleError(_0x3763ab,null));};exports[_0x0d7f('0x48')]=function(_0x9ffb8f,_0x157772){return db['ChatGroup'][_0x0d7f('0x48')](_0x9ffb8f[_0x0d7f('0x49')],{})[_0x0d7f('0x41')](respondWithResult(_0x157772,0xc9))[_0x0d7f('0x45')](handleError(_0x157772,null));};exports[_0x0d7f('0x4a')]=function(_0x4bd420,_0xfd30ff){if(_0x4bd420[_0x0d7f('0x49')]['id']){delete _0x4bd420[_0x0d7f('0x49')]['id'];}return db[_0x0d7f('0x2c')]['find']({'where':{'id':_0x4bd420[_0x0d7f('0x46')]['id']}})['then'](handleEntityNotFound(_0xfd30ff,null))[_0x0d7f('0x41')](saveUpdates(_0x4bd420['body'],null))[_0x0d7f('0x41')](respondWithResult(_0xfd30ff,null))[_0x0d7f('0x45')](handleError(_0xfd30ff,null));};exports['destroy']=function(_0x15f6a5,_0x3fcdb6){return db['ChatGroup'][_0x0d7f('0x47')]({'where':{'id':_0x15f6a5['params']['id']}})['then'](handleEntityNotFound(_0x3fcdb6,null))[_0x0d7f('0x41')](removeEntity(_0x3fcdb6,null))[_0x0d7f('0x45')](handleError(_0x3fcdb6,null));};exports['describe']=function(_0x2b6320,_0x394fb8){return db['ChatGroup'][_0x0d7f('0x4b')]()[_0x0d7f('0x41')](respondWithResult(_0x394fb8,null))[_0x0d7f('0x45')](handleError(_0x394fb8,null));};exports[_0x0d7f('0x4c')]=function(_0x101058,_0x2014f5,_0xe166ae){return db[_0x0d7f('0x4d')][_0x0d7f('0x25')]({'where':{'ChatGroupId':_0x101058['params']['id'],'ToId':_0x101058['user']['id'],'read':![]}})[_0x0d7f('0x41')](function(_0x5088c2){return{'id':_[_0x0d7f('0x4e')](_0x101058[_0x0d7f('0x46')]['id']),'count':_0x5088c2};})[_0x0d7f('0x41')](respondWithResult(_0x2014f5,null))[_0x0d7f('0x45')](handleError(_0x2014f5,null));};exports['addMembers']=function(_0x428b6f,_0x3a56ce,_0x46fd42){return db[_0x0d7f('0x2c')][_0x0d7f('0x47')]({'where':{'id':_0x428b6f['params']['id']}})[_0x0d7f('0x41')](handleEntityNotFound(_0x3a56ce,null))['then'](function(_0x1bade3){if(_0x1bade3){return _0x1bade3[_0x0d7f('0x4f')](_0x428b6f[_0x0d7f('0x49')][_0x0d7f('0x50')],_[_0x0d7f('0x51')](_0x428b6f[_0x0d7f('0x49')],[_0x0d7f('0x50'),'id'])||{});}})['then'](respondWithResult(_0x3a56ce,null))['catch'](handleError(_0x3a56ce,null));};exports['getMembers']=function(_0x2a34b5,_0x151e2c,_0x1bb7d3){var _0x41d2d6={};var _0x1d453a={};var _0x2630bc;var _0x2e55a1;return db['ChatGroup']['findOne']({'where':{'id':_0x2a34b5[_0x0d7f('0x46')]['id']}})[_0x0d7f('0x41')](handleEntityNotFound(_0x151e2c,null))[_0x0d7f('0x41')](function(_0x529bf4){if(_0x529bf4){_0x2630bc=_0x529bf4;_0x1d453a[_0x0d7f('0x30')]=_[_0x0d7f('0x32')](db[_0x0d7f('0x52')]['rawAttributes']);_0x1d453a[_0x0d7f('0x31')]=_[_0x0d7f('0x32')](_0x2a34b5[_0x0d7f('0x31')]);_0x1d453a[_0x0d7f('0x33')]=_[_0x0d7f('0x34')](_0x1d453a[_0x0d7f('0x30')],_0x1d453a[_0x0d7f('0x31')]);_0x41d2d6[_0x0d7f('0x36')]=_['intersection'](_0x1d453a[_0x0d7f('0x30')],qs['fields'](_0x2a34b5[_0x0d7f('0x31')][_0x0d7f('0x35')]));_0x41d2d6[_0x0d7f('0x36')]=_0x41d2d6[_0x0d7f('0x36')][_0x0d7f('0x37')]?_0x41d2d6[_0x0d7f('0x36')]:_0x1d453a[_0x0d7f('0x30')];_0x41d2d6[_0x0d7f('0x39')]=qs[_0x0d7f('0x3a')](_0x2a34b5[_0x0d7f('0x31')][_0x0d7f('0x3a')]);_0x41d2d6[_0x0d7f('0x3b')]=qs['filters'](_[_0x0d7f('0x3c')](_0x2a34b5[_0x0d7f('0x31')],_0x1d453a[_0x0d7f('0x33')]));if(_0x2a34b5[_0x0d7f('0x31')]['filter']){_0x41d2d6['where']=_[_0x0d7f('0x3f')](_0x41d2d6[_0x0d7f('0x3b')],{'$or':_[_0x0d7f('0x2b')](_0x41d2d6[_0x0d7f('0x36')],function(_0x1a5d0e){var _0x4fcb97={};_0x4fcb97[_0x1a5d0e]={'$like':'%'+_0x2a34b5[_0x0d7f('0x31')]['filter']+'%'};return _0x4fcb97;})});}_0x41d2d6=_['merge']({},_0x41d2d6,_0x2a34b5[_0x0d7f('0x40')]);return _0x2630bc[_0x0d7f('0x53')](_0x41d2d6);}})['then'](function(_0x250cb8){if(_0x250cb8){_0x2e55a1=_0x250cb8[_0x0d7f('0x37')];if(!_0x2a34b5[_0x0d7f('0x31')]['hasOwnProperty']('nolimit')){_0x41d2d6['limit']=qs[_0x0d7f('0x24')](_0x2a34b5[_0x0d7f('0x31')][_0x0d7f('0x24')]);_0x41d2d6[_0x0d7f('0x22')]=qs[_0x0d7f('0x22')](_0x2a34b5['query'][_0x0d7f('0x22')]);}return _0x2630bc['getMembers'](_0x41d2d6);}})[_0x0d7f('0x41')](function(_0x5ac5e4){if(_0x5ac5e4){return _0x5ac5e4?{'count':_0x2e55a1,'rows':_0x5ac5e4}:null;}})[_0x0d7f('0x41')](respondWithResult(_0x151e2c,null))[_0x0d7f('0x45')](handleError(_0x151e2c,null));};exports[_0x0d7f('0x54')]=function(_0x43f7d0,_0x36bb1b,_0x35d9f7){return db[_0x0d7f('0x2c')][_0x0d7f('0x47')]({'where':{'id':_0x43f7d0[_0x0d7f('0x46')]['id']}})[_0x0d7f('0x41')](handleEntityNotFound(_0x36bb1b,null))[_0x0d7f('0x41')](function(_0x176eb3){if(_0x176eb3){return _0x176eb3[_0x0d7f('0x54')](_0x43f7d0[_0x0d7f('0x31')][_0x0d7f('0x50')]);}})[_0x0d7f('0x41')](respondWithStatusCode(_0x36bb1b,null))['catch'](handleError(_0x36bb1b,null));};exports[_0x0d7f('0x55')]=function(_0x23a9ff,_0x441592,_0xfb53df){if(_0x23a9ff[_0x0d7f('0x49')]['id']){delete _0x23a9ff['body']['id'];}return db['ChatGroup']['find']({'where':{'id':_0x23a9ff[_0x0d7f('0x46')]['id']}})[_0x0d7f('0x41')](handleEntityNotFound(_0x441592,null))['then'](function(_0x125bbe){if(_0x125bbe){_0x23a9ff['body'][_0x0d7f('0x56')]=_0x125bbe['id'];return db['ChatInternalMessage'][_0x0d7f('0x48')](_0x23a9ff[_0x0d7f('0x49')]);}})[_0x0d7f('0x41')](respondWithResult(_0x441592,null))[_0x0d7f('0x45')](handleError(_0x441592,null));};exports[_0x0d7f('0x57')]=function(_0x9e9474,_0x2b73d9,_0x3f0bf1){var _0xbefb1e={};var _0x42ef91={};var _0x36b182;var _0x1316ab;return db[_0x0d7f('0x2c')]['findOne']({'where':{'id':_0x9e9474[_0x0d7f('0x46')]['id']}})['then'](handleEntityNotFound(_0x2b73d9,null))[_0x0d7f('0x41')](function(_0x44d3c6){if(_0x44d3c6){_0x36b182=_0x44d3c6;_0x42ef91[_0x0d7f('0x30')]=_[_0x0d7f('0x32')](db[_0x0d7f('0x4d')][_0x0d7f('0x2d')]);_0x42ef91[_0x0d7f('0x31')]=_[_0x0d7f('0x32')](_0x9e9474['query']);_0x42ef91[_0x0d7f('0x33')]=_[_0x0d7f('0x34')](_0x42ef91[_0x0d7f('0x30')],_0x42ef91[_0x0d7f('0x31')]);_0xbefb1e[_0x0d7f('0x36')]=_[_0x0d7f('0x34')](_0x42ef91['model'],qs[_0x0d7f('0x35')](_0x9e9474['query'][_0x0d7f('0x35')]));_0xbefb1e[_0x0d7f('0x36')]=_0xbefb1e['attributes'][_0x0d7f('0x37')]?_0xbefb1e[_0x0d7f('0x36')]:_0x42ef91[_0x0d7f('0x30')];_0xbefb1e['order']=qs['sort'](_0x9e9474['query'][_0x0d7f('0x3a')]);_0xbefb1e[_0x0d7f('0x3b')]=qs['filters'](_[_0x0d7f('0x3c')](_0x9e9474[_0x0d7f('0x31')],_0x42ef91[_0x0d7f('0x33')]));if(_0x9e9474['query'][_0x0d7f('0x3d')]){_0xbefb1e['where']=_[_0x0d7f('0x3f')](_0xbefb1e[_0x0d7f('0x3b')],{'$or':_[_0x0d7f('0x2b')](_0xbefb1e[_0x0d7f('0x36')],function(_0x5cfcac){var _0x1f2bf5={};_0x1f2bf5[_0x5cfcac]={'$like':'%'+_0x9e9474[_0x0d7f('0x31')][_0x0d7f('0x3d')]+'%'};return _0x1f2bf5;})});}if(_0x9e9474[_0x0d7f('0x31')][_0x0d7f('0x58')]){var _0x5f211e=_0x9e9474['query']['$gte'][_0x0d7f('0x59')](',');var _0x349523={};_0x349523[_0x5f211e[0x0]]={'$gte':moment(_0x5f211e[0x1])[_0x0d7f('0x5a')]('YYYY-MM-DD\x20HH:mm:ss')};_0xbefb1e[_0x0d7f('0x3b')]=_[_0x0d7f('0x3f')](_0xbefb1e[_0x0d7f('0x3b')],_0x349523);}_0xbefb1e=_[_0x0d7f('0x3f')]({},_0xbefb1e,_0x9e9474[_0x0d7f('0x40')]);return _0x36b182[_0x0d7f('0x57')](_0xbefb1e);}})['then'](function(_0x30b190){if(_0x30b190){_0x1316ab=_0x30b190['length'];if(!_0x9e9474[_0x0d7f('0x31')][_0x0d7f('0x5b')](_0x0d7f('0x38'))){_0xbefb1e['limit']=qs[_0x0d7f('0x24')](_0x9e9474[_0x0d7f('0x31')][_0x0d7f('0x24')]);_0xbefb1e[_0x0d7f('0x22')]=qs[_0x0d7f('0x22')](_0x9e9474[_0x0d7f('0x31')][_0x0d7f('0x22')]);}return _0x36b182[_0x0d7f('0x57')](_0xbefb1e);}})[_0x0d7f('0x41')](function(_0x151a5e){if(_0x151a5e){return _0x151a5e?{'count':_0x1316ab,'rows':_0x151a5e}:null;}})[_0x0d7f('0x41')](respondWithResult(_0x2b73d9,null))['catch'](handleError(_0x2b73d9,null));};
\ No newline at end of file
+var _0x6190=['../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','name','map','ChatGroup','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','describe','getUnread','user','toInteger','addMembers','ids','omit','User','order','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','findOne','ChatInternalMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x2dd839,_0x5706cd){var _0x58d234=function(_0x15e998){while(--_0x15e998){_0x2dd839['push'](_0x2dd839['shift']());}};_0x58d234(++_0x5706cd);}(_0x6190,0x105));var _0x0619=function(_0x47b11b,_0x311bfb){_0x47b11b=_0x47b11b-0x0;var _0x5ae63a=_0x6190[_0x47b11b];return _0x5ae63a;};'use strict';var emlformat=require(_0x0619('0x0'));var rimraf=require(_0x0619('0x1'));var zipdir=require(_0x0619('0x2'));var jsonpatch=require(_0x0619('0x3'));var rp=require('request-promise');var moment=require(_0x0619('0x4'));var BPromise=require(_0x0619('0x5'));var Mustache=require(_0x0619('0x6'));var util=require(_0x0619('0x7'));var path=require(_0x0619('0x8'));var sox=require('sox');var csv=require(_0x0619('0x9'));var ejs=require(_0x0619('0xa'));var fs=require('fs');var fs_extra=require(_0x0619('0xb'));var _=require('lodash');var squel=require(_0x0619('0xc'));var crypto=require(_0x0619('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0619('0x9'));var querystring=require(_0x0619('0xe'));var Papa=require(_0x0619('0xf'));var Redis=require(_0x0619('0x10'));var authService=require(_0x0619('0x11'));var qs=require(_0x0619('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0619('0x13'));var logger=require(_0x0619('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x0619('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x0619('0x16')]=_[_0x0619('0x17')](config[_0x0619('0x16')],{'host':_0x0619('0x18'),'port':0x18eb});var socket=require(_0x0619('0x19'))(new Redis(config[_0x0619('0x16')]));require(_0x0619('0x1a'))[_0x0619('0x1b')](socket);function respondWithStatusCode(_0x26870e,_0x488d67){_0x488d67=_0x488d67||0xcc;return function(_0x5b4d20){if(_0x5b4d20){return _0x26870e[_0x0619('0x1c')](_0x488d67);}return _0x26870e[_0x0619('0x1d')](_0x488d67)[_0x0619('0x1e')]();};}function respondWithResult(_0x1493fd,_0x2544b3){_0x2544b3=_0x2544b3||0xc8;return function(_0x163a06){if(_0x163a06){return _0x1493fd[_0x0619('0x1d')](_0x2544b3)[_0x0619('0x1f')](_0x163a06);}};}function respondWithFilteredResult(_0x1a1c9a,_0x227578){return function(_0x1cd5a8){if(_0x1cd5a8){var _0x565092=typeof _0x227578[_0x0619('0x20')]===_0x0619('0x21')&&typeof _0x227578[_0x0619('0x22')]===_0x0619('0x21');var _0x4f20b4=_0x1cd5a8[_0x0619('0x23')];var _0x10a2da=_0x565092?0x0:_0x227578[_0x0619('0x20')];var _0xb2ff7d=_0x565092?_0x1cd5a8['count']:_0x227578[_0x0619('0x20')]+_0x227578['limit'];var _0x129901;if(_0xb2ff7d>=_0x4f20b4){_0xb2ff7d=_0x4f20b4;_0x129901=0xc8;}else{_0x129901=0xce;}_0x1a1c9a[_0x0619('0x1d')](_0x129901);return _0x1a1c9a['set'](_0x0619('0x24'),_0x10a2da+'-'+_0xb2ff7d+'/'+_0x4f20b4)['json'](_0x1cd5a8);}return null;};}function patchUpdates(_0x25b369){return function(_0x1a9786){try{jsonpatch[_0x0619('0x25')](_0x1a9786,_0x25b369,!![]);}catch(_0x5f3088){return BPromise[_0x0619('0x26')](_0x5f3088);}return _0x1a9786['save']();};}function saveUpdates(_0x4e622d,_0xf997a){return function(_0x33cf4a){if(_0x33cf4a){return _0x33cf4a[_0x0619('0x27')](_0x4e622d)[_0x0619('0x28')](function(_0x104aa8){return _0x104aa8;});}return null;};}function removeEntity(_0x2d417d,_0x48cd29){return function(_0x5a1bb5){if(_0x5a1bb5){return _0x5a1bb5[_0x0619('0x29')]()[_0x0619('0x28')](function(){_0x2d417d[_0x0619('0x1d')](0xcc)[_0x0619('0x1e')]();});}};}function handleEntityNotFound(_0x5163ae,_0x3539d5){return function(_0x198941){if(!_0x198941){_0x5163ae[_0x0619('0x1c')](0x194);}return _0x198941;};}function handleError(_0x7a3cd5,_0x394db0){_0x394db0=_0x394db0||0x1f4;return function(_0x18a81d){logger['error'](_0x18a81d['stack']);if(_0x18a81d[_0x0619('0x2a')]){delete _0x18a81d[_0x0619('0x2a')];}_0x7a3cd5['status'](_0x394db0)['send'](_0x18a81d);};}exports['index']=function(_0x253ce6,_0x3ac9ea){var _0x13994d={},_0x382af1={},_0xd778ef={'count':0x0,'rows':[]};var _0x593450=_[_0x0619('0x2b')](db[_0x0619('0x2c')]['rawAttributes'],function(_0x54b37a){return{'name':_0x54b37a['fieldName'],'type':_0x54b37a[_0x0619('0x2d')]['key']};});_0x382af1[_0x0619('0x2e')]=_['map'](_0x593450,'name');_0x382af1[_0x0619('0x2f')]=_[_0x0619('0x30')](_0x253ce6[_0x0619('0x2f')]);_0x382af1[_0x0619('0x31')]=_[_0x0619('0x32')](_0x382af1['model'],_0x382af1[_0x0619('0x2f')]);_0x13994d[_0x0619('0x33')]=_[_0x0619('0x32')](_0x382af1['model'],qs[_0x0619('0x34')](_0x253ce6[_0x0619('0x2f')][_0x0619('0x34')]));_0x13994d['attributes']=_0x13994d['attributes'][_0x0619('0x35')]?_0x13994d[_0x0619('0x33')]:_0x382af1[_0x0619('0x2e')];if(!_0x253ce6[_0x0619('0x2f')][_0x0619('0x36')](_0x0619('0x37'))){_0x13994d[_0x0619('0x22')]=qs[_0x0619('0x22')](_0x253ce6['query'][_0x0619('0x22')]);_0x13994d[_0x0619('0x20')]=qs['offset'](_0x253ce6['query'][_0x0619('0x20')]);}_0x13994d['order']=qs[_0x0619('0x38')](_0x253ce6[_0x0619('0x2f')]['sort']);_0x13994d[_0x0619('0x39')]=qs[_0x0619('0x31')](_[_0x0619('0x3a')](_0x253ce6['query'],_0x382af1['filters']),_0x593450);if(_0x253ce6[_0x0619('0x2f')][_0x0619('0x3b')]){_0x13994d[_0x0619('0x39')]=_[_0x0619('0x3c')](_0x13994d[_0x0619('0x39')],{'$or':_['map'](_0x593450,function(_0x9a46d9){if(_0x9a46d9[_0x0619('0x2d')]!==_0x0619('0x3d')){var _0x685ee3={};_0x685ee3[_0x9a46d9[_0x0619('0x2a')]]={'$like':'%'+_0x253ce6[_0x0619('0x2f')][_0x0619('0x3b')]+'%'};return _0x685ee3;}})});}_0x13994d=_['merge']({},_0x13994d,_0x253ce6[_0x0619('0x3e')]);var _0x1e1253={'where':_0x13994d[_0x0619('0x39')]};return db['ChatGroup'][_0x0619('0x23')](_0x1e1253)['then'](function(_0x3906c6){_0xd778ef[_0x0619('0x23')]=_0x3906c6;if(_0x253ce6[_0x0619('0x2f')][_0x0619('0x3f')]){_0x13994d[_0x0619('0x40')]=[{'all':!![]}];}return db[_0x0619('0x2c')][_0x0619('0x41')](_0x13994d);})[_0x0619('0x28')](function(_0x377361){_0xd778ef[_0x0619('0x42')]=_0x377361;return _0xd778ef;})[_0x0619('0x28')](respondWithFilteredResult(_0x3ac9ea,_0x13994d))[_0x0619('0x43')](handleError(_0x3ac9ea,null));};exports[_0x0619('0x44')]=function(_0x1af964,_0x8b3977){var _0x34939c={'raw':!![],'where':{'id':_0x1af964['params']['id']}},_0x558bd4={};_0x558bd4['model']=_[_0x0619('0x30')](db['ChatGroup'][_0x0619('0x45')]);_0x558bd4[_0x0619('0x2f')]=_[_0x0619('0x30')](_0x1af964[_0x0619('0x2f')]);_0x558bd4[_0x0619('0x31')]=_[_0x0619('0x32')](_0x558bd4['model'],_0x558bd4[_0x0619('0x2f')]);_0x34939c['attributes']=_[_0x0619('0x32')](_0x558bd4['model'],qs[_0x0619('0x34')](_0x1af964[_0x0619('0x2f')][_0x0619('0x34')]));_0x34939c[_0x0619('0x33')]=_0x34939c['attributes'][_0x0619('0x35')]?_0x34939c['attributes']:_0x558bd4['model'];if(_0x1af964['query'][_0x0619('0x3f')]){_0x34939c[_0x0619('0x40')]=[{'all':!![]}];}_0x34939c=_[_0x0619('0x3c')]({},_0x34939c,_0x1af964[_0x0619('0x3e')]);return db[_0x0619('0x2c')][_0x0619('0x46')](_0x34939c)['then'](handleEntityNotFound(_0x8b3977,null))[_0x0619('0x28')](respondWithResult(_0x8b3977,null))[_0x0619('0x43')](handleError(_0x8b3977,null));};exports[_0x0619('0x47')]=function(_0x5447eb,_0x4276ec){return db[_0x0619('0x2c')][_0x0619('0x47')](_0x5447eb[_0x0619('0x48')],{})[_0x0619('0x28')](respondWithResult(_0x4276ec,0xc9))['catch'](handleError(_0x4276ec,null));};exports['update']=function(_0x187b93,_0xeb5f33){if(_0x187b93['body']['id']){delete _0x187b93[_0x0619('0x48')]['id'];}return db[_0x0619('0x2c')]['find']({'where':{'id':_0x187b93[_0x0619('0x49')]['id']}})[_0x0619('0x28')](handleEntityNotFound(_0xeb5f33,null))['then'](saveUpdates(_0x187b93[_0x0619('0x48')],null))[_0x0619('0x28')](respondWithResult(_0xeb5f33,null))['catch'](handleError(_0xeb5f33,null));};exports[_0x0619('0x29')]=function(_0x267291,_0x36c80c){return db[_0x0619('0x2c')]['find']({'where':{'id':_0x267291[_0x0619('0x49')]['id']}})[_0x0619('0x28')](handleEntityNotFound(_0x36c80c,null))[_0x0619('0x28')](removeEntity(_0x36c80c,null))[_0x0619('0x43')](handleError(_0x36c80c,null));};exports[_0x0619('0x4a')]=function(_0x122b0d,_0x10507d){return db['ChatGroup']['describe']()[_0x0619('0x28')](respondWithResult(_0x10507d,null))[_0x0619('0x43')](handleError(_0x10507d,null));};exports[_0x0619('0x4b')]=function(_0x1f726d,_0x17aeff,_0x137246){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x1f726d['params']['id'],'ToId':_0x1f726d[_0x0619('0x4c')]['id'],'read':![]}})[_0x0619('0x28')](function(_0x541e85){return{'id':_[_0x0619('0x4d')](_0x1f726d[_0x0619('0x49')]['id']),'count':_0x541e85};})[_0x0619('0x28')](respondWithResult(_0x17aeff,null))[_0x0619('0x43')](handleError(_0x17aeff,null));};exports[_0x0619('0x4e')]=function(_0x44af05,_0x3eb2a4,_0x794031){return db[_0x0619('0x2c')][_0x0619('0x46')]({'where':{'id':_0x44af05[_0x0619('0x49')]['id']}})[_0x0619('0x28')](handleEntityNotFound(_0x3eb2a4,null))['then'](function(_0x4f7278){if(_0x4f7278){return _0x4f7278['addMembers'](_0x44af05[_0x0619('0x48')][_0x0619('0x4f')],_[_0x0619('0x50')](_0x44af05[_0x0619('0x48')],[_0x0619('0x4f'),'id'])||{});}})[_0x0619('0x28')](respondWithResult(_0x3eb2a4,null))[_0x0619('0x43')](handleError(_0x3eb2a4,null));};exports['getMembers']=function(_0x2ffea8,_0x4e5520,_0x3c4c58){var _0x48d5e6={};var _0x4f1744={};var _0x42b8b9;var _0x339fde;return db[_0x0619('0x2c')]['findOne']({'where':{'id':_0x2ffea8[_0x0619('0x49')]['id']}})[_0x0619('0x28')](handleEntityNotFound(_0x4e5520,null))['then'](function(_0x3102a2){if(_0x3102a2){_0x42b8b9=_0x3102a2;_0x4f1744[_0x0619('0x2e')]=_[_0x0619('0x30')](db[_0x0619('0x51')][_0x0619('0x45')]);_0x4f1744[_0x0619('0x2f')]=_['keys'](_0x2ffea8[_0x0619('0x2f')]);_0x4f1744[_0x0619('0x31')]=_['intersection'](_0x4f1744['model'],_0x4f1744['query']);_0x48d5e6[_0x0619('0x33')]=_[_0x0619('0x32')](_0x4f1744[_0x0619('0x2e')],qs[_0x0619('0x34')](_0x2ffea8[_0x0619('0x2f')]['fields']));_0x48d5e6[_0x0619('0x33')]=_0x48d5e6['attributes'][_0x0619('0x35')]?_0x48d5e6[_0x0619('0x33')]:_0x4f1744['model'];_0x48d5e6[_0x0619('0x52')]=qs[_0x0619('0x38')](_0x2ffea8[_0x0619('0x2f')][_0x0619('0x38')]);_0x48d5e6['where']=qs[_0x0619('0x31')](_[_0x0619('0x3a')](_0x2ffea8[_0x0619('0x2f')],_0x4f1744[_0x0619('0x31')]));if(_0x2ffea8[_0x0619('0x2f')][_0x0619('0x3b')]){_0x48d5e6[_0x0619('0x39')]=_['merge'](_0x48d5e6[_0x0619('0x39')],{'$or':_['map'](_0x48d5e6[_0x0619('0x33')],function(_0x38bbf7){var _0x39e7a5={};_0x39e7a5[_0x38bbf7]={'$like':'%'+_0x2ffea8['query'][_0x0619('0x3b')]+'%'};return _0x39e7a5;})});}_0x48d5e6=_['merge']({},_0x48d5e6,_0x2ffea8['options']);return _0x42b8b9[_0x0619('0x53')](_0x48d5e6);}})[_0x0619('0x28')](function(_0x12c007){if(_0x12c007){_0x339fde=_0x12c007[_0x0619('0x35')];if(!_0x2ffea8[_0x0619('0x2f')][_0x0619('0x36')](_0x0619('0x37'))){_0x48d5e6[_0x0619('0x22')]=qs[_0x0619('0x22')](_0x2ffea8['query'][_0x0619('0x22')]);_0x48d5e6[_0x0619('0x20')]=qs['offset'](_0x2ffea8['query'][_0x0619('0x20')]);}return _0x42b8b9[_0x0619('0x53')](_0x48d5e6);}})[_0x0619('0x28')](function(_0x3295de){if(_0x3295de){return _0x3295de?{'count':_0x339fde,'rows':_0x3295de}:null;}})['then'](respondWithResult(_0x4e5520,null))[_0x0619('0x43')](handleError(_0x4e5520,null));};exports[_0x0619('0x54')]=function(_0x24a639,_0x1f39b,_0x17c989){return db[_0x0619('0x2c')]['find']({'where':{'id':_0x24a639[_0x0619('0x49')]['id']}})[_0x0619('0x28')](handleEntityNotFound(_0x1f39b,null))[_0x0619('0x28')](function(_0x24d07c){if(_0x24d07c){return _0x24d07c['removeMembers'](_0x24a639[_0x0619('0x2f')][_0x0619('0x4f')]);}})[_0x0619('0x28')](respondWithStatusCode(_0x1f39b,null))[_0x0619('0x43')](handleError(_0x1f39b,null));};exports[_0x0619('0x55')]=function(_0xd12416,_0x35ab8d,_0x243ccc){if(_0xd12416[_0x0619('0x48')]['id']){delete _0xd12416['body']['id'];}return db[_0x0619('0x2c')]['find']({'where':{'id':_0xd12416[_0x0619('0x49')]['id']}})['then'](handleEntityNotFound(_0x35ab8d,null))[_0x0619('0x28')](function(_0xc8fe18){if(_0xc8fe18){_0xd12416[_0x0619('0x48')][_0x0619('0x56')]=_0xc8fe18['id'];return db['ChatInternalMessage'][_0x0619('0x47')](_0xd12416[_0x0619('0x48')]);}})[_0x0619('0x28')](respondWithResult(_0x35ab8d,null))[_0x0619('0x43')](handleError(_0x35ab8d,null));};exports[_0x0619('0x57')]=function(_0x3d0dc3,_0x17c2b0,_0x28de8a){var _0x13847f={};var _0x27ccbf={};var _0x18a421;var _0x1ca71d;return db['ChatGroup'][_0x0619('0x58')]({'where':{'id':_0x3d0dc3['params']['id']}})[_0x0619('0x28')](handleEntityNotFound(_0x17c2b0,null))[_0x0619('0x28')](function(_0x487e4d){if(_0x487e4d){_0x18a421=_0x487e4d;_0x27ccbf[_0x0619('0x2e')]=_[_0x0619('0x30')](db[_0x0619('0x59')][_0x0619('0x45')]);_0x27ccbf['query']=_[_0x0619('0x30')](_0x3d0dc3['query']);_0x27ccbf[_0x0619('0x31')]=_[_0x0619('0x32')](_0x27ccbf[_0x0619('0x2e')],_0x27ccbf['query']);_0x13847f[_0x0619('0x33')]=_[_0x0619('0x32')](_0x27ccbf[_0x0619('0x2e')],qs['fields'](_0x3d0dc3[_0x0619('0x2f')]['fields']));_0x13847f[_0x0619('0x33')]=_0x13847f[_0x0619('0x33')][_0x0619('0x35')]?_0x13847f[_0x0619('0x33')]:_0x27ccbf[_0x0619('0x2e')];_0x13847f[_0x0619('0x52')]=qs[_0x0619('0x38')](_0x3d0dc3[_0x0619('0x2f')][_0x0619('0x38')]);_0x13847f['where']=qs[_0x0619('0x31')](_[_0x0619('0x3a')](_0x3d0dc3['query'],_0x27ccbf[_0x0619('0x31')]));if(_0x3d0dc3[_0x0619('0x2f')]['filter']){_0x13847f[_0x0619('0x39')]=_[_0x0619('0x3c')](_0x13847f[_0x0619('0x39')],{'$or':_[_0x0619('0x2b')](_0x13847f['attributes'],function(_0x1b9cbb){var _0x38ae7b={};_0x38ae7b[_0x1b9cbb]={'$like':'%'+_0x3d0dc3[_0x0619('0x2f')][_0x0619('0x3b')]+'%'};return _0x38ae7b;})});}if(_0x3d0dc3[_0x0619('0x2f')]['$gte']){var _0x4e87bb=_0x3d0dc3[_0x0619('0x2f')][_0x0619('0x5a')][_0x0619('0x5b')](',');var _0x5e5447={};_0x5e5447[_0x4e87bb[0x0]]={'$gte':moment(_0x4e87bb[0x1])[_0x0619('0x5c')](_0x0619('0x5d'))};_0x13847f[_0x0619('0x39')]=_[_0x0619('0x3c')](_0x13847f[_0x0619('0x39')],_0x5e5447);}_0x13847f=_[_0x0619('0x3c')]({},_0x13847f,_0x3d0dc3['options']);return _0x18a421['getMessages'](_0x13847f);}})['then'](function(_0x4723c8){if(_0x4723c8){_0x1ca71d=_0x4723c8[_0x0619('0x35')];if(!_0x3d0dc3[_0x0619('0x2f')]['hasOwnProperty'](_0x0619('0x37'))){_0x13847f[_0x0619('0x22')]=qs[_0x0619('0x22')](_0x3d0dc3[_0x0619('0x2f')][_0x0619('0x22')]);_0x13847f[_0x0619('0x20')]=qs[_0x0619('0x20')](_0x3d0dc3[_0x0619('0x2f')][_0x0619('0x20')]);}return _0x18a421[_0x0619('0x57')](_0x13847f);}})[_0x0619('0x28')](function(_0x4cb07a){if(_0x4cb07a){return _0x4cb07a?{'count':_0x1ca71d,'rows':_0x4cb07a}:null;}})[_0x0619('0x28')](respondWithResult(_0x17c2b0,null))[_0x0619('0x43')](handleError(_0x17c2b0,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 8fcea22..80aca65 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 _0x7d5d=['exports','../../mysqldb','ChatGroup','update','remove','emit','hasOwnProperty'];(function(_0x408a32,_0x5d7184){var _0x10a934=function(_0x5791e9){while(--_0x5791e9){_0x408a32['push'](_0x408a32['shift']());}};_0x10a934(++_0x5d7184);}(_0x7d5d,0x1dd));var _0xd7d5=function(_0x5669f6,_0x2b4029){_0x5669f6=_0x5669f6-0x0;var _0x1cf487=_0x7d5d[_0x5669f6];return _0x1cf487;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0xd7d5('0x0'))['db'][_0xd7d5('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xd7d5('0x2'),'afterDestroy':_0xd7d5('0x3')};function emitEvent(_0x2948ca){return function(_0x5ce3bf,_0x236433,_0x26fd7b){ChatGroupEvents[_0xd7d5('0x4')](_0x2948ca+':'+_0x5ce3bf['id'],_0x5ce3bf);ChatGroupEvents[_0xd7d5('0x4')](_0x2948ca,_0x5ce3bf);_0x26fd7b(null);};}for(var e in events){if(events[_0xd7d5('0x5')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0xd7d5('0x6')]=ChatGroupEvents;
\ No newline at end of file
+var _0x1753=['remove','emit','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1753,0x1cb));var _0x3175=function(_0x46008b,_0x21df33){_0x46008b=_0x46008b-0x0;var _0x564c27=_0x1753[_0x46008b];return _0x564c27;};'use strict';var EventEmitter=require(_0x3175('0x0'));var ChatGroup=require(_0x3175('0x1'))['db'][_0x3175('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x3175('0x3')](0x0);var events={'afterCreate':_0x3175('0x4'),'afterUpdate':'update','afterDestroy':_0x3175('0x5')};function emitEvent(_0x5ddc7f){return function(_0x2c92b2,_0x7d0b14,_0x1a83b4){ChatGroupEvents[_0x3175('0x6')](_0x5ddc7f+':'+_0x2c92b2['id'],_0x2c92b2);ChatGroupEvents[_0x3175('0x6')](_0x5ddc7f,_0x2c92b2);_0x1a83b4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x3175('0x7')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index ee33ca5..dc9c162 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 _0x1d80=['path','rimraf','./chatGroup.attributes','define','chat_groups','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1d80,0x1e9));var _0x01d8=function(_0x56dbed,_0x3426c1){_0x56dbed=_0x56dbed-0x0;var _0x317998=_0x1d80[_0x56dbed];return _0x317998;};'use strict';var _=require(_0x01d8('0x0'));var util=require(_0x01d8('0x1'));var logger=require(_0x01d8('0x2'))(_0x01d8('0x3'));var moment=require(_0x01d8('0x4'));var BPromise=require(_0x01d8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x01d8('0x6'));var rimraf=require(_0x01d8('0x7'));var config=require('../../config/environment');var attributes=require(_0x01d8('0x8'));module['exports']=function(_0x5c9b9d,_0x4ca053){return _0x5c9b9d[_0x01d8('0x9')]('ChatGroup',attributes,{'tableName':_0x01d8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc986=['bluebird','request-promise','../../config/environment','exports','chat_groups','util','moment'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xc986,0x7c));var _0x6c98=function(_0x573542,_0x415977){_0x573542=_0x573542-0x0;var _0x27834b=_0xc986[_0x573542];return _0x27834b;};'use strict';var _=require('lodash');var util=require(_0x6c98('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x6c98('0x1'));var BPromise=require(_0x6c98('0x2'));var rp=require(_0x6c98('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6c98('0x4'));var attributes=require('./chatGroup.attributes');module[_0x6c98('0x5')]=function(_0x308352,_0x4712aa){return _0x308352['define']('ChatGroup',attributes,{'tableName':_0x6c98('0x6'),'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 4be8bda..d71fbe9 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 _0x56e7=['defaults','localhost','./chatGroup.socket','register','request','info','debug','request\x20sent','stringify','error','code','message','ChatGroup,\x20%s,\x20%s','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis'];(function(_0x55383a,_0x5636bf){var _0x3ec492=function(_0x43574b){while(--_0x43574b){_0x55383a['push'](_0x55383a['shift']());}};_0x3ec492(++_0x5636bf);}(_0x56e7,0x7b));var _0x756e=function(_0x217864,_0x183226){_0x217864=_0x217864-0x0;var _0x58d26f=_0x56e7[_0x217864];return _0x58d26f;};'use strict';var _=require('lodash');var util=require(_0x756e('0x0'));var moment=require(_0x756e('0x1'));var BPromise=require('bluebird');var rs=require(_0x756e('0x2'));var fs=require('fs');var Redis=require(_0x756e('0x3'));var db=require(_0x756e('0x4'))['db'];var utils=require(_0x756e('0x5'));var logger=require(_0x756e('0x6'))(_0x756e('0x7'));var config=require(_0x756e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x756e('0x9')][_0x756e('0xa')]({'port':0x232a});config[_0x756e('0xb')]=_[_0x756e('0xc')](config['redis'],{'host':_0x756e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x756e('0xb')]));require(_0x756e('0xe'))[_0x756e('0xf')](socket);function respondWithRpcPromise(_0x4738dc,_0x4adf8f,_0x5d5b90){return new BPromise(function(_0x324d36,_0x2be615){return client[_0x756e('0x10')](_0x4738dc,_0x5d5b90)['then'](function(_0x330076){logger[_0x756e('0x11')]('ChatGroup,\x20%s,\x20%s',_0x4adf8f,'request\x20sent');logger[_0x756e('0x12')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x4adf8f,_0x756e('0x13'),JSON[_0x756e('0x14')](_0x330076));if(_0x330076[_0x756e('0x15')]){if(_0x330076[_0x756e('0x15')][_0x756e('0x16')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x4adf8f,_0x330076[_0x756e('0x15')][_0x756e('0x17')]);return _0x2be615(_0x330076[_0x756e('0x15')]['message']);}logger['error'](_0x756e('0x18'),_0x4adf8f,_0x330076[_0x756e('0x15')][_0x756e('0x17')]);return _0x324d36(_0x330076[_0x756e('0x15')][_0x756e('0x17')]);}else{logger[_0x756e('0x11')](_0x756e('0x18'),_0x4adf8f,_0x756e('0x13'));_0x324d36(_0x330076[_0x756e('0x19')]['message']);}})[_0x756e('0x1a')](function(_0x47c3c4){logger['error'](_0x756e('0x18'),_0x4adf8f,_0x47c3c4);_0x2be615(_0x47c3c4);});});}
\ No newline at end of file
+var _0xb3ea=['../../config/environment','jayson/promise','client','redis','localhost','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x16b26f,_0x1c7a93){var _0x2bcfd4=function(_0x2764b2){while(--_0x2764b2){_0x16b26f['push'](_0x16b26f['shift']());}};_0x2bcfd4(++_0x1c7a93);}(_0xb3ea,0x10d));var _0xab3e=function(_0x4bb8f2,_0x3d17fb){_0x4bb8f2=_0x4bb8f2-0x0;var _0x450d32=_0xb3ea[_0x4bb8f2];return _0x450d32;};'use strict';var _=require(_0xab3e('0x0'));var util=require(_0xab3e('0x1'));var moment=require(_0xab3e('0x2'));var BPromise=require('bluebird');var rs=require(_0xab3e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab3e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xab3e('0x5'))(_0xab3e('0x6'));var config=require(_0xab3e('0x7'));var jayson=require(_0xab3e('0x8'));var client=jayson[_0xab3e('0x9')]['http']({'port':0x232a});config[_0xab3e('0xa')]=_['defaults'](config[_0xab3e('0xa')],{'host':_0xab3e('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xab3e('0xa')]));require(_0xab3e('0xc'))['register'](socket);function respondWithRpcPromise(_0x15448b,_0xe809be,_0x5872cf){return new BPromise(function(_0x57d9b9,_0x219c55){return client[_0xab3e('0xd')](_0x15448b,_0x5872cf)[_0xab3e('0xe')](function(_0x4620c7){logger[_0xab3e('0xf')](_0xab3e('0x10'),_0xe809be,'request\x20sent');logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0xe809be,_0xab3e('0x11'),JSON[_0xab3e('0x12')](_0x4620c7));if(_0x4620c7[_0xab3e('0x13')]){if(_0x4620c7[_0xab3e('0x13')]['code']===0x1f4){logger[_0xab3e('0x13')]('ChatGroup,\x20%s,\x20%s',_0xe809be,_0x4620c7['error'][_0xab3e('0x14')]);return _0x219c55(_0x4620c7[_0xab3e('0x13')]['message']);}logger[_0xab3e('0x13')](_0xab3e('0x10'),_0xe809be,_0x4620c7['error'][_0xab3e('0x14')]);return _0x57d9b9(_0x4620c7['error'][_0xab3e('0x14')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0xe809be,_0xab3e('0x11'));_0x57d9b9(_0x4620c7[_0xab3e('0x15')][_0xab3e('0x14')]);}})[_0xab3e('0x16')](function(_0x7bf46d){logger[_0xab3e('0x13')]('ChatGroup,\x20%s,\x20%s',_0xe809be,_0x7bf46d);_0x219c55(_0x7bf46d);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 7fd2fa5..b397987 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 _0xcab1=['emit','register','./chatGroup.events','save','remove','update'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0xcab1,0xe0));var _0x1cab=function(_0x4cc40f,_0x1ad2ed){_0x4cc40f=_0x4cc40f-0x0;var _0x335cc3=_0xcab1[_0x4cc40f];return _0x335cc3;};'use strict';var ChatGroupEvents=require(_0x1cab('0x0'));var events=[_0x1cab('0x1'),_0x1cab('0x2'),_0x1cab('0x3')];function createListener(_0x2019f1,_0xfd873b){return function(_0x1d6b04){_0xfd873b[_0x1cab('0x4')](_0x2019f1,_0x1d6b04);};}function removeListener(_0x4aa18e,_0x2d1856){return function(){ChatGroupEvents['removeListener'](_0x4aa18e,_0x2d1856);};}exports[_0x1cab('0x5')]=function(_0x5db393){for(var _0x22934a=0x0,_0x10341e=events['length'];_0x22934a<_0x10341e;_0x22934a++){var _0x57438b=events[_0x22934a];var _0x20343a=createListener('chatGroup:'+_0x57438b,_0x5db393);ChatGroupEvents['on'](_0x57438b,_0x20343a);}};
\ No newline at end of file
+var _0x84fe=['length','chatGroup:','./chatGroup.events','remove','update','removeListener','register'];(function(_0x8f87ec,_0x1841ca){var _0x182547=function(_0x31686e){while(--_0x31686e){_0x8f87ec['push'](_0x8f87ec['shift']());}};_0x182547(++_0x1841ca);}(_0x84fe,0x1c9));var _0xe84f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x84fe[_0x122ef9];return _0x42fba0;};'use strict';var ChatGroupEvents=require(_0xe84f('0x0'));var events=['save',_0xe84f('0x1'),_0xe84f('0x2')];function createListener(_0x2f0f4e,_0x4fd9b1){return function(_0x3085e6){_0x4fd9b1['emit'](_0x2f0f4e,_0x3085e6);};}function removeListener(_0x507ee6,_0x1bd00d){return function(){ChatGroupEvents[_0xe84f('0x3')](_0x507ee6,_0x1bd00d);};}exports[_0xe84f('0x4')]=function(_0x32cc80){for(var _0x28ad16=0x0,_0x3c72d1=events[_0xe84f('0x5')];_0x28ad16<_0x3c72d1;_0x28ad16++){var _0x4d2906=events[_0x28ad16];var _0x251789=createListener(_0xe84f('0x6')+_0x4d2906,_0x32cc80);ChatGroupEvents['on'](_0x4d2906,_0x251789);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index d9cb415..bd7a08a 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 _0x1e75=['index','/describe','describe','/:id','show','/:id/unread','getUnread','getMembers','getMessages','post','create','/:id/members','addMembers','put','update','delete','destroy','removeMembers','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatGroup.controller','get','isAuthenticated'];(function(_0x2392b4,_0x332bfa){var _0x5148ff=function(_0x5e6d4d){while(--_0x5e6d4d){_0x2392b4['push'](_0x2392b4['shift']());}};_0x5148ff(++_0x332bfa);}(_0x1e75,0x13f));var _0x51e7=function(_0x33bf8f,_0x378f7c){_0x33bf8f=_0x33bf8f-0x0;var _0x584719=_0x1e75[_0x33bf8f];return _0x584719;};'use strict';var multer=require(_0x51e7('0x0'));var util=require(_0x51e7('0x1'));var path=require(_0x51e7('0x2'));var timeout=require('connect-timeout');var express=require(_0x51e7('0x3'));var router=express[_0x51e7('0x4')]();var fs_extra=require(_0x51e7('0x5'));var auth=require(_0x51e7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x51e7('0x7'));var controller=require(_0x51e7('0x8'));router[_0x51e7('0x9')]('/',auth[_0x51e7('0xa')](),controller[_0x51e7('0xb')]);router[_0x51e7('0x9')](_0x51e7('0xc'),auth[_0x51e7('0xa')](),controller[_0x51e7('0xd')]);router['get'](_0x51e7('0xe'),auth[_0x51e7('0xa')](),controller[_0x51e7('0xf')]);router[_0x51e7('0x9')](_0x51e7('0x10'),auth[_0x51e7('0xa')](),controller[_0x51e7('0x11')]);router[_0x51e7('0x9')]('/:id/members',auth[_0x51e7('0xa')](),controller[_0x51e7('0x12')]);router[_0x51e7('0x9')]('/:id/messages',auth[_0x51e7('0xa')](),controller[_0x51e7('0x13')]);router[_0x51e7('0x14')]('/',auth[_0x51e7('0xa')](),controller[_0x51e7('0x15')]);router[_0x51e7('0x14')](_0x51e7('0x16'),auth[_0x51e7('0xa')](),controller[_0x51e7('0x17')]);router[_0x51e7('0x14')]('/:id/messages',auth[_0x51e7('0xa')](),controller['addMessage']);router[_0x51e7('0x18')](_0x51e7('0xe'),auth[_0x51e7('0xa')](),controller[_0x51e7('0x19')]);router[_0x51e7('0x1a')](_0x51e7('0xe'),auth[_0x51e7('0xa')](),controller[_0x51e7('0x1b')]);router['delete'](_0x51e7('0x16'),auth[_0x51e7('0xa')](),controller[_0x51e7('0x1c')]);module[_0x51e7('0x1d')]=router;
\ No newline at end of file
+var _0xebed=['./chatGroup.controller','isAuthenticated','index','describe','get','/:id/unread','/:id/members','getMembers','/:id/messages','post','addMembers','put','/:id','update','delete','destroy','removeMembers','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x243d5e,_0x4d2a10){var _0x58787b=function(_0x27b688){while(--_0x27b688){_0x243d5e['push'](_0x243d5e['shift']());}};_0x58787b(++_0x4d2a10);}(_0xebed,0x198));var _0xdebe=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0xebed[_0x5834bc];return _0x3e183a;};'use strict';var multer=require('multer');var util=require(_0xdebe('0x0'));var path=require(_0xdebe('0x1'));var timeout=require(_0xdebe('0x2'));var express=require(_0xdebe('0x3'));var router=express[_0xdebe('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdebe('0x5'));var interaction=require(_0xdebe('0x6'));var config=require(_0xdebe('0x7'));var controller=require(_0xdebe('0x8'));router['get']('/',auth[_0xdebe('0x9')](),controller[_0xdebe('0xa')]);router['get']('/describe',auth[_0xdebe('0x9')](),controller[_0xdebe('0xb')]);router[_0xdebe('0xc')]('/:id',auth[_0xdebe('0x9')](),controller['show']);router['get'](_0xdebe('0xd'),auth[_0xdebe('0x9')](),controller['getUnread']);router[_0xdebe('0xc')](_0xdebe('0xe'),auth[_0xdebe('0x9')](),controller[_0xdebe('0xf')]);router[_0xdebe('0xc')](_0xdebe('0x10'),auth[_0xdebe('0x9')](),controller['getMessages']);router[_0xdebe('0x11')]('/',auth[_0xdebe('0x9')](),controller['create']);router[_0xdebe('0x11')]('/:id/members',auth[_0xdebe('0x9')](),controller[_0xdebe('0x12')]);router[_0xdebe('0x11')](_0xdebe('0x10'),auth[_0xdebe('0x9')](),controller['addMessage']);router[_0xdebe('0x13')](_0xdebe('0x14'),auth[_0xdebe('0x9')](),controller[_0xdebe('0x15')]);router[_0xdebe('0x16')](_0xdebe('0x14'),auth[_0xdebe('0x9')](),controller[_0xdebe('0x17')]);router['delete']('/:id/members',auth[_0xdebe('0x9')](),controller[_0xdebe('0x18')]);module[_0xdebe('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 516f1cd..affba8e 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 _0x3de3=['sequelize','BOOLEAN','INTEGER','star','thumb','TEXT','STRING','DATE','long','ENUM','out'];(function(_0x50e889,_0x3aac10){var _0xab3923=function(_0x5af956){while(--_0x5af956){_0x50e889['push'](_0x50e889['shift']());}};_0xab3923(++_0x3aac10);}(_0x3de3,0x1ce));var _0x33de=function(_0x3e3e57,_0x54b132){_0x3e3e57=_0x3e3e57-0x0;var _0x4e5026=_0x3de3[_0x3e3e57];return _0x4e5026;};'use strict';var Sequelize=require(_0x33de('0x0'));module['exports']={'closed':{'type':Sequelize[_0x33de('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x33de('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x33de('0x3'),_0x33de('0x4')),'defaultValue':_0x33de('0x3')},'ratingMessage':{'type':Sequelize[_0x33de('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x33de('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x33de('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x33de('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x33de('0x6')]},'browserName':{'type':Sequelize[_0x33de('0x6')]},'browserVersion':{'type':Sequelize[_0x33de('0x6')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x33de('0x6')]},'deviceModel':{'type':Sequelize[_0x33de('0x6')]},'deviceVendor':{'type':Sequelize[_0x33de('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x33de('0x5')]},'customerIp':{'type':Sequelize[_0x33de('0x6')]},'formData':{'type':Sequelize[_0x33de('0x5')](_0x33de('0x8'))},'read1stAt':{'type':Sequelize[_0x33de('0x7')]},'lastMsgAt':{'type':Sequelize[_0x33de('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x33de('0x9')]('in',_0x33de('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x33de('0x6')]},'customerPort':{'type':Sequelize[_0x33de('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x33de('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x34b7=['thumb','STRING','DATE','TEXT','long','out','BOOLEAN','INTEGER','ENUM','star'];(function(_0x5467d2,_0x13e443){var _0xfd1d89=function(_0x2143bf){while(--_0x2143bf){_0x5467d2['push'](_0x5467d2['shift']());}};_0xfd1d89(++_0x13e443);}(_0x34b7,0x196));var _0x734b=function(_0x596cdd,_0x939916){_0x596cdd=_0x596cdd-0x0;var _0x5b65ab=_0x34b7[_0x596cdd];return _0x5b65ab;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x734b('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x734b('0x1')]},'ratingType':{'type':Sequelize[_0x734b('0x2')](_0x734b('0x3'),_0x734b('0x4')),'defaultValue':_0x734b('0x3')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x734b('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x734b('0x6')]},'disposition':{'type':Sequelize[_0x734b('0x5')]},'secondDisposition':{'type':Sequelize[_0x734b('0x5')]},'thirdDisposition':{'type':Sequelize[_0x734b('0x5')]},'note':{'type':Sequelize[_0x734b('0x5')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x734b('0x5')]},'osName':{'type':Sequelize[_0x734b('0x5')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x734b('0x5')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x734b('0x5')]},'formData':{'type':Sequelize[_0x734b('0x7')](_0x734b('0x8'))},'read1stAt':{'type':Sequelize[_0x734b('0x6')]},'lastMsgAt':{'type':Sequelize[_0x734b('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x734b('0x2')]('in',_0x734b('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x734b('0x5')]},'customerPort':{'type':Sequelize[_0x734b('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x734b('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0x734b('0x0')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 3abb706..08040c8 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 _0x0b34=['err','unlinkSync','zip-dir','request-promise','moment','bluebird','util','path','ejs','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','status','end','json','offset','undefined','count','limit','set','Content-Range','destroy','sendStatus','name','render','merge','body','interaction','account','index','map','ChatInteraction','rawAttributes','key','findAll','query','user','params','model','keys','filters','attributes','intersection','fields','include','options','catch','create','update','find','describe','createVidaooSession','ChatWebsite','findOne','ChatWebsiteId','vidaooApiKey','vidaooTopic','vidaooNote','vidaooMetadata','vidaooEscalation','fullname','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','attachmentUpload','file','originalname','basename','filename','type','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','Messages','User','CmContact','length','System','customer','Visitor','ContactId','agentIdentifier','website_alias','%s%d','agentAlias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','hasOwnProperty','nolimit','order','sort','where','ChatInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','getMyMessages','pick','includeAgent','push','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','download','toString','server','files','tmp','transcript-%d-%s.zip','lastName','attachments','read','Account','Owner','get','mkdirSync','N.A.','closedAt','disposition','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','firstName','renderFile','downloadInteraction.ejs','transcript-','.pdf','Chat','createPdfFromHTML'];(function(_0x3877c1,_0x238c29){var _0x59056a=function(_0x3567cd){while(--_0x3567cd){_0x3877c1['push'](_0x3877c1['shift']());}};_0x59056a(++_0x238c29);}(_0x0b34,0xd5));var _0x40b3=function(_0x3b892e,_0x2c9467){_0x3b892e=_0x3b892e-0x0;var _0x28dca7=_0x0b34[_0x3b892e];return _0x28dca7;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x40b3('0x0'));var rp=require(_0x40b3('0x1'));var moment=require(_0x40b3('0x2'));var BPromise=require(_0x40b3('0x3'));var Mustache=require('mustache');var util=require(_0x40b3('0x4'));var path=require(_0x40b3('0x5'));var ejs=require(_0x40b3('0x6'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0x40b3('0x7'));var qs=require(_0x40b3('0x8'));var pdf=require(_0x40b3('0x9'));var logger=require(_0x40b3('0xa'))('api');var config=require('../../config/environment');var db=require(_0x40b3('0xb'))['db'];config[_0x40b3('0xc')]=_[_0x40b3('0xd')](config[_0x40b3('0xc')],{'host':_0x40b3('0xe'),'port':0x18eb});var socket=require(_0x40b3('0xf'))(new Redis(config[_0x40b3('0xc')]));require(_0x40b3('0x10'))[_0x40b3('0x11')](socket);var jayson=require(_0x40b3('0x12'));var client=jayson[_0x40b3('0x13')][_0x40b3('0x14')]({'port':0x232b});var client9004=jayson[_0x40b3('0x13')][_0x40b3('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x50a58d,_0x1eeaff,_0x1d0d40,_0x1e6787){return new BPromise(function(_0x5eb3e5,_0x5cacf4){var _0x56b07c=_0x1e6787||client;return _0x56b07c[_0x40b3('0x15')](_0x50a58d,_0x1d0d40)[_0x40b3('0x16')](function(_0x172372){logger['info'](_0x40b3('0x17'),_0x1eeaff,_0x40b3('0x18'));logger[_0x40b3('0x19')](_0x40b3('0x1a'),_0x1eeaff,'request\x20sent',JSON['stringify'](_0x172372));if(_0x172372[_0x40b3('0x1b')]){if(_0x172372['error'][_0x40b3('0x1c')]===0x1f4){logger['error'](_0x40b3('0x17'),_0x1eeaff,_0x172372['error'][_0x40b3('0x1d')]);return _0x5cacf4(_0x172372[_0x40b3('0x1b')][_0x40b3('0x1d')]);}logger['error'](_0x40b3('0x17'),_0x1eeaff,_0x172372[_0x40b3('0x1b')]['message']);return _0x5eb3e5(_0x172372[_0x40b3('0x1b')][_0x40b3('0x1d')]);}else{logger[_0x40b3('0x1e')]('ChatInteraction,\x20%s,\x20%s',_0x1eeaff,_0x40b3('0x18'));_0x5eb3e5(_0x172372['result'][_0x40b3('0x1d')]);}})['catch'](function(_0x5c923a){logger[_0x40b3('0x1b')](_0x40b3('0x17'),_0x1eeaff,_0x5c923a);_0x5cacf4(_0x5c923a);});});}function respondWithStatusCode(_0x42900c,_0x4695ed){_0x4695ed=_0x4695ed||0xcc;return function(_0x1f8452){if(_0x1f8452){return _0x42900c['sendStatus'](_0x4695ed);}return _0x42900c[_0x40b3('0x1f')](_0x4695ed)[_0x40b3('0x20')]();};}function respondWithResult(_0x4e70e4,_0x56214f){_0x56214f=_0x56214f||0xc8;return function(_0x2b8031){if(_0x2b8031){return _0x4e70e4[_0x40b3('0x1f')](_0x56214f)[_0x40b3('0x21')](_0x2b8031);}};}function respondWithFilteredResult(_0xbd3383,_0x2188f4){return function(_0x1c06f5){if(_0x1c06f5){var _0x3b0c50=typeof _0x2188f4[_0x40b3('0x22')]==='undefined'&&typeof _0x2188f4['limit']===_0x40b3('0x23');var _0x1c78b2=_0x1c06f5['count'];var _0x526244=_0x3b0c50?0x0:_0x2188f4['offset'];var _0x45930d=_0x3b0c50?_0x1c06f5[_0x40b3('0x24')]:_0x2188f4[_0x40b3('0x22')]+_0x2188f4[_0x40b3('0x25')];var _0x48220a;if(_0x45930d>=_0x1c78b2){_0x45930d=_0x1c78b2;_0x48220a=0xc8;}else{_0x48220a=0xce;}_0xbd3383[_0x40b3('0x1f')](_0x48220a);return _0xbd3383[_0x40b3('0x26')](_0x40b3('0x27'),_0x526244+'-'+_0x45930d+'/'+_0x1c78b2)[_0x40b3('0x21')](_0x1c06f5);}return null;};}function saveUpdates(_0x5054a9){return function(_0x14a84c){if(_0x14a84c){return _0x14a84c['update'](_0x5054a9)[_0x40b3('0x16')](function(_0x476a16){return _0x476a16;});}return null;};}function removeEntity(_0x36c93a){return function(_0x5a1dc1){if(_0x5a1dc1){return _0x5a1dc1[_0x40b3('0x28')]()['then'](function(){_0x36c93a[_0x40b3('0x1f')](0xcc)[_0x40b3('0x20')]();});}};}function handleEntityNotFound(_0x331077){return function(_0x39b520){if(!_0x39b520){_0x331077[_0x40b3('0x29')](0x194);}return _0x39b520;};}function handleError(_0x3c0fbe,_0x145a4e){_0x145a4e=_0x145a4e||0x1f4;return function(_0x1ba425){logger[_0x40b3('0x1b')](_0x1ba425['stack']);if(_0x1ba425[_0x40b3('0x2a')]){delete _0x1ba425['name'];}_0x3c0fbe[_0x40b3('0x1f')](_0x145a4e)['send'](_0x1ba425);};}function getMustacheRender(_0x4c7479,_0xf445f1){return Mustache[_0x40b3('0x2b')](_0x4c7479,_[_0x40b3('0x2c')](_0xf445f1[_0x40b3('0x2d')],{'contact':_0xf445f1['contact'],'message':_0xf445f1['message'],'agent':_0xf445f1['agent'],'interaction':_0xf445f1[_0x40b3('0x2e')],'account':_0xf445f1[_0x40b3('0x2f')]}))||'';}exports[_0x40b3('0x30')]=function(_0x480f1b,_0x4fed73){var _0x2988cf={};var _0xc9a300=_[_0x40b3('0x31')](db[_0x40b3('0x32')][_0x40b3('0x33')],function(_0xb68b38){return{'name':_0xb68b38['fieldName'],'type':_0xb68b38['type'][_0x40b3('0x34')]};});_0x2988cf=qs['getOptions'](_0xc9a300,_0x480f1b);return interaction[_0x40b3('0x35')]('chat',_0x480f1b[_0x40b3('0x36')],_0x480f1b[_0x40b3('0x37')],_0x2988cf,_0xc9a300)[_0x40b3('0x16')](respondWithFilteredResult(_0x4fed73,_0x2988cf))['catch'](handleError(_0x4fed73,null));};exports['show']=function(_0x4c89ba,_0x320b19){var _0x405501={'raw':![],'where':{'id':_0x4c89ba[_0x40b3('0x38')]['id']}},_0x558176={};_0x558176[_0x40b3('0x39')]=_[_0x40b3('0x3a')](db[_0x40b3('0x32')][_0x40b3('0x33')]);_0x558176['query']=_['keys'](_0x4c89ba[_0x40b3('0x36')]);_0x558176[_0x40b3('0x3b')]=_['intersection'](_0x558176[_0x40b3('0x39')],_0x558176[_0x40b3('0x36')]);_0x405501[_0x40b3('0x3c')]=_[_0x40b3('0x3d')](_0x558176[_0x40b3('0x39')],qs[_0x40b3('0x3e')](_0x4c89ba[_0x40b3('0x36')][_0x40b3('0x3e')]));_0x405501[_0x40b3('0x3c')]=_0x405501[_0x40b3('0x3c')]['length']?_0x405501['attributes']:_0x558176['model'];if(_0x4c89ba['query']['includeAll']){_0x405501[_0x40b3('0x3f')]=[{'all':!![]}];}_0x405501=_['merge']({},_0x405501,_0x4c89ba[_0x40b3('0x40')]);return db[_0x40b3('0x32')]['find'](_0x405501)[_0x40b3('0x16')](handleEntityNotFound(_0x320b19,null))['then'](respondWithResult(_0x320b19,null))[_0x40b3('0x41')](handleError(_0x320b19,null));};exports[_0x40b3('0x42')]=function(_0x592edc,_0xbe7cc5){return db['ChatInteraction'][_0x40b3('0x42')](_0x592edc[_0x40b3('0x2d')],{})[_0x40b3('0x16')](respondWithResult(_0xbe7cc5,0xc9))[_0x40b3('0x41')](handleError(_0xbe7cc5,null));};exports[_0x40b3('0x43')]=function(_0x2092a4,_0x2d3ef2){if(_0x2092a4[_0x40b3('0x2d')]['id']){delete _0x2092a4['body']['id'];}return db[_0x40b3('0x32')][_0x40b3('0x44')]({'where':{'id':_0x2092a4[_0x40b3('0x38')]['id']}})['then'](handleEntityNotFound(_0x2d3ef2,null))[_0x40b3('0x16')](saveUpdates(_0x2092a4[_0x40b3('0x2d')],null))['then'](respondWithResult(_0x2d3ef2,null))[_0x40b3('0x41')](handleError(_0x2d3ef2,null));};exports[_0x40b3('0x28')]=function(_0x311a66,_0x2878b8){return db[_0x40b3('0x32')][_0x40b3('0x44')]({'where':{'id':_0x311a66[_0x40b3('0x38')]['id']}})['then'](handleEntityNotFound(_0x2878b8,null))[_0x40b3('0x16')](removeEntity(_0x2878b8,null))['catch'](handleError(_0x2878b8,null));};exports['describe']=function(_0x448ffd,_0x3dea1b){return db['ChatInteraction'][_0x40b3('0x45')]()[_0x40b3('0x16')](respondWithResult(_0x3dea1b,null))[_0x40b3('0x41')](handleError(_0x3dea1b,null));};exports[_0x40b3('0x46')]=function(_0x53f9ac,_0x10ddfa){var _0x163099=_0x53f9ac[_0x40b3('0x38')]['id'];var _0x59dd70;var _0x350c03;var _0x19b9e4;return db[_0x40b3('0x32')]['findOne']({'where':{'id':_0x163099}})[_0x40b3('0x16')](function(_0x31324b){_0x59dd70=_0x31324b;return db[_0x40b3('0x47')][_0x40b3('0x48')]({'where':{'id':_0x31324b[_0x40b3('0x49')]},'attributes':['id',_0x40b3('0x4a'),'vidaooEscalation',_0x40b3('0x4b'),_0x40b3('0x4c'),_0x40b3('0x4d')],'raw':!![]});})['then'](function(_0x18d11f){if(_0x18d11f&&_0x18d11f[_0x40b3('0x4a')]&&_0x18d11f[_0x40b3('0x4e')]){_0x350c03=_0x18d11f;var _0xd247e2={'interaction':{'id':_0x163099},'agent':{'id':_0x53f9ac['user']['id'],'name':_0x53f9ac['user'][_0x40b3('0x2a')],'fullname':_0x53f9ac[_0x40b3('0x37')][_0x40b3('0x4f')],'email':_0x53f9ac[_0x40b3('0x37')][_0x40b3('0x50')]},'contact':_0x53f9ac['body'][_0x40b3('0x51')],'account':_0x53f9ac['body'][_0x40b3('0x2f')]};var _0x12a469={'rejectUnauthorized':![],'method':_0x40b3('0x52'),'url':_0x40b3('0x53'),'headers':{'X-APIKEY':_0x18d11f[_0x40b3('0x4a')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x53f9ac[_0x40b3('0x37')][_0x40b3('0x50')]],'buttons':null,'topic':_0x350c03[_0x40b3('0x4b')],'note':_[_0x40b3('0x54')](_0x350c03[_0x40b3('0x4c')])?null:getMustacheRender(_0x350c03[_0x40b3('0x4c')],_0xd247e2),'metadata':null},'redirect':_0x40b3('0x55'),'json':!![]};try{if(!_[_0x40b3('0x54')](_0x350c03[_0x40b3('0x4d')])){var _0x5c9cdf=getMustacheRender(_0x350c03[_0x40b3('0x4d')],_0xd247e2);var _0x10d839=JSON[_0x40b3('0x56')](_0x5c9cdf);_0x12a469[_0x40b3('0x2d')]['metadata']=_0x10d839;}}catch(_0x5d2d80){throw new db[(_0x40b3('0x57'))][(_0x40b3('0x58'))](_0x40b3('0x59'));}return rp(_0x12a469);}else{throw new db[(_0x40b3('0x57'))][(_0x40b3('0x58'))](_0x40b3('0x5a'));}})[_0x40b3('0x16')](function(_0x253b87){_0x19b9e4=_0x253b87;if(_0x19b9e4['id']){var _0x4a35df={'body':_0x19b9e4[_0x40b3('0x5b')],'ChatWebsiteId':_0x350c03['id'],'ChatInteractionId':_0x59dd70['id'],'direction':_0x40b3('0x5c'),'UserId':_0x53f9ac[_0x40b3('0x37')]['id']};return db[_0x40b3('0x5d')][_0x40b3('0x42')](_0x4a35df,{});}else{throw new db[(_0x40b3('0x57'))][(_0x40b3('0x58'))](_0x40b3('0x5e'));}})['then'](function(){return _0x59dd70[_0x40b3('0x5f')]({'vidaooSessionId':_0x19b9e4['id']});})[_0x40b3('0x16')](respondWithResult(_0x10ddfa,null))[_0x40b3('0x41')](handleError(_0x10ddfa,null));};exports['customUpdate']=function(_0x4ce669,_0x57ed37){if(_0x4ce669[_0x40b3('0x2d')]['id']){delete _0x4ce669[_0x40b3('0x2d')]['id'];}return db[_0x40b3('0x32')][_0x40b3('0x44')]({'where':{'id':_0x4ce669[_0x40b3('0x38')]['id']},'include':[{'model':db['CmContact'],'as':_0x40b3('0x60')}]})[_0x40b3('0x16')](handleEntityNotFound(_0x57ed37,null))[_0x40b3('0x16')](saveUpdates(_0x4ce669[_0x40b3('0x2d')],null))[_0x40b3('0x16')](respondWithResult(_0x57ed37,null))[_0x40b3('0x41')](handleError(_0x57ed37,null));};exports[_0x40b3('0x61')]=function(_0x56c3bc,_0x1e42aa){if(_0x56c3bc[_0x40b3('0x2d')]['id']){delete _0x56c3bc[_0x40b3('0x2d')]['id'];}return db[_0x40b3('0x32')][_0x40b3('0x44')]({'where':{'id':_0x56c3bc[_0x40b3('0x38')]['id']}})[_0x40b3('0x16')](function(_0x5acd9a){if(!_0x5acd9a){logger['error'](_0x40b3('0x62'),_0x40b3('0x61'),0x194,_0x40b3('0x63'));_0x1e42aa[_0x40b3('0x29')](0x194);}else{if(_0x5acd9a[_0x40b3('0x64')]){throw new db[(_0x40b3('0x57'))][(_0x40b3('0x58'))](_0x40b3('0x65'));}}return _0x5acd9a;})['then'](function(_0x4d369f){if(_0x4d369f){return _0x4d369f['update']({'closed':_0x56c3bc[_0x40b3('0x2d')][_0x40b3('0x66')],'disposition':_0x56c3bc[_0x40b3('0x2d')]['disposition']})[_0x40b3('0x16')](function(_0x3603c0){return _0x3603c0;});}})[_0x40b3('0x16')](function(){return respondWithRpcPromise('AbandonInteraction',_0x40b3('0x61'),_0x56c3bc[_0x40b3('0x2d')],client9004);})[_0x40b3('0x16')](respondWithResult(_0x1e42aa,null))[_0x40b3('0x41')](handleError(_0x1e42aa,null));};exports[_0x40b3('0x67')]=function(_0x2165ba,_0x176ed1){_0x2165ba[_0x40b3('0x2d')][_0x40b3('0x2a')]=_0x2165ba[_0x40b3('0x68')][_0x40b3('0x69')];_0x2165ba[_0x40b3('0x2d')][_0x40b3('0x6a')]=_0x2165ba[_0x40b3('0x68')][_0x40b3('0x6b')];_0x2165ba[_0x40b3('0x2d')][_0x40b3('0x6c')]=_0x2165ba[_0x40b3('0x68')][_0x40b3('0x6d')];return db[_0x40b3('0x6e')][_0x40b3('0x42')](_0x2165ba[_0x40b3('0x2d')])[_0x40b3('0x16')](respondWithResult(_0x176ed1,0xc9))['catch'](handleError(_0x176ed1,null));};exports[_0x40b3('0x6f')]=function(_0x5bbb20,_0x348e41){return db[_0x40b3('0x32')]['findOne']({'where':{'id':_0x5bbb20[_0x40b3('0x38')]['id']},'raw':!![]})[_0x40b3('0x16')](handleEntityNotFound(_0x348e41,null))[_0x40b3('0x16')](function(_0x1eb24c){if(_0x1eb24c){if(_0x1eb24c[_0x40b3('0x66')]){return _0x348e41[_0x40b3('0x1f')](0x193)['json']({'status':0x193,'message':_0x40b3('0x70')});}return db[_0x40b3('0x6e')][_0x40b3('0x48')]({'where':{'id':_0x5bbb20[_0x40b3('0x36')][_0x40b3('0x71')]},'raw':!![]})['then'](handleEntityNotFound(_0x348e41,null));}})[_0x40b3('0x16')](function(_0x304bee){if(_0x304bee){var _0x188695=_0x304bee[_0x40b3('0x72')]!==null;var _0x28da93=path[_0x40b3('0x73')](config[_0x40b3('0x74')],_0x40b3('0x75'));if(_0x188695){_0x28da93=path[_0x40b3('0x73')](_0x28da93,_0x40b3('0x76'));}var _0x2727ef=path[_0x40b3('0x73')](_0x28da93,_0x304bee['basename']);return _0x348e41['download'](_0x2727ef);}})[_0x40b3('0x41')](handleError(_0x348e41,null));};exports[_0x40b3('0x77')]=function(_0x3f7806,_0x55542c){var _0x595ed9=null;var _0x4d8345=null;var _0x30135b=null;if(_0x3f7806[_0x40b3('0x2d')]['id']){delete _0x3f7806['body']['id'];}if(_0x3f7806[_0x40b3('0x2d')][_0x40b3('0x78')]){_0x30135b=path[_0x40b3('0x73')](config['root'],_0x40b3('0x79'),util[_0x40b3('0x7a')](_0x40b3('0x7b'),Date[_0x40b3('0x7c')]()));_0x3f7806[_0x40b3('0x2d')]['pathTranscript']=_0x30135b;}return db[_0x40b3('0x32')][_0x40b3('0x44')]({'where':{'id':_0x3f7806[_0x40b3('0x38')]['id']},'include':[{'model':db[_0x40b3('0x5d')],'as':_0x40b3('0x7d'),'include':[{'model':db[_0x40b3('0x7e')],'as':'User'}]}]})[_0x40b3('0x16')](handleEntityNotFound(_0x55542c,null))[_0x40b3('0x16')](saveUpdates(_0x3f7806['body'],null))['then'](function(_0x39f600){if(_0x39f600){_0x595ed9=_0x39f600;return db[_0x40b3('0x47')][_0x40b3('0x44')]({'where':{'id':_0x595ed9[_0x40b3('0x49')]}});}})['then'](function(_0xac3d4){if(_0xac3d4){_0x4d8345=_0xac3d4;return db[_0x40b3('0x7f')]['find']({'where':{'id':_0x595ed9['ContactId']}});}})[_0x40b3('0x16')](function(_0x3d9b80){if(_0x3d9b80){if(_0x30135b){var _0x87e2c4=null;for(var _0x221542=0x1;_0x221542<_0x595ed9[_0x40b3('0x7d')][_0x40b3('0x80')];++_0x221542){_0x87e2c4=_0x595ed9['Messages'][_0x221542];var _0x2219f8=_0x87e2c4[_0x40b3('0x64')]?util[_0x40b3('0x7a')]('%s%d',_0x4d8345['agentAlias'],_0x87e2c4['UserId']):_0x40b3('0x81');var _0x3caaae=_0x3f7806[_0x40b3('0x2d')][_0x40b3('0x82')]||util[_0x40b3('0x7a')]('%s%d',_0x40b3('0x83'),_0x87e2c4[_0x40b3('0x84')]);switch(_0x4d8345[_0x40b3('0x85')]){case _0x40b3('0x86'):_0x2219f8=_0x87e2c4['UserId']?util[_0x40b3('0x7a')](_0x40b3('0x87'),_0x4d8345[_0x40b3('0x88')],_0x87e2c4[_0x40b3('0x64')]):_0x40b3('0x81');break;case _0x40b3('0x89'):_0x2219f8=_0x87e2c4[_0x40b3('0x64')]?_0x87e2c4[_0x40b3('0x7e')][_0x40b3('0x8a')]||_0x87e2c4[_0x40b3('0x7e')]['fullname']:_0x40b3('0x81');break;case'agent_fullname':_0x2219f8=_0x87e2c4[_0x40b3('0x64')]?_0x87e2c4[_0x40b3('0x7e')][_0x40b3('0x4f')]:_0x40b3('0x81');break;default:_0x2219f8=_0x87e2c4[_0x40b3('0x64')]?util['format'](_0x40b3('0x87'),_0x4d8345[_0x40b3('0x88')],_0x87e2c4['UserId']):_0x40b3('0x81');}var _0x5c06b9=util['format'](_0x40b3('0x8b'),moment(_0x87e2c4[_0x40b3('0x8c')])[_0x40b3('0x7a')](_0x40b3('0x8d')),_0x87e2c4[_0x40b3('0x8e')]==='in'?_0x3caaae:_0x2219f8,_0x87e2c4[_0x40b3('0x2d')]);if(!_0x87e2c4[_0x40b3('0x8f')]){fs[_0x40b3('0x90')](_0x30135b,_0x5c06b9);}}return db[_0x40b3('0x91')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x40b3('0x92')],'as':_0x40b3('0x93'),'raw':!![],'include':[{'model':db[_0x40b3('0x94')],'as':_0x40b3('0x94'),'raw':!![]}]}]});}}})[_0x40b3('0x16')](function(_0x688c8e){if(!_0x688c8e||!_0x688c8e[_0x40b3('0x93')]||!_0x3f7806[_0x40b3('0x2d')])return _0x595ed9;var _0x22a39d=_0x688c8e[_0x40b3('0x95')]();return respondWithRpcPromise(_0x40b3('0x96'),_0x40b3('0x97'),{'account':_0x22a39d,'message':{'from':util[_0x40b3('0x7a')](_0x40b3('0x98'),_0x688c8e[_0x40b3('0x2a')],_0x688c8e[_0x40b3('0x50')]||_0x688c8e[_0x40b3('0x93')][_0x40b3('0x37')]),'to':_0x3f7806[_0x40b3('0x2d')][_0x40b3('0x78')],'subject':_0x40b3('0x99'),'text':util['format'](_0x40b3('0x9a'),_0x3f7806['body'][_0x40b3('0x78')]),'attachments':[{'path':_0x30135b}]}})[_0x40b3('0x16')](function(){return _0x595ed9;})[_0x40b3('0x41')](function(_0x562aee){logger[_0x40b3('0x1b')](_0x562aee);});})[_0x40b3('0x16')](respondWithStatusCode(_0x55542c,0xc8))[_0x40b3('0x41')](handleError(_0x55542c,null));};exports[_0x40b3('0x9b')]=function(_0x5297fb,_0x3ba0e8){return db[_0x40b3('0x5d')][_0x40b3('0x44')]({'where':{'id':_0x5297fb[_0x40b3('0x38')]['id']}})[_0x40b3('0x16')](handleEntityNotFound(_0x3ba0e8,null))[_0x40b3('0x16')](function(_0x25b077){if(_0x25b077){return _0x25b077[_0x40b3('0x9b')](_0x5297fb[_0x40b3('0x2d')][_0x40b3('0x9c')],_[_0x40b3('0x9d')](_0x5297fb[_0x40b3('0x2d')],['ids','id'])||{});}})[_0x40b3('0x16')](respondWithResult(_0x3ba0e8,null))['catch'](handleError(_0x3ba0e8,null));};exports['getMessages']=function(_0x4588b9,_0x2ff308){var _0xe352ee={'raw':![],'where':{}};var _0x3e39b6={};var _0x1266ab={'count':0x0,'rows':[]};return db[_0x40b3('0x32')][_0x40b3('0x48')]({'where':{'id':_0x4588b9[_0x40b3('0x38')]['id']}})[_0x40b3('0x16')](handleEntityNotFound(_0x2ff308,null))[_0x40b3('0x16')](function(_0x402fab){if(_0x402fab){_0x3e39b6['model']=_['keys'](db[_0x40b3('0x5d')][_0x40b3('0x33')]);_0x3e39b6[_0x40b3('0x36')]=_[_0x40b3('0x3a')](_0x4588b9['query']);_0x3e39b6[_0x40b3('0x3b')]=_[_0x40b3('0x3d')](_0x3e39b6[_0x40b3('0x39')],_0x3e39b6[_0x40b3('0x36')]);_0xe352ee[_0x40b3('0x3c')]=_[_0x40b3('0x3d')](_0x3e39b6['model'],qs['fields'](_0x4588b9['query'][_0x40b3('0x3e')]));_0xe352ee[_0x40b3('0x3c')]=_0xe352ee[_0x40b3('0x3c')][_0x40b3('0x80')]?_0xe352ee[_0x40b3('0x3c')]:_0x3e39b6[_0x40b3('0x39')];if(!_0x4588b9[_0x40b3('0x36')][_0x40b3('0x9e')](_0x40b3('0x9f'))){_0xe352ee['limit']=qs[_0x40b3('0x25')](_0x4588b9['query'][_0x40b3('0x25')]);_0xe352ee[_0x40b3('0x22')]=qs[_0x40b3('0x22')](_0x4588b9[_0x40b3('0x36')][_0x40b3('0x22')]);}_0xe352ee[_0x40b3('0xa0')]=qs[_0x40b3('0xa1')](_0x4588b9[_0x40b3('0x36')]['sort']);_0xe352ee[_0x40b3('0xa2')]=qs[_0x40b3('0x3b')](_['pick'](_0x4588b9[_0x40b3('0x36')],_0x3e39b6['filters']));_0xe352ee['where'][_0x40b3('0xa3')]=_0x402fab['id'];if(_0x4588b9[_0x40b3('0x36')][_0x40b3('0xa4')]){_0xe352ee['where']=_[_0x40b3('0x2c')](_0xe352ee[_0x40b3('0xa2')],{'$or':_[_0x40b3('0x31')](_0xe352ee[_0x40b3('0x3c')],function(_0x29110a){var _0x368f39={};_0x368f39[_0x29110a]={'$like':'%'+_0x4588b9[_0x40b3('0x36')][_0x40b3('0xa4')]+'%'};return _0x368f39;})});}if(_0x4588b9[_0x40b3('0x36')][_0x40b3('0xa5')]){var _0x48ff1e=_0x4588b9[_0x40b3('0x36')][_0x40b3('0xa5')]['split'](',');var _0x373597={};_0x373597[_0x48ff1e[0x0]]={'$gte':moment(_0x48ff1e[0x1])['format'](_0x40b3('0xa6'))};_0xe352ee['where']=_[_0x40b3('0x2c')](_0xe352ee[_0x40b3('0xa2')],_0x373597);}_0xe352ee=_[_0x40b3('0x2c')]({},_0xe352ee,_0x4588b9[_0x40b3('0x40')]);return db[_0x40b3('0x5d')][_0x40b3('0x24')]({'where':_0xe352ee[_0x40b3('0xa2')]})['then'](function(_0x498875){_0x1266ab[_0x40b3('0x24')]=_0x498875;if(_0x4588b9[_0x40b3('0x36')][_0x40b3('0xa7')]){_0xe352ee[_0x40b3('0x3f')]=[{'all':!![]}];}return db[_0x40b3('0x5d')][_0x40b3('0x35')](_0xe352ee);})[_0x40b3('0x16')](function(_0x4f74c2){_0x1266ab[_0x40b3('0xa8')]=_0x4f74c2;return _0x1266ab;});}})[_0x40b3('0x16')](respondWithFilteredResult(_0x2ff308,_0xe352ee))[_0x40b3('0x41')](handleError(_0x2ff308,null));};exports[_0x40b3('0xa9')]=function(_0x1ab372,_0x54cccc){var _0x441595={'where':{}},_0x42d830={},_0x2943c5={'count':0x0,'rows':[]};return db[_0x40b3('0x32')]['findOne']({'where':{'id':_0x1ab372['params']['id']}})[_0x40b3('0x16')](handleEntityNotFound(_0x54cccc,null))['then'](function(_0x478010){if(_0x478010){_0x42d830['model']=_[_0x40b3('0x3a')](db[_0x40b3('0x5d')]['rawAttributes']);_0x42d830[_0x40b3('0x36')]=_[_0x40b3('0x3a')](_0x1ab372[_0x40b3('0x36')]);_0x42d830[_0x40b3('0x3b')]=_['intersection'](_0x42d830[_0x40b3('0x39')],_0x42d830[_0x40b3('0x36')]);_0x441595[_0x40b3('0x3c')]=_[_0x40b3('0x3d')](_0x42d830[_0x40b3('0x39')],qs[_0x40b3('0x3e')](_0x1ab372[_0x40b3('0x36')]['fields']));_0x441595[_0x40b3('0x3c')]=_0x441595[_0x40b3('0x3c')][_0x40b3('0x80')]?_0x441595['attributes']:_0x42d830[_0x40b3('0x39')];if(!_0x1ab372[_0x40b3('0x36')]['hasOwnProperty'](_0x40b3('0x9f'))){_0x441595['limit']=qs[_0x40b3('0x25')](_0x1ab372[_0x40b3('0x36')][_0x40b3('0x25')]);_0x441595[_0x40b3('0x22')]=qs[_0x40b3('0x22')](_0x1ab372[_0x40b3('0x36')]['offset']);}_0x441595[_0x40b3('0xa0')]=qs[_0x40b3('0xa1')](_0x1ab372[_0x40b3('0x36')][_0x40b3('0xa1')]);_0x441595['where']=qs[_0x40b3('0x3b')](_[_0x40b3('0xaa')](_0x1ab372[_0x40b3('0x36')],_0x42d830[_0x40b3('0x3b')]));_0x441595[_0x40b3('0xa2')][_0x40b3('0xa3')]=_0x478010['id'];if(_0x1ab372[_0x40b3('0x36')][_0x40b3('0xa4')]){_0x441595['where']=_[_0x40b3('0x2c')](_0x441595[_0x40b3('0xa2')],{'$or':_['map'](_0x441595[_0x40b3('0x3c')],function(_0x2cc37b){var _0x9cfd7a={};_0x9cfd7a[_0x2cc37b]={'$like':'%'+_0x1ab372[_0x40b3('0x36')][_0x40b3('0xa4')]+'%'};return _0x9cfd7a;})});}_0x441595[_0x40b3('0xa2')][_0x40b3('0x8f')]=![];if(_0x1ab372[_0x40b3('0x36')]['id']){_0x441595['where']['id']={'$gt':_0x1ab372[_0x40b3('0x36')]['id']};}_0x441595=_['merge']({},_0x441595,_0x1ab372['options']);return db[_0x40b3('0x5d')][_0x40b3('0x24')]({'where':_0x441595[_0x40b3('0xa2')]})[_0x40b3('0x16')](function(_0x5e596a){_0x2943c5[_0x40b3('0x24')]=_0x5e596a;_0x441595[_0x40b3('0x3f')]=[];if(_0x1ab372[_0x40b3('0x36')][_0x40b3('0xab')]){_0x441595['include'][_0x40b3('0xac')]({'model':db['User'],'as':_0x40b3('0x7e'),'attributes':['id',_0x40b3('0x4f'),_0x40b3('0x8a')]});}if(_0x1ab372['query'][_0x40b3('0xa7')]){_0x441595['include']=[{'all':!![]}];}return db[_0x40b3('0x5d')][_0x40b3('0x35')](_0x441595);})[_0x40b3('0x16')](function(_0x12cea8){_0x2943c5[_0x40b3('0xa8')]=_0x12cea8;return _0x2943c5;});}})['then'](respondWithFilteredResult(_0x54cccc,_0x441595))['catch'](handleError(_0x54cccc,null));};exports['addTags']=function(_0x15941d,_0x235829){return db[_0x40b3('0x32')][_0x40b3('0x44')]({'where':{'id':_0x15941d[_0x40b3('0x38')]['id']}})['then'](handleEntityNotFound(_0x235829,null))[_0x40b3('0x16')](function(_0x1e7b59){if(_0x1e7b59){return _0x1e7b59[_0x40b3('0xad')](_0x15941d[_0x40b3('0x2d')][_0x40b3('0x9c')],_[_0x40b3('0x9d')](_0x15941d['body'],[_0x40b3('0x9c'),'id'])||{})[_0x40b3('0xae')](function(){return db[_0x40b3('0xaf')][_0x40b3('0x35')]({'attributes':['id','name',_0x40b3('0xb0')],'where':{'id':_0x15941d[_0x40b3('0x2d')][_0x40b3('0x9c')]}});})[_0x40b3('0x16')](function(_0x18832d){socket[_0x40b3('0xb1')](_0x40b3('0xb2'),{'id':Number(_0x15941d[_0x40b3('0x38')]['id']),'tags':_0x18832d||[]});return{'id':Number(_0x15941d[_0x40b3('0x38')]['id']),'tags':_0x18832d||[]};});}})[_0x40b3('0x16')](respondWithResult(_0x235829,null))[_0x40b3('0x41')](handleError(_0x235829,null));};exports[_0x40b3('0xb3')]=function(_0x3ee907,_0xcdff5d){return db[_0x40b3('0x32')][_0x40b3('0x44')]({'where':{'id':_0x3ee907[_0x40b3('0x38')]['id']}})[_0x40b3('0x16')](handleEntityNotFound(_0xcdff5d,null))['then'](function(_0x59d69f){if(_0x59d69f){return _0x59d69f[_0x40b3('0xb3')](_0x3ee907['query']['ids']);}})['then'](respondWithStatusCode(_0xcdff5d,null))[_0x40b3('0x41')](handleError(_0xcdff5d,null));};exports[_0x40b3('0xb4')]=function(_0x529d67,_0x3fa8b9){var _0x311267=moment()['unix']()[_0x40b3('0xb5')]();var _0x49b485=path[_0x40b3('0x73')](config['root'],_0x40b3('0xb6'),_0x40b3('0xb7'),_0x40b3('0xb8'));var _0x4850de=path[_0x40b3('0x73')](config[_0x40b3('0x74')],_0x40b3('0xb6'),_0x40b3('0xb7'),'attachments');var _0x345353=path[_0x40b3('0x73')](_0x49b485,_0x311267);var _0x5d3718=util[_0x40b3('0x7a')](_0x40b3('0xb9'),_0x529d67['params']['id'],_0x311267);var _0xaa6c5b=path[_0x40b3('0x73')](_0x49b485,_0x5d3718);var _0x5d0979=[];_0x5d0979[_0x40b3('0xac')]({'model':db['User'],'as':_0x40b3('0x7e'),'attributes':['id',_0x40b3('0x4f')],'raw':!![]});_0x5d0979[_0x40b3('0xac')]({'model':db[_0x40b3('0x7f')],'as':_0x40b3('0x60'),'attributes':['id','firstName',_0x40b3('0xba')],'raw':!![]});if(_0x529d67[_0x40b3('0x36')][_0x40b3('0xbb')]){_0x5d0979[_0x40b3('0xac')]({'model':db[_0x40b3('0x6e')],'as':_0x40b3('0x6e'),'raw':!![]});}var _0x6ebd80=[{'model':db['ChatMessage'],'as':'Messages','attributes':['id','body',_0x40b3('0x8c'),_0x40b3('0x8e'),_0x40b3('0x8f'),_0x40b3('0xbc')],'include':_0x5d0979}];_0x6ebd80[_0x40b3('0xac')]({'model':db[_0x40b3('0x47')],'as':_0x40b3('0xbd'),'attributes':['id',_0x40b3('0x2a')]});_0x6ebd80[_0x40b3('0xac')]({'model':db['User'],'as':_0x40b3('0xbe'),'attributes':['id',_0x40b3('0x4f')]});return db['ChatInteraction'][_0x40b3('0x44')]({'where':{'id':_0x529d67[_0x40b3('0x38')]['id']},'include':_0x6ebd80})[_0x40b3('0x16')](handleEntityNotFound(_0x3fa8b9,null))[_0x40b3('0x16')](function(_0x55a7f1){if(_0x55a7f1){var _0x147405=_0x55a7f1[_0x40b3('0xbf')]({'plain':!![]});fs[_0x40b3('0xc0')](_0x345353);var _0x53d1dd={'channel':'Chat','account':_0x147405['Account'][_0x40b3('0x2a')],'agent':_0x147405[_0x40b3('0xbe')]?_0x147405[_0x40b3('0xbe')]['fullname']:_0x40b3('0xc1'),'createdAt':moment(_0x147405[_0x40b3('0x8c')])['format'](_0x40b3('0xa6'))['toString'](),'closedAt':_0x147405[_0x40b3('0x66')]?moment(_0x147405[_0x40b3('0xc2')])[_0x40b3('0x7a')]('YYYY-MM-DD\x20HH:mm:ss')[_0x40b3('0xb5')]():'','disposition':_0x147405[_0x40b3('0xc3')],'chatInfo':{'browser':_0x147405['browserName'],'os':_0x147405['osName'],'referer':_0x147405['referer'],'customerIp':_0x147405[_0x40b3('0xc4')],'customerPort':_0x147405[_0x40b3('0xc5')]?_0x147405[_0x40b3('0xc5')]:_0x40b3('0xc1')},'messages':_(_0x147405[_0x40b3('0x7d')])['tail']()[_0x40b3('0xa4')]({'secret':![]})[_0x40b3('0x31')](function(_0x43c7a6){if(_0x43c7a6['Attachment']){var _0x175581=path['join'](_0x4850de,_0x43c7a6[_0x40b3('0x6e')][_0x40b3('0x6a')]);if(fs[_0x40b3('0xc6')](_0x175581)){fs[_0x40b3('0xc7')](_0x175581)[_0x40b3('0xc8')](fs[_0x40b3('0xc9')](path[_0x40b3('0x73')](_0x345353,_0x43c7a6[_0x40b3('0x6e')][_0x40b3('0x6a')])));}}return{'date':moment(_0x43c7a6[_0x40b3('0x8c')])[_0x40b3('0x7a')]('YYYY-MM-DD\x20HH:mm:ss')[_0x40b3('0xb5')](),'sender':_0x43c7a6[_0x40b3('0x8e')]==='out'?_0x43c7a6[_0x40b3('0x7e')]?_0x43c7a6[_0x40b3('0x7e')][_0x40b3('0x4f')]:_0x40b3('0x81'):_0x43c7a6[_0x40b3('0x60')][_0x40b3('0xca')]+(_0x43c7a6[_0x40b3('0x60')][_0x40b3('0xba')]?'\x20'+_0x43c7a6[_0x40b3('0x60')][_0x40b3('0xba')]:''),'body':_0x43c7a6[_0x40b3('0x6e')]?_0x43c7a6[_0x40b3('0x6e')][_0x40b3('0x6a')]:_0x43c7a6[_0x40b3('0x2d')],'direction':_0x43c7a6['direction']===_0x40b3('0x5c')?'A':'C','secret':_0x43c7a6[_0x40b3('0x8f')],'read':_0x43c7a6[_0x40b3('0xbc')],'attachment':_0x43c7a6['Attachment']};})['value']()};return ejs[_0x40b3('0xcb')](path[_0x40b3('0x73')](config[_0x40b3('0x74')],_0x40b3('0xb6'),'views',_0x40b3('0xcc')),{'interaction':_0x53d1dd})[_0x40b3('0x16')](function(_0x405902){var _0x328a65=path[_0x40b3('0x73')](_0x345353,_0x40b3('0xcd')+_0x147405['id']+'-'+_0x311267+_0x40b3('0xce'));var _0xa9a7fa={'path':_0x328a65,'channel':_0x40b3('0xcf'),'interactionId':_0x147405['id']};return pdf[_0x40b3('0xd0')](_0x405902,_0xa9a7fa);})['then'](function(){return new Promise(function(_0x2df45d,_0x1f8ec8){zipdir(_0x345353,{'saveTo':_0xaa6c5b},function(_0x2db24d,_0xb1d54c){if(_0x2db24d)return _0x1f8ec8(_0x2db24d);return _0x2df45d(_0xb1d54c);});})[_0x40b3('0x16')](function(){return new BPromise(function(_0x118ba4,_0x55fff2){rimraf(_0x345353,function(_0x4fc76a){if(_0x4fc76a)_0x55fff2(_0x4fc76a);return _0x118ba4();});});})[_0x40b3('0x16')](function(){return _0x3fa8b9[_0x40b3('0xb4')](_0xaa6c5b,_0x5d3718,function(_0x60beaa){if(_0x60beaa){logger['error'](_0x40b3('0xd1'),_0x60beaa);}else{fs[_0x40b3('0xd2')](_0xaa6c5b);}});});});}else{return _0x3fa8b9[_0x40b3('0x29')](0xc8);}})[_0x40b3('0x41')](handleError(_0x3fa8b9,null));};
\ No newline at end of file
+var _0xfd35=['result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','stack','name','render','merge','body','contact','agent','account','ChatInteraction','rawAttributes','key','findAll','query','user','catch','show','params','intersection','model','fields','attributes','includeAll','include','create','find','describe','createVidaooSession','ChatWebsite','ChatWebsiteId','vidaooEscalation','vidaooMetadata','fullname','email','POST','vidaooApiKey','vidaooTopic','isNull','vidaooNote','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','updateAttributes','customUpdate','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','UserId','closed','disposition','AbandonInteraction','originalname','basename','file','filename','mimetype','attachmentDownload','Unauthorized','findOne','attachId','join','root','close','mailTranscript','format','now','ChatMessage','Messages','User','ContactId','length','%s%d','System','customer','Visitor','agentIdentifier','website_alias','agentAlias','agent_fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailServerOut','Smtp','CloudProvider','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','keys','nolimit','order','sort','where','filters','pick','ChatInteractionId','filter','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','rows','getMyMessages','hasOwnProperty','includeAgent','push','setTags','Tag','color','emit','chatInteractionTags:save','removeTags','download','unix','toString','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','Attachment','direction','read','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','renderFile','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','rimraf','zip-dir','request-promise','moment','mustache','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','api','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','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'];(function(_0x58ceb9,_0x5601df){var _0x3d0ff5=function(_0x3a79d0){while(--_0x3a79d0){_0x58ceb9['push'](_0x58ceb9['shift']());}};_0x3d0ff5(++_0x5601df);}(_0xfd35,0x173));var _0x5fd3=function(_0x9b6188,_0x28cb0b){_0x9b6188=_0x9b6188-0x0;var _0x37d16d=_0xfd35[_0x9b6188];return _0x37d16d;};'use strict';var rimraf=require(_0x5fd3('0x0'));var zipdir=require(_0x5fd3('0x1'));var rp=require(_0x5fd3('0x2'));var moment=require(_0x5fd3('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5fd3('0x4'));var util=require(_0x5fd3('0x5'));var path=require(_0x5fd3('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5fd3('0x7'));var Redis=require(_0x5fd3('0x8'));var interaction=require(_0x5fd3('0x9'));var qs=require(_0x5fd3('0xa'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')(_0x5fd3('0xb'));var config=require('../../config/environment');var db=require(_0x5fd3('0xc'))['db'];config[_0x5fd3('0xd')]=_['defaults'](config[_0x5fd3('0xd')],{'host':_0x5fd3('0xe'),'port':0x18eb});var socket=require(_0x5fd3('0xf'))(new Redis(config[_0x5fd3('0xd')]));require(_0x5fd3('0x10'))['register'](socket);var jayson=require(_0x5fd3('0x11'));var client=jayson[_0x5fd3('0x12')][_0x5fd3('0x13')]({'port':0x232b});var client9004=jayson[_0x5fd3('0x12')][_0x5fd3('0x13')]({'port':0x232c});function respondWithRpcPromise(_0x5a0fab,_0x1a3ec9,_0x90c27f,_0x12b8bf){return new BPromise(function(_0x4a0268,_0x227ec3){var _0x10e708=_0x12b8bf||client;return _0x10e708[_0x5fd3('0x14')](_0x5a0fab,_0x90c27f)[_0x5fd3('0x15')](function(_0xc68b7d){logger[_0x5fd3('0x16')](_0x5fd3('0x17'),_0x1a3ec9,_0x5fd3('0x18'));logger[_0x5fd3('0x19')](_0x5fd3('0x1a'),_0x1a3ec9,_0x5fd3('0x18'),JSON[_0x5fd3('0x1b')](_0xc68b7d));if(_0xc68b7d[_0x5fd3('0x1c')]){if(_0xc68b7d[_0x5fd3('0x1c')][_0x5fd3('0x1d')]===0x1f4){logger[_0x5fd3('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x1a3ec9,_0xc68b7d[_0x5fd3('0x1c')]['message']);return _0x227ec3(_0xc68b7d[_0x5fd3('0x1c')]['message']);}logger[_0x5fd3('0x1c')](_0x5fd3('0x17'),_0x1a3ec9,_0xc68b7d[_0x5fd3('0x1c')][_0x5fd3('0x1e')]);return _0x4a0268(_0xc68b7d[_0x5fd3('0x1c')][_0x5fd3('0x1e')]);}else{logger[_0x5fd3('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x1a3ec9,'request\x20sent');_0x4a0268(_0xc68b7d[_0x5fd3('0x1f')][_0x5fd3('0x1e')]);}})['catch'](function(_0x25e92d){logger[_0x5fd3('0x1c')](_0x5fd3('0x17'),_0x1a3ec9,_0x25e92d);_0x227ec3(_0x25e92d);});});}function respondWithStatusCode(_0x4adaeb,_0x1212b9){_0x1212b9=_0x1212b9||0xcc;return function(_0xbc5540){if(_0xbc5540){return _0x4adaeb[_0x5fd3('0x20')](_0x1212b9);}return _0x4adaeb[_0x5fd3('0x21')](_0x1212b9)['end']();};}function respondWithResult(_0x3c42e1,_0x1494a4){_0x1494a4=_0x1494a4||0xc8;return function(_0x56ff7a){if(_0x56ff7a){return _0x3c42e1[_0x5fd3('0x21')](_0x1494a4)[_0x5fd3('0x22')](_0x56ff7a);}};}function respondWithFilteredResult(_0x4ccf61,_0x157c1b){return function(_0x40a85b){if(_0x40a85b){var _0x481a7=typeof _0x157c1b[_0x5fd3('0x23')]===_0x5fd3('0x24')&&typeof _0x157c1b[_0x5fd3('0x25')]===_0x5fd3('0x24');var _0x56ce14=_0x40a85b['count'];var _0x51d5e=_0x481a7?0x0:_0x157c1b[_0x5fd3('0x23')];var _0x50ad1d=_0x481a7?_0x40a85b[_0x5fd3('0x26')]:_0x157c1b[_0x5fd3('0x23')]+_0x157c1b['limit'];var _0x18d00c;if(_0x50ad1d>=_0x56ce14){_0x50ad1d=_0x56ce14;_0x18d00c=0xc8;}else{_0x18d00c=0xce;}_0x4ccf61[_0x5fd3('0x21')](_0x18d00c);return _0x4ccf61[_0x5fd3('0x27')](_0x5fd3('0x28'),_0x51d5e+'-'+_0x50ad1d+'/'+_0x56ce14)[_0x5fd3('0x22')](_0x40a85b);}return null;};}function saveUpdates(_0x9b803b){return function(_0xac128){if(_0xac128){return _0xac128[_0x5fd3('0x29')](_0x9b803b)[_0x5fd3('0x15')](function(_0x34da19){return _0x34da19;});}return null;};}function removeEntity(_0x1701d7){return function(_0x20f79b){if(_0x20f79b){return _0x20f79b[_0x5fd3('0x2a')]()[_0x5fd3('0x15')](function(){_0x1701d7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x58a89e){return function(_0x3e09a8){if(!_0x3e09a8){_0x58a89e[_0x5fd3('0x20')](0x194);}return _0x3e09a8;};}function handleError(_0x3fe207,_0x962f01){_0x962f01=_0x962f01||0x1f4;return function(_0x2e956a){logger[_0x5fd3('0x1c')](_0x2e956a[_0x5fd3('0x2b')]);if(_0x2e956a[_0x5fd3('0x2c')]){delete _0x2e956a[_0x5fd3('0x2c')];}_0x3fe207[_0x5fd3('0x21')](_0x962f01)['send'](_0x2e956a);};}function getMustacheRender(_0x5a33fa,_0x2df1db){return Mustache[_0x5fd3('0x2d')](_0x5a33fa,_[_0x5fd3('0x2e')](_0x2df1db[_0x5fd3('0x2f')],{'contact':_0x2df1db[_0x5fd3('0x30')],'message':_0x2df1db[_0x5fd3('0x1e')],'agent':_0x2df1db[_0x5fd3('0x31')],'interaction':_0x2df1db['interaction'],'account':_0x2df1db[_0x5fd3('0x32')]}))||'';}exports['index']=function(_0x9544a2,_0x3ab072){var _0x493460={};var _0x4ed56a=_['map'](db[_0x5fd3('0x33')][_0x5fd3('0x34')],function(_0x589a09){return{'name':_0x589a09['fieldName'],'type':_0x589a09['type'][_0x5fd3('0x35')]};});_0x493460=qs['getOptions'](_0x4ed56a,_0x9544a2);return interaction[_0x5fd3('0x36')]('chat',_0x9544a2[_0x5fd3('0x37')],_0x9544a2[_0x5fd3('0x38')],_0x493460,_0x4ed56a)[_0x5fd3('0x15')](respondWithFilteredResult(_0x3ab072,_0x493460))[_0x5fd3('0x39')](handleError(_0x3ab072,null));};exports[_0x5fd3('0x3a')]=function(_0x2dcf93,_0xeec642){var _0x1bfac7={'raw':![],'where':{'id':_0x2dcf93[_0x5fd3('0x3b')]['id']}},_0x12bad9={};_0x12bad9['model']=_['keys'](db[_0x5fd3('0x33')][_0x5fd3('0x34')]);_0x12bad9[_0x5fd3('0x37')]=_['keys'](_0x2dcf93['query']);_0x12bad9['filters']=_[_0x5fd3('0x3c')](_0x12bad9[_0x5fd3('0x3d')],_0x12bad9[_0x5fd3('0x37')]);_0x1bfac7['attributes']=_[_0x5fd3('0x3c')](_0x12bad9['model'],qs[_0x5fd3('0x3e')](_0x2dcf93[_0x5fd3('0x37')]['fields']));_0x1bfac7[_0x5fd3('0x3f')]=_0x1bfac7[_0x5fd3('0x3f')]['length']?_0x1bfac7[_0x5fd3('0x3f')]:_0x12bad9[_0x5fd3('0x3d')];if(_0x2dcf93[_0x5fd3('0x37')][_0x5fd3('0x40')]){_0x1bfac7[_0x5fd3('0x41')]=[{'all':!![]}];}_0x1bfac7=_[_0x5fd3('0x2e')]({},_0x1bfac7,_0x2dcf93['options']);return db[_0x5fd3('0x33')]['find'](_0x1bfac7)[_0x5fd3('0x15')](handleEntityNotFound(_0xeec642,null))[_0x5fd3('0x15')](respondWithResult(_0xeec642,null))[_0x5fd3('0x39')](handleError(_0xeec642,null));};exports[_0x5fd3('0x42')]=function(_0x3681eb,_0x52d76d){return db[_0x5fd3('0x33')][_0x5fd3('0x42')](_0x3681eb[_0x5fd3('0x2f')],{})['then'](respondWithResult(_0x52d76d,0xc9))[_0x5fd3('0x39')](handleError(_0x52d76d,null));};exports['update']=function(_0xaa6c38,_0xa0fc85){if(_0xaa6c38[_0x5fd3('0x2f')]['id']){delete _0xaa6c38[_0x5fd3('0x2f')]['id'];}return db['ChatInteraction'][_0x5fd3('0x43')]({'where':{'id':_0xaa6c38[_0x5fd3('0x3b')]['id']}})[_0x5fd3('0x15')](handleEntityNotFound(_0xa0fc85,null))[_0x5fd3('0x15')](saveUpdates(_0xaa6c38[_0x5fd3('0x2f')],null))[_0x5fd3('0x15')](respondWithResult(_0xa0fc85,null))[_0x5fd3('0x39')](handleError(_0xa0fc85,null));};exports[_0x5fd3('0x2a')]=function(_0x3d360f,_0x2eaa87){return db[_0x5fd3('0x33')][_0x5fd3('0x43')]({'where':{'id':_0x3d360f['params']['id']}})[_0x5fd3('0x15')](handleEntityNotFound(_0x2eaa87,null))[_0x5fd3('0x15')](removeEntity(_0x2eaa87,null))[_0x5fd3('0x39')](handleError(_0x2eaa87,null));};exports['describe']=function(_0x5cca61,_0x4c101e){return db[_0x5fd3('0x33')][_0x5fd3('0x44')]()[_0x5fd3('0x15')](respondWithResult(_0x4c101e,null))[_0x5fd3('0x39')](handleError(_0x4c101e,null));};exports[_0x5fd3('0x45')]=function(_0x478c75,_0x3c792d){var _0x1ca6da=_0x478c75[_0x5fd3('0x3b')]['id'];var _0x58c9a8;var _0x508f61;var _0x5875eb;return db['ChatInteraction']['findOne']({'where':{'id':_0x1ca6da}})[_0x5fd3('0x15')](function(_0x58a190){_0x58c9a8=_0x58a190;return db[_0x5fd3('0x46')]['findOne']({'where':{'id':_0x58a190[_0x5fd3('0x47')]},'attributes':['id','vidaooApiKey',_0x5fd3('0x48'),'vidaooTopic','vidaooNote',_0x5fd3('0x49')],'raw':!![]});})[_0x5fd3('0x15')](function(_0x3459cf){if(_0x3459cf&&_0x3459cf['vidaooApiKey']&&_0x3459cf['vidaooEscalation']){_0x508f61=_0x3459cf;var _0x3704a5={'interaction':{'id':_0x1ca6da},'agent':{'id':_0x478c75['user']['id'],'name':_0x478c75['user'][_0x5fd3('0x2c')],'fullname':_0x478c75[_0x5fd3('0x38')][_0x5fd3('0x4a')],'email':_0x478c75[_0x5fd3('0x38')][_0x5fd3('0x4b')]},'contact':_0x478c75[_0x5fd3('0x2f')][_0x5fd3('0x30')],'account':_0x478c75[_0x5fd3('0x2f')][_0x5fd3('0x32')]};var _0x796a15={'rejectUnauthorized':![],'method':_0x5fd3('0x4c'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x3459cf[_0x5fd3('0x4d')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x478c75[_0x5fd3('0x38')][_0x5fd3('0x4b')]],'buttons':null,'topic':_0x508f61[_0x5fd3('0x4e')],'note':_[_0x5fd3('0x4f')](_0x508f61[_0x5fd3('0x50')])?null:getMustacheRender(_0x508f61[_0x5fd3('0x50')],_0x3704a5),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x5fd3('0x4f')](_0x508f61[_0x5fd3('0x49')])){var _0x1e234f=getMustacheRender(_0x508f61['vidaooMetadata'],_0x3704a5);var _0x3af4eb=JSON['parse'](_0x1e234f);_0x796a15['body']['metadata']=_0x3af4eb;}}catch(_0x2d436e){throw new db[(_0x5fd3('0x51'))][(_0x5fd3('0x52'))](_0x5fd3('0x53'));}return rp(_0x796a15);}else{throw new db[(_0x5fd3('0x51'))][(_0x5fd3('0x52'))](_0x5fd3('0x54'));}})[_0x5fd3('0x15')](function(_0x236d71){_0x5875eb=_0x236d71;if(_0x5875eb['id']){var _0x4c12f9={'body':_0x5875eb[_0x5fd3('0x55')],'ChatWebsiteId':_0x508f61['id'],'ChatInteractionId':_0x58c9a8['id'],'direction':_0x5fd3('0x56'),'UserId':_0x478c75[_0x5fd3('0x38')]['id']};return db['ChatMessage'][_0x5fd3('0x42')](_0x4c12f9,{});}else{throw new db[(_0x5fd3('0x51'))][(_0x5fd3('0x52'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x5fd3('0x15')](function(){return _0x58c9a8[_0x5fd3('0x57')]({'vidaooSessionId':_0x5875eb['id']});})[_0x5fd3('0x15')](respondWithResult(_0x3c792d,null))['catch'](handleError(_0x3c792d,null));};exports[_0x5fd3('0x58')]=function(_0x591c7b,_0x4bbc90){if(_0x591c7b[_0x5fd3('0x2f')]['id']){delete _0x591c7b[_0x5fd3('0x2f')]['id'];}return db[_0x5fd3('0x33')][_0x5fd3('0x43')]({'where':{'id':_0x591c7b[_0x5fd3('0x3b')]['id']},'include':[{'model':db[_0x5fd3('0x59')],'as':_0x5fd3('0x5a')}]})[_0x5fd3('0x15')](handleEntityNotFound(_0x4bbc90,null))['then'](saveUpdates(_0x591c7b[_0x5fd3('0x2f')],null))[_0x5fd3('0x15')](respondWithResult(_0x4bbc90,null))[_0x5fd3('0x39')](handleError(_0x4bbc90,null));};exports['abandon']=function(_0x1021d9,_0x50350e){if(_0x1021d9[_0x5fd3('0x2f')]['id']){delete _0x1021d9[_0x5fd3('0x2f')]['id'];}return db[_0x5fd3('0x33')][_0x5fd3('0x43')]({'where':{'id':_0x1021d9[_0x5fd3('0x3b')]['id']}})[_0x5fd3('0x15')](function(_0x1347a7){if(!_0x1347a7){logger['error'](_0x5fd3('0x5b'),_0x5fd3('0x5c'),0x194,_0x5fd3('0x5d'));_0x50350e[_0x5fd3('0x20')](0x194);}else{if(_0x1347a7[_0x5fd3('0x5e')]){throw new db[(_0x5fd3('0x51'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0x1347a7;})[_0x5fd3('0x15')](function(_0x456e00){if(_0x456e00){return _0x456e00[_0x5fd3('0x29')]({'closed':_0x1021d9['body'][_0x5fd3('0x5f')],'disposition':_0x1021d9[_0x5fd3('0x2f')][_0x5fd3('0x60')]})[_0x5fd3('0x15')](function(_0x31095c){return _0x31095c;});}})[_0x5fd3('0x15')](function(){return respondWithRpcPromise(_0x5fd3('0x61'),_0x5fd3('0x5c'),_0x1021d9['body'],client9004);})['then'](respondWithResult(_0x50350e,null))[_0x5fd3('0x39')](handleError(_0x50350e,null));};exports['attachmentUpload']=function(_0x23a73e,_0x2830c0){_0x23a73e[_0x5fd3('0x2f')][_0x5fd3('0x2c')]=_0x23a73e['file'][_0x5fd3('0x62')];_0x23a73e[_0x5fd3('0x2f')][_0x5fd3('0x63')]=_0x23a73e[_0x5fd3('0x64')][_0x5fd3('0x65')];_0x23a73e[_0x5fd3('0x2f')]['type']=_0x23a73e['file'][_0x5fd3('0x66')];return db['Attachment'][_0x5fd3('0x42')](_0x23a73e[_0x5fd3('0x2f')])[_0x5fd3('0x15')](respondWithResult(_0x2830c0,0xc9))[_0x5fd3('0x39')](handleError(_0x2830c0,null));};exports[_0x5fd3('0x67')]=function(_0x126861,_0x4ee07f){return db[_0x5fd3('0x33')]['findOne']({'where':{'id':_0x126861[_0x5fd3('0x3b')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x4ee07f,null))['then'](function(_0x2625ec){if(_0x2625ec){if(_0x2625ec[_0x5fd3('0x5f')]){return _0x4ee07f[_0x5fd3('0x21')](0x193)['json']({'status':0x193,'message':_0x5fd3('0x68')});}return db['Attachment'][_0x5fd3('0x69')]({'where':{'id':_0x126861[_0x5fd3('0x37')][_0x5fd3('0x6a')]},'raw':!![]})[_0x5fd3('0x15')](handleEntityNotFound(_0x4ee07f,null));}})['then'](function(_0x4fdff2){if(_0x4fdff2){var _0x30ffba=_0x4fdff2['ChatOfflineMessageId']!==null;var _0x518c04=path[_0x5fd3('0x6b')](config[_0x5fd3('0x6c')],'server/files/attachments/');if(_0x30ffba){_0x518c04=path[_0x5fd3('0x6b')](_0x518c04,'offline-chat/');}var _0x5aa301=path[_0x5fd3('0x6b')](_0x518c04,_0x4fdff2[_0x5fd3('0x63')]);return _0x4ee07f['download'](_0x5aa301);}})[_0x5fd3('0x39')](handleError(_0x4ee07f,null));};exports[_0x5fd3('0x6d')]=function(_0x36b693,_0x4149b2){var _0x1f2f35=null;var _0x1cfdc9=null;var _0x46aa8d=null;if(_0x36b693[_0x5fd3('0x2f')]['id']){delete _0x36b693[_0x5fd3('0x2f')]['id'];}if(_0x36b693[_0x5fd3('0x2f')][_0x5fd3('0x6e')]){_0x46aa8d=path[_0x5fd3('0x6b')](config[_0x5fd3('0x6c')],'server/files/chat/upload/',util[_0x5fd3('0x6f')]('transcript-%s.txt',Date[_0x5fd3('0x70')]()));_0x36b693[_0x5fd3('0x2f')]['pathTranscript']=_0x46aa8d;}return db[_0x5fd3('0x33')]['find']({'where':{'id':_0x36b693[_0x5fd3('0x3b')]['id']},'include':[{'model':db[_0x5fd3('0x71')],'as':_0x5fd3('0x72'),'include':[{'model':db[_0x5fd3('0x73')],'as':'User'}]}]})[_0x5fd3('0x15')](handleEntityNotFound(_0x4149b2,null))[_0x5fd3('0x15')](saveUpdates(_0x36b693['body'],null))['then'](function(_0x49e2cc){if(_0x49e2cc){_0x1f2f35=_0x49e2cc;return db[_0x5fd3('0x46')][_0x5fd3('0x43')]({'where':{'id':_0x1f2f35[_0x5fd3('0x47')]}});}})[_0x5fd3('0x15')](function(_0x35d8a3){if(_0x35d8a3){_0x1cfdc9=_0x35d8a3;return db[_0x5fd3('0x59')][_0x5fd3('0x43')]({'where':{'id':_0x1f2f35[_0x5fd3('0x74')]}});}})[_0x5fd3('0x15')](function(_0x49b6a1){if(_0x49b6a1){if(_0x46aa8d){var _0x219e30=null;for(var _0x101573=0x1;_0x101573<_0x1f2f35[_0x5fd3('0x72')][_0x5fd3('0x75')];++_0x101573){_0x219e30=_0x1f2f35[_0x5fd3('0x72')][_0x101573];var _0x172a34=_0x219e30[_0x5fd3('0x5e')]?util[_0x5fd3('0x6f')](_0x5fd3('0x76'),_0x1cfdc9['agentAlias'],_0x219e30[_0x5fd3('0x5e')]):_0x5fd3('0x77');var _0x9db4ad=_0x36b693['body'][_0x5fd3('0x78')]||util[_0x5fd3('0x6f')](_0x5fd3('0x76'),_0x5fd3('0x79'),_0x219e30['ContactId']);switch(_0x1cfdc9[_0x5fd3('0x7a')]){case _0x5fd3('0x7b'):_0x172a34=_0x219e30[_0x5fd3('0x5e')]?util[_0x5fd3('0x6f')](_0x5fd3('0x76'),_0x1cfdc9[_0x5fd3('0x7c')],_0x219e30[_0x5fd3('0x5e')]):_0x5fd3('0x77');break;case'agent_alias':_0x172a34=_0x219e30[_0x5fd3('0x5e')]?_0x219e30[_0x5fd3('0x73')]['alias']||_0x219e30['User']['fullname']:_0x5fd3('0x77');break;case _0x5fd3('0x7d'):_0x172a34=_0x219e30['UserId']?_0x219e30['User']['fullname']:_0x5fd3('0x77');break;default:_0x172a34=_0x219e30['UserId']?util[_0x5fd3('0x6f')](_0x5fd3('0x76'),_0x1cfdc9[_0x5fd3('0x7c')],_0x219e30[_0x5fd3('0x5e')]):_0x5fd3('0x77');}var _0x55acf1=util[_0x5fd3('0x6f')]('[%s]\x20%s:\x20%s\x0a',moment(_0x219e30[_0x5fd3('0x7e')])[_0x5fd3('0x6f')](_0x5fd3('0x7f')),_0x219e30['direction']==='in'?_0x9db4ad:_0x172a34,_0x219e30[_0x5fd3('0x2f')]);if(!_0x219e30[_0x5fd3('0x80')]){fs[_0x5fd3('0x81')](_0x46aa8d,_0x55acf1);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x5fd3('0x82')],'as':_0x5fd3('0x83'),'raw':!![],'include':[{'model':db[_0x5fd3('0x84')],'as':_0x5fd3('0x84'),'raw':!![]}]}]});}}})[_0x5fd3('0x15')](function(_0x2e4dd5){if(!_0x2e4dd5||!_0x2e4dd5[_0x5fd3('0x83')]||!_0x36b693[_0x5fd3('0x2f')])return _0x1f2f35;var _0x57449f=_0x2e4dd5['getSmtpOptions']();return respondWithRpcPromise(_0x5fd3('0x85'),_0x5fd3('0x86'),{'account':_0x57449f,'message':{'from':util[_0x5fd3('0x6f')](_0x5fd3('0x87'),_0x2e4dd5['name'],_0x2e4dd5[_0x5fd3('0x4b')]||_0x2e4dd5[_0x5fd3('0x83')]['user']),'to':_0x36b693[_0x5fd3('0x2f')][_0x5fd3('0x6e')],'subject':_0x5fd3('0x88'),'text':util['format'](_0x5fd3('0x89'),_0x36b693[_0x5fd3('0x2f')][_0x5fd3('0x6e')]),'attachments':[{'path':_0x46aa8d}]}})[_0x5fd3('0x15')](function(){return _0x1f2f35;})[_0x5fd3('0x39')](function(_0x4fe7f6){logger[_0x5fd3('0x1c')](_0x4fe7f6);});})[_0x5fd3('0x15')](respondWithStatusCode(_0x4149b2,0xc8))[_0x5fd3('0x39')](handleError(_0x4149b2,null));};exports[_0x5fd3('0x8a')]=function(_0x2a47e9,_0x1889f3){return db['ChatMessage'][_0x5fd3('0x43')]({'where':{'id':_0x2a47e9[_0x5fd3('0x3b')]['id']}})['then'](handleEntityNotFound(_0x1889f3,null))[_0x5fd3('0x15')](function(_0x3e7faf){if(_0x3e7faf){return _0x3e7faf[_0x5fd3('0x8a')](_0x2a47e9[_0x5fd3('0x2f')][_0x5fd3('0x8b')],_[_0x5fd3('0x8c')](_0x2a47e9[_0x5fd3('0x2f')],[_0x5fd3('0x8b'),'id'])||{});}})[_0x5fd3('0x15')](respondWithResult(_0x1889f3,null))[_0x5fd3('0x39')](handleError(_0x1889f3,null));};exports[_0x5fd3('0x8d')]=function(_0x3a0e77,_0x5539ed){var _0xedbc49={'raw':![],'where':{}};var _0x118abb={};var _0x11612d={'count':0x0,'rows':[]};return db[_0x5fd3('0x33')][_0x5fd3('0x69')]({'where':{'id':_0x3a0e77['params']['id']}})[_0x5fd3('0x15')](handleEntityNotFound(_0x5539ed,null))['then'](function(_0x203878){if(_0x203878){_0x118abb[_0x5fd3('0x3d')]=_[_0x5fd3('0x8e')](db[_0x5fd3('0x71')][_0x5fd3('0x34')]);_0x118abb[_0x5fd3('0x37')]=_['keys'](_0x3a0e77[_0x5fd3('0x37')]);_0x118abb['filters']=_['intersection'](_0x118abb['model'],_0x118abb[_0x5fd3('0x37')]);_0xedbc49[_0x5fd3('0x3f')]=_[_0x5fd3('0x3c')](_0x118abb['model'],qs[_0x5fd3('0x3e')](_0x3a0e77[_0x5fd3('0x37')][_0x5fd3('0x3e')]));_0xedbc49['attributes']=_0xedbc49[_0x5fd3('0x3f')]['length']?_0xedbc49[_0x5fd3('0x3f')]:_0x118abb['model'];if(!_0x3a0e77['query']['hasOwnProperty'](_0x5fd3('0x8f'))){_0xedbc49[_0x5fd3('0x25')]=qs['limit'](_0x3a0e77[_0x5fd3('0x37')][_0x5fd3('0x25')]);_0xedbc49[_0x5fd3('0x23')]=qs['offset'](_0x3a0e77[_0x5fd3('0x37')][_0x5fd3('0x23')]);}_0xedbc49[_0x5fd3('0x90')]=qs[_0x5fd3('0x91')](_0x3a0e77[_0x5fd3('0x37')][_0x5fd3('0x91')]);_0xedbc49[_0x5fd3('0x92')]=qs[_0x5fd3('0x93')](_[_0x5fd3('0x94')](_0x3a0e77[_0x5fd3('0x37')],_0x118abb[_0x5fd3('0x93')]));_0xedbc49[_0x5fd3('0x92')][_0x5fd3('0x95')]=_0x203878['id'];if(_0x3a0e77['query'][_0x5fd3('0x96')]){_0xedbc49[_0x5fd3('0x92')]=_[_0x5fd3('0x2e')](_0xedbc49[_0x5fd3('0x92')],{'$or':_[_0x5fd3('0x97')](_0xedbc49[_0x5fd3('0x3f')],function(_0x56200e){var _0x5c5363={};_0x5c5363[_0x56200e]={'$like':'%'+_0x3a0e77[_0x5fd3('0x37')][_0x5fd3('0x96')]+'%'};return _0x5c5363;})});}if(_0x3a0e77[_0x5fd3('0x37')]['$gte']){var _0x42dd26=_0x3a0e77[_0x5fd3('0x37')][_0x5fd3('0x98')][_0x5fd3('0x99')](',');var _0xfb08d7={};_0xfb08d7[_0x42dd26[0x0]]={'$gte':moment(_0x42dd26[0x1])[_0x5fd3('0x6f')](_0x5fd3('0x9a'))};_0xedbc49[_0x5fd3('0x92')]=_[_0x5fd3('0x2e')](_0xedbc49[_0x5fd3('0x92')],_0xfb08d7);}_0xedbc49=_[_0x5fd3('0x2e')]({},_0xedbc49,_0x3a0e77[_0x5fd3('0x9b')]);return db[_0x5fd3('0x71')][_0x5fd3('0x26')]({'where':_0xedbc49[_0x5fd3('0x92')]})[_0x5fd3('0x15')](function(_0x20d3e2){_0x11612d[_0x5fd3('0x26')]=_0x20d3e2;if(_0x3a0e77['query'][_0x5fd3('0x40')]){_0xedbc49[_0x5fd3('0x41')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0xedbc49);})[_0x5fd3('0x15')](function(_0x5b5968){_0x11612d[_0x5fd3('0x9c')]=_0x5b5968;return _0x11612d;});}})[_0x5fd3('0x15')](respondWithFilteredResult(_0x5539ed,_0xedbc49))[_0x5fd3('0x39')](handleError(_0x5539ed,null));};exports[_0x5fd3('0x9d')]=function(_0x1fffa2,_0x58fcea){var _0x4ac4ad={'where':{}},_0x37f0fe={},_0x15a80c={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x1fffa2['params']['id']}})['then'](handleEntityNotFound(_0x58fcea,null))['then'](function(_0xb62756){if(_0xb62756){_0x37f0fe['model']=_[_0x5fd3('0x8e')](db[_0x5fd3('0x71')][_0x5fd3('0x34')]);_0x37f0fe[_0x5fd3('0x37')]=_['keys'](_0x1fffa2[_0x5fd3('0x37')]);_0x37f0fe[_0x5fd3('0x93')]=_[_0x5fd3('0x3c')](_0x37f0fe['model'],_0x37f0fe['query']);_0x4ac4ad['attributes']=_['intersection'](_0x37f0fe['model'],qs[_0x5fd3('0x3e')](_0x1fffa2[_0x5fd3('0x37')][_0x5fd3('0x3e')]));_0x4ac4ad[_0x5fd3('0x3f')]=_0x4ac4ad['attributes'][_0x5fd3('0x75')]?_0x4ac4ad[_0x5fd3('0x3f')]:_0x37f0fe['model'];if(!_0x1fffa2[_0x5fd3('0x37')][_0x5fd3('0x9e')]('nolimit')){_0x4ac4ad[_0x5fd3('0x25')]=qs[_0x5fd3('0x25')](_0x1fffa2[_0x5fd3('0x37')]['limit']);_0x4ac4ad[_0x5fd3('0x23')]=qs[_0x5fd3('0x23')](_0x1fffa2[_0x5fd3('0x37')][_0x5fd3('0x23')]);}_0x4ac4ad['order']=qs[_0x5fd3('0x91')](_0x1fffa2['query']['sort']);_0x4ac4ad[_0x5fd3('0x92')]=qs[_0x5fd3('0x93')](_[_0x5fd3('0x94')](_0x1fffa2[_0x5fd3('0x37')],_0x37f0fe['filters']));_0x4ac4ad[_0x5fd3('0x92')]['ChatInteractionId']=_0xb62756['id'];if(_0x1fffa2[_0x5fd3('0x37')]['filter']){_0x4ac4ad['where']=_['merge'](_0x4ac4ad[_0x5fd3('0x92')],{'$or':_[_0x5fd3('0x97')](_0x4ac4ad['attributes'],function(_0x39847a){var _0x443014={};_0x443014[_0x39847a]={'$like':'%'+_0x1fffa2[_0x5fd3('0x37')][_0x5fd3('0x96')]+'%'};return _0x443014;})});}_0x4ac4ad['where'][_0x5fd3('0x80')]=![];if(_0x1fffa2['query']['id']){_0x4ac4ad[_0x5fd3('0x92')]['id']={'$gt':_0x1fffa2[_0x5fd3('0x37')]['id']};}_0x4ac4ad=_[_0x5fd3('0x2e')]({},_0x4ac4ad,_0x1fffa2[_0x5fd3('0x9b')]);return db[_0x5fd3('0x71')][_0x5fd3('0x26')]({'where':_0x4ac4ad[_0x5fd3('0x92')]})[_0x5fd3('0x15')](function(_0x30cb03){_0x15a80c['count']=_0x30cb03;_0x4ac4ad[_0x5fd3('0x41')]=[];if(_0x1fffa2[_0x5fd3('0x37')][_0x5fd3('0x9f')]){_0x4ac4ad[_0x5fd3('0x41')][_0x5fd3('0xa0')]({'model':db[_0x5fd3('0x73')],'as':_0x5fd3('0x73'),'attributes':['id','fullname','alias']});}if(_0x1fffa2[_0x5fd3('0x37')][_0x5fd3('0x40')]){_0x4ac4ad['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x4ac4ad);})[_0x5fd3('0x15')](function(_0x2f912c){_0x15a80c[_0x5fd3('0x9c')]=_0x2f912c;return _0x15a80c;});}})[_0x5fd3('0x15')](respondWithFilteredResult(_0x58fcea,_0x4ac4ad))[_0x5fd3('0x39')](handleError(_0x58fcea,null));};exports['addTags']=function(_0x13e2d9,_0x484a55){return db[_0x5fd3('0x33')][_0x5fd3('0x43')]({'where':{'id':_0x13e2d9[_0x5fd3('0x3b')]['id']}})[_0x5fd3('0x15')](handleEntityNotFound(_0x484a55,null))['then'](function(_0x3a8a35){if(_0x3a8a35){return _0x3a8a35[_0x5fd3('0xa1')](_0x13e2d9[_0x5fd3('0x2f')][_0x5fd3('0x8b')],_['omit'](_0x13e2d9[_0x5fd3('0x2f')],[_0x5fd3('0x8b'),'id'])||{})['spread'](function(){return db[_0x5fd3('0xa2')][_0x5fd3('0x36')]({'attributes':['id','name',_0x5fd3('0xa3')],'where':{'id':_0x13e2d9['body']['ids']}});})[_0x5fd3('0x15')](function(_0xcfa615){socket[_0x5fd3('0xa4')](_0x5fd3('0xa5'),{'id':Number(_0x13e2d9['params']['id']),'tags':_0xcfa615||[]});return{'id':Number(_0x13e2d9[_0x5fd3('0x3b')]['id']),'tags':_0xcfa615||[]};});}})[_0x5fd3('0x15')](respondWithResult(_0x484a55,null))['catch'](handleError(_0x484a55,null));};exports[_0x5fd3('0xa6')]=function(_0x36d62d,_0x1bbe14){return db['ChatInteraction']['find']({'where':{'id':_0x36d62d[_0x5fd3('0x3b')]['id']}})[_0x5fd3('0x15')](handleEntityNotFound(_0x1bbe14,null))[_0x5fd3('0x15')](function(_0x56683b){if(_0x56683b){return _0x56683b[_0x5fd3('0xa6')](_0x36d62d[_0x5fd3('0x37')][_0x5fd3('0x8b')]);}})[_0x5fd3('0x15')](respondWithStatusCode(_0x1bbe14,null))[_0x5fd3('0x39')](handleError(_0x1bbe14,null));};exports[_0x5fd3('0xa7')]=function(_0x23b01a,_0x183757){var _0x27156a=moment()[_0x5fd3('0xa8')]()[_0x5fd3('0xa9')]();var _0x53655a=path[_0x5fd3('0x6b')](config[_0x5fd3('0x6c')],_0x5fd3('0xaa'),_0x5fd3('0xab'),'tmp');var _0x4e3c7e=path[_0x5fd3('0x6b')](config['root'],_0x5fd3('0xaa'),_0x5fd3('0xab'),_0x5fd3('0xac'));var _0x295fe1=path[_0x5fd3('0x6b')](_0x53655a,_0x27156a);var _0x44e962=util[_0x5fd3('0x6f')](_0x5fd3('0xad'),_0x23b01a[_0x5fd3('0x3b')]['id'],_0x27156a);var _0x55d121=path[_0x5fd3('0x6b')](_0x53655a,_0x44e962);var _0x227ecf=[];_0x227ecf[_0x5fd3('0xa0')]({'model':db['User'],'as':'User','attributes':['id',_0x5fd3('0x4a')],'raw':!![]});_0x227ecf[_0x5fd3('0xa0')]({'model':db[_0x5fd3('0x59')],'as':_0x5fd3('0x5a'),'attributes':['id',_0x5fd3('0xae'),_0x5fd3('0xaf')],'raw':!![]});if(_0x23b01a[_0x5fd3('0x37')][_0x5fd3('0xac')]){_0x227ecf['push']({'model':db[_0x5fd3('0xb0')],'as':_0x5fd3('0xb0'),'raw':!![]});}var _0x92f274=[{'model':db['ChatMessage'],'as':'Messages','attributes':['id',_0x5fd3('0x2f'),_0x5fd3('0x7e'),_0x5fd3('0xb1'),_0x5fd3('0x80'),_0x5fd3('0xb2')],'include':_0x227ecf}];_0x92f274['push']({'model':db[_0x5fd3('0x46')],'as':_0x5fd3('0xb3'),'attributes':['id','name']});_0x92f274[_0x5fd3('0xa0')]({'model':db['User'],'as':_0x5fd3('0xb4'),'attributes':['id','fullname']});return db[_0x5fd3('0x33')][_0x5fd3('0x43')]({'where':{'id':_0x23b01a['params']['id']},'include':_0x92f274})[_0x5fd3('0x15')](handleEntityNotFound(_0x183757,null))[_0x5fd3('0x15')](function(_0x1d82aa){if(_0x1d82aa){var _0x365012=_0x1d82aa[_0x5fd3('0xb5')]({'plain':!![]});fs[_0x5fd3('0xb6')](_0x295fe1);var _0x22ba7c={'channel':_0x5fd3('0xb7'),'account':_0x365012[_0x5fd3('0xb3')][_0x5fd3('0x2c')],'agent':_0x365012[_0x5fd3('0xb4')]?_0x365012[_0x5fd3('0xb4')][_0x5fd3('0x4a')]:_0x5fd3('0xb8'),'createdAt':moment(_0x365012[_0x5fd3('0x7e')])['format'](_0x5fd3('0x9a'))[_0x5fd3('0xa9')](),'closedAt':_0x365012[_0x5fd3('0x5f')]?moment(_0x365012[_0x5fd3('0xb9')])[_0x5fd3('0x6f')](_0x5fd3('0x9a'))[_0x5fd3('0xa9')]():'','disposition':_0x365012[_0x5fd3('0x60')],'chatInfo':{'browser':_0x365012[_0x5fd3('0xba')],'os':_0x365012[_0x5fd3('0xbb')],'referer':_0x365012[_0x5fd3('0xbc')],'customerIp':_0x365012[_0x5fd3('0xbd')],'customerPort':_0x365012[_0x5fd3('0xbe')]?_0x365012[_0x5fd3('0xbe')]:'N.A.'},'messages':_(_0x365012['Messages'])[_0x5fd3('0xbf')]()[_0x5fd3('0x96')]({'secret':![]})['map'](function(_0x5ac5f5){if(_0x5ac5f5[_0x5fd3('0xb0')]){var _0x392ac4=path['join'](_0x4e3c7e,_0x5ac5f5[_0x5fd3('0xb0')][_0x5fd3('0x63')]);if(fs[_0x5fd3('0xc0')](_0x392ac4)){fs[_0x5fd3('0xc1')](_0x392ac4)[_0x5fd3('0xc2')](fs[_0x5fd3('0xc3')](path[_0x5fd3('0x6b')](_0x295fe1,_0x5ac5f5[_0x5fd3('0xb0')][_0x5fd3('0x63')])));}}return{'date':moment(_0x5ac5f5[_0x5fd3('0x7e')])[_0x5fd3('0x6f')]('YYYY-MM-DD\x20HH:mm:ss')[_0x5fd3('0xa9')](),'sender':_0x5ac5f5[_0x5fd3('0xb1')]===_0x5fd3('0x56')?_0x5ac5f5[_0x5fd3('0x73')]?_0x5ac5f5[_0x5fd3('0x73')]['fullname']:_0x5fd3('0x77'):_0x5ac5f5[_0x5fd3('0x5a')]['firstName']+(_0x5ac5f5[_0x5fd3('0x5a')][_0x5fd3('0xaf')]?'\x20'+_0x5ac5f5['Contact'][_0x5fd3('0xaf')]:''),'body':_0x5ac5f5[_0x5fd3('0xb0')]?_0x5ac5f5[_0x5fd3('0xb0')][_0x5fd3('0x63')]:_0x5ac5f5['body'],'direction':_0x5ac5f5[_0x5fd3('0xb1')]===_0x5fd3('0x56')?'A':'C','secret':_0x5ac5f5[_0x5fd3('0x80')],'read':_0x5ac5f5[_0x5fd3('0xb2')],'attachment':_0x5ac5f5[_0x5fd3('0xb0')]};})['value']()};return ejs[_0x5fd3('0xc4')](path['join'](config[_0x5fd3('0x6c')],_0x5fd3('0xaa'),'views',_0x5fd3('0xc5')),{'interaction':_0x22ba7c})['then'](function(_0x3cb9bd){var _0x3fcbc1=path['join'](_0x295fe1,_0x5fd3('0xc6')+_0x365012['id']+'-'+_0x27156a+'.pdf');var _0x17ef1e={'path':_0x3fcbc1,'channel':_0x5fd3('0xb7'),'interactionId':_0x365012['id']};return pdf[_0x5fd3('0xc7')](_0x3cb9bd,_0x17ef1e);})['then'](function(){return new Promise(function(_0x3a60ce,_0x20c366){zipdir(_0x295fe1,{'saveTo':_0x55d121},function(_0x10845e,_0x3311e4){if(_0x10845e)return _0x20c366(_0x10845e);return _0x3a60ce(_0x3311e4);});})[_0x5fd3('0x15')](function(){return new BPromise(function(_0x272b61,_0x1953de){rimraf(_0x295fe1,function(_0x35b3ef){if(_0x35b3ef)_0x1953de(_0x35b3ef);return _0x272b61();});});})['then'](function(){return _0x183757[_0x5fd3('0xa7')](_0x55d121,_0x44e962,function(_0x367450){if(_0x367450){logger[_0x5fd3('0x1c')](_0x5fd3('0xc8'),_0x367450);}else{fs['unlinkSync'](_0x55d121);}});});});}else{return _0x183757[_0x5fd3('0x20')](0xc8);}})[_0x5fd3('0x39')](handleError(_0x183757,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 0abf397..06de5e3 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 _0x8196=['exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty'];(function(_0x408b32,_0x792c51){var _0x4958c5=function(_0x4ea419){while(--_0x4ea419){_0x408b32['push'](_0x408b32['shift']());}};_0x4958c5(++_0x792c51);}(_0x8196,0x144));var _0x6819=function(_0x2ba04e,_0x594656){_0x2ba04e=_0x2ba04e-0x0;var _0x4cbd78=_0x8196[_0x2ba04e];return _0x4cbd78;};'use strict';var EventEmitter=require(_0x6819('0x0'));var ChatInteraction=require(_0x6819('0x1'))['db'][_0x6819('0x2')];var ChatMessage=require(_0x6819('0x1'))['db'][_0x6819('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x6819('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6819('0x5'),'afterDestroy':'remove'};function emitEvent(_0x50adac){return function(_0x4e3482,_0x462ceb,_0x4d021b){_0x4e3482[_0x6819('0x6')]({'attributes':['id'],'raw':!![]})[_0x6819('0x7')](function(_0x4a4175){_0x4e3482[_0x6819('0x8')](_0x6819('0x9'),_0x4a4175[_0x6819('0xa')](function(_0x25e279){return{'id':_0x25e279['id']};}));return ChatMessage[_0x6819('0xb')]({'where':{'ChatInteractionId':_0x4e3482['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6819('0x7')](function(_0x1558da){_0x4e3482['setDataValue'](_0x6819('0xc'),_0x1558da['length']);ChatInteractionEvents[_0x6819('0xd')](_0x50adac+':'+_0x4e3482['id'],_0x4e3482);ChatInteractionEvents['emit'](_0x50adac,_0x4e3482);_0x4d021b(null);})[_0x6819('0xe')](_0x4d021b(null));};}for(var e in events){if(events[_0x6819('0xf')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x6819('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x49c3=['exports','../../mysqldb','ChatInteraction','ChatMessage','save','remove','getUsers','then','setDataValue','Users','map','findAll','emit','catch','hasOwnProperty','hook'];(function(_0x5e6118,_0x4a8f97){var _0x25f6a5=function(_0x5e112b){while(--_0x5e112b){_0x5e6118['push'](_0x5e6118['shift']());}};_0x25f6a5(++_0x4a8f97);}(_0x49c3,0x1b1));var _0x349c=function(_0x21f9a9,_0x20eff1){_0x21f9a9=_0x21f9a9-0x0;var _0x326f5f=_0x49c3[_0x21f9a9];return _0x326f5f;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x349c('0x0'))['db'][_0x349c('0x1')];var ChatMessage=require(_0x349c('0x0'))['db'][_0x349c('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x349c('0x3'),'afterUpdate':'update','afterDestroy':_0x349c('0x4')};function emitEvent(_0x90c458){return function(_0x10f391,_0x2f8bcb,_0x56daba){_0x10f391[_0x349c('0x5')]({'attributes':['id'],'raw':!![]})[_0x349c('0x6')](function(_0x230167){_0x10f391[_0x349c('0x7')](_0x349c('0x8'),_0x230167[_0x349c('0x9')](function(_0x34d21f){return{'id':_0x34d21f['id']};}));return ChatMessage[_0x349c('0xa')]({'where':{'ChatInteractionId':_0x10f391['id'],'direction':'in','read':![]},'raw':!![]});})[_0x349c('0x6')](function(_0x135da3){_0x10f391['setDataValue']('unreadMessages',_0x135da3['length']);ChatInteractionEvents[_0x349c('0xb')](_0x90c458+':'+_0x10f391['id'],_0x10f391);ChatInteractionEvents['emit'](_0x90c458,_0x10f391);_0x56daba(null);})[_0x349c('0xc')](_0x56daba(null));};}for(var e in events){if(events[_0x349c('0xd')](e)){var event=events[e];ChatInteraction[_0x349c('0xe')](e,emitEvent(event));}}module[_0x349c('0xf')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 922a59a..f091223 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 _0x90fc=['request-promise','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x90fc,0x1be));var _0xc90f=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x90fc[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0xc90f('0x0'));var util=require(_0xc90f('0x1'));var logger=require('../../config/logger')(_0xc90f('0x2'));var moment=require(_0xc90f('0x3'));var BPromise=require('bluebird');var rp=require(_0xc90f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc90f('0x5'));var attributes=require(_0xc90f('0x6'));module['exports']=function(_0x19a870,_0x2c4f29){return _0x19a870[_0xc90f('0x7')](_0xc90f('0x8'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4d69bd,_0x21e499,_0x328b){if(_0x4d69bd['changed'](_0xc90f('0x9'))){_0x4d69bd[_0xc90f('0xa')]=moment()[_0xc90f('0xb')](_0xc90f('0xc'));}_0x328b(null,_0x4d69bd);}},'charset':_0xc90f('0xd'),'collate':_0xc90f('0xe')});};
\ No newline at end of file
+var _0x17dd=['YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','path','rimraf','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format'];(function(_0x5be77a,_0x5cdad7){var _0x59936e=function(_0x1fa2a3){while(--_0x1fa2a3){_0x5be77a['push'](_0x5be77a['shift']());}};_0x59936e(++_0x5cdad7);}(_0x17dd,0x134));var _0xd17d=function(_0x565635,_0x5299fb){_0x565635=_0x565635-0x0;var _0x148ce8=_0x17dd[_0x565635];return _0x148ce8;};'use strict';var _=require(_0xd17d('0x0'));var util=require('util');var logger=require(_0xd17d('0x1'))(_0xd17d('0x2'));var moment=require(_0xd17d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd17d('0x4'));var rimraf=require(_0xd17d('0x5'));var config=require('../../config/environment');var attributes=require(_0xd17d('0x6'));module[_0xd17d('0x7')]=function(_0x38f438,_0x8e087c){return _0x38f438[_0xd17d('0x8')](_0xd17d('0x9'),attributes,{'tableName':_0xd17d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x59478d,_0x5be67c,_0x3ff02f){if(_0x59478d[_0xd17d('0xb')](_0xd17d('0xc'))){_0x59478d[_0xd17d('0xd')]=moment()[_0xd17d('0xe')](_0xd17d('0xf'));}_0x3ff02f(null,_0x59478d);}},'charset':'utf8mb4','collate':_0xd17d('0x10')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 5664dea..847cb7a 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 _0x3ee5=['catch','ChatInteraction','body','options','raw','where','attributes','limit','UpdateChatInteraction','AddTagsToChatInteraction','find','addTags','ids','AddTags','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0x3ee5,0x18a));var _0x53ee=function(_0x1f7199,_0x144fbc){_0x1f7199=_0x1f7199-0x0;var _0x577298=_0x3ee5[_0x1f7199];return _0x577298;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x53ee('0x0'));var BPromise=require('bluebird');var rs=require(_0x53ee('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x53ee('0x2'));var logger=require(_0x53ee('0x3'))(_0x53ee('0x4'));var config=require(_0x53ee('0x5'));var jayson=require(_0x53ee('0x6'));var client=jayson[_0x53ee('0x7')][_0x53ee('0x8')]({'port':0x232a});config[_0x53ee('0x9')]=_[_0x53ee('0xa')](config[_0x53ee('0x9')],{'host':_0x53ee('0xb'),'port':0x18eb});var socket=require(_0x53ee('0xc'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0x53ee('0xd')](socket);function respondWithRpcPromise(_0x51b769,_0x530033,_0x25f854){return new BPromise(function(_0x56cda0,_0x851312){return client['request'](_0x51b769,_0x25f854)[_0x53ee('0xe')](function(_0x39e080){logger[_0x53ee('0xf')](_0x53ee('0x10'),_0x530033,'request\x20sent');logger[_0x53ee('0x11')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x530033,_0x53ee('0x12'),JSON[_0x53ee('0x13')](_0x39e080));if(_0x39e080['error']){if(_0x39e080[_0x53ee('0x14')][_0x53ee('0x15')]===0x1f4){logger['error'](_0x53ee('0x10'),_0x530033,_0x39e080[_0x53ee('0x14')][_0x53ee('0x16')]);return _0x851312(_0x39e080[_0x53ee('0x14')][_0x53ee('0x16')]);}logger[_0x53ee('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x530033,_0x39e080[_0x53ee('0x14')][_0x53ee('0x16')]);return _0x56cda0(_0x39e080[_0x53ee('0x14')][_0x53ee('0x16')]);}else{logger[_0x53ee('0xf')](_0x53ee('0x10'),_0x530033,_0x53ee('0x12'));_0x56cda0(_0x39e080[_0x53ee('0x17')][_0x53ee('0x16')]);}})[_0x53ee('0x18')](function(_0x46831c){logger[_0x53ee('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x530033,_0x46831c);_0x851312(_0x46831c);});});}exports['UpdateChatInteraction']=function(_0x2c5332){var _0x4fe546=this;return new Promise(function(_0x401090,_0x2371bd){return db[_0x53ee('0x19')]['update'](_0x2c5332[_0x53ee('0x1a')],{'raw':_0x2c5332[_0x53ee('0x1b')]?_0x2c5332[_0x53ee('0x1b')][_0x53ee('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c5332['options']?_0x2c5332[_0x53ee('0x1b')][_0x53ee('0x1d')]||null:null,'attributes':_0x2c5332[_0x53ee('0x1b')]?_0x2c5332[_0x53ee('0x1b')][_0x53ee('0x1e')]||null:null,'limit':_0x2c5332[_0x53ee('0x1b')]?_0x2c5332['options'][_0x53ee('0x1f')]||null:null})[_0x53ee('0xe')](function(_0x2a65d0){logger[_0x53ee('0xf')](_0x53ee('0x20'),_0x2c5332);logger[_0x53ee('0x11')](_0x53ee('0x20'),_0x2c5332,JSON['stringify'](_0x2a65d0));_0x401090(_0x2a65d0);})[_0x53ee('0x18')](function(_0x46f391){logger[_0x53ee('0x14')](_0x53ee('0x20'),_0x46f391[_0x53ee('0x16')],_0x2c5332);_0x2371bd(_0x4fe546[_0x53ee('0x14')](0x1f4,_0x46f391['message']));});});};exports[_0x53ee('0x21')]=function(_0x3cd3bc){return new Promise(function(_0x362f9e,_0x113d31){return db[_0x53ee('0x19')][_0x53ee('0x22')]({'where':_0x3cd3bc[_0x53ee('0x1b')]?_0x3cd3bc[_0x53ee('0x1b')][_0x53ee('0x1d')]||null:null})['then'](function(_0x323a53){if(_0x323a53){return _0x323a53[_0x53ee('0x23')](_0x3cd3bc['body'][_0x53ee('0x24')],_['omit'](_0x3cd3bc['body'],[_0x53ee('0x24'),'id'])||{});}})['spread'](function(_0x4951b7){logger['info'](_0x53ee('0x25'),_0x3cd3bc);logger[_0x53ee('0x11')](_0x53ee('0x25'),_0x3cd3bc,JSON[_0x53ee('0x13')](_0x4951b7));_0x362f9e(_0x4951b7);})[_0x53ee('0x18')](function(_0x53aa99){logger[_0x53ee('0x14')](_0x53ee('0x25'),_0x53aa99[_0x53ee('0x16')],_0x3cd3bc);_0x113d31(_this[_0x53ee('0x14')](0x1f4,_0x53aa99[_0x53ee('0x16')]));});});};
\ No newline at end of file
+var _0x99b4=['http','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','options','raw','where','limit','AddTagsToChatInteraction','find','addTags','body','ids','omit','AddTags','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','client'];(function(_0x3c2b2e,_0x3e6e53){var _0x27a338=function(_0x40d29d){while(--_0x40d29d){_0x3c2b2e['push'](_0x3c2b2e['shift']());}};_0x27a338(++_0x3e6e53);}(_0x99b4,0x99));var _0x499b=function(_0x1dbddf,_0x59c4dd){_0x1dbddf=_0x1dbddf-0x0;var _0x4858ce=_0x99b4[_0x1dbddf];return _0x4858ce;};'use strict';var _=require(_0x499b('0x0'));var util=require(_0x499b('0x1'));var moment=require('moment');var BPromise=require(_0x499b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x499b('0x3'));var db=require(_0x499b('0x4'))['db'];var utils=require(_0x499b('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x499b('0x6')][_0x499b('0x7')]({'port':0x232a});config['redis']=_[_0x499b('0x8')](config[_0x499b('0x9')],{'host':_0x499b('0xa'),'port':0x18eb});var socket=require(_0x499b('0xb'))(new Redis(config[_0x499b('0x9')]));require(_0x499b('0xc'))['register'](socket);function respondWithRpcPromise(_0x168776,_0x3ba68f,_0x79aa98){return new BPromise(function(_0x53c7af,_0x393374){return client[_0x499b('0xd')](_0x168776,_0x79aa98)[_0x499b('0xe')](function(_0x1b33b8){logger[_0x499b('0xf')](_0x499b('0x10'),_0x3ba68f,_0x499b('0x11'));logger[_0x499b('0x12')](_0x499b('0x13'),_0x3ba68f,_0x499b('0x11'),JSON[_0x499b('0x14')](_0x1b33b8));if(_0x1b33b8[_0x499b('0x15')]){if(_0x1b33b8[_0x499b('0x15')][_0x499b('0x16')]===0x1f4){logger['error'](_0x499b('0x10'),_0x3ba68f,_0x1b33b8['error']['message']);return _0x393374(_0x1b33b8['error'][_0x499b('0x17')]);}logger[_0x499b('0x15')](_0x499b('0x10'),_0x3ba68f,_0x1b33b8[_0x499b('0x15')][_0x499b('0x17')]);return _0x53c7af(_0x1b33b8[_0x499b('0x15')]['message']);}else{logger[_0x499b('0xf')]('ChatInteraction,\x20%s,\x20%s',_0x3ba68f,_0x499b('0x11'));_0x53c7af(_0x1b33b8[_0x499b('0x18')][_0x499b('0x17')]);}})[_0x499b('0x19')](function(_0x1c2819){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x3ba68f,_0x1c2819);_0x393374(_0x1c2819);});});}exports[_0x499b('0x1a')]=function(_0x6357f9){var _0x3a6bd3=this;return new Promise(function(_0x306248,_0x3a1d15){return db[_0x499b('0x1b')][_0x499b('0x1c')](_0x6357f9['body'],{'raw':_0x6357f9[_0x499b('0x1d')]?_0x6357f9[_0x499b('0x1d')][_0x499b('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6357f9[_0x499b('0x1d')]?_0x6357f9[_0x499b('0x1d')][_0x499b('0x1f')]||null:null,'attributes':_0x6357f9[_0x499b('0x1d')]?_0x6357f9['options']['attributes']||null:null,'limit':_0x6357f9[_0x499b('0x1d')]?_0x6357f9[_0x499b('0x1d')][_0x499b('0x20')]||null:null})['then'](function(_0x3e4580){logger[_0x499b('0xf')](_0x499b('0x1a'),_0x6357f9);logger[_0x499b('0x12')](_0x499b('0x1a'),_0x6357f9,JSON[_0x499b('0x14')](_0x3e4580));_0x306248(_0x3e4580);})['catch'](function(_0x477039){logger[_0x499b('0x15')]('UpdateChatInteraction',_0x477039[_0x499b('0x17')],_0x6357f9);_0x3a1d15(_0x3a6bd3[_0x499b('0x15')](0x1f4,_0x477039[_0x499b('0x17')]));});});};exports[_0x499b('0x21')]=function(_0x205610){return new Promise(function(_0x4f403c,_0x6c5fd6){return db[_0x499b('0x1b')][_0x499b('0x22')]({'where':_0x205610[_0x499b('0x1d')]?_0x205610[_0x499b('0x1d')][_0x499b('0x1f')]||null:null})[_0x499b('0xe')](function(_0xa641af){if(_0xa641af){return _0xa641af[_0x499b('0x23')](_0x205610[_0x499b('0x24')][_0x499b('0x25')],_[_0x499b('0x26')](_0x205610[_0x499b('0x24')],['ids','id'])||{});}})['spread'](function(_0xcfe9af){logger[_0x499b('0xf')](_0x499b('0x27'),_0x205610);logger[_0x499b('0x12')](_0x499b('0x27'),_0x205610,JSON[_0x499b('0x14')](_0xcfe9af));_0x4f403c(_0xcfe9af);})[_0x499b('0x19')](function(_0x2f30dc){logger[_0x499b('0x15')](_0x499b('0x27'),_0x2f30dc[_0x499b('0x17')],_0x205610);_0x6c5fd6(_this[_0x499b('0x15')](0x1f4,_0x2f30dc['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index b8eb231..578fc80 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 _0x4528=['save','remove','update','emit','removeListener','length','chatInteraction:','./chatInteraction.events'];(function(_0x1a4807,_0xc2cf93){var _0x5b8beb=function(_0x3449d5){while(--_0x3449d5){_0x1a4807['push'](_0x1a4807['shift']());}};_0x5b8beb(++_0xc2cf93);}(_0x4528,0x197));var _0x8452=function(_0x355326,_0x380e8b){_0x355326=_0x355326-0x0;var _0x4eb4af=_0x4528[_0x355326];return _0x4eb4af;};'use strict';var ChatInteractionEvents=require(_0x8452('0x0'));var events=[_0x8452('0x1'),_0x8452('0x2'),_0x8452('0x3')];function createListener(_0x27f286,_0x45e9bf){return function(_0x4ae8eb){_0x45e9bf[_0x8452('0x4')](_0x27f286,_0x4ae8eb);};}function removeListener(_0x535065,_0x2e3b54){return function(){ChatInteractionEvents[_0x8452('0x5')](_0x535065,_0x2e3b54);};}exports['register']=function(_0x3e8e98){for(var _0x3b108f=0x0,_0x19d095=events[_0x8452('0x6')];_0x3b108f<_0x19d095;_0x3b108f++){var _0x4fe809=events[_0x3b108f];var _0x40b7e7=createListener(_0x8452('0x7')+_0x4fe809,_0x3e8e98);ChatInteractionEvents['on'](_0x4fe809,_0x40b7e7);}};
\ No newline at end of file
+var _0x03d4=['save','remove','update','emit','length','chatInteraction:','./chatInteraction.events'];(function(_0x265aa2,_0x220072){var _0x447a3a=function(_0x1512cc){while(--_0x1512cc){_0x265aa2['push'](_0x265aa2['shift']());}};_0x447a3a(++_0x220072);}(_0x03d4,0x18e));var _0x403d=function(_0x196d49,_0x56dcb6){_0x196d49=_0x196d49-0x0;var _0x464b69=_0x03d4[_0x196d49];return _0x464b69;};'use strict';var ChatInteractionEvents=require(_0x403d('0x0'));var events=[_0x403d('0x1'),_0x403d('0x2'),_0x403d('0x3')];function createListener(_0x5923e4,_0x44e47a){return function(_0x41b51f){_0x44e47a[_0x403d('0x4')](_0x5923e4,_0x41b51f);};}function removeListener(_0x1ce2d0,_0x277d91){return function(){ChatInteractionEvents['removeListener'](_0x1ce2d0,_0x277d91);};}exports['register']=function(_0x50d741){for(var _0x5c65db=0x0,_0x334828=events[_0x403d('0x5')];_0x5c65db<_0x334828;_0x5c65db++){var _0x331883=events[_0x5c65db];var _0x296ed4=createListener(_0x403d('0x6')+_0x331883,_0x50d741);ChatInteractionEvents['on'](_0x331883,_0x296ed4);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 1c93622..c8f194e 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 _0x8fca=['root','server/files/attachments/','/:id/attachment_upload','single','file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','abandon','close','delete','chatinteraction:destroy','destroy','/:id/tags','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','diskStorage'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x8fca,0x12f));var _0xa8fc=function(_0x46dfe4,_0x5a4e9e){_0x46dfe4=_0x46dfe4-0x0;var _0x39c26f=_0x8fca[_0x46dfe4];return _0x39c26f;};'use strict';var multer=require(_0xa8fc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa8fc('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa8fc('0x2'));var auth=require(_0xa8fc('0x3'));var interaction=require(_0xa8fc('0x4'));var config=require('../../config/environment');var controller=require(_0xa8fc('0x5'));router[_0xa8fc('0x6')]('/',auth[_0xa8fc('0x7')](),controller[_0xa8fc('0x8')]);router[_0xa8fc('0x6')](_0xa8fc('0x9'),auth['isAuthenticated'](),controller[_0xa8fc('0xa')]);router['get'](_0xa8fc('0xb'),auth['isChatInteractionAuthorized'](),controller[_0xa8fc('0xc')]);router[_0xa8fc('0x6')](_0xa8fc('0xd'),auth[_0xa8fc('0xe')](),controller[_0xa8fc('0xf')]);router[_0xa8fc('0x6')](_0xa8fc('0x10'),auth[_0xa8fc('0x7')](),controller[_0xa8fc('0x11')]);router[_0xa8fc('0x6')](_0xa8fc('0x12'),auth['isChatInteractionAuthorized'](),controller[_0xa8fc('0x13')]);router[_0xa8fc('0x6')](_0xa8fc('0x14'),auth[_0xa8fc('0x7')](),controller[_0xa8fc('0x15')]);router[_0xa8fc('0x16')]('/',auth[_0xa8fc('0x7')](),controller[_0xa8fc('0x17')]);router['post'](_0xa8fc('0x18'),auth[_0xa8fc('0x7')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xa8fc('0x19')]({'destination':function(_0x89b405,_0x57550c,_0x6ca5c0){_0x6ca5c0(null,path['join'](config[_0xa8fc('0x1a')],_0xa8fc('0x1b')));},'filename':function(_0x214629,_0x4c32f4,_0x5b2e94){_0x5b2e94(null,util['format']('%s-%s',Date['now'](),_0x4c32f4['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa8fc('0x16')](_0xa8fc('0x1c'),upload[_0xa8fc('0x1d')](_0xa8fc('0x1e')),controller[_0xa8fc('0x1f')]);router[_0xa8fc('0x16')](_0xa8fc('0x10'),auth[_0xa8fc('0xe')](),controller[_0xa8fc('0x20')]);router[_0xa8fc('0x16')]('/:id/tags',auth[_0xa8fc('0x7')](),interaction[_0xa8fc('0x21')](_0xa8fc('0x22'),_0xa8fc('0x23')),controller['addTags']);router[_0xa8fc('0x24')](_0xa8fc('0xb'),auth[_0xa8fc('0x7')](),interaction[_0xa8fc('0x21')](_0xa8fc('0x22'),_0xa8fc('0x25')),controller[_0xa8fc('0x26')]);router[_0xa8fc('0x24')](_0xa8fc('0x27'),controller[_0xa8fc('0x28')]);router['put']('/:id/abandon',auth[_0xa8fc('0xe')](),controller[_0xa8fc('0x29')]);router[_0xa8fc('0x24')]('/:id/close',controller[_0xa8fc('0x2a')]);router[_0xa8fc('0x2b')](_0xa8fc('0xb'),auth['isAuthenticated'](),interaction[_0xa8fc('0x21')](_0xa8fc('0x22'),_0xa8fc('0x2c')),controller[_0xa8fc('0x2d')]);router['delete'](_0xa8fc('0x2e'),auth[_0xa8fc('0x7')](),controller['removeTags']);module['exports']=router;
\ No newline at end of file
+var _0xe8d1=['chatinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','/:id','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','isAuthenticated','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','createVidaooSession','diskStorage','join','root','server/files/attachments/','now','originalname','replace','file','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/close','close','delete'];(function(_0x1cb279,_0x5481b8){var _0x592903=function(_0x3f2e07){while(--_0x3f2e07){_0x1cb279['push'](_0x1cb279['shift']());}};_0x592903(++_0x5481b8);}(_0xe8d1,0x64));var _0x1e8d=function(_0x3b5e9f,_0x29601e){_0x3b5e9f=_0x3b5e9f-0x0;var _0x1e9a49=_0xe8d1[_0x3b5e9f];return _0x1e9a49;};'use strict';var multer=require('multer');var util=require(_0x1e8d('0x0'));var path=require(_0x1e8d('0x1'));var timeout=require(_0x1e8d('0x2'));var express=require(_0x1e8d('0x3'));var router=express[_0x1e8d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1e8d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1e8d('0x6'));var controller=require('./chatInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x1e8d('0x7')](_0x1e8d('0x8'),auth['isChatInteractionAuthorized'](),controller['show']);router[_0x1e8d('0x7')](_0x1e8d('0x9'),auth[_0x1e8d('0xa')](),controller[_0x1e8d('0xb')]);router[_0x1e8d('0x7')](_0x1e8d('0xc'),auth[_0x1e8d('0xd')](),controller[_0x1e8d('0xe')]);router['get'](_0x1e8d('0xf'),auth[_0x1e8d('0xa')](),controller[_0x1e8d('0x10')]);router[_0x1e8d('0x7')](_0x1e8d('0x11'),auth[_0x1e8d('0xd')](),controller[_0x1e8d('0x12')]);router[_0x1e8d('0x13')]('/',auth['isAuthenticated'](),controller[_0x1e8d('0x14')]);router['post']('/:id/vidaoo',auth[_0x1e8d('0xd')](),controller[_0x1e8d('0x15')]);var upload=multer({'storage':multer[_0x1e8d('0x16')]({'destination':function(_0x18e86f,_0x24f81d,_0x1d1ba6){_0x1d1ba6(null,path[_0x1e8d('0x17')](config[_0x1e8d('0x18')],_0x1e8d('0x19')));},'filename':function(_0x163bb8,_0x2d3782,_0x5f094e){_0x5f094e(null,util['format']('%s-%s',Date[_0x1e8d('0x1a')](),_0x2d3782[_0x1e8d('0x1b')][_0x1e8d('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x1e8d('0x13')]('/:id/attachment_upload',upload['single'](_0x1e8d('0x1d')),controller[_0x1e8d('0x1e')]);router[_0x1e8d('0x13')](_0x1e8d('0xc'),auth[_0x1e8d('0xa')](),controller['addMessage']);router[_0x1e8d('0x13')](_0x1e8d('0x1f'),auth[_0x1e8d('0xd')](),interaction[_0x1e8d('0x20')](_0x1e8d('0x21'),_0x1e8d('0x22')),controller[_0x1e8d('0x23')]);router[_0x1e8d('0x24')](_0x1e8d('0x8'),auth[_0x1e8d('0xd')](),interaction[_0x1e8d('0x20')](_0x1e8d('0x21'),_0x1e8d('0x25')),controller[_0x1e8d('0x26')]);router['put'](_0x1e8d('0x27'),controller[_0x1e8d('0x28')]);router[_0x1e8d('0x24')]('/:id/abandon',auth[_0x1e8d('0xa')](),controller['abandon']);router['put'](_0x1e8d('0x29'),controller[_0x1e8d('0x2a')]);router[_0x1e8d('0x2b')]('/:id',auth[_0x1e8d('0xd')](),interaction['tracked'](_0x1e8d('0x21'),_0x1e8d('0x2c')),controller[_0x1e8d('0x2d')]);router[_0x1e8d('0x2b')](_0x1e8d('0x1f'),auth[_0x1e8d('0xd')](),controller[_0x1e8d('0x2e')]);module[_0x1e8d('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 54bc7ea..ef75b35 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 _0x1ff2=['exports','medium','sequelize'];(function(_0x411b68,_0x52e768){var _0x41ff90=function(_0x2ab602){while(--_0x2ab602){_0x411b68['push'](_0x411b68['shift']());}};_0x41ff90(++_0x52e768);}(_0x1ff2,0x6e));var _0x21ff=function(_0x504095,_0x56da2e){_0x504095=_0x504095-0x0;var _0x3a00be=_0x1ff2[_0x504095];return _0x3a00be;};'use strict';var Sequelize=require(_0x21ff('0x0'));module[_0x21ff('0x1')]={'body':{'type':Sequelize['TEXT'](_0x21ff('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xdc89=['sequelize','TEXT','BOOLEAN','INTEGER'];(function(_0x1f3445,_0x36a853){var _0x1c070b=function(_0x3d9f2d){while(--_0x3d9f2d){_0x1f3445['push'](_0x1f3445['shift']());}};_0x1c070b(++_0x36a853);}(_0xdc89,0x84));var _0x9dc8=function(_0x33eb5c,_0x4a7d98){_0x33eb5c=_0x33eb5c-0x0;var _0x253328=_0xdc89[_0x33eb5c];return _0x253328;};'use strict';var Sequelize=require(_0x9dc8('0x0'));module['exports']={'body':{'type':Sequelize[_0x9dc8('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x9dc8('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x9dc8('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index ca034c4..36439d8 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 _0x5061=['hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','includeAll','include','findAll','rows','show','params','options','find','create','body','update','catch','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','getUsers','agent','admin','user','role','userpic','online','allowmessenger','showWebBar','-online','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','all','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','undefined','limit','count','offset','set','json','apply','reject','save','then','destroy','sendStatus','error','stack','name','index','ChatInternalMessage','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length'];(function(_0x3b8311,_0x219685){var _0x2565bd=function(_0x40b4d){while(--_0x40b4d){_0x3b8311['push'](_0x3b8311['shift']());}};_0x2565bd(++_0x219685);}(_0x5061,0x114));var _0x1506=function(_0x3d56d5,_0x492dc9){_0x3d56d5=_0x3d56d5-0x0;var _0x50b4f3=_0x5061[_0x3d56d5];return _0x50b4f3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1506('0x0'));var zipdir=require(_0x1506('0x1'));var jsonpatch=require(_0x1506('0x2'));var rp=require(_0x1506('0x3'));var moment=require(_0x1506('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1506('0x5'));var util=require(_0x1506('0x6'));var path=require(_0x1506('0x7'));var sox=require(_0x1506('0x8'));var csv=require(_0x1506('0x9'));var ejs=require(_0x1506('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1506('0xb'));var crypto=require(_0x1506('0xc'));var jsforce=require(_0x1506('0xd'));var deskjs=require(_0x1506('0xe'));var toCsv=require(_0x1506('0x9'));var querystring=require(_0x1506('0xf'));var Papa=require(_0x1506('0x10'));var Redis=require('ioredis');var authService=require(_0x1506('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1506('0x12'));var hardwareService=require(_0x1506('0x13'));var logger=require(_0x1506('0x14'))('api');var utils=require(_0x1506('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1506('0x16'));var db=require(_0x1506('0x17'))['db'];config[_0x1506('0x18')]=_[_0x1506('0x19')](config[_0x1506('0x18')],{'host':_0x1506('0x1a'),'port':0x18eb});var socket=require(_0x1506('0x1b'))(new Redis(config[_0x1506('0x18')]));require('./chatInternalMessage.socket')[_0x1506('0x1c')](socket);function respondWithStatusCode(_0x4b8abd,_0x4e3bf8){_0x4e3bf8=_0x4e3bf8||0xcc;return function(_0x276b4a){if(_0x276b4a){return _0x4b8abd['sendStatus'](_0x4e3bf8);}return _0x4b8abd[_0x1506('0x1d')](_0x4e3bf8)[_0x1506('0x1e')]();};}function respondWithResult(_0xebf3e4,_0x375c40){_0x375c40=_0x375c40||0xc8;return function(_0x2effac){if(_0x2effac){return _0xebf3e4[_0x1506('0x1d')](_0x375c40)['json'](_0x2effac);}};}function respondWithFilteredResult(_0x373a49,_0x4a6e71){return function(_0x30c043){if(_0x30c043){var _0x2a076f=typeof _0x4a6e71['offset']===_0x1506('0x1f')&&typeof _0x4a6e71[_0x1506('0x20')]===_0x1506('0x1f');var _0x35c7be=_0x30c043[_0x1506('0x21')];var _0x1b6f78=_0x2a076f?0x0:_0x4a6e71['offset'];var _0x33dfe9=_0x2a076f?_0x30c043[_0x1506('0x21')]:_0x4a6e71[_0x1506('0x22')]+_0x4a6e71[_0x1506('0x20')];var _0x20034e;if(_0x33dfe9>=_0x35c7be){_0x33dfe9=_0x35c7be;_0x20034e=0xc8;}else{_0x20034e=0xce;}_0x373a49[_0x1506('0x1d')](_0x20034e);return _0x373a49[_0x1506('0x23')]('Content-Range',_0x1b6f78+'-'+_0x33dfe9+'/'+_0x35c7be)[_0x1506('0x24')](_0x30c043);}return null;};}function patchUpdates(_0x3a4dc2){return function(_0x5d192c){try{jsonpatch[_0x1506('0x25')](_0x5d192c,_0x3a4dc2,!![]);}catch(_0x16ff84){return BPromise[_0x1506('0x26')](_0x16ff84);}return _0x5d192c[_0x1506('0x27')]();};}function saveUpdates(_0x5b4a6e,_0x422d23){return function(_0x243907){if(_0x243907){return _0x243907['update'](_0x5b4a6e)[_0x1506('0x28')](function(_0x515b23){return _0x515b23;});}return null;};}function removeEntity(_0x39e506,_0xefe97d){return function(_0x48a9b9){if(_0x48a9b9){return _0x48a9b9[_0x1506('0x29')]()['then'](function(){_0x39e506[_0x1506('0x1d')](0xcc)[_0x1506('0x1e')]();});}};}function handleEntityNotFound(_0xa58810,_0x3a8517){return function(_0x32579e){if(!_0x32579e){_0xa58810[_0x1506('0x2a')](0x194);}return _0x32579e;};}function handleError(_0x589818,_0x353790){_0x353790=_0x353790||0x1f4;return function(_0x3b9fe2){logger[_0x1506('0x2b')](_0x3b9fe2[_0x1506('0x2c')]);if(_0x3b9fe2[_0x1506('0x2d')]){delete _0x3b9fe2[_0x1506('0x2d')];}_0x589818[_0x1506('0x1d')](_0x353790)['send'](_0x3b9fe2);};}exports[_0x1506('0x2e')]=function(_0x260c6e,_0x1ddd1a){var _0x53761b={},_0x1177fe={},_0xacf270={'count':0x0,'rows':[]};var _0x25f561=_['map'](db[_0x1506('0x2f')][_0x1506('0x30')],function(_0x25d9c0){return{'name':_0x25d9c0[_0x1506('0x31')],'type':_0x25d9c0[_0x1506('0x32')][_0x1506('0x33')]};});_0x1177fe[_0x1506('0x34')]=_[_0x1506('0x35')](_0x25f561,_0x1506('0x2d'));_0x1177fe[_0x1506('0x36')]=_[_0x1506('0x37')](_0x260c6e[_0x1506('0x36')]);_0x1177fe['filters']=_[_0x1506('0x38')](_0x1177fe[_0x1506('0x34')],_0x1177fe[_0x1506('0x36')]);_0x53761b[_0x1506('0x39')]=_[_0x1506('0x38')](_0x1177fe['model'],qs['fields'](_0x260c6e[_0x1506('0x36')][_0x1506('0x3a')]));_0x53761b[_0x1506('0x39')]=_0x53761b['attributes'][_0x1506('0x3b')]?_0x53761b[_0x1506('0x39')]:_0x1177fe[_0x1506('0x34')];if(!_0x260c6e[_0x1506('0x36')][_0x1506('0x3c')](_0x1506('0x3d'))){_0x53761b['limit']=qs['limit'](_0x260c6e['query'][_0x1506('0x20')]);_0x53761b[_0x1506('0x22')]=qs['offset'](_0x260c6e['query'][_0x1506('0x22')]);}_0x53761b[_0x1506('0x3e')]=qs[_0x1506('0x3f')](_0x260c6e['query'][_0x1506('0x3f')]);_0x53761b['where']=qs[_0x1506('0x40')](_[_0x1506('0x41')](_0x260c6e[_0x1506('0x36')],_0x1177fe[_0x1506('0x40')]),_0x25f561);if(_0x260c6e[_0x1506('0x36')][_0x1506('0x42')]){_0x53761b['where']=_[_0x1506('0x43')](_0x53761b[_0x1506('0x44')],{'$or':_['map'](_0x25f561,function(_0x9cd739){if(_0x9cd739[_0x1506('0x32')]!=='VIRTUAL'){var _0x4a50fc={};_0x4a50fc[_0x9cd739[_0x1506('0x2d')]]={'$like':'%'+_0x260c6e[_0x1506('0x36')]['filter']+'%'};return _0x4a50fc;}})});}_0x53761b=_[_0x1506('0x43')]({},_0x53761b,_0x260c6e['options']);var _0x42b9b5={'where':_0x53761b[_0x1506('0x44')]};return db['ChatInternalMessage']['count'](_0x42b9b5)['then'](function(_0x48dc65){_0xacf270[_0x1506('0x21')]=_0x48dc65;if(_0x260c6e[_0x1506('0x36')][_0x1506('0x45')]){_0x53761b[_0x1506('0x46')]=[{'all':!![]}];}return db[_0x1506('0x2f')][_0x1506('0x47')](_0x53761b);})[_0x1506('0x28')](function(_0x1b5d78){_0xacf270[_0x1506('0x48')]=_0x1b5d78;return _0xacf270;})[_0x1506('0x28')](respondWithFilteredResult(_0x1ddd1a,_0x53761b))['catch'](handleError(_0x1ddd1a,null));};exports[_0x1506('0x49')]=function(_0x26c63e,_0xec1157){var _0x50689b={'raw':!![],'where':{'id':_0x26c63e[_0x1506('0x4a')]['id']}},_0x293934={};_0x293934['model']=_[_0x1506('0x37')](db[_0x1506('0x2f')][_0x1506('0x30')]);_0x293934['query']=_[_0x1506('0x37')](_0x26c63e[_0x1506('0x36')]);_0x293934[_0x1506('0x40')]=_['intersection'](_0x293934[_0x1506('0x34')],_0x293934['query']);_0x50689b[_0x1506('0x39')]=_[_0x1506('0x38')](_0x293934['model'],qs[_0x1506('0x3a')](_0x26c63e[_0x1506('0x36')]['fields']));_0x50689b['attributes']=_0x50689b[_0x1506('0x39')][_0x1506('0x3b')]?_0x50689b[_0x1506('0x39')]:_0x293934[_0x1506('0x34')];if(_0x26c63e[_0x1506('0x36')][_0x1506('0x45')]){_0x50689b['include']=[{'all':!![]}];}_0x50689b=_['merge']({},_0x50689b,_0x26c63e[_0x1506('0x4b')]);return db['ChatInternalMessage'][_0x1506('0x4c')](_0x50689b)[_0x1506('0x28')](handleEntityNotFound(_0xec1157,null))['then'](respondWithResult(_0xec1157,null))['catch'](handleError(_0xec1157,null));};exports[_0x1506('0x4d')]=function(_0x41bba5,_0x35ccd7){return db[_0x1506('0x2f')][_0x1506('0x4d')](_0x41bba5[_0x1506('0x4e')],{})[_0x1506('0x28')](respondWithResult(_0x35ccd7,0xc9))['catch'](handleError(_0x35ccd7,null));};exports[_0x1506('0x4f')]=function(_0x2106a4,_0x247fab){if(_0x2106a4['body']['id']){delete _0x2106a4[_0x1506('0x4e')]['id'];}return db[_0x1506('0x2f')][_0x1506('0x4c')]({'where':{'id':_0x2106a4['params']['id']}})['then'](handleEntityNotFound(_0x247fab,null))['then'](saveUpdates(_0x2106a4[_0x1506('0x4e')],null))['then'](respondWithResult(_0x247fab,null))[_0x1506('0x50')](handleError(_0x247fab,null));};exports[_0x1506('0x29')]=function(_0x5d047c,_0x1945e9){return db[_0x1506('0x2f')][_0x1506('0x4c')]({'where':{'id':_0x5d047c['params']['id']}})[_0x1506('0x28')](handleEntityNotFound(_0x1945e9,null))[_0x1506('0x28')](removeEntity(_0x1945e9,null))[_0x1506('0x50')](handleError(_0x1945e9,null));};exports['describe']=function(_0x3bcc09,_0x337108){return db['ChatInternalMessage'][_0x1506('0x51')]()[_0x1506('0x28')](respondWithResult(_0x337108,null))[_0x1506('0x50')](handleError(_0x337108,null));};function wrapUser(_0x13a269){return function(_0x3033e6){var _0x44d1e1=_0x13a269[_0x1506('0x52')]({'plain':!![]});_0x44d1e1[_0x1506('0x53')]=[];if(_0x3033e6){_0x44d1e1[_0x1506('0x54')]=_0x3033e6[_0x1506('0x55')];_0x44d1e1[_0x1506('0x56')]=_0x3033e6;}else{_0x44d1e1[_0x1506('0x54')]=moment(0x0)[_0x1506('0x57')]('YYYY-MM-DD\x20HH:mm:ss');_0x44d1e1[_0x1506('0x56')]={};}return _0x44d1e1;};}exports[_0x1506('0x58')]=function(_0x1f15c4,_0x1d72ab,_0x4ac52d){var _0x9a8a8b=[];return db['User']['findAll']({'where':{'role':[_0x1506('0x59'),_0x1506('0x5a'),_0x1506('0x5b')]},'attributes':['id','fullname','name',_0x1506('0x5c'),_0x1506('0x5d'),'internal',_0x1506('0x5e'),'lastLoginAt',_0x1506('0x5f'),_0x1506('0x60')],'order':qs[_0x1506('0x3f')](_0x1506('0x61')),'include':[{'model':db[_0x1506('0x62')],'as':'VoiceQueues','attributes':['id',_0x1506('0x2d'),_0x1506('0x32')],'through':{'attributes':[]}}]})[_0x1506('0x28')](function(_0xec2225){if(_0xec2225){var _0x4804bf=_0x1f15c4[_0x1506('0x5b')][_0x1506('0x52')]({'plain':!![]});if(!_0x4804bf)throw new Error(_0x1506('0x63'));if(_0x4804bf[_0x1506('0x5c')]===_0x1506('0x5b')){return db[_0x1506('0x64')][_0x1506('0x4c')]({'where':{'name':_0x1506('0x65'),'userProfileId':_0x4804bf['userProfileId']},'raw':!![]})[_0x1506('0x28')](function(_0x50a1a4){if(_0x50a1a4){if(_0x50a1a4[_0x1506('0x66')]===0x0){return db[_0x1506('0x67')][_0x1506('0x47')]({'where':{'sectionId':_0x50a1a4['id']},'raw':!![]})[_0x1506('0x28')](function(_0x5d9807){var _0x51d94c=[];if(_[_0x1506('0x68')](_0x5d9807)){_0x51d94c=_[_0x1506('0x42')](_0xec2225,function(_0x2c2051){if(_0x2c2051[_0x1506('0x5c')]!=='agent'){return _0x2c2051;}});return _0x51d94c;}else{for(var _0x5361f3=0x0;_0x5361f3<_0xec2225[_0x1506('0x3b')];_0x5361f3++){var _0x4eea2f=_0xec2225[_0x5361f3];if(_0x4eea2f['role']===_0x1506('0x59')){var _0xb60122=_['find'](_0x5d9807,function(_0x7c0087){return _0x7c0087[_0x1506('0x69')]===_0x4eea2f['id'];});if(_0xb60122)_0x51d94c['push'](_0x4eea2f);}else{_0x51d94c[_0x1506('0x6a')](_0x4eea2f);}}return _0x51d94c;}});}else{return _0xec2225;}}else{var _0x38f525=_[_0x1506('0x42')](_0xec2225,function(_0x51ba58){if(_0x51ba58[_0x1506('0x5c')]!==_0x1506('0x59')){return _0x51ba58;}});return _0x38f525;}});}else{return _0xec2225;}}})[_0x1506('0x28')](function(_0x5757de){var _0x174ffa=[];if(_0x5757de){_0x9a8a8b=_0x5757de;for(var _0x33c050=0x0;_0x33c050<_0x5757de[_0x1506('0x3b')];_0x33c050+=0x1){_0x9a8a8b[_0x33c050]['messages']=[];_0x174ffa[_0x1506('0x6a')](db[_0x1506('0x2f')][_0x1506('0x4c')]({'where':{'FromId':[_0x1f15c4[_0x1506('0x5b')]['id'],_0x5757de[_0x33c050]['id']],'ToId':[_0x1f15c4[_0x1506('0x5b')]['id'],_0x5757de[_0x33c050]['id']],'ChatGroupId':null},'attributes':['id',_0x1506('0x55'),_0x1506('0x6b'),_0x1506('0x6c'),_0x1506('0x6d'),_0x1506('0x4e')],'order':qs[_0x1506('0x3f')](_0x1506('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x1506('0x28')](wrapUser(_0x5757de[_0x33c050])));}return BPromise[_0x1506('0x6f')](_0x174ffa);}return[];})['then'](function(_0x4f76de){return{'rows':_0x4f76de,'count':_0x4f76de[_0x1506('0x3b')]};})['then'](respondWithResult(_0x1d72ab,null))[_0x1506('0x50')](handleError(_0x1d72ab,null));};
\ No newline at end of file
+var _0xad80=['./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','apply','save','update','then','error','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch','params','ChatInternalMessage','length','options','find','create','body','destroy','describe','get','messages','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','online','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','read','-createdAt','all','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter'];(function(_0x1982f2,_0x3dabdc){var _0x3f6eff=function(_0x5f3e56){while(--_0x5f3e56){_0x1982f2['push'](_0x1982f2['shift']());}};_0x3f6eff(++_0x3dabdc);}(_0xad80,0x1aa));var _0x0ad8=function(_0x6e2bdd,_0xb7cffa){_0x6e2bdd=_0x6e2bdd-0x0;var _0x49470f=_0xad80[_0x6e2bdd];return _0x49470f;};'use strict';var emlformat=require(_0x0ad8('0x0'));var rimraf=require(_0x0ad8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0ad8('0x2'));var rp=require(_0x0ad8('0x3'));var moment=require(_0x0ad8('0x4'));var BPromise=require(_0x0ad8('0x5'));var Mustache=require(_0x0ad8('0x6'));var util=require(_0x0ad8('0x7'));var path=require('path');var sox=require(_0x0ad8('0x8'));var csv=require(_0x0ad8('0x9'));var ejs=require(_0x0ad8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0ad8('0xb'));var squel=require(_0x0ad8('0xc'));var crypto=require(_0x0ad8('0xd'));var jsforce=require(_0x0ad8('0xe'));var deskjs=require(_0x0ad8('0xf'));var toCsv=require(_0x0ad8('0x9'));var querystring=require(_0x0ad8('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0ad8('0x11'));var qs=require(_0x0ad8('0x12'));var as=require(_0x0ad8('0x13'));var hardwareService=require(_0x0ad8('0x14'));var logger=require(_0x0ad8('0x15'))(_0x0ad8('0x16'));var utils=require(_0x0ad8('0x17'));var config=require(_0x0ad8('0x18'));var licenseUtil=require(_0x0ad8('0x19'));var db=require('../../mysqldb')['db'];config[_0x0ad8('0x1a')]=_[_0x0ad8('0x1b')](config[_0x0ad8('0x1a')],{'host':_0x0ad8('0x1c'),'port':0x18eb});var socket=require(_0x0ad8('0x1d'))(new Redis(config['redis']));require(_0x0ad8('0x1e'))[_0x0ad8('0x1f')](socket);function respondWithStatusCode(_0x4c4f91,_0x42ac63){_0x42ac63=_0x42ac63||0xcc;return function(_0x3ce621){if(_0x3ce621){return _0x4c4f91[_0x0ad8('0x20')](_0x42ac63);}return _0x4c4f91[_0x0ad8('0x21')](_0x42ac63)[_0x0ad8('0x22')]();};}function respondWithResult(_0x57d35d,_0x3bd0c0){_0x3bd0c0=_0x3bd0c0||0xc8;return function(_0x5ebdf1){if(_0x5ebdf1){return _0x57d35d[_0x0ad8('0x21')](_0x3bd0c0)[_0x0ad8('0x23')](_0x5ebdf1);}};}function respondWithFilteredResult(_0x1e99e9,_0x4150b1){return function(_0x5611c6){if(_0x5611c6){var _0x307302=typeof _0x4150b1[_0x0ad8('0x24')]==='undefined'&&typeof _0x4150b1['limit']===_0x0ad8('0x25');var _0x7dc6c2=_0x5611c6['count'];var _0x10c428=_0x307302?0x0:_0x4150b1[_0x0ad8('0x24')];var _0x3603f7=_0x307302?_0x5611c6[_0x0ad8('0x26')]:_0x4150b1[_0x0ad8('0x24')]+_0x4150b1[_0x0ad8('0x27')];var _0x3a1838;if(_0x3603f7>=_0x7dc6c2){_0x3603f7=_0x7dc6c2;_0x3a1838=0xc8;}else{_0x3a1838=0xce;}_0x1e99e9[_0x0ad8('0x21')](_0x3a1838);return _0x1e99e9['set']('Content-Range',_0x10c428+'-'+_0x3603f7+'/'+_0x7dc6c2)['json'](_0x5611c6);}return null;};}function patchUpdates(_0x52d8ee){return function(_0x213e16){try{jsonpatch[_0x0ad8('0x28')](_0x213e16,_0x52d8ee,!![]);}catch(_0x1786e6){return BPromise['reject'](_0x1786e6);}return _0x213e16[_0x0ad8('0x29')]();};}function saveUpdates(_0x1dd50b,_0x788864){return function(_0x27d8b0){if(_0x27d8b0){return _0x27d8b0[_0x0ad8('0x2a')](_0x1dd50b)[_0x0ad8('0x2b')](function(_0xc94985){return _0xc94985;});}return null;};}function removeEntity(_0x1f169c,_0x155172){return function(_0x48d9a3){if(_0x48d9a3){return _0x48d9a3['destroy']()['then'](function(){_0x1f169c[_0x0ad8('0x21')](0xcc)[_0x0ad8('0x22')]();});}};}function handleEntityNotFound(_0x51e646,_0x3da3f0){return function(_0x5f3687){if(!_0x5f3687){_0x51e646[_0x0ad8('0x20')](0x194);}return _0x5f3687;};}function handleError(_0x10dc69,_0x1c61ea){_0x1c61ea=_0x1c61ea||0x1f4;return function(_0x62fe9c){logger[_0x0ad8('0x2c')](_0x62fe9c[_0x0ad8('0x2d')]);if(_0x62fe9c[_0x0ad8('0x2e')]){delete _0x62fe9c[_0x0ad8('0x2e')];}_0x10dc69[_0x0ad8('0x21')](_0x1c61ea)[_0x0ad8('0x2f')](_0x62fe9c);};}exports['index']=function(_0x190384,_0x2aea37){var _0x2bea4a={},_0x483152={},_0x2c9f5b={'count':0x0,'rows':[]};var _0x4e5878=_[_0x0ad8('0x30')](db['ChatInternalMessage'][_0x0ad8('0x31')],function(_0x2e656d){return{'name':_0x2e656d[_0x0ad8('0x32')],'type':_0x2e656d['type'][_0x0ad8('0x33')]};});_0x483152[_0x0ad8('0x34')]=_[_0x0ad8('0x30')](_0x4e5878,_0x0ad8('0x2e'));_0x483152[_0x0ad8('0x35')]=_[_0x0ad8('0x36')](_0x190384[_0x0ad8('0x35')]);_0x483152[_0x0ad8('0x37')]=_[_0x0ad8('0x38')](_0x483152[_0x0ad8('0x34')],_0x483152[_0x0ad8('0x35')]);_0x2bea4a[_0x0ad8('0x39')]=_[_0x0ad8('0x38')](_0x483152['model'],qs[_0x0ad8('0x3a')](_0x190384[_0x0ad8('0x35')][_0x0ad8('0x3a')]));_0x2bea4a[_0x0ad8('0x39')]=_0x2bea4a['attributes']['length']?_0x2bea4a[_0x0ad8('0x39')]:_0x483152[_0x0ad8('0x34')];if(!_0x190384[_0x0ad8('0x35')][_0x0ad8('0x3b')](_0x0ad8('0x3c'))){_0x2bea4a[_0x0ad8('0x27')]=qs[_0x0ad8('0x27')](_0x190384['query'][_0x0ad8('0x27')]);_0x2bea4a[_0x0ad8('0x24')]=qs[_0x0ad8('0x24')](_0x190384[_0x0ad8('0x35')]['offset']);}_0x2bea4a[_0x0ad8('0x3d')]=qs[_0x0ad8('0x3e')](_0x190384[_0x0ad8('0x35')][_0x0ad8('0x3e')]);_0x2bea4a[_0x0ad8('0x3f')]=qs[_0x0ad8('0x37')](_[_0x0ad8('0x40')](_0x190384[_0x0ad8('0x35')],_0x483152['filters']),_0x4e5878);if(_0x190384['query']['filter']){_0x2bea4a[_0x0ad8('0x3f')]=_['merge'](_0x2bea4a['where'],{'$or':_[_0x0ad8('0x30')](_0x4e5878,function(_0x5c2245){if(_0x5c2245[_0x0ad8('0x41')]!==_0x0ad8('0x42')){var _0x25089c={};_0x25089c[_0x5c2245[_0x0ad8('0x2e')]]={'$like':'%'+_0x190384['query'][_0x0ad8('0x43')]+'%'};return _0x25089c;}})});}_0x2bea4a=_[_0x0ad8('0x44')]({},_0x2bea4a,_0x190384['options']);var _0x26adc8={'where':_0x2bea4a['where']};return db['ChatInternalMessage']['count'](_0x26adc8)[_0x0ad8('0x2b')](function(_0x3ae0cf){_0x2c9f5b[_0x0ad8('0x26')]=_0x3ae0cf;if(_0x190384[_0x0ad8('0x35')][_0x0ad8('0x45')]){_0x2bea4a[_0x0ad8('0x46')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x0ad8('0x47')](_0x2bea4a);})[_0x0ad8('0x2b')](function(_0x86d201){_0x2c9f5b[_0x0ad8('0x48')]=_0x86d201;return _0x2c9f5b;})['then'](respondWithFilteredResult(_0x2aea37,_0x2bea4a))[_0x0ad8('0x49')](handleError(_0x2aea37,null));};exports['show']=function(_0x2aeb9f,_0x40267d){var _0x384941={'raw':!![],'where':{'id':_0x2aeb9f[_0x0ad8('0x4a')]['id']}},_0x1fc637={};_0x1fc637['model']=_[_0x0ad8('0x36')](db[_0x0ad8('0x4b')][_0x0ad8('0x31')]);_0x1fc637[_0x0ad8('0x35')]=_['keys'](_0x2aeb9f[_0x0ad8('0x35')]);_0x1fc637[_0x0ad8('0x37')]=_[_0x0ad8('0x38')](_0x1fc637[_0x0ad8('0x34')],_0x1fc637[_0x0ad8('0x35')]);_0x384941[_0x0ad8('0x39')]=_['intersection'](_0x1fc637[_0x0ad8('0x34')],qs['fields'](_0x2aeb9f['query'][_0x0ad8('0x3a')]));_0x384941[_0x0ad8('0x39')]=_0x384941[_0x0ad8('0x39')][_0x0ad8('0x4c')]?_0x384941[_0x0ad8('0x39')]:_0x1fc637[_0x0ad8('0x34')];if(_0x2aeb9f[_0x0ad8('0x35')]['includeAll']){_0x384941[_0x0ad8('0x46')]=[{'all':!![]}];}_0x384941=_[_0x0ad8('0x44')]({},_0x384941,_0x2aeb9f[_0x0ad8('0x4d')]);return db[_0x0ad8('0x4b')][_0x0ad8('0x4e')](_0x384941)[_0x0ad8('0x2b')](handleEntityNotFound(_0x40267d,null))[_0x0ad8('0x2b')](respondWithResult(_0x40267d,null))[_0x0ad8('0x49')](handleError(_0x40267d,null));};exports[_0x0ad8('0x4f')]=function(_0x53ea4f,_0x4de9a3){return db['ChatInternalMessage']['create'](_0x53ea4f[_0x0ad8('0x50')],{})[_0x0ad8('0x2b')](respondWithResult(_0x4de9a3,0xc9))[_0x0ad8('0x49')](handleError(_0x4de9a3,null));};exports[_0x0ad8('0x2a')]=function(_0x52a5ce,_0x4ada5f){if(_0x52a5ce['body']['id']){delete _0x52a5ce[_0x0ad8('0x50')]['id'];}return db[_0x0ad8('0x4b')]['find']({'where':{'id':_0x52a5ce['params']['id']}})[_0x0ad8('0x2b')](handleEntityNotFound(_0x4ada5f,null))[_0x0ad8('0x2b')](saveUpdates(_0x52a5ce[_0x0ad8('0x50')],null))['then'](respondWithResult(_0x4ada5f,null))[_0x0ad8('0x49')](handleError(_0x4ada5f,null));};exports[_0x0ad8('0x51')]=function(_0x14b432,_0x3a4603){return db[_0x0ad8('0x4b')][_0x0ad8('0x4e')]({'where':{'id':_0x14b432[_0x0ad8('0x4a')]['id']}})[_0x0ad8('0x2b')](handleEntityNotFound(_0x3a4603,null))[_0x0ad8('0x2b')](removeEntity(_0x3a4603,null))[_0x0ad8('0x49')](handleError(_0x3a4603,null));};exports['describe']=function(_0x47bb6e,_0x540cb5){return db[_0x0ad8('0x4b')][_0x0ad8('0x52')]()[_0x0ad8('0x2b')](respondWithResult(_0x540cb5,null))[_0x0ad8('0x49')](handleError(_0x540cb5,null));};function wrapUser(_0xb8e3ea){return function(_0x1c798d){var _0x528743=_0xb8e3ea[_0x0ad8('0x53')]({'plain':!![]});_0x528743[_0x0ad8('0x54')]=[];if(_0x1c798d){_0x528743[_0x0ad8('0x55')]=_0x1c798d[_0x0ad8('0x56')];_0x528743[_0x0ad8('0x57')]=_0x1c798d;}else{_0x528743['lastMessageAt']=moment(0x0)['format'](_0x0ad8('0x58'));_0x528743[_0x0ad8('0x57')]={};}return _0x528743;};}exports[_0x0ad8('0x59')]=function(_0x2def78,_0xed9cb1,_0x14e608){var _0x411a87=[];return db[_0x0ad8('0x5a')][_0x0ad8('0x47')]({'where':{'role':[_0x0ad8('0x5b'),_0x0ad8('0x5c'),_0x0ad8('0x5d')]},'attributes':['id',_0x0ad8('0x5e'),_0x0ad8('0x2e'),_0x0ad8('0x5f'),'userpic','internal',_0x0ad8('0x60'),'lastLoginAt',_0x0ad8('0x61'),_0x0ad8('0x62')],'order':qs[_0x0ad8('0x3e')]('-online'),'include':[{'model':db[_0x0ad8('0x63')],'as':_0x0ad8('0x64'),'attributes':['id',_0x0ad8('0x2e'),_0x0ad8('0x41')],'through':{'attributes':[]}}]})[_0x0ad8('0x2b')](function(_0x239028){if(_0x239028){var _0x3c0393=_0x2def78[_0x0ad8('0x5d')][_0x0ad8('0x53')]({'plain':!![]});if(!_0x3c0393)throw new Error(_0x0ad8('0x65'));if(_0x3c0393['role']===_0x0ad8('0x5d')){return db[_0x0ad8('0x66')][_0x0ad8('0x4e')]({'where':{'name':_0x0ad8('0x67'),'userProfileId':_0x3c0393[_0x0ad8('0x68')]},'raw':!![]})[_0x0ad8('0x2b')](function(_0x51f07f){if(_0x51f07f){if(_0x51f07f[_0x0ad8('0x69')]===0x0){return db[_0x0ad8('0x6a')][_0x0ad8('0x47')]({'where':{'sectionId':_0x51f07f['id']},'raw':!![]})['then'](function(_0x4e8539){var _0x493de5=[];if(_[_0x0ad8('0x6b')](_0x4e8539)){_0x493de5=_[_0x0ad8('0x43')](_0x239028,function(_0x55fcd0){if(_0x55fcd0[_0x0ad8('0x5f')]!==_0x0ad8('0x5b')){return _0x55fcd0;}});return _0x493de5;}else{for(var _0x317bb7=0x0;_0x317bb7<_0x239028[_0x0ad8('0x4c')];_0x317bb7++){var _0x10dd63=_0x239028[_0x317bb7];if(_0x10dd63['role']===_0x0ad8('0x5b')){var _0x969cf1=_['find'](_0x4e8539,function(_0x51686f){return _0x51686f[_0x0ad8('0x6c')]===_0x10dd63['id'];});if(_0x969cf1)_0x493de5[_0x0ad8('0x6d')](_0x10dd63);}else{_0x493de5['push'](_0x10dd63);}}return _0x493de5;}});}else{return _0x239028;}}else{var _0x314529=_[_0x0ad8('0x43')](_0x239028,function(_0x292993){if(_0x292993['role']!=='agent'){return _0x292993;}});return _0x314529;}});}else{return _0x239028;}}})['then'](function(_0x1eecf1){var _0x5b0eb6=[];if(_0x1eecf1){_0x411a87=_0x1eecf1;for(var _0x53547b=0x0;_0x53547b<_0x1eecf1[_0x0ad8('0x4c')];_0x53547b+=0x1){_0x411a87[_0x53547b][_0x0ad8('0x54')]=[];_0x5b0eb6[_0x0ad8('0x6d')](db[_0x0ad8('0x4b')][_0x0ad8('0x4e')]({'where':{'FromId':[_0x2def78['user']['id'],_0x1eecf1[_0x53547b]['id']],'ToId':[_0x2def78[_0x0ad8('0x5d')]['id'],_0x1eecf1[_0x53547b]['id']],'ChatGroupId':null},'attributes':['id',_0x0ad8('0x56'),_0x0ad8('0x6e'),'ToId',_0x0ad8('0x6f'),_0x0ad8('0x50')],'order':qs[_0x0ad8('0x3e')](_0x0ad8('0x70')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x0ad8('0x2b')](wrapUser(_0x1eecf1[_0x53547b])));}return BPromise[_0x0ad8('0x71')](_0x5b0eb6);}return[];})[_0x0ad8('0x2b')](function(_0x5a8776){return{'rows':_0x5a8776,'count':_0x5a8776[_0x0ad8('0x4c')]};})['then'](respondWithResult(_0xed9cb1,null))[_0x0ad8('0x49')](handleError(_0xed9cb1,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 5afefe0..d4491f1 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 _0xb0ee=['ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0xb0ee,0x18f));var _0xeb0e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb0ee[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xeb0e('0x0'))['db'][_0xeb0e('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xeb0e('0x2')](0x0);var events={'afterCreate':_0xeb0e('0x3'),'afterUpdate':_0xeb0e('0x4'),'afterDestroy':_0xeb0e('0x5')};function emitEvent(_0xa22c37){return function(_0x470baf,_0x441f55,_0x16f417){ChatInternalMessageEvents['emit'](_0xa22c37+':'+_0x470baf['id'],_0x470baf);ChatInternalMessageEvents[_0xeb0e('0x6')](_0xa22c37,_0x470baf);_0x16f417(null);};}for(var e in events){if(events[_0xeb0e('0x7')](e)){var event=events[e];ChatInternalMessage[_0xeb0e('0x8')](e,emitEvent(event));}}module[_0xeb0e('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xef75=['events','../../mysqldb','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x3f579c,_0x387015){var _0x469754=function(_0x461055){while(--_0x461055){_0x3f579c['push'](_0x3f579c['shift']());}};_0x469754(++_0x387015);}(_0xef75,0x13e));var _0x5ef7=function(_0x41267c,_0x3772dd){_0x41267c=_0x41267c-0x0;var _0x2d14b3=_0xef75[_0x41267c];return _0x2d14b3;};'use strict';var EventEmitter=require(_0x5ef7('0x0'));var ChatInternalMessage=require(_0x5ef7('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x5ef7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x5ef7('0x3')};function emitEvent(_0xd3e59a){return function(_0xaffe11,_0x1affad,_0x386209){ChatInternalMessageEvents[_0x5ef7('0x4')](_0xd3e59a+':'+_0xaffe11['id'],_0xaffe11);ChatInternalMessageEvents[_0x5ef7('0x4')](_0xd3e59a,_0xaffe11);_0x386209(null);};}for(var e in events){if(events[_0x5ef7('0x5')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 5696e1f..bb982e9 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 _0xacb9=['request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','util','api','moment','bluebird'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xacb9,0x1a9));var _0x9acb=function(_0xbf098b,_0x269d81){_0xbf098b=_0xbf098b-0x0;var _0x2f1446=_0xacb9[_0xbf098b];return _0x2f1446;};'use strict';var _=require('lodash');var util=require(_0x9acb('0x0'));var logger=require('../../config/logger')(_0x9acb('0x1'));var moment=require(_0x9acb('0x2'));var BPromise=require(_0x9acb('0x3'));var rp=require(_0x9acb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9acb('0x5'));var config=require(_0x9acb('0x6'));var attributes=require(_0x9acb('0x7'));module[_0x9acb('0x8')]=function(_0x2b06fb,_0x61e55e){return _0x2b06fb[_0x9acb('0x9')](_0x9acb('0xa'),attributes,{'tableName':_0x9acb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9acb('0xc')});};
\ No newline at end of file
+var _0x8efa=['api','moment','bluebird','path','rimraf','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','lodash','util','../../config/logger'];(function(_0x580cf8,_0x26751e){var _0xcc9a9e=function(_0x5a67ad){while(--_0x5a67ad){_0x580cf8['push'](_0x580cf8['shift']());}};_0xcc9a9e(++_0x26751e);}(_0x8efa,0xeb));var _0xa8ef=function(_0xdd5d8a,_0x16d52b){_0xdd5d8a=_0xdd5d8a-0x0;var _0x40a6c1=_0x8efa[_0xdd5d8a];return _0x40a6c1;};'use strict';var _=require(_0xa8ef('0x0'));var util=require(_0xa8ef('0x1'));var logger=require(_0xa8ef('0x2'))(_0xa8ef('0x3'));var moment=require(_0xa8ef('0x4'));var BPromise=require(_0xa8ef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa8ef('0x6'));var rimraf=require(_0xa8ef('0x7'));var config=require('../../config/environment');var attributes=require(_0xa8ef('0x8'));module[_0xa8ef('0x9')]=function(_0x15c336,_0x3ab24f){return _0x15c336[_0xa8ef('0xa')](_0xa8ef('0xb'),attributes,{'tableName':_0xa8ef('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa8ef('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index ff6e99e..b4843f4 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 _0x79ea=['request\x20sent','error','code','result','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s'];(function(_0x44b7d6,_0x4a3f3f){var _0x5346f0=function(_0x35ac17){while(--_0x35ac17){_0x44b7d6['push'](_0x44b7d6['shift']());}};_0x5346f0(++_0x4a3f3f);}(_0x79ea,0x1b6));var _0xa79e=function(_0x3e4db1,_0x385cd6){_0x3e4db1=_0x3e4db1-0x0;var _0x33ecd5=_0x79ea[_0x3e4db1];return _0x33ecd5;};'use strict';var _=require(_0xa79e('0x0'));var util=require(_0xa79e('0x1'));var moment=require(_0xa79e('0x2'));var BPromise=require(_0xa79e('0x3'));var rs=require(_0xa79e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa79e('0x5'))['db'];var utils=require(_0xa79e('0x6'));var logger=require('../../config/logger')(_0xa79e('0x7'));var config=require(_0xa79e('0x8'));var jayson=require(_0xa79e('0x9'));var client=jayson[_0xa79e('0xa')][_0xa79e('0xb')]({'port':0x232a});config[_0xa79e('0xc')]=_[_0xa79e('0xd')](config[_0xa79e('0xc')],{'host':_0xa79e('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa79e('0xc')]));require(_0xa79e('0xf'))[_0xa79e('0x10')](socket);function respondWithRpcPromise(_0x2e1b82,_0x1d4f66,_0x209022){return new BPromise(function(_0x36f64e,_0x164e0a){return client[_0xa79e('0x11')](_0x2e1b82,_0x209022)[_0xa79e('0x12')](function(_0x312fc4){logger[_0xa79e('0x13')](_0xa79e('0x14'),_0x1d4f66,_0xa79e('0x15'));logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x1d4f66,'request\x20sent',JSON['stringify'](_0x312fc4));if(_0x312fc4[_0xa79e('0x16')]){if(_0x312fc4[_0xa79e('0x16')][_0xa79e('0x17')]===0x1f4){logger[_0xa79e('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x1d4f66,_0x312fc4[_0xa79e('0x16')]['message']);return _0x164e0a(_0x312fc4['error']['message']);}logger[_0xa79e('0x16')](_0xa79e('0x14'),_0x1d4f66,_0x312fc4[_0xa79e('0x16')]['message']);return _0x36f64e(_0x312fc4[_0xa79e('0x16')]['message']);}else{logger[_0xa79e('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x1d4f66,_0xa79e('0x15'));_0x36f64e(_0x312fc4[_0xa79e('0x18')][_0xa79e('0x19')]);}})[_0xa79e('0x1a')](function(_0x18f49c){logger[_0xa79e('0x16')](_0xa79e('0x14'),_0x1d4f66,_0x18f49c);_0x164e0a(_0x18f49c);});});}
\ No newline at end of file
+var _0x86d5=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatInternalMessage,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x1ce9b7,_0x310313){var _0xace3ed=function(_0x2cb220){while(--_0x2cb220){_0x1ce9b7['push'](_0x1ce9b7['shift']());}};_0xace3ed(++_0x310313);}(_0x86d5,0x71));var _0x586d=function(_0xd1bccd,_0x5621f2){_0xd1bccd=_0xd1bccd-0x0;var _0x34e22b=_0x86d5[_0xd1bccd];return _0x34e22b;};'use strict';var _=require(_0x586d('0x0'));var util=require(_0x586d('0x1'));var moment=require(_0x586d('0x2'));var BPromise=require(_0x586d('0x3'));var rs=require(_0x586d('0x4'));var fs=require('fs');var Redis=require(_0x586d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x586d('0x6'));var logger=require(_0x586d('0x7'))(_0x586d('0x8'));var config=require(_0x586d('0x9'));var jayson=require(_0x586d('0xa'));var client=jayson[_0x586d('0xb')][_0x586d('0xc')]({'port':0x232a});config[_0x586d('0xd')]=_[_0x586d('0xe')](config[_0x586d('0xd')],{'host':_0x586d('0xf'),'port':0x18eb});var socket=require(_0x586d('0x10'))(new Redis(config[_0x586d('0xd')]));require(_0x586d('0x11'))[_0x586d('0x12')](socket);function respondWithRpcPromise(_0x4c77d9,_0x4c4ee2,_0x5821c8){return new BPromise(function(_0x149d7f,_0x37e4dd){return client[_0x586d('0x13')](_0x4c77d9,_0x5821c8)[_0x586d('0x14')](function(_0x105ab7){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x4c4ee2,'request\x20sent');logger[_0x586d('0x15')](_0x586d('0x16'),_0x4c4ee2,_0x586d('0x17'),JSON['stringify'](_0x105ab7));if(_0x105ab7[_0x586d('0x18')]){if(_0x105ab7['error'][_0x586d('0x19')]===0x1f4){logger['error'](_0x586d('0x1a'),_0x4c4ee2,_0x105ab7[_0x586d('0x18')]['message']);return _0x37e4dd(_0x105ab7[_0x586d('0x18')]['message']);}logger[_0x586d('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x4c4ee2,_0x105ab7[_0x586d('0x18')][_0x586d('0x1b')]);return _0x149d7f(_0x105ab7[_0x586d('0x18')]['message']);}else{logger[_0x586d('0x1c')](_0x586d('0x1a'),_0x4c4ee2,_0x586d('0x17'));_0x149d7f(_0x105ab7[_0x586d('0x1d')][_0x586d('0x1b')]);}})['catch'](function(_0x49b5bc){logger['error'](_0x586d('0x1a'),_0x4c4ee2,_0x49b5bc);_0x37e4dd(_0x49b5bc);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index c51c0cc..114a44c 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 _0xe487=['update','emit','removeListener','register','length','./chatInternalMessage.events','save','remove'];(function(_0x397446,_0x3f1304){var _0x33aff8=function(_0x488ced){while(--_0x488ced){_0x397446['push'](_0x397446['shift']());}};_0x33aff8(++_0x3f1304);}(_0xe487,0xcd));var _0x7e48=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe487[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInternalMessageEvents=require(_0x7e48('0x0'));var events=[_0x7e48('0x1'),_0x7e48('0x2'),_0x7e48('0x3')];function createListener(_0x2c4fda,_0x34ae14){return function(_0x1bb06a){_0x34ae14[_0x7e48('0x4')](_0x2c4fda,_0x1bb06a);};}function removeListener(_0x292bc9,_0x2f3264){return function(){ChatInternalMessageEvents[_0x7e48('0x5')](_0x292bc9,_0x2f3264);};}exports[_0x7e48('0x6')]=function(_0x21134b){for(var _0x56c5a5=0x0,_0xa39d36=events[_0x7e48('0x7')];_0x56c5a5<_0xa39d36;_0x56c5a5++){var _0x5073a4=events[_0x56c5a5];var _0x6cfa24=createListener('chatInternalMessage:'+_0x5073a4,_0x21134b);ChatInternalMessageEvents['on'](_0x5073a4,_0x6cfa24);}};
\ No newline at end of file
+var _0x3f67=['length','chatInternalMessage:','./chatInternalMessage.events','save','emit','removeListener'];(function(_0x216d35,_0xd4c390){var _0x407a11=function(_0x3e125b){while(--_0x3e125b){_0x216d35['push'](_0x216d35['shift']());}};_0x407a11(++_0xd4c390);}(_0x3f67,0x158));var _0x73f6=function(_0x221272,_0x29146a){_0x221272=_0x221272-0x0;var _0xe0a9d7=_0x3f67[_0x221272];return _0xe0a9d7;};'use strict';var ChatInternalMessageEvents=require(_0x73f6('0x0'));var events=[_0x73f6('0x1'),'remove','update'];function createListener(_0x52c7e8,_0x3ad892){return function(_0x110649){_0x3ad892[_0x73f6('0x2')](_0x52c7e8,_0x110649);};}function removeListener(_0x559a7e,_0x354958){return function(){ChatInternalMessageEvents[_0x73f6('0x3')](_0x559a7e,_0x354958);};}exports['register']=function(_0x16de7c){for(var _0x2dc69f=0x0,_0x3a4ef1=events[_0x73f6('0x4')];_0x2dc69f<_0x3a4ef1;_0x2dc69f++){var _0x39e8a3=events[_0x2dc69f];var _0x865333=createListener(_0x73f6('0x5')+_0x39e8a3,_0x16de7c);ChatInternalMessageEvents['on'](_0x39e8a3,_0x865333);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 5c3f62a..ef7d67d 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 _0xfb62=['../../config/environment','isAuthenticated','index','get','/describe','describe','getUsers','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfb62,0x1f3));var _0x2fb6=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xfb62[_0x4792c8];return _0x35edb1;};'use strict';var multer=require(_0x2fb6('0x0'));var util=require(_0x2fb6('0x1'));var path=require(_0x2fb6('0x2'));var timeout=require('connect-timeout');var express=require(_0x2fb6('0x3'));var router=express[_0x2fb6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2fb6('0x5'));var interaction=require(_0x2fb6('0x6'));var config=require(_0x2fb6('0x7'));var controller=require('./chatInternalMessage.controller');router['get']('/',auth[_0x2fb6('0x8')](),controller[_0x2fb6('0x9')]);router[_0x2fb6('0xa')](_0x2fb6('0xb'),auth['isAuthenticated'](),controller[_0x2fb6('0xc')]);router[_0x2fb6('0xa')]('/users',auth[_0x2fb6('0x8')](),controller[_0x2fb6('0xd')]);router[_0x2fb6('0xa')](_0x2fb6('0xe'),auth[_0x2fb6('0x8')](),controller[_0x2fb6('0xf')]);router[_0x2fb6('0x10')]('/',auth[_0x2fb6('0x8')](),controller[_0x2fb6('0x11')]);router['put'](_0x2fb6('0xe'),controller[_0x2fb6('0x12')]);router[_0x2fb6('0x13')](_0x2fb6('0xe'),auth['isAuthenticated'](),controller[_0x2fb6('0x14')]);module[_0x2fb6('0x15')]=router;
\ No newline at end of file
+var _0xcda0=['./chatInternalMessage.controller','get','isAuthenticated','index','describe','/users','getUsers','/:id','show','post','create','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x398f5d,_0x1b9c08){var _0x3e0401=function(_0x140dae){while(--_0x140dae){_0x398f5d['push'](_0x398f5d['shift']());}};_0x3e0401(++_0x1b9c08);}(_0xcda0,0xcb));var _0x0cda=function(_0x4f57b7,_0x3b9217){_0x4f57b7=_0x4f57b7-0x0;var _0x21fbc7=_0xcda0[_0x4f57b7];return _0x21fbc7;};'use strict';var multer=require('multer');var util=require(_0x0cda('0x0'));var path=require('path');var timeout=require(_0x0cda('0x1'));var express=require('express');var router=express[_0x0cda('0x2')]();var fs_extra=require(_0x0cda('0x3'));var auth=require(_0x0cda('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0cda('0x5'));var controller=require(_0x0cda('0x6'));router[_0x0cda('0x7')]('/',auth[_0x0cda('0x8')](),controller[_0x0cda('0x9')]);router[_0x0cda('0x7')]('/describe',auth[_0x0cda('0x8')](),controller[_0x0cda('0xa')]);router['get'](_0x0cda('0xb'),auth[_0x0cda('0x8')](),controller[_0x0cda('0xc')]);router[_0x0cda('0x7')](_0x0cda('0xd'),auth['isAuthenticated'](),controller[_0x0cda('0xe')]);router[_0x0cda('0xf')]('/',auth[_0x0cda('0x8')](),controller[_0x0cda('0x10')]);router['put']('/:id',controller['update']);router['delete'](_0x0cda('0xd'),auth[_0x0cda('0x8')](),controller[_0x0cda('0x11')]);module[_0x0cda('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 2dbbab6..e7d4438 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 _0x7894=['medium','BOOLEAN','out','STRING','sequelize','exports','TEXT'];(function(_0x274ab5,_0x31e87d){var _0x545785=function(_0x58dc9d){while(--_0x58dc9d){_0x274ab5['push'](_0x274ab5['shift']());}};_0x545785(++_0x31e87d);}(_0x7894,0x170));var _0x4789=function(_0x47480f,_0x5d056a){_0x47480f=_0x47480f-0x0;var _0x3ad65c=_0x7894[_0x47480f];return _0x3ad65c;};'use strict';var Sequelize=require(_0x4789('0x0'));module[_0x4789('0x1')]={'body':{'type':Sequelize[_0x4789('0x2')](_0x4789('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x4789('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x4789('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x4789('0x5')),'defaultValue':_0x4789('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x4789('0x6')]},'providerResponse':{'type':Sequelize[_0x4789('0x2')]}};
\ No newline at end of file
+var _0x93e6=['BOOLEAN','out','DATE','TEXT','sequelize','medium'];(function(_0x134775,_0x559413){var _0x23b495=function(_0x280591){while(--_0x280591){_0x134775['push'](_0x134775['shift']());}};_0x23b495(++_0x559413);}(_0x93e6,0x11e));var _0x693e=function(_0x28ad0a,_0x1c7181){_0x28ad0a=_0x28ad0a-0x0;var _0x1d1116=_0x93e6[_0x28ad0a];return _0x1d1116;};'use strict';var Sequelize=require(_0x693e('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x693e('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x693e('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x693e('0x3')),'defaultValue':_0x693e('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0x693e('0x4')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x693e('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 38a2118..431ae26 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 _0x56aa=['email','interface','channel','accept','EventManager','parse','formData','../../config/logger','ChatInteraction','ChatInteractionId','RejectMessage','rejectMessage','contact','internal','SIP/%s','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','where','pick','merge','VIRTUAL','filter','options','ChatMessage','includeAll','rows','params','fields','include','find','create','body','describe','chat-interactions','chat','read','readAt','UserId','user','agent','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','get','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','fullname'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x56aa,0x197));var _0xa56a=function(_0x304600,_0x4ecdfe){_0x304600=_0x304600-0x0;var _0x337878=_0x56aa[_0x304600];return _0x337878;};'use strict';var emlformat=require(_0xa56a('0x0'));var rimraf=require(_0xa56a('0x1'));var zipdir=require(_0xa56a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa56a('0x3'));var moment=require(_0xa56a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa56a('0x5'));var util=require('util');var path=require(_0xa56a('0x6'));var sox=require(_0xa56a('0x7'));var csv=require(_0xa56a('0x8'));var ejs=require(_0xa56a('0x9'));var fs=require('fs');var fs_extra=require(_0xa56a('0xa'));var _=require(_0xa56a('0xb'));var squel=require(_0xa56a('0xc'));var crypto=require(_0xa56a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa56a('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa56a('0xf'));var Redis=require(_0xa56a('0x10'));var authService=require(_0xa56a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa56a('0x12'));var hardwareService=require(_0xa56a('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xa56a('0x14'));var config=require(_0xa56a('0x15'));var licenseUtil=require(_0xa56a('0x16'));var db=require(_0xa56a('0x17'))['db'];config[_0xa56a('0x18')]=_[_0xa56a('0x19')](config[_0xa56a('0x18')],{'host':_0xa56a('0x1a'),'port':0x18eb});var socket=require(_0xa56a('0x1b'))(new Redis(config[_0xa56a('0x18')]));require(_0xa56a('0x1c'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xa56a('0x1d')][_0xa56a('0x1e')]({'port':0x232c});var client9002=jayson[_0xa56a('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48fff4,_0x3d2354,_0xd3c04f,_0x5b0b76){return new BPromise(function(_0x2d4e38,_0x29c4cb){var _0x1730b5=_0x5b0b76||client;return _0x1730b5['request'](_0x48fff4,_0xd3c04f)[_0xa56a('0x1f')](function(_0xe00cd8){logger[_0xa56a('0x20')](_0xa56a('0x21'),_0x3d2354,_0xa56a('0x22'));logger[_0xa56a('0x23')](_0xa56a('0x24'),_0x3d2354,'request\x20sent',JSON[_0xa56a('0x25')](_0xe00cd8));if(_0xe00cd8['error']){if(_0xe00cd8[_0xa56a('0x26')][_0xa56a('0x27')]===0x1f4){logger[_0xa56a('0x26')](_0xa56a('0x21'),_0x3d2354,_0xe00cd8[_0xa56a('0x26')][_0xa56a('0x28')]);return _0x29c4cb(_0xe00cd8[_0xa56a('0x26')]['message']);}logger[_0xa56a('0x26')](_0xa56a('0x21'),_0x3d2354,_0xe00cd8[_0xa56a('0x26')][_0xa56a('0x28')]);return _0x2d4e38(_0xe00cd8[_0xa56a('0x26')][_0xa56a('0x28')]);}else{logger[_0xa56a('0x20')]('ChatMessage,\x20%s,\x20%s',_0x3d2354,_0xa56a('0x22'));_0x2d4e38(_0xe00cd8[_0xa56a('0x29')]['message']);}})[_0xa56a('0x2a')](function(_0x4dfcbb){logger[_0xa56a('0x26')]('ChatMessage,\x20%s,\x20%s',_0x3d2354,_0x4dfcbb);_0x29c4cb(_0x4dfcbb);});});}function respondWithStatusCode(_0x5b1f72,_0x49eea5){_0x49eea5=_0x49eea5||0xcc;return function(_0x5c835e){if(_0x5c835e){return _0x5b1f72[_0xa56a('0x2b')](_0x49eea5);}return _0x5b1f72[_0xa56a('0x2c')](_0x49eea5)[_0xa56a('0x2d')]();};}function respondWithResult(_0x116032,_0x2a8cc4){_0x2a8cc4=_0x2a8cc4||0xc8;return function(_0xf8895a){if(_0xf8895a){return _0x116032[_0xa56a('0x2c')](_0x2a8cc4)[_0xa56a('0x2e')](_0xf8895a);}};}function respondWithFilteredResult(_0x5f1685,_0x32f313){return function(_0x29921b){if(_0x29921b){var _0x12a6ab=typeof _0x32f313[_0xa56a('0x2f')]===_0xa56a('0x30')&&typeof _0x32f313['limit']===_0xa56a('0x30');var _0x30db28=_0x29921b[_0xa56a('0x31')];var _0x36bf62=_0x12a6ab?0x0:_0x32f313[_0xa56a('0x2f')];var _0x1b864f=_0x12a6ab?_0x29921b[_0xa56a('0x31')]:_0x32f313['offset']+_0x32f313[_0xa56a('0x32')];var _0x3aad30;if(_0x1b864f>=_0x30db28){_0x1b864f=_0x30db28;_0x3aad30=0xc8;}else{_0x3aad30=0xce;}_0x5f1685[_0xa56a('0x2c')](_0x3aad30);return _0x5f1685[_0xa56a('0x33')](_0xa56a('0x34'),_0x36bf62+'-'+_0x1b864f+'/'+_0x30db28)[_0xa56a('0x2e')](_0x29921b);}return null;};}function patchUpdates(_0x3112c1){return function(_0x1922c0){try{jsonpatch['apply'](_0x1922c0,_0x3112c1,!![]);}catch(_0x25732d){return BPromise[_0xa56a('0x35')](_0x25732d);}return _0x1922c0[_0xa56a('0x36')]();};}function saveUpdates(_0x3fd1be,_0x43291d){return function(_0x5071ce){if(_0x5071ce){return _0x5071ce[_0xa56a('0x37')](_0x3fd1be)[_0xa56a('0x1f')](function(_0x1203b8){return _0x1203b8;});}return null;};}function removeEntity(_0x438bce,_0x2d79b2){return function(_0x4bb56c){if(_0x4bb56c){return _0x4bb56c[_0xa56a('0x38')]()[_0xa56a('0x1f')](function(){_0x438bce['status'](0xcc)[_0xa56a('0x2d')]();});}};}function handleEntityNotFound(_0x8cc858,_0x43af0e){return function(_0x5e65b5){if(!_0x5e65b5){_0x8cc858[_0xa56a('0x2b')](0x194);}return _0x5e65b5;};}function handleError(_0x5121ea,_0x2bbfd2){_0x2bbfd2=_0x2bbfd2||0x1f4;return function(_0x5557c2){logger['error'](_0x5557c2[_0xa56a('0x39')]);if(_0x5557c2[_0xa56a('0x3a')]){delete _0x5557c2[_0xa56a('0x3a')];}_0x5121ea['status'](_0x2bbfd2)[_0xa56a('0x3b')](_0x5557c2);};}exports[_0xa56a('0x3c')]=function(_0x467a49,_0xd3c84a){var _0x4fa52a={},_0x3d4e7e={},_0x15496f={'count':0x0,'rows':[]};var _0x43cc36=_[_0xa56a('0x3d')](db['ChatMessage'][_0xa56a('0x3e')],function(_0x35c375){return{'name':_0x35c375['fieldName'],'type':_0x35c375[_0xa56a('0x3f')][_0xa56a('0x40')]};});_0x3d4e7e[_0xa56a('0x41')]=_[_0xa56a('0x3d')](_0x43cc36,_0xa56a('0x3a'));_0x3d4e7e[_0xa56a('0x42')]=_[_0xa56a('0x43')](_0x467a49[_0xa56a('0x42')]);_0x3d4e7e[_0xa56a('0x44')]=_[_0xa56a('0x45')](_0x3d4e7e['model'],_0x3d4e7e['query']);_0x4fa52a[_0xa56a('0x46')]=_[_0xa56a('0x45')](_0x3d4e7e['model'],qs['fields'](_0x467a49[_0xa56a('0x42')]['fields']));_0x4fa52a[_0xa56a('0x46')]=_0x4fa52a['attributes'][_0xa56a('0x47')]?_0x4fa52a[_0xa56a('0x46')]:_0x3d4e7e[_0xa56a('0x41')];if(!_0x467a49[_0xa56a('0x42')][_0xa56a('0x48')](_0xa56a('0x49'))){_0x4fa52a[_0xa56a('0x32')]=qs['limit'](_0x467a49['query'][_0xa56a('0x32')]);_0x4fa52a[_0xa56a('0x2f')]=qs[_0xa56a('0x2f')](_0x467a49[_0xa56a('0x42')]['offset']);}_0x4fa52a['order']=qs['sort'](_0x467a49['query']['sort']);_0x4fa52a[_0xa56a('0x4a')]=qs['filters'](_[_0xa56a('0x4b')](_0x467a49[_0xa56a('0x42')],_0x3d4e7e[_0xa56a('0x44')]),_0x43cc36);if(_0x467a49[_0xa56a('0x42')]['filter']){_0x4fa52a[_0xa56a('0x4a')]=_[_0xa56a('0x4c')](_0x4fa52a[_0xa56a('0x4a')],{'$or':_['map'](_0x43cc36,function(_0x532dc7){if(_0x532dc7[_0xa56a('0x3f')]!==_0xa56a('0x4d')){var _0xba83ec={};_0xba83ec[_0x532dc7[_0xa56a('0x3a')]]={'$like':'%'+_0x467a49[_0xa56a('0x42')][_0xa56a('0x4e')]+'%'};return _0xba83ec;}})});}_0x4fa52a=_[_0xa56a('0x4c')]({},_0x4fa52a,_0x467a49[_0xa56a('0x4f')]);var _0x2de736={'where':_0x4fa52a[_0xa56a('0x4a')]};return db[_0xa56a('0x50')][_0xa56a('0x31')](_0x2de736)['then'](function(_0x3dd8ae){_0x15496f['count']=_0x3dd8ae;if(_0x467a49[_0xa56a('0x42')][_0xa56a('0x51')]){_0x4fa52a['include']=[{'all':!![]}];}return db[_0xa56a('0x50')]['findAll'](_0x4fa52a);})[_0xa56a('0x1f')](function(_0x5238b8){_0x15496f[_0xa56a('0x52')]=_0x5238b8;return _0x15496f;})[_0xa56a('0x1f')](respondWithFilteredResult(_0xd3c84a,_0x4fa52a))[_0xa56a('0x2a')](handleError(_0xd3c84a,null));};exports['show']=function(_0x339369,_0x101c95){var _0xfac16b={'raw':!![],'where':{'id':_0x339369[_0xa56a('0x53')]['id']}},_0x566119={};_0x566119[_0xa56a('0x41')]=_[_0xa56a('0x43')](db[_0xa56a('0x50')][_0xa56a('0x3e')]);_0x566119[_0xa56a('0x42')]=_['keys'](_0x339369[_0xa56a('0x42')]);_0x566119['filters']=_[_0xa56a('0x45')](_0x566119[_0xa56a('0x41')],_0x566119[_0xa56a('0x42')]);_0xfac16b[_0xa56a('0x46')]=_[_0xa56a('0x45')](_0x566119[_0xa56a('0x41')],qs[_0xa56a('0x54')](_0x339369[_0xa56a('0x42')][_0xa56a('0x54')]));_0xfac16b[_0xa56a('0x46')]=_0xfac16b[_0xa56a('0x46')][_0xa56a('0x47')]?_0xfac16b['attributes']:_0x566119[_0xa56a('0x41')];if(_0x339369[_0xa56a('0x42')][_0xa56a('0x51')]){_0xfac16b[_0xa56a('0x55')]=[{'all':!![]}];}_0xfac16b=_['merge']({},_0xfac16b,_0x339369[_0xa56a('0x4f')]);return db[_0xa56a('0x50')][_0xa56a('0x56')](_0xfac16b)[_0xa56a('0x1f')](handleEntityNotFound(_0x101c95,null))[_0xa56a('0x1f')](respondWithResult(_0x101c95,null))[_0xa56a('0x2a')](handleError(_0x101c95,null));};exports[_0xa56a('0x57')]=function(_0x3cf895,_0x3157cc){return db[_0xa56a('0x50')][_0xa56a('0x57')](_0x3cf895[_0xa56a('0x58')],{})['then'](respondWithResult(_0x3157cc,0xc9))[_0xa56a('0x2a')](handleError(_0x3157cc,null));};exports['update']=function(_0x1b5ef3,_0x1a2dd1){if(_0x1b5ef3[_0xa56a('0x58')]['id']){delete _0x1b5ef3[_0xa56a('0x58')]['id'];}return db[_0xa56a('0x50')][_0xa56a('0x56')]({'where':{'id':_0x1b5ef3[_0xa56a('0x53')]['id']}})[_0xa56a('0x1f')](handleEntityNotFound(_0x1a2dd1,null))[_0xa56a('0x1f')](saveUpdates(_0x1b5ef3[_0xa56a('0x58')],null))[_0xa56a('0x1f')](respondWithResult(_0x1a2dd1,null))[_0xa56a('0x2a')](handleError(_0x1a2dd1,null));};exports[_0xa56a('0x38')]=function(_0x451423,_0x284f99){return db[_0xa56a('0x50')][_0xa56a('0x56')]({'where':{'id':_0x451423[_0xa56a('0x53')]['id']}})['then'](handleEntityNotFound(_0x284f99,null))[_0xa56a('0x1f')](removeEntity(_0x284f99,null))[_0xa56a('0x2a')](handleError(_0x284f99,null));};exports[_0xa56a('0x59')]=function(_0x14ea80,_0x3c2ee2){return db[_0xa56a('0x50')][_0xa56a('0x59')]()[_0xa56a('0x1f')](respondWithResult(_0x3c2ee2,null))[_0xa56a('0x2a')](handleError(_0x3c2ee2,null));};var interaction_log=require('../../config/logger')(_0xa56a('0x5a'));exports['accept']=function(_0x4c632c,_0x596c3c,_0x4f4cad){var _0x43d454={'agent':{},'channel':_0xa56a('0x5b')};if(_0x4c632c[_0xa56a('0x58')]['id']){delete _0x4c632c[_0xa56a('0x58')]['id'];}_0x4c632c['body'][_0xa56a('0x5c')]=!![];_0x4c632c[_0xa56a('0x58')][_0xa56a('0x5d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4c632c['body']['UserId']=_0x4c632c['body'][_0xa56a('0x5e')]||_0x4c632c[_0xa56a('0x5f')]['id'];_0x43d454[_0xa56a('0x60')]['id']=_0x4c632c[_0xa56a('0x58')][_0xa56a('0x5e')];return db[_0xa56a('0x50')][_0xa56a('0x56')]({'where':{'id':_0x4c632c[_0xa56a('0x53')]['id'],'UserId':null}})[_0xa56a('0x1f')](handleEntityNotFound(_0x596c3c,null))['then'](saveUpdates(_0x4c632c[_0xa56a('0x58')],null))['then'](function(_0x2b0d00){if(_0x2b0d00){_0x43d454[_0xa56a('0x28')]=_0x2b0d00['get']({'plain':!![]});return db['ChatInteraction'][_0xa56a('0x56')]({'where':{'id':_0x2b0d00['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x596c3c,null))[_0xa56a('0x1f')](function(_0x5146bf){if(_0x5146bf){return _0x5146bf[_0xa56a('0x37')]({'UserId':_0x4c632c[_0xa56a('0x58')]['UserId'],'read1stAt':_['isNil'](_0x5146bf[_0xa56a('0x61')])?moment()[_0xa56a('0x62')](_0xa56a('0x63')):undefined});}return null;})[_0xa56a('0x1f')](function(_0xd62408){if(_0xd62408){_0x43d454[_0xa56a('0x64')]=_0xd62408[_0xa56a('0x65')]({'plain':!![]});interaction_log[_0xa56a('0x20')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4c632c[_0xa56a('0x5f')]['id'],_0x4c632c[_0xa56a('0x5f')][_0xa56a('0x3a')],_0x4c632c[_0xa56a('0x5f')][_0xa56a('0x66')],_0x43d454[_0xa56a('0x64')]['id'],_0x4c632c[_0xa56a('0x58')]?JSON['stringify'](_0x4c632c[_0xa56a('0x58')]):_0xa56a('0x67'));return respondWithRpcPromise(_0xa56a('0x68'),_0xa56a('0x69'),_0x43d454);}return null;})[_0xa56a('0x1f')](function(_0x47c8db){var _0x46ddce=_0xa56a('0x6a')+_0x47c8db['message'][_0xa56a('0x6b')];return db[_0xa56a('0x6c')][_0xa56a('0x42')](_0x46ddce,{'type':db[_0xa56a('0x6d')][_0xa56a('0x6e')][_0xa56a('0x6f')],'raw':!![]})[_0xa56a('0x1f')](function(_0x947c90){return _0x947c90;});})[_0xa56a('0x1f')](function(_0x3f49f1){if(_0x3f49f1){_0x43d454[_0xa56a('0x28')]['contact']=_0x3f49f1[0x0];if(!_0x4c632c[_0xa56a('0x58')]['UserId'])return;return db['User']['find']({'where':{'id':_0x4c632c[_0xa56a('0x58')][_0xa56a('0x5e')],'role':_0xa56a('0x60')},'attributes':['id',_0xa56a('0x3a'),_0xa56a('0x70'),_0xa56a('0x71'),'internal'],'raw':!![]});}return null;})[_0xa56a('0x1f')](function(_0x4e2a5b){if(!_0x4e2a5b)return null;_0x43d454[_0xa56a('0x28')]['agent']=_0x4e2a5b;return _0x43d454;})[_0xa56a('0x1f')](function(_0x3e3d3d){if(_0x3e3d3d){if(_0x4c632c['body']['manual']){_0x43d454['message'][_0xa56a('0x72')]=util[_0xa56a('0x62')]('SIP/%s',_0x4c632c[_0xa56a('0x5f')][_0xa56a('0x3a')]);_0x43d454[_0xa56a('0x28')]['channel']=_0x43d454[_0xa56a('0x73')];_0x43d454[_0xa56a('0x28')]['motionChannel']=_0x43d454[_0xa56a('0x73')];_0x43d454[_0xa56a('0x28')]['event']=_0xa56a('0x74');return respondWithRpcPromise(_0xa56a('0x75'),_0xa56a('0x75'),{'event':'acceptmessage','message':_['merge'](_0x43d454['message'],JSON[_0xa56a('0x76')](_0x43d454[_0xa56a('0x64')][_0xa56a('0x77')]))},client9002)['then'](function(){return _0x43d454;});}return _0x43d454;}return null;})[_0xa56a('0x1f')](respondWithResult(_0x596c3c,null))[_0xa56a('0x2a')](handleError(_0x596c3c,null));};var interaction_log=require(_0xa56a('0x78'))(_0xa56a('0x5a'));exports[_0xa56a('0x35')]=function(_0x526a4b,_0x53442e,_0x596349){var _0xcd17e4={'agent':{},'channel':_0xa56a('0x5b')};if(_0x526a4b[_0xa56a('0x58')]['id']){delete _0x526a4b[_0xa56a('0x58')]['id'];}_0x526a4b['body'][_0xa56a('0x5e')]=_0x526a4b[_0xa56a('0x58')][_0xa56a('0x5e')]||_0x526a4b[_0xa56a('0x5f')]['id'];_0xcd17e4[_0xa56a('0x60')]['id']=_0x526a4b['body']['UserId'];return db[_0xa56a('0x50')][_0xa56a('0x56')]({'where':{'id':_0x526a4b[_0xa56a('0x53')]['id'],'UserId':null}})[_0xa56a('0x1f')](handleEntityNotFound(_0x53442e,null))[_0xa56a('0x1f')](function(_0x3bd21d){if(_0x3bd21d){_0xcd17e4[_0xa56a('0x28')]=_0x3bd21d['get']({'plain':!![]});return db[_0xa56a('0x79')][_0xa56a('0x56')]({'where':{'id':_0x3bd21d[_0xa56a('0x7a')]}});}return null;})[_0xa56a('0x1f')](handleEntityNotFound(_0x53442e,null))[_0xa56a('0x1f')](function(_0x2c95e0){if(_0x2c95e0){_0xcd17e4[_0xa56a('0x64')]=_0x2c95e0[_0xa56a('0x65')]({'plain':!![]});interaction_log[_0xa56a('0x20')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x526a4b[_0xa56a('0x5f')]['id'],_0x526a4b['user']['name'],_0x526a4b[_0xa56a('0x5f')][_0xa56a('0x66')],_0xcd17e4[_0xa56a('0x64')]['id'],_0x526a4b['body']?JSON['stringify'](_0x526a4b[_0xa56a('0x58')]):_0xa56a('0x67'));return respondWithRpcPromise(_0xa56a('0x7b'),_0xa56a('0x7c'),_0xcd17e4);}return null;})[_0xa56a('0x1f')](function(_0x4d0ff3){var _0x33dcc5=_0xa56a('0x6a')+_0x4d0ff3['message'][_0xa56a('0x6b')];return db['sequelize'][_0xa56a('0x42')](_0x33dcc5,{'type':db['Sequelize'][_0xa56a('0x6e')][_0xa56a('0x6f')],'raw':!![]})[_0xa56a('0x1f')](function(_0x231e9a){return _0x231e9a;});})[_0xa56a('0x1f')](function(_0x2a4860){if(_0x2a4860){_0xcd17e4['message'][_0xa56a('0x7d')]=_0x2a4860[0x0];if(!_0x526a4b[_0xa56a('0x58')][_0xa56a('0x5e')])return;return db['User']['find']({'where':{'id':_0x526a4b[_0xa56a('0x58')]['UserId'],'role':_0xa56a('0x60')},'attributes':['id',_0xa56a('0x3a'),_0xa56a('0x70'),_0xa56a('0x71'),_0xa56a('0x7e')],'raw':!![]});}return null;})['then'](function(_0x4fda54){if(!_0x4fda54)return null;_0xcd17e4[_0xa56a('0x28')][_0xa56a('0x60')]=_0x4fda54;return _0xcd17e4;})['then'](function(_0x248e7f){if(_0x248e7f){_0x248e7f[_0xa56a('0x28')][_0xa56a('0x72')]=util[_0xa56a('0x62')](_0xa56a('0x7f'),_0x526a4b['user']['name']);_0x248e7f['message'][_0xa56a('0x73')]=_0xcd17e4[_0xa56a('0x73')];_0x248e7f[_0xa56a('0x28')][_0xa56a('0x80')]=_0xcd17e4[_0xa56a('0x73')];_0x248e7f['message']['event']=_0xa56a('0x35');respondWithRpcPromise(_0xa56a('0x75'),_0xa56a('0x75'),{'event':_0xa56a('0x81'),'message':_[_0xa56a('0x4c')](_0xcd17e4[_0xa56a('0x28')],JSON[_0xa56a('0x76')](_0xcd17e4[_0xa56a('0x64')][_0xa56a('0x77')]))},client9002);return _0xcd17e4;}return null;})[_0xa56a('0x1f')](respondWithResult(_0x53442e,null))[_0xa56a('0x2a')](handleError(_0x53442e,null));};
\ No newline at end of file
+var _0x03da=['localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','destroy','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','findAll','then','catch','params','length','includeAll','include','create','body','find','describe','chat-interactions','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteraction','isNil','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','fullname','internal','manual','SIP/%s','channel','motionChannel','event','acceptmessage','parse','formData','get','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','email','interface','EventManager','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis'];(function(_0x344272,_0x245de9){var _0x11562a=function(_0x2b2b43){while(--_0x2b2b43){_0x344272['push'](_0x344272['shift']());}};_0x11562a(++_0x245de9);}(_0x03da,0x69));var _0xa03d=function(_0x41642e,_0x97f901){_0x41642e=_0x41642e-0x0;var _0x39ec15=_0x03da[_0x41642e];return _0x39ec15;};'use strict';var emlformat=require(_0xa03d('0x0'));var rimraf=require(_0xa03d('0x1'));var zipdir=require(_0xa03d('0x2'));var jsonpatch=require(_0xa03d('0x3'));var rp=require('request-promise');var moment=require(_0xa03d('0x4'));var BPromise=require(_0xa03d('0x5'));var Mustache=require(_0xa03d('0x6'));var util=require(_0xa03d('0x7'));var path=require(_0xa03d('0x8'));var sox=require(_0xa03d('0x9'));var csv=require(_0xa03d('0xa'));var ejs=require(_0xa03d('0xb'));var fs=require('fs');var fs_extra=require(_0xa03d('0xc'));var _=require('lodash');var squel=require(_0xa03d('0xd'));var crypto=require(_0xa03d('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa03d('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa03d('0x10'));var Papa=require('papaparse');var Redis=require(_0xa03d('0x11'));var authService=require(_0xa03d('0x12'));var qs=require(_0xa03d('0x13'));var as=require(_0xa03d('0x14'));var hardwareService=require(_0xa03d('0x15'));var logger=require('../../config/logger')(_0xa03d('0x16'));var utils=require('../../config/utils');var config=require(_0xa03d('0x17'));var licenseUtil=require(_0xa03d('0x18'));var db=require(_0xa03d('0x19'))['db'];config[_0xa03d('0x1a')]=_['defaults'](config['redis'],{'host':_0xa03d('0x1b'),'port':0x18eb});var socket=require(_0xa03d('0x1c'))(new Redis(config[_0xa03d('0x1a')]));require(_0xa03d('0x1d'))[_0xa03d('0x1e')](socket);var jayson=require(_0xa03d('0x1f'));var client=jayson[_0xa03d('0x20')][_0xa03d('0x21')]({'port':0x232c});var client9002=jayson['client'][_0xa03d('0x21')]({'port':0x232a});function respondWithRpcPromise(_0xb50ee0,_0x5ea68b,_0x5dd4fb,_0x28f4a7){return new BPromise(function(_0x427ca5,_0x26e077){var _0x25ba29=_0x28f4a7||client;return _0x25ba29[_0xa03d('0x22')](_0xb50ee0,_0x5dd4fb)['then'](function(_0x259605){logger[_0xa03d('0x23')](_0xa03d('0x24'),_0x5ea68b,_0xa03d('0x25'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x5ea68b,'request\x20sent',JSON[_0xa03d('0x26')](_0x259605));if(_0x259605[_0xa03d('0x27')]){if(_0x259605[_0xa03d('0x27')][_0xa03d('0x28')]===0x1f4){logger['error'](_0xa03d('0x24'),_0x5ea68b,_0x259605['error'][_0xa03d('0x29')]);return _0x26e077(_0x259605[_0xa03d('0x27')][_0xa03d('0x29')]);}logger[_0xa03d('0x27')](_0xa03d('0x24'),_0x5ea68b,_0x259605[_0xa03d('0x27')][_0xa03d('0x29')]);return _0x427ca5(_0x259605['error'][_0xa03d('0x29')]);}else{logger[_0xa03d('0x23')](_0xa03d('0x24'),_0x5ea68b,_0xa03d('0x25'));_0x427ca5(_0x259605[_0xa03d('0x2a')][_0xa03d('0x29')]);}})['catch'](function(_0x52ca35){logger['error'](_0xa03d('0x24'),_0x5ea68b,_0x52ca35);_0x26e077(_0x52ca35);});});}function respondWithStatusCode(_0x4d93af,_0x37563e){_0x37563e=_0x37563e||0xcc;return function(_0x339e84){if(_0x339e84){return _0x4d93af[_0xa03d('0x2b')](_0x37563e);}return _0x4d93af[_0xa03d('0x2c')](_0x37563e)[_0xa03d('0x2d')]();};}function respondWithResult(_0x19ef2e,_0x5ce328){_0x5ce328=_0x5ce328||0xc8;return function(_0x46ab47){if(_0x46ab47){return _0x19ef2e['status'](_0x5ce328)[_0xa03d('0x2e')](_0x46ab47);}};}function respondWithFilteredResult(_0x160094,_0x33da9c){return function(_0x570a35){if(_0x570a35){var _0x542f5f=typeof _0x33da9c['offset']===_0xa03d('0x2f')&&typeof _0x33da9c[_0xa03d('0x30')]===_0xa03d('0x2f');var _0x3dbd5f=_0x570a35[_0xa03d('0x31')];var _0x259d79=_0x542f5f?0x0:_0x33da9c[_0xa03d('0x32')];var _0x368b68=_0x542f5f?_0x570a35[_0xa03d('0x31')]:_0x33da9c[_0xa03d('0x32')]+_0x33da9c[_0xa03d('0x30')];var _0x463d75;if(_0x368b68>=_0x3dbd5f){_0x368b68=_0x3dbd5f;_0x463d75=0xc8;}else{_0x463d75=0xce;}_0x160094[_0xa03d('0x2c')](_0x463d75);return _0x160094['set']('Content-Range',_0x259d79+'-'+_0x368b68+'/'+_0x3dbd5f)[_0xa03d('0x2e')](_0x570a35);}return null;};}function patchUpdates(_0x1dc0cc){return function(_0x1f6000){try{jsonpatch[_0xa03d('0x33')](_0x1f6000,_0x1dc0cc,!![]);}catch(_0x505d6a){return BPromise[_0xa03d('0x34')](_0x505d6a);}return _0x1f6000[_0xa03d('0x35')]();};}function saveUpdates(_0x538f6d,_0x12f9cc){return function(_0x68512f){if(_0x68512f){return _0x68512f[_0xa03d('0x36')](_0x538f6d)['then'](function(_0x291b98){return _0x291b98;});}return null;};}function removeEntity(_0x89a759,_0x44a580){return function(_0x28c947){if(_0x28c947){return _0x28c947[_0xa03d('0x37')]()['then'](function(){_0x89a759['status'](0xcc)[_0xa03d('0x2d')]();});}};}function handleEntityNotFound(_0x7da821,_0x155606){return function(_0x519304){if(!_0x519304){_0x7da821['sendStatus'](0x194);}return _0x519304;};}function handleError(_0xb14ec7,_0x24578b){_0x24578b=_0x24578b||0x1f4;return function(_0x1dd87f){logger[_0xa03d('0x27')](_0x1dd87f['stack']);if(_0x1dd87f[_0xa03d('0x38')]){delete _0x1dd87f[_0xa03d('0x38')];}_0xb14ec7[_0xa03d('0x2c')](_0x24578b)[_0xa03d('0x39')](_0x1dd87f);};}exports[_0xa03d('0x3a')]=function(_0x5ec2e4,_0x3e1838){var _0x5eefc9={},_0x55c6={},_0x7da176={'count':0x0,'rows':[]};var _0xf3c6f1=_[_0xa03d('0x3b')](db[_0xa03d('0x3c')][_0xa03d('0x3d')],function(_0x308845){return{'name':_0x308845[_0xa03d('0x3e')],'type':_0x308845[_0xa03d('0x3f')][_0xa03d('0x40')]};});_0x55c6[_0xa03d('0x41')]=_[_0xa03d('0x3b')](_0xf3c6f1,_0xa03d('0x38'));_0x55c6['query']=_[_0xa03d('0x42')](_0x5ec2e4[_0xa03d('0x43')]);_0x55c6[_0xa03d('0x44')]=_[_0xa03d('0x45')](_0x55c6[_0xa03d('0x41')],_0x55c6['query']);_0x5eefc9[_0xa03d('0x46')]=_[_0xa03d('0x45')](_0x55c6[_0xa03d('0x41')],qs[_0xa03d('0x47')](_0x5ec2e4[_0xa03d('0x43')]['fields']));_0x5eefc9[_0xa03d('0x46')]=_0x5eefc9[_0xa03d('0x46')]['length']?_0x5eefc9['attributes']:_0x55c6[_0xa03d('0x41')];if(!_0x5ec2e4[_0xa03d('0x43')][_0xa03d('0x48')](_0xa03d('0x49'))){_0x5eefc9[_0xa03d('0x30')]=qs[_0xa03d('0x30')](_0x5ec2e4[_0xa03d('0x43')][_0xa03d('0x30')]);_0x5eefc9[_0xa03d('0x32')]=qs['offset'](_0x5ec2e4[_0xa03d('0x43')][_0xa03d('0x32')]);}_0x5eefc9[_0xa03d('0x4a')]=qs[_0xa03d('0x4b')](_0x5ec2e4[_0xa03d('0x43')][_0xa03d('0x4b')]);_0x5eefc9[_0xa03d('0x4c')]=qs['filters'](_['pick'](_0x5ec2e4[_0xa03d('0x43')],_0x55c6['filters']),_0xf3c6f1);if(_0x5ec2e4[_0xa03d('0x43')]['filter']){_0x5eefc9[_0xa03d('0x4c')]=_[_0xa03d('0x4d')](_0x5eefc9[_0xa03d('0x4c')],{'$or':_['map'](_0xf3c6f1,function(_0x2936e6){if(_0x2936e6['type']!==_0xa03d('0x4e')){var _0x322e87={};_0x322e87[_0x2936e6['name']]={'$like':'%'+_0x5ec2e4[_0xa03d('0x43')][_0xa03d('0x4f')]+'%'};return _0x322e87;}})});}_0x5eefc9=_[_0xa03d('0x4d')]({},_0x5eefc9,_0x5ec2e4[_0xa03d('0x50')]);var _0x2e1a02={'where':_0x5eefc9['where']};return db['ChatMessage']['count'](_0x2e1a02)['then'](function(_0x18ac0c){_0x7da176['count']=_0x18ac0c;if(_0x5ec2e4['query']['includeAll']){_0x5eefc9['include']=[{'all':!![]}];}return db[_0xa03d('0x3c')][_0xa03d('0x51')](_0x5eefc9);})[_0xa03d('0x52')](function(_0x26cba8){_0x7da176['rows']=_0x26cba8;return _0x7da176;})[_0xa03d('0x52')](respondWithFilteredResult(_0x3e1838,_0x5eefc9))[_0xa03d('0x53')](handleError(_0x3e1838,null));};exports['show']=function(_0x584a03,_0x96593f){var _0x15d597={'raw':!![],'where':{'id':_0x584a03[_0xa03d('0x54')]['id']}},_0x370d24={};_0x370d24['model']=_[_0xa03d('0x42')](db[_0xa03d('0x3c')][_0xa03d('0x3d')]);_0x370d24['query']=_[_0xa03d('0x42')](_0x584a03['query']);_0x370d24['filters']=_[_0xa03d('0x45')](_0x370d24['model'],_0x370d24['query']);_0x15d597[_0xa03d('0x46')]=_['intersection'](_0x370d24['model'],qs[_0xa03d('0x47')](_0x584a03[_0xa03d('0x43')][_0xa03d('0x47')]));_0x15d597[_0xa03d('0x46')]=_0x15d597[_0xa03d('0x46')][_0xa03d('0x55')]?_0x15d597['attributes']:_0x370d24[_0xa03d('0x41')];if(_0x584a03[_0xa03d('0x43')][_0xa03d('0x56')]){_0x15d597[_0xa03d('0x57')]=[{'all':!![]}];}_0x15d597=_[_0xa03d('0x4d')]({},_0x15d597,_0x584a03[_0xa03d('0x50')]);return db[_0xa03d('0x3c')]['find'](_0x15d597)[_0xa03d('0x52')](handleEntityNotFound(_0x96593f,null))[_0xa03d('0x52')](respondWithResult(_0x96593f,null))[_0xa03d('0x53')](handleError(_0x96593f,null));};exports['create']=function(_0x3e99d4,_0x20bee2){return db[_0xa03d('0x3c')][_0xa03d('0x58')](_0x3e99d4[_0xa03d('0x59')],{})[_0xa03d('0x52')](respondWithResult(_0x20bee2,0xc9))[_0xa03d('0x53')](handleError(_0x20bee2,null));};exports[_0xa03d('0x36')]=function(_0x547cba,_0x1283e5){if(_0x547cba[_0xa03d('0x59')]['id']){delete _0x547cba[_0xa03d('0x59')]['id'];}return db['ChatMessage'][_0xa03d('0x5a')]({'where':{'id':_0x547cba[_0xa03d('0x54')]['id']}})[_0xa03d('0x52')](handleEntityNotFound(_0x1283e5,null))['then'](saveUpdates(_0x547cba[_0xa03d('0x59')],null))[_0xa03d('0x52')](respondWithResult(_0x1283e5,null))[_0xa03d('0x53')](handleError(_0x1283e5,null));};exports[_0xa03d('0x37')]=function(_0x44df2c,_0x73a0c5){return db[_0xa03d('0x3c')]['find']({'where':{'id':_0x44df2c['params']['id']}})['then'](handleEntityNotFound(_0x73a0c5,null))[_0xa03d('0x52')](removeEntity(_0x73a0c5,null))[_0xa03d('0x53')](handleError(_0x73a0c5,null));};exports[_0xa03d('0x5b')]=function(_0x4a15ed,_0x2c4e07){return db[_0xa03d('0x3c')][_0xa03d('0x5b')]()[_0xa03d('0x52')](respondWithResult(_0x2c4e07,null))['catch'](handleError(_0x2c4e07,null));};var interaction_log=require('../../config/logger')(_0xa03d('0x5c'));exports[_0xa03d('0x5d')]=function(_0x4e1098,_0x1bfdb5,_0x22eec5){var _0x479bc5={'agent':{},'channel':_0xa03d('0x5e')};if(_0x4e1098[_0xa03d('0x59')]['id']){delete _0x4e1098[_0xa03d('0x59')]['id'];}_0x4e1098[_0xa03d('0x59')][_0xa03d('0x5f')]=!![];_0x4e1098[_0xa03d('0x59')]['readAt']=moment()[_0xa03d('0x60')](_0xa03d('0x61'));_0x4e1098['body'][_0xa03d('0x62')]=_0x4e1098[_0xa03d('0x59')][_0xa03d('0x62')]||_0x4e1098[_0xa03d('0x63')]['id'];_0x479bc5[_0xa03d('0x64')]['id']=_0x4e1098[_0xa03d('0x59')]['UserId'];return db[_0xa03d('0x3c')][_0xa03d('0x5a')]({'where':{'id':_0x4e1098['params']['id'],'UserId':null}})[_0xa03d('0x52')](handleEntityNotFound(_0x1bfdb5,null))[_0xa03d('0x52')](saveUpdates(_0x4e1098[_0xa03d('0x59')],null))[_0xa03d('0x52')](function(_0x959a5c){if(_0x959a5c){_0x479bc5['message']=_0x959a5c['get']({'plain':!![]});return db[_0xa03d('0x65')][_0xa03d('0x5a')]({'where':{'id':_0x959a5c['ChatInteractionId']}});}return null;})[_0xa03d('0x52')](handleEntityNotFound(_0x1bfdb5,null))[_0xa03d('0x52')](function(_0x3b80d3){if(_0x3b80d3){return _0x3b80d3['update']({'UserId':_0x4e1098[_0xa03d('0x59')][_0xa03d('0x62')],'read1stAt':_[_0xa03d('0x66')](_0x3b80d3['read1stAt'])?moment()[_0xa03d('0x60')](_0xa03d('0x61')):undefined});}return null;})[_0xa03d('0x52')](function(_0x4ebe7f){if(_0x4ebe7f){_0x479bc5[_0xa03d('0x67')]=_0x4ebe7f['get']({'plain':!![]});interaction_log[_0xa03d('0x23')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4e1098[_0xa03d('0x63')]['id'],_0x4e1098[_0xa03d('0x63')][_0xa03d('0x38')],_0x4e1098['user'][_0xa03d('0x68')],_0x479bc5[_0xa03d('0x67')]['id'],_0x4e1098[_0xa03d('0x59')]?JSON['stringify'](_0x4e1098[_0xa03d('0x59')]):_0xa03d('0x69'));return respondWithRpcPromise(_0xa03d('0x6a'),_0xa03d('0x6b'),_0x479bc5);}return null;})[_0xa03d('0x52')](function(_0x2d0c83){var _0x1faca7=_0xa03d('0x6c')+_0x2d0c83[_0xa03d('0x29')][_0xa03d('0x6d')];return db[_0xa03d('0x6e')]['query'](_0x1faca7,{'type':db[_0xa03d('0x6f')][_0xa03d('0x70')][_0xa03d('0x71')],'raw':!![]})[_0xa03d('0x52')](function(_0xc55466){return _0xc55466;});})[_0xa03d('0x52')](function(_0x1b27d6){if(_0x1b27d6){_0x479bc5[_0xa03d('0x29')]['contact']=_0x1b27d6[0x0];if(!_0x4e1098[_0xa03d('0x59')]['UserId'])return;return db['User'][_0xa03d('0x5a')]({'where':{'id':_0x4e1098['body'][_0xa03d('0x62')],'role':_0xa03d('0x64')},'attributes':['id',_0xa03d('0x38'),_0xa03d('0x72'),'email',_0xa03d('0x73')],'raw':!![]});}return null;})[_0xa03d('0x52')](function(_0x38ca38){if(!_0x38ca38)return null;_0x479bc5[_0xa03d('0x29')][_0xa03d('0x64')]=_0x38ca38;return _0x479bc5;})['then'](function(_0xf4dadb){if(_0xf4dadb){if(_0x4e1098[_0xa03d('0x59')][_0xa03d('0x74')]){_0x479bc5[_0xa03d('0x29')]['interface']=util['format'](_0xa03d('0x75'),_0x4e1098[_0xa03d('0x63')]['name']);_0x479bc5[_0xa03d('0x29')][_0xa03d('0x76')]=_0x479bc5[_0xa03d('0x76')];_0x479bc5[_0xa03d('0x29')][_0xa03d('0x77')]=_0x479bc5[_0xa03d('0x76')];_0x479bc5[_0xa03d('0x29')][_0xa03d('0x78')]=_0xa03d('0x5d');return respondWithRpcPromise('EventManager','EventManager',{'event':_0xa03d('0x79'),'message':_[_0xa03d('0x4d')](_0x479bc5[_0xa03d('0x29')],JSON[_0xa03d('0x7a')](_0x479bc5[_0xa03d('0x67')][_0xa03d('0x7b')]))},client9002)[_0xa03d('0x52')](function(){return _0x479bc5;});}return _0x479bc5;}return null;})[_0xa03d('0x52')](respondWithResult(_0x1bfdb5,null))[_0xa03d('0x53')](handleError(_0x1bfdb5,null));};var interaction_log=require('../../config/logger')(_0xa03d('0x5c'));exports['reject']=function(_0x5d5643,_0x273d45,_0x1fd873){var _0x1cbf1a={'agent':{},'channel':_0xa03d('0x5e')};if(_0x5d5643[_0xa03d('0x59')]['id']){delete _0x5d5643['body']['id'];}_0x5d5643[_0xa03d('0x59')][_0xa03d('0x62')]=_0x5d5643['body'][_0xa03d('0x62')]||_0x5d5643[_0xa03d('0x63')]['id'];_0x1cbf1a['agent']['id']=_0x5d5643[_0xa03d('0x59')][_0xa03d('0x62')];return db[_0xa03d('0x3c')][_0xa03d('0x5a')]({'where':{'id':_0x5d5643[_0xa03d('0x54')]['id'],'UserId':null}})[_0xa03d('0x52')](handleEntityNotFound(_0x273d45,null))[_0xa03d('0x52')](function(_0x25b5e9){if(_0x25b5e9){_0x1cbf1a[_0xa03d('0x29')]=_0x25b5e9[_0xa03d('0x7c')]({'plain':!![]});return db[_0xa03d('0x65')][_0xa03d('0x5a')]({'where':{'id':_0x25b5e9[_0xa03d('0x7d')]}});}return null;})[_0xa03d('0x52')](handleEntityNotFound(_0x273d45,null))[_0xa03d('0x52')](function(_0x4edcec){if(_0x4edcec){_0x1cbf1a['interaction']=_0x4edcec['get']({'plain':!![]});interaction_log['info'](_0xa03d('0x7e'),_0x5d5643['user']['id'],_0x5d5643[_0xa03d('0x63')][_0xa03d('0x38')],_0x5d5643['user'][_0xa03d('0x68')],_0x1cbf1a[_0xa03d('0x67')]['id'],_0x5d5643[_0xa03d('0x59')]?JSON['stringify'](_0x5d5643[_0xa03d('0x59')]):'null');return respondWithRpcPromise('RejectMessage',_0xa03d('0x7f'),_0x1cbf1a);}return null;})[_0xa03d('0x52')](function(_0x46155f){var _0x210645=_0xa03d('0x6c')+_0x46155f['message'][_0xa03d('0x6d')];return db['sequelize'][_0xa03d('0x43')](_0x210645,{'type':db['Sequelize'][_0xa03d('0x70')][_0xa03d('0x71')],'raw':!![]})[_0xa03d('0x52')](function(_0x1a5051){return _0x1a5051;});})[_0xa03d('0x52')](function(_0x18ee7a){if(_0x18ee7a){_0x1cbf1a[_0xa03d('0x29')]['contact']=_0x18ee7a[0x0];if(!_0x5d5643['body'][_0xa03d('0x62')])return;return db['User'][_0xa03d('0x5a')]({'where':{'id':_0x5d5643[_0xa03d('0x59')][_0xa03d('0x62')],'role':_0xa03d('0x64')},'attributes':['id',_0xa03d('0x38'),_0xa03d('0x72'),_0xa03d('0x80'),_0xa03d('0x73')],'raw':!![]});}return null;})[_0xa03d('0x52')](function(_0x393392){if(!_0x393392)return null;_0x1cbf1a[_0xa03d('0x29')][_0xa03d('0x64')]=_0x393392;return _0x1cbf1a;})[_0xa03d('0x52')](function(_0x2cc0d4){if(_0x2cc0d4){_0x2cc0d4[_0xa03d('0x29')][_0xa03d('0x81')]=util[_0xa03d('0x60')](_0xa03d('0x75'),_0x5d5643['user'][_0xa03d('0x38')]);_0x2cc0d4[_0xa03d('0x29')][_0xa03d('0x76')]=_0x1cbf1a[_0xa03d('0x76')];_0x2cc0d4['message'][_0xa03d('0x77')]=_0x1cbf1a[_0xa03d('0x76')];_0x2cc0d4['message'][_0xa03d('0x78')]=_0xa03d('0x34');respondWithRpcPromise(_0xa03d('0x82'),_0xa03d('0x82'),{'event':_0xa03d('0x83'),'message':_[_0xa03d('0x4d')](_0x1cbf1a[_0xa03d('0x29')],JSON[_0xa03d('0x7a')](_0x1cbf1a[_0xa03d('0x67')][_0xa03d('0x7b')]))},client9002);return _0x1cbf1a;}return null;})[_0xa03d('0x52')](respondWithResult(_0x273d45,null))['catch'](handleError(_0x273d45,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index bf35b04..e2bb659 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 _0x6857=['hook','exports','events','../../mysqldb','save','remove','emit'];(function(_0x3c7a54,_0x2e248f){var _0x14a3b=function(_0xe3b51a){while(--_0xe3b51a){_0x3c7a54['push'](_0x3c7a54['shift']());}};_0x14a3b(++_0x2e248f);}(_0x6857,0xc6));var _0x7685=function(_0x254dc2,_0x26c4e0){_0x254dc2=_0x254dc2-0x0;var _0x47ee1b=_0x6857[_0x254dc2];return _0x47ee1b;};'use strict';var EventEmitter=require(_0x7685('0x0'));var ChatMessage=require(_0x7685('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7685('0x2'),'afterUpdate':'update','afterDestroy':_0x7685('0x3')};function emitEvent(_0x26216e){return function(_0x310019,_0x3386d5,_0x1ae74f){ChatMessageEvents[_0x7685('0x4')](_0x26216e+':'+_0x310019['id'],_0x310019);ChatMessageEvents[_0x7685('0x4')](_0x26216e,_0x310019);_0x1ae74f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x7685('0x5')](e,emitEvent(event));}}module[_0x7685('0x6')]=ChatMessageEvents;
\ No newline at end of file
+var _0xd08f=['update','emit','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd08f,0x74));var _0xfd08=function(_0x264a62,_0x25f772){_0x264a62=_0x264a62-0x0;var _0x101811=_0xd08f[_0x264a62];return _0x101811;};'use strict';var EventEmitter=require(_0xfd08('0x0'));var ChatMessage=require(_0xfd08('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xfd08('0x2')](0x0);var events={'afterCreate':_0xfd08('0x3'),'afterUpdate':_0xfd08('0x4'),'afterDestroy':'remove'};function emitEvent(_0x18b6d4){return function(_0x364762,_0x116949,_0x24b3c0){ChatMessageEvents[_0xfd08('0x5')](_0x18b6d4+':'+_0x364762['id'],_0x364762);ChatMessageEvents[_0xfd08('0x5')](_0x18b6d4,_0x364762);_0x24b3c0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xfd08('0x6')](e,emitEvent(event));}}module[_0xfd08('0x7')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 027127c..9cc4392 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 _0xb2ef=['isNil','UserId','ChatInteraction','findOne','ChatInteractionId','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','out'];(function(_0xacaf13,_0x1ea63d){var _0x452ba7=function(_0xb3a3d0){while(--_0xb3a3d0){_0xacaf13['push'](_0xacaf13['shift']());}};_0x452ba7(++_0x1ea63d);}(_0xb2ef,0x121));var _0xfb2e=function(_0x2b34e0,_0x3d9ae8){_0x2b34e0=_0x2b34e0-0x0;var _0x1c15c5=_0xb2ef[_0x2b34e0];return _0x1c15c5;};'use strict';var _=require(_0xfb2e('0x0'));var util=require(_0xfb2e('0x1'));var logger=require(_0xfb2e('0x2'))(_0xfb2e('0x3'));var moment=require(_0xfb2e('0x4'));var BPromise=require(_0xfb2e('0x5'));var rp=require(_0xfb2e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfb2e('0x7'));var config=require(_0xfb2e('0x8'));var attributes=require(_0xfb2e('0x9'));module[_0xfb2e('0xa')]=function(_0x27c3fa,_0x216c25){return _0x27c3fa[_0xfb2e('0xb')](_0xfb2e('0xc'),attributes,{'tableName':_0xfb2e('0xd'),'paranoid':![],'indexes':[{'name':_0xfb2e('0xe'),'fields':[_0xfb2e('0xf')],'type':_0xfb2e('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x161283,_0x14b0b8,_0xf81270){var _0x3b8e4a=_0x27c3fa[_0xfb2e('0x11')];var _0x244341=_0x161283['get']({'plain':!![]});if(_0x244341[_0xfb2e('0x12')][_0xfb2e('0x13')]()==='in'||_0x244341[_0xfb2e('0x12')][_0xfb2e('0x13')]()===_0xfb2e('0x14')&&!_0x244341['secret']&&!_[_0xfb2e('0x15')](_0x244341[_0xfb2e('0x16')])){_0x3b8e4a[_0xfb2e('0x17')][_0xfb2e('0x18')]({'where':{'id':_0x244341[_0xfb2e('0x19')]}})['then'](function(_0x4f96e9){if(_0x4f96e9){_0x4f96e9[_0xfb2e('0x1a')]({'lastMsgAt':_0x244341[_0xfb2e('0x1b')],'lastMsgDirection':_0x244341[_0xfb2e('0x12')][_0xfb2e('0x13')]()});}})[_0xfb2e('0x1c')](function(_0x364362){console['error'](_0x364362);});}_0xf81270();}},'charset':_0xfb2e('0x1d'),'collate':_0xfb2e('0x1e')});};
\ No newline at end of file
+var _0xa554=['define','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','ChatInteractionId','then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','rimraf','./chatMessage.attributes'];(function(_0x4fbb15,_0x21be0c){var _0x436338=function(_0x3b5a05){while(--_0x3b5a05){_0x4fbb15['push'](_0x4fbb15['shift']());}};_0x436338(++_0x21be0c);}(_0xa554,0x12d));var _0x4a55=function(_0x275f17,_0x471f69){_0x275f17=_0x275f17-0x0;var _0x149bb2=_0xa554[_0x275f17];return _0x149bb2;};'use strict';var _=require(_0x4a55('0x0'));var util=require('util');var logger=require(_0x4a55('0x1'))(_0x4a55('0x2'));var moment=require('moment');var BPromise=require(_0x4a55('0x3'));var rp=require(_0x4a55('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4a55('0x5'));var config=require('../../config/environment');var attributes=require(_0x4a55('0x6'));module['exports']=function(_0x5eb575,_0x1c63bf){return _0x5eb575[_0x4a55('0x7')]('ChatMessage',attributes,{'tableName':_0x4a55('0x8'),'paranoid':![],'indexes':[{'name':_0x4a55('0x9'),'fields':[_0x4a55('0xa')],'type':_0x4a55('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x41ddd9,_0x2fb0d9,_0x22d180){var _0x233f76=_0x5eb575[_0x4a55('0xc')];var _0xa6b7b7=_0x41ddd9[_0x4a55('0xd')]({'plain':!![]});if(_0xa6b7b7[_0x4a55('0xe')][_0x4a55('0xf')]()==='in'||_0xa6b7b7[_0x4a55('0xe')]['toLowerCase']()===_0x4a55('0x10')&&!_0xa6b7b7[_0x4a55('0x11')]&&!_[_0x4a55('0x12')](_0xa6b7b7[_0x4a55('0x13')])){_0x233f76['ChatInteraction'][_0x4a55('0x14')]({'where':{'id':_0xa6b7b7[_0x4a55('0x15')]}})[_0x4a55('0x16')](function(_0x2595bf){if(_0x2595bf){_0x2595bf[_0x4a55('0x17')]({'lastMsgAt':_0xa6b7b7[_0x4a55('0x18')],'lastMsgDirection':_0xa6b7b7[_0x4a55('0xe')][_0x4a55('0xf')]()});}})['catch'](function(_0xfed9ea){console[_0x4a55('0x19')](_0xfed9ea);});}_0x22d180();}},'charset':_0x4a55('0x1a'),'collate':_0x4a55('0x1b')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 253a6b6..50dc551 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 _0xfb90=['create','options','raw','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CreateChatMessage','ChatMessage'];(function(_0x494022,_0xdc326c){var _0xfb72f0=function(_0x10cd99){while(--_0x10cd99){_0x494022['push'](_0x494022['shift']());}};_0xfb72f0(++_0xdc326c);}(_0xfb90,0x18f));var _0x0fb9=function(_0xe2a1aa,_0x525d7b){_0xe2a1aa=_0xe2a1aa-0x0;var _0x5a8362=_0xfb90[_0xe2a1aa];return _0x5a8362;};'use strict';var _=require(_0x0fb9('0x0'));var util=require(_0x0fb9('0x1'));var moment=require('moment');var BPromise=require(_0x0fb9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0fb9('0x3'));var db=require(_0x0fb9('0x4'))['db'];var utils=require(_0x0fb9('0x5'));var logger=require(_0x0fb9('0x6'))('rpc');var config=require(_0x0fb9('0x7'));var jayson=require(_0x0fb9('0x8'));var client=jayson[_0x0fb9('0x9')][_0x0fb9('0xa')]({'port':0x232a});config[_0x0fb9('0xb')]=_['defaults'](config[_0x0fb9('0xb')],{'host':_0x0fb9('0xc'),'port':0x18eb});var socket=require(_0x0fb9('0xd'))(new Redis(config[_0x0fb9('0xb')]));require(_0x0fb9('0xe'))['register'](socket);function respondWithRpcPromise(_0x4e753a,_0xa334a1,_0x5afb93){return new BPromise(function(_0x227262,_0x354221){return client[_0x0fb9('0xf')](_0x4e753a,_0x5afb93)[_0x0fb9('0x10')](function(_0x198b21){logger[_0x0fb9('0x11')](_0x0fb9('0x12'),_0xa334a1,'request\x20sent');logger[_0x0fb9('0x13')](_0x0fb9('0x14'),_0xa334a1,'request\x20sent',JSON[_0x0fb9('0x15')](_0x198b21));if(_0x198b21[_0x0fb9('0x16')]){if(_0x198b21[_0x0fb9('0x16')][_0x0fb9('0x17')]===0x1f4){logger[_0x0fb9('0x16')](_0x0fb9('0x12'),_0xa334a1,_0x198b21['error']['message']);return _0x354221(_0x198b21[_0x0fb9('0x16')]['message']);}logger[_0x0fb9('0x16')]('ChatMessage,\x20%s,\x20%s',_0xa334a1,_0x198b21['error'][_0x0fb9('0x18')]);return _0x227262(_0x198b21[_0x0fb9('0x16')][_0x0fb9('0x18')]);}else{logger['info'](_0x0fb9('0x12'),_0xa334a1,_0x0fb9('0x19'));_0x227262(_0x198b21[_0x0fb9('0x1a')][_0x0fb9('0x18')]);}})[_0x0fb9('0x1b')](function(_0x4fdf8d){logger[_0x0fb9('0x16')](_0x0fb9('0x12'),_0xa334a1,_0x4fdf8d);_0x354221(_0x4fdf8d);});});}exports[_0x0fb9('0x1c')]=function(_0x3506b3){var _0x4ffb21=this;return new Promise(function(_0xd0a5ef,_0x51e1f5){return db[_0x0fb9('0x1d')][_0x0fb9('0x1e')](_0x3506b3['body'],{'raw':_0x3506b3['options']?_0x3506b3[_0x0fb9('0x1f')][_0x0fb9('0x20')]===undefined?!![]:![]:!![]})[_0x0fb9('0x10')](function(_0x150044){logger[_0x0fb9('0x11')](_0x0fb9('0x1c'),_0x3506b3);logger[_0x0fb9('0x13')]('CreateChatMessage',_0x3506b3,JSON[_0x0fb9('0x15')](_0x150044));_0xd0a5ef(_0x150044);})[_0x0fb9('0x1b')](function(_0xf27877){logger[_0x0fb9('0x16')](_0x0fb9('0x1c'),_0xf27877[_0x0fb9('0x18')],_0x3506b3);_0x51e1f5(_0x4ffb21['error'](0x1f4,_0xf27877[_0x0fb9('0x18')]));});});};
\ No newline at end of file
+var _0xb957=['client','redis','defaults','localhost','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','stringify','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise'];(function(_0x47568e,_0x5ccdaf){var _0x33815b=function(_0x56b026){while(--_0x56b026){_0x47568e['push'](_0x47568e['shift']());}};_0x33815b(++_0x5ccdaf);}(_0xb957,0x1e6));var _0x7b95=function(_0x54d847,_0x2bd2a1){_0x54d847=_0x54d847-0x0;var _0x57afb3=_0xb957[_0x54d847];return _0x57afb3;};'use strict';var _=require('lodash');var util=require(_0x7b95('0x0'));var moment=require(_0x7b95('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b95('0x2'));var fs=require('fs');var Redis=require(_0x7b95('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7b95('0x4'));var config=require(_0x7b95('0x5'));var jayson=require(_0x7b95('0x6'));var client=jayson[_0x7b95('0x7')]['http']({'port':0x232a});config[_0x7b95('0x8')]=_[_0x7b95('0x9')](config['redis'],{'host':_0x7b95('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatMessage.socket')[_0x7b95('0xb')](socket);function respondWithRpcPromise(_0x4226db,_0x1032ea,_0x24e160){return new BPromise(function(_0x11a261,_0x4c3433){return client[_0x7b95('0xc')](_0x4226db,_0x24e160)[_0x7b95('0xd')](function(_0x968dc1){logger[_0x7b95('0xe')](_0x7b95('0xf'),_0x1032ea,_0x7b95('0x10'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x1032ea,'request\x20sent',JSON['stringify'](_0x968dc1));if(_0x968dc1['error']){if(_0x968dc1[_0x7b95('0x11')][_0x7b95('0x12')]===0x1f4){logger['error'](_0x7b95('0xf'),_0x1032ea,_0x968dc1[_0x7b95('0x11')][_0x7b95('0x13')]);return _0x4c3433(_0x968dc1[_0x7b95('0x11')][_0x7b95('0x13')]);}logger[_0x7b95('0x11')](_0x7b95('0xf'),_0x1032ea,_0x968dc1[_0x7b95('0x11')]['message']);return _0x11a261(_0x968dc1[_0x7b95('0x11')]['message']);}else{logger[_0x7b95('0xe')](_0x7b95('0xf'),_0x1032ea,'request\x20sent');_0x11a261(_0x968dc1[_0x7b95('0x14')][_0x7b95('0x13')]);}})[_0x7b95('0x15')](function(_0x4b9e29){logger[_0x7b95('0x11')](_0x7b95('0xf'),_0x1032ea,_0x4b9e29);_0x4c3433(_0x4b9e29);});});}exports[_0x7b95('0x16')]=function(_0x145987){var _0x52ed2d=this;return new Promise(function(_0x2a2201,_0x5d9615){return db[_0x7b95('0x17')][_0x7b95('0x18')](_0x145987[_0x7b95('0x19')],{'raw':_0x145987[_0x7b95('0x1a')]?_0x145987[_0x7b95('0x1a')][_0x7b95('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x335dfd){logger[_0x7b95('0xe')](_0x7b95('0x16'),_0x145987);logger['debug']('CreateChatMessage',_0x145987,JSON[_0x7b95('0x1c')](_0x335dfd));_0x2a2201(_0x335dfd);})[_0x7b95('0x15')](function(_0x15a10c){logger[_0x7b95('0x11')]('CreateChatMessage',_0x15a10c[_0x7b95('0x13')],_0x145987);_0x5d9615(_0x52ed2d[_0x7b95('0x11')](0x1f4,_0x15a10c[_0x7b95('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 25784ce..a0d931e 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 _0x3d6d=['update','emit','removeListener','length','./chatMessage.events','save','remove'];(function(_0x4452e0,_0x20358b){var _0x1c9be0=function(_0xa95a17){while(--_0xa95a17){_0x4452e0['push'](_0x4452e0['shift']());}};_0x1c9be0(++_0x20358b);}(_0x3d6d,0xb3));var _0xd3d6=function(_0x695b76,_0x551526){_0x695b76=_0x695b76-0x0;var _0x1dc21f=_0x3d6d[_0x695b76];return _0x1dc21f;};'use strict';var ChatMessageEvents=require(_0xd3d6('0x0'));var events=[_0xd3d6('0x1'),_0xd3d6('0x2'),_0xd3d6('0x3')];function createListener(_0x380c09,_0x1e1915){return function(_0x366f41){_0x1e1915[_0xd3d6('0x4')](_0x380c09,_0x366f41);};}function removeListener(_0x297bd6,_0x3d5e37){return function(){ChatMessageEvents[_0xd3d6('0x5')](_0x297bd6,_0x3d5e37);};}exports['register']=function(_0x5400f8){for(var _0x3f36=0x0,_0x1f02f5=events[_0xd3d6('0x6')];_0x3f36<_0x1f02f5;_0x3f36++){var _0x3c2a9b=events[_0x3f36];var _0x4356b7=createListener('chatMessage:'+_0x3c2a9b,_0x5400f8);ChatMessageEvents['on'](_0x3c2a9b,_0x4356b7);}};
\ No newline at end of file
+var _0xb458=['length','./chatMessage.events','save','remove','emit','removeListener'];(function(_0x210a50,_0x253dd5){var _0x23e475=function(_0x5ae27f){while(--_0x5ae27f){_0x210a50['push'](_0x210a50['shift']());}};_0x23e475(++_0x253dd5);}(_0xb458,0x103));var _0x8b45=function(_0x588e08,_0x494086){_0x588e08=_0x588e08-0x0;var _0x2d1902=_0xb458[_0x588e08];return _0x2d1902;};'use strict';var ChatMessageEvents=require(_0x8b45('0x0'));var events=[_0x8b45('0x1'),_0x8b45('0x2'),'update'];function createListener(_0x58a508,_0xdf89d4){return function(_0x93d9cd){_0xdf89d4[_0x8b45('0x3')](_0x58a508,_0x93d9cd);};}function removeListener(_0x13a8c6,_0x5d51e4){return function(){ChatMessageEvents[_0x8b45('0x4')](_0x13a8c6,_0x5d51e4);};}exports['register']=function(_0x5cc2d5){for(var _0xe8d774=0x0,_0x12bd05=events[_0x8b45('0x5')];_0xe8d774<_0x12bd05;_0xe8d774++){var _0x3a8ccb=events[_0xe8d774];var _0x32342f=createListener('chatMessage:'+_0x3a8ccb,_0x5cc2d5);ChatMessageEvents['on'](_0x3a8ccb,_0x32342f);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index f2d176a..a7dabf8 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 _0xf436=['/describe','describe','/:id','tracked','chat','chatmessage:create','create','update','put','/:id/accept','/:id/reject','reject','delete','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated'];(function(_0xe111b0,_0x33b1cb){var _0x370295=function(_0x5945b1){while(--_0x5945b1){_0xe111b0['push'](_0xe111b0['shift']());}};_0x370295(++_0x33b1cb);}(_0xf436,0x1ee));var _0x6f43=function(_0x1b8561,_0xad7d74){_0x1b8561=_0x1b8561-0x0;var _0x4ec35a=_0xf436[_0x1b8561];return _0x4ec35a;};'use strict';var multer=require('multer');var util=require(_0x6f43('0x0'));var path=require('path');var timeout=require(_0x6f43('0x1'));var express=require(_0x6f43('0x2'));var router=express[_0x6f43('0x3')]();var fs_extra=require(_0x6f43('0x4'));var auth=require(_0x6f43('0x5'));var interaction=require(_0x6f43('0x6'));var config=require('../../config/environment');var controller=require(_0x6f43('0x7'));router[_0x6f43('0x8')]('/',auth[_0x6f43('0x9')](),controller['index']);router[_0x6f43('0x8')](_0x6f43('0xa'),auth[_0x6f43('0x9')](),controller[_0x6f43('0xb')]);router[_0x6f43('0x8')](_0x6f43('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x6f43('0x9')](),interaction[_0x6f43('0xd')](_0x6f43('0xe'),_0x6f43('0xf')),controller[_0x6f43('0x10')]);router['put']('/:id',controller[_0x6f43('0x11')]);router[_0x6f43('0x12')](_0x6f43('0x13'),auth[_0x6f43('0x9')](),controller['accept']);router[_0x6f43('0x12')](_0x6f43('0x14'),auth[_0x6f43('0x9')](),controller[_0x6f43('0x15')]);router[_0x6f43('0x16')](_0x6f43('0xc'),auth[_0x6f43('0x9')](),controller[_0x6f43('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0x8f95=['multer','path','express','fs-extra','../../config/environment','./chatMessage.controller','index','get','/describe','isAuthenticated','describe','show','post','tracked','chat','create','put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','exports'];(function(_0x3c45de,_0x1f0979){var _0x270350=function(_0x45f304){while(--_0x45f304){_0x3c45de['push'](_0x3c45de['shift']());}};_0x270350(++_0x1f0979);}(_0x8f95,0x12c));var _0x58f9=function(_0x7c018a,_0x499ba2){_0x7c018a=_0x7c018a-0x0;var _0x5a819a=_0x8f95[_0x7c018a];return _0x5a819a;};'use strict';var multer=require(_0x58f9('0x0'));var util=require('util');var path=require(_0x58f9('0x1'));var timeout=require('connect-timeout');var express=require(_0x58f9('0x2'));var router=express['Router']();var fs_extra=require(_0x58f9('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x58f9('0x4'));var controller=require(_0x58f9('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x58f9('0x6')]);router[_0x58f9('0x7')](_0x58f9('0x8'),auth[_0x58f9('0x9')](),controller[_0x58f9('0xa')]);router[_0x58f9('0x7')]('/:id',auth[_0x58f9('0x9')](),controller[_0x58f9('0xb')]);router[_0x58f9('0xc')]('/',auth[_0x58f9('0x9')](),interaction[_0x58f9('0xd')](_0x58f9('0xe'),'chatmessage:create'),controller[_0x58f9('0xf')]);router[_0x58f9('0x10')](_0x58f9('0x11'),controller[_0x58f9('0x12')]);router['put'](_0x58f9('0x13'),auth[_0x58f9('0x9')](),controller[_0x58f9('0x14')]);router[_0x58f9('0x10')](_0x58f9('0x15'),auth[_0x58f9('0x9')](),controller[_0x58f9('0x16')]);router[_0x58f9('0x17')](_0x58f9('0x11'),auth[_0x58f9('0x9')](),controller['destroy']);module[_0x58f9('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 1da5490..4ad973c 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 _0x5f66=['medium','TEXT','exports'];(function(_0x5695c9,_0x5ddd60){var _0x310254=function(_0x2a1c18){while(--_0x2a1c18){_0x5695c9['push'](_0x5695c9['shift']());}};_0x310254(++_0x5ddd60);}(_0x5f66,0x1a0));var _0x65f6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5f66[_0x19e35c];return _0x3e1fe8;};'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
+var _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x187868,_0x4064f7){var _0x1b7847=function(_0x31a267){while(--_0x31a267){_0x187868['push'](_0x187868['shift']());}};_0x1b7847(++_0x4064f7);}(_0xdb28,0x106));var _0x8db2=function(_0x4ac811,_0x1797b3){_0x4ac811=_0x4ac811-0x0;var _0x260b21=_0xdb28[_0x4ac811];return _0x260b21;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index a23b5d9..a90617e 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(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x7a54,0x106));var _0x47a5=function(_0x2ad945,_0xa1b5ad){_0x2ad945=_0x2ad945-0x0;var _0x578e33=_0x7a54[_0x2ad945];return _0x578e33;};'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(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x7a54,0x106));var _0x47a5=function(_0x282875,_0x706b6f){_0x282875=_0x282875-0x0;var _0x25c36f=_0x7a54[_0x282875];return _0x25c36f;};'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 3b07a78..44ec5aa 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 _0x7166=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage','save','update','remove'];(function(_0x13c304,_0x4791de){var _0x12696e=function(_0x2070d4){while(--_0x2070d4){_0x13c304['push'](_0x13c304['shift']());}};_0x12696e(++_0x4791de);}(_0x7166,0x90));var _0x6716=function(_0x1b3a5c,_0x2f9d5f){_0x1b3a5c=_0x1b3a5c-0x0;var _0x2ae8cb=_0x7166[_0x1b3a5c];return _0x2ae8cb;};'use strict';var EventEmitter=require(_0x6716('0x0'));var ChatOfflineMessage=require(_0x6716('0x1'))['db'][_0x6716('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6716('0x3'),'afterUpdate':_0x6716('0x4'),'afterDestroy':_0x6716('0x5')};function emitEvent(_0x55f69d){return function(_0x4bfa7f,_0x3b711d,_0x26d51b){ChatOfflineMessageEvents[_0x6716('0x6')](_0x55f69d+':'+_0x4bfa7f['id'],_0x4bfa7f);ChatOfflineMessageEvents[_0x6716('0x6')](_0x55f69d,_0x4bfa7f);_0x26d51b(null);};}for(var e in events){if(events[_0x6716('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x6716('0x8')](e,emitEvent(event));}}module[_0x6716('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x3d3c=['hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x194ac2,_0x4588f4){var _0x1d726b=function(_0xd4e938){while(--_0xd4e938){_0x194ac2['push'](_0x194ac2['shift']());}};_0x1d726b(++_0x4588f4);}(_0x3d3c,0x98));var _0xc3d3=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x3d3c[_0x47e7cb];return _0x2a8874;};'use strict';var EventEmitter=require(_0xc3d3('0x0'));var ChatOfflineMessage=require(_0xc3d3('0x1'))['db'][_0xc3d3('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xc3d3('0x3')](0x0);var events={'afterCreate':_0xc3d3('0x4'),'afterUpdate':_0xc3d3('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5116b4){return function(_0x5de982,_0x1e6e66,_0x4efade){ChatOfflineMessageEvents[_0xc3d3('0x6')](_0x5116b4+':'+_0x5de982['id'],_0x5de982);ChatOfflineMessageEvents[_0xc3d3('0x6')](_0x5116b4,_0x5de982);_0x4efade(null);};}for(var e in events){if(events[_0xc3d3('0x7')](e)){var event=events[e];ChatOfflineMessage[_0xc3d3('0x8')](e,emitEvent(event));}}module[_0xc3d3('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 3181ea7..10fa07b 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 _0x4f34=['ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x4f34,0xac));var _0x44f3=function(_0x1f5067,_0x2e995a){_0x1f5067=_0x1f5067-0x0;var _0x4c21d4=_0x4f34[_0x1f5067];return _0x4c21d4;};'use strict';var attributes=require(_0x44f3('0x0'));module[_0x44f3('0x1')]=function(_0x423849){return _0x423849[_0x44f3('0x2')](_0x44f3('0x3'),attributes,{'tableName':_0x44f3('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x44f3('0x5'),'collate':_0x44f3('0x6')});};
\ No newline at end of file
+var _0x7bf9=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0x13de2a,_0x102705){var _0x5407fa=function(_0x39a31c){while(--_0x39a31c){_0x13de2a['push'](_0x13de2a['shift']());}};_0x5407fa(++_0x102705);}(_0x7bf9,0x1e1));var _0x97bf=function(_0x34b89e,_0x2b1385){_0x34b89e=_0x34b89e-0x0;var _0xfeb914=_0x7bf9[_0x34b89e];return _0xfeb914;};'use strict';var attributes=require(_0x97bf('0x0'));module['exports']=function(_0x199213){return _0x199213[_0x97bf('0x1')](_0x97bf('0x2'),attributes,{'tableName':_0x97bf('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x97bf('0x4'),'collate':_0x97bf('0x5')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index f2928e4..03a1a06 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 _0xf776=['error','code','ChatOfflineMessage,\x20%s,\x20%s','message','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x17c63b,_0x5f2190){var _0x412594=function(_0x31a240){while(--_0x31a240){_0x17c63b['push'](_0x17c63b['shift']());}};_0x412594(++_0x5f2190);}(_0xf776,0x169));var _0x6f77=function(_0x3fb1ec,_0x32d8cb){_0x3fb1ec=_0x3fb1ec-0x0;var _0x50535b=_0xf776[_0x3fb1ec];return _0x50535b;};'use strict';var _=require(_0x6f77('0x0'));var util=require('util');var moment=require(_0x6f77('0x1'));var BPromise=require(_0x6f77('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6f77('0x3'));var db=require(_0x6f77('0x4'))['db'];var utils=require(_0x6f77('0x5'));var logger=require(_0x6f77('0x6'))('rpc');var config=require(_0x6f77('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6f77('0x8')][_0x6f77('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36ffd2,_0x18a937,_0x545ba9){return new BPromise(function(_0x1dd52f,_0x5a83ba){return client[_0x6f77('0xa')](_0x36ffd2,_0x545ba9)[_0x6f77('0xb')](function(_0x14ea05){logger[_0x6f77('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x18a937,_0x6f77('0xd'));logger[_0x6f77('0xe')](_0x6f77('0xf'),_0x18a937,_0x6f77('0xd'),JSON[_0x6f77('0x10')](_0x14ea05));if(_0x14ea05[_0x6f77('0x11')]){if(_0x14ea05['error'][_0x6f77('0x12')]===0x1f4){logger[_0x6f77('0x11')](_0x6f77('0x13'),_0x18a937,_0x14ea05[_0x6f77('0x11')][_0x6f77('0x14')]);return _0x5a83ba(_0x14ea05[_0x6f77('0x11')][_0x6f77('0x14')]);}logger[_0x6f77('0x11')](_0x6f77('0x13'),_0x18a937,_0x14ea05[_0x6f77('0x11')][_0x6f77('0x14')]);return _0x1dd52f(_0x14ea05[_0x6f77('0x11')]['message']);}else{logger['info'](_0x6f77('0x13'),_0x18a937,_0x6f77('0xd'));_0x1dd52f(_0x14ea05['result'][_0x6f77('0x14')]);}})['catch'](function(_0xf36aa2){logger[_0x6f77('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x18a937,_0xf36aa2);_0x5a83ba(_0xf36aa2);});});}
\ No newline at end of file
+var _0x65a0=['code','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','error'];(function(_0x56e63d,_0x28afdb){var _0x5d7fd3=function(_0x1aff11){while(--_0x1aff11){_0x56e63d['push'](_0x56e63d['shift']());}};_0x5d7fd3(++_0x28afdb);}(_0x65a0,0x89));var _0x065a=function(_0xd83600,_0x419250){_0xd83600=_0xd83600-0x0;var _0x294526=_0x65a0[_0xd83600];return _0x294526;};'use strict';var _=require(_0x065a('0x0'));var util=require(_0x065a('0x1'));var moment=require('moment');var BPromise=require(_0x065a('0x2'));var rs=require(_0x065a('0x3'));var fs=require('fs');var Redis=require(_0x065a('0x4'));var db=require(_0x065a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x065a('0x6'))('rpc');var config=require(_0x065a('0x7'));var jayson=require(_0x065a('0x8'));var client=jayson[_0x065a('0x9')][_0x065a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x200ba9,_0x27444a,_0x4baf12){return new BPromise(function(_0x32a711,_0x16f5a5){return client[_0x065a('0xb')](_0x200ba9,_0x4baf12)[_0x065a('0xc')](function(_0x5a95ae){logger[_0x065a('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x27444a,_0x065a('0xe'));logger[_0x065a('0xf')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x27444a,_0x065a('0xe'),JSON['stringify'](_0x5a95ae));if(_0x5a95ae[_0x065a('0x10')]){if(_0x5a95ae['error'][_0x065a('0x11')]===0x1f4){logger[_0x065a('0x10')](_0x065a('0x12'),_0x27444a,_0x5a95ae[_0x065a('0x10')][_0x065a('0x13')]);return _0x16f5a5(_0x5a95ae[_0x065a('0x10')][_0x065a('0x13')]);}logger[_0x065a('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x27444a,_0x5a95ae['error'][_0x065a('0x13')]);return _0x32a711(_0x5a95ae['error']['message']);}else{logger[_0x065a('0xd')](_0x065a('0x12'),_0x27444a,_0x065a('0xe'));_0x32a711(_0x5a95ae[_0x065a('0x14')][_0x065a('0x13')]);}})[_0x065a('0x15')](function(_0xa5a0f0){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x27444a,_0xa5a0f0);_0x16f5a5(_0xa5a0f0);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 306dafd..1a8c7af 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 _0x3d15=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','describe','/:id','post','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3d15,0x12a));var _0x53d1=function(_0x541f17,_0x8adfd1){_0x541f17=_0x541f17-0x0;var _0x4765f6=_0x3d15[_0x541f17];return _0x4765f6;};'use strict';var multer=require(_0x53d1('0x0'));var util=require(_0x53d1('0x1'));var path=require(_0x53d1('0x2'));var timeout=require(_0x53d1('0x3'));var express=require(_0x53d1('0x4'));var router=express['Router']();var fs_extra=require(_0x53d1('0x5'));var auth=require(_0x53d1('0x6'));var interaction=require(_0x53d1('0x7'));var config=require(_0x53d1('0x8'));var controller=require(_0x53d1('0x9'));router[_0x53d1('0xa')]('/',auth[_0x53d1('0xb')](),controller[_0x53d1('0xc')]);router[_0x53d1('0xa')]('/describe',auth[_0x53d1('0xb')](),controller[_0x53d1('0xd')]);router[_0x53d1('0xa')](_0x53d1('0xe'),auth[_0x53d1('0xb')](),controller['show']);router[_0x53d1('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x53d1('0x10')](_0x53d1('0xe'),auth[_0x53d1('0xb')](),controller[_0x53d1('0x11')]);router[_0x53d1('0x12')](_0x53d1('0xe'),auth['isAuthenticated'](),controller[_0x53d1('0x13')]);module[_0x53d1('0x14')]=router;
\ No newline at end of file
+var _0xab1b=['show','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xab1b,0x17c));var _0xbab1=function(_0x56a0e8,_0x154861){_0x56a0e8=_0x56a0e8-0x0;var _0x71abc3=_0xab1b[_0x56a0e8];return _0x71abc3;};'use strict';var multer=require(_0xbab1('0x0'));var util=require(_0xbab1('0x1'));var path=require(_0xbab1('0x2'));var timeout=require(_0xbab1('0x3'));var express=require(_0xbab1('0x4'));var router=express[_0xbab1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbab1('0x6'));var interaction=require(_0xbab1('0x7'));var config=require(_0xbab1('0x8'));var controller=require(_0xbab1('0x9'));router[_0xbab1('0xa')]('/',auth[_0xbab1('0xb')](),controller[_0xbab1('0xc')]);router[_0xbab1('0xa')](_0xbab1('0xd'),auth[_0xbab1('0xb')](),controller[_0xbab1('0xe')]);router[_0xbab1('0xa')](_0xbab1('0xf'),auth[_0xbab1('0xb')](),controller[_0xbab1('0x10')]);router[_0xbab1('0x11')]('/',auth[_0xbab1('0xb')](),controller[_0xbab1('0x12')]);router[_0xbab1('0x13')]('/:id',auth[_0xbab1('0xb')](),controller['update']);router[_0xbab1('0x14')]('/:id',auth[_0xbab1('0xb')](),controller['destroy']);module[_0xbab1('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 32ae750..af880de 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 _0xdcbd=['mouseOver','timeout','INTEGER','STRING'];(function(_0x3712e2,_0x32d752){var _0x1faff4=function(_0x550dc0){while(--_0x550dc0){_0x3712e2['push'](_0x3712e2['shift']());}};_0x1faff4(++_0x32d752);}(_0xdcbd,0x107));var _0xddcb=function(_0x5e3769,_0x1befbe){_0x5e3769=_0x5e3769-0x0;var _0x566ca6=_0xdcbd[_0x5e3769];return _0x566ca6;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xddcb('0x0')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xddcb('0x1'),_0xddcb('0x2')),'defaultValue':_0xddcb('0x1')},'selector':{'type':Sequelize[_0xddcb('0x0')]},'timeout':{'type':Sequelize[_0xddcb('0x3')]}};
\ No newline at end of file
+var _0x6ffd=['ENUM','mouseOver','INTEGER','sequelize','exports','STRING'];(function(_0x5e248b,_0x589169){var _0x2cdca2=function(_0x5e9aab){while(--_0x5e9aab){_0x5e248b['push'](_0x5e248b['shift']());}};_0x2cdca2(++_0x589169);}(_0x6ffd,0x1b3));var _0xd6ff=function(_0x14dbc3,_0x520570){_0x14dbc3=_0x14dbc3-0x0;var _0x2be0b4=_0x6ffd[_0x14dbc3];return _0x2be0b4;};'use strict';var Sequelize=require(_0xd6ff('0x0'));module[_0xd6ff('0x1')]={'name':{'type':Sequelize[_0xd6ff('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xd6ff('0x3')](_0xd6ff('0x4'),'timeout'),'defaultValue':_0xd6ff('0x4')},'selector':{'type':Sequelize[_0xd6ff('0x2')]},'timeout':{'type':Sequelize[_0xd6ff('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index fa0d389..34a7e48 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 _0x28e3=['reject','save','update','then','destroy','error','name','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','options','find','create','body','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','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','limit','undefined','count','set'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x28e3,0x106));var _0x328e=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x28e3[_0x160c73];return _0xd9302;};'use strict';var emlformat=require(_0x328e('0x0'));var rimraf=require(_0x328e('0x1'));var zipdir=require(_0x328e('0x2'));var jsonpatch=require(_0x328e('0x3'));var rp=require('request-promise');var moment=require(_0x328e('0x4'));var BPromise=require(_0x328e('0x5'));var Mustache=require(_0x328e('0x6'));var util=require(_0x328e('0x7'));var path=require(_0x328e('0x8'));var sox=require(_0x328e('0x9'));var csv=require(_0x328e('0xa'));var ejs=require(_0x328e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x328e('0xc'));var jsforce=require(_0x328e('0xd'));var deskjs=require(_0x328e('0xe'));var toCsv=require(_0x328e('0xa'));var querystring=require(_0x328e('0xf'));var Papa=require('papaparse');var Redis=require(_0x328e('0x10'));var authService=require(_0x328e('0x11'));var qs=require(_0x328e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x328e('0x13'));var utils=require(_0x328e('0x14'));var config=require(_0x328e('0x15'));var licenseUtil=require(_0x328e('0x16'));var db=require(_0x328e('0x17'))['db'];function respondWithStatusCode(_0x45cda0,_0x4699ec){_0x4699ec=_0x4699ec||0xcc;return function(_0x39338e){if(_0x39338e){return _0x45cda0[_0x328e('0x18')](_0x4699ec);}return _0x45cda0[_0x328e('0x19')](_0x4699ec)[_0x328e('0x1a')]();};}function respondWithResult(_0x4abd75,_0x89600b){_0x89600b=_0x89600b||0xc8;return function(_0x1cddc3){if(_0x1cddc3){return _0x4abd75[_0x328e('0x19')](_0x89600b)[_0x328e('0x1b')](_0x1cddc3);}};}function respondWithFilteredResult(_0x29f8bf,_0x397b16){return function(_0x2a8096){if(_0x2a8096){var _0x3c5b37=typeof _0x397b16[_0x328e('0x1c')]==='undefined'&&typeof _0x397b16[_0x328e('0x1d')]===_0x328e('0x1e');var _0x116f46=_0x2a8096[_0x328e('0x1f')];var _0xf69c0f=_0x3c5b37?0x0:_0x397b16[_0x328e('0x1c')];var _0x41a6bb=_0x3c5b37?_0x2a8096['count']:_0x397b16[_0x328e('0x1c')]+_0x397b16[_0x328e('0x1d')];var _0x448f5a;if(_0x41a6bb>=_0x116f46){_0x41a6bb=_0x116f46;_0x448f5a=0xc8;}else{_0x448f5a=0xce;}_0x29f8bf[_0x328e('0x19')](_0x448f5a);return _0x29f8bf[_0x328e('0x20')]('Content-Range',_0xf69c0f+'-'+_0x41a6bb+'/'+_0x116f46)[_0x328e('0x1b')](_0x2a8096);}return null;};}function patchUpdates(_0x1c5551){return function(_0x3d876b){try{jsonpatch['apply'](_0x3d876b,_0x1c5551,!![]);}catch(_0x35da3b){return BPromise[_0x328e('0x21')](_0x35da3b);}return _0x3d876b[_0x328e('0x22')]();};}function saveUpdates(_0x273b45,_0x233bd3){return function(_0x1c43f8){if(_0x1c43f8){return _0x1c43f8[_0x328e('0x23')](_0x273b45)[_0x328e('0x24')](function(_0x3878d7){return _0x3878d7;});}return null;};}function removeEntity(_0x5cbc7f,_0x4e1d4c){return function(_0x139ef3){if(_0x139ef3){return _0x139ef3[_0x328e('0x25')]()[_0x328e('0x24')](function(){_0x5cbc7f[_0x328e('0x19')](0xcc)[_0x328e('0x1a')]();});}};}function handleEntityNotFound(_0x4a62a8,_0x23fda2){return function(_0x48a854){if(!_0x48a854){_0x4a62a8[_0x328e('0x18')](0x194);}return _0x48a854;};}function handleError(_0x476b6a,_0x28da22){_0x28da22=_0x28da22||0x1f4;return function(_0x2fab5a){logger[_0x328e('0x26')](_0x2fab5a['stack']);if(_0x2fab5a['name']){delete _0x2fab5a[_0x328e('0x27')];}_0x476b6a['status'](_0x28da22)['send'](_0x2fab5a);};}exports[_0x328e('0x28')]=function(_0x270d58,_0x5873d1){var _0x232ec7={'raw':!![],'where':{'id':_0x270d58['params']['id']}},_0x1fdc4d={};_0x1fdc4d[_0x328e('0x29')]=_[_0x328e('0x2a')](db[_0x328e('0x2b')][_0x328e('0x2c')]);_0x1fdc4d[_0x328e('0x2d')]=_['keys'](_0x270d58[_0x328e('0x2d')]);_0x1fdc4d[_0x328e('0x2e')]=_[_0x328e('0x2f')](_0x1fdc4d[_0x328e('0x29')],_0x1fdc4d[_0x328e('0x2d')]);_0x232ec7[_0x328e('0x30')]=_[_0x328e('0x2f')](_0x1fdc4d[_0x328e('0x29')],qs[_0x328e('0x31')](_0x270d58['query']['fields']));_0x232ec7[_0x328e('0x30')]=_0x232ec7[_0x328e('0x30')]['length']?_0x232ec7['attributes']:_0x1fdc4d['model'];if(_0x270d58[_0x328e('0x2d')][_0x328e('0x32')]){_0x232ec7[_0x328e('0x33')]=[{'all':!![]}];}_0x232ec7=_[_0x328e('0x34')]({},_0x232ec7,_0x270d58[_0x328e('0x35')]);return db[_0x328e('0x2b')][_0x328e('0x36')](_0x232ec7)['then'](handleEntityNotFound(_0x5873d1,null))[_0x328e('0x24')](respondWithResult(_0x5873d1,null))['catch'](handleError(_0x5873d1,null));};exports['create']=function(_0x25f1ba,_0x479bda){return db[_0x328e('0x2b')][_0x328e('0x37')](_0x25f1ba[_0x328e('0x38')],{})['then'](respondWithResult(_0x479bda,0xc9))[_0x328e('0x39')](handleError(_0x479bda,null));};exports['update']=function(_0x2ba70c,_0x38ebdc){if(_0x2ba70c[_0x328e('0x38')]['id']){delete _0x2ba70c[_0x328e('0x38')]['id'];}return db['ChatProactiveAction'][_0x328e('0x36')]({'where':{'id':_0x2ba70c['params']['id']}})[_0x328e('0x24')](handleEntityNotFound(_0x38ebdc,null))['then'](saveUpdates(_0x2ba70c['body'],null))[_0x328e('0x24')](respondWithResult(_0x38ebdc,null))['catch'](handleError(_0x38ebdc,null));};exports[_0x328e('0x25')]=function(_0x3c8a91,_0x1892e0){return db[_0x328e('0x2b')]['find']({'where':{'id':_0x3c8a91[_0x328e('0x3a')]['id']}})[_0x328e('0x24')](handleEntityNotFound(_0x1892e0,null))[_0x328e('0x24')](removeEntity(_0x1892e0,null))[_0x328e('0x39')](handleError(_0x1892e0,null));};
\ No newline at end of file
+var _0x36b2=['lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','merge','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra'];(function(_0x508835,_0x80e24b){var _0x5b8e84=function(_0x299554){while(--_0x299554){_0x508835['push'](_0x508835['shift']());}};_0x5b8e84(++_0x80e24b);}(_0x36b2,0x6b));var _0x236b=function(_0x3ddd84,_0x39140a){_0x3ddd84=_0x3ddd84-0x0;var _0x307d01=_0x36b2[_0x3ddd84];return _0x307d01;};'use strict';var emlformat=require(_0x236b('0x0'));var rimraf=require(_0x236b('0x1'));var zipdir=require(_0x236b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x236b('0x3'));var moment=require(_0x236b('0x4'));var BPromise=require(_0x236b('0x5'));var Mustache=require('mustache');var util=require(_0x236b('0x6'));var path=require(_0x236b('0x7'));var sox=require('sox');var csv=require(_0x236b('0x8'));var ejs=require(_0x236b('0x9'));var fs=require('fs');var fs_extra=require(_0x236b('0xa'));var _=require(_0x236b('0xb'));var squel=require(_0x236b('0xc'));var crypto=require(_0x236b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x236b('0xe'));var toCsv=require(_0x236b('0x8'));var querystring=require(_0x236b('0xf'));var Papa=require(_0x236b('0x10'));var Redis=require('ioredis');var authService=require(_0x236b('0x11'));var qs=require(_0x236b('0x12'));var as=require(_0x236b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x236b('0x14'))(_0x236b('0x15'));var utils=require(_0x236b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x236b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52393a,_0x1ee631){_0x1ee631=_0x1ee631||0xcc;return function(_0x5d5d8a){if(_0x5d5d8a){return _0x52393a[_0x236b('0x18')](_0x1ee631);}return _0x52393a[_0x236b('0x19')](_0x1ee631)[_0x236b('0x1a')]();};}function respondWithResult(_0x2410a5,_0x2df000){_0x2df000=_0x2df000||0xc8;return function(_0xa772f3){if(_0xa772f3){return _0x2410a5[_0x236b('0x19')](_0x2df000)['json'](_0xa772f3);}};}function respondWithFilteredResult(_0x5476ac,_0xcc6d01){return function(_0x13248a){if(_0x13248a){var _0x258935=typeof _0xcc6d01[_0x236b('0x1b')]===_0x236b('0x1c')&&typeof _0xcc6d01['limit']==='undefined';var _0xab13f4=_0x13248a['count'];var _0x18878f=_0x258935?0x0:_0xcc6d01[_0x236b('0x1b')];var _0x5a6c07=_0x258935?_0x13248a['count']:_0xcc6d01[_0x236b('0x1b')]+_0xcc6d01['limit'];var _0x1be23c;if(_0x5a6c07>=_0xab13f4){_0x5a6c07=_0xab13f4;_0x1be23c=0xc8;}else{_0x1be23c=0xce;}_0x5476ac['status'](_0x1be23c);return _0x5476ac['set'](_0x236b('0x1d'),_0x18878f+'-'+_0x5a6c07+'/'+_0xab13f4)[_0x236b('0x1e')](_0x13248a);}return null;};}function patchUpdates(_0x3f4ed3){return function(_0x35e4f1){try{jsonpatch[_0x236b('0x1f')](_0x35e4f1,_0x3f4ed3,!![]);}catch(_0x7a1430){return BPromise[_0x236b('0x20')](_0x7a1430);}return _0x35e4f1[_0x236b('0x21')]();};}function saveUpdates(_0x1159c5,_0x1927a1){return function(_0x168ede){if(_0x168ede){return _0x168ede[_0x236b('0x22')](_0x1159c5)['then'](function(_0xc135e7){return _0xc135e7;});}return null;};}function removeEntity(_0xc8d8cf,_0x5711a9){return function(_0xb18e7){if(_0xb18e7){return _0xb18e7[_0x236b('0x23')]()[_0x236b('0x24')](function(){_0xc8d8cf['status'](0xcc)[_0x236b('0x1a')]();});}};}function handleEntityNotFound(_0x1617f8,_0xd405b3){return function(_0x154905){if(!_0x154905){_0x1617f8[_0x236b('0x18')](0x194);}return _0x154905;};}function handleError(_0x29e0ec,_0x9702b2){_0x9702b2=_0x9702b2||0x1f4;return function(_0x4d319e){logger[_0x236b('0x25')](_0x4d319e[_0x236b('0x26')]);if(_0x4d319e[_0x236b('0x27')]){delete _0x4d319e[_0x236b('0x27')];}_0x29e0ec[_0x236b('0x19')](_0x9702b2)[_0x236b('0x28')](_0x4d319e);};}exports[_0x236b('0x29')]=function(_0x1b5a50,_0x1de15f){var _0x2e7fc5={'raw':!![],'where':{'id':_0x1b5a50[_0x236b('0x2a')]['id']}},_0x15a520={};_0x15a520[_0x236b('0x2b')]=_[_0x236b('0x2c')](db[_0x236b('0x2d')][_0x236b('0x2e')]);_0x15a520['query']=_[_0x236b('0x2c')](_0x1b5a50[_0x236b('0x2f')]);_0x15a520[_0x236b('0x30')]=_['intersection'](_0x15a520[_0x236b('0x2b')],_0x15a520[_0x236b('0x2f')]);_0x2e7fc5[_0x236b('0x31')]=_[_0x236b('0x32')](_0x15a520[_0x236b('0x2b')],qs[_0x236b('0x33')](_0x1b5a50[_0x236b('0x2f')][_0x236b('0x33')]));_0x2e7fc5[_0x236b('0x31')]=_0x2e7fc5[_0x236b('0x31')][_0x236b('0x34')]?_0x2e7fc5[_0x236b('0x31')]:_0x15a520[_0x236b('0x2b')];if(_0x1b5a50[_0x236b('0x2f')][_0x236b('0x35')]){_0x2e7fc5['include']=[{'all':!![]}];}_0x2e7fc5=_[_0x236b('0x36')]({},_0x2e7fc5,_0x1b5a50['options']);return db['ChatProactiveAction'][_0x236b('0x37')](_0x2e7fc5)[_0x236b('0x24')](handleEntityNotFound(_0x1de15f,null))[_0x236b('0x24')](respondWithResult(_0x1de15f,null))[_0x236b('0x38')](handleError(_0x1de15f,null));};exports[_0x236b('0x39')]=function(_0x1aafd8,_0x5a113e){return db[_0x236b('0x2d')]['create'](_0x1aafd8['body'],{})[_0x236b('0x24')](respondWithResult(_0x5a113e,0xc9))[_0x236b('0x38')](handleError(_0x5a113e,null));};exports[_0x236b('0x22')]=function(_0x38664d,_0x2a019c){if(_0x38664d['body']['id']){delete _0x38664d[_0x236b('0x3a')]['id'];}return db[_0x236b('0x2d')][_0x236b('0x37')]({'where':{'id':_0x38664d[_0x236b('0x2a')]['id']}})[_0x236b('0x24')](handleEntityNotFound(_0x2a019c,null))[_0x236b('0x24')](saveUpdates(_0x38664d[_0x236b('0x3a')],null))[_0x236b('0x24')](respondWithResult(_0x2a019c,null))[_0x236b('0x38')](handleError(_0x2a019c,null));};exports[_0x236b('0x23')]=function(_0x19d202,_0x209759){return db[_0x236b('0x2d')][_0x236b('0x37')]({'where':{'id':_0x19d202[_0x236b('0x2a')]['id']}})[_0x236b('0x24')](handleEntityNotFound(_0x209759,null))[_0x236b('0x24')](removeEntity(_0x209759,null))[_0x236b('0x38')](handleError(_0x209759,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 6632261..4ae8088 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 _0xdffc=['./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3371d7,_0xc5a179){var _0x53c402=function(_0x2f1001){while(--_0x2f1001){_0x3371d7['push'](_0x3371d7['shift']());}};_0x53c402(++_0xc5a179);}(_0xdffc,0x122));var _0xcdff=function(_0x8844fe,_0x52f601){_0x8844fe=_0x8844fe-0x0;var _0x281198=_0xdffc[_0x8844fe];return _0x281198;};'use strict';var _=require(_0xcdff('0x0'));var util=require(_0xcdff('0x1'));var logger=require(_0xcdff('0x2'))(_0xcdff('0x3'));var moment=require(_0xcdff('0x4'));var BPromise=require(_0xcdff('0x5'));var rp=require(_0xcdff('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcdff('0x7'));module['exports']=function(_0x467f42,_0x2f23af){return _0x467f42[_0xcdff('0x8')](_0xcdff('0x9'),attributes,{'tableName':_0xcdff('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x70c6=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions','lodash','api'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x70c6,0xca));var _0x670c=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x70c6[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x670c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x670c('0x1'));var moment=require(_0x670c('0x2'));var BPromise=require(_0x670c('0x3'));var rp=require(_0x670c('0x4'));var fs=require('fs');var path=require(_0x670c('0x5'));var rimraf=require(_0x670c('0x6'));var config=require(_0x670c('0x7'));var attributes=require(_0x670c('0x8'));module[_0x670c('0x9')]=function(_0xddece4,_0x36be23){return _0xddece4['define'](_0x670c('0xa'),attributes,{'tableName':_0x670c('0xb'),'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 9f4cba7..d0422b4 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 _0x8d70=['client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x18f772,_0x555096){var _0xb0402e=function(_0x34d203){while(--_0x34d203){_0x18f772['push'](_0x18f772['shift']());}};_0xb0402e(++_0x555096);}(_0x8d70,0x168));var _0x08d7=function(_0x2fe931,_0x5c3ba9){_0x2fe931=_0x2fe931-0x0;var _0x476f82=_0x8d70[_0x2fe931];return _0x476f82;};'use strict';var _=require(_0x08d7('0x0'));var util=require('util');var moment=require(_0x08d7('0x1'));var BPromise=require(_0x08d7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x08d7('0x3'))['db'];var utils=require(_0x08d7('0x4'));var logger=require('../../config/logger')(_0x08d7('0x5'));var config=require(_0x08d7('0x6'));var jayson=require(_0x08d7('0x7'));var client=jayson[_0x08d7('0x8')][_0x08d7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3bac6c,_0x222c65,_0x2a685f){return new BPromise(function(_0x1f41e7,_0x22d06d){return client[_0x08d7('0xa')](_0x3bac6c,_0x2a685f)[_0x08d7('0xb')](function(_0x2767a4){logger[_0x08d7('0xc')](_0x08d7('0xd'),_0x222c65,_0x08d7('0xe'));logger[_0x08d7('0xf')](_0x08d7('0x10'),_0x222c65,_0x08d7('0xe'),JSON[_0x08d7('0x11')](_0x2767a4));if(_0x2767a4[_0x08d7('0x12')]){if(_0x2767a4['error'][_0x08d7('0x13')]===0x1f4){logger[_0x08d7('0x12')](_0x08d7('0xd'),_0x222c65,_0x2767a4['error'][_0x08d7('0x14')]);return _0x22d06d(_0x2767a4[_0x08d7('0x12')][_0x08d7('0x14')]);}logger[_0x08d7('0x12')](_0x08d7('0xd'),_0x222c65,_0x2767a4[_0x08d7('0x12')][_0x08d7('0x14')]);return _0x1f41e7(_0x2767a4[_0x08d7('0x12')][_0x08d7('0x14')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x222c65,_0x08d7('0xe'));_0x1f41e7(_0x2767a4[_0x08d7('0x15')][_0x08d7('0x14')]);}})[_0x08d7('0x16')](function(_0x54eb1b){logger[_0x08d7('0x12')](_0x08d7('0xd'),_0x222c65,_0x54eb1b);_0x22d06d(_0x54eb1b);});});}
\ No newline at end of file
+var _0xa503=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatProactiveAction,\x20%s,\x20%s','catch','lodash','util'];(function(_0x3dfef7,_0x2be200){var _0x19b5d7=function(_0x4c328d){while(--_0x4c328d){_0x3dfef7['push'](_0x3dfef7['shift']());}};_0x19b5d7(++_0x2be200);}(_0xa503,0x1a0));var _0x3a50=function(_0x82f677,_0x5df5a2){_0x82f677=_0x82f677-0x0;var _0x398635=_0xa503[_0x82f677];return _0x398635;};'use strict';var _=require(_0x3a50('0x0'));var util=require(_0x3a50('0x1'));var moment=require('moment');var BPromise=require(_0x3a50('0x2'));var rs=require(_0x3a50('0x3'));var fs=require('fs');var Redis=require(_0x3a50('0x4'));var db=require(_0x3a50('0x5'))['db'];var utils=require(_0x3a50('0x6'));var logger=require(_0x3a50('0x7'))(_0x3a50('0x8'));var config=require('../../config/environment');var jayson=require(_0x3a50('0x9'));var client=jayson['client'][_0x3a50('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4eeee1,_0x417c5c,_0x189ca2){return new BPromise(function(_0x31edcc,_0x5d3163){return client[_0x3a50('0xb')](_0x4eeee1,_0x189ca2)['then'](function(_0x567086){logger[_0x3a50('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x417c5c,_0x3a50('0xd'));logger[_0x3a50('0xe')](_0x3a50('0xf'),_0x417c5c,'request\x20sent',JSON[_0x3a50('0x10')](_0x567086));if(_0x567086[_0x3a50('0x11')]){if(_0x567086[_0x3a50('0x11')][_0x3a50('0x12')]===0x1f4){logger[_0x3a50('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x417c5c,_0x567086[_0x3a50('0x11')][_0x3a50('0x13')]);return _0x5d3163(_0x567086[_0x3a50('0x11')]['message']);}logger[_0x3a50('0x11')](_0x3a50('0x14'),_0x417c5c,_0x567086[_0x3a50('0x11')][_0x3a50('0x13')]);return _0x31edcc(_0x567086[_0x3a50('0x11')][_0x3a50('0x13')]);}else{logger[_0x3a50('0xc')](_0x3a50('0x14'),_0x417c5c,_0x3a50('0xd'));_0x31edcc(_0x567086['result'][_0x3a50('0x13')]);}})[_0x3a50('0x15')](function(_0x5a8658){logger[_0x3a50('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x417c5c,_0x5a8658);_0x5d3163(_0x5a8658);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 86f0394..69d772f 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 _0xb138=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','post','create','destroy','exports','multer','util','path'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xb138,0x1dd));var _0x8b13=function(_0x306064,_0x88fccb){_0x306064=_0x306064-0x0;var _0x17d9a2=_0xb138[_0x306064];return _0x17d9a2;};'use strict';var multer=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var path=require(_0x8b13('0x2'));var timeout=require(_0x8b13('0x3'));var express=require(_0x8b13('0x4'));var router=express[_0x8b13('0x5')]();var fs_extra=require(_0x8b13('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var controller=require(_0x8b13('0x9'));router['get'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller['show']);router[_0x8b13('0xc')]('/',auth[_0x8b13('0xb')](),controller[_0x8b13('0xd')]);router['put'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller['update']);router['delete'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller[_0x8b13('0xe')]);module[_0x8b13('0xf')]=router;
\ No newline at end of file
+var _0x7da7=['util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','show','isAuthenticated','create','put','delete','exports','multer'];(function(_0x2ac5f8,_0x4c3a9f){var _0x3b8229=function(_0x46a3c0){while(--_0x46a3c0){_0x2ac5f8['push'](_0x2ac5f8['shift']());}};_0x3b8229(++_0x4c3a9f);}(_0x7da7,0x10d));var _0x77da=function(_0x4e93a9,_0x413f30){_0x4e93a9=_0x4e93a9-0x0;var _0x43013c=_0x7da7[_0x4e93a9];return _0x43013c;};'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
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 723c094..cbbe35d 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 _0xa053=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','INTEGER'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xa053,0x10c));var _0x3a05=function(_0x36e1de,_0x4b88c4){_0x36e1de=_0x36e1de-0x0;var _0x2c1d8a=_0xa053[_0x36e1de];return _0x2c1d8a;};'use strict';var Sequelize=require(_0x3a05('0x0'));module[_0x3a05('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3a05('0x2')]},'timeout':{'type':Sequelize[_0x3a05('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3a05('0x4')](_0x3a05('0x5'),_0x3a05('0x6'),_0x3a05('0x7'))}};
\ No newline at end of file
+var _0x9407=['rrmemory','beepall','roundrobin','exports','STRING','name','INTEGER','ENUM'];(function(_0x340e34,_0x58e730){var _0x3d4722=function(_0x1a0a62){while(--_0x1a0a62){_0x340e34['push'](_0x340e34['shift']());}};_0x3d4722(++_0x58e730);}(_0x9407,0x143));var _0x7940=function(_0x1e923f,_0x19399a){_0x1e923f=_0x1e923f-0x0;var _0x29b554=_0x9407[_0x1e923f];return _0x29b554;};'use strict';var Sequelize=require('sequelize');module[_0x7940('0x0')]={'name':{'type':Sequelize[_0x7940('0x1')],'unique':_0x7940('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7940('0x1')]},'timeout':{'type':Sequelize[_0x7940('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7940('0x4')](_0x7940('0x5'),_0x7940('0x6'),_0x7940('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 82ce5e1..81c0b22 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 _0x4bee=['tq.TeamId','from','team_has_chat_queues','user_has_teams','ChatQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','every','all','union','value','removeAgents','emit','addAgents','omit','spread','isArray','userChatQueue:remove','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','name','send','index','map','ChatQueue','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','rows','catch','params','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','find','getMembers','findOne','ChatQueueId','UserChatQueue','User','findAndCountAll','UserId','updatedAt','format','%s/%s','SIP','chatPause','createdAt','getTeams','Team','ids','findAll','online','interface','Agents','sequelize','transaction','addTeams','each','findOrCreate','forEach','userChatQueue:save','removeTeams','select'];(function(_0x32db14,_0x1acfef){var _0xa97506=function(_0x1c62a9){while(--_0x1c62a9){_0x32db14['push'](_0x32db14['shift']());}};_0xa97506(++_0x1acfef);}(_0x4bee,0xaa));var _0xe4be=function(_0x102ff9,_0x907658){_0x102ff9=_0x102ff9-0x0;var _0x24fa97=_0x4bee[_0x102ff9];return _0x24fa97;};'use strict';var emlformat=require(_0xe4be('0x0'));var rimraf=require(_0xe4be('0x1'));var zipdir=require(_0xe4be('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe4be('0x3'));var BPromise=require(_0xe4be('0x4'));var Mustache=require(_0xe4be('0x5'));var util=require(_0xe4be('0x6'));var path=require(_0xe4be('0x7'));var sox=require(_0xe4be('0x8'));var csv=require(_0xe4be('0x9'));var ejs=require(_0xe4be('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe4be('0xb'));var squel=require(_0xe4be('0xc'));var crypto=require('crypto');var jsforce=require(_0xe4be('0xd'));var deskjs=require(_0xe4be('0xe'));var toCsv=require(_0xe4be('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe4be('0xf'));var authService=require(_0xe4be('0x10'));var qs=require(_0xe4be('0x11'));var as=require(_0xe4be('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe4be('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xe4be('0x14'));var licenseUtil=require(_0xe4be('0x15'));var db=require(_0xe4be('0x16'))['db'];config[_0xe4be('0x17')]=_[_0xe4be('0x18')](config[_0xe4be('0x17')],{'host':_0xe4be('0x19'),'port':0x18eb});var socket=require(_0xe4be('0x1a'))(new Redis(config['redis']));require('./chatQueue.socket')[_0xe4be('0x1b')](socket);var jayson=require(_0xe4be('0x1c'));var client=jayson[_0xe4be('0x1d')][_0xe4be('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x29bd5d,_0x2a0f57,_0x5adaa6,_0x50ba2d){return new BPromise(function(_0x35f7af,_0x2e2b75){var _0x19aaf2=_0x50ba2d||client;return _0x19aaf2['request'](_0x29bd5d,_0x5adaa6)[_0xe4be('0x1f')](function(_0x45f6c2){logger[_0xe4be('0x20')](_0xe4be('0x21'),_0x2a0f57,_0xe4be('0x22'));logger[_0xe4be('0x23')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x2a0f57,_0xe4be('0x22'),JSON[_0xe4be('0x24')](_0x45f6c2));if(_0x45f6c2[_0xe4be('0x25')]){if(_0x45f6c2[_0xe4be('0x25')]['code']===0x1f4){logger['error'](_0xe4be('0x21'),_0x2a0f57,_0x45f6c2[_0xe4be('0x25')]['message']);return _0x2e2b75(_0x45f6c2[_0xe4be('0x25')][_0xe4be('0x26')]);}logger[_0xe4be('0x25')](_0xe4be('0x21'),_0x2a0f57,_0x45f6c2[_0xe4be('0x25')][_0xe4be('0x26')]);return _0x35f7af(_0x45f6c2[_0xe4be('0x25')][_0xe4be('0x26')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x2a0f57,_0xe4be('0x22'));_0x35f7af(_0x45f6c2[_0xe4be('0x27')][_0xe4be('0x26')]);}})['catch'](function(_0x3fc583){logger[_0xe4be('0x25')](_0xe4be('0x21'),_0x2a0f57,_0x3fc583);_0x2e2b75(_0x3fc583);});});}function respondWithStatusCode(_0x3913ff,_0x215a22){_0x215a22=_0x215a22||0xcc;return function(_0x5af13c){if(_0x5af13c){return _0x3913ff[_0xe4be('0x28')](_0x215a22);}return _0x3913ff[_0xe4be('0x29')](_0x215a22)[_0xe4be('0x2a')]();};}function respondWithResult(_0x47858a,_0x348638){_0x348638=_0x348638||0xc8;return function(_0xefd0f2){if(_0xefd0f2){return _0x47858a[_0xe4be('0x29')](_0x348638)[_0xe4be('0x2b')](_0xefd0f2);}};}function respondWithFilteredResult(_0x23147c,_0x2a894e){return function(_0x3d663b){if(_0x3d663b){var _0x318d1f=typeof _0x2a894e[_0xe4be('0x2c')]==='undefined'&&typeof _0x2a894e['limit']===_0xe4be('0x2d');var _0x500af7=_0x3d663b['count'];var _0x215069=_0x318d1f?0x0:_0x2a894e[_0xe4be('0x2c')];var _0x49d818=_0x318d1f?_0x3d663b[_0xe4be('0x2e')]:_0x2a894e[_0xe4be('0x2c')]+_0x2a894e[_0xe4be('0x2f')];var _0x43c27f;if(_0x49d818>=_0x500af7){_0x49d818=_0x500af7;_0x43c27f=0xc8;}else{_0x43c27f=0xce;}_0x23147c['status'](_0x43c27f);return _0x23147c[_0xe4be('0x30')](_0xe4be('0x31'),_0x215069+'-'+_0x49d818+'/'+_0x500af7)[_0xe4be('0x2b')](_0x3d663b);}return null;};}function patchUpdates(_0x390226){return function(_0x2e529a){try{jsonpatch[_0xe4be('0x32')](_0x2e529a,_0x390226,!![]);}catch(_0x42068b){return BPromise[_0xe4be('0x33')](_0x42068b);}return _0x2e529a[_0xe4be('0x34')]();};}function saveUpdates(_0x5b25f6,_0x92b81c){return function(_0x59f484){if(_0x59f484){return _0x59f484[_0xe4be('0x35')](_0x5b25f6)[_0xe4be('0x1f')](function(_0x8a3ce2){return _0x8a3ce2;});}return null;};}function removeEntity(_0x4d7466,_0x4074c5){return function(_0x11a75b){if(_0x11a75b){return _0x11a75b[_0xe4be('0x36')]()[_0xe4be('0x1f')](function(){var _0xb22789=_0x11a75b['get']({'plain':!![]});var _0x5090d6='ChatQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0x5090d6,'resourceId':_0xb22789['id']}})[_0xe4be('0x1f')](function(){return _0x11a75b;});})['then'](function(){_0x4d7466[_0xe4be('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22a4a5,_0x40239b){return function(_0x5db688){if(!_0x5db688){_0x22a4a5[_0xe4be('0x28')](0x194);}return _0x5db688;};}function handleError(_0x49e4b3,_0x52c69d){_0x52c69d=_0x52c69d||0x1f4;return function(_0x48f782){logger[_0xe4be('0x25')](_0x48f782['stack']);if(_0x48f782['name']){delete _0x48f782[_0xe4be('0x37')];}_0x49e4b3[_0xe4be('0x29')](_0x52c69d)[_0xe4be('0x38')](_0x48f782);};}exports[_0xe4be('0x39')]=function(_0x412135,_0x25dd6e){var _0x582e5b={},_0x114e88={},_0x14f17b={'count':0x0,'rows':[]};var _0x277e60=_[_0xe4be('0x3a')](db[_0xe4be('0x3b')][_0xe4be('0x3c')],function(_0x3c0eb4){return{'name':_0x3c0eb4[_0xe4be('0x3d')],'type':_0x3c0eb4['type'][_0xe4be('0x3e')]};});_0x114e88[_0xe4be('0x3f')]=_['map'](_0x277e60,_0xe4be('0x37'));_0x114e88['query']=_[_0xe4be('0x40')](_0x412135[_0xe4be('0x41')]);_0x114e88[_0xe4be('0x42')]=_[_0xe4be('0x43')](_0x114e88['model'],_0x114e88[_0xe4be('0x41')]);_0x582e5b[_0xe4be('0x44')]=_[_0xe4be('0x43')](_0x114e88[_0xe4be('0x3f')],qs['fields'](_0x412135[_0xe4be('0x41')][_0xe4be('0x45')]));_0x582e5b[_0xe4be('0x44')]=_0x582e5b[_0xe4be('0x44')][_0xe4be('0x46')]?_0x582e5b[_0xe4be('0x44')]:_0x114e88[_0xe4be('0x3f')];if(!_0x412135[_0xe4be('0x41')][_0xe4be('0x47')](_0xe4be('0x48'))){_0x582e5b[_0xe4be('0x2f')]=qs['limit'](_0x412135[_0xe4be('0x41')][_0xe4be('0x2f')]);_0x582e5b['offset']=qs[_0xe4be('0x2c')](_0x412135[_0xe4be('0x41')]['offset']);}_0x582e5b[_0xe4be('0x49')]=qs[_0xe4be('0x4a')](_0x412135[_0xe4be('0x41')]['sort']);_0x582e5b[_0xe4be('0x4b')]=qs[_0xe4be('0x42')](_[_0xe4be('0x4c')](_0x412135[_0xe4be('0x41')],_0x114e88[_0xe4be('0x42')]),_0x277e60);if(_0x412135['query'][_0xe4be('0x4d')]){_0x582e5b[_0xe4be('0x4b')]=_['merge'](_0x582e5b[_0xe4be('0x4b')],{'$or':_[_0xe4be('0x3a')](_0x277e60,function(_0x11412e){if(_0x11412e[_0xe4be('0x4e')]!==_0xe4be('0x4f')){var _0x458129={};_0x458129[_0x11412e[_0xe4be('0x37')]]={'$like':'%'+_0x412135[_0xe4be('0x41')][_0xe4be('0x4d')]+'%'};return _0x458129;}})});}_0x582e5b=_[_0xe4be('0x50')]({},_0x582e5b,_0x412135[_0xe4be('0x51')]);var _0x274230={'where':_0x582e5b[_0xe4be('0x4b')]};return db['ChatQueue']['count'](_0x274230)[_0xe4be('0x1f')](function(_0x31bf17){_0x14f17b[_0xe4be('0x2e')]=_0x31bf17;if(_0x412135['query'][_0xe4be('0x52')]){_0x582e5b[_0xe4be('0x53')]=[{'all':!![]}];}return db[_0xe4be('0x3b')]['findAll'](_0x582e5b);})[_0xe4be('0x1f')](function(_0x351a75){_0x14f17b[_0xe4be('0x54')]=_0x351a75;return _0x14f17b;})['then'](respondWithFilteredResult(_0x25dd6e,_0x582e5b))[_0xe4be('0x55')](handleError(_0x25dd6e,null));};exports['show']=function(_0x5b2063,_0x3c7915){var _0x4ba8dd={'raw':!![],'where':{'id':_0x5b2063[_0xe4be('0x56')]['id']}},_0x5b6b53={};_0x5b6b53[_0xe4be('0x3f')]=_[_0xe4be('0x40')](db[_0xe4be('0x3b')][_0xe4be('0x3c')]);_0x5b6b53[_0xe4be('0x41')]=_[_0xe4be('0x40')](_0x5b2063['query']);_0x5b6b53[_0xe4be('0x42')]=_[_0xe4be('0x43')](_0x5b6b53[_0xe4be('0x3f')],_0x5b6b53['query']);_0x4ba8dd[_0xe4be('0x44')]=_[_0xe4be('0x43')](_0x5b6b53[_0xe4be('0x3f')],qs['fields'](_0x5b2063[_0xe4be('0x41')][_0xe4be('0x45')]));_0x4ba8dd[_0xe4be('0x44')]=_0x4ba8dd[_0xe4be('0x44')]['length']?_0x4ba8dd[_0xe4be('0x44')]:_0x5b6b53[_0xe4be('0x3f')];if(_0x5b2063['query'][_0xe4be('0x52')]){_0x4ba8dd['include']=[{'all':!![]}];}_0x4ba8dd=_[_0xe4be('0x50')]({},_0x4ba8dd,_0x5b2063[_0xe4be('0x51')]);return db['ChatQueue']['find'](_0x4ba8dd)[_0xe4be('0x1f')](handleEntityNotFound(_0x3c7915,null))['then'](respondWithResult(_0x3c7915,null))[_0xe4be('0x55')](handleError(_0x3c7915,null));};exports[_0xe4be('0x57')]=function(_0x5def26,_0x1ba9a0){return db[_0xe4be('0x3b')][_0xe4be('0x57')](_0x5def26['body'],{})[_0xe4be('0x1f')](function(_0x2ec45a){var _0x171f8a=_0x5def26[_0xe4be('0x58')][_0xe4be('0x59')]({'plain':!![]});if(!_0x171f8a)throw new Error(_0xe4be('0x5a'));if(_0x171f8a[_0xe4be('0x5b')]===_0xe4be('0x58')){var _0x4f4689=_0x2ec45a[_0xe4be('0x59')]({'plain':!![]});var _0x326d03=_0xe4be('0x5c');return db[_0xe4be('0x5d')]['find']({'where':{'name':_0x326d03,'userProfileId':_0x171f8a[_0xe4be('0x5e')]},'raw':!![]})['then'](function(_0x339a46){if(_0x339a46&&_0x339a46[_0xe4be('0x5f')]===0x0){return db[_0xe4be('0x60')][_0xe4be('0x57')]({'name':_0x4f4689[_0xe4be('0x37')],'resourceId':_0x4f4689['id'],'type':_0x339a46[_0xe4be('0x37')],'sectionId':_0x339a46['id']},{})['then'](function(){return _0x2ec45a;});}else{return _0x2ec45a;}})[_0xe4be('0x55')](function(_0xf1fa17){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf1fa17);throw _0xf1fa17;});}return _0x2ec45a;})[_0xe4be('0x1f')](respondWithResult(_0x1ba9a0,0xc9))[_0xe4be('0x55')](handleError(_0x1ba9a0,null));};exports[_0xe4be('0x35')]=function(_0x508c8b,_0x262dc1){if(_0x508c8b[_0xe4be('0x61')]['id']){delete _0x508c8b[_0xe4be('0x61')]['id'];}return db[_0xe4be('0x3b')][_0xe4be('0x62')]({'where':{'id':_0x508c8b[_0xe4be('0x56')]['id']}})[_0xe4be('0x1f')](handleEntityNotFound(_0x262dc1,null))[_0xe4be('0x1f')](saveUpdates(_0x508c8b[_0xe4be('0x61')],null))['then'](respondWithResult(_0x262dc1,null))[_0xe4be('0x55')](handleError(_0x262dc1,null));};exports[_0xe4be('0x36')]=function(_0x395b29,_0x4a2a55){return db[_0xe4be('0x3b')][_0xe4be('0x62')]({'where':{'id':_0x395b29[_0xe4be('0x56')]['id']}})['then'](handleEntityNotFound(_0x4a2a55,null))['then'](removeEntity(_0x4a2a55,null))[_0xe4be('0x55')](handleError(_0x4a2a55,null));};exports['describe']=function(_0x2546cd,_0x554d33){return db[_0xe4be('0x3b')]['describe']()[_0xe4be('0x1f')](respondWithResult(_0x554d33,null))[_0xe4be('0x55')](handleError(_0x554d33,null));};exports[_0xe4be('0x63')]=function(_0x592f46,_0x3033ce,_0x25e6fe){var _0x25a6a4={'raw':!![],'where':{}},_0x9f04d3={},_0x34fc29;return db[_0xe4be('0x3b')][_0xe4be('0x64')]({'where':{'id':_0x592f46[_0xe4be('0x56')]['id']}})[_0xe4be('0x1f')](handleEntityNotFound(_0x3033ce,null))[_0xe4be('0x1f')](function(_0x4132d0){if(_0x4132d0){_0x34fc29=_0x4132d0['get']({'plain':!![]});_0x9f04d3['model']=_['keys'](db['UserChatQueue'][_0xe4be('0x3c')]);_0x9f04d3[_0xe4be('0x41')]=_[_0xe4be('0x40')](_0x592f46[_0xe4be('0x41')]);_0x9f04d3[_0xe4be('0x42')]=_[_0xe4be('0x43')](_0x9f04d3['model'],_0x9f04d3['query']);_0x25a6a4[_0xe4be('0x44')]=_[_0xe4be('0x43')](_0x9f04d3[_0xe4be('0x3f')],qs[_0xe4be('0x45')](_0x592f46[_0xe4be('0x41')]['fields']));_0x25a6a4[_0xe4be('0x44')]=_0x25a6a4['attributes'][_0xe4be('0x46')]?_0x25a6a4[_0xe4be('0x44')]:_0x9f04d3[_0xe4be('0x3f')];if(!_0x592f46[_0xe4be('0x41')][_0xe4be('0x47')](_0xe4be('0x48'))){_0x25a6a4[_0xe4be('0x2f')]=qs[_0xe4be('0x2f')](_0x592f46[_0xe4be('0x41')][_0xe4be('0x2f')]);_0x25a6a4['offset']=qs[_0xe4be('0x2c')](_0x592f46[_0xe4be('0x41')][_0xe4be('0x2c')]);}_0x25a6a4['order']=qs['sort'](_0x592f46['query'][_0xe4be('0x4a')]);_0x25a6a4[_0xe4be('0x4b')]=qs[_0xe4be('0x42')](_[_0xe4be('0x4c')](_0x592f46['query'],_0x9f04d3[_0xe4be('0x42')]));_0x25a6a4[_0xe4be('0x4b')][_0xe4be('0x65')]=_0x4132d0['id'];if(_0x592f46[_0xe4be('0x41')]['filter']){_0x25a6a4[_0xe4be('0x4b')]=_[_0xe4be('0x50')](_0x25a6a4[_0xe4be('0x4b')],{'$or':_[_0xe4be('0x3a')](_0x25a6a4[_0xe4be('0x44')],function(_0x133b51){var _0x421dd1={};_0x421dd1[_0x133b51]={'$like':'%'+_0x592f46['query'][_0xe4be('0x4d')]+'%'};return _0x421dd1;})});}_0x25a6a4=_[_0xe4be('0x50')]({},_0x25a6a4,_0x592f46[_0xe4be('0x51')]);return db[_0xe4be('0x66')]['findAll'](_0x25a6a4);}})[_0xe4be('0x1f')](function(_0x4273d3){if(_0x4273d3){return db[_0xe4be('0x67')][_0xe4be('0x68')]({'where':{'id':_[_0xe4be('0x3a')](_0x4273d3,_0xe4be('0x69')),'role':'agent'},'attributes':['id',_0xe4be('0x37'),'chatPause',_0xe4be('0x6a'),'createdAt']});}})[_0xe4be('0x1f')](function(_0x1354df){if(_0x1354df){return{'count':_0x1354df[_0xe4be('0x2e')],'rows':_['map'](_0x1354df[_0xe4be('0x54')],function(_0x529b06){return{'membername':_0x529b06['name'],'UserId':_0x529b06['id'],'queue_name':_0x34fc29[_0xe4be('0x37')],'ChatQueueId':_0x34fc29['id'],'interface':util[_0xe4be('0x6b')](_0xe4be('0x6c'),_0xe4be('0x6d'),_0x529b06[_0xe4be('0x37')]),'penalty':0x0,'paused':_0x529b06[_0xe4be('0x6e')],'createdAt':_0x529b06[_0xe4be('0x6f')],'updatedAt':_0x529b06[_0xe4be('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe4be('0x1f')](respondWithFilteredResult(_0x3033ce,_0x25a6a4))[_0xe4be('0x55')](handleError(_0x3033ce,null));};exports[_0xe4be('0x70')]=function(_0x48c915,_0x54a837,_0x3ce717){var _0x1ef052={};var _0x28deff={};var _0x34beec;var _0x1cc5c1;return db[_0xe4be('0x3b')][_0xe4be('0x64')]({'where':{'id':_0x48c915[_0xe4be('0x56')]['id']}})['then'](handleEntityNotFound(_0x54a837,null))['then'](function(_0x55fa70){if(_0x55fa70){_0x34beec=_0x55fa70;_0x28deff[_0xe4be('0x3f')]=_['keys'](db[_0xe4be('0x71')][_0xe4be('0x3c')]);_0x28deff[_0xe4be('0x41')]=_[_0xe4be('0x40')](_0x48c915[_0xe4be('0x41')]);_0x28deff[_0xe4be('0x42')]=_[_0xe4be('0x43')](_0x28deff[_0xe4be('0x3f')],_0x28deff[_0xe4be('0x41')]);_0x1ef052[_0xe4be('0x44')]=_[_0xe4be('0x43')](_0x28deff[_0xe4be('0x3f')],qs['fields'](_0x48c915[_0xe4be('0x41')][_0xe4be('0x45')]));_0x1ef052[_0xe4be('0x44')]=_0x1ef052[_0xe4be('0x44')][_0xe4be('0x46')]?_0x1ef052[_0xe4be('0x44')]:_0x28deff[_0xe4be('0x3f')];_0x1ef052[_0xe4be('0x49')]=qs['sort'](_0x48c915['query']['sort']);_0x1ef052[_0xe4be('0x4b')]=qs[_0xe4be('0x42')](_[_0xe4be('0x4c')](_0x48c915[_0xe4be('0x41')],_0x28deff[_0xe4be('0x42')]));if(_0x48c915[_0xe4be('0x41')]['filter']){_0x1ef052['where']=_[_0xe4be('0x50')](_0x1ef052[_0xe4be('0x4b')],{'$or':_[_0xe4be('0x3a')](_0x1ef052[_0xe4be('0x44')],function(_0x5e8cf4){var _0x50a1b7={};_0x50a1b7[_0x5e8cf4]={'$like':'%'+_0x48c915[_0xe4be('0x41')][_0xe4be('0x4d')]+'%'};return _0x50a1b7;})});}_0x1ef052=_[_0xe4be('0x50')]({},_0x1ef052,_0x48c915['options']);return _0x34beec[_0xe4be('0x70')](_0x1ef052);}})[_0xe4be('0x1f')](function(_0xc5a333){if(_0xc5a333){_0x1cc5c1=_0xc5a333[_0xe4be('0x46')];if(!_0x48c915[_0xe4be('0x41')][_0xe4be('0x47')](_0xe4be('0x48'))){_0x1ef052[_0xe4be('0x2f')]=qs['limit'](_0x48c915['query'][_0xe4be('0x2f')]);_0x1ef052['offset']=qs[_0xe4be('0x2c')](_0x48c915['query']['offset']);}return _0x34beec['getTeams'](_0x1ef052);}})[_0xe4be('0x1f')](function(_0x2bebca){if(_0x2bebca){return _0x2bebca?{'count':_0x1cc5c1,'rows':_0x2bebca}:null;}})[_0xe4be('0x1f')](respondWithResult(_0x54a837,null))[_0xe4be('0x55')](handleError(_0x54a837,null));};exports['addTeams']=function(_0x5783c5,_0x4e116f,_0x54f3bd){var _0x257dc1=_0x5783c5[_0xe4be('0x61')][_0xe4be('0x72')];return db[_0xe4be('0x71')][_0xe4be('0x73')]({'where':{'id':_0x257dc1},'attributes':['id'],'include':[{'model':db[_0xe4be('0x67')],'as':'Agents','attributes':['id',_0xe4be('0x37'),_0xe4be('0x74'),'voicePause',_0xe4be('0x75')],'raw':!![]}]})[_0xe4be('0x1f')](function(_0x5eff14){if(_0x5eff14){var _0x385ab9=_['flatMap'](_0x5eff14,function(_0x4898e7){var _0x2f8db2=_0x4898e7[_0xe4be('0x59')]({'plain':!![]});return _0x2f8db2[_0xe4be('0x76')];});return db[_0xe4be('0x3b')][_0xe4be('0x62')]({'where':{'id':_0x5783c5[_0xe4be('0x56')]['id']}})['then'](function(_0x1c5b43){return db[_0xe4be('0x77')][_0xe4be('0x78')](function(_0x3919c2){return _0x1c5b43[_0xe4be('0x79')](_0x257dc1,{'transaction':_0x3919c2})['then'](function(){return BPromise[_0xe4be('0x7a')](_0x385ab9,function(_0x145c6a){return db[_0xe4be('0x66')][_0xe4be('0x7b')]({'where':{'UserId':_0x145c6a['id'],'ChatQueueId':_0x5783c5[_0xe4be('0x56')]['id']},'transaction':_0x3919c2});});})[_0xe4be('0x1f')](function(){_0x385ab9[_0xe4be('0x7c')](function(_0x589d6d){socket['emit'](_0xe4be('0x7d'),{'UserId':_0x589d6d['id'],'ChatQueueId':_0x1c5b43['id']});});});});});}})['then'](respondWithStatusCode(_0x4e116f,null))[_0xe4be('0x55')](handleError(_0x4e116f,null));};exports[_0xe4be('0x7e')]=function(_0x4ce11e,_0x55248a,_0x358952){return db[_0xe4be('0x71')][_0xe4be('0x73')]({'where':{'id':_0x4ce11e[_0xe4be('0x41')]['ids']},'attributes':['id'],'include':[{'model':db[_0xe4be('0x67')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x55248a,null))[_0xe4be('0x1f')](function(_0x243ed9){var _0x1d634c=_[_0xe4be('0x3a')](_0x243ed9,'id');var _0x21cf3c=[];var _0x1f6344=[];var _0x44a476=squel[_0xe4be('0x7f')]();_0x44a476['field'](_0xe4be('0x80'))[_0xe4be('0x81')](_0xe4be('0x82'),'tq')['join'](_0xe4be('0x83'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xe4be('0x4b')](_0xe4be('0x84'),_0x4ce11e['params']['id']);for(var _0x3a722c=0x0;_0x3a722c<_0x243ed9[_0xe4be('0x46')];_0x3a722c+=0x1){let _0xbb65d2=_0x243ed9[_0x3a722c];for(var _0x48a413=0x0;_0x48a413<_0xbb65d2[_0xe4be('0x76')][_0xe4be('0x46')];_0x48a413+=0x1){let _0x27b486=_0xbb65d2[_0xe4be('0x76')][_0x48a413];var _0x31e984=_0x44a476['clone']();_0x31e984['where']('ut.UserId\x20=\x20?',_0x27b486['id']);_0x1f6344[_0xe4be('0x85')](db[_0xe4be('0x77')][_0xe4be('0x41')](_0x31e984[_0xe4be('0x86')](),{'type':db['sequelize'][_0xe4be('0x87')][_0xe4be('0x88')]})[_0xe4be('0x1f')](function(_0x581821){if(_0x581821[_0xe4be('0x46')]===0x1){return _0x27b486['id'];}else{var _0xd1bab3=_[_0xe4be('0x89')](_[_0xe4be('0x3a')](_0x581821,'TeamId'),function(_0x54019e){return _['includes'](_0x1d634c,_0x54019e);});if(_0xd1bab3){return _0x27b486['id'];}}}));}}return BPromise[_0xe4be('0x8a')](_0x1f6344)[_0xe4be('0x1f')](function(_0x541a09){_0x21cf3c=_(_0x21cf3c)[_0xe4be('0x8b')](_0x541a09)['compact']()[_0xe4be('0x8c')]();return db[_0xe4be('0x3b')]['find']({'where':{'id':_0x4ce11e[_0xe4be('0x56')]['id']}})[_0xe4be('0x1f')](function(_0x1c16ab){return db[_0xe4be('0x77')][_0xe4be('0x78')](function(_0x1c6fab){return _0x1c16ab['removeTeams'](_0x4ce11e[_0xe4be('0x41')][_0xe4be('0x72')],{'transaction':_0x1c6fab})[_0xe4be('0x1f')](function(){if(!_['isEmpty'](_0x21cf3c)){return _0x1c16ab[_0xe4be('0x8d')](_0x21cf3c,{'transaction':_0x1c6fab});}})['then'](function(){_0x21cf3c[_0xe4be('0x7c')](function(_0x186764){socket[_0xe4be('0x8e')]('userChatQueue:remove',{'UserId':_0x186764,'ChatQueueId':_0x1c16ab['id']});});});});});});})[_0xe4be('0x1f')](respondWithStatusCode(_0x55248a,null))['catch'](handleError(_0x55248a,null));};exports[_0xe4be('0x8f')]=function(_0xf2aef1,_0x3237c9,_0x42e91f){return db[_0xe4be('0x3b')][_0xe4be('0x62')]({'where':{'id':_0xf2aef1['params']['id']}})[_0xe4be('0x1f')](handleEntityNotFound(_0x3237c9,null))[_0xe4be('0x1f')](function(_0x29da5e){if(_0x29da5e){return _0x29da5e[_0xe4be('0x8f')](_0xf2aef1[_0xe4be('0x61')][_0xe4be('0x72')],_[_0xe4be('0x90')](_0xf2aef1[_0xe4be('0x61')],['ids','id'])||{})[_0xe4be('0x91')](function(_0x175884){for(var _0x466a24=0x0;_0x466a24<_0xf2aef1['body'][_0xe4be('0x72')][_0xe4be('0x46')];_0x466a24+=0x1){socket['emit'](_0xe4be('0x7d'),{'UserId':Number(_0xf2aef1[_0xe4be('0x61')][_0xe4be('0x72')][_0x466a24]),'ChatQueueId':Number(_0xf2aef1['params']['id'])});}return _0x175884;});}})[_0xe4be('0x1f')](respondWithResult(_0x3237c9,null))[_0xe4be('0x55')](handleError(_0x3237c9,null));};exports[_0xe4be('0x8d')]=function(_0x23f771,_0x18a23e,_0x1e1247){return db[_0xe4be('0x3b')]['find']({'where':{'id':_0x23f771['params']['id']}})[_0xe4be('0x1f')](handleEntityNotFound(_0x18a23e,null))['then'](function(_0x272ecb){if(_0x272ecb){return _0x272ecb[_0xe4be('0x8d')](_0x23f771[_0xe4be('0x41')]['ids'])[_0xe4be('0x1f')](function(){if(_[_0xe4be('0x92')](_0x23f771[_0xe4be('0x41')][_0xe4be('0x72')])){for(var _0x348e62=0x0;_0x348e62<_0x23f771['query'][_0xe4be('0x72')]['length'];_0x348e62+=0x1){socket[_0xe4be('0x8e')](_0xe4be('0x93'),{'UserId':Number(_0x23f771[_0xe4be('0x41')][_0xe4be('0x72')][_0x348e62]),'ChatQueueId':Number(_0x23f771[_0xe4be('0x56')]['id'])});}}else{socket[_0xe4be('0x8e')]('userChatQueue:remove',{'UserId':Number(_0x23f771[_0xe4be('0x41')][_0xe4be('0x72')]),'ChatQueueId':Number(_0x23f771[_0xe4be('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x18a23e,null))[_0xe4be('0x55')](handleError(_0x18a23e,null));};exports[_0xe4be('0x94')]=function(_0xc22dbd,_0x16f6ea,_0x25e1fc){var _0x189adf={};var _0x365786={};var _0x105f93;var _0x2ea714;return db['ChatQueue']['findOne']({'where':{'id':_0xc22dbd[_0xe4be('0x56')]['id']}})[_0xe4be('0x1f')](handleEntityNotFound(_0x16f6ea,null))[_0xe4be('0x1f')](function(_0x1492e9){if(_0x1492e9){_0x105f93=_0x1492e9;_0x365786['model']=_[_0xe4be('0x40')](db[_0xe4be('0x67')][_0xe4be('0x3c')]);_0x365786[_0xe4be('0x41')]=_[_0xe4be('0x40')](_0xc22dbd[_0xe4be('0x41')]);_0x365786[_0xe4be('0x42')]=_[_0xe4be('0x43')](_0x365786[_0xe4be('0x3f')],_0x365786[_0xe4be('0x41')]);_0x189adf['attributes']=_[_0xe4be('0x43')](_0x365786[_0xe4be('0x3f')],qs[_0xe4be('0x45')](_0xc22dbd['query'][_0xe4be('0x45')]));_0x189adf[_0xe4be('0x44')]=_0x189adf[_0xe4be('0x44')][_0xe4be('0x46')]?_0x189adf[_0xe4be('0x44')]:_0x365786[_0xe4be('0x3f')];_0x189adf[_0xe4be('0x49')]=qs['sort'](_0xc22dbd['query'][_0xe4be('0x4a')]);_0x189adf[_0xe4be('0x4b')]=qs['filters'](_[_0xe4be('0x4c')](_0xc22dbd[_0xe4be('0x41')],_0x365786[_0xe4be('0x42')]));if(_0xc22dbd[_0xe4be('0x41')][_0xe4be('0x4d')]){_0x189adf[_0xe4be('0x4b')]=_[_0xe4be('0x50')](_0x189adf[_0xe4be('0x4b')],{'$or':_[_0xe4be('0x3a')](_0x189adf[_0xe4be('0x44')],function(_0x37bcee){var _0x55a83e={};_0x55a83e[_0x37bcee]={'$like':'%'+_0xc22dbd[_0xe4be('0x41')]['filter']+'%'};return _0x55a83e;})});}_0x189adf=_[_0xe4be('0x50')]({},_0x189adf,_0xc22dbd[_0xe4be('0x51')]);return _0x105f93[_0xe4be('0x94')](_0x189adf);}})['then'](function(_0x41e83f){if(_0x41e83f){_0x2ea714=_0x41e83f[_0xe4be('0x46')];if(!_0xc22dbd[_0xe4be('0x41')]['hasOwnProperty'](_0xe4be('0x48'))){_0x189adf['limit']=qs[_0xe4be('0x2f')](_0xc22dbd['query']['limit']);_0x189adf[_0xe4be('0x2c')]=qs[_0xe4be('0x2c')](_0xc22dbd[_0xe4be('0x41')][_0xe4be('0x2c')]);}return _0x105f93[_0xe4be('0x94')](_0x189adf);}})[_0xe4be('0x1f')](function(_0x1a0343){if(_0x1a0343){return _0x1a0343?{'count':_0x2ea714,'rows':_0x1a0343}:null;}})[_0xe4be('0x1f')](respondWithResult(_0x16f6ea,null))[_0xe4be('0x55')](handleError(_0x16f6ea,null));};
\ No newline at end of file
+var _0xe3ef=['../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatQueue.socket','jayson/promise','client','then','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','destroy','UserProfileResource','end','stack','name','send','index','map','ChatQueue','rawAttributes','type','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','includeAll','rows','show','length','include','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','params','UserChatQueue','ChatQueueId','findAll','UserId','agent','updatedAt','createdAt','format','%s/%s','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','select','field','team_has_chat_queues','join','user_has_teams','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','all','union','value','removeTeams','isEmpty','removeAgents','userChatQueue:remove','omit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x5dccb2,_0x1e4401){var _0x1e2ed7=function(_0x48206b){while(--_0x48206b){_0x5dccb2['push'](_0x5dccb2['shift']());}};_0x1e2ed7(++_0x1e4401);}(_0xe3ef,0x1aa));var _0xfe3e=function(_0x384789,_0x402b67){_0x384789=_0x384789-0x0;var _0x475fe7=_0xe3ef[_0x384789];return _0x475fe7;};'use strict';var emlformat=require(_0xfe3e('0x0'));var rimraf=require(_0xfe3e('0x1'));var zipdir=require(_0xfe3e('0x2'));var jsonpatch=require(_0xfe3e('0x3'));var rp=require(_0xfe3e('0x4'));var moment=require(_0xfe3e('0x5'));var BPromise=require(_0xfe3e('0x6'));var Mustache=require(_0xfe3e('0x7'));var util=require(_0xfe3e('0x8'));var path=require(_0xfe3e('0x9'));var sox=require(_0xfe3e('0xa'));var csv=require(_0xfe3e('0xb'));var ejs=require(_0xfe3e('0xc'));var fs=require('fs');var fs_extra=require(_0xfe3e('0xd'));var _=require(_0xfe3e('0xe'));var squel=require(_0xfe3e('0xf'));var crypto=require(_0xfe3e('0x10'));var jsforce=require(_0xfe3e('0x11'));var deskjs=require('desk.js');var toCsv=require(_0xfe3e('0xb'));var querystring=require(_0xfe3e('0x12'));var Papa=require(_0xfe3e('0x13'));var Redis=require(_0xfe3e('0x14'));var authService=require(_0xfe3e('0x15'));var qs=require(_0xfe3e('0x16'));var as=require(_0xfe3e('0x17'));var hardwareService=require(_0xfe3e('0x18'));var logger=require(_0xfe3e('0x19'))(_0xfe3e('0x1a'));var utils=require(_0xfe3e('0x1b'));var config=require('../../config/environment');var licenseUtil=require(_0xfe3e('0x1c'));var db=require(_0xfe3e('0x1d'))['db'];config[_0xfe3e('0x1e')]=_[_0xfe3e('0x1f')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfe3e('0x20'))(new Redis(config['redis']));require(_0xfe3e('0x21'))['register'](socket);var jayson=require(_0xfe3e('0x22'));var client=jayson[_0xfe3e('0x23')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11f6ed,_0x1c41a4,_0x826f6d,_0x2fac0a){return new BPromise(function(_0x58bf2c,_0x1ec0da){var _0xad816a=_0x2fac0a||client;return _0xad816a['request'](_0x11f6ed,_0x826f6d)[_0xfe3e('0x24')](function(_0x253ed1){logger['info'](_0xfe3e('0x25'),_0x1c41a4,_0xfe3e('0x26'));logger['debug'](_0xfe3e('0x27'),_0x1c41a4,'request\x20sent',JSON[_0xfe3e('0x28')](_0x253ed1));if(_0x253ed1['error']){if(_0x253ed1['error'][_0xfe3e('0x29')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x1c41a4,_0x253ed1['error'][_0xfe3e('0x2a')]);return _0x1ec0da(_0x253ed1[_0xfe3e('0x2b')][_0xfe3e('0x2a')]);}logger[_0xfe3e('0x2b')](_0xfe3e('0x25'),_0x1c41a4,_0x253ed1[_0xfe3e('0x2b')][_0xfe3e('0x2a')]);return _0x58bf2c(_0x253ed1[_0xfe3e('0x2b')][_0xfe3e('0x2a')]);}else{logger[_0xfe3e('0x2c')](_0xfe3e('0x25'),_0x1c41a4,_0xfe3e('0x26'));_0x58bf2c(_0x253ed1[_0xfe3e('0x2d')]['message']);}})[_0xfe3e('0x2e')](function(_0x403c07){logger[_0xfe3e('0x2b')]('ChatQueue,\x20%s,\x20%s',_0x1c41a4,_0x403c07);_0x1ec0da(_0x403c07);});});}function respondWithStatusCode(_0x393de5,_0x3dff90){_0x3dff90=_0x3dff90||0xcc;return function(_0x5ea14f){if(_0x5ea14f){return _0x393de5[_0xfe3e('0x2f')](_0x3dff90);}return _0x393de5[_0xfe3e('0x30')](_0x3dff90)['end']();};}function respondWithResult(_0x55064c,_0x32ce52){_0x32ce52=_0x32ce52||0xc8;return function(_0xb5584e){if(_0xb5584e){return _0x55064c[_0xfe3e('0x30')](_0x32ce52)[_0xfe3e('0x31')](_0xb5584e);}};}function respondWithFilteredResult(_0x64c561,_0x3a2a64){return function(_0x450740){if(_0x450740){var _0x56d354=typeof _0x3a2a64[_0xfe3e('0x32')]===_0xfe3e('0x33')&&typeof _0x3a2a64[_0xfe3e('0x34')]===_0xfe3e('0x33');var _0x16a759=_0x450740[_0xfe3e('0x35')];var _0x4e4d78=_0x56d354?0x0:_0x3a2a64['offset'];var _0x493f16=_0x56d354?_0x450740[_0xfe3e('0x35')]:_0x3a2a64[_0xfe3e('0x32')]+_0x3a2a64['limit'];var _0x1ae5d0;if(_0x493f16>=_0x16a759){_0x493f16=_0x16a759;_0x1ae5d0=0xc8;}else{_0x1ae5d0=0xce;}_0x64c561[_0xfe3e('0x30')](_0x1ae5d0);return _0x64c561['set']('Content-Range',_0x4e4d78+'-'+_0x493f16+'/'+_0x16a759)['json'](_0x450740);}return null;};}function patchUpdates(_0x3b2a00){return function(_0x45cb92){try{jsonpatch[_0xfe3e('0x36')](_0x45cb92,_0x3b2a00,!![]);}catch(_0x356b4f){return BPromise[_0xfe3e('0x37')](_0x356b4f);}return _0x45cb92[_0xfe3e('0x38')]();};}function saveUpdates(_0x2342c8,_0x3d1b9e){return function(_0x18d5d9){if(_0x18d5d9){return _0x18d5d9['update'](_0x2342c8)[_0xfe3e('0x24')](function(_0x2c01e8){return _0x2c01e8;});}return null;};}function removeEntity(_0x74a439,_0x43227c){return function(_0x59b4f7){if(_0x59b4f7){return _0x59b4f7[_0xfe3e('0x39')]()[_0xfe3e('0x24')](function(){var _0xd5d934=_0x59b4f7['get']({'plain':!![]});var _0x9fe482='ChatQueues';return db[_0xfe3e('0x3a')][_0xfe3e('0x39')]({'where':{'type':_0x9fe482,'resourceId':_0xd5d934['id']}})[_0xfe3e('0x24')](function(){return _0x59b4f7;});})[_0xfe3e('0x24')](function(){_0x74a439[_0xfe3e('0x30')](0xcc)[_0xfe3e('0x3b')]();});}};}function handleEntityNotFound(_0x26e955,_0x59df81){return function(_0x21de58){if(!_0x21de58){_0x26e955[_0xfe3e('0x2f')](0x194);}return _0x21de58;};}function handleError(_0x2b4367,_0x189ab6){_0x189ab6=_0x189ab6||0x1f4;return function(_0x5224b5){logger[_0xfe3e('0x2b')](_0x5224b5[_0xfe3e('0x3c')]);if(_0x5224b5[_0xfe3e('0x3d')]){delete _0x5224b5['name'];}_0x2b4367['status'](_0x189ab6)[_0xfe3e('0x3e')](_0x5224b5);};}exports[_0xfe3e('0x3f')]=function(_0x3b43f0,_0x2ce15b){var _0x1bc1de={},_0x2fd0ec={},_0x213d4c={'count':0x0,'rows':[]};var _0x5e9daa=_[_0xfe3e('0x40')](db[_0xfe3e('0x41')][_0xfe3e('0x42')],function(_0x508e8e){return{'name':_0x508e8e['fieldName'],'type':_0x508e8e[_0xfe3e('0x43')]['key']};});_0x2fd0ec['model']=_[_0xfe3e('0x40')](_0x5e9daa,'name');_0x2fd0ec[_0xfe3e('0x44')]=_[_0xfe3e('0x45')](_0x3b43f0[_0xfe3e('0x44')]);_0x2fd0ec['filters']=_[_0xfe3e('0x46')](_0x2fd0ec[_0xfe3e('0x47')],_0x2fd0ec[_0xfe3e('0x44')]);_0x1bc1de[_0xfe3e('0x48')]=_['intersection'](_0x2fd0ec[_0xfe3e('0x47')],qs[_0xfe3e('0x49')](_0x3b43f0[_0xfe3e('0x44')][_0xfe3e('0x49')]));_0x1bc1de['attributes']=_0x1bc1de[_0xfe3e('0x48')]['length']?_0x1bc1de[_0xfe3e('0x48')]:_0x2fd0ec[_0xfe3e('0x47')];if(!_0x3b43f0[_0xfe3e('0x44')][_0xfe3e('0x4a')](_0xfe3e('0x4b'))){_0x1bc1de['limit']=qs[_0xfe3e('0x34')](_0x3b43f0[_0xfe3e('0x44')]['limit']);_0x1bc1de[_0xfe3e('0x32')]=qs[_0xfe3e('0x32')](_0x3b43f0[_0xfe3e('0x44')]['offset']);}_0x1bc1de[_0xfe3e('0x4c')]=qs['sort'](_0x3b43f0['query'][_0xfe3e('0x4d')]);_0x1bc1de['where']=qs[_0xfe3e('0x4e')](_[_0xfe3e('0x4f')](_0x3b43f0[_0xfe3e('0x44')],_0x2fd0ec[_0xfe3e('0x4e')]),_0x5e9daa);if(_0x3b43f0[_0xfe3e('0x44')][_0xfe3e('0x50')]){_0x1bc1de[_0xfe3e('0x51')]=_[_0xfe3e('0x52')](_0x1bc1de[_0xfe3e('0x51')],{'$or':_[_0xfe3e('0x40')](_0x5e9daa,function(_0x44bae2){if(_0x44bae2[_0xfe3e('0x43')]!=='VIRTUAL'){var _0x2596b2={};_0x2596b2[_0x44bae2['name']]={'$like':'%'+_0x3b43f0['query'][_0xfe3e('0x50')]+'%'};return _0x2596b2;}})});}_0x1bc1de=_[_0xfe3e('0x52')]({},_0x1bc1de,_0x3b43f0['options']);var _0x3dab2e={'where':_0x1bc1de[_0xfe3e('0x51')]};return db[_0xfe3e('0x41')][_0xfe3e('0x35')](_0x3dab2e)['then'](function(_0x2ce425){_0x213d4c[_0xfe3e('0x35')]=_0x2ce425;if(_0x3b43f0['query'][_0xfe3e('0x53')]){_0x1bc1de['include']=[{'all':!![]}];}return db[_0xfe3e('0x41')]['findAll'](_0x1bc1de);})[_0xfe3e('0x24')](function(_0x2d61b1){_0x213d4c[_0xfe3e('0x54')]=_0x2d61b1;return _0x213d4c;})[_0xfe3e('0x24')](respondWithFilteredResult(_0x2ce15b,_0x1bc1de))[_0xfe3e('0x2e')](handleError(_0x2ce15b,null));};exports[_0xfe3e('0x55')]=function(_0x3d6547,_0x5a4f6f){var _0x2b2ee5={'raw':!![],'where':{'id':_0x3d6547['params']['id']}},_0x180ebb={};_0x180ebb[_0xfe3e('0x47')]=_[_0xfe3e('0x45')](db[_0xfe3e('0x41')]['rawAttributes']);_0x180ebb[_0xfe3e('0x44')]=_['keys'](_0x3d6547[_0xfe3e('0x44')]);_0x180ebb[_0xfe3e('0x4e')]=_['intersection'](_0x180ebb['model'],_0x180ebb[_0xfe3e('0x44')]);_0x2b2ee5[_0xfe3e('0x48')]=_['intersection'](_0x180ebb[_0xfe3e('0x47')],qs['fields'](_0x3d6547[_0xfe3e('0x44')][_0xfe3e('0x49')]));_0x2b2ee5[_0xfe3e('0x48')]=_0x2b2ee5['attributes'][_0xfe3e('0x56')]?_0x2b2ee5[_0xfe3e('0x48')]:_0x180ebb[_0xfe3e('0x47')];if(_0x3d6547['query'][_0xfe3e('0x53')]){_0x2b2ee5[_0xfe3e('0x57')]=[{'all':!![]}];}_0x2b2ee5=_[_0xfe3e('0x52')]({},_0x2b2ee5,_0x3d6547[_0xfe3e('0x58')]);return db[_0xfe3e('0x41')][_0xfe3e('0x59')](_0x2b2ee5)[_0xfe3e('0x24')](handleEntityNotFound(_0x5a4f6f,null))[_0xfe3e('0x24')](respondWithResult(_0x5a4f6f,null))['catch'](handleError(_0x5a4f6f,null));};exports[_0xfe3e('0x5a')]=function(_0xbe0b8f,_0x5751d0){return db[_0xfe3e('0x41')][_0xfe3e('0x5a')](_0xbe0b8f[_0xfe3e('0x5b')],{})['then'](function(_0x496dc3){var _0x528a90=_0xbe0b8f[_0xfe3e('0x5c')][_0xfe3e('0x5d')]({'plain':!![]});if(!_0x528a90)throw new Error(_0xfe3e('0x5e'));if(_0x528a90[_0xfe3e('0x5f')]===_0xfe3e('0x5c')){var _0x24de20=_0x496dc3[_0xfe3e('0x5d')]({'plain':!![]});var _0x354173=_0xfe3e('0x60');return db[_0xfe3e('0x61')][_0xfe3e('0x59')]({'where':{'name':_0x354173,'userProfileId':_0x528a90[_0xfe3e('0x62')]},'raw':!![]})[_0xfe3e('0x24')](function(_0x201165){if(_0x201165&&_0x201165[_0xfe3e('0x63')]===0x0){return db[_0xfe3e('0x3a')]['create']({'name':_0x24de20['name'],'resourceId':_0x24de20['id'],'type':_0x201165[_0xfe3e('0x3d')],'sectionId':_0x201165['id']},{})[_0xfe3e('0x24')](function(){return _0x496dc3;});}else{return _0x496dc3;}})[_0xfe3e('0x2e')](function(_0x32b07f){logger['error'](_0xfe3e('0x64'),_0x32b07f);throw _0x32b07f;});}return _0x496dc3;})[_0xfe3e('0x24')](respondWithResult(_0x5751d0,0xc9))[_0xfe3e('0x2e')](handleError(_0x5751d0,null));};exports[_0xfe3e('0x65')]=function(_0x36e023,_0x4fc465){if(_0x36e023[_0xfe3e('0x5b')]['id']){delete _0x36e023[_0xfe3e('0x5b')]['id'];}return db[_0xfe3e('0x41')][_0xfe3e('0x59')]({'where':{'id':_0x36e023['params']['id']}})[_0xfe3e('0x24')](handleEntityNotFound(_0x4fc465,null))[_0xfe3e('0x24')](saveUpdates(_0x36e023[_0xfe3e('0x5b')],null))['then'](respondWithResult(_0x4fc465,null))[_0xfe3e('0x2e')](handleError(_0x4fc465,null));};exports[_0xfe3e('0x39')]=function(_0x2c61e8,_0x504971){return db[_0xfe3e('0x41')][_0xfe3e('0x59')]({'where':{'id':_0x2c61e8['params']['id']}})[_0xfe3e('0x24')](handleEntityNotFound(_0x504971,null))['then'](removeEntity(_0x504971,null))[_0xfe3e('0x2e')](handleError(_0x504971,null));};exports['describe']=function(_0x1113c6,_0x1a9ab3){return db[_0xfe3e('0x41')][_0xfe3e('0x66')]()['then'](respondWithResult(_0x1a9ab3,null))[_0xfe3e('0x2e')](handleError(_0x1a9ab3,null));};exports[_0xfe3e('0x67')]=function(_0x15a48a,_0x50d021,_0x4b5706){var _0x338a1e={'raw':!![],'where':{}},_0x59fb78={},_0x8cf01e;return db[_0xfe3e('0x41')][_0xfe3e('0x68')]({'where':{'id':_0x15a48a[_0xfe3e('0x69')]['id']}})['then'](handleEntityNotFound(_0x50d021,null))[_0xfe3e('0x24')](function(_0x5acf8b){if(_0x5acf8b){_0x8cf01e=_0x5acf8b[_0xfe3e('0x5d')]({'plain':!![]});_0x59fb78[_0xfe3e('0x47')]=_['keys'](db[_0xfe3e('0x6a')][_0xfe3e('0x42')]);_0x59fb78[_0xfe3e('0x44')]=_[_0xfe3e('0x45')](_0x15a48a[_0xfe3e('0x44')]);_0x59fb78['filters']=_[_0xfe3e('0x46')](_0x59fb78[_0xfe3e('0x47')],_0x59fb78[_0xfe3e('0x44')]);_0x338a1e[_0xfe3e('0x48')]=_[_0xfe3e('0x46')](_0x59fb78[_0xfe3e('0x47')],qs[_0xfe3e('0x49')](_0x15a48a[_0xfe3e('0x44')][_0xfe3e('0x49')]));_0x338a1e[_0xfe3e('0x48')]=_0x338a1e['attributes'][_0xfe3e('0x56')]?_0x338a1e[_0xfe3e('0x48')]:_0x59fb78[_0xfe3e('0x47')];if(!_0x15a48a['query'][_0xfe3e('0x4a')](_0xfe3e('0x4b'))){_0x338a1e[_0xfe3e('0x34')]=qs[_0xfe3e('0x34')](_0x15a48a[_0xfe3e('0x44')][_0xfe3e('0x34')]);_0x338a1e[_0xfe3e('0x32')]=qs[_0xfe3e('0x32')](_0x15a48a[_0xfe3e('0x44')]['offset']);}_0x338a1e[_0xfe3e('0x4c')]=qs[_0xfe3e('0x4d')](_0x15a48a[_0xfe3e('0x44')][_0xfe3e('0x4d')]);_0x338a1e['where']=qs[_0xfe3e('0x4e')](_[_0xfe3e('0x4f')](_0x15a48a[_0xfe3e('0x44')],_0x59fb78[_0xfe3e('0x4e')]));_0x338a1e['where'][_0xfe3e('0x6b')]=_0x5acf8b['id'];if(_0x15a48a[_0xfe3e('0x44')][_0xfe3e('0x50')]){_0x338a1e[_0xfe3e('0x51')]=_[_0xfe3e('0x52')](_0x338a1e[_0xfe3e('0x51')],{'$or':_['map'](_0x338a1e[_0xfe3e('0x48')],function(_0x19e117){var _0x518a23={};_0x518a23[_0x19e117]={'$like':'%'+_0x15a48a['query'][_0xfe3e('0x50')]+'%'};return _0x518a23;})});}_0x338a1e=_['merge']({},_0x338a1e,_0x15a48a[_0xfe3e('0x58')]);return db['UserChatQueue'][_0xfe3e('0x6c')](_0x338a1e);}})['then'](function(_0x1d71d0){if(_0x1d71d0){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x1d71d0,_0xfe3e('0x6d')),'role':_0xfe3e('0x6e')},'attributes':['id',_0xfe3e('0x3d'),'chatPause',_0xfe3e('0x6f'),_0xfe3e('0x70')]});}})[_0xfe3e('0x24')](function(_0x41b18e){if(_0x41b18e){return{'count':_0x41b18e[_0xfe3e('0x35')],'rows':_['map'](_0x41b18e[_0xfe3e('0x54')],function(_0x4fc36d){return{'membername':_0x4fc36d[_0xfe3e('0x3d')],'UserId':_0x4fc36d['id'],'queue_name':_0x8cf01e['name'],'ChatQueueId':_0x8cf01e['id'],'interface':util[_0xfe3e('0x71')](_0xfe3e('0x72'),'SIP',_0x4fc36d['name']),'penalty':0x0,'paused':_0x4fc36d['chatPause'],'createdAt':_0x4fc36d[_0xfe3e('0x70')],'updatedAt':_0x4fc36d[_0xfe3e('0x6f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xfe3e('0x24')](respondWithFilteredResult(_0x50d021,_0x338a1e))['catch'](handleError(_0x50d021,null));};exports[_0xfe3e('0x73')]=function(_0x4cd072,_0x3c8758,_0x1e8d2b){var _0x181f5={};var _0x1ab32e={};var _0x2803a1;var _0x39e982;return db[_0xfe3e('0x41')]['findOne']({'where':{'id':_0x4cd072[_0xfe3e('0x69')]['id']}})['then'](handleEntityNotFound(_0x3c8758,null))['then'](function(_0x484921){if(_0x484921){_0x2803a1=_0x484921;_0x1ab32e[_0xfe3e('0x47')]=_[_0xfe3e('0x45')](db[_0xfe3e('0x74')][_0xfe3e('0x42')]);_0x1ab32e[_0xfe3e('0x44')]=_[_0xfe3e('0x45')](_0x4cd072[_0xfe3e('0x44')]);_0x1ab32e[_0xfe3e('0x4e')]=_[_0xfe3e('0x46')](_0x1ab32e['model'],_0x1ab32e[_0xfe3e('0x44')]);_0x181f5['attributes']=_[_0xfe3e('0x46')](_0x1ab32e[_0xfe3e('0x47')],qs['fields'](_0x4cd072[_0xfe3e('0x44')][_0xfe3e('0x49')]));_0x181f5[_0xfe3e('0x48')]=_0x181f5[_0xfe3e('0x48')]['length']?_0x181f5['attributes']:_0x1ab32e[_0xfe3e('0x47')];_0x181f5['order']=qs[_0xfe3e('0x4d')](_0x4cd072['query'][_0xfe3e('0x4d')]);_0x181f5[_0xfe3e('0x51')]=qs[_0xfe3e('0x4e')](_[_0xfe3e('0x4f')](_0x4cd072[_0xfe3e('0x44')],_0x1ab32e['filters']));if(_0x4cd072[_0xfe3e('0x44')][_0xfe3e('0x50')]){_0x181f5[_0xfe3e('0x51')]=_[_0xfe3e('0x52')](_0x181f5['where'],{'$or':_['map'](_0x181f5[_0xfe3e('0x48')],function(_0x3e9dc5){var _0x7b490a={};_0x7b490a[_0x3e9dc5]={'$like':'%'+_0x4cd072[_0xfe3e('0x44')][_0xfe3e('0x50')]+'%'};return _0x7b490a;})});}_0x181f5=_[_0xfe3e('0x52')]({},_0x181f5,_0x4cd072['options']);return _0x2803a1[_0xfe3e('0x73')](_0x181f5);}})[_0xfe3e('0x24')](function(_0x4054c1){if(_0x4054c1){_0x39e982=_0x4054c1[_0xfe3e('0x56')];if(!_0x4cd072[_0xfe3e('0x44')]['hasOwnProperty'](_0xfe3e('0x4b'))){_0x181f5['limit']=qs[_0xfe3e('0x34')](_0x4cd072[_0xfe3e('0x44')]['limit']);_0x181f5[_0xfe3e('0x32')]=qs[_0xfe3e('0x32')](_0x4cd072[_0xfe3e('0x44')]['offset']);}return _0x2803a1[_0xfe3e('0x73')](_0x181f5);}})[_0xfe3e('0x24')](function(_0x1d3d02){if(_0x1d3d02){return _0x1d3d02?{'count':_0x39e982,'rows':_0x1d3d02}:null;}})['then'](respondWithResult(_0x3c8758,null))[_0xfe3e('0x2e')](handleError(_0x3c8758,null));};exports[_0xfe3e('0x75')]=function(_0x5901f3,_0x52d84e,_0x2bd742){var _0x5d81c0=_0x5901f3[_0xfe3e('0x5b')][_0xfe3e('0x76')];return db[_0xfe3e('0x74')][_0xfe3e('0x6c')]({'where':{'id':_0x5d81c0},'attributes':['id'],'include':[{'model':db[_0xfe3e('0x77')],'as':_0xfe3e('0x78'),'attributes':['id',_0xfe3e('0x3d'),_0xfe3e('0x79'),_0xfe3e('0x7a'),'interface'],'raw':!![]}]})[_0xfe3e('0x24')](function(_0x44b327){if(_0x44b327){var _0x2fd7b6=_['flatMap'](_0x44b327,function(_0x134ebc){var _0x5c6a13=_0x134ebc[_0xfe3e('0x5d')]({'plain':!![]});return _0x5c6a13[_0xfe3e('0x78')];});return db[_0xfe3e('0x41')][_0xfe3e('0x59')]({'where':{'id':_0x5901f3[_0xfe3e('0x69')]['id']}})[_0xfe3e('0x24')](function(_0x4a1794){return db[_0xfe3e('0x7b')][_0xfe3e('0x7c')](function(_0x1f9665){return _0x4a1794[_0xfe3e('0x75')](_0x5d81c0,{'transaction':_0x1f9665})[_0xfe3e('0x24')](function(){return BPromise[_0xfe3e('0x7d')](_0x2fd7b6,function(_0x2ea481){return db[_0xfe3e('0x6a')][_0xfe3e('0x7e')]({'where':{'UserId':_0x2ea481['id'],'ChatQueueId':_0x5901f3[_0xfe3e('0x69')]['id']},'transaction':_0x1f9665});});})[_0xfe3e('0x24')](function(){_0x2fd7b6[_0xfe3e('0x7f')](function(_0x524b72){socket[_0xfe3e('0x80')](_0xfe3e('0x81'),{'UserId':_0x524b72['id'],'ChatQueueId':_0x4a1794['id']});});});});});}})[_0xfe3e('0x24')](respondWithStatusCode(_0x52d84e,null))[_0xfe3e('0x2e')](handleError(_0x52d84e,null));};exports['removeTeams']=function(_0x4e51f3,_0x515acb,_0x513b89){return db[_0xfe3e('0x74')]['findAll']({'where':{'id':_0x4e51f3[_0xfe3e('0x44')][_0xfe3e('0x76')]},'attributes':['id'],'include':[{'model':db[_0xfe3e('0x77')],'as':_0xfe3e('0x78'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x515acb,null))[_0xfe3e('0x24')](function(_0x4c1b88){var _0x5778dd=_[_0xfe3e('0x40')](_0x4c1b88,'id');var _0x1def63=[];var _0x184763=[];var _0x465533=squel[_0xfe3e('0x82')]();_0x465533[_0xfe3e('0x83')]('tq.TeamId')['from'](_0xfe3e('0x84'),'tq')[_0xfe3e('0x85')](_0xfe3e('0x86'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xfe3e('0x51')]('ChatQueueId\x20=\x20?',_0x4e51f3[_0xfe3e('0x69')]['id']);for(var _0x1e5be3=0x0;_0x1e5be3<_0x4c1b88[_0xfe3e('0x56')];_0x1e5be3+=0x1){let _0x1c3de7=_0x4c1b88[_0x1e5be3];for(var _0x14490c=0x0;_0x14490c<_0x1c3de7['Agents'][_0xfe3e('0x56')];_0x14490c+=0x1){let _0x4d78d8=_0x1c3de7[_0xfe3e('0x78')][_0x14490c];var _0x5d9241=_0x465533['clone']();_0x5d9241[_0xfe3e('0x51')](_0xfe3e('0x87'),_0x4d78d8['id']);_0x184763[_0xfe3e('0x88')](db[_0xfe3e('0x7b')][_0xfe3e('0x44')](_0x5d9241[_0xfe3e('0x89')](),{'type':db['sequelize'][_0xfe3e('0x8a')]['SELECT']})['then'](function(_0x23afab){if(_0x23afab[_0xfe3e('0x56')]===0x1){return _0x4d78d8['id'];}else{var _0x5d668e=_[_0xfe3e('0x8b')](_[_0xfe3e('0x40')](_0x23afab,_0xfe3e('0x8c')),function(_0x16093e){return _['includes'](_0x5778dd,_0x16093e);});if(_0x5d668e){return _0x4d78d8['id'];}}}));}}return BPromise[_0xfe3e('0x8d')](_0x184763)[_0xfe3e('0x24')](function(_0x2b3005){_0x1def63=_(_0x1def63)[_0xfe3e('0x8e')](_0x2b3005)['compact']()[_0xfe3e('0x8f')]();return db['ChatQueue'][_0xfe3e('0x59')]({'where':{'id':_0x4e51f3['params']['id']}})[_0xfe3e('0x24')](function(_0x18b357){return db['sequelize']['transaction'](function(_0x52b920){return _0x18b357[_0xfe3e('0x90')](_0x4e51f3[_0xfe3e('0x44')][_0xfe3e('0x76')],{'transaction':_0x52b920})['then'](function(){if(!_[_0xfe3e('0x91')](_0x1def63)){return _0x18b357[_0xfe3e('0x92')](_0x1def63,{'transaction':_0x52b920});}})[_0xfe3e('0x24')](function(){_0x1def63['forEach'](function(_0x4e7c67){socket[_0xfe3e('0x80')](_0xfe3e('0x93'),{'UserId':_0x4e7c67,'ChatQueueId':_0x18b357['id']});});});});});});})[_0xfe3e('0x24')](respondWithStatusCode(_0x515acb,null))[_0xfe3e('0x2e')](handleError(_0x515acb,null));};exports['addAgents']=function(_0x5effe2,_0x36dac7,_0x4e2310){return db[_0xfe3e('0x41')]['find']({'where':{'id':_0x5effe2[_0xfe3e('0x69')]['id']}})['then'](handleEntityNotFound(_0x36dac7,null))[_0xfe3e('0x24')](function(_0x373642){if(_0x373642){return _0x373642['addAgents'](_0x5effe2['body'][_0xfe3e('0x76')],_[_0xfe3e('0x94')](_0x5effe2[_0xfe3e('0x5b')],[_0xfe3e('0x76'),'id'])||{})['spread'](function(_0x257fbd){for(var _0x15b626=0x0;_0x15b626<_0x5effe2[_0xfe3e('0x5b')][_0xfe3e('0x76')][_0xfe3e('0x56')];_0x15b626+=0x1){socket[_0xfe3e('0x80')]('userChatQueue:save',{'UserId':Number(_0x5effe2[_0xfe3e('0x5b')][_0xfe3e('0x76')][_0x15b626]),'ChatQueueId':Number(_0x5effe2[_0xfe3e('0x69')]['id'])});}return _0x257fbd;});}})[_0xfe3e('0x24')](respondWithResult(_0x36dac7,null))['catch'](handleError(_0x36dac7,null));};exports[_0xfe3e('0x92')]=function(_0x4e510f,_0x28ad12,_0x1f0d3c){return db['ChatQueue']['find']({'where':{'id':_0x4e510f['params']['id']}})[_0xfe3e('0x24')](handleEntityNotFound(_0x28ad12,null))[_0xfe3e('0x24')](function(_0x19c250){if(_0x19c250){return _0x19c250[_0xfe3e('0x92')](_0x4e510f[_0xfe3e('0x44')][_0xfe3e('0x76')])[_0xfe3e('0x24')](function(){if(_[_0xfe3e('0x95')](_0x4e510f[_0xfe3e('0x44')][_0xfe3e('0x76')])){for(var _0x40f63c=0x0;_0x40f63c<_0x4e510f['query'][_0xfe3e('0x76')]['length'];_0x40f63c+=0x1){socket[_0xfe3e('0x80')]('userChatQueue:remove',{'UserId':Number(_0x4e510f['query'][_0xfe3e('0x76')][_0x40f63c]),'ChatQueueId':Number(_0x4e510f[_0xfe3e('0x69')]['id'])});}}else{socket[_0xfe3e('0x80')](_0xfe3e('0x93'),{'UserId':Number(_0x4e510f['query']['ids']),'ChatQueueId':Number(_0x4e510f['params']['id'])});}});}})['then'](respondWithStatusCode(_0x28ad12,null))[_0xfe3e('0x2e')](handleError(_0x28ad12,null));};exports[_0xfe3e('0x96')]=function(_0x27e392,_0x3d57de,_0x4ab75e){var _0x5bba38={};var _0x385184={};var _0x2af7fc;var _0x8442f5;return db['ChatQueue']['findOne']({'where':{'id':_0x27e392[_0xfe3e('0x69')]['id']}})[_0xfe3e('0x24')](handleEntityNotFound(_0x3d57de,null))['then'](function(_0x4105db){if(_0x4105db){_0x2af7fc=_0x4105db;_0x385184['model']=_[_0xfe3e('0x45')](db['User'][_0xfe3e('0x42')]);_0x385184[_0xfe3e('0x44')]=_['keys'](_0x27e392[_0xfe3e('0x44')]);_0x385184[_0xfe3e('0x4e')]=_[_0xfe3e('0x46')](_0x385184[_0xfe3e('0x47')],_0x385184['query']);_0x5bba38[_0xfe3e('0x48')]=_['intersection'](_0x385184[_0xfe3e('0x47')],qs[_0xfe3e('0x49')](_0x27e392[_0xfe3e('0x44')][_0xfe3e('0x49')]));_0x5bba38[_0xfe3e('0x48')]=_0x5bba38['attributes'][_0xfe3e('0x56')]?_0x5bba38[_0xfe3e('0x48')]:_0x385184[_0xfe3e('0x47')];_0x5bba38[_0xfe3e('0x4c')]=qs[_0xfe3e('0x4d')](_0x27e392[_0xfe3e('0x44')][_0xfe3e('0x4d')]);_0x5bba38[_0xfe3e('0x51')]=qs[_0xfe3e('0x4e')](_[_0xfe3e('0x4f')](_0x27e392['query'],_0x385184[_0xfe3e('0x4e')]));if(_0x27e392[_0xfe3e('0x44')][_0xfe3e('0x50')]){_0x5bba38[_0xfe3e('0x51')]=_[_0xfe3e('0x52')](_0x5bba38[_0xfe3e('0x51')],{'$or':_['map'](_0x5bba38['attributes'],function(_0x5835fb){var _0x3832d4={};_0x3832d4[_0x5835fb]={'$like':'%'+_0x27e392['query'][_0xfe3e('0x50')]+'%'};return _0x3832d4;})});}_0x5bba38=_[_0xfe3e('0x52')]({},_0x5bba38,_0x27e392['options']);return _0x2af7fc[_0xfe3e('0x96')](_0x5bba38);}})[_0xfe3e('0x24')](function(_0x5b3081){if(_0x5b3081){_0x8442f5=_0x5b3081[_0xfe3e('0x56')];if(!_0x27e392[_0xfe3e('0x44')][_0xfe3e('0x4a')]('nolimit')){_0x5bba38[_0xfe3e('0x34')]=qs[_0xfe3e('0x34')](_0x27e392[_0xfe3e('0x44')][_0xfe3e('0x34')]);_0x5bba38[_0xfe3e('0x32')]=qs['offset'](_0x27e392[_0xfe3e('0x44')][_0xfe3e('0x32')]);}return _0x2af7fc['getAgents'](_0x5bba38);}})[_0xfe3e('0x24')](function(_0x3c9c95){if(_0x3c9c95){return _0x3c9c95?{'count':_0x8442f5,'rows':_0x3c9c95}:null;}})[_0xfe3e('0x24')](respondWithResult(_0x3d57de,null))[_0xfe3e('0x2e')](handleError(_0x3d57de,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 4bc3d32..b24047a 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 _0x11c5=['../../mysqldb','ChatQueue','setMaxListeners','save','remove','emit','hook','exports','events'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x11c5,0xc5));var _0x511c=function(_0x3eaedf,_0xa1791f){_0x3eaedf=_0x3eaedf-0x0;var _0x2a0694=_0x11c5[_0x3eaedf];return _0x2a0694;};'use strict';var EventEmitter=require(_0x511c('0x0'));var ChatQueue=require(_0x511c('0x1'))['db'][_0x511c('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x511c('0x3')](0x0);var events={'afterCreate':_0x511c('0x4'),'afterUpdate':'update','afterDestroy':_0x511c('0x5')};function emitEvent(_0x4cf942){return function(_0x3ff37f,_0xf1c46,_0x208b5b){ChatQueueEvents[_0x511c('0x6')](_0x4cf942+':'+_0x3ff37f['id'],_0x3ff37f);ChatQueueEvents['emit'](_0x4cf942,_0x3ff37f);_0x208b5b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x511c('0x7')](e,emitEvent(event));}}module[_0x511c('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0x5ffd=['exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x5caec2,_0x495313){var _0x27429=function(_0x3c6d2c){while(--_0x3c6d2c){_0x5caec2['push'](_0x5caec2['shift']());}};_0x27429(++_0x495313);}(_0x5ffd,0xdd));var _0xd5ff=function(_0x541a3f,_0x3bb0c9){_0x541a3f=_0x541a3f-0x0;var _0x12ed43=_0x5ffd[_0x541a3f];return _0x12ed43;};'use strict';var EventEmitter=require(_0xd5ff('0x0'));var ChatQueue=require(_0xd5ff('0x1'))['db'][_0xd5ff('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xd5ff('0x3')](0x0);var events={'afterCreate':_0xd5ff('0x4'),'afterUpdate':_0xd5ff('0x5'),'afterDestroy':_0xd5ff('0x6')};function emitEvent(_0xf4290){return function(_0x2d6c5a,_0x4459a7,_0x2ec5c6){ChatQueueEvents[_0xd5ff('0x7')](_0xf4290+':'+_0x2d6c5a['id'],_0x2d6c5a);ChatQueueEvents[_0xd5ff('0x7')](_0xf4290,_0x2d6c5a);_0x2ec5c6(null);};}for(var e in events){if(events[_0xd5ff('0x8')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xd5ff('0x9')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 1de6cb3..bc2d081 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 _0xd085=['moment','bluebird','request-promise','path','rimraf','../../config/environment','chat_queues','util','../../config/logger','api'];(function(_0x4f59b3,_0x1daf6e){var _0x2956f1=function(_0x2000af){while(--_0x2000af){_0x4f59b3['push'](_0x4f59b3['shift']());}};_0x2956f1(++_0x1daf6e);}(_0xd085,0x89));var _0x5d08=function(_0x305486,_0x24acd4){_0x305486=_0x305486-0x0;var _0xa04940=_0xd085[_0x305486];return _0xa04940;};'use strict';var _=require('lodash');var util=require(_0x5d08('0x0'));var logger=require(_0x5d08('0x1'))(_0x5d08('0x2'));var moment=require(_0x5d08('0x3'));var BPromise=require(_0x5d08('0x4'));var rp=require(_0x5d08('0x5'));var fs=require('fs');var path=require(_0x5d08('0x6'));var rimraf=require(_0x5d08('0x7'));var config=require(_0x5d08('0x8'));var attributes=require('./chatQueue.attributes');module['exports']=function(_0x4668ab,_0x537284){return _0x4668ab['define']('ChatQueue',attributes,{'tableName':_0x5d08('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc3fc=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','define','ChatQueue','chat_queues','lodash'];(function(_0xe64c79,_0x3f1a4a){var _0x4d15cf=function(_0x4550be){while(--_0x4550be){_0xe64c79['push'](_0xe64c79['shift']());}};_0x4d15cf(++_0x3f1a4a);}(_0xc3fc,0x1a3));var _0xcc3f=function(_0xed5ef,_0x431ed2){_0xed5ef=_0xed5ef-0x0;var _0x316278=_0xc3fc[_0xed5ef];return _0x316278;};'use strict';var _=require(_0xcc3f('0x0'));var util=require(_0xcc3f('0x1'));var logger=require(_0xcc3f('0x2'))('api');var moment=require(_0xcc3f('0x3'));var BPromise=require('bluebird');var rp=require(_0xcc3f('0x4'));var fs=require('fs');var path=require(_0xcc3f('0x5'));var rimraf=require(_0xcc3f('0x6'));var config=require(_0xcc3f('0x7'));var attributes=require(_0xcc3f('0x8'));module['exports']=function(_0x5decce,_0x2fb227){return _0x5decce[_0xcc3f('0x9')](_0xcc3f('0xa'),attributes,{'tableName':_0xcc3f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 0401a7d..dcfb172 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 _0x3d70=['../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetChatQueue','ChatQueue','options','raw','where','attributes','limit','include','map','model','debug','ShowChatQueue','util','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x21f21d,_0x23f311){var _0x353a1f=function(_0x4794aa){while(--_0x4794aa){_0x21f21d['push'](_0x21f21d['shift']());}};_0x353a1f(++_0x23f311);}(_0x3d70,0xf6));var _0x03d7=function(_0x1c208e,_0x2a0a5b){_0x1c208e=_0x1c208e-0x0;var _0x5104ff=_0x3d70[_0x1c208e];return _0x5104ff;};'use strict';var _=require('lodash');var util=require(_0x03d7('0x0'));var moment=require(_0x03d7('0x1'));var BPromise=require(_0x03d7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x03d7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x03d7('0x4'));var logger=require(_0x03d7('0x5'))('rpc');var config=require(_0x03d7('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x03d7('0x7')][_0x03d7('0x8')]({'port':0x232a});config[_0x03d7('0x9')]=_[_0x03d7('0xa')](config['redis'],{'host':_0x03d7('0xb'),'port':0x18eb});var socket=require(_0x03d7('0xc'))(new Redis(config[_0x03d7('0x9')]));require('./chatQueue.socket')[_0x03d7('0xd')](socket);function respondWithRpcPromise(_0x4678d8,_0x556e42,_0x34d03a){return new BPromise(function(_0x19da37,_0x430718){return client[_0x03d7('0xe')](_0x4678d8,_0x34d03a)[_0x03d7('0xf')](function(_0x2fed0f){logger[_0x03d7('0x10')](_0x03d7('0x11'),_0x556e42,_0x03d7('0x12'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x556e42,_0x03d7('0x12'),JSON[_0x03d7('0x13')](_0x2fed0f));if(_0x2fed0f[_0x03d7('0x14')]){if(_0x2fed0f[_0x03d7('0x14')][_0x03d7('0x15')]===0x1f4){logger[_0x03d7('0x14')](_0x03d7('0x11'),_0x556e42,_0x2fed0f[_0x03d7('0x14')][_0x03d7('0x16')]);return _0x430718(_0x2fed0f[_0x03d7('0x14')]['message']);}logger['error'](_0x03d7('0x11'),_0x556e42,_0x2fed0f[_0x03d7('0x14')][_0x03d7('0x16')]);return _0x19da37(_0x2fed0f[_0x03d7('0x14')][_0x03d7('0x16')]);}else{logger[_0x03d7('0x10')](_0x03d7('0x11'),_0x556e42,'request\x20sent');_0x19da37(_0x2fed0f['result']['message']);}})[_0x03d7('0x17')](function(_0x59237){logger[_0x03d7('0x14')](_0x03d7('0x11'),_0x556e42,_0x59237);_0x430718(_0x59237);});});}exports[_0x03d7('0x18')]=function(_0x1fa6d9){var _0x4da574=this;return new Promise(function(_0x539beb,_0x13aa1c){return db[_0x03d7('0x19')]['findAll']({'raw':_0x1fa6d9[_0x03d7('0x1a')]?_0x1fa6d9[_0x03d7('0x1a')][_0x03d7('0x1b')]===undefined?!![]:![]:!![],'where':_0x1fa6d9[_0x03d7('0x1a')]?_0x1fa6d9[_0x03d7('0x1a')][_0x03d7('0x1c')]||null:null,'attributes':_0x1fa6d9[_0x03d7('0x1a')]?_0x1fa6d9[_0x03d7('0x1a')][_0x03d7('0x1d')]||null:null,'limit':_0x1fa6d9[_0x03d7('0x1a')]?_0x1fa6d9[_0x03d7('0x1a')][_0x03d7('0x1e')]||null:null,'include':_0x1fa6d9[_0x03d7('0x1a')]?_0x1fa6d9['options'][_0x03d7('0x1f')]?_[_0x03d7('0x20')](_0x1fa6d9[_0x03d7('0x1a')][_0x03d7('0x1f')],function(_0x1cdd49){return{'model':db[_0x1cdd49[_0x03d7('0x21')]],'as':_0x1cdd49['as'],'attributes':_0x1cdd49[_0x03d7('0x1d')],'include':_0x1cdd49[_0x03d7('0x1f')]?_[_0x03d7('0x20')](_0x1cdd49['include'],function(_0x58d170){return{'model':db[_0x58d170[_0x03d7('0x21')]],'as':_0x58d170['as'],'attributes':_0x58d170[_0x03d7('0x1d')],'include':_0x58d170[_0x03d7('0x1f')]?_[_0x03d7('0x20')](_0x58d170[_0x03d7('0x1f')],function(_0x745694){return{'model':db[_0x745694[_0x03d7('0x21')]],'as':_0x745694['as'],'attributes':_0x745694['attributes']};}):[]};}):[]};}):[]:[]})[_0x03d7('0xf')](function(_0xfc727f){logger['info'](_0x03d7('0x18'),_0x1fa6d9);logger[_0x03d7('0x22')]('GetChatQueue',_0x1fa6d9,JSON[_0x03d7('0x13')](_0xfc727f));_0x539beb(_0xfc727f);})[_0x03d7('0x17')](function(_0x30fb5f){logger['error'](_0x03d7('0x18'),_0x30fb5f[_0x03d7('0x16')],_0x1fa6d9);_0x13aa1c(_0x4da574['error'](0x1f4,_0x30fb5f['message']));});});};exports[_0x03d7('0x23')]=function(_0x1f2c24){var _0x24f749=this;return new Promise(function(_0x2655a0,_0x1d8b6c){return db[_0x03d7('0x19')]['find']({'raw':_0x1f2c24[_0x03d7('0x1a')]?_0x1f2c24['options'][_0x03d7('0x1b')]===undefined?!![]:![]:!![],'where':_0x1f2c24[_0x03d7('0x1a')]?_0x1f2c24[_0x03d7('0x1a')][_0x03d7('0x1c')]||null:null,'attributes':_0x1f2c24[_0x03d7('0x1a')]?_0x1f2c24['options'][_0x03d7('0x1d')]||null:null,'include':_0x1f2c24[_0x03d7('0x1a')]?_0x1f2c24['options'][_0x03d7('0x1f')]?_[_0x03d7('0x20')](_0x1f2c24[_0x03d7('0x1a')][_0x03d7('0x1f')],function(_0x4a8754){return{'model':db[_0x4a8754[_0x03d7('0x21')]],'as':_0x4a8754['as'],'attributes':_0x4a8754[_0x03d7('0x1d')],'include':_0x4a8754[_0x03d7('0x1f')]?_[_0x03d7('0x20')](_0x4a8754[_0x03d7('0x1f')],function(_0x33e9ff){return{'model':db[_0x33e9ff[_0x03d7('0x21')]],'as':_0x33e9ff['as'],'attributes':_0x33e9ff[_0x03d7('0x1d')],'include':_0x33e9ff[_0x03d7('0x1f')]?_['map'](_0x33e9ff[_0x03d7('0x1f')],function(_0x34e985){return{'model':db[_0x34e985[_0x03d7('0x21')]],'as':_0x34e985['as'],'attributes':_0x34e985['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x343928){logger[_0x03d7('0x10')](_0x03d7('0x23'),_0x1f2c24);logger[_0x03d7('0x22')]('ShowChatQueue',_0x1f2c24,JSON[_0x03d7('0x13')](_0x343928));_0x2655a0(_0x343928);})[_0x03d7('0x17')](function(_0x128932){logger[_0x03d7('0x14')](_0x03d7('0x23'),_0x128932[_0x03d7('0x16')],_0x1f2c24);_0x1d8b6c(_0x24f749[_0x03d7('0x14')](0x1f4,_0x128932[_0x03d7('0x16')]));});});};
\ No newline at end of file
+var _0xf846=['include','map','model','catch','ShowChatQueue','ChatQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetChatQueue','findAll','options','raw','where','attributes','limit'];(function(_0x184cbe,_0x2c701d){var _0x45a0be=function(_0x3b7c64){while(--_0x3b7c64){_0x184cbe['push'](_0x184cbe['shift']());}};_0x45a0be(++_0x2c701d);}(_0xf846,0x85));var _0x6f84=function(_0x3b5ca2,_0x524232){_0x3b5ca2=_0x3b5ca2-0x0;var _0x35d529=_0xf846[_0x3b5ca2];return _0x35d529;};'use strict';var _=require(_0x6f84('0x0'));var util=require(_0x6f84('0x1'));var moment=require(_0x6f84('0x2'));var BPromise=require(_0x6f84('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6f84('0x4'));var db=require(_0x6f84('0x5'))['db'];var utils=require(_0x6f84('0x6'));var logger=require(_0x6f84('0x7'))('rpc');var config=require(_0x6f84('0x8'));var jayson=require(_0x6f84('0x9'));var client=jayson[_0x6f84('0xa')][_0x6f84('0xb')]({'port':0x232a});config[_0x6f84('0xc')]=_[_0x6f84('0xd')](config['redis'],{'host':_0x6f84('0xe'),'port':0x18eb});var socket=require(_0x6f84('0xf'))(new Redis(config[_0x6f84('0xc')]));require('./chatQueue.socket')[_0x6f84('0x10')](socket);function respondWithRpcPromise(_0x4144b7,_0x4d4362,_0x3f8488){return new BPromise(function(_0x3c816d,_0x390d9f){return client[_0x6f84('0x11')](_0x4144b7,_0x3f8488)[_0x6f84('0x12')](function(_0x317420){logger[_0x6f84('0x13')](_0x6f84('0x14'),_0x4d4362,_0x6f84('0x15'));logger[_0x6f84('0x16')](_0x6f84('0x17'),_0x4d4362,'request\x20sent',JSON[_0x6f84('0x18')](_0x317420));if(_0x317420['error']){if(_0x317420[_0x6f84('0x19')][_0x6f84('0x1a')]===0x1f4){logger['error'](_0x6f84('0x14'),_0x4d4362,_0x317420['error'][_0x6f84('0x1b')]);return _0x390d9f(_0x317420['error'][_0x6f84('0x1b')]);}logger['error'](_0x6f84('0x14'),_0x4d4362,_0x317420['error'][_0x6f84('0x1b')]);return _0x3c816d(_0x317420[_0x6f84('0x19')][_0x6f84('0x1b')]);}else{logger[_0x6f84('0x13')](_0x6f84('0x14'),_0x4d4362,_0x6f84('0x15'));_0x3c816d(_0x317420['result'][_0x6f84('0x1b')]);}})['catch'](function(_0x39de09){logger[_0x6f84('0x19')](_0x6f84('0x14'),_0x4d4362,_0x39de09);_0x390d9f(_0x39de09);});});}exports[_0x6f84('0x1c')]=function(_0x3e818f){var _0x1c9fcc=this;return new Promise(function(_0x3086ff,_0x56dd3a){return db['ChatQueue'][_0x6f84('0x1d')]({'raw':_0x3e818f['options']?_0x3e818f[_0x6f84('0x1e')][_0x6f84('0x1f')]===undefined?!![]:![]:!![],'where':_0x3e818f[_0x6f84('0x1e')]?_0x3e818f[_0x6f84('0x1e')][_0x6f84('0x20')]||null:null,'attributes':_0x3e818f[_0x6f84('0x1e')]?_0x3e818f[_0x6f84('0x1e')][_0x6f84('0x21')]||null:null,'limit':_0x3e818f[_0x6f84('0x1e')]?_0x3e818f['options'][_0x6f84('0x22')]||null:null,'include':_0x3e818f['options']?_0x3e818f[_0x6f84('0x1e')][_0x6f84('0x23')]?_[_0x6f84('0x24')](_0x3e818f[_0x6f84('0x1e')][_0x6f84('0x23')],function(_0x30014e){return{'model':db[_0x30014e[_0x6f84('0x25')]],'as':_0x30014e['as'],'attributes':_0x30014e[_0x6f84('0x21')],'include':_0x30014e[_0x6f84('0x23')]?_[_0x6f84('0x24')](_0x30014e[_0x6f84('0x23')],function(_0x7d298d){return{'model':db[_0x7d298d[_0x6f84('0x25')]],'as':_0x7d298d['as'],'attributes':_0x7d298d[_0x6f84('0x21')],'include':_0x7d298d[_0x6f84('0x23')]?_[_0x6f84('0x24')](_0x7d298d[_0x6f84('0x23')],function(_0x4fa5da){return{'model':db[_0x4fa5da[_0x6f84('0x25')]],'as':_0x4fa5da['as'],'attributes':_0x4fa5da[_0x6f84('0x21')]};}):[]};}):[]};}):[]:[]})[_0x6f84('0x12')](function(_0x4a4a4f){logger['info'](_0x6f84('0x1c'),_0x3e818f);logger[_0x6f84('0x16')]('GetChatQueue',_0x3e818f,JSON[_0x6f84('0x18')](_0x4a4a4f));_0x3086ff(_0x4a4a4f);})[_0x6f84('0x26')](function(_0x17f6a9){logger[_0x6f84('0x19')]('GetChatQueue',_0x17f6a9[_0x6f84('0x1b')],_0x3e818f);_0x56dd3a(_0x1c9fcc[_0x6f84('0x19')](0x1f4,_0x17f6a9[_0x6f84('0x1b')]));});});};exports[_0x6f84('0x27')]=function(_0x4a85c5){var _0x3f153b=this;return new Promise(function(_0x27ac0a,_0x45f959){return db[_0x6f84('0x28')][_0x6f84('0x29')]({'raw':_0x4a85c5[_0x6f84('0x1e')]?_0x4a85c5[_0x6f84('0x1e')][_0x6f84('0x1f')]===undefined?!![]:![]:!![],'where':_0x4a85c5[_0x6f84('0x1e')]?_0x4a85c5[_0x6f84('0x1e')][_0x6f84('0x20')]||null:null,'attributes':_0x4a85c5['options']?_0x4a85c5[_0x6f84('0x1e')][_0x6f84('0x21')]||null:null,'include':_0x4a85c5[_0x6f84('0x1e')]?_0x4a85c5[_0x6f84('0x1e')][_0x6f84('0x23')]?_['map'](_0x4a85c5[_0x6f84('0x1e')]['include'],function(_0x42ea0c){return{'model':db[_0x42ea0c[_0x6f84('0x25')]],'as':_0x42ea0c['as'],'attributes':_0x42ea0c[_0x6f84('0x21')],'include':_0x42ea0c[_0x6f84('0x23')]?_[_0x6f84('0x24')](_0x42ea0c[_0x6f84('0x23')],function(_0x140ede){return{'model':db[_0x140ede[_0x6f84('0x25')]],'as':_0x140ede['as'],'attributes':_0x140ede[_0x6f84('0x21')],'include':_0x140ede[_0x6f84('0x23')]?_[_0x6f84('0x24')](_0x140ede[_0x6f84('0x23')],function(_0x36a4ad){return{'model':db[_0x36a4ad[_0x6f84('0x25')]],'as':_0x36a4ad['as'],'attributes':_0x36a4ad[_0x6f84('0x21')]};}):[]};}):[]};}):[]:[]})[_0x6f84('0x12')](function(_0xdfdc31){logger['info'](_0x6f84('0x27'),_0x4a85c5);logger[_0x6f84('0x16')]('ShowChatQueue',_0x4a85c5,JSON[_0x6f84('0x18')](_0xdfdc31));_0x27ac0a(_0xdfdc31);})[_0x6f84('0x26')](function(_0x598be8){logger[_0x6f84('0x19')](_0x6f84('0x27'),_0x598be8['message'],_0x4a85c5);_0x45f959(_0x3f153b['error'](0x1f4,_0x598be8[_0x6f84('0x1b')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index d0de6e7..149fe1f 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 _0x29d4=['removeListener','register','length','./chatQueue.events','remove','update'];(function(_0x31a955,_0x145b94){var _0x34aa15=function(_0x4df822){while(--_0x4df822){_0x31a955['push'](_0x31a955['shift']());}};_0x34aa15(++_0x145b94);}(_0x29d4,0x1a1));var _0x429d=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x29d4[_0x5bd426];return _0x23a7eb;};'use strict';var ChatQueueEvents=require(_0x429d('0x0'));var events=['save',_0x429d('0x1'),_0x429d('0x2')];function createListener(_0x16ce75,_0x472fc9){return function(_0x45df1c){_0x472fc9['emit'](_0x16ce75,_0x45df1c);};}function removeListener(_0xc3989d,_0x3f43f5){return function(){ChatQueueEvents[_0x429d('0x3')](_0xc3989d,_0x3f43f5);};}exports[_0x429d('0x4')]=function(_0x1c55aa){for(var _0xa71445=0x0,_0x56aa2f=events[_0x429d('0x5')];_0xa71445<_0x56aa2f;_0xa71445++){var _0x4befb9=events[_0xa71445];var _0x9fc337=createListener('chatQueue:'+_0x4befb9,_0x1c55aa);ChatQueueEvents['on'](_0x4befb9,_0x9fc337);}};
\ No newline at end of file
+var _0x9c44=['emit','removeListener','length','chatQueue:','remove','update'];(function(_0x7f5cb8,_0xb73358){var _0x26a254=function(_0x4383e2){while(--_0x4383e2){_0x7f5cb8['push'](_0x7f5cb8['shift']());}};_0x26a254(++_0xb73358);}(_0x9c44,0x178));var _0x49c4=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x9c44[_0x4fde08];return _0x12e725;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0x49c4('0x0'),_0x49c4('0x1')];function createListener(_0x26844b,_0x1ba0bb){return function(_0x455700){_0x1ba0bb[_0x49c4('0x2')](_0x26844b,_0x455700);};}function removeListener(_0x4e0313,_0x4941f1){return function(){ChatQueueEvents[_0x49c4('0x3')](_0x4e0313,_0x4941f1);};}exports['register']=function(_0xc1278f){for(var _0x6030ae=0x0,_0x69bc41=events[_0x49c4('0x4')];_0x6030ae<_0x69bc41;_0x6030ae++){var _0x436234=events[_0x6030ae];var _0x511d53=createListener(_0x49c4('0x5')+_0x436234,_0xc1278f);ChatQueueEvents['on'](_0x436234,_0x511d53);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index e3fe717..efbed8e 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x3e74,0x175));var _0x43e7=function(_0x540b0d,_0x37bf42){_0x540b0d=_0x540b0d-0x0;var _0x1e06d9=_0x3e74[_0x540b0d];return _0x1e06d9;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router;
\ No newline at end of file
+var _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(_0x24c105,_0x7ad441){var _0x320381=function(_0x382ca3){while(--_0x382ca3){_0x24c105['push'](_0x24c105['shift']());}};_0x320381(++_0x7ad441);}(_0xe14b,0x93));var _0xbe14=function(_0x100cd0,_0x5b4781){_0x100cd0=_0x100cd0-0x0;var _0x5ef79e=_0xe14b[_0x100cd0];return _0x5ef79e;};'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
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 660a967..5830e40 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 _0x2a8e=['STRING','DATE','moment','sequelize','exports'];(function(_0x582274,_0x2cbd9c){var _0x8f14d3=function(_0x1cfe08){while(--_0x1cfe08){_0x582274['push'](_0x582274['shift']());}};_0x8f14d3(++_0x2cbd9c);}(_0x2a8e,0x156));var _0xe2a8=function(_0x5a636f,_0x3fec2b){_0x5a636f=_0x5a636f-0x0;var _0x6a8cfb=_0x2a8e[_0x5a636f];return _0x6a8cfb;};'use strict';var moment=require(_0xe2a8('0x0'));var Sequelize=require(_0xe2a8('0x1'));module[_0xe2a8('0x2')]={'uniqueid':{'type':Sequelize[_0xe2a8('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xe2a8('0x4')]},'leaveAt':{'type':Sequelize[_0xe2a8('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xe2a8('0x4')]},'reason':{'type':Sequelize[_0xe2a8('0x3')]}};
\ No newline at end of file
+var _0x8ae2=['moment','sequelize','exports','STRING','DATE'];(function(_0x1ed9dc,_0x39dac8){var _0x1a68a1=function(_0x5c243e){while(--_0x5c243e){_0x1ed9dc['push'](_0x1ed9dc['shift']());}};_0x1a68a1(++_0x39dac8);}(_0x8ae2,0x140));var _0x28ae=function(_0x20b5fb,_0x208a92){_0x20b5fb=_0x20b5fb-0x0;var _0x369b02=_0x8ae2[_0x20b5fb];return _0x369b02;};'use strict';var moment=require(_0x28ae('0x0'));var Sequelize=require(_0x28ae('0x1'));module[_0x28ae('0x2')]={'uniqueid':{'type':Sequelize[_0x28ae('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x28ae('0x4')]},'leaveAt':{'type':Sequelize[_0x28ae('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x28ae('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 9d5030d..4a2c6ee 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 _0x2cd0=['status','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','ChatQueueReport','rawAttributes','type','key','model','keys','filters','query','attributes','intersection','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','fields','find','catch','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count'];(function(_0x5b8b3d,_0x2200f0){var _0x47d2c7=function(_0x12faa6){while(--_0x12faa6){_0x5b8b3d['push'](_0x5b8b3d['shift']());}};_0x47d2c7(++_0x2200f0);}(_0x2cd0,0x10f));var _0x02cd=function(_0xfd5211,_0x490686){_0xfd5211=_0xfd5211-0x0;var _0x19797d=_0x2cd0[_0xfd5211];return _0x19797d;};'use strict';var emlformat=require(_0x02cd('0x0'));var rimraf=require(_0x02cd('0x1'));var zipdir=require(_0x02cd('0x2'));var jsonpatch=require(_0x02cd('0x3'));var rp=require(_0x02cd('0x4'));var moment=require(_0x02cd('0x5'));var BPromise=require(_0x02cd('0x6'));var Mustache=require(_0x02cd('0x7'));var util=require('util');var path=require(_0x02cd('0x8'));var sox=require(_0x02cd('0x9'));var csv=require(_0x02cd('0xa'));var ejs=require(_0x02cd('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x02cd('0xc'));var squel=require(_0x02cd('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x02cd('0xa'));var querystring=require(_0x02cd('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x02cd('0xf'));var qs=require(_0x02cd('0x10'));var as=require(_0x02cd('0x11'));var hardwareService=require(_0x02cd('0x12'));var logger=require(_0x02cd('0x13'))(_0x02cd('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x02cd('0x15'));var db=require(_0x02cd('0x16'))['db'];function respondWithStatusCode(_0x1bce6c,_0x1c5e82){_0x1c5e82=_0x1c5e82||0xcc;return function(_0x111dc6){if(_0x111dc6){return _0x1bce6c[_0x02cd('0x17')](_0x1c5e82);}return _0x1bce6c['status'](_0x1c5e82)[_0x02cd('0x18')]();};}function respondWithResult(_0x52bbe6,_0x203e9d){_0x203e9d=_0x203e9d||0xc8;return function(_0x583620){if(_0x583620){return _0x52bbe6['status'](_0x203e9d)['json'](_0x583620);}};}function respondWithFilteredResult(_0x24043b,_0x2cda2c){return function(_0x308ee3){if(_0x308ee3){var _0x15b6fe=typeof _0x2cda2c[_0x02cd('0x19')]===_0x02cd('0x1a')&&typeof _0x2cda2c[_0x02cd('0x1b')]===_0x02cd('0x1a');var _0xb4115c=_0x308ee3[_0x02cd('0x1c')];var _0x18c522=_0x15b6fe?0x0:_0x2cda2c[_0x02cd('0x19')];var _0xb57985=_0x15b6fe?_0x308ee3[_0x02cd('0x1c')]:_0x2cda2c[_0x02cd('0x19')]+_0x2cda2c[_0x02cd('0x1b')];var _0x4f448b;if(_0xb57985>=_0xb4115c){_0xb57985=_0xb4115c;_0x4f448b=0xc8;}else{_0x4f448b=0xce;}_0x24043b[_0x02cd('0x1d')](_0x4f448b);return _0x24043b[_0x02cd('0x1e')](_0x02cd('0x1f'),_0x18c522+'-'+_0xb57985+'/'+_0xb4115c)[_0x02cd('0x20')](_0x308ee3);}return null;};}function patchUpdates(_0x822204){return function(_0x33fb48){try{jsonpatch[_0x02cd('0x21')](_0x33fb48,_0x822204,!![]);}catch(_0xd6cc59){return BPromise[_0x02cd('0x22')](_0xd6cc59);}return _0x33fb48[_0x02cd('0x23')]();};}function saveUpdates(_0x1736be,_0x54453c){return function(_0x2b9809){if(_0x2b9809){return _0x2b9809[_0x02cd('0x24')](_0x1736be)[_0x02cd('0x25')](function(_0x2fb5af){return _0x2fb5af;});}return null;};}function removeEntity(_0x47dc25,_0x28f678){return function(_0x4e127f){if(_0x4e127f){return _0x4e127f[_0x02cd('0x26')]()[_0x02cd('0x25')](function(){_0x47dc25[_0x02cd('0x1d')](0xcc)[_0x02cd('0x18')]();});}};}function handleEntityNotFound(_0x40e7fa,_0x194c7e){return function(_0x3fd0b0){if(!_0x3fd0b0){_0x40e7fa['sendStatus'](0x194);}return _0x3fd0b0;};}function handleError(_0x134961,_0x1fce0c){_0x1fce0c=_0x1fce0c||0x1f4;return function(_0x51d6a2){logger[_0x02cd('0x27')](_0x51d6a2['stack']);if(_0x51d6a2[_0x02cd('0x28')]){delete _0x51d6a2[_0x02cd('0x28')];}_0x134961[_0x02cd('0x1d')](_0x1fce0c)[_0x02cd('0x29')](_0x51d6a2);};}exports[_0x02cd('0x2a')]=function(_0x205ee7,_0x16872f){var _0x256cb5={},_0x4adfb2={},_0x55c97b={'count':0x0,'rows':[]};var _0x87feaf=_[_0x02cd('0x2b')](db[_0x02cd('0x2c')][_0x02cd('0x2d')],function(_0x5f5283){return{'name':_0x5f5283['fieldName'],'type':_0x5f5283[_0x02cd('0x2e')][_0x02cd('0x2f')]};});_0x4adfb2[_0x02cd('0x30')]=_['map'](_0x87feaf,_0x02cd('0x28'));_0x4adfb2['query']=_[_0x02cd('0x31')](_0x205ee7['query']);_0x4adfb2[_0x02cd('0x32')]=_['intersection'](_0x4adfb2[_0x02cd('0x30')],_0x4adfb2[_0x02cd('0x33')]);_0x256cb5[_0x02cd('0x34')]=_[_0x02cd('0x35')](_0x4adfb2[_0x02cd('0x30')],qs['fields'](_0x205ee7[_0x02cd('0x33')]['fields']));_0x256cb5['attributes']=_0x256cb5[_0x02cd('0x34')][_0x02cd('0x36')]?_0x256cb5[_0x02cd('0x34')]:_0x4adfb2[_0x02cd('0x30')];if(!_0x205ee7['query']['hasOwnProperty'](_0x02cd('0x37'))){_0x256cb5[_0x02cd('0x1b')]=qs[_0x02cd('0x1b')](_0x205ee7[_0x02cd('0x33')][_0x02cd('0x1b')]);_0x256cb5[_0x02cd('0x19')]=qs[_0x02cd('0x19')](_0x205ee7['query'][_0x02cd('0x19')]);}_0x256cb5[_0x02cd('0x38')]=qs[_0x02cd('0x39')](_0x205ee7[_0x02cd('0x33')][_0x02cd('0x39')]);_0x256cb5[_0x02cd('0x3a')]=qs[_0x02cd('0x32')](_[_0x02cd('0x3b')](_0x205ee7[_0x02cd('0x33')],_0x4adfb2['filters']),_0x87feaf);if(_0x205ee7[_0x02cd('0x33')][_0x02cd('0x3c')]){_0x256cb5[_0x02cd('0x3a')]=_[_0x02cd('0x3d')](_0x256cb5[_0x02cd('0x3a')],{'$or':_[_0x02cd('0x2b')](_0x87feaf,function(_0x386cfa){if(_0x386cfa[_0x02cd('0x2e')]!==_0x02cd('0x3e')){var _0x16a1d3={};_0x16a1d3[_0x386cfa[_0x02cd('0x28')]]={'$like':'%'+_0x205ee7[_0x02cd('0x33')]['filter']+'%'};return _0x16a1d3;}})});}_0x256cb5=_[_0x02cd('0x3d')]({},_0x256cb5,_0x205ee7[_0x02cd('0x3f')]);var _0x4f185a={'where':_0x256cb5[_0x02cd('0x3a')]};return db['ChatQueueReport'][_0x02cd('0x1c')](_0x4f185a)[_0x02cd('0x25')](function(_0x9b65f4){_0x55c97b[_0x02cd('0x1c')]=_0x9b65f4;if(_0x205ee7[_0x02cd('0x33')][_0x02cd('0x40')]){_0x256cb5[_0x02cd('0x41')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x02cd('0x42')](_0x256cb5);})[_0x02cd('0x25')](function(_0x248f84){_0x55c97b[_0x02cd('0x43')]=_0x248f84;return _0x55c97b;})[_0x02cd('0x25')](respondWithFilteredResult(_0x16872f,_0x256cb5))['catch'](handleError(_0x16872f,null));};exports[_0x02cd('0x44')]=function(_0x180198,_0x5bae08){var _0x1abc13={'raw':!![],'where':{'id':_0x180198[_0x02cd('0x45')]['id']}},_0xdf71cf={};_0xdf71cf[_0x02cd('0x30')]=_[_0x02cd('0x31')](db['ChatQueueReport'][_0x02cd('0x2d')]);_0xdf71cf['query']=_[_0x02cd('0x31')](_0x180198[_0x02cd('0x33')]);_0xdf71cf[_0x02cd('0x32')]=_[_0x02cd('0x35')](_0xdf71cf['model'],_0xdf71cf[_0x02cd('0x33')]);_0x1abc13[_0x02cd('0x34')]=_[_0x02cd('0x35')](_0xdf71cf[_0x02cd('0x30')],qs[_0x02cd('0x46')](_0x180198[_0x02cd('0x33')]['fields']));_0x1abc13[_0x02cd('0x34')]=_0x1abc13[_0x02cd('0x34')][_0x02cd('0x36')]?_0x1abc13['attributes']:_0xdf71cf[_0x02cd('0x30')];if(_0x180198[_0x02cd('0x33')]['includeAll']){_0x1abc13['include']=[{'all':!![]}];}_0x1abc13=_[_0x02cd('0x3d')]({},_0x1abc13,_0x180198[_0x02cd('0x3f')]);return db[_0x02cd('0x2c')][_0x02cd('0x47')](_0x1abc13)[_0x02cd('0x25')](handleEntityNotFound(_0x5bae08,null))['then'](respondWithResult(_0x5bae08,null))[_0x02cd('0x48')](handleError(_0x5bae08,null));};exports['create']=function(_0x424c75,_0x1d91ca){return db[_0x02cd('0x2c')]['create'](_0x424c75[_0x02cd('0x49')],{})[_0x02cd('0x25')](respondWithResult(_0x1d91ca,0xc9))[_0x02cd('0x48')](handleError(_0x1d91ca,null));};exports[_0x02cd('0x24')]=function(_0x2be2f2,_0x25d6b9){if(_0x2be2f2[_0x02cd('0x49')]['id']){delete _0x2be2f2[_0x02cd('0x49')]['id'];}return db[_0x02cd('0x2c')][_0x02cd('0x47')]({'where':{'id':_0x2be2f2['params']['id']}})[_0x02cd('0x25')](handleEntityNotFound(_0x25d6b9,null))[_0x02cd('0x25')](saveUpdates(_0x2be2f2[_0x02cd('0x49')],null))[_0x02cd('0x25')](respondWithResult(_0x25d6b9,null))[_0x02cd('0x48')](handleError(_0x25d6b9,null));};exports['destroy']=function(_0x4dbb43,_0x203066){return db['ChatQueueReport'][_0x02cd('0x47')]({'where':{'id':_0x4dbb43[_0x02cd('0x45')]['id']}})[_0x02cd('0x25')](handleEntityNotFound(_0x203066,null))[_0x02cd('0x25')](removeEntity(_0x203066,null))['catch'](handleError(_0x203066,null));};exports[_0x02cd('0x4a')]=function(_0x10b1c1,_0x447f84){return db[_0x02cd('0x2c')]['describe']()[_0x02cd('0x25')](respondWithResult(_0x447f84,null))['catch'](handleError(_0x447f84,null));};
\ No newline at end of file
+var _0xc319=['zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','then','destroy','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options','ChatQueueReport','includeAll','include','findAll','rows','show','params','catch','create','update','find','body','describe','eml-format','rimraf'];(function(_0x49b934,_0x5c1416){var _0xea4057=function(_0x4c2ee6){while(--_0x4c2ee6){_0x49b934['push'](_0x49b934['shift']());}};_0xea4057(++_0x5c1416);}(_0xc319,0x12e));var _0x9c31=function(_0x3f9b76,_0x26dff1){_0x3f9b76=_0x3f9b76-0x0;var _0x2ce80a=_0xc319[_0x3f9b76];return _0x2ce80a;};'use strict';var emlformat=require(_0x9c31('0x0'));var rimraf=require(_0x9c31('0x1'));var zipdir=require(_0x9c31('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9c31('0x3'));var moment=require(_0x9c31('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9c31('0x5'));var util=require(_0x9c31('0x6'));var path=require(_0x9c31('0x7'));var sox=require(_0x9c31('0x8'));var csv=require('to-csv');var ejs=require(_0x9c31('0x9'));var fs=require('fs');var fs_extra=require(_0x9c31('0xa'));var _=require(_0x9c31('0xb'));var squel=require(_0x9c31('0xc'));var crypto=require(_0x9c31('0xd'));var jsforce=require(_0x9c31('0xe'));var deskjs=require(_0x9c31('0xf'));var toCsv=require(_0x9c31('0x10'));var querystring=require(_0x9c31('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9c31('0x12'));var as=require(_0x9c31('0x13'));var hardwareService=require(_0x9c31('0x14'));var logger=require(_0x9c31('0x15'))(_0x9c31('0x16'));var utils=require('../../config/utils');var config=require(_0x9c31('0x17'));var licenseUtil=require(_0x9c31('0x18'));var db=require(_0x9c31('0x19'))['db'];function respondWithStatusCode(_0x4d0175,_0x2012b1){_0x2012b1=_0x2012b1||0xcc;return function(_0x30fc7f){if(_0x30fc7f){return _0x4d0175[_0x9c31('0x1a')](_0x2012b1);}return _0x4d0175[_0x9c31('0x1b')](_0x2012b1)[_0x9c31('0x1c')]();};}function respondWithResult(_0x4d9601,_0x52037f){_0x52037f=_0x52037f||0xc8;return function(_0x513815){if(_0x513815){return _0x4d9601['status'](_0x52037f)['json'](_0x513815);}};}function respondWithFilteredResult(_0x13ba85,_0xb2e9b9){return function(_0x57a4ff){if(_0x57a4ff){var _0x3df9ad=typeof _0xb2e9b9[_0x9c31('0x1d')]===_0x9c31('0x1e')&&typeof _0xb2e9b9[_0x9c31('0x1f')]===_0x9c31('0x1e');var _0x5eec43=_0x57a4ff[_0x9c31('0x20')];var _0x47b5a7=_0x3df9ad?0x0:_0xb2e9b9[_0x9c31('0x1d')];var _0x4aacad=_0x3df9ad?_0x57a4ff[_0x9c31('0x20')]:_0xb2e9b9['offset']+_0xb2e9b9[_0x9c31('0x1f')];var _0x3ae089;if(_0x4aacad>=_0x5eec43){_0x4aacad=_0x5eec43;_0x3ae089=0xc8;}else{_0x3ae089=0xce;}_0x13ba85[_0x9c31('0x1b')](_0x3ae089);return _0x13ba85['set'](_0x9c31('0x21'),_0x47b5a7+'-'+_0x4aacad+'/'+_0x5eec43)[_0x9c31('0x22')](_0x57a4ff);}return null;};}function patchUpdates(_0x417360){return function(_0x4f8363){try{jsonpatch[_0x9c31('0x23')](_0x4f8363,_0x417360,!![]);}catch(_0x34eca6){return BPromise['reject'](_0x34eca6);}return _0x4f8363[_0x9c31('0x24')]();};}function saveUpdates(_0x297bc0,_0x316917){return function(_0x9fb534){if(_0x9fb534){return _0x9fb534['update'](_0x297bc0)[_0x9c31('0x25')](function(_0x3f66ee){return _0x3f66ee;});}return null;};}function removeEntity(_0x456d29,_0x438a05){return function(_0x3cfeba){if(_0x3cfeba){return _0x3cfeba[_0x9c31('0x26')]()[_0x9c31('0x25')](function(){_0x456d29['status'](0xcc)[_0x9c31('0x1c')]();});}};}function handleEntityNotFound(_0x1b9600,_0x2b9cd2){return function(_0x28297e){if(!_0x28297e){_0x1b9600[_0x9c31('0x1a')](0x194);}return _0x28297e;};}function handleError(_0x3a9b00,_0x5206c2){_0x5206c2=_0x5206c2||0x1f4;return function(_0x183916){logger['error'](_0x183916['stack']);if(_0x183916[_0x9c31('0x27')]){delete _0x183916[_0x9c31('0x27')];}_0x3a9b00[_0x9c31('0x1b')](_0x5206c2)[_0x9c31('0x28')](_0x183916);};}exports['index']=function(_0xa43ac0,_0x1273dd){var _0x30e8c3={},_0x2f7208={},_0x294039={'count':0x0,'rows':[]};var _0x8f7f55=_[_0x9c31('0x29')](db['ChatQueueReport'][_0x9c31('0x2a')],function(_0x2acfca){return{'name':_0x2acfca[_0x9c31('0x2b')],'type':_0x2acfca[_0x9c31('0x2c')][_0x9c31('0x2d')]};});_0x2f7208[_0x9c31('0x2e')]=_[_0x9c31('0x29')](_0x8f7f55,_0x9c31('0x27'));_0x2f7208[_0x9c31('0x2f')]=_[_0x9c31('0x30')](_0xa43ac0[_0x9c31('0x2f')]);_0x2f7208[_0x9c31('0x31')]=_[_0x9c31('0x32')](_0x2f7208['model'],_0x2f7208['query']);_0x30e8c3[_0x9c31('0x33')]=_[_0x9c31('0x32')](_0x2f7208[_0x9c31('0x2e')],qs[_0x9c31('0x34')](_0xa43ac0['query'][_0x9c31('0x34')]));_0x30e8c3[_0x9c31('0x33')]=_0x30e8c3[_0x9c31('0x33')][_0x9c31('0x35')]?_0x30e8c3[_0x9c31('0x33')]:_0x2f7208[_0x9c31('0x2e')];if(!_0xa43ac0[_0x9c31('0x2f')][_0x9c31('0x36')]('nolimit')){_0x30e8c3[_0x9c31('0x1f')]=qs[_0x9c31('0x1f')](_0xa43ac0[_0x9c31('0x2f')]['limit']);_0x30e8c3[_0x9c31('0x1d')]=qs[_0x9c31('0x1d')](_0xa43ac0[_0x9c31('0x2f')]['offset']);}_0x30e8c3[_0x9c31('0x37')]=qs[_0x9c31('0x38')](_0xa43ac0['query']['sort']);_0x30e8c3[_0x9c31('0x39')]=qs[_0x9c31('0x31')](_[_0x9c31('0x3a')](_0xa43ac0[_0x9c31('0x2f')],_0x2f7208[_0x9c31('0x31')]),_0x8f7f55);if(_0xa43ac0[_0x9c31('0x2f')]['filter']){_0x30e8c3[_0x9c31('0x39')]=_['merge'](_0x30e8c3[_0x9c31('0x39')],{'$or':_[_0x9c31('0x29')](_0x8f7f55,function(_0xc52dbd){if(_0xc52dbd[_0x9c31('0x2c')]!==_0x9c31('0x3b')){var _0x393439={};_0x393439[_0xc52dbd['name']]={'$like':'%'+_0xa43ac0['query'][_0x9c31('0x3c')]+'%'};return _0x393439;}})});}_0x30e8c3=_[_0x9c31('0x3d')]({},_0x30e8c3,_0xa43ac0[_0x9c31('0x3e')]);var _0x3939a9={'where':_0x30e8c3[_0x9c31('0x39')]};return db[_0x9c31('0x3f')][_0x9c31('0x20')](_0x3939a9)[_0x9c31('0x25')](function(_0x2bb1ab){_0x294039['count']=_0x2bb1ab;if(_0xa43ac0[_0x9c31('0x2f')][_0x9c31('0x40')]){_0x30e8c3[_0x9c31('0x41')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x9c31('0x42')](_0x30e8c3);})[_0x9c31('0x25')](function(_0x315b43){_0x294039[_0x9c31('0x43')]=_0x315b43;return _0x294039;})[_0x9c31('0x25')](respondWithFilteredResult(_0x1273dd,_0x30e8c3))['catch'](handleError(_0x1273dd,null));};exports[_0x9c31('0x44')]=function(_0xd294a4,_0x2805ea){var _0x592fce={'raw':!![],'where':{'id':_0xd294a4[_0x9c31('0x45')]['id']}},_0x424c2a={};_0x424c2a[_0x9c31('0x2e')]=_[_0x9c31('0x30')](db[_0x9c31('0x3f')][_0x9c31('0x2a')]);_0x424c2a[_0x9c31('0x2f')]=_['keys'](_0xd294a4['query']);_0x424c2a[_0x9c31('0x31')]=_[_0x9c31('0x32')](_0x424c2a[_0x9c31('0x2e')],_0x424c2a[_0x9c31('0x2f')]);_0x592fce[_0x9c31('0x33')]=_['intersection'](_0x424c2a['model'],qs[_0x9c31('0x34')](_0xd294a4[_0x9c31('0x2f')][_0x9c31('0x34')]));_0x592fce[_0x9c31('0x33')]=_0x592fce[_0x9c31('0x33')][_0x9c31('0x35')]?_0x592fce[_0x9c31('0x33')]:_0x424c2a[_0x9c31('0x2e')];if(_0xd294a4['query'][_0x9c31('0x40')]){_0x592fce['include']=[{'all':!![]}];}_0x592fce=_['merge']({},_0x592fce,_0xd294a4[_0x9c31('0x3e')]);return db[_0x9c31('0x3f')]['find'](_0x592fce)['then'](handleEntityNotFound(_0x2805ea,null))[_0x9c31('0x25')](respondWithResult(_0x2805ea,null))[_0x9c31('0x46')](handleError(_0x2805ea,null));};exports[_0x9c31('0x47')]=function(_0x527057,_0x1dda1c){return db[_0x9c31('0x3f')][_0x9c31('0x47')](_0x527057['body'],{})[_0x9c31('0x25')](respondWithResult(_0x1dda1c,0xc9))[_0x9c31('0x46')](handleError(_0x1dda1c,null));};exports[_0x9c31('0x48')]=function(_0x25cb3d,_0x468b87){if(_0x25cb3d['body']['id']){delete _0x25cb3d['body']['id'];}return db[_0x9c31('0x3f')][_0x9c31('0x49')]({'where':{'id':_0x25cb3d[_0x9c31('0x45')]['id']}})['then'](handleEntityNotFound(_0x468b87,null))[_0x9c31('0x25')](saveUpdates(_0x25cb3d[_0x9c31('0x4a')],null))['then'](respondWithResult(_0x468b87,null))[_0x9c31('0x46')](handleError(_0x468b87,null));};exports[_0x9c31('0x26')]=function(_0x36faca,_0x13e8f8){return db['ChatQueueReport']['find']({'where':{'id':_0x36faca[_0x9c31('0x45')]['id']}})['then'](handleEntityNotFound(_0x13e8f8,null))[_0x9c31('0x25')](removeEntity(_0x13e8f8,null))[_0x9c31('0x46')](handleError(_0x13e8f8,null));};exports['describe']=function(_0xa57aa9,_0x58ba63){return db['ChatQueueReport'][_0x9c31('0x4b')]()[_0x9c31('0x25')](respondWithResult(_0x58ba63,null))[_0x9c31('0x46')](handleError(_0x58ba63,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index ac92809..e2a6c8e 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(_0x48f7cf,_0x4baa04){var _0xc201c0=function(_0x23ff34){while(--_0x23ff34){_0x48f7cf['push'](_0x48f7cf['shift']());}};_0xc201c0(++_0x4baa04);}(_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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x1bb6aa,_0x40fe82){var _0x2ef28e=function(_0x32b4eb){while(--_0x32b4eb){_0x1bb6aa['push'](_0x1bb6aa['shift']());}};_0x2ef28e(++_0x40fe82);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index d7a67fa..78fdbd2 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 _0x38fb=['ChatQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ChatQueueReport','create','body','options','raw','CreateChatQueueReport','debug','UpdateChatQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','client','http','then','info'];(function(_0x55eedf,_0x343e2d){var _0x27c2a0=function(_0x3a1f57){while(--_0x3a1f57){_0x55eedf['push'](_0x55eedf['shift']());}};_0x27c2a0(++_0x343e2d);}(_0x38fb,0x74));var _0xb38f=function(_0x2891d1,_0x2ddd3e){_0x2891d1=_0x2891d1-0x0;var _0x486948=_0x38fb[_0x2891d1];return _0x486948;};'use strict';var _=require(_0xb38f('0x0'));var util=require(_0xb38f('0x1'));var moment=require(_0xb38f('0x2'));var BPromise=require(_0xb38f('0x3'));var rs=require(_0xb38f('0x4'));var fs=require('fs');var Redis=require(_0xb38f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb38f('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xb38f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb38f('0x8')][_0xb38f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50ab33,_0x528bae,_0x4f5164){return new BPromise(function(_0x158bad,_0x32d37f){return client['request'](_0x50ab33,_0x4f5164)[_0xb38f('0xa')](function(_0x4bfbac){logger[_0xb38f('0xb')](_0xb38f('0xc'),_0x528bae,_0xb38f('0xd'));logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x528bae,'request\x20sent',JSON[_0xb38f('0xe')](_0x4bfbac));if(_0x4bfbac[_0xb38f('0xf')]){if(_0x4bfbac[_0xb38f('0xf')][_0xb38f('0x10')]===0x1f4){logger['error'](_0xb38f('0xc'),_0x528bae,_0x4bfbac['error'][_0xb38f('0x11')]);return _0x32d37f(_0x4bfbac['error'][_0xb38f('0x11')]);}logger[_0xb38f('0xf')](_0xb38f('0xc'),_0x528bae,_0x4bfbac[_0xb38f('0xf')][_0xb38f('0x11')]);return _0x158bad(_0x4bfbac[_0xb38f('0xf')][_0xb38f('0x11')]);}else{logger[_0xb38f('0xb')](_0xb38f('0xc'),_0x528bae,_0xb38f('0xd'));_0x158bad(_0x4bfbac[_0xb38f('0x12')][_0xb38f('0x11')]);}})[_0xb38f('0x13')](function(_0x47ecf5){logger[_0xb38f('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x528bae,_0x47ecf5);_0x32d37f(_0x47ecf5);});});}exports['CreateChatQueueReport']=function(_0x25dc8e){var _0x15c334=this;return new Promise(function(_0xc82bed,_0x19ce6d){return db[_0xb38f('0x14')][_0xb38f('0x15')](_0x25dc8e[_0xb38f('0x16')],{'raw':_0x25dc8e[_0xb38f('0x17')]?_0x25dc8e[_0xb38f('0x17')][_0xb38f('0x18')]===undefined?!![]:![]:!![]})[_0xb38f('0xa')](function(_0x3a6f29){logger[_0xb38f('0xb')](_0xb38f('0x19'),_0x25dc8e);logger[_0xb38f('0x1a')](_0xb38f('0x19'),_0x25dc8e,JSON['stringify'](_0x3a6f29));_0xc82bed(_0x3a6f29);})['catch'](function(_0x5ac11f){logger[_0xb38f('0xf')](_0xb38f('0x19'),_0x5ac11f[_0xb38f('0x11')],_0x25dc8e);_0x19ce6d(_0x15c334[_0xb38f('0xf')](0x1f4,_0x5ac11f[_0xb38f('0x11')]));});});};exports[_0xb38f('0x1b')]=function(_0x41881b){var _0x739b7f=this;return new Promise(function(_0x5823fa,_0x32c12a){return db[_0xb38f('0x14')][_0xb38f('0x1c')](_0x41881b[_0xb38f('0x16')],{'raw':_0x41881b[_0xb38f('0x17')]?_0x41881b[_0xb38f('0x17')][_0xb38f('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41881b[_0xb38f('0x17')]?_0x41881b[_0xb38f('0x17')][_0xb38f('0x1d')]||null:null,'attributes':_0x41881b[_0xb38f('0x17')]?_0x41881b[_0xb38f('0x17')][_0xb38f('0x1e')]||null:null,'limit':_0x41881b[_0xb38f('0x17')]?_0x41881b['options'][_0xb38f('0x1f')]||null:null})[_0xb38f('0xa')](function(_0x2628bc){logger[_0xb38f('0xb')](_0xb38f('0x1b'),_0x41881b);logger[_0xb38f('0x1a')]('UpdateChatQueueReport',_0x41881b,JSON[_0xb38f('0xe')](_0x2628bc));_0x5823fa(_0x2628bc);})[_0xb38f('0x13')](function(_0x3d12fe){logger['error'](_0xb38f('0x1b'),_0x3d12fe[_0xb38f('0x11')],_0x41881b);_0x32c12a(_0x739b7f['error'](0x1f4,_0x3d12fe[_0xb38f('0x11')]));});});};
\ No newline at end of file
+var _0x11ec=['../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','ChatQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CreateChatQueueReport','create','body','options','raw','UpdateChatQueueReport','update','where','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x386d7a,_0x3092ee){var _0x3855bf=function(_0x34be95){while(--_0x34be95){_0x386d7a['push'](_0x386d7a['shift']());}};_0x3855bf(++_0x3092ee);}(_0x11ec,0x126));var _0xc11e=function(_0x3fc97b,_0x20ca29){_0x3fc97b=_0x3fc97b-0x0;var _0x3a0c82=_0x11ec[_0x3fc97b];return _0x3a0c82;};'use strict';var _=require(_0xc11e('0x0'));var util=require(_0xc11e('0x1'));var moment=require(_0xc11e('0x2'));var BPromise=require('bluebird');var rs=require(_0xc11e('0x3'));var fs=require('fs');var Redis=require(_0xc11e('0x4'));var db=require(_0xc11e('0x5'))['db'];var utils=require(_0xc11e('0x6'));var logger=require('../../config/logger')(_0xc11e('0x7'));var config=require(_0xc11e('0x8'));var jayson=require(_0xc11e('0x9'));var client=jayson['client'][_0xc11e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4fb825,_0x27d813,_0x4a03bc){return new BPromise(function(_0x47c774,_0x3f433a){return client['request'](_0x4fb825,_0x4a03bc)[_0xc11e('0xb')](function(_0x5b80c0){logger[_0xc11e('0xc')](_0xc11e('0xd'),_0x27d813,'request\x20sent');logger[_0xc11e('0xe')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x27d813,'request\x20sent',JSON[_0xc11e('0xf')](_0x5b80c0));if(_0x5b80c0[_0xc11e('0x10')]){if(_0x5b80c0[_0xc11e('0x10')][_0xc11e('0x11')]===0x1f4){logger[_0xc11e('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x27d813,_0x5b80c0[_0xc11e('0x10')][_0xc11e('0x12')]);return _0x3f433a(_0x5b80c0[_0xc11e('0x10')]['message']);}logger['error'](_0xc11e('0xd'),_0x27d813,_0x5b80c0['error']['message']);return _0x47c774(_0x5b80c0[_0xc11e('0x10')]['message']);}else{logger[_0xc11e('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x27d813,_0xc11e('0x13'));_0x47c774(_0x5b80c0[_0xc11e('0x14')][_0xc11e('0x12')]);}})[_0xc11e('0x15')](function(_0x45a936){logger[_0xc11e('0x10')](_0xc11e('0xd'),_0x27d813,_0x45a936);_0x3f433a(_0x45a936);});});}exports[_0xc11e('0x16')]=function(_0x4fec77){var _0x286787=this;return new Promise(function(_0x49e483,_0x24ea22){return db['ChatQueueReport'][_0xc11e('0x17')](_0x4fec77[_0xc11e('0x18')],{'raw':_0x4fec77[_0xc11e('0x19')]?_0x4fec77[_0xc11e('0x19')][_0xc11e('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x177087){logger['info']('CreateChatQueueReport',_0x4fec77);logger['debug'](_0xc11e('0x16'),_0x4fec77,JSON['stringify'](_0x177087));_0x49e483(_0x177087);})[_0xc11e('0x15')](function(_0xe8c31d){logger['error'](_0xc11e('0x16'),_0xe8c31d[_0xc11e('0x12')],_0x4fec77);_0x24ea22(_0x286787['error'](0x1f4,_0xe8c31d[_0xc11e('0x12')]));});});};exports[_0xc11e('0x1b')]=function(_0x21b49f){var _0x1bf2fb=this;return new Promise(function(_0x10c6f7,_0x34bf00){return db['ChatQueueReport'][_0xc11e('0x1c')](_0x21b49f[_0xc11e('0x18')],{'raw':_0x21b49f[_0xc11e('0x19')]?_0x21b49f[_0xc11e('0x19')][_0xc11e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21b49f[_0xc11e('0x19')]?_0x21b49f['options'][_0xc11e('0x1d')]||null:null,'attributes':_0x21b49f[_0xc11e('0x19')]?_0x21b49f['options']['attributes']||null:null,'limit':_0x21b49f[_0xc11e('0x19')]?_0x21b49f['options']['limit']||null:null})[_0xc11e('0xb')](function(_0x17a8d0){logger[_0xc11e('0xc')](_0xc11e('0x1b'),_0x21b49f);logger['debug'](_0xc11e('0x1b'),_0x21b49f,JSON[_0xc11e('0xf')](_0x17a8d0));_0x10c6f7(_0x17a8d0);})['catch'](function(_0xdf009e){logger[_0xc11e('0x10')](_0xc11e('0x1b'),_0xdf009e[_0xc11e('0x12')],_0x21b49f);_0x34bf00(_0x1bf2fb[_0xc11e('0x10')](0x1f4,_0xdf009e[_0xc11e('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index efaeb80..144bc89 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 _0x1cdf=['delete','/:id','destroy','exports','multer','path','Router','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','index','describe','get','isAuthenticated','show','post','create','put'];(function(_0x3e299b,_0x66d53b){var _0x5475f9=function(_0x45ebe8){while(--_0x45ebe8){_0x3e299b['push'](_0x3e299b['shift']());}};_0x5475f9(++_0x66d53b);}(_0x1cdf,0x16c));var _0xf1cd=function(_0x3d8483,_0x3823a3){_0x3d8483=_0x3d8483-0x0;var _0x32b7f4=_0x1cdf[_0x3d8483];return _0x32b7f4;};'use strict';var multer=require(_0xf1cd('0x0'));var util=require('util');var path=require(_0xf1cd('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf1cd('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf1cd('0x3'));var config=require(_0xf1cd('0x4'));var controller=require(_0xf1cd('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xf1cd('0x6')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xf1cd('0x7')]);router[_0xf1cd('0x8')]('/:id',auth[_0xf1cd('0x9')](),controller[_0xf1cd('0xa')]);router[_0xf1cd('0xb')]('/',auth[_0xf1cd('0x9')](),controller[_0xf1cd('0xc')]);router[_0xf1cd('0xd')]('/:id',auth[_0xf1cd('0x9')](),controller['update']);router[_0xf1cd('0xe')](_0xf1cd('0xf'),auth[_0xf1cd('0x9')](),controller[_0xf1cd('0x10')]);module[_0xf1cd('0x11')]=router;
\ No newline at end of file
+var _0x2449=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','destroy'];(function(_0x22908e,_0x8c7aeb){var _0x4ac32e=function(_0x4c5ed6){while(--_0x4c5ed6){_0x22908e['push'](_0x22908e['shift']());}};_0x4ac32e(++_0x8c7aeb);}(_0x2449,0x168));var _0x9244=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2449[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9244('0x0'));var timeout=require(_0x9244('0x1'));var express=require(_0x9244('0x2'));var router=express[_0x9244('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9244('0x4'));var interaction=require(_0x9244('0x5'));var config=require(_0x9244('0x6'));var controller=require(_0x9244('0x7'));router[_0x9244('0x8')]('/',auth[_0x9244('0x9')](),controller[_0x9244('0xa')]);router[_0x9244('0x8')](_0x9244('0xb'),auth[_0x9244('0x9')](),controller['describe']);router[_0x9244('0x8')](_0x9244('0xc'),auth[_0x9244('0x9')](),controller[_0x9244('0xd')]);router[_0x9244('0xe')]('/',auth[_0x9244('0x9')](),controller[_0x9244('0xf')]);router[_0x9244('0x10')]('/:id',auth[_0x9244('0x9')](),controller['update']);router['delete'](_0x9244('0xc'),auth['isAuthenticated'](),controller[_0x9244('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index c503ed0..e9ca36a 100644
--- a/server/api/chatTransferReport/chatTransferReport.attributes.js
+++ b/server/api/chatTransferReport/chatTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x3edeba,_0x1bac30){var _0x12e9b7=function(_0x2a610d){while(--_0x2a610d){_0x3edeba['push'](_0x3edeba['shift']());}};_0x12e9b7(++_0x1bac30);}(_0x00bb,0x1d8));var _0xb00b=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x00bb[_0x28947d];return _0x12d2ee;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}};
\ No newline at end of file
+var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x527365,_0x36fb3a){var _0x5de073=function(_0x52a251){while(--_0x52a251){_0x527365['push'](_0x527365['shift']());}};_0x5de073(++_0x36fb3a);}(_0x34e8,0x12c));var _0x834e=function(_0x245483,_0x1b92a6){_0x245483=_0x245483-0x0;var _0x4124f2=_0x34e8[_0x245483];return _0x4124f2;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 2fcc022..e901f2b 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 _0xeee3=['name','send','index','map','rawAttributes','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filter','merge','where','type','VIRTUAL','options','ChatTransferReport','include','rows','catch','show','params','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','apply','update','then','destroy','end','stack'];(function(_0x121cef,_0x22dd0c){var _0x4ef278=function(_0x241d7e){while(--_0x241d7e){_0x121cef['push'](_0x121cef['shift']());}};_0x4ef278(++_0x22dd0c);}(_0xeee3,0x146));var _0x3eee=function(_0x1c1225,_0x6ebf55){_0x1c1225=_0x1c1225-0x0;var _0x1bfc69=_0xeee3[_0x1c1225];return _0x1bfc69;};'use strict';var emlformat=require(_0x3eee('0x0'));var rimraf=require(_0x3eee('0x1'));var zipdir=require(_0x3eee('0x2'));var jsonpatch=require(_0x3eee('0x3'));var rp=require(_0x3eee('0x4'));var moment=require('moment');var BPromise=require(_0x3eee('0x5'));var Mustache=require(_0x3eee('0x6'));var util=require(_0x3eee('0x7'));var path=require(_0x3eee('0x8'));var sox=require(_0x3eee('0x9'));var csv=require('to-csv');var ejs=require(_0x3eee('0xa'));var fs=require('fs');var fs_extra=require(_0x3eee('0xb'));var _=require(_0x3eee('0xc'));var squel=require(_0x3eee('0xd'));var crypto=require('crypto');var jsforce=require(_0x3eee('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3eee('0xf'));var querystring=require('querystring');var Papa=require(_0x3eee('0x10'));var Redis=require(_0x3eee('0x11'));var authService=require(_0x3eee('0x12'));var qs=require(_0x3eee('0x13'));var as=require(_0x3eee('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3eee('0x15'))(_0x3eee('0x16'));var utils=require(_0x3eee('0x17'));var config=require(_0x3eee('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x3eee('0x19'))['db'];function respondWithStatusCode(_0x168adf,_0x50421c){_0x50421c=_0x50421c||0xcc;return function(_0x4f5423){if(_0x4f5423){return _0x168adf[_0x3eee('0x1a')](_0x50421c);}return _0x168adf[_0x3eee('0x1b')](_0x50421c)['end']();};}function respondWithResult(_0x367fcc,_0x564bc3){_0x564bc3=_0x564bc3||0xc8;return function(_0x81cedd){if(_0x81cedd){return _0x367fcc['status'](_0x564bc3)[_0x3eee('0x1c')](_0x81cedd);}};}function respondWithFilteredResult(_0x30e013,_0x155633){return function(_0xf9c74a){if(_0xf9c74a){var _0x2c7c55=typeof _0x155633[_0x3eee('0x1d')]===_0x3eee('0x1e')&&typeof _0x155633['limit']==='undefined';var _0x52c622=_0xf9c74a[_0x3eee('0x1f')];var _0x39a342=_0x2c7c55?0x0:_0x155633[_0x3eee('0x1d')];var _0x3db241=_0x2c7c55?_0xf9c74a[_0x3eee('0x1f')]:_0x155633[_0x3eee('0x1d')]+_0x155633['limit'];var _0x4390a6;if(_0x3db241>=_0x52c622){_0x3db241=_0x52c622;_0x4390a6=0xc8;}else{_0x4390a6=0xce;}_0x30e013[_0x3eee('0x1b')](_0x4390a6);return _0x30e013[_0x3eee('0x20')]('Content-Range',_0x39a342+'-'+_0x3db241+'/'+_0x52c622)[_0x3eee('0x1c')](_0xf9c74a);}return null;};}function patchUpdates(_0x1a383c){return function(_0x74a3b8){try{jsonpatch[_0x3eee('0x21')](_0x74a3b8,_0x1a383c,!![]);}catch(_0x278f05){return BPromise['reject'](_0x278f05);}return _0x74a3b8['save']();};}function saveUpdates(_0x4c946e,_0x165da6){return function(_0x3b2e49){if(_0x3b2e49){return _0x3b2e49[_0x3eee('0x22')](_0x4c946e)[_0x3eee('0x23')](function(_0x458eee){return _0x458eee;});}return null;};}function removeEntity(_0x34cf85,_0x160554){return function(_0xf46b3d){if(_0xf46b3d){return _0xf46b3d[_0x3eee('0x24')]()[_0x3eee('0x23')](function(){_0x34cf85['status'](0xcc)[_0x3eee('0x25')]();});}};}function handleEntityNotFound(_0x795b0,_0x3f49d2){return function(_0x2e2753){if(!_0x2e2753){_0x795b0['sendStatus'](0x194);}return _0x2e2753;};}function handleError(_0x4e9779,_0x3b5b89){_0x3b5b89=_0x3b5b89||0x1f4;return function(_0x52f37c){logger['error'](_0x52f37c[_0x3eee('0x26')]);if(_0x52f37c['name']){delete _0x52f37c[_0x3eee('0x27')];}_0x4e9779[_0x3eee('0x1b')](_0x3b5b89)[_0x3eee('0x28')](_0x52f37c);};}exports[_0x3eee('0x29')]=function(_0x44fa4b,_0x3401ae){var _0x1fe1fa={},_0x36cece={},_0x3c9feb={'count':0x0,'rows':[]};var _0x693677=_[_0x3eee('0x2a')](db['ChatTransferReport'][_0x3eee('0x2b')],function(_0xd94dfc){return{'name':_0xd94dfc['fieldName'],'type':_0xd94dfc['type'][_0x3eee('0x2c')]};});_0x36cece['model']=_['map'](_0x693677,_0x3eee('0x27'));_0x36cece[_0x3eee('0x2d')]=_[_0x3eee('0x2e')](_0x44fa4b['query']);_0x36cece[_0x3eee('0x2f')]=_['intersection'](_0x36cece[_0x3eee('0x30')],_0x36cece[_0x3eee('0x2d')]);_0x1fe1fa[_0x3eee('0x31')]=_['intersection'](_0x36cece[_0x3eee('0x30')],qs[_0x3eee('0x32')](_0x44fa4b[_0x3eee('0x2d')][_0x3eee('0x32')]));_0x1fe1fa[_0x3eee('0x31')]=_0x1fe1fa['attributes'][_0x3eee('0x33')]?_0x1fe1fa[_0x3eee('0x31')]:_0x36cece['model'];if(!_0x44fa4b[_0x3eee('0x2d')][_0x3eee('0x34')](_0x3eee('0x35'))){_0x1fe1fa[_0x3eee('0x36')]=qs[_0x3eee('0x36')](_0x44fa4b['query'][_0x3eee('0x36')]);_0x1fe1fa[_0x3eee('0x1d')]=qs[_0x3eee('0x1d')](_0x44fa4b[_0x3eee('0x2d')][_0x3eee('0x1d')]);}_0x1fe1fa[_0x3eee('0x37')]=qs[_0x3eee('0x38')](_0x44fa4b['query']['sort']);_0x1fe1fa['where']=qs[_0x3eee('0x2f')](_['pick'](_0x44fa4b['query'],_0x36cece[_0x3eee('0x2f')]),_0x693677);if(_0x44fa4b['query'][_0x3eee('0x39')]){_0x1fe1fa['where']=_[_0x3eee('0x3a')](_0x1fe1fa[_0x3eee('0x3b')],{'$or':_[_0x3eee('0x2a')](_0x693677,function(_0x3b9fb5){if(_0x3b9fb5[_0x3eee('0x3c')]!==_0x3eee('0x3d')){var _0x29caec={};_0x29caec[_0x3b9fb5[_0x3eee('0x27')]]={'$like':'%'+_0x44fa4b[_0x3eee('0x2d')][_0x3eee('0x39')]+'%'};return _0x29caec;}})});}_0x1fe1fa=_[_0x3eee('0x3a')]({},_0x1fe1fa,_0x44fa4b[_0x3eee('0x3e')]);var _0x3605a0={'where':_0x1fe1fa[_0x3eee('0x3b')]};return db[_0x3eee('0x3f')][_0x3eee('0x1f')](_0x3605a0)[_0x3eee('0x23')](function(_0x3881a9){_0x3c9feb['count']=_0x3881a9;if(_0x44fa4b['query']['includeAll']){_0x1fe1fa[_0x3eee('0x40')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x1fe1fa);})[_0x3eee('0x23')](function(_0x10a187){_0x3c9feb[_0x3eee('0x41')]=_0x10a187;return _0x3c9feb;})['then'](respondWithFilteredResult(_0x3401ae,_0x1fe1fa))[_0x3eee('0x42')](handleError(_0x3401ae,null));};exports[_0x3eee('0x43')]=function(_0x15aa89,_0x46918c){var _0x5502e3={'raw':!![],'where':{'id':_0x15aa89[_0x3eee('0x44')]['id']}},_0x48855f={};_0x48855f[_0x3eee('0x30')]=_[_0x3eee('0x2e')](db['ChatTransferReport'][_0x3eee('0x2b')]);_0x48855f[_0x3eee('0x2d')]=_[_0x3eee('0x2e')](_0x15aa89[_0x3eee('0x2d')]);_0x48855f[_0x3eee('0x2f')]=_['intersection'](_0x48855f[_0x3eee('0x30')],_0x48855f[_0x3eee('0x2d')]);_0x5502e3[_0x3eee('0x31')]=_['intersection'](_0x48855f[_0x3eee('0x30')],qs[_0x3eee('0x32')](_0x15aa89[_0x3eee('0x2d')]['fields']));_0x5502e3[_0x3eee('0x31')]=_0x5502e3[_0x3eee('0x31')][_0x3eee('0x33')]?_0x5502e3[_0x3eee('0x31')]:_0x48855f[_0x3eee('0x30')];if(_0x15aa89['query']['includeAll']){_0x5502e3[_0x3eee('0x40')]=[{'all':!![]}];}_0x5502e3=_[_0x3eee('0x3a')]({},_0x5502e3,_0x15aa89[_0x3eee('0x3e')]);return db[_0x3eee('0x3f')]['find'](_0x5502e3)[_0x3eee('0x23')](handleEntityNotFound(_0x46918c,null))[_0x3eee('0x23')](respondWithResult(_0x46918c,null))['catch'](handleError(_0x46918c,null));};exports[_0x3eee('0x45')]=function(_0x149b3a,_0x391621){return db[_0x3eee('0x3f')][_0x3eee('0x45')](_0x149b3a[_0x3eee('0x46')],{})[_0x3eee('0x23')](respondWithResult(_0x391621,0xc9))['catch'](handleError(_0x391621,null));};exports[_0x3eee('0x22')]=function(_0x2caae9,_0x3a72a1){if(_0x2caae9[_0x3eee('0x46')]['id']){delete _0x2caae9[_0x3eee('0x46')]['id'];}return db[_0x3eee('0x3f')][_0x3eee('0x47')]({'where':{'id':_0x2caae9[_0x3eee('0x44')]['id']}})[_0x3eee('0x23')](handleEntityNotFound(_0x3a72a1,null))[_0x3eee('0x23')](saveUpdates(_0x2caae9[_0x3eee('0x46')],null))[_0x3eee('0x23')](respondWithResult(_0x3a72a1,null))[_0x3eee('0x42')](handleError(_0x3a72a1,null));};exports[_0x3eee('0x24')]=function(_0x143131,_0x429441){return db[_0x3eee('0x3f')][_0x3eee('0x47')]({'where':{'id':_0x143131['params']['id']}})['then'](handleEntityNotFound(_0x429441,null))[_0x3eee('0x23')](removeEntity(_0x429441,null))[_0x3eee('0x42')](handleError(_0x429441,null));};exports['describe']=function(_0x5a11c0,_0x5e8567){return db['ChatTransferReport'][_0x3eee('0x48')]()['then'](respondWithResult(_0x5e8567,null))[_0x3eee('0x42')](handleError(_0x5e8567,null));};
\ No newline at end of file
+var _0x43f9=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','destroy','end','sendStatus','error','name','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','include','findAll','rows','catch','params','includeAll','options','create','body','find','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x43f9,0x82));var _0x943f=function(_0x212834,_0x4b200d){_0x212834=_0x212834-0x0;var _0x390773=_0x43f9[_0x212834];return _0x390773;};'use strict';var emlformat=require(_0x943f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x943f('0x1'));var jsonpatch=require(_0x943f('0x2'));var rp=require('request-promise');var moment=require(_0x943f('0x3'));var BPromise=require(_0x943f('0x4'));var Mustache=require(_0x943f('0x5'));var util=require(_0x943f('0x6'));var path=require(_0x943f('0x7'));var sox=require('sox');var csv=require(_0x943f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x943f('0x9'));var crypto=require('crypto');var jsforce=require(_0x943f('0xa'));var deskjs=require(_0x943f('0xb'));var toCsv=require(_0x943f('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x943f('0xc'));var authService=require(_0x943f('0xd'));var qs=require(_0x943f('0xe'));var as=require(_0x943f('0xf'));var hardwareService=require(_0x943f('0x10'));var logger=require(_0x943f('0x11'))(_0x943f('0x12'));var utils=require(_0x943f('0x13'));var config=require(_0x943f('0x14'));var licenseUtil=require(_0x943f('0x15'));var db=require(_0x943f('0x16'))['db'];function respondWithStatusCode(_0x246e40,_0x139d9c){_0x139d9c=_0x139d9c||0xcc;return function(_0x3bc435){if(_0x3bc435){return _0x246e40['sendStatus'](_0x139d9c);}return _0x246e40['status'](_0x139d9c)['end']();};}function respondWithResult(_0x525543,_0x5d77da){_0x5d77da=_0x5d77da||0xc8;return function(_0x1338d0){if(_0x1338d0){return _0x525543['status'](_0x5d77da)[_0x943f('0x17')](_0x1338d0);}};}function respondWithFilteredResult(_0x5e1e4d,_0x341c15){return function(_0x44409c){if(_0x44409c){var _0x5a89e0=typeof _0x341c15[_0x943f('0x18')]===_0x943f('0x19')&&typeof _0x341c15[_0x943f('0x1a')]===_0x943f('0x19');var _0x3d3886=_0x44409c[_0x943f('0x1b')];var _0x3c7aef=_0x5a89e0?0x0:_0x341c15[_0x943f('0x18')];var _0x4c2b5d=_0x5a89e0?_0x44409c[_0x943f('0x1b')]:_0x341c15['offset']+_0x341c15[_0x943f('0x1a')];var _0x4418e7;if(_0x4c2b5d>=_0x3d3886){_0x4c2b5d=_0x3d3886;_0x4418e7=0xc8;}else{_0x4418e7=0xce;}_0x5e1e4d[_0x943f('0x1c')](_0x4418e7);return _0x5e1e4d[_0x943f('0x1d')](_0x943f('0x1e'),_0x3c7aef+'-'+_0x4c2b5d+'/'+_0x3d3886)[_0x943f('0x17')](_0x44409c);}return null;};}function patchUpdates(_0x48256c){return function(_0x317370){try{jsonpatch[_0x943f('0x1f')](_0x317370,_0x48256c,!![]);}catch(_0x53b9aa){return BPromise[_0x943f('0x20')](_0x53b9aa);}return _0x317370['save']();};}function saveUpdates(_0x189334,_0x2c95bc){return function(_0x303627){if(_0x303627){return _0x303627[_0x943f('0x21')](_0x189334)[_0x943f('0x22')](function(_0xc6b089){return _0xc6b089;});}return null;};}function removeEntity(_0x8a89b1,_0x447043){return function(_0x3cc7f3){if(_0x3cc7f3){return _0x3cc7f3[_0x943f('0x23')]()['then'](function(){_0x8a89b1[_0x943f('0x1c')](0xcc)[_0x943f('0x24')]();});}};}function handleEntityNotFound(_0x488740,_0x2dfeb0){return function(_0x3ed9dc){if(!_0x3ed9dc){_0x488740[_0x943f('0x25')](0x194);}return _0x3ed9dc;};}function handleError(_0x1d17b9,_0x332a46){_0x332a46=_0x332a46||0x1f4;return function(_0x5b6117){logger[_0x943f('0x26')](_0x5b6117['stack']);if(_0x5b6117[_0x943f('0x27')]){delete _0x5b6117[_0x943f('0x27')];}_0x1d17b9[_0x943f('0x1c')](_0x332a46)['send'](_0x5b6117);};}exports[_0x943f('0x28')]=function(_0x1c2bfb,_0x38c11e){var _0xa2e45e={},_0x2899dd={},_0x114d2b={'count':0x0,'rows':[]};var _0x4b1ae6=_[_0x943f('0x29')](db[_0x943f('0x2a')][_0x943f('0x2b')],function(_0x53c5d4){return{'name':_0x53c5d4[_0x943f('0x2c')],'type':_0x53c5d4[_0x943f('0x2d')][_0x943f('0x2e')]};});_0x2899dd['model']=_['map'](_0x4b1ae6,_0x943f('0x27'));_0x2899dd[_0x943f('0x2f')]=_[_0x943f('0x30')](_0x1c2bfb[_0x943f('0x2f')]);_0x2899dd[_0x943f('0x31')]=_[_0x943f('0x32')](_0x2899dd[_0x943f('0x33')],_0x2899dd[_0x943f('0x2f')]);_0xa2e45e[_0x943f('0x34')]=_[_0x943f('0x32')](_0x2899dd[_0x943f('0x33')],qs[_0x943f('0x35')](_0x1c2bfb[_0x943f('0x2f')][_0x943f('0x35')]));_0xa2e45e[_0x943f('0x34')]=_0xa2e45e[_0x943f('0x34')][_0x943f('0x36')]?_0xa2e45e[_0x943f('0x34')]:_0x2899dd[_0x943f('0x33')];if(!_0x1c2bfb[_0x943f('0x2f')][_0x943f('0x37')](_0x943f('0x38'))){_0xa2e45e[_0x943f('0x1a')]=qs[_0x943f('0x1a')](_0x1c2bfb[_0x943f('0x2f')][_0x943f('0x1a')]);_0xa2e45e[_0x943f('0x18')]=qs[_0x943f('0x18')](_0x1c2bfb[_0x943f('0x2f')][_0x943f('0x18')]);}_0xa2e45e[_0x943f('0x39')]=qs[_0x943f('0x3a')](_0x1c2bfb['query']['sort']);_0xa2e45e[_0x943f('0x3b')]=qs[_0x943f('0x31')](_[_0x943f('0x3c')](_0x1c2bfb[_0x943f('0x2f')],_0x2899dd[_0x943f('0x31')]),_0x4b1ae6);if(_0x1c2bfb[_0x943f('0x2f')][_0x943f('0x3d')]){_0xa2e45e[_0x943f('0x3b')]=_[_0x943f('0x3e')](_0xa2e45e[_0x943f('0x3b')],{'$or':_[_0x943f('0x29')](_0x4b1ae6,function(_0x406b66){if(_0x406b66[_0x943f('0x2d')]!=='VIRTUAL'){var _0x5e2d9d={};_0x5e2d9d[_0x406b66[_0x943f('0x27')]]={'$like':'%'+_0x1c2bfb[_0x943f('0x2f')]['filter']+'%'};return _0x5e2d9d;}})});}_0xa2e45e=_[_0x943f('0x3e')]({},_0xa2e45e,_0x1c2bfb['options']);var _0x51a84f={'where':_0xa2e45e[_0x943f('0x3b')]};return db[_0x943f('0x2a')]['count'](_0x51a84f)[_0x943f('0x22')](function(_0x1cab65){_0x114d2b[_0x943f('0x1b')]=_0x1cab65;if(_0x1c2bfb[_0x943f('0x2f')]['includeAll']){_0xa2e45e[_0x943f('0x3f')]=[{'all':!![]}];}return db[_0x943f('0x2a')][_0x943f('0x40')](_0xa2e45e);})[_0x943f('0x22')](function(_0x2f0e62){_0x114d2b[_0x943f('0x41')]=_0x2f0e62;return _0x114d2b;})['then'](respondWithFilteredResult(_0x38c11e,_0xa2e45e))[_0x943f('0x42')](handleError(_0x38c11e,null));};exports['show']=function(_0x1c35eb,_0x4c0501){var _0x31d42a={'raw':!![],'where':{'id':_0x1c35eb[_0x943f('0x43')]['id']}},_0x392f01={};_0x392f01[_0x943f('0x33')]=_['keys'](db[_0x943f('0x2a')][_0x943f('0x2b')]);_0x392f01['query']=_[_0x943f('0x30')](_0x1c35eb[_0x943f('0x2f')]);_0x392f01[_0x943f('0x31')]=_[_0x943f('0x32')](_0x392f01[_0x943f('0x33')],_0x392f01[_0x943f('0x2f')]);_0x31d42a[_0x943f('0x34')]=_['intersection'](_0x392f01[_0x943f('0x33')],qs['fields'](_0x1c35eb[_0x943f('0x2f')][_0x943f('0x35')]));_0x31d42a[_0x943f('0x34')]=_0x31d42a[_0x943f('0x34')][_0x943f('0x36')]?_0x31d42a[_0x943f('0x34')]:_0x392f01[_0x943f('0x33')];if(_0x1c35eb[_0x943f('0x2f')][_0x943f('0x44')]){_0x31d42a[_0x943f('0x3f')]=[{'all':!![]}];}_0x31d42a=_[_0x943f('0x3e')]({},_0x31d42a,_0x1c35eb[_0x943f('0x45')]);return db[_0x943f('0x2a')]['find'](_0x31d42a)[_0x943f('0x22')](handleEntityNotFound(_0x4c0501,null))['then'](respondWithResult(_0x4c0501,null))['catch'](handleError(_0x4c0501,null));};exports[_0x943f('0x46')]=function(_0x1aac94,_0xb1853c){return db[_0x943f('0x2a')][_0x943f('0x46')](_0x1aac94[_0x943f('0x47')],{})[_0x943f('0x22')](respondWithResult(_0xb1853c,0xc9))[_0x943f('0x42')](handleError(_0xb1853c,null));};exports[_0x943f('0x21')]=function(_0x807eae,_0xa01788){if(_0x807eae['body']['id']){delete _0x807eae[_0x943f('0x47')]['id'];}return db[_0x943f('0x2a')][_0x943f('0x48')]({'where':{'id':_0x807eae[_0x943f('0x43')]['id']}})[_0x943f('0x22')](handleEntityNotFound(_0xa01788,null))[_0x943f('0x22')](saveUpdates(_0x807eae[_0x943f('0x47')],null))['then'](respondWithResult(_0xa01788,null))[_0x943f('0x42')](handleError(_0xa01788,null));};exports[_0x943f('0x23')]=function(_0x658a12,_0x4f8f8a){return db[_0x943f('0x2a')][_0x943f('0x48')]({'where':{'id':_0x658a12[_0x943f('0x43')]['id']}})[_0x943f('0x22')](handleEntityNotFound(_0x4f8f8a,null))[_0x943f('0x22')](removeEntity(_0x4f8f8a,null))[_0x943f('0x42')](handleError(_0x4f8f8a,null));};exports[_0x943f('0x49')]=function(_0x24f68e,_0x3eff32){return db[_0x943f('0x2a')][_0x943f('0x49')]()[_0x943f('0x22')](respondWithResult(_0x3eff32,null))[_0x943f('0x42')](handleError(_0x3eff32,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 9ad5a5d..0594946 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 _0xfb4c=['../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','api','moment','bluebird','path','rimraf'];(function(_0x1ed2b,_0x5a9db8){var _0x2cd8d6=function(_0x3b5603){while(--_0x3b5603){_0x1ed2b['push'](_0x1ed2b['shift']());}};_0x2cd8d6(++_0x5a9db8);}(_0xfb4c,0x165));var _0xcfb4=function(_0x557ffe,_0x220b15){_0x557ffe=_0x557ffe-0x0;var _0x411fd5=_0xfb4c[_0x557ffe];return _0x411fd5;};'use strict';var _=require(_0xcfb4('0x0'));var util=require(_0xcfb4('0x1'));var logger=require('../../config/logger')(_0xcfb4('0x2'));var moment=require(_0xcfb4('0x3'));var BPromise=require(_0xcfb4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcfb4('0x5'));var rimraf=require(_0xcfb4('0x6'));var config=require(_0xcfb4('0x7'));var attributes=require(_0xcfb4('0x8'));module[_0xcfb4('0x9')]=function(_0x50a71b,_0x15ecbd){return _0x50a71b[_0xcfb4('0xa')](_0xcfb4('0xb'),attributes,{'tableName':_0xcfb4('0xc'),'paranoid':![],'indexes':[{'name':_0xcfb4('0xd'),'fields':[_0xcfb4('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb358=['report_chat_transfer','uniqueid','util','../../config/logger','bluebird','request-promise','../../config/environment','exports','define','ChatTransferReport'];(function(_0x1d9aa5,_0x392b41){var _0x2c2c8f=function(_0x142474){while(--_0x142474){_0x1d9aa5['push'](_0x1d9aa5['shift']());}};_0x2c2c8f(++_0x392b41);}(_0xb358,0xfc));var _0x8b35=function(_0xeb1059,_0x468895){_0xeb1059=_0xeb1059-0x0;var _0x1d2586=_0xb358[_0xeb1059];return _0x1d2586;};'use strict';var _=require('lodash');var util=require(_0x8b35('0x0'));var logger=require(_0x8b35('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8b35('0x2'));var rp=require(_0x8b35('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8b35('0x4'));var attributes=require('./chatTransferReport.attributes');module[_0x8b35('0x5')]=function(_0x150d4f,_0x3373df){return _0x150d4f[_0x8b35('0x6')](_0x8b35('0x7'),attributes,{'tableName':_0x8b35('0x8'),'paranoid':![],'indexes':[{'name':_0x8b35('0x9'),'fields':[_0x8b35('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 2970ecd..685f3ee 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 _0xae9e=['code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4c681e,_0x561ccd){var _0x596ab5=function(_0x40668b){while(--_0x40668b){_0x4c681e['push'](_0x4c681e['shift']());}};_0x596ab5(++_0x561ccd);}(_0xae9e,0xf5));var _0xeae9=function(_0x3d0e2b,_0x5caf34){_0x3d0e2b=_0x3d0e2b-0x0;var _0x2472bb=_0xae9e[_0x3d0e2b];return _0x2472bb;};'use strict';var _=require(_0xeae9('0x0'));var util=require(_0xeae9('0x1'));var moment=require('moment');var BPromise=require(_0xeae9('0x2'));var rs=require(_0xeae9('0x3'));var fs=require('fs');var Redis=require(_0xeae9('0x4'));var db=require(_0xeae9('0x5'))['db'];var utils=require(_0xeae9('0x6'));var logger=require(_0xeae9('0x7'))(_0xeae9('0x8'));var config=require(_0xeae9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xeae9('0xa')][_0xeae9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x231b3d,_0x4e5ee9,_0x410542){return new BPromise(function(_0x10bd04,_0x2ef4cb){return client['request'](_0x231b3d,_0x410542)['then'](function(_0x20da0b){logger[_0xeae9('0xc')](_0xeae9('0xd'),_0x4e5ee9,_0xeae9('0xe'));logger[_0xeae9('0xf')](_0xeae9('0x10'),_0x4e5ee9,_0xeae9('0xe'),JSON[_0xeae9('0x11')](_0x20da0b));if(_0x20da0b[_0xeae9('0x12')]){if(_0x20da0b['error'][_0xeae9('0x13')]===0x1f4){logger['error'](_0xeae9('0xd'),_0x4e5ee9,_0x20da0b[_0xeae9('0x12')][_0xeae9('0x14')]);return _0x2ef4cb(_0x20da0b['error']['message']);}logger[_0xeae9('0x12')](_0xeae9('0xd'),_0x4e5ee9,_0x20da0b[_0xeae9('0x12')][_0xeae9('0x14')]);return _0x10bd04(_0x20da0b[_0xeae9('0x12')]['message']);}else{logger[_0xeae9('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x4e5ee9,_0xeae9('0xe'));_0x10bd04(_0x20da0b[_0xeae9('0x15')][_0xeae9('0x14')]);}})['catch'](function(_0x10deff){logger[_0xeae9('0x12')](_0xeae9('0xd'),_0x4e5ee9,_0x10deff);_0x2ef4cb(_0x10deff);});});}
\ No newline at end of file
+var _0xa06f=['request','then','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','ChatTransferReport,\x20%s,\x20%s','message','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x40cc9f,_0x7a0902){var _0x4ec8a9=function(_0x1b55e4){while(--_0x1b55e4){_0x40cc9f['push'](_0x40cc9f['shift']());}};_0x4ec8a9(++_0x7a0902);}(_0xa06f,0xb5));var _0xfa06=function(_0x1d3789,_0x45dda5){_0x1d3789=_0x1d3789-0x0;var _0x3f1185=_0xa06f[_0x1d3789];return _0x3f1185;};'use strict';var _=require(_0xfa06('0x0'));var util=require(_0xfa06('0x1'));var moment=require(_0xfa06('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfa06('0x3'))['db'];var utils=require(_0xfa06('0x4'));var logger=require(_0xfa06('0x5'))(_0xfa06('0x6'));var config=require('../../config/environment');var jayson=require(_0xfa06('0x7'));var client=jayson[_0xfa06('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfed3d4,_0x11c4bf,_0x325e2b){return new BPromise(function(_0x33bc3f,_0x41313d){return client[_0xfa06('0x9')](_0xfed3d4,_0x325e2b)[_0xfa06('0xa')](function(_0x2b4778){logger[_0xfa06('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x11c4bf,_0xfa06('0xc'));logger[_0xfa06('0xd')](_0xfa06('0xe'),_0x11c4bf,_0xfa06('0xc'),JSON['stringify'](_0x2b4778));if(_0x2b4778[_0xfa06('0xf')]){if(_0x2b4778['error']['code']===0x1f4){logger[_0xfa06('0xf')](_0xfa06('0x10'),_0x11c4bf,_0x2b4778[_0xfa06('0xf')][_0xfa06('0x11')]);return _0x41313d(_0x2b4778[_0xfa06('0xf')]['message']);}logger[_0xfa06('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x11c4bf,_0x2b4778['error']['message']);return _0x33bc3f(_0x2b4778[_0xfa06('0xf')]['message']);}else{logger[_0xfa06('0xb')](_0xfa06('0x10'),_0x11c4bf,'request\x20sent');_0x33bc3f(_0x2b4778['result'][_0xfa06('0x11')]);}})[_0xfa06('0x12')](function(_0x3bc410){logger[_0xfa06('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x11c4bf,_0x3bc410);_0x41313d(_0x3bc410);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 00805de..b14f112 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 _0xc267=['delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x10486a,_0x4f7fc2){var _0x345a98=function(_0x43b447){while(--_0x43b447){_0x10486a['push'](_0x10486a['shift']());}};_0x345a98(++_0x4f7fc2);}(_0xc267,0x18a));var _0x7c26=function(_0x4e9a9,_0x31d38b){_0x4e9a9=_0x4e9a9-0x0;var _0x2aedbc=_0xc267[_0x4e9a9];return _0x2aedbc;};'use strict';var multer=require(_0x7c26('0x0'));var util=require(_0x7c26('0x1'));var path=require(_0x7c26('0x2'));var timeout=require(_0x7c26('0x3'));var express=require(_0x7c26('0x4'));var router=express['Router']();var fs_extra=require(_0x7c26('0x5'));var auth=require(_0x7c26('0x6'));var interaction=require(_0x7c26('0x7'));var config=require(_0x7c26('0x8'));var controller=require(_0x7c26('0x9'));router[_0x7c26('0xa')]('/',auth[_0x7c26('0xb')](),controller[_0x7c26('0xc')]);router[_0x7c26('0xa')](_0x7c26('0xd'),auth['isAuthenticated'](),controller[_0x7c26('0xe')]);router[_0x7c26('0xa')](_0x7c26('0xf'),auth[_0x7c26('0xb')](),controller[_0x7c26('0x10')]);router[_0x7c26('0x11')]('/',auth[_0x7c26('0xb')](),controller[_0x7c26('0x12')]);router[_0x7c26('0x13')](_0x7c26('0xf'),auth[_0x7c26('0xb')](),controller['update']);router[_0x7c26('0x14')](_0x7c26('0xf'),auth[_0x7c26('0xb')](),controller[_0x7c26('0x15')]);module[_0x7c26('0x16')]=router;
\ No newline at end of file
+var _0x9990=['connect-timeout','express','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','create','destroy','exports','multer','util','path'];(function(_0x25936c,_0x45ab5b){var _0x482efc=function(_0x7d11be){while(--_0x7d11be){_0x25936c['push'](_0x25936c['shift']());}};_0x482efc(++_0x45ab5b);}(_0x9990,0x1ad));var _0x0999=function(_0x580178,_0x49692e){_0x580178=_0x580178-0x0;var _0x4310d1=_0x9990[_0x580178];return _0x4310d1;};'use strict';var multer=require(_0x0999('0x0'));var util=require(_0x0999('0x1'));var path=require(_0x0999('0x2'));var timeout=require(_0x0999('0x3'));var express=require(_0x0999('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0999('0x5'));var config=require(_0x0999('0x6'));var controller=require(_0x0999('0x7'));router[_0x0999('0x8')]('/',auth[_0x0999('0x9')](),controller['index']);router[_0x0999('0x8')](_0x0999('0xa'),auth[_0x0999('0x9')](),controller[_0x0999('0xb')]);router[_0x0999('0x8')](_0x0999('0xc'),auth[_0x0999('0x9')](),controller['show']);router['post']('/',auth[_0x0999('0x9')](),controller[_0x0999('0xd')]);router['put'](_0x0999('0xc'),auth[_0x0999('0x9')](),controller['update']);router['delete'](_0x0999('0xc'),auth[_0x0999('0x9')](),controller[_0x0999('0xe')]);module[_0x0999('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 60754b8..6a1c5b9 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 _0xa74f=['Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','exports','address','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','squared','rounded','We\x20are\x20here!','Chat','Send','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Feedback','star','TEXT','stringify','input','name','getDataValue','onlineForm','textarea','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0xa74f,0x9a));var _0xfa74=function(_0x2e58c7,_0x23d092){_0x2e58c7=_0x2e58c7-0x0;var _0x26eb00=_0xa74f[_0x2e58c7];return _0x26eb00;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xfa74('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xfa74('0x1')},'description':{'type':Sequelize[_0xfa74('0x2')]},'mapKey':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xfa74('0x3')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xfa74('0x4')},'customerAlias':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xfa74('0x2')],'allowNull':![],'defaultValue':_0xfa74('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xfa74('0x2')],'allowNull':![],'defaultValue':_0xfa74('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xfa74('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xfa74('0x2')],'allowNull':![],'defaultValue':_0xfa74('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xfa74('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xfa74('0x9')]('rounded',_0xfa74('0xa')),'defaultValue':_0xfa74('0xb')},'header_online':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0xc')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xfa74('0xd')},'offline_chat_button':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0xe')},'header_offline':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xfa74('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x12')},'noteTitle':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x13')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0xe')},'skipMessageButton':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x14')},'ratingType':{'type':Sequelize[_0xfa74('0x9')]('star','thumb'),'defaultValue':_0xfa74('0x15')},'ratingStarsNumber':{'type':Sequelize[_0xfa74('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xfa74('0x16')],'defaultValue':function(){return JSON[_0xfa74('0x17')]({'items':[{'type':_0xfa74('0x18'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0xfa74('0x19'),'helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xfa74('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xfa74('0x1a')](_0xfa74('0x1b'))?JSON['parse'](this['getDataValue'](_0xfa74('0x1b'))):{};},'set':function(_0xeb6c11){return this['setDataValue'](_0xfa74('0x1b'),JSON['stringify'](_0xeb6c11));}},'offlineForm':{'type':Sequelize[_0xfa74('0x16')],'defaultValue':function(){return JSON[_0xfa74('0x17')]({'items':[{'type':'input','props':{'title':_0xfa74('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xfa74('0x3'),'type':_0xfa74('0x3')},'variable':null},{'type':_0xfa74('0x1c'),'config':{'placeholder':'Comments'},'props':{'title':_0xfa74('0x1d'),'helpText':_0xfa74('0x1e')}}],'fromKey':0x0});},'get':function(){return this[_0xfa74('0x1a')]('offlineForm')?JSON['parse'](this[_0xfa74('0x1a')](_0xfa74('0x1f'))):{};},'set':function(_0x5df5cd){return this['setDataValue'](_0xfa74('0x1f'),JSON['stringify'](_0x5df5cd));}},'token':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xfa74('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xfa74('0x2')]},'waitingTitle':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x20')},'waitingMessage':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x21')},'offlineMessageSubject':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x22')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xfa74('0x23')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x24')},'skipUnmanaged':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x25')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xfa74('0x16')]},'showAgentAvatar':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xfa74('0x16')],'defaultValue':function(){return _0xfa74('0x26');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xfa74('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x27')},'verticalAlignment':{'type':Sequelize[_0xfa74('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x28')},'messagesAlignment':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x29')},'defaultTitle':{'type':Sequelize[_0xfa74('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xfa74('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xfa74('0x2')],'allowNull':![],'defaultValue':_0xfa74('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfa74('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfa74('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x2b')},'systemAvatar':{'type':Sequelize[_0xfa74('0x16')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xfa74('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![],'comment':_0xfa74('0x2d'),'set':function(_0x35f252){if(!_0x35f252)this['setDataValue'](_0xfa74('0x2e'),null);this[_0xfa74('0x2f')](_0xfa74('0x30'),_0x35f252);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xfa74('0x2')],'allowNull':![],'defaultValue':_0xfa74('0x31')},'vidaooNote':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':function(){return _0xfa74('0x32');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xfa74('0x16')]}};
\ No newline at end of file
+var _0x702d=['ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','stringify','name','input','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','email','Agent','#ffffff','INTEGER','BOOLEAN'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x702d,0x147));var _0xd702=function(_0x335607,_0x10708f){_0x335607=_0x335607-0x0;var _0xb4ed7d=_0x702d[_0x335607];return _0xb4ed7d;};'use strict';var Sequelize=require(_0xd702('0x0'));var rs=require(_0xd702('0x1'));module[_0xd702('0x2')]={'name':{'type':Sequelize[_0xd702('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xd702('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xd702('0x3')]},'mapKey':{'type':Sequelize[_0xd702('0x3')],'defaultValue':_0xd702('0x4')},'mapKeyOffline':{'type':Sequelize[_0xd702('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0xd702('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xd702('0x5')},'customerAlias':{'type':Sequelize[_0xd702('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xd702('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xd702('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xd702('0x3')],'allowNull':![],'defaultValue':_0xd702('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xd702('0x3')],'allowNull':![],'defaultValue':_0xd702('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xd702('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xd702('0x3')]},'animation':{'type':Sequelize[_0xd702('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xd702('0x9')](_0xd702('0xa'),_0xd702('0xb')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xd702('0xc')},'start_chat_button':{'type':Sequelize[_0xd702('0x3')],'defaultValue':_0xd702('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xd702('0xe')},'header_offline':{'type':Sequelize[_0xd702('0x3')],'defaultValue':_0xd702('0xf')},'download_transcript':{'type':Sequelize[_0xd702('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xd702('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xd702('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xd702('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xd702('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xd702('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xd702('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0xd702('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xd702('0x3')],'defaultValue':_0xd702('0x13')},'placeholderMessage':{'type':Sequelize[_0xd702('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xd702('0x14')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xd702('0xe')},'skipMessageButton':{'type':Sequelize[_0xd702('0x3')],'defaultValue':_0xd702('0x15')},'conditionAgreement':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize['ENUM'](_0xd702('0x16'),_0xd702('0x17')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xd702('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xd702('0x18')]({'items':[{'type':'input','variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0xd702('0x19'),'helpText':''}},{'type':_0xd702('0x1a'),'props':{'title':_0xd702('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xd702('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xd702('0x1b')](_0xd702('0x1c'))?JSON[_0xd702('0x1d')](this[_0xd702('0x1b')](_0xd702('0x1c'))):{};},'set':function(_0x94c58d){return this[_0xd702('0x1e')](_0xd702('0x1c'),JSON['stringify'](_0x94c58d));}},'offlineForm':{'type':Sequelize[_0xd702('0x10')],'defaultValue':function(){return JSON[_0xd702('0x18')]({'items':[{'type':_0xd702('0x1a'),'props':{'title':_0xd702('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xd702('0x4'),'type':_0xd702('0x4')},'variable':null},{'type':_0xd702('0x1f'),'config':{'placeholder':_0xd702('0x20')},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xd702('0x1b')](_0xd702('0x21'))?JSON['parse'](this[_0xd702('0x1b')](_0xd702('0x21'))):{};},'set':function(_0xffdb54){return this[_0xd702('0x1e')]('offlineForm',JSON[_0xd702('0x18')](_0xffdb54));}},'token':{'type':Sequelize[_0xd702('0x3')],'defaultValue':function(){return rs[_0xd702('0x22')]();}},'autoclose':{'type':Sequelize[_0xd702('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xd702('0x3')]},'forwardOffline':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xd702('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xd702('0x23')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xd702('0x3')],'defaultValue':_0xd702('0x24')},'offlineMessageBody':{'type':Sequelize[_0xd702('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xd702('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xd702('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xd702('0x3')],'defaultValue':_0xd702('0x15')},'sendUnmanaged':{'type':Sequelize[_0xd702('0x3')],'defaultValue':_0xd702('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xd702('0x10')]},'showAgentAvatar':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xd702('0x3')]},'notificationTemplate':{'type':Sequelize[_0xd702('0x10')],'defaultValue':function(){return _0xd702('0x25');}},'notificationSound':{'type':Sequelize[_0xd702('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xd702('0x3')],'defaultValue':_0xd702('0x26')},'waitForTheAssignedAgent':{'type':Sequelize[_0xd702('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xd702('0x3')],'defaultValue':_0xd702('0x27')},'verticalAlignment':{'type':Sequelize[_0xd702('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xd702('0x3')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xd702('0x28')},'defaultTitle':{'type':Sequelize[_0xd702('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xd702('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xd702('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd702('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xd702('0x3')],'defaultValue':_0xd702('0x29')},'systemAvatar':{'type':Sequelize[_0xd702('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xd702('0x2a')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xd702('0x2b'),'set':function(_0x239bec){if(!_0x239bec)this[_0xd702('0x1e')](_0xd702('0x2c'),null);this[_0xd702('0x1e')](_0xd702('0x2d'),_0x239bec);}},'vidaooEscalation':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xd702('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd702('0x2e')},'vidaooNote':{'type':Sequelize[_0xd702('0x3')],'defaultValue':function(){return _0xd702('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0xd702('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xd702('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 0ac45fb..0e6c5ca 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 _0xee0e=['fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','name','includeAll','findAll','params','rawAttributes','include','options','find','create','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','rows','removeAnswers','addLogo','filename','addAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','isNil','server/files/images/logos/','sitepic','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','from','CmList','List','Contacts','DESC','account','applications','Applications','list','asc','contact','cf-connecting-ip','x-forwarded-for','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','stringify','threadId','externalUrl','ChatInteraction','ContactId','interaction','messageId','created','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','utf8','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','openNewInteraction','transaction','Attachment','MailServerOut','CloudProvider','forwardOffline','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Smtp','forwardOfflineAddress','offlineMessageSubject','subjectOffline','toPairsIn','firstName','notifyMail','remove','addInteraction','omit','getInteractions','Owner','internal','Tag','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','inspect','No\x20timezone','Interval','getProactiveActions','virtual','custom','License','Intervals','all','some','readFileSync','address','origin','3.1.0','remote','x-real-ip','connection','remoteAddress','render','alignment','verticalAlignment','color','textColor','color_button','hideWhenOffline','IntervalId','sequelize','READ_COMMITTED','ChatApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','getOfflineMessages','Contact','Attachments','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','util','ejs','fs-extra','lodash','querystring','../../components/parsers/qs','api','../../config/environment','url','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','html-to-text','jayson/promise','client','http','request','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','ChatWebsite,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','undefined','count','limit','set','Content-Range','update','then','destroy','ChatWebsites','UserProfileResource','stack','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite'];(function(_0x3c97cb,_0x43b68e){var _0x2529c2=function(_0x56120e){while(--_0x56120e){_0x3c97cb['push'](_0x3c97cb['shift']());}};_0x2529c2(++_0x43b68e);}(_0xee0e,0xf7));var _0xeee0=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0xee0e[_0x26462c];return _0x509a42;};'use strict';var BPromise=require(_0xeee0('0x0'));var Mustache=require('mustache');var util=require(_0xeee0('0x1'));var path=require('path');var ejs=require(_0xeee0('0x2'));var fs=require('fs');var fs_extra=require(_0xeee0('0x3'));var _=require(_0xeee0('0x4'));var querystring=require(_0xeee0('0x5'));var Redis=require('ioredis');var qs=require(_0xeee0('0x6'));var logger=require('../../config/logger')(_0xeee0('0x7'));var config=require(_0xeee0('0x8'));var url=require(_0xeee0('0x9'));var db=require(_0xeee0('0xa'))['db'];config[_0xeee0('0xb')]=_[_0xeee0('0xc')](config[_0xeee0('0xb')],{'host':_0xeee0('0xd'),'port':0x18eb});var socket=require(_0xeee0('0xe'))(new Redis(config[_0xeee0('0xb')]));require('./chatWebsite.socket')[_0xeee0('0xf')](socket);var htmlToText=require(_0xeee0('0x10'));var jayson=require(_0xeee0('0x11'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xeee0('0x12')]['http']({'port':0x232a});var client9003=jayson['client'][_0xeee0('0x13')]({'port':0x232b});var client9001=jayson[_0xeee0('0x12')]['http']({'port':0x2329});function respondWithRpcPromise(_0x23b533,_0x4fc44b,_0x499982,_0x1383d5){return new BPromise(function(_0x484ab5,_0x4dc2b6){var _0x1f79b6=_0x1383d5||client;return _0x1f79b6[_0xeee0('0x14')](_0x23b533,_0x499982)['then'](function(_0x4e2f4d){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x4fc44b,_0xeee0('0x15'));logger[_0xeee0('0x16')](_0xeee0('0x17'),_0x4fc44b,_0xeee0('0x15'),JSON['stringify'](_0x4e2f4d));if(_0x4e2f4d[_0xeee0('0x18')]){if(_0x4e2f4d[_0xeee0('0x18')][_0xeee0('0x19')]===0x1f4){logger[_0xeee0('0x18')](_0xeee0('0x1a'),_0x4fc44b,_0x4e2f4d[_0xeee0('0x18')][_0xeee0('0x1b')]);return _0x4dc2b6(_0x4e2f4d[_0xeee0('0x18')]['message']);}logger[_0xeee0('0x18')](_0xeee0('0x1a'),_0x4fc44b,_0x4e2f4d[_0xeee0('0x18')]['message']);return _0x484ab5(_0x4e2f4d[_0xeee0('0x18')][_0xeee0('0x1b')]);}else{logger[_0xeee0('0x1c')](_0xeee0('0x1a'),_0x4fc44b,'request\x20sent');_0x484ab5(_0x4e2f4d[_0xeee0('0x1d')]['message']);}})[_0xeee0('0x1e')](function(_0x52b4a7){logger[_0xeee0('0x18')](_0xeee0('0x1a'),_0x4fc44b,_0x52b4a7);_0x4dc2b6(_0x52b4a7);});});}function respondWithStatusCode(_0x24c68f,_0xd6fe72){_0xd6fe72=_0xd6fe72||0xcc;return function(_0x52f49a){if(_0x52f49a){return _0x24c68f[_0xeee0('0x1f')](_0xd6fe72);}return _0x24c68f[_0xeee0('0x20')](_0xd6fe72)[_0xeee0('0x21')]();};}function respondWithResult(_0x4119e4,_0x43cba0){_0x43cba0=_0x43cba0||0xc8;return function(_0x543c93){if(_0x543c93){return _0x4119e4[_0xeee0('0x20')](_0x43cba0)[_0xeee0('0x22')](_0x543c93);}};}function respondWithFilteredResult(_0x1643f0,_0x1c912d){return function(_0x183691){if(_0x183691){var _0x25c1af=typeof _0x1c912d['offset']===_0xeee0('0x23')&&typeof _0x1c912d['limit']===_0xeee0('0x23');var _0x33624f=_0x183691[_0xeee0('0x24')];var _0x2f2ea4=_0x25c1af?0x0:_0x1c912d['offset'];var _0x59d3bf=_0x25c1af?_0x183691[_0xeee0('0x24')]:_0x1c912d['offset']+_0x1c912d[_0xeee0('0x25')];var _0x5817c8;if(_0x59d3bf>=_0x33624f){_0x59d3bf=_0x33624f;_0x5817c8=0xc8;}else{_0x5817c8=0xce;}_0x1643f0['status'](_0x5817c8);return _0x1643f0[_0xeee0('0x26')](_0xeee0('0x27'),_0x2f2ea4+'-'+_0x59d3bf+'/'+_0x33624f)['json'](_0x183691);}return null;};}function saveUpdates(_0x4d5bb7){return function(_0xb209e){if(_0xb209e){return _0xb209e[_0xeee0('0x28')](_0x4d5bb7)[_0xeee0('0x29')](function(_0xc59273){return _0xc59273;});}return null;};}function removeEntity(_0x4c9411){return function(_0xb1ec06){if(_0xb1ec06){return _0xb1ec06[_0xeee0('0x2a')]()[_0xeee0('0x29')](function(){var _0xdfff3b=_0xb1ec06['get']({'plain':!![]});var _0x469b0f=_0xeee0('0x2b');return db[_0xeee0('0x2c')][_0xeee0('0x2a')]({'where':{'type':_0x469b0f,'resourceId':_0xdfff3b['id']}})[_0xeee0('0x29')](function(){return _0xb1ec06;});})[_0xeee0('0x29')](function(){_0x4c9411[_0xeee0('0x20')](0xcc)[_0xeee0('0x21')]();});}};}function handleEntityNotFound(_0x46f116){return function(_0x10e524){if(!_0x10e524){_0x46f116[_0xeee0('0x1f')](0x194);}return _0x10e524;};}function handleError(_0x448832,_0x23ebf6){_0x23ebf6=_0x23ebf6||0x1f4;return function(_0xc38d18){logger[_0xeee0('0x18')](_0xc38d18[_0xeee0('0x2d')]);if(_0xc38d18['name']){delete _0xc38d18['name'];}_0x448832[_0xeee0('0x20')](_0x23ebf6)[_0xeee0('0x2e')](_0xc38d18);};}exports[_0xeee0('0x2f')]=function(_0x2e4870,_0x1df264){var _0x31c12c={'include':[{'model':db[_0xeee0('0x30')],'as':_0xeee0('0x31')}]},_0x4b9a92={},_0x2421dc={'count':0x0,'rows':[]};var _0x4df76b=_[_0xeee0('0x32')](db[_0xeee0('0x33')]['rawAttributes'],function(_0x4dce7f){return{'name':_0x4dce7f[_0xeee0('0x34')],'type':_0x4dce7f[_0xeee0('0x35')][_0xeee0('0x36')]};});_0x4b9a92[_0xeee0('0x37')]=_[_0xeee0('0x32')](_0x4df76b,'name');_0x4b9a92[_0xeee0('0x38')]=_[_0xeee0('0x39')](_0x2e4870[_0xeee0('0x38')]);_0x4b9a92[_0xeee0('0x3a')]=_[_0xeee0('0x3b')](_0x4b9a92[_0xeee0('0x37')],_0x4b9a92[_0xeee0('0x38')]);_0x31c12c[_0xeee0('0x3c')]=_[_0xeee0('0x3b')](_0x4b9a92[_0xeee0('0x37')],qs['fields'](_0x2e4870[_0xeee0('0x38')][_0xeee0('0x3d')]));_0x31c12c['attributes']=_0x31c12c[_0xeee0('0x3c')][_0xeee0('0x3e')]?_0x31c12c[_0xeee0('0x3c')]:_0x4b9a92[_0xeee0('0x37')];if(!_0x2e4870[_0xeee0('0x38')][_0xeee0('0x3f')](_0xeee0('0x40'))){_0x31c12c[_0xeee0('0x25')]=qs[_0xeee0('0x25')](_0x2e4870[_0xeee0('0x38')][_0xeee0('0x25')]);_0x31c12c[_0xeee0('0x41')]=qs[_0xeee0('0x41')](_0x2e4870[_0xeee0('0x38')][_0xeee0('0x41')]);}_0x31c12c[_0xeee0('0x42')]=qs['sort'](_0x2e4870['query'][_0xeee0('0x43')]);_0x31c12c[_0xeee0('0x44')]=qs[_0xeee0('0x3a')](_[_0xeee0('0x45')](_0x2e4870[_0xeee0('0x38')],_0x4b9a92[_0xeee0('0x3a')]),_0x4df76b);if(_0x2e4870[_0xeee0('0x38')][_0xeee0('0x46')]){_0x31c12c[_0xeee0('0x44')]=_[_0xeee0('0x47')](_0x31c12c[_0xeee0('0x44')],{'$or':_[_0xeee0('0x32')](_0x4df76b,function(_0x478647){if(_0x478647['type']!==_0xeee0('0x48')){var _0x13a94d={};_0x13a94d[_0x478647[_0xeee0('0x49')]]={'$like':'%'+_0x2e4870[_0xeee0('0x38')][_0xeee0('0x46')]+'%'};return _0x13a94d;}})});}_0x31c12c=_[_0xeee0('0x47')]({},_0x31c12c,_0x2e4870['options']);var _0x2bd9c0={'where':_0x31c12c[_0xeee0('0x44')]};return db['ChatWebsite'][_0xeee0('0x24')](_0x2bd9c0)[_0xeee0('0x29')](function(_0x16a386){_0x2421dc[_0xeee0('0x24')]=_0x16a386;if(_0x2e4870[_0xeee0('0x38')][_0xeee0('0x4a')]){_0x31c12c['include']=[{'all':!![]}];}return db[_0xeee0('0x33')][_0xeee0('0x4b')](_0x31c12c);})[_0xeee0('0x29')](function(_0x3bd7b4){_0x2421dc['rows']=_0x3bd7b4;return _0x2421dc;})[_0xeee0('0x29')](respondWithFilteredResult(_0x1df264,_0x31c12c))[_0xeee0('0x1e')](handleError(_0x1df264,null));};exports['show']=function(_0x2966b0,_0xb2fcf){var _0x37bc2d={'raw':![],'where':{'id':_0x2966b0[_0xeee0('0x4c')]['id']},'include':[{'model':db[_0xeee0('0x30')],'as':'mandatoryDispositionPause'}]},_0x3e74eb={};_0x3e74eb[_0xeee0('0x37')]=_['keys'](db[_0xeee0('0x33')][_0xeee0('0x4d')]);_0x3e74eb[_0xeee0('0x38')]=_[_0xeee0('0x39')](_0x2966b0[_0xeee0('0x38')]);_0x3e74eb['filters']=_[_0xeee0('0x3b')](_0x3e74eb[_0xeee0('0x37')],_0x3e74eb[_0xeee0('0x38')]);_0x37bc2d[_0xeee0('0x3c')]=_['intersection'](_0x3e74eb[_0xeee0('0x37')],qs[_0xeee0('0x3d')](_0x2966b0[_0xeee0('0x38')][_0xeee0('0x3d')]));_0x37bc2d[_0xeee0('0x3c')]=_0x37bc2d[_0xeee0('0x3c')][_0xeee0('0x3e')]?_0x37bc2d[_0xeee0('0x3c')]:_0x3e74eb[_0xeee0('0x37')];if(_0x2966b0[_0xeee0('0x38')][_0xeee0('0x4a')]){_0x37bc2d[_0xeee0('0x4e')]=[{'all':!![]}];}_0x37bc2d=_['merge']({},_0x37bc2d,_0x2966b0[_0xeee0('0x4f')]);return db[_0xeee0('0x33')][_0xeee0('0x50')](_0x37bc2d)[_0xeee0('0x29')](handleEntityNotFound(_0xb2fcf,null))[_0xeee0('0x29')](respondWithResult(_0xb2fcf,null))['catch'](handleError(_0xb2fcf,null));};exports[_0xeee0('0x51')]=function(_0x39e52c,_0x320ec8){return db[_0xeee0('0x33')][_0xeee0('0x51')](_0x39e52c['body'],{})[_0xeee0('0x29')](function(_0x5335ab){var _0x1e59f3=_0x39e52c[_0xeee0('0x52')][_0xeee0('0x53')]({'plain':!![]});if(!_0x1e59f3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e59f3[_0xeee0('0x54')]===_0xeee0('0x52')){var _0x502cf6=_0x5335ab[_0xeee0('0x53')]({'plain':!![]});var _0x366b47='ChatWebsites';return db[_0xeee0('0x55')]['find']({'where':{'name':_0x366b47,'userProfileId':_0x1e59f3[_0xeee0('0x56')]},'raw':!![]})[_0xeee0('0x29')](function(_0x4cec1d){if(_0x4cec1d&&_0x4cec1d[_0xeee0('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x502cf6[_0xeee0('0x49')],'resourceId':_0x502cf6['id'],'type':_0x4cec1d[_0xeee0('0x49')],'sectionId':_0x4cec1d['id']},{})['then'](function(){return _0x5335ab;});}else{return _0x5335ab;}})[_0xeee0('0x1e')](function(_0x6f8e8a){logger[_0xeee0('0x18')](_0xeee0('0x58'),_0x6f8e8a);throw _0x6f8e8a;});}return _0x5335ab;})['then'](respondWithResult(_0x320ec8,0xc9))[_0xeee0('0x1e')](handleError(_0x320ec8,null));};exports[_0xeee0('0x28')]=function(_0x52440f,_0x59aa86){if(_0x52440f['body']['id']){delete _0x52440f[_0xeee0('0x59')]['id'];}return db[_0xeee0('0x33')][_0xeee0('0x50')]({'where':{'id':_0x52440f[_0xeee0('0x4c')]['id']},'include':[{'model':db[_0xeee0('0x30')],'as':_0xeee0('0x31')}]})['then'](handleEntityNotFound(_0x59aa86,null))['then'](saveUpdates(_0x52440f[_0xeee0('0x59')],null))[_0xeee0('0x29')](respondWithResult(_0x59aa86,null))['catch'](handleError(_0x59aa86,null));};exports['destroy']=function(_0x3f6287,_0x246ecf){return db[_0xeee0('0x33')][_0xeee0('0x50')]({'where':{'id':_0x3f6287[_0xeee0('0x4c')]['id']}})[_0xeee0('0x29')](handleEntityNotFound(_0x246ecf,null))[_0xeee0('0x29')](removeEntity(_0x246ecf,null))[_0xeee0('0x1e')](handleError(_0x246ecf,null));};exports[_0xeee0('0x5a')]=function(_0x3118f2,_0x3ad981){return db[_0xeee0('0x33')][_0xeee0('0x5a')]()[_0xeee0('0x29')](respondWithResult(_0x3ad981,null))[_0xeee0('0x1e')](handleError(_0x3ad981,null));};exports[_0xeee0('0x5b')]=function(_0x51979b,_0x4438b9){if(_0x51979b['body']['id']){delete _0x51979b[_0xeee0('0x59')]['id'];}return db['ChatWebsite'][_0xeee0('0x50')]({'where':{'id':_0x51979b[_0xeee0('0x4c')]['id']}})[_0xeee0('0x29')](handleEntityNotFound(_0x4438b9,null))[_0xeee0('0x29')](function(_0x566d8d){if(_0x566d8d){_0x51979b[_0xeee0('0x59')][_0xeee0('0x5c')]=_0x566d8d['id'];return db[_0xeee0('0x5d')][_0xeee0('0x51')](_0x51979b[_0xeee0('0x59')]);}})[_0xeee0('0x29')](respondWithResult(_0x4438b9,null))[_0xeee0('0x1e')](handleError(_0x4438b9,null));};exports[_0xeee0('0x5e')]=function(_0x51375f,_0xabc6fe){var _0x52c2ab={'raw':![],'where':{}};var _0x63bfe9={};var _0x32e2a5={'count':0x0,'rows':[]};return db[_0xeee0('0x33')][_0xeee0('0x5f')]({'where':{'id':_0x51375f[_0xeee0('0x4c')]['id']}})['then'](handleEntityNotFound(_0xabc6fe,null))[_0xeee0('0x29')](function(_0x3cfc65){if(_0x3cfc65){_0x63bfe9[_0xeee0('0x37')]=_[_0xeee0('0x39')](db[_0xeee0('0x5d')][_0xeee0('0x4d')]);_0x63bfe9[_0xeee0('0x38')]=_['keys'](_0x51375f['query']);_0x63bfe9['filters']=_['intersection'](_0x63bfe9[_0xeee0('0x37')],_0x63bfe9['query']);_0x52c2ab[_0xeee0('0x3c')]=_[_0xeee0('0x3b')](_0x63bfe9['model'],qs[_0xeee0('0x3d')](_0x51375f['query']['fields']));_0x52c2ab[_0xeee0('0x3c')]=_0x52c2ab['attributes'][_0xeee0('0x3e')]?_0x52c2ab[_0xeee0('0x3c')]:_0x63bfe9[_0xeee0('0x37')];if(!_0x51375f[_0xeee0('0x38')][_0xeee0('0x3f')](_0xeee0('0x40'))){_0x52c2ab[_0xeee0('0x25')]=qs[_0xeee0('0x25')](_0x51375f[_0xeee0('0x38')][_0xeee0('0x25')]);_0x52c2ab[_0xeee0('0x41')]=qs[_0xeee0('0x41')](_0x51375f[_0xeee0('0x38')][_0xeee0('0x41')]);}_0x52c2ab[_0xeee0('0x42')]=qs[_0xeee0('0x43')](_0x51375f['query'][_0xeee0('0x43')]);_0x52c2ab[_0xeee0('0x44')]=qs['filters'](_[_0xeee0('0x45')](_0x51375f['query'],_0x63bfe9[_0xeee0('0x3a')]));_0x52c2ab[_0xeee0('0x44')][_0xeee0('0x5c')]=_0x3cfc65['id'];if(_0x51375f[_0xeee0('0x38')]['filter']){_0x52c2ab[_0xeee0('0x44')]=_[_0xeee0('0x47')](_0x52c2ab[_0xeee0('0x44')],{'$or':_['map'](_0x52c2ab[_0xeee0('0x3c')],function(_0x4e6a1c){var _0x40ee54={};_0x40ee54[_0x4e6a1c]={'$like':'%'+_0x51375f[_0xeee0('0x38')]['filter']+'%'};return _0x40ee54;})});}_0x52c2ab=_[_0xeee0('0x47')]({},_0x52c2ab,_0x51375f[_0xeee0('0x4f')]);return db[_0xeee0('0x5d')][_0xeee0('0x24')]({'where':_0x52c2ab[_0xeee0('0x44')]})['then'](function(_0x40ce48){_0x32e2a5['count']=_0x40ce48;if(_0x51375f[_0xeee0('0x38')]['includeAll']){_0x52c2ab[_0xeee0('0x4e')]=[{'all':!![]}];}return db[_0xeee0('0x5d')][_0xeee0('0x4b')](_0x52c2ab);})[_0xeee0('0x29')](function(_0x58fe54){_0x32e2a5['rows']=_0x58fe54;return _0x32e2a5;});}})[_0xeee0('0x29')](respondWithFilteredResult(_0xabc6fe,_0x52c2ab))[_0xeee0('0x1e')](handleError(_0xabc6fe,null));};exports[_0xeee0('0x60')]=function(_0x520658,_0x19aa2b){return db[_0xeee0('0x33')][_0xeee0('0x50')]({'where':{'id':_0x520658[_0xeee0('0x4c')]['id']}})[_0xeee0('0x29')](handleEntityNotFound(_0x19aa2b,null))['then'](function(_0x46e351){if(_0x46e351){return _0x46e351[_0xeee0('0x60')](_0x520658[_0xeee0('0x38')][_0xeee0('0x61')]);}})[_0xeee0('0x29')](respondWithStatusCode(_0x19aa2b,null))['catch'](handleError(_0x19aa2b,null));};exports[_0xeee0('0x62')]=function(_0x24bbc2,_0x22137f){if(_0x24bbc2[_0xeee0('0x59')]['id']){delete _0x24bbc2[_0xeee0('0x59')]['id'];}return db['ChatWebsite'][_0xeee0('0x50')]({'where':{'id':_0x24bbc2['params']['id']}})[_0xeee0('0x29')](handleEntityNotFound(_0x22137f,null))[_0xeee0('0x29')](function(_0x24ff3b){if(_0x24ff3b){_0x24bbc2['body'][_0xeee0('0x5c')]=_0x24ff3b['id'];return db[_0xeee0('0x63')]['create'](_0x24bbc2[_0xeee0('0x59')]);}})[_0xeee0('0x29')](respondWithResult(_0x22137f,null))[_0xeee0('0x1e')](handleError(_0x22137f,null));};exports['getAnswers']=function(_0x472080,_0x2cab82){var _0x1e7e9b={'raw':![],'where':{}};var _0x305c0f={};var _0x3c54e3={'count':0x0,'rows':[]};return db[_0xeee0('0x33')][_0xeee0('0x5f')]({'where':{'id':_0x472080[_0xeee0('0x4c')]['id']}})[_0xeee0('0x29')](handleEntityNotFound(_0x2cab82,null))[_0xeee0('0x29')](function(_0x1c604f){if(_0x1c604f){_0x305c0f[_0xeee0('0x37')]=_['keys'](db[_0xeee0('0x63')][_0xeee0('0x4d')]);_0x305c0f[_0xeee0('0x38')]=_[_0xeee0('0x39')](_0x472080[_0xeee0('0x38')]);_0x305c0f[_0xeee0('0x3a')]=_['intersection'](_0x305c0f[_0xeee0('0x37')],_0x305c0f[_0xeee0('0x38')]);_0x1e7e9b['attributes']=_['intersection'](_0x305c0f[_0xeee0('0x37')],qs[_0xeee0('0x3d')](_0x472080[_0xeee0('0x38')][_0xeee0('0x3d')]));_0x1e7e9b[_0xeee0('0x3c')]=_0x1e7e9b[_0xeee0('0x3c')][_0xeee0('0x3e')]?_0x1e7e9b[_0xeee0('0x3c')]:_0x305c0f[_0xeee0('0x37')];if(!_0x472080[_0xeee0('0x38')]['hasOwnProperty'](_0xeee0('0x40'))){_0x1e7e9b[_0xeee0('0x25')]=qs[_0xeee0('0x25')](_0x472080[_0xeee0('0x38')][_0xeee0('0x25')]);_0x1e7e9b[_0xeee0('0x41')]=qs[_0xeee0('0x41')](_0x472080['query']['offset']);}_0x1e7e9b[_0xeee0('0x42')]=qs[_0xeee0('0x43')](_0x472080[_0xeee0('0x38')][_0xeee0('0x43')]);_0x1e7e9b[_0xeee0('0x44')]=qs[_0xeee0('0x3a')](_[_0xeee0('0x45')](_0x472080[_0xeee0('0x38')],_0x305c0f['filters']));_0x1e7e9b[_0xeee0('0x44')][_0xeee0('0x5c')]=_0x1c604f['id'];if(_0x472080['query'][_0xeee0('0x46')]){_0x1e7e9b['where']=_['merge'](_0x1e7e9b['where'],{'$or':_['map'](_0x1e7e9b[_0xeee0('0x3c')],function(_0xae8350){var _0x572f91={};_0x572f91[_0xae8350]={'$like':'%'+_0x472080['query']['filter']+'%'};return _0x572f91;})});}_0x1e7e9b=_[_0xeee0('0x47')]({},_0x1e7e9b,_0x472080[_0xeee0('0x4f')]);return db[_0xeee0('0x63')]['count']({'where':_0x1e7e9b[_0xeee0('0x44')]})['then'](function(_0x77e7ce){_0x3c54e3[_0xeee0('0x24')]=_0x77e7ce;if(_0x472080[_0xeee0('0x38')][_0xeee0('0x4a')]){_0x1e7e9b[_0xeee0('0x4e')]=[{'all':!![]}];}return db[_0xeee0('0x63')][_0xeee0('0x4b')](_0x1e7e9b);})[_0xeee0('0x29')](function(_0x753a8d){_0x3c54e3[_0xeee0('0x64')]=_0x753a8d;return _0x3c54e3;});}})['then'](respondWithFilteredResult(_0x2cab82,_0x1e7e9b))[_0xeee0('0x1e')](handleError(_0x2cab82,null));};exports[_0xeee0('0x65')]=function(_0x6a3436,_0x51790b){return db['ChatWebsite'][_0xeee0('0x50')]({'where':{'id':_0x6a3436[_0xeee0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x51790b,null))[_0xeee0('0x29')](function(_0x4806d4){if(_0x4806d4){return _0x4806d4[_0xeee0('0x65')](_0x6a3436[_0xeee0('0x38')]['ids']);}})[_0xeee0('0x29')](respondWithStatusCode(_0x51790b,null))['catch'](handleError(_0x51790b,null));};exports[_0xeee0('0x66')]=function(_0x55c880,_0xff1731){_0x55c880[_0xeee0('0x59')]['sitepic']=_0x55c880['file'][_0xeee0('0x67')];return db['ChatWebsite'][_0xeee0('0x50')]({'where':{'id':_0x55c880['params']['id']}})[_0xeee0('0x29')](handleEntityNotFound(_0xff1731,null))['then'](saveUpdates(_0x55c880['body'],null))[_0xeee0('0x29')](respondWithResult(_0xff1731,null))[_0xeee0('0x1e')](handleError(_0xff1731,null));};exports[_0xeee0('0x68')]=function(_0x481b8d,_0x102107){_0x481b8d['body']['agentAvatar']=_0x481b8d[_0xeee0('0x69')]['filename'];return db[_0xeee0('0x33')][_0xeee0('0x50')]({'where':{'id':_0x481b8d['params']['id']}})[_0xeee0('0x29')](handleEntityNotFound(_0x102107,null))[_0xeee0('0x29')](saveUpdates(_0x481b8d['body'],null))['then'](respondWithResult(_0x102107,null))['catch'](handleError(_0x102107,null));};exports[_0xeee0('0x6a')]=function(_0x2fde7e,_0x1e18ca){_0x2fde7e[_0xeee0('0x59')][_0xeee0('0x6b')]=_0x2fde7e[_0xeee0('0x69')][_0xeee0('0x67')];return db[_0xeee0('0x33')][_0xeee0('0x50')]({'where':{'id':_0x2fde7e[_0xeee0('0x4c')]['id']}})[_0xeee0('0x29')](handleEntityNotFound(_0x1e18ca,null))[_0xeee0('0x29')](saveUpdates(_0x2fde7e['body'],null))['then'](respondWithResult(_0x1e18ca,null))[_0xeee0('0x1e')](handleError(_0x1e18ca,null));};exports[_0xeee0('0x6c')]=function(_0x2333f1,_0x2323a4){_0x2333f1['body'][_0xeee0('0x6d')]=_0x2333f1[_0xeee0('0x69')][_0xeee0('0x67')];return db[_0xeee0('0x33')][_0xeee0('0x50')]({'where':{'id':_0x2333f1['params']['id']}})[_0xeee0('0x29')](handleEntityNotFound(_0x2323a4,null))[_0xeee0('0x29')](saveUpdates(_0x2333f1[_0xeee0('0x59')],null))['then'](respondWithResult(_0x2323a4,null))['catch'](handleError(_0x2323a4,null));};exports[_0xeee0('0x6e')]=function(_0x441561,_0x116c1c){var _0x2205f4=path[_0xeee0('0x6f')](config[_0xeee0('0x70')],_0xeee0('0x71'));var _0x3eae00={'where':{'id':_0x441561['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x246a26=![];return require(_0xeee0('0x72'))[_0xeee0('0x73')]()[_0xeee0('0x29')](function(_0x134274){if(_0x134274){_0x246a26=_0x134274['custom'];}})[_0xeee0('0x29')](function(){return db[_0xeee0('0x33')][_0xeee0('0x50')](_0x3eae00);})[_0xeee0('0x29')](handleEntityNotFound(_0x116c1c,null))[_0xeee0('0x29')](function(_0x53d8cb){if(_0x53d8cb){if(!_[_0xeee0('0x74')](_0x53d8cb['sitepic'])){if(fs['existsSync'](path[_0xeee0('0x6f')](config[_0xeee0('0x70')],_0xeee0('0x75'),_0x53d8cb[_0xeee0('0x76')]))&&_0x246a26){_0x2205f4=path['join'](config[_0xeee0('0x70')],_0xeee0('0x75'),_0x53d8cb[_0xeee0('0x76')]);}}return _0x116c1c[_0xeee0('0x77')](_0x2205f4);}})[_0xeee0('0x1e')](handleError(_0x116c1c,null));};exports[_0xeee0('0x78')]=function(_0x4361bd,_0x58ef38){var _0x16e346=path[_0xeee0('0x6f')](config['root'],_0xeee0('0x79'));var _0x3877a9={'where':{'id':_0x4361bd['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db['ChatWebsite']['find'](_0x3877a9)[_0xeee0('0x29')](handleEntityNotFound(_0x58ef38,null))[_0xeee0('0x29')](function(_0x357c45){if(_0x357c45){if(!_[_0xeee0('0x74')](_0x357c45[_0xeee0('0x7a')])){if(fs[_0xeee0('0x7b')](path[_0xeee0('0x6f')](config['root'],_0xeee0('0x7c'),_0x357c45[_0xeee0('0x7a')]))){_0x16e346=path[_0xeee0('0x6f')](config[_0xeee0('0x70')],'server/files/images/avatars/',_0x357c45['agentAvatar']);}}return _0x58ef38[_0xeee0('0x77')](_0x16e346);}})[_0xeee0('0x1e')](handleError(_0x58ef38,null));};exports[_0xeee0('0x7d')]=function(_0x80e4cf,_0x4bff33){var _0x255d36=path['join'](config[_0xeee0('0x70')],_0xeee0('0x7e'));var _0x210acc={'where':{'id':_0x80e4cf[_0xeee0('0x4c')]['id']},'attributes':['id',_0xeee0('0x6b'),'showCustomerAvatar'],'raw':!![]};return db[_0xeee0('0x33')][_0xeee0('0x50')](_0x210acc)[_0xeee0('0x29')](handleEntityNotFound(_0x4bff33,null))['then'](function(_0x5c05eb){if(_0x5c05eb){if(!_[_0xeee0('0x74')](_0x5c05eb[_0xeee0('0x6b')])){if(fs[_0xeee0('0x7b')](path[_0xeee0('0x6f')](config[_0xeee0('0x70')],_0xeee0('0x7c'),_0x5c05eb[_0xeee0('0x6b')]))&&_0x5c05eb[_0xeee0('0x7f')]){_0x255d36=path[_0xeee0('0x6f')](config[_0xeee0('0x70')],_0xeee0('0x7c'),_0x5c05eb[_0xeee0('0x6b')]);}}return _0x4bff33[_0xeee0('0x77')](_0x255d36);}})['catch'](handleError(_0x4bff33,null));};exports[_0xeee0('0x80')]=function(_0x3f8d24,_0x31b836){var _0x271800=path['join'](config[_0xeee0('0x70')],'server/files/images/avatars/system_avatar.png');var _0x4a8722={'where':{'id':_0x3f8d24['params']['id']},'attributes':['id',_0xeee0('0x6d')],'raw':!![]};return db[_0xeee0('0x33')]['find'](_0x4a8722)[_0xeee0('0x29')](handleEntityNotFound(_0x31b836,null))[_0xeee0('0x29')](function(_0x257cff){if(_0x257cff){if(!_['isNil'](_0x257cff[_0xeee0('0x6d')])){if(fs[_0xeee0('0x7b')](path['join'](config[_0xeee0('0x70')],'server/files/images/avatars/',_0x257cff[_0xeee0('0x6d')]))){_0x271800=path['join'](config[_0xeee0('0x70')],_0xeee0('0x7c'),_0x257cff[_0xeee0('0x6d')]);}}return _0x31b836[_0xeee0('0x77')](_0x271800);}})[_0xeee0('0x1e')](handleError(_0x31b836,null));};exports[_0xeee0('0x81')]=function(_0x537e61,_0x3243e9){var _0x2f2fcb=require(_0xeee0('0x82'));var _0x5dbc8c=new _0x2f2fcb();var _0x5ca16d=_0x5dbc8c[_0xeee0('0x83')](_0x537e61[_0xeee0('0x84')][_0xeee0('0x85')])[_0xeee0('0x86')]();var _0x51a543={'body':_0x537e61['body'],'channel':_0xeee0('0x87')};var _0x222402=[];var _0x4f62ae=[];var _0xd30fc3={};var _0x23c690=![];return db[_0xeee0('0x88')][_0xeee0('0x5a')]()[_0xeee0('0x29')](function(_0xebe931){if(!_0xebe931){throw new db[(_0xeee0('0x89'))][(_0xeee0('0x8a'))](_0xeee0('0x8b'));}_0x222402=_[_0xeee0('0x8c')](_[_0xeee0('0x39')](_0xebe931),[_0xeee0('0x8d'),_0xeee0('0x8e')]);_0x4f62ae=_[_0xeee0('0x8c')](_['keys'](_0xebe931),['createdAt',_0xeee0('0x8e'),_0xeee0('0x8f'),_0xeee0('0x90')]);if(_0x537e61['body']['id']){delete _0x537e61['body']['id'];}if(_[_0xeee0('0x74')](_0x537e61[_0xeee0('0x59')]['from'])){throw new db[(_0xeee0('0x89'))]['ValidationError'](_0xeee0('0x91'));}if(_[_0xeee0('0x74')](_0x537e61[_0xeee0('0x59')][_0xeee0('0x59')])||_0x537e61['body'][_0xeee0('0x59')]===''){throw new db[(_0xeee0('0x89'))][(_0xeee0('0x8a'))](_0xeee0('0x92'));}if(_['isNil'](_0x537e61[_0xeee0('0x59')]['mapKey'])){throw new db[(_0xeee0('0x89'))][(_0xeee0('0x8a'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4f62ae);}if(!_[_0xeee0('0x93')](_0x4f62ae,_0x537e61[_0xeee0('0x59')]['mapKey'])){throw new db[(_0xeee0('0x89'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4f62ae);}_0xd30fc3[_0x537e61[_0xeee0('0x59')][_0xeee0('0x94')]]=_0x537e61[_0xeee0('0x59')][_0xeee0('0x95')];})['then'](function(){return db['ChatWebsite'][_0xeee0('0x50')]({'where':{'id':_0x537e61[_0xeee0('0x4c')]['id']},'include':[{'model':db[_0xeee0('0x96')],'as':_0xeee0('0x97'),'include':[{'model':db['CmContact'],'as':_0xeee0('0x98'),'where':_0xd30fc3,'limit':0x1,'order':[[_0xeee0('0x8e'),_0xeee0('0x99')]]}]},{'model':db['ChatApplication'],'as':'Applications'}]});})[_0xeee0('0x29')](handleEntityNotFound(_0x3243e9,null))[_0xeee0('0x29')](function(_0x31f899){if(_0x31f899&&_0x31f899[_0xeee0('0x97')]){_0x51a543[_0xeee0('0x9a')]=_0x31f899;_0x51a543[_0xeee0('0x9b')]=_0x31f899[_0xeee0('0x9c')];_0x51a543[_0xeee0('0x9d')]=_0x31f899['List'];_0x51a543[_0xeee0('0x9b')]=_['orderBy'](_0x51a543[_0xeee0('0x9b')],['priority'],[_0xeee0('0x9e')]);if(_0x51a543[_0xeee0('0x9a')][_0xeee0('0x9c')]){delete _0x51a543[_0xeee0('0x9a')][_0xeee0('0x9c')];}if(_0x51a543[_0xeee0('0x9a')][_0xeee0('0x97')]&&_0x51a543['account']['List'][_0xeee0('0x98')][_0xeee0('0x3e')]){return _0x51a543[_0xeee0('0x9a')][_0xeee0('0x97')][_0xeee0('0x98')][0x0];}var _0x1ad541=_[_0xeee0('0xc')](_0x537e61[_0xeee0('0x59')],{'firstName':_0x537e61[_0xeee0('0x59')][_0xeee0('0x95')],'ListId':_0x31f899[_0xeee0('0x90')]});_0x1ad541[_0x537e61[_0xeee0('0x59')]['mapKey']]=_0x537e61[_0xeee0('0x59')][_0xeee0('0x95')];return db['CmContact'][_0xeee0('0x51')](_0x1ad541,{'fields':_0x222402,'raw':!![]});}})[_0xeee0('0x29')](handleEntityNotFound(_0x3243e9,null))[_0xeee0('0x29')](function(_0xe3a476){_0x51a543[_0xeee0('0x9f')]=_0xe3a476;var _0x1ee22b=_0x537e61[_0xeee0('0x59')]['customerIp'];if(_0x537e61[_0xeee0('0x84')][_0xeee0('0xa0')]){_0x1ee22b=_0x537e61[_0xeee0('0x84')]['cf-connecting-ip'];}else if(_0x537e61['headers'][_0xeee0('0xa1')]){_0x1ee22b=_['first'](_0x537e61[_0xeee0('0x84')][_0xeee0('0xa1')]['split'](','));}if(_0xe3a476){var _0x4884b9={'ContactId':_0xe3a476['id'],'ChatWebsiteId':_0x537e61['params']['id'],'from':(_0xe3a476['firstName']||'')+'\x20'+(_0xe3a476[_0xeee0('0xa2')]||''),'customerIp':_0x1ee22b,'customerPort':_0x537e61['headers'][_0xeee0('0xa3')]?_0x537e61[_0xeee0('0x84')]['x-real-port']:null,'referer':_0x537e61[_0xeee0('0x59')][_0xeee0('0xa4')],'browserName':_0x5ca16d[_0xeee0('0xa5')][_0xeee0('0x49')]&&_0x5ca16d[_0xeee0('0xa5')][_0xeee0('0xa6')]?util[_0xeee0('0xa7')](_0xeee0('0xa8'),_0x5ca16d[_0xeee0('0xa5')]['name'],_0x5ca16d['browser'][_0xeee0('0xa6')]):'unknown','browserVersion':_0x5ca16d[_0xeee0('0xa5')][_0xeee0('0xa6')]||_0xeee0('0xa9'),'osName':util[_0xeee0('0xa7')]('%s\x20%s',_0x5ca16d['os']['name'],_0x5ca16d['os'][_0xeee0('0xa6')]),'osVersion':_0x5ca16d['os'][_0xeee0('0xa6')],'deviceModel':_0x5ca16d[_0xeee0('0xaa')]['model']&&_0x5ca16d['device'][_0xeee0('0xab')]?util[_0xeee0('0xa7')](_0xeee0('0xac'),_0x5ca16d[_0xeee0('0xaa')][_0xeee0('0x37')],_0x5ca16d[_0xeee0('0xaa')]['vendor'],_0x5ca16d['device']['type']):null,'deviceVendor':_0x5ca16d[_0xeee0('0xaa')][_0xeee0('0xab')],'deviceType':_0x5ca16d[_0xeee0('0xaa')][_0xeee0('0x35')],'formData':JSON[_0xeee0('0xad')](_0x537e61[_0xeee0('0x59')])};var _0x1a57e5={'ChatWebsiteId':_0x537e61['params']['id'],'closed':![]};if(_0x537e61[_0xeee0('0x59')][_0xeee0('0xae')]){_0x1a57e5[_0xeee0('0xae')]=_0x537e61[_0xeee0('0x59')]['threadId'];return db['ChatInteraction'][_0xeee0('0x50')]({'where':_0x1a57e5})['then'](function(_0x4f32b2){if(_0x4f32b2){return[_0x4f32b2,![]];}_0x4884b9[_0xeee0('0xae')]=_0x537e61[_0xeee0('0x59')][_0xeee0('0xae')];_0x4884b9['externalUrl']=_0x537e61[_0xeee0('0x59')][_0xeee0('0xaf')];return db[_0xeee0('0xb0')][_0xeee0('0x51')](_0x4884b9)['then'](function(_0x555f1a){return[_0x555f1a,!![]];});});}_0x1a57e5[_0xeee0('0xb1')]=_0xe3a476['id'];if(_0x537e61[_0xeee0('0x59')][_0xeee0('0xb2')]&&_0x537e61[_0xeee0('0x59')][_0xeee0('0xb2')]['id']){_0x1a57e5['id']=_0x537e61[_0xeee0('0x59')]['interaction']['id'];return db[_0xeee0('0xb0')][_0xeee0('0x50')]({'where':_0x1a57e5})[_0xeee0('0x29')](function(_0x3cb85e){if(_0x3cb85e){return[_0x3cb85e,![]];}return db['ChatInteraction'][_0xeee0('0x51')](_0x4884b9)[_0xeee0('0x29')](function(_0x3a582a){return[_0x3a582a,!![]];});});}return db[_0xeee0('0xb0')][_0xeee0('0x51')](_0x4884b9)[_0xeee0('0x29')](function(_0x209eb9){return[_0x209eb9,!![]];});}})['spread'](function(_0x5e7e13,_0x598250){if(_0x5e7e13){_0x23c690=_0x598250;if(!_0x598250){var _0xc178fc={'from':(_0x51a543[_0xeee0('0x9f')]['firstName']||'')+'\x20'+(_0x51a543[_0xeee0('0x9f')]['lastName']||'')};if(_0x537e61[_0xeee0('0x59')][_0xeee0('0xae')]&&_0x537e61[_0xeee0('0x59')][_0xeee0('0xb3')]&&_0x537e61[_0xeee0('0x59')][_0xeee0('0xae')]!=_0x537e61[_0xeee0('0x59')][_0xeee0('0xb3')]){_0xc178fc['threadId']=_0x537e61['body']['messageId'];}return _0x5e7e13[_0xeee0('0x28')](_0xc178fc);}else{return _0x5e7e13;}}})[_0xeee0('0x29')](function(_0x3d938c){_0x51a543[_0xeee0('0xb2')]=_0x3d938c[_0xeee0('0x53')]({'plain':!![]});_0x51a543['interaction'][_0xeee0('0xb4')]=_0x23c690;if(_0x51a543['interaction']['created']){if(_0x51a543[_0xeee0('0x9a')]['autoclose']){_0x51a543[_0xeee0('0x9b')][_0xeee0('0xb5')]({'id':0x0,'priority':_0x51a543[_0xeee0('0x9b')][_0xeee0('0x3e')]+0x1,'app':_0xeee0('0xb6'),'appdata':_0xeee0('0xb7'),'interval':_0xeee0('0xb8')});}}return db['ChatMessage']['create']({'body':_0x537e61[_0xeee0('0x59')][_0xeee0('0x59')],'ChatWebsiteId':_0x537e61[_0xeee0('0x4c')]['id'],'ChatInteractionId':_0x3d938c['id'],'direction':'in','ContactId':_0x51a543[_0xeee0('0x9f')]['id'],'AttachmentId':_0x537e61[_0xeee0('0x59')][_0xeee0('0xb9')]});})['then'](function(_0x57afb9){_0x51a543[_0xeee0('0x1b')]=_0x57afb9;if(_0x51a543[_0xeee0('0xb2')][_0xeee0('0xba')]){return db[_0xeee0('0xbb')][_0xeee0('0x50')]({'attributes':['id',_0xeee0('0x49')],'where':{'id':_0x51a543['interaction']['UserId']}})[_0xeee0('0x29')](function(_0x34491f){if(_0x34491f){_0x51a543[_0xeee0('0x9b')][_0xeee0('0xbc')]({'id':0x0,'priority':0x0,'app':_0xeee0('0xbd'),'appdata':_0x34491f[_0xeee0('0x49')]+','+(_0x51a543['account'][_0xeee0('0xbe')]||0xa),'interval':_0xeee0('0xb8')});_0x51a543['forcedOwnership']=!![];}return respondWithRpcPromise(_0xeee0('0xbf'),'startRouting',_0x51a543);});}return respondWithRpcPromise(_0xeee0('0xbf'),_0xeee0('0xc0'),_0x51a543);})[_0xeee0('0x29')](function(_0x1d2f0f){respondWithRpcPromise(_0xeee0('0xc1'),_0xeee0('0xc1'),{'event':'notify','message':_0x1d2f0f},client9002);return _0x1d2f0f;})['then'](respondWithResult(_0x3243e9,null))[_0xeee0('0x1e')](handleError(_0x3243e9,null));};exports[_0xeee0('0xc2')]=function(_0x10f762,_0x491093){var _0x482e01,_0x2cb0ea,_0x33beb3;var _0x191b48=[];var _0x5c4e44={};var _0x2dec3d=_0x10f762[_0xeee0('0xc3')]||[];var _0x2235ed=[];var _0x4d6f13;return db[_0xeee0('0x88')][_0xeee0('0x5a')]()[_0xeee0('0x29')](function(_0x5eebb6){if(!_0x5eebb6){throw new db[(_0xeee0('0x89'))][(_0xeee0('0x8a'))](_0xeee0('0x8b'));}_0x191b48=_[_0xeee0('0x8c')](_['keys'](_0x5eebb6),['createdAt',_0xeee0('0x8e'),'CompanyId',_0xeee0('0x90')]);if(_0x10f762[_0xeee0('0x59')]['id']){delete _0x10f762[_0xeee0('0x59')]['id'];}if(_[_0xeee0('0x74')](_0x10f762[_0xeee0('0x59')][_0xeee0('0x95')])){throw _0x491093[_0xeee0('0x20')](0x1f4)[_0xeee0('0x2e')](new db['Sequelize'][(_0xeee0('0x8a'))](_0xeee0('0x91')));}if(_[_0xeee0('0x74')](_0x10f762[_0xeee0('0x59')][_0xeee0('0x59')])||_0x10f762[_0xeee0('0x59')][_0xeee0('0x59')]===''){throw _0x491093[_0xeee0('0x20')](0x1f4)['send'](new db[(_0xeee0('0x89'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xeee0('0x74')](_0x10f762[_0xeee0('0x59')]['mapKeyOffline'])){throw _0x491093['status'](0x1f4)[_0xeee0('0x2e')](new db[(_0xeee0('0x89'))][(_0xeee0('0x8a'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x191b48));}if(!_[_0xeee0('0x93')](_0x191b48,_0x10f762[_0xeee0('0x59')][_0xeee0('0xc4')])){throw _0x491093['status'](0x1f4)['send'](new db[(_0xeee0('0x89'))][(_0xeee0('0x8a'))](_0xeee0('0xc5')+_0x191b48));}_0x5c4e44[_0x10f762['body'][_0xeee0('0xc4')]]=_0x10f762[_0xeee0('0x59')][_0xeee0('0x95')];})[_0xeee0('0x29')](function(){return db[_0xeee0('0x33')][_0xeee0('0x50')]({'where':{'id':_0x10f762[_0xeee0('0x4c')]['id']},'include':[{'model':db[_0xeee0('0x96')],'as':_0xeee0('0x97')},{'model':db[_0xeee0('0xc6')],'as':_0xeee0('0xc6')}]});})['then'](handleEntityNotFound(_0x491093,null))[_0xeee0('0x29')](function(_0x365edd){if(_0x365edd&&_0x365edd[_0xeee0('0x97')]){_0x2cb0ea=_0x365edd;var _0x20d9ed=_[_0xeee0('0xc')](_0x10f762[_0xeee0('0x59')],{'firstName':_0x10f762['body'][_0xeee0('0x95')],'phone':_0x10f762[_0xeee0('0x59')][_0xeee0('0x95')],'ListId':_0x365edd[_0xeee0('0x90')]});_0x20d9ed[_0x10f762[_0xeee0('0x59')]['mapKeyOffline']]=_0x10f762[_0xeee0('0x59')][_0xeee0('0x95')];return db[_0xeee0('0x88')][_0xeee0('0xc7')]({'where':_0x5c4e44,'defaults':_0x20d9ed});}})[_0xeee0('0xc8')](function(_0x435608){if(_0x435608){_0x33beb3=_0x435608;var _0x4ac442=fs['readFileSync'](path[_0xeee0('0x6f')](config[_0xeee0('0x70')],_0xeee0('0xc9')),_0xeee0('0xca'));var _0x20a62f=ejs['render'](_0x4ac442,{'body':_['toPairs'](_0x10f762[_0xeee0('0x59')]['body']),'bodyTitle':_0x2cb0ea[_0xeee0('0xcb')]});return db[_0xeee0('0xcc')][_0xeee0('0x51')]({'body':_0x20a62f,'plainBody':htmlToText[_0xeee0('0xcd')](_0x20a62f),'ContactId':_0x435608['id'],'ChatWebsiteId':_0x2cb0ea['id']});}})[_0xeee0('0x29')](function(_0x8cdeaa){_0x4d6f13=_0x8cdeaa;if(_0x2dec3d[_0xeee0('0x3e')]){var _0x2a52fb=_0x2dec3d[_0xeee0('0x32')](function(_0x3b4ed6){return{'name':_0x3b4ed6[_0xeee0('0xce')],'basename':_0x3b4ed6[_0xeee0('0x67')],'type':_0x3b4ed6[_0xeee0('0xcf')],'ChatOfflineMessageId':_0x8cdeaa['id']};});_0x2235ed=_0x2a52fb[_0xeee0('0x32')](_0x485833=>{var _0x356144={'filename':_0x485833[_0xeee0('0x49')],'path':path['join'](config[_0xeee0('0x70')],_0xeee0('0xd0'),'files',_0xeee0('0xd1'),_0xeee0('0xd2'),_0x485833['basename'])};return _0x356144;});if(!_0x2cb0ea[_0xeee0('0xd3')]){return db['sequelize'][_0xeee0('0xd4')](function(_0x5d9956){return db[_0xeee0('0xd5')]['bulkCreate'](_0x2a52fb,{'transaction':_0x5d9956});});}}})[_0xeee0('0x29')](function(){if(_0x4d6f13){_0x482e01=_0x4d6f13;return db[_0xeee0('0xc6')][_0xeee0('0x5f')]({'where':{'service':!![]},'include':[{'model':db[_0xeee0('0xd6')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xeee0('0xd7')],'as':'CloudProvider','raw':!![]}]}]});}})[_0xeee0('0x29')](function(_0x33682c){if(_0x33682c&&_0x33682c['Smtp']&&_0x2cb0ea[_0xeee0('0xd8')]&&_0x2cb0ea['forwardOfflineAddress']){var _0x555cea=_0x33682c[_0xeee0('0xd9')]();return respondWithRpcPromise(_0xeee0('0xda'),_0xeee0('0xdb'),{'account':_0x555cea,'message':{'from':util['format'](_0xeee0('0xdc'),_0x33682c[_0xeee0('0x49')],_0x33682c[_0xeee0('0xdd')]||_0x33682c[_0xeee0('0xde')]['user']),'to':_0x2cb0ea[_0xeee0('0xdf')],'subject':_0x2cb0ea[_0xeee0('0xe0')],'html':_0x482e01[_0xeee0('0x59')],'attachments':_0x2235ed}},client9003)[_0xeee0('0x29')](function(){return _0x482e01;})[_0xeee0('0x1e')](function(_0xe7b1ee){logger[_0xeee0('0x18')](_0xe7b1ee);});}})[_0xeee0('0x29')](function(){if(_0x2cb0ea&&_0x2cb0ea[_0xeee0('0xd3')]&&_0x2cb0ea['MailAccountId']){var _0x4d8595=[];if(_0x2dec3d[_0xeee0('0x3e')]){_0x4d8595=_0x2dec3d[_0xeee0('0x32')](function(_0x2ac57c){return{'name':_0x2ac57c[_0xeee0('0xce')],'basename':_0x2ac57c['filename'],'type':_0x2ac57c[_0xeee0('0xcf')],'ChatOfflineMessageId':_0x4d6f13['id']};});}var _0x5824ef;if(!_[_0xeee0('0x74')](_0x2cb0ea[_0xeee0('0xe1')])){var _0x1f4379=_['map'](_0x10f762[_0xeee0('0x59')],function(_0xad477){return _0xad477;});var _0x1208f3=_[_0xeee0('0xe2')](_0x1f4379)[0x0];var _0x4b0e35=_['mapValues'](_0x1208f3,function(_0x5d86ab){return _0x5d86ab;});_0x5824ef=_0x4b0e35[0x1][_0x2cb0ea['subjectOffline']];}var _0x59428d={'from':_0x33beb3[_0xeee0('0xdd')],'firstName':_0x33beb3[_0xeee0('0xe3')],'lastName':_0x33beb3[_0xeee0('0xa2')],'mapKey':_0xeee0('0xdd'),'message':{'from':_0x33beb3[_0xeee0('0xdd')],'to':_0x2cb0ea[_0xeee0('0xc6')][_0xeee0('0xdd')],'cc':'','subject':_[_0xeee0('0x74')](_0x5824ef)?_0x2cb0ea[_0xeee0('0xe0')]:_0x5824ef,'messageId':'','sentAt':new Date(),'attach':_0x4d8595[_0xeee0('0x3e')],'attachments':_0x4d8595,'originChannel':'Chat','ChatWebsiteId':_0x2cb0ea['id'],'ChatOfflineMessageId':_0x482e01['id'],'originTo':_0x2cb0ea[_0xeee0('0xc6')][_0xeee0('0xdd')]},'body':_0x482e01[_0xeee0('0x59')]};var _0x57ec85={'account':{'id':_0x2cb0ea['MailAccountId']},'body':_0x59428d,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount',_0xeee0('0xe4'),_0x57ec85,client9001)['then'](function(){return _0x482e01;})[_0xeee0('0x1e')](function(_0x5b7a1b){logger[_0xeee0('0x18')](_0x5b7a1b);});}return;})[_0xeee0('0x29')](function(){if(_0x482e01){return _0x482e01;}})['then'](respondWithResult(_0x491093,null))[_0xeee0('0x1e')](function(_0x541e7e){logger[_0xeee0('0x18')](_0xeee0('0x1e'),_0x541e7e);for(var _0xafef87 of _0x2dec3d){var _0x309d0b=path[_0xeee0('0x6f')](config[_0xeee0('0x70')],_0xeee0('0xd0'),_0xeee0('0xc3'),_0xeee0('0xd1'),_0xeee0('0xd2'),_0xafef87[_0xeee0('0x67')]);fs_extra[_0xeee0('0xe5')](_0x309d0b)[_0xeee0('0x1e')](function(_0x24caea){logger[_0xeee0('0x18')]('Could\x20not\x20remove\x20attachment\x20file',_0x309d0b,_0x24caea);});}});};exports[_0xeee0('0xe6')]=function(_0x398b7a,_0x2753cf){return db[_0xeee0('0xb0')]['find']({'where':{'id':_0x398b7a[_0xeee0('0x4c')]['id']}})[_0xeee0('0x29')](handleEntityNotFound(_0x2753cf,null))[_0xeee0('0x29')](function(_0x2f3b73){if(_0x2f3b73){return _0x2f3b73[_0xeee0('0xe6')](_0x398b7a[_0xeee0('0x59')][_0xeee0('0x61')],_[_0xeee0('0xe7')](_0x398b7a['body'],[_0xeee0('0x61'),'id'])||{});}})[_0xeee0('0x29')](respondWithResult(_0x2753cf,null))[_0xeee0('0x1e')](handleError(_0x2753cf,null));};exports[_0xeee0('0xe8')]=function(_0x4aff06,_0xbb33e0){var _0x871bf3={'raw':![],'where':{}};var _0x40c6ca={};var _0x5a08a4={'count':0x0,'rows':[]};return db[_0xeee0('0x33')][_0xeee0('0x5f')]({'where':{'id':_0x4aff06[_0xeee0('0x4c')]['id']}})[_0xeee0('0x29')](handleEntityNotFound(_0xbb33e0,null))[_0xeee0('0x29')](function(_0x2e4d6c){if(_0x2e4d6c){_0x40c6ca[_0xeee0('0x37')]=_[_0xeee0('0x39')](db[_0xeee0('0xb0')]['rawAttributes']);_0x40c6ca[_0xeee0('0x38')]=_[_0xeee0('0x39')](_0x4aff06[_0xeee0('0x38')]);_0x40c6ca[_0xeee0('0x3a')]=_[_0xeee0('0x3b')](_0x40c6ca['model'],_0x40c6ca['query']);_0x871bf3[_0xeee0('0x3c')]=_[_0xeee0('0x3b')](_0x40c6ca[_0xeee0('0x37')],qs[_0xeee0('0x3d')](_0x4aff06['query']['fields']));_0x871bf3[_0xeee0('0x3c')]=_0x871bf3['attributes']['length']?_0x871bf3[_0xeee0('0x3c')]:_0x40c6ca[_0xeee0('0x37')];if(!_0x4aff06['query'][_0xeee0('0x3f')](_0xeee0('0x40'))){_0x871bf3[_0xeee0('0x25')]=qs['limit'](_0x4aff06[_0xeee0('0x38')][_0xeee0('0x25')]);_0x871bf3[_0xeee0('0x41')]=qs[_0xeee0('0x41')](_0x4aff06['query'][_0xeee0('0x41')]);}_0x871bf3[_0xeee0('0x42')]=qs[_0xeee0('0x43')](_0x4aff06[_0xeee0('0x38')][_0xeee0('0x43')]);_0x871bf3['where']=qs['filters'](_[_0xeee0('0x45')](_0x4aff06[_0xeee0('0x38')],_0x40c6ca['filters']));_0x871bf3['where']['ChatWebsiteId']=_0x2e4d6c['id'];if(_0x4aff06['query']['filter']){_0x871bf3[_0xeee0('0x44')]=_[_0xeee0('0x47')](_0x871bf3['where'],{'$or':_['map'](_0x871bf3[_0xeee0('0x3c')],function(_0x11538c){var _0x3944d9={};_0x3944d9[_0x11538c]={'$like':'%'+_0x4aff06[_0xeee0('0x38')]['filter']+'%'};return _0x3944d9;})});}_0x871bf3=_[_0xeee0('0x47')]({},_0x871bf3,_0x4aff06['options']);return db['ChatInteraction'][_0xeee0('0x24')]({'where':_0x871bf3[_0xeee0('0x44')]})[_0xeee0('0x29')](function(_0x14aa61){_0x5a08a4[_0xeee0('0x24')]=_0x14aa61;if(_0x4aff06[_0xeee0('0x38')][_0xeee0('0x4a')]){_0x871bf3[_0xeee0('0x4e')]=[{'model':db[_0xeee0('0x88')],'as':'Contact','required':![]},{'model':db[_0xeee0('0xbb')],'as':_0xeee0('0xe9'),'attributes':[_0xeee0('0x49'),'fullname',_0xeee0('0xea')],'required':![]},{'model':db[_0xeee0('0xeb')],'as':'Tags','attributes':['id',_0xeee0('0x49'),'color'],'where':_0x4aff06['query'][_0xeee0('0xec')]?{'id':_0x4aff06[_0xeee0('0x38')]['tag']}:undefined,'required':_0x4aff06['query'][_0xeee0('0xec')]?!![]:![]}];}return db[_0xeee0('0xb0')][_0xeee0('0x4b')](_0x871bf3);})[_0xeee0('0x29')](function(_0x17cac0){_0x5a08a4[_0xeee0('0x64')]=_0x17cac0;return _0x5a08a4;});}})['then'](respondWithFilteredResult(_0xbb33e0,_0x871bf3))[_0xeee0('0x1e')](handleError(_0xbb33e0,null));};function iftimePromise(_0x1977ae,_0x511c23){return respondWithRpcPromise(_0xeee0('0xed'),_0xeee0('0xee'),{'command':_0x511c23[_0xeee0('0xef')]?util[_0xeee0('0xa7')](_0xeee0('0xf0'),_0x1977ae[_0xeee0('0xf1')],_0x511c23[_0xeee0('0xef')]):util[_0xeee0('0xa7')](_0xeee0('0xf2'),_0x1977ae[_0xeee0('0xf1')])},client9002)[_0xeee0('0x29')](function(_0x1e7c2f){var _0x5cdbf8=_0x1e7c2f&&_0x1e7c2f[_0xeee0('0xf3')](_0xeee0('0xf4'))>=0x0?!![]:![];logger[_0xeee0('0x1c')](_0xeee0('0xf5'),_0x511c23['id'],_0x1977ae['id'],_0x1977ae['interval'],_0x5cdbf8?'ONLINE':_0xeee0('0xf6'),_0x511c23[_0xeee0('0xef')]?_0x511c23[_0xeee0('0xef')]:'No\x20timezone');return _0x5cdbf8;})[_0xeee0('0x1e')](function(_0xa1046c){logger[_0xeee0('0x18')](_0xeee0('0xf5'),_0x511c23['id'],_0x1977ae['id'],_0x1977ae[_0xeee0('0xf1')],util[_0xeee0('0xf7')](_0xa1046c,{'showHidden':![],'depth':null}),_0x511c23[_0xeee0('0xef')]?_0x511c23[_0xeee0('0xef')]:_0xeee0('0xf8'));return![];});}exports[_0xeee0('0xee')]=function(_0x163bfc,_0x1a23d2){var _0x1a7234=0x0;var _0x384843=0x0;var _0x130df5=![];var _0x279918;var _0x430158;return db[_0xeee0('0x33')][_0xeee0('0x50')]({'where':{'id':_0x163bfc['params']['id']},'include':[{'model':db['Interval'],'as':_0xeee0('0xf9'),'include':[{'model':db[_0xeee0('0xf9')],'as':'Intervals','attributes':['id',_0xeee0('0xf1')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x1a23d2,null))[_0xeee0('0x29')](function(_0x874935){if(_0x874935){_0x279918=_0x874935;return _0x874935[_0xeee0('0xfa')]({'raw':!![]});}})['then'](function(_0x340bd1){if(_0x279918){if(_0x340bd1){_0x430158=_0x340bd1;}}return require(_0xeee0('0x72'))[_0xeee0('0x73')]();})[_0xeee0('0x29')](function(_0x5b7941){if(_0x5b7941){_0x384843=_0x5b7941[_0xeee0('0xfb')];_0x130df5=_0x5b7941[_0xeee0('0xfc')];}})[_0xeee0('0x29')](function(){return db['ChatInteraction'][_0xeee0('0x24')]({'where':{'closed':![]}});})[_0xeee0('0x29')](function(_0x46d237){_0x1a7234=_0x46d237;if(_0x384843&&_0x46d237>_0x384843){return db[_0xeee0('0xfd')][_0xeee0('0x5f')]({'where':{'id':0x1}})[_0xeee0('0x29')](function(_0x39bcf9){if(_0x39bcf9){_0x39bcf9['increment']('chatLicenseExceeded');}});}})[_0xeee0('0x29')](function(){if(_0x279918['Interval']&&_0x279918[_0xeee0('0xf9')][_0xeee0('0xfe')]){var _0x1f813e=[];for(var _0x15aef2=0x0;_0x15aef2<_0x279918['Interval'][_0xeee0('0xfe')][_0xeee0('0x3e')];_0x15aef2++){var _0x1a3e61=_0x279918[_0xeee0('0xf9')][_0xeee0('0xfe')][_0x15aef2]['get']({'plain':!![]});_0x1f813e[_0xeee0('0xb5')](iftimePromise(_0x1a3e61,_0x279918));}return BPromise[_0xeee0('0xff')](_0x1f813e)[_0xeee0('0x29')](function(_0x580847){return _[_0xeee0('0x100')](_0x580847);});}else{return!![];}})['then'](function(_0x1329b1){var _0x24a58c=fs[_0xeee0('0x101')](path[_0xeee0('0x6f')](config[_0xeee0('0x70')],'server/files/chat/iframe.ejs'),_0xeee0('0xca'));var _0x3b6584=new url['URL'](_0x279918[_0xeee0('0x102')])[_0xeee0('0x103')];var _0x276a05=_0xeee0('0x104');var _0x3c6a36=![];var _0x25d45a={'chatVersion':_0x276a05,'chatWebsiteAddressOrigin':_0x3b6584,'remote':_0x279918[_0xeee0('0x105')],'query':querystring['stringify'](_[_0xeee0('0x47')](_0x279918[_0xeee0('0x53')]({'plain':!![]}),{'customerIp':_0x163bfc[_0xeee0('0x84')]['x-forwarded-for']||_0x163bfc[_0xeee0('0x84')][_0xeee0('0x106')]||_0x163bfc[_0xeee0('0x107')][_0xeee0('0x108')]||_0x163bfc['ip'],'referer':_0x163bfc['headers']['referer'],'openedInteractions':_0x1a7234,'maxInteractions':_0x384843,'virtual':_0x130df5['virtual'],'online':_0x1329b1,'custom':_0x130df5}))['replace'](/'/g,'\x5c\x27')};_0x1a23d2[_0xeee0('0x2e')](ejs[_0xeee0('0x109')](Mustache[_0xeee0('0x109')](_0x24a58c,_0x25d45a),{'proactiveActions':_0x430158,'alignment':_0x279918[_0xeee0('0x10a')],'verticalAlignment':_0x279918[_0xeee0('0x10b')],'div_color':_0x279918[_0xeee0('0x10c')],'labelText':_0x279918['labelText'],'text_color':_0x279918[_0xeee0('0x10d')],'text_button_color':_0x279918['textButtonColor'],'button_color':_0x279918[_0xeee0('0x10e')],'background_color':_0x279918['backgroundColor'],'hideWhenOffline':_0x279918[_0xeee0('0x10f')],'intervalId':_0x279918[_0xeee0('0x110')],'isDevelopment':_0x3c6a36,'chatVersion':_0x276a05}));})['catch'](handleError(_0x1a23d2,null));};exports['addApplications']=function(_0x5574d4,_0x149246){var _0x3dedfe=_0x5574d4[_0xeee0('0x4c')]['id'];var _0x5f460a=_0x5574d4[_0xeee0('0x59')];var _0x3557d4=0xc8;var _0x300943=null;return db[_0xeee0('0x111')][_0xeee0('0xd4')]({'isolationLevel':db[_0xeee0('0x111')]['Transaction']['ISOLATION_LEVELS'][_0xeee0('0x112')]},function(_0x4dfb6c){return db['ChatWebsite'][_0xeee0('0x5f')]({'where':{'id':_0x3dedfe},'transaction':_0x4dfb6c})[_0xeee0('0x29')](function(_0x328c3a){if(_0x328c3a){return db[_0xeee0('0x113')][_0xeee0('0x2a')]({'where':{'ChatWebsiteId':_0x3dedfe},'transaction':_0x4dfb6c})['then'](function(){var _0x7466f9=_[_0xeee0('0x32')](_0x5f460a,function(_0x28e99e){_0x28e99e[_0xeee0('0x5c')]=_0x3dedfe;return _0x28e99e;});return db[_0xeee0('0x113')][_0xeee0('0x114')](_0x7466f9,{'transaction':_0x4dfb6c});});}else{_0x3557d4=0x194;_0x300943=[];}});})[_0xeee0('0x29')](function(){if(_0x3557d4!==0x194){return db[_0xeee0('0x113')][_0xeee0('0x115')]({'where':{'ChatWebsiteId':_0x3dedfe},'order':_0xeee0('0x116')})[_0xeee0('0x29')](function(_0x25facc){_0x300943=_0x25facc;});}})[_0xeee0('0x1e')](function(_0x352629){_0x3557d4=0x1f4;logger['error'](_0x352629[_0xeee0('0x2d')]);if(_0x352629[_0xeee0('0x49')]){delete _0x352629[_0xeee0('0x49')];}_0x300943=_0x352629;})[_0xeee0('0x117')](function(){if(_0x300943===null){_0x149246['sendStatus'](_0x3557d4);}else{if(_0x3557d4===0x1f4){_0x149246[_0xeee0('0x20')](_0x3557d4)[_0xeee0('0x2e')](_0x300943);}else{_0x149246[_0xeee0('0x20')](_0x3557d4)['json'](_0x300943);}}});};exports['getApplications']=function(_0x4a281b,_0x50fc61){var _0x49a108={};var _0x33329e={};var _0x53e80f;var _0x4ae2ff;return db[_0xeee0('0x33')]['findOne']({'where':{'id':_0x4a281b['params']['id']}})['then'](handleEntityNotFound(_0x50fc61,null))['then'](function(_0x154f14){if(_0x154f14){_0x53e80f=_0x154f14;_0x33329e[_0xeee0('0x37')]=_[_0xeee0('0x39')](db[_0xeee0('0x113')][_0xeee0('0x4d')]);_0x33329e['query']=_['keys'](_0x4a281b[_0xeee0('0x38')]);_0x33329e[_0xeee0('0x3a')]=_[_0xeee0('0x3b')](_0x33329e[_0xeee0('0x37')],_0x33329e[_0xeee0('0x38')]);_0x49a108['attributes']=_['intersection'](_0x33329e[_0xeee0('0x37')],qs[_0xeee0('0x3d')](_0x4a281b['query']['fields']));_0x49a108['attributes']=_0x49a108[_0xeee0('0x3c')]['length']?_0x49a108[_0xeee0('0x3c')]:_0x33329e[_0xeee0('0x37')];_0x49a108[_0xeee0('0x42')]=qs[_0xeee0('0x43')](_0x4a281b[_0xeee0('0x38')][_0xeee0('0x43')]);_0x49a108[_0xeee0('0x44')]=qs[_0xeee0('0x3a')](_['pick'](_0x4a281b[_0xeee0('0x38')],_0x33329e[_0xeee0('0x3a')]));if(_0x4a281b['query'][_0xeee0('0x46')]){_0x49a108[_0xeee0('0x44')]=_[_0xeee0('0x47')](_0x49a108[_0xeee0('0x44')],{'$or':_['map'](_0x49a108[_0xeee0('0x3c')],function(_0x3dbd36){var _0xa0b35a={};_0xa0b35a[_0x3dbd36]={'$like':'%'+_0x4a281b[_0xeee0('0x38')][_0xeee0('0x46')]+'%'};return _0xa0b35a;})});}_0x49a108=_[_0xeee0('0x47')]({},_0x49a108,_0x4a281b[_0xeee0('0x4f')]);return _0x53e80f[_0xeee0('0x118')](_0x49a108);}})['then'](function(_0x339c95){if(_0x339c95){_0x4ae2ff=_0x339c95[_0xeee0('0x3e')];if(!_0x4a281b[_0xeee0('0x38')][_0xeee0('0x3f')]('nolimit')){_0x49a108[_0xeee0('0x25')]=qs[_0xeee0('0x25')](_0x4a281b[_0xeee0('0x38')][_0xeee0('0x25')]);_0x49a108['offset']=qs[_0xeee0('0x41')](_0x4a281b[_0xeee0('0x38')]['offset']);}return _0x53e80f[_0xeee0('0x118')](_0x49a108);}})['then'](function(_0x397faf){if(_0x397faf){return _0x397faf?{'count':_0x4ae2ff,'rows':_0x397faf}:null;}})['then'](respondWithResult(_0x50fc61,null))[_0xeee0('0x1e')](handleError(_0x50fc61,null));};exports[_0xeee0('0x119')]=function(_0x57380f,_0x4f7024){return db[_0xeee0('0x11a')][_0xeee0('0x50')]({'where':{'id':_0x57380f[_0xeee0('0x4c')]['id']}})[_0xeee0('0x29')](handleEntityNotFound(_0x4f7024,null))[_0xeee0('0x29')](function(_0x1e3d9b){if(_0x1e3d9b){return _0x1e3d9b[_0xeee0('0x119')](_0x57380f[_0xeee0('0x59')][_0xeee0('0x61')],_[_0xeee0('0xe7')](_0x57380f[_0xeee0('0x59')],[_0xeee0('0x61'),'id'])||{});}})[_0xeee0('0x29')](respondWithResult(_0x4f7024,null))[_0xeee0('0x1e')](handleError(_0x4f7024,null));};exports[_0xeee0('0xfa')]=function(_0x441858,_0x443f39){var _0x53d5bc={};var _0x58fbc0={};var _0x484b7a;var _0xb59ce7;return db['ChatWebsite']['findOne']({'where':{'id':_0x441858[_0xeee0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x443f39,null))['then'](function(_0x1c8edc){if(_0x1c8edc){_0x484b7a=_0x1c8edc;_0x58fbc0[_0xeee0('0x37')]=_['keys'](db[_0xeee0('0x11b')][_0xeee0('0x4d')]);_0x58fbc0[_0xeee0('0x38')]=_[_0xeee0('0x39')](_0x441858[_0xeee0('0x38')]);_0x58fbc0[_0xeee0('0x3a')]=_[_0xeee0('0x3b')](_0x58fbc0[_0xeee0('0x37')],_0x58fbc0[_0xeee0('0x38')]);_0x53d5bc[_0xeee0('0x3c')]=_[_0xeee0('0x3b')](_0x58fbc0[_0xeee0('0x37')],qs[_0xeee0('0x3d')](_0x441858[_0xeee0('0x38')][_0xeee0('0x3d')]));_0x53d5bc[_0xeee0('0x3c')]=_0x53d5bc['attributes'][_0xeee0('0x3e')]?_0x53d5bc['attributes']:_0x58fbc0[_0xeee0('0x37')];_0x53d5bc[_0xeee0('0x42')]=qs[_0xeee0('0x43')](_0x441858[_0xeee0('0x38')][_0xeee0('0x43')]);_0x53d5bc[_0xeee0('0x44')]=qs['filters'](_[_0xeee0('0x45')](_0x441858[_0xeee0('0x38')],_0x58fbc0[_0xeee0('0x3a')]));if(_0x441858[_0xeee0('0x38')][_0xeee0('0x46')]){_0x53d5bc['where']=_[_0xeee0('0x47')](_0x53d5bc['where'],{'$or':_[_0xeee0('0x32')](_0x53d5bc[_0xeee0('0x3c')],function(_0x2eae89){var _0x383734={};_0x383734[_0x2eae89]={'$like':'%'+_0x441858['query'][_0xeee0('0x46')]+'%'};return _0x383734;})});}_0x53d5bc=_['merge']({},_0x53d5bc,_0x441858[_0xeee0('0x4f')]);return _0x484b7a[_0xeee0('0xfa')](_0x53d5bc);}})[_0xeee0('0x29')](function(_0x55195d){if(_0x55195d){_0xb59ce7=_0x55195d[_0xeee0('0x3e')];if(!_0x441858['query'][_0xeee0('0x3f')]('nolimit')){_0x53d5bc[_0xeee0('0x25')]=qs[_0xeee0('0x25')](_0x441858[_0xeee0('0x38')][_0xeee0('0x25')]);_0x53d5bc[_0xeee0('0x41')]=qs[_0xeee0('0x41')](_0x441858[_0xeee0('0x38')]['offset']);}return _0x484b7a[_0xeee0('0xfa')](_0x53d5bc);}})[_0xeee0('0x29')](function(_0x5bf9c5){if(_0x5bf9c5){return _0x5bf9c5?{'count':_0xb59ce7,'rows':_0x5bf9c5}:null;}})[_0xeee0('0x29')](respondWithResult(_0x443f39,null))['catch'](handleError(_0x443f39,null));};exports[_0xeee0('0x11c')]=function(_0x189474,_0x1fb3e3){var _0xf4e63d=_0x189474[_0xeee0('0x38')][_0xeee0('0x11d')]===_0xeee0('0x11e')?'offlineForm':_0xeee0('0x11f');return db[_0xeee0('0x33')][_0xeee0('0x50')]({'attributes':['id',_0xf4e63d],'where':{'id':_0x189474[_0xeee0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1fb3e3,null))[_0xeee0('0x29')](function(_0x22ed98){if(_0x22ed98){var _0x19b578=_0x22ed98[_0xf4e63d];var _0x164da0=_0x19b578&&_0x19b578[_0xeee0('0x120')]?_0x19b578[_0xeee0('0x120')]:[];_0x1fb3e3[_0xeee0('0x2e')]({'fromKey':_[_0xeee0('0x74')](_0x19b578[_0xeee0('0x121')])?undefined:_0x19b578['fromKey'],'count':_0x164da0[_0xeee0('0x3e')],'rows':_0x164da0});}})[_0xeee0('0x1e')](handleError(_0x1fb3e3,null));};exports[_0xeee0('0x122')]=function(_0x19771a,_0x18d18c){var _0x32700a={'raw':![],'where':{}};var _0x3148df={};var _0x6263a={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xeee0('0x5f')]({'where':{'id':_0x19771a[_0xeee0('0x4c')]['id']}})[_0xeee0('0x29')](handleEntityNotFound(_0x18d18c,null))[_0xeee0('0x29')](function(_0x308de4){if(_0x308de4){_0x3148df[_0xeee0('0x37')]=_['keys'](db[_0xeee0('0xcc')][_0xeee0('0x4d')]);_0x3148df[_0xeee0('0x38')]=_['keys'](_0x19771a[_0xeee0('0x38')]);_0x3148df['filters']=_[_0xeee0('0x3b')](_0x3148df[_0xeee0('0x37')],_0x3148df[_0xeee0('0x38')]);_0x32700a[_0xeee0('0x3c')]=_[_0xeee0('0x3b')](_0x3148df[_0xeee0('0x37')],qs['fields'](_0x19771a[_0xeee0('0x38')]['fields']));_0x32700a[_0xeee0('0x3c')]=_0x32700a[_0xeee0('0x3c')]['length']?_0x32700a[_0xeee0('0x3c')]:_0x3148df[_0xeee0('0x37')];if(!_0x19771a['query'][_0xeee0('0x3f')](_0xeee0('0x40'))){_0x32700a[_0xeee0('0x25')]=qs['limit'](_0x19771a[_0xeee0('0x38')][_0xeee0('0x25')]);_0x32700a[_0xeee0('0x41')]=qs[_0xeee0('0x41')](_0x19771a[_0xeee0('0x38')][_0xeee0('0x41')]);}_0x32700a[_0xeee0('0x42')]=qs[_0xeee0('0x43')](_0x19771a[_0xeee0('0x38')][_0xeee0('0x43')]);_0x32700a[_0xeee0('0x44')]=qs['filters'](_[_0xeee0('0x45')](_0x19771a[_0xeee0('0x38')],_0x3148df[_0xeee0('0x3a')]));_0x32700a['where']['ChatWebsiteId']=_0x308de4['id'];if(_0x19771a[_0xeee0('0x38')][_0xeee0('0x46')]){_0x32700a['where']=_[_0xeee0('0x47')](_0x32700a['where'],{'$or':_['map'](_0x32700a[_0xeee0('0x3c')],function(_0x11bf10){var _0x21f737={};_0x21f737[_0x11bf10]={'$like':'%'+_0x19771a[_0xeee0('0x38')]['filter']+'%'};return _0x21f737;})});}_0x32700a=_[_0xeee0('0x47')]({},_0x32700a,_0x19771a['options']);return db[_0xeee0('0xcc')]['count']({'where':_0x32700a['where']})[_0xeee0('0x29')](function(_0x1680ba){_0x6263a[_0xeee0('0x24')]=_0x1680ba;if(_0x19771a[_0xeee0('0x38')][_0xeee0('0x4a')]){_0x32700a[_0xeee0('0x4e')]=[{'all':!![]}];}else{_0x32700a[_0xeee0('0x4e')]=[{'model':db[_0xeee0('0x88')],'as':_0xeee0('0x123'),'required':![]},{'model':db[_0xeee0('0xd5')],'as':_0xeee0('0x124'),'required':![]}];}return db[_0xeee0('0xcc')][_0xeee0('0x4b')](_0x32700a);})[_0xeee0('0x29')](function(_0x7f633c){_0x6263a['rows']=_0x7f633c;return _0x6263a;});}})[_0xeee0('0x29')](respondWithFilteredResult(_0x18d18c,_0x32700a))['catch'](handleError(_0x18d18c,null));};exports['addAgents']=function(_0x547d12,_0x5f1b72){return db['ChatWebsite']['find']({'where':{'id':_0x547d12[_0xeee0('0x4c')]['id']}})[_0xeee0('0x29')](handleEntityNotFound(_0x5f1b72,null))[_0xeee0('0x29')](function(_0x2cda8b){if(_0x2cda8b){return _0x2cda8b['addAgents'](_0x547d12['body'][_0xeee0('0x61')],_[_0xeee0('0xe7')](_0x547d12[_0xeee0('0x59')],[_0xeee0('0x61'),'id'])||{})[_0xeee0('0xc8')](function(_0x90816d){for(var _0x1a9fa6=0x0;_0x1a9fa6<_0x547d12['body']['ids'][_0xeee0('0x3e')];_0x1a9fa6+=0x1){socket[_0xeee0('0x125')](_0xeee0('0x126'),{'UserId':Number(_0x547d12[_0xeee0('0x59')]['ids'][_0x1a9fa6]),'ChatWebsiteId':Number(_0x547d12[_0xeee0('0x4c')]['id'])});}return _0x90816d;});}})['then'](respondWithResult(_0x5f1b72,null))[_0xeee0('0x1e')](handleError(_0x5f1b72,null));};exports[_0xeee0('0x127')]=function(_0x3900e4,_0x282c84){return db[_0xeee0('0x33')]['find']({'where':{'id':_0x3900e4['params']['id']}})['then'](handleEntityNotFound(_0x282c84,null))[_0xeee0('0x29')](function(_0xbaf15c){if(_0xbaf15c){return _0xbaf15c['removeAgents'](_0x3900e4[_0xeee0('0x38')][_0xeee0('0x61')])['then'](function(){if(_[_0xeee0('0x128')](_0x3900e4[_0xeee0('0x38')][_0xeee0('0x61')])){for(var _0x31115e=0x0;_0x31115e<_0x3900e4[_0xeee0('0x38')][_0xeee0('0x61')][_0xeee0('0x3e')];_0x31115e+=0x1){socket[_0xeee0('0x125')](_0xeee0('0x129'),{'UserId':Number(_0x3900e4[_0xeee0('0x38')][_0xeee0('0x61')][_0x31115e]),'ChatWebsiteId':Number(_0x3900e4[_0xeee0('0x4c')]['id'])});}}else{socket['emit'](_0xeee0('0x129'),{'UserId':Number(_0x3900e4[_0xeee0('0x38')][_0xeee0('0x61')]),'ChatWebsiteId':Number(_0x3900e4['params']['id'])});}});}})['then'](respondWithStatusCode(_0x282c84,null))[_0xeee0('0x1e')](handleError(_0x282c84,null));};exports['getAgents']=function(_0x5c407c,_0x7b9786){var _0x4b1e9={};var _0x484d4c={};var _0x861521;var _0x14ba9c;return db[_0xeee0('0x33')][_0xeee0('0x5f')]({'where':{'id':_0x5c407c[_0xeee0('0x4c')]['id']}})[_0xeee0('0x29')](handleEntityNotFound(_0x7b9786,null))[_0xeee0('0x29')](function(_0x13b2a4){if(_0x13b2a4){_0x861521=_0x13b2a4;_0x484d4c['model']=_['keys'](db[_0xeee0('0xbb')][_0xeee0('0x4d')]);_0x484d4c[_0xeee0('0x38')]=_[_0xeee0('0x39')](_0x5c407c[_0xeee0('0x38')]);_0x484d4c['filters']=_[_0xeee0('0x3b')](_0x484d4c['model'],_0x484d4c[_0xeee0('0x38')]);_0x4b1e9[_0xeee0('0x3c')]=_['intersection'](_0x484d4c[_0xeee0('0x37')],qs['fields'](_0x5c407c[_0xeee0('0x38')][_0xeee0('0x3d')]));_0x4b1e9['attributes']=_0x4b1e9[_0xeee0('0x3c')][_0xeee0('0x3e')]?_0x4b1e9[_0xeee0('0x3c')]:_0x484d4c[_0xeee0('0x37')];_0x4b1e9[_0xeee0('0x42')]=qs[_0xeee0('0x43')](_0x5c407c[_0xeee0('0x38')]['sort']);_0x4b1e9['where']=qs[_0xeee0('0x3a')](_[_0xeee0('0x45')](_0x5c407c[_0xeee0('0x38')],_0x484d4c[_0xeee0('0x3a')]));if(_0x5c407c[_0xeee0('0x38')][_0xeee0('0x46')]){_0x4b1e9[_0xeee0('0x44')]=_[_0xeee0('0x47')](_0x4b1e9[_0xeee0('0x44')],{'$or':_['map'](_0x4b1e9['attributes'],function(_0x21485d){var _0x5af470={};_0x5af470[_0x21485d]={'$like':'%'+_0x5c407c[_0xeee0('0x38')]['filter']+'%'};return _0x5af470;})});}_0x4b1e9=_[_0xeee0('0x47')]({},_0x4b1e9,_0x5c407c[_0xeee0('0x4f')]);return _0x861521[_0xeee0('0x12a')](_0x4b1e9);}})[_0xeee0('0x29')](function(_0x5a60fd){if(_0x5a60fd){_0x14ba9c=_0x5a60fd[_0xeee0('0x3e')];if(!_0x5c407c[_0xeee0('0x38')][_0xeee0('0x3f')]('nolimit')){_0x4b1e9[_0xeee0('0x25')]=qs[_0xeee0('0x25')](_0x5c407c[_0xeee0('0x38')][_0xeee0('0x25')]);_0x4b1e9[_0xeee0('0x41')]=qs[_0xeee0('0x41')](_0x5c407c['query']['offset']);}return _0x861521[_0xeee0('0x12a')](_0x4b1e9);}})['then'](function(_0x2af580){if(_0x2af580){return _0x2af580?{'count':_0x14ba9c,'rows':_0x2af580}:null;}})[_0xeee0('0x29')](respondWithResult(_0x7b9786,null))[_0xeee0('0x1e')](handleError(_0x7b9786,null));};
\ No newline at end of file
+var _0xb1b7=['spread','messageId','created','autoclose','push','*,*,*,*','AttachmentId','UserId','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','from\x20is\x20mandatory','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','mimetype','server','files','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','CloudProvider','Smtp','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','User','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','interval','iftime\x20%s','indexOf','true','ONLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','Interval','getProactiveActions','virtual','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.ejs','URL','address','origin','3.1.0','remote','x-real-ip','remoteAddress','replace','verticalAlignment','labelText','textButtonColor','color_button','backgroundColor','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','getApplications','addProactiveActions','getFields','online','false','offlineForm','onlineForm','items','getOfflineMessages','Contact','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','util','path','ejs','fs-extra','lodash','querystring','ioredis','../../config/logger','api','../../config/environment','url','redis','socket.io-emitter','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','destroy','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','body','addDisposition','getDispositions','findOne','Disposition','nolimit','ChatWebsiteId','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','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/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','user-agent','chat','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','account','applications','Applications','list','orderBy','priority','asc','defaults','contact','customerIp','cf-connecting-ip','headers','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','unknown','%s\x20%s','device','vendor','format','%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','ContactId','interaction'];(function(_0x182393,_0x56e7cd){var _0x277126=function(_0x19ef76){while(--_0x19ef76){_0x182393['push'](_0x182393['shift']());}};_0x277126(++_0x56e7cd);}(_0xb1b7,0x1a1));var _0x7b1b=function(_0x1a487d,_0x45e2d3){_0x1a487d=_0x1a487d-0x0;var _0x623be5=_0xb1b7[_0x1a487d];return _0x623be5;};'use strict';var BPromise=require(_0x7b1b('0x0'));var Mustache=require('mustache');var util=require(_0x7b1b('0x1'));var path=require(_0x7b1b('0x2'));var ejs=require(_0x7b1b('0x3'));var fs=require('fs');var fs_extra=require(_0x7b1b('0x4'));var _=require(_0x7b1b('0x5'));var querystring=require(_0x7b1b('0x6'));var Redis=require(_0x7b1b('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0x7b1b('0x8'))(_0x7b1b('0x9'));var config=require(_0x7b1b('0xa'));var url=require(_0x7b1b('0xb'));var db=require('../../mysqldb')['db'];config[_0x7b1b('0xc')]=_['defaults'](config[_0x7b1b('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x7b1b('0xd'))(new Redis(config[_0x7b1b('0xc')]));require('./chatWebsite.socket')[_0x7b1b('0xe')](socket);var htmlToText=require('html-to-text');var jayson=require('jayson/promise');var client=jayson[_0x7b1b('0xf')][_0x7b1b('0x10')]({'port':0x232c});var client9002=jayson['client'][_0x7b1b('0x10')]({'port':0x232a});var client9003=jayson[_0x7b1b('0xf')][_0x7b1b('0x10')]({'port':0x232b});var client9001=jayson[_0x7b1b('0xf')][_0x7b1b('0x10')]({'port':0x2329});function respondWithRpcPromise(_0x3b5e67,_0x187296,_0x45a703,_0xc72d70){return new BPromise(function(_0x120e25,_0x40232c){var _0x14914c=_0xc72d70||client;return _0x14914c[_0x7b1b('0x11')](_0x3b5e67,_0x45a703)[_0x7b1b('0x12')](function(_0x521a3d){logger[_0x7b1b('0x13')](_0x7b1b('0x14'),_0x187296,_0x7b1b('0x15'));logger[_0x7b1b('0x16')](_0x7b1b('0x17'),_0x187296,'request\x20sent',JSON[_0x7b1b('0x18')](_0x521a3d));if(_0x521a3d[_0x7b1b('0x19')]){if(_0x521a3d[_0x7b1b('0x19')][_0x7b1b('0x1a')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x187296,_0x521a3d['error']['message']);return _0x40232c(_0x521a3d['error'][_0x7b1b('0x1b')]);}logger[_0x7b1b('0x19')](_0x7b1b('0x14'),_0x187296,_0x521a3d[_0x7b1b('0x19')][_0x7b1b('0x1b')]);return _0x120e25(_0x521a3d['error'][_0x7b1b('0x1b')]);}else{logger[_0x7b1b('0x13')](_0x7b1b('0x14'),_0x187296,_0x7b1b('0x15'));_0x120e25(_0x521a3d[_0x7b1b('0x1c')][_0x7b1b('0x1b')]);}})[_0x7b1b('0x1d')](function(_0x47bef0){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x187296,_0x47bef0);_0x40232c(_0x47bef0);});});}function respondWithStatusCode(_0x3913fe,_0x1b91e7){_0x1b91e7=_0x1b91e7||0xcc;return function(_0x1f64e9){if(_0x1f64e9){return _0x3913fe[_0x7b1b('0x1e')](_0x1b91e7);}return _0x3913fe[_0x7b1b('0x1f')](_0x1b91e7)[_0x7b1b('0x20')]();};}function respondWithResult(_0x1f0c78,_0x4a7bde){_0x4a7bde=_0x4a7bde||0xc8;return function(_0x1172a0){if(_0x1172a0){return _0x1f0c78[_0x7b1b('0x1f')](_0x4a7bde)[_0x7b1b('0x21')](_0x1172a0);}};}function respondWithFilteredResult(_0x4af212,_0x401a51){return function(_0x5685e8){if(_0x5685e8){var _0x35e429=typeof _0x401a51[_0x7b1b('0x22')]==='undefined'&&typeof _0x401a51[_0x7b1b('0x23')]===_0x7b1b('0x24');var _0x3a0c25=_0x5685e8[_0x7b1b('0x25')];var _0x52236a=_0x35e429?0x0:_0x401a51[_0x7b1b('0x22')];var _0x371bf8=_0x35e429?_0x5685e8[_0x7b1b('0x25')]:_0x401a51[_0x7b1b('0x22')]+_0x401a51[_0x7b1b('0x23')];var _0x53bc4c;if(_0x371bf8>=_0x3a0c25){_0x371bf8=_0x3a0c25;_0x53bc4c=0xc8;}else{_0x53bc4c=0xce;}_0x4af212[_0x7b1b('0x1f')](_0x53bc4c);return _0x4af212[_0x7b1b('0x26')](_0x7b1b('0x27'),_0x52236a+'-'+_0x371bf8+'/'+_0x3a0c25)[_0x7b1b('0x21')](_0x5685e8);}return null;};}function saveUpdates(_0x3b01de){return function(_0x5058f3){if(_0x5058f3){return _0x5058f3['update'](_0x3b01de)[_0x7b1b('0x12')](function(_0x41692a){return _0x41692a;});}return null;};}function removeEntity(_0x2232d8){return function(_0xbddb75){if(_0xbddb75){return _0xbddb75[_0x7b1b('0x28')]()[_0x7b1b('0x12')](function(){var _0xac49ee=_0xbddb75['get']({'plain':!![]});var _0x115a71=_0x7b1b('0x29');return db[_0x7b1b('0x2a')]['destroy']({'where':{'type':_0x115a71,'resourceId':_0xac49ee['id']}})[_0x7b1b('0x12')](function(){return _0xbddb75;});})[_0x7b1b('0x12')](function(){_0x2232d8[_0x7b1b('0x1f')](0xcc)[_0x7b1b('0x20')]();});}};}function handleEntityNotFound(_0x5b8c06){return function(_0x4e22d4){if(!_0x4e22d4){_0x5b8c06[_0x7b1b('0x1e')](0x194);}return _0x4e22d4;};}function handleError(_0x16625d,_0x3d7232){_0x3d7232=_0x3d7232||0x1f4;return function(_0x2ab1fd){logger['error'](_0x2ab1fd[_0x7b1b('0x2b')]);if(_0x2ab1fd['name']){delete _0x2ab1fd[_0x7b1b('0x2c')];}_0x16625d['status'](_0x3d7232)[_0x7b1b('0x2d')](_0x2ab1fd);};}exports[_0x7b1b('0x2e')]=function(_0x55eae7,_0x4bc45d){var _0x4b3edb={'include':[{'model':db[_0x7b1b('0x2f')],'as':_0x7b1b('0x30')}]},_0x37591b={},_0x17dd23={'count':0x0,'rows':[]};var _0x22ad32=_[_0x7b1b('0x31')](db[_0x7b1b('0x32')][_0x7b1b('0x33')],function(_0x40d7e9){return{'name':_0x40d7e9[_0x7b1b('0x34')],'type':_0x40d7e9[_0x7b1b('0x35')][_0x7b1b('0x36')]};});_0x37591b['model']=_[_0x7b1b('0x31')](_0x22ad32,'name');_0x37591b[_0x7b1b('0x37')]=_[_0x7b1b('0x38')](_0x55eae7[_0x7b1b('0x37')]);_0x37591b[_0x7b1b('0x39')]=_['intersection'](_0x37591b[_0x7b1b('0x3a')],_0x37591b[_0x7b1b('0x37')]);_0x4b3edb['attributes']=_[_0x7b1b('0x3b')](_0x37591b[_0x7b1b('0x3a')],qs['fields'](_0x55eae7[_0x7b1b('0x37')][_0x7b1b('0x3c')]));_0x4b3edb['attributes']=_0x4b3edb[_0x7b1b('0x3d')][_0x7b1b('0x3e')]?_0x4b3edb['attributes']:_0x37591b[_0x7b1b('0x3a')];if(!_0x55eae7[_0x7b1b('0x37')][_0x7b1b('0x3f')]('nolimit')){_0x4b3edb[_0x7b1b('0x23')]=qs[_0x7b1b('0x23')](_0x55eae7[_0x7b1b('0x37')]['limit']);_0x4b3edb[_0x7b1b('0x22')]=qs['offset'](_0x55eae7[_0x7b1b('0x37')][_0x7b1b('0x22')]);}_0x4b3edb[_0x7b1b('0x40')]=qs['sort'](_0x55eae7[_0x7b1b('0x37')][_0x7b1b('0x41')]);_0x4b3edb[_0x7b1b('0x42')]=qs['filters'](_[_0x7b1b('0x43')](_0x55eae7[_0x7b1b('0x37')],_0x37591b[_0x7b1b('0x39')]),_0x22ad32);if(_0x55eae7['query'][_0x7b1b('0x44')]){_0x4b3edb['where']=_[_0x7b1b('0x45')](_0x4b3edb['where'],{'$or':_['map'](_0x22ad32,function(_0x18be01){if(_0x18be01['type']!==_0x7b1b('0x46')){var _0x1c4481={};_0x1c4481[_0x18be01[_0x7b1b('0x2c')]]={'$like':'%'+_0x55eae7[_0x7b1b('0x37')][_0x7b1b('0x44')]+'%'};return _0x1c4481;}})});}_0x4b3edb=_[_0x7b1b('0x45')]({},_0x4b3edb,_0x55eae7['options']);var _0x4cef0b={'where':_0x4b3edb['where']};return db[_0x7b1b('0x32')][_0x7b1b('0x25')](_0x4cef0b)['then'](function(_0x1244ef){_0x17dd23['count']=_0x1244ef;if(_0x55eae7[_0x7b1b('0x37')][_0x7b1b('0x47')]){_0x4b3edb[_0x7b1b('0x48')]=[{'all':!![]}];}return db[_0x7b1b('0x32')][_0x7b1b('0x49')](_0x4b3edb);})[_0x7b1b('0x12')](function(_0x41bfda){_0x17dd23[_0x7b1b('0x4a')]=_0x41bfda;return _0x17dd23;})[_0x7b1b('0x12')](respondWithFilteredResult(_0x4bc45d,_0x4b3edb))[_0x7b1b('0x1d')](handleError(_0x4bc45d,null));};exports['show']=function(_0x53e976,_0x111543){var _0x39982d={'raw':![],'where':{'id':_0x53e976[_0x7b1b('0x4b')]['id']},'include':[{'model':db[_0x7b1b('0x2f')],'as':'mandatoryDispositionPause'}]},_0x3d61fb={};_0x3d61fb[_0x7b1b('0x3a')]=_['keys'](db[_0x7b1b('0x32')]['rawAttributes']);_0x3d61fb[_0x7b1b('0x37')]=_['keys'](_0x53e976[_0x7b1b('0x37')]);_0x3d61fb['filters']=_[_0x7b1b('0x3b')](_0x3d61fb[_0x7b1b('0x3a')],_0x3d61fb['query']);_0x39982d[_0x7b1b('0x3d')]=_[_0x7b1b('0x3b')](_0x3d61fb[_0x7b1b('0x3a')],qs['fields'](_0x53e976[_0x7b1b('0x37')][_0x7b1b('0x3c')]));_0x39982d[_0x7b1b('0x3d')]=_0x39982d[_0x7b1b('0x3d')][_0x7b1b('0x3e')]?_0x39982d[_0x7b1b('0x3d')]:_0x3d61fb['model'];if(_0x53e976[_0x7b1b('0x37')][_0x7b1b('0x47')]){_0x39982d[_0x7b1b('0x48')]=[{'all':!![]}];}_0x39982d=_['merge']({},_0x39982d,_0x53e976[_0x7b1b('0x4c')]);return db[_0x7b1b('0x32')][_0x7b1b('0x4d')](_0x39982d)[_0x7b1b('0x12')](handleEntityNotFound(_0x111543,null))[_0x7b1b('0x12')](respondWithResult(_0x111543,null))[_0x7b1b('0x1d')](handleError(_0x111543,null));};exports['create']=function(_0x1e7a4e,_0x10faba){return db[_0x7b1b('0x32')][_0x7b1b('0x4e')](_0x1e7a4e['body'],{})[_0x7b1b('0x12')](function(_0x3e8cc5){var _0xe5f6f0=_0x1e7a4e[_0x7b1b('0x4f')][_0x7b1b('0x50')]({'plain':!![]});if(!_0xe5f6f0)throw new Error(_0x7b1b('0x51'));if(_0xe5f6f0[_0x7b1b('0x52')]==='user'){var _0xe31a4a=_0x3e8cc5[_0x7b1b('0x50')]({'plain':!![]});var _0x465011=_0x7b1b('0x29');return db[_0x7b1b('0x53')]['find']({'where':{'name':_0x465011,'userProfileId':_0xe5f6f0[_0x7b1b('0x54')]},'raw':!![]})[_0x7b1b('0x12')](function(_0x6c4c7a){if(_0x6c4c7a&&_0x6c4c7a[_0x7b1b('0x55')]===0x0){return db[_0x7b1b('0x2a')][_0x7b1b('0x4e')]({'name':_0xe31a4a[_0x7b1b('0x2c')],'resourceId':_0xe31a4a['id'],'type':_0x6c4c7a[_0x7b1b('0x2c')],'sectionId':_0x6c4c7a['id']},{})[_0x7b1b('0x12')](function(){return _0x3e8cc5;});}else{return _0x3e8cc5;}})['catch'](function(_0x542d3c){logger[_0x7b1b('0x19')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x542d3c);throw _0x542d3c;});}return _0x3e8cc5;})[_0x7b1b('0x12')](respondWithResult(_0x10faba,0xc9))[_0x7b1b('0x1d')](handleError(_0x10faba,null));};exports[_0x7b1b('0x56')]=function(_0x280b2c,_0x378641){if(_0x280b2c[_0x7b1b('0x57')]['id']){delete _0x280b2c[_0x7b1b('0x57')]['id'];}return db[_0x7b1b('0x32')][_0x7b1b('0x4d')]({'where':{'id':_0x280b2c[_0x7b1b('0x4b')]['id']},'include':[{'model':db[_0x7b1b('0x2f')],'as':_0x7b1b('0x30')}]})[_0x7b1b('0x12')](handleEntityNotFound(_0x378641,null))[_0x7b1b('0x12')](saveUpdates(_0x280b2c[_0x7b1b('0x57')],null))[_0x7b1b('0x12')](respondWithResult(_0x378641,null))[_0x7b1b('0x1d')](handleError(_0x378641,null));};exports['destroy']=function(_0x48378e,_0x1e5246){return db[_0x7b1b('0x32')][_0x7b1b('0x4d')]({'where':{'id':_0x48378e[_0x7b1b('0x4b')]['id']}})[_0x7b1b('0x12')](handleEntityNotFound(_0x1e5246,null))['then'](removeEntity(_0x1e5246,null))[_0x7b1b('0x1d')](handleError(_0x1e5246,null));};exports['describe']=function(_0x500241,_0x2a5648){return db['ChatWebsite']['describe']()[_0x7b1b('0x12')](respondWithResult(_0x2a5648,null))[_0x7b1b('0x1d')](handleError(_0x2a5648,null));};exports[_0x7b1b('0x58')]=function(_0x13765d,_0x3dec15){if(_0x13765d[_0x7b1b('0x57')]['id']){delete _0x13765d[_0x7b1b('0x57')]['id'];}return db[_0x7b1b('0x32')][_0x7b1b('0x4d')]({'where':{'id':_0x13765d[_0x7b1b('0x4b')]['id']}})[_0x7b1b('0x12')](handleEntityNotFound(_0x3dec15,null))['then'](function(_0x2dda0f){if(_0x2dda0f){_0x13765d[_0x7b1b('0x57')]['ChatWebsiteId']=_0x2dda0f['id'];return db['Disposition']['create'](_0x13765d[_0x7b1b('0x57')]);}})[_0x7b1b('0x12')](respondWithResult(_0x3dec15,null))[_0x7b1b('0x1d')](handleError(_0x3dec15,null));};exports[_0x7b1b('0x59')]=function(_0x474bee,_0x3a7753){var _0x36e502={'raw':![],'where':{}};var _0x2af282={};var _0x4f61c5={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x7b1b('0x5a')]({'where':{'id':_0x474bee[_0x7b1b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3a7753,null))[_0x7b1b('0x12')](function(_0x5c6984){if(_0x5c6984){_0x2af282[_0x7b1b('0x3a')]=_['keys'](db[_0x7b1b('0x5b')]['rawAttributes']);_0x2af282['query']=_['keys'](_0x474bee[_0x7b1b('0x37')]);_0x2af282[_0x7b1b('0x39')]=_['intersection'](_0x2af282[_0x7b1b('0x3a')],_0x2af282[_0x7b1b('0x37')]);_0x36e502[_0x7b1b('0x3d')]=_[_0x7b1b('0x3b')](_0x2af282[_0x7b1b('0x3a')],qs[_0x7b1b('0x3c')](_0x474bee['query'][_0x7b1b('0x3c')]));_0x36e502['attributes']=_0x36e502[_0x7b1b('0x3d')][_0x7b1b('0x3e')]?_0x36e502[_0x7b1b('0x3d')]:_0x2af282[_0x7b1b('0x3a')];if(!_0x474bee[_0x7b1b('0x37')][_0x7b1b('0x3f')](_0x7b1b('0x5c'))){_0x36e502[_0x7b1b('0x23')]=qs[_0x7b1b('0x23')](_0x474bee[_0x7b1b('0x37')]['limit']);_0x36e502[_0x7b1b('0x22')]=qs['offset'](_0x474bee[_0x7b1b('0x37')][_0x7b1b('0x22')]);}_0x36e502[_0x7b1b('0x40')]=qs[_0x7b1b('0x41')](_0x474bee[_0x7b1b('0x37')]['sort']);_0x36e502[_0x7b1b('0x42')]=qs[_0x7b1b('0x39')](_[_0x7b1b('0x43')](_0x474bee[_0x7b1b('0x37')],_0x2af282['filters']));_0x36e502[_0x7b1b('0x42')][_0x7b1b('0x5d')]=_0x5c6984['id'];if(_0x474bee[_0x7b1b('0x37')][_0x7b1b('0x44')]){_0x36e502[_0x7b1b('0x42')]=_[_0x7b1b('0x45')](_0x36e502[_0x7b1b('0x42')],{'$or':_[_0x7b1b('0x31')](_0x36e502[_0x7b1b('0x3d')],function(_0x2af7cf){var _0x36a3ea={};_0x36a3ea[_0x2af7cf]={'$like':'%'+_0x474bee[_0x7b1b('0x37')][_0x7b1b('0x44')]+'%'};return _0x36a3ea;})});}_0x36e502=_['merge']({},_0x36e502,_0x474bee[_0x7b1b('0x4c')]);return db['Disposition']['count']({'where':_0x36e502[_0x7b1b('0x42')]})[_0x7b1b('0x12')](function(_0x28173a){_0x4f61c5['count']=_0x28173a;if(_0x474bee[_0x7b1b('0x37')][_0x7b1b('0x47')]){_0x36e502[_0x7b1b('0x48')]=[{'all':!![]}];}return db[_0x7b1b('0x5b')][_0x7b1b('0x49')](_0x36e502);})[_0x7b1b('0x12')](function(_0x1fe958){_0x4f61c5['rows']=_0x1fe958;return _0x4f61c5;});}})[_0x7b1b('0x12')](respondWithFilteredResult(_0x3a7753,_0x36e502))[_0x7b1b('0x1d')](handleError(_0x3a7753,null));};exports[_0x7b1b('0x5e')]=function(_0x2df8cf,_0x121767){return db[_0x7b1b('0x32')]['find']({'where':{'id':_0x2df8cf[_0x7b1b('0x4b')]['id']}})[_0x7b1b('0x12')](handleEntityNotFound(_0x121767,null))[_0x7b1b('0x12')](function(_0x16280a){if(_0x16280a){return _0x16280a[_0x7b1b('0x5e')](_0x2df8cf['query'][_0x7b1b('0x5f')]);}})[_0x7b1b('0x12')](respondWithStatusCode(_0x121767,null))['catch'](handleError(_0x121767,null));};exports[_0x7b1b('0x60')]=function(_0x31421d,_0x42cfd8){if(_0x31421d[_0x7b1b('0x57')]['id']){delete _0x31421d[_0x7b1b('0x57')]['id'];}return db[_0x7b1b('0x32')]['find']({'where':{'id':_0x31421d[_0x7b1b('0x4b')]['id']}})[_0x7b1b('0x12')](handleEntityNotFound(_0x42cfd8,null))[_0x7b1b('0x12')](function(_0x533f56){if(_0x533f56){_0x31421d[_0x7b1b('0x57')][_0x7b1b('0x5d')]=_0x533f56['id'];return db['CannedAnswer'][_0x7b1b('0x4e')](_0x31421d['body']);}})[_0x7b1b('0x12')](respondWithResult(_0x42cfd8,null))[_0x7b1b('0x1d')](handleError(_0x42cfd8,null));};exports[_0x7b1b('0x61')]=function(_0x279ba3,_0x391f90){var _0x38309a={'raw':![],'where':{}};var _0x539a6f={};var _0x691182={'count':0x0,'rows':[]};return db[_0x7b1b('0x32')]['findOne']({'where':{'id':_0x279ba3[_0x7b1b('0x4b')]['id']}})[_0x7b1b('0x12')](handleEntityNotFound(_0x391f90,null))[_0x7b1b('0x12')](function(_0x462a2f){if(_0x462a2f){_0x539a6f[_0x7b1b('0x3a')]=_[_0x7b1b('0x38')](db[_0x7b1b('0x62')][_0x7b1b('0x33')]);_0x539a6f[_0x7b1b('0x37')]=_['keys'](_0x279ba3['query']);_0x539a6f[_0x7b1b('0x39')]=_[_0x7b1b('0x3b')](_0x539a6f['model'],_0x539a6f[_0x7b1b('0x37')]);_0x38309a[_0x7b1b('0x3d')]=_['intersection'](_0x539a6f[_0x7b1b('0x3a')],qs[_0x7b1b('0x3c')](_0x279ba3[_0x7b1b('0x37')][_0x7b1b('0x3c')]));_0x38309a[_0x7b1b('0x3d')]=_0x38309a[_0x7b1b('0x3d')][_0x7b1b('0x3e')]?_0x38309a[_0x7b1b('0x3d')]:_0x539a6f[_0x7b1b('0x3a')];if(!_0x279ba3[_0x7b1b('0x37')][_0x7b1b('0x3f')](_0x7b1b('0x5c'))){_0x38309a[_0x7b1b('0x23')]=qs[_0x7b1b('0x23')](_0x279ba3[_0x7b1b('0x37')][_0x7b1b('0x23')]);_0x38309a['offset']=qs[_0x7b1b('0x22')](_0x279ba3['query']['offset']);}_0x38309a['order']=qs['sort'](_0x279ba3[_0x7b1b('0x37')]['sort']);_0x38309a['where']=qs['filters'](_[_0x7b1b('0x43')](_0x279ba3['query'],_0x539a6f[_0x7b1b('0x39')]));_0x38309a[_0x7b1b('0x42')]['ChatWebsiteId']=_0x462a2f['id'];if(_0x279ba3[_0x7b1b('0x37')][_0x7b1b('0x44')]){_0x38309a[_0x7b1b('0x42')]=_[_0x7b1b('0x45')](_0x38309a[_0x7b1b('0x42')],{'$or':_['map'](_0x38309a[_0x7b1b('0x3d')],function(_0x5dd69c){var _0x342d29={};_0x342d29[_0x5dd69c]={'$like':'%'+_0x279ba3['query'][_0x7b1b('0x44')]+'%'};return _0x342d29;})});}_0x38309a=_[_0x7b1b('0x45')]({},_0x38309a,_0x279ba3['options']);return db[_0x7b1b('0x62')][_0x7b1b('0x25')]({'where':_0x38309a[_0x7b1b('0x42')]})['then'](function(_0x5107ef){_0x691182['count']=_0x5107ef;if(_0x279ba3[_0x7b1b('0x37')][_0x7b1b('0x47')]){_0x38309a['include']=[{'all':!![]}];}return db[_0x7b1b('0x62')][_0x7b1b('0x49')](_0x38309a);})[_0x7b1b('0x12')](function(_0x415966){_0x691182[_0x7b1b('0x4a')]=_0x415966;return _0x691182;});}})[_0x7b1b('0x12')](respondWithFilteredResult(_0x391f90,_0x38309a))[_0x7b1b('0x1d')](handleError(_0x391f90,null));};exports[_0x7b1b('0x63')]=function(_0x11dbca,_0x2d484c){return db[_0x7b1b('0x32')][_0x7b1b('0x4d')]({'where':{'id':_0x11dbca[_0x7b1b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2d484c,null))[_0x7b1b('0x12')](function(_0xa34b21){if(_0xa34b21){return _0xa34b21[_0x7b1b('0x63')](_0x11dbca['query']['ids']);}})['then'](respondWithStatusCode(_0x2d484c,null))[_0x7b1b('0x1d')](handleError(_0x2d484c,null));};exports[_0x7b1b('0x64')]=function(_0x5d562d,_0x37a4c6){_0x5d562d[_0x7b1b('0x57')][_0x7b1b('0x65')]=_0x5d562d[_0x7b1b('0x66')][_0x7b1b('0x67')];return db['ChatWebsite'][_0x7b1b('0x4d')]({'where':{'id':_0x5d562d[_0x7b1b('0x4b')]['id']}})[_0x7b1b('0x12')](handleEntityNotFound(_0x37a4c6,null))[_0x7b1b('0x12')](saveUpdates(_0x5d562d[_0x7b1b('0x57')],null))[_0x7b1b('0x12')](respondWithResult(_0x37a4c6,null))[_0x7b1b('0x1d')](handleError(_0x37a4c6,null));};exports[_0x7b1b('0x68')]=function(_0x4b7305,_0x2caf62){_0x4b7305[_0x7b1b('0x57')][_0x7b1b('0x69')]=_0x4b7305[_0x7b1b('0x66')]['filename'];return db[_0x7b1b('0x32')][_0x7b1b('0x4d')]({'where':{'id':_0x4b7305['params']['id']}})[_0x7b1b('0x12')](handleEntityNotFound(_0x2caf62,null))[_0x7b1b('0x12')](saveUpdates(_0x4b7305['body'],null))['then'](respondWithResult(_0x2caf62,null))[_0x7b1b('0x1d')](handleError(_0x2caf62,null));};exports[_0x7b1b('0x6a')]=function(_0x2f51e1,_0x54a662){_0x2f51e1[_0x7b1b('0x57')][_0x7b1b('0x6b')]=_0x2f51e1[_0x7b1b('0x66')]['filename'];return db[_0x7b1b('0x32')][_0x7b1b('0x4d')]({'where':{'id':_0x2f51e1['params']['id']}})[_0x7b1b('0x12')](handleEntityNotFound(_0x54a662,null))['then'](saveUpdates(_0x2f51e1[_0x7b1b('0x57')],null))['then'](respondWithResult(_0x54a662,null))[_0x7b1b('0x1d')](handleError(_0x54a662,null));};exports[_0x7b1b('0x6c')]=function(_0x5b910c,_0x101f11){_0x5b910c['body'][_0x7b1b('0x6d')]=_0x5b910c['file']['filename'];return db[_0x7b1b('0x32')][_0x7b1b('0x4d')]({'where':{'id':_0x5b910c[_0x7b1b('0x4b')]['id']}})[_0x7b1b('0x12')](handleEntityNotFound(_0x101f11,null))[_0x7b1b('0x12')](saveUpdates(_0x5b910c['body'],null))[_0x7b1b('0x12')](respondWithResult(_0x101f11,null))[_0x7b1b('0x1d')](handleError(_0x101f11,null));};exports['getLogo']=function(_0x5e6a3b,_0x2ba950){var _0x20916c=path[_0x7b1b('0x6e')](config[_0x7b1b('0x6f')],_0x7b1b('0x70'));var _0x51f101={'where':{'id':_0x5e6a3b[_0x7b1b('0x4b')]['id']},'attributes':['id',_0x7b1b('0x65')],'raw':!![]};var _0x4513a3=![];return require(_0x7b1b('0x71'))[_0x7b1b('0x72')]()[_0x7b1b('0x12')](function(_0x5a7fbf){if(_0x5a7fbf){_0x4513a3=_0x5a7fbf[_0x7b1b('0x73')];}})['then'](function(){return db[_0x7b1b('0x32')][_0x7b1b('0x4d')](_0x51f101);})['then'](handleEntityNotFound(_0x2ba950,null))[_0x7b1b('0x12')](function(_0x1c4789){if(_0x1c4789){if(!_[_0x7b1b('0x74')](_0x1c4789[_0x7b1b('0x65')])){if(fs[_0x7b1b('0x75')](path[_0x7b1b('0x6e')](config['root'],_0x7b1b('0x76'),_0x1c4789['sitepic']))&&_0x4513a3){_0x20916c=path[_0x7b1b('0x6e')](config['root'],'server/files/images/logos/',_0x1c4789[_0x7b1b('0x65')]);}}return _0x2ba950[_0x7b1b('0x77')](_0x20916c);}})['catch'](handleError(_0x2ba950,null));};exports[_0x7b1b('0x78')]=function(_0x44371c,_0x3fa277){var _0x47f3c1=path[_0x7b1b('0x6e')](config[_0x7b1b('0x6f')],_0x7b1b('0x79'));var _0x25d954={'where':{'id':_0x44371c[_0x7b1b('0x4b')]['id']},'attributes':['id',_0x7b1b('0x69')],'raw':!![]};return db['ChatWebsite'][_0x7b1b('0x4d')](_0x25d954)[_0x7b1b('0x12')](handleEntityNotFound(_0x3fa277,null))[_0x7b1b('0x12')](function(_0x3c15ab){if(_0x3c15ab){if(!_['isNil'](_0x3c15ab[_0x7b1b('0x69')])){if(fs[_0x7b1b('0x75')](path['join'](config[_0x7b1b('0x6f')],_0x7b1b('0x7a'),_0x3c15ab[_0x7b1b('0x69')]))){_0x47f3c1=path[_0x7b1b('0x6e')](config[_0x7b1b('0x6f')],_0x7b1b('0x7a'),_0x3c15ab[_0x7b1b('0x69')]);}}return _0x3fa277[_0x7b1b('0x77')](_0x47f3c1);}})['catch'](handleError(_0x3fa277,null));};exports[_0x7b1b('0x7b')]=function(_0x14104f,_0x20a247){var _0xb4e5d8=path[_0x7b1b('0x6e')](config[_0x7b1b('0x6f')],_0x7b1b('0x7c'));var _0x31f721={'where':{'id':_0x14104f[_0x7b1b('0x4b')]['id']},'attributes':['id',_0x7b1b('0x6b'),_0x7b1b('0x7d')],'raw':!![]};return db[_0x7b1b('0x32')][_0x7b1b('0x4d')](_0x31f721)[_0x7b1b('0x12')](handleEntityNotFound(_0x20a247,null))['then'](function(_0x1cd3cc){if(_0x1cd3cc){if(!_[_0x7b1b('0x74')](_0x1cd3cc['customerAvatar'])){if(fs[_0x7b1b('0x75')](path[_0x7b1b('0x6e')](config[_0x7b1b('0x6f')],_0x7b1b('0x7a'),_0x1cd3cc[_0x7b1b('0x6b')]))&&_0x1cd3cc[_0x7b1b('0x7d')]){_0xb4e5d8=path[_0x7b1b('0x6e')](config[_0x7b1b('0x6f')],'server/files/images/avatars/',_0x1cd3cc[_0x7b1b('0x6b')]);}}return _0x20a247['download'](_0xb4e5d8);}})[_0x7b1b('0x1d')](handleError(_0x20a247,null));};exports[_0x7b1b('0x7e')]=function(_0x335da3,_0x4725ae){var _0x2c2794=path['join'](config[_0x7b1b('0x6f')],_0x7b1b('0x7f'));var _0x5c45f9={'where':{'id':_0x335da3[_0x7b1b('0x4b')]['id']},'attributes':['id',_0x7b1b('0x6d')],'raw':!![]};return db[_0x7b1b('0x32')][_0x7b1b('0x4d')](_0x5c45f9)['then'](handleEntityNotFound(_0x4725ae,null))[_0x7b1b('0x12')](function(_0xe03e12){if(_0xe03e12){if(!_[_0x7b1b('0x74')](_0xe03e12['systemAvatar'])){if(fs[_0x7b1b('0x75')](path[_0x7b1b('0x6e')](config[_0x7b1b('0x6f')],'server/files/images/avatars/',_0xe03e12[_0x7b1b('0x6d')]))){_0x2c2794=path[_0x7b1b('0x6e')](config[_0x7b1b('0x6f')],_0x7b1b('0x7a'),_0xe03e12['systemAvatar']);}}return _0x4725ae[_0x7b1b('0x77')](_0x2c2794);}})[_0x7b1b('0x1d')](handleError(_0x4725ae,null));};exports['notify']=function(_0x55056d,_0x2845f7){var _0x5048d3=require(_0x7b1b('0x80'));var _0x221957=new _0x5048d3();var _0x5238bc=_0x221957['setUA'](_0x55056d['headers'][_0x7b1b('0x81')])['getResult']();var _0x399441={'body':_0x55056d[_0x7b1b('0x57')],'channel':_0x7b1b('0x82')};var _0x2f699f=[];var _0x1773a4=[];var _0x50d94b={};var _0x55cb62=![];return db[_0x7b1b('0x83')][_0x7b1b('0x84')]()[_0x7b1b('0x12')](function(_0x2ff334){if(!_0x2ff334){throw new db[(_0x7b1b('0x85'))][(_0x7b1b('0x86'))](_0x7b1b('0x87'));}_0x2f699f=_[_0x7b1b('0x88')](_[_0x7b1b('0x38')](_0x2ff334),['createdAt',_0x7b1b('0x89')]);_0x1773a4=_[_0x7b1b('0x88')](_[_0x7b1b('0x38')](_0x2ff334),[_0x7b1b('0x8a'),_0x7b1b('0x89'),_0x7b1b('0x8b'),_0x7b1b('0x8c')]);if(_0x55056d[_0x7b1b('0x57')]['id']){delete _0x55056d[_0x7b1b('0x57')]['id'];}if(_['isNil'](_0x55056d[_0x7b1b('0x57')][_0x7b1b('0x8d')])){throw new db[(_0x7b1b('0x85'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x55056d[_0x7b1b('0x57')][_0x7b1b('0x57')])||_0x55056d['body'][_0x7b1b('0x57')]===''){throw new db[(_0x7b1b('0x85'))]['ValidationError'](_0x7b1b('0x8e'));}if(_[_0x7b1b('0x74')](_0x55056d['body']['mapKey'])){throw new db[(_0x7b1b('0x85'))]['ValidationError'](_0x7b1b('0x8f')+_0x1773a4);}if(!_[_0x7b1b('0x90')](_0x1773a4,_0x55056d[_0x7b1b('0x57')][_0x7b1b('0x91')])){throw new db[(_0x7b1b('0x85'))]['ValidationError'](_0x7b1b('0x92')+_0x1773a4);}_0x50d94b[_0x55056d['body'][_0x7b1b('0x91')]]=_0x55056d[_0x7b1b('0x57')]['from'];})[_0x7b1b('0x12')](function(){return db[_0x7b1b('0x32')]['find']({'where':{'id':_0x55056d[_0x7b1b('0x4b')]['id']},'include':[{'model':db[_0x7b1b('0x93')],'as':_0x7b1b('0x94'),'include':[{'model':db[_0x7b1b('0x83')],'as':_0x7b1b('0x95'),'where':_0x50d94b,'limit':0x1,'order':[[_0x7b1b('0x89'),_0x7b1b('0x96')]]}]},{'model':db[_0x7b1b('0x97')],'as':'Applications'}]});})[_0x7b1b('0x12')](handleEntityNotFound(_0x2845f7,null))[_0x7b1b('0x12')](function(_0x30023e){if(_0x30023e&&_0x30023e[_0x7b1b('0x94')]){_0x399441[_0x7b1b('0x98')]=_0x30023e;_0x399441[_0x7b1b('0x99')]=_0x30023e[_0x7b1b('0x9a')];_0x399441[_0x7b1b('0x9b')]=_0x30023e[_0x7b1b('0x94')];_0x399441[_0x7b1b('0x99')]=_[_0x7b1b('0x9c')](_0x399441[_0x7b1b('0x99')],[_0x7b1b('0x9d')],[_0x7b1b('0x9e')]);if(_0x399441['account'][_0x7b1b('0x9a')]){delete _0x399441['account'][_0x7b1b('0x9a')];}if(_0x399441['account'][_0x7b1b('0x94')]&&_0x399441['account'][_0x7b1b('0x94')][_0x7b1b('0x95')][_0x7b1b('0x3e')]){return _0x399441['account'][_0x7b1b('0x94')][_0x7b1b('0x95')][0x0];}var _0xa1b3ce=_[_0x7b1b('0x9f')](_0x55056d[_0x7b1b('0x57')],{'firstName':_0x55056d[_0x7b1b('0x57')][_0x7b1b('0x8d')],'ListId':_0x30023e[_0x7b1b('0x8c')]});_0xa1b3ce[_0x55056d[_0x7b1b('0x57')][_0x7b1b('0x91')]]=_0x55056d['body'][_0x7b1b('0x8d')];return db[_0x7b1b('0x83')][_0x7b1b('0x4e')](_0xa1b3ce,{'fields':_0x2f699f,'raw':!![]});}})['then'](handleEntityNotFound(_0x2845f7,null))[_0x7b1b('0x12')](function(_0x3946a8){_0x399441[_0x7b1b('0xa0')]=_0x3946a8;var _0x3dbe9e=_0x55056d[_0x7b1b('0x57')][_0x7b1b('0xa1')];if(_0x55056d['headers'][_0x7b1b('0xa2')]){_0x3dbe9e=_0x55056d[_0x7b1b('0xa3')][_0x7b1b('0xa2')];}else if(_0x55056d[_0x7b1b('0xa3')][_0x7b1b('0xa4')]){_0x3dbe9e=_['first'](_0x55056d[_0x7b1b('0xa3')]['x-forwarded-for'][_0x7b1b('0xa5')](','));}if(_0x3946a8){var _0x311384={'ContactId':_0x3946a8['id'],'ChatWebsiteId':_0x55056d[_0x7b1b('0x4b')]['id'],'from':(_0x3946a8[_0x7b1b('0xa6')]||'')+'\x20'+(_0x3946a8[_0x7b1b('0xa7')]||''),'customerIp':_0x3dbe9e,'customerPort':_0x55056d[_0x7b1b('0xa3')][_0x7b1b('0xa8')]?_0x55056d[_0x7b1b('0xa3')][_0x7b1b('0xa8')]:null,'referer':_0x55056d['body'][_0x7b1b('0xa9')],'browserName':_0x5238bc[_0x7b1b('0xaa')][_0x7b1b('0x2c')]&&_0x5238bc[_0x7b1b('0xaa')]['version']?util['format']('%s\x20%s',_0x5238bc[_0x7b1b('0xaa')][_0x7b1b('0x2c')],_0x5238bc[_0x7b1b('0xaa')][_0x7b1b('0xab')]):'unknown','browserVersion':_0x5238bc['browser'][_0x7b1b('0xab')]||_0x7b1b('0xac'),'osName':util['format'](_0x7b1b('0xad'),_0x5238bc['os'][_0x7b1b('0x2c')],_0x5238bc['os']['version']),'osVersion':_0x5238bc['os'][_0x7b1b('0xab')],'deviceModel':_0x5238bc[_0x7b1b('0xae')][_0x7b1b('0x3a')]&&_0x5238bc[_0x7b1b('0xae')][_0x7b1b('0xaf')]?util[_0x7b1b('0xb0')](_0x7b1b('0xb1'),_0x5238bc[_0x7b1b('0xae')]['model'],_0x5238bc[_0x7b1b('0xae')][_0x7b1b('0xaf')],_0x5238bc['device'][_0x7b1b('0x35')]):null,'deviceVendor':_0x5238bc['device'][_0x7b1b('0xaf')],'deviceType':_0x5238bc[_0x7b1b('0xae')][_0x7b1b('0x35')],'formData':JSON[_0x7b1b('0x18')](_0x55056d[_0x7b1b('0x57')])};var _0x39c5dd={'ChatWebsiteId':_0x55056d[_0x7b1b('0x4b')]['id'],'closed':![]};if(_0x55056d['body'][_0x7b1b('0xb2')]){_0x39c5dd[_0x7b1b('0xb2')]=_0x55056d['body'][_0x7b1b('0xb2')];return db['ChatInteraction'][_0x7b1b('0x4d')]({'where':_0x39c5dd})[_0x7b1b('0x12')](function(_0x930556){if(_0x930556){return[_0x930556,![]];}_0x311384[_0x7b1b('0xb2')]=_0x55056d[_0x7b1b('0x57')][_0x7b1b('0xb2')];_0x311384['externalUrl']=_0x55056d[_0x7b1b('0x57')][_0x7b1b('0xb3')];return db[_0x7b1b('0xb4')][_0x7b1b('0x4e')](_0x311384)['then'](function(_0x1b6e1d){return[_0x1b6e1d,!![]];});});}_0x39c5dd[_0x7b1b('0xb5')]=_0x3946a8['id'];if(_0x55056d['body'][_0x7b1b('0xb6')]&&_0x55056d[_0x7b1b('0x57')][_0x7b1b('0xb6')]['id']){_0x39c5dd['id']=_0x55056d[_0x7b1b('0x57')][_0x7b1b('0xb6')]['id'];return db['ChatInteraction'][_0x7b1b('0x4d')]({'where':_0x39c5dd})[_0x7b1b('0x12')](function(_0x1d1bd8){if(_0x1d1bd8){return[_0x1d1bd8,![]];}return db[_0x7b1b('0xb4')]['create'](_0x311384)['then'](function(_0x4e7c8f){return[_0x4e7c8f,!![]];});});}return db['ChatInteraction'][_0x7b1b('0x4e')](_0x311384)[_0x7b1b('0x12')](function(_0x838d0){return[_0x838d0,!![]];});}})[_0x7b1b('0xb7')](function(_0x4bea2f,_0x1d2de3){if(_0x4bea2f){_0x55cb62=_0x1d2de3;if(!_0x1d2de3){var _0x1bea15={'from':(_0x399441[_0x7b1b('0xa0')][_0x7b1b('0xa6')]||'')+'\x20'+(_0x399441[_0x7b1b('0xa0')][_0x7b1b('0xa7')]||'')};if(_0x55056d[_0x7b1b('0x57')]['threadId']&&_0x55056d[_0x7b1b('0x57')]['messageId']&&_0x55056d[_0x7b1b('0x57')]['threadId']!=_0x55056d[_0x7b1b('0x57')][_0x7b1b('0xb8')]){_0x1bea15['threadId']=_0x55056d[_0x7b1b('0x57')][_0x7b1b('0xb8')];}return _0x4bea2f[_0x7b1b('0x56')](_0x1bea15);}else{return _0x4bea2f;}}})['then'](function(_0xb597e8){_0x399441[_0x7b1b('0xb6')]=_0xb597e8['get']({'plain':!![]});_0x399441[_0x7b1b('0xb6')][_0x7b1b('0xb9')]=_0x55cb62;if(_0x399441[_0x7b1b('0xb6')][_0x7b1b('0xb9')]){if(_0x399441[_0x7b1b('0x98')][_0x7b1b('0xba')]){_0x399441[_0x7b1b('0x99')][_0x7b1b('0xbb')]({'id':0x0,'priority':_0x399441[_0x7b1b('0x99')][_0x7b1b('0x3e')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x7b1b('0xbc')});}}return db['ChatMessage']['create']({'body':_0x55056d[_0x7b1b('0x57')]['body'],'ChatWebsiteId':_0x55056d[_0x7b1b('0x4b')]['id'],'ChatInteractionId':_0xb597e8['id'],'direction':'in','ContactId':_0x399441['contact']['id'],'AttachmentId':_0x55056d['body'][_0x7b1b('0xbd')]});})[_0x7b1b('0x12')](function(_0x449ed4){_0x399441[_0x7b1b('0x1b')]=_0x449ed4;if(_0x399441[_0x7b1b('0xb6')][_0x7b1b('0xbe')]){return db['User'][_0x7b1b('0x4d')]({'attributes':['id',_0x7b1b('0x2c')],'where':{'id':_0x399441['interaction'][_0x7b1b('0xbe')]}})[_0x7b1b('0x12')](function(_0x139241){if(_0x139241){_0x399441['applications'][_0x7b1b('0xbf')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x139241[_0x7b1b('0x2c')]+','+(_0x399441[_0x7b1b('0x98')][_0x7b1b('0xc0')]||0xa),'interval':_0x7b1b('0xbc')});_0x399441[_0x7b1b('0xc1')]=!![];}return respondWithRpcPromise(_0x7b1b('0xc2'),_0x7b1b('0xc3'),_0x399441);});}return respondWithRpcPromise(_0x7b1b('0xc2'),_0x7b1b('0xc3'),_0x399441);})['then'](function(_0x23b93b){respondWithRpcPromise(_0x7b1b('0xc4'),_0x7b1b('0xc4'),{'event':'notify','message':_0x23b93b},client9002);return _0x23b93b;})['then'](respondWithResult(_0x2845f7,null))['catch'](handleError(_0x2845f7,null));};exports[_0x7b1b('0xc5')]=function(_0x36e819,_0x5c7f6a){var _0x52d5ac,_0x14822b,_0x1a5c8c;var _0x449dab=[];var _0x5a32e1={};var _0x51f3a4=_0x36e819['files']||[];var _0x161f3b=[];var _0x4ce356;return db['CmContact']['describe']()[_0x7b1b('0x12')](function(_0xa42aec){if(!_0xa42aec){throw new db[(_0x7b1b('0x85'))][(_0x7b1b('0x86'))](_0x7b1b('0x87'));}_0x449dab=_[_0x7b1b('0x88')](_[_0x7b1b('0x38')](_0xa42aec),[_0x7b1b('0x8a'),_0x7b1b('0x89'),_0x7b1b('0x8b'),_0x7b1b('0x8c')]);if(_0x36e819['body']['id']){delete _0x36e819['body']['id'];}if(_[_0x7b1b('0x74')](_0x36e819[_0x7b1b('0x57')][_0x7b1b('0x8d')])){throw _0x5c7f6a['status'](0x1f4)[_0x7b1b('0x2d')](new db[(_0x7b1b('0x85'))]['ValidationError'](_0x7b1b('0xc6')));}if(_[_0x7b1b('0x74')](_0x36e819[_0x7b1b('0x57')][_0x7b1b('0x57')])||_0x36e819[_0x7b1b('0x57')]['body']===''){throw _0x5c7f6a[_0x7b1b('0x1f')](0x1f4)[_0x7b1b('0x2d')](new db[(_0x7b1b('0x85'))]['ValidationError'](_0x7b1b('0x8e')));}if(_[_0x7b1b('0x74')](_0x36e819['body']['mapKeyOffline'])){throw _0x5c7f6a[_0x7b1b('0x1f')](0x1f4)[_0x7b1b('0x2d')](new db[(_0x7b1b('0x85'))][(_0x7b1b('0x86'))](_0x7b1b('0xc7')+_0x449dab));}if(!_['includes'](_0x449dab,_0x36e819[_0x7b1b('0x57')][_0x7b1b('0xc8')])){throw _0x5c7f6a[_0x7b1b('0x1f')](0x1f4)[_0x7b1b('0x2d')](new db['Sequelize'][(_0x7b1b('0x86'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x449dab));}_0x5a32e1[_0x36e819[_0x7b1b('0x57')][_0x7b1b('0xc8')]]=_0x36e819[_0x7b1b('0x57')][_0x7b1b('0x8d')];})[_0x7b1b('0x12')](function(){return db['ChatWebsite'][_0x7b1b('0x4d')]({'where':{'id':_0x36e819[_0x7b1b('0x4b')]['id']},'include':[{'model':db[_0x7b1b('0x93')],'as':'List'},{'model':db['MailAccount'],'as':_0x7b1b('0xc9')}]});})[_0x7b1b('0x12')](handleEntityNotFound(_0x5c7f6a,null))['then'](function(_0x4efc3f){if(_0x4efc3f&&_0x4efc3f['List']){_0x14822b=_0x4efc3f;var _0x35bf26=_['defaults'](_0x36e819[_0x7b1b('0x57')],{'firstName':_0x36e819['body']['from'],'phone':_0x36e819[_0x7b1b('0x57')][_0x7b1b('0x8d')],'ListId':_0x4efc3f[_0x7b1b('0x8c')]});_0x35bf26[_0x36e819['body'][_0x7b1b('0xc8')]]=_0x36e819[_0x7b1b('0x57')][_0x7b1b('0x8d')];return db['CmContact'][_0x7b1b('0xca')]({'where':_0x5a32e1,'defaults':_0x35bf26});}})[_0x7b1b('0xb7')](function(_0x72bd1a){if(_0x72bd1a){_0x1a5c8c=_0x72bd1a;var _0xc9d06f=fs[_0x7b1b('0xcb')](path['join'](config['root'],_0x7b1b('0xcc')),_0x7b1b('0xcd'));var _0x44b4ae=ejs[_0x7b1b('0xce')](_0xc9d06f,{'body':_[_0x7b1b('0xcf')](_0x36e819[_0x7b1b('0x57')][_0x7b1b('0x57')]),'bodyTitle':_0x14822b[_0x7b1b('0xd0')]});return db[_0x7b1b('0xd1')]['create']({'body':_0x44b4ae,'plainBody':htmlToText[_0x7b1b('0xd2')](_0x44b4ae),'ContactId':_0x72bd1a['id'],'ChatWebsiteId':_0x14822b['id']});}})['then'](function(_0x2a746f){_0x4ce356=_0x2a746f;if(_0x51f3a4['length']){var _0x1e9aee=_0x51f3a4[_0x7b1b('0x31')](function(_0x5268e3){return{'name':_0x5268e3['originalname'],'basename':_0x5268e3['filename'],'type':_0x5268e3[_0x7b1b('0xd3')],'ChatOfflineMessageId':_0x2a746f['id']};});_0x161f3b=_0x1e9aee['map'](_0xe907bb=>{var _0x10f861={'filename':_0xe907bb[_0x7b1b('0x2c')],'path':path[_0x7b1b('0x6e')](config['root'],_0x7b1b('0xd4'),_0x7b1b('0xd5'),_0x7b1b('0xd6'),_0x7b1b('0xd7'),_0xe907bb['basename'])};return _0x10f861;});if(!_0x14822b[_0x7b1b('0xd8')]){return db[_0x7b1b('0xd9')][_0x7b1b('0xda')](function(_0x4a8676){return db[_0x7b1b('0xdb')][_0x7b1b('0xdc')](_0x1e9aee,{'transaction':_0x4a8676});});}}})[_0x7b1b('0x12')](function(){if(_0x4ce356){_0x52d5ac=_0x4ce356;return db['MailAccount'][_0x7b1b('0x5a')]({'where':{'service':!![]},'include':[{'model':db[_0x7b1b('0xdd')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x7b1b('0xde')],'as':_0x7b1b('0xde'),'raw':!![]}]}]});}})[_0x7b1b('0x12')](function(_0x3e9406){if(_0x3e9406&&_0x3e9406[_0x7b1b('0xdf')]&&_0x14822b[_0x7b1b('0xe0')]&&_0x14822b[_0x7b1b('0xe1')]){var _0x3428ec=_0x3e9406[_0x7b1b('0xe2')]();return respondWithRpcPromise(_0x7b1b('0xe3'),'sendMail',{'account':_0x3428ec,'message':{'from':util[_0x7b1b('0xb0')](_0x7b1b('0xe4'),_0x3e9406['name'],_0x3e9406[_0x7b1b('0xe5')]||_0x3e9406['Smtp']['user']),'to':_0x14822b[_0x7b1b('0xe1')],'subject':_0x14822b[_0x7b1b('0xe6')],'html':_0x52d5ac[_0x7b1b('0x57')],'attachments':_0x161f3b}},client9003)[_0x7b1b('0x12')](function(){return _0x52d5ac;})[_0x7b1b('0x1d')](function(_0xa677b4){logger['error'](_0xa677b4);});}})[_0x7b1b('0x12')](function(){if(_0x14822b&&_0x14822b['openNewInteraction']&&_0x14822b[_0x7b1b('0xe7')]){var _0x54c190=[];if(_0x51f3a4[_0x7b1b('0x3e')]){_0x54c190=_0x51f3a4[_0x7b1b('0x31')](function(_0x30f50f){return{'name':_0x30f50f['originalname'],'basename':_0x30f50f[_0x7b1b('0x67')],'type':_0x30f50f['mimetype'],'ChatOfflineMessageId':_0x4ce356['id']};});}var _0x5024b8;if(!_[_0x7b1b('0x74')](_0x14822b[_0x7b1b('0xe8')])){var _0x2603cb=_[_0x7b1b('0x31')](_0x36e819[_0x7b1b('0x57')],function(_0x160fab){return _0x160fab;});var _0x43a545=_[_0x7b1b('0xe9')](_0x2603cb)[0x0];var _0x43f2fb=_[_0x7b1b('0xea')](_0x43a545,function(_0xac0661){return _0xac0661;});_0x5024b8=_0x43f2fb[0x1][_0x14822b['subjectOffline']];}var _0x35b736={'from':_0x1a5c8c[_0x7b1b('0xe5')],'firstName':_0x1a5c8c[_0x7b1b('0xa6')],'lastName':_0x1a5c8c[_0x7b1b('0xa7')],'mapKey':_0x7b1b('0xe5'),'message':{'from':_0x1a5c8c['email'],'to':_0x14822b['MailAccount'][_0x7b1b('0xe5')],'cc':'','subject':_[_0x7b1b('0x74')](_0x5024b8)?_0x14822b[_0x7b1b('0xe6')]:_0x5024b8,'messageId':'','sentAt':new Date(),'attach':_0x54c190[_0x7b1b('0x3e')],'attachments':_0x54c190,'originChannel':'Chat','ChatWebsiteId':_0x14822b['id'],'ChatOfflineMessageId':_0x52d5ac['id'],'originTo':_0x14822b[_0x7b1b('0xc9')][_0x7b1b('0xe5')]},'body':_0x52d5ac[_0x7b1b('0x57')]};var _0x396dc4={'account':{'id':_0x14822b[_0x7b1b('0xe7')]},'body':_0x35b736,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0x396dc4,client9001)[_0x7b1b('0x12')](function(){return _0x52d5ac;})['catch'](function(_0x36b578){logger[_0x7b1b('0x19')](_0x36b578);});}return;})['then'](function(){if(_0x52d5ac){return _0x52d5ac;}})[_0x7b1b('0x12')](respondWithResult(_0x5c7f6a,null))['catch'](function(_0x21915f){logger[_0x7b1b('0x19')](_0x7b1b('0x1d'),_0x21915f);for(var _0x3d8c2f of _0x51f3a4){var _0x46d62a=path[_0x7b1b('0x6e')](config['root'],_0x7b1b('0xd4'),_0x7b1b('0xd5'),_0x7b1b('0xd6'),_0x7b1b('0xd7'),_0x3d8c2f[_0x7b1b('0x67')]);fs_extra[_0x7b1b('0xeb')](_0x46d62a)['catch'](function(_0x547f3d){logger[_0x7b1b('0x19')](_0x7b1b('0xec'),_0x46d62a,_0x547f3d);});}});};exports[_0x7b1b('0xed')]=function(_0x5a5e9b,_0xceee3){return db[_0x7b1b('0xb4')][_0x7b1b('0x4d')]({'where':{'id':_0x5a5e9b[_0x7b1b('0x4b')]['id']}})['then'](handleEntityNotFound(_0xceee3,null))[_0x7b1b('0x12')](function(_0x370b08){if(_0x370b08){return _0x370b08[_0x7b1b('0xed')](_0x5a5e9b['body']['ids'],_[_0x7b1b('0xee')](_0x5a5e9b[_0x7b1b('0x57')],[_0x7b1b('0x5f'),'id'])||{});}})[_0x7b1b('0x12')](respondWithResult(_0xceee3,null))[_0x7b1b('0x1d')](handleError(_0xceee3,null));};exports[_0x7b1b('0xef')]=function(_0x6f77be,_0x1a6a38){var _0x567628={'raw':![],'where':{}};var _0x22d63d={};var _0x3e3520={'count':0x0,'rows':[]};return db[_0x7b1b('0x32')][_0x7b1b('0x5a')]({'where':{'id':_0x6f77be[_0x7b1b('0x4b')]['id']}})[_0x7b1b('0x12')](handleEntityNotFound(_0x1a6a38,null))['then'](function(_0x1043c1){if(_0x1043c1){_0x22d63d[_0x7b1b('0x3a')]=_[_0x7b1b('0x38')](db[_0x7b1b('0xb4')][_0x7b1b('0x33')]);_0x22d63d[_0x7b1b('0x37')]=_[_0x7b1b('0x38')](_0x6f77be[_0x7b1b('0x37')]);_0x22d63d[_0x7b1b('0x39')]=_['intersection'](_0x22d63d[_0x7b1b('0x3a')],_0x22d63d[_0x7b1b('0x37')]);_0x567628[_0x7b1b('0x3d')]=_[_0x7b1b('0x3b')](_0x22d63d[_0x7b1b('0x3a')],qs[_0x7b1b('0x3c')](_0x6f77be[_0x7b1b('0x37')][_0x7b1b('0x3c')]));_0x567628[_0x7b1b('0x3d')]=_0x567628[_0x7b1b('0x3d')][_0x7b1b('0x3e')]?_0x567628[_0x7b1b('0x3d')]:_0x22d63d[_0x7b1b('0x3a')];if(!_0x6f77be[_0x7b1b('0x37')][_0x7b1b('0x3f')](_0x7b1b('0x5c'))){_0x567628[_0x7b1b('0x23')]=qs[_0x7b1b('0x23')](_0x6f77be[_0x7b1b('0x37')][_0x7b1b('0x23')]);_0x567628['offset']=qs[_0x7b1b('0x22')](_0x6f77be[_0x7b1b('0x37')]['offset']);}_0x567628['order']=qs[_0x7b1b('0x41')](_0x6f77be[_0x7b1b('0x37')]['sort']);_0x567628[_0x7b1b('0x42')]=qs['filters'](_[_0x7b1b('0x43')](_0x6f77be['query'],_0x22d63d[_0x7b1b('0x39')]));_0x567628['where'][_0x7b1b('0x5d')]=_0x1043c1['id'];if(_0x6f77be[_0x7b1b('0x37')][_0x7b1b('0x44')]){_0x567628[_0x7b1b('0x42')]=_['merge'](_0x567628[_0x7b1b('0x42')],{'$or':_[_0x7b1b('0x31')](_0x567628[_0x7b1b('0x3d')],function(_0x56915b){var _0xab98d8={};_0xab98d8[_0x56915b]={'$like':'%'+_0x6f77be[_0x7b1b('0x37')][_0x7b1b('0x44')]+'%'};return _0xab98d8;})});}_0x567628=_['merge']({},_0x567628,_0x6f77be[_0x7b1b('0x4c')]);return db['ChatInteraction'][_0x7b1b('0x25')]({'where':_0x567628[_0x7b1b('0x42')]})['then'](function(_0x553856){_0x3e3520['count']=_0x553856;if(_0x6f77be['query'][_0x7b1b('0x47')]){_0x567628['include']=[{'model':db[_0x7b1b('0x83')],'as':'Contact','required':![]},{'model':db[_0x7b1b('0xf0')],'as':'Owner','attributes':['name','fullname',_0x7b1b('0xf1')],'required':![]},{'model':db[_0x7b1b('0xf2')],'as':_0x7b1b('0xf3'),'attributes':['id',_0x7b1b('0x2c'),_0x7b1b('0xf4')],'where':_0x6f77be[_0x7b1b('0x37')]['tag']?{'id':_0x6f77be['query'][_0x7b1b('0xf5')]}:undefined,'required':_0x6f77be[_0x7b1b('0x37')]['tag']?!![]:![]}];}return db[_0x7b1b('0xb4')]['findAll'](_0x567628);})[_0x7b1b('0x12')](function(_0x1a6629){_0x3e3520['rows']=_0x1a6629;return _0x3e3520;});}})['then'](respondWithFilteredResult(_0x1a6a38,_0x567628))['catch'](handleError(_0x1a6a38,null));};function iftimePromise(_0x1a3470,_0x2e1dd9){return respondWithRpcPromise(_0x7b1b('0xf6'),_0x7b1b('0xf7'),{'command':_0x2e1dd9[_0x7b1b('0xf8')]?util[_0x7b1b('0xb0')]('iftime\x20%s,%s',_0x1a3470[_0x7b1b('0xf9')],_0x2e1dd9['timezone']):util[_0x7b1b('0xb0')](_0x7b1b('0xfa'),_0x1a3470['interval'])},client9002)[_0x7b1b('0x12')](function(_0x19953e){var _0x5c62e8=_0x19953e&&_0x19953e[_0x7b1b('0xfb')](_0x7b1b('0xfc'))>=0x0?!![]:![];logger[_0x7b1b('0x13')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x2e1dd9['id'],_0x1a3470['id'],_0x1a3470[_0x7b1b('0xf9')],_0x5c62e8?_0x7b1b('0xfd'):'OFFLINE',_0x2e1dd9[_0x7b1b('0xf8')]?_0x2e1dd9['timezone']:_0x7b1b('0xfe'));return _0x5c62e8;})[_0x7b1b('0x1d')](function(_0x1e35d4){logger[_0x7b1b('0x19')](_0x7b1b('0xff'),_0x2e1dd9['id'],_0x1a3470['id'],_0x1a3470[_0x7b1b('0xf9')],util['inspect'](_0x1e35d4,{'showHidden':![],'depth':null}),_0x2e1dd9['timezone']?_0x2e1dd9[_0x7b1b('0xf8')]:_0x7b1b('0xfe'));return![];});}exports[_0x7b1b('0xf7')]=function(_0xb2a946,_0x1ca635){var _0x39a6d3=0x0;var _0x261371=0x0;var _0x47cc26=![];var _0x492038;var _0x3ad750;return db['ChatWebsite'][_0x7b1b('0x4d')]({'where':{'id':_0xb2a946['params']['id']},'include':[{'model':db[_0x7b1b('0x100')],'as':'Interval','include':[{'model':db[_0x7b1b('0x100')],'as':'Intervals','attributes':['id','interval'],'raw':!![]}]}]})[_0x7b1b('0x12')](handleEntityNotFound(_0x1ca635,null))[_0x7b1b('0x12')](function(_0x396c76){if(_0x396c76){_0x492038=_0x396c76;return _0x396c76[_0x7b1b('0x101')]({'raw':!![]});}})['then'](function(_0x16442f){if(_0x492038){if(_0x16442f){_0x3ad750=_0x16442f;}}return require(_0x7b1b('0x71'))[_0x7b1b('0x72')]();})[_0x7b1b('0x12')](function(_0xf6dcf){if(_0xf6dcf){_0x261371=_0xf6dcf[_0x7b1b('0x102')];_0x47cc26=_0xf6dcf[_0x7b1b('0x73')];}})[_0x7b1b('0x12')](function(){return db[_0x7b1b('0xb4')][_0x7b1b('0x25')]({'where':{'closed':![]}});})[_0x7b1b('0x12')](function(_0x998e71){_0x39a6d3=_0x998e71;if(_0x261371&&_0x998e71>_0x261371){return db['License'][_0x7b1b('0x5a')]({'where':{'id':0x1}})['then'](function(_0x3ebbe0){if(_0x3ebbe0){_0x3ebbe0['increment'](_0x7b1b('0x103'));}});}})['then'](function(){if(_0x492038[_0x7b1b('0x100')]&&_0x492038['Interval'][_0x7b1b('0x104')]){var _0x4fd387=[];for(var _0x3a3025=0x0;_0x3a3025<_0x492038['Interval']['Intervals'][_0x7b1b('0x3e')];_0x3a3025++){var _0x415666=_0x492038[_0x7b1b('0x100')][_0x7b1b('0x104')][_0x3a3025]['get']({'plain':!![]});_0x4fd387[_0x7b1b('0xbb')](iftimePromise(_0x415666,_0x492038));}return BPromise[_0x7b1b('0x105')](_0x4fd387)[_0x7b1b('0x12')](function(_0x307779){return _[_0x7b1b('0x106')](_0x307779);});}else{return!![];}})['then'](function(_0x43d049){var _0x3ae93d=fs[_0x7b1b('0xcb')](path[_0x7b1b('0x6e')](config['root'],_0x7b1b('0x107')),_0x7b1b('0xcd'));var _0x1da208=new url[(_0x7b1b('0x108'))](_0x492038[_0x7b1b('0x109')])[_0x7b1b('0x10a')];var _0x4ce69a=_0x7b1b('0x10b');var _0x356b58=![];var _0x5d3320={'chatVersion':_0x4ce69a,'chatWebsiteAddressOrigin':_0x1da208,'remote':_0x492038[_0x7b1b('0x10c')],'query':querystring['stringify'](_[_0x7b1b('0x45')](_0x492038[_0x7b1b('0x50')]({'plain':!![]}),{'customerIp':_0xb2a946['headers'][_0x7b1b('0xa4')]||_0xb2a946[_0x7b1b('0xa3')][_0x7b1b('0x10d')]||_0xb2a946['connection'][_0x7b1b('0x10e')]||_0xb2a946['ip'],'referer':_0xb2a946[_0x7b1b('0xa3')][_0x7b1b('0xa9')],'openedInteractions':_0x39a6d3,'maxInteractions':_0x261371,'virtual':_0x47cc26['virtual'],'online':_0x43d049,'custom':_0x47cc26}))[_0x7b1b('0x10f')](/'/g,'\x5c\x27')};_0x1ca635['send'](ejs[_0x7b1b('0xce')](Mustache[_0x7b1b('0xce')](_0x3ae93d,_0x5d3320),{'proactiveActions':_0x3ad750,'alignment':_0x492038['alignment'],'verticalAlignment':_0x492038[_0x7b1b('0x110')],'div_color':_0x492038[_0x7b1b('0xf4')],'labelText':_0x492038[_0x7b1b('0x111')],'text_color':_0x492038['textColor'],'text_button_color':_0x492038[_0x7b1b('0x112')],'button_color':_0x492038[_0x7b1b('0x113')],'background_color':_0x492038[_0x7b1b('0x114')],'hideWhenOffline':_0x492038['hideWhenOffline'],'intervalId':_0x492038['IntervalId'],'isDevelopment':_0x356b58,'chatVersion':_0x4ce69a}));})[_0x7b1b('0x1d')](handleError(_0x1ca635,null));};exports[_0x7b1b('0x115')]=function(_0x853d1f,_0x12802e){var _0xfc8a7c=_0x853d1f['params']['id'];var _0x2065c1=_0x853d1f[_0x7b1b('0x57')];var _0x13f1cb=0xc8;var _0x4156ea=null;return db[_0x7b1b('0xd9')][_0x7b1b('0xda')]({'isolationLevel':db[_0x7b1b('0xd9')][_0x7b1b('0x116')][_0x7b1b('0x117')][_0x7b1b('0x118')]},function(_0x383582){return db['ChatWebsite'][_0x7b1b('0x5a')]({'where':{'id':_0xfc8a7c},'transaction':_0x383582})['then'](function(_0x462c75){if(_0x462c75){return db[_0x7b1b('0x97')][_0x7b1b('0x28')]({'where':{'ChatWebsiteId':_0xfc8a7c},'transaction':_0x383582})['then'](function(){var _0x395d66=_['map'](_0x2065c1,function(_0xe51730){_0xe51730['ChatWebsiteId']=_0xfc8a7c;return _0xe51730;});return db['ChatApplication'][_0x7b1b('0xdc')](_0x395d66,{'transaction':_0x383582});});}else{_0x13f1cb=0x194;_0x4156ea=[];}});})['then'](function(){if(_0x13f1cb!==0x194){return db[_0x7b1b('0x97')][_0x7b1b('0x119')]({'where':{'ChatWebsiteId':_0xfc8a7c},'order':_0x7b1b('0x9d')})['then'](function(_0x5f95a6){_0x4156ea=_0x5f95a6;});}})[_0x7b1b('0x1d')](function(_0x2a5f4d){_0x13f1cb=0x1f4;logger[_0x7b1b('0x19')](_0x2a5f4d[_0x7b1b('0x2b')]);if(_0x2a5f4d[_0x7b1b('0x2c')]){delete _0x2a5f4d['name'];}_0x4156ea=_0x2a5f4d;})['finally'](function(){if(_0x4156ea===null){_0x12802e[_0x7b1b('0x1e')](_0x13f1cb);}else{if(_0x13f1cb===0x1f4){_0x12802e['status'](_0x13f1cb)[_0x7b1b('0x2d')](_0x4156ea);}else{_0x12802e['status'](_0x13f1cb)[_0x7b1b('0x21')](_0x4156ea);}}});};exports['getApplications']=function(_0x459e9f,_0x3ced78){var _0x491940={};var _0x2ea6c1={};var _0x6b2198;var _0x39b360;return db[_0x7b1b('0x32')][_0x7b1b('0x5a')]({'where':{'id':_0x459e9f[_0x7b1b('0x4b')]['id']}})[_0x7b1b('0x12')](handleEntityNotFound(_0x3ced78,null))[_0x7b1b('0x12')](function(_0x4c5592){if(_0x4c5592){_0x6b2198=_0x4c5592;_0x2ea6c1['model']=_[_0x7b1b('0x38')](db[_0x7b1b('0x97')][_0x7b1b('0x33')]);_0x2ea6c1[_0x7b1b('0x37')]=_[_0x7b1b('0x38')](_0x459e9f[_0x7b1b('0x37')]);_0x2ea6c1[_0x7b1b('0x39')]=_[_0x7b1b('0x3b')](_0x2ea6c1[_0x7b1b('0x3a')],_0x2ea6c1[_0x7b1b('0x37')]);_0x491940[_0x7b1b('0x3d')]=_['intersection'](_0x2ea6c1[_0x7b1b('0x3a')],qs[_0x7b1b('0x3c')](_0x459e9f[_0x7b1b('0x37')][_0x7b1b('0x3c')]));_0x491940['attributes']=_0x491940[_0x7b1b('0x3d')][_0x7b1b('0x3e')]?_0x491940[_0x7b1b('0x3d')]:_0x2ea6c1[_0x7b1b('0x3a')];_0x491940['order']=qs[_0x7b1b('0x41')](_0x459e9f[_0x7b1b('0x37')][_0x7b1b('0x41')]);_0x491940[_0x7b1b('0x42')]=qs[_0x7b1b('0x39')](_['pick'](_0x459e9f[_0x7b1b('0x37')],_0x2ea6c1[_0x7b1b('0x39')]));if(_0x459e9f[_0x7b1b('0x37')]['filter']){_0x491940[_0x7b1b('0x42')]=_[_0x7b1b('0x45')](_0x491940[_0x7b1b('0x42')],{'$or':_[_0x7b1b('0x31')](_0x491940[_0x7b1b('0x3d')],function(_0x345cbd){var _0x7667e={};_0x7667e[_0x345cbd]={'$like':'%'+_0x459e9f['query'][_0x7b1b('0x44')]+'%'};return _0x7667e;})});}_0x491940=_[_0x7b1b('0x45')]({},_0x491940,_0x459e9f[_0x7b1b('0x4c')]);return _0x6b2198['getApplications'](_0x491940);}})[_0x7b1b('0x12')](function(_0x5807b6){if(_0x5807b6){_0x39b360=_0x5807b6['length'];if(!_0x459e9f[_0x7b1b('0x37')][_0x7b1b('0x3f')](_0x7b1b('0x5c'))){_0x491940[_0x7b1b('0x23')]=qs[_0x7b1b('0x23')](_0x459e9f[_0x7b1b('0x37')][_0x7b1b('0x23')]);_0x491940[_0x7b1b('0x22')]=qs['offset'](_0x459e9f[_0x7b1b('0x37')][_0x7b1b('0x22')]);}return _0x6b2198[_0x7b1b('0x11a')](_0x491940);}})[_0x7b1b('0x12')](function(_0x5f497b){if(_0x5f497b){return _0x5f497b?{'count':_0x39b360,'rows':_0x5f497b}:null;}})[_0x7b1b('0x12')](respondWithResult(_0x3ced78,null))['catch'](handleError(_0x3ced78,null));};exports[_0x7b1b('0x11b')]=function(_0x1a721a,_0x541c92){return db['chatProactiveAction'][_0x7b1b('0x4d')]({'where':{'id':_0x1a721a['params']['id']}})[_0x7b1b('0x12')](handleEntityNotFound(_0x541c92,null))['then'](function(_0x2e8c82){if(_0x2e8c82){return _0x2e8c82[_0x7b1b('0x11b')](_0x1a721a[_0x7b1b('0x57')][_0x7b1b('0x5f')],_[_0x7b1b('0xee')](_0x1a721a[_0x7b1b('0x57')],[_0x7b1b('0x5f'),'id'])||{});}})['then'](respondWithResult(_0x541c92,null))[_0x7b1b('0x1d')](handleError(_0x541c92,null));};exports[_0x7b1b('0x101')]=function(_0x23403f,_0x3d5691){var _0x438bd0={};var _0x2a59fb={};var _0x1b1d83;var _0x508c3c;return db[_0x7b1b('0x32')][_0x7b1b('0x5a')]({'where':{'id':_0x23403f['params']['id']}})[_0x7b1b('0x12')](handleEntityNotFound(_0x3d5691,null))[_0x7b1b('0x12')](function(_0xbf9f2b){if(_0xbf9f2b){_0x1b1d83=_0xbf9f2b;_0x2a59fb[_0x7b1b('0x3a')]=_[_0x7b1b('0x38')](db['ChatProactiveAction']['rawAttributes']);_0x2a59fb['query']=_['keys'](_0x23403f[_0x7b1b('0x37')]);_0x2a59fb[_0x7b1b('0x39')]=_['intersection'](_0x2a59fb[_0x7b1b('0x3a')],_0x2a59fb['query']);_0x438bd0['attributes']=_[_0x7b1b('0x3b')](_0x2a59fb[_0x7b1b('0x3a')],qs['fields'](_0x23403f[_0x7b1b('0x37')][_0x7b1b('0x3c')]));_0x438bd0[_0x7b1b('0x3d')]=_0x438bd0[_0x7b1b('0x3d')][_0x7b1b('0x3e')]?_0x438bd0['attributes']:_0x2a59fb[_0x7b1b('0x3a')];_0x438bd0[_0x7b1b('0x40')]=qs[_0x7b1b('0x41')](_0x23403f[_0x7b1b('0x37')][_0x7b1b('0x41')]);_0x438bd0['where']=qs[_0x7b1b('0x39')](_[_0x7b1b('0x43')](_0x23403f[_0x7b1b('0x37')],_0x2a59fb[_0x7b1b('0x39')]));if(_0x23403f[_0x7b1b('0x37')][_0x7b1b('0x44')]){_0x438bd0[_0x7b1b('0x42')]=_[_0x7b1b('0x45')](_0x438bd0['where'],{'$or':_['map'](_0x438bd0['attributes'],function(_0x2b93a1){var _0x1c9233={};_0x1c9233[_0x2b93a1]={'$like':'%'+_0x23403f[_0x7b1b('0x37')]['filter']+'%'};return _0x1c9233;})});}_0x438bd0=_[_0x7b1b('0x45')]({},_0x438bd0,_0x23403f['options']);return _0x1b1d83[_0x7b1b('0x101')](_0x438bd0);}})[_0x7b1b('0x12')](function(_0x2b7e75){if(_0x2b7e75){_0x508c3c=_0x2b7e75['length'];if(!_0x23403f[_0x7b1b('0x37')]['hasOwnProperty'](_0x7b1b('0x5c'))){_0x438bd0[_0x7b1b('0x23')]=qs[_0x7b1b('0x23')](_0x23403f[_0x7b1b('0x37')][_0x7b1b('0x23')]);_0x438bd0[_0x7b1b('0x22')]=qs[_0x7b1b('0x22')](_0x23403f[_0x7b1b('0x37')][_0x7b1b('0x22')]);}return _0x1b1d83[_0x7b1b('0x101')](_0x438bd0);}})[_0x7b1b('0x12')](function(_0x5a2826){if(_0x5a2826){return _0x5a2826?{'count':_0x508c3c,'rows':_0x5a2826}:null;}})[_0x7b1b('0x12')](respondWithResult(_0x3d5691,null))[_0x7b1b('0x1d')](handleError(_0x3d5691,null));};exports[_0x7b1b('0x11c')]=function(_0x13921a,_0x2971f3){var _0x37cd71=_0x13921a[_0x7b1b('0x37')][_0x7b1b('0x11d')]===_0x7b1b('0x11e')?_0x7b1b('0x11f'):_0x7b1b('0x120');return db[_0x7b1b('0x32')][_0x7b1b('0x4d')]({'attributes':['id',_0x37cd71],'where':{'id':_0x13921a[_0x7b1b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2971f3,null))[_0x7b1b('0x12')](function(_0x1a5186){if(_0x1a5186){var _0x1cb8eb=_0x1a5186[_0x37cd71];var _0x535317=_0x1cb8eb&&_0x1cb8eb['items']?_0x1cb8eb[_0x7b1b('0x121')]:[];_0x2971f3[_0x7b1b('0x2d')]({'fromKey':_['isNil'](_0x1cb8eb['fromKey'])?undefined:_0x1cb8eb['fromKey'],'count':_0x535317[_0x7b1b('0x3e')],'rows':_0x535317});}})[_0x7b1b('0x1d')](handleError(_0x2971f3,null));};exports[_0x7b1b('0x122')]=function(_0x430ee4,_0x1fe641){var _0x5dd77a={'raw':![],'where':{}};var _0x514d1f={};var _0x147e0d={'count':0x0,'rows':[]};return db[_0x7b1b('0x32')][_0x7b1b('0x5a')]({'where':{'id':_0x430ee4[_0x7b1b('0x4b')]['id']}})[_0x7b1b('0x12')](handleEntityNotFound(_0x1fe641,null))[_0x7b1b('0x12')](function(_0x551478){if(_0x551478){_0x514d1f['model']=_[_0x7b1b('0x38')](db[_0x7b1b('0xd1')][_0x7b1b('0x33')]);_0x514d1f[_0x7b1b('0x37')]=_[_0x7b1b('0x38')](_0x430ee4[_0x7b1b('0x37')]);_0x514d1f[_0x7b1b('0x39')]=_['intersection'](_0x514d1f[_0x7b1b('0x3a')],_0x514d1f[_0x7b1b('0x37')]);_0x5dd77a[_0x7b1b('0x3d')]=_[_0x7b1b('0x3b')](_0x514d1f[_0x7b1b('0x3a')],qs[_0x7b1b('0x3c')](_0x430ee4['query']['fields']));_0x5dd77a[_0x7b1b('0x3d')]=_0x5dd77a[_0x7b1b('0x3d')]['length']?_0x5dd77a[_0x7b1b('0x3d')]:_0x514d1f['model'];if(!_0x430ee4[_0x7b1b('0x37')][_0x7b1b('0x3f')](_0x7b1b('0x5c'))){_0x5dd77a[_0x7b1b('0x23')]=qs[_0x7b1b('0x23')](_0x430ee4[_0x7b1b('0x37')][_0x7b1b('0x23')]);_0x5dd77a[_0x7b1b('0x22')]=qs[_0x7b1b('0x22')](_0x430ee4[_0x7b1b('0x37')]['offset']);}_0x5dd77a[_0x7b1b('0x40')]=qs[_0x7b1b('0x41')](_0x430ee4[_0x7b1b('0x37')][_0x7b1b('0x41')]);_0x5dd77a[_0x7b1b('0x42')]=qs[_0x7b1b('0x39')](_[_0x7b1b('0x43')](_0x430ee4[_0x7b1b('0x37')],_0x514d1f[_0x7b1b('0x39')]));_0x5dd77a['where']['ChatWebsiteId']=_0x551478['id'];if(_0x430ee4[_0x7b1b('0x37')][_0x7b1b('0x44')]){_0x5dd77a['where']=_[_0x7b1b('0x45')](_0x5dd77a[_0x7b1b('0x42')],{'$or':_[_0x7b1b('0x31')](_0x5dd77a[_0x7b1b('0x3d')],function(_0x2b5ce3){var _0x2df0da={};_0x2df0da[_0x2b5ce3]={'$like':'%'+_0x430ee4['query'][_0x7b1b('0x44')]+'%'};return _0x2df0da;})});}_0x5dd77a=_['merge']({},_0x5dd77a,_0x430ee4[_0x7b1b('0x4c')]);return db['ChatOfflineMessage'][_0x7b1b('0x25')]({'where':_0x5dd77a[_0x7b1b('0x42')]})[_0x7b1b('0x12')](function(_0x67b8dd){_0x147e0d[_0x7b1b('0x25')]=_0x67b8dd;if(_0x430ee4[_0x7b1b('0x37')][_0x7b1b('0x47')]){_0x5dd77a[_0x7b1b('0x48')]=[{'all':!![]}];}else{_0x5dd77a[_0x7b1b('0x48')]=[{'model':db[_0x7b1b('0x83')],'as':_0x7b1b('0x123'),'required':![]},{'model':db[_0x7b1b('0xdb')],'as':_0x7b1b('0x124'),'required':![]}];}return db[_0x7b1b('0xd1')]['findAll'](_0x5dd77a);})['then'](function(_0x576f3a){_0x147e0d[_0x7b1b('0x4a')]=_0x576f3a;return _0x147e0d;});}})[_0x7b1b('0x12')](respondWithFilteredResult(_0x1fe641,_0x5dd77a))[_0x7b1b('0x1d')](handleError(_0x1fe641,null));};exports[_0x7b1b('0x125')]=function(_0x543078,_0x2cb0fd){return db[_0x7b1b('0x32')]['find']({'where':{'id':_0x543078['params']['id']}})[_0x7b1b('0x12')](handleEntityNotFound(_0x2cb0fd,null))[_0x7b1b('0x12')](function(_0x3f8792){if(_0x3f8792){return _0x3f8792[_0x7b1b('0x125')](_0x543078['body'][_0x7b1b('0x5f')],_['omit'](_0x543078[_0x7b1b('0x57')],[_0x7b1b('0x5f'),'id'])||{})[_0x7b1b('0xb7')](function(_0x1fbe20){for(var _0x53f66d=0x0;_0x53f66d<_0x543078[_0x7b1b('0x57')]['ids'][_0x7b1b('0x3e')];_0x53f66d+=0x1){socket[_0x7b1b('0x126')](_0x7b1b('0x127'),{'UserId':Number(_0x543078[_0x7b1b('0x57')]['ids'][_0x53f66d]),'ChatWebsiteId':Number(_0x543078[_0x7b1b('0x4b')]['id'])});}return _0x1fbe20;});}})[_0x7b1b('0x12')](respondWithResult(_0x2cb0fd,null))[_0x7b1b('0x1d')](handleError(_0x2cb0fd,null));};exports[_0x7b1b('0x128')]=function(_0x56c4ec,_0x41bef6){return db[_0x7b1b('0x32')][_0x7b1b('0x4d')]({'where':{'id':_0x56c4ec[_0x7b1b('0x4b')]['id']}})[_0x7b1b('0x12')](handleEntityNotFound(_0x41bef6,null))[_0x7b1b('0x12')](function(_0x4d716c){if(_0x4d716c){return _0x4d716c[_0x7b1b('0x128')](_0x56c4ec[_0x7b1b('0x37')][_0x7b1b('0x5f')])[_0x7b1b('0x12')](function(){if(_[_0x7b1b('0x129')](_0x56c4ec[_0x7b1b('0x37')]['ids'])){for(var _0x4131cc=0x0;_0x4131cc<_0x56c4ec[_0x7b1b('0x37')][_0x7b1b('0x5f')]['length'];_0x4131cc+=0x1){socket[_0x7b1b('0x126')](_0x7b1b('0x12a'),{'UserId':Number(_0x56c4ec['query'][_0x7b1b('0x5f')][_0x4131cc]),'ChatWebsiteId':Number(_0x56c4ec['params']['id'])});}}else{socket[_0x7b1b('0x126')](_0x7b1b('0x12a'),{'UserId':Number(_0x56c4ec['query']['ids']),'ChatWebsiteId':Number(_0x56c4ec['params']['id'])});}});}})[_0x7b1b('0x12')](respondWithStatusCode(_0x41bef6,null))[_0x7b1b('0x1d')](handleError(_0x41bef6,null));};exports[_0x7b1b('0x12b')]=function(_0x19d2b2,_0xcd7cd9){var _0x40efe3={};var _0x4bf403={};var _0x58b664;var _0x4b8dfc;return db['ChatWebsite'][_0x7b1b('0x5a')]({'where':{'id':_0x19d2b2[_0x7b1b('0x4b')]['id']}})['then'](handleEntityNotFound(_0xcd7cd9,null))[_0x7b1b('0x12')](function(_0x5b3bdb){if(_0x5b3bdb){_0x58b664=_0x5b3bdb;_0x4bf403[_0x7b1b('0x3a')]=_['keys'](db[_0x7b1b('0xf0')]['rawAttributes']);_0x4bf403['query']=_[_0x7b1b('0x38')](_0x19d2b2[_0x7b1b('0x37')]);_0x4bf403['filters']=_[_0x7b1b('0x3b')](_0x4bf403[_0x7b1b('0x3a')],_0x4bf403['query']);_0x40efe3[_0x7b1b('0x3d')]=_[_0x7b1b('0x3b')](_0x4bf403[_0x7b1b('0x3a')],qs[_0x7b1b('0x3c')](_0x19d2b2[_0x7b1b('0x37')][_0x7b1b('0x3c')]));_0x40efe3['attributes']=_0x40efe3[_0x7b1b('0x3d')]['length']?_0x40efe3[_0x7b1b('0x3d')]:_0x4bf403['model'];_0x40efe3[_0x7b1b('0x40')]=qs[_0x7b1b('0x41')](_0x19d2b2[_0x7b1b('0x37')][_0x7b1b('0x41')]);_0x40efe3['where']=qs[_0x7b1b('0x39')](_[_0x7b1b('0x43')](_0x19d2b2[_0x7b1b('0x37')],_0x4bf403[_0x7b1b('0x39')]));if(_0x19d2b2[_0x7b1b('0x37')][_0x7b1b('0x44')]){_0x40efe3[_0x7b1b('0x42')]=_['merge'](_0x40efe3[_0x7b1b('0x42')],{'$or':_[_0x7b1b('0x31')](_0x40efe3[_0x7b1b('0x3d')],function(_0x5c3f96){var _0x4ac66d={};_0x4ac66d[_0x5c3f96]={'$like':'%'+_0x19d2b2[_0x7b1b('0x37')][_0x7b1b('0x44')]+'%'};return _0x4ac66d;})});}_0x40efe3=_['merge']({},_0x40efe3,_0x19d2b2[_0x7b1b('0x4c')]);return _0x58b664['getAgents'](_0x40efe3);}})[_0x7b1b('0x12')](function(_0x3e1ce2){if(_0x3e1ce2){_0x4b8dfc=_0x3e1ce2[_0x7b1b('0x3e')];if(!_0x19d2b2[_0x7b1b('0x37')][_0x7b1b('0x3f')](_0x7b1b('0x5c'))){_0x40efe3['limit']=qs['limit'](_0x19d2b2[_0x7b1b('0x37')][_0x7b1b('0x23')]);_0x40efe3[_0x7b1b('0x22')]=qs['offset'](_0x19d2b2[_0x7b1b('0x37')][_0x7b1b('0x22')]);}return _0x58b664[_0x7b1b('0x12b')](_0x40efe3);}})[_0x7b1b('0x12')](function(_0x346c85){if(_0x346c85){return _0x346c85?{'count':_0x4b8dfc,'rows':_0x346c85}:null;}})[_0x7b1b('0x12')](respondWithResult(_0xcd7cd9,null))[_0x7b1b('0x1d')](handleError(_0xcd7cd9,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 8bd88f2..69c0377 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 _0x5ed2=['update','remove','emit','hasOwnProperty','hook','exports','events','ChatWebsite','setMaxListeners'];(function(_0x42abaa,_0x283a90){var _0x1e44fe=function(_0x1e52ed){while(--_0x1e52ed){_0x42abaa['push'](_0x42abaa['shift']());}};_0x1e44fe(++_0x283a90);}(_0x5ed2,0x114));var _0x25ed=function(_0x25831a,_0x3027d1){_0x25831a=_0x25831a-0x0;var _0x141686=_0x5ed2[_0x25831a];return _0x141686;};'use strict';var EventEmitter=require(_0x25ed('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x25ed('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x25ed('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x25ed('0x3'),'afterDestroy':_0x25ed('0x4')};function emitEvent(_0x591e52){return function(_0x1ce8d8,_0x2e6fb6,_0xbebea9){ChatWebsiteEvents[_0x25ed('0x5')](_0x591e52+':'+_0x1ce8d8['id'],_0x1ce8d8);ChatWebsiteEvents['emit'](_0x591e52,_0x1ce8d8);_0xbebea9(null);};}for(var e in events){if(events[_0x25ed('0x6')](e)){var event=events[e];ChatWebsite[_0x25ed('0x7')](e,emitEvent(event));}}module[_0x25ed('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x6379=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatWebsite'];(function(_0x36c7d6,_0x4684e5){var _0xa95375=function(_0x441d96){while(--_0x441d96){_0x36c7d6['push'](_0x36c7d6['shift']());}};_0xa95375(++_0x4684e5);}(_0x6379,0x84));var _0x9637=function(_0x57d671,_0x1a101c){_0x57d671=_0x57d671-0x0;var _0x450dfe=_0x6379[_0x57d671];return _0x450dfe;};'use strict';var EventEmitter=require(_0x9637('0x0'));var ChatWebsite=require(_0x9637('0x1'))['db'][_0x9637('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x9637('0x3')](0x0);var events={'afterCreate':_0x9637('0x4'),'afterUpdate':'update','afterDestroy':_0x9637('0x5')};function emitEvent(_0x3e678f){return function(_0x5f1058,_0x5f50c5,_0x1f7805){ChatWebsiteEvents[_0x9637('0x6')](_0x3e678f+':'+_0x5f1058['id'],_0x5f1058);ChatWebsiteEvents[_0x9637('0x6')](_0x3e678f,_0x5f1058);_0x1f7805(null);};}for(var e in events){if(events[_0x9637('0x7')](e)){var event=events[e];ChatWebsite[_0x9637('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 53a1327..632cb86 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 _0xca40=['../../config/environment','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x24f0ab,_0x2cc3db){var _0x4dc05e=function(_0x12d1c2){while(--_0x12d1c2){_0x24f0ab['push'](_0x24f0ab['shift']());}};_0x4dc05e(++_0x2cc3db);}(_0xca40,0x13c));var _0x0ca4=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0xca40[_0x68ee8b];return _0x5148f7;};'use strict';var _=require(_0x0ca4('0x0'));var util=require(_0x0ca4('0x1'));var logger=require(_0x0ca4('0x2'))(_0x0ca4('0x3'));var moment=require(_0x0ca4('0x4'));var BPromise=require(_0x0ca4('0x5'));var rp=require(_0x0ca4('0x6'));var fs=require('fs');var path=require(_0x0ca4('0x7'));var rimraf=require(_0x0ca4('0x8'));var config=require(_0x0ca4('0x9'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x4125e7,_0x2bb9e0){return _0x4125e7[_0x0ca4('0xa')](_0x0ca4('0xb'),attributes,{'tableName':_0x0ca4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6152=['exports','define','ChatWebsite','chat_websites','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6152,0x10c));var _0x2615=function(_0x357923,_0xc46c8b){_0x357923=_0x357923-0x0;var _0x49f0c8=_0x6152[_0x357923];return _0x49f0c8;};'use strict';var _=require(_0x2615('0x0'));var util=require(_0x2615('0x1'));var logger=require('../../config/logger')(_0x2615('0x2'));var moment=require(_0x2615('0x3'));var BPromise=require(_0x2615('0x4'));var rp=require(_0x2615('0x5'));var fs=require('fs');var path=require(_0x2615('0x6'));var rimraf=require('rimraf');var config=require(_0x2615('0x7'));var attributes=require('./chatWebsite.attributes');module[_0x2615('0x8')]=function(_0x2ec426,_0x5c0460){return _0x2ec426[_0x2615('0x9')](_0x2615('0xa'),attributes,{'tableName':_0x2615('0xb'),'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 90b44c5..07ae1f6 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 _0x66e9=['info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x66e9,0xc7));var _0x966e=function(_0x119705,_0xba9427){_0x119705=_0x119705-0x0;var _0x2affc2=_0x66e9[_0x119705];return _0x2affc2;};'use strict';var _=require(_0x966e('0x0'));var util=require(_0x966e('0x1'));var moment=require(_0x966e('0x2'));var BPromise=require('bluebird');var rs=require(_0x966e('0x3'));var fs=require('fs');var Redis=require(_0x966e('0x4'));var db=require(_0x966e('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x966e('0x6'));var config=require(_0x966e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x966e('0x8')]['http']({'port':0x232a});config['redis']=_[_0x966e('0x9')](config[_0x966e('0xa')],{'host':_0x966e('0xb'),'port':0x18eb});var socket=require(_0x966e('0xc'))(new Redis(config[_0x966e('0xa')]));require(_0x966e('0xd'))[_0x966e('0xe')](socket);function respondWithRpcPromise(_0x146db2,_0x472970,_0x3b0f0f){return new BPromise(function(_0x440113,_0x417d66){return client[_0x966e('0xf')](_0x146db2,_0x3b0f0f)[_0x966e('0x10')](function(_0x967825){logger['info'](_0x966e('0x11'),_0x472970,'request\x20sent');logger[_0x966e('0x12')](_0x966e('0x13'),_0x472970,_0x966e('0x14'),JSON[_0x966e('0x15')](_0x967825));if(_0x967825['error']){if(_0x967825[_0x966e('0x16')][_0x966e('0x17')]===0x1f4){logger[_0x966e('0x16')](_0x966e('0x11'),_0x472970,_0x967825[_0x966e('0x16')][_0x966e('0x18')]);return _0x417d66(_0x967825[_0x966e('0x16')][_0x966e('0x18')]);}logger[_0x966e('0x16')](_0x966e('0x11'),_0x472970,_0x967825[_0x966e('0x16')][_0x966e('0x18')]);return _0x440113(_0x967825[_0x966e('0x16')][_0x966e('0x18')]);}else{logger[_0x966e('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x472970,'request\x20sent');_0x440113(_0x967825[_0x966e('0x1a')][_0x966e('0x18')]);}})[_0x966e('0x1b')](function(_0x250def){logger[_0x966e('0x16')](_0x966e('0x11'),_0x472970,_0x250def);_0x417d66(_0x250def);});});}
\ No newline at end of file
+var _0xe082=['code','message','result','catch','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x333d1d,_0x19f053){var _0x2debd4=function(_0x20b7ec){while(--_0x20b7ec){_0x333d1d['push'](_0x333d1d['shift']());}};_0x2debd4(++_0x19f053);}(_0xe082,0xc1));var _0x2e08=function(_0x43a37c,_0x25a567){_0x43a37c=_0x43a37c-0x0;var _0x5d1d40=_0xe082[_0x43a37c];return _0x5d1d40;};'use strict';var _=require(_0x2e08('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2e08('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2e08('0x2'))['db'];var utils=require(_0x2e08('0x3'));var logger=require(_0x2e08('0x4'))(_0x2e08('0x5'));var config=require(_0x2e08('0x6'));var jayson=require(_0x2e08('0x7'));var client=jayson['client'][_0x2e08('0x8')]({'port':0x232a});config[_0x2e08('0x9')]=_[_0x2e08('0xa')](config[_0x2e08('0x9')],{'host':_0x2e08('0xb'),'port':0x18eb});var socket=require(_0x2e08('0xc'))(new Redis(config[_0x2e08('0x9')]));require(_0x2e08('0xd'))[_0x2e08('0xe')](socket);function respondWithRpcPromise(_0x271265,_0x36c501,_0x3e7211){return new BPromise(function(_0x6b1a6b,_0x14d7ab){return client['request'](_0x271265,_0x3e7211)[_0x2e08('0xf')](function(_0x3f3435){logger[_0x2e08('0x10')](_0x2e08('0x11'),_0x36c501,_0x2e08('0x12'));logger[_0x2e08('0x13')](_0x2e08('0x14'),_0x36c501,'request\x20sent',JSON[_0x2e08('0x15')](_0x3f3435));if(_0x3f3435[_0x2e08('0x16')]){if(_0x3f3435[_0x2e08('0x16')][_0x2e08('0x17')]===0x1f4){logger[_0x2e08('0x16')](_0x2e08('0x11'),_0x36c501,_0x3f3435[_0x2e08('0x16')][_0x2e08('0x18')]);return _0x14d7ab(_0x3f3435['error']['message']);}logger['error'](_0x2e08('0x11'),_0x36c501,_0x3f3435[_0x2e08('0x16')][_0x2e08('0x18')]);return _0x6b1a6b(_0x3f3435[_0x2e08('0x16')][_0x2e08('0x18')]);}else{logger[_0x2e08('0x10')](_0x2e08('0x11'),_0x36c501,_0x2e08('0x12'));_0x6b1a6b(_0x3f3435[_0x2e08('0x19')][_0x2e08('0x18')]);}})[_0x2e08('0x1a')](function(_0x51d576){logger[_0x2e08('0x16')](_0x2e08('0x11'),_0x36c501,_0x51d576);_0x14d7ab(_0x51d576);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index df9aa74..75c1793 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 _0xdd0c=['removeListener','register','chatWebsite:','./chatWebsite.events','save'];(function(_0x374888,_0x4fe130){var _0x39fc0a=function(_0x1ddf3b){while(--_0x1ddf3b){_0x374888['push'](_0x374888['shift']());}};_0x39fc0a(++_0x4fe130);}(_0xdd0c,0x1a7));var _0xcdd0=function(_0x24e1a0,_0x5c4ce9){_0x24e1a0=_0x24e1a0-0x0;var _0x1b270f=_0xdd0c[_0x24e1a0];return _0x1b270f;};'use strict';var ChatWebsiteEvents=require(_0xcdd0('0x0'));var events=[_0xcdd0('0x1'),'remove','update'];function createListener(_0x35dc9d,_0x25803f){return function(_0x183f84){_0x25803f['emit'](_0x35dc9d,_0x183f84);};}function removeListener(_0x4533f3,_0x23460d){return function(){ChatWebsiteEvents[_0xcdd0('0x2')](_0x4533f3,_0x23460d);};}exports[_0xcdd0('0x3')]=function(_0x242ccf){for(var _0x22f060=0x0,_0x1fd31c=events['length'];_0x22f060<_0x1fd31c;_0x22f060++){var _0x39ace0=events[_0x22f060];var _0xf3476=createListener(_0xcdd0('0x4')+_0x39ace0,_0x242ccf);ChatWebsiteEvents['on'](_0x39ace0,_0xf3476);}};
\ No newline at end of file
+var _0x6b0d=['emit','removeListener','register','length','chatWebsite:','remove'];(function(_0x42b5aa,_0x43df72){var _0x4a7c5c=function(_0x2291a0){while(--_0x2291a0){_0x42b5aa['push'](_0x42b5aa['shift']());}};_0x4a7c5c(++_0x43df72);}(_0x6b0d,0x1bb));var _0xd6b0=function(_0x1626ab,_0x50c634){_0x1626ab=_0x1626ab-0x0;var _0x33b82d=_0x6b0d[_0x1626ab];return _0x33b82d;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=['save',_0xd6b0('0x0'),'update'];function createListener(_0x519dce,_0x20b3eb){return function(_0x32bdb2){_0x20b3eb[_0xd6b0('0x1')](_0x519dce,_0x32bdb2);};}function removeListener(_0x5040b2,_0x2f33bb){return function(){ChatWebsiteEvents[_0xd6b0('0x2')](_0x5040b2,_0x2f33bb);};}exports[_0xd6b0('0x3')]=function(_0x5378b4){for(var _0x44693b=0x0,_0x4a6301=events[_0xd6b0('0x4')];_0x44693b<_0x4a6301;_0x44693b++){var _0x448f2a=events[_0x44693b];var _0x1eccfd=createListener(_0xd6b0('0x5')+_0x448f2a,_0x5378b4);ChatWebsiteEvents['on'](_0x448f2a,_0x1eccfd);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index d77cdcc..8e723bf 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 _0x450d=['/:id/system_avatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','/:id/dispositions','addDisposition','addAnswer','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','join','diskStorage','server/files/images/avatars/','addCustomerAvatar','/:id/notify','notify','server/files','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','addAgents','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','describe','show','getDispositions','/:id/canned_answers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar'];(function(_0x36f5cb,_0x2a720f){var _0x58d6ce=function(_0x1adfb5){while(--_0x1adfb5){_0x36f5cb['push'](_0x36f5cb['shift']());}};_0x58d6ce(++_0x2a720f);}(_0x450d,0x113));var _0xd450=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x450d[_0x173441];return _0x2423a8;};'use strict';var multer=require(_0xd450('0x0'));var util=require(_0xd450('0x1'));var path=require(_0xd450('0x2'));var timeout=require(_0xd450('0x3'));var express=require('express');var router=express[_0xd450('0x4')]();var fs_extra=require(_0xd450('0x5'));var auth=require(_0xd450('0x6'));var interaction=require(_0xd450('0x7'));var config=require(_0xd450('0x8'));var controller=require(_0xd450('0x9'));router[_0xd450('0xa')]('/',auth[_0xd450('0xb')](),controller['index']);router[_0xd450('0xa')]('/describe',auth[_0xd450('0xb')](),controller[_0xd450('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xd450('0xd')]);router['get']('/:id/dispositions',auth[_0xd450('0xb')](),controller[_0xd450('0xe')]);router[_0xd450('0xa')](_0xd450('0xf'),auth[_0xd450('0xb')](),controller['getAnswers']);router[_0xd450('0xa')](_0xd450('0x10'),controller['getLogo']);router['get'](_0xd450('0x11'),controller[_0xd450('0x12')]);router[_0xd450('0xa')](_0xd450('0x13'),controller[_0xd450('0x14')]);router['get'](_0xd450('0x15'),controller['getSystemAvatar']);router['get'](_0xd450('0x16'),auth[_0xd450('0xb')](),controller['getInteractions']);router[_0xd450('0xa')](_0xd450('0x17'),controller[_0xd450('0x18')]);router['get'](_0xd450('0x19'),auth[_0xd450('0xb')](),controller[_0xd450('0x1a')]);router[_0xd450('0xa')]('/:id/proactive_actions',auth[_0xd450('0xb')](),controller[_0xd450('0x1b')]);router['get'](_0xd450('0x1c'),controller[_0xd450('0x1d')]);router[_0xd450('0xa')]('/:id/offline_messages',auth['isAuthenticated'](),controller[_0xd450('0x1e')]);router[_0xd450('0xa')](_0xd450('0x1f'),auth['isAuthenticated'](),controller[_0xd450('0x20')]);router[_0xd450('0x21')]('/',auth[_0xd450('0xb')](),controller['create']);router['post'](_0xd450('0x22'),auth[_0xd450('0xb')](),controller[_0xd450('0x23')]);router['post'](_0xd450('0xf'),auth[_0xd450('0xb')](),controller[_0xd450('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5382fd,_0x255719,_0x1c32c4){_0x1c32c4(null,path['join'](config[_0xd450('0x25')],_0xd450('0x26')));},'filename':function(_0x4e9017,_0x3bc053,_0x5a0f92){_0x5a0f92(null,util[_0xd450('0x27')](_0xd450('0x28'),Date[_0xd450('0x29')](),_0x3bc053[_0xd450('0x2a')]));}})});router['post'](_0xd450('0x10'),upload[_0xd450('0x2b')](_0xd450('0x2c')),controller[_0xd450('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x21922c,_0x5d1128,_0x1f7261){_0x1f7261(null,path[_0xd450('0x2e')](config[_0xd450('0x25')],'server/files/images/avatars/'));},'filename':function(_0x2ff51f,_0x41d9be,_0x184c68){_0x184c68(null,util['format']('%s-%s',Date['now'](),_0x41d9be[_0xd450('0x2a')]));}})});router[_0xd450('0x21')](_0xd450('0x11'),upload[_0xd450('0x2b')](_0xd450('0x2c')),controller['addAvatar']);var upload=multer({'storage':multer[_0xd450('0x2f')]({'destination':function(_0x5c588a,_0x1c1e84,_0x407a96){_0x407a96(null,path[_0xd450('0x2e')](config[_0xd450('0x25')],_0xd450('0x30')));},'filename':function(_0x31296b,_0x122bd3,_0x160d8f){_0x160d8f(null,util[_0xd450('0x27')](_0xd450('0x28'),Date[_0xd450('0x29')](),_0x122bd3[_0xd450('0x2a')]));}})});router[_0xd450('0x21')](_0xd450('0x13'),upload[_0xd450('0x2b')]('file'),controller[_0xd450('0x31')]);var upload=multer({'storage':multer[_0xd450('0x2f')]({'destination':function(_0x46b79c,_0x487fb8,_0x45cbb8){_0x45cbb8(null,path['join'](config[_0xd450('0x25')],'server/files/images/avatars/'));},'filename':function(_0x6cfc76,_0x3c9e9e,_0x3820d8){_0x3820d8(null,util[_0xd450('0x27')]('%s-%s',Date[_0xd450('0x29')](),_0x3c9e9e[_0xd450('0x2a')]));}})});router[_0xd450('0x21')](_0xd450('0x15'),upload[_0xd450('0x2b')](_0xd450('0x2c')),controller['addSystemAvatar']);router['post'](_0xd450('0x32'),controller[_0xd450('0x33')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x42f439,_0x2cb906,_0x139b1c){const _0x443c34=path['join'](config[_0xd450('0x25')],_0xd450('0x34'),'attachments',_0xd450('0x35'));fs_extra[_0xd450('0x36')](_0x443c34,function(){_0x139b1c(null,_0x443c34);});},'filename':function(_0x54dd28,_0x4ae78a,_0x20c499){const _0x29f088=_0x4ae78a[_0xd450('0x2a')][_0xd450('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x25c441=path[_0xd450('0x38')](_0x29f088);const _0x5ac0d2=Date['now']()+'-'+_0x29f088[_0xd450('0x37')](_0x25c441,'')+_0x25c441;_0x20c499(null,_0x5ac0d2);}})});router[_0xd450('0x21')](_0xd450('0x39'),offlineUploadMulter[_0xd450('0x3a')](),controller[_0xd450('0x3b')]);router[_0xd450('0x21')](_0xd450('0x16'),auth[_0xd450('0xb')](),controller[_0xd450('0x3c')]);router['post'](_0xd450('0x19'),auth[_0xd450('0xb')](),controller[_0xd450('0x3d')]);router['post'](_0xd450('0x3e'),auth[_0xd450('0xb')](),controller[_0xd450('0x3f')]);router[_0xd450('0x21')](_0xd450('0x1f'),auth[_0xd450('0xb')](),controller[_0xd450('0x40')]);router[_0xd450('0x41')](_0xd450('0x42'),auth[_0xd450('0xb')](),controller[_0xd450('0x43')]);router[_0xd450('0x44')](_0xd450('0x42'),auth[_0xd450('0xb')](),controller[_0xd450('0x45')]);router[_0xd450('0x44')](_0xd450('0x22'),auth['isAuthenticated'](),controller[_0xd450('0x46')]);router[_0xd450('0x44')](_0xd450('0xf'),auth[_0xd450('0xb')](),controller[_0xd450('0x47')]);router[_0xd450('0x44')](_0xd450('0x1f'),auth[_0xd450('0xb')](),controller[_0xd450('0x48')]);module[_0xd450('0x49')]=router;
\ No newline at end of file
+var _0x4bd1=['/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getAgents','create','addAnswer','diskStorage','join','root','%s-%s','now','originalname','post','single','file','server/files/images/avatars/','format','addAvatar','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','/:id/applications','addProactiveActions','/:id/users','addAgents','put','/:id','update','delete','removeAnswers','removeAgents','exports','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0x4bd1,0x7b));var _0x14bd=function(_0x118afa,_0x4bf0c1){_0x118afa=_0x118afa-0x0;var _0x167d76=_0x4bd1[_0x118afa];return _0x167d76;};'use strict';var multer=require(_0x14bd('0x0'));var util=require(_0x14bd('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x14bd('0x2'));var auth=require(_0x14bd('0x3'));var interaction=require(_0x14bd('0x4'));var config=require(_0x14bd('0x5'));var controller=require(_0x14bd('0x6'));router[_0x14bd('0x7')]('/',auth[_0x14bd('0x8')](),controller['index']);router[_0x14bd('0x7')](_0x14bd('0x9'),auth[_0x14bd('0x8')](),controller['describe']);router['get']('/:id',auth[_0x14bd('0x8')](),controller[_0x14bd('0xa')]);router[_0x14bd('0x7')](_0x14bd('0xb'),auth['isAuthenticated'](),controller[_0x14bd('0xc')]);router['get'](_0x14bd('0xd'),auth[_0x14bd('0x8')](),controller[_0x14bd('0xe')]);router['get'](_0x14bd('0xf'),controller[_0x14bd('0x10')]);router[_0x14bd('0x7')](_0x14bd('0x11'),controller[_0x14bd('0x12')]);router[_0x14bd('0x7')]('/:id/customer_avatar',controller[_0x14bd('0x13')]);router[_0x14bd('0x7')](_0x14bd('0x14'),controller['getSystemAvatar']);router[_0x14bd('0x7')](_0x14bd('0x15'),auth[_0x14bd('0x8')](),controller[_0x14bd('0x16')]);router[_0x14bd('0x7')](_0x14bd('0x17'),controller[_0x14bd('0x18')]);router[_0x14bd('0x7')]('/:id/applications',auth['isAuthenticated'](),controller[_0x14bd('0x19')]);router[_0x14bd('0x7')](_0x14bd('0x1a'),auth[_0x14bd('0x8')](),controller[_0x14bd('0x1b')]);router[_0x14bd('0x7')](_0x14bd('0x1c'),controller[_0x14bd('0x1d')]);router[_0x14bd('0x7')]('/:id/offline_messages',auth['isAuthenticated'](),controller['getOfflineMessages']);router[_0x14bd('0x7')]('/:id/users',auth['isAuthenticated'](),controller[_0x14bd('0x1e')]);router['post']('/',auth[_0x14bd('0x8')](),controller[_0x14bd('0x1f')]);router['post'](_0x14bd('0xb'),auth[_0x14bd('0x8')](),controller['addDisposition']);router['post'](_0x14bd('0xd'),auth[_0x14bd('0x8')](),controller[_0x14bd('0x20')]);var upload=multer({'storage':multer[_0x14bd('0x21')]({'destination':function(_0x36e002,_0x28ab0f,_0x15e255){_0x15e255(null,path[_0x14bd('0x22')](config[_0x14bd('0x23')],'server/files/images/logos/'));},'filename':function(_0x477a81,_0x197d19,_0x4ba84d){_0x4ba84d(null,util['format'](_0x14bd('0x24'),Date[_0x14bd('0x25')](),_0x197d19[_0x14bd('0x26')]));}})});router[_0x14bd('0x27')]('/:id/logo',upload[_0x14bd('0x28')](_0x14bd('0x29')),controller['addLogo']);var upload=multer({'storage':multer[_0x14bd('0x21')]({'destination':function(_0x5c7b35,_0xd6348,_0x312d76){_0x312d76(null,path['join'](config[_0x14bd('0x23')],_0x14bd('0x2a')));},'filename':function(_0x213f8a,_0x2e1f22,_0x196bf2){_0x196bf2(null,util[_0x14bd('0x2b')](_0x14bd('0x24'),Date['now'](),_0x2e1f22[_0x14bd('0x26')]));}})});router['post'](_0x14bd('0x11'),upload[_0x14bd('0x28')](_0x14bd('0x29')),controller[_0x14bd('0x2c')]);var upload=multer({'storage':multer[_0x14bd('0x21')]({'destination':function(_0x52b856,_0x159497,_0x3f8492){_0x3f8492(null,path['join'](config[_0x14bd('0x23')],'server/files/images/avatars/'));},'filename':function(_0x147ac8,_0x4e0bbb,_0xcf283f){_0xcf283f(null,util[_0x14bd('0x2b')](_0x14bd('0x24'),Date[_0x14bd('0x25')](),_0x4e0bbb[_0x14bd('0x26')]));}})});router[_0x14bd('0x27')](_0x14bd('0x2d'),upload[_0x14bd('0x28')](_0x14bd('0x29')),controller[_0x14bd('0x2e')]);var upload=multer({'storage':multer[_0x14bd('0x21')]({'destination':function(_0x10ba3f,_0x43fae4,_0x4771a6){_0x4771a6(null,path['join'](config[_0x14bd('0x23')],_0x14bd('0x2a')));},'filename':function(_0x52c64a,_0x2c8c0b,_0x5d71ea){_0x5d71ea(null,util['format'](_0x14bd('0x24'),Date[_0x14bd('0x25')](),_0x2c8c0b[_0x14bd('0x26')]));}})});router[_0x14bd('0x27')]('/:id/system_avatar',upload[_0x14bd('0x28')](_0x14bd('0x29')),controller[_0x14bd('0x2f')]);router[_0x14bd('0x27')](_0x14bd('0x30'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x14bd('0x21')]({'destination':function(_0x22c3d5,_0x1dce05,_0x513bf9){const _0x188243=path['join'](config[_0x14bd('0x23')],_0x14bd('0x31'),_0x14bd('0x32'),_0x14bd('0x33'));fs_extra[_0x14bd('0x34')](_0x188243,function(){_0x513bf9(null,_0x188243);});},'filename':function(_0x252e61,_0xd1361a,_0x17d92d){const _0x121563=_0xd1361a[_0x14bd('0x26')][_0x14bd('0x35')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1fca79=path[_0x14bd('0x36')](_0x121563);const _0x3d4b9a=Date[_0x14bd('0x25')]()+'-'+_0x121563[_0x14bd('0x35')](_0x1fca79,'')+_0x1fca79;_0x17d92d(null,_0x3d4b9a);}})});router[_0x14bd('0x27')](_0x14bd('0x37'),offlineUploadMulter[_0x14bd('0x38')](),controller[_0x14bd('0x39')]);router['post']('/:id/interactions',auth[_0x14bd('0x8')](),controller[_0x14bd('0x3a')]);router[_0x14bd('0x27')](_0x14bd('0x3b'),auth['isAuthenticated'](),controller['addApplications']);router[_0x14bd('0x27')](_0x14bd('0x1a'),auth[_0x14bd('0x8')](),controller[_0x14bd('0x3c')]);router[_0x14bd('0x27')](_0x14bd('0x3d'),auth['isAuthenticated'](),controller[_0x14bd('0x3e')]);router[_0x14bd('0x3f')](_0x14bd('0x40'),auth[_0x14bd('0x8')](),controller[_0x14bd('0x41')]);router['delete'](_0x14bd('0x40'),auth['isAuthenticated'](),controller['destroy']);router['delete']('/:id/dispositions',auth[_0x14bd('0x8')](),controller['removeDispositions']);router[_0x14bd('0x42')]('/:id/canned_answers',auth[_0x14bd('0x8')](),controller[_0x14bd('0x43')]);router[_0x14bd('0x42')](_0x14bd('0x3d'),auth[_0x14bd('0x8')](),controller[_0x14bd('0x44')]);module[_0x14bd('0x45')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 9ff1917..f0fd84d 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 _0x1b40=['get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','isAuthenticated','exports','express','../config/environment','Router','env','app'];(function(_0x479385,_0x26c872){var _0x2a307=function(_0x2a6a24){while(--_0x2a6a24){_0x479385['push'](_0x479385['shift']());}};_0x2a307(++_0x26c872);}(_0x1b40,0x67));var _0x01b4=function(_0x12d6de,_0xccc040){_0x12d6de=_0x12d6de-0x0;var _0x32923b=_0x1b40[_0x12d6de];return _0x32923b;};var beaverLogger=require('beaver-logger/server');var express=require(_0x01b4('0x0'));var auth=require('../components/auth/service');var config=require(_0x01b4('0x1'));var router=express[_0x01b4('0x2')]();var isProduction=config[_0x01b4('0x3')]==='production'||![];function clientSideLogs(_0x312a45,_0x36f7ed,_0x4ff973){var _0x1b35df=_0x312a45[_0x01b4('0x4')][_0x01b4('0x5')](_0x01b4('0x6'));if(!_0x1b35df){throw new Error(_0x01b4('0x7'));}return beaverLogger[_0x01b4('0x8')]({'uri':_0x01b4('0x9'),'logger':_0x1b35df,'enableCors':!isProduction})(_0x312a45,_0x36f7ed,_0x4ff973);}router['use'](auth[_0x01b4('0xa')](),clientSideLogs);module[_0x01b4('0xb')]=router;
\ No newline at end of file
+var _0xc176=['client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','exports','beaver-logger/server','../config/environment','Router','env','production','app','get'];(function(_0x514d04,_0xc0386b){var _0x4047d9=function(_0x1c6829){while(--_0x1c6829){_0x514d04['push'](_0x514d04['shift']());}};_0x4047d9(++_0xc0386b);}(_0xc176,0x10a));var _0x6c17=function(_0x26b622,_0x237e9e){_0x26b622=_0x26b622-0x0;var _0x58a028=_0xc176[_0x26b622];return _0x58a028;};var beaverLogger=require(_0x6c17('0x0'));var express=require('express');var auth=require('../components/auth/service');var config=require(_0x6c17('0x1'));var router=express[_0x6c17('0x2')]();var isProduction=config[_0x6c17('0x3')]===_0x6c17('0x4')||![];function clientSideLogs(_0x496d20,_0x114432,_0x13dae5){var _0x520bde=_0x496d20[_0x6c17('0x5')][_0x6c17('0x6')](_0x6c17('0x7'));if(!_0x520bde){throw new Error(_0x6c17('0x8'));}return beaverLogger[_0x6c17('0x9')]({'uri':_0x6c17('0xa'),'logger':_0x520bde,'enableCors':!isProduction})(_0x496d20,_0x114432,_0x13dae5);}router[_0x6c17('0xb')](auth['isAuthenticated'](),clientSideLogs);module[_0x6c17('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 443622d..c7489e5 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 _0x9c83=['MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','STRING','ENUM','AmazonAWS','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri'];(function(_0x57d773,_0xf4b81b){var _0x57e209=function(_0xd96560){while(--_0xd96560){_0x57d773['push'](_0x57d773['shift']());}};_0x57e209(++_0xf4b81b);}(_0x9c83,0x1d2));var _0x39c8=function(_0x3ca991,_0x53a5bd){_0x3ca991=_0x3ca991-0x0;var _0x271da1=_0x9c83[_0x3ca991];return _0x271da1;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x39c8('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x39c8('0x1')](_0x39c8('0x2'),'Google',_0x39c8('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x39c8('0x4'),_0x39c8('0x5'))},'data1':{'type':Sequelize[_0x39c8('0x0')],'comment':_0x39c8('0x6')},'data2':{'type':Sequelize[_0x39c8('0x0')],'comment':_0x39c8('0x7')},'data3':{'type':Sequelize[_0x39c8('0x0')],'comment':_0x39c8('0x8')},'data4':{'type':Sequelize[_0x39c8('0x0')],'comment':_0x39c8('0x9')},'data5':{'type':Sequelize['TEXT'],'comment':_0x39c8('0xa')},'data6':{'type':Sequelize[_0x39c8('0xb')],'comment':_0x39c8('0xc')},'data7':{'type':Sequelize['TEXT'],'comment':_0x39c8('0xd')}};
\ No newline at end of file
+var _0x84b7=['AmazonAWS','Google','MicrosoftAzure','ENUM','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','STRING'];(function(_0x160951,_0x4508b3){var _0x4e30a2=function(_0x143629){while(--_0x143629){_0x160951['push'](_0x160951['shift']());}};_0x4e30a2(++_0x4508b3);}(_0x84b7,0x1c6));var _0x784b=function(_0x5bb4e8,_0x44b756){_0x5bb4e8=_0x5bb4e8-0x0;var _0x2a86f2=_0x84b7[_0x5bb4e8];return _0x2a86f2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x784b('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x784b('0x1'),_0x784b('0x2'),_0x784b('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x784b('0x4')](_0x784b('0x5'),_0x784b('0x6'))},'data1':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x784b('0x0')],'comment':_0x784b('0x7')},'data3':{'type':Sequelize['STRING'],'comment':_0x784b('0x8')},'data4':{'type':Sequelize[_0x784b('0x0')],'comment':_0x784b('0x9')},'data5':{'type':Sequelize[_0x784b('0xa')],'comment':_0x784b('0xb')},'data6':{'type':Sequelize[_0x784b('0xa')],'comment':_0x784b('0xc')},'data7':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index d37d2b3..2e0fa2d 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 _0x450c=['localhost','socket.io-emitter','sendStatus','status','end','json','offset','limit','undefined','count','set','update','then','destroy','error','stack','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','options','find','create','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','parse','from','state','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','del','getOauth2MicrosoftAccessToken','access_token','refresh_token','data5','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../mysqldb','./cloudProvider.oauth','redis'];(function(_0x2db3e3,_0x198d5c){var _0x3acd90=function(_0x5c6cf6){while(--_0x5c6cf6){_0x2db3e3['push'](_0x2db3e3['shift']());}};_0x3acd90(++_0x198d5c);}(_0x450c,0x125));var _0xc450=function(_0x531222,_0x95c7a2){_0x531222=_0x531222-0x0;var _0x3486bb=_0x450c[_0x531222];return _0x3486bb;};'use strict';var _=require('lodash');var Redis=require(_0xc450('0x0'));var qs=require(_0xc450('0x1'));var encryptor=require(_0xc450('0x2'));var config=require(_0xc450('0x3'));var logger=require('../../config/logger')('api');var db=require(_0xc450('0x4'))['db'];var oauth=require(_0xc450('0x5'));config['redis']=_['defaults'](config[_0xc450('0x6')],{'host':_0xc450('0x7'),'port':0x18eb});var socket=require(_0xc450('0x8'))(new Redis(config[_0xc450('0x6')]));var redis=new Redis(config[_0xc450('0x6')]);function respondWithStatusCode(_0x2bc709,_0x5e3ac3){_0x5e3ac3=_0x5e3ac3||0xcc;return function(_0x165f99){if(_0x165f99){return _0x2bc709[_0xc450('0x9')](_0x5e3ac3);}return _0x2bc709[_0xc450('0xa')](_0x5e3ac3)[_0xc450('0xb')]();};}function respondWithResult(_0x2f5b83,_0x47f606){_0x47f606=_0x47f606||0xc8;return function(_0x3b8e64){if(_0x3b8e64){return _0x2f5b83[_0xc450('0xa')](_0x47f606)[_0xc450('0xc')](_0x3b8e64);}};}function respondWithFilteredResult(_0x40619d,_0x348c89){return function(_0x46b080){if(_0x46b080){var _0x309d=typeof _0x348c89[_0xc450('0xd')]==='undefined'&&typeof _0x348c89[_0xc450('0xe')]===_0xc450('0xf');var _0x4f59d6=_0x46b080[_0xc450('0x10')];var _0x20627e=_0x309d?0x0:_0x348c89[_0xc450('0xd')];var _0xd2509c=_0x309d?_0x46b080[_0xc450('0x10')]:_0x348c89['offset']+_0x348c89[_0xc450('0xe')];var _0x5c30d1;if(_0xd2509c>=_0x4f59d6){_0xd2509c=_0x4f59d6;_0x5c30d1=0xc8;}else{_0x5c30d1=0xce;}_0x40619d['status'](_0x5c30d1);return _0x40619d[_0xc450('0x11')]('Content-Range',_0x20627e+'-'+_0xd2509c+'/'+_0x4f59d6)['json'](_0x46b080);}return null;};}function saveUpdates(_0x2e139b){return function(_0x4080a4){if(_0x4080a4){return _0x4080a4[_0xc450('0x12')](_0x2e139b)[_0xc450('0x13')](function(_0x491f71){return _0x491f71;});}return null;};}function removeEntity(_0x272bd2){return function(_0x5a25cc){if(_0x5a25cc){return _0x5a25cc[_0xc450('0x14')]()[_0xc450('0x13')](function(){_0x272bd2[_0xc450('0xa')](0xcc)[_0xc450('0xb')]();});}};}function handleEntityNotFound(_0x420544){return function(_0x4fa032){if(!_0x4fa032){_0x420544[_0xc450('0x9')](0x194);}return _0x4fa032;};}function handleError(_0x4061d4,_0x5c8f97){_0x5c8f97=_0x5c8f97||0x1f4;return function(_0x4aa7cd){logger[_0xc450('0x15')](_0x4aa7cd[_0xc450('0x16')]);if(_0x4aa7cd[_0xc450('0x17')]){delete _0x4aa7cd[_0xc450('0x17')];}_0x4061d4[_0xc450('0xa')](_0x5c8f97)[_0xc450('0x18')](_0x4aa7cd);};}function maskClientSecret(_0x175b29){return _[_0xc450('0x19')](_0x175b29[_0xc450('0x1a')](0x0,0x3),0x14,'*');}exports[_0xc450('0x1b')]=function(_0x3deab7,_0x9b4872){var _0x548a8a={},_0x316adc={},_0x20e425={'count':0x0,'rows':[]};var _0x926f85=_[_0xc450('0x1c')](db[_0xc450('0x1d')][_0xc450('0x1e')],function(_0x233a0c){return{'name':_0x233a0c[_0xc450('0x1f')],'type':_0x233a0c[_0xc450('0x20')][_0xc450('0x21')]};});_0x316adc[_0xc450('0x22')]=_[_0xc450('0x1c')](_0x926f85,'name');_0x316adc['query']=_[_0xc450('0x23')](_0x3deab7[_0xc450('0x24')]);_0x316adc['filters']=_['intersection'](_0x316adc[_0xc450('0x22')],_0x316adc[_0xc450('0x24')]);_0x548a8a[_0xc450('0x25')]=_[_0xc450('0x26')](_0x316adc[_0xc450('0x22')],qs[_0xc450('0x27')](_0x3deab7[_0xc450('0x24')][_0xc450('0x27')]));_0x548a8a[_0xc450('0x25')]=_0x548a8a[_0xc450('0x25')][_0xc450('0x28')]?_0x548a8a[_0xc450('0x25')]:_0x316adc[_0xc450('0x22')];if(!_0x3deab7['query'][_0xc450('0x29')](_0xc450('0x2a'))){_0x548a8a['limit']=qs['limit'](_0x3deab7[_0xc450('0x24')][_0xc450('0xe')]);_0x548a8a['offset']=qs['offset'](_0x3deab7['query'][_0xc450('0xd')]);}_0x548a8a[_0xc450('0x2b')]=qs['sort'](_0x3deab7[_0xc450('0x24')][_0xc450('0x2c')]);_0x548a8a[_0xc450('0x2d')]=qs[_0xc450('0x2e')](_[_0xc450('0x2f')](_0x3deab7[_0xc450('0x24')],_0x316adc['filters']),_0x926f85);if(_0x3deab7[_0xc450('0x24')][_0xc450('0x30')]){_0x548a8a[_0xc450('0x2d')]=_[_0xc450('0x31')](_0x548a8a[_0xc450('0x2d')],{'$or':_['map'](_0x926f85,function(_0x3838bc){if(_0x3838bc['type']!==_0xc450('0x32')){var _0x1d2073={};_0x1d2073[_0x3838bc[_0xc450('0x17')]]={'$like':'%'+_0x3deab7['query'][_0xc450('0x30')]+'%'};return _0x1d2073;}})});}_0x548a8a=_[_0xc450('0x31')]({},_0x548a8a,_0x3deab7['options']);var _0x2b8680={'where':_0x548a8a[_0xc450('0x2d')]};return db['CloudProvider'][_0xc450('0x10')](_0x2b8680)[_0xc450('0x13')](function(_0x3e2cac){_0x20e425[_0xc450('0x10')]=_0x3e2cac;if(_0x3deab7[_0xc450('0x24')][_0xc450('0x33')]){_0x548a8a[_0xc450('0x34')]=[{'all':!![]}];}return db['CloudProvider'][_0xc450('0x35')](_0x548a8a);})[_0xc450('0x13')](function(_0x3d2287){_0x20e425[_0xc450('0x36')]=_[_0xc450('0x1c')](_0x3d2287,function(_0x18d19f){if(_0x18d19f[_0xc450('0x37')]===_0xc450('0x38')){var _0x105f56=encryptor[_0xc450('0x39')](_0x18d19f[_0xc450('0x3a')]);_0x18d19f['data3']=maskClientSecret(_0x105f56);}return _0x18d19f;});return _0x20e425;})[_0xc450('0x13')](respondWithFilteredResult(_0x9b4872,_0x548a8a))[_0xc450('0x3b')](handleError(_0x9b4872,null));};exports[_0xc450('0x3c')]=function(_0x4c7e9e,_0x383407){var _0xa606b6={'raw':!![],'where':{'id':_0x4c7e9e[_0xc450('0x3d')]['id']}},_0x5462a5={};_0x5462a5['model']=_[_0xc450('0x23')](db[_0xc450('0x1d')][_0xc450('0x1e')]);_0x5462a5[_0xc450('0x24')]=_[_0xc450('0x23')](_0x4c7e9e[_0xc450('0x24')]);_0x5462a5[_0xc450('0x2e')]=_[_0xc450('0x26')](_0x5462a5[_0xc450('0x22')],_0x5462a5[_0xc450('0x24')]);_0xa606b6[_0xc450('0x25')]=_[_0xc450('0x26')](_0x5462a5[_0xc450('0x22')],qs['fields'](_0x4c7e9e['query'][_0xc450('0x27')]));_0xa606b6[_0xc450('0x25')]=_0xa606b6['attributes'][_0xc450('0x28')]?_0xa606b6[_0xc450('0x25')]:_0x5462a5[_0xc450('0x22')];if(_0x4c7e9e[_0xc450('0x24')][_0xc450('0x33')]){_0xa606b6[_0xc450('0x34')]=[{'all':!![]}];}_0xa606b6=_[_0xc450('0x31')]({},_0xa606b6,_0x4c7e9e[_0xc450('0x3e')]);return db[_0xc450('0x1d')][_0xc450('0x3f')](_0xa606b6)[_0xc450('0x13')](handleEntityNotFound(_0x383407,null))[_0xc450('0x13')](function(_0x1dbdf5){if(_0x1dbdf5[_0xc450('0x37')]===_0xc450('0x38')){var _0x4d6c6f=encryptor[_0xc450('0x39')](_0x1dbdf5[_0xc450('0x3a')]);_0x1dbdf5[_0xc450('0x3a')]=maskClientSecret(_0x4d6c6f);}return _0x1dbdf5;})[_0xc450('0x13')](respondWithResult(_0x383407,null))[_0xc450('0x3b')](handleError(_0x383407,null));};exports[_0xc450('0x40')]=function(_0x169a21,_0x4f9f3c){if(!_0x169a21[_0xc450('0x41')]['name'])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x169a21['body'][_0xc450('0x37')])throw new Error(_0xc450('0x42'));var _0x3f3258=db['CloudProvider'][_0xc450('0x1e')][_0xc450('0x37')][_0xc450('0x43')];if(!_0x3f3258[_0xc450('0x44')](_0x169a21['body']['service']))throw new Error(_0xc450('0x45')+_0x3f3258['join'](',\x20'));if(_0x169a21[_0xc450('0x41')][_0xc450('0x37')]===_0xc450('0x38')&&_0x169a21['body'][_0xc450('0x3a')]){_0x169a21[_0xc450('0x41')][_0xc450('0x3a')]=encryptor[_0xc450('0x46')](_0x169a21['body'][_0xc450('0x3a')]);}return db[_0xc450('0x1d')]['create'](_0x169a21['body'],{})[_0xc450('0x13')](respondWithResult(_0x4f9f3c,0xc9))[_0xc450('0x3b')](handleError(_0x4f9f3c,null));};exports['update']=function(_0x3a8ad8,_0xd387f6){if(_0x3a8ad8[_0xc450('0x41')]['id']){delete _0x3a8ad8[_0xc450('0x41')]['id'];}return db[_0xc450('0x1d')][_0xc450('0x3f')]({'where':{'id':_0x3a8ad8['params']['id']}})['then'](handleEntityNotFound(_0xd387f6,null))[_0xc450('0x13')](function(_0x3d48db){if(_0x3d48db[_0xc450('0x37')]==='MicrosoftAzure'&&_0x3a8ad8['body'][_0xc450('0x3a')]){_0x3a8ad8[_0xc450('0x41')][_0xc450('0x3a')]=encryptor[_0xc450('0x46')](_0x3a8ad8[_0xc450('0x41')][_0xc450('0x3a')]);}return _0x3d48db;})[_0xc450('0x13')](saveUpdates(_0x3a8ad8['body'],null))[_0xc450('0x13')](respondWithResult(_0xd387f6,null))[_0xc450('0x3b')](handleError(_0xd387f6,null));};exports[_0xc450('0x14')]=function(_0x28dbe5,_0x18ba56){return db['CloudProvider'][_0xc450('0x3f')]({'where':{'id':_0x28dbe5['params']['id']}})['then'](handleEntityNotFound(_0x18ba56,null))['then'](removeEntity(_0x18ba56,null))['catch'](handleError(_0x18ba56,null));};exports[_0xc450('0x47')]=function(_0x133c97,_0x4f7f8b){return db[_0xc450('0x1d')][_0xc450('0x48')]({'where':{'id':_0x133c97[_0xc450('0x3d')]['id']},'raw':!![]})[_0xc450('0x13')](function(_0x43ce70){if(!_0x43ce70)return _0x4f7f8b[_0xc450('0x9')](0x194);return{'url':oauth[_0xc450('0x49')](_0x43ce70,_0x133c97[_0xc450('0x4a')]['id'])};})[_0xc450('0x13')](respondWithResult(_0x4f7f8b,null))[_0xc450('0x3b')](handleError(_0x4f7f8b,null));};exports[_0xc450('0x4b')]=function(_0x266855,_0x34b470){var _0x307315=_0x266855[_0xc450('0x41')];var _0x29221d;var _0x3c7345;if(_0x307315[_0xc450('0x15')])throw _0x307315;redis[_0xc450('0x4c')](_0x307315['state'])[_0xc450('0x13')](function(_0x347092){if(!_0x347092)throw new Error('Invalid\x20state\x20parameter');_0x29221d=JSON[_0xc450('0x4d')](_0x347092);var _0x7da5d4=Buffer[_0xc450('0x4e')](_0x307315[_0xc450('0x4f')],_0xc450('0x50'))[_0xc450('0x51')](_0xc450('0x52'));_0x3c7345=JSON[_0xc450('0x4d')](_0x7da5d4);if(!oauth[_0xc450('0x53')](_0x307315[_0xc450('0x54')],_0x29221d[_0xc450('0x55')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xc450('0x56')](_0x307315['state']);return oauth[_0xc450('0x57')](_0x307315['code'],_0x29221d);})[_0xc450('0x13')](function(_0x380941){_0x29221d['data5']=_0x380941[_0xc450('0x58')];_0x29221d['data6']=_0x380941[_0xc450('0x59')];return db[_0xc450('0x1d')][_0xc450('0x12')]({'data5':_0x29221d[_0xc450('0x5a')],'data6':_0x29221d[_0xc450('0x5b')]},{'where':{'id':_0x29221d['id']}});})[_0xc450('0x13')](function(){oauth[_0xc450('0x5c')](_0x29221d);socket[_0xc450('0x5d')](_0xc450('0x5e'),{'id':_0x3c7345['id']});return;})[_0xc450('0x13')](respondWithStatusCode(_0x34b470,null))[_0xc450('0x3b')](function(_0x2df6dd){if(_0x3c7345){socket[_0xc450('0x5d')](_0xc450('0x5f'),{'id':_0x3c7345['id']});}if(!_0x29221d){logger[_0xc450('0x15')](_0xc450('0x60'),_0x2df6dd);return _0x34b470[_0xc450('0xa')](0x1f4)[_0xc450('0x18')](_0x2df6dd[_0xc450('0x61')]);}logger[_0xc450('0x15')](_0xc450('0x62'),_0x29221d['id'],JSON[_0xc450('0x63')](_0x2df6dd));});};
\ No newline at end of file
+var _0x3161=['lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','./cloudProvider.oauth','redis','defaults','socket.io-emitter','status','end','offset','undefined','limit','count','set','Content-Range','json','update','then','sendStatus','name','padEnd','slice','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','findAll','service','data3','catch','show','params','intersection','includeAll','MicrosoftAzure','body','Service\x20parameter\x20not\x20specified','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create','find','destroy','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','base64','toString','parse','isValidIdToken','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','microsoftAuthorization:success','emit','error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0x3161,0xb2));var _0x1316=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3161[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x1316('0x0'));var Redis=require(_0x1316('0x1'));var qs=require(_0x1316('0x2'));var encryptor=require(_0x1316('0x3'));var config=require(_0x1316('0x4'));var logger=require(_0x1316('0x5'))(_0x1316('0x6'));var db=require('../../mysqldb')['db'];var oauth=require(_0x1316('0x7'));config[_0x1316('0x8')]=_[_0x1316('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1316('0xa'))(new Redis(config[_0x1316('0x8')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x4f93b0,_0x299328){_0x299328=_0x299328||0xcc;return function(_0xc4d1ba){if(_0xc4d1ba){return _0x4f93b0['sendStatus'](_0x299328);}return _0x4f93b0[_0x1316('0xb')](_0x299328)[_0x1316('0xc')]();};}function respondWithResult(_0x1789b2,_0x58bf7d){_0x58bf7d=_0x58bf7d||0xc8;return function(_0xeb1423){if(_0xeb1423){return _0x1789b2[_0x1316('0xb')](_0x58bf7d)['json'](_0xeb1423);}};}function respondWithFilteredResult(_0x578675,_0xf09649){return function(_0x3d7942){if(_0x3d7942){var _0x1cb199=typeof _0xf09649[_0x1316('0xd')]===_0x1316('0xe')&&typeof _0xf09649[_0x1316('0xf')]===_0x1316('0xe');var _0x5e3d21=_0x3d7942[_0x1316('0x10')];var _0x567ce0=_0x1cb199?0x0:_0xf09649['offset'];var _0x5e86fe=_0x1cb199?_0x3d7942[_0x1316('0x10')]:_0xf09649[_0x1316('0xd')]+_0xf09649[_0x1316('0xf')];var _0x4866fd;if(_0x5e86fe>=_0x5e3d21){_0x5e86fe=_0x5e3d21;_0x4866fd=0xc8;}else{_0x4866fd=0xce;}_0x578675[_0x1316('0xb')](_0x4866fd);return _0x578675[_0x1316('0x11')](_0x1316('0x12'),_0x567ce0+'-'+_0x5e86fe+'/'+_0x5e3d21)[_0x1316('0x13')](_0x3d7942);}return null;};}function saveUpdates(_0x275709){return function(_0x1753e6){if(_0x1753e6){return _0x1753e6[_0x1316('0x14')](_0x275709)[_0x1316('0x15')](function(_0x29742b){return _0x29742b;});}return null;};}function removeEntity(_0xebadfd){return function(_0xc0d828){if(_0xc0d828){return _0xc0d828['destroy']()[_0x1316('0x15')](function(){_0xebadfd[_0x1316('0xb')](0xcc)[_0x1316('0xc')]();});}};}function handleEntityNotFound(_0x262c37){return function(_0x3e165c){if(!_0x3e165c){_0x262c37[_0x1316('0x16')](0x194);}return _0x3e165c;};}function handleError(_0x2a8c5a,_0x2fcb8c){_0x2fcb8c=_0x2fcb8c||0x1f4;return function(_0x51608f){logger['error'](_0x51608f['stack']);if(_0x51608f['name']){delete _0x51608f[_0x1316('0x17')];}_0x2a8c5a[_0x1316('0xb')](_0x2fcb8c)['send'](_0x51608f);};}function maskClientSecret(_0x46c73c){return _[_0x1316('0x18')](_0x46c73c[_0x1316('0x19')](0x0,0x3),0x14,'*');}exports['index']=function(_0x379c8c,_0x3a1983){var _0x56a08f={},_0x5a5548={},_0x2c88f1={'count':0x0,'rows':[]};var _0x2e624f=_[_0x1316('0x1a')](db[_0x1316('0x1b')][_0x1316('0x1c')],function(_0xeb18f1){return{'name':_0xeb18f1[_0x1316('0x1d')],'type':_0xeb18f1[_0x1316('0x1e')][_0x1316('0x1f')]};});_0x5a5548[_0x1316('0x20')]=_[_0x1316('0x1a')](_0x2e624f,_0x1316('0x17'));_0x5a5548[_0x1316('0x21')]=_[_0x1316('0x22')](_0x379c8c[_0x1316('0x21')]);_0x5a5548[_0x1316('0x23')]=_['intersection'](_0x5a5548['model'],_0x5a5548['query']);_0x56a08f['attributes']=_['intersection'](_0x5a5548[_0x1316('0x20')],qs['fields'](_0x379c8c[_0x1316('0x21')][_0x1316('0x24')]));_0x56a08f[_0x1316('0x25')]=_0x56a08f['attributes'][_0x1316('0x26')]?_0x56a08f['attributes']:_0x5a5548[_0x1316('0x20')];if(!_0x379c8c['query'][_0x1316('0x27')](_0x1316('0x28'))){_0x56a08f[_0x1316('0xf')]=qs[_0x1316('0xf')](_0x379c8c['query'][_0x1316('0xf')]);_0x56a08f['offset']=qs[_0x1316('0xd')](_0x379c8c[_0x1316('0x21')][_0x1316('0xd')]);}_0x56a08f[_0x1316('0x29')]=qs[_0x1316('0x2a')](_0x379c8c[_0x1316('0x21')][_0x1316('0x2a')]);_0x56a08f[_0x1316('0x2b')]=qs['filters'](_['pick'](_0x379c8c[_0x1316('0x21')],_0x5a5548['filters']),_0x2e624f);if(_0x379c8c[_0x1316('0x21')][_0x1316('0x2c')]){_0x56a08f[_0x1316('0x2b')]=_[_0x1316('0x2d')](_0x56a08f[_0x1316('0x2b')],{'$or':_[_0x1316('0x1a')](_0x2e624f,function(_0x5781ea){if(_0x5781ea[_0x1316('0x1e')]!==_0x1316('0x2e')){var _0x402b5f={};_0x402b5f[_0x5781ea[_0x1316('0x17')]]={'$like':'%'+_0x379c8c['query'][_0x1316('0x2c')]+'%'};return _0x402b5f;}})});}_0x56a08f=_[_0x1316('0x2d')]({},_0x56a08f,_0x379c8c[_0x1316('0x2f')]);var _0x2a787a={'where':_0x56a08f['where']};return db[_0x1316('0x1b')][_0x1316('0x10')](_0x2a787a)[_0x1316('0x15')](function(_0x51e96a){_0x2c88f1[_0x1316('0x10')]=_0x51e96a;if(_0x379c8c[_0x1316('0x21')]['includeAll']){_0x56a08f['include']=[{'all':!![]}];}return db[_0x1316('0x1b')][_0x1316('0x30')](_0x56a08f);})[_0x1316('0x15')](function(_0x57719d){_0x2c88f1['rows']=_['map'](_0x57719d,function(_0x26490a){if(_0x26490a[_0x1316('0x31')]==='MicrosoftAzure'){var _0x2dd50d=encryptor['decryptString'](_0x26490a['data3']);_0x26490a[_0x1316('0x32')]=maskClientSecret(_0x2dd50d);}return _0x26490a;});return _0x2c88f1;})[_0x1316('0x15')](respondWithFilteredResult(_0x3a1983,_0x56a08f))[_0x1316('0x33')](handleError(_0x3a1983,null));};exports[_0x1316('0x34')]=function(_0x110656,_0x21b4bf){var _0x591e12={'raw':!![],'where':{'id':_0x110656[_0x1316('0x35')]['id']}},_0x6374c9={};_0x6374c9[_0x1316('0x20')]=_[_0x1316('0x22')](db[_0x1316('0x1b')][_0x1316('0x1c')]);_0x6374c9[_0x1316('0x21')]=_[_0x1316('0x22')](_0x110656[_0x1316('0x21')]);_0x6374c9[_0x1316('0x23')]=_['intersection'](_0x6374c9[_0x1316('0x20')],_0x6374c9['query']);_0x591e12['attributes']=_[_0x1316('0x36')](_0x6374c9[_0x1316('0x20')],qs[_0x1316('0x24')](_0x110656[_0x1316('0x21')][_0x1316('0x24')]));_0x591e12[_0x1316('0x25')]=_0x591e12[_0x1316('0x25')][_0x1316('0x26')]?_0x591e12['attributes']:_0x6374c9[_0x1316('0x20')];if(_0x110656[_0x1316('0x21')][_0x1316('0x37')]){_0x591e12['include']=[{'all':!![]}];}_0x591e12=_[_0x1316('0x2d')]({},_0x591e12,_0x110656['options']);return db[_0x1316('0x1b')]['find'](_0x591e12)[_0x1316('0x15')](handleEntityNotFound(_0x21b4bf,null))[_0x1316('0x15')](function(_0x332805){if(_0x332805[_0x1316('0x31')]===_0x1316('0x38')){var _0x4d5660=encryptor['decryptString'](_0x332805[_0x1316('0x32')]);_0x332805[_0x1316('0x32')]=maskClientSecret(_0x4d5660);}return _0x332805;})[_0x1316('0x15')](respondWithResult(_0x21b4bf,null))['catch'](handleError(_0x21b4bf,null));};exports['create']=function(_0x3f01e7,_0x1a598a){if(!_0x3f01e7['body'][_0x1316('0x17')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x3f01e7[_0x1316('0x39')][_0x1316('0x31')])throw new Error(_0x1316('0x3a'));var _0x1e482b=db[_0x1316('0x1b')][_0x1316('0x1c')]['service']['values'];if(!_0x1e482b['includes'](_0x3f01e7[_0x1316('0x39')][_0x1316('0x31')]))throw new Error(_0x1316('0x3b')+_0x1e482b[_0x1316('0x3c')](',\x20'));if(_0x3f01e7['body'][_0x1316('0x31')]==='MicrosoftAzure'&&_0x3f01e7[_0x1316('0x39')][_0x1316('0x32')]){_0x3f01e7[_0x1316('0x39')][_0x1316('0x32')]=encryptor[_0x1316('0x3d')](_0x3f01e7['body'][_0x1316('0x32')]);}return db[_0x1316('0x1b')][_0x1316('0x3e')](_0x3f01e7[_0x1316('0x39')],{})[_0x1316('0x15')](respondWithResult(_0x1a598a,0xc9))[_0x1316('0x33')](handleError(_0x1a598a,null));};exports['update']=function(_0x336b64,_0x2a5f94){if(_0x336b64[_0x1316('0x39')]['id']){delete _0x336b64['body']['id'];}return db[_0x1316('0x1b')][_0x1316('0x3f')]({'where':{'id':_0x336b64[_0x1316('0x35')]['id']}})['then'](handleEntityNotFound(_0x2a5f94,null))[_0x1316('0x15')](function(_0x4ffcb8){if(_0x4ffcb8['service']===_0x1316('0x38')&&_0x336b64[_0x1316('0x39')][_0x1316('0x32')]){_0x336b64[_0x1316('0x39')][_0x1316('0x32')]=encryptor['encryptString'](_0x336b64['body'][_0x1316('0x32')]);}return _0x4ffcb8;})[_0x1316('0x15')](saveUpdates(_0x336b64[_0x1316('0x39')],null))[_0x1316('0x15')](respondWithResult(_0x2a5f94,null))[_0x1316('0x33')](handleError(_0x2a5f94,null));};exports[_0x1316('0x40')]=function(_0x3f130d,_0x4de234){return db[_0x1316('0x1b')][_0x1316('0x3f')]({'where':{'id':_0x3f130d[_0x1316('0x35')]['id']}})[_0x1316('0x15')](handleEntityNotFound(_0x4de234,null))[_0x1316('0x15')](removeEntity(_0x4de234,null))['catch'](handleError(_0x4de234,null));};exports['oauth2MicrosoftAuthorize']=function(_0x5bab5a,_0xfcd82){return db['CloudProvider']['findOne']({'where':{'id':_0x5bab5a[_0x1316('0x35')]['id']},'raw':!![]})[_0x1316('0x15')](function(_0x541a8a){if(!_0x541a8a)return _0xfcd82[_0x1316('0x16')](0x194);return{'url':oauth[_0x1316('0x41')](_0x541a8a,_0x5bab5a[_0x1316('0x42')]['id'])};})[_0x1316('0x15')](respondWithResult(_0xfcd82,null))[_0x1316('0x33')](handleError(_0xfcd82,null));};exports[_0x1316('0x43')]=function(_0x244622,_0x6da917){var _0x6e7401=_0x244622[_0x1316('0x39')];var _0x22a862;var _0x479590;if(_0x6e7401['error'])throw _0x6e7401;redis[_0x1316('0x44')](_0x6e7401[_0x1316('0x45')])[_0x1316('0x15')](function(_0x4449b7){if(!_0x4449b7)throw new Error(_0x1316('0x46'));_0x22a862=JSON['parse'](_0x4449b7);var _0x3e9180=Buffer['from'](_0x6e7401[_0x1316('0x45')],_0x1316('0x47'))[_0x1316('0x48')]('ascii');_0x479590=JSON[_0x1316('0x49')](_0x3e9180);if(!oauth[_0x1316('0x4a')](_0x6e7401['id_token'],_0x22a862['oauth2Claims']))throw new Error(_0x1316('0x4b'));redis['del'](_0x6e7401['state']);return oauth[_0x1316('0x4c')](_0x6e7401[_0x1316('0x4d')],_0x22a862);})[_0x1316('0x15')](function(_0x31b619){_0x22a862[_0x1316('0x4e')]=_0x31b619[_0x1316('0x4f')];_0x22a862[_0x1316('0x50')]=_0x31b619[_0x1316('0x51')];return db[_0x1316('0x1b')]['update']({'data5':_0x22a862[_0x1316('0x4e')],'data6':_0x22a862[_0x1316('0x50')]},{'where':{'id':_0x22a862['id']}});})[_0x1316('0x15')](function(){oauth[_0x1316('0x52')](_0x22a862);socket['emit'](_0x1316('0x53'),{'id':_0x479590['id']});return;})[_0x1316('0x15')](respondWithStatusCode(_0x6da917,null))[_0x1316('0x33')](function(_0x14a853){if(_0x479590){socket[_0x1316('0x54')]('microsoftAuthorization:error',{'id':_0x479590['id']});}if(!_0x22a862){logger[_0x1316('0x55')](_0x1316('0x56'),_0x14a853);return _0x6da917['status'](0x1f4)['send'](_0x14a853[_0x1316('0x57')]);}logger[_0x1316('0x55')](_0x1316('0x58'),_0x22a862['id'],JSON['stringify'](_0x14a853));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 6584d2e..6722da7 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 _0xa5bf=['rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x586b36,_0x510770){var _0x1bde1c=function(_0x50a8a6){while(--_0x50a8a6){_0x586b36['push'](_0x586b36['shift']());}};_0x1bde1c(++_0x510770);}(_0xa5bf,0x1d5));var _0xfa5b=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xa5bf[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0xfa5b('0x0'));var util=require(_0xfa5b('0x1'));var logger=require(_0xfa5b('0x2'))(_0xfa5b('0x3'));var moment=require('moment');var BPromise=require(_0xfa5b('0x4'));var rp=require(_0xfa5b('0x5'));var fs=require('fs');var path=require(_0xfa5b('0x6'));var rimraf=require(_0xfa5b('0x7'));var config=require(_0xfa5b('0x8'));var attributes=require(_0xfa5b('0x9'));module[_0xfa5b('0xa')]=function(_0x3f97c1,_0x1cb1cb){return _0x3f97c1[_0xfa5b('0xb')](_0xfa5b('0xc'),attributes,{'tableName':_0xfa5b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4cf5=['request-promise','path','../../config/environment','./cloudProvider.attributes','exports','define','cloud_providers','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x297119,_0x1588ab){var _0x3a583b=function(_0x18be30){while(--_0x18be30){_0x297119['push'](_0x297119['shift']());}};_0x3a583b(++_0x1588ab);}(_0x4cf5,0x10b));var _0x54cf=function(_0x51bb26,_0x522011){_0x51bb26=_0x51bb26-0x0;var _0x5cc1c7=_0x4cf5[_0x51bb26];return _0x5cc1c7;};'use strict';var _=require(_0x54cf('0x0'));var util=require(_0x54cf('0x1'));var logger=require(_0x54cf('0x2'))(_0x54cf('0x3'));var moment=require(_0x54cf('0x4'));var BPromise=require(_0x54cf('0x5'));var rp=require(_0x54cf('0x6'));var fs=require('fs');var path=require(_0x54cf('0x7'));var rimraf=require('rimraf');var config=require(_0x54cf('0x8'));var attributes=require(_0x54cf('0x9'));module[_0x54cf('0xa')]=function(_0x123c5b,_0x5569d9){return _0x123c5b[_0x54cf('0xb')]('CloudProvider',attributes,{'tableName':_0x54cf('0xc'),'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 523aed0..443a218 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 _0xc109=['ioredis','request-promise','util','../../components/encryptor','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','defaults','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','openid','/authorize','/token','map','type','Dynamics365','push','data7','join','Outlook365','/.default','replace','{TENANT_ID}','data2','code','id_token','from','stringify','toString','randomBytes','hex','response_type','redirect_uri','data4','response_mode','form_post','scope','state','nonce','key','value','oauth2Claims','oauth2/','data1','set','decode','payload','iss','isAfter','exp','resolve','then','data3','CloudProvider','refresh_token','data6','decryptString','POST','data5','access_token','update','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','findAll','all','catch','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','moment'];(function(_0x39567e,_0x5686b1){var _0xfe26f9=function(_0x51bd8f){while(--_0x51bd8f){_0x39567e['push'](_0x39567e['shift']());}};_0xfe26f9(++_0x5686b1);}(_0xc109,0x1dd));var _0x9c10=function(_0x4a9f22,_0x439a61){_0x4a9f22=_0x4a9f22-0x0;var _0x2511ff=_0xc109[_0x4a9f22];return _0x2511ff;};'use strict';var _=require('lodash');var crypto=require(_0x9c10('0x0'));var jwt=require(_0x9c10('0x1'));var moment=require(_0x9c10('0x2'));var Redis=require(_0x9c10('0x3'));var rp=require(_0x9c10('0x4'));var util=require(_0x9c10('0x5'));var encryptor=require(_0x9c10('0x6'));var config=require('../../config/environment');var logger=require(_0x9c10('0x7'))(_0x9c10('0x8'));var schedule=require(_0x9c10('0x9'));var db=require(_0x9c10('0xa'))['db'];config['redis']=_[_0x9c10('0xb')](config[_0x9c10('0xc')],{'host':_0x9c10('0xd'),'port':0x18eb});var redis=new Redis(config[_0x9c10('0xc')]);var MICROSOFT_AUTH_URL=_0x9c10('0xe');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x9c10('0xf'),_0x9c10('0x10'),_0x9c10('0x11'),_0x9c10('0x12'),_0x9c10('0x13'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x9c10('0x14'),_0x9c10('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0x9c10('0x15');var MICROSOFT_TOKEN_ENDPOINT=_0x9c10('0x16');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x31728c){var _0x512197=_[_0x9c10('0x17')](AZURE_AUTH_SCOPES[_0x31728c[_0x9c10('0x18')]]);if(_0x31728c[_0x9c10('0x18')]===_0x9c10('0x19'))_0x512197[_0x9c10('0x1a')](_0x31728c[_0x9c10('0x1b')]+'/.default');return _0x512197[_0x9c10('0x1c')]('\x20');}function getAccessTokenScope(_0x83e991){if(_0x83e991[_0x9c10('0x18')]===_0x9c10('0x1d'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x83e991[_0x9c10('0x18')]===_0x9c10('0x19'))return _0x83e991[_0x9c10('0x1b')]+_0x9c10('0x1e');}function generateMicrosoftAuthorizationUrl(_0x54f150,_0x396799){var _0x4fa313=MICROSOFT_AUTH_URL[_0x9c10('0x1f')](_0x9c10('0x20'),_0x54f150[_0x9c10('0x21')]);var _0x16bc06=[_0x9c10('0x22'),_0x9c10('0x23')];var _0x48a8d8=Buffer[_0x9c10('0x24')](JSON[_0x9c10('0x25')]({'id':_0x396799}))[_0x9c10('0x26')]('base64');var _0x30efcf=crypto[_0x9c10('0x27')](0x10)['toString'](_0x9c10('0x28'));var _0x458d4f=getAuthorizationScopes(_0x54f150);var _0x3451e8=[{'key':'client_id','value':_0x54f150['data1']},{'key':_0x9c10('0x29'),'value':encodeURIComponent(_0x16bc06[_0x9c10('0x1c')]('\x20'))},{'key':_0x9c10('0x2a'),'value':_0x54f150[_0x9c10('0x2b')]},{'key':_0x9c10('0x2c'),'value':_0x9c10('0x2d')},{'key':_0x9c10('0x2e'),'value':encodeURIComponent(_0x458d4f)},{'key':_0x9c10('0x2f'),'value':_0x48a8d8},{'key':_0x9c10('0x30'),'value':_0x30efcf},{'key':'prompt','value':'login'}];var _0x441450=_0x4fa313+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x3451e8,function(_0x3fa151){return _0x3fa151[_0x9c10('0x31')]+'='+_0x3fa151[_0x9c10('0x32')];})[_0x9c10('0x1c')]('&');_0x54f150[_0x9c10('0x33')]={'issuer':_0x4fa313[_0x9c10('0x1f')](_0x9c10('0x34'),''),'audience':_0x54f150[_0x9c10('0x35')],'state':_0x48a8d8,'nonce':_0x30efcf};redis[_0x9c10('0x36')](_0x48a8d8,JSON[_0x9c10('0x25')](_0x54f150));return _0x441450;}function isValidIdToken(_0x30b048,_0x36aa94){try{var _0x561bf2=jwt[_0x9c10('0x37')](_0x30b048,{'complete':!![]});var _0x37e322=_0x561bf2[_0x9c10('0x38')];if(_0x37e322[_0x9c10('0x39')]!==_0x36aa94['issuer'])return![];if(_0x37e322['aud']!==_0x36aa94['audience'])return![];if(_0x37e322['nonce']!==_0x36aa94['nonce'])return![];if(moment()[_0x9c10('0x3a')](moment['unix'](_0x37e322[_0x9c10('0x3b')])))return![];return!![];}catch(_0x24277f){throw _0x24277f;}}function refreshOauth2MicrosoftAccessToken(_0x1d0ee7){return Promise[_0x9c10('0x3c')]()[_0x9c10('0x3d')](function(){if(_0x1d0ee7[_0x9c10('0x3e')])return _0x1d0ee7;return db[_0x9c10('0x3f')]['findOne']({'where':{'id':_0x1d0ee7['id']},'raw':!![]});})[_0x9c10('0x3d')](function(_0x9d3be7){var _0x113734={'grant_type':_0x9c10('0x40'),'refresh_token':_0x9d3be7[_0x9c10('0x41')],'scope':getAccessTokenScope(_0x9d3be7),'redirect_uri':_0x9d3be7[_0x9c10('0x2b')],'client_id':_0x9d3be7['data1'],'client_secret':encryptor[_0x9c10('0x42')](_0x9d3be7[_0x9c10('0x3e')])};var _0x3b5753={'method':_0x9c10('0x43'),'uri':MICROSOFT_AUTH_URL[_0x9c10('0x1f')](_0x9c10('0x20'),_0x9d3be7[_0x9c10('0x21')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x113734,'json':!![]};return rp(_0x3b5753);})['then'](function(_0x11f412){_0x1d0ee7[_0x9c10('0x44')]=_0x11f412[_0x9c10('0x45')];_0x1d0ee7[_0x9c10('0x41')]=_0x11f412['refresh_token'];return db[_0x9c10('0x3f')][_0x9c10('0x46')]({'data5':_0x1d0ee7[_0x9c10('0x44')],'data6':_0x1d0ee7[_0x9c10('0x41')]},{'where':{'id':_0x1d0ee7['id']}});})['then'](function(){return _0x1d0ee7;})['catch'](function(_0x29474c){logger[_0x9c10('0x47')](_0x9c10('0x48'),_0x1d0ee7['id'],_0x29474c);});}function getOauth2MicrosoftAccessToken(_0x18d909,_0x5a21a7){var _0x1a5f27={'grant_type':_0x9c10('0x49'),'code':_0x18d909,'scope':getAccessTokenScope(_0x5a21a7),'redirect_uri':_0x5a21a7[_0x9c10('0x2b')],'client_id':_0x5a21a7['data1'],'client_secret':encryptor[_0x9c10('0x42')](_0x5a21a7['data3'])};var _0x5819e2={'method':_0x9c10('0x43'),'uri':MICROSOFT_AUTH_URL[_0x9c10('0x1f')](_0x9c10('0x20'),_0x5a21a7['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1a5f27,'json':!![]};return rp(_0x5819e2);}function startRefreshInterval(_0x500257){var _0x44c710=schedule[_0x9c10('0x4a')];if(_0x44c710[_0x500257['id']])clearInterval(_0x44c710[_0x500257['id']]);_0x44c710[_0x500257['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x500257['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x44c710;}function startAllRefreshIntervals(){return db[_0x9c10('0x3f')][_0x9c10('0x4b')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x9c10('0x3d')](function(_0x502726){var _0xea74b0=_0x502726['map'](function(_0x51e6d4){return refreshOauth2MicrosoftAccessToken(_0x51e6d4)[_0x9c10('0x3d')](function(_0x3c558c){startRefreshInterval(_0x3c558c);});});return Promise[_0x9c10('0x4c')](_0xea74b0);})[_0x9c10('0x4d')](function(_0x181ce0){var _0x1f5765=_0x181ce0?util['inspect'](_0x181ce0,{'showHidden':![],'depth':null}):'';logger[_0x9c10('0x47')](_0x9c10('0x4e'),_0x1f5765);});}module[_0x9c10('0x4f')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x53a5=['/.default','join','replace','{TENANT_ID}','id_token','from','base64','randomBytes','toString','hex','client_id','response_type','redirect_uri','data4','response_mode','form_post','scope','state','nonce','prompt','login','value','oauth2Claims','data1','set','stringify','issuer','unix','resolve','then','data3','CloudProvider','refresh_token','data6','decryptString','POST','data2','data5','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','bind','intervals','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','ioredis','request-promise','util','../../components/encryptor','../../config/environment','api','../../config/schedule/cloud-provider','redis','defaults','localhost','openid','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/token','map','type','Dynamics365','push','data7'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x53a5,0xc1));var _0x553a=function(_0x185792,_0x162643){_0x185792=_0x185792-0x0;var _0x2d3df1=_0x53a5[_0x185792];return _0x2d3df1;};'use strict';var _=require(_0x553a('0x0'));var crypto=require(_0x553a('0x1'));var jwt=require('jsonwebtoken');var moment=require('moment');var Redis=require(_0x553a('0x2'));var rp=require(_0x553a('0x3'));var util=require(_0x553a('0x4'));var encryptor=require(_0x553a('0x5'));var config=require(_0x553a('0x6'));var logger=require('../../config/logger')(_0x553a('0x7'));var schedule=require(_0x553a('0x8'));var db=require('../../mysqldb')['db'];config[_0x553a('0x9')]=_[_0x553a('0xa')](config['redis'],{'host':_0x553a('0xb'),'port':0x18eb});var redis=new Redis(config[_0x553a('0x9')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x553a('0xc'),'profile',_0x553a('0xd'),'offline_access',_0x553a('0xe'),'https://outlook.office.com/POP.AccessAsUser.All',_0x553a('0xf')],'Dynamics365':[_0x553a('0xc'),_0x553a('0x10')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x553a('0x11');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x25cabb){var _0x2cf064=_[_0x553a('0x12')](AZURE_AUTH_SCOPES[_0x25cabb[_0x553a('0x13')]]);if(_0x25cabb[_0x553a('0x13')]===_0x553a('0x14'))_0x2cf064[_0x553a('0x15')](_0x25cabb[_0x553a('0x16')]+_0x553a('0x17'));return _0x2cf064[_0x553a('0x18')]('\x20');}function getAccessTokenScope(_0x140331){if(_0x140331['type']==='Outlook365')return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x140331['type']==='Dynamics365')return _0x140331[_0x553a('0x16')]+_0x553a('0x17');}function generateMicrosoftAuthorizationUrl(_0x5bde4f,_0x2a73e3){var _0x37a652=MICROSOFT_AUTH_URL[_0x553a('0x19')](_0x553a('0x1a'),_0x5bde4f['data2']);var _0x5def04=['code',_0x553a('0x1b')];var _0x24454f=Buffer[_0x553a('0x1c')](JSON['stringify']({'id':_0x2a73e3}))['toString'](_0x553a('0x1d'));var _0x687298=crypto[_0x553a('0x1e')](0x10)[_0x553a('0x1f')](_0x553a('0x20'));var _0x519393=getAuthorizationScopes(_0x5bde4f);var _0x4af2dd=[{'key':_0x553a('0x21'),'value':_0x5bde4f['data1']},{'key':_0x553a('0x22'),'value':encodeURIComponent(_0x5def04[_0x553a('0x18')]('\x20'))},{'key':_0x553a('0x23'),'value':_0x5bde4f[_0x553a('0x24')]},{'key':_0x553a('0x25'),'value':_0x553a('0x26')},{'key':_0x553a('0x27'),'value':encodeURIComponent(_0x519393)},{'key':_0x553a('0x28'),'value':_0x24454f},{'key':_0x553a('0x29'),'value':_0x687298},{'key':_0x553a('0x2a'),'value':_0x553a('0x2b')}];var _0x5722dd=_0x37a652+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x553a('0x12')](_0x4af2dd,function(_0x4c9fcf){return _0x4c9fcf['key']+'='+_0x4c9fcf[_0x553a('0x2c')];})[_0x553a('0x18')]('&');_0x5bde4f[_0x553a('0x2d')]={'issuer':_0x37a652['replace']('oauth2/',''),'audience':_0x5bde4f[_0x553a('0x2e')],'state':_0x24454f,'nonce':_0x687298};redis[_0x553a('0x2f')](_0x24454f,JSON[_0x553a('0x30')](_0x5bde4f));return _0x5722dd;}function isValidIdToken(_0x4020e9,_0x4a0ba5){try{var _0x1e3a19=jwt['decode'](_0x4020e9,{'complete':!![]});var _0x369bbd=_0x1e3a19['payload'];if(_0x369bbd['iss']!==_0x4a0ba5[_0x553a('0x31')])return![];if(_0x369bbd['aud']!==_0x4a0ba5['audience'])return![];if(_0x369bbd[_0x553a('0x29')]!==_0x4a0ba5['nonce'])return![];if(moment()['isAfter'](moment[_0x553a('0x32')](_0x369bbd['exp'])))return![];return!![];}catch(_0x581723){throw _0x581723;}}function refreshOauth2MicrosoftAccessToken(_0x260c21){return Promise[_0x553a('0x33')]()[_0x553a('0x34')](function(){if(_0x260c21[_0x553a('0x35')])return _0x260c21;return db[_0x553a('0x36')]['findOne']({'where':{'id':_0x260c21['id']},'raw':!![]});})[_0x553a('0x34')](function(_0x3ee111){var _0x514184={'grant_type':_0x553a('0x37'),'refresh_token':_0x3ee111[_0x553a('0x38')],'scope':getAccessTokenScope(_0x3ee111),'redirect_uri':_0x3ee111[_0x553a('0x24')],'client_id':_0x3ee111[_0x553a('0x2e')],'client_secret':encryptor[_0x553a('0x39')](_0x3ee111[_0x553a('0x35')])};var _0x1ff3f6={'method':_0x553a('0x3a'),'uri':MICROSOFT_AUTH_URL[_0x553a('0x19')]('{TENANT_ID}',_0x3ee111[_0x553a('0x3b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x514184,'json':!![]};return rp(_0x1ff3f6);})[_0x553a('0x34')](function(_0x19aa75){_0x260c21[_0x553a('0x3c')]=_0x19aa75['access_token'];_0x260c21['data6']=_0x19aa75[_0x553a('0x37')];return db['CloudProvider'][_0x553a('0x3d')]({'data5':_0x260c21[_0x553a('0x3c')],'data6':_0x260c21[_0x553a('0x38')]},{'where':{'id':_0x260c21['id']}});})['then'](function(){return _0x260c21;})[_0x553a('0x3e')](function(_0x6ceca3){logger[_0x553a('0x3f')](_0x553a('0x40'),_0x260c21['id'],_0x6ceca3);});}function getOauth2MicrosoftAccessToken(_0x191fd6,_0x327bdc){var _0x483f81={'grant_type':'authorization_code','code':_0x191fd6,'scope':getAccessTokenScope(_0x327bdc),'redirect_uri':_0x327bdc[_0x553a('0x24')],'client_id':_0x327bdc[_0x553a('0x2e')],'client_secret':encryptor[_0x553a('0x39')](_0x327bdc[_0x553a('0x35')])};var _0xb1f027={'method':_0x553a('0x3a'),'uri':MICROSOFT_AUTH_URL[_0x553a('0x19')](_0x553a('0x1a'),_0x327bdc['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x483f81,'json':!![]};return rp(_0xb1f027);}function startRefreshInterval(_0x2c541f){var _0x172f74=schedule['intervals'];if(_0x172f74[_0x2c541f['id']])clearInterval(_0x172f74[_0x2c541f['id']]);_0x172f74[_0x2c541f['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x553a('0x41')](this,{'id':_0x2c541f['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x553a('0x42')]=_0x172f74;}function startAllRefreshIntervals(){return db[_0x553a('0x36')][_0x553a('0x43')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x553a('0x34')](function(_0x18e714){var _0x7cf0f6=_0x18e714[_0x553a('0x12')](function(_0xe281b8){return refreshOauth2MicrosoftAccessToken(_0xe281b8)[_0x553a('0x34')](function(_0x3d2018){startRefreshInterval(_0x3d2018);});});return Promise[_0x553a('0x44')](_0x7cf0f6);})['catch'](function(_0x2c706d){var _0x4fc48c=_0x2c706d?util[_0x553a('0x45')](_0x2c706d,{'showHidden':![],'depth':null}):'';logger[_0x553a('0x3f')](_0x553a('0x46'),_0x4fc48c);});}module[_0x553a('0x47')]={'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 344fb25..b76462c 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 _0x565e=['stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s'];(function(_0x3e2a9b,_0x2cd62f){var _0x1fe73a=function(_0x15e87c){while(--_0x15e87c){_0x3e2a9b['push'](_0x3e2a9b['shift']());}};_0x1fe73a(++_0x2cd62f);}(_0x565e,0x7f));var _0xe565=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x565e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe565('0x0'));var util=require('util');var moment=require(_0xe565('0x1'));var BPromise=require(_0xe565('0x2'));var rs=require(_0xe565('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe565('0x4'));var logger=require(_0xe565('0x5'))(_0xe565('0x6'));var config=require(_0xe565('0x7'));var jayson=require(_0xe565('0x8'));var client=jayson[_0xe565('0x9')][_0xe565('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a9d48,_0x470daf,_0x359a05){return new BPromise(function(_0x1204c8,_0x14f3df){return client[_0xe565('0xb')](_0x1a9d48,_0x359a05)[_0xe565('0xc')](function(_0x1d3d48){logger[_0xe565('0xd')]('CloudProvider,\x20%s,\x20%s',_0x470daf,_0xe565('0xe'));logger[_0xe565('0xf')](_0xe565('0x10'),_0x470daf,'request\x20sent',JSON[_0xe565('0x11')](_0x1d3d48));if(_0x1d3d48[_0xe565('0x12')]){if(_0x1d3d48[_0xe565('0x12')][_0xe565('0x13')]===0x1f4){logger['error'](_0xe565('0x14'),_0x470daf,_0x1d3d48['error'][_0xe565('0x15')]);return _0x14f3df(_0x1d3d48['error'][_0xe565('0x15')]);}logger[_0xe565('0x12')](_0xe565('0x14'),_0x470daf,_0x1d3d48['error'][_0xe565('0x15')]);return _0x1204c8(_0x1d3d48[_0xe565('0x12')][_0xe565('0x15')]);}else{logger[_0xe565('0xd')]('CloudProvider,\x20%s,\x20%s',_0x470daf,_0xe565('0xe'));_0x1204c8(_0x1d3d48[_0xe565('0x16')][_0xe565('0x15')]);}})[_0xe565('0x17')](function(_0x3899de){logger[_0xe565('0x12')]('CloudProvider,\x20%s,\x20%s',_0x470daf,_0x3899de);_0x14f3df(_0x3899de);});});}
\ No newline at end of file
+var _0x500c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xfbe06e,_0x2fb7ab){var _0x24e5b6=function(_0x48569f){while(--_0x48569f){_0xfbe06e['push'](_0xfbe06e['shift']());}};_0x24e5b6(++_0x2fb7ab);}(_0x500c,0x188));var _0xc500=function(_0x8bd42b,_0x5e2120){_0x8bd42b=_0x8bd42b-0x0;var _0x1847be=_0x500c[_0x8bd42b];return _0x1847be;};'use strict';var _=require(_0xc500('0x0'));var util=require(_0xc500('0x1'));var moment=require(_0xc500('0x2'));var BPromise=require(_0xc500('0x3'));var rs=require(_0xc500('0x4'));var fs=require('fs');var Redis=require(_0xc500('0x5'));var db=require(_0xc500('0x6'))['db'];var utils=require(_0xc500('0x7'));var logger=require(_0xc500('0x8'))(_0xc500('0x9'));var config=require(_0xc500('0xa'));var jayson=require(_0xc500('0xb'));var client=jayson[_0xc500('0xc')][_0xc500('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3bc410,_0x5dd365,_0x297252){return new BPromise(function(_0x480a10,_0x3cf7f9){return client[_0xc500('0xe')](_0x3bc410,_0x297252)[_0xc500('0xf')](function(_0x3b40f2){logger[_0xc500('0x10')](_0xc500('0x11'),_0x5dd365,'request\x20sent');logger[_0xc500('0x12')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x5dd365,_0xc500('0x13'),JSON['stringify'](_0x3b40f2));if(_0x3b40f2['error']){if(_0x3b40f2[_0xc500('0x14')][_0xc500('0x15')]===0x1f4){logger['error'](_0xc500('0x11'),_0x5dd365,_0x3b40f2[_0xc500('0x14')][_0xc500('0x16')]);return _0x3cf7f9(_0x3b40f2[_0xc500('0x14')][_0xc500('0x16')]);}logger[_0xc500('0x14')](_0xc500('0x11'),_0x5dd365,_0x3b40f2[_0xc500('0x14')]['message']);return _0x480a10(_0x3b40f2[_0xc500('0x14')][_0xc500('0x16')]);}else{logger['info'](_0xc500('0x11'),_0x5dd365,_0xc500('0x13'));_0x480a10(_0x3b40f2[_0xc500('0x17')][_0xc500('0x16')]);}})[_0xc500('0x18')](function(_0x369271){logger[_0xc500('0x14')]('CloudProvider,\x20%s,\x20%s',_0x5dd365,_0x369271);_0x3cf7f9(_0x369271);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index c4d7aee..c2a108c 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 _0x5f66=['index','post','/:id','update','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','Router','./cloudProvider.controller','get','isAuthenticated'];(function(_0x16b9a2,_0x238e9e){var _0x34f907=function(_0x2bdc77){while(--_0x2bdc77){_0x16b9a2['push'](_0x16b9a2['shift']());}};_0x34f907(++_0x238e9e);}(_0x5f66,0x1a0));var _0x65f6=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x5f66[_0x17d9e3];return _0x14192d;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);router[_0x65f6('0x2')]('/:id',auth[_0x65f6('0x3')](),controller['show']);router[_0x65f6('0x5')]('/',auth[_0x65f6('0x3')](),controller['create']);router['put'](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller[_0x65f6('0x7')]);router[_0x65f6('0x8')](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller['destroy']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x3')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x5')]('/oauth2/microsoft/callback',controller[_0x65f6('0xb')]);module['exports']=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(_0x24e652,_0x321756){var _0x489b2f=function(_0x186b86){while(--_0x186b86){_0x24e652['push'](_0x24e652['shift']());}};_0x489b2f(++_0x321756);}(_0xdb28,0x106));var _0x8db2=function(_0x56cea4,_0x588762){_0x56cea4=_0x56cea4-0x0;var _0x19480a=_0xdb28[_0x56cea4];return _0x19480a;};'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 64c6d63..418a500 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 _0xb102=['STRING','name','sequelize'];(function(_0x1e767d,_0x398fc9){var _0x4b631b=function(_0xf78d76){while(--_0xf78d76){_0x1e767d['push'](_0x1e767d['shift']());}};_0x4b631b(++_0x398fc9);}(_0xb102,0x16d));var _0x2b10=function(_0x4c71fa,_0x14b8f7){_0x4c71fa=_0x4c71fa-0x0;var _0x46621e=_0xb102[_0x4c71fa];return _0x46621e;};'use strict';var Sequelize=require(_0x2b10('0x0'));module['exports']={'name':{'type':Sequelize[_0x2b10('0x1')],'unique':_0x2b10('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x2b10('0x1')]},'companyId':{'type':Sequelize[_0x2b10('0x1')]},'website':{'type':Sequelize[_0x2b10('0x1')]},'phone':{'type':Sequelize[_0x2b10('0x1')]},'fax':{'type':Sequelize[_0x2b10('0x1')]},'type':{'type':Sequelize[_0x2b10('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x2b10('0x1')]},'city':{'type':Sequelize[_0x2b10('0x1')]},'country':{'type':Sequelize[_0x2b10('0x1')]},'email':{'type':Sequelize[_0x2b10('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x2b10('0x1')]},'sPostalCode':{'type':Sequelize[_0x2b10('0x1')]},'sCity':{'type':Sequelize[_0x2b10('0x1')]},'sCountry':{'type':Sequelize[_0x2b10('0x1')]},'description':{'type':Sequelize[_0x2b10('0x1')]}};
\ No newline at end of file
+var _0x8363=['sequelize','exports','name','STRING'];(function(_0x1498c9,_0x5d9a21){var _0x1522e3=function(_0x263f99){while(--_0x263f99){_0x1498c9['push'](_0x1498c9['shift']());}};_0x1522e3(++_0x5d9a21);}(_0x8363,0x1f0));var _0x3836=function(_0x3e6f74,_0xd6cbbd){_0x3e6f74=_0x3e6f74-0x0;var _0x1e255a=_0x8363[_0x3e6f74];return _0x1e255a;};'use strict';var Sequelize=require(_0x3836('0x0'));module[_0x3836('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x3836('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x3836('0x3')]},'companyId':{'type':Sequelize[_0x3836('0x3')]},'website':{'type':Sequelize[_0x3836('0x3')]},'phone':{'type':Sequelize[_0x3836('0x3')]},'fax':{'type':Sequelize[_0x3836('0x3')]},'type':{'type':Sequelize[_0x3836('0x3')]},'street':{'type':Sequelize[_0x3836('0x3')]},'postalCode':{'type':Sequelize[_0x3836('0x3')]},'city':{'type':Sequelize[_0x3836('0x3')]},'country':{'type':Sequelize[_0x3836('0x3')]},'email':{'type':Sequelize[_0x3836('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x3836('0x3')]},'sPostalCode':{'type':Sequelize[_0x3836('0x3')]},'sCity':{'type':Sequelize[_0x3836('0x3')]},'sCountry':{'type':Sequelize[_0x3836('0x3')]},'description':{'type':Sequelize[_0x3836('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 62ec86a..def4878 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 _0x4dea=['then','destroy','get','Companies','UserProfileResource','error','stack','name','index','CmCompany','describe','model','keys','filters','intersection','attributes','query','fields','nolimit','order','pick','filter','where','map','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContact','addContacts','ids','omit','getContacts','sort','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update'];(function(_0x1927d7,_0x21a071){var _0x1eb2bf=function(_0x485975){while(--_0x485975){_0x1927d7['push'](_0x1927d7['shift']());}};_0x1eb2bf(++_0x21a071);}(_0x4dea,0x88));var _0xa4de=function(_0x3086e5,_0x5364e7){_0x3086e5=_0x3086e5-0x0;var _0x27f951=_0x4dea[_0x3086e5];return _0x27f951;};'use strict';var emlformat=require(_0xa4de('0x0'));var rimraf=require(_0xa4de('0x1'));var zipdir=require(_0xa4de('0x2'));var jsonpatch=require(_0xa4de('0x3'));var rp=require('request-promise');var moment=require(_0xa4de('0x4'));var BPromise=require(_0xa4de('0x5'));var Mustache=require(_0xa4de('0x6'));var util=require(_0xa4de('0x7'));var path=require(_0xa4de('0x8'));var sox=require('sox');var csv=require(_0xa4de('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa4de('0xa'));var _=require(_0xa4de('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa4de('0xc'));var deskjs=require(_0xa4de('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa4de('0xe'));var Papa=require(_0xa4de('0xf'));var Redis=require('ioredis');var authService=require(_0xa4de('0x10'));var qs=require(_0xa4de('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa4de('0x12'));var logger=require('../../config/logger')(_0xa4de('0x13'));var utils=require(_0xa4de('0x14'));var config=require(_0xa4de('0x15'));var licenseUtil=require(_0xa4de('0x16'));var db=require(_0xa4de('0x17'))['db'];function respondWithStatusCode(_0x18db03,_0x1f8dfd){_0x1f8dfd=_0x1f8dfd||0xcc;return function(_0x271377){if(_0x271377){return _0x18db03[_0xa4de('0x18')](_0x1f8dfd);}return _0x18db03['status'](_0x1f8dfd)[_0xa4de('0x19')]();};}function respondWithResult(_0x4f4517,_0x3fb89c){_0x3fb89c=_0x3fb89c||0xc8;return function(_0x38309e){if(_0x38309e){return _0x4f4517[_0xa4de('0x1a')](_0x3fb89c)['json'](_0x38309e);}};}function respondWithFilteredResult(_0x1fe7cd,_0x524a6d){return function(_0x426575){if(_0x426575){var _0x52e9ad=typeof _0x524a6d[_0xa4de('0x1b')]==='undefined'&&typeof _0x524a6d[_0xa4de('0x1c')]===_0xa4de('0x1d');var _0x36c6c3=_0x426575[_0xa4de('0x1e')];var _0x275030=_0x52e9ad?0x0:_0x524a6d[_0xa4de('0x1b')];var _0x3f9a0a=_0x52e9ad?_0x426575[_0xa4de('0x1e')]:_0x524a6d[_0xa4de('0x1b')]+_0x524a6d[_0xa4de('0x1c')];var _0x90ba8b;if(_0x3f9a0a>=_0x36c6c3){_0x3f9a0a=_0x36c6c3;_0x90ba8b=0xc8;}else{_0x90ba8b=0xce;}_0x1fe7cd[_0xa4de('0x1a')](_0x90ba8b);return _0x1fe7cd[_0xa4de('0x1f')](_0xa4de('0x20'),_0x275030+'-'+_0x3f9a0a+'/'+_0x36c6c3)[_0xa4de('0x21')](_0x426575);}return null;};}function patchUpdates(_0x4fe8ff){return function(_0x3a654e){try{jsonpatch[_0xa4de('0x22')](_0x3a654e,_0x4fe8ff,!![]);}catch(_0x293f8b){return BPromise[_0xa4de('0x23')](_0x293f8b);}return _0x3a654e[_0xa4de('0x24')]();};}function saveUpdates(_0x354bf2,_0x3f0455){return function(_0x1335ac){if(_0x1335ac){return _0x1335ac[_0xa4de('0x25')](_0x354bf2)[_0xa4de('0x26')](function(_0x4b647a){return _0x4b647a;});}return null;};}function removeEntity(_0x32436f,_0x44b83a){return function(_0x5750f8){if(_0x5750f8){return _0x5750f8[_0xa4de('0x27')]()[_0xa4de('0x26')](function(){var _0x331896=_0x5750f8[_0xa4de('0x28')]({'plain':!![]});var _0x2d38fd=_0xa4de('0x29');return db[_0xa4de('0x2a')][_0xa4de('0x27')]({'where':{'type':_0x2d38fd,'resourceId':_0x331896['id']}})['then'](function(){return _0x5750f8;});})['then'](function(){_0x32436f[_0xa4de('0x1a')](0xcc)[_0xa4de('0x19')]();});}};}function handleEntityNotFound(_0x4d93f4,_0x4aa0e1){return function(_0x59043d){if(!_0x59043d){_0x4d93f4[_0xa4de('0x18')](0x194);}return _0x59043d;};}function handleError(_0x51472c,_0x33bfb0){_0x33bfb0=_0x33bfb0||0x1f4;return function(_0x51e9a0){logger[_0xa4de('0x2b')](_0x51e9a0[_0xa4de('0x2c')]);if(_0x51e9a0[_0xa4de('0x2d')]){delete _0x51e9a0[_0xa4de('0x2d')];}_0x51472c['status'](_0x33bfb0)['send'](_0x51e9a0);};}exports[_0xa4de('0x2e')]=function(_0x9aa3df,_0x32be3a){var _0x55c300={},_0x46906b={},_0x5a3b21={'count':0x0,'rows':[]};return db[_0xa4de('0x2f')][_0xa4de('0x30')]()[_0xa4de('0x26')](function(_0x20037b){_0x46906b[_0xa4de('0x31')]=_['keys'](_0x20037b);_0x46906b['query']=_[_0xa4de('0x32')](_0x9aa3df['query']);_0x46906b[_0xa4de('0x33')]=_[_0xa4de('0x34')](_0x46906b[_0xa4de('0x31')],_0x46906b['query']);_0x55c300[_0xa4de('0x35')]=_[_0xa4de('0x34')](_0x46906b[_0xa4de('0x31')],qs['fields'](_0x9aa3df[_0xa4de('0x36')][_0xa4de('0x37')]));_0x55c300[_0xa4de('0x35')]=_0x55c300[_0xa4de('0x35')]['length']?_0x55c300[_0xa4de('0x35')]:_0x46906b[_0xa4de('0x31')];if(!_0x9aa3df[_0xa4de('0x36')]['hasOwnProperty'](_0xa4de('0x38'))){_0x55c300['limit']=qs['limit'](_0x9aa3df[_0xa4de('0x36')][_0xa4de('0x1c')]);_0x55c300['offset']=qs[_0xa4de('0x1b')](_0x9aa3df['query'][_0xa4de('0x1b')]);}_0x55c300[_0xa4de('0x39')]=qs['sort'](_0x9aa3df[_0xa4de('0x36')]['sort']);_0x55c300['where']=qs[_0xa4de('0x33')](_[_0xa4de('0x3a')](_0x9aa3df[_0xa4de('0x36')],_0x46906b[_0xa4de('0x33')]),_0x20037b);if(_0x9aa3df['query'][_0xa4de('0x3b')]){_0x55c300[_0xa4de('0x3c')]=_['merge'](_0x55c300[_0xa4de('0x3c')],{'$or':_[_0xa4de('0x3d')](_0x55c300[_0xa4de('0x35')],function(_0x26608f){var _0x26d13e={};_0x26d13e[_0x26608f]={'$like':'%'+_0x9aa3df[_0xa4de('0x36')][_0xa4de('0x3b')]+'%'};return _0x26d13e;})});}_0x55c300=_[_0xa4de('0x3e')]({},_0x55c300,_0x9aa3df[_0xa4de('0x3f')]);var _0x2331dd={'where':_0x55c300[_0xa4de('0x3c')]};return db[_0xa4de('0x2f')][_0xa4de('0x1e')](_0x2331dd)[_0xa4de('0x26')](function(_0x20a27d){_0x5a3b21['count']=_0x20a27d;if(_0x9aa3df[_0xa4de('0x36')][_0xa4de('0x40')]){_0x55c300['include']=[{'all':!![]}];}return db[_0xa4de('0x2f')][_0xa4de('0x41')](_0x55c300);})[_0xa4de('0x26')](function(_0x300764){_0x5a3b21[_0xa4de('0x42')]=_0x300764;return _0x5a3b21;})[_0xa4de('0x26')](respondWithFilteredResult(_0x32be3a,_0x55c300))[_0xa4de('0x43')](handleError(_0x32be3a,null));})[_0xa4de('0x43')](handleError(_0x32be3a,null));};exports[_0xa4de('0x44')]=function(_0x4b5770,_0x3070f2){var _0x10fc66={'raw':![],'where':{'id':_0x4b5770[_0xa4de('0x45')]['id']}},_0x3c83ca={};_0x3c83ca[_0xa4de('0x31')]=_[_0xa4de('0x32')](db['CmCompany'][_0xa4de('0x46')]);_0x3c83ca['query']=_[_0xa4de('0x32')](_0x4b5770['query']);_0x3c83ca[_0xa4de('0x33')]=_[_0xa4de('0x34')](_0x3c83ca[_0xa4de('0x31')],_0x3c83ca[_0xa4de('0x36')]);_0x10fc66[_0xa4de('0x35')]=_[_0xa4de('0x34')](_0x3c83ca['model'],qs[_0xa4de('0x37')](_0x4b5770[_0xa4de('0x36')]['fields']));_0x10fc66[_0xa4de('0x35')]=_0x10fc66['attributes'][_0xa4de('0x47')]?_0x10fc66[_0xa4de('0x35')]:_0x3c83ca[_0xa4de('0x31')];if(_0x4b5770[_0xa4de('0x36')][_0xa4de('0x40')]){_0x10fc66['include']=[{'all':!![]}];}_0x10fc66=_[_0xa4de('0x3e')]({},_0x10fc66,_0x4b5770[_0xa4de('0x3f')]);return db[_0xa4de('0x2f')][_0xa4de('0x48')](_0x10fc66)['then'](handleEntityNotFound(_0x3070f2,null))[_0xa4de('0x26')](respondWithResult(_0x3070f2,null))[_0xa4de('0x43')](handleError(_0x3070f2,null));};exports['create']=function(_0x1afd3f,_0x5a2032){return db['CmCompany'][_0xa4de('0x49')](_0x1afd3f[_0xa4de('0x4a')],{})['then'](function(_0x36bf7b){var _0x2442de=_0x1afd3f['user'][_0xa4de('0x28')]({'plain':!![]});if(!_0x2442de)throw new Error(_0xa4de('0x4b'));if(_0x2442de[_0xa4de('0x4c')]===_0xa4de('0x4d')){var _0x4f3ac4=_0x36bf7b[_0xa4de('0x28')]({'plain':!![]});var _0x48981d=_0xa4de('0x29');return db['UserProfileSection'][_0xa4de('0x48')]({'where':{'name':_0x48981d,'userProfileId':_0x2442de['userProfileId']},'raw':!![]})['then'](function(_0x125fee){if(_0x125fee&&_0x125fee[_0xa4de('0x4e')]===0x0){return db[_0xa4de('0x2a')]['create']({'name':_0x4f3ac4[_0xa4de('0x2d')],'resourceId':_0x4f3ac4['id'],'type':_0x125fee[_0xa4de('0x2d')],'sectionId':_0x125fee['id']},{})['then'](function(){return _0x36bf7b;});}else{return _0x36bf7b;}})[_0xa4de('0x43')](function(_0x3b0cda){logger[_0xa4de('0x2b')](_0xa4de('0x4f'),_0x3b0cda);throw _0x3b0cda;});}return _0x36bf7b;})[_0xa4de('0x26')](respondWithResult(_0x5a2032,0xc9))['catch'](handleError(_0x5a2032,null));};exports[_0xa4de('0x25')]=function(_0x3eebd3,_0x51a44e){if(_0x3eebd3[_0xa4de('0x4a')]['id']){delete _0x3eebd3['body']['id'];}return db['CmCompany'][_0xa4de('0x48')]({'where':{'id':_0x3eebd3[_0xa4de('0x45')]['id']}})['then'](handleEntityNotFound(_0x51a44e,null))['then'](saveUpdates(_0x3eebd3['body'],null))[_0xa4de('0x26')](respondWithResult(_0x51a44e,null))[_0xa4de('0x43')](handleError(_0x51a44e,null));};exports['destroy']=function(_0x3c39f9,_0x3ccc6d){return db[_0xa4de('0x2f')][_0xa4de('0x48')]({'where':{'id':_0x3c39f9['params']['id']}})[_0xa4de('0x26')](handleEntityNotFound(_0x3ccc6d,null))[_0xa4de('0x26')](removeEntity(_0x3ccc6d,null))['catch'](handleError(_0x3ccc6d,null));};exports[_0xa4de('0x30')]=function(_0x4e597f,_0x345a4c){return db[_0xa4de('0x2f')]['describe']()[_0xa4de('0x26')](respondWithResult(_0x345a4c,null))['catch'](handleError(_0x345a4c,null));};exports['addContacts']=function(_0x51ca90,_0x444d6c,_0x3dd418){return db[_0xa4de('0x50')]['find']({'where':{'id':_0x51ca90['params']['id']}})[_0xa4de('0x26')](handleEntityNotFound(_0x444d6c,null))[_0xa4de('0x26')](function(_0x494c60){if(_0x494c60){return _0x494c60[_0xa4de('0x51')](_0x51ca90[_0xa4de('0x4a')][_0xa4de('0x52')],_[_0xa4de('0x53')](_0x51ca90[_0xa4de('0x4a')],['ids','id'])||{});}})[_0xa4de('0x26')](respondWithResult(_0x444d6c,null))[_0xa4de('0x43')](handleError(_0x444d6c,null));};exports[_0xa4de('0x54')]=function(_0x5d104b,_0x140929,_0x197747){var _0x40a843={};var _0x594edf={};var _0x15d59d;var _0x4a06d4;return db[_0xa4de('0x2f')]['findOne']({'where':{'id':_0x5d104b[_0xa4de('0x45')]['id']}})['then'](handleEntityNotFound(_0x140929,null))[_0xa4de('0x26')](function(_0x44035b){if(_0x44035b){_0x15d59d=_0x44035b;_0x594edf[_0xa4de('0x31')]=_[_0xa4de('0x32')](db[_0xa4de('0x50')][_0xa4de('0x46')]);_0x594edf['query']=_[_0xa4de('0x32')](_0x5d104b[_0xa4de('0x36')]);_0x594edf[_0xa4de('0x33')]=_[_0xa4de('0x34')](_0x594edf['model'],_0x594edf[_0xa4de('0x36')]);_0x40a843[_0xa4de('0x35')]=_[_0xa4de('0x34')](_0x594edf[_0xa4de('0x31')],qs[_0xa4de('0x37')](_0x5d104b[_0xa4de('0x36')][_0xa4de('0x37')]));_0x40a843[_0xa4de('0x35')]=_0x40a843['attributes'][_0xa4de('0x47')]?_0x40a843[_0xa4de('0x35')]:_0x594edf['model'];_0x40a843[_0xa4de('0x39')]=qs[_0xa4de('0x55')](_0x5d104b[_0xa4de('0x36')][_0xa4de('0x55')]);_0x40a843[_0xa4de('0x3c')]=qs[_0xa4de('0x33')](_[_0xa4de('0x3a')](_0x5d104b[_0xa4de('0x36')],_0x594edf[_0xa4de('0x33')]));if(_0x5d104b['query'][_0xa4de('0x3b')]){_0x40a843[_0xa4de('0x3c')]=_[_0xa4de('0x3e')](_0x40a843['where'],{'$or':_[_0xa4de('0x3d')](_0x40a843[_0xa4de('0x35')],function(_0x3f1a39){var _0x229bec={};_0x229bec[_0x3f1a39]={'$like':'%'+_0x5d104b[_0xa4de('0x36')][_0xa4de('0x3b')]+'%'};return _0x229bec;})});}_0x40a843=_[_0xa4de('0x3e')]({},_0x40a843,_0x5d104b[_0xa4de('0x3f')]);return _0x15d59d[_0xa4de('0x54')](_0x40a843);}})[_0xa4de('0x26')](function(_0x431471){if(_0x431471){_0x4a06d4=_0x431471[_0xa4de('0x47')];if(!_0x5d104b['query'][_0xa4de('0x56')]('nolimit')){_0x40a843[_0xa4de('0x1c')]=qs[_0xa4de('0x1c')](_0x5d104b['query'][_0xa4de('0x1c')]);_0x40a843[_0xa4de('0x1b')]=qs[_0xa4de('0x1b')](_0x5d104b[_0xa4de('0x36')][_0xa4de('0x1b')]);}return _0x15d59d[_0xa4de('0x54')](_0x40a843);}})[_0xa4de('0x26')](function(_0x190cea){if(_0x190cea){return _0x190cea?{'count':_0x4a06d4,'rows':_0x190cea}:null;}})[_0xa4de('0x26')](respondWithResult(_0x140929,null))[_0xa4de('0x43')](handleError(_0x140929,null));};
\ No newline at end of file
+var _0x7c1a=['keys','query','filters','attributes','fields','length','order','sort','where','pick','filter','merge','map','findAll','rows','catch','params','intersection','includeAll','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','find','ids','getContacts','findOne','CmContact','rawAttributes','hasOwnProperty','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','undefined','count','offset','limit','set','Content-Range','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','describe','model'];(function(_0x41a6ea,_0x5abe65){var _0x3c3871=function(_0xa583c7){while(--_0xa583c7){_0x41a6ea['push'](_0x41a6ea['shift']());}};_0x3c3871(++_0x5abe65);}(_0x7c1a,0x75));var _0xa7c1=function(_0x3fc4ef,_0x57e071){_0x3fc4ef=_0x3fc4ef-0x0;var _0x20d7e2=_0x7c1a[_0x3fc4ef];return _0x20d7e2;};'use strict';var emlformat=require(_0xa7c1('0x0'));var rimraf=require(_0xa7c1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa7c1('0x2'));var rp=require(_0xa7c1('0x3'));var moment=require('moment');var BPromise=require(_0xa7c1('0x4'));var Mustache=require(_0xa7c1('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xa7c1('0x6'));var ejs=require(_0xa7c1('0x7'));var fs=require('fs');var fs_extra=require(_0xa7c1('0x8'));var _=require(_0xa7c1('0x9'));var squel=require(_0xa7c1('0xa'));var crypto=require(_0xa7c1('0xb'));var jsforce=require(_0xa7c1('0xc'));var deskjs=require(_0xa7c1('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa7c1('0xe'));var qs=require(_0xa7c1('0xf'));var as=require(_0xa7c1('0x10'));var hardwareService=require(_0xa7c1('0x11'));var logger=require(_0xa7c1('0x12'))(_0xa7c1('0x13'));var utils=require(_0xa7c1('0x14'));var config=require(_0xa7c1('0x15'));var licenseUtil=require(_0xa7c1('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x85bdac,_0x1a24ca){_0x1a24ca=_0x1a24ca||0xcc;return function(_0x37157c){if(_0x37157c){return _0x85bdac['sendStatus'](_0x1a24ca);}return _0x85bdac[_0xa7c1('0x17')](_0x1a24ca)[_0xa7c1('0x18')]();};}function respondWithResult(_0xf48917,_0x5dd36f){_0x5dd36f=_0x5dd36f||0xc8;return function(_0x305a13){if(_0x305a13){return _0xf48917[_0xa7c1('0x17')](_0x5dd36f)['json'](_0x305a13);}};}function respondWithFilteredResult(_0xc4d555,_0x19b78b){return function(_0x540c25){if(_0x540c25){var _0x4b493b=typeof _0x19b78b['offset']==='undefined'&&typeof _0x19b78b['limit']===_0xa7c1('0x19');var _0x3feddc=_0x540c25[_0xa7c1('0x1a')];var _0x6eb73c=_0x4b493b?0x0:_0x19b78b[_0xa7c1('0x1b')];var _0x37841c=_0x4b493b?_0x540c25[_0xa7c1('0x1a')]:_0x19b78b[_0xa7c1('0x1b')]+_0x19b78b[_0xa7c1('0x1c')];var _0x212681;if(_0x37841c>=_0x3feddc){_0x37841c=_0x3feddc;_0x212681=0xc8;}else{_0x212681=0xce;}_0xc4d555[_0xa7c1('0x17')](_0x212681);return _0xc4d555[_0xa7c1('0x1d')](_0xa7c1('0x1e'),_0x6eb73c+'-'+_0x37841c+'/'+_0x3feddc)['json'](_0x540c25);}return null;};}function patchUpdates(_0x190113){return function(_0x1d8eaf){try{jsonpatch['apply'](_0x1d8eaf,_0x190113,!![]);}catch(_0x22a1d3){return BPromise['reject'](_0x22a1d3);}return _0x1d8eaf['save']();};}function saveUpdates(_0x344c24,_0x3c30c0){return function(_0xab9674){if(_0xab9674){return _0xab9674[_0xa7c1('0x1f')](_0x344c24)[_0xa7c1('0x20')](function(_0x21bf37){return _0x21bf37;});}return null;};}function removeEntity(_0x34a18d,_0x45ff94){return function(_0x151b18){if(_0x151b18){return _0x151b18[_0xa7c1('0x21')]()[_0xa7c1('0x20')](function(){var _0x24b486=_0x151b18[_0xa7c1('0x22')]({'plain':!![]});var _0x21fbc1=_0xa7c1('0x23');return db[_0xa7c1('0x24')][_0xa7c1('0x21')]({'where':{'type':_0x21fbc1,'resourceId':_0x24b486['id']}})[_0xa7c1('0x20')](function(){return _0x151b18;});})['then'](function(){_0x34a18d[_0xa7c1('0x17')](0xcc)[_0xa7c1('0x18')]();});}};}function handleEntityNotFound(_0x3979a7,_0x5ba747){return function(_0x327ac7){if(!_0x327ac7){_0x3979a7['sendStatus'](0x194);}return _0x327ac7;};}function handleError(_0x2a1144,_0x81cad9){_0x81cad9=_0x81cad9||0x1f4;return function(_0x34ff30){logger[_0xa7c1('0x25')](_0x34ff30[_0xa7c1('0x26')]);if(_0x34ff30[_0xa7c1('0x27')]){delete _0x34ff30['name'];}_0x2a1144[_0xa7c1('0x17')](_0x81cad9)[_0xa7c1('0x28')](_0x34ff30);};}exports[_0xa7c1('0x29')]=function(_0x4625e3,_0x17231f){var _0x25ae69={},_0x2ee5ec={},_0x25b1df={'count':0x0,'rows':[]};return db[_0xa7c1('0x2a')][_0xa7c1('0x2b')]()[_0xa7c1('0x20')](function(_0x23aeef){_0x2ee5ec[_0xa7c1('0x2c')]=_[_0xa7c1('0x2d')](_0x23aeef);_0x2ee5ec[_0xa7c1('0x2e')]=_['keys'](_0x4625e3['query']);_0x2ee5ec[_0xa7c1('0x2f')]=_['intersection'](_0x2ee5ec['model'],_0x2ee5ec[_0xa7c1('0x2e')]);_0x25ae69[_0xa7c1('0x30')]=_['intersection'](_0x2ee5ec[_0xa7c1('0x2c')],qs[_0xa7c1('0x31')](_0x4625e3['query']['fields']));_0x25ae69[_0xa7c1('0x30')]=_0x25ae69[_0xa7c1('0x30')][_0xa7c1('0x32')]?_0x25ae69[_0xa7c1('0x30')]:_0x2ee5ec[_0xa7c1('0x2c')];if(!_0x4625e3[_0xa7c1('0x2e')]['hasOwnProperty']('nolimit')){_0x25ae69[_0xa7c1('0x1c')]=qs[_0xa7c1('0x1c')](_0x4625e3[_0xa7c1('0x2e')][_0xa7c1('0x1c')]);_0x25ae69['offset']=qs[_0xa7c1('0x1b')](_0x4625e3[_0xa7c1('0x2e')]['offset']);}_0x25ae69[_0xa7c1('0x33')]=qs[_0xa7c1('0x34')](_0x4625e3['query'][_0xa7c1('0x34')]);_0x25ae69[_0xa7c1('0x35')]=qs[_0xa7c1('0x2f')](_[_0xa7c1('0x36')](_0x4625e3[_0xa7c1('0x2e')],_0x2ee5ec[_0xa7c1('0x2f')]),_0x23aeef);if(_0x4625e3[_0xa7c1('0x2e')][_0xa7c1('0x37')]){_0x25ae69[_0xa7c1('0x35')]=_[_0xa7c1('0x38')](_0x25ae69[_0xa7c1('0x35')],{'$or':_[_0xa7c1('0x39')](_0x25ae69[_0xa7c1('0x30')],function(_0x5824fe){var _0x5ef88b={};_0x5ef88b[_0x5824fe]={'$like':'%'+_0x4625e3[_0xa7c1('0x2e')]['filter']+'%'};return _0x5ef88b;})});}_0x25ae69=_[_0xa7c1('0x38')]({},_0x25ae69,_0x4625e3['options']);var _0x45b9b2={'where':_0x25ae69['where']};return db[_0xa7c1('0x2a')][_0xa7c1('0x1a')](_0x45b9b2)[_0xa7c1('0x20')](function(_0x3668b1){_0x25b1df[_0xa7c1('0x1a')]=_0x3668b1;if(_0x4625e3['query']['includeAll']){_0x25ae69['include']=[{'all':!![]}];}return db[_0xa7c1('0x2a')][_0xa7c1('0x3a')](_0x25ae69);})[_0xa7c1('0x20')](function(_0x37d590){_0x25b1df[_0xa7c1('0x3b')]=_0x37d590;return _0x25b1df;})['then'](respondWithFilteredResult(_0x17231f,_0x25ae69))[_0xa7c1('0x3c')](handleError(_0x17231f,null));})['catch'](handleError(_0x17231f,null));};exports['show']=function(_0xb7894b,_0x5a7836){var _0x5e9165={'raw':![],'where':{'id':_0xb7894b[_0xa7c1('0x3d')]['id']}},_0x24e6b4={};_0x24e6b4[_0xa7c1('0x2c')]=_[_0xa7c1('0x2d')](db[_0xa7c1('0x2a')]['rawAttributes']);_0x24e6b4[_0xa7c1('0x2e')]=_['keys'](_0xb7894b[_0xa7c1('0x2e')]);_0x24e6b4[_0xa7c1('0x2f')]=_[_0xa7c1('0x3e')](_0x24e6b4[_0xa7c1('0x2c')],_0x24e6b4[_0xa7c1('0x2e')]);_0x5e9165[_0xa7c1('0x30')]=_[_0xa7c1('0x3e')](_0x24e6b4[_0xa7c1('0x2c')],qs['fields'](_0xb7894b[_0xa7c1('0x2e')][_0xa7c1('0x31')]));_0x5e9165[_0xa7c1('0x30')]=_0x5e9165['attributes']['length']?_0x5e9165[_0xa7c1('0x30')]:_0x24e6b4[_0xa7c1('0x2c')];if(_0xb7894b[_0xa7c1('0x2e')][_0xa7c1('0x3f')]){_0x5e9165['include']=[{'all':!![]}];}_0x5e9165=_[_0xa7c1('0x38')]({},_0x5e9165,_0xb7894b[_0xa7c1('0x40')]);return db['CmCompany']['find'](_0x5e9165)['then'](handleEntityNotFound(_0x5a7836,null))[_0xa7c1('0x20')](respondWithResult(_0x5a7836,null))[_0xa7c1('0x3c')](handleError(_0x5a7836,null));};exports[_0xa7c1('0x41')]=function(_0x3f22a6,_0x54dc27){return db[_0xa7c1('0x2a')][_0xa7c1('0x41')](_0x3f22a6[_0xa7c1('0x42')],{})[_0xa7c1('0x20')](function(_0x5dd574){var _0x5f4d49=_0x3f22a6['user'][_0xa7c1('0x22')]({'plain':!![]});if(!_0x5f4d49)throw new Error(_0xa7c1('0x43'));if(_0x5f4d49[_0xa7c1('0x44')]==='user'){var _0x48fa5b=_0x5dd574[_0xa7c1('0x22')]({'plain':!![]});var _0x2eadb0=_0xa7c1('0x23');return db[_0xa7c1('0x45')]['find']({'where':{'name':_0x2eadb0,'userProfileId':_0x5f4d49[_0xa7c1('0x46')]},'raw':!![]})[_0xa7c1('0x20')](function(_0x4e36dd){if(_0x4e36dd&&_0x4e36dd[_0xa7c1('0x47')]===0x0){return db['UserProfileResource'][_0xa7c1('0x41')]({'name':_0x48fa5b[_0xa7c1('0x27')],'resourceId':_0x48fa5b['id'],'type':_0x4e36dd[_0xa7c1('0x27')],'sectionId':_0x4e36dd['id']},{})[_0xa7c1('0x20')](function(){return _0x5dd574;});}else{return _0x5dd574;}})['catch'](function(_0xc5bb74){logger[_0xa7c1('0x25')](_0xa7c1('0x48'),_0xc5bb74);throw _0xc5bb74;});}return _0x5dd574;})[_0xa7c1('0x20')](respondWithResult(_0x54dc27,0xc9))['catch'](handleError(_0x54dc27,null));};exports[_0xa7c1('0x1f')]=function(_0x2cf46b,_0x1fafbd){if(_0x2cf46b['body']['id']){delete _0x2cf46b[_0xa7c1('0x42')]['id'];}return db[_0xa7c1('0x2a')]['find']({'where':{'id':_0x2cf46b[_0xa7c1('0x3d')]['id']}})[_0xa7c1('0x20')](handleEntityNotFound(_0x1fafbd,null))[_0xa7c1('0x20')](saveUpdates(_0x2cf46b[_0xa7c1('0x42')],null))[_0xa7c1('0x20')](respondWithResult(_0x1fafbd,null))['catch'](handleError(_0x1fafbd,null));};exports[_0xa7c1('0x21')]=function(_0x59b2c3,_0x2958f6){return db['CmCompany']['find']({'where':{'id':_0x59b2c3[_0xa7c1('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2958f6,null))[_0xa7c1('0x20')](removeEntity(_0x2958f6,null))[_0xa7c1('0x3c')](handleError(_0x2958f6,null));};exports['describe']=function(_0x57f9e5,_0x135665){return db[_0xa7c1('0x2a')][_0xa7c1('0x2b')]()[_0xa7c1('0x20')](respondWithResult(_0x135665,null))[_0xa7c1('0x3c')](handleError(_0x135665,null));};exports[_0xa7c1('0x49')]=function(_0x56ad20,_0x4666f0,_0x766070){return db['CmContact'][_0xa7c1('0x4a')]({'where':{'id':_0x56ad20[_0xa7c1('0x3d')]['id']}})[_0xa7c1('0x20')](handleEntityNotFound(_0x4666f0,null))[_0xa7c1('0x20')](function(_0x26ee8c){if(_0x26ee8c){return _0x26ee8c[_0xa7c1('0x49')](_0x56ad20[_0xa7c1('0x42')][_0xa7c1('0x4b')],_['omit'](_0x56ad20['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x4666f0,null))[_0xa7c1('0x3c')](handleError(_0x4666f0,null));};exports[_0xa7c1('0x4c')]=function(_0x1d7f76,_0x556980,_0x331e61){var _0x38a22a={};var _0x1f7f51={};var _0x4dd65d;var _0x4e220a;return db[_0xa7c1('0x2a')][_0xa7c1('0x4d')]({'where':{'id':_0x1d7f76['params']['id']}})['then'](handleEntityNotFound(_0x556980,null))['then'](function(_0xe2d191){if(_0xe2d191){_0x4dd65d=_0xe2d191;_0x1f7f51[_0xa7c1('0x2c')]=_['keys'](db[_0xa7c1('0x4e')][_0xa7c1('0x4f')]);_0x1f7f51[_0xa7c1('0x2e')]=_['keys'](_0x1d7f76[_0xa7c1('0x2e')]);_0x1f7f51[_0xa7c1('0x2f')]=_[_0xa7c1('0x3e')](_0x1f7f51[_0xa7c1('0x2c')],_0x1f7f51[_0xa7c1('0x2e')]);_0x38a22a[_0xa7c1('0x30')]=_[_0xa7c1('0x3e')](_0x1f7f51['model'],qs[_0xa7c1('0x31')](_0x1d7f76[_0xa7c1('0x2e')][_0xa7c1('0x31')]));_0x38a22a[_0xa7c1('0x30')]=_0x38a22a[_0xa7c1('0x30')][_0xa7c1('0x32')]?_0x38a22a['attributes']:_0x1f7f51[_0xa7c1('0x2c')];_0x38a22a[_0xa7c1('0x33')]=qs[_0xa7c1('0x34')](_0x1d7f76[_0xa7c1('0x2e')][_0xa7c1('0x34')]);_0x38a22a['where']=qs['filters'](_[_0xa7c1('0x36')](_0x1d7f76['query'],_0x1f7f51[_0xa7c1('0x2f')]));if(_0x1d7f76[_0xa7c1('0x2e')][_0xa7c1('0x37')]){_0x38a22a[_0xa7c1('0x35')]=_['merge'](_0x38a22a[_0xa7c1('0x35')],{'$or':_[_0xa7c1('0x39')](_0x38a22a[_0xa7c1('0x30')],function(_0x2d1534){var _0xa23626={};_0xa23626[_0x2d1534]={'$like':'%'+_0x1d7f76['query'][_0xa7c1('0x37')]+'%'};return _0xa23626;})});}_0x38a22a=_['merge']({},_0x38a22a,_0x1d7f76[_0xa7c1('0x40')]);return _0x4dd65d[_0xa7c1('0x4c')](_0x38a22a);}})[_0xa7c1('0x20')](function(_0x591c3b){if(_0x591c3b){_0x4e220a=_0x591c3b['length'];if(!_0x1d7f76[_0xa7c1('0x2e')][_0xa7c1('0x50')]('nolimit')){_0x38a22a[_0xa7c1('0x1c')]=qs[_0xa7c1('0x1c')](_0x1d7f76['query']['limit']);_0x38a22a['offset']=qs[_0xa7c1('0x1b')](_0x1d7f76[_0xa7c1('0x2e')][_0xa7c1('0x1b')]);}return _0x4dd65d[_0xa7c1('0x4c')](_0x38a22a);}})['then'](function(_0x25bc3f){if(_0x25bc3f){return _0x25bc3f?{'count':_0x4e220a,'rows':_0x25bc3f}:null;}})[_0xa7c1('0x20')](respondWithResult(_0x556980,null))[_0xa7c1('0x3c')](handleError(_0x556980,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index eef0f62..8f65a64 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 _0xf75d=['exports','define','CmCompany','api','moment','path','rimraf','../../config/environment','./cmCompany.attributes'];(function(_0x4604fb,_0x16b1ae){var _0x45b5f1=function(_0x490d8e){while(--_0x490d8e){_0x4604fb['push'](_0x4604fb['shift']());}};_0x45b5f1(++_0x16b1ae);}(_0xf75d,0x1e9));var _0xdf75=function(_0xa92146,_0x57b211){_0xa92146=_0xa92146-0x0;var _0x4687b9=_0xf75d[_0xa92146];return _0x4687b9;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xdf75('0x0'));var moment=require(_0xdf75('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf75('0x2'));var rimraf=require(_0xdf75('0x3'));var config=require(_0xdf75('0x4'));var attributes=require(_0xdf75('0x5'));module[_0xdf75('0x6')]=function(_0x24cbd1,_0x504a42){return _0x24cbd1[_0xdf75('0x7')](_0xdf75('0x8'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa620=['../../config/environment','./cmCompany.attributes','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x449098,_0x351ae){var _0x3e0f53=function(_0x3af21c){while(--_0x3af21c){_0x449098['push'](_0x449098['shift']());}};_0x3e0f53(++_0x351ae);}(_0xa620,0x13d));var _0x0a62=function(_0x152136,_0x4f14f1){_0x152136=_0x152136-0x0;var _0x20df44=_0xa620[_0x152136];return _0x20df44;};'use strict';var _=require(_0x0a62('0x0'));var util=require(_0x0a62('0x1'));var logger=require(_0x0a62('0x2'))(_0x0a62('0x3'));var moment=require('moment');var BPromise=require(_0x0a62('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a62('0x5'));var rimraf=require(_0x0a62('0x6'));var config=require(_0x0a62('0x7'));var attributes=require(_0x0a62('0x8'));module['exports']=function(_0x10e88d,_0x5dcf30){return _0x10e88d['define']('CmCompany',attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index 8657b97..b5abacf 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 _0x29fc=['info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then'];(function(_0x4b5075,_0xee1fb9){var _0x234617=function(_0x39aef7){while(--_0x39aef7){_0x4b5075['push'](_0x4b5075['shift']());}};_0x234617(++_0xee1fb9);}(_0x29fc,0x8d));var _0xc29f=function(_0x316628,_0x31e805){_0x316628=_0x316628-0x0;var _0x4bdf91=_0x29fc[_0x316628];return _0x4bdf91;};'use strict';var _=require(_0xc29f('0x0'));var util=require(_0xc29f('0x1'));var moment=require(_0xc29f('0x2'));var BPromise=require(_0xc29f('0x3'));var rs=require(_0xc29f('0x4'));var fs=require('fs');var Redis=require(_0xc29f('0x5'));var db=require(_0xc29f('0x6'))['db'];var utils=require(_0xc29f('0x7'));var logger=require(_0xc29f('0x8'))(_0xc29f('0x9'));var config=require(_0xc29f('0xa'));var jayson=require(_0xc29f('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x41cae7,_0x4d0ca9,_0x19bff2){return new BPromise(function(_0x221780,_0x1d02e7){return client['request'](_0x41cae7,_0x19bff2)[_0xc29f('0xc')](function(_0x2b3ce9){logger[_0xc29f('0xd')](_0xc29f('0xe'),_0x4d0ca9,_0xc29f('0xf'));logger[_0xc29f('0x10')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x4d0ca9,'request\x20sent',JSON[_0xc29f('0x11')](_0x2b3ce9));if(_0x2b3ce9[_0xc29f('0x12')]){if(_0x2b3ce9['error'][_0xc29f('0x13')]===0x1f4){logger[_0xc29f('0x12')](_0xc29f('0xe'),_0x4d0ca9,_0x2b3ce9[_0xc29f('0x12')][_0xc29f('0x14')]);return _0x1d02e7(_0x2b3ce9[_0xc29f('0x12')][_0xc29f('0x14')]);}logger[_0xc29f('0x12')](_0xc29f('0xe'),_0x4d0ca9,_0x2b3ce9['error'][_0xc29f('0x14')]);return _0x221780(_0x2b3ce9['error']['message']);}else{logger[_0xc29f('0xd')](_0xc29f('0xe'),_0x4d0ca9,'request\x20sent');_0x221780(_0x2b3ce9[_0xc29f('0x15')][_0xc29f('0x14')]);}})['catch'](function(_0x39891f){logger[_0xc29f('0x12')](_0xc29f('0xe'),_0x4d0ca9,_0x39891f);_0x1d02e7(_0x39891f);});});}
\ No newline at end of file
+var _0x881f=['message','request\x20sent','result','catch','lodash','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s'];(function(_0x17d713,_0x19b690){var _0x452666=function(_0xaff2b4){while(--_0xaff2b4){_0x17d713['push'](_0x17d713['shift']());}};_0x452666(++_0x19b690);}(_0x881f,0xf4));var _0xf881=function(_0x174017,_0x528052){_0x174017=_0x174017-0x0;var _0x4097b1=_0x881f[_0x174017];return _0x4097b1;};'use strict';var _=require(_0xf881('0x0'));var util=require('util');var moment=require(_0xf881('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf881('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xf881('0x3'));var logger=require(_0xf881('0x4'))(_0xf881('0x5'));var config=require(_0xf881('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf881('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1eb6d3,_0x3b175d,_0x2a0273){return new BPromise(function(_0x346456,_0x4a8cd4){return client[_0xf881('0x8')](_0x1eb6d3,_0x2a0273)['then'](function(_0x2d20cb){logger[_0xf881('0x9')]('CmCompany,\x20%s,\x20%s',_0x3b175d,'request\x20sent');logger[_0xf881('0xa')](_0xf881('0xb'),_0x3b175d,'request\x20sent',JSON[_0xf881('0xc')](_0x2d20cb));if(_0x2d20cb[_0xf881('0xd')]){if(_0x2d20cb[_0xf881('0xd')][_0xf881('0xe')]===0x1f4){logger[_0xf881('0xd')](_0xf881('0xf'),_0x3b175d,_0x2d20cb['error'][_0xf881('0x10')]);return _0x4a8cd4(_0x2d20cb[_0xf881('0xd')][_0xf881('0x10')]);}logger[_0xf881('0xd')](_0xf881('0xf'),_0x3b175d,_0x2d20cb[_0xf881('0xd')]['message']);return _0x346456(_0x2d20cb[_0xf881('0xd')][_0xf881('0x10')]);}else{logger['info'](_0xf881('0xf'),_0x3b175d,_0xf881('0x11'));_0x346456(_0x2d20cb[_0xf881('0x12')][_0xf881('0x10')]);}})[_0xf881('0x13')](function(_0x5601cb){logger['error'](_0xf881('0xf'),_0x3b175d,_0x5601cb);_0x4a8cd4(_0x5601cb);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index c6c9a7a..55e1d57 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 _0x53a8=['isAuthenticated','index','/:id','/:id/contacts','getContacts','post','create','addContacts','put','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get'];(function(_0x4d4e7c,_0x1a8689){var _0x408125=function(_0x4db103){while(--_0x4db103){_0x4d4e7c['push'](_0x4d4e7c['shift']());}};_0x408125(++_0x1a8689);}(_0x53a8,0x11c));var _0x853a=function(_0x38c5d7,_0x45ab69){_0x38c5d7=_0x38c5d7-0x0;var _0x23750e=_0x53a8[_0x38c5d7];return _0x23750e;};'use strict';var multer=require(_0x853a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x853a('0x1'));var express=require(_0x853a('0x2'));var router=express[_0x853a('0x3')]();var fs_extra=require(_0x853a('0x4'));var auth=require(_0x853a('0x5'));var interaction=require(_0x853a('0x6'));var config=require(_0x853a('0x7'));var controller=require(_0x853a('0x8'));router[_0x853a('0x9')]('/',auth[_0x853a('0xa')](),controller[_0x853a('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x853a('0x9')](_0x853a('0xc'),auth[_0x853a('0xa')](),controller['show']);router['get'](_0x853a('0xd'),auth[_0x853a('0xa')](),controller[_0x853a('0xe')]);router[_0x853a('0xf')]('/',auth[_0x853a('0xa')](),controller[_0x853a('0x10')]);router[_0x853a('0xf')](_0x853a('0xd'),auth['isAuthenticated'](),controller[_0x853a('0x11')]);router[_0x853a('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x853a('0xa')](),controller[_0x853a('0x13')]);module[_0x853a('0x14')]=router;
\ No newline at end of file
+var _0xa5b0=['post','create','/:id/contacts','put','update','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id','show','getContacts'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xa5b0,0x1bf));var _0x0a5b=function(_0x350aeb,_0x3d265a){_0x350aeb=_0x350aeb-0x0;var _0x3c5273=_0xa5b0[_0x350aeb];return _0x3c5273;};'use strict';var multer=require(_0x0a5b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0a5b('0x1'));var express=require(_0x0a5b('0x2'));var router=express[_0x0a5b('0x3')]();var fs_extra=require(_0x0a5b('0x4'));var auth=require(_0x0a5b('0x5'));var interaction=require(_0x0a5b('0x6'));var config=require('../../config/environment');var controller=require('./cmCompany.controller');router['get']('/',auth[_0x0a5b('0x7')](),controller[_0x0a5b('0x8')]);router[_0x0a5b('0x9')](_0x0a5b('0xa'),auth[_0x0a5b('0x7')](),controller[_0x0a5b('0xb')]);router[_0x0a5b('0x9')](_0x0a5b('0xc'),auth[_0x0a5b('0x7')](),controller[_0x0a5b('0xd')]);router[_0x0a5b('0x9')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x0a5b('0xe')]);router[_0x0a5b('0xf')]('/',auth[_0x0a5b('0x7')](),controller[_0x0a5b('0x10')]);router['post'](_0x0a5b('0x11'),auth['isAuthenticated'](),controller['addContacts']);router[_0x0a5b('0x12')](_0x0a5b('0xc'),auth[_0x0a5b('0x7')](),controller[_0x0a5b('0x13')]);router['delete']('/:id',auth[_0x0a5b('0x7')](),controller[_0x0a5b('0x14')]);module[_0x0a5b('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 e607916..26d86fd 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 _0x5a06=['STRING','TEXT','INTEGER','lodash','exports'];(function(_0x11da31,_0x5d576f){var _0x6bb4c8=function(_0x1680a3){while(--_0x1680a3){_0x11da31['push'](_0x11da31['shift']());}};_0x6bb4c8(++_0x5d576f);}(_0x5a06,0x1c5));var _0x65a0=function(_0x26a62b,_0x4ce537){_0x26a62b=_0x26a62b-0x0;var _0x213992=_0x5a06[_0x26a62b];return _0x213992;};'use strict';var _=require(_0x65a0('0x0'));var Sequelize=require('sequelize');module[_0x65a0('0x1')]={'firstName':{'type':Sequelize[_0x65a0('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x65a0('0x2')]},'city':{'type':Sequelize[_0x65a0('0x2')]},'country':{'type':Sequelize[_0x65a0('0x2')]},'dateOfBirth':{'type':Sequelize[_0x65a0('0x2')]},'description':{'type':Sequelize[_0x65a0('0x3')]},'phone':{'type':Sequelize[_0x65a0('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x65a0('0x2')]},'fb_data':{'type':Sequelize[_0x65a0('0x2')]},'twitter':{'type':Sequelize[_0x65a0('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x65a0('0x2')]},'viber':{'type':Sequelize[_0x65a0('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x65a0('0x2')]},'telegram':{'type':Sequelize[_0x65a0('0x2')]},'UserId':{'type':Sequelize[_0x65a0('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x65a0('0x2')]},'priority':{'type':Sequelize[_0x65a0('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x65a0('0x2')]},'utcOffset':{'type':Sequelize[_0x65a0('0x4')]}};
\ No newline at end of file
+var _0x09ca=['INTEGER','DATE','NOW','sequelize','STRING','TEXT'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x09ca,0xe7));var _0xa09c=function(_0x1f43ec,_0x593858){_0x1f43ec=_0x1f43ec-0x0;var _0x2e5c05=_0x09ca[_0x1f43ec];return _0x2e5c05;};'use strict';var _=require('lodash');var Sequelize=require(_0xa09c('0x0'));module['exports']={'firstName':{'type':Sequelize[_0xa09c('0x1')],'allowNull':![]},'lastName':{'type':Sequelize[_0xa09c('0x1')]},'street':{'type':Sequelize[_0xa09c('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xa09c('0x1')]},'country':{'type':Sequelize[_0xa09c('0x1')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa09c('0x2')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xa09c('0x1')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xa09c('0x1')]},'url':{'type':Sequelize[_0xa09c('0x1')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xa09c('0x1')]},'twitter':{'type':Sequelize[_0xa09c('0x1')]},'skype':{'type':Sequelize[_0xa09c('0x1')]},'teams':{'type':Sequelize[_0xa09c('0x1')]},'viber':{'type':Sequelize[_0xa09c('0x1')]},'line':{'type':Sequelize[_0xa09c('0x1')]},'wechat':{'type':Sequelize[_0xa09c('0x1')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xa09c('0x3')]},'AdditionalPhones':{'type':Sequelize[_0xa09c('0x1')]},'priority':{'type':Sequelize[_0xa09c('0x3')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xa09c('0x4')],'defaultValue':Sequelize[_0xa09c('0x5')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0xa09c('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 9f166d5..5dced77 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 _0x710e=['sequelize','literal','$and','map','omit','pickBy','format','cf_%d','isEmpty','table','id\x20=\x20?','toParam','text','phone','getTags','findOne','model','filters','intersection','attributes','fields','order','sort','filter','options','nolimit','setTags','ids','setAdditionalPhones','CmContactHasItem','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','ItemType','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','getHoppers','rawAttributes','pick','ContactId','include','rows','getHopperHistories','includeAll','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','split','zipObject','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','root','server/files/tmp','chmodSync','0777','fork','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','file','meta','User','agent','binding','firstName','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','importUpdates','child_process','../../components/import/cm/csvUpdates','exit','error\x20child\x20process','getJourney','chat','openchannel','fax','whatsapp','voice','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','source','destination','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','UserId','fullname','Website','Account','closedAt','secondDisposition','thirdDisposition','key','Tags','DESC','browserName','customerIp','customerPort','deviceModel','osName','ratingType','ratingValue','referer','substatus','externalUrl','threadId','startCase','Owner','sortBy','reverse','value','slice','moment','bluebird','path','lodash','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','json','offset','undefined','limit','count','set','Content-Range','then','status','end','sendStatus','error','name','send','describe','getOptions','findAll','query','user','destroy','CmContact','find','params','catch','tags','length','keys','startsWith','cf_','columnName','displayName','analytics','CmCustomField','alias','custom','type','values','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body','from','get','mergeWith','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','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','isNil','dialTimezone','utcOffset','timezones','additionalPhones','bulkCreate','each','duplicates','where','$or','push','ListId','spread','contact','all','show','Tag','color','tag','ContactItemType'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x710e,0x93));var _0xe710=function(_0x562315,_0x48ace2){_0x562315=_0x562315-0x0;var _0x48ed27=_0x710e[_0x562315];return _0x48ed27;};'use strict';var moment=require(_0xe710('0x0'));var BPromise=require(_0xe710('0x1'));var util=require('util');var path=require(_0xe710('0x2'));var fs=require('fs');var _=require(_0xe710('0x3'));var squel=require(_0xe710('0x4'));var Papa=require('papaparse');var Redis=require(_0xe710('0x5'));var contacts=require(_0xe710('0x6'));var qs=require(_0xe710('0x7'));var logger=require('../../config/logger')('api');var config=require(_0xe710('0x8'));var shared=require(_0xe710('0x9'));var db=require(_0xe710('0xa'))['db'];config[_0xe710('0xb')]=_[_0xe710('0xc')](config[_0xe710('0xb')],{'host':_0xe710('0xd'),'port':0x18eb});var socket=require(_0xe710('0xe'))(new Redis(config[_0xe710('0xb')]));require(_0xe710('0xf'))[_0xe710('0x10')](socket);function respondWithResult(_0x3c807d,_0x51c0bd){_0x51c0bd=_0x51c0bd||0xc8;return function(_0x28d19d){if(_0x28d19d){return _0x3c807d['status'](_0x51c0bd)[_0xe710('0x11')](_0x28d19d);}};}function respondWithFilteredResult(_0x22de24,_0x1ea3ef){return function(_0x328d3b){if(_0x328d3b){var _0xb8a1a3=typeof _0x1ea3ef[_0xe710('0x12')]===_0xe710('0x13')&&typeof _0x1ea3ef[_0xe710('0x14')]===_0xe710('0x13');var _0x2dca1c=_0x328d3b[_0xe710('0x15')];var _0x238130=_0xb8a1a3?0x0:_0x1ea3ef['offset'];var _0x330b5e=_0xb8a1a3?_0x328d3b[_0xe710('0x15')]:_0x1ea3ef[_0xe710('0x12')]+_0x1ea3ef[_0xe710('0x14')];var _0x349169;if(_0x330b5e>=_0x2dca1c){_0x330b5e=_0x2dca1c;_0x349169=0xc8;}else{_0x349169=0xce;}_0x22de24['status'](_0x349169);return _0x22de24[_0xe710('0x16')](_0xe710('0x17'),_0x238130+'-'+_0x330b5e+'/'+_0x2dca1c)[_0xe710('0x11')](_0x328d3b);}return null;};}function saveUpdates(_0x844aa0){return function(_0x1ff0be){if(_0x1ff0be){return _0x1ff0be['update'](_0x844aa0)[_0xe710('0x18')](function(_0x7444c4){return _0x7444c4;});}return null;};}function removeEntity(_0x40af5b){return function(_0x18df73){if(_0x18df73){return _0x18df73['destroy']()[_0xe710('0x18')](function(){_0x40af5b[_0xe710('0x19')](0xcc)[_0xe710('0x1a')]();});}};}function handleEntityNotFound(_0x5413c2){return function(_0x59d413){if(!_0x59d413){_0x5413c2[_0xe710('0x1b')](0x194);}return _0x59d413;};}function handleError(_0x2941b6,_0x3a1cfc){_0x3a1cfc=_0x3a1cfc||0x1f4;return function(_0x17cb16){logger[_0xe710('0x1c')](_0x17cb16['stack']);if(_0x17cb16[_0xe710('0x1d')]){delete _0x17cb16[_0xe710('0x1d')];}_0x2941b6[_0xe710('0x19')](_0x3a1cfc)[_0xe710('0x1e')](_0x17cb16);};}exports['index']=function(_0x965304,_0x280668){var _0x32d35e={};return contacts[_0xe710('0x1f')]()[_0xe710('0x18')](function(_0x4bf8e5){_0x32d35e=qs[_0xe710('0x20')](_0x4bf8e5,_0x965304);return contacts[_0xe710('0x21')](_0x965304[_0xe710('0x22')],_0x965304[_0xe710('0x23')],_0x32d35e,_0x4bf8e5);})['then'](respondWithFilteredResult(_0x280668,_0x32d35e))['catch'](handleError(_0x280668,null));};exports[_0xe710('0x24')]=function(_0x4b75a4,_0x310ea5){return db[_0xe710('0x25')][_0xe710('0x26')]({'where':{'id':_0x4b75a4[_0xe710('0x27')]['id']}})[_0xe710('0x18')](handleEntityNotFound(_0x310ea5,null))['then'](removeEntity(_0x310ea5,null))[_0xe710('0x28')](handleError(_0x310ea5,null));};exports[_0xe710('0x1f')]=function(_0x276ba1,_0x275611){return db[_0xe710('0x25')][_0xe710('0x1f')]()[_0xe710('0x18')](function(_0x3d66d5){delete _0x3d66d5[_0xe710('0x29')];for(var _0x461b87=0x0;_0x461b87
','generateXOAuth2Token','auth=Bearer\x20','utf-8','base64','lodash','moment','randomstring','path','util','node-tnef','email','../../../config/environment','value','address','anonymous','@xcally.com','head','name','substring','indexOf','split','length','join','Anonymous','pop','isEmpty','generate','html','replace','includes'];(function(_0x3d81e7,_0xc5b4c0){var _0x21bd16=function(_0x786c39){while(--_0x786c39){_0x3d81e7['push'](_0x3d81e7['shift']());}};_0x21bd16(++_0xc5b4c0);}(_0x730c,0x106));var _0xc730=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x730c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc730('0x0'));var moment=require(_0xc730('0x1'));var random=require(_0xc730('0x2'));var fs=require('fs');var path=require(_0xc730('0x3'));var util=require(_0xc730('0x4'));var tnef=require(_0xc730('0x5'));var logger=require('../../../config/logger')(_0xc730('0x6'));var config=require(_0xc730('0x7'));function getAddress(_0x6b2ba){var _0x3346df=_['head'](_0x6b2ba[_0xc730('0x8')]);return _0x3346df&&_0x3346df['address']?_0x3346df[_0xc730('0x9')]:_0xc730('0xa')+random['generate'](0x6)+_0xc730('0xb');}function getFirstName(_0x47a39a){var _0x58a50e=_[_0xc730('0xc')](_0x47a39a[_0xc730('0x8')]);if(_0x58a50e&&_0x58a50e[_0xc730('0xd')]){if(_0x58a50e[_0xc730('0xd')]==_0x58a50e[_0xc730('0x9')]){return _0x58a50e[_0xc730('0xd')][_0xc730('0xe')](0x0,_0x58a50e[_0xc730('0xd')][_0xc730('0xf')]('@'));}var _0x1d366f=_0x58a50e[_0xc730('0xd')][_0xc730('0x10')](/\s+/);return _0x1d366f[_0xc730('0x11')]>0x1?_0x1d366f['slice'](0x0,-0x1)[_0xc730('0x12')]('\x20'):_0x58a50e[_0xc730('0xd')];}return _0xc730('0x13');}function getLastName(_0x1d8eb5){var _0x1a7b91=_[_0xc730('0xc')](_0x1d8eb5[_0xc730('0x8')]);if(_0x1a7b91&&_0x1a7b91[_0xc730('0xd')]){var _0x1b13e5=_0x1a7b91[_0xc730('0xd')][_0xc730('0x10')](/\s+/);return _0x1b13e5[_0xc730('0x11')]>0x1?_0x1b13e5[_0xc730('0x14')]():'';}return'';}function getMails(_0x2e8bd2,_0x1360cc){var _0x4592d5='';for(var _0x6eab4b=0x0;_0x6eab4b<_0x1360cc['value'][_0xc730('0x11')];_0x6eab4b+=0x1){if(_0x1360cc[_0xc730('0x8')][_0x6eab4b]['address']!==_0x2e8bd2){if(!_[_0xc730('0x15')](_0x4592d5)){_0x4592d5+=',';}_0x4592d5+=_0x1360cc['value'][_0x6eab4b][_0xc730('0xd')]||_0x1360cc[_0xc730('0x8')][_0x6eab4b]['address']||'';_0x4592d5+='\x20<';_0x4592d5+=_0x1360cc['value'][_0x6eab4b][_0xc730('0x9')]?_0x1360cc[_0xc730('0x8')][_0x6eab4b][_0xc730('0x9')]:_0xc730('0xa')+random[_0xc730('0x16')](0x6)+'@xcally.com';_0x4592d5+='>';}}return _0x4592d5;}function parseEmail(_0x2968e0,_0x589e8f,_0x33d9b9){if(_0x589e8f[_0xc730('0x17')]){var _0x2ebb3f=/