From 6af6663fd2335231df18a38f4bad066443cfb6f1 Mon Sep 17 00:00:00 2001
From: support
Date: Thu, 14 Apr 2022 09:25:51 +0000
Subject: [PATCH] Built motion from commit 4d5ba482.|2.6.8
---
apidoc/api_project.js | 2 +-
apidoc/api_project.json | 2 +-
server/api/action/action.attributes.js | 2 +-
server/api/action/action.controller.js | 2 +-
server/api/action/action.model.js | 2 +-
server/api/action/action.rpc.js | 2 +-
server/api/action/index.js | 2 +-
.../analyticCustomReport.attributes.js | 2 +-
.../analyticCustomReport.controller.js | 2 +-
.../analyticCustomReport.model.js | 2 +-
.../analyticCustomReport.rpc.js | 2 +-
server/api/analyticCustomReport/index.js | 2 +-
.../analyticDefaultReport.attributes.js | 2 +-
.../analyticDefaultReport.controller.js | 2 +-
.../analyticDefaultReport.model.js | 2 +-
.../analyticDefaultReport.rpc.js | 2 +-
server/api/analyticDefaultReport/index.js | 2 +-
.../analyticExtractedReport.attributes.js | 2 +-
.../analyticExtractedReport.controller.js | 2 +-
.../analyticExtractedReport.model.js | 2 +-
.../analyticExtractedReport.rpc.js | 2 +-
server/api/analyticExtractedReport/index.js | 2 +-
.../analyticFieldReport.attributes.js | 2 +-
.../analyticFieldReport.controller.js | 2 +-
.../analyticFieldReport.model.js | 2 +-
.../analyticFieldReport/analyticFieldReport.rpc.js | 2 +-
server/api/analyticFieldReport/index.js | 2 +-
.../analyticMetric/analyticMetric.attributes.js | 2 +-
.../analyticMetric/analyticMetric.controller.js | 2 +-
server/api/analyticMetric/analyticMetric.model.js | 2 +-
server/api/analyticMetric/analyticMetric.rpc.js | 2 +-
server/api/analyticMetric/index.js | 2 +-
.../analyticTreeReport.attributes.js | 2 +-
.../analyticTreeReport.controller.js | 2 +-
.../analyticTreeReport/analyticTreeReport.model.js | 2 +-
.../analyticTreeReport/analyticTreeReport.rpc.js | 2 +-
server/api/analyticTreeReport/index.js | 2 +-
server/api/attachment/attachment.attributes.js | 2 +-
server/api/attachment/attachment.controller.js | 2 +-
server/api/attachment/attachment.model.js | 2 +-
server/api/attachment/attachment.rpc.js | 2 +-
server/api/attachment/index.js | 2 +-
.../authActiveDirectory.controller.js | 2 +-
server/api/authActiveDirectory/index.js | 2 +-
server/api/authGoogle/authGoogle.controller.js | 2 +-
server/api/authGoogle/index.js | 2 +-
server/api/authLocal/authLocal.controller.js | 2 +-
server/api/authLocal/index.js | 2 +-
server/api/automation/automation.attributes.js | 2 +-
server/api/automation/automation.controller.js | 2 +-
server/api/automation/automation.model.js | 2 +-
server/api/automation/automation.rpc.js | 2 +-
server/api/automation/index.js | 2 +-
server/api/campaign/campaign.attributes.js | 2 +-
server/api/campaign/campaign.controller.js | 2 +-
server/api/campaign/campaign.model.js | 2 +-
server/api/campaign/campaign.rpc.js | 2 +-
server/api/campaign/index.js | 2 +-
server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +-
server/api/cannedAnswer/cannedAnswer.controller.js | 2 +-
server/api/cannedAnswer/cannedAnswer.model.js | 2 +-
server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +-
server/api/cannedAnswer/index.js | 2 +-
server/api/cdr/cdr.attributes.js | 2 +-
server/api/cdr/cdr.controller.js | 2 +-
server/api/cdr/cdr.model.js | 2 +-
server/api/cdr/cdr.rpc.js | 2 +-
server/api/cdr/index.js | 2 +-
.../chatApplication/chatApplication.attributes.js | 2 +-
.../chatApplication/chatApplication.controller.js | 2 +-
.../api/chatApplication/chatApplication.model.js | 2 +-
server/api/chatApplication/chatApplication.rpc.js | 2 +-
server/api/chatApplication/index.js | 2 +-
server/api/chatGroup/chatGroup.attributes.js | 2 +-
server/api/chatGroup/chatGroup.controller.js | 2 +-
server/api/chatGroup/chatGroup.events.js | 2 +-
server/api/chatGroup/chatGroup.model.js | 2 +-
server/api/chatGroup/chatGroup.rpc.js | 2 +-
server/api/chatGroup/chatGroup.socket.js | 2 +-
server/api/chatGroup/index.js | 2 +-
.../chatInteraction/chatInteraction.attributes.js | 2 +-
.../chatInteraction/chatInteraction.controller.js | 2 +-
.../api/chatInteraction/chatInteraction.events.js | 2 +-
.../api/chatInteraction/chatInteraction.model.js | 2 +-
server/api/chatInteraction/chatInteraction.rpc.js | 2 +-
.../api/chatInteraction/chatInteraction.socket.js | 2 +-
server/api/chatInteraction/index.js | 2 +-
.../chatInternalMessage.attributes.js | 2 +-
.../chatInternalMessage.controller.js | 2 +-
.../chatInternalMessage.events.js | 2 +-
.../chatInternalMessage.model.js | 2 +-
.../chatInternalMessage/chatInternalMessage.rpc.js | 2 +-
.../chatInternalMessage.socket.js | 2 +-
server/api/chatInternalMessage/index.js | 2 +-
server/api/chatMessage/chatMessage.attributes.js | 2 +-
server/api/chatMessage/chatMessage.controller.js | 2 +-
server/api/chatMessage/chatMessage.events.js | 2 +-
server/api/chatMessage/chatMessage.model.js | 2 +-
server/api/chatMessage/chatMessage.rpc.js | 2 +-
server/api/chatMessage/chatMessage.socket.js | 2 +-
server/api/chatMessage/index.js | 2 +-
.../chatOfflineMessage.attributes.js | 2 +-
.../chatOfflineMessage.controller.js | 2 +-
.../chatOfflineMessage.events.js | 2 +-
.../chatOfflineMessage/chatOfflineMessage.model.js | 2 +-
.../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +-
server/api/chatOfflineMessage/index.js | 2 +-
.../chatProactiveAction.attributes.js | 2 +-
.../chatProactiveAction.controller.js | 2 +-
.../chatProactiveAction.model.js | 2 +-
.../chatProactiveAction/chatProactiveAction.rpc.js | 2 +-
server/api/chatProactiveAction/index.js | 2 +-
server/api/chatQueue/chatQueue.attributes.js | 2 +-
server/api/chatQueue/chatQueue.controller.js | 2 +-
server/api/chatQueue/chatQueue.events.js | 2 +-
server/api/chatQueue/chatQueue.model.js | 2 +-
server/api/chatQueue/chatQueue.rpc.js | 2 +-
server/api/chatQueue/chatQueue.socket.js | 2 +-
server/api/chatQueue/index.js | 2 +-
.../chatQueueReport/chatQueueReport.attributes.js | 2 +-
.../chatQueueReport/chatQueueReport.controller.js | 2 +-
.../api/chatQueueReport/chatQueueReport.model.js | 2 +-
server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +-
server/api/chatQueueReport/index.js | 2 +-
.../chatTransferReport.attributes.js | 2 +-
.../chatTransferReport.controller.js | 2 +-
.../chatTransferReport/chatTransferReport.model.js | 2 +-
.../chatTransferReport/chatTransferReport.rpc.js | 2 +-
server/api/chatTransferReport/index.js | 2 +-
server/api/chatWebsite/chatWebsite.attributes.js | 2 +-
server/api/chatWebsite/chatWebsite.controller.js | 2 +-
server/api/chatWebsite/chatWebsite.events.js | 2 +-
server/api/chatWebsite/chatWebsite.model.js | 2 +-
server/api/chatWebsite/chatWebsite.rpc.js | 2 +-
server/api/chatWebsite/chatWebsite.socket.js | 2 +-
server/api/chatWebsite/index.js | 2 +-
server/api/client-side-logs.js | 2 +-
.../api/cloudProvider/cloudProvider.attributes.js | 2 +-
.../api/cloudProvider/cloudProvider.controller.js | 2 +-
server/api/cloudProvider/cloudProvider.model.js | 2 +-
server/api/cloudProvider/cloudProvider.oauth.js | 2 +-
server/api/cloudProvider/cloudProvider.rpc.js | 2 +-
server/api/cloudProvider/index.js | 2 +-
server/api/cmCompany/cmCompany.attributes.js | 2 +-
server/api/cmCompany/cmCompany.controller.js | 2 +-
server/api/cmCompany/cmCompany.model.js | 2 +-
server/api/cmCompany/cmCompany.rpc.js | 2 +-
server/api/cmCompany/index.js | 2 +-
server/api/cmContact/cmContact.attributes.js | 2 +-
server/api/cmContact/cmContact.controller.js | 2 +-
server/api/cmContact/cmContact.events.js | 2 +-
server/api/cmContact/cmContact.model.js | 2 +-
server/api/cmContact/cmContact.rpc.js | 2 +-
server/api/cmContact/cmContact.socket.js | 2 +-
server/api/cmContact/index.js | 2 +-
.../cmContactHasItem.attributes.js | 2 +-
.../cmContactHasItem.controller.js | 2 +-
.../api/cmContactHasItem/cmContactHasItem.model.js | 2 +-
.../api/cmContactHasItem/cmContactHasItem.rpc.js | 2 +-
server/api/cmContactHasItem/index.js | 2 +-
.../api/cmCustomField/cmCustomField.attributes.js | 2 +-
.../api/cmCustomField/cmCustomField.controller.js | 2 +-
server/api/cmCustomField/cmCustomField.model.js | 2 +-
server/api/cmCustomField/cmCustomField.rpc.js | 2 +-
server/api/cmCustomField/index.js | 2 +-
server/api/cmHopper/cmHopper.attributes.js | 2 +-
server/api/cmHopper/cmHopper.controller.js | 2 +-
server/api/cmHopper/cmHopper.model.js | 2 +-
server/api/cmHopper/cmHopper.rpc.js | 2 +-
server/api/cmHopper/index.js | 2 +-
.../cmHopperAdditionalPhone.attributes.js | 2 +-
.../cmHopperAdditionalPhone.controller.js | 2 +-
.../cmHopperAdditionalPhone.model.js | 2 +-
.../cmHopperAdditionalPhone.rpc.js | 2 +-
server/api/cmHopperAdditionalPhone/index.js | 2 +-
.../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +-
.../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +-
server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +-
server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +-
server/api/cmHopperBlack/index.js | 2 +-
.../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +-
.../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +-
server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +-
server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +-
server/api/cmHopperFinal/index.js | 2 +-
.../cmHopperHistory/cmHopperHistory.attributes.js | 2 +-
.../cmHopperHistory/cmHopperHistory.controller.js | 2 +-
.../api/cmHopperHistory/cmHopperHistory.model.js | 2 +-
server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +-
server/api/cmHopperHistory/index.js | 2 +-
server/api/cmList/cmList.attributes.js | 2 +-
server/api/cmList/cmList.controller.js | 2 +-
server/api/cmList/cmList.events.js | 2 +-
server/api/cmList/cmList.model.js | 2 +-
server/api/cmList/cmList.rpc.js | 2 +-
server/api/cmList/cmList.socket.js | 2 +-
server/api/cmList/index.js | 2 +-
server/api/condition/condition.attributes.js | 2 +-
server/api/condition/condition.controller.js | 2 +-
server/api/condition/condition.model.js | 2 +-
server/api/condition/condition.rpc.js | 2 +-
server/api/condition/index.js | 2 +-
.../contactItemType/contactItemType.attributes.js | 2 +-
.../contactItemType/contactItemType.controller.js | 2 +-
.../api/contactItemType/contactItemType.model.js | 2 +-
server/api/contactItemType/contactItemType.rpc.js | 2 +-
server/api/contactItemType/index.js | 2 +-
server/api/dashboard/dashboard.attributes.js | 2 +-
server/api/dashboard/dashboard.controller.js | 2 +-
server/api/dashboard/dashboard.events.js | 2 +-
server/api/dashboard/dashboard.model.js | 2 +-
server/api/dashboard/dashboard.rpc.js | 2 +-
server/api/dashboard/dashboard.socket.js | 2 +-
server/api/dashboard/index.js | 2 +-
.../api/dashboardItem/dashboardItem.attributes.js | 2 +-
.../api/dashboardItem/dashboardItem.controller.js | 2 +-
server/api/dashboardItem/dashboardItem.events.js | 2 +-
server/api/dashboardItem/dashboardItem.model.js | 2 +-
server/api/dashboardItem/dashboardItem.rpc.js | 2 +-
server/api/dashboardItem/dashboardItem.socket.js | 2 +-
server/api/dashboardItem/index.js | 2 +-
server/api/disposition/disposition.attributes.js | 2 +-
server/api/disposition/disposition.controller.js | 2 +-
server/api/disposition/disposition.model.js | 2 +-
server/api/disposition/disposition.rpc.js | 2 +-
server/api/disposition/index.js | 2 +-
server/api/faxAccount/faxAccount.attributes.js | 2 +-
server/api/faxAccount/faxAccount.controller.js | 2 +-
server/api/faxAccount/faxAccount.events.js | 2 +-
server/api/faxAccount/faxAccount.model.js | 2 +-
server/api/faxAccount/faxAccount.rpc.js | 2 +-
server/api/faxAccount/faxAccount.socket.js | 2 +-
server/api/faxAccount/index.js | 2 +-
.../faxApplication/faxApplication.attributes.js | 2 +-
.../faxApplication/faxApplication.controller.js | 2 +-
server/api/faxApplication/faxApplication.model.js | 2 +-
server/api/faxApplication/faxApplication.rpc.js | 2 +-
server/api/faxApplication/index.js | 2 +-
.../faxInteraction/faxInteraction.attributes.js | 2 +-
.../faxInteraction/faxInteraction.controller.js | 2 +-
server/api/faxInteraction/faxInteraction.events.js | 2 +-
server/api/faxInteraction/faxInteraction.model.js | 2 +-
server/api/faxInteraction/faxInteraction.rpc.js | 2 +-
server/api/faxInteraction/faxInteraction.socket.js | 2 +-
server/api/faxInteraction/index.js | 2 +-
server/api/faxMessage/faxMessage.attributes.js | 2 +-
server/api/faxMessage/faxMessage.controller.js | 2 +-
server/api/faxMessage/faxMessage.events.js | 2 +-
server/api/faxMessage/faxMessage.model.js | 2 +-
server/api/faxMessage/faxMessage.rpc.js | 2 +-
server/api/faxMessage/faxMessage.socket.js | 2 +-
server/api/faxMessage/index.js | 2 +-
server/api/faxQueue/faxQueue.attributes.js | 2 +-
server/api/faxQueue/faxQueue.controller.js | 2 +-
server/api/faxQueue/faxQueue.events.js | 2 +-
server/api/faxQueue/faxQueue.model.js | 2 +-
server/api/faxQueue/faxQueue.rpc.js | 2 +-
server/api/faxQueue/faxQueue.socket.js | 2 +-
server/api/faxQueue/index.js | 2 +-
.../faxQueueReport/faxQueueReport.attributes.js | 2 +-
.../faxQueueReport/faxQueueReport.controller.js | 2 +-
server/api/faxQueueReport/faxQueueReport.model.js | 2 +-
server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +-
server/api/faxQueueReport/index.js | 2 +-
.../faxTransferReport.attributes.js | 2 +-
.../faxTransferReport.controller.js | 2 +-
.../faxTransferReport/faxTransferReport.model.js | 2 +-
.../api/faxTransferReport/faxTransferReport.rpc.js | 2 +-
server/api/faxTransferReport/index.js | 2 +-
server/api/intDeskAccount/index.js | 2 +-
.../intDeskAccount/intDeskAccount.attributes.js | 2 +-
.../intDeskAccount/intDeskAccount.controller.js | 2 +-
server/api/intDeskAccount/intDeskAccount.model.js | 2 +-
server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +-
server/api/intDeskConfiguration/index.js | 2 +-
.../intDeskConfiguration.attributes.js | 2 +-
.../intDeskConfiguration.controller.js | 2 +-
.../intDeskConfiguration.model.js | 2 +-
.../intDeskConfiguration.rpc.js | 2 +-
server/api/intDeskField/index.js | 2 +-
server/api/intDeskField/intDeskField.attributes.js | 2 +-
server/api/intDeskField/intDeskField.controller.js | 2 +-
server/api/intDeskField/intDeskField.model.js | 2 +-
server/api/intDeskField/intDeskField.rpc.js | 2 +-
server/api/intDynamics365Account/index.js | 2 +-
.../intDynamics365Account.attributes.js | 2 +-
.../intDynamics365Account.controller.js | 2 +-
.../intDynamics365Account.model.js | 2 +-
.../intDynamics365Account.rpc.js | 2 +-
server/api/intDynamics365Configuration/index.js | 2 +-
.../intDynamics365Configuration.attributes.js | 2 +-
.../intDynamics365Configuration.controller.js | 2 +-
.../intDynamics365Configuration.model.js | 2 +-
.../intDynamics365Configuration.rpc.js | 2 +-
server/api/intDynamics365Field/index.js | 2 +-
.../intDynamics365Field.attributes.js | 2 +-
.../intDynamics365Field.controller.js | 2 +-
.../intDynamics365Field.model.js | 2 +-
.../intDynamics365Field/intDynamics365Field.rpc.js | 2 +-
server/api/intFreshdeskAccount/index.js | 2 +-
.../intFreshdeskAccount.attributes.js | 2 +-
.../intFreshdeskAccount.controller.js | 2 +-
.../intFreshdeskAccount.model.js | 2 +-
.../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +-
server/api/intFreshdeskConfiguration/index.js | 2 +-
.../intFreshdeskConfiguration.attributes.js | 2 +-
.../intFreshdeskConfiguration.controller.js | 2 +-
.../intFreshdeskConfiguration.model.js | 2 +-
.../intFreshdeskConfiguration.rpc.js | 2 +-
server/api/intFreshdeskField/index.js | 2 +-
.../intFreshdeskField.attributes.js | 2 +-
.../intFreshdeskField.controller.js | 2 +-
.../intFreshdeskField/intFreshdeskField.model.js | 2 +-
.../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +-
server/api/intFreshsalesAccount/index.js | 2 +-
.../intFreshsalesAccount.attributes.js | 2 +-
.../intFreshsalesAccount.controller.js | 2 +-
.../intFreshsalesAccount.model.js | 2 +-
.../intFreshsalesAccount.rpc.js | 2 +-
server/api/intFreshsalesConfiguration/index.js | 2 +-
.../intFreshsalesConfiguration.attributes.js | 2 +-
.../intFreshsalesConfiguration.controller.js | 2 +-
.../intFreshsalesConfiguration.model.js | 2 +-
.../intFreshsalesConfiguration.rpc.js | 2 +-
server/api/intFreshsalesField/index.js | 2 +-
.../intFreshsalesField.attributes.js | 2 +-
.../intFreshsalesField.controller.js | 2 +-
.../intFreshsalesField/intFreshsalesField.model.js | 2 +-
.../intFreshsalesField/intFreshsalesField.rpc.js | 2 +-
server/api/intSalesforceAccount/index.js | 2 +-
.../intSalesforceAccount.attributes.js | 2 +-
.../intSalesforceAccount.controller.js | 2 +-
.../intSalesforceAccount.model.js | 2 +-
.../intSalesforceAccount.rpc.js | 2 +-
server/api/intSalesforceConfiguration/index.js | 2 +-
.../intSalesforceConfiguration.attributes.js | 2 +-
.../intSalesforceConfiguration.controller.js | 2 +-
.../intSalesforceConfiguration.model.js | 2 +-
.../intSalesforceConfiguration.rpc.js | 2 +-
server/api/intSalesforceField/index.js | 2 +-
.../intSalesforceField.attributes.js | 2 +-
.../intSalesforceField.controller.js | 2 +-
.../intSalesforceField/intSalesforceField.model.js | 2 +-
.../intSalesforceField/intSalesforceField.rpc.js | 2 +-
server/api/intServicenowAccount/index.js | 2 +-
.../intServicenowAccount.attributes.js | 2 +-
.../intServicenowAccount.controller.js | 2 +-
.../intServicenowAccount.model.js | 2 +-
.../intServicenowAccount.rpc.js | 2 +-
server/api/intServicenowConfiguration/index.js | 2 +-
.../intServicenowConfiguration.attributes.js | 2 +-
.../intServicenowConfiguration.controller.js | 2 +-
.../intServicenowConfiguration.model.js | 2 +-
.../intServicenowConfiguration.rpc.js | 2 +-
server/api/intServicenowField/index.js | 2 +-
.../intServicenowField.attributes.js | 2 +-
.../intServicenowField.controller.js | 2 +-
.../intServicenowField/intServicenowField.model.js | 2 +-
.../intServicenowField/intServicenowField.rpc.js | 2 +-
server/api/intSugarcrmAccount/index.js | 2 +-
.../intSugarcrmAccount.attributes.js | 2 +-
.../intSugarcrmAccount.controller.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +-
server/api/intSugarcrmConfiguration/index.js | 2 +-
.../intSugarcrmConfiguration.attributes.js | 2 +-
.../intSugarcrmConfiguration.controller.js | 2 +-
.../intSugarcrmConfiguration.model.js | 2 +-
.../intSugarcrmConfiguration.rpc.js | 2 +-
server/api/intSugarcrmField/index.js | 2 +-
.../intSugarcrmField.attributes.js | 2 +-
.../intSugarcrmField.controller.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.model.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +-
server/api/intVtigerAccount/index.js | 2 +-
.../intVtigerAccount.attributes.js | 2 +-
.../intVtigerAccount.controller.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.model.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +-
server/api/intVtigerConfiguration/index.js | 2 +-
.../intVtigerConfiguration.attributes.js | 2 +-
.../intVtigerConfiguration.controller.js | 2 +-
.../intVtigerConfiguration.model.js | 2 +-
.../intVtigerConfiguration.rpc.js | 2 +-
server/api/intVtigerField/index.js | 2 +-
.../intVtigerField/intVtigerField.attributes.js | 2 +-
.../intVtigerField/intVtigerField.controller.js | 2 +-
server/api/intVtigerField/intVtigerField.model.js | 2 +-
server/api/intVtigerField/intVtigerField.rpc.js | 2 +-
server/api/intZendeskAccount/index.js | 2 +-
.../intZendeskAccount.attributes.js | 2 +-
.../intZendeskAccount.controller.js | 2 +-
.../intZendeskAccount/intZendeskAccount.model.js | 2 +-
.../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +-
server/api/intZendeskConfiguration/index.js | 2 +-
.../intZendeskConfiguration.attributes.js | 2 +-
.../intZendeskConfiguration.controller.js | 2 +-
.../intZendeskConfiguration.model.js | 2 +-
.../intZendeskConfiguration.rpc.js | 2 +-
server/api/intZendeskField/index.js | 2 +-
.../intZendeskField/intZendeskField.attributes.js | 2 +-
.../intZendeskField/intZendeskField.controller.js | 2 +-
.../api/intZendeskField/intZendeskField.model.js | 2 +-
server/api/intZendeskField/intZendeskField.rpc.js | 2 +-
server/api/intZohoAccount/index.js | 2 +-
.../intZohoAccount/intZohoAccount.attributes.js | 2 +-
.../intZohoAccount/intZohoAccount.controller.js | 2 +-
server/api/intZohoAccount/intZohoAccount.model.js | 2 +-
server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +-
server/api/intZohoConfiguration/index.js | 2 +-
.../intZohoConfiguration.attributes.js | 2 +-
.../intZohoConfiguration.controller.js | 2 +-
.../intZohoConfiguration.model.js | 2 +-
.../intZohoConfiguration.rpc.js | 2 +-
server/api/intZohoField/index.js | 2 +-
server/api/intZohoField/intZohoField.attributes.js | 2 +-
server/api/intZohoField/intZohoField.controller.js | 2 +-
server/api/intZohoField/intZohoField.model.js | 2 +-
server/api/intZohoField/intZohoField.rpc.js | 2 +-
server/api/integration/index.js | 2 +-
server/api/integration/integration.attributes.js | 2 +-
server/api/integration/integration.controller.js | 2 +-
server/api/integration/integration.model.js | 2 +-
server/api/integration/integration.rpc.js | 2 +-
server/api/integrationReport/index.js | 2 +-
.../integrationReport.attributes.js | 2 +-
.../integrationReport.controller.js | 2 +-
.../integrationReport/integrationReport.model.js | 2 +-
.../api/integrationReport/integrationReport.rpc.js | 2 +-
server/api/interval/index.js | 2 +-
server/api/interval/interval.attributes.js | 2 +-
server/api/interval/interval.controller.js | 2 +-
server/api/interval/interval.model.js | 2 +-
server/api/interval/interval.rpc.js | 2 +-
server/api/jira/index.js | 2 +-
server/api/jira/jira.controller.js | 2 +-
server/api/jscriptyAnswerReport/index.js | 2 +-
.../jscriptyAnswerReport.attributes.js | 2 +-
.../jscriptyAnswerReport.controller.js | 2 +-
.../jscriptyAnswerReport.model.js | 2 +-
.../jscriptyAnswerReport.rpc.js | 2 +-
server/api/jscriptyProject/index.js | 2 +-
.../jscriptyProject/jscriptyProject.attributes.js | 2 +-
.../jscriptyProject/jscriptyProject.controller.js | 2 +-
.../api/jscriptyProject/jscriptyProject.model.js | 2 +-
server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +-
server/api/jscriptyQuestionReport/index.js | 2 +-
.../jscriptyQuestionReport.attributes.js | 2 +-
.../jscriptyQuestionReport.controller.js | 2 +-
.../jscriptyQuestionReport.model.js | 2 +-
.../jscriptyQuestionReport.rpc.js | 2 +-
server/api/jscriptySessionReport/index.js | 2 +-
.../jscriptySessionReport.attributes.js | 2 +-
.../jscriptySessionReport.controller.js | 2 +-
.../jscriptySessionReport.model.js | 2 +-
.../jscriptySessionReport.rpc.js | 2 +-
server/api/license/index.js | 2 +-
server/api/license/license.attributes.js | 2 +-
server/api/license/license.controller.js | 2 +-
server/api/license/license.model.js | 2 +-
server/api/license/license.rpc.js | 2 +-
server/api/mailAccount/index.js | 2 +-
server/api/mailAccount/mailAccount.attributes.js | 2 +-
server/api/mailAccount/mailAccount.controller.js | 2 +-
server/api/mailAccount/mailAccount.events.js | 2 +-
server/api/mailAccount/mailAccount.model.js | 2 +-
server/api/mailAccount/mailAccount.rpc.js | 2 +-
server/api/mailAccount/mailAccount.socket.js | 2 +-
server/api/mailApplication/index.js | 2 +-
.../mailApplication/mailApplication.attributes.js | 2 +-
.../mailApplication/mailApplication.controller.js | 2 +-
.../api/mailApplication/mailApplication.model.js | 2 +-
server/api/mailApplication/mailApplication.rpc.js | 2 +-
server/api/mailInteraction/index.js | 2 +-
.../mailInteraction/mailInteraction.attributes.js | 2 +-
.../mailInteraction/mailInteraction.controller.js | 2 +-
.../api/mailInteraction/mailInteraction.events.js | 2 +-
.../api/mailInteraction/mailInteraction.model.js | 2 +-
server/api/mailInteraction/mailInteraction.rpc.js | 2 +-
.../api/mailInteraction/mailInteraction.socket.js | 2 +-
server/api/mailMessage/index.js | 2 +-
server/api/mailMessage/mailMessage.attributes.js | 2 +-
server/api/mailMessage/mailMessage.controller.js | 2 +-
server/api/mailMessage/mailMessage.events.js | 2 +-
server/api/mailMessage/mailMessage.model.js | 2 +-
server/api/mailMessage/mailMessage.rpc.js | 2 +-
server/api/mailMessage/mailMessage.socket.js | 2 +-
server/api/mailQueue/index.js | 2 +-
server/api/mailQueue/mailQueue.attributes.js | 2 +-
server/api/mailQueue/mailQueue.controller.js | 2 +-
server/api/mailQueue/mailQueue.events.js | 2 +-
server/api/mailQueue/mailQueue.model.js | 2 +-
server/api/mailQueue/mailQueue.rpc.js | 2 +-
server/api/mailQueue/mailQueue.socket.js | 2 +-
server/api/mailQueueReport/index.js | 2 +-
.../mailQueueReport/mailQueueReport.attributes.js | 2 +-
.../mailQueueReport/mailQueueReport.controller.js | 2 +-
.../api/mailQueueReport/mailQueueReport.model.js | 2 +-
server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +-
server/api/mailServerIn/index.js | 2 +-
server/api/mailServerIn/mailServerIn.attributes.js | 2 +-
server/api/mailServerIn/mailServerIn.model.js | 2 +-
server/api/mailServerIn/mailServerIn.rpc.js | 2 +-
server/api/mailServerOut/index.js | 2 +-
.../api/mailServerOut/mailServerOut.attributes.js | 2 +-
.../api/mailServerOut/mailServerOut.controller.js | 2 +-
server/api/mailServerOut/mailServerOut.model.js | 2 +-
server/api/mailServerOut/mailServerOut.rpc.js | 2 +-
server/api/mailSubstatus/index.js | 2 +-
.../api/mailSubstatus/mailSubstatus.attributes.js | 2 +-
.../api/mailSubstatus/mailSubstatus.controller.js | 2 +-
server/api/mailSubstatus/mailSubstatus.events.js | 2 +-
server/api/mailSubstatus/mailSubstatus.model.js | 2 +-
server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +-
server/api/mailTransferReport/index.js | 2 +-
.../mailTransferReport.attributes.js | 2 +-
.../mailTransferReport.controller.js | 2 +-
.../mailTransferReport/mailTransferReport.model.js | 2 +-
.../mailTransferReport/mailTransferReport.rpc.js | 2 +-
server/api/memberReport/index.js | 2 +-
server/api/memberReport/memberReport.attributes.js | 2 +-
server/api/memberReport/memberReport.controller.js | 2 +-
server/api/memberReport/memberReport.model.js | 2 +-
server/api/memberReport/memberReport.rpc.js | 2 +-
server/api/migration/index.js | 2 +-
server/api/migration/migration.attributes.js | 2 +-
server/api/migration/migration.controller.js | 2 +-
server/api/migration/migration.model.js | 2 +-
server/api/migration/migration.rpc.js | 2 +-
server/api/network/index.js | 2 +-
server/api/network/network.attributes.js | 2 +-
server/api/network/network.controller.js | 2 +-
server/api/network/network.model.js | 2 +-
server/api/network/network.rpc.js | 2 +-
server/api/openchannelAccount/index.js | 2 +-
.../openchannelAccount.attributes.js | 2 +-
.../openchannelAccount.controller.js | 2 +-
.../openchannelAccount.events.js | 2 +-
.../openchannelAccount/openchannelAccount.model.js | 2 +-
.../openchannelAccount/openchannelAccount.rpc.js | 2 +-
.../openchannelAccount.socket.js | 2 +-
server/api/openchannelApplication/index.js | 2 +-
.../openchannelApplication.attributes.js | 2 +-
.../openchannelApplication.controller.js | 2 +-
.../openchannelApplication.model.js | 2 +-
.../openchannelApplication.rpc.js | 2 +-
server/api/openchannelInteraction/index.js | 2 +-
.../openchannelInteraction.attributes.js | 2 +-
.../openchannelInteraction.controller.js | 2 +-
.../openchannelInteraction.events.js | 2 +-
.../openchannelInteraction.model.js | 2 +-
.../openchannelInteraction.rpc.js | 2 +-
.../openchannelInteraction.socket.js | 2 +-
server/api/openchannelMessage/index.js | 2 +-
.../openchannelMessage.attributes.js | 2 +-
.../openchannelMessage.controller.js | 2 +-
.../openchannelMessage.events.js | 2 +-
.../openchannelMessage/openchannelMessage.model.js | 2 +-
.../openchannelMessage/openchannelMessage.rpc.js | 2 +-
.../openchannelMessage.socket.js | 2 +-
server/api/openchannelQueue/index.js | 2 +-
.../openchannelQueue.attributes.js | 2 +-
.../openchannelQueue.controller.js | 2 +-
.../openchannelQueue/openchannelQueue.events.js | 2 +-
.../api/openchannelQueue/openchannelQueue.model.js | 2 +-
.../api/openchannelQueue/openchannelQueue.rpc.js | 2 +-
.../openchannelQueue/openchannelQueue.socket.js | 2 +-
server/api/openchannelQueueReport/index.js | 2 +-
.../openchannelQueueReport.attributes.js | 2 +-
.../openchannelQueueReport.controller.js | 2 +-
.../openchannelQueueReport.model.js | 2 +-
.../openchannelQueueReport.rpc.js | 2 +-
server/api/openchannelTransferReport/index.js | 2 +-
.../openchannelTransferReport.attributes.js | 2 +-
.../openchannelTransferReport.controller.js | 2 +-
.../openchannelTransferReport.model.js | 2 +-
.../openchannelTransferReport.rpc.js | 2 +-
server/api/pause/index.js | 2 +-
server/api/pause/pause.attributes.js | 2 +-
server/api/pause/pause.controller.js | 2 +-
server/api/pause/pause.model.js | 2 +-
server/api/pause/pause.rpc.js | 2 +-
server/api/plugin/index.js | 2 +-
server/api/plugin/plugin.attributes.js | 2 +-
server/api/plugin/plugin.controller.js | 2 +-
server/api/plugin/plugin.events.js | 2 +-
server/api/plugin/plugin.model.js | 2 +-
server/api/plugin/plugin.rpc.js | 2 +-
server/api/plugin/plugin.socket.js | 2 +-
server/api/pm2/index.js | 2 +-
server/api/pm2/pm2.controller.js | 2 +-
server/api/realtime/index.js | 2 +-
server/api/realtime/realtime.controller.js | 2 +-
server/api/reportAgentPreview/index.js | 2 +-
.../reportAgentPreview.attributes.js | 2 +-
.../reportAgentPreview/reportAgentPreview.model.js | 2 +-
.../reportAgentPreview/reportAgentPreview.rpc.js | 2 +-
server/api/rpc/index.js | 2 +-
server/api/rpc/rpc.controller.js | 2 +-
server/api/schedule/index.js | 2 +-
server/api/schedule/schedule.attributes.js | 2 +-
server/api/schedule/schedule.controller.js | 2 +-
server/api/schedule/schedule.model.js | 2 +-
server/api/schedule/schedule.rpc.js | 2 +-
server/api/screenRecording/index.js | 2 +-
.../screenRecording/screenRecording.attributes.js | 2 +-
.../screenRecording/screenRecording.controller.js | 2 +-
.../api/screenRecording/screenRecording.model.js | 2 +-
server/api/screenRecording/screenRecording.rpc.js | 2 +-
server/api/setting/index.js | 2 +-
server/api/setting/setting.attributes.js | 2 +-
server/api/setting/setting.controller.js | 2 +-
server/api/setting/setting.model.js | 2 +-
server/api/setting/setting.rpc.js | 2 +-
server/api/smsAccount/index.js | 2 +-
server/api/smsAccount/smsAccount.attributes.js | 2 +-
server/api/smsAccount/smsAccount.controller.js | 2 +-
server/api/smsAccount/smsAccount.events.js | 2 +-
server/api/smsAccount/smsAccount.model.js | 2 +-
server/api/smsAccount/smsAccount.rpc.js | 2 +-
server/api/smsAccount/smsAccount.socket.js | 2 +-
server/api/smsApplication/index.js | 2 +-
.../smsApplication/smsApplication.attributes.js | 2 +-
.../smsApplication/smsApplication.controller.js | 2 +-
server/api/smsApplication/smsApplication.model.js | 2 +-
server/api/smsApplication/smsApplication.rpc.js | 2 +-
server/api/smsInteraction/index.js | 2 +-
.../smsInteraction/smsInteraction.attributes.js | 2 +-
.../smsInteraction/smsInteraction.controller.js | 2 +-
server/api/smsInteraction/smsInteraction.events.js | 2 +-
server/api/smsInteraction/smsInteraction.model.js | 2 +-
server/api/smsInteraction/smsInteraction.rpc.js | 2 +-
server/api/smsInteraction/smsInteraction.socket.js | 2 +-
server/api/smsMessage/index.js | 2 +-
server/api/smsMessage/smsMessage.attributes.js | 2 +-
server/api/smsMessage/smsMessage.controller.js | 2 +-
server/api/smsMessage/smsMessage.events.js | 2 +-
server/api/smsMessage/smsMessage.model.js | 2 +-
server/api/smsMessage/smsMessage.rpc.js | 2 +-
server/api/smsMessage/smsMessage.socket.js | 2 +-
server/api/smsQueue/index.js | 2 +-
server/api/smsQueue/smsQueue.attributes.js | 2 +-
server/api/smsQueue/smsQueue.controller.js | 2 +-
server/api/smsQueue/smsQueue.events.js | 2 +-
server/api/smsQueue/smsQueue.model.js | 2 +-
server/api/smsQueue/smsQueue.rpc.js | 2 +-
server/api/smsQueue/smsQueue.socket.js | 2 +-
server/api/smsQueueReport/index.js | 2 +-
.../smsQueueReport/smsQueueReport.attributes.js | 2 +-
.../smsQueueReport/smsQueueReport.controller.js | 2 +-
server/api/smsQueueReport/smsQueueReport.model.js | 2 +-
server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +-
server/api/smsTransferReport/index.js | 2 +-
.../smsTransferReport.attributes.js | 2 +-
.../smsTransferReport.controller.js | 2 +-
.../smsTransferReport/smsTransferReport.model.js | 2 +-
.../api/smsTransferReport/smsTransferReport.rpc.js | 2 +-
server/api/sound/index.js | 2 +-
server/api/sound/sound.attributes.js | 2 +-
server/api/sound/sound.controller.js | 2 +-
server/api/sound/sound.model.js | 2 +-
server/api/sound/sound.rpc.js | 2 +-
server/api/squareMessage/index.js | 2 +-
.../api/squareMessage/squareMessage.attributes.js | 2 +-
.../api/squareMessage/squareMessage.controller.js | 2 +-
server/api/squareMessage/squareMessage.model.js | 2 +-
server/api/squareMessage/squareMessage.rpc.js | 2 +-
server/api/squareOdbc/index.js | 2 +-
server/api/squareOdbc/squareOdbc.attributes.js | 2 +-
server/api/squareOdbc/squareOdbc.controller.js | 2 +-
server/api/squareOdbc/squareOdbc.model.js | 2 +-
server/api/squareOdbc/squareOdbc.rpc.js | 2 +-
server/api/squareProject/index.js | 2 +-
.../api/squareProject/squareProject.attributes.js | 2 +-
.../api/squareProject/squareProject.controller.js | 2 +-
server/api/squareProject/squareProject.events.js | 2 +-
server/api/squareProject/squareProject.model.js | 2 +-
server/api/squareProject/squareProject.rpc.js | 2 +-
server/api/squareProject/squareProject.socket.js | 2 +-
server/api/squareRecording/index.js | 2 +-
.../squareRecording/squareRecording.attributes.js | 2 +-
.../squareRecording/squareRecording.controller.js | 2 +-
.../api/squareRecording/squareRecording.model.js | 2 +-
server/api/squareRecording/squareRecording.rpc.js | 2 +-
server/api/squareReport/index.js | 2 +-
server/api/squareReport/squareReport.attributes.js | 2 +-
server/api/squareReport/squareReport.controller.js | 2 +-
server/api/squareReport/squareReport.model.js | 2 +-
server/api/squareReport/squareReport.rpc.js | 2 +-
server/api/squareReportDetail/index.js | 2 +-
.../squareReportDetail.attributes.js | 2 +-
.../squareReportDetail.controller.js | 2 +-
.../squareReportDetail/squareReportDetail.model.js | 2 +-
.../squareReportDetail/squareReportDetail.rpc.js | 2 +-
server/api/system/index.js | 2 +-
server/api/system/system.controller.js | 2 +-
server/api/tag/index.js | 2 +-
server/api/tag/tag.attributes.js | 2 +-
server/api/tag/tag.controller.js | 2 +-
server/api/tag/tag.model.js | 2 +-
server/api/tag/tag.rpc.js | 2 +-
server/api/team/index.js | 2 +-
server/api/team/team.attributes.js | 2 +-
server/api/team/team.controller.js | 2 +-
server/api/team/team.events.js | 2 +-
server/api/team/team.model.js | 2 +-
server/api/team/team.rpc.js | 2 +-
server/api/team/team.socket.js | 2 +-
.../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +-
.../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +-
server/api/teamVoiceQueue/index.js | 2 +-
.../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +-
server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +-
server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +-
server/api/template/index.js | 2 +-
server/api/template/template.attributes.js | 2 +-
server/api/template/template.controller.js | 2 +-
server/api/template/template.model.js | 2 +-
server/api/template/template.rpc.js | 2 +-
server/api/trigger/index.js | 2 +-
server/api/trigger/trigger.attributes.js | 2 +-
server/api/trigger/trigger.controller.js | 2 +-
server/api/trigger/trigger.model.js | 2 +-
server/api/trigger/trigger.rpc.js | 2 +-
server/api/trunk/index.js | 2 +-
server/api/trunk/trunk.attributes.js | 2 +-
server/api/trunk/trunk.controller.js | 2 +-
server/api/trunk/trunk.model.js | 2 +-
server/api/trunk/trunk.rpc.js | 2 +-
server/api/user-setting/index.js | 2 +-
server/api/user-setting/user-setting.attributes.js | 2 +-
server/api/user-setting/user-setting.controller.js | 2 +-
server/api/user-setting/user-setting.events.js | 2 +-
server/api/user-setting/user-setting.model.js | 2 +-
server/api/user-setting/user-setting.socket.js | 2 +-
server/api/user/index.js | 2 +-
server/api/user/user.attributes.js | 2 +-
server/api/user/user.controller.js | 2 +-
server/api/user/user.events.js | 2 +-
server/api/user/user.model.js | 2 +-
server/api/user/user.rpc.js | 2 +-
server/api/user/user.socket.js | 2 +-
server/api/userChatQueue/index.js | 2 +-
.../api/userChatQueue/userChatQueue.attributes.js | 2 +-
server/api/userChatQueue/userChatQueue.model.js | 2 +-
server/api/userChatQueue/userChatQueue.rpc.js | 2 +-
server/api/userFaxQueue/index.js | 2 +-
server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +-
server/api/userFaxQueue/userFaxQueue.model.js | 2 +-
server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +-
server/api/userMailQueue/index.js | 2 +-
.../api/userMailQueue/userMailQueue.attributes.js | 2 +-
server/api/userMailQueue/userMailQueue.model.js | 2 +-
server/api/userMailQueue/userMailQueue.rpc.js | 2 +-
server/api/userNotification/index.js | 2 +-
.../userNotification.attributes.js | 2 +-
.../userNotification.controller.js | 2 +-
.../userNotification/userNotification.events.js | 2 +-
.../api/userNotification/userNotification.model.js | 2 +-
.../api/userNotification/userNotification.rpc.js | 2 +-
.../userNotification/userNotification.socket.js | 2 +-
server/api/userOpenchannelQueue/index.js | 2 +-
.../userOpenchannelQueue.attributes.js | 2 +-
.../userOpenchannelQueue.model.js | 2 +-
.../userOpenchannelQueue.rpc.js | 2 +-
server/api/userProfile/index.js | 2 +-
server/api/userProfile/userProfile.attributes.js | 2 +-
server/api/userProfile/userProfile.controller.js | 2 +-
server/api/userProfile/userProfile.events.js | 2 +-
server/api/userProfile/userProfile.model.js | 2 +-
server/api/userProfile/userProfile.rpc.js | 2 +-
server/api/userProfile/userProfile.socket.js | 2 +-
server/api/userProfileResource/index.js | 2 +-
.../userProfileResource.attributes.js | 2 +-
.../userProfileResource.controller.js | 2 +-
.../userProfileResource.model.js | 2 +-
.../userProfileResource/userProfileResource.rpc.js | 2 +-
server/api/userProfileSection/index.js | 2 +-
.../userProfileSection.attributes.js | 2 +-
.../userProfileSection.controller.js | 2 +-
.../userProfileSection/userProfileSection.model.js | 2 +-
.../userProfileSection/userProfileSection.rpc.js | 2 +-
server/api/userSmsQueue/index.js | 2 +-
server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +-
server/api/userSmsQueue/userSmsQueue.model.js | 2 +-
server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +-
.../userVoicePrefix/userVoicePrefix.attributes.js | 2 +-
.../api/userVoicePrefix/userVoicePrefix.model.js | 2 +-
server/api/userVoiceQueue/index.js | 2 +-
.../userVoiceQueue/userVoiceQueue.attributes.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +-
server/api/userVoiceQueueRt/index.js | 2 +-
.../userVoiceQueueRt.attributes.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +-
server/api/userWhatsappQueue/index.js | 2 +-
.../userWhatsappQueue.attributes.js | 2 +-
.../userWhatsappQueue/userWhatsappQueue.model.js | 2 +-
.../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +-
server/api/variable/index.js | 2 +-
server/api/variable/variable.attributes.js | 2 +-
server/api/variable/variable.controller.js | 2 +-
server/api/variable/variable.model.js | 2 +-
server/api/variable/variable.rpc.js | 2 +-
server/api/version/index.js | 2 +-
server/api/version/version.controller.js | 2 +-
server/api/voiceAgentReport/index.js | 2 +-
.../voiceAgentReport.attributes.js | 2 +-
.../voiceAgentReport.controller.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.model.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +-
server/api/voiceCallReport/index.js | 2 +-
.../voiceCallReport/voiceCallReport.attributes.js | 2 +-
.../voiceCallReport/voiceCallReport.controller.js | 2 +-
.../api/voiceCallReport/voiceCallReport.model.js | 2 +-
server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +-
server/api/voiceChanSpy/index.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +-
server/api/voiceContext/index.js | 2 +-
server/api/voiceContext/voiceContext.attributes.js | 2 +-
server/api/voiceContext/voiceContext.controller.js | 2 +-
server/api/voiceContext/voiceContext.model.js | 2 +-
server/api/voiceContext/voiceContext.rpc.js | 2 +-
server/api/voiceDialReport/index.js | 2 +-
.../voiceDialReport/voiceDialReport.attributes.js | 2 +-
.../voiceDialReport/voiceDialReport.controller.js | 2 +-
.../api/voiceDialReport/voiceDialReport.model.js | 2 +-
server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +-
server/api/voiceExtension/index.js | 2 +-
.../voiceExtension/voiceExtension.attributes.js | 2 +-
.../voiceExtension/voiceExtension.controller.js | 2 +-
server/api/voiceExtension/voiceExtension.events.js | 2 +-
server/api/voiceExtension/voiceExtension.model.js | 2 +-
server/api/voiceExtension/voiceExtension.rpc.js | 2 +-
server/api/voiceExtension/voiceExtension.socket.js | 2 +-
server/api/voiceMail/index.js | 2 +-
server/api/voiceMail/voiceMail.attributes.js | 2 +-
server/api/voiceMail/voiceMail.controller.js | 2 +-
server/api/voiceMail/voiceMail.model.js | 2 +-
server/api/voiceMail/voiceMail.rpc.js | 2 +-
server/api/voiceMailMessage/index.js | 2 +-
.../voiceMailMessage.attributes.js | 2 +-
.../voiceMailMessage.controller.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.model.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +-
server/api/voiceMusicOnHold/index.js | 2 +-
.../voiceMusicOnHold.attributes.js | 2 +-
.../voiceMusicOnHold.controller.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +-
server/api/voicePrefix/index.js | 2 +-
server/api/voicePrefix/voicePrefix.attributes.js | 2 +-
server/api/voicePrefix/voicePrefix.controller.js | 2 +-
server/api/voicePrefix/voicePrefix.events.js | 2 +-
server/api/voicePrefix/voicePrefix.model.js | 2 +-
server/api/voicePrefix/voicePrefix.rpc.js | 2 +-
server/api/voicePrefix/voicePrefix.socket.js | 2 +-
server/api/voiceQueue/index.js | 2 +-
server/api/voiceQueue/voiceQueue.attributes.js | 2 +-
server/api/voiceQueue/voiceQueue.controller.js | 2 +-
server/api/voiceQueue/voiceQueue.events.js | 2 +-
server/api/voiceQueue/voiceQueue.model.js | 2 +-
server/api/voiceQueue/voiceQueue.rpc.js | 2 +-
server/api/voiceQueue/voiceQueue.socket.js | 2 +-
server/api/voiceQueueReport/index.js | 2 +-
.../voiceQueueReport.attributes.js | 2 +-
.../voiceQueueReport.controller.js | 2 +-
.../voiceQueueReport/voiceQueueReport.events.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.model.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +-
.../voiceQueueReport/voiceQueueReport.socket.js | 2 +-
server/api/voiceQueuesLog/index.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +-
server/api/voiceRecording/index.js | 2 +-
.../voiceRecording/voiceRecording.attributes.js | 2 +-
.../voiceRecording/voiceRecording.controller.js | 2 +-
server/api/voiceRecording/voiceRecording.model.js | 2 +-
server/api/voiceRecording/voiceRecording.rpc.js | 2 +-
server/api/voiceTransferReport/index.js | 2 +-
.../voiceTransferReport.attributes.js | 2 +-
.../voiceTransferReport.controller.js | 2 +-
.../voiceTransferReport.model.js | 2 +-
.../voiceTransferReport/voiceTransferReport.rpc.js | 2 +-
server/api/webbar/index.js | 2 +-
server/api/webbar/webbar.controller.js | 2 +-
server/api/whatsappAccount/index.js | 2 +-
.../whatsappAccount/whatsappAccount.attributes.js | 2 +-
.../whatsappAccount/whatsappAccount.controller.js | 2 +-
.../api/whatsappAccount/whatsappAccount.events.js | 2 +-
.../api/whatsappAccount/whatsappAccount.model.js | 2 +-
server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +-
.../api/whatsappAccount/whatsappAccount.socket.js | 2 +-
server/api/whatsappApplication/index.js | 2 +-
.../whatsappApplication.attributes.js | 2 +-
.../whatsappApplication.controller.js | 2 +-
.../whatsappApplication.model.js | 2 +-
.../whatsappApplication/whatsappApplication.rpc.js | 2 +-
server/api/whatsappInteraction/index.js | 2 +-
.../whatsappInteraction.attributes.js | 2 +-
.../whatsappInteraction.controller.js | 2 +-
.../whatsappInteraction.events.js | 2 +-
.../whatsappInteraction.model.js | 2 +-
.../whatsappInteraction/whatsappInteraction.rpc.js | 2 +-
.../whatsappInteraction.socket.js | 2 +-
server/api/whatsappMessage/index.js | 2 +-
.../whatsappMessage/whatsappMessage.attributes.js | 2 +-
.../whatsappMessage/whatsappMessage.controller.js | 2 +-
.../api/whatsappMessage/whatsappMessage.events.js | 2 +-
.../api/whatsappMessage/whatsappMessage.model.js | 2 +-
server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +-
.../api/whatsappMessage/whatsappMessage.socket.js | 2 +-
server/api/whatsappQueue/index.js | 2 +-
.../api/whatsappQueue/whatsappQueue.attributes.js | 2 +-
.../api/whatsappQueue/whatsappQueue.controller.js | 2 +-
server/api/whatsappQueue/whatsappQueue.events.js | 2 +-
server/api/whatsappQueue/whatsappQueue.model.js | 2 +-
server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +-
server/api/whatsappQueue/whatsappQueue.socket.js | 2 +-
server/api/whatsappQueueReport/index.js | 2 +-
.../whatsappQueueReport.attributes.js | 2 +-
.../whatsappQueueReport.controller.js | 2 +-
.../whatsappQueueReport.model.js | 2 +-
.../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +-
server/api/whatsappTransferReport/index.js | 2 +-
.../whatsappTransferReport.attributes.js | 2 +-
.../whatsappTransferReport.controller.js | 2 +-
.../whatsappTransferReport.model.js | 2 +-
.../whatsappTransferReport.rpc.js | 2 +-
server/app.js | 2 +-
server/components/auth/service.js | 2 +-
server/components/contacts/index.js | 2 +-
server/components/contacts/sql-utils.js | 2 +-
server/components/encryptor/index.js | 2 +-
server/components/export/csv.js | 2 +-
server/components/export/pdf.js | 2 +-
server/components/export/xlsx.js | 2 +-
server/components/extensions/rewrite.js | 2 +-
server/components/import/cm/csv.js | 2 +-
server/components/import/cm/csv2.js | 2 +-
server/components/import/cm/csvUpdates.js | 2 +-
server/components/integrations/configuration.js | 2 +-
server/components/interaction/service.js | 2 +-
server/components/interaction/sql-utils.js | 2 +-
.../components/interaction/update-interaction.js | 2 +-
server/components/interaction/utils.js | 2 +-
server/components/license/service.js | 2 +-
server/components/parsers/advancedSearch.js | 2 +-
server/components/parsers/qs.js | 2 +-
server/components/realtime/agents.js | 2 +-
server/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/action.js | 2 +-
server/services/ami/dialer/agentComplete.js | 2 +-
server/services/ami/dialer/final.js | 2 +-
server/services/ami/dialer/hangup.js | 2 +-
server/services/ami/dialer/history.js | 2 +-
server/services/ami/dialer/index.js | 2 +-
server/services/ami/dialer/queueCallerAbandon.js | 2 +-
server/services/ami/fax/action.js | 2 +-
server/services/ami/fax/index.js | 2 +-
server/services/ami/fax/rpcDb.js | 2 +-
server/services/ami/fax/util/gs.js | 2 +-
server/services/ami/fax/util/util.js | 2 +-
server/services/ami/index.js | 2 +-
server/services/ami/model/agent.js | 2 +-
server/services/ami/model/campaign.js | 2 +-
server/services/ami/model/channel.js | 2 +-
server/services/ami/model/deskAccount.js | 2 +-
server/services/ami/model/dynamics365Account.js | 2 +-
server/services/ami/model/faxAccount.js | 2 +-
server/services/ami/model/freshdeskAccount.js | 2 +-
server/services/ami/model/freshsalesAccount.js | 2 +-
server/services/ami/model/queueReport.js | 2 +-
server/services/ami/model/salesforceAccount.js | 2 +-
server/services/ami/model/servicenowAccount.js | 2 +-
server/services/ami/model/sugarcrmAccount.js | 2 +-
server/services/ami/model/telephone.js | 2 +-
server/services/ami/model/template.js | 2 +-
server/services/ami/model/trigger.js | 2 +-
server/services/ami/model/trunk.js | 2 +-
server/services/ami/model/voiceExtension.js | 2 +-
server/services/ami/model/voiceQueue.js | 2 +-
server/services/ami/model/vtigerAccount.js | 2 +-
server/services/ami/model/zendeskAccount.js | 2 +-
server/services/ami/model/zohoAccount.js | 2 +-
server/services/ami/preview/action.js | 2 +-
server/services/ami/preview/index.js | 2 +-
server/services/ami/preview/rpcDb.js | 2 +-
server/services/ami/preview/util/util.js | 2 +-
server/services/ami/properties.js | 2 +-
server/services/ami/realtime/index.js | 2 +-
server/services/ami/report/index.js | 2 +-
server/services/ami/report/userReport.js | 2 +-
server/services/ami/report/voiceAgentReport.js | 2 +-
server/services/ami/report/voiceCallReport.js | 2 +-
server/services/ami/report/voiceDialReport.js | 2 +-
server/services/ami/report/voiceQueueReport.js | 2 +-
server/services/ami/rpc/agentReportPreview.js | 2 +-
server/services/ami/rpc/attachment.js | 2 +-
server/services/ami/rpc/campaign.js | 2 +-
server/services/ami/rpc/cmContact.js | 2 +-
server/services/ami/rpc/cmHopper.js | 2 +-
server/services/ami/rpc/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/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/loggers.js | 2 +-
server/utils/mask-sensitive-data.js | 2 +-
server/utils/safe-template.js | 2 +-
1195 files changed, 1195 insertions(+), 1195 deletions(-)
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 393b075..178edd7 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-04-14T09:01:20.910Z",
+ "time": "2022-04-14T09:18:03.340Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 9040007..4027e83 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-04-14T09:01:20.910Z",
+ "time": "2022-04-14T09:18:03.340Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index c988cab..178a8a6 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 _0x1be5=['TEXT','exports','VIRTUAL','getDataValue','action','contactManager','integration','motionbar','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]'];(function(_0x3e9080,_0x13c6df){var _0x5005dc=function(_0x163ca2){while(--_0x163ca2){_0x3e9080['push'](_0x3e9080['shift']());}};_0x5005dc(++_0x13c6df);}(_0x1be5,0x91));var _0x51be=function(_0x45156b,_0x8adace){_0x45156b=_0x45156b-0x0;var _0x36980c=_0x1be5[_0x45156b];return _0x36980c;};'use strict';var Sequelize=require('sequelize');module[_0x51be('0x0')]={'name':{'type':Sequelize[_0x51be('0x1')],'get':function(_0x3ccccb){return this[_0x51be('0x2')](_0x51be('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x51be('0x4'),_0x51be('0x5'),_0x51be('0x6'),'jscripty',_0x51be('0x7'),'browser',_0x51be('0x8'),_0x51be('0x9')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x51be('0xa')},'data1':{'type':Sequelize[_0x51be('0xb')](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':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x51be('0xb')](0x1000),'comment':_0x51be('0xc')},'data4':{'type':Sequelize[_0x51be('0xb')](0x1000),'comments':_0x51be('0xd')},'data5':{'type':Sequelize[_0x51be('0xb')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x51be('0xb')],'comments':_0x51be('0xe')},'data7':{'type':Sequelize[_0x51be('0xf')],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0x1a42=['STRING','contactManager','motionbar','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','exports','VIRTUAL','getDataValue','action'];(function(_0x563107,_0x4283d3){var _0x578d98=function(_0x446017){while(--_0x446017){_0x563107['push'](_0x563107['shift']());}};_0x578d98(++_0x4283d3);}(_0x1a42,0x12c));var _0x21a4=function(_0x58eca9,_0x219608){_0x58eca9=_0x58eca9-0x0;var _0x25a12e=_0x1a42[_0x58eca9];return _0x25a12e;};'use strict';var Sequelize=require('sequelize');module[_0x21a4('0x0')]={'name':{'type':Sequelize[_0x21a4('0x1')],'get':function(_0x3c94dd){return this[_0x21a4('0x2')](_0x21a4('0x3'));}},'action':{'type':Sequelize[_0x21a4('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x21a4('0x5'),'integration',_0x21a4('0x6'),'jscripty',_0x21a4('0x7'),_0x21a4('0x8'),_0x21a4('0x9'),_0x21a4('0xa')]],'msg':_0x21a4('0xb')}},'comment':_0x21a4('0xb')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x21a4('0xc')},'data2':{'type':Sequelize[_0x21a4('0x4')](0x1000),'comment':_0x21a4('0xd')},'data3':{'type':Sequelize[_0x21a4('0x4')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x21a4('0x4')](0x1000),'comments':_0x21a4('0xe')},'data5':{'type':Sequelize[_0x21a4('0x4')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x21a4('0x4')],'comments':_0x21a4('0xf')},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index ebc0e3d..706c2cd 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 _0x555b=['../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','stack','name','send','update','body','Action','find','params','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x12c766,_0x4dbf56){var _0x3d7ae6=function(_0x83963f){while(--_0x83963f){_0x12c766['push'](_0x12c766['shift']());}};_0x3d7ae6(++_0x4dbf56);}(_0x555b,0x1de));var _0xb555=function(_0xbc759d,_0x591154){_0xbc759d=_0xbc759d-0x0;var _0x1feac5=_0x555b[_0xbc759d];return _0x1feac5;};'use strict';var emlformat=require(_0xb555('0x0'));var rimraf=require(_0xb555('0x1'));var zipdir=require(_0xb555('0x2'));var jsonpatch=require(_0xb555('0x3'));var rp=require(_0xb555('0x4'));var moment=require('moment');var BPromise=require(_0xb555('0x5'));var Mustache=require('mustache');var util=require(_0xb555('0x6'));var path=require(_0xb555('0x7'));var sox=require(_0xb555('0x8'));var csv=require(_0xb555('0x9'));var ejs=require(_0xb555('0xa'));var fs=require('fs');var fs_extra=require(_0xb555('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb555('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb555('0xd'));var toCsv=require(_0xb555('0x9'));var querystring=require(_0xb555('0xe'));var Papa=require(_0xb555('0xf'));var Redis=require(_0xb555('0x10'));var authService=require(_0xb555('0x11'));var qs=require(_0xb555('0x12'));var as=require(_0xb555('0x13'));var hardwareService=require(_0xb555('0x14'));var logger=require('../../config/logger')(_0xb555('0x15'));var utils=require(_0xb555('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xb555('0x17'));var db=require(_0xb555('0x18'))['db'];function respondWithStatusCode(_0x5cda56,_0x3100e5){_0x3100e5=_0x3100e5||0xcc;return function(_0x54ddbf){if(_0x54ddbf){return _0x5cda56[_0xb555('0x19')](_0x3100e5);}return _0x5cda56[_0xb555('0x1a')](_0x3100e5)[_0xb555('0x1b')]();};}function respondWithResult(_0x1ef61d,_0x28cc10){_0x28cc10=_0x28cc10||0xc8;return function(_0x9526f0){if(_0x9526f0){return _0x1ef61d[_0xb555('0x1a')](_0x28cc10)[_0xb555('0x1c')](_0x9526f0);}};}function respondWithFilteredResult(_0x52e6c8,_0xa365d4){return function(_0x339bb9){if(_0x339bb9){var _0x456336=typeof _0xa365d4[_0xb555('0x1d')]===_0xb555('0x1e')&&typeof _0xa365d4[_0xb555('0x1f')]===_0xb555('0x1e');var _0x251ff1=_0x339bb9[_0xb555('0x20')];var _0x181beb=_0x456336?0x0:_0xa365d4[_0xb555('0x1d')];var _0x289673=_0x456336?_0x339bb9[_0xb555('0x20')]:_0xa365d4[_0xb555('0x1d')]+_0xa365d4['limit'];var _0x2f1862;if(_0x289673>=_0x251ff1){_0x289673=_0x251ff1;_0x2f1862=0xc8;}else{_0x2f1862=0xce;}_0x52e6c8[_0xb555('0x1a')](_0x2f1862);return _0x52e6c8[_0xb555('0x21')](_0xb555('0x22'),_0x181beb+'-'+_0x289673+'/'+_0x251ff1)[_0xb555('0x1c')](_0x339bb9);}return null;};}function patchUpdates(_0x1f82af){return function(_0x9d63d6){try{jsonpatch[_0xb555('0x23')](_0x9d63d6,_0x1f82af,!![]);}catch(_0x101303){return BPromise[_0xb555('0x24')](_0x101303);}return _0x9d63d6[_0xb555('0x25')]();};}function saveUpdates(_0x9e0137,_0x46203f){return function(_0x457539){if(_0x457539){return _0x457539['update'](_0x9e0137)[_0xb555('0x26')](function(_0x2b0967){return _0x2b0967;});}return null;};}function removeEntity(_0x945fd9,_0x42b228){return function(_0x146954){if(_0x146954){return _0x146954['destroy']()[_0xb555('0x26')](function(){_0x945fd9['status'](0xcc)[_0xb555('0x1b')]();});}};}function handleEntityNotFound(_0x3da395,_0x3caedd){return function(_0x28ac63){if(!_0x28ac63){_0x3da395[_0xb555('0x19')](0x194);}return _0x28ac63;};}function handleError(_0x2d67ca,_0x554694){_0x554694=_0x554694||0x1f4;return function(_0x44e6b9){logger[_0xb555('0x27')](_0x44e6b9[_0xb555('0x28')]);if(_0x44e6b9[_0xb555('0x29')]){delete _0x44e6b9[_0xb555('0x29')];}_0x2d67ca['status'](_0x554694)[_0xb555('0x2a')](_0x44e6b9);};}exports[_0xb555('0x2b')]=function(_0x1ea36e,_0x11e23a){if(_0x1ea36e['body']['id']){delete _0x1ea36e[_0xb555('0x2c')]['id'];}return db[_0xb555('0x2d')][_0xb555('0x2e')]({'where':{'id':_0x1ea36e[_0xb555('0x2f')]['id']}})[_0xb555('0x26')](handleEntityNotFound(_0x11e23a,null))[_0xb555('0x26')](saveUpdates(_0x1ea36e[_0xb555('0x2c')],null))['then'](respondWithResult(_0x11e23a,null))[_0xb555('0x30')](handleError(_0x11e23a,null));};exports[_0xb555('0x31')]=function(_0xd64e89,_0x2537d8){return db['Action'][_0xb555('0x2e')]({'where':{'id':_0xd64e89[_0xb555('0x2f')]['id']}})['then'](handleEntityNotFound(_0x2537d8,null))[_0xb555('0x26')](removeEntity(_0x2537d8,null))[_0xb555('0x30')](handleError(_0x2537d8,null));};
\ No newline at end of file
+var _0x5ddc=['undefined','count','set','Content-Range','save','update','then','sendStatus','error','name','send','body','Action','params','catch','destroy','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset','limit'];(function(_0x3e40b8,_0x27358a){var _0x456430=function(_0x3310f3){while(--_0x3310f3){_0x3e40b8['push'](_0x3e40b8['shift']());}};_0x456430(++_0x27358a);}(_0x5ddc,0x153));var _0xc5dd=function(_0x12e0e1,_0x29192d){_0x12e0e1=_0x12e0e1-0x0;var _0x241fa5=_0x5ddc[_0x12e0e1];return _0x241fa5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc5dd('0x0'));var zipdir=require(_0xc5dd('0x1'));var jsonpatch=require(_0xc5dd('0x2'));var rp=require(_0xc5dd('0x3'));var moment=require(_0xc5dd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc5dd('0x5'));var util=require(_0xc5dd('0x6'));var path=require(_0xc5dd('0x7'));var sox=require(_0xc5dd('0x8'));var csv=require(_0xc5dd('0x9'));var ejs=require(_0xc5dd('0xa'));var fs=require('fs');var fs_extra=require(_0xc5dd('0xb'));var _=require('lodash');var squel=require(_0xc5dd('0xc'));var crypto=require(_0xc5dd('0xd'));var jsforce=require(_0xc5dd('0xe'));var deskjs=require(_0xc5dd('0xf'));var toCsv=require(_0xc5dd('0x9'));var querystring=require(_0xc5dd('0x10'));var Papa=require(_0xc5dd('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc5dd('0x12'));var hardwareService=require(_0xc5dd('0x13'));var logger=require(_0xc5dd('0x14'))(_0xc5dd('0x15'));var utils=require(_0xc5dd('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xc5dd('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44bb38,_0x2e7d6c){_0x2e7d6c=_0x2e7d6c||0xcc;return function(_0x4b7b99){if(_0x4b7b99){return _0x44bb38['sendStatus'](_0x2e7d6c);}return _0x44bb38[_0xc5dd('0x18')](_0x2e7d6c)[_0xc5dd('0x19')]();};}function respondWithResult(_0x331f89,_0x474d8a){_0x474d8a=_0x474d8a||0xc8;return function(_0x2c9a1d){if(_0x2c9a1d){return _0x331f89[_0xc5dd('0x18')](_0x474d8a)[_0xc5dd('0x1a')](_0x2c9a1d);}};}function respondWithFilteredResult(_0x548d70,_0x3d3781){return function(_0xfd7b81){if(_0xfd7b81){var _0x2f56f3=typeof _0x3d3781[_0xc5dd('0x1b')]==='undefined'&&typeof _0x3d3781[_0xc5dd('0x1c')]===_0xc5dd('0x1d');var _0x2b58b5=_0xfd7b81['count'];var _0x14fbf1=_0x2f56f3?0x0:_0x3d3781[_0xc5dd('0x1b')];var _0x2dde31=_0x2f56f3?_0xfd7b81[_0xc5dd('0x1e')]:_0x3d3781[_0xc5dd('0x1b')]+_0x3d3781[_0xc5dd('0x1c')];var _0x298dbc;if(_0x2dde31>=_0x2b58b5){_0x2dde31=_0x2b58b5;_0x298dbc=0xc8;}else{_0x298dbc=0xce;}_0x548d70[_0xc5dd('0x18')](_0x298dbc);return _0x548d70[_0xc5dd('0x1f')](_0xc5dd('0x20'),_0x14fbf1+'-'+_0x2dde31+'/'+_0x2b58b5)[_0xc5dd('0x1a')](_0xfd7b81);}return null;};}function patchUpdates(_0x1e13db){return function(_0x25a80d){try{jsonpatch['apply'](_0x25a80d,_0x1e13db,!![]);}catch(_0x514a85){return BPromise['reject'](_0x514a85);}return _0x25a80d[_0xc5dd('0x21')]();};}function saveUpdates(_0x5eeb4b,_0x58c90d){return function(_0x15e6c8){if(_0x15e6c8){return _0x15e6c8[_0xc5dd('0x22')](_0x5eeb4b)['then'](function(_0x7b2b1d){return _0x7b2b1d;});}return null;};}function removeEntity(_0x4553ea,_0x509a3d){return function(_0x5a7786){if(_0x5a7786){return _0x5a7786['destroy']()[_0xc5dd('0x23')](function(){_0x4553ea['status'](0xcc)[_0xc5dd('0x19')]();});}};}function handleEntityNotFound(_0x12944c,_0x5a700d){return function(_0x12fd4f){if(!_0x12fd4f){_0x12944c[_0xc5dd('0x24')](0x194);}return _0x12fd4f;};}function handleError(_0x162453,_0x280a6a){_0x280a6a=_0x280a6a||0x1f4;return function(_0x33b32a){logger[_0xc5dd('0x25')](_0x33b32a['stack']);if(_0x33b32a[_0xc5dd('0x26')]){delete _0x33b32a[_0xc5dd('0x26')];}_0x162453['status'](_0x280a6a)[_0xc5dd('0x27')](_0x33b32a);};}exports['update']=function(_0x1c5752,_0x13216c){if(_0x1c5752[_0xc5dd('0x28')]['id']){delete _0x1c5752[_0xc5dd('0x28')]['id'];}return db[_0xc5dd('0x29')]['find']({'where':{'id':_0x1c5752[_0xc5dd('0x2a')]['id']}})[_0xc5dd('0x23')](handleEntityNotFound(_0x13216c,null))[_0xc5dd('0x23')](saveUpdates(_0x1c5752['body'],null))[_0xc5dd('0x23')](respondWithResult(_0x13216c,null))[_0xc5dd('0x2b')](handleError(_0x13216c,null));};exports[_0xc5dd('0x2c')]=function(_0x3f05a3,_0x1f348f){return db[_0xc5dd('0x29')][_0xc5dd('0x2d')]({'where':{'id':_0x3f05a3['params']['id']}})[_0xc5dd('0x23')](handleEntityNotFound(_0x1f348f,null))[_0xc5dd('0x23')](removeEntity(_0x1f348f,null))[_0xc5dd('0x2b')](handleError(_0x1f348f,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index b9b94b3..4160641 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 _0xa6e6=['../../config/logger','api','moment','request-promise','path','../../config/environment','./action.attributes','define','tools_actions','lodash'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0xa6e6,0x167));var _0x6a6e=function(_0xfbdff6,_0x2af690){_0xfbdff6=_0xfbdff6-0x0;var _0x4cb9be=_0xa6e6[_0xfbdff6];return _0x4cb9be;};'use strict';var _=require(_0x6a6e('0x0'));var util=require('util');var logger=require(_0x6a6e('0x1'))(_0x6a6e('0x2'));var moment=require(_0x6a6e('0x3'));var BPromise=require('bluebird');var rp=require(_0x6a6e('0x4'));var fs=require('fs');var path=require(_0x6a6e('0x5'));var rimraf=require('rimraf');var config=require(_0x6a6e('0x6'));var attributes=require(_0x6a6e('0x7'));module['exports']=function(_0x531aab,_0x45365c){return _0x531aab[_0x6a6e('0x8')]('Action',attributes,{'tableName':_0x6a6e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0a68=['Action','tools_actions','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./action.attributes','exports'];(function(_0x54edc9,_0x345f01){var _0x2ae7a9=function(_0x24a545){while(--_0x24a545){_0x54edc9['push'](_0x54edc9['shift']());}};_0x2ae7a9(++_0x345f01);}(_0x0a68,0x11a));var _0x80a6=function(_0x3b5414,_0x80f3bd){_0x3b5414=_0x3b5414-0x0;var _0x331233=_0x0a68[_0x3b5414];return _0x331233;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x80a6('0x0'))('api');var moment=require(_0x80a6('0x1'));var BPromise=require(_0x80a6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x80a6('0x3'));var rimraf=require(_0x80a6('0x4'));var config=require(_0x80a6('0x5'));var attributes=require(_0x80a6('0x6'));module[_0x80a6('0x7')]=function(_0x5f58f8,_0x567ca3){return _0x5f58f8['define'](_0x80a6('0x8'),attributes,{'tableName':_0x80a6('0x9'),'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 f0ee8b0..7d67e38 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 _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0x7217,0x19e));var _0x7721=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0x7217[_0x4e1d03];return _0x362d4b;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Action,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}
\ No newline at end of file
+var _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x9a1d84,_0x211b00){var _0x584812=function(_0x50c0d9){while(--_0x50c0d9){_0x9a1d84['push'](_0x9a1d84['shift']());}};_0x584812(++_0x211b00);}(_0x5fc3,0xa8));var _0x35fc=function(_0x903228,_0x42c429){_0x903228=_0x903228-0x0;var _0xcec81d=_0x5fc3[_0x903228];return _0xcec81d;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 5067bb7..3677ebc 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 _0x9849=['put','/:id','isAuthenticated','update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./action.controller'];(function(_0x148bbb,_0x26d402){var _0x38619c=function(_0x5f0027){while(--_0x5f0027){_0x148bbb['push'](_0x148bbb['shift']());}};_0x38619c(++_0x26d402);}(_0x9849,0x91));var _0x9984=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9849[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x9984('0x0'));var util=require(_0x9984('0x1'));var path=require(_0x9984('0x2'));var timeout=require(_0x9984('0x3'));var express=require(_0x9984('0x4'));var router=express['Router']();var fs_extra=require(_0x9984('0x5'));var auth=require(_0x9984('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9984('0x7'));var controller=require(_0x9984('0x8'));router[_0x9984('0x9')](_0x9984('0xa'),auth[_0x9984('0xb')](),controller[_0x9984('0xc')]);router['delete'](_0x9984('0xa'),auth[_0x9984('0xb')](),controller['destroy']);module[_0x9984('0xd')]=router;
\ No newline at end of file
+var _0x5c1d=['update','/:id','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x5c1d,0x1f3));var _0xd5c1=function(_0x4343cc,_0x48f4f2){_0x4343cc=_0x4343cc-0x0;var _0x170ffc=_0x5c1d[_0x4343cc];return _0x170ffc;};'use strict';var multer=require('multer');var util=require(_0xd5c1('0x0'));var path=require(_0xd5c1('0x1'));var timeout=require(_0xd5c1('0x2'));var express=require(_0xd5c1('0x3'));var router=express[_0xd5c1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd5c1('0x5'));var interaction=require(_0xd5c1('0x6'));var config=require(_0xd5c1('0x7'));var controller=require(_0xd5c1('0x8'));router[_0xd5c1('0x9')]('/:id',auth[_0xd5c1('0xa')](),controller[_0xd5c1('0xb')]);router['delete'](_0xd5c1('0xc'),auth[_0xd5c1('0xa')](),controller[_0xd5c1('0xd')]);module[_0xd5c1('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 1cbb75d..a392ff9 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 _0xa630=['STRING','TEXT','sequelize','exports'];(function(_0x4d1945,_0x19aa2d){var _0x43290c=function(_0x169d12){while(--_0x169d12){_0x4d1945['push'](_0x4d1945['shift']());}};_0x43290c(++_0x19aa2d);}(_0xa630,0xbe));var _0x0a63=function(_0x4b6778,_0x505a76){_0x4b6778=_0x4b6778-0x0;var _0x22dbb9=_0xa630[_0x4b6778];return _0x22dbb9;};'use strict';var Sequelize=require(_0x0a63('0x0'));module[_0x0a63('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x0a63('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x0a63('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x4819=['TEXT','exports','STRING'];(function(_0x41d02a,_0x355e19){var _0x4c3983=function(_0x4802a7){while(--_0x4802a7){_0x41d02a['push'](_0x41d02a['shift']());}};_0x4c3983(++_0x355e19);}(_0x4819,0xcd));var _0x9481=function(_0x8e3507,_0x7c734c){_0x8e3507=_0x8e3507-0x0;var _0x48c52b=_0x4819[_0x8e3507];return _0x48c52b;};'use strict';var Sequelize=require('sequelize');module[_0x9481('0x0')]={'name':{'type':Sequelize[_0x9481('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x9481('0x1')]},'parent':{'type':Sequelize[_0x9481('0x1')]},'table':{'type':Sequelize[_0x9481('0x1')]},'conditions':{'type':Sequelize[_0x9481('0x2')]},'joins':{'type':Sequelize[_0x9481('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 50691a8..562a655 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 _0x53d0=['AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../components/export/','output','select','countTable','COUNT(*)','SELECT','run','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','CustomReports','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','catch','show','params','rawAttributes','merge','options','AnalyticCustomReport','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','userProfileId','UserProfileResource','body','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','MetricId','metric','replace','function','format','groupBy','orderBy','alias','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','foreignKey','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','COUNT(%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','operator','from','DESC','web','randomstring','csv','custom'];(function(_0xa0f797,_0x9b2fa7){var _0x14acd7=function(_0x3f814a){while(--_0x3f814a){_0xa0f797['push'](_0xa0f797['shift']());}};_0x14acd7(++_0x9b2fa7);}(_0x53d0,0xbb));var _0x053d=function(_0xdc61c3,_0x58ca1c){_0xdc61c3=_0xdc61c3-0x0;var _0x1fd157=_0x53d0[_0xdc61c3];return _0x1fd157;};'use strict';var emlformat=require(_0x053d('0x0'));var rimraf=require(_0x053d('0x1'));var zipdir=require(_0x053d('0x2'));var jsonpatch=require(_0x053d('0x3'));var rp=require(_0x053d('0x4'));var moment=require(_0x053d('0x5'));var BPromise=require(_0x053d('0x6'));var Mustache=require(_0x053d('0x7'));var util=require(_0x053d('0x8'));var path=require(_0x053d('0x9'));var sox=require(_0x053d('0xa'));var csv=require(_0x053d('0xb'));var ejs=require(_0x053d('0xc'));var fs=require('fs');var fs_extra=require(_0x053d('0xd'));var _=require(_0x053d('0xe'));var squel=require(_0x053d('0xf'));var crypto=require('crypto');var jsforce=require(_0x053d('0x10'));var deskjs=require(_0x053d('0x11'));var toCsv=require(_0x053d('0xb'));var querystring=require('querystring');var Papa=require(_0x053d('0x12'));var Redis=require(_0x053d('0x13'));var authService=require(_0x053d('0x14'));var qs=require(_0x053d('0x15'));var as=require(_0x053d('0x16'));var hardwareService=require(_0x053d('0x17'));var logger=require(_0x053d('0x18'))(_0x053d('0x19'));var utils=require(_0x053d('0x1a'));var config=require(_0x053d('0x1b'));var licenseUtil=require(_0x053d('0x1c'));var db=require(_0x053d('0x1d'))['db'];var dbH=require(_0x053d('0x1d'))[_0x053d('0x1e')];function respondWithStatusCode(_0x51c784,_0x20494d){_0x20494d=_0x20494d||0xcc;return function(_0x2aae48){if(_0x2aae48){return _0x51c784[_0x053d('0x1f')](_0x20494d);}return _0x51c784['status'](_0x20494d)[_0x053d('0x20')]();};}function respondWithResult(_0x336b3a,_0xc55ad4){_0xc55ad4=_0xc55ad4||0xc8;return function(_0x41ea3d){if(_0x41ea3d){return _0x336b3a[_0x053d('0x21')](_0xc55ad4)[_0x053d('0x22')](_0x41ea3d);}};}function respondWithFilteredResult(_0x13d537,_0x18d693){return function(_0xfd7e49){if(_0xfd7e49){var _0x11a4f4=typeof _0x18d693[_0x053d('0x23')]===_0x053d('0x24')&&typeof _0x18d693[_0x053d('0x25')]===_0x053d('0x24');var _0x555e03=_0xfd7e49[_0x053d('0x26')];var _0x183e15=_0x11a4f4?0x0:_0x18d693[_0x053d('0x23')];var _0xf9bc01=_0x11a4f4?_0xfd7e49[_0x053d('0x26')]:_0x18d693[_0x053d('0x23')]+_0x18d693[_0x053d('0x25')];var _0x2eacd0;if(_0xf9bc01>=_0x555e03){_0xf9bc01=_0x555e03;_0x2eacd0=0xc8;}else{_0x2eacd0=0xce;}_0x13d537[_0x053d('0x21')](_0x2eacd0);return _0x13d537[_0x053d('0x27')](_0x053d('0x28'),_0x183e15+'-'+_0xf9bc01+'/'+_0x555e03)[_0x053d('0x22')](_0xfd7e49);}return null;};}function patchUpdates(_0x59ffa6){return function(_0x3f194c){try{jsonpatch['apply'](_0x3f194c,_0x59ffa6,!![]);}catch(_0x4e8dda){return BPromise[_0x053d('0x29')](_0x4e8dda);}return _0x3f194c[_0x053d('0x2a')]();};}function saveUpdates(_0x3635a2,_0xc7802c){return function(_0x51fbef){if(_0x51fbef){return _0x51fbef[_0x053d('0x2b')](_0x3635a2)[_0x053d('0x2c')](function(_0x5a68e6){return _0x5a68e6;});}return null;};}function removeEntity(_0x3ba5d9,_0x20b546){return function(_0x3c0b11){if(_0x3c0b11){return _0x3c0b11['destroy']()[_0x053d('0x2c')](function(){var _0x4cf3c6=_0x3c0b11['get']({'plain':!![]});var _0x4b2a29=_0x053d('0x2d');return db['UserProfileResource'][_0x053d('0x2e')]({'where':{'type':_0x4b2a29,'resourceId':_0x4cf3c6['id']}})[_0x053d('0x2c')](function(){return _0x3c0b11;});})[_0x053d('0x2c')](function(){_0x3ba5d9[_0x053d('0x21')](0xcc)[_0x053d('0x20')]();});}};}function handleEntityNotFound(_0x589a67,_0x1473c1){return function(_0x4a6318){if(!_0x4a6318){_0x589a67['sendStatus'](0x194);}return _0x4a6318;};}function handleError(_0xc0e034,_0x289146){_0x289146=_0x289146||0x1f4;return function(_0x4367b4){logger[_0x053d('0x2f')](_0x4367b4[_0x053d('0x30')]);if(_0x4367b4[_0x053d('0x31')]){delete _0x4367b4['name'];}_0xc0e034[_0x053d('0x21')](_0x289146)[_0x053d('0x32')](_0x4367b4);};}exports[_0x053d('0x33')]=function(_0x3004f5,_0x4b7745){var _0x5274e4={},_0x5bb8d5={},_0x799350={'count':0x0,'rows':[]};var _0x10149f=_[_0x053d('0x34')](db['AnalyticCustomReport']['rawAttributes'],function(_0x1bac6c){return{'name':_0x1bac6c[_0x053d('0x35')],'type':_0x1bac6c[_0x053d('0x36')][_0x053d('0x37')]};});_0x5bb8d5[_0x053d('0x38')]=_[_0x053d('0x34')](_0x10149f,_0x053d('0x31'));_0x5bb8d5[_0x053d('0x39')]=_[_0x053d('0x3a')](_0x3004f5[_0x053d('0x39')]);_0x5bb8d5[_0x053d('0x3b')]=_['intersection'](_0x5bb8d5[_0x053d('0x38')],_0x5bb8d5[_0x053d('0x39')]);_0x5274e4['attributes']=_[_0x053d('0x3c')](_0x5bb8d5[_0x053d('0x38')],qs[_0x053d('0x3d')](_0x3004f5[_0x053d('0x39')]['fields']));_0x5274e4[_0x053d('0x3e')]=_0x5274e4[_0x053d('0x3e')][_0x053d('0x3f')]?_0x5274e4[_0x053d('0x3e')]:_0x5bb8d5[_0x053d('0x38')];if(!_0x3004f5[_0x053d('0x39')][_0x053d('0x40')](_0x053d('0x41'))){_0x5274e4[_0x053d('0x25')]=qs['limit'](_0x3004f5['query'][_0x053d('0x25')]);_0x5274e4[_0x053d('0x23')]=qs[_0x053d('0x23')](_0x3004f5[_0x053d('0x39')]['offset']);}_0x5274e4[_0x053d('0x42')]=qs[_0x053d('0x43')](_0x3004f5[_0x053d('0x39')][_0x053d('0x43')]);_0x5274e4[_0x053d('0x44')]=qs[_0x053d('0x3b')](_[_0x053d('0x45')](_0x3004f5[_0x053d('0x39')],_0x5bb8d5[_0x053d('0x3b')]),_0x10149f);if(_0x3004f5[_0x053d('0x39')][_0x053d('0x46')]){_0x5274e4[_0x053d('0x44')]=_['merge'](_0x5274e4[_0x053d('0x44')],{'$or':_[_0x053d('0x34')](_0x10149f,function(_0x3b7344){if(_0x3b7344[_0x053d('0x36')]!==_0x053d('0x47')){var _0xb610bf={};_0xb610bf[_0x3b7344[_0x053d('0x31')]]={'$like':'%'+_0x3004f5[_0x053d('0x39')]['filter']+'%'};return _0xb610bf;}})});}_0x5274e4=_['merge']({},_0x5274e4,_0x3004f5['options']);var _0x28e14e={'where':_0x5274e4['where']};return db['AnalyticCustomReport'][_0x053d('0x26')](_0x28e14e)[_0x053d('0x2c')](function(_0x589b0a){_0x799350[_0x053d('0x26')]=_0x589b0a;if(_0x3004f5[_0x053d('0x39')][_0x053d('0x48')]){_0x5274e4[_0x053d('0x49')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x053d('0x4a')](_0x5274e4);})[_0x053d('0x2c')](function(_0x2f397c){_0x799350['rows']=_0x2f397c;return _0x799350;})['then'](respondWithFilteredResult(_0x4b7745,_0x5274e4))[_0x053d('0x4b')](handleError(_0x4b7745,null));};exports[_0x053d('0x4c')]=function(_0x1a91c3,_0x4cd4b8){var _0x3d63b6={'raw':![],'where':{'id':_0x1a91c3[_0x053d('0x4d')]['id']}},_0x3c6f38={};_0x3c6f38[_0x053d('0x38')]=_[_0x053d('0x3a')](db['AnalyticCustomReport'][_0x053d('0x4e')]);_0x3c6f38[_0x053d('0x39')]=_[_0x053d('0x3a')](_0x1a91c3[_0x053d('0x39')]);_0x3c6f38[_0x053d('0x3b')]=_['intersection'](_0x3c6f38['model'],_0x3c6f38['query']);_0x3d63b6[_0x053d('0x3e')]=_[_0x053d('0x3c')](_0x3c6f38[_0x053d('0x38')],qs[_0x053d('0x3d')](_0x1a91c3[_0x053d('0x39')][_0x053d('0x3d')]));_0x3d63b6[_0x053d('0x3e')]=_0x3d63b6[_0x053d('0x3e')][_0x053d('0x3f')]?_0x3d63b6['attributes']:_0x3c6f38[_0x053d('0x38')];if(_0x1a91c3[_0x053d('0x39')]['includeAll']){_0x3d63b6['include']=[{'all':!![]}];}_0x3d63b6=_[_0x053d('0x4f')]({},_0x3d63b6,_0x1a91c3[_0x053d('0x50')]);return db[_0x053d('0x51')][_0x053d('0x52')](_0x3d63b6)[_0x053d('0x2c')](handleEntityNotFound(_0x4cd4b8,null))['then'](respondWithResult(_0x4cd4b8,null))[_0x053d('0x4b')](handleError(_0x4cd4b8,null));};exports[_0x053d('0x53')]=function(_0x2c8d94,_0xa1d2eb){return db['AnalyticCustomReport'][_0x053d('0x53')](_0x2c8d94['body'],{})['then'](function(_0x43a44d){var _0x2fc661=_0x2c8d94['user'][_0x053d('0x54')]({'plain':!![]});if(!_0x2fc661)throw new Error(_0x053d('0x55'));if(_0x2fc661[_0x053d('0x56')]===_0x053d('0x57')){var _0x286175=_0x43a44d['get']({'plain':!![]});var _0x4d8453=_0x053d('0x58');return db['UserProfileSection'][_0x053d('0x52')]({'where':{'name':_0x4d8453,'userProfileId':_0x2fc661[_0x053d('0x59')]},'raw':!![]})['then'](function(_0x2c5d43){if(_0x2c5d43&&_0x2c5d43['autoAssociation']===0x0){return db[_0x053d('0x5a')][_0x053d('0x53')]({'name':_0x286175[_0x053d('0x31')],'resourceId':_0x286175['id'],'type':'CustomReports','sectionId':_0x2c5d43['id']},{})[_0x053d('0x2c')](function(){return _0x43a44d;});}else{return _0x43a44d;}})[_0x053d('0x4b')](function(_0x2bf0b1){logger[_0x053d('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2bf0b1);throw _0x2bf0b1;});}return _0x43a44d;})[_0x053d('0x2c')](respondWithResult(_0xa1d2eb,0xc9))[_0x053d('0x4b')](handleError(_0xa1d2eb,null));};exports['update']=function(_0x347a4b,_0x355b5e){if(_0x347a4b[_0x053d('0x5b')]['id']){delete _0x347a4b[_0x053d('0x5b')]['id'];}return db[_0x053d('0x51')]['find']({'where':{'id':_0x347a4b['params']['id']}})[_0x053d('0x2c')](handleEntityNotFound(_0x355b5e,null))['then'](saveUpdates(_0x347a4b[_0x053d('0x5b')],null))[_0x053d('0x2c')](respondWithResult(_0x355b5e,null))[_0x053d('0x4b')](handleError(_0x355b5e,null));};exports[_0x053d('0x2e')]=function(_0x529daa,_0x54ebc4){return db[_0x053d('0x51')]['find']({'where':{'id':_0x529daa[_0x053d('0x4d')]['id']}})[_0x053d('0x2c')](handleEntityNotFound(_0x54ebc4,null))[_0x053d('0x2c')](removeEntity(_0x54ebc4,null))[_0x053d('0x4b')](handleError(_0x54ebc4,null));};exports[_0x053d('0x5c')]=function(_0x5f1c97,_0x162755){var _0x4b4285=0xa;var _0x1ddb08=[_0x053d('0x5d'),_0x053d('0x5e'),_0x053d('0x5f'),_0x053d('0x60')];var _0x17b345={'SUM':_0x053d('0x61'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x053d('0x62'),'MAX':'MAX(%s)','MIN':_0x053d('0x63'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x053d('0x64'),'GROUP_CONCAT ASC':_0x053d('0x65'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1923bb={'SEC_TO_TIME':_0x053d('0x66'),'DATE':_0x053d('0x67'),'HOUR':_0x053d('0x68'),'ROUND':_0x053d('0x69'),'UNIX_TIMESTAMP':_0x053d('0x6a')};var _0x11cf89=function(_0x16d950){return!_['includes']([_0x053d('0x6b'),_0x053d('0x6c'),_0x053d('0x6d'),_0x053d('0x6e')],_0x16d950);};var _0x1b5ffc=function(_0x5a16db){if(!_0x5a16db||!_0x5a16db['rules'][_0x053d('0x3f')]){return'';}for(var _0x28c3b9='(',_0x20ba68=0x0;_0x20ba68<_0x5a16db[_0x053d('0x6f')][_0x053d('0x3f')];_0x20ba68+=0x1){_0x20ba68>0x0&&(_0x28c3b9+='\x20'+_0x5a16db['operator']+'\x20');_0x28c3b9+=_0x5a16db['rules'][_0x20ba68]['group']?_0x1b5ffc(_0x5a16db['rules'][_0x20ba68][_0x053d('0x70')]):_0x5a16db['rules'][_0x20ba68][_0x053d('0x71')]+'\x20'+_0x5a16db['rules'][_0x20ba68][_0x053d('0x72')]+(_0x11cf89(_0x5a16db[_0x053d('0x6f')][_0x20ba68][_0x053d('0x72')])?'\x20'+_0x5a16db['rules'][_0x20ba68][_0x053d('0x73')]:'');}return _0x28c3b9+')';};var _0x42c649={'where':{'id':_0x5f1c97[_0x053d('0x4d')]['id']}},_0x180c57,_0x3d6222,_0x2a03bf,_0x4d896d,_0x162cbc;_0x42c649=_['merge']({},_0x42c649,_0x5f1c97['options']);return db['AnalyticCustomReport'][_0x053d('0x52')](_0x42c649)[_0x053d('0x2c')](function(_0x3e58ca){if(_0x3e58ca){_0x180c57=_0x3e58ca;return _0x3e58ca[_0x053d('0x74')]();}return null;})['then'](function(_0x54ca28){if(_0x54ca28){if(!_0x54ca28['length']){throw new db[(_0x053d('0x75'))][(_0x053d('0x76'))](_0x053d('0x77'),0x193);}_0x3d6222=_0x54ca28;return db[_0x053d('0x78')]['findAll']({'raw':!![]});}return null;})[_0x053d('0x2c')](function(_0x4bdd9e){if(_0x4bdd9e){_0x2a03bf=_[_0x053d('0x79')](_0x4bdd9e,'id');var _0x1348fe;var _0x34295d=squel['select']();_0x34295d['from'](_0x180c57['table']);for(var _0x348910=0x0;_0x348910<_0x3d6222[_0x053d('0x3f')];_0x348910+=0x1){_0x1348fe=_0x3d6222[_0x348910][_0x053d('0x7a')]?_0x2a03bf[_0x3d6222[_0x348910]['MetricId']][_0x053d('0x7b')]:_0x3d6222[_0x348910][_0x053d('0x71')];_0x1348fe=_0x3d6222[_0x348910]['function']?_[_0x053d('0x7c')](_0x17b345[_0x3d6222[_0x348910][_0x053d('0x7d')]],'%s',_0x1348fe):_0x1348fe;_0x1348fe=_0x3d6222[_0x348910][_0x053d('0x7e')]?_['replace'](_0x1923bb[_0x3d6222[_0x348910]['format']],'%s',_0x1348fe):_0x1348fe;if(_0x3d6222[_0x348910][_0x053d('0x7f')]){_0x34295d[_0x053d('0x70')](_0x1348fe);}_0x3d6222[_0x348910][_0x053d('0x80')]&&_0x34295d[_0x053d('0x42')](_0x1348fe,_0x3d6222[_0x348910]['orderBy']==='DESC'?![]:!![]);_0x34295d[_0x053d('0x71')](_0x1348fe,_0x3d6222[_0x348910][_0x053d('0x81')]||_0x1348fe);}if(_0x180c57[_0x053d('0x82')]){_0x180c57[_0x053d('0x82')]=JSON[_0x053d('0x83')](_0x180c57['joins']);for(var _0x1deb0c=0x0;_0x1deb0c<_0x180c57['joins'][_0x053d('0x3f')];_0x1deb0c+=0x1){if(_0x180c57[_0x053d('0x82')][_0x1deb0c][_0x053d('0x36')]&&_[_0x053d('0x84')](_0x1ddb08,_0x180c57[_0x053d('0x82')][_0x1deb0c][_0x053d('0x36')])&&_0x180c57['joins'][_0x1deb0c][_0x053d('0x85')]&&_0x180c57['joins'][_0x1deb0c][_0x053d('0x86')]&&_0x180c57[_0x053d('0x82')][_0x1deb0c]['foreignKey']){_0x34295d[_0x180c57[_0x053d('0x82')][_0x1deb0c][_0x053d('0x36')]](_0x180c57[_0x053d('0x82')][_0x1deb0c][_0x053d('0x86')],null,util['format'](_0x053d('0x87'),_0x180c57[_0x053d('0x88')],_0x180c57['joins'][_0x1deb0c][_0x053d('0x85')],_0x180c57[_0x053d('0x82')][_0x1deb0c][_0x053d('0x86')],_0x180c57[_0x053d('0x82')][_0x1deb0c][_0x053d('0x89')]));}}}if(_0x180c57[_0x053d('0x8a')]){_0x180c57[_0x053d('0x8a')]=JSON['parse'](_0x180c57[_0x053d('0x8a')]);_0x34295d[_0x053d('0x44')](_0x1b5ffc(_0x180c57['conditions'][_0x053d('0x70')]));}_0x162cbc=_0x34295d[_0x053d('0x8b')]();_0x34295d[_0x053d('0x25')](_0x4b4285);_0x34295d[_0x053d('0x23')](0x0);logger['debug'](_0x053d('0x8c'),_0x34295d['toString']());return dbH['sequelize'][_0x053d('0x39')](_0x34295d[_0x053d('0x8d')](),{'type':dbH[_0x053d('0x8e')][_0x053d('0x8f')]['SELECT']});}})[_0x053d('0x2c')](respondWithResult(_0x162755,null))[_0x053d('0x4b')](handleError(_0x162755,null));};function runReport(_0x1f05ba,_0x588850,_0x5b82e0){var _0x39355b=_0x588850['name'];var _0x4b30db=0xa;var _0x2783bb=['join','left_join','right_join',_0x053d('0x60')];var _0x4680b1={'SUM':_0x053d('0x61'),'COUNT':_0x053d('0x90'),'COUNT DISTINCT':_0x053d('0x62'),'MAX':_0x053d('0x91'),'MIN':'MIN(%s)','AVG':_0x053d('0x92'),'GROUP_CONCAT':_0x053d('0x64'),'GROUP_CONCAT ASC':_0x053d('0x65'),'GROUP_CONCAT DESC':_0x053d('0x93')};var _0x4a1841={'SEC_TO_TIME':_0x053d('0x66'),'DATE':_0x053d('0x67'),'HOUR':_0x053d('0x68'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x053d('0x6a')};var _0x19f3cd=function(_0x338877){return!_[_0x053d('0x84')](['IS\x20NULL',_0x053d('0x6c'),_0x053d('0x6d'),_0x053d('0x6e')],_0x338877);};var _0x504ddb=function(_0x25cdbf){if(!_0x25cdbf||!_0x25cdbf[_0x053d('0x6f')][_0x053d('0x3f')]){return'';}for(var _0x1a4764='(',_0x2fad06=0x0;_0x2fad06<_0x25cdbf[_0x053d('0x6f')]['length'];_0x2fad06+=0x1){_0x2fad06>0x0&&(_0x1a4764+='\x20'+_0x25cdbf[_0x053d('0x94')]+'\x20');_0x1a4764+=_0x25cdbf[_0x053d('0x6f')][_0x2fad06][_0x053d('0x70')]?_0x504ddb(_0x25cdbf[_0x053d('0x6f')][_0x2fad06]['group']):_0x25cdbf[_0x053d('0x6f')][_0x2fad06][_0x053d('0x71')]+'\x20'+_0x25cdbf[_0x053d('0x6f')][_0x2fad06][_0x053d('0x72')]+(_0x19f3cd(_0x25cdbf[_0x053d('0x6f')][_0x2fad06]['condition'])?'\x20'+_0x25cdbf[_0x053d('0x6f')][_0x2fad06][_0x053d('0x73')]:'');}return _0x1a4764+')';};var _0x31328e={'where':{'id':_0x1f05ba['id']}},_0x25e15d,_0x4f8d71,_0x375bbc,_0x3c04b8,_0x3888b9;_0x31328e=_[_0x053d('0x4f')]({},_0x31328e,_0x5b82e0);return db[_0x053d('0x51')][_0x053d('0x52')](_0x31328e)[_0x053d('0x2c')](function(_0x5d1823){if(_0x5d1823){_0x25e15d=_0x5d1823;return _0x5d1823[_0x053d('0x74')]();}return null;})[_0x053d('0x2c')](function(_0x1022aa){if(_0x1022aa){if(!_0x1022aa[_0x053d('0x3f')]){throw new db[(_0x053d('0x75'))][(_0x053d('0x76'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4f8d71=_0x1022aa;return db[_0x053d('0x78')][_0x053d('0x4a')]({'raw':!![]});}return null;})[_0x053d('0x2c')](function(_0x272922){if(_0x272922){_0x375bbc=_[_0x053d('0x79')](_0x272922,'id');var _0x48320d;var _0xfa9957=squel['select']();_0xfa9957[_0x053d('0x95')](_0x25e15d[_0x053d('0x88')]);for(var _0x2f4b92=0x0;_0x2f4b92<_0x4f8d71[_0x053d('0x3f')];_0x2f4b92+=0x1){_0x48320d=_0x4f8d71[_0x2f4b92][_0x053d('0x7a')]?_0x375bbc[_0x4f8d71[_0x2f4b92][_0x053d('0x7a')]][_0x053d('0x7b')]:_0x4f8d71[_0x2f4b92]['field'];_0x48320d=_0x4f8d71[_0x2f4b92][_0x053d('0x7d')]?_['replace'](_0x4680b1[_0x4f8d71[_0x2f4b92][_0x053d('0x7d')]],'%s',_0x48320d):_0x48320d;_0x48320d=_0x4f8d71[_0x2f4b92][_0x053d('0x7e')]?_[_0x053d('0x7c')](_0x4a1841[_0x4f8d71[_0x2f4b92]['format']],'%s',_0x48320d):_0x48320d;if(_0x4f8d71[_0x2f4b92][_0x053d('0x7f')]){_0xfa9957['group'](_0x48320d);}_0x4f8d71[_0x2f4b92]['orderBy']&&_0xfa9957['order'](_0x48320d,_0x4f8d71[_0x2f4b92]['orderBy']===_0x053d('0x96')?![]:!![]);_0xfa9957['field'](_0x48320d,_0x4f8d71[_0x2f4b92][_0x053d('0x81')]||_0x48320d);}if(_0x25e15d[_0x053d('0x82')]){_0x25e15d['joins']=JSON[_0x053d('0x83')](_0x25e15d[_0x053d('0x82')]);for(var _0x185485=0x0;_0x185485<_0x25e15d[_0x053d('0x82')][_0x053d('0x3f')];_0x185485+=0x1){if(_0x25e15d[_0x053d('0x82')][_0x185485][_0x053d('0x36')]&&_[_0x053d('0x84')](_0x2783bb,_0x25e15d[_0x053d('0x82')][_0x185485][_0x053d('0x36')])&&_0x25e15d[_0x053d('0x82')][_0x185485][_0x053d('0x85')]&&_0x25e15d[_0x053d('0x82')][_0x185485][_0x053d('0x86')]&&_0x25e15d[_0x053d('0x82')][_0x185485][_0x053d('0x89')]){_0xfa9957[_0x25e15d[_0x053d('0x82')][_0x185485][_0x053d('0x36')]](_0x25e15d[_0x053d('0x82')][_0x185485][_0x053d('0x86')],null,util[_0x053d('0x7e')](_0x053d('0x87'),_0x25e15d['table'],_0x25e15d[_0x053d('0x82')][_0x185485]['parentKey'],_0x25e15d[_0x053d('0x82')][_0x185485][_0x053d('0x86')],_0x25e15d[_0x053d('0x82')][_0x185485]['foreignKey']));}}}if(_0x25e15d['conditions']){_0x25e15d[_0x053d('0x8a')]=JSON['parse'](_0x25e15d[_0x053d('0x8a')]);_0xfa9957[_0x053d('0x44')](_0x504ddb(_0x25e15d[_0x053d('0x8a')]['group']));}_0x3888b9=_0xfa9957[_0x053d('0x8b')]();_0xfa9957[_0x053d('0x25')](_0x4b30db);_0xfa9957['offset'](0x0);return;}})[_0x053d('0x2c')](function(){if(_0x588850['output']===_0x053d('0x97')){return null;}var _0x4913a1=_[_0x053d('0x4f')](_0x588850,{'name':_0x588850['fullPath']||_0x588850['name']||_0x25e15d[_0x053d('0x31')],'basename':_0x39355b,'savename':util[_0x053d('0x7e')]('%s-%s.%s',_0x588850[_0x053d('0x31')]||_0x25e15d['name'],require(_0x053d('0x98'))['generate'](0x4),_0x588850['output']||_0x053d('0x99')),'reportId':_0x25e15d['id'],'reportType':_0x053d('0x9a')});return db[_0x053d('0x9b')][_0x053d('0x53')](_0x4913a1,{'raw':!![]});})['then'](function(_0x3492b6){if(_0x25e15d[_0x053d('0x88')]==='cdr'){_0x3888b9[_0x053d('0x44')](_0x25e15d['table']+_0x053d('0x9c'),_0x588850[_0x053d('0x9d')],_0x588850[_0x053d('0x9e')]);}else{_0x3888b9[_0x053d('0x44')](_0x25e15d[_0x053d('0x88')]+_0x053d('0x9f'),_0x588850['startDate'],_0x588850[_0x053d('0x9e')]);}if(_0x3492b6){logger[_0x053d('0xa0')](_0x053d('0xa1'),_0x3888b9[_0x053d('0x8d')]());require(_0x053d('0xa2'))['fork'](path[_0x053d('0x5d')](__dirname,_0x053d('0xa3'),_0x3492b6[_0x053d('0xa4')]),[_0x3492b6['id'],_0x3888b9[_0x053d('0x8d')](),path[_0x053d('0x5d')](__dirname,'../../files/reports',_0x3492b6['savename']),_0x39355b]);return _0x3492b6;}else{var _0x3a9154=squel[_0x053d('0xa5')]();_0x3a9154[_0x053d('0x95')]('('+_0x3888b9[_0x053d('0x8d')]()+')',_0x053d('0xa6'));_0x3a9154[_0x053d('0x71')](_0x053d('0xa7'),'count');_0x3888b9[_0x053d('0x25')](_0x588850[_0x053d('0x25')]||_0x4b30db);_0x3888b9['offset'](_0x588850[_0x053d('0x23')]||0x0);return dbH[_0x053d('0x8e')][_0x053d('0x39')](_0x3a9154[_0x053d('0x8d')](),{'type':dbH[_0x053d('0x8e')][_0x053d('0x8f')][_0x053d('0xa8')]})[_0x053d('0x2c')](function(_0xb9185a){if(!_0xb9185a[_0x053d('0x3f')]){_0x3c04b8=0x0;}else{_0x3c04b8=_0xb9185a[0x0][_0x053d('0x26')]||0x0;}return dbH[_0x053d('0x8e')][_0x053d('0x39')](_0x3888b9[_0x053d('0x8d')](),{'type':dbH[_0x053d('0x8e')][_0x053d('0x8f')][_0x053d('0xa8')]});})[_0x053d('0x2c')](function(_0x31304c){return{'rows':_0x31304c||[],'count':_0x3c04b8};});}});}exports[_0x053d('0xa9')]=function(_0x1418a8,_0x359cde){return runReport(_0x1418a8['params'],_0x1418a8[_0x053d('0x39')],_0x1418a8[_0x053d('0x50')])[_0x053d('0x2c')](respondWithResult(_0x359cde,null))[_0x053d('0x4b')](handleError(_0x359cde,null));};exports[_0x053d('0xaa')]=runReport;exports[_0x053d('0x39')]=function(_0x4e168c,_0x4c31f9){var _0x389b42=0xa;var _0x86c6df=[_0x053d('0x5d'),_0x053d('0x5e'),_0x053d('0x5f'),_0x053d('0x60')];var _0x2e8c1a={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x053d('0x63'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x053d('0x64'),'GROUP_CONCAT ASC':_0x053d('0x65'),'GROUP_CONCAT DESC':_0x053d('0x93')};var _0x358dc9={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x053d('0x67'),'HOUR':_0x053d('0x68'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x178ff=function(_0xfd85b0){return!_[_0x053d('0x84')](['IS\x20NULL',_0x053d('0x6c'),_0x053d('0x6d'),_0x053d('0x6e')],_0xfd85b0);};var _0x24d8c8=function(_0x32762c){if(!_0x32762c||!_0x32762c[_0x053d('0x6f')]['length']){return'';}for(var _0x1c553f='(',_0x58af8d=0x0;_0x58af8d<_0x32762c['rules'][_0x053d('0x3f')];_0x58af8d+=0x1){_0x58af8d>0x0&&(_0x1c553f+='\x20'+_0x32762c[_0x053d('0x94')]+'\x20');_0x1c553f+=_0x32762c[_0x053d('0x6f')][_0x58af8d][_0x053d('0x70')]?_0x24d8c8(_0x32762c[_0x053d('0x6f')][_0x58af8d][_0x053d('0x70')]):_0x32762c[_0x053d('0x6f')][_0x58af8d]['field']+'\x20'+_0x32762c[_0x053d('0x6f')][_0x58af8d]['condition']+(_0x178ff(_0x32762c[_0x053d('0x6f')][_0x58af8d][_0x053d('0x72')])?'\x20'+_0x32762c['rules'][_0x58af8d][_0x053d('0x73')]:'');}return _0x1c553f+')';};var _0x144362={'where':{'id':_0x4e168c[_0x053d('0x4d')]['id']}},_0x4aae03,_0x2658c5,_0x2ebc3f,_0x2d6a0b,_0x3e4e20;_0x144362=_[_0x053d('0x4f')]({},_0x144362,_0x4e168c[_0x053d('0x50')]);return db['AnalyticCustomReport'][_0x053d('0x52')](_0x144362)[_0x053d('0x2c')](function(_0x50022c){if(_0x50022c){_0x4aae03=_0x50022c;return _0x50022c[_0x053d('0x74')]();}return null;})[_0x053d('0x2c')](function(_0x2cfdd6){if(_0x2cfdd6){if(!_0x2cfdd6[_0x053d('0x3f')]){throw new db[(_0x053d('0x75'))][(_0x053d('0x76'))](_0x053d('0x77'),0x193);}_0x2658c5=_0x2cfdd6;return db['AnalyticMetric'][_0x053d('0x4a')]({'raw':!![]});}return null;})[_0x053d('0x2c')](function(_0x6061f3){if(_0x6061f3){_0x2ebc3f=_[_0x053d('0x79')](_0x6061f3,'id');var _0x9a1de0;var _0x796cea=squel['select']();_0x796cea[_0x053d('0x95')](_0x4aae03[_0x053d('0x88')]);for(var _0x214f81=0x0;_0x214f81<_0x2658c5[_0x053d('0x3f')];_0x214f81+=0x1){_0x9a1de0=_0x2658c5[_0x214f81][_0x053d('0x7a')]?_0x2ebc3f[_0x2658c5[_0x214f81]['MetricId']]['metric']:_0x2658c5[_0x214f81]['field'];_0x9a1de0=_0x2658c5[_0x214f81][_0x053d('0x7d')]?_[_0x053d('0x7c')](_0x2e8c1a[_0x2658c5[_0x214f81][_0x053d('0x7d')]],'%s',_0x9a1de0):_0x9a1de0;_0x9a1de0=_0x2658c5[_0x214f81][_0x053d('0x7e')]?_[_0x053d('0x7c')](_0x358dc9[_0x2658c5[_0x214f81][_0x053d('0x7e')]],'%s',_0x9a1de0):_0x9a1de0;if(_0x2658c5[_0x214f81][_0x053d('0x7f')]){_0x796cea[_0x053d('0x70')](_0x9a1de0);}_0x2658c5[_0x214f81][_0x053d('0x80')]&&_0x796cea[_0x053d('0x42')](_0x9a1de0,_0x2658c5[_0x214f81][_0x053d('0x80')]==='DESC'?![]:!![]);_0x796cea[_0x053d('0x71')](_0x9a1de0,_0x2658c5[_0x214f81][_0x053d('0x81')]||_0x9a1de0);}if(_0x4aae03[_0x053d('0x82')]){_0x4aae03['joins']=JSON[_0x053d('0x83')](_0x4aae03[_0x053d('0x82')]);for(var _0x27d58e=0x0;_0x27d58e<_0x4aae03[_0x053d('0x82')][_0x053d('0x3f')];_0x27d58e+=0x1){if(_0x4aae03[_0x053d('0x82')][_0x27d58e][_0x053d('0x36')]&&_[_0x053d('0x84')](_0x86c6df,_0x4aae03[_0x053d('0x82')][_0x27d58e][_0x053d('0x36')])&&_0x4aae03[_0x053d('0x82')][_0x27d58e][_0x053d('0x85')]&&_0x4aae03['joins'][_0x27d58e][_0x053d('0x86')]&&_0x4aae03[_0x053d('0x82')][_0x27d58e]['foreignKey']){_0x796cea[_0x4aae03['joins'][_0x27d58e][_0x053d('0x36')]](_0x4aae03[_0x053d('0x82')][_0x27d58e][_0x053d('0x86')],null,util[_0x053d('0x7e')]('%s.%s\x20=\x20%s.%s',_0x4aae03[_0x053d('0x88')],_0x4aae03[_0x053d('0x82')][_0x27d58e]['parentKey'],_0x4aae03['joins'][_0x27d58e][_0x053d('0x86')],_0x4aae03['joins'][_0x27d58e][_0x053d('0x89')]));}}}if(_0x4aae03['conditions']){_0x4aae03[_0x053d('0x8a')]=JSON[_0x053d('0x83')](_0x4aae03[_0x053d('0x8a')]);_0x796cea[_0x053d('0x44')](_0x24d8c8(_0x4aae03[_0x053d('0x8a')]['group']));}_0x3e4e20=_0x796cea[_0x053d('0x8b')]();_0x796cea[_0x053d('0x25')](_0x389b42);_0x796cea[_0x053d('0x23')](0x0);logger['debug'](_0x053d('0x8c'),_0x796cea[_0x053d('0x8d')]());return dbH['sequelize'][_0x053d('0x39')](_0x796cea['toString'](),{'type':dbH[_0x053d('0x8e')][_0x053d('0x8f')][_0x053d('0xa8')]});}})[_0x053d('0x2c')](function(){return{'sql':_0x3e4e20['toString']()};})['then'](respondWithResult(_0x4c31f9,null))['catch'](handleError(_0x4c31f9,null));};
\ No newline at end of file
+var _0xc2d3=['Reports','userProfileId','autoAssociation','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%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)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','table','MetricId','function','replace','format','orderBy','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','IS\x20NULL','AnalyticMetric','select','from','groupBy','order','DESC','alias','output','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','GROUP_CONCAT(%s)','metric','debug','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','CustomReports','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','AnalyticCustomReport','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xc2d3,0xfe));var _0x3c2d=function(_0x34ac82,_0x5dbaeb){_0x34ac82=_0x34ac82-0x0;var _0x119517=_0xc2d3[_0x34ac82];return _0x119517;};'use strict';var emlformat=require(_0x3c2d('0x0'));var rimraf=require(_0x3c2d('0x1'));var zipdir=require(_0x3c2d('0x2'));var jsonpatch=require(_0x3c2d('0x3'));var rp=require(_0x3c2d('0x4'));var moment=require('moment');var BPromise=require(_0x3c2d('0x5'));var Mustache=require(_0x3c2d('0x6'));var util=require('util');var path=require(_0x3c2d('0x7'));var sox=require(_0x3c2d('0x8'));var csv=require(_0x3c2d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3c2d('0xa'));var _=require(_0x3c2d('0xb'));var squel=require(_0x3c2d('0xc'));var crypto=require(_0x3c2d('0xd'));var jsforce=require(_0x3c2d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3c2d('0x9'));var querystring=require(_0x3c2d('0xf'));var Papa=require(_0x3c2d('0x10'));var Redis=require(_0x3c2d('0x11'));var authService=require(_0x3c2d('0x12'));var qs=require(_0x3c2d('0x13'));var as=require(_0x3c2d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3c2d('0x15'))(_0x3c2d('0x16'));var utils=require('../../config/utils');var config=require(_0x3c2d('0x17'));var licenseUtil=require(_0x3c2d('0x18'));var db=require(_0x3c2d('0x19'))['db'];var dbH=require('../../mysqldb')[_0x3c2d('0x1a')];function respondWithStatusCode(_0x1df940,_0x437bd4){_0x437bd4=_0x437bd4||0xcc;return function(_0x3dc4fd){if(_0x3dc4fd){return _0x1df940[_0x3c2d('0x1b')](_0x437bd4);}return _0x1df940[_0x3c2d('0x1c')](_0x437bd4)[_0x3c2d('0x1d')]();};}function respondWithResult(_0x4ab002,_0x247d7d){_0x247d7d=_0x247d7d||0xc8;return function(_0x132417){if(_0x132417){return _0x4ab002[_0x3c2d('0x1c')](_0x247d7d)[_0x3c2d('0x1e')](_0x132417);}};}function respondWithFilteredResult(_0x4e6104,_0x5e8e71){return function(_0x5f087e){if(_0x5f087e){var _0x1fe6e1=typeof _0x5e8e71[_0x3c2d('0x1f')]===_0x3c2d('0x20')&&typeof _0x5e8e71[_0x3c2d('0x21')]===_0x3c2d('0x20');var _0x11325d=_0x5f087e[_0x3c2d('0x22')];var _0x22db0e=_0x1fe6e1?0x0:_0x5e8e71['offset'];var _0x27abf1=_0x1fe6e1?_0x5f087e[_0x3c2d('0x22')]:_0x5e8e71[_0x3c2d('0x1f')]+_0x5e8e71[_0x3c2d('0x21')];var _0x581f75;if(_0x27abf1>=_0x11325d){_0x27abf1=_0x11325d;_0x581f75=0xc8;}else{_0x581f75=0xce;}_0x4e6104[_0x3c2d('0x1c')](_0x581f75);return _0x4e6104[_0x3c2d('0x23')]('Content-Range',_0x22db0e+'-'+_0x27abf1+'/'+_0x11325d)['json'](_0x5f087e);}return null;};}function patchUpdates(_0x2c3933){return function(_0x2f2780){try{jsonpatch[_0x3c2d('0x24')](_0x2f2780,_0x2c3933,!![]);}catch(_0x1b3317){return BPromise[_0x3c2d('0x25')](_0x1b3317);}return _0x2f2780[_0x3c2d('0x26')]();};}function saveUpdates(_0x54c454,_0xf14fb9){return function(_0x78e4b2){if(_0x78e4b2){return _0x78e4b2[_0x3c2d('0x27')](_0x54c454)[_0x3c2d('0x28')](function(_0x436d50){return _0x436d50;});}return null;};}function removeEntity(_0x554777,_0x3a2694){return function(_0x399eaa){if(_0x399eaa){return _0x399eaa[_0x3c2d('0x29')]()[_0x3c2d('0x28')](function(){var _0x5ccad3=_0x399eaa['get']({'plain':!![]});var _0x66f790=_0x3c2d('0x2a');return db[_0x3c2d('0x2b')][_0x3c2d('0x29')]({'where':{'type':_0x66f790,'resourceId':_0x5ccad3['id']}})[_0x3c2d('0x28')](function(){return _0x399eaa;});})[_0x3c2d('0x28')](function(){_0x554777[_0x3c2d('0x1c')](0xcc)[_0x3c2d('0x1d')]();});}};}function handleEntityNotFound(_0x46ea0b,_0x1c9068){return function(_0x5306f4){if(!_0x5306f4){_0x46ea0b[_0x3c2d('0x1b')](0x194);}return _0x5306f4;};}function handleError(_0x50e4f7,_0x15a630){_0x15a630=_0x15a630||0x1f4;return function(_0x35fe3f){logger[_0x3c2d('0x2c')](_0x35fe3f[_0x3c2d('0x2d')]);if(_0x35fe3f[_0x3c2d('0x2e')]){delete _0x35fe3f['name'];}_0x50e4f7['status'](_0x15a630)[_0x3c2d('0x2f')](_0x35fe3f);};}exports[_0x3c2d('0x30')]=function(_0x387263,_0x3e794a){var _0x6905dc={},_0x432fe9={},_0x5752c6={'count':0x0,'rows':[]};var _0x12fa8d=_['map'](db['AnalyticCustomReport'][_0x3c2d('0x31')],function(_0xea7a1e){return{'name':_0xea7a1e[_0x3c2d('0x32')],'type':_0xea7a1e[_0x3c2d('0x33')][_0x3c2d('0x34')]};});_0x432fe9['model']=_['map'](_0x12fa8d,_0x3c2d('0x2e'));_0x432fe9[_0x3c2d('0x35')]=_['keys'](_0x387263[_0x3c2d('0x35')]);_0x432fe9[_0x3c2d('0x36')]=_['intersection'](_0x432fe9[_0x3c2d('0x37')],_0x432fe9[_0x3c2d('0x35')]);_0x6905dc[_0x3c2d('0x38')]=_[_0x3c2d('0x39')](_0x432fe9[_0x3c2d('0x37')],qs[_0x3c2d('0x3a')](_0x387263[_0x3c2d('0x35')][_0x3c2d('0x3a')]));_0x6905dc[_0x3c2d('0x38')]=_0x6905dc['attributes'][_0x3c2d('0x3b')]?_0x6905dc['attributes']:_0x432fe9[_0x3c2d('0x37')];if(!_0x387263[_0x3c2d('0x35')][_0x3c2d('0x3c')](_0x3c2d('0x3d'))){_0x6905dc[_0x3c2d('0x21')]=qs[_0x3c2d('0x21')](_0x387263[_0x3c2d('0x35')]['limit']);_0x6905dc[_0x3c2d('0x1f')]=qs[_0x3c2d('0x1f')](_0x387263[_0x3c2d('0x35')][_0x3c2d('0x1f')]);}_0x6905dc['order']=qs[_0x3c2d('0x3e')](_0x387263[_0x3c2d('0x35')]['sort']);_0x6905dc[_0x3c2d('0x3f')]=qs['filters'](_[_0x3c2d('0x40')](_0x387263[_0x3c2d('0x35')],_0x432fe9[_0x3c2d('0x36')]),_0x12fa8d);if(_0x387263[_0x3c2d('0x35')][_0x3c2d('0x41')]){_0x6905dc[_0x3c2d('0x3f')]=_['merge'](_0x6905dc[_0x3c2d('0x3f')],{'$or':_['map'](_0x12fa8d,function(_0x4916df){if(_0x4916df['type']!=='VIRTUAL'){var _0x218a67={};_0x218a67[_0x4916df[_0x3c2d('0x2e')]]={'$like':'%'+_0x387263['query']['filter']+'%'};return _0x218a67;}})});}_0x6905dc=_[_0x3c2d('0x42')]({},_0x6905dc,_0x387263[_0x3c2d('0x43')]);var _0x4be102={'where':_0x6905dc[_0x3c2d('0x3f')]};return db[_0x3c2d('0x44')][_0x3c2d('0x22')](_0x4be102)[_0x3c2d('0x28')](function(_0x1fcec3){_0x5752c6[_0x3c2d('0x22')]=_0x1fcec3;if(_0x387263[_0x3c2d('0x35')][_0x3c2d('0x45')]){_0x6905dc['include']=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x3c2d('0x46')](_0x6905dc);})[_0x3c2d('0x28')](function(_0x3a5540){_0x5752c6[_0x3c2d('0x47')]=_0x3a5540;return _0x5752c6;})[_0x3c2d('0x28')](respondWithFilteredResult(_0x3e794a,_0x6905dc))[_0x3c2d('0x48')](handleError(_0x3e794a,null));};exports[_0x3c2d('0x49')]=function(_0x20aa03,_0x3acc38){var _0x42271d={'raw':![],'where':{'id':_0x20aa03[_0x3c2d('0x4a')]['id']}},_0x4e9201={};_0x4e9201[_0x3c2d('0x37')]=_[_0x3c2d('0x4b')](db[_0x3c2d('0x44')][_0x3c2d('0x31')]);_0x4e9201[_0x3c2d('0x35')]=_[_0x3c2d('0x4b')](_0x20aa03[_0x3c2d('0x35')]);_0x4e9201[_0x3c2d('0x36')]=_[_0x3c2d('0x39')](_0x4e9201['model'],_0x4e9201[_0x3c2d('0x35')]);_0x42271d[_0x3c2d('0x38')]=_['intersection'](_0x4e9201[_0x3c2d('0x37')],qs[_0x3c2d('0x3a')](_0x20aa03[_0x3c2d('0x35')]['fields']));_0x42271d[_0x3c2d('0x38')]=_0x42271d[_0x3c2d('0x38')][_0x3c2d('0x3b')]?_0x42271d[_0x3c2d('0x38')]:_0x4e9201[_0x3c2d('0x37')];if(_0x20aa03['query'][_0x3c2d('0x45')]){_0x42271d[_0x3c2d('0x4c')]=[{'all':!![]}];}_0x42271d=_['merge']({},_0x42271d,_0x20aa03[_0x3c2d('0x43')]);return db['AnalyticCustomReport'][_0x3c2d('0x4d')](_0x42271d)['then'](handleEntityNotFound(_0x3acc38,null))[_0x3c2d('0x28')](respondWithResult(_0x3acc38,null))[_0x3c2d('0x48')](handleError(_0x3acc38,null));};exports[_0x3c2d('0x4e')]=function(_0x24058f,_0x37b78d){return db['AnalyticCustomReport']['create'](_0x24058f[_0x3c2d('0x4f')],{})[_0x3c2d('0x28')](function(_0x10efb7){var _0x4a109a=_0x24058f[_0x3c2d('0x50')][_0x3c2d('0x51')]({'plain':!![]});if(!_0x4a109a)throw new Error(_0x3c2d('0x52'));if(_0x4a109a[_0x3c2d('0x53')]==='user'){var _0x445c8c=_0x10efb7[_0x3c2d('0x51')]({'plain':!![]});var _0x28ff76=_0x3c2d('0x54');return db['UserProfileSection'][_0x3c2d('0x4d')]({'where':{'name':_0x28ff76,'userProfileId':_0x4a109a[_0x3c2d('0x55')]},'raw':!![]})[_0x3c2d('0x28')](function(_0xc1da55){if(_0xc1da55&&_0xc1da55[_0x3c2d('0x56')]===0x0){return db[_0x3c2d('0x2b')][_0x3c2d('0x4e')]({'name':_0x445c8c[_0x3c2d('0x2e')],'resourceId':_0x445c8c['id'],'type':'CustomReports','sectionId':_0xc1da55['id']},{})['then'](function(){return _0x10efb7;});}else{return _0x10efb7;}})['catch'](function(_0xd796d){logger[_0x3c2d('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd796d);throw _0xd796d;});}return _0x10efb7;})['then'](respondWithResult(_0x37b78d,0xc9))['catch'](handleError(_0x37b78d,null));};exports[_0x3c2d('0x27')]=function(_0x4a0f23,_0x38b5b2){if(_0x4a0f23['body']['id']){delete _0x4a0f23[_0x3c2d('0x4f')]['id'];}return db[_0x3c2d('0x44')][_0x3c2d('0x4d')]({'where':{'id':_0x4a0f23[_0x3c2d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x38b5b2,null))[_0x3c2d('0x28')](saveUpdates(_0x4a0f23[_0x3c2d('0x4f')],null))[_0x3c2d('0x28')](respondWithResult(_0x38b5b2,null))[_0x3c2d('0x48')](handleError(_0x38b5b2,null));};exports[_0x3c2d('0x29')]=function(_0xbbba3a,_0x12a849){return db[_0x3c2d('0x44')][_0x3c2d('0x4d')]({'where':{'id':_0xbbba3a[_0x3c2d('0x4a')]['id']}})[_0x3c2d('0x28')](handleEntityNotFound(_0x12a849,null))[_0x3c2d('0x28')](removeEntity(_0x12a849,null))[_0x3c2d('0x48')](handleError(_0x12a849,null));};exports[_0x3c2d('0x57')]=function(_0xe1bb4e,_0x485bd7){var _0x50345d=0xa;var _0x16495e=[_0x3c2d('0x58'),_0x3c2d('0x59'),_0x3c2d('0x5a'),_0x3c2d('0x5b')];var _0x48b8c4={'SUM':_0x3c2d('0x5c'),'COUNT':_0x3c2d('0x5d'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x3c2d('0x5e'),'MIN':_0x3c2d('0x5f'),'AVG':_0x3c2d('0x60'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x3c2d('0x61'),'GROUP_CONCAT DESC':_0x3c2d('0x62')};var _0x4ef52c={'SEC_TO_TIME':_0x3c2d('0x63'),'DATE':_0x3c2d('0x64'),'HOUR':_0x3c2d('0x65'),'ROUND':_0x3c2d('0x66'),'UNIX_TIMESTAMP':_0x3c2d('0x67')};var _0x5129a3=function(_0xcc4bac){return!_[_0x3c2d('0x68')](['IS\x20NULL',_0x3c2d('0x69'),_0x3c2d('0x6a'),_0x3c2d('0x6b')],_0xcc4bac);};var _0x1ae297=function(_0x371875){if(!_0x371875||!_0x371875[_0x3c2d('0x6c')][_0x3c2d('0x3b')]){return'';}for(var _0x432cae='(',_0x1f5d09=0x0;_0x1f5d09<_0x371875[_0x3c2d('0x6c')]['length'];_0x1f5d09+=0x1){_0x1f5d09>0x0&&(_0x432cae+='\x20'+_0x371875[_0x3c2d('0x6d')]+'\x20');_0x432cae+=_0x371875[_0x3c2d('0x6c')][_0x1f5d09][_0x3c2d('0x6e')]?_0x1ae297(_0x371875[_0x3c2d('0x6c')][_0x1f5d09][_0x3c2d('0x6e')]):_0x371875[_0x3c2d('0x6c')][_0x1f5d09][_0x3c2d('0x6f')]+'\x20'+_0x371875[_0x3c2d('0x6c')][_0x1f5d09][_0x3c2d('0x70')]+(_0x5129a3(_0x371875[_0x3c2d('0x6c')][_0x1f5d09][_0x3c2d('0x70')])?'\x20'+_0x371875[_0x3c2d('0x6c')][_0x1f5d09][_0x3c2d('0x71')]:'');}return _0x432cae+')';};var _0x287c7d={'where':{'id':_0xe1bb4e[_0x3c2d('0x4a')]['id']}},_0x1a2ab7,_0x4f022e,_0x33d2ce,_0x401547,_0x264430;_0x287c7d=_[_0x3c2d('0x42')]({},_0x287c7d,_0xe1bb4e['options']);return db[_0x3c2d('0x44')][_0x3c2d('0x4d')](_0x287c7d)[_0x3c2d('0x28')](function(_0x838bcf){if(_0x838bcf){_0x1a2ab7=_0x838bcf;return _0x838bcf[_0x3c2d('0x72')]();}return null;})[_0x3c2d('0x28')](function(_0x53de22){if(_0x53de22){if(!_0x53de22[_0x3c2d('0x3b')]){throw new db[(_0x3c2d('0x73'))][(_0x3c2d('0x74'))](_0x3c2d('0x75'),0x193);}_0x4f022e=_0x53de22;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x3c2d('0x28')](function(_0x11e619){if(_0x11e619){_0x33d2ce=_[_0x3c2d('0x76')](_0x11e619,'id');var _0x4eb72e;var _0x29e6ea=squel['select']();_0x29e6ea['from'](_0x1a2ab7[_0x3c2d('0x77')]);for(var _0x52e75f=0x0;_0x52e75f<_0x4f022e[_0x3c2d('0x3b')];_0x52e75f+=0x1){_0x4eb72e=_0x4f022e[_0x52e75f][_0x3c2d('0x78')]?_0x33d2ce[_0x4f022e[_0x52e75f][_0x3c2d('0x78')]]['metric']:_0x4f022e[_0x52e75f][_0x3c2d('0x6f')];_0x4eb72e=_0x4f022e[_0x52e75f][_0x3c2d('0x79')]?_[_0x3c2d('0x7a')](_0x48b8c4[_0x4f022e[_0x52e75f]['function']],'%s',_0x4eb72e):_0x4eb72e;_0x4eb72e=_0x4f022e[_0x52e75f][_0x3c2d('0x7b')]?_[_0x3c2d('0x7a')](_0x4ef52c[_0x4f022e[_0x52e75f][_0x3c2d('0x7b')]],'%s',_0x4eb72e):_0x4eb72e;if(_0x4f022e[_0x52e75f]['groupBy']){_0x29e6ea['group'](_0x4eb72e);}_0x4f022e[_0x52e75f][_0x3c2d('0x7c')]&&_0x29e6ea['order'](_0x4eb72e,_0x4f022e[_0x52e75f][_0x3c2d('0x7c')]==='DESC'?![]:!![]);_0x29e6ea[_0x3c2d('0x6f')](_0x4eb72e,_0x4f022e[_0x52e75f]['alias']||_0x4eb72e);}if(_0x1a2ab7[_0x3c2d('0x7d')]){_0x1a2ab7[_0x3c2d('0x7d')]=JSON[_0x3c2d('0x7e')](_0x1a2ab7[_0x3c2d('0x7d')]);for(var _0x2607f8=0x0;_0x2607f8<_0x1a2ab7[_0x3c2d('0x7d')]['length'];_0x2607f8+=0x1){if(_0x1a2ab7[_0x3c2d('0x7d')][_0x2607f8][_0x3c2d('0x33')]&&_[_0x3c2d('0x68')](_0x16495e,_0x1a2ab7['joins'][_0x2607f8][_0x3c2d('0x33')])&&_0x1a2ab7[_0x3c2d('0x7d')][_0x2607f8][_0x3c2d('0x7f')]&&_0x1a2ab7[_0x3c2d('0x7d')][_0x2607f8][_0x3c2d('0x80')]&&_0x1a2ab7['joins'][_0x2607f8][_0x3c2d('0x81')]){_0x29e6ea[_0x1a2ab7[_0x3c2d('0x7d')][_0x2607f8][_0x3c2d('0x33')]](_0x1a2ab7[_0x3c2d('0x7d')][_0x2607f8]['foreignTable'],null,util[_0x3c2d('0x7b')](_0x3c2d('0x82'),_0x1a2ab7['table'],_0x1a2ab7[_0x3c2d('0x7d')][_0x2607f8][_0x3c2d('0x7f')],_0x1a2ab7[_0x3c2d('0x7d')][_0x2607f8][_0x3c2d('0x80')],_0x1a2ab7[_0x3c2d('0x7d')][_0x2607f8][_0x3c2d('0x81')]));}}}if(_0x1a2ab7[_0x3c2d('0x83')]){_0x1a2ab7[_0x3c2d('0x83')]=JSON[_0x3c2d('0x7e')](_0x1a2ab7['conditions']);_0x29e6ea[_0x3c2d('0x3f')](_0x1ae297(_0x1a2ab7[_0x3c2d('0x83')][_0x3c2d('0x6e')]));}_0x264430=_0x29e6ea[_0x3c2d('0x84')]();_0x29e6ea[_0x3c2d('0x21')](_0x50345d);_0x29e6ea[_0x3c2d('0x1f')](0x0);logger['debug'](_0x3c2d('0x85'),_0x29e6ea[_0x3c2d('0x86')]());return dbH[_0x3c2d('0x87')][_0x3c2d('0x35')](_0x29e6ea[_0x3c2d('0x86')](),{'type':dbH[_0x3c2d('0x87')][_0x3c2d('0x88')]['SELECT']});}})['then'](respondWithResult(_0x485bd7,null))[_0x3c2d('0x48')](handleError(_0x485bd7,null));};function runReport(_0xbffd12,_0x3458ed,_0x341565){var _0x3d8161=_0x3458ed['name'];var _0x3d0b54=0xa;var _0x27cdd0=[_0x3c2d('0x58'),_0x3c2d('0x59'),_0x3c2d('0x5a'),_0x3c2d('0x5b')];var _0x389541={'SUM':_0x3c2d('0x5c'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x3c2d('0x5e'),'MIN':_0x3c2d('0x5f'),'AVG':_0x3c2d('0x60'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x3c2d('0x61'),'GROUP_CONCAT DESC':_0x3c2d('0x62')};var _0x5da9cd={'SEC_TO_TIME':_0x3c2d('0x63'),'DATE':_0x3c2d('0x64'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x3c2d('0x67')};var _0x28b479=function(_0x3f08e4){return!_[_0x3c2d('0x68')]([_0x3c2d('0x89'),_0x3c2d('0x69'),'IS\x20EMPTY',_0x3c2d('0x6b')],_0x3f08e4);};var _0x39d234=function(_0x214bb4){if(!_0x214bb4||!_0x214bb4['rules'][_0x3c2d('0x3b')]){return'';}for(var _0x141454='(',_0x48a7c6=0x0;_0x48a7c6<_0x214bb4[_0x3c2d('0x6c')][_0x3c2d('0x3b')];_0x48a7c6+=0x1){_0x48a7c6>0x0&&(_0x141454+='\x20'+_0x214bb4[_0x3c2d('0x6d')]+'\x20');_0x141454+=_0x214bb4[_0x3c2d('0x6c')][_0x48a7c6]['group']?_0x39d234(_0x214bb4[_0x3c2d('0x6c')][_0x48a7c6][_0x3c2d('0x6e')]):_0x214bb4[_0x3c2d('0x6c')][_0x48a7c6][_0x3c2d('0x6f')]+'\x20'+_0x214bb4[_0x3c2d('0x6c')][_0x48a7c6][_0x3c2d('0x70')]+(_0x28b479(_0x214bb4[_0x3c2d('0x6c')][_0x48a7c6]['condition'])?'\x20'+_0x214bb4[_0x3c2d('0x6c')][_0x48a7c6]['value']:'');}return _0x141454+')';};var _0x1105a0={'where':{'id':_0xbffd12['id']}},_0x4b617b,_0x413b7e,_0x18c37c,_0x5ab646,_0x31e629;_0x1105a0=_[_0x3c2d('0x42')]({},_0x1105a0,_0x341565);return db['AnalyticCustomReport']['find'](_0x1105a0)[_0x3c2d('0x28')](function(_0x39d2dd){if(_0x39d2dd){_0x4b617b=_0x39d2dd;return _0x39d2dd[_0x3c2d('0x72')]();}return null;})[_0x3c2d('0x28')](function(_0x31e5ef){if(_0x31e5ef){if(!_0x31e5ef[_0x3c2d('0x3b')]){throw new db['Sequelize']['ValidationErrorItem'](_0x3c2d('0x75'),0x193);}_0x413b7e=_0x31e5ef;return db[_0x3c2d('0x8a')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x18ce5d){if(_0x18ce5d){_0x18c37c=_['keyBy'](_0x18ce5d,'id');var _0x16a7ee;var _0xac227a=squel[_0x3c2d('0x8b')]();_0xac227a[_0x3c2d('0x8c')](_0x4b617b[_0x3c2d('0x77')]);for(var _0x3038b8=0x0;_0x3038b8<_0x413b7e[_0x3c2d('0x3b')];_0x3038b8+=0x1){_0x16a7ee=_0x413b7e[_0x3038b8][_0x3c2d('0x78')]?_0x18c37c[_0x413b7e[_0x3038b8][_0x3c2d('0x78')]]['metric']:_0x413b7e[_0x3038b8][_0x3c2d('0x6f')];_0x16a7ee=_0x413b7e[_0x3038b8][_0x3c2d('0x79')]?_['replace'](_0x389541[_0x413b7e[_0x3038b8][_0x3c2d('0x79')]],'%s',_0x16a7ee):_0x16a7ee;_0x16a7ee=_0x413b7e[_0x3038b8][_0x3c2d('0x7b')]?_[_0x3c2d('0x7a')](_0x5da9cd[_0x413b7e[_0x3038b8][_0x3c2d('0x7b')]],'%s',_0x16a7ee):_0x16a7ee;if(_0x413b7e[_0x3038b8][_0x3c2d('0x8d')]){_0xac227a[_0x3c2d('0x6e')](_0x16a7ee);}_0x413b7e[_0x3038b8]['orderBy']&&_0xac227a[_0x3c2d('0x8e')](_0x16a7ee,_0x413b7e[_0x3038b8][_0x3c2d('0x7c')]===_0x3c2d('0x8f')?![]:!![]);_0xac227a['field'](_0x16a7ee,_0x413b7e[_0x3038b8][_0x3c2d('0x90')]||_0x16a7ee);}if(_0x4b617b['joins']){_0x4b617b[_0x3c2d('0x7d')]=JSON[_0x3c2d('0x7e')](_0x4b617b['joins']);for(var _0x1e6f7d=0x0;_0x1e6f7d<_0x4b617b[_0x3c2d('0x7d')]['length'];_0x1e6f7d+=0x1){if(_0x4b617b[_0x3c2d('0x7d')][_0x1e6f7d][_0x3c2d('0x33')]&&_['includes'](_0x27cdd0,_0x4b617b[_0x3c2d('0x7d')][_0x1e6f7d][_0x3c2d('0x33')])&&_0x4b617b['joins'][_0x1e6f7d][_0x3c2d('0x7f')]&&_0x4b617b[_0x3c2d('0x7d')][_0x1e6f7d][_0x3c2d('0x80')]&&_0x4b617b[_0x3c2d('0x7d')][_0x1e6f7d][_0x3c2d('0x81')]){_0xac227a[_0x4b617b[_0x3c2d('0x7d')][_0x1e6f7d][_0x3c2d('0x33')]](_0x4b617b[_0x3c2d('0x7d')][_0x1e6f7d][_0x3c2d('0x80')],null,util[_0x3c2d('0x7b')](_0x3c2d('0x82'),_0x4b617b[_0x3c2d('0x77')],_0x4b617b[_0x3c2d('0x7d')][_0x1e6f7d][_0x3c2d('0x7f')],_0x4b617b[_0x3c2d('0x7d')][_0x1e6f7d][_0x3c2d('0x80')],_0x4b617b['joins'][_0x1e6f7d]['foreignKey']));}}}if(_0x4b617b[_0x3c2d('0x83')]){_0x4b617b['conditions']=JSON[_0x3c2d('0x7e')](_0x4b617b[_0x3c2d('0x83')]);_0xac227a[_0x3c2d('0x3f')](_0x39d234(_0x4b617b[_0x3c2d('0x83')]['group']));}_0x31e629=_0xac227a[_0x3c2d('0x84')]();_0xac227a['limit'](_0x3d0b54);_0xac227a[_0x3c2d('0x1f')](0x0);return;}})[_0x3c2d('0x28')](function(){if(_0x3458ed[_0x3c2d('0x91')]==='web'){return null;}var _0x402eda=_[_0x3c2d('0x42')](_0x3458ed,{'name':_0x3458ed['fullPath']||_0x3458ed[_0x3c2d('0x2e')]||_0x4b617b[_0x3c2d('0x2e')],'basename':_0x3d8161,'savename':util[_0x3c2d('0x7b')](_0x3c2d('0x92'),_0x3458ed[_0x3c2d('0x2e')]||_0x4b617b[_0x3c2d('0x2e')],require(_0x3c2d('0x93'))[_0x3c2d('0x94')](0x4),_0x3458ed[_0x3c2d('0x91')]||_0x3c2d('0x95')),'reportId':_0x4b617b['id'],'reportType':_0x3c2d('0x96')});return db[_0x3c2d('0x97')]['create'](_0x402eda,{'raw':!![]});})[_0x3c2d('0x28')](function(_0x28e89f){if(_0x4b617b[_0x3c2d('0x77')]==='cdr'){_0x31e629[_0x3c2d('0x3f')](_0x4b617b[_0x3c2d('0x77')]+_0x3c2d('0x98'),_0x3458ed[_0x3c2d('0x99')],_0x3458ed[_0x3c2d('0x9a')]);}else{_0x31e629['where'](_0x4b617b[_0x3c2d('0x77')]+_0x3c2d('0x9b'),_0x3458ed[_0x3c2d('0x99')],_0x3458ed[_0x3c2d('0x9a')]);}if(_0x28e89f){logger['info'](_0x3c2d('0x9c'),_0x31e629[_0x3c2d('0x86')]());require(_0x3c2d('0x9d'))['fork'](path[_0x3c2d('0x58')](__dirname,_0x3c2d('0x9e'),_0x28e89f[_0x3c2d('0x91')]),[_0x28e89f['id'],_0x31e629['toString'](),path[_0x3c2d('0x58')](__dirname,_0x3c2d('0x9f'),_0x28e89f[_0x3c2d('0xa0')]),_0x3d8161]);return _0x28e89f;}else{var _0x27f122=squel[_0x3c2d('0x8b')]();_0x27f122[_0x3c2d('0x8c')]('('+_0x31e629[_0x3c2d('0x86')]()+')',_0x3c2d('0xa1'));_0x27f122['field'](_0x3c2d('0xa2'),'count');_0x31e629['limit'](_0x3458ed[_0x3c2d('0x21')]||_0x3d0b54);_0x31e629[_0x3c2d('0x1f')](_0x3458ed[_0x3c2d('0x1f')]||0x0);return dbH[_0x3c2d('0x87')][_0x3c2d('0x35')](_0x27f122[_0x3c2d('0x86')](),{'type':dbH['sequelize']['QueryTypes'][_0x3c2d('0xa3')]})[_0x3c2d('0x28')](function(_0x56733a){if(!_0x56733a[_0x3c2d('0x3b')]){_0x5ab646=0x0;}else{_0x5ab646=_0x56733a[0x0][_0x3c2d('0x22')]||0x0;}return dbH[_0x3c2d('0x87')][_0x3c2d('0x35')](_0x31e629['toString'](),{'type':dbH[_0x3c2d('0x87')][_0x3c2d('0x88')][_0x3c2d('0xa3')]});})[_0x3c2d('0x28')](function(_0x29924b){return{'rows':_0x29924b||[],'count':_0x5ab646};});}});}exports[_0x3c2d('0xa4')]=function(_0x3e11e0,_0x5ce247){return runReport(_0x3e11e0['params'],_0x3e11e0[_0x3c2d('0x35')],_0x3e11e0['options'])[_0x3c2d('0x28')](respondWithResult(_0x5ce247,null))[_0x3c2d('0x48')](handleError(_0x5ce247,null));};exports[_0x3c2d('0xa5')]=runReport;exports[_0x3c2d('0x35')]=function(_0x2ef164,_0x11e551){var _0x28809d=0xa;var _0x190aa0=[_0x3c2d('0x58'),'left_join',_0x3c2d('0x5a'),_0x3c2d('0x5b')];var _0x36ef6f={'SUM':'SUM(%s)','COUNT':_0x3c2d('0x5d'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x3c2d('0x5e'),'MIN':_0x3c2d('0x5f'),'AVG':_0x3c2d('0x60'),'GROUP_CONCAT':_0x3c2d('0xa6'),'GROUP_CONCAT ASC':_0x3c2d('0x61'),'GROUP_CONCAT DESC':_0x3c2d('0x62')};var _0x340eef={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x3c2d('0x64'),'HOUR':_0x3c2d('0x65'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x3c2d('0x67')};var _0x302d27=function(_0x20966d){return!_[_0x3c2d('0x68')]([_0x3c2d('0x89'),'IS\x20NOT\x20NULL',_0x3c2d('0x6a'),_0x3c2d('0x6b')],_0x20966d);};var _0xa5b703=function(_0x2f93d3){if(!_0x2f93d3||!_0x2f93d3[_0x3c2d('0x6c')][_0x3c2d('0x3b')]){return'';}for(var _0x43835f='(',_0x432de9=0x0;_0x432de9<_0x2f93d3['rules'][_0x3c2d('0x3b')];_0x432de9+=0x1){_0x432de9>0x0&&(_0x43835f+='\x20'+_0x2f93d3[_0x3c2d('0x6d')]+'\x20');_0x43835f+=_0x2f93d3[_0x3c2d('0x6c')][_0x432de9][_0x3c2d('0x6e')]?_0xa5b703(_0x2f93d3[_0x3c2d('0x6c')][_0x432de9][_0x3c2d('0x6e')]):_0x2f93d3['rules'][_0x432de9]['field']+'\x20'+_0x2f93d3[_0x3c2d('0x6c')][_0x432de9][_0x3c2d('0x70')]+(_0x302d27(_0x2f93d3[_0x3c2d('0x6c')][_0x432de9][_0x3c2d('0x70')])?'\x20'+_0x2f93d3[_0x3c2d('0x6c')][_0x432de9]['value']:'');}return _0x43835f+')';};var _0x341610={'where':{'id':_0x2ef164['params']['id']}},_0x221499,_0x1d000f,_0x5eddb5,_0x2d69cc,_0x476478;_0x341610=_['merge']({},_0x341610,_0x2ef164[_0x3c2d('0x43')]);return db[_0x3c2d('0x44')][_0x3c2d('0x4d')](_0x341610)['then'](function(_0x4d6fbd){if(_0x4d6fbd){_0x221499=_0x4d6fbd;return _0x4d6fbd[_0x3c2d('0x72')]();}return null;})[_0x3c2d('0x28')](function(_0x26ac84){if(_0x26ac84){if(!_0x26ac84['length']){throw new db['Sequelize'][(_0x3c2d('0x74'))](_0x3c2d('0x75'),0x193);}_0x1d000f=_0x26ac84;return db[_0x3c2d('0x8a')][_0x3c2d('0x46')]({'raw':!![]});}return null;})['then'](function(_0x1672a3){if(_0x1672a3){_0x5eddb5=_[_0x3c2d('0x76')](_0x1672a3,'id');var _0x1cecb3;var _0x8e3104=squel[_0x3c2d('0x8b')]();_0x8e3104[_0x3c2d('0x8c')](_0x221499['table']);for(var _0x4101f4=0x0;_0x4101f4<_0x1d000f[_0x3c2d('0x3b')];_0x4101f4+=0x1){_0x1cecb3=_0x1d000f[_0x4101f4][_0x3c2d('0x78')]?_0x5eddb5[_0x1d000f[_0x4101f4][_0x3c2d('0x78')]][_0x3c2d('0xa7')]:_0x1d000f[_0x4101f4][_0x3c2d('0x6f')];_0x1cecb3=_0x1d000f[_0x4101f4][_0x3c2d('0x79')]?_[_0x3c2d('0x7a')](_0x36ef6f[_0x1d000f[_0x4101f4][_0x3c2d('0x79')]],'%s',_0x1cecb3):_0x1cecb3;_0x1cecb3=_0x1d000f[_0x4101f4][_0x3c2d('0x7b')]?_[_0x3c2d('0x7a')](_0x340eef[_0x1d000f[_0x4101f4][_0x3c2d('0x7b')]],'%s',_0x1cecb3):_0x1cecb3;if(_0x1d000f[_0x4101f4][_0x3c2d('0x8d')]){_0x8e3104['group'](_0x1cecb3);}_0x1d000f[_0x4101f4][_0x3c2d('0x7c')]&&_0x8e3104[_0x3c2d('0x8e')](_0x1cecb3,_0x1d000f[_0x4101f4]['orderBy']===_0x3c2d('0x8f')?![]:!![]);_0x8e3104['field'](_0x1cecb3,_0x1d000f[_0x4101f4][_0x3c2d('0x90')]||_0x1cecb3);}if(_0x221499['joins']){_0x221499[_0x3c2d('0x7d')]=JSON[_0x3c2d('0x7e')](_0x221499[_0x3c2d('0x7d')]);for(var _0x52ebd8=0x0;_0x52ebd8<_0x221499[_0x3c2d('0x7d')][_0x3c2d('0x3b')];_0x52ebd8+=0x1){if(_0x221499[_0x3c2d('0x7d')][_0x52ebd8][_0x3c2d('0x33')]&&_[_0x3c2d('0x68')](_0x190aa0,_0x221499[_0x3c2d('0x7d')][_0x52ebd8][_0x3c2d('0x33')])&&_0x221499['joins'][_0x52ebd8]['parentKey']&&_0x221499['joins'][_0x52ebd8][_0x3c2d('0x80')]&&_0x221499[_0x3c2d('0x7d')][_0x52ebd8]['foreignKey']){_0x8e3104[_0x221499[_0x3c2d('0x7d')][_0x52ebd8][_0x3c2d('0x33')]](_0x221499[_0x3c2d('0x7d')][_0x52ebd8]['foreignTable'],null,util[_0x3c2d('0x7b')](_0x3c2d('0x82'),_0x221499[_0x3c2d('0x77')],_0x221499[_0x3c2d('0x7d')][_0x52ebd8][_0x3c2d('0x7f')],_0x221499[_0x3c2d('0x7d')][_0x52ebd8][_0x3c2d('0x80')],_0x221499[_0x3c2d('0x7d')][_0x52ebd8][_0x3c2d('0x81')]));}}}if(_0x221499[_0x3c2d('0x83')]){_0x221499['conditions']=JSON[_0x3c2d('0x7e')](_0x221499[_0x3c2d('0x83')]);_0x8e3104['where'](_0xa5b703(_0x221499[_0x3c2d('0x83')][_0x3c2d('0x6e')]));}_0x476478=_0x8e3104[_0x3c2d('0x84')]();_0x8e3104[_0x3c2d('0x21')](_0x28809d);_0x8e3104[_0x3c2d('0x1f')](0x0);logger[_0x3c2d('0xa8')](_0x3c2d('0x85'),_0x8e3104[_0x3c2d('0x86')]());return dbH['sequelize'][_0x3c2d('0x35')](_0x8e3104[_0x3c2d('0x86')](),{'type':dbH[_0x3c2d('0x87')][_0x3c2d('0x88')]['SELECT']});}})['then'](function(){return{'sql':_0x476478['toString']()};})[_0x3c2d('0x28')](respondWithResult(_0x11e551,null))[_0x3c2d('0x48')](handleError(_0x11e551,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 2d8d076..d93254f 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 _0x1077=['rimraf','../../config/environment','./analyticCustomReport.attributes','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1077,0x1ad));var _0x7107=function(_0x44bb15,_0x3fc1e9){_0x44bb15=_0x44bb15-0x0;var _0x4fdd05=_0x1077[_0x44bb15];return _0x4fdd05;};'use strict';var _=require(_0x7107('0x0'));var util=require(_0x7107('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7107('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7107('0x3'));var config=require(_0x7107('0x4'));var attributes=require(_0x7107('0x5'));module['exports']=function(_0x2bde15,_0x5d0c6e){return _0x2bde15[_0x7107('0x6')](_0x7107('0x7'),attributes,{'tableName':_0x7107('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1c0f=['../../config/environment','./analyticCustomReport.attributes','analytics_custom_reports','util','../../config/logger','bluebird','request-promise','path'];(function(_0x53c88b,_0x295d4c){var _0x2d4c27=function(_0x5ae123){while(--_0x5ae123){_0x53c88b['push'](_0x53c88b['shift']());}};_0x2d4c27(++_0x295d4c);}(_0x1c0f,0x11b));var _0xf1c0=function(_0x37d366,_0x858264){_0x37d366=_0x37d366-0x0;var _0x13e576=_0x1c0f[_0x37d366];return _0x13e576;};'use strict';var _=require('lodash');var util=require(_0xf1c0('0x0'));var logger=require(_0xf1c0('0x1'))('api');var moment=require('moment');var BPromise=require(_0xf1c0('0x2'));var rp=require(_0xf1c0('0x3'));var fs=require('fs');var path=require(_0xf1c0('0x4'));var rimraf=require('rimraf');var config=require(_0xf1c0('0x5'));var attributes=require(_0xf1c0('0x6'));module['exports']=function(_0x5c8461,_0x56d535){return _0x5c8461['define']('AnalyticCustomReport',attributes,{'tableName':_0xf1c0('0x7'),'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 3411222..43e6788 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 _0x0d07=['error','message','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0d07,0x12a));var _0x70d0=function(_0x164d5c,_0xf9f2ea){_0x164d5c=_0x164d5c-0x0;var _0x58be62=_0x0d07[_0x164d5c];return _0x58be62;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x70d0('0x0'));var BPromise=require(_0x70d0('0x1'));var rs=require(_0x70d0('0x2'));var fs=require('fs');var Redis=require(_0x70d0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x70d0('0x4'));var logger=require(_0x70d0('0x5'))(_0x70d0('0x6'));var config=require(_0x70d0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x70d0('0x8')][_0x70d0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x505528,_0x34ac3e,_0x13017b){return new BPromise(function(_0x8c4d46,_0x38c41d){return client[_0x70d0('0xa')](_0x505528,_0x13017b)[_0x70d0('0xb')](function(_0x1d8b87){logger[_0x70d0('0xc')](_0x70d0('0xd'),_0x34ac3e,_0x70d0('0xe'));logger[_0x70d0('0xf')](_0x70d0('0x10'),_0x34ac3e,_0x70d0('0xe'),JSON['stringify'](_0x1d8b87));if(_0x1d8b87[_0x70d0('0x11')]){if(_0x1d8b87[_0x70d0('0x11')]['code']===0x1f4){logger[_0x70d0('0x11')](_0x70d0('0xd'),_0x34ac3e,_0x1d8b87['error'][_0x70d0('0x12')]);return _0x38c41d(_0x1d8b87['error']['message']);}logger['error'](_0x70d0('0xd'),_0x34ac3e,_0x1d8b87[_0x70d0('0x11')][_0x70d0('0x12')]);return _0x8c4d46(_0x1d8b87[_0x70d0('0x11')]['message']);}else{logger[_0x70d0('0xc')](_0x70d0('0xd'),_0x34ac3e,'request\x20sent');_0x8c4d46(_0x1d8b87[_0x70d0('0x13')][_0x70d0('0x12')]);}})[_0x70d0('0x14')](function(_0x3b1eef){logger[_0x70d0('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x34ac3e,_0x3b1eef);_0x38c41d(_0x3b1eef);});});}
\ No newline at end of file
+var _0x7e2e=['jayson/promise','http','request','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x298dc2,_0x498b39){var _0x1a6877=function(_0x393b02){while(--_0x393b02){_0x298dc2['push'](_0x298dc2['shift']());}};_0x1a6877(++_0x498b39);}(_0x7e2e,0x1b0));var _0xe7e2=function(_0x344ac8,_0x381df7){_0x344ac8=_0x344ac8-0x0;var _0x4984f4=_0x7e2e[_0x344ac8];return _0x4984f4;};'use strict';var _=require(_0xe7e2('0x0'));var util=require(_0xe7e2('0x1'));var moment=require(_0xe7e2('0x2'));var BPromise=require(_0xe7e2('0x3'));var rs=require(_0xe7e2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe7e2('0x5'));var logger=require(_0xe7e2('0x6'))(_0xe7e2('0x7'));var config=require(_0xe7e2('0x8'));var jayson=require(_0xe7e2('0x9'));var client=jayson['client'][_0xe7e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2aee3b,_0x44448e,_0x209dfb){return new BPromise(function(_0xf9d6db,_0x3805f2){return client[_0xe7e2('0xb')](_0x2aee3b,_0x209dfb)['then'](function(_0x387143){logger[_0xe7e2('0xc')](_0xe7e2('0xd'),_0x44448e,_0xe7e2('0xe'));logger[_0xe7e2('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x44448e,_0xe7e2('0xe'),JSON[_0xe7e2('0x10')](_0x387143));if(_0x387143['error']){if(_0x387143[_0xe7e2('0x11')][_0xe7e2('0x12')]===0x1f4){logger[_0xe7e2('0x11')](_0xe7e2('0xd'),_0x44448e,_0x387143[_0xe7e2('0x11')][_0xe7e2('0x13')]);return _0x3805f2(_0x387143[_0xe7e2('0x11')][_0xe7e2('0x13')]);}logger[_0xe7e2('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x44448e,_0x387143[_0xe7e2('0x11')][_0xe7e2('0x13')]);return _0xf9d6db(_0x387143[_0xe7e2('0x11')][_0xe7e2('0x13')]);}else{logger['info'](_0xe7e2('0xd'),_0x44448e,_0xe7e2('0xe'));_0xf9d6db(_0x387143[_0xe7e2('0x14')][_0xe7e2('0x13')]);}})['catch'](function(_0x891636){logger['error'](_0xe7e2('0xd'),_0x44448e,_0x891636);_0x3805f2(_0x891636);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 401801d..689ab88 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 _0xfb98=['put','/:id','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post'];(function(_0x4ef56b,_0x1f8891){var _0x58b4de=function(_0x38c402){while(--_0x38c402){_0x4ef56b['push'](_0x4ef56b['shift']());}};_0x58b4de(++_0x1f8891);}(_0xfb98,0xd5));var _0x8fb9=function(_0x175711,_0x152abc){_0x175711=_0x175711-0x0;var _0x226cbd=_0xfb98[_0x175711];return _0x226cbd;};'use strict';var multer=require('multer');var util=require(_0x8fb9('0x0'));var path=require(_0x8fb9('0x1'));var timeout=require(_0x8fb9('0x2'));var express=require(_0x8fb9('0x3'));var router=express[_0x8fb9('0x4')]();var fs_extra=require(_0x8fb9('0x5'));var auth=require(_0x8fb9('0x6'));var interaction=require(_0x8fb9('0x7'));var config=require(_0x8fb9('0x8'));var controller=require(_0x8fb9('0x9'));router[_0x8fb9('0xa')]('/',auth[_0x8fb9('0xb')](),controller[_0x8fb9('0xc')]);router[_0x8fb9('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x8fb9('0xd')]);router[_0x8fb9('0xa')](_0x8fb9('0xe'),auth[_0x8fb9('0xb')](),controller[_0x8fb9('0xf')]);router[_0x8fb9('0xa')](_0x8fb9('0x10'),auth['isAuthenticated'](),controller[_0x8fb9('0x11')]);router['get'](_0x8fb9('0x12'),auth['isAuthenticated'](),controller[_0x8fb9('0x13')]);router[_0x8fb9('0x14')]('/',auth[_0x8fb9('0xb')](),controller['create']);router[_0x8fb9('0x15')](_0x8fb9('0x16'),auth[_0x8fb9('0xb')](),controller[_0x8fb9('0x17')]);router[_0x8fb9('0x18')](_0x8fb9('0x16'),auth[_0x8fb9('0xb')](),controller[_0x8fb9('0x19')]);module['exports']=router;
\ No newline at end of file
+var _0x4ac1=['/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','update','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show'];(function(_0x55cde5,_0x1dc61e){var _0x285641=function(_0x5baca0){while(--_0x5baca0){_0x55cde5['push'](_0x55cde5['shift']());}};_0x285641(++_0x1dc61e);}(_0x4ac1,0x11e));var _0x14ac=function(_0x207fa2,_0x486e91){_0x207fa2=_0x207fa2-0x0;var _0x3bcbd1=_0x4ac1[_0x207fa2];return _0x3bcbd1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x14ac('0x0'));var timeout=require(_0x14ac('0x1'));var express=require(_0x14ac('0x2'));var router=express[_0x14ac('0x3')]();var fs_extra=require(_0x14ac('0x4'));var auth=require(_0x14ac('0x5'));var interaction=require(_0x14ac('0x6'));var config=require(_0x14ac('0x7'));var controller=require(_0x14ac('0x8'));router[_0x14ac('0x9')]('/',auth[_0x14ac('0xa')](),controller[_0x14ac('0xb')]);router[_0x14ac('0x9')](_0x14ac('0xc'),auth['isAuthenticated'](),controller[_0x14ac('0xd')]);router[_0x14ac('0x9')](_0x14ac('0xe'),auth['isAuthenticated'](),controller[_0x14ac('0xf')]);router['get'](_0x14ac('0x10'),auth[_0x14ac('0xa')](),controller[_0x14ac('0x11')]);router[_0x14ac('0x9')](_0x14ac('0x12'),auth[_0x14ac('0xa')](),controller[_0x14ac('0x13')]);router[_0x14ac('0x14')]('/',auth['isAuthenticated'](),controller[_0x14ac('0x15')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x14ac('0x16')]);router['delete']('/:id',auth[_0x14ac('0xa')](),controller[_0x14ac('0x17')]);module[_0x14ac('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 26a6880..76c5cc8 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 _0x33c5=['STRING','TEXT','exports'];(function(_0x198563,_0x9b45af){var _0x399bb6=function(_0x1cf46c){while(--_0x1cf46c){_0x198563['push'](_0x198563['shift']());}};_0x399bb6(++_0x9b45af);}(_0x33c5,0xe6));var _0x533c=function(_0x2e249d,_0x41b7e7){_0x2e249d=_0x2e249d-0x0;var _0x1faa37=_0x33c5[_0x2e249d];return _0x1faa37;};'use strict';var Sequelize=require('sequelize');module[_0x533c('0x0')]={'name':{'type':Sequelize[_0x533c('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x533c('0x1')]},'table':{'type':Sequelize[_0x533c('0x1')]},'conditions':{'type':Sequelize[_0x533c('0x2')]},'joins':{'type':Sequelize[_0x533c('0x2')]}};
\ No newline at end of file
+var _0x4819=['TEXT','exports','STRING'];(function(_0x22431e,_0x5af0a3){var _0xd978e9=function(_0x2bbdd7){while(--_0x2bbdd7){_0x22431e['push'](_0x22431e['shift']());}};_0xd978e9(++_0x5af0a3);}(_0x4819,0xcd));var _0x9481=function(_0x32d553,_0x12f5e8){_0x32d553=_0x32d553-0x0;var _0x1707a4=_0x4819[_0x32d553];return _0x1707a4;};'use strict';var Sequelize=require('sequelize');module[_0x9481('0x0')]={'name':{'type':Sequelize[_0x9481('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x9481('0x1')]},'parent':{'type':Sequelize[_0x9481('0x1')]},'table':{'type':Sequelize[_0x9481('0x1')]},'conditions':{'type':Sequelize[_0x9481('0x2')]},'joins':{'type':Sequelize[_0x9481('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index fa89e8d..0e5b73c 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 _0x524e=['AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','QueryTypes','SELECT','run','runReport','SUM(%s)','GROUP_CONCAT(%s)','debug','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','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','status','offset','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','send','index','AnalyticDefaultReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','create','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','update','body','params','preview','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','Limited\x20Query:','sequelize','toString','join','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','getFields','from','clone','output','web','fullPath','generate','csv','default'];(function(_0x5ed411,_0xf717b9){var _0x1a03c9=function(_0x827cd7){while(--_0x827cd7){_0x5ed411['push'](_0x5ed411['shift']());}};_0x1a03c9(++_0xf717b9);}(_0x524e,0x15e));var _0xe524=function(_0x1b662c,_0x12878d){_0x1b662c=_0x1b662c-0x0;var _0x336638=_0x524e[_0x1b662c];return _0x336638;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe524('0x0'));var jsonpatch=require(_0xe524('0x1'));var rp=require(_0xe524('0x2'));var moment=require(_0xe524('0x3'));var BPromise=require(_0xe524('0x4'));var Mustache=require(_0xe524('0x5'));var util=require(_0xe524('0x6'));var path=require(_0xe524('0x7'));var sox=require(_0xe524('0x8'));var csv=require(_0xe524('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe524('0xa'));var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0x9'));var querystring=require(_0xe524('0xf'));var Papa=require(_0xe524('0x10'));var Redis=require(_0xe524('0x11'));var authService=require(_0xe524('0x12'));var qs=require(_0xe524('0x13'));var as=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var licenseUtil=require(_0xe524('0x1a'));var db=require(_0xe524('0x1b'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0xfdc2a5,_0x1541d8){_0x1541d8=_0x1541d8||0xcc;return function(_0x11adbc){if(_0x11adbc){return _0xfdc2a5[_0xe524('0x1c')](_0x1541d8);}return _0xfdc2a5[_0xe524('0x1d')](_0x1541d8)['end']();};}function respondWithResult(_0x12ff75,_0x51e9fe){_0x51e9fe=_0x51e9fe||0xc8;return function(_0x19f013){if(_0x19f013){return _0x12ff75[_0xe524('0x1d')](_0x51e9fe)['json'](_0x19f013);}};}function respondWithFilteredResult(_0x569660,_0x488fce){return function(_0x109795){if(_0x109795){var _0x538754=typeof _0x488fce[_0xe524('0x1e')]==='undefined'&&typeof _0x488fce['limit']==='undefined';var _0x3a4027=_0x109795['count'];var _0x11b2a1=_0x538754?0x0:_0x488fce[_0xe524('0x1e')];var _0x278de9=_0x538754?_0x109795[_0xe524('0x1f')]:_0x488fce['offset']+_0x488fce[_0xe524('0x20')];var _0x3ccb3f;if(_0x278de9>=_0x3a4027){_0x278de9=_0x3a4027;_0x3ccb3f=0xc8;}else{_0x3ccb3f=0xce;}_0x569660['status'](_0x3ccb3f);return _0x569660[_0xe524('0x21')](_0xe524('0x22'),_0x11b2a1+'-'+_0x278de9+'/'+_0x3a4027)[_0xe524('0x23')](_0x109795);}return null;};}function patchUpdates(_0x1dcc0f){return function(_0x1c4194){try{jsonpatch[_0xe524('0x24')](_0x1c4194,_0x1dcc0f,!![]);}catch(_0xbf059b){return BPromise[_0xe524('0x25')](_0xbf059b);}return _0x1c4194[_0xe524('0x26')]();};}function saveUpdates(_0x5c4d21,_0x7d1f92){return function(_0x5bb00b){if(_0x5bb00b){return _0x5bb00b['update'](_0x5c4d21)[_0xe524('0x27')](function(_0x23df5e){return _0x23df5e;});}return null;};}function removeEntity(_0x1ad106,_0x85fc51){return function(_0x599d5d){if(_0x599d5d){return _0x599d5d[_0xe524('0x28')]()['then'](function(){var _0x17e245=_0x599d5d[_0xe524('0x29')]({'plain':!![]});var _0xd62772=_0xe524('0x2a');return db[_0xe524('0x2b')][_0xe524('0x28')]({'where':{'type':_0xd62772,'resourceId':_0x17e245['id']}})[_0xe524('0x27')](function(){return _0x599d5d;});})['then'](function(){_0x1ad106['status'](0xcc)[_0xe524('0x2c')]();});}};}function handleEntityNotFound(_0x45abad,_0x476572){return function(_0x109a96){if(!_0x109a96){_0x45abad[_0xe524('0x1c')](0x194);}return _0x109a96;};}function handleError(_0x5405e4,_0x52f140){_0x52f140=_0x52f140||0x1f4;return function(_0x4b1ff){logger[_0xe524('0x2d')](_0x4b1ff[_0xe524('0x2e')]);if(_0x4b1ff[_0xe524('0x2f')]){delete _0x4b1ff[_0xe524('0x2f')];}_0x5405e4['status'](_0x52f140)[_0xe524('0x30')](_0x4b1ff);};}exports[_0xe524('0x31')]=function(_0x4a4e15,_0x5b7ded){var _0x20688e={},_0x376324={},_0x5b2fc3={'count':0x0,'rows':[]};var _0x31d4a7=_['map'](db[_0xe524('0x32')]['rawAttributes'],function(_0x315e56){return{'name':_0x315e56[_0xe524('0x33')],'type':_0x315e56[_0xe524('0x34')]['key']};});_0x376324[_0xe524('0x35')]=_['map'](_0x31d4a7,_0xe524('0x2f'));_0x376324[_0xe524('0x36')]=_[_0xe524('0x37')](_0x4a4e15['query']);_0x376324[_0xe524('0x38')]=_[_0xe524('0x39')](_0x376324['model'],_0x376324[_0xe524('0x36')]);_0x20688e[_0xe524('0x3a')]=_[_0xe524('0x39')](_0x376324[_0xe524('0x35')],qs['fields'](_0x4a4e15[_0xe524('0x36')][_0xe524('0x3b')]));_0x20688e[_0xe524('0x3a')]=_0x20688e[_0xe524('0x3a')][_0xe524('0x3c')]?_0x20688e[_0xe524('0x3a')]:_0x376324[_0xe524('0x35')];if(!_0x4a4e15[_0xe524('0x36')]['hasOwnProperty'](_0xe524('0x3d'))){_0x20688e['limit']=qs[_0xe524('0x20')](_0x4a4e15[_0xe524('0x36')]['limit']);_0x20688e[_0xe524('0x1e')]=qs['offset'](_0x4a4e15[_0xe524('0x36')][_0xe524('0x1e')]);}_0x20688e[_0xe524('0x3e')]=qs[_0xe524('0x3f')](_0x4a4e15[_0xe524('0x36')][_0xe524('0x3f')]);_0x20688e[_0xe524('0x40')]=qs[_0xe524('0x38')](_['pick'](_0x4a4e15[_0xe524('0x36')],_0x376324[_0xe524('0x38')]),_0x31d4a7);if(_0x4a4e15[_0xe524('0x36')][_0xe524('0x41')]){_0x20688e[_0xe524('0x40')]=_[_0xe524('0x42')](_0x20688e[_0xe524('0x40')],{'$or':_[_0xe524('0x43')](_0x31d4a7,function(_0x5d3ea1){if(_0x5d3ea1[_0xe524('0x34')]!==_0xe524('0x44')){var _0x2e4a13={};_0x2e4a13[_0x5d3ea1['name']]={'$like':'%'+_0x4a4e15[_0xe524('0x36')]['filter']+'%'};return _0x2e4a13;}})});}_0x20688e=_[_0xe524('0x42')]({},_0x20688e,_0x4a4e15[_0xe524('0x45')]);var _0x43c314={'where':_0x20688e[_0xe524('0x40')]};return db[_0xe524('0x32')][_0xe524('0x1f')](_0x43c314)[_0xe524('0x27')](function(_0x52cd0e){_0x5b2fc3[_0xe524('0x1f')]=_0x52cd0e;if(_0x4a4e15[_0xe524('0x36')][_0xe524('0x46')]){_0x20688e[_0xe524('0x47')]=[{'all':!![]}];}return db[_0xe524('0x32')][_0xe524('0x48')](_0x20688e);})['then'](function(_0xb694b9){_0x5b2fc3[_0xe524('0x49')]=_0xb694b9;return _0x5b2fc3;})[_0xe524('0x27')](respondWithFilteredResult(_0x5b7ded,_0x20688e))['catch'](handleError(_0x5b7ded,null));};exports[_0xe524('0x4a')]=function(_0x5209dc,_0x4e5d99){var _0x2b9b3b={'raw':!![],'where':{'id':_0x5209dc['params']['id']}},_0x33906d={};_0x33906d[_0xe524('0x35')]=_[_0xe524('0x37')](db[_0xe524('0x32')][_0xe524('0x4b')]);_0x33906d['query']=_['keys'](_0x5209dc[_0xe524('0x36')]);_0x33906d[_0xe524('0x38')]=_['intersection'](_0x33906d[_0xe524('0x35')],_0x33906d['query']);_0x2b9b3b[_0xe524('0x3a')]=_[_0xe524('0x39')](_0x33906d[_0xe524('0x35')],qs[_0xe524('0x3b')](_0x5209dc[_0xe524('0x36')][_0xe524('0x3b')]));_0x2b9b3b[_0xe524('0x3a')]=_0x2b9b3b[_0xe524('0x3a')][_0xe524('0x3c')]?_0x2b9b3b[_0xe524('0x3a')]:_0x33906d[_0xe524('0x35')];if(_0x5209dc[_0xe524('0x36')][_0xe524('0x46')]){_0x2b9b3b[_0xe524('0x47')]=[{'all':!![]}];}_0x2b9b3b=_[_0xe524('0x42')]({},_0x2b9b3b,_0x5209dc['options']);return db[_0xe524('0x32')]['find'](_0x2b9b3b)['then'](handleEntityNotFound(_0x4e5d99,null))[_0xe524('0x27')](respondWithResult(_0x4e5d99,null))['catch'](handleError(_0x4e5d99,null));};exports[_0xe524('0x4c')]=function(_0x15d7ee,_0x561107){return db[_0xe524('0x32')]['create'](_0x15d7ee['body'],{})[_0xe524('0x27')](function(_0x1e5687){var _0x203e71=_0x15d7ee['user']['get']({'plain':!![]});if(!_0x203e71)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x203e71['role']==='user'){var _0x5477ca=_0x1e5687[_0xe524('0x29')]({'plain':!![]});var _0x2ce5c0='Reports';return db[_0xe524('0x4d')][_0xe524('0x4e')]({'where':{'name':_0x2ce5c0,'userProfileId':_0x203e71[_0xe524('0x4f')]},'raw':!![]})[_0xe524('0x27')](function(_0x2fa143){if(_0x2fa143&&_0x2fa143['autoAssociation']===0x0){return db[_0xe524('0x2b')][_0xe524('0x4c')]({'name':_0x5477ca[_0xe524('0x2f')],'resourceId':_0x5477ca['id'],'type':'DefaultReports','sectionId':_0x2fa143['id']},{})[_0xe524('0x27')](function(){return _0x1e5687;});}else{return _0x1e5687;}})['catch'](function(_0x12e5d0){logger[_0xe524('0x2d')](_0xe524('0x50'),_0x12e5d0);throw _0x12e5d0;});}return _0x1e5687;})[_0xe524('0x27')](respondWithResult(_0x561107,0xc9))[_0xe524('0x51')](handleError(_0x561107,null));};exports[_0xe524('0x52')]=function(_0x1cec31,_0x374450){if(_0x1cec31[_0xe524('0x53')]['id']){delete _0x1cec31[_0xe524('0x53')]['id'];}return db[_0xe524('0x32')][_0xe524('0x4e')]({'where':{'id':_0x1cec31['params']['id']}})['then'](handleEntityNotFound(_0x374450,null))['then'](saveUpdates(_0x1cec31[_0xe524('0x53')],null))[_0xe524('0x27')](respondWithResult(_0x374450,null))[_0xe524('0x51')](handleError(_0x374450,null));};exports[_0xe524('0x28')]=function(_0x45fb0d,_0xef3d2f){return db[_0xe524('0x32')][_0xe524('0x4e')]({'where':{'id':_0x45fb0d[_0xe524('0x54')]['id']}})[_0xe524('0x27')](handleEntityNotFound(_0xef3d2f,null))[_0xe524('0x27')](removeEntity(_0xef3d2f,null))['catch'](handleError(_0xef3d2f,null));};exports[_0xe524('0x55')]=function(_0x1f0567,_0x4a5f4a){var _0x53da86=0xa;var _0x54adbd=['join',_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x8a2c00={'SUM':'SUM(%s)','COUNT':_0xe524('0x59'),'COUNT DISTINCT':_0xe524('0x5a'),'MAX':_0xe524('0x5b'),'MIN':_0xe524('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xe524('0x5d')};var _0x582fbb={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':_0xe524('0x60'),'ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x4f58ff=function(_0x5d0507){return!_[_0xe524('0x63')]([_0xe524('0x64'),_0xe524('0x65'),_0xe524('0x66'),_0xe524('0x67')],_0x5d0507);};var _0x474ed4=function(_0x5135f0){if(!_0x5135f0||!_0x5135f0[_0xe524('0x68')][_0xe524('0x3c')]){return'';}for(var _0xc3ccfd='(',_0x5d3b9c=0x0;_0x5d3b9c<_0x5135f0[_0xe524('0x68')][_0xe524('0x3c')];_0x5d3b9c+=0x1){_0x5d3b9c>0x0&&(_0xc3ccfd+='\x20'+_0x5135f0[_0xe524('0x69')]+'\x20');_0xc3ccfd+=_0x5135f0['rules'][_0x5d3b9c]['group']?_0x474ed4(_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6a')]):_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6b')]+'\x20'+_0x5135f0[_0xe524('0x68')][_0x5d3b9c]['condition']+(_0x4f58ff(_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6c')])?'\x20'+_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6d')]:'');}return _0xc3ccfd+')';};var _0x3ce098={'where':{'id':_0x1f0567[_0xe524('0x54')]['id']}},_0x22d06a,_0x35e6b2,_0x1e4b32,_0x27c55c,_0x7e5992;_0x3ce098=_['merge']({},_0x3ce098,_0x1f0567[_0xe524('0x45')]);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x3ce098)[_0xe524('0x27')](function(_0xeec885){if(_0xeec885){_0x22d06a=_0xeec885;return _0xeec885['getFields']();}return null;})[_0xe524('0x27')](function(_0x2341cf){if(_0x2341cf){if(!_0x2341cf[_0xe524('0x3c')]){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x35e6b2=_0x2341cf;return db[_0xe524('0x71')]['findAll']({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x245501){if(_0x245501){_0x1e4b32=_[_0xe524('0x72')](_0x245501,'id');var _0xce15f5;var _0x5ec07c=squel[_0xe524('0x73')]();_0x5ec07c['from'](_0x22d06a[_0xe524('0x74')]);for(var _0x2a88e2=0x0;_0x2a88e2<_0x35e6b2[_0xe524('0x3c')];_0x2a88e2+=0x1){_0xce15f5=_0x35e6b2[_0x2a88e2]['MetricId']?_0x1e4b32[_0x35e6b2[_0x2a88e2][_0xe524('0x75')]][_0xe524('0x76')]:_0x35e6b2[_0x2a88e2][_0xe524('0x6b')];_0xce15f5=_0x35e6b2[_0x2a88e2][_0xe524('0x77')]?_[_0xe524('0x78')](_0x8a2c00[_0x35e6b2[_0x2a88e2]['function']],'%s',_0xce15f5):_0xce15f5;_0xce15f5=_0x35e6b2[_0x2a88e2][_0xe524('0x79')]?_[_0xe524('0x78')](_0x582fbb[_0x35e6b2[_0x2a88e2][_0xe524('0x79')]],'%s',_0xce15f5):_0xce15f5;if(_0x35e6b2[_0x2a88e2][_0xe524('0x7a')]){_0x5ec07c[_0xe524('0x6a')](_0xce15f5);}_0x35e6b2[_0x2a88e2]['orderBy']&&_0x5ec07c[_0xe524('0x3e')](_0xce15f5,_0x35e6b2[_0x2a88e2][_0xe524('0x7b')]===_0xe524('0x7c')?![]:!![]);_0x5ec07c[_0xe524('0x6b')](_0xce15f5,_0x35e6b2[_0x2a88e2][_0xe524('0x7d')]||_0xce15f5);}if(_0x22d06a[_0xe524('0x7e')]){_0x22d06a['joins']=JSON[_0xe524('0x7f')](_0x22d06a[_0xe524('0x7e')]);for(var _0x1beaa2=0x0;_0x1beaa2<_0x22d06a['joins'][_0xe524('0x3c')];_0x1beaa2+=0x1){if(_0x22d06a[_0xe524('0x7e')][_0x1beaa2]['type']&&_[_0xe524('0x63')](_0x54adbd,_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x34')])&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x80')]&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2]['foreignTable']&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x81')]){_0x5ec07c[_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x34')]](_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x82')],null,util[_0xe524('0x79')](_0xe524('0x83'),_0x22d06a[_0xe524('0x74')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x80')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x82')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x81')]));}}}if(_0x22d06a['conditions']){_0x22d06a[_0xe524('0x84')]=JSON[_0xe524('0x7f')](_0x22d06a[_0xe524('0x84')]);_0x5ec07c['where'](_0x474ed4(_0x22d06a[_0xe524('0x84')][_0xe524('0x6a')]));}_0x7e5992=_0x5ec07c['clone']();_0x5ec07c['limit'](_0x53da86);_0x5ec07c[_0xe524('0x1e')](0x0);logger['debug'](_0xe524('0x85'),_0x5ec07c['toString']());return dbH[_0xe524('0x86')][_0xe524('0x36')](_0x5ec07c[_0xe524('0x87')](),{'type':dbH[_0xe524('0x86')]['QueryTypes']['SELECT']});}})[_0xe524('0x27')](respondWithResult(_0x4a5f4a,null))[_0xe524('0x51')](handleError(_0x4a5f4a,null));};function runReport(_0x50eb96,_0x45c287,_0x449842){var _0x1f3ed1=_0x45c287['name'];var _0x19b063=0xa;var _0x140a4e=[_0xe524('0x88'),_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x54385f={'SUM':'SUM(%s)','COUNT':_0xe524('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe524('0x5b'),'MIN':_0xe524('0x5c'),'AVG':_0xe524('0x89'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xe524('0x8a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1681c5={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':_0xe524('0x60'),'ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x50f5e3=function(_0x11298c){return!_[_0xe524('0x63')]([_0xe524('0x64'),'IS\x20NOT\x20NULL',_0xe524('0x66'),_0xe524('0x67')],_0x11298c);};var _0x5603d0=function(_0x2712ac){if(!_0x2712ac||!_0x2712ac[_0xe524('0x68')][_0xe524('0x3c')]){return'';}for(var _0x32c9f6='(',_0x58d29e=0x0;_0x58d29e<_0x2712ac[_0xe524('0x68')][_0xe524('0x3c')];_0x58d29e+=0x1){_0x58d29e>0x0&&(_0x32c9f6+='\x20'+_0x2712ac[_0xe524('0x69')]+'\x20');_0x32c9f6+=_0x2712ac['rules'][_0x58d29e][_0xe524('0x6a')]?_0x5603d0(_0x2712ac['rules'][_0x58d29e][_0xe524('0x6a')]):_0x2712ac[_0xe524('0x68')][_0x58d29e][_0xe524('0x6b')]+'\x20'+_0x2712ac['rules'][_0x58d29e][_0xe524('0x6c')]+(_0x50f5e3(_0x2712ac[_0xe524('0x68')][_0x58d29e][_0xe524('0x6c')])?'\x20'+_0x2712ac['rules'][_0x58d29e]['value']:'');}return _0x32c9f6+')';};var _0x334164={'where':{'id':_0x50eb96['id']}},_0x512572,_0x903e24,_0x4964c3,_0x2dc3f5,_0x246c62;_0x334164=_['merge']({},_0x334164,_0x449842);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x334164)['then'](function(_0x482b72){if(_0x482b72){_0x512572=_0x482b72;return _0x482b72[_0xe524('0x8b')]();}return null;})[_0xe524('0x27')](function(_0x1b3e03){if(_0x1b3e03){if(!_0x1b3e03['length']){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x903e24=_0x1b3e03;return db[_0xe524('0x71')][_0xe524('0x48')]({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x57501c){if(_0x57501c){_0x4964c3=_[_0xe524('0x72')](_0x57501c,'id');var _0x3a2834;var _0x4c7f45=squel['select']();_0x4c7f45[_0xe524('0x8c')](_0x512572[_0xe524('0x74')]);for(var _0x41f842=0x0;_0x41f842<_0x903e24[_0xe524('0x3c')];_0x41f842+=0x1){_0x3a2834=_0x903e24[_0x41f842]['MetricId']?_0x4964c3[_0x903e24[_0x41f842][_0xe524('0x75')]][_0xe524('0x76')]:_0x903e24[_0x41f842]['field'];_0x3a2834=_0x903e24[_0x41f842]['function']?_[_0xe524('0x78')](_0x54385f[_0x903e24[_0x41f842][_0xe524('0x77')]],'%s',_0x3a2834):_0x3a2834;_0x3a2834=_0x903e24[_0x41f842][_0xe524('0x79')]?_[_0xe524('0x78')](_0x1681c5[_0x903e24[_0x41f842][_0xe524('0x79')]],'%s',_0x3a2834):_0x3a2834;if(_0x903e24[_0x41f842][_0xe524('0x7a')]){_0x4c7f45['group'](_0x3a2834);}_0x903e24[_0x41f842]['orderBy']&&_0x4c7f45[_0xe524('0x3e')](_0x3a2834,_0x903e24[_0x41f842][_0xe524('0x7b')]==='DESC'?![]:!![]);_0x4c7f45['field'](_0x3a2834,_0x903e24[_0x41f842][_0xe524('0x7d')]||_0x3a2834);}if(_0x512572[_0xe524('0x7e')]){_0x512572[_0xe524('0x7e')]=JSON[_0xe524('0x7f')](_0x512572[_0xe524('0x7e')]);for(var _0xa820a1=0x0;_0xa820a1<_0x512572['joins']['length'];_0xa820a1+=0x1){if(_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x34')]&&_[_0xe524('0x63')](_0x140a4e,_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x34')])&&_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x80')]&&_0x512572[_0xe524('0x7e')][_0xa820a1]['foreignTable']&&_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x81')]){_0x4c7f45[_0x512572[_0xe524('0x7e')][_0xa820a1]['type']](_0x512572['joins'][_0xa820a1][_0xe524('0x82')],null,util[_0xe524('0x79')](_0xe524('0x83'),_0x512572[_0xe524('0x74')],_0x512572['joins'][_0xa820a1][_0xe524('0x80')],_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x82')],_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x81')]));}}}if(_0x512572['conditions']){_0x512572[_0xe524('0x84')]=JSON['parse'](_0x512572[_0xe524('0x84')]);_0x4c7f45[_0xe524('0x40')](_0x5603d0(_0x512572['conditions'][_0xe524('0x6a')]));}_0x246c62=_0x4c7f45[_0xe524('0x8d')]();_0x4c7f45['limit'](_0x19b063);_0x4c7f45[_0xe524('0x1e')](0x0);return;}})['then'](function(){if(_0x45c287[_0xe524('0x8e')]===_0xe524('0x8f')){return null;}var _0x1be681=_[_0xe524('0x42')](_0x45c287,{'name':_0x45c287[_0xe524('0x90')]||_0x45c287[_0xe524('0x2f')]||_0x512572[_0xe524('0x2f')],'basename':_0x1f3ed1,'savename':util[_0xe524('0x79')]('%s-%s.%s',_0x45c287[_0xe524('0x2f')]||_0x512572['name'],require('randomstring')[_0xe524('0x91')](0x4),_0x45c287['output']||_0xe524('0x92')),'reportId':_0x512572['id'],'reportType':_0xe524('0x93')});return db[_0xe524('0x94')][_0xe524('0x4c')](_0x1be681,{'raw':!![]});})[_0xe524('0x27')](function(_0x26c802){if(_0x512572['table']==='cdr'){_0x246c62[_0xe524('0x40')](_0x512572[_0xe524('0x74')]+_0xe524('0x95'),_0x45c287[_0xe524('0x96')],_0x45c287[_0xe524('0x97')]);}else{_0x246c62[_0xe524('0x40')](_0x512572[_0xe524('0x74')]+_0xe524('0x98'),_0x45c287[_0xe524('0x96')],_0x45c287[_0xe524('0x97')]);}if(_0x26c802){logger['info'](_0xe524('0x99'),_0x246c62[_0xe524('0x87')]());require(_0xe524('0x9a'))[_0xe524('0x9b')](path[_0xe524('0x88')](__dirname,_0xe524('0x9c'),_0x26c802['output']),[_0x26c802['id'],_0x246c62[_0xe524('0x87')](),path[_0xe524('0x88')](__dirname,_0xe524('0x9d'),_0x26c802[_0xe524('0x9e')]),_0x1f3ed1]);return _0x26c802;}else{var _0x84bbd7=squel[_0xe524('0x73')]();_0x84bbd7[_0xe524('0x8c')]('('+_0x246c62[_0xe524('0x87')]()+')','countTable');_0x84bbd7['field']('COUNT(*)',_0xe524('0x1f'));_0x246c62[_0xe524('0x20')](_0x45c287['limit']||_0x19b063);_0x246c62[_0xe524('0x1e')](_0x45c287[_0xe524('0x1e')]||0x0);return dbH['sequelize'][_0xe524('0x36')](_0x84bbd7[_0xe524('0x87')](),{'type':dbH['sequelize'][_0xe524('0x9f')][_0xe524('0xa0')]})[_0xe524('0x27')](function(_0x542182){if(!_0x542182[_0xe524('0x3c')]){_0x2dc3f5=0x0;}else{_0x2dc3f5=_0x542182[0x0][_0xe524('0x1f')]||0x0;}return dbH[_0xe524('0x86')]['query'](_0x246c62[_0xe524('0x87')](),{'type':dbH[_0xe524('0x86')][_0xe524('0x9f')][_0xe524('0xa0')]});})['then'](function(_0x5e6a3d){return{'rows':_0x5e6a3d||[],'count':_0x2dc3f5};});}});}exports[_0xe524('0xa1')]=function(_0x33d066,_0x3ea495){return runReport(_0x33d066[_0xe524('0x54')],_0x33d066[_0xe524('0x36')],_0x33d066[_0xe524('0x45')])[_0xe524('0x27')](respondWithResult(_0x3ea495,null))[_0xe524('0x51')](handleError(_0x3ea495,null));};exports[_0xe524('0xa2')]=runReport;exports[_0xe524('0x36')]=function(_0x4505de,_0x292f14){var _0x2d24c1=0xa;var _0x483307=[_0xe524('0x88'),_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x280022={'SUM':_0xe524('0xa3'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe524('0x5b'),'MIN':'MIN(%s)','AVG':_0xe524('0x89'),'GROUP_CONCAT':_0xe524('0xa4'),'GROUP_CONCAT ASC':_0xe524('0x8a'),'GROUP_CONCAT DESC':_0xe524('0x5d')};var _0x46d6da={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x39998a=function(_0x107de8){return!_['includes']([_0xe524('0x64'),_0xe524('0x65'),'IS\x20EMPTY',_0xe524('0x67')],_0x107de8);};var _0x458e14=function(_0x4e0886){if(!_0x4e0886||!_0x4e0886['rules'][_0xe524('0x3c')]){return'';}for(var _0x3639cf='(',_0x575c14=0x0;_0x575c14<_0x4e0886['rules'][_0xe524('0x3c')];_0x575c14+=0x1){_0x575c14>0x0&&(_0x3639cf+='\x20'+_0x4e0886['operator']+'\x20');_0x3639cf+=_0x4e0886['rules'][_0x575c14]['group']?_0x458e14(_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6a')]):_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6b')]+'\x20'+_0x4e0886['rules'][_0x575c14]['condition']+(_0x39998a(_0x4e0886['rules'][_0x575c14][_0xe524('0x6c')])?'\x20'+_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6d')]:'');}return _0x3639cf+')';};var _0x289720={'where':{'id':_0x4505de[_0xe524('0x54')]['id']}},_0x3fb45c,_0x3362fe,_0x119684,_0x19e4fd,_0x4b4349;_0x289720=_[_0xe524('0x42')]({},_0x289720,_0x4505de[_0xe524('0x45')]);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x289720)[_0xe524('0x27')](function(_0x404a49){if(_0x404a49){_0x3fb45c=_0x404a49;return _0x404a49[_0xe524('0x8b')]();}return null;})[_0xe524('0x27')](function(_0x8e8087){if(_0x8e8087){if(!_0x8e8087['length']){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x3362fe=_0x8e8087;return db[_0xe524('0x71')][_0xe524('0x48')]({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x113a54){if(_0x113a54){_0x119684=_[_0xe524('0x72')](_0x113a54,'id');var _0x4ebca4;var _0x40043c=squel[_0xe524('0x73')]();_0x40043c[_0xe524('0x8c')](_0x3fb45c[_0xe524('0x74')]);for(var _0x19a773=0x0;_0x19a773<_0x3362fe[_0xe524('0x3c')];_0x19a773+=0x1){_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x75')]?_0x119684[_0x3362fe[_0x19a773][_0xe524('0x75')]][_0xe524('0x76')]:_0x3362fe[_0x19a773][_0xe524('0x6b')];_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x77')]?_[_0xe524('0x78')](_0x280022[_0x3362fe[_0x19a773]['function']],'%s',_0x4ebca4):_0x4ebca4;_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x79')]?_[_0xe524('0x78')](_0x46d6da[_0x3362fe[_0x19a773][_0xe524('0x79')]],'%s',_0x4ebca4):_0x4ebca4;if(_0x3362fe[_0x19a773]['groupBy']){_0x40043c['group'](_0x4ebca4);}_0x3362fe[_0x19a773][_0xe524('0x7b')]&&_0x40043c[_0xe524('0x3e')](_0x4ebca4,_0x3362fe[_0x19a773][_0xe524('0x7b')]==='DESC'?![]:!![]);_0x40043c[_0xe524('0x6b')](_0x4ebca4,_0x3362fe[_0x19a773][_0xe524('0x7d')]||_0x4ebca4);}if(_0x3fb45c[_0xe524('0x7e')]){_0x3fb45c['joins']=JSON['parse'](_0x3fb45c[_0xe524('0x7e')]);for(var _0x2a85e5=0x0;_0x2a85e5<_0x3fb45c[_0xe524('0x7e')]['length'];_0x2a85e5+=0x1){if(_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')]&&_[_0xe524('0x63')](_0x483307,_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')])&&_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x80')]&&_0x3fb45c['joins'][_0x2a85e5][_0xe524('0x82')]&&_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x81')]){_0x40043c[_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')]](_0x3fb45c['joins'][_0x2a85e5][_0xe524('0x82')],null,util[_0xe524('0x79')]('%s.%s\x20=\x20%s.%s',_0x3fb45c[_0xe524('0x74')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x80')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x82')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x81')]));}}}if(_0x3fb45c[_0xe524('0x84')]){_0x3fb45c[_0xe524('0x84')]=JSON['parse'](_0x3fb45c['conditions']);_0x40043c[_0xe524('0x40')](_0x458e14(_0x3fb45c[_0xe524('0x84')][_0xe524('0x6a')]));}_0x4b4349=_0x40043c[_0xe524('0x8d')]();_0x40043c[_0xe524('0x20')](_0x2d24c1);_0x40043c[_0xe524('0x1e')](0x0);logger[_0xe524('0xa5')]('Limited\x20Query:',_0x40043c['toString']());return dbH[_0xe524('0x86')]['query'](_0x40043c['toString'](),{'type':dbH[_0xe524('0x86')][_0xe524('0x9f')][_0xe524('0xa0')]});}})[_0xe524('0x27')](function(){return{'sql':_0x4b4349[_0xe524('0x87')]()};})[_0xe524('0x27')](respondWithResult(_0x292f14,null))['catch'](handleError(_0x292f14,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(_0x1406db,_0x487af2){var _0x48ed7e=function(_0x18b78f){while(--_0x18b78f){_0x1406db['push'](_0x1406db['shift']());}};_0x48ed7e(++_0x487af2);}(_0x1967,0x173));var _0x7196=function(_0x494fde,_0xfc7043){_0x494fde=_0x494fde-0x0;var _0x2b271d=_0x1967[_0x494fde];return _0x2b271d;};'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 65b7aa4..16eac59 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 _0xce78=['rimraf','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x253088,_0x1834e4){var _0x5d5f6e=function(_0x2124df){while(--_0x2124df){_0x253088['push'](_0x253088['shift']());}};_0x5d5f6e(++_0x1834e4);}(_0xce78,0x1d3));var _0x8ce7=function(_0x44fb02,_0x16bdbc){_0x44fb02=_0x44fb02-0x0;var _0x4d3aaa=_0xce78[_0x44fb02];return _0x4d3aaa;};'use strict';var _=require(_0x8ce7('0x0'));var util=require(_0x8ce7('0x1'));var logger=require(_0x8ce7('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8ce7('0x3'));var rp=require(_0x8ce7('0x4'));var fs=require('fs');var path=require(_0x8ce7('0x5'));var rimraf=require(_0x8ce7('0x6'));var config=require('../../config/environment');var attributes=require(_0x8ce7('0x7'));module[_0x8ce7('0x8')]=function(_0xc44713,_0x496586){return _0xc44713['define'](_0x8ce7('0x9'),attributes,{'tableName':_0x8ce7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xaf23=['rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x4a0c06,_0x50e132){var _0x2bafd0=function(_0x1dc7f9){while(--_0x1dc7f9){_0x4a0c06['push'](_0x4a0c06['shift']());}};_0x2bafd0(++_0x50e132);}(_0xaf23,0x1f2));var _0x3af2=function(_0x6b65a,_0xc8eda1){_0x6b65a=_0x6b65a-0x0;var _0x27deeb=_0xaf23[_0x6b65a];return _0x27deeb;};'use strict';var _=require(_0x3af2('0x0'));var util=require(_0x3af2('0x1'));var logger=require(_0x3af2('0x2'))('api');var moment=require(_0x3af2('0x3'));var BPromise=require('bluebird');var rp=require(_0x3af2('0x4'));var fs=require('fs');var path=require(_0x3af2('0x5'));var rimraf=require(_0x3af2('0x6'));var config=require(_0x3af2('0x7'));var attributes=require(_0x3af2('0x8'));module[_0x3af2('0x9')]=function(_0x11a461,_0x8fa0c2){return _0x11a461[_0x3af2('0xa')](_0x3af2('0xb'),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 a41e7cb..b2f6a4b 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 _0xe34c=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis'];(function(_0x206247,_0x149b6c){var _0x523c16=function(_0x2ee1b2){while(--_0x2ee1b2){_0x206247['push'](_0x206247['shift']());}};_0x523c16(++_0x149b6c);}(_0xe34c,0x65));var _0xce34=function(_0x1ae9f4,_0x1e7ec3){_0x1ae9f4=_0x1ae9f4-0x0;var _0x7cfef=_0xe34c[_0x1ae9f4];return _0x7cfef;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xce34('0x0'));var BPromise=require(_0xce34('0x1'));var rs=require(_0xce34('0x2'));var fs=require('fs');var Redis=require(_0xce34('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xce34('0x4'));var logger=require(_0xce34('0x5'))(_0xce34('0x6'));var config=require(_0xce34('0x7'));var jayson=require(_0xce34('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x23f9fb,_0xad3c40,_0x105ec6){return new BPromise(function(_0x25eb6f,_0x3c2e0b){return client[_0xce34('0x9')](_0x23f9fb,_0x105ec6)[_0xce34('0xa')](function(_0x4ce4c9){logger[_0xce34('0xb')](_0xce34('0xc'),_0xad3c40,_0xce34('0xd'));logger['debug'](_0xce34('0xe'),_0xad3c40,_0xce34('0xd'),JSON[_0xce34('0xf')](_0x4ce4c9));if(_0x4ce4c9[_0xce34('0x10')]){if(_0x4ce4c9['error'][_0xce34('0x11')]===0x1f4){logger[_0xce34('0x10')](_0xce34('0xc'),_0xad3c40,_0x4ce4c9[_0xce34('0x10')]['message']);return _0x3c2e0b(_0x4ce4c9[_0xce34('0x10')][_0xce34('0x12')]);}logger[_0xce34('0x10')](_0xce34('0xc'),_0xad3c40,_0x4ce4c9['error'][_0xce34('0x12')]);return _0x25eb6f(_0x4ce4c9[_0xce34('0x10')][_0xce34('0x12')]);}else{logger[_0xce34('0xb')](_0xce34('0xc'),_0xad3c40,_0xce34('0xd'));_0x25eb6f(_0x4ce4c9[_0xce34('0x13')][_0xce34('0x12')]);}})[_0xce34('0x14')](function(_0x584e4c){logger[_0xce34('0x10')](_0xce34('0xc'),_0xad3c40,_0x584e4c);_0x3c2e0b(_0x584e4c);});});}
\ No newline at end of file
+var _0xdb76=['AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x560615,_0x57b639){var _0x3b624f=function(_0x44af3a){while(--_0x44af3a){_0x560615['push'](_0x560615['shift']());}};_0x3b624f(++_0x57b639);}(_0xdb76,0x1c0));var _0x6db7=function(_0x1919c2,_0x4d04af){_0x1919c2=_0x1919c2-0x0;var _0x5e1451=_0xdb76[_0x1919c2];return _0x5e1451;};'use strict';var _=require(_0x6db7('0x0'));var util=require('util');var moment=require(_0x6db7('0x1'));var BPromise=require('bluebird');var rs=require(_0x6db7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6db7('0x3'))['db'];var utils=require(_0x6db7('0x4'));var logger=require(_0x6db7('0x5'))(_0x6db7('0x6'));var config=require(_0x6db7('0x7'));var jayson=require(_0x6db7('0x8'));var client=jayson[_0x6db7('0x9')][_0x6db7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ce150,_0x166b3c,_0xe19bc8){return new BPromise(function(_0x1abd6c,_0x59ef2a){return client['request'](_0x3ce150,_0xe19bc8)[_0x6db7('0xb')](function(_0x32c5c8){logger['info'](_0x6db7('0xc'),_0x166b3c,_0x6db7('0xd'));logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x166b3c,_0x6db7('0xd'),JSON[_0x6db7('0xe')](_0x32c5c8));if(_0x32c5c8['error']){if(_0x32c5c8['error'][_0x6db7('0xf')]===0x1f4){logger[_0x6db7('0x10')](_0x6db7('0xc'),_0x166b3c,_0x32c5c8['error']['message']);return _0x59ef2a(_0x32c5c8['error']['message']);}logger[_0x6db7('0x10')](_0x6db7('0xc'),_0x166b3c,_0x32c5c8['error'][_0x6db7('0x11')]);return _0x1abd6c(_0x32c5c8[_0x6db7('0x10')]['message']);}else{logger[_0x6db7('0x12')](_0x6db7('0xc'),_0x166b3c,'request\x20sent');_0x1abd6c(_0x32c5c8['result']['message']);}})[_0x6db7('0x13')](function(_0x40f209){logger[_0x6db7('0x10')](_0x6db7('0xc'),_0x166b3c,_0x40f209);_0x59ef2a(_0x40f209);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index b7850b9..412e902 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 _0x347a=['./analyticDefaultReport.controller','index','get','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','/:id/query','query','post','create','put','update','delete','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x11f0e3,_0x5170bc){var _0x2892e8=function(_0x3292b2){while(--_0x3292b2){_0x11f0e3['push'](_0x11f0e3['shift']());}};_0x2892e8(++_0x5170bc);}(_0x347a,0x148));var _0xa347=function(_0x5efb4a,_0x39b1ec){_0x5efb4a=_0x5efb4a-0x0;var _0x5f31a2=_0x347a[_0x5efb4a];return _0x5f31a2;};'use strict';var multer=require(_0xa347('0x0'));var util=require('util');var path=require(_0xa347('0x1'));var timeout=require(_0xa347('0x2'));var express=require('express');var router=express[_0xa347('0x3')]();var fs_extra=require(_0xa347('0x4'));var auth=require(_0xa347('0x5'));var interaction=require(_0xa347('0x6'));var config=require(_0xa347('0x7'));var controller=require(_0xa347('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xa347('0x9')]);router[_0xa347('0xa')](_0xa347('0xb'),auth[_0xa347('0xc')](),controller[_0xa347('0xd')]);router[_0xa347('0xa')](_0xa347('0xe'),auth[_0xa347('0xc')](),controller[_0xa347('0xf')]);router['get'](_0xa347('0x10'),auth[_0xa347('0xc')](),controller['run']);router[_0xa347('0xa')](_0xa347('0x11'),auth[_0xa347('0xc')](),controller[_0xa347('0x12')]);router[_0xa347('0x13')]('/',auth[_0xa347('0xc')](),controller[_0xa347('0x14')]);router[_0xa347('0x15')](_0xa347('0xb'),auth[_0xa347('0xc')](),controller[_0xa347('0x16')]);router[_0xa347('0x17')](_0xa347('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xbf43=['delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','put','update'];(function(_0x487b69,_0x5dcac2){var _0x3cd138=function(_0x705626){while(--_0x705626){_0x487b69['push'](_0x487b69['shift']());}};_0x3cd138(++_0x5dcac2);}(_0xbf43,0x13b));var _0x3bf4=function(_0x26ee7f,_0x25c2ac){_0x26ee7f=_0x26ee7f-0x0;var _0x1ed8b4=_0xbf43[_0x26ee7f];return _0x1ed8b4;};'use strict';var multer=require(_0x3bf4('0x0'));var util=require(_0x3bf4('0x1'));var path=require(_0x3bf4('0x2'));var timeout=require(_0x3bf4('0x3'));var express=require(_0x3bf4('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3bf4('0x5'));var interaction=require(_0x3bf4('0x6'));var config=require(_0x3bf4('0x7'));var controller=require(_0x3bf4('0x8'));router[_0x3bf4('0x9')]('/',auth[_0x3bf4('0xa')](),controller['index']);router[_0x3bf4('0x9')](_0x3bf4('0xb'),auth[_0x3bf4('0xa')](),controller[_0x3bf4('0xc')]);router[_0x3bf4('0x9')](_0x3bf4('0xd'),auth['isAuthenticated'](),controller[_0x3bf4('0xe')]);router[_0x3bf4('0x9')](_0x3bf4('0xf'),auth[_0x3bf4('0xa')](),controller[_0x3bf4('0x10')]);router[_0x3bf4('0x9')](_0x3bf4('0x11'),auth[_0x3bf4('0xa')](),controller[_0x3bf4('0x12')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x3bf4('0x13')](_0x3bf4('0xb'),auth['isAuthenticated'](),controller[_0x3bf4('0x14')]);router[_0x3bf4('0x15')](_0x3bf4('0xb'),auth[_0x3bf4('0xa')](),controller[_0x3bf4('0x16')]);module[_0x3bf4('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 79a949e..79ad553 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 _0x6051=['INTEGER','UNSIGNED','sequelize','moment','exports','ENUM','pdf','xlsx','csv','STRING','DATE','manual','scheduled'];(function(_0x2883cd,_0x2c2d03){var _0x3ea560=function(_0x3cbee5){while(--_0x3cbee5){_0x2883cd['push'](_0x2883cd['shift']());}};_0x3ea560(++_0x2c2d03);}(_0x6051,0x91));var _0x1605=function(_0x5266e7,_0x97b16b){_0x5266e7=_0x5266e7-0x0;var _0x5470f1=_0x6051[_0x5266e7];return _0x5470f1;};'use strict';var Sequelize=require(_0x1605('0x0'));var moment=require(_0x1605('0x1'));module[_0x1605('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x1605('0x3')]('csv',_0x1605('0x4'),_0x1605('0x5')),'allowNull':![],'defaultValue':_0x1605('0x6')},'savename':{'type':Sequelize[_0x1605('0x7')],'allowNull':![]},'startDate':{'type':Sequelize[_0x1605('0x8')]},'endDate':{'type':Sequelize[_0x1605('0x8')]},'status':{'type':Sequelize[_0x1605('0x7')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x1605('0x9'),_0x1605('0xa')),'allowNull':![],'defaultValue':_0x1605('0x9')},'reportId':{'type':Sequelize[_0x1605('0xb')](0xb)[_0x1605('0xc')]},'reportType':{'type':Sequelize[_0x1605('0x7')]}};
\ No newline at end of file
+var _0xfe2f=['csv','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','moment','exports','STRING','ENUM','xlsx'];(function(_0x17c32c,_0x35683f){var _0x2847b6=function(_0x4cf68b){while(--_0x4cf68b){_0x17c32c['push'](_0x17c32c['shift']());}};_0x2847b6(++_0x35683f);}(_0xfe2f,0x1db));var _0xffe2=function(_0x130f1b,_0x49b396){_0x130f1b=_0x130f1b-0x0;var _0x3bf16e=_0xfe2f[_0x130f1b];return _0x3bf16e;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xffe2('0x0'));module[_0xffe2('0x1')]={'name':{'type':Sequelize[_0xffe2('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xffe2('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xffe2('0x3')]('csv','pdf',_0xffe2('0x4')),'allowNull':![],'defaultValue':_0xffe2('0x5')},'savename':{'type':Sequelize[_0xffe2('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xffe2('0x6')]},'endDate':{'type':Sequelize[_0xffe2('0x6')]},'status':{'type':Sequelize[_0xffe2('0x2')],'defaultValue':_0xffe2('0x7')},'type':{'type':Sequelize[_0xffe2('0x3')](_0xffe2('0x8'),_0xffe2('0x9')),'allowNull':![],'defaultValue':_0xffe2('0x8')},'reportId':{'type':Sequelize[_0xffe2('0xa')](0xb)[_0xffe2('0xb')]},'reportType':{'type':Sequelize[_0xffe2('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index a203762..ce886fa 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 _0xe5cd=['UserProfileSection','userProfileId','autoAssociation','params','download','basename','savename','output','existsSync','join','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','get','ExtractedReports','UserProfileResource','end','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','pick','filter','merge','VIRTUAL','options','where','includeAll','findAll','rows','catch','show','length','include','find','create','body','user','role'];(function(_0x330723,_0x8de382){var _0x60c546=function(_0xd6d3fe){while(--_0xd6d3fe){_0x330723['push'](_0x330723['shift']());}};_0x60c546(++_0x8de382);}(_0xe5cd,0x12b));var _0xde5c=function(_0xa57fa4,_0x314a8e){_0xa57fa4=_0xa57fa4-0x0;var _0x160e9b=_0xe5cd[_0xa57fa4];return _0x160e9b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xde5c('0x0'));var zipdir=require(_0xde5c('0x1'));var jsonpatch=require(_0xde5c('0x2'));var rp=require('request-promise');var moment=require(_0xde5c('0x3'));var BPromise=require(_0xde5c('0x4'));var Mustache=require(_0xde5c('0x5'));var util=require(_0xde5c('0x6'));var path=require(_0xde5c('0x7'));var sox=require('sox');var csv=require(_0xde5c('0x8'));var ejs=require(_0xde5c('0x9'));var fs=require('fs');var fs_extra=require(_0xde5c('0xa'));var _=require('lodash');var squel=require(_0xde5c('0xb'));var crypto=require(_0xde5c('0xc'));var jsforce=require(_0xde5c('0xd'));var deskjs=require(_0xde5c('0xe'));var toCsv=require('to-csv');var querystring=require(_0xde5c('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xde5c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xde5c('0x11'));var utils=require(_0xde5c('0x12'));var config=require(_0xde5c('0x13'));var licenseUtil=require(_0xde5c('0x14'));var db=require(_0xde5c('0x15'))['db'];function respondWithStatusCode(_0x151917,_0x252404){_0x252404=_0x252404||0xcc;return function(_0x2d814e){if(_0x2d814e){return _0x151917[_0xde5c('0x16')](_0x252404);}return _0x151917[_0xde5c('0x17')](_0x252404)['end']();};}function respondWithResult(_0x28b99f,_0x1998c4){_0x1998c4=_0x1998c4||0xc8;return function(_0x3974e0){if(_0x3974e0){return _0x28b99f[_0xde5c('0x17')](_0x1998c4)[_0xde5c('0x18')](_0x3974e0);}};}function respondWithFilteredResult(_0x3cb0f1,_0x1bb2b2){return function(_0x807c2a){if(_0x807c2a){var _0x17fa6f=typeof _0x1bb2b2[_0xde5c('0x19')]===_0xde5c('0x1a')&&typeof _0x1bb2b2[_0xde5c('0x1b')]===_0xde5c('0x1a');var _0x445429=_0x807c2a[_0xde5c('0x1c')];var _0x3599e9=_0x17fa6f?0x0:_0x1bb2b2[_0xde5c('0x19')];var _0x5b3ab4=_0x17fa6f?_0x807c2a['count']:_0x1bb2b2['offset']+_0x1bb2b2['limit'];var _0x228902;if(_0x5b3ab4>=_0x445429){_0x5b3ab4=_0x445429;_0x228902=0xc8;}else{_0x228902=0xce;}_0x3cb0f1[_0xde5c('0x17')](_0x228902);return _0x3cb0f1[_0xde5c('0x1d')]('Content-Range',_0x3599e9+'-'+_0x5b3ab4+'/'+_0x445429)[_0xde5c('0x18')](_0x807c2a);}return null;};}function patchUpdates(_0x1a0b9a){return function(_0x22f13b){try{jsonpatch[_0xde5c('0x1e')](_0x22f13b,_0x1a0b9a,!![]);}catch(_0x20c579){return BPromise['reject'](_0x20c579);}return _0x22f13b[_0xde5c('0x1f')]();};}function saveUpdates(_0x20b168,_0x335034){return function(_0x1ae139){if(_0x1ae139){return _0x1ae139[_0xde5c('0x20')](_0x20b168)[_0xde5c('0x21')](function(_0x27995d){return _0x27995d;});}return null;};}function removeEntity(_0x3477d4,_0xc4fc10){return function(_0x6bc68b){if(_0x6bc68b){return _0x6bc68b[_0xde5c('0x22')]()[_0xde5c('0x21')](function(){var _0xd5eca8=_0x6bc68b[_0xde5c('0x23')]({'plain':!![]});var _0x37ad39=_0xde5c('0x24');return db[_0xde5c('0x25')]['destroy']({'where':{'type':_0x37ad39,'resourceId':_0xd5eca8['id']}})[_0xde5c('0x21')](function(){return _0x6bc68b;});})[_0xde5c('0x21')](function(){_0x3477d4[_0xde5c('0x17')](0xcc)[_0xde5c('0x26')]();});}};}function handleEntityNotFound(_0x1fe3ce,_0x4e1ab7){return function(_0x3dbc7e){if(!_0x3dbc7e){_0x1fe3ce[_0xde5c('0x16')](0x194);}return _0x3dbc7e;};}function handleError(_0x2a34dc,_0x2a6317){_0x2a6317=_0x2a6317||0x1f4;return function(_0x56171d){logger[_0xde5c('0x27')](_0x56171d[_0xde5c('0x28')]);if(_0x56171d[_0xde5c('0x29')]){delete _0x56171d['name'];}_0x2a34dc[_0xde5c('0x17')](_0x2a6317)[_0xde5c('0x2a')](_0x56171d);};}exports[_0xde5c('0x2b')]=function(_0x727396,_0x363a71){var _0x39455c={},_0x3f1713={},_0x2a3570={'count':0x0,'rows':[]};var _0x24d91e=_[_0xde5c('0x2c')](db[_0xde5c('0x2d')][_0xde5c('0x2e')],function(_0x10bcee){return{'name':_0x10bcee['fieldName'],'type':_0x10bcee[_0xde5c('0x2f')][_0xde5c('0x30')]};});_0x3f1713[_0xde5c('0x31')]=_['map'](_0x24d91e,'name');_0x3f1713[_0xde5c('0x32')]=_[_0xde5c('0x33')](_0x727396['query']);_0x3f1713[_0xde5c('0x34')]=_[_0xde5c('0x35')](_0x3f1713['model'],_0x3f1713[_0xde5c('0x32')]);_0x39455c['attributes']=_[_0xde5c('0x35')](_0x3f1713[_0xde5c('0x31')],qs[_0xde5c('0x36')](_0x727396[_0xde5c('0x32')][_0xde5c('0x36')]));_0x39455c[_0xde5c('0x37')]=_0x39455c[_0xde5c('0x37')]['length']?_0x39455c['attributes']:_0x3f1713[_0xde5c('0x31')];if(!_0x727396[_0xde5c('0x32')][_0xde5c('0x38')]('nolimit')){_0x39455c['limit']=qs[_0xde5c('0x1b')](_0x727396['query'][_0xde5c('0x1b')]);_0x39455c[_0xde5c('0x19')]=qs[_0xde5c('0x19')](_0x727396[_0xde5c('0x32')][_0xde5c('0x19')]);}_0x39455c[_0xde5c('0x39')]=qs['sort'](_0x727396[_0xde5c('0x32')][_0xde5c('0x3a')]);_0x39455c['where']=qs[_0xde5c('0x34')](_[_0xde5c('0x3b')](_0x727396[_0xde5c('0x32')],_0x3f1713[_0xde5c('0x34')]),_0x24d91e);if(_0x727396[_0xde5c('0x32')][_0xde5c('0x3c')]){_0x39455c['where']=_[_0xde5c('0x3d')](_0x39455c['where'],{'$or':_[_0xde5c('0x2c')](_0x24d91e,function(_0x506b8f){if(_0x506b8f['type']!==_0xde5c('0x3e')){var _0x27b0d8={};_0x27b0d8[_0x506b8f['name']]={'$like':'%'+_0x727396[_0xde5c('0x32')][_0xde5c('0x3c')]+'%'};return _0x27b0d8;}})});}_0x39455c=_[_0xde5c('0x3d')]({},_0x39455c,_0x727396[_0xde5c('0x3f')]);var _0x2601b3={'where':_0x39455c[_0xde5c('0x40')]};return db[_0xde5c('0x2d')][_0xde5c('0x1c')](_0x2601b3)[_0xde5c('0x21')](function(_0x4d2589){_0x2a3570[_0xde5c('0x1c')]=_0x4d2589;if(_0x727396['query'][_0xde5c('0x41')]){_0x39455c['include']=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xde5c('0x42')](_0x39455c);})[_0xde5c('0x21')](function(_0x3f0530){_0x2a3570[_0xde5c('0x43')]=_0x3f0530;return _0x2a3570;})[_0xde5c('0x21')](respondWithFilteredResult(_0x363a71,_0x39455c))[_0xde5c('0x44')](handleError(_0x363a71,null));};exports[_0xde5c('0x45')]=function(_0x5cd68e,_0x4ec11a){var _0x21e1f1={'raw':!![],'where':{'id':_0x5cd68e['params']['id']}},_0xd60245={};_0xd60245['model']=_[_0xde5c('0x33')](db[_0xde5c('0x2d')][_0xde5c('0x2e')]);_0xd60245[_0xde5c('0x32')]=_[_0xde5c('0x33')](_0x5cd68e[_0xde5c('0x32')]);_0xd60245[_0xde5c('0x34')]=_['intersection'](_0xd60245[_0xde5c('0x31')],_0xd60245[_0xde5c('0x32')]);_0x21e1f1[_0xde5c('0x37')]=_[_0xde5c('0x35')](_0xd60245[_0xde5c('0x31')],qs[_0xde5c('0x36')](_0x5cd68e[_0xde5c('0x32')][_0xde5c('0x36')]));_0x21e1f1['attributes']=_0x21e1f1[_0xde5c('0x37')][_0xde5c('0x46')]?_0x21e1f1[_0xde5c('0x37')]:_0xd60245[_0xde5c('0x31')];if(_0x5cd68e['query'][_0xde5c('0x41')]){_0x21e1f1[_0xde5c('0x47')]=[{'all':!![]}];}_0x21e1f1=_['merge']({},_0x21e1f1,_0x5cd68e[_0xde5c('0x3f')]);return db[_0xde5c('0x2d')][_0xde5c('0x48')](_0x21e1f1)[_0xde5c('0x21')](handleEntityNotFound(_0x4ec11a,null))[_0xde5c('0x21')](respondWithResult(_0x4ec11a,null))['catch'](handleError(_0x4ec11a,null));};exports[_0xde5c('0x49')]=function(_0x3c9ed3,_0x7613f){return db[_0xde5c('0x2d')][_0xde5c('0x49')](_0x3c9ed3[_0xde5c('0x4a')],{})[_0xde5c('0x21')](function(_0x284fd9){var _0x3950e0=_0x3c9ed3[_0xde5c('0x4b')][_0xde5c('0x23')]({'plain':!![]});if(!_0x3950e0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3950e0[_0xde5c('0x4c')]===_0xde5c('0x4b')){var _0x562ff2=_0x284fd9[_0xde5c('0x23')]({'plain':!![]});var _0x40d16c=_0xde5c('0x24');return db[_0xde5c('0x4d')][_0xde5c('0x48')]({'where':{'name':_0x40d16c,'userProfileId':_0x3950e0[_0xde5c('0x4e')]},'raw':!![]})[_0xde5c('0x21')](function(_0x6d250f){if(_0x6d250f&&_0x6d250f[_0xde5c('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x562ff2[_0xde5c('0x29')],'resourceId':_0x562ff2['id'],'type':_0x6d250f[_0xde5c('0x29')],'sectionId':_0x6d250f['id']},{})[_0xde5c('0x21')](function(){return _0x284fd9;});}else{return _0x284fd9;}})[_0xde5c('0x44')](function(_0xc51373){logger[_0xde5c('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc51373);throw _0xc51373;});}return _0x284fd9;})[_0xde5c('0x21')](respondWithResult(_0x7613f,0xc9))[_0xde5c('0x44')](handleError(_0x7613f,null));};exports[_0xde5c('0x20')]=function(_0x4b5709,_0x333fed){if(_0x4b5709[_0xde5c('0x4a')]['id']){delete _0x4b5709[_0xde5c('0x4a')]['id'];}return db['AnalyticExtractedReport'][_0xde5c('0x48')]({'where':{'id':_0x4b5709[_0xde5c('0x50')]['id']}})[_0xde5c('0x21')](handleEntityNotFound(_0x333fed,null))[_0xde5c('0x21')](saveUpdates(_0x4b5709[_0xde5c('0x4a')],null))[_0xde5c('0x21')](respondWithResult(_0x333fed,null))[_0xde5c('0x44')](handleError(_0x333fed,null));};exports[_0xde5c('0x22')]=function(_0x2fb254,_0x59e451){return db[_0xde5c('0x2d')][_0xde5c('0x48')]({'where':{'id':_0x2fb254[_0xde5c('0x50')]['id']}})[_0xde5c('0x21')](handleEntityNotFound(_0x59e451,null))[_0xde5c('0x21')](removeEntity(_0x59e451,null))['catch'](handleError(_0x59e451,null));};exports[_0xde5c('0x51')]=function(_0x39434d,_0x55b3d4,_0x51bed1){return db['AnalyticExtractedReport'][_0xde5c('0x48')]({'where':{'id':_0x39434d['params']['id']},'attributes':['name',_0xde5c('0x52'),_0xde5c('0x53'),_0xde5c('0x54')],'raw':!![]})['then'](handleEntityNotFound(_0x55b3d4,null))[_0xde5c('0x21')](function(_0x423e0e){if(_0x423e0e){if(!fs[_0xde5c('0x55')](path[_0xde5c('0x56')](config['root'],'server/files/reports',_0x423e0e[_0xde5c('0x53')]))){throw new db[(_0xde5c('0x57'))][(_0xde5c('0x58'))](_0xde5c('0x59'));}if(_0x39434d['query'][_0xde5c('0x5a')]){return _0x55b3d4[_0xde5c('0x16')](0xc8);}return _0x55b3d4['download'](path['join'](config['root'],'server/files/reports',_0x423e0e[_0xde5c('0x53')]),util[_0xde5c('0x5b')](_0xde5c('0x5c'),_0x423e0e[_0xde5c('0x52')]||_0x423e0e[_0xde5c('0x29')],_0x423e0e[_0xde5c('0x54')][_0xde5c('0x5d')]()));}})[_0xde5c('0x44')](handleError(_0x55b3d4,null));};
\ No newline at end of file
+var _0x058a=['json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','AnalyticExtractedReport','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','UserProfileSection','userProfileId','download','basename','existsSync','root','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','join','%s.%s','output','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x391554,_0x3ffa5a){var _0x314412=function(_0x3c326c){while(--_0x3c326c){_0x391554['push'](_0x391554['shift']());}};_0x314412(++_0x3ffa5a);}(_0x058a,0x1bf));var _0xa058=function(_0xe96de5,_0x5b2946){_0xe96de5=_0xe96de5-0x0;var _0x280055=_0x058a[_0xe96de5];return _0x280055;};'use strict';var emlformat=require(_0xa058('0x0'));var rimraf=require(_0xa058('0x1'));var zipdir=require(_0xa058('0x2'));var jsonpatch=require(_0xa058('0x3'));var rp=require(_0xa058('0x4'));var moment=require('moment');var BPromise=require(_0xa058('0x5'));var Mustache=require(_0xa058('0x6'));var util=require(_0xa058('0x7'));var path=require(_0xa058('0x8'));var sox=require(_0xa058('0x9'));var csv=require(_0xa058('0xa'));var ejs=require(_0xa058('0xb'));var fs=require('fs');var fs_extra=require(_0xa058('0xc'));var _=require(_0xa058('0xd'));var squel=require(_0xa058('0xe'));var crypto=require(_0xa058('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa058('0xa'));var querystring=require(_0xa058('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa058('0x11'));var qs=require(_0xa058('0x12'));var as=require(_0xa058('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa058('0x14'))(_0xa058('0x15'));var utils=require('../../config/utils');var config=require(_0xa058('0x16'));var licenseUtil=require(_0xa058('0x17'));var db=require(_0xa058('0x18'))['db'];function respondWithStatusCode(_0x2031bc,_0x736c75){_0x736c75=_0x736c75||0xcc;return function(_0x4c91c4){if(_0x4c91c4){return _0x2031bc[_0xa058('0x19')](_0x736c75);}return _0x2031bc[_0xa058('0x1a')](_0x736c75)[_0xa058('0x1b')]();};}function respondWithResult(_0x16338a,_0x1cd9f8){_0x1cd9f8=_0x1cd9f8||0xc8;return function(_0x2f8d9a){if(_0x2f8d9a){return _0x16338a[_0xa058('0x1a')](_0x1cd9f8)[_0xa058('0x1c')](_0x2f8d9a);}};}function respondWithFilteredResult(_0x154647,_0x377b63){return function(_0x59c576){if(_0x59c576){var _0x2abee6=typeof _0x377b63[_0xa058('0x1d')]===_0xa058('0x1e')&&typeof _0x377b63['limit']===_0xa058('0x1e');var _0x4e08e5=_0x59c576[_0xa058('0x1f')];var _0x21339b=_0x2abee6?0x0:_0x377b63[_0xa058('0x1d')];var _0x19d7e8=_0x2abee6?_0x59c576['count']:_0x377b63['offset']+_0x377b63[_0xa058('0x20')];var _0x59dc65;if(_0x19d7e8>=_0x4e08e5){_0x19d7e8=_0x4e08e5;_0x59dc65=0xc8;}else{_0x59dc65=0xce;}_0x154647[_0xa058('0x1a')](_0x59dc65);return _0x154647['set'](_0xa058('0x21'),_0x21339b+'-'+_0x19d7e8+'/'+_0x4e08e5)[_0xa058('0x1c')](_0x59c576);}return null;};}function patchUpdates(_0x5ef4ac){return function(_0x13711e){try{jsonpatch[_0xa058('0x22')](_0x13711e,_0x5ef4ac,!![]);}catch(_0x40b8ed){return BPromise[_0xa058('0x23')](_0x40b8ed);}return _0x13711e[_0xa058('0x24')]();};}function saveUpdates(_0x22c49a,_0x178e26){return function(_0x2f14c3){if(_0x2f14c3){return _0x2f14c3[_0xa058('0x25')](_0x22c49a)[_0xa058('0x26')](function(_0xa5279e){return _0xa5279e;});}return null;};}function removeEntity(_0x302a03,_0x38f39d){return function(_0x1a19fd){if(_0x1a19fd){return _0x1a19fd[_0xa058('0x27')]()['then'](function(){var _0x26d4d9=_0x1a19fd[_0xa058('0x28')]({'plain':!![]});var _0x4fcec1='ExtractedReports';return db[_0xa058('0x29')][_0xa058('0x27')]({'where':{'type':_0x4fcec1,'resourceId':_0x26d4d9['id']}})[_0xa058('0x26')](function(){return _0x1a19fd;});})['then'](function(){_0x302a03[_0xa058('0x1a')](0xcc)[_0xa058('0x1b')]();});}};}function handleEntityNotFound(_0x175640,_0x2288d8){return function(_0xc131d2){if(!_0xc131d2){_0x175640['sendStatus'](0x194);}return _0xc131d2;};}function handleError(_0x41b308,_0x377b36){_0x377b36=_0x377b36||0x1f4;return function(_0x2e4572){logger[_0xa058('0x2a')](_0x2e4572[_0xa058('0x2b')]);if(_0x2e4572[_0xa058('0x2c')]){delete _0x2e4572['name'];}_0x41b308[_0xa058('0x1a')](_0x377b36)[_0xa058('0x2d')](_0x2e4572);};}exports['index']=function(_0x4bf5af,_0x384d25){var _0x34d837={},_0x5ce8cc={},_0x28d4cf={'count':0x0,'rows':[]};var _0x5ab8c2=_[_0xa058('0x2e')](db['AnalyticExtractedReport'][_0xa058('0x2f')],function(_0x1660e8){return{'name':_0x1660e8[_0xa058('0x30')],'type':_0x1660e8[_0xa058('0x31')][_0xa058('0x32')]};});_0x5ce8cc[_0xa058('0x33')]=_['map'](_0x5ab8c2,'name');_0x5ce8cc[_0xa058('0x34')]=_[_0xa058('0x35')](_0x4bf5af[_0xa058('0x34')]);_0x5ce8cc[_0xa058('0x36')]=_[_0xa058('0x37')](_0x5ce8cc[_0xa058('0x33')],_0x5ce8cc[_0xa058('0x34')]);_0x34d837['attributes']=_[_0xa058('0x37')](_0x5ce8cc['model'],qs['fields'](_0x4bf5af['query'][_0xa058('0x38')]));_0x34d837[_0xa058('0x39')]=_0x34d837[_0xa058('0x39')][_0xa058('0x3a')]?_0x34d837[_0xa058('0x39')]:_0x5ce8cc[_0xa058('0x33')];if(!_0x4bf5af[_0xa058('0x34')]['hasOwnProperty'](_0xa058('0x3b'))){_0x34d837[_0xa058('0x20')]=qs['limit'](_0x4bf5af[_0xa058('0x34')][_0xa058('0x20')]);_0x34d837['offset']=qs[_0xa058('0x1d')](_0x4bf5af[_0xa058('0x34')][_0xa058('0x1d')]);}_0x34d837[_0xa058('0x3c')]=qs[_0xa058('0x3d')](_0x4bf5af[_0xa058('0x34')][_0xa058('0x3d')]);_0x34d837[_0xa058('0x3e')]=qs[_0xa058('0x36')](_[_0xa058('0x3f')](_0x4bf5af[_0xa058('0x34')],_0x5ce8cc['filters']),_0x5ab8c2);if(_0x4bf5af[_0xa058('0x34')]['filter']){_0x34d837[_0xa058('0x3e')]=_[_0xa058('0x40')](_0x34d837[_0xa058('0x3e')],{'$or':_[_0xa058('0x2e')](_0x5ab8c2,function(_0x2ab0d2){if(_0x2ab0d2['type']!==_0xa058('0x41')){var _0x2b9b79={};_0x2b9b79[_0x2ab0d2[_0xa058('0x2c')]]={'$like':'%'+_0x4bf5af['query'][_0xa058('0x42')]+'%'};return _0x2b9b79;}})});}_0x34d837=_['merge']({},_0x34d837,_0x4bf5af['options']);var _0x31ff62={'where':_0x34d837[_0xa058('0x3e')]};return db[_0xa058('0x43')]['count'](_0x31ff62)['then'](function(_0x392b96){_0x28d4cf[_0xa058('0x1f')]=_0x392b96;if(_0x4bf5af[_0xa058('0x34')][_0xa058('0x44')]){_0x34d837[_0xa058('0x45')]=[{'all':!![]}];}return db[_0xa058('0x43')][_0xa058('0x46')](_0x34d837);})[_0xa058('0x26')](function(_0x1e0a98){_0x28d4cf[_0xa058('0x47')]=_0x1e0a98;return _0x28d4cf;})[_0xa058('0x26')](respondWithFilteredResult(_0x384d25,_0x34d837))[_0xa058('0x48')](handleError(_0x384d25,null));};exports[_0xa058('0x49')]=function(_0x17f26e,_0x369845){var _0xf881e0={'raw':!![],'where':{'id':_0x17f26e[_0xa058('0x4a')]['id']}},_0x2ea8c4={};_0x2ea8c4[_0xa058('0x33')]=_[_0xa058('0x35')](db['AnalyticExtractedReport'][_0xa058('0x2f')]);_0x2ea8c4[_0xa058('0x34')]=_[_0xa058('0x35')](_0x17f26e[_0xa058('0x34')]);_0x2ea8c4[_0xa058('0x36')]=_[_0xa058('0x37')](_0x2ea8c4['model'],_0x2ea8c4[_0xa058('0x34')]);_0xf881e0[_0xa058('0x39')]=_[_0xa058('0x37')](_0x2ea8c4[_0xa058('0x33')],qs[_0xa058('0x38')](_0x17f26e['query']['fields']));_0xf881e0[_0xa058('0x39')]=_0xf881e0[_0xa058('0x39')][_0xa058('0x3a')]?_0xf881e0[_0xa058('0x39')]:_0x2ea8c4[_0xa058('0x33')];if(_0x17f26e['query'][_0xa058('0x44')]){_0xf881e0['include']=[{'all':!![]}];}_0xf881e0=_[_0xa058('0x40')]({},_0xf881e0,_0x17f26e[_0xa058('0x4b')]);return db['AnalyticExtractedReport'][_0xa058('0x4c')](_0xf881e0)[_0xa058('0x26')](handleEntityNotFound(_0x369845,null))['then'](respondWithResult(_0x369845,null))['catch'](handleError(_0x369845,null));};exports[_0xa058('0x4d')]=function(_0x1ca16b,_0x3f0cce){return db[_0xa058('0x43')][_0xa058('0x4d')](_0x1ca16b[_0xa058('0x4e')],{})[_0xa058('0x26')](function(_0x416e45){var _0x2b930e=_0x1ca16b[_0xa058('0x4f')]['get']({'plain':!![]});if(!_0x2b930e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b930e['role']===_0xa058('0x4f')){var _0x4d463b=_0x416e45[_0xa058('0x28')]({'plain':!![]});var _0x4b3975='ExtractedReports';return db[_0xa058('0x50')][_0xa058('0x4c')]({'where':{'name':_0x4b3975,'userProfileId':_0x2b930e[_0xa058('0x51')]},'raw':!![]})[_0xa058('0x26')](function(_0x4e5155){if(_0x4e5155&&_0x4e5155['autoAssociation']===0x0){return db[_0xa058('0x29')][_0xa058('0x4d')]({'name':_0x4d463b[_0xa058('0x2c')],'resourceId':_0x4d463b['id'],'type':_0x4e5155[_0xa058('0x2c')],'sectionId':_0x4e5155['id']},{})[_0xa058('0x26')](function(){return _0x416e45;});}else{return _0x416e45;}})[_0xa058('0x48')](function(_0x19b04c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x19b04c);throw _0x19b04c;});}return _0x416e45;})['then'](respondWithResult(_0x3f0cce,0xc9))[_0xa058('0x48')](handleError(_0x3f0cce,null));};exports[_0xa058('0x25')]=function(_0x18dd60,_0x4cf98f){if(_0x18dd60[_0xa058('0x4e')]['id']){delete _0x18dd60[_0xa058('0x4e')]['id'];}return db[_0xa058('0x43')][_0xa058('0x4c')]({'where':{'id':_0x18dd60[_0xa058('0x4a')]['id']}})[_0xa058('0x26')](handleEntityNotFound(_0x4cf98f,null))['then'](saveUpdates(_0x18dd60[_0xa058('0x4e')],null))[_0xa058('0x26')](respondWithResult(_0x4cf98f,null))['catch'](handleError(_0x4cf98f,null));};exports[_0xa058('0x27')]=function(_0x27e1bc,_0x37f6d1){return db[_0xa058('0x43')][_0xa058('0x4c')]({'where':{'id':_0x27e1bc[_0xa058('0x4a')]['id']}})[_0xa058('0x26')](handleEntityNotFound(_0x37f6d1,null))[_0xa058('0x26')](removeEntity(_0x37f6d1,null))['catch'](handleError(_0x37f6d1,null));};exports[_0xa058('0x52')]=function(_0x24703b,_0x37c761,_0x105353){return db[_0xa058('0x43')][_0xa058('0x4c')]({'where':{'id':_0x24703b[_0xa058('0x4a')]['id']},'attributes':[_0xa058('0x2c'),_0xa058('0x53'),'savename','output'],'raw':!![]})[_0xa058('0x26')](handleEntityNotFound(_0x37c761,null))['then'](function(_0x547eeb){if(_0x547eeb){if(!fs[_0xa058('0x54')](path['join'](config[_0xa058('0x55')],_0xa058('0x56'),_0x547eeb[_0xa058('0x57')]))){throw new db[(_0xa058('0x58'))][(_0xa058('0x59'))](_0xa058('0x5a'));}if(_0x24703b[_0xa058('0x34')]['exists']){return _0x37c761[_0xa058('0x19')](0xc8);}return _0x37c761[_0xa058('0x52')](path[_0xa058('0x5b')](config[_0xa058('0x55')],_0xa058('0x56'),_0x547eeb[_0xa058('0x57')]),util['format'](_0xa058('0x5c'),_0x547eeb[_0xa058('0x53')]||_0x547eeb[_0xa058('0x2c')],_0x547eeb[_0xa058('0x5d')][_0xa058('0x5e')]()));}})[_0xa058('0x48')](handleError(_0x37c761,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 610c0a4..98748dd 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 _0x6592=['path','rimraf','exports','define','AnalyticExtractedReport','lodash','util','api','moment','bluebird'];(function(_0x4eac23,_0x5d41f8){var _0x38d8f6=function(_0x5e9e5f){while(--_0x5e9e5f){_0x4eac23['push'](_0x4eac23['shift']());}};_0x38d8f6(++_0x5d41f8);}(_0x6592,0x145));var _0x2659=function(_0x396a05,_0xc13516){_0x396a05=_0x396a05-0x0;var _0x5407a4=_0x6592[_0x396a05];return _0x5407a4;};'use strict';var _=require(_0x2659('0x0'));var util=require(_0x2659('0x1'));var logger=require('../../config/logger')(_0x2659('0x2'));var moment=require(_0x2659('0x3'));var BPromise=require(_0x2659('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2659('0x5'));var rimraf=require(_0x2659('0x6'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module[_0x2659('0x7')]=function(_0x407b31,_0x5d7b28){return _0x407b31[_0x2659('0x8')](_0x2659('0x9'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc12e=['util','../../config/logger','api','moment','bluebird','../../config/environment','exports','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0x5459c1,_0x36f6f0){var _0x3f99b5=function(_0x512bea){while(--_0x512bea){_0x5459c1['push'](_0x5459c1['shift']());}};_0x3f99b5(++_0x36f6f0);}(_0xc12e,0x19e));var _0xec12=function(_0x47dde4,_0xc8fe9e){_0x47dde4=_0x47dde4-0x0;var _0x46bd3e=_0xc12e[_0x47dde4];return _0x46bd3e;};'use strict';var _=require('lodash');var util=require(_0xec12('0x0'));var logger=require(_0xec12('0x1'))(_0xec12('0x2'));var moment=require(_0xec12('0x3'));var BPromise=require(_0xec12('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xec12('0x5'));var attributes=require('./analyticExtractedReport.attributes');module[_0xec12('0x6')]=function(_0x4cb618,_0x2891c0){return _0x4cb618['define'](_0xec12('0x7'),attributes,{'tableName':_0xec12('0x8'),'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 a45ad45..ba3e95e 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 _0x6472=['../../config/environment','jayson/promise','client','http','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','util','moment','bluebird','../../config/utils','../../config/logger'];(function(_0x3638fa,_0x4bae8f){var _0xc818a7=function(_0x49fd1c){while(--_0x49fd1c){_0x3638fa['push'](_0x3638fa['shift']());}};_0xc818a7(++_0x4bae8f);}(_0x6472,0xcc));var _0x2647=function(_0xc9e185,_0x1ed7f5){_0xc9e185=_0xc9e185-0x0;var _0x4f1b0c=_0x6472[_0xc9e185];return _0x4f1b0c;};'use strict';var _=require('lodash');var util=require(_0x2647('0x0'));var moment=require(_0x2647('0x1'));var BPromise=require(_0x2647('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2647('0x3'));var logger=require(_0x2647('0x4'))('rpc');var config=require(_0x2647('0x5'));var jayson=require(_0x2647('0x6'));var client=jayson[_0x2647('0x7')][_0x2647('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x99b11e,_0xe41345,_0x1f7039){return new BPromise(function(_0x3d63e2,_0x4bda33){return client['request'](_0x99b11e,_0x1f7039)[_0x2647('0x9')](function(_0x4d416b){logger['info'](_0x2647('0xa'),_0xe41345,_0x2647('0xb'));logger[_0x2647('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0xe41345,'request\x20sent',JSON[_0x2647('0xd')](_0x4d416b));if(_0x4d416b['error']){if(_0x4d416b[_0x2647('0xe')][_0x2647('0xf')]===0x1f4){logger['error'](_0x2647('0xa'),_0xe41345,_0x4d416b['error'][_0x2647('0x10')]);return _0x4bda33(_0x4d416b[_0x2647('0xe')]['message']);}logger[_0x2647('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xe41345,_0x4d416b['error']['message']);return _0x3d63e2(_0x4d416b['error'][_0x2647('0x10')]);}else{logger[_0x2647('0x11')](_0x2647('0xa'),_0xe41345,_0x2647('0xb'));_0x3d63e2(_0x4d416b[_0x2647('0x12')][_0x2647('0x10')]);}})['catch'](function(_0xb01465){logger[_0x2647('0xe')](_0x2647('0xa'),_0xe41345,_0xb01465);_0x4bda33(_0xb01465);});});}
\ No newline at end of file
+var _0x7d06=['AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7d06,0x158));var _0x67d0=function(_0x5edf1c,_0xc7c803){_0x5edf1c=_0x5edf1c-0x0;var _0x53e9a9=_0x7d06[_0x5edf1c];return _0x53e9a9;};'use strict';var _=require(_0x67d0('0x0'));var util=require(_0x67d0('0x1'));var moment=require(_0x67d0('0x2'));var BPromise=require(_0x67d0('0x3'));var rs=require(_0x67d0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x67d0('0x5'))['db'];var utils=require(_0x67d0('0x6'));var logger=require(_0x67d0('0x7'))('rpc');var config=require(_0x67d0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x67d0('0x9')][_0x67d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x367f1d,_0xe4789b,_0x3c9976){return new BPromise(function(_0x481a08,_0x358986){return client['request'](_0x367f1d,_0x3c9976)[_0x67d0('0xb')](function(_0x5916d0){logger[_0x67d0('0xc')](_0x67d0('0xd'),_0xe4789b,_0x67d0('0xe'));logger[_0x67d0('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0xe4789b,_0x67d0('0xe'),JSON['stringify'](_0x5916d0));if(_0x5916d0['error']){if(_0x5916d0[_0x67d0('0x10')][_0x67d0('0x11')]===0x1f4){logger['error'](_0x67d0('0xd'),_0xe4789b,_0x5916d0[_0x67d0('0x10')]['message']);return _0x358986(_0x5916d0[_0x67d0('0x10')]['message']);}logger[_0x67d0('0x10')](_0x67d0('0xd'),_0xe4789b,_0x5916d0[_0x67d0('0x10')][_0x67d0('0x12')]);return _0x481a08(_0x5916d0[_0x67d0('0x10')][_0x67d0('0x12')]);}else{logger[_0x67d0('0xc')](_0x67d0('0xd'),_0xe4789b,_0x67d0('0xe'));_0x481a08(_0x5916d0[_0x67d0('0x13')]['message']);}})[_0x67d0('0x14')](function(_0xa1b889){logger['error'](_0x67d0('0xd'),_0xe4789b,_0xa1b889);_0x358986(_0xa1b889);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index d3c8a5d..ceda643 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 _0x2e7f=['put','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','/:id','isAuthenticated','show','/:id/download','download','post','create'];(function(_0x2495c2,_0x204a77){var _0x500c73=function(_0x32813e){while(--_0x32813e){_0x2495c2['push'](_0x2495c2['shift']());}};_0x500c73(++_0x204a77);}(_0x2e7f,0xb8));var _0xf2e7=function(_0x715c02,_0x4584db){_0x715c02=_0x715c02-0x0;var _0x48d06e=_0x2e7f[_0x715c02];return _0x48d06e;};'use strict';var multer=require(_0xf2e7('0x0'));var util=require(_0xf2e7('0x1'));var path=require('path');var timeout=require(_0xf2e7('0x2'));var express=require(_0xf2e7('0x3'));var router=express[_0xf2e7('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf2e7('0x5'));var config=require(_0xf2e7('0x6'));var controller=require(_0xf2e7('0x7'));router[_0xf2e7('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf2e7('0x8')](_0xf2e7('0x9'),auth[_0xf2e7('0xa')](),controller[_0xf2e7('0xb')]);router[_0xf2e7('0x8')](_0xf2e7('0xc'),auth[_0xf2e7('0xa')](),controller[_0xf2e7('0xd')]);router[_0xf2e7('0xe')]('/',auth[_0xf2e7('0xa')](),controller[_0xf2e7('0xf')]);router[_0xf2e7('0x10')](_0xf2e7('0x9'),auth['isAuthenticated'](),controller[_0xf2e7('0x11')]);router[_0xf2e7('0x12')](_0xf2e7('0x9'),auth[_0xf2e7('0xa')](),controller['destroy']);module[_0xf2e7('0x13')]=router;
\ No newline at end of file
+var _0xd968=['/:id','show','download','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x12d013,_0x27a541){var _0x627ee=function(_0x548d51){while(--_0x548d51){_0x12d013['push'](_0x12d013['shift']());}};_0x627ee(++_0x27a541);}(_0xd968,0xd3));var _0x8d96=function(_0x4fa6c3,_0x331ef8){_0x4fa6c3=_0x4fa6c3-0x0;var _0x5bdac0=_0xd968[_0x4fa6c3];return _0x5bdac0;};'use strict';var multer=require(_0x8d96('0x0'));var util=require(_0x8d96('0x1'));var path=require(_0x8d96('0x2'));var timeout=require('connect-timeout');var express=require(_0x8d96('0x3'));var router=express[_0x8d96('0x4')]();var fs_extra=require(_0x8d96('0x5'));var auth=require(_0x8d96('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8d96('0x7'));var controller=require('./analyticExtractedReport.controller');router[_0x8d96('0x8')]('/',auth[_0x8d96('0x9')](),controller['index']);router[_0x8d96('0x8')](_0x8d96('0xa'),auth[_0x8d96('0x9')](),controller[_0x8d96('0xb')]);router[_0x8d96('0x8')]('/:id/download',auth[_0x8d96('0x9')](),controller[_0x8d96('0xc')]);router['post']('/',auth[_0x8d96('0x9')](),controller['create']);router[_0x8d96('0xd')](_0x8d96('0xa'),auth['isAuthenticated'](),controller[_0x8d96('0xe')]);router[_0x8d96('0xf')](_0x8d96('0xa'),auth[_0x8d96('0x9')](),controller['destroy']);module[_0x8d96('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 6cabbaa..80c62d4 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 _0xdf63=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x4e1f20,_0x144d8d){var _0x45b9ec=function(_0xf5a9a1){while(--_0xf5a9a1){_0x4e1f20['push'](_0x4e1f20['shift']());}};_0x45b9ec(++_0x144d8d);}(_0xdf63,0x111));var _0x3df6=function(_0x44745f,_0x432d7e){_0x44745f=_0x44745f-0x0;var _0xac7f24=_0xdf63[_0x44745f];return _0xac7f24;};'use strict';var Sequelize=require(_0x3df6('0x0'));module[_0x3df6('0x1')]={'field':{'type':Sequelize[_0x3df6('0x2')]},'alias':{'type':Sequelize[_0x3df6('0x3')]},'function':{'type':Sequelize[_0x3df6('0x3')]},'format':{'type':Sequelize[_0x3df6('0x3')]},'groupBy':{'type':Sequelize[_0x3df6('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x3df6('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x17c9=['STRING','BOOLEAN','exports','TEXT'];(function(_0x3b2c6f,_0xa9f35c){var _0x22e219=function(_0x3ee04c){while(--_0x3ee04c){_0x3b2c6f['push'](_0x3b2c6f['shift']());}};_0x22e219(++_0xa9f35c);}(_0x17c9,0x11a));var _0x917c=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x17c9[_0x2dadb9];return _0x2f0097;};'use strict';var Sequelize=require('sequelize');module[_0x917c('0x0')]={'field':{'type':Sequelize[_0x917c('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x917c('0x2')]},'format':{'type':Sequelize[_0x917c('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x917c('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 38aff9d..18fce4b 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 _0x7b54=['pick','merge','VIRTUAL','filter','options','includeAll','include','catch','params','AnalyticFieldReport','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','end','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where'];(function(_0x30af1c,_0x2b4ceb){var _0x198d78=function(_0x236ba3){while(--_0x236ba3){_0x30af1c['push'](_0x30af1c['shift']());}};_0x198d78(++_0x2b4ceb);}(_0x7b54,0xb7));var _0x47b5=function(_0x4d6554,_0x24a2bf){_0x4d6554=_0x4d6554-0x0;var _0xd9f05b=_0x7b54[_0x4d6554];return _0xd9f05b;};'use strict';var emlformat=require(_0x47b5('0x0'));var rimraf=require(_0x47b5('0x1'));var zipdir=require(_0x47b5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47b5('0x3'));var moment=require('moment');var BPromise=require(_0x47b5('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x47b5('0x5'));var sox=require(_0x47b5('0x6'));var csv=require(_0x47b5('0x7'));var ejs=require(_0x47b5('0x8'));var fs=require('fs');var fs_extra=require(_0x47b5('0x9'));var _=require(_0x47b5('0xa'));var squel=require(_0x47b5('0xb'));var crypto=require(_0x47b5('0xc'));var jsforce=require(_0x47b5('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x47b5('0x7'));var querystring=require(_0x47b5('0xe'));var Papa=require(_0x47b5('0xf'));var Redis=require('ioredis');var authService=require(_0x47b5('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x47b5('0x11'));var logger=require(_0x47b5('0x12'))(_0x47b5('0x13'));var utils=require('../../config/utils');var config=require(_0x47b5('0x14'));var licenseUtil=require(_0x47b5('0x15'));var db=require(_0x47b5('0x16'))['db'];function respondWithStatusCode(_0x3b9a91,_0x597350){_0x597350=_0x597350||0xcc;return function(_0xa2c841){if(_0xa2c841){return _0x3b9a91['sendStatus'](_0x597350);}return _0x3b9a91['status'](_0x597350)['end']();};}function respondWithResult(_0x1db247,_0x21282b){_0x21282b=_0x21282b||0xc8;return function(_0x56a310){if(_0x56a310){return _0x1db247[_0x47b5('0x17')](_0x21282b)[_0x47b5('0x18')](_0x56a310);}};}function respondWithFilteredResult(_0x1d36e7,_0x458809){return function(_0x200929){if(_0x200929){var _0x4cc878=typeof _0x458809[_0x47b5('0x19')]===_0x47b5('0x1a')&&typeof _0x458809[_0x47b5('0x1b')]===_0x47b5('0x1a');var _0x413708=_0x200929[_0x47b5('0x1c')];var _0x352ac8=_0x4cc878?0x0:_0x458809['offset'];var _0x5ef7a8=_0x4cc878?_0x200929[_0x47b5('0x1c')]:_0x458809[_0x47b5('0x19')]+_0x458809[_0x47b5('0x1b')];var _0x4f8b7f;if(_0x5ef7a8>=_0x413708){_0x5ef7a8=_0x413708;_0x4f8b7f=0xc8;}else{_0x4f8b7f=0xce;}_0x1d36e7[_0x47b5('0x17')](_0x4f8b7f);return _0x1d36e7[_0x47b5('0x1d')](_0x47b5('0x1e'),_0x352ac8+'-'+_0x5ef7a8+'/'+_0x413708)[_0x47b5('0x18')](_0x200929);}return null;};}function patchUpdates(_0x5b6dcc){return function(_0x46e864){try{jsonpatch[_0x47b5('0x1f')](_0x46e864,_0x5b6dcc,!![]);}catch(_0x6644ec){return BPromise[_0x47b5('0x20')](_0x6644ec);}return _0x46e864['save']();};}function saveUpdates(_0x37234d,_0x43a548){return function(_0xb477e9){if(_0xb477e9){return _0xb477e9[_0x47b5('0x21')](_0x37234d)['then'](function(_0x2c0a5b){return _0x2c0a5b;});}return null;};}function removeEntity(_0x25f015,_0x40c399){return function(_0x41a120){if(_0x41a120){return _0x41a120[_0x47b5('0x22')]()[_0x47b5('0x23')](function(){_0x25f015[_0x47b5('0x17')](0xcc)[_0x47b5('0x24')]();});}};}function handleEntityNotFound(_0x219e72,_0xee6dc5){return function(_0x4accd9){if(!_0x4accd9){_0x219e72['sendStatus'](0x194);}return _0x4accd9;};}function handleError(_0x1a86d5,_0x29cdfb){_0x29cdfb=_0x29cdfb||0x1f4;return function(_0x29be32){logger[_0x47b5('0x25')](_0x29be32[_0x47b5('0x26')]);if(_0x29be32['name']){delete _0x29be32[_0x47b5('0x27')];}_0x1a86d5['status'](_0x29cdfb)['send'](_0x29be32);};}exports[_0x47b5('0x28')]=function(_0x194b2d,_0x4481f0){var _0x19ecdd={},_0x55ea81={},_0x50815e={'count':0x0,'rows':[]};var _0x4fa5a2=_[_0x47b5('0x29')](db['AnalyticFieldReport'][_0x47b5('0x2a')],function(_0x50e225){return{'name':_0x50e225[_0x47b5('0x2b')],'type':_0x50e225[_0x47b5('0x2c')]['key']};});_0x55ea81[_0x47b5('0x2d')]=_[_0x47b5('0x29')](_0x4fa5a2,_0x47b5('0x27'));_0x55ea81[_0x47b5('0x2e')]=_[_0x47b5('0x2f')](_0x194b2d[_0x47b5('0x2e')]);_0x55ea81[_0x47b5('0x30')]=_[_0x47b5('0x31')](_0x55ea81[_0x47b5('0x2d')],_0x55ea81[_0x47b5('0x2e')]);_0x19ecdd['attributes']=_[_0x47b5('0x31')](_0x55ea81[_0x47b5('0x2d')],qs[_0x47b5('0x32')](_0x194b2d[_0x47b5('0x2e')][_0x47b5('0x32')]));_0x19ecdd[_0x47b5('0x33')]=_0x19ecdd['attributes'][_0x47b5('0x34')]?_0x19ecdd[_0x47b5('0x33')]:_0x55ea81[_0x47b5('0x2d')];if(!_0x194b2d['query'][_0x47b5('0x35')]('nolimit')){_0x19ecdd[_0x47b5('0x1b')]=qs[_0x47b5('0x1b')](_0x194b2d[_0x47b5('0x2e')]['limit']);_0x19ecdd[_0x47b5('0x19')]=qs['offset'](_0x194b2d['query'][_0x47b5('0x19')]);}_0x19ecdd[_0x47b5('0x36')]=qs[_0x47b5('0x37')](_0x194b2d[_0x47b5('0x2e')][_0x47b5('0x37')]);_0x19ecdd[_0x47b5('0x38')]=qs['filters'](_[_0x47b5('0x39')](_0x194b2d[_0x47b5('0x2e')],_0x55ea81[_0x47b5('0x30')]),_0x4fa5a2);if(_0x194b2d[_0x47b5('0x2e')]['filter']){_0x19ecdd['where']=_[_0x47b5('0x3a')](_0x19ecdd[_0x47b5('0x38')],{'$or':_[_0x47b5('0x29')](_0x4fa5a2,function(_0x32af95){if(_0x32af95[_0x47b5('0x2c')]!==_0x47b5('0x3b')){var _0xa8a661={};_0xa8a661[_0x32af95[_0x47b5('0x27')]]={'$like':'%'+_0x194b2d[_0x47b5('0x2e')][_0x47b5('0x3c')]+'%'};return _0xa8a661;}})});}_0x19ecdd=_[_0x47b5('0x3a')]({},_0x19ecdd,_0x194b2d[_0x47b5('0x3d')]);var _0xf8fbcc={'where':_0x19ecdd['where']};return db['AnalyticFieldReport'][_0x47b5('0x1c')](_0xf8fbcc)['then'](function(_0x21b10b){_0x50815e[_0x47b5('0x1c')]=_0x21b10b;if(_0x194b2d['query'][_0x47b5('0x3e')]){_0x19ecdd[_0x47b5('0x3f')]=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0x19ecdd);})[_0x47b5('0x23')](function(_0x2e50f1){_0x50815e['rows']=_0x2e50f1;return _0x50815e;})[_0x47b5('0x23')](respondWithFilteredResult(_0x4481f0,_0x19ecdd))[_0x47b5('0x40')](handleError(_0x4481f0,null));};exports['show']=function(_0x501ec1,_0x38ba26){var _0x43096d={'raw':![],'where':{'id':_0x501ec1[_0x47b5('0x41')]['id']}},_0x7ad62e={};_0x7ad62e[_0x47b5('0x2d')]=_[_0x47b5('0x2f')](db[_0x47b5('0x42')]['rawAttributes']);_0x7ad62e[_0x47b5('0x2e')]=_[_0x47b5('0x2f')](_0x501ec1[_0x47b5('0x2e')]);_0x7ad62e['filters']=_['intersection'](_0x7ad62e[_0x47b5('0x2d')],_0x7ad62e['query']);_0x43096d[_0x47b5('0x33')]=_[_0x47b5('0x31')](_0x7ad62e[_0x47b5('0x2d')],qs['fields'](_0x501ec1['query'][_0x47b5('0x32')]));_0x43096d[_0x47b5('0x33')]=_0x43096d['attributes']['length']?_0x43096d['attributes']:_0x7ad62e[_0x47b5('0x2d')];if(_0x501ec1[_0x47b5('0x2e')][_0x47b5('0x3e')]){_0x43096d[_0x47b5('0x3f')]=[{'all':!![]}];}_0x43096d=_[_0x47b5('0x3a')]({},_0x43096d,_0x501ec1['options']);return db[_0x47b5('0x42')][_0x47b5('0x43')](_0x43096d)[_0x47b5('0x23')](handleEntityNotFound(_0x38ba26,null))[_0x47b5('0x23')](respondWithResult(_0x38ba26,null))[_0x47b5('0x40')](handleError(_0x38ba26,null));};exports[_0x47b5('0x44')]=function(_0x245a7f,_0x180278){return db['AnalyticFieldReport'][_0x47b5('0x44')](_0x245a7f[_0x47b5('0x45')],{})['then'](respondWithResult(_0x180278,0xc9))[_0x47b5('0x40')](handleError(_0x180278,null));};exports[_0x47b5('0x46')]=function(_0x11626a,_0x21437a){return db[_0x47b5('0x42')][_0x47b5('0x46')](_0x11626a[_0x47b5('0x45')],{'raw':![],'individualHooks':!![]})[_0x47b5('0x23')](respondWithResult(_0x21437a,0xc9))['catch'](handleError(_0x21437a,null));};exports[_0x47b5('0x21')]=function(_0x1782bb,_0x37a7ec){if(_0x1782bb[_0x47b5('0x45')]['id']){delete _0x1782bb[_0x47b5('0x45')]['id'];}return db[_0x47b5('0x42')][_0x47b5('0x43')]({'where':{'id':_0x1782bb[_0x47b5('0x41')]['id']}})[_0x47b5('0x23')](handleEntityNotFound(_0x37a7ec,null))[_0x47b5('0x23')](saveUpdates(_0x1782bb[_0x47b5('0x45')],null))[_0x47b5('0x23')](respondWithResult(_0x37a7ec,null))[_0x47b5('0x40')](handleError(_0x37a7ec,null));};exports[_0x47b5('0x22')]=function(_0x591f85,_0x279190){return db[_0x47b5('0x42')][_0x47b5('0x43')]({'where':{'id':_0x591f85[_0x47b5('0x41')]['id']}})[_0x47b5('0x23')](handleEntityNotFound(_0x279190,null))['then'](removeEntity(_0x279190,null))['catch'](handleError(_0x279190,null));};exports[_0x47b5('0x47')]=function(_0x535473,_0xca5451){return db[_0x47b5('0x42')][_0x47b5('0x22')]({'where':{'id':_0x535473[_0x47b5('0x2e')][_0x47b5('0x48')]||[]},'raw':![],'individualHooks':!![]})[_0x47b5('0x23')](respondWithResult(_0xca5451,0xcc))[_0x47b5('0x40')](handleError(_0xca5451,null));};exports[_0x47b5('0x49')]=function(_0xf0555f,_0x3af59f,_0x1102fc){return db[_0x47b5('0x4a')][_0x47b5('0x4b')]({'where':{'id':_0xf0555f[_0x47b5('0x41')]['id']}})['then'](handleEntityNotFound(_0x3af59f,null))['then'](function(_0x9b7f80){if(_0x9b7f80){return db[_0x47b5('0x4c')][_0x47b5('0x4d')](function(_0x5cae10){return db[_0x47b5('0x42')][_0x47b5('0x22')]({'where':{'CustomReportId':_0xf0555f[_0x47b5('0x41')]['id']},'transaction':_0x5cae10})[_0x47b5('0x23')](function(_0x5a76d0){var _0x4ba5e3=_['map'](_0xf0555f[_0x47b5('0x45')],function(_0x2cf57d){delete _0x2cf57d['id'];_0x2cf57d[_0x47b5('0x4e')]=_0xf0555f[_0x47b5('0x41')]['id'];return _0x2cf57d;});return db['AnalyticFieldReport']['bulkCreate'](_0x4ba5e3,{'transaction':_0x5cae10});});})[_0x47b5('0x23')](function(){return db['AnalyticFieldReport'][_0x47b5('0x4f')]({'where':{'CustomReportId':_0xf0555f[_0x47b5('0x41')]['id']}});});}})[_0x47b5('0x23')](respondWithResult(_0x3af59f,null))['catch'](handleError(_0x3af59f,null));};
\ No newline at end of file
+var _0x7a7c=['name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','AnalyticFieldReport','findAll','rows','catch','show','find','create','body','bulkCreate','params','bulkDestroy','addFields','AnalyticCustomReport','sequelize','transaction','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','set','json','apply','reject','save','update','then','destroy','sendStatus','error','stack'];(function(_0x5342b3,_0x472de0){var _0x153f4e=function(_0x1df249){while(--_0x1df249){_0x5342b3['push'](_0x5342b3['shift']());}};_0x153f4e(++_0x472de0);}(_0x7a7c,0xc9));var _0xc7a7=function(_0x52934a,_0x52e134){_0x52934a=_0x52934a-0x0;var _0x24feb8=_0x7a7c[_0x52934a];return _0x24feb8;};'use strict';var emlformat=require(_0xc7a7('0x0'));var rimraf=require(_0xc7a7('0x1'));var zipdir=require(_0xc7a7('0x2'));var jsonpatch=require(_0xc7a7('0x3'));var rp=require(_0xc7a7('0x4'));var moment=require(_0xc7a7('0x5'));var BPromise=require(_0xc7a7('0x6'));var Mustache=require(_0xc7a7('0x7'));var util=require('util');var path=require(_0xc7a7('0x8'));var sox=require(_0xc7a7('0x9'));var csv=require(_0xc7a7('0xa'));var ejs=require(_0xc7a7('0xb'));var fs=require('fs');var fs_extra=require(_0xc7a7('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc7a7('0xd'));var jsforce=require(_0xc7a7('0xe'));var deskjs=require(_0xc7a7('0xf'));var toCsv=require(_0xc7a7('0xa'));var querystring=require(_0xc7a7('0x10'));var Papa=require('papaparse');var Redis=require(_0xc7a7('0x11'));var authService=require(_0xc7a7('0x12'));var qs=require(_0xc7a7('0x13'));var as=require(_0xc7a7('0x14'));var hardwareService=require(_0xc7a7('0x15'));var logger=require('../../config/logger')(_0xc7a7('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc7a7('0x17'));var db=require(_0xc7a7('0x18'))['db'];function respondWithStatusCode(_0x122d10,_0x59347a){_0x59347a=_0x59347a||0xcc;return function(_0x5d7093){if(_0x5d7093){return _0x122d10['sendStatus'](_0x59347a);}return _0x122d10[_0xc7a7('0x19')](_0x59347a)[_0xc7a7('0x1a')]();};}function respondWithResult(_0x138531,_0x5ce12a){_0x5ce12a=_0x5ce12a||0xc8;return function(_0x2cfc49){if(_0x2cfc49){return _0x138531[_0xc7a7('0x19')](_0x5ce12a)['json'](_0x2cfc49);}};}function respondWithFilteredResult(_0x3ba7eb,_0x15c5ba){return function(_0x3cfdfb){if(_0x3cfdfb){var _0x177ce2=typeof _0x15c5ba['offset']===_0xc7a7('0x1b')&&typeof _0x15c5ba[_0xc7a7('0x1c')]==='undefined';var _0x5f47e1=_0x3cfdfb[_0xc7a7('0x1d')];var _0x1316f5=_0x177ce2?0x0:_0x15c5ba['offset'];var _0x258302=_0x177ce2?_0x3cfdfb[_0xc7a7('0x1d')]:_0x15c5ba[_0xc7a7('0x1e')]+_0x15c5ba[_0xc7a7('0x1c')];var _0x419b52;if(_0x258302>=_0x5f47e1){_0x258302=_0x5f47e1;_0x419b52=0xc8;}else{_0x419b52=0xce;}_0x3ba7eb['status'](_0x419b52);return _0x3ba7eb[_0xc7a7('0x1f')]('Content-Range',_0x1316f5+'-'+_0x258302+'/'+_0x5f47e1)[_0xc7a7('0x20')](_0x3cfdfb);}return null;};}function patchUpdates(_0x14f794){return function(_0x30864a){try{jsonpatch[_0xc7a7('0x21')](_0x30864a,_0x14f794,!![]);}catch(_0x4c03b7){return BPromise[_0xc7a7('0x22')](_0x4c03b7);}return _0x30864a[_0xc7a7('0x23')]();};}function saveUpdates(_0x2590eb,_0x11e5f8){return function(_0x2d4ada){if(_0x2d4ada){return _0x2d4ada[_0xc7a7('0x24')](_0x2590eb)[_0xc7a7('0x25')](function(_0x4955f7){return _0x4955f7;});}return null;};}function removeEntity(_0x1efbc5,_0x3041ef){return function(_0x878010){if(_0x878010){return _0x878010[_0xc7a7('0x26')]()[_0xc7a7('0x25')](function(){_0x1efbc5[_0xc7a7('0x19')](0xcc)[_0xc7a7('0x1a')]();});}};}function handleEntityNotFound(_0x16710c,_0xc5bc45){return function(_0x575583){if(!_0x575583){_0x16710c[_0xc7a7('0x27')](0x194);}return _0x575583;};}function handleError(_0x4609a1,_0x41127c){_0x41127c=_0x41127c||0x1f4;return function(_0x3234ab){logger[_0xc7a7('0x28')](_0x3234ab[_0xc7a7('0x29')]);if(_0x3234ab[_0xc7a7('0x2a')]){delete _0x3234ab[_0xc7a7('0x2a')];}_0x4609a1[_0xc7a7('0x19')](_0x41127c)['send'](_0x3234ab);};}exports[_0xc7a7('0x2b')]=function(_0x7dc99f,_0x3be3e0){var _0x26e230={},_0x1cf8d7={},_0x3a7751={'count':0x0,'rows':[]};var _0x4d716a=_[_0xc7a7('0x2c')](db['AnalyticFieldReport'][_0xc7a7('0x2d')],function(_0x25c745){return{'name':_0x25c745['fieldName'],'type':_0x25c745[_0xc7a7('0x2e')][_0xc7a7('0x2f')]};});_0x1cf8d7[_0xc7a7('0x30')]=_[_0xc7a7('0x2c')](_0x4d716a,_0xc7a7('0x2a'));_0x1cf8d7[_0xc7a7('0x31')]=_[_0xc7a7('0x32')](_0x7dc99f[_0xc7a7('0x31')]);_0x1cf8d7[_0xc7a7('0x33')]=_['intersection'](_0x1cf8d7[_0xc7a7('0x30')],_0x1cf8d7['query']);_0x26e230['attributes']=_[_0xc7a7('0x34')](_0x1cf8d7[_0xc7a7('0x30')],qs[_0xc7a7('0x35')](_0x7dc99f[_0xc7a7('0x31')][_0xc7a7('0x35')]));_0x26e230[_0xc7a7('0x36')]=_0x26e230['attributes'][_0xc7a7('0x37')]?_0x26e230[_0xc7a7('0x36')]:_0x1cf8d7[_0xc7a7('0x30')];if(!_0x7dc99f[_0xc7a7('0x31')]['hasOwnProperty'](_0xc7a7('0x38'))){_0x26e230['limit']=qs[_0xc7a7('0x1c')](_0x7dc99f[_0xc7a7('0x31')][_0xc7a7('0x1c')]);_0x26e230[_0xc7a7('0x1e')]=qs['offset'](_0x7dc99f[_0xc7a7('0x31')][_0xc7a7('0x1e')]);}_0x26e230[_0xc7a7('0x39')]=qs[_0xc7a7('0x3a')](_0x7dc99f[_0xc7a7('0x31')][_0xc7a7('0x3a')]);_0x26e230['where']=qs[_0xc7a7('0x33')](_['pick'](_0x7dc99f[_0xc7a7('0x31')],_0x1cf8d7[_0xc7a7('0x33')]),_0x4d716a);if(_0x7dc99f[_0xc7a7('0x31')][_0xc7a7('0x3b')]){_0x26e230[_0xc7a7('0x3c')]=_[_0xc7a7('0x3d')](_0x26e230[_0xc7a7('0x3c')],{'$or':_[_0xc7a7('0x2c')](_0x4d716a,function(_0x26bb61){if(_0x26bb61['type']!==_0xc7a7('0x3e')){var _0x21b396={};_0x21b396[_0x26bb61[_0xc7a7('0x2a')]]={'$like':'%'+_0x7dc99f[_0xc7a7('0x31')][_0xc7a7('0x3b')]+'%'};return _0x21b396;}})});}_0x26e230=_[_0xc7a7('0x3d')]({},_0x26e230,_0x7dc99f[_0xc7a7('0x3f')]);var _0x2f7ed7={'where':_0x26e230[_0xc7a7('0x3c')]};return db['AnalyticFieldReport']['count'](_0x2f7ed7)[_0xc7a7('0x25')](function(_0x2a90a9){_0x3a7751[_0xc7a7('0x1d')]=_0x2a90a9;if(_0x7dc99f[_0xc7a7('0x31')][_0xc7a7('0x40')]){_0x26e230[_0xc7a7('0x41')]=[{'all':!![]}];}return db[_0xc7a7('0x42')][_0xc7a7('0x43')](_0x26e230);})[_0xc7a7('0x25')](function(_0x42f576){_0x3a7751[_0xc7a7('0x44')]=_0x42f576;return _0x3a7751;})['then'](respondWithFilteredResult(_0x3be3e0,_0x26e230))[_0xc7a7('0x45')](handleError(_0x3be3e0,null));};exports[_0xc7a7('0x46')]=function(_0x16d6f6,_0x75e01d){var _0xac3e26={'raw':![],'where':{'id':_0x16d6f6['params']['id']}},_0x3dd955={};_0x3dd955['model']=_[_0xc7a7('0x32')](db[_0xc7a7('0x42')][_0xc7a7('0x2d')]);_0x3dd955[_0xc7a7('0x31')]=_[_0xc7a7('0x32')](_0x16d6f6[_0xc7a7('0x31')]);_0x3dd955[_0xc7a7('0x33')]=_[_0xc7a7('0x34')](_0x3dd955['model'],_0x3dd955[_0xc7a7('0x31')]);_0xac3e26['attributes']=_['intersection'](_0x3dd955[_0xc7a7('0x30')],qs[_0xc7a7('0x35')](_0x16d6f6['query']['fields']));_0xac3e26[_0xc7a7('0x36')]=_0xac3e26['attributes'][_0xc7a7('0x37')]?_0xac3e26[_0xc7a7('0x36')]:_0x3dd955[_0xc7a7('0x30')];if(_0x16d6f6[_0xc7a7('0x31')]['includeAll']){_0xac3e26[_0xc7a7('0x41')]=[{'all':!![]}];}_0xac3e26=_[_0xc7a7('0x3d')]({},_0xac3e26,_0x16d6f6[_0xc7a7('0x3f')]);return db[_0xc7a7('0x42')][_0xc7a7('0x47')](_0xac3e26)[_0xc7a7('0x25')](handleEntityNotFound(_0x75e01d,null))['then'](respondWithResult(_0x75e01d,null))[_0xc7a7('0x45')](handleError(_0x75e01d,null));};exports[_0xc7a7('0x48')]=function(_0x392e7a,_0x41d1fa){return db[_0xc7a7('0x42')][_0xc7a7('0x48')](_0x392e7a[_0xc7a7('0x49')],{})[_0xc7a7('0x25')](respondWithResult(_0x41d1fa,0xc9))['catch'](handleError(_0x41d1fa,null));};exports[_0xc7a7('0x4a')]=function(_0x23f6c3,_0x1b53e9){return db[_0xc7a7('0x42')][_0xc7a7('0x4a')](_0x23f6c3[_0xc7a7('0x49')],{'raw':![],'individualHooks':!![]})[_0xc7a7('0x25')](respondWithResult(_0x1b53e9,0xc9))[_0xc7a7('0x45')](handleError(_0x1b53e9,null));};exports['update']=function(_0xc6c678,_0xc02ed5){if(_0xc6c678['body']['id']){delete _0xc6c678['body']['id'];}return db['AnalyticFieldReport'][_0xc7a7('0x47')]({'where':{'id':_0xc6c678[_0xc7a7('0x4b')]['id']}})[_0xc7a7('0x25')](handleEntityNotFound(_0xc02ed5,null))[_0xc7a7('0x25')](saveUpdates(_0xc6c678[_0xc7a7('0x49')],null))[_0xc7a7('0x25')](respondWithResult(_0xc02ed5,null))[_0xc7a7('0x45')](handleError(_0xc02ed5,null));};exports[_0xc7a7('0x26')]=function(_0x5322b0,_0x4800b7){return db[_0xc7a7('0x42')]['find']({'where':{'id':_0x5322b0[_0xc7a7('0x4b')]['id']}})[_0xc7a7('0x25')](handleEntityNotFound(_0x4800b7,null))[_0xc7a7('0x25')](removeEntity(_0x4800b7,null))[_0xc7a7('0x45')](handleError(_0x4800b7,null));};exports[_0xc7a7('0x4c')]=function(_0xa63ca,_0xb655cd){return db[_0xc7a7('0x42')][_0xc7a7('0x26')]({'where':{'id':_0xa63ca[_0xc7a7('0x31')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xc7a7('0x25')](respondWithResult(_0xb655cd,0xcc))[_0xc7a7('0x45')](handleError(_0xb655cd,null));};exports[_0xc7a7('0x4d')]=function(_0xce113a,_0x2190d1,_0x379a92){return db[_0xc7a7('0x4e')]['findOne']({'where':{'id':_0xce113a[_0xc7a7('0x4b')]['id']}})[_0xc7a7('0x25')](handleEntityNotFound(_0x2190d1,null))['then'](function(_0x578093){if(_0x578093){return db[_0xc7a7('0x4f')][_0xc7a7('0x50')](function(_0x5c8111){return db[_0xc7a7('0x42')][_0xc7a7('0x26')]({'where':{'CustomReportId':_0xce113a[_0xc7a7('0x4b')]['id']},'transaction':_0x5c8111})['then'](function(_0x14e4fb){var _0x3e3ef8=_['map'](_0xce113a[_0xc7a7('0x49')],function(_0x172f6e){delete _0x172f6e['id'];_0x172f6e['CustomReportId']=_0xce113a[_0xc7a7('0x4b')]['id'];return _0x172f6e;});return db[_0xc7a7('0x42')][_0xc7a7('0x4a')](_0x3e3ef8,{'transaction':_0x5c8111});});})[_0xc7a7('0x25')](function(){return db['AnalyticFieldReport'][_0xc7a7('0x43')]({'where':{'CustomReportId':_0xce113a['params']['id']}});});}})[_0xc7a7('0x25')](respondWithResult(_0x2190d1,null))[_0xc7a7('0x45')](handleError(_0x2190d1,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index d4f01fc..3fbd456 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 _0x1eb6=['AnalyticFieldReport','analytics_report_fields','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define'];(function(_0xabbd2f,_0x44d05a){var _0x34a040=function(_0x3736d9){while(--_0x3736d9){_0xabbd2f['push'](_0xabbd2f['shift']());}};_0x34a040(++_0x44d05a);}(_0x1eb6,0x1d6));var _0x61eb=function(_0x166faf,_0x544897){_0x166faf=_0x166faf-0x0;var _0xaf11fe=_0x1eb6[_0x166faf];return _0xaf11fe;};'use strict';var _=require('lodash');var util=require(_0x61eb('0x0'));var logger=require(_0x61eb('0x1'))(_0x61eb('0x2'));var moment=require(_0x61eb('0x3'));var BPromise=require(_0x61eb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x61eb('0x5'));var rimraf=require(_0x61eb('0x6'));var config=require(_0x61eb('0x7'));var attributes=require(_0x61eb('0x8'));module[_0x61eb('0x9')]=function(_0x82e418,_0x3fb52d){return _0x82e418[_0x61eb('0xa')](_0x61eb('0xb'),attributes,{'tableName':_0x61eb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfae0=['exports','define','AnalyticFieldReport','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xfae0,0xb7));var _0x0fae=function(_0x5b142f,_0x10815a){_0x5b142f=_0x5b142f-0x0;var _0x327bbd=_0xfae0[_0x5b142f];return _0x327bbd;};'use strict';var _=require(_0x0fae('0x0'));var util=require(_0x0fae('0x1'));var logger=require(_0x0fae('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0fae('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0fae('0x4'));var rimraf=require(_0x0fae('0x5'));var config=require(_0x0fae('0x6'));var attributes=require('./analyticFieldReport.attributes');module[_0x0fae('0x7')]=function(_0x489cc8,_0x3a3b6f){return _0x489cc8[_0x0fae('0x8')](_0x0fae('0x9'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 9777c96..62c751d 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 _0x0ddf=['util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0ddf,0x187));var _0xf0dd=function(_0x1aae91,_0x595db2){_0x1aae91=_0x1aae91-0x0;var _0x42cd4f=_0x0ddf[_0x1aae91];return _0x42cd4f;};'use strict';var _=require('lodash');var util=require(_0xf0dd('0x0'));var moment=require(_0xf0dd('0x1'));var BPromise=require(_0xf0dd('0x2'));var rs=require(_0xf0dd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf0dd('0x4'))(_0xf0dd('0x5'));var config=require(_0xf0dd('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x34bace,_0x16d5a9,_0x528b65){return new BPromise(function(_0x219185,_0x2f0c71){return client[_0xf0dd('0x7')](_0x34bace,_0x528b65)[_0xf0dd('0x8')](function(_0x5221e7){logger[_0xf0dd('0x9')](_0xf0dd('0xa'),_0x16d5a9,_0xf0dd('0xb'));logger['debug'](_0xf0dd('0xc'),_0x16d5a9,'request\x20sent',JSON[_0xf0dd('0xd')](_0x5221e7));if(_0x5221e7[_0xf0dd('0xe')]){if(_0x5221e7[_0xf0dd('0xe')]['code']===0x1f4){logger[_0xf0dd('0xe')](_0xf0dd('0xa'),_0x16d5a9,_0x5221e7[_0xf0dd('0xe')][_0xf0dd('0xf')]);return _0x2f0c71(_0x5221e7['error'][_0xf0dd('0xf')]);}logger[_0xf0dd('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x16d5a9,_0x5221e7[_0xf0dd('0xe')][_0xf0dd('0xf')]);return _0x219185(_0x5221e7[_0xf0dd('0xe')][_0xf0dd('0xf')]);}else{logger[_0xf0dd('0x9')](_0xf0dd('0xa'),_0x16d5a9,_0xf0dd('0xb'));_0x219185(_0x5221e7[_0xf0dd('0x10')][_0xf0dd('0xf')]);}})['catch'](function(_0x53f140){logger[_0xf0dd('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x16d5a9,_0x53f140);_0x2f0c71(_0x53f140);});});}
\ No newline at end of file
+var _0xe7d1=['code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','error'];(function(_0x1fb996,_0x4e0b5f){var _0x3f2a72=function(_0x9449b1){while(--_0x9449b1){_0x1fb996['push'](_0x1fb996['shift']());}};_0x3f2a72(++_0x4e0b5f);}(_0xe7d1,0x1d3));var _0x1e7d=function(_0x5c0732,_0x2caed7){_0x5c0732=_0x5c0732-0x0;var _0x18af65=_0xe7d1[_0x5c0732];return _0x18af65;};'use strict';var _=require(_0x1e7d('0x0'));var util=require(_0x1e7d('0x1'));var moment=require(_0x1e7d('0x2'));var BPromise=require('bluebird');var rs=require(_0x1e7d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1e7d('0x4'));var logger=require(_0x1e7d('0x5'))(_0x1e7d('0x6'));var config=require('../../config/environment');var jayson=require(_0x1e7d('0x7'));var client=jayson[_0x1e7d('0x8')][_0x1e7d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14a209,_0x5b9a62,_0x3dbb65){return new BPromise(function(_0x4ac0da,_0x4be0ab){return client[_0x1e7d('0xa')](_0x14a209,_0x3dbb65)[_0x1e7d('0xb')](function(_0x405c49){logger[_0x1e7d('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5b9a62,_0x1e7d('0xd'));logger[_0x1e7d('0xe')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x5b9a62,_0x1e7d('0xd'),JSON['stringify'](_0x405c49));if(_0x405c49[_0x1e7d('0xf')]){if(_0x405c49[_0x1e7d('0xf')][_0x1e7d('0x10')]===0x1f4){logger[_0x1e7d('0xf')](_0x1e7d('0x11'),_0x5b9a62,_0x405c49[_0x1e7d('0xf')]['message']);return _0x4be0ab(_0x405c49[_0x1e7d('0xf')]['message']);}logger[_0x1e7d('0xf')](_0x1e7d('0x11'),_0x5b9a62,_0x405c49[_0x1e7d('0xf')][_0x1e7d('0x12')]);return _0x4ac0da(_0x405c49[_0x1e7d('0xf')]['message']);}else{logger['info'](_0x1e7d('0x11'),_0x5b9a62,_0x1e7d('0xd'));_0x4ac0da(_0x405c49[_0x1e7d('0x13')][_0x1e7d('0x12')]);}})[_0x1e7d('0x14')](function(_0x46343e){logger[_0x1e7d('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5b9a62,_0x46343e);_0x4be0ab(_0x46343e);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 19d908a..491b6e2 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(_0x3beb86,_0x10537c){var _0x385cb9=function(_0x556817){while(--_0x556817){_0x3beb86['push'](_0x3beb86['shift']());}};_0x385cb9(++_0x10537c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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(_0x12f3c3,_0x281abf){var _0x2e48d6=function(_0x4bfe00){while(--_0x4bfe00){_0x12f3c3['push'](_0x12f3c3['shift']());}};_0x2e48d6(++_0x281abf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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 052a4cf..5773eb1 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 _0xb9be=['name','TEXT','sequelize','exports','STRING'];(function(_0x2d8004,_0x20aac8){var _0x2f661c=function(_0x49fe78){while(--_0x49fe78){_0x2d8004['push'](_0x2d8004['shift']());}};_0x2f661c(++_0x20aac8);}(_0xb9be,0xc5));var _0xeb9b=function(_0x111e94,_0x31c837){_0x111e94=_0x111e94-0x0;var _0x3de107=_0xb9be[_0x111e94];return _0x3de107;};'use strict';var Sequelize=require(_0xeb9b('0x0'));module[_0xeb9b('0x1')]={'name':{'type':Sequelize[_0xeb9b('0x2')],'allowNull':![],'unique':_0xeb9b('0x3')},'table':{'type':Sequelize[_0xeb9b('0x2')]},'metric':{'type':Sequelize[_0xeb9b('0x4')]},'description':{'type':Sequelize[_0xeb9b('0x2')]}};
\ No newline at end of file
+var _0x4ffe=['STRING','TEXT','sequelize','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x4ffe,0x172));var _0xe4ff=function(_0x5b4615,_0x3fad71){_0x5b4615=_0x5b4615-0x0;var _0x44eb78=_0x4ffe[_0x5b4615];return _0x44eb78;};'use strict';var Sequelize=require(_0xe4ff('0x0'));module[_0xe4ff('0x1')]={'name':{'type':Sequelize[_0xe4ff('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xe4ff('0x2')]},'metric':{'type':Sequelize[_0xe4ff('0x3')]},'description':{'type':Sequelize[_0xe4ff('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 8bcb63b..5bad51e 100644
--- a/server/api/analyticMetric/analyticMetric.controller.js
+++ b/server/api/analyticMetric/analyticMetric.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x008c=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','destroy','get','stack','name','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x45cbd6,_0x3509bb){var _0x4e6dde=function(_0x599dab){while(--_0x599dab){_0x45cbd6['push'](_0x45cbd6['shift']());}};_0x4e6dde(++_0x3509bb);}(_0x008c,0x188));var _0xc008=function(_0x5a905e,_0x31aa4a){_0x5a905e=_0x5a905e-0x0;var _0x4124d6=_0x008c[_0x5a905e];return _0x4124d6;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){var _0x2e3cfb=_0x58a6ea[_0xc008('0x23')]({'plain':!![]});var _0x5410f5='Metrics';return db['UserProfileResource'][_0xc008('0x22')]({'where':{'type':_0x5410f5,'resourceId':_0x2e3cfb['id']}})[_0xc008('0x21')](function(){return _0x58a6ea;});})[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2aca,_0x4fce9c){return function(_0x4adbab){if(!_0x4adbab){_0x5e2aca['sendStatus'](0x194);}return _0x4adbab;};}function handleError(_0x3865c0,_0x29ba43){_0x29ba43=_0x29ba43||0x1f4;return function(_0x25eae4){logger['error'](_0x25eae4[_0xc008('0x24')]);if(_0x25eae4[_0xc008('0x25')]){delete _0x25eae4[_0xc008('0x25')];}_0x3865c0[_0xc008('0x19')](_0x29ba43)['send'](_0x25eae4);};}exports[_0xc008('0x26')]=function(_0x2e0b4e,_0x53ed35){var _0x58db82={},_0x539766={},_0x1032b2={'count':0x0,'rows':[]};var _0x267abd=_[_0xc008('0x27')](db[_0xc008('0x28')][_0xc008('0x29')],function(_0xceebc3){return{'name':_0xceebc3[_0xc008('0x2a')],'type':_0xceebc3[_0xc008('0x2b')][_0xc008('0x2c')]};});_0x539766[_0xc008('0x2d')]=_[_0xc008('0x27')](_0x267abd,_0xc008('0x25'));_0x539766['query']=_[_0xc008('0x2e')](_0x2e0b4e[_0xc008('0x2f')]);_0x539766['filters']=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],_0x539766[_0xc008('0x2f')]);_0x58db82[_0xc008('0x31')]=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x32')]));_0x58db82['attributes']=_0x58db82[_0xc008('0x31')][_0xc008('0x33')]?_0x58db82[_0xc008('0x31')]:_0x539766[_0xc008('0x2d')];if(!_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x34')](_0xc008('0x35'))){_0x58db82['limit']=qs[_0xc008('0x1d')](_0x2e0b4e[_0xc008('0x2f')]['limit']);_0x58db82[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x2e0b4e['query'][_0xc008('0x1b')]);}_0x58db82[_0xc008('0x36')]=qs[_0xc008('0x37')](_0x2e0b4e['query']['sort']);_0x58db82['where']=qs[_0xc008('0x38')](_['pick'](_0x2e0b4e[_0xc008('0x2f')],_0x539766[_0xc008('0x38')]),_0x267abd);if(_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x39')]){_0x58db82[_0xc008('0x3a')]=_[_0xc008('0x3b')](_0x58db82[_0xc008('0x3a')],{'$or':_[_0xc008('0x27')](_0x267abd,function(_0xffd2b3){if(_0xffd2b3[_0xc008('0x2b')]!==_0xc008('0x3c')){var _0xdfca2e={};_0xdfca2e[_0xffd2b3[_0xc008('0x25')]]={'$like':'%'+_0x2e0b4e[_0xc008('0x2f')]['filter']+'%'};return _0xdfca2e;}})});}_0x58db82=_[_0xc008('0x3b')]({},_0x58db82,_0x2e0b4e[_0xc008('0x3d')]);var _0x30b7df={'where':_0x58db82[_0xc008('0x3a')]};return db['AnalyticMetric'][_0xc008('0x1e')](_0x30b7df)[_0xc008('0x21')](function(_0xc8cb91){_0x1032b2[_0xc008('0x1e')]=_0xc8cb91;if(_0x2e0b4e[_0xc008('0x2f')]['includeAll']){_0x58db82[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x28')][_0xc008('0x3f')](_0x58db82);})[_0xc008('0x21')](function(_0x7279e8){_0x1032b2['rows']=_0x7279e8;return _0x1032b2;})[_0xc008('0x21')](respondWithFilteredResult(_0x53ed35,_0x58db82))[_0xc008('0x40')](handleError(_0x53ed35,null));};exports[_0xc008('0x41')]=function(_0x408192,_0x4b80f3){var _0x26cd05={'raw':!![],'where':{'id':_0x408192[_0xc008('0x42')]['id']}},_0xe37446={};_0xe37446['model']=_[_0xc008('0x2e')](db['AnalyticMetric'][_0xc008('0x29')]);_0xe37446['query']=_[_0xc008('0x2e')](_0x408192[_0xc008('0x2f')]);_0xe37446['filters']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],_0xe37446[_0xc008('0x2f')]);_0x26cd05['attributes']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x408192[_0xc008('0x2f')][_0xc008('0x32')]));_0x26cd05[_0xc008('0x31')]=_0x26cd05['attributes']['length']?_0x26cd05['attributes']:_0xe37446[_0xc008('0x2d')];if(_0x408192[_0xc008('0x2f')][_0xc008('0x43')]){_0x26cd05[_0xc008('0x3e')]=[{'all':!![]}];}_0x26cd05=_[_0xc008('0x3b')]({},_0x26cd05,_0x408192[_0xc008('0x3d')]);return db[_0xc008('0x28')][_0xc008('0x44')](_0x26cd05)['then'](handleEntityNotFound(_0x4b80f3,null))['then'](respondWithResult(_0x4b80f3,null))['catch'](handleError(_0x4b80f3,null));};exports[_0xc008('0x45')]=function(_0x2651cf,_0x158eae){return db['AnalyticMetric'][_0xc008('0x45')](_0x2651cf[_0xc008('0x46')],{})[_0xc008('0x21')](function(_0x1c2c50){var _0x4981b4=_0x2651cf[_0xc008('0x47')][_0xc008('0x23')]({'plain':!![]});if(!_0x4981b4)throw new Error(_0xc008('0x48'));if(_0x4981b4[_0xc008('0x49')]===_0xc008('0x47')){var _0x52c444=_0x1c2c50['get']({'plain':!![]});var _0x223056='Metrics';return db[_0xc008('0x4a')][_0xc008('0x44')]({'where':{'name':_0x223056,'userProfileId':_0x4981b4[_0xc008('0x4b')]},'raw':!![]})['then'](function(_0x144ab2){if(_0x144ab2&&_0x144ab2[_0xc008('0x4c')]===0x0){return db[_0xc008('0x4d')][_0xc008('0x45')]({'name':_0x52c444[_0xc008('0x25')],'resourceId':_0x52c444['id'],'type':_0x144ab2['name'],'sectionId':_0x144ab2['id']},{})[_0xc008('0x21')](function(){return _0x1c2c50;});}else{return _0x1c2c50;}})[_0xc008('0x40')](function(_0x4b4c6d){logger[_0xc008('0x4e')](_0xc008('0x4f'),_0x4b4c6d);throw _0x4b4c6d;});}return _0x1c2c50;})['then'](respondWithResult(_0x158eae,0xc9))['catch'](handleError(_0x158eae,null));};exports[_0xc008('0x20')]=function(_0xd47b74,_0x20947b){if(_0xd47b74[_0xc008('0x46')]['id']){delete _0xd47b74[_0xc008('0x46')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0xd47b74[_0xc008('0x42')]['id']}})['then'](handleEntityNotFound(_0x20947b,null))[_0xc008('0x21')](saveUpdates(_0xd47b74[_0xc008('0x46')],null))[_0xc008('0x21')](respondWithResult(_0x20947b,null))[_0xc008('0x40')](handleError(_0x20947b,null));};exports[_0xc008('0x22')]=function(_0x27a167,_0x49d8b0){return db[_0xc008('0x28')][_0xc008('0x44')]({'where':{'id':_0x27a167[_0xc008('0x42')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x49d8b0,null))[_0xc008('0x21')](removeEntity(_0x49d8b0,null))['catch'](handleError(_0x49d8b0,null));};
\ No newline at end of file
+var _0x9a19=['AnalyticMetric','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','user','UserProfileSection','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','Metrics','stack','name','send','index','map'];(function(_0x5cd1a0,_0x1b6d75){var _0x3a2a15=function(_0x461870){while(--_0x461870){_0x5cd1a0['push'](_0x5cd1a0['shift']());}};_0x3a2a15(++_0x1b6d75);}(_0x9a19,0x114));var _0x99a1=function(_0x193e28,_0x3dac1d){_0x193e28=_0x193e28-0x0;var _0x20ef59=_0x9a19[_0x193e28];return _0x20ef59;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){var _0x179597=_0x5b5dfa[_0x99a1('0x25')]({'plain':!![]});var _0x3c813=_0x99a1('0x26');return db['UserProfileResource'][_0x99a1('0x24')]({'where':{'type':_0x3c813,'resourceId':_0x179597['id']}})['then'](function(){return _0x5b5dfa;});})['then'](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0xa6799b,_0x15a0b6){return function(_0x25d560){if(!_0x25d560){_0xa6799b[_0x99a1('0x19')](0x194);}return _0x25d560;};}function handleError(_0x183037,_0x549645){_0x549645=_0x549645||0x1f4;return function(_0xf41b0d){logger['error'](_0xf41b0d[_0x99a1('0x27')]);if(_0xf41b0d[_0x99a1('0x28')]){delete _0xf41b0d[_0x99a1('0x28')];}_0x183037['status'](_0x549645)[_0x99a1('0x29')](_0xf41b0d);};}exports[_0x99a1('0x2a')]=function(_0x5718b9,_0x37514e){var _0x1434a0={},_0x36aa34={},_0x303d1e={'count':0x0,'rows':[]};var _0x2a5b8c=_[_0x99a1('0x2b')](db[_0x99a1('0x2c')][_0x99a1('0x2d')],function(_0x52da8d){return{'name':_0x52da8d['fieldName'],'type':_0x52da8d[_0x99a1('0x2e')]['key']};});_0x36aa34[_0x99a1('0x2f')]=_[_0x99a1('0x2b')](_0x2a5b8c,'name');_0x36aa34[_0x99a1('0x30')]=_[_0x99a1('0x31')](_0x5718b9[_0x99a1('0x30')]);_0x36aa34[_0x99a1('0x32')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],_0x36aa34[_0x99a1('0x30')]);_0x1434a0[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1434a0[_0x99a1('0x34')]=_0x1434a0['attributes']['length']?_0x1434a0[_0x99a1('0x34')]:_0x36aa34[_0x99a1('0x2f')];if(!_0x5718b9[_0x99a1('0x30')][_0x99a1('0x36')](_0x99a1('0x37'))){_0x1434a0[_0x99a1('0x1e')]=qs[_0x99a1('0x1e')](_0x5718b9['query'][_0x99a1('0x1e')]);_0x1434a0[_0x99a1('0x1c')]=qs['offset'](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x1c')]);}_0x1434a0[_0x99a1('0x38')]=qs[_0x99a1('0x39')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x39')]);_0x1434a0[_0x99a1('0x3a')]=qs[_0x99a1('0x32')](_[_0x99a1('0x3b')](_0x5718b9[_0x99a1('0x30')],_0x36aa34[_0x99a1('0x32')]),_0x2a5b8c);if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]){_0x1434a0['where']=_['merge'](_0x1434a0['where'],{'$or':_[_0x99a1('0x2b')](_0x2a5b8c,function(_0x169df7){if(_0x169df7[_0x99a1('0x2e')]!==_0x99a1('0x3d')){var _0x40613a={};_0x40613a[_0x169df7['name']]={'$like':'%'+_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]+'%'};return _0x40613a;}})});}_0x1434a0=_[_0x99a1('0x3e')]({},_0x1434a0,_0x5718b9['options']);var _0x49be37={'where':_0x1434a0[_0x99a1('0x3a')]};return db[_0x99a1('0x2c')][_0x99a1('0x1f')](_0x49be37)['then'](function(_0x6c4cb){_0x303d1e[_0x99a1('0x1f')]=_0x6c4cb;if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3f')]){_0x1434a0[_0x99a1('0x40')]=[{'all':!![]}];}return db[_0x99a1('0x2c')][_0x99a1('0x41')](_0x1434a0);})[_0x99a1('0x23')](function(_0x1c4ce4){_0x303d1e[_0x99a1('0x42')]=_0x1c4ce4;return _0x303d1e;})['then'](respondWithFilteredResult(_0x37514e,_0x1434a0))[_0x99a1('0x43')](handleError(_0x37514e,null));};exports[_0x99a1('0x44')]=function(_0x3d5373,_0x50d38b){var _0x1beed2={'raw':!![],'where':{'id':_0x3d5373[_0x99a1('0x45')]['id']}},_0x51536d={};_0x51536d[_0x99a1('0x2f')]=_[_0x99a1('0x31')](db[_0x99a1('0x2c')][_0x99a1('0x2d')]);_0x51536d[_0x99a1('0x30')]=_['keys'](_0x3d5373[_0x99a1('0x30')]);_0x51536d['filters']=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],_0x51536d[_0x99a1('0x30')]);_0x1beed2[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x3d5373[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1beed2[_0x99a1('0x34')]=_0x1beed2[_0x99a1('0x34')]['length']?_0x1beed2[_0x99a1('0x34')]:_0x51536d[_0x99a1('0x2f')];if(_0x3d5373['query'][_0x99a1('0x3f')]){_0x1beed2[_0x99a1('0x40')]=[{'all':!![]}];}_0x1beed2=_[_0x99a1('0x3e')]({},_0x1beed2,_0x3d5373[_0x99a1('0x46')]);return db[_0x99a1('0x2c')][_0x99a1('0x47')](_0x1beed2)[_0x99a1('0x23')](handleEntityNotFound(_0x50d38b,null))['then'](respondWithResult(_0x50d38b,null))[_0x99a1('0x43')](handleError(_0x50d38b,null));};exports['create']=function(_0x1d4d3f,_0x269798){return db['AnalyticMetric']['create'](_0x1d4d3f[_0x99a1('0x48')],{})[_0x99a1('0x23')](function(_0x462c15){var _0x4519fb=_0x1d4d3f[_0x99a1('0x49')]['get']({'plain':!![]});if(!_0x4519fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4519fb['role']===_0x99a1('0x49')){var _0x4ae90e=_0x462c15[_0x99a1('0x25')]({'plain':!![]});var _0x30fdfb=_0x99a1('0x26');return db[_0x99a1('0x4a')][_0x99a1('0x47')]({'where':{'name':_0x30fdfb,'userProfileId':_0x4519fb['userProfileId']},'raw':!![]})[_0x99a1('0x23')](function(_0x22bfd8){if(_0x22bfd8&&_0x22bfd8[_0x99a1('0x4b')]===0x0){return db['UserProfileResource'][_0x99a1('0x4c')]({'name':_0x4ae90e['name'],'resourceId':_0x4ae90e['id'],'type':_0x22bfd8['name'],'sectionId':_0x22bfd8['id']},{})[_0x99a1('0x23')](function(){return _0x462c15;});}else{return _0x462c15;}})[_0x99a1('0x43')](function(_0x1dd17b){logger[_0x99a1('0x4d')](_0x99a1('0x4e'),_0x1dd17b);throw _0x1dd17b;});}return _0x462c15;})[_0x99a1('0x23')](respondWithResult(_0x269798,0xc9))[_0x99a1('0x43')](handleError(_0x269798,null));};exports[_0x99a1('0x4f')]=function(_0x16641e,_0x53e9eb){if(_0x16641e[_0x99a1('0x48')]['id']){delete _0x16641e['body']['id'];}return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x16641e['params']['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x53e9eb,null))[_0x99a1('0x23')](saveUpdates(_0x16641e[_0x99a1('0x48')],null))[_0x99a1('0x23')](respondWithResult(_0x53e9eb,null))[_0x99a1('0x43')](handleError(_0x53e9eb,null));};exports[_0x99a1('0x24')]=function(_0x157c49,_0x1a5658){return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x157c49[_0x99a1('0x45')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x1a5658,null))['then'](removeEntity(_0x1a5658,null))['catch'](handleError(_0x1a5658,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 1f3b444..997a99e 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 _0x647c=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticMetric','analytics_metrics','lodash'];(function(_0x48583f,_0x3557f7){var _0x1af0f5=function(_0x19a839){while(--_0x19a839){_0x48583f['push'](_0x48583f['shift']());}};_0x1af0f5(++_0x3557f7);}(_0x647c,0x1d3));var _0xc647=function(_0x3030a9,_0x3e7be2){_0x3030a9=_0x3030a9-0x0;var _0x5e6b29=_0x647c[_0x3030a9];return _0x5e6b29;};'use strict';var _=require(_0xc647('0x0'));var util=require('util');var logger=require(_0xc647('0x1'))(_0xc647('0x2'));var moment=require('moment');var BPromise=require(_0xc647('0x3'));var rp=require(_0xc647('0x4'));var fs=require('fs');var path=require(_0xc647('0x5'));var rimraf=require(_0xc647('0x6'));var config=require(_0xc647('0x7'));var attributes=require('./analyticMetric.attributes');module[_0xc647('0x8')]=function(_0x202fea,_0x19bfae){return _0x202fea[_0xc647('0x9')](_0xc647('0xa'),attributes,{'tableName':_0xc647('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf78f=['moment','bluebird','request-promise','define','AnalyticMetric','analytics_metrics','util','../../config/logger','api'];(function(_0x1d7196,_0x26d92f){var _0x2efcf6=function(_0x2f774b){while(--_0x2f774b){_0x1d7196['push'](_0x1d7196['shift']());}};_0x2efcf6(++_0x26d92f);}(_0xf78f,0x72));var _0xff78=function(_0x347379,_0x37de29){_0x347379=_0x347379-0x0;var _0x1e6dbf=_0xf78f[_0x347379];return _0x1e6dbf;};'use strict';var _=require('lodash');var util=require(_0xff78('0x0'));var logger=require(_0xff78('0x1'))(_0xff78('0x2'));var moment=require(_0xff78('0x3'));var BPromise=require(_0xff78('0x4'));var rp=require(_0xff78('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x35f208,_0x487ec1){return _0x35f208[_0xff78('0x6')](_0xff78('0x7'),attributes,{'tableName':_0xff78('0x8'),'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 cded21b..3943e93 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 _0x7c6c=['info','AnalyticMetric,\x20%s,\x20%s','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','http','request','then'];(function(_0x11caf7,_0x2ffd69){var _0x1460a2=function(_0xf91fce){while(--_0xf91fce){_0x11caf7['push'](_0x11caf7['shift']());}};_0x1460a2(++_0x2ffd69);}(_0x7c6c,0x1a9));var _0xc7c6=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x7c6c[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0xc7c6('0x0'));var util=require(_0xc7c6('0x1'));var moment=require(_0xc7c6('0x2'));var BPromise=require(_0xc7c6('0x3'));var rs=require(_0xc7c6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc7c6('0x5'))['db'];var utils=require(_0xc7c6('0x6'));var logger=require('../../config/logger')(_0xc7c6('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc7c6('0x8')][_0xc7c6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ef496,_0x331259,_0x17846c){return new BPromise(function(_0xc0d511,_0x73f0a8){return client[_0xc7c6('0xa')](_0x5ef496,_0x17846c)[_0xc7c6('0xb')](function(_0x4322ed){logger[_0xc7c6('0xc')](_0xc7c6('0xd'),_0x331259,'request\x20sent');logger['debug'](_0xc7c6('0xe'),_0x331259,'request\x20sent',JSON['stringify'](_0x4322ed));if(_0x4322ed['error']){if(_0x4322ed[_0xc7c6('0xf')]['code']===0x1f4){logger[_0xc7c6('0xf')](_0xc7c6('0xd'),_0x331259,_0x4322ed[_0xc7c6('0xf')][_0xc7c6('0x10')]);return _0x73f0a8(_0x4322ed['error'][_0xc7c6('0x10')]);}logger[_0xc7c6('0xf')](_0xc7c6('0xd'),_0x331259,_0x4322ed[_0xc7c6('0xf')]['message']);return _0xc0d511(_0x4322ed[_0xc7c6('0xf')]['message']);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x331259,_0xc7c6('0x11'));_0xc0d511(_0x4322ed[_0xc7c6('0x12')]['message']);}})['catch'](function(_0x54de7d){logger[_0xc7c6('0xf')](_0xc7c6('0xd'),_0x331259,_0x54de7d);_0x73f0a8(_0x54de7d);});});}
\ No newline at end of file
+var _0x86b1=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util'];(function(_0x2e40f8,_0x116cfc){var _0x291cc6=function(_0x1b3c8f){while(--_0x1b3c8f){_0x2e40f8['push'](_0x2e40f8['shift']());}};_0x291cc6(++_0x116cfc);}(_0x86b1,0x106));var _0x186b=function(_0x3452d6,_0x242484){_0x3452d6=_0x3452d6-0x0;var _0x1e8c56=_0x86b1[_0x3452d6];return _0x1e8c56;};'use strict';var _=require(_0x186b('0x0'));var util=require(_0x186b('0x1'));var moment=require(_0x186b('0x2'));var BPromise=require(_0x186b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x186b('0x4'));var db=require(_0x186b('0x5'))['db'];var utils=require(_0x186b('0x6'));var logger=require(_0x186b('0x7'))(_0x186b('0x8'));var config=require(_0x186b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x186b('0xa')][_0x186b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2fc806,_0x543616,_0xe5ef3e){return new BPromise(function(_0x528f85,_0x483c66){return client[_0x186b('0xc')](_0x2fc806,_0xe5ef3e)[_0x186b('0xd')](function(_0x551610){logger[_0x186b('0xe')](_0x186b('0xf'),_0x543616,_0x186b('0x10'));logger[_0x186b('0x11')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x543616,'request\x20sent',JSON[_0x186b('0x12')](_0x551610));if(_0x551610[_0x186b('0x13')]){if(_0x551610['error'][_0x186b('0x14')]===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x543616,_0x551610['error'][_0x186b('0x15')]);return _0x483c66(_0x551610[_0x186b('0x13')]['message']);}logger['error'](_0x186b('0xf'),_0x543616,_0x551610[_0x186b('0x13')][_0x186b('0x15')]);return _0x528f85(_0x551610[_0x186b('0x13')][_0x186b('0x15')]);}else{logger['info'](_0x186b('0xf'),_0x543616,_0x186b('0x10'));_0x528f85(_0x551610[_0x186b('0x16')][_0x186b('0x15')]);}})[_0x186b('0x17')](function(_0x9804c1){logger[_0x186b('0x13')](_0x186b('0xf'),_0x543616,_0x9804c1);_0x483c66(_0x9804c1);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 0303b84..6e74b16 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 _0x0619=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x58a13f,_0x2d3de7){var _0x18c3c4=function(_0x524aff){while(--_0x524aff){_0x58a13f['push'](_0x58a13f['shift']());}};_0x18c3c4(++_0x2d3de7);}(_0x0619,0x90));var _0x9061=function(_0x22590a,_0x1bf69a){_0x22590a=_0x22590a-0x0;var _0x5d5f70=_0x0619[_0x22590a];return _0x5d5f70;};'use strict';var multer=require(_0x9061('0x0'));var util=require(_0x9061('0x1'));var path=require(_0x9061('0x2'));var timeout=require(_0x9061('0x3'));var express=require('express');var router=express[_0x9061('0x4')]();var fs_extra=require(_0x9061('0x5'));var auth=require(_0x9061('0x6'));var interaction=require(_0x9061('0x7'));var config=require(_0x9061('0x8'));var controller=require(_0x9061('0x9'));router[_0x9061('0xa')]('/',auth[_0x9061('0xb')](),controller[_0x9061('0xc')]);router[_0x9061('0xa')](_0x9061('0xd'),auth['isAuthenticated'](),controller[_0x9061('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9061('0xf')]);router[_0x9061('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x9061('0x11')]);router[_0x9061('0x12')](_0x9061('0xd'),auth[_0x9061('0xb')](),controller[_0x9061('0x13')]);module[_0x9061('0x14')]=router;
\ No newline at end of file
+var _0x8784=['index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./analyticMetric.controller','get','isAuthenticated'];(function(_0x4c0585,_0x24041a){var _0x3de0aa=function(_0xcbc4df){while(--_0xcbc4df){_0x4c0585['push'](_0x4c0585['shift']());}};_0x3de0aa(++_0x24041a);}(_0x8784,0x172));var _0x4878=function(_0x33d4a2,_0x2baaf4){_0x33d4a2=_0x33d4a2-0x0;var _0x2c793f=_0x8784[_0x33d4a2];return _0x2c793f;};'use strict';var multer=require(_0x4878('0x0'));var util=require(_0x4878('0x1'));var path=require('path');var timeout=require(_0x4878('0x2'));var express=require(_0x4878('0x3'));var router=express[_0x4878('0x4')]();var fs_extra=require(_0x4878('0x5'));var auth=require(_0x4878('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4878('0x7'));router[_0x4878('0x8')]('/',auth[_0x4878('0x9')](),controller[_0x4878('0xa')]);router[_0x4878('0x8')](_0x4878('0xb'),auth[_0x4878('0x9')](),controller[_0x4878('0xc')]);router[_0x4878('0xd')]('/',auth['isAuthenticated'](),controller[_0x4878('0xe')]);router[_0x4878('0xf')](_0x4878('0xb'),auth[_0x4878('0x9')](),controller[_0x4878('0x10')]);router[_0x4878('0x11')](_0x4878('0xb'),auth[_0x4878('0x9')](),controller[_0x4878('0x12')]);module[_0x4878('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index f0c132a..41137fe 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 _0xd9bf=['exports','TEXT','sequelize'];(function(_0xe30e17,_0xce02be){var _0x2342c9=function(_0x20b733){while(--_0x20b733){_0xe30e17['push'](_0xe30e17['shift']());}};_0x2342c9(++_0xce02be);}(_0xd9bf,0xda));var _0xfd9b=function(_0x1fb625,_0x310725){_0x1fb625=_0x1fb625-0x0;var _0x1d3e76=_0xd9bf[_0x1fb625];return _0x1d3e76;};'use strict';var Sequelize=require(_0xfd9b('0x0'));module[_0xfd9b('0x1')]={'tree':{'type':Sequelize[_0xfd9b('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x98c0=['exports','TEXT','sequelize'];(function(_0x27cc42,_0x468979){var _0x571fc4=function(_0x1b10b0){while(--_0x1b10b0){_0x27cc42['push'](_0x27cc42['shift']());}};_0x571fc4(++_0x468979);}(_0x98c0,0xc2));var _0x098c=function(_0x1085fb,_0x1e1d99){_0x1085fb=_0x1085fb-0x0;var _0x3dd44d=_0x98c0[_0x1085fb];return _0x3dd44d;};'use strict';var Sequelize=require(_0x098c('0x0'));module[_0x098c('0x1')]={'tree':{'type':Sequelize[_0x098c('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 cd2acd3..e267192 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 _0x0859=['filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','rawAttributes','options','find','catch','create','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','map','AnalyticTreeReport','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x151721,_0x20d5bc){var _0x2deaa7=function(_0x499812){while(--_0x499812){_0x151721['push'](_0x151721['shift']());}};_0x2deaa7(++_0x20d5bc);}(_0x0859,0x1cb));var _0x9085=function(_0x93ad58,_0x179403){_0x93ad58=_0x93ad58-0x0;var _0x10589b=_0x0859[_0x93ad58];return _0x10589b;};'use strict';var emlformat=require(_0x9085('0x0'));var rimraf=require(_0x9085('0x1'));var zipdir=require(_0x9085('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9085('0x3'));var BPromise=require(_0x9085('0x4'));var Mustache=require(_0x9085('0x5'));var util=require(_0x9085('0x6'));var path=require(_0x9085('0x7'));var sox=require(_0x9085('0x8'));var csv=require('to-csv');var ejs=require(_0x9085('0x9'));var fs=require('fs');var fs_extra=require(_0x9085('0xa'));var _=require('lodash');var squel=require(_0x9085('0xb'));var crypto=require(_0x9085('0xc'));var jsforce=require(_0x9085('0xd'));var deskjs=require(_0x9085('0xe'));var toCsv=require(_0x9085('0xf'));var querystring=require(_0x9085('0x10'));var Papa=require(_0x9085('0x11'));var Redis=require(_0x9085('0x12'));var authService=require(_0x9085('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x9085('0x14'));var hardwareService=require(_0x9085('0x15'));var logger=require('../../config/logger')(_0x9085('0x16'));var utils=require(_0x9085('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9085('0x18'));var db=require(_0x9085('0x19'))['db'];function respondWithStatusCode(_0x27ac73,_0x5ed26a){_0x5ed26a=_0x5ed26a||0xcc;return function(_0x4fdea5){if(_0x4fdea5){return _0x27ac73[_0x9085('0x1a')](_0x5ed26a);}return _0x27ac73[_0x9085('0x1b')](_0x5ed26a)['end']();};}function respondWithResult(_0x4d5a3e,_0x352c2d){_0x352c2d=_0x352c2d||0xc8;return function(_0x21973e){if(_0x21973e){return _0x4d5a3e['status'](_0x352c2d)['json'](_0x21973e);}};}function respondWithFilteredResult(_0x5950f7,_0x547661){return function(_0x3607d9){if(_0x3607d9){var _0x12aa7f=typeof _0x547661['offset']===_0x9085('0x1c')&&typeof _0x547661[_0x9085('0x1d')]===_0x9085('0x1c');var _0x4c0d72=_0x3607d9['count'];var _0x2a4036=_0x12aa7f?0x0:_0x547661[_0x9085('0x1e')];var _0x5eed84=_0x12aa7f?_0x3607d9[_0x9085('0x1f')]:_0x547661[_0x9085('0x1e')]+_0x547661[_0x9085('0x1d')];var _0x1ac0c0;if(_0x5eed84>=_0x4c0d72){_0x5eed84=_0x4c0d72;_0x1ac0c0=0xc8;}else{_0x1ac0c0=0xce;}_0x5950f7[_0x9085('0x1b')](_0x1ac0c0);return _0x5950f7[_0x9085('0x20')](_0x9085('0x21'),_0x2a4036+'-'+_0x5eed84+'/'+_0x4c0d72)[_0x9085('0x22')](_0x3607d9);}return null;};}function patchUpdates(_0xc225b2){return function(_0x2847f4){try{jsonpatch[_0x9085('0x23')](_0x2847f4,_0xc225b2,!![]);}catch(_0x3c038b){return BPromise[_0x9085('0x24')](_0x3c038b);}return _0x2847f4[_0x9085('0x25')]();};}function saveUpdates(_0x38696f,_0x45a10c){return function(_0x1e6aaa){if(_0x1e6aaa){return _0x1e6aaa[_0x9085('0x26')](_0x38696f)[_0x9085('0x27')](function(_0x2277d7){return _0x2277d7;});}return null;};}function removeEntity(_0x8740b1,_0x1ff9c6){return function(_0x267a2d){if(_0x267a2d){return _0x267a2d[_0x9085('0x28')]()[_0x9085('0x27')](function(){_0x8740b1['status'](0xcc)[_0x9085('0x29')]();});}};}function handleEntityNotFound(_0x594b93,_0x519fbc){return function(_0x415b35){if(!_0x415b35){_0x594b93['sendStatus'](0x194);}return _0x415b35;};}function handleError(_0x131a7f,_0x3c8d1d){_0x3c8d1d=_0x3c8d1d||0x1f4;return function(_0x148807){logger[_0x9085('0x2a')](_0x148807['stack']);if(_0x148807['name']){delete _0x148807['name'];}_0x131a7f[_0x9085('0x1b')](_0x3c8d1d)['send'](_0x148807);};}exports['index']=function(_0x4d4d46,_0x23946d){var _0x405c8={},_0x172b3e={},_0x4e64dc={'count':0x0,'rows':[]};var _0x4fb072=_[_0x9085('0x2b')](db[_0x9085('0x2c')]['rawAttributes'],function(_0x6a2ec8){return{'name':_0x6a2ec8['fieldName'],'type':_0x6a2ec8[_0x9085('0x2d')]['key']};});_0x172b3e[_0x9085('0x2e')]=_[_0x9085('0x2b')](_0x4fb072,'name');_0x172b3e['query']=_[_0x9085('0x2f')](_0x4d4d46[_0x9085('0x30')]);_0x172b3e[_0x9085('0x31')]=_[_0x9085('0x32')](_0x172b3e[_0x9085('0x2e')],_0x172b3e['query']);_0x405c8[_0x9085('0x33')]=_[_0x9085('0x32')](_0x172b3e[_0x9085('0x2e')],qs[_0x9085('0x34')](_0x4d4d46['query'][_0x9085('0x34')]));_0x405c8[_0x9085('0x33')]=_0x405c8['attributes'][_0x9085('0x35')]?_0x405c8[_0x9085('0x33')]:_0x172b3e[_0x9085('0x2e')];if(!_0x4d4d46[_0x9085('0x30')][_0x9085('0x36')](_0x9085('0x37'))){_0x405c8[_0x9085('0x1d')]=qs[_0x9085('0x1d')](_0x4d4d46[_0x9085('0x30')]['limit']);_0x405c8[_0x9085('0x1e')]=qs[_0x9085('0x1e')](_0x4d4d46['query']['offset']);}_0x405c8['order']=qs[_0x9085('0x38')](_0x4d4d46['query'][_0x9085('0x38')]);_0x405c8[_0x9085('0x39')]=qs['filters'](_[_0x9085('0x3a')](_0x4d4d46[_0x9085('0x30')],_0x172b3e[_0x9085('0x31')]),_0x4fb072);if(_0x4d4d46[_0x9085('0x30')][_0x9085('0x3b')]){_0x405c8[_0x9085('0x39')]=_[_0x9085('0x3c')](_0x405c8[_0x9085('0x39')],{'$or':_[_0x9085('0x2b')](_0x4fb072,function(_0x28fb5e){if(_0x28fb5e[_0x9085('0x2d')]!==_0x9085('0x3d')){var _0x1c0274={};_0x1c0274[_0x28fb5e['name']]={'$like':'%'+_0x4d4d46[_0x9085('0x30')][_0x9085('0x3b')]+'%'};return _0x1c0274;}})});}_0x405c8=_[_0x9085('0x3c')]({},_0x405c8,_0x4d4d46['options']);var _0x33c539={'where':_0x405c8['where']};return db[_0x9085('0x2c')]['count'](_0x33c539)[_0x9085('0x27')](function(_0x42c1ff){_0x4e64dc[_0x9085('0x1f')]=_0x42c1ff;if(_0x4d4d46[_0x9085('0x30')][_0x9085('0x3e')]){_0x405c8[_0x9085('0x3f')]=[{'all':!![]}];}return db[_0x9085('0x2c')][_0x9085('0x40')](_0x405c8);})['then'](function(_0x718a6e){_0x4e64dc[_0x9085('0x41')]=_0x718a6e;return _0x4e64dc;})[_0x9085('0x27')](respondWithFilteredResult(_0x23946d,_0x405c8))['catch'](handleError(_0x23946d,null));};exports[_0x9085('0x42')]=function(_0x13f481,_0x4f6619){var _0x2e8ad9={'raw':!![],'where':{'id':_0x13f481['params']['id']}},_0x38aa7e={};_0x38aa7e[_0x9085('0x2e')]=_[_0x9085('0x2f')](db[_0x9085('0x2c')][_0x9085('0x43')]);_0x38aa7e[_0x9085('0x30')]=_[_0x9085('0x2f')](_0x13f481['query']);_0x38aa7e[_0x9085('0x31')]=_[_0x9085('0x32')](_0x38aa7e[_0x9085('0x2e')],_0x38aa7e['query']);_0x2e8ad9[_0x9085('0x33')]=_[_0x9085('0x32')](_0x38aa7e['model'],qs['fields'](_0x13f481[_0x9085('0x30')][_0x9085('0x34')]));_0x2e8ad9[_0x9085('0x33')]=_0x2e8ad9['attributes']['length']?_0x2e8ad9['attributes']:_0x38aa7e[_0x9085('0x2e')];if(_0x13f481[_0x9085('0x30')][_0x9085('0x3e')]){_0x2e8ad9[_0x9085('0x3f')]=[{'all':!![]}];}_0x2e8ad9=_['merge']({},_0x2e8ad9,_0x13f481[_0x9085('0x44')]);return db[_0x9085('0x2c')][_0x9085('0x45')](_0x2e8ad9)[_0x9085('0x27')](handleEntityNotFound(_0x4f6619,null))[_0x9085('0x27')](respondWithResult(_0x4f6619,null))[_0x9085('0x46')](handleError(_0x4f6619,null));};exports[_0x9085('0x47')]=function(_0x542a07,_0x30db84){return db[_0x9085('0x2c')][_0x9085('0x47')](_0x542a07[_0x9085('0x48')],{})[_0x9085('0x27')](respondWithResult(_0x30db84,0xc9))[_0x9085('0x46')](handleError(_0x30db84,null));};exports['update']=function(_0x51d8e2,_0x304273){if(_0x51d8e2['body']['id']){delete _0x51d8e2[_0x9085('0x48')]['id'];}return db[_0x9085('0x2c')][_0x9085('0x45')]({'where':{'id':_0x51d8e2[_0x9085('0x49')]['id']}})['then'](handleEntityNotFound(_0x304273,null))[_0x9085('0x27')](saveUpdates(_0x51d8e2['body'],null))[_0x9085('0x27')](respondWithResult(_0x304273,null))[_0x9085('0x46')](handleError(_0x304273,null));};exports[_0x9085('0x28')]=function(_0x15c37b,_0x551db0){return db['AnalyticTreeReport'][_0x9085('0x45')]({'where':{'id':_0x15c37b[_0x9085('0x49')]['id']}})[_0x9085('0x27')](handleEntityNotFound(_0x551db0,null))[_0x9085('0x27')](removeEntity(_0x551db0,null))[_0x9085('0x46')](handleError(_0x551db0,null));};
\ No newline at end of file
+var _0x3700=['catch','params','includeAll','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','AnalyticTreeReport','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','options','rows'];(function(_0x53b90d,_0x4583bb){var _0xae5f0a=function(_0x21b03f){while(--_0x21b03f){_0x53b90d['push'](_0x53b90d['shift']());}};_0xae5f0a(++_0x4583bb);}(_0x3700,0x127));var _0x0370=function(_0x46428c,_0x20ab75){_0x46428c=_0x46428c-0x0;var _0x16a677=_0x3700[_0x46428c];return _0x16a677;};'use strict';var emlformat=require(_0x0370('0x0'));var rimraf=require(_0x0370('0x1'));var zipdir=require(_0x0370('0x2'));var jsonpatch=require(_0x0370('0x3'));var rp=require(_0x0370('0x4'));var moment=require(_0x0370('0x5'));var BPromise=require(_0x0370('0x6'));var Mustache=require(_0x0370('0x7'));var util=require(_0x0370('0x8'));var path=require('path');var sox=require(_0x0370('0x9'));var csv=require(_0x0370('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0370('0xb'));var _=require('lodash');var squel=require(_0x0370('0xc'));var crypto=require(_0x0370('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0370('0xe'));var toCsv=require(_0x0370('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0370('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0370('0x10'));var logger=require(_0x0370('0x11'))(_0x0370('0x12'));var utils=require('../../config/utils');var config=require(_0x0370('0x13'));var licenseUtil=require(_0x0370('0x14'));var db=require(_0x0370('0x15'))['db'];function respondWithStatusCode(_0x2422ea,_0x5d112c){_0x5d112c=_0x5d112c||0xcc;return function(_0x35d0a8){if(_0x35d0a8){return _0x2422ea[_0x0370('0x16')](_0x5d112c);}return _0x2422ea[_0x0370('0x17')](_0x5d112c)[_0x0370('0x18')]();};}function respondWithResult(_0x3b80c7,_0x592f00){_0x592f00=_0x592f00||0xc8;return function(_0x17f738){if(_0x17f738){return _0x3b80c7['status'](_0x592f00)['json'](_0x17f738);}};}function respondWithFilteredResult(_0xdf4517,_0x132663){return function(_0xcee483){if(_0xcee483){var _0x44e456=typeof _0x132663[_0x0370('0x19')]===_0x0370('0x1a')&&typeof _0x132663[_0x0370('0x1b')]===_0x0370('0x1a');var _0x52f5b8=_0xcee483[_0x0370('0x1c')];var _0x6483d7=_0x44e456?0x0:_0x132663[_0x0370('0x19')];var _0x3574ca=_0x44e456?_0xcee483[_0x0370('0x1c')]:_0x132663['offset']+_0x132663['limit'];var _0x50a768;if(_0x3574ca>=_0x52f5b8){_0x3574ca=_0x52f5b8;_0x50a768=0xc8;}else{_0x50a768=0xce;}_0xdf4517[_0x0370('0x17')](_0x50a768);return _0xdf4517[_0x0370('0x1d')](_0x0370('0x1e'),_0x6483d7+'-'+_0x3574ca+'/'+_0x52f5b8)['json'](_0xcee483);}return null;};}function patchUpdates(_0x21054a){return function(_0x1652bc){try{jsonpatch[_0x0370('0x1f')](_0x1652bc,_0x21054a,!![]);}catch(_0x301523){return BPromise[_0x0370('0x20')](_0x301523);}return _0x1652bc[_0x0370('0x21')]();};}function saveUpdates(_0x572229,_0x31c07d){return function(_0x28e89b){if(_0x28e89b){return _0x28e89b[_0x0370('0x22')](_0x572229)[_0x0370('0x23')](function(_0x4e6c6f){return _0x4e6c6f;});}return null;};}function removeEntity(_0x4625b2,_0x1ecec4){return function(_0x518df0){if(_0x518df0){return _0x518df0[_0x0370('0x24')]()[_0x0370('0x23')](function(){_0x4625b2['status'](0xcc)[_0x0370('0x18')]();});}};}function handleEntityNotFound(_0xa56c80,_0x36a469){return function(_0x2d3401){if(!_0x2d3401){_0xa56c80[_0x0370('0x16')](0x194);}return _0x2d3401;};}function handleError(_0x5a56b0,_0x105d4d){_0x105d4d=_0x105d4d||0x1f4;return function(_0x608222){logger['error'](_0x608222[_0x0370('0x25')]);if(_0x608222[_0x0370('0x26')]){delete _0x608222['name'];}_0x5a56b0['status'](_0x105d4d)[_0x0370('0x27')](_0x608222);};}exports[_0x0370('0x28')]=function(_0x1a0f85,_0x9e4fda){var _0x4c73b7={},_0xf07dda={},_0x5bf174={'count':0x0,'rows':[]};var _0x322252=_['map'](db[_0x0370('0x29')][_0x0370('0x2a')],function(_0x560907){return{'name':_0x560907[_0x0370('0x2b')],'type':_0x560907['type'][_0x0370('0x2c')]};});_0xf07dda[_0x0370('0x2d')]=_[_0x0370('0x2e')](_0x322252,_0x0370('0x26'));_0xf07dda['query']=_[_0x0370('0x2f')](_0x1a0f85[_0x0370('0x30')]);_0xf07dda[_0x0370('0x31')]=_[_0x0370('0x32')](_0xf07dda['model'],_0xf07dda[_0x0370('0x30')]);_0x4c73b7[_0x0370('0x33')]=_[_0x0370('0x32')](_0xf07dda[_0x0370('0x2d')],qs[_0x0370('0x34')](_0x1a0f85[_0x0370('0x30')][_0x0370('0x34')]));_0x4c73b7[_0x0370('0x33')]=_0x4c73b7[_0x0370('0x33')][_0x0370('0x35')]?_0x4c73b7['attributes']:_0xf07dda['model'];if(!_0x1a0f85['query'][_0x0370('0x36')](_0x0370('0x37'))){_0x4c73b7[_0x0370('0x1b')]=qs['limit'](_0x1a0f85[_0x0370('0x30')][_0x0370('0x1b')]);_0x4c73b7[_0x0370('0x19')]=qs[_0x0370('0x19')](_0x1a0f85[_0x0370('0x30')][_0x0370('0x19')]);}_0x4c73b7[_0x0370('0x38')]=qs['sort'](_0x1a0f85[_0x0370('0x30')]['sort']);_0x4c73b7[_0x0370('0x39')]=qs[_0x0370('0x31')](_[_0x0370('0x3a')](_0x1a0f85[_0x0370('0x30')],_0xf07dda['filters']),_0x322252);if(_0x1a0f85['query'][_0x0370('0x3b')]){_0x4c73b7['where']=_[_0x0370('0x3c')](_0x4c73b7[_0x0370('0x39')],{'$or':_[_0x0370('0x2e')](_0x322252,function(_0x4cb4d5){if(_0x4cb4d5[_0x0370('0x3d')]!==_0x0370('0x3e')){var _0x19cd3f={};_0x19cd3f[_0x4cb4d5[_0x0370('0x26')]]={'$like':'%'+_0x1a0f85['query'][_0x0370('0x3b')]+'%'};return _0x19cd3f;}})});}_0x4c73b7=_[_0x0370('0x3c')]({},_0x4c73b7,_0x1a0f85[_0x0370('0x3f')]);var _0x4dcd5c={'where':_0x4c73b7[_0x0370('0x39')]};return db[_0x0370('0x29')][_0x0370('0x1c')](_0x4dcd5c)[_0x0370('0x23')](function(_0x23d48a){_0x5bf174['count']=_0x23d48a;if(_0x1a0f85[_0x0370('0x30')]['includeAll']){_0x4c73b7['include']=[{'all':!![]}];}return db[_0x0370('0x29')]['findAll'](_0x4c73b7);})[_0x0370('0x23')](function(_0x5f29f7){_0x5bf174[_0x0370('0x40')]=_0x5f29f7;return _0x5bf174;})['then'](respondWithFilteredResult(_0x9e4fda,_0x4c73b7))[_0x0370('0x41')](handleError(_0x9e4fda,null));};exports['show']=function(_0x56b38e,_0x27607c){var _0x262180={'raw':!![],'where':{'id':_0x56b38e[_0x0370('0x42')]['id']}},_0xd450a3={};_0xd450a3[_0x0370('0x2d')]=_[_0x0370('0x2f')](db[_0x0370('0x29')]['rawAttributes']);_0xd450a3['query']=_[_0x0370('0x2f')](_0x56b38e[_0x0370('0x30')]);_0xd450a3[_0x0370('0x31')]=_[_0x0370('0x32')](_0xd450a3[_0x0370('0x2d')],_0xd450a3[_0x0370('0x30')]);_0x262180[_0x0370('0x33')]=_[_0x0370('0x32')](_0xd450a3['model'],qs[_0x0370('0x34')](_0x56b38e[_0x0370('0x30')][_0x0370('0x34')]));_0x262180[_0x0370('0x33')]=_0x262180[_0x0370('0x33')][_0x0370('0x35')]?_0x262180[_0x0370('0x33')]:_0xd450a3[_0x0370('0x2d')];if(_0x56b38e[_0x0370('0x30')][_0x0370('0x43')]){_0x262180[_0x0370('0x44')]=[{'all':!![]}];}_0x262180=_['merge']({},_0x262180,_0x56b38e[_0x0370('0x3f')]);return db[_0x0370('0x29')][_0x0370('0x45')](_0x262180)['then'](handleEntityNotFound(_0x27607c,null))[_0x0370('0x23')](respondWithResult(_0x27607c,null))['catch'](handleError(_0x27607c,null));};exports[_0x0370('0x46')]=function(_0x8a4177,_0x44616a){return db[_0x0370('0x29')][_0x0370('0x46')](_0x8a4177[_0x0370('0x47')],{})[_0x0370('0x23')](respondWithResult(_0x44616a,0xc9))[_0x0370('0x41')](handleError(_0x44616a,null));};exports[_0x0370('0x22')]=function(_0x3bfa3e,_0x106707){if(_0x3bfa3e[_0x0370('0x47')]['id']){delete _0x3bfa3e[_0x0370('0x47')]['id'];}return db[_0x0370('0x29')][_0x0370('0x45')]({'where':{'id':_0x3bfa3e[_0x0370('0x42')]['id']}})[_0x0370('0x23')](handleEntityNotFound(_0x106707,null))[_0x0370('0x23')](saveUpdates(_0x3bfa3e[_0x0370('0x47')],null))['then'](respondWithResult(_0x106707,null))[_0x0370('0x41')](handleError(_0x106707,null));};exports['destroy']=function(_0x1fd82e,_0x4c852c){return db[_0x0370('0x29')][_0x0370('0x45')]({'where':{'id':_0x1fd82e[_0x0370('0x42')]['id']}})[_0x0370('0x23')](handleEntityNotFound(_0x4c852c,null))[_0x0370('0x23')](removeEntity(_0x4c852c,null))[_0x0370('0x41')](handleError(_0x4c852c,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index c9ee091..7b9fca0 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 _0xbffc=['./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3f4cd0,_0x303070){var _0x3f9f01=function(_0x6ced93){while(--_0x6ced93){_0x3f4cd0['push'](_0x3f4cd0['shift']());}};_0x3f9f01(++_0x303070);}(_0xbffc,0xd0));var _0xcbff=function(_0x216226,_0x145eab){_0x216226=_0x216226-0x0;var _0x462499=_0xbffc[_0x216226];return _0x462499;};'use strict';var _=require('lodash');var util=require(_0xcbff('0x0'));var logger=require(_0xcbff('0x1'))(_0xcbff('0x2'));var moment=require(_0xcbff('0x3'));var BPromise=require(_0xcbff('0x4'));var rp=require(_0xcbff('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcbff('0x6'));var config=require(_0xcbff('0x7'));var attributes=require(_0xcbff('0x8'));module[_0xcbff('0x9')]=function(_0x4f4760,_0x119acb){return _0x4f4760[_0xcbff('0xa')](_0xcbff('0xb'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xac94=['lodash','util','../../config/logger','api','moment','path','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport'];(function(_0x2af692,_0x30438e){var _0x26a3a8=function(_0x28aa74){while(--_0x28aa74){_0x2af692['push'](_0x2af692['shift']());}};_0x26a3a8(++_0x30438e);}(_0xac94,0x197));var _0x4ac9=function(_0x10f88c,_0x560cc3){_0x10f88c=_0x10f88c-0x0;var _0xd77c0d=_0xac94[_0x10f88c];return _0xd77c0d;};'use strict';var _=require(_0x4ac9('0x0'));var util=require(_0x4ac9('0x1'));var logger=require(_0x4ac9('0x2'))(_0x4ac9('0x3'));var moment=require(_0x4ac9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4ac9('0x5'));var rimraf=require('rimraf');var config=require(_0x4ac9('0x6'));var attributes=require(_0x4ac9('0x7'));module[_0x4ac9('0x8')]=function(_0x2555db,_0x1edb9b){return _0x2555db[_0x4ac9('0x9')](_0x4ac9('0xa'),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 68b52b6..2c7a8de 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x124791,_0x2b9ed2){_0x124791=_0x124791-0x0;var _0x4c535a=_0x7a54[_0x124791];return _0x4c535a;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
+var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x33f79f,_0xe46bc5){var _0x3a5cd1=function(_0x1bf38b){while(--_0x1bf38b){_0x33f79f['push'](_0x33f79f['shift']());}};_0x3a5cd1(++_0xe46bc5);}(_0xdb28,0x106));var _0x8db2=function(_0x5797c9,_0x4ebd89){_0x5797c9=_0x5797c9-0x0;var _0x35ee65=_0xdb28[_0x5797c9];return _0x35ee65;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 5f8524e..100ca91 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 _0x3264=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','show','post','create','put','/:id','destroy','multer','path','connect-timeout'];(function(_0x17c056,_0x11f4ff){var _0x5c238a=function(_0x32e152){while(--_0x32e152){_0x17c056['push'](_0x17c056['shift']());}};_0x5c238a(++_0x11f4ff);}(_0x3264,0x1e3));var _0x4326=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x3264[_0x2064e5];return _0x21a233;};'use strict';var multer=require(_0x4326('0x0'));var util=require('util');var path=require(_0x4326('0x1'));var timeout=require(_0x4326('0x2'));var express=require(_0x4326('0x3'));var router=express[_0x4326('0x4')]();var fs_extra=require(_0x4326('0x5'));var auth=require(_0x4326('0x6'));var interaction=require(_0x4326('0x7'));var config=require(_0x4326('0x8'));var controller=require(_0x4326('0x9'));router['get']('/',auth[_0x4326('0xa')](),controller[_0x4326('0xb')]);router['get']('/:id',auth[_0x4326('0xa')](),controller[_0x4326('0xc')]);router[_0x4326('0xd')]('/',auth[_0x4326('0xa')](),controller[_0x4326('0xe')]);router[_0x4326('0xf')](_0x4326('0x10'),auth[_0x4326('0xa')](),controller['update']);router['delete'](_0x4326('0x10'),auth[_0x4326('0xa')](),controller[_0x4326('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x29e9=['post','create','put','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','get','/:id'];(function(_0x3dea7d,_0x2cd4ea){var _0x53919a=function(_0x1554e2){while(--_0x1554e2){_0x3dea7d['push'](_0x3dea7d['shift']());}};_0x53919a(++_0x2cd4ea);}(_0x29e9,0x95));var _0x929e=function(_0x2299d4,_0x47c68f){_0x2299d4=_0x2299d4-0x0;var _0x149413=_0x29e9[_0x2299d4];return _0x149413;};'use strict';var multer=require('multer');var util=require(_0x929e('0x0'));var path=require(_0x929e('0x1'));var timeout=require(_0x929e('0x2'));var express=require(_0x929e('0x3'));var router=express[_0x929e('0x4')]();var fs_extra=require(_0x929e('0x5'));var auth=require(_0x929e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x929e('0x7'));var controller=require(_0x929e('0x8'));router['get']('/',auth[_0x929e('0x9')](),controller[_0x929e('0xa')]);router[_0x929e('0xb')](_0x929e('0xc'),auth[_0x929e('0x9')](),controller['show']);router[_0x929e('0xd')]('/',auth[_0x929e('0x9')](),controller[_0x929e('0xe')]);router[_0x929e('0xf')](_0x929e('0xc'),auth[_0x929e('0x9')](),controller['update']);router[_0x929e('0x10')]('/:id',auth[_0x929e('0x9')](),controller[_0x929e('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index bbf3cf6..08507c5 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 _0x8ebf=['sequelize','exports','STRING'];(function(_0x176bf2,_0x190eaa){var _0x59ec2d=function(_0x5c05f9){while(--_0x5c05f9){_0x176bf2['push'](_0x176bf2['shift']());}};_0x59ec2d(++_0x190eaa);}(_0x8ebf,0x15c));var _0xf8eb=function(_0x37a79c,_0x2b19f0){_0x37a79c=_0x37a79c-0x0;var _0x561d89=_0x8ebf[_0x37a79c];return _0x561d89;};'use strict';var Sequelize=require(_0xf8eb('0x0'));module[_0xf8eb('0x1')]={'name':{'type':Sequelize[_0xf8eb('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf8eb('0x2')]}};
\ No newline at end of file
+var _0x089f=['STRING','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x089f,0x1c7));var _0xf089=function(_0x58cca5,_0xa02c6){_0x58cca5=_0x58cca5-0x0;var _0x55b0a6=_0x089f[_0x58cca5];return _0x55b0a6;};'use strict';var Sequelize=require('sequelize');module[_0xf089('0x0')]={'name':{'type':Sequelize[_0xf089('0x1')]},'basename':{'type':Sequelize[_0xf089('0x1')]},'type':{'type':Sequelize[_0xf089('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 8fd90f1..5339251 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 _0x5eee=['bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','destroy','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','Attachment','findAll','catch','show','params','includeAll','find','clone','length','include','get','omit','createdAt','updatedAt','body','create','update','file','originalname','basename','filename','download','findOne','ChatOfflineMessageId','join','root','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x1ccc2a,_0x1a1e08){var _0x323a21=function(_0x3e1516){while(--_0x3e1516){_0x1ccc2a['push'](_0x1ccc2a['shift']());}};_0x323a21(++_0x1a1e08);}(_0x5eee,0xb2));var _0xe5ee=function(_0x4b4642,_0x31c522){_0x4b4642=_0x4b4642-0x0;var _0xa1767d=_0x5eee[_0x4b4642];return _0xa1767d;};'use strict';var emlformat=require(_0xe5ee('0x0'));var rimraf=require(_0xe5ee('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe5ee('0x2'));var rp=require(_0xe5ee('0x3'));var moment=require('moment');var BPromise=require(_0xe5ee('0x4'));var Mustache=require(_0xe5ee('0x5'));var util=require(_0xe5ee('0x6'));var path=require('path');var sox=require(_0xe5ee('0x7'));var csv=require('to-csv');var ejs=require(_0xe5ee('0x8'));var fs=require('fs');var fs_extra=require(_0xe5ee('0x9'));var _=require(_0xe5ee('0xa'));var squel=require(_0xe5ee('0xb'));var crypto=require(_0xe5ee('0xc'));var jsforce=require(_0xe5ee('0xd'));var deskjs=require(_0xe5ee('0xe'));var toCsv=require(_0xe5ee('0xf'));var querystring=require('querystring');var Papa=require(_0xe5ee('0x10'));var Redis=require(_0xe5ee('0x11'));var authService=require(_0xe5ee('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe5ee('0x13'));var hardwareService=require(_0xe5ee('0x14'));var logger=require(_0xe5ee('0x15'))(_0xe5ee('0x16'));var utils=require(_0xe5ee('0x17'));var config=require(_0xe5ee('0x18'));var licenseUtil=require(_0xe5ee('0x19'));var db=require(_0xe5ee('0x1a'))['db'];function respondWithStatusCode(_0x14e7ef,_0x1c580f){_0x1c580f=_0x1c580f||0xcc;return function(_0x17c10c){if(_0x17c10c){return _0x14e7ef[_0xe5ee('0x1b')](_0x1c580f);}return _0x14e7ef[_0xe5ee('0x1c')](_0x1c580f)[_0xe5ee('0x1d')]();};}function respondWithResult(_0x760052,_0x343472){_0x343472=_0x343472||0xc8;return function(_0x4395a7){if(_0x4395a7){return _0x760052[_0xe5ee('0x1c')](_0x343472)[_0xe5ee('0x1e')](_0x4395a7);}};}function respondWithFilteredResult(_0x5d4dbc,_0x11735f){return function(_0x78f7f3){if(_0x78f7f3){var _0x407f0a=typeof _0x11735f[_0xe5ee('0x1f')]===_0xe5ee('0x20')&&typeof _0x11735f[_0xe5ee('0x21')]===_0xe5ee('0x20');var _0x3e53fd=_0x78f7f3[_0xe5ee('0x22')];var _0x267ded=_0x407f0a?0x0:_0x11735f['offset'];var _0x3e0608=_0x407f0a?_0x78f7f3[_0xe5ee('0x22')]:_0x11735f[_0xe5ee('0x1f')]+_0x11735f[_0xe5ee('0x21')];var _0x449742;if(_0x3e0608>=_0x3e53fd){_0x3e0608=_0x3e53fd;_0x449742=0xc8;}else{_0x449742=0xce;}_0x5d4dbc[_0xe5ee('0x1c')](_0x449742);return _0x5d4dbc[_0xe5ee('0x23')]('Content-Range',_0x267ded+'-'+_0x3e0608+'/'+_0x3e53fd)['json'](_0x78f7f3);}return null;};}function patchUpdates(_0x119f19){return function(_0x233dec){try{jsonpatch[_0xe5ee('0x24')](_0x233dec,_0x119f19,!![]);}catch(_0x269675){return BPromise[_0xe5ee('0x25')](_0x269675);}return _0x233dec['save']();};}function saveUpdates(_0x3f9d1d,_0x54ad1e){return function(_0x3b9422){if(_0x3b9422){return _0x3b9422['update'](_0x3f9d1d)['then'](function(_0x41d7ee){return _0x41d7ee;});}return null;};}function removeEntity(_0x5e5139,_0x2609c9){return function(_0x526a4b){if(_0x526a4b){return _0x526a4b[_0xe5ee('0x26')]()[_0xe5ee('0x27')](function(){_0x5e5139[_0xe5ee('0x1c')](0xcc)[_0xe5ee('0x1d')]();});}};}function handleEntityNotFound(_0x490524,_0x165123){return function(_0x5eb773){if(!_0x5eb773){_0x490524[_0xe5ee('0x1b')](0x194);}return _0x5eb773;};}function handleError(_0x403977,_0x422495){_0x422495=_0x422495||0x1f4;return function(_0x25174d){logger['error'](_0x25174d[_0xe5ee('0x28')]);if(_0x25174d[_0xe5ee('0x29')]){delete _0x25174d[_0xe5ee('0x29')];}_0x403977[_0xe5ee('0x1c')](_0x422495)[_0xe5ee('0x2a')](_0x25174d);};}exports[_0xe5ee('0x2b')]=function(_0x51058d,_0x1410fc){var _0x20e64f={},_0x2285f6={},_0x35d9bb={'count':0x0,'rows':[]};var _0x469e89=_[_0xe5ee('0x2c')](db['Attachment'][_0xe5ee('0x2d')],function(_0x41f4b2){return{'name':_0x41f4b2[_0xe5ee('0x2e')],'type':_0x41f4b2[_0xe5ee('0x2f')][_0xe5ee('0x30')]};});_0x2285f6[_0xe5ee('0x31')]=_[_0xe5ee('0x2c')](_0x469e89,_0xe5ee('0x29'));_0x2285f6[_0xe5ee('0x32')]=_[_0xe5ee('0x33')](_0x51058d['query']);_0x2285f6['filters']=_[_0xe5ee('0x34')](_0x2285f6[_0xe5ee('0x31')],_0x2285f6[_0xe5ee('0x32')]);_0x20e64f[_0xe5ee('0x35')]=_[_0xe5ee('0x34')](_0x2285f6['model'],qs['fields'](_0x51058d[_0xe5ee('0x32')][_0xe5ee('0x36')]));_0x20e64f[_0xe5ee('0x35')]=_0x20e64f[_0xe5ee('0x35')]['length']?_0x20e64f[_0xe5ee('0x35')]:_0x2285f6[_0xe5ee('0x31')];if(!_0x51058d[_0xe5ee('0x32')]['hasOwnProperty'](_0xe5ee('0x37'))){_0x20e64f[_0xe5ee('0x21')]=qs['limit'](_0x51058d[_0xe5ee('0x32')][_0xe5ee('0x21')]);_0x20e64f[_0xe5ee('0x1f')]=qs['offset'](_0x51058d[_0xe5ee('0x32')][_0xe5ee('0x1f')]);}_0x20e64f[_0xe5ee('0x38')]=qs[_0xe5ee('0x39')](_0x51058d['query']['sort']);_0x20e64f[_0xe5ee('0x3a')]=qs[_0xe5ee('0x3b')](_['pick'](_0x51058d[_0xe5ee('0x32')],_0x2285f6[_0xe5ee('0x3b')]),_0x469e89);if(_0x51058d[_0xe5ee('0x32')][_0xe5ee('0x3c')]){_0x20e64f[_0xe5ee('0x3a')]=_[_0xe5ee('0x3d')](_0x20e64f['where'],{'$or':_[_0xe5ee('0x2c')](_0x469e89,function(_0x1bb75c){if(_0x1bb75c[_0xe5ee('0x2f')]!==_0xe5ee('0x3e')){var _0x2d5234={};_0x2d5234[_0x1bb75c['name']]={'$like':'%'+_0x51058d[_0xe5ee('0x32')][_0xe5ee('0x3c')]+'%'};return _0x2d5234;}})});}_0x20e64f=_[_0xe5ee('0x3d')]({},_0x20e64f,_0x51058d[_0xe5ee('0x3f')]);var _0x42a55d={'where':_0x20e64f[_0xe5ee('0x3a')]};return db[_0xe5ee('0x40')][_0xe5ee('0x22')](_0x42a55d)[_0xe5ee('0x27')](function(_0x429dce){_0x35d9bb[_0xe5ee('0x22')]=_0x429dce;if(_0x51058d['query']['includeAll']){_0x20e64f['include']=[{'all':!![]}];}return db[_0xe5ee('0x40')][_0xe5ee('0x41')](_0x20e64f);})['then'](function(_0x228c38){_0x35d9bb['rows']=_0x228c38;return _0x35d9bb;})[_0xe5ee('0x27')](respondWithFilteredResult(_0x1410fc,_0x20e64f))[_0xe5ee('0x42')](handleError(_0x1410fc,null));};exports[_0xe5ee('0x43')]=function(_0x1c78b4,_0x8e03f9){var _0x20a2ed={'raw':!![],'where':{'id':_0x1c78b4[_0xe5ee('0x44')]['id']}},_0x24ea0a={};_0x24ea0a['model']=_[_0xe5ee('0x33')](db[_0xe5ee('0x40')][_0xe5ee('0x2d')]);_0x24ea0a[_0xe5ee('0x32')]=_[_0xe5ee('0x33')](_0x1c78b4[_0xe5ee('0x32')]);_0x24ea0a[_0xe5ee('0x3b')]=_[_0xe5ee('0x34')](_0x24ea0a['model'],_0x24ea0a[_0xe5ee('0x32')]);_0x20a2ed['attributes']=_[_0xe5ee('0x34')](_0x24ea0a[_0xe5ee('0x31')],qs[_0xe5ee('0x36')](_0x1c78b4[_0xe5ee('0x32')][_0xe5ee('0x36')]));_0x20a2ed[_0xe5ee('0x35')]=_0x20a2ed[_0xe5ee('0x35')]['length']?_0x20a2ed[_0xe5ee('0x35')]:_0x24ea0a[_0xe5ee('0x31')];if(_0x1c78b4['query'][_0xe5ee('0x45')]){_0x20a2ed['include']=[{'all':!![]}];}_0x20a2ed=_[_0xe5ee('0x3d')]({},_0x20a2ed,_0x1c78b4[_0xe5ee('0x3f')]);return db[_0xe5ee('0x40')][_0xe5ee('0x46')](_0x20a2ed)['then'](handleEntityNotFound(_0x8e03f9,null))[_0xe5ee('0x27')](respondWithResult(_0x8e03f9,null))['catch'](handleError(_0x8e03f9,null));};exports[_0xe5ee('0x47')]=function(_0x3fd761,_0x295f5d){var _0x36ce1e={'where':{'id':_0x3fd761[_0xe5ee('0x44')]['id']}},_0x546666={};_0x546666[_0xe5ee('0x31')]=_[_0xe5ee('0x33')](db[_0xe5ee('0x40')][_0xe5ee('0x2d')]);_0x36ce1e[_0xe5ee('0x35')]=_[_0xe5ee('0x34')](_0x546666[_0xe5ee('0x31')],qs[_0xe5ee('0x36')](_0x3fd761[_0xe5ee('0x32')]['fields']));_0x36ce1e[_0xe5ee('0x35')]=_0x36ce1e[_0xe5ee('0x35')][_0xe5ee('0x48')]?_0x36ce1e[_0xe5ee('0x35')]:_0x546666[_0xe5ee('0x31')];if(_0x3fd761[_0xe5ee('0x32')]['includeAll']){_0x36ce1e[_0xe5ee('0x49')]=[{'all':!![]}];}_0x36ce1e=_[_0xe5ee('0x3d')]({},_0x36ce1e,_0x3fd761['options']);return db[_0xe5ee('0x40')][_0xe5ee('0x46')](_0x36ce1e)[_0xe5ee('0x27')](handleEntityNotFound(_0x295f5d,null))[_0xe5ee('0x27')](function(_0x3d0633){if(_0x3d0633){var _0x642cf5=_0x3d0633[_0xe5ee('0x4a')]({'plain':!![]});_0x642cf5=qs[_0xe5ee('0x4b')](_0x642cf5,['id',_0xe5ee('0x4c'),_0xe5ee('0x4d')]);_0x3fd761[_0xe5ee('0x4e')]=_[_0xe5ee('0x4b')](_0x3fd761[_0xe5ee('0x4e')],['id',_0xe5ee('0x4c'),_0xe5ee('0x4d')]);return db[_0xe5ee('0x40')][_0xe5ee('0x4f')](_['merge'](_0x642cf5,_0x3fd761[_0xe5ee('0x4e')]),{'include':_0x3fd761[_0xe5ee('0x32')]['includeAll']?[{'all':!![]}]:undefined});}})[_0xe5ee('0x27')](respondWithResult(_0x295f5d,0xc9))[_0xe5ee('0x42')](handleError(_0x295f5d,null));};exports[_0xe5ee('0x50')]=function(_0xa954df,_0x4cc33f){if(_0xa954df[_0xe5ee('0x4e')]['id']){delete _0xa954df[_0xe5ee('0x4e')]['id'];}return db['Attachment'][_0xe5ee('0x46')]({'where':{'id':_0xa954df[_0xe5ee('0x44')]['id']}})[_0xe5ee('0x27')](handleEntityNotFound(_0x4cc33f,null))[_0xe5ee('0x27')](saveUpdates(_0xa954df[_0xe5ee('0x4e')],null))['then'](respondWithResult(_0x4cc33f,null))[_0xe5ee('0x42')](handleError(_0x4cc33f,null));};exports[_0xe5ee('0x26')]=function(_0x13c71d,_0x16eb0f){return db['Attachment']['find']({'where':{'id':_0x13c71d['params']['id']}})[_0xe5ee('0x27')](handleEntityNotFound(_0x16eb0f,null))[_0xe5ee('0x27')](removeEntity(_0x16eb0f,null))[_0xe5ee('0x42')](handleError(_0x16eb0f,null));};exports[_0xe5ee('0x4f')]=function(_0x530990,_0x2de9a4,_0x5acc28){_0x530990[_0xe5ee('0x4e')]['name']=_0x530990[_0xe5ee('0x51')][_0xe5ee('0x52')];_0x530990['body'][_0xe5ee('0x53')]=_0x530990[_0xe5ee('0x51')][_0xe5ee('0x54')];_0x530990[_0xe5ee('0x4e')][_0xe5ee('0x2f')]=_0x530990[_0xe5ee('0x51')]['mimetype'];return db[_0xe5ee('0x40')][_0xe5ee('0x4f')](_0x530990[_0xe5ee('0x4e')])['then'](respondWithResult(_0x2de9a4,0xc9))[_0xe5ee('0x42')](handleError(_0x2de9a4,null));};exports[_0xe5ee('0x55')]=function(_0x5b5b4c,_0xfe10c1,_0x33cde9){return db[_0xe5ee('0x40')][_0xe5ee('0x56')]({'where':{'id':_0x5b5b4c[_0xe5ee('0x44')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0xfe10c1,null))['then'](function(_0xacfedc){if(_0xacfedc){var _0xec5a21=_0xacfedc[_0xe5ee('0x57')]!==null;var _0x622758=path[_0xe5ee('0x58')](config[_0xe5ee('0x59')],'server/files/attachments/');if(_0xec5a21){_0x622758=path['join'](_0x622758,_0xe5ee('0x5a'));}var _0x934da8=path['join'](_0x622758,_0xacfedc[_0xe5ee('0x53')]);return _0xfe10c1['download'](_0x934da8);}})[_0xe5ee('0x42')](handleError(_0xfe10c1,null));};
\ No newline at end of file
+var _0x3b3e=['error','name','map','Attachment','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','options','includeAll','findAll','catch','params','rawAttributes','length','include','merge','clone','find','get','omit','createdAt','updatedAt','body','create','originalname','basename','file','filename','mimetype','download','findOne','root','join','offline-chat/','eml-format','rimraf','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy'];(function(_0x38eb23,_0x196e8b){var _0x48506a=function(_0x36edb0){while(--_0x36edb0){_0x38eb23['push'](_0x38eb23['shift']());}};_0x48506a(++_0x196e8b);}(_0x3b3e,0x1de));var _0xe3b3=function(_0x473088,_0x2cddfc){_0x473088=_0x473088-0x0;var _0x25a3a8=_0x3b3e[_0x473088];return _0x25a3a8;};'use strict';var emlformat=require(_0xe3b3('0x0'));var rimraf=require(_0xe3b3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe3b3('0x2'));var moment=require(_0xe3b3('0x3'));var BPromise=require(_0xe3b3('0x4'));var Mustache=require('mustache');var util=require(_0xe3b3('0x5'));var path=require('path');var sox=require(_0xe3b3('0x6'));var csv=require(_0xe3b3('0x7'));var ejs=require(_0xe3b3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe3b3('0x9'));var squel=require(_0xe3b3('0xa'));var crypto=require(_0xe3b3('0xb'));var jsforce=require(_0xe3b3('0xc'));var deskjs=require(_0xe3b3('0xd'));var toCsv=require(_0xe3b3('0x7'));var querystring=require(_0xe3b3('0xe'));var Papa=require(_0xe3b3('0xf'));var Redis=require(_0xe3b3('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe3b3('0x11'));var as=require(_0xe3b3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe3b3('0x13'))(_0xe3b3('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe3b3('0x15'))['db'];function respondWithStatusCode(_0x305a12,_0x34afad){_0x34afad=_0x34afad||0xcc;return function(_0x429ef6){if(_0x429ef6){return _0x305a12[_0xe3b3('0x16')](_0x34afad);}return _0x305a12[_0xe3b3('0x17')](_0x34afad)[_0xe3b3('0x18')]();};}function respondWithResult(_0x395f07,_0x23e8c5){_0x23e8c5=_0x23e8c5||0xc8;return function(_0x5d6d69){if(_0x5d6d69){return _0x395f07[_0xe3b3('0x17')](_0x23e8c5)['json'](_0x5d6d69);}};}function respondWithFilteredResult(_0x2bd5f0,_0x4920e9){return function(_0x4d859b){if(_0x4d859b){var _0x1f7eca=typeof _0x4920e9['offset']===_0xe3b3('0x19')&&typeof _0x4920e9[_0xe3b3('0x1a')]===_0xe3b3('0x19');var _0x130ee9=_0x4d859b[_0xe3b3('0x1b')];var _0x198598=_0x1f7eca?0x0:_0x4920e9[_0xe3b3('0x1c')];var _0x33e124=_0x1f7eca?_0x4d859b[_0xe3b3('0x1b')]:_0x4920e9['offset']+_0x4920e9[_0xe3b3('0x1a')];var _0x36c43f;if(_0x33e124>=_0x130ee9){_0x33e124=_0x130ee9;_0x36c43f=0xc8;}else{_0x36c43f=0xce;}_0x2bd5f0['status'](_0x36c43f);return _0x2bd5f0[_0xe3b3('0x1d')](_0xe3b3('0x1e'),_0x198598+'-'+_0x33e124+'/'+_0x130ee9)[_0xe3b3('0x1f')](_0x4d859b);}return null;};}function patchUpdates(_0x13446a){return function(_0x1611e0){try{jsonpatch[_0xe3b3('0x20')](_0x1611e0,_0x13446a,!![]);}catch(_0x51c909){return BPromise[_0xe3b3('0x21')](_0x51c909);}return _0x1611e0[_0xe3b3('0x22')]();};}function saveUpdates(_0x3ea897,_0x1f126a){return function(_0x49f950){if(_0x49f950){return _0x49f950[_0xe3b3('0x23')](_0x3ea897)[_0xe3b3('0x24')](function(_0x38a226){return _0x38a226;});}return null;};}function removeEntity(_0x2fea06,_0x4c9942){return function(_0x15ef13){if(_0x15ef13){return _0x15ef13[_0xe3b3('0x25')]()['then'](function(){_0x2fea06[_0xe3b3('0x17')](0xcc)[_0xe3b3('0x18')]();});}};}function handleEntityNotFound(_0x482d4c,_0x3fe89c){return function(_0x411dd3){if(!_0x411dd3){_0x482d4c['sendStatus'](0x194);}return _0x411dd3;};}function handleError(_0x43f4cb,_0x36e6d7){_0x36e6d7=_0x36e6d7||0x1f4;return function(_0x1f681b){logger[_0xe3b3('0x26')](_0x1f681b['stack']);if(_0x1f681b['name']){delete _0x1f681b[_0xe3b3('0x27')];}_0x43f4cb[_0xe3b3('0x17')](_0x36e6d7)['send'](_0x1f681b);};}exports['index']=function(_0x6f7fb5,_0x11e3d9){var _0x3e0162={},_0x510818={},_0x37711f={'count':0x0,'rows':[]};var _0x90f464=_[_0xe3b3('0x28')](db[_0xe3b3('0x29')]['rawAttributes'],function(_0x64bf89){return{'name':_0x64bf89[_0xe3b3('0x2a')],'type':_0x64bf89[_0xe3b3('0x2b')][_0xe3b3('0x2c')]};});_0x510818[_0xe3b3('0x2d')]=_['map'](_0x90f464,_0xe3b3('0x27'));_0x510818[_0xe3b3('0x2e')]=_[_0xe3b3('0x2f')](_0x6f7fb5[_0xe3b3('0x2e')]);_0x510818[_0xe3b3('0x30')]=_[_0xe3b3('0x31')](_0x510818[_0xe3b3('0x2d')],_0x510818[_0xe3b3('0x2e')]);_0x3e0162[_0xe3b3('0x32')]=_[_0xe3b3('0x31')](_0x510818['model'],qs[_0xe3b3('0x33')](_0x6f7fb5[_0xe3b3('0x2e')][_0xe3b3('0x33')]));_0x3e0162[_0xe3b3('0x32')]=_0x3e0162[_0xe3b3('0x32')]['length']?_0x3e0162[_0xe3b3('0x32')]:_0x510818[_0xe3b3('0x2d')];if(!_0x6f7fb5[_0xe3b3('0x2e')][_0xe3b3('0x34')]('nolimit')){_0x3e0162[_0xe3b3('0x1a')]=qs['limit'](_0x6f7fb5[_0xe3b3('0x2e')][_0xe3b3('0x1a')]);_0x3e0162[_0xe3b3('0x1c')]=qs[_0xe3b3('0x1c')](_0x6f7fb5['query']['offset']);}_0x3e0162[_0xe3b3('0x35')]=qs[_0xe3b3('0x36')](_0x6f7fb5[_0xe3b3('0x2e')][_0xe3b3('0x36')]);_0x3e0162['where']=qs[_0xe3b3('0x30')](_[_0xe3b3('0x37')](_0x6f7fb5[_0xe3b3('0x2e')],_0x510818['filters']),_0x90f464);if(_0x6f7fb5['query'][_0xe3b3('0x38')]){_0x3e0162[_0xe3b3('0x39')]=_['merge'](_0x3e0162[_0xe3b3('0x39')],{'$or':_[_0xe3b3('0x28')](_0x90f464,function(_0x53e162){if(_0x53e162[_0xe3b3('0x2b')]!==_0xe3b3('0x3a')){var _0x1be161={};_0x1be161[_0x53e162[_0xe3b3('0x27')]]={'$like':'%'+_0x6f7fb5[_0xe3b3('0x2e')][_0xe3b3('0x38')]+'%'};return _0x1be161;}})});}_0x3e0162=_['merge']({},_0x3e0162,_0x6f7fb5[_0xe3b3('0x3b')]);var _0x2fe74d={'where':_0x3e0162[_0xe3b3('0x39')]};return db[_0xe3b3('0x29')][_0xe3b3('0x1b')](_0x2fe74d)[_0xe3b3('0x24')](function(_0x424462){_0x37711f['count']=_0x424462;if(_0x6f7fb5[_0xe3b3('0x2e')][_0xe3b3('0x3c')]){_0x3e0162['include']=[{'all':!![]}];}return db['Attachment'][_0xe3b3('0x3d')](_0x3e0162);})[_0xe3b3('0x24')](function(_0x2ad565){_0x37711f['rows']=_0x2ad565;return _0x37711f;})[_0xe3b3('0x24')](respondWithFilteredResult(_0x11e3d9,_0x3e0162))[_0xe3b3('0x3e')](handleError(_0x11e3d9,null));};exports['show']=function(_0x4d1429,_0x1cee83){var _0x1045b2={'raw':!![],'where':{'id':_0x4d1429[_0xe3b3('0x3f')]['id']}},_0x3d1c02={};_0x3d1c02[_0xe3b3('0x2d')]=_['keys'](db[_0xe3b3('0x29')][_0xe3b3('0x40')]);_0x3d1c02['query']=_['keys'](_0x4d1429[_0xe3b3('0x2e')]);_0x3d1c02[_0xe3b3('0x30')]=_[_0xe3b3('0x31')](_0x3d1c02[_0xe3b3('0x2d')],_0x3d1c02[_0xe3b3('0x2e')]);_0x1045b2['attributes']=_[_0xe3b3('0x31')](_0x3d1c02[_0xe3b3('0x2d')],qs['fields'](_0x4d1429[_0xe3b3('0x2e')][_0xe3b3('0x33')]));_0x1045b2[_0xe3b3('0x32')]=_0x1045b2[_0xe3b3('0x32')][_0xe3b3('0x41')]?_0x1045b2['attributes']:_0x3d1c02['model'];if(_0x4d1429[_0xe3b3('0x2e')]['includeAll']){_0x1045b2[_0xe3b3('0x42')]=[{'all':!![]}];}_0x1045b2=_[_0xe3b3('0x43')]({},_0x1045b2,_0x4d1429[_0xe3b3('0x3b')]);return db[_0xe3b3('0x29')]['find'](_0x1045b2)[_0xe3b3('0x24')](handleEntityNotFound(_0x1cee83,null))['then'](respondWithResult(_0x1cee83,null))[_0xe3b3('0x3e')](handleError(_0x1cee83,null));};exports[_0xe3b3('0x44')]=function(_0xcb69e5,_0x454eb6){var _0x213a6c={'where':{'id':_0xcb69e5[_0xe3b3('0x3f')]['id']}},_0x239c7f={};_0x239c7f[_0xe3b3('0x2d')]=_[_0xe3b3('0x2f')](db[_0xe3b3('0x29')][_0xe3b3('0x40')]);_0x213a6c[_0xe3b3('0x32')]=_[_0xe3b3('0x31')](_0x239c7f['model'],qs[_0xe3b3('0x33')](_0xcb69e5[_0xe3b3('0x2e')]['fields']));_0x213a6c['attributes']=_0x213a6c[_0xe3b3('0x32')][_0xe3b3('0x41')]?_0x213a6c[_0xe3b3('0x32')]:_0x239c7f[_0xe3b3('0x2d')];if(_0xcb69e5[_0xe3b3('0x2e')][_0xe3b3('0x3c')]){_0x213a6c[_0xe3b3('0x42')]=[{'all':!![]}];}_0x213a6c=_[_0xe3b3('0x43')]({},_0x213a6c,_0xcb69e5['options']);return db[_0xe3b3('0x29')][_0xe3b3('0x45')](_0x213a6c)[_0xe3b3('0x24')](handleEntityNotFound(_0x454eb6,null))[_0xe3b3('0x24')](function(_0x1e9b0c){if(_0x1e9b0c){var _0xcb4748=_0x1e9b0c[_0xe3b3('0x46')]({'plain':!![]});_0xcb4748=qs[_0xe3b3('0x47')](_0xcb4748,['id',_0xe3b3('0x48'),_0xe3b3('0x49')]);_0xcb69e5[_0xe3b3('0x4a')]=_[_0xe3b3('0x47')](_0xcb69e5[_0xe3b3('0x4a')],['id',_0xe3b3('0x48'),'updatedAt']);return db['Attachment'][_0xe3b3('0x4b')](_[_0xe3b3('0x43')](_0xcb4748,_0xcb69e5[_0xe3b3('0x4a')]),{'include':_0xcb69e5[_0xe3b3('0x2e')][_0xe3b3('0x3c')]?[{'all':!![]}]:undefined});}})[_0xe3b3('0x24')](respondWithResult(_0x454eb6,0xc9))[_0xe3b3('0x3e')](handleError(_0x454eb6,null));};exports[_0xe3b3('0x23')]=function(_0x420eaf,_0x4a7baf){if(_0x420eaf[_0xe3b3('0x4a')]['id']){delete _0x420eaf[_0xe3b3('0x4a')]['id'];}return db['Attachment'][_0xe3b3('0x45')]({'where':{'id':_0x420eaf['params']['id']}})[_0xe3b3('0x24')](handleEntityNotFound(_0x4a7baf,null))[_0xe3b3('0x24')](saveUpdates(_0x420eaf[_0xe3b3('0x4a')],null))[_0xe3b3('0x24')](respondWithResult(_0x4a7baf,null))['catch'](handleError(_0x4a7baf,null));};exports[_0xe3b3('0x25')]=function(_0x593440,_0x2d8191){return db[_0xe3b3('0x29')][_0xe3b3('0x45')]({'where':{'id':_0x593440[_0xe3b3('0x3f')]['id']}})[_0xe3b3('0x24')](handleEntityNotFound(_0x2d8191,null))[_0xe3b3('0x24')](removeEntity(_0x2d8191,null))[_0xe3b3('0x3e')](handleError(_0x2d8191,null));};exports['create']=function(_0x5810c3,_0x57e413,_0xde5991){_0x5810c3['body'][_0xe3b3('0x27')]=_0x5810c3['file'][_0xe3b3('0x4c')];_0x5810c3[_0xe3b3('0x4a')][_0xe3b3('0x4d')]=_0x5810c3[_0xe3b3('0x4e')][_0xe3b3('0x4f')];_0x5810c3[_0xe3b3('0x4a')][_0xe3b3('0x2b')]=_0x5810c3[_0xe3b3('0x4e')][_0xe3b3('0x50')];return db[_0xe3b3('0x29')][_0xe3b3('0x4b')](_0x5810c3[_0xe3b3('0x4a')])['then'](respondWithResult(_0x57e413,0xc9))['catch'](handleError(_0x57e413,null));};exports[_0xe3b3('0x51')]=function(_0x21f055,_0x2f2ee1,_0x3df6cf){return db[_0xe3b3('0x29')][_0xe3b3('0x52')]({'where':{'id':_0x21f055[_0xe3b3('0x3f')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2f2ee1,null))[_0xe3b3('0x24')](function(_0x4e042d){if(_0x4e042d){var _0x55e8ce=_0x4e042d['ChatOfflineMessageId']!==null;var _0x6c699e=path['join'](config[_0xe3b3('0x53')],'server/files/attachments/');if(_0x55e8ce){_0x6c699e=path[_0xe3b3('0x54')](_0x6c699e,_0xe3b3('0x55'));}var _0x151de0=path[_0xe3b3('0x54')](_0x6c699e,_0x4e042d[_0xe3b3('0x4d')]);return _0x2f2ee1[_0xe3b3('0x51')](_0x151de0);}})[_0xe3b3('0x3e')](handleError(_0x2f2ee1,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 0061d93..0935173 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 _0xf90a=['bluebird','path','rimraf','exports','define','Attachment','attachments','lodash','util','../../config/logger','api','moment'];(function(_0x689e24,_0x2c024e){var _0x30ae81=function(_0x4859d0){while(--_0x4859d0){_0x689e24['push'](_0x689e24['shift']());}};_0x30ae81(++_0x2c024e);}(_0xf90a,0xd3));var _0xaf90=function(_0x2b331e,_0x5f35e3){_0x2b331e=_0x2b331e-0x0;var _0x448c90=_0xf90a[_0x2b331e];return _0x448c90;};'use strict';var _=require(_0xaf90('0x0'));var util=require(_0xaf90('0x1'));var logger=require(_0xaf90('0x2'))(_0xaf90('0x3'));var moment=require(_0xaf90('0x4'));var BPromise=require(_0xaf90('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaf90('0x6'));var rimraf=require(_0xaf90('0x7'));var config=require('../../config/environment');var attributes=require('./attachment.attributes');module[_0xaf90('0x8')]=function(_0x11eb1f,_0x22f77b){return _0x11eb1f[_0xaf90('0x9')](_0xaf90('0xa'),attributes,{'tableName':_0xaf90('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb596=['rimraf','./attachment.attributes','exports','define','Attachment','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1ff7e3,_0x53f934){var _0xd3604a=function(_0x18b2ca){while(--_0x18b2ca){_0x1ff7e3['push'](_0x1ff7e3['shift']());}};_0xd3604a(++_0x53f934);}(_0xb596,0x94));var _0x6b59=function(_0x29292d,_0x2680b3){_0x29292d=_0x29292d-0x0;var _0x281f2f=_0xb596[_0x29292d];return _0x281f2f;};'use strict';var _=require(_0x6b59('0x0'));var util=require(_0x6b59('0x1'));var logger=require(_0x6b59('0x2'))(_0x6b59('0x3'));var moment=require(_0x6b59('0x4'));var BPromise=require(_0x6b59('0x5'));var rp=require(_0x6b59('0x6'));var fs=require('fs');var path=require(_0x6b59('0x7'));var rimraf=require(_0x6b59('0x8'));var config=require('../../config/environment');var attributes=require(_0x6b59('0x9'));module[_0x6b59('0xa')]=function(_0x17cd07,_0x1add4b){return _0x17cd07[_0x6b59('0xb')](_0x6b59('0xc'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 0883a3f..2c55dc7 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 _0x202c=['request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateAttachment','Attachment','options','raw','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Attachment,\x20%s,\x20%s'];(function(_0x35e92e,_0x21581b){var _0x1205a8=function(_0x4325d8){while(--_0x4325d8){_0x35e92e['push'](_0x35e92e['shift']());}};_0x1205a8(++_0x21581b);}(_0x202c,0x178));var _0xc202=function(_0x2513ce,_0xf33af6){_0x2513ce=_0x2513ce-0x0;var _0x19e1e7=_0x202c[_0x2513ce];return _0x19e1e7;};'use strict';var _=require(_0xc202('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc202('0x1'));var rs=require(_0xc202('0x2'));var fs=require('fs');var Redis=require(_0xc202('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc202('0x4'));var logger=require(_0xc202('0x5'))(_0xc202('0x6'));var config=require(_0xc202('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc202('0x8')][_0xc202('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59563a,_0xc2b3eb,_0x574549){return new BPromise(function(_0x872c1a,_0x5978fe){return client[_0xc202('0xa')](_0x59563a,_0x574549)[_0xc202('0xb')](function(_0x36fcb7){logger[_0xc202('0xc')](_0xc202('0xd'),_0xc2b3eb,_0xc202('0xe'));logger[_0xc202('0xf')](_0xc202('0x10'),_0xc2b3eb,_0xc202('0xe'),JSON[_0xc202('0x11')](_0x36fcb7));if(_0x36fcb7[_0xc202('0x12')]){if(_0x36fcb7['error'][_0xc202('0x13')]===0x1f4){logger[_0xc202('0x12')](_0xc202('0xd'),_0xc2b3eb,_0x36fcb7[_0xc202('0x12')][_0xc202('0x14')]);return _0x5978fe(_0x36fcb7[_0xc202('0x12')][_0xc202('0x14')]);}logger['error'](_0xc202('0xd'),_0xc2b3eb,_0x36fcb7[_0xc202('0x12')]['message']);return _0x872c1a(_0x36fcb7['error']['message']);}else{logger[_0xc202('0xc')]('Attachment,\x20%s,\x20%s',_0xc2b3eb,_0xc202('0xe'));_0x872c1a(_0x36fcb7['result'][_0xc202('0x14')]);}})[_0xc202('0x15')](function(_0x3018c8){logger[_0xc202('0x12')](_0xc202('0xd'),_0xc2b3eb,_0x3018c8);_0x5978fe(_0x3018c8);});});}exports[_0xc202('0x16')]=function(_0x9620a0){var _0x591ecc=this;return new Promise(function(_0x16ec7c,_0x2c5557){return db[_0xc202('0x17')]['create'](_0x9620a0['body'],{'raw':_0x9620a0[_0xc202('0x18')]?_0x9620a0[_0xc202('0x18')][_0xc202('0x19')]===undefined?!![]:![]:!![]})[_0xc202('0xb')](function(_0x2ae3c1){logger['info']('CreateAttachment',_0x9620a0);logger[_0xc202('0xf')]('CreateAttachment',_0x9620a0,JSON[_0xc202('0x11')](_0x2ae3c1));_0x16ec7c(_0x2ae3c1);})[_0xc202('0x15')](function(_0x56e979){logger['error'](_0xc202('0x16'),_0x56e979['message'],_0x9620a0);_0x2c5557(_0x591ecc[_0xc202('0x12')](0x1f4,_0x56e979[_0xc202('0x14')]));});});};
\ No newline at end of file
+var _0x6c50=['error','Attachment,\x20%s,\x20%s','message','request\x20sent','result','catch','CreateAttachment','Attachment','create','body','options','raw','debug','stringify','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s,\x20%s'];(function(_0x117fef,_0x56c508){var _0x1406d9=function(_0x46f36a){while(--_0x46f36a){_0x117fef['push'](_0x117fef['shift']());}};_0x1406d9(++_0x56c508);}(_0x6c50,0xa4));var _0x06c5=function(_0x2d957d,_0x376e55){_0x2d957d=_0x2d957d-0x0;var _0x309f77=_0x6c50[_0x2d957d];return _0x309f77;};'use strict';var _=require(_0x06c5('0x0'));var util=require(_0x06c5('0x1'));var moment=require(_0x06c5('0x2'));var BPromise=require(_0x06c5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06c5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x06c5('0x5'));var logger=require(_0x06c5('0x6'))(_0x06c5('0x7'));var config=require(_0x06c5('0x8'));var jayson=require(_0x06c5('0x9'));var client=jayson[_0x06c5('0xa')][_0x06c5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x427dd6,_0x181c7f,_0x17c636){return new BPromise(function(_0x154b0a,_0x546ae5){return client[_0x06c5('0xc')](_0x427dd6,_0x17c636)[_0x06c5('0xd')](function(_0x3010af){logger[_0x06c5('0xe')]('Attachment,\x20%s,\x20%s',_0x181c7f,'request\x20sent');logger['debug'](_0x06c5('0xf'),_0x181c7f,'request\x20sent',JSON['stringify'](_0x3010af));if(_0x3010af['error']){if(_0x3010af[_0x06c5('0x10')]['code']===0x1f4){logger[_0x06c5('0x10')](_0x06c5('0x11'),_0x181c7f,_0x3010af[_0x06c5('0x10')]['message']);return _0x546ae5(_0x3010af[_0x06c5('0x10')][_0x06c5('0x12')]);}logger[_0x06c5('0x10')](_0x06c5('0x11'),_0x181c7f,_0x3010af['error']['message']);return _0x154b0a(_0x3010af[_0x06c5('0x10')][_0x06c5('0x12')]);}else{logger[_0x06c5('0xe')]('Attachment,\x20%s,\x20%s',_0x181c7f,_0x06c5('0x13'));_0x154b0a(_0x3010af[_0x06c5('0x14')]['message']);}})[_0x06c5('0x15')](function(_0x9045e6){logger[_0x06c5('0x10')](_0x06c5('0x11'),_0x181c7f,_0x9045e6);_0x546ae5(_0x9045e6);});});}exports[_0x06c5('0x16')]=function(_0x36b9e9){var _0x44d14e=this;return new Promise(function(_0x18a070,_0x1393f5){return db[_0x06c5('0x17')][_0x06c5('0x18')](_0x36b9e9[_0x06c5('0x19')],{'raw':_0x36b9e9[_0x06c5('0x1a')]?_0x36b9e9[_0x06c5('0x1a')][_0x06c5('0x1b')]===undefined?!![]:![]:!![]})[_0x06c5('0xd')](function(_0x26a653){logger['info'](_0x06c5('0x16'),_0x36b9e9);logger[_0x06c5('0x1c')](_0x06c5('0x16'),_0x36b9e9,JSON[_0x06c5('0x1d')](_0x26a653));_0x18a070(_0x26a653);})[_0x06c5('0x15')](function(_0x3c9e49){logger[_0x06c5('0x10')]('CreateAttachment',_0x3c9e49[_0x06c5('0x12')],_0x36b9e9);_0x1393f5(_0x44d14e[_0x06c5('0x10')](0x1f4,_0x3c9e49[_0x06c5('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 890bed1..5fce082 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 _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0x0b0e,0x187));var _0xe0b0=function(_0xe15270,_0x227d06){_0xe15270=_0xe15270-0x0;var _0x1e813b=_0x0b0e[_0xe15270];return _0x1e813b;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router;
\ No newline at end of file
+var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1f9503,_0x8e450b){_0x1f9503=_0x1f9503-0x0;var _0xaab94f=_0x0b0e[_0x1f9503];return _0xaab94f;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 8da65e0..e130128 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 _0xf01c=['salt','role','disabled','blocked','blockedAt','online','admin','user','agent','add','minutes','clearBlockUser','getLicense','send','message','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','passport-local','Strategy','moment','bluebird','util','../../mysqldb','../../config/utils','../../config/environment','../../config/logger','activedirectory','undefined','baseDN','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','name','password'];(function(_0x1f495a,_0x33f28f){var _0x4989f1=function(_0x1e59f4){while(--_0x1e59f4){_0x1f495a['push'](_0x1f495a['shift']());}};_0x4989f1(++_0x33f28f);}(_0xf01c,0x165));var _0xcf01=function(_0x14eeef,_0x2e55bc){_0x14eeef=_0x14eeef-0x0;var _0x53aa66=_0xf01c[_0x14eeef];return _0x53aa66;};'use strict';var passport=require(_0xcf01('0x0'));var LocalStrategy=require(_0xcf01('0x1'))[_0xcf01('0x2')];var moment=require(_0xcf01('0x3'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xcf01('0x4'));var util=require(_0xcf01('0x5'));var db=require(_0xcf01('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xcf01('0x7'));var config=require(_0xcf01('0x8'));var logger=require(_0xcf01('0x9'))('api');function isActiveDirectoryConfigured(_0x4db8cb){var _0x309f6b=![];if(typeof _0x4db8cb[_0xcf01('0xa')]!==_0xcf01('0xb')){_0x309f6b=_0x4db8cb['activedirectory'][_0xcf01('0xc')]&&_0x4db8cb['activedirectory']['url']&&_0x4db8cb[_0xcf01('0xa')][_0xcf01('0xd')];}return _0x309f6b;}function adAuthenticate(_0x4059e4,_0x488f37,_0x11a20c){return new BPromise(function(_0x1d29f6,_0x32447f){try{var _0x2cd274=new ActiveDirectory(_0x4059e4);_0x2cd274[_0xcf01('0xe')](_0x488f37,_0x11a20c,function(_0x17ee14,_0x971fc8){if(_0x17ee14){logger[_0xcf01('0xf')](_0xcf01('0x10'),_0x488f37,util['inspect'](_0x17ee14,{'showHidden':![],'depth':null}));_0x32447f(_0xcf01('0x11'));}else if(!_0x971fc8){logger[_0xcf01('0xf')](_0xcf01('0x12'),_0x488f37);_0x32447f(_0xcf01('0x11'));}else{_0x1d29f6(_0x971fc8);}});}catch(_0x26d291){_0x32447f(_0x26d291);}});}function ActiveDirectoryAuthenticate(_0x1716a5,_0x211ccb,_0x3a802b,_0xb8ff1f){var _0x46645d,_0x299858;if(!isActiveDirectoryConfigured(config)){logger['error'](_0xcf01('0x13'),_0x211ccb);return _0xb8ff1f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0xcf01('0x14')][_0xcf01('0x15')]({'where':{'id':0x1},'attributes':[_0xcf01('0x16'),_0xcf01('0x17')],'raw':!![]})[_0xcf01('0x18')](function(_0x126df5){_0x46645d=_0x126df5;if(!_0x46645d[_0xcf01('0x16')]){logger[_0xcf01('0xf')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x211ccb);throw new Error(_0xcf01('0x11'));}return _0x1716a5['findOne']({'attributes':['id',_0xcf01('0x19'),_0xcf01('0x1a'),_0xcf01('0x1b'),_0xcf01('0x1c'),_0xcf01('0x1d'),_0xcf01('0x1e'),_0xcf01('0x1f'),_0xcf01('0x20')],'where':{'name':_0x211ccb,'role':{'$or':[_0xcf01('0x21'),_0xcf01('0x22'),_0xcf01('0x23')]},'adSsoEnabled':!![]}});})[_0xcf01('0x18')](function(_0x3bfa95){if(!_0x3bfa95||_0x3bfa95&&_0x3bfa95[_0xcf01('0x19')]!==_0x211ccb){throw new Error(_0xcf01('0x11'));}_0x299858=_0x3bfa95;var _0x102cb3=_0x299858['name']+'@'+config['activedirectory'][_0xcf01('0xd')];return adAuthenticate(config[_0xcf01('0xa')],_0x102cb3,_0x3a802b);})[_0xcf01('0x18')](function(_0x26f6a6){if(_0x299858[_0xcf01('0x1d')]){throw new Error(_0xcf01('0x11'));}if(_0x46645d['blockDuration']>0x0){if(_0x299858[_0xcf01('0x1e')]){if(moment(_0x299858[_0xcf01('0x1f')])[_0xcf01('0x24')](_0x46645d['blockDuration'],_0xcf01('0x25'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0xcf01('0x26')](_0x299858,0x0,![],null)[_0xcf01('0x18')](function(){return utils[_0xcf01('0x27')](_0x299858);})[_0xcf01('0x18')](function(){return _0xb8ff1f(null,_0x299858);});}else{return utils['getLicense'](_0x299858)[_0xcf01('0x18')](function(){return _0xb8ff1f(null,_0x299858);});}}else{return utils[_0xcf01('0x27')](_0x299858)['then'](function(){return _0xb8ff1f(null,_0x299858);});}})['catch'](function(_0x445829){return _0xb8ff1f(null,![],_0x445829);});}function handleError(_0x4f469d,_0x1c4674,_0x478a5e){return _0x4f469d['status'](_0x1c4674||0x1f4)[_0xcf01('0x28')]({'message':_0x478a5e?_0x478a5e[_0xcf01('0x29')]||_0x478a5e:''});}exports['login']=function(_0x52f325,_0x54fe17,_0x3c3ac7){passport[_0xcf01('0xe')](_0xcf01('0x2a'),function(_0x5dfc55,_0x5b038c,_0x4e89a0){var _0x18de51=_0x5dfc55||_0x4e89a0;if(_0x18de51){return handleError(_0x54fe17,0x191,_0x18de51);}if(!_0x5b038c){return handleError(_0x54fe17,0x194,{'message':_0xcf01('0x2b')});}else{var _0x5be626={'payload':{'id':_0x5b038c['id'],'role':_0x5b038c['role']},'options':{'expiresIn':0x15180}};return authService[_0xcf01('0x2c')](_0x5be626)[_0xcf01('0x18')](function(_0x548d0b){_0x54fe17[_0xcf01('0x2d')]({'id':_0x5b038c['id'],'token':_0x548d0b,'statusCall':'','isAlreadyLogged':_0x5b038c['online']});});}})(_0x52f325,_0x54fe17,_0x3c3ac7);};passport[_0xcf01('0x2e')](_0xcf01('0x2a'),new LocalStrategy({'usernameField':_0xcf01('0x19'),'passwordField':'password'},function(_0x3ae696,_0x12586c,_0x29b916){return ActiveDirectoryAuthenticate(db[_0xcf01('0x2f')],_0x3ae696,_0x12586c,_0x29b916);}));
\ No newline at end of file
+var _0x38d4=['blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','blocked','blockedAt','online','admin','user','agent','disabled','add','clearBlockUser','getLicense','catch','status','send','message','login','ad-login','signToken','use','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','api','activedirectory','baseDN','url','domain','authenticate','error','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0x38d4,0x178));var _0x438d=function(_0x8e8855,_0x41a083){_0x8e8855=_0x8e8855-0x0;var _0x251c78=_0x38d4[_0x8e8855];return _0x251c78;};'use strict';var passport=require(_0x438d('0x0'));var LocalStrategy=require(_0x438d('0x1'))[_0x438d('0x2')];var moment=require(_0x438d('0x3'));var ActiveDirectory=require(_0x438d('0x4'));var BPromise=require(_0x438d('0x5'));var util=require(_0x438d('0x6'));var db=require(_0x438d('0x7'))['db'];var authService=require(_0x438d('0x8'));var utils=require(_0x438d('0x9'));var config=require(_0x438d('0xa'));var logger=require('../../config/logger')(_0x438d('0xb'));function isActiveDirectoryConfigured(_0x2eedc7){var _0x385bda=![];if(typeof _0x2eedc7[_0x438d('0xc')]!=='undefined'){_0x385bda=_0x2eedc7[_0x438d('0xc')][_0x438d('0xd')]&&_0x2eedc7[_0x438d('0xc')][_0x438d('0xe')]&&_0x2eedc7['activedirectory'][_0x438d('0xf')];}return _0x385bda;}function adAuthenticate(_0x5defe8,_0x646a23,_0x310eb1){return new BPromise(function(_0x270ec7,_0x29b082){try{var _0x3f2170=new ActiveDirectory(_0x5defe8);_0x3f2170[_0x438d('0x10')](_0x646a23,_0x310eb1,function(_0x1ae88d,_0x1466e6){if(_0x1ae88d){logger[_0x438d('0x11')]('Error\x20authenticate\x20%s:\x20%s',_0x646a23,util[_0x438d('0x12')](_0x1ae88d,{'showHidden':![],'depth':null}));_0x29b082('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x1466e6){logger[_0x438d('0x11')](_0x438d('0x13'),_0x646a23);_0x29b082(_0x438d('0x14'));}else{_0x270ec7(_0x1466e6);}});}catch(_0x46fbad){_0x29b082(_0x46fbad);}});}function ActiveDirectoryAuthenticate(_0x32b4af,_0x33c7e5,_0xd8e448,_0x41c321){var _0x225da0,_0x4719a0;if(!isActiveDirectoryConfigured(config)){logger[_0x438d('0x11')](_0x438d('0x15'),_0x33c7e5);return _0x41c321(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x438d('0x16')][_0x438d('0x17')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x438d('0x18')],'raw':!![]})[_0x438d('0x19')](function(_0x2b80bb){_0x225da0=_0x2b80bb;if(!_0x225da0['adSsoEnabled']){logger[_0x438d('0x11')](_0x438d('0x1a'),_0x33c7e5);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x32b4af[_0x438d('0x17')]({'attributes':['id',_0x438d('0x1b'),_0x438d('0x1c'),_0x438d('0x1d'),_0x438d('0x1e'),'disabled',_0x438d('0x1f'),_0x438d('0x20'),_0x438d('0x21')],'where':{'name':_0x33c7e5,'role':{'$or':[_0x438d('0x22'),_0x438d('0x23'),_0x438d('0x24')]},'adSsoEnabled':!![]}});})[_0x438d('0x19')](function(_0x56aaee){if(!_0x56aaee||_0x56aaee&&_0x56aaee[_0x438d('0x1b')]!==_0x33c7e5){throw new Error(_0x438d('0x14'));}_0x4719a0=_0x56aaee;var _0x5a1b31=_0x4719a0[_0x438d('0x1b')]+'@'+config[_0x438d('0xc')]['domain'];return adAuthenticate(config[_0x438d('0xc')],_0x5a1b31,_0xd8e448);})[_0x438d('0x19')](function(_0x26dbc5){if(_0x4719a0[_0x438d('0x25')]){throw new Error(_0x438d('0x14'));}if(_0x225da0['blockDuration']>0x0){if(_0x4719a0[_0x438d('0x1f')]){if(moment(_0x4719a0[_0x438d('0x20')])[_0x438d('0x26')](_0x225da0[_0x438d('0x18')],'minutes')>moment()){throw new Error(_0x438d('0x14'));}return utils[_0x438d('0x27')](_0x4719a0,0x0,![],null)[_0x438d('0x19')](function(){return utils['getLicense'](_0x4719a0);})[_0x438d('0x19')](function(){return _0x41c321(null,_0x4719a0);});}else{return utils[_0x438d('0x28')](_0x4719a0)['then'](function(){return _0x41c321(null,_0x4719a0);});}}else{return utils[_0x438d('0x28')](_0x4719a0)['then'](function(){return _0x41c321(null,_0x4719a0);});}})[_0x438d('0x29')](function(_0x31d132){return _0x41c321(null,![],_0x31d132);});}function handleError(_0x9e5353,_0x5c7c5b,_0x2a8ffd){return _0x9e5353[_0x438d('0x2a')](_0x5c7c5b||0x1f4)[_0x438d('0x2b')]({'message':_0x2a8ffd?_0x2a8ffd[_0x438d('0x2c')]||_0x2a8ffd:''});}exports[_0x438d('0x2d')]=function(_0x123dd1,_0x337db2,_0x2e0a39){passport[_0x438d('0x10')](_0x438d('0x2e'),function(_0x437e14,_0x2acfc5,_0x4fff4a){var _0x42352c=_0x437e14||_0x4fff4a;if(_0x42352c){return handleError(_0x337db2,0x191,_0x42352c);}if(!_0x2acfc5){return handleError(_0x337db2,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x5977ce={'payload':{'id':_0x2acfc5['id'],'role':_0x2acfc5[_0x438d('0x1e')]},'options':{'expiresIn':0x15180}};return authService[_0x438d('0x2f')](_0x5977ce)[_0x438d('0x19')](function(_0x1ad634){_0x337db2['json']({'id':_0x2acfc5['id'],'token':_0x1ad634,'statusCall':'','isAlreadyLogged':_0x2acfc5[_0x438d('0x21')]});});}})(_0x123dd1,_0x337db2,_0x2e0a39);};passport[_0x438d('0x30')](_0x438d('0x2e'),new LocalStrategy({'usernameField':_0x438d('0x1b'),'passwordField':_0x438d('0x1c')},function(_0x32d89a,_0xb202ce,_0x3747bd){return ActiveDirectoryAuthenticate(db[_0x438d('0x31')],_0x32d89a,_0xb202ce,_0x3747bd);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 35dfa1c..f6ebfea 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 _0x09c1=['express','Router','./authActiveDirectory.controller','post','login','exports'];(function(_0x19c978,_0x451c13){var _0x1eab29=function(_0x382ac1){while(--_0x382ac1){_0x19c978['push'](_0x19c978['shift']());}};_0x1eab29(++_0x451c13);}(_0x09c1,0xa2));var _0x109c=function(_0x13ea36,_0x2805ad){_0x13ea36=_0x13ea36-0x0;var _0x312066=_0x09c1[_0x13ea36];return _0x312066;};'use strict';var express=require(_0x109c('0x0'));var router=express[_0x109c('0x1')]();var controller=require(_0x109c('0x2'));router[_0x109c('0x3')]('/',controller[_0x109c('0x4')]);module[_0x109c('0x5')]=router;
\ No newline at end of file
+var _0x0a29=['login','exports','./authActiveDirectory.controller'];(function(_0x16db8b,_0xca7d28){var _0x5ba017=function(_0x35b933){while(--_0x35b933){_0x16db8b['push'](_0x16db8b['shift']());}};_0x5ba017(++_0xca7d28);}(_0x0a29,0x12b));var _0x90a2=function(_0x510e77,_0x3bcec5){_0x510e77=_0x510e77-0x0;var _0x46702f=_0x0a29[_0x510e77];return _0x46702f;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0x90a2('0x0'));router['post']('/',controller[_0x90a2('0x1')]);module[_0x90a2('0x2')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 7697ae0..307fa13 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(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0x7a54,0x106));var _0x47a5=function(_0x303787,_0x487d30){_0x303787=_0x303787-0x0;var _0x3d5c66=_0x7a54[_0x303787];return _0x3d5c66;};'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(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x7a54,0x106));var _0x47a5=function(_0x32857c,_0x1d520d){_0x32857c=_0x32857c-0x0;var _0x2b47fc=_0x7a54[_0x32857c];return _0x2b47fc;};'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 1a1f137..e1eacbc 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 _0x846c=['exports','express','passport','Router','../user/user.controller.js','../../components/auth/service','get','callback','isMiddleware','setTokenCookie'];(function(_0x5e1765,_0xf1b6fa){var _0x1a284d=function(_0x2518bf){while(--_0x2518bf){_0x5e1765['push'](_0x5e1765['shift']());}};_0x1a284d(++_0xf1b6fa);}(_0x846c,0xf1));var _0xc846=function(_0x156af3,_0x49d4d4){_0x156af3=_0x156af3-0x0;var _0x5e818a=_0x846c[_0x156af3];return _0x5e818a;};'use strict';var express=require(_0xc846('0x0'));var passport=require(_0xc846('0x1'));var router=express[_0xc846('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0xc846('0x3'));var authService=require(_0xc846('0x4'));router['get']('/',controller['login']);router[_0xc846('0x5')]('/callback',controller[_0xc846('0x6')],authService[_0xc846('0x7')],userController['login'],authService[_0xc846('0x8')]);module[_0xc846('0x9')]=router;
\ No newline at end of file
+var _0x45a8=['/callback','callback','isMiddleware','setTokenCookie','exports','express','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login'];(function(_0x34c542,_0x220b05){var _0x5b9ec2=function(_0x51dc4f){while(--_0x51dc4f){_0x34c542['push'](_0x34c542['shift']());}};_0x5b9ec2(++_0x220b05);}(_0x45a8,0x9f));var _0x845a=function(_0x16bbf5,_0x407600){_0x16bbf5=_0x16bbf5-0x0;var _0x4c60e1=_0x45a8[_0x16bbf5];return _0x4c60e1;};'use strict';var express=require(_0x845a('0x0'));var passport=require('passport');var router=express['Router']();var controller=require(_0x845a('0x1'));var userController=require(_0x845a('0x2'));var authService=require(_0x845a('0x3'));router[_0x845a('0x4')]('/',controller[_0x845a('0x5')]);router[_0x845a('0x4')](_0x845a('0x6'),controller[_0x845a('0x7')],authService[_0x845a('0x8')],userController['login'],authService[_0x845a('0x9')]);module[_0x845a('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index be78568..0584a54 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 _0x9208=['SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','forgot','body','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordToken','Password\x20reset!','use','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','blockDuration','name','password','salt','role','disabled','blocked','blockedAt','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','then','loginAttempts','add','minutes','clearBlockUser','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','error'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x9208,0x82));var _0x8920=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9208[_0x321bb2];return _0x9c12ed;};'use strict';var util=require('util');var passport=require(_0x8920('0x0'));var LocalStrategy=require(_0x8920('0x1'))[_0x8920('0x2')];var jayson=require(_0x8920('0x3'));var _=require(_0x8920('0x4'));var rs=require(_0x8920('0x5'));var moment=require(_0x8920('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0x8920('0x7'));var utils=require(_0x8920('0x8'));var client=jayson['client'][_0x8920('0x9')]({'port':0x232b});function localAuthenticate(_0x145076,_0x46425d,_0x5da5e3,_0x9070e5){var _0x2f2bf9,_0x4283ac;return db[_0x8920('0xa')][_0x8920('0xb')]({'where':{'id':0x1},'attributes':[_0x8920('0xc'),_0x8920('0xd')],'raw':!![]})['then'](function(_0x179ab4){_0x2f2bf9=_0x179ab4;return _0x145076[_0x8920('0xb')]({'attributes':['id',_0x8920('0xe'),_0x8920('0xf'),_0x8920('0x10'),_0x8920('0x11'),_0x8920('0x12'),_0x8920('0x13'),_0x8920('0x14'),'loginAttempts'],'where':{'name':_0x46425d,'role':{'$or':[_0x8920('0x15'),_0x8920('0x16'),_0x8920('0x17')]}}});})['then'](function(_0x4a180f){if(!_0x4a180f||_0x4a180f&&_0x4a180f['name']!==_0x46425d){throw new Error(_0x8920('0x18'));}else{_0x4283ac=_0x4a180f;return _0x4283ac;}})[_0x8920('0x19')](function(){_0x4283ac['authenticate'](_0x5da5e3,function(_0xc864ba,_0x54fe31){var _0x533b02=_0x4283ac[_0x8920('0x1a')]+0x1;if(_0xc864ba){return _0x9070e5(_0xc864ba);}else if(!_0x54fe31){if(_0x4283ac[_0x8920('0x12')]){return _0x9070e5(null,![],{'message':_0x8920('0x18')});}else if(_0x2f2bf9[_0x8920('0xc')]>0x0){if(_0x4283ac[_0x8920('0x13')]){if(_0x2f2bf9[_0x8920('0xd')]>0x0){if(moment(_0x4283ac[_0x8920('0x14')])[_0x8920('0x1b')](_0x2f2bf9[_0x8920('0xd')],_0x8920('0x1c'))>moment()){return _0x9070e5(null,![],{'message':_0x8920('0x18')});}else{return utils[_0x8920('0x1d')](_0x4283ac,_0x533b02,![],null)[_0x8920('0x19')](function(){return _0x9070e5(null,![],{'message':_0x8920('0x18')});});}}else{return _0x9070e5(null,![],{'message':_0x8920('0x18')});}}else{if(_0x533b02>=_0x2f2bf9['allowedLoginAttempts']){return utils[_0x8920('0x1d')](_0x4283ac,0x0,!![],moment())[_0x8920('0x19')](function(){return _0x9070e5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x8920('0x1d')](_0x4283ac,_0x533b02,![],null)['then'](function(){return _0x9070e5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x9070e5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x4283ac[_0x8920('0x12')]){return _0x9070e5(null,![],{'message':_0x8920('0x18')});}else if(_0x2f2bf9['allowedLoginAttempts']>0x0){if(_0x4283ac[_0x8920('0x13')]){if(_0x2f2bf9[_0x8920('0xd')]>0x0){if(moment(_0x4283ac['blockedAt'])[_0x8920('0x1b')](_0x2f2bf9[_0x8920('0xd')],_0x8920('0x1c'))>moment()){return _0x9070e5(null,![],{'message':_0x8920('0x18')});}else{return utils[_0x8920('0x1d')](_0x4283ac,0x0,![],null)['then'](function(){return utils[_0x8920('0x1e')](_0x4283ac);})[_0x8920('0x19')](function(){return _0x9070e5(null,_0x4283ac);});}}else{return _0x9070e5(null,![],{'message':_0x8920('0x18')});}}else{return utils[_0x8920('0x1d')](_0x4283ac,0x0,![],null)[_0x8920('0x19')](function(){return utils[_0x8920('0x1e')](_0x4283ac);})[_0x8920('0x19')](function(){return _0x9070e5(null,_0x4283ac);})[_0x8920('0x1f')](function(_0x543c78){return _0x9070e5(null,![],_0x543c78);});}}else{if(_0x4283ac[_0x8920('0x13')]){return _0x9070e5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x8920('0x1e')](_0x4283ac)['then'](function(){return _0x9070e5(null,_0x4283ac);});}}}});})[_0x8920('0x1f')](function(_0x5aec18){return _0x9070e5(null,![],_0x5aec18);});}function sendServiceMail(_0x2ffeb6){return db[_0x8920('0x20')][_0x8920('0x21')]({'where':{'service':!![]},'attributes':['id',_0x8920('0xe'),_0x8920('0x22')],'include':[{'model':db[_0x8920('0x23')],'as':_0x8920('0x24'),'include':[{'model':db['CloudProvider'],'as':_0x8920('0x25')}]}]})[_0x8920('0x19')](function(_0x1eafa4){if(!_0x1eafa4){throw new Error(_0x8920('0x26'));}var _0x141e1f=_0x1eafa4[_0x8920('0x27')]();var _0x47a258={'account':_0x141e1f,'message':_[_0x8920('0x28')]({'from':util[_0x8920('0x29')](_0x8920('0x2a'),_0x1eafa4[_0x8920('0xe')],_0x1eafa4['email']||_0x1eafa4['Smtp'][_0x8920('0x16')])},_0x2ffeb6)};return client[_0x8920('0x2b')](_0x8920('0x2c'),_0x47a258);})[_0x8920('0x19')](function(_0x46a64a){if(_0x46a64a[_0x8920('0x2d')]){throw new Error(util[_0x8920('0x29')](_0x8920('0x2e'),_0x46a64a[_0x8920('0x2d')][_0x8920('0x2f')]||JSON[_0x8920('0x30')](_0x46a64a[_0x8920('0x2d')])));}return!![];});}function handleError(_0x27de34,_0x44a82c,_0x416e66){return _0x27de34[_0x8920('0x31')](_0x44a82c||0x1f4)[_0x8920('0x32')]({'message':_0x416e66?_0x416e66[_0x8920('0x2f')]||_0x416e66:''});}exports[_0x8920('0x33')]=function(_0x4bbff5,_0xe68154,_0x4477e1){passport[_0x8920('0x34')](_0x8920('0x35'),function(_0x47e72d,_0x318e9a,_0x44fb70){var _0x1cfbf1=_0x47e72d||_0x44fb70;if(_0x1cfbf1){return handleError(_0xe68154,0x191,_0x1cfbf1);}if(!_0x318e9a){return handleError(_0xe68154,0x194,{'message':_0x8920('0x36')});}else{var _0x47a377={'payload':{'id':_0x318e9a['id'],'role':_0x318e9a[_0x8920('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x8920('0x37')](_0x47a377)[_0x8920('0x19')](function(_0x1254bc){_0xe68154['json']({'id':_0x318e9a['id'],'token':_0x1254bc,'statusCall':'','isAlreadyLogged':_0x318e9a['online']});});}})(_0x4bbff5,_0xe68154,_0x4477e1);};exports[_0x8920('0x38')]=function(_0x41e421,_0x246d7f){if(!_0x41e421[_0x8920('0x39')][_0x8920('0x22')]){return handleError(_0x246d7f,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x133ce7=rs[_0x8920('0x3a')]();_0x41e421[_0x8920('0x39')][_0x8920('0x22')]=_0x41e421[_0x8920('0x39')][_0x8920('0x22')][_0x8920('0x3b')]()[_0x8920('0x3c')]();var _0x1fcb1b;return db[_0x8920('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0x8920('0xc'),_0x8920('0xd')],'raw':!![]})[_0x8920('0x19')](function(_0x249467){_0x1fcb1b=_0x249467;return db[_0x8920('0x3d')][_0x8920('0x21')]({'where':{'email':_0x41e421[_0x8920('0x39')]['email']}});})[_0x8920('0x19')](function(_0x2eee1a){if(!_0x2eee1a){throw new Error(_0x8920('0x3e'));}if(_0x2eee1a[_0x8920('0x12')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x2eee1a[_0x8920('0x13')]){if(moment(_0x2eee1a[_0x8920('0x14')])[_0x8920('0x1b')](_0x1fcb1b[_0x8920('0xd')],'minutes')>moment()){throw new Error(_0x8920('0x3f'));}else{_0x2eee1a['blocked']=![];_0x2eee1a[_0x8920('0x14')]=null;}}_0x2eee1a['resetPasswordToken']=_0x133ce7;_0x2eee1a[_0x8920('0x40')]=Date[_0x8920('0x41')]()+0x36ee80;return _0x2eee1a[_0x8920('0x42')]();})[_0x8920('0x19')](function(){return sendServiceMail({'to':_0x41e421[_0x8920('0x39')]['email'],'subject':_0x8920('0x43'),'text':_0x8920('0x44')+_0x8920('0x45')+_0x8920('0x46')+_0x41e421[_0x8920('0x47')][_0x8920('0x48')]+_0x8920('0x49')+_0x133ce7+'\x0a\x0a'+_0x8920('0x4a')});})[_0x8920('0x19')](function(){_0x246d7f[_0x8920('0x31')](0xc8)['send']({'message':_0x8920('0x4b')});})['catch'](function(_0x3f85f7){return handleError(_0x246d7f,0x1f4,_0x3f85f7);});};exports[_0x8920('0x4c')]=function(_0x1d4929,_0x503e33){return db[_0x8920('0x3d')]['find']({'where':{'resetPasswordToken':_0x1d4929[_0x8920('0x4d')]['token'],'resetPasswordExpires':{'$gt':Date[_0x8920('0x41')]()}}})[_0x8920('0x19')](function(_0x24de9e){if(!_0x24de9e){throw new Error(_0x8920('0x4e'));}return db[_0x8920('0xa')][_0x8920('0xb')]({'attributes':['id',_0x8920('0x4f'),_0x8920('0x50'),_0x8920('0x51')]})[_0x8920('0x19')](function(_0x21da02){if(_0x21da02['securePassword'])authService[_0x8920('0x52')](_0x1d4929[_0x8920('0x39')][_0x8920('0xf')]);if(!_0x21da02[_0x8920('0x50')]||!_0x24de9e[_0x8920('0x53')])return _0x24de9e;authService[_0x8920('0x54')](_0x1d4929[_0x8920('0x39')][_0x8920('0xf')],_0x24de9e['previousPasswords'],_0x21da02[_0x8920('0x51')]);return _0x24de9e;})[_0x8920('0x19')](function(){_0x24de9e[_0x8920('0xf')]=_0x1d4929[_0x8920('0x39')][_0x8920('0xf')];_0x24de9e[_0x8920('0x55')]=null;_0x24de9e[_0x8920('0x40')]=null;return _0x24de9e[_0x8920('0x42')]();});})[_0x8920('0x19')](function(){_0x503e33[_0x8920('0x31')](0xc8)[_0x8920('0x32')]({'message':_0x8920('0x56')});})[_0x8920('0x1f')](function(_0x2a1f1f){return handleError(_0x503e33,0x1f4,_0x2a1f1f);});};passport[_0x8920('0x57')](_0x8920('0x35'),new LocalStrategy({'usernameField':_0x8920('0xe'),'passwordField':_0x8920('0xf')},function(_0x382b7e,_0x40dac7,_0x4dcfff){return localAuthenticate(db[_0x8920('0x3d')],_0x382b7e,_0x40dac7,_0x4dcfff);}));
\ No newline at end of file
+var _0xeb33=['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','send','Reset\x20Email\x20sent!','reset','params','token','passwordHistoryLimit','securePassword','validatePasswordPattern','password','enforcePasswordHistory','previousPasswords','validatePasswordHistory','Password\x20reset!','local-login','util','passport','passport-local','jayson/promise','lodash','moment','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','name','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','agent','then','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','\x22%s\x22\x20<%s>','request','message','stringify','error','status','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','forgot','Email\x20parameter\x20is\x20missing','generate','body','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'];(function(_0xf22003,_0x4daaad){var _0x1af727=function(_0x99db67){while(--_0x99db67){_0xf22003['push'](_0xf22003['shift']());}};_0x1af727(++_0x4daaad);}(_0xeb33,0xb4));var _0x3eb3=function(_0x1585a3,_0x315848){_0x1585a3=_0x1585a3-0x0;var _0x2fc3aa=_0xeb33[_0x1585a3];return _0x2fc3aa;};'use strict';var util=require(_0x3eb3('0x0'));var passport=require(_0x3eb3('0x1'));var LocalStrategy=require(_0x3eb3('0x2'))['Strategy'];var jayson=require(_0x3eb3('0x3'));var _=require(_0x3eb3('0x4'));var rs=require('randomstring');var moment=require(_0x3eb3('0x5'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var client=jayson[_0x3eb3('0x6')][_0x3eb3('0x7')]({'port':0x232b});function localAuthenticate(_0x1e359b,_0x2864c9,_0x4386ad,_0x556cfa){var _0xf46557,_0x2702e5;return db[_0x3eb3('0x8')][_0x3eb3('0x9')]({'where':{'id':0x1},'attributes':[_0x3eb3('0xa'),_0x3eb3('0xb')],'raw':!![]})['then'](function(_0x2c1aaa){_0xf46557=_0x2c1aaa;return _0x1e359b['findOne']({'attributes':['id',_0x3eb3('0xc'),'password',_0x3eb3('0xd'),_0x3eb3('0xe'),_0x3eb3('0xf'),_0x3eb3('0x10'),_0x3eb3('0x11'),_0x3eb3('0x12')],'where':{'name':_0x2864c9,'role':{'$or':[_0x3eb3('0x13'),'user',_0x3eb3('0x14')]}}});})[_0x3eb3('0x15')](function(_0x516154){if(!_0x516154||_0x516154&&_0x516154[_0x3eb3('0xc')]!==_0x2864c9){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x2702e5=_0x516154;return _0x2702e5;}})[_0x3eb3('0x15')](function(){_0x2702e5[_0x3eb3('0x16')](_0x4386ad,function(_0x5dac93,_0xbdbf78){var _0x2b280b=_0x2702e5['loginAttempts']+0x1;if(_0x5dac93){return _0x556cfa(_0x5dac93);}else if(!_0xbdbf78){if(_0x2702e5[_0x3eb3('0xf')]){return _0x556cfa(null,![],{'message':_0x3eb3('0x17')});}else if(_0xf46557[_0x3eb3('0xa')]>0x0){if(_0x2702e5[_0x3eb3('0x10')]){if(_0xf46557[_0x3eb3('0xb')]>0x0){if(moment(_0x2702e5[_0x3eb3('0x11')])[_0x3eb3('0x18')](_0xf46557[_0x3eb3('0xb')],_0x3eb3('0x19'))>moment()){return _0x556cfa(null,![],{'message':_0x3eb3('0x17')});}else{return utils[_0x3eb3('0x1a')](_0x2702e5,_0x2b280b,![],null)[_0x3eb3('0x15')](function(){return _0x556cfa(null,![],{'message':_0x3eb3('0x17')});});}}else{return _0x556cfa(null,![],{'message':_0x3eb3('0x17')});}}else{if(_0x2b280b>=_0xf46557[_0x3eb3('0xa')]){return utils[_0x3eb3('0x1a')](_0x2702e5,0x0,!![],moment())[_0x3eb3('0x15')](function(){return _0x556cfa(null,![],{'message':_0x3eb3('0x17')});});}else{return utils['clearBlockUser'](_0x2702e5,_0x2b280b,![],null)[_0x3eb3('0x15')](function(){return _0x556cfa(null,![],{'message':_0x3eb3('0x17')});});}}}else{return _0x556cfa(null,![],{'message':_0x3eb3('0x17')});}}else{if(_0x2702e5[_0x3eb3('0xf')]){return _0x556cfa(null,![],{'message':_0x3eb3('0x17')});}else if(_0xf46557[_0x3eb3('0xa')]>0x0){if(_0x2702e5[_0x3eb3('0x10')]){if(_0xf46557[_0x3eb3('0xb')]>0x0){if(moment(_0x2702e5['blockedAt'])[_0x3eb3('0x18')](_0xf46557[_0x3eb3('0xb')],_0x3eb3('0x19'))>moment()){return _0x556cfa(null,![],{'message':_0x3eb3('0x17')});}else{return utils[_0x3eb3('0x1a')](_0x2702e5,0x0,![],null)[_0x3eb3('0x15')](function(){return utils[_0x3eb3('0x1b')](_0x2702e5);})[_0x3eb3('0x15')](function(){return _0x556cfa(null,_0x2702e5);});}}else{return _0x556cfa(null,![],{'message':_0x3eb3('0x17')});}}else{return utils[_0x3eb3('0x1a')](_0x2702e5,0x0,![],null)[_0x3eb3('0x15')](function(){return utils[_0x3eb3('0x1b')](_0x2702e5);})[_0x3eb3('0x15')](function(){return _0x556cfa(null,_0x2702e5);})[_0x3eb3('0x1c')](function(_0x5ddbbe){return _0x556cfa(null,![],_0x5ddbbe);});}}else{if(_0x2702e5[_0x3eb3('0x10')]){return _0x556cfa(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x3eb3('0x1b')](_0x2702e5)[_0x3eb3('0x15')](function(){return _0x556cfa(null,_0x2702e5);});}}}});})[_0x3eb3('0x1c')](function(_0x107265){return _0x556cfa(null,![],_0x107265);});}function sendServiceMail(_0x17ab7b){return db[_0x3eb3('0x1d')][_0x3eb3('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x3eb3('0xc'),_0x3eb3('0x1f')],'include':[{'model':db[_0x3eb3('0x20')],'as':_0x3eb3('0x21'),'include':[{'model':db[_0x3eb3('0x22')],'as':'CloudProvider'}]}]})['then'](function(_0x324c8a){if(!_0x324c8a){throw new Error(_0x3eb3('0x23'));}var _0x555fce=_0x324c8a['getSmtpOptions']();var _0x799a17={'account':_0x555fce,'message':_[_0x3eb3('0x24')]({'from':util[_0x3eb3('0x25')](_0x3eb3('0x26'),_0x324c8a[_0x3eb3('0xc')],_0x324c8a['email']||_0x324c8a[_0x3eb3('0x21')]['user'])},_0x17ab7b)};return client[_0x3eb3('0x27')]('SendMail',_0x799a17);})[_0x3eb3('0x15')](function(_0x5b455c){if(_0x5b455c['error']){throw new Error(util[_0x3eb3('0x25')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x5b455c['error'][_0x3eb3('0x28')]||JSON[_0x3eb3('0x29')](_0x5b455c[_0x3eb3('0x2a')])));}return!![];});}function handleError(_0x2cb51b,_0xd81f5a,_0x2534d0){return _0x2cb51b[_0x3eb3('0x2b')](_0xd81f5a||0x1f4)['send']({'message':_0x2534d0?_0x2534d0['message']||_0x2534d0:''});}exports[_0x3eb3('0x2c')]=function(_0x27c652,_0x761dde,_0x51550c){passport[_0x3eb3('0x16')]('local-login',function(_0x109e90,_0x2c3520,_0x14ad59){var _0x31f000=_0x109e90||_0x14ad59;if(_0x31f000){return handleError(_0x761dde,0x191,_0x31f000);}if(!_0x2c3520){return handleError(_0x761dde,0x194,{'message':_0x3eb3('0x2d')});}else{var _0x214453={'payload':{'id':_0x2c3520['id'],'role':_0x2c3520[_0x3eb3('0xe')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x214453)[_0x3eb3('0x15')](function(_0x108907){_0x761dde[_0x3eb3('0x2e')]({'id':_0x2c3520['id'],'token':_0x108907,'statusCall':'','isAlreadyLogged':_0x2c3520['online']});});}})(_0x27c652,_0x761dde,_0x51550c);};exports[_0x3eb3('0x2f')]=function(_0x4e872a,_0x1b4abb){if(!_0x4e872a['body'][_0x3eb3('0x1f')]){return handleError(_0x1b4abb,0x1f4,{'message':_0x3eb3('0x30')});}var _0x239f62=rs[_0x3eb3('0x31')]();_0x4e872a[_0x3eb3('0x32')][_0x3eb3('0x1f')]=_0x4e872a['body']['email']['trim']()[_0x3eb3('0x33')]();var _0x42b68c;return db[_0x3eb3('0x8')][_0x3eb3('0x9')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x3eb3('0xb')],'raw':!![]})[_0x3eb3('0x15')](function(_0x401357){_0x42b68c=_0x401357;return db[_0x3eb3('0x34')]['find']({'where':{'email':_0x4e872a[_0x3eb3('0x32')][_0x3eb3('0x1f')]}});})[_0x3eb3('0x15')](function(_0x49a2f4){if(!_0x49a2f4){throw new Error(_0x3eb3('0x35'));}if(_0x49a2f4['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x49a2f4[_0x3eb3('0x10')]){if(moment(_0x49a2f4[_0x3eb3('0x11')])['add'](_0x42b68c[_0x3eb3('0xb')],_0x3eb3('0x19'))>moment()){throw new Error(_0x3eb3('0x36'));}else{_0x49a2f4[_0x3eb3('0x10')]=![];_0x49a2f4[_0x3eb3('0x11')]=null;}}_0x49a2f4[_0x3eb3('0x37')]=_0x239f62;_0x49a2f4[_0x3eb3('0x38')]=Date['now']()+0x36ee80;return _0x49a2f4[_0x3eb3('0x39')]();})[_0x3eb3('0x15')](function(){return sendServiceMail({'to':_0x4e872a[_0x3eb3('0x32')][_0x3eb3('0x1f')],'subject':_0x3eb3('0x3a'),'text':_0x3eb3('0x3b')+_0x3eb3('0x3c')+_0x3eb3('0x3d')+_0x4e872a[_0x3eb3('0x3e')][_0x3eb3('0x3f')]+_0x3eb3('0x40')+_0x239f62+'\x0a\x0a'+_0x3eb3('0x41')});})[_0x3eb3('0x15')](function(){_0x1b4abb[_0x3eb3('0x2b')](0xc8)[_0x3eb3('0x42')]({'message':_0x3eb3('0x43')});})['catch'](function(_0x2478a8){return handleError(_0x1b4abb,0x1f4,_0x2478a8);});};exports[_0x3eb3('0x44')]=function(_0x49e0f8,_0x459707){return db[_0x3eb3('0x34')][_0x3eb3('0x1e')]({'where':{'resetPasswordToken':_0x49e0f8[_0x3eb3('0x45')][_0x3eb3('0x46')],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x2075f4){if(!_0x2075f4){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting']['findOne']({'attributes':['id','securePassword','enforcePasswordHistory',_0x3eb3('0x47')]})[_0x3eb3('0x15')](function(_0x216903){if(_0x216903[_0x3eb3('0x48')])authService[_0x3eb3('0x49')](_0x49e0f8[_0x3eb3('0x32')][_0x3eb3('0x4a')]);if(!_0x216903[_0x3eb3('0x4b')]||!_0x2075f4[_0x3eb3('0x4c')])return _0x2075f4;authService[_0x3eb3('0x4d')](_0x49e0f8[_0x3eb3('0x32')]['password'],_0x2075f4[_0x3eb3('0x4c')],_0x216903[_0x3eb3('0x47')]);return _0x2075f4;})[_0x3eb3('0x15')](function(){_0x2075f4[_0x3eb3('0x4a')]=_0x49e0f8[_0x3eb3('0x32')][_0x3eb3('0x4a')];_0x2075f4['resetPasswordToken']=null;_0x2075f4[_0x3eb3('0x38')]=null;return _0x2075f4[_0x3eb3('0x39')]();});})['then'](function(){_0x459707[_0x3eb3('0x2b')](0xc8)[_0x3eb3('0x42')]({'message':_0x3eb3('0x4e')});})['catch'](function(_0x38a022){return handleError(_0x459707,0x1f4,_0x38a022);});};passport['use'](_0x3eb3('0x4f'),new LocalStrategy({'usernameField':'name','passwordField':_0x3eb3('0x4a')},function(_0x357c74,_0x14f9e7,_0x1f4a9d){return localAuthenticate(db[_0x3eb3('0x34')],_0x357c74,_0x14f9e7,_0x1f4a9d);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 92df2b2..e5626ac 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 _0xf9b2=['./authLocal.controller','post','login','/forgot','forgot','/reset/:token','reset','exports','express','Router'];(function(_0xdb2e3c,_0x2f4644){var _0x55e38d=function(_0x46ed7b){while(--_0x46ed7b){_0xdb2e3c['push'](_0xdb2e3c['shift']());}};_0x55e38d(++_0x2f4644);}(_0xf9b2,0x198));var _0x2f9b=function(_0x27c754,_0x488254){_0x27c754=_0x27c754-0x0;var _0x245d47=_0xf9b2[_0x27c754];return _0x245d47;};'use strict';var express=require(_0x2f9b('0x0'));var router=express[_0x2f9b('0x1')]();var controller=require(_0x2f9b('0x2'));router[_0x2f9b('0x3')]('/',controller[_0x2f9b('0x4')]);router[_0x2f9b('0x3')](_0x2f9b('0x5'),controller[_0x2f9b('0x6')]);router['post'](_0x2f9b('0x7'),controller[_0x2f9b('0x8')]);module[_0x2f9b('0x9')]=router;
\ No newline at end of file
+var _0x4f9d=['post','login','forgot','reset','exports','Router'];(function(_0x641900,_0x346ff0){var _0x1e2277=function(_0x27a3f6){while(--_0x27a3f6){_0x641900['push'](_0x641900['shift']());}};_0x1e2277(++_0x346ff0);}(_0x4f9d,0xef));var _0xd4f9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4f9d[_0x14add3];return _0x4a174f;};'use strict';var express=require('express');var router=express[_0xd4f9('0x0')]();var controller=require('./authLocal.controller');router[_0xd4f9('0x1')]('/',controller[_0xd4f9('0x2')]);router[_0xd4f9('0x1')]('/forgot',controller[_0xd4f9('0x3')]);router['post']('/reset/:token',controller[_0xd4f9('0x4')]);module[_0xd4f9('0x5')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 33cb5e3..80d1a4d 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 _0x8cbd=['BOOLEAN','sequelize'];(function(_0x4f1896,_0xb74faa){var _0x188cc3=function(_0x3e6b2b){while(--_0x3e6b2b){_0x4f1896['push'](_0x4f1896['shift']());}};_0x188cc3(++_0xb74faa);}(_0x8cbd,0x1bb));var _0xd8cb=function(_0x22490e,_0x4935bd){_0x22490e=_0x22490e-0x0;var _0x5b6459=_0x8cbd[_0x22490e];return _0x5b6459;};'use strict';var Sequelize=require(_0xd8cb('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xd8cb('0x1')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0x1fde=['BOOLEAN','sequelize','exports','STRING'];(function(_0x142020,_0x1f7233){var _0x40da8f=function(_0x17f0a3){while(--_0x17f0a3){_0x142020['push'](_0x142020['shift']());}};_0x40da8f(++_0x1f7233);}(_0x1fde,0x1a1));var _0xe1fd=function(_0xa45395,_0x5579e6){_0xa45395=_0xa45395-0x0;var _0x3c83d2=_0x1fde[_0xa45395];return _0x3c83d2;};'use strict';var Sequelize=require(_0xe1fd('0x0'));module[_0xe1fd('0x1')]={'name':{'type':Sequelize[_0xe1fd('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xe1fd('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xe1fd('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 7eda47f..536477a 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 _0x7a69=['moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','name','map','rawAttributes','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','Automation','include','catch','show','params','includeAll','find','create','body','addConditions','Condition','ids','getConditions','findOne','nolimit','addActions','Action','getActions','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x2f0178,_0x5f4f55){var _0x3db154=function(_0x4a12fe){while(--_0x4a12fe){_0x2f0178['push'](_0x2f0178['shift']());}};_0x3db154(++_0x5f4f55);}(_0x7a69,0x12c));var _0x97a6=function(_0x32db71,_0x324324){_0x32db71=_0x32db71-0x0;var _0x31db74=_0x7a69[_0x32db71];return _0x31db74;};'use strict';var emlformat=require(_0x97a6('0x0'));var rimraf=require(_0x97a6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x97a6('0x2'));var rp=require(_0x97a6('0x3'));var moment=require(_0x97a6('0x4'));var BPromise=require(_0x97a6('0x5'));var Mustache=require(_0x97a6('0x6'));var util=require(_0x97a6('0x7'));var path=require('path');var sox=require(_0x97a6('0x8'));var csv=require(_0x97a6('0x9'));var ejs=require(_0x97a6('0xa'));var fs=require('fs');var fs_extra=require(_0x97a6('0xb'));var _=require(_0x97a6('0xc'));var squel=require(_0x97a6('0xd'));var crypto=require('crypto');var jsforce=require(_0x97a6('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x97a6('0xf'));var Papa=require(_0x97a6('0x10'));var Redis=require('ioredis');var authService=require(_0x97a6('0x11'));var qs=require(_0x97a6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x97a6('0x13'))('api');var utils=require(_0x97a6('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x97a6('0x15'))['db'];function respondWithStatusCode(_0x5f0076,_0x1f1950){_0x1f1950=_0x1f1950||0xcc;return function(_0x141b0f){if(_0x141b0f){return _0x5f0076[_0x97a6('0x16')](_0x1f1950);}return _0x5f0076[_0x97a6('0x17')](_0x1f1950)[_0x97a6('0x18')]();};}function respondWithResult(_0x46ed2d,_0x3e63c4){_0x3e63c4=_0x3e63c4||0xc8;return function(_0x54d77e){if(_0x54d77e){return _0x46ed2d[_0x97a6('0x17')](_0x3e63c4)[_0x97a6('0x19')](_0x54d77e);}};}function respondWithFilteredResult(_0x29b0c3,_0x9d2d4){return function(_0x1b1384){if(_0x1b1384){var _0x3dbff8=typeof _0x9d2d4[_0x97a6('0x1a')]===_0x97a6('0x1b')&&typeof _0x9d2d4[_0x97a6('0x1c')]===_0x97a6('0x1b');var _0x7b2fe8=_0x1b1384[_0x97a6('0x1d')];var _0x45c20e=_0x3dbff8?0x0:_0x9d2d4[_0x97a6('0x1a')];var _0x2efff9=_0x3dbff8?_0x1b1384[_0x97a6('0x1d')]:_0x9d2d4[_0x97a6('0x1a')]+_0x9d2d4[_0x97a6('0x1c')];var _0x1e9d14;if(_0x2efff9>=_0x7b2fe8){_0x2efff9=_0x7b2fe8;_0x1e9d14=0xc8;}else{_0x1e9d14=0xce;}_0x29b0c3[_0x97a6('0x17')](_0x1e9d14);return _0x29b0c3['set'](_0x97a6('0x1e'),_0x45c20e+'-'+_0x2efff9+'/'+_0x7b2fe8)[_0x97a6('0x19')](_0x1b1384);}return null;};}function patchUpdates(_0x3e2ab1){return function(_0x819baa){try{jsonpatch['apply'](_0x819baa,_0x3e2ab1,!![]);}catch(_0x3befbd){return BPromise[_0x97a6('0x1f')](_0x3befbd);}return _0x819baa[_0x97a6('0x20')]();};}function saveUpdates(_0x6d180,_0x34a5dd){return function(_0x1ca1ad){if(_0x1ca1ad){return _0x1ca1ad[_0x97a6('0x21')](_0x6d180)[_0x97a6('0x22')](function(_0x59b347){return _0x59b347;});}return null;};}function removeEntity(_0x314d6d,_0xda253c){return function(_0x11a8b6){if(_0x11a8b6){return _0x11a8b6[_0x97a6('0x23')]()[_0x97a6('0x22')](function(){_0x314d6d['status'](0xcc)[_0x97a6('0x18')]();});}};}function handleEntityNotFound(_0x41c075,_0x43ac58){return function(_0x4a8b1b){if(!_0x4a8b1b){_0x41c075['sendStatus'](0x194);}return _0x4a8b1b;};}function handleError(_0x518c86,_0x36ca24){_0x36ca24=_0x36ca24||0x1f4;return function(_0x4a009e){logger[_0x97a6('0x24')](_0x4a009e['stack']);if(_0x4a009e[_0x97a6('0x25')]){delete _0x4a009e[_0x97a6('0x25')];}_0x518c86[_0x97a6('0x17')](_0x36ca24)['send'](_0x4a009e);};}exports['index']=function(_0x1ed70f,_0x2caf76){var _0x2bf807={},_0x430eae={},_0x141a66={'count':0x0,'rows':[]};var _0x2ef46c=_[_0x97a6('0x26')](db['Automation'][_0x97a6('0x27')],function(_0x2dd0cc){return{'name':_0x2dd0cc['fieldName'],'type':_0x2dd0cc['type']['key']};});_0x430eae['model']=_['map'](_0x2ef46c,_0x97a6('0x25'));_0x430eae[_0x97a6('0x28')]=_[_0x97a6('0x29')](_0x1ed70f['query']);_0x430eae['filters']=_[_0x97a6('0x2a')](_0x430eae['model'],_0x430eae[_0x97a6('0x28')]);_0x2bf807[_0x97a6('0x2b')]=_[_0x97a6('0x2a')](_0x430eae['model'],qs[_0x97a6('0x2c')](_0x1ed70f['query'][_0x97a6('0x2c')]));_0x2bf807[_0x97a6('0x2b')]=_0x2bf807[_0x97a6('0x2b')][_0x97a6('0x2d')]?_0x2bf807[_0x97a6('0x2b')]:_0x430eae[_0x97a6('0x2e')];if(!_0x1ed70f['query'][_0x97a6('0x2f')]('nolimit')){_0x2bf807[_0x97a6('0x1c')]=qs['limit'](_0x1ed70f[_0x97a6('0x28')][_0x97a6('0x1c')]);_0x2bf807[_0x97a6('0x1a')]=qs[_0x97a6('0x1a')](_0x1ed70f['query'][_0x97a6('0x1a')]);}_0x2bf807[_0x97a6('0x30')]=qs[_0x97a6('0x31')](_0x1ed70f['query'][_0x97a6('0x31')]);_0x2bf807[_0x97a6('0x32')]=qs[_0x97a6('0x33')](_[_0x97a6('0x34')](_0x1ed70f[_0x97a6('0x28')],_0x430eae[_0x97a6('0x33')]),_0x2ef46c);if(_0x1ed70f[_0x97a6('0x28')][_0x97a6('0x35')]){_0x2bf807['where']=_[_0x97a6('0x36')](_0x2bf807['where'],{'$or':_['map'](_0x2ef46c,function(_0x3bc8fc){if(_0x3bc8fc[_0x97a6('0x37')]!==_0x97a6('0x38')){var _0x1faab8={};_0x1faab8[_0x3bc8fc[_0x97a6('0x25')]]={'$like':'%'+_0x1ed70f[_0x97a6('0x28')][_0x97a6('0x35')]+'%'};return _0x1faab8;}})});}_0x2bf807=_[_0x97a6('0x36')]({},_0x2bf807,_0x1ed70f[_0x97a6('0x39')]);var _0xc410a2={'where':_0x2bf807[_0x97a6('0x32')]};return db[_0x97a6('0x3a')]['count'](_0xc410a2)[_0x97a6('0x22')](function(_0x2f2c47){_0x141a66['count']=_0x2f2c47;if(_0x1ed70f[_0x97a6('0x28')]['includeAll']){_0x2bf807[_0x97a6('0x3b')]=[{'all':!![]}];}return db[_0x97a6('0x3a')]['findAll'](_0x2bf807);})['then'](function(_0x216c8c){_0x141a66['rows']=_0x216c8c;return _0x141a66;})['then'](respondWithFilteredResult(_0x2caf76,_0x2bf807))[_0x97a6('0x3c')](handleError(_0x2caf76,null));};exports[_0x97a6('0x3d')]=function(_0x2d8aaf,_0x11b99a){var _0x2bf992={'raw':![],'where':{'id':_0x2d8aaf[_0x97a6('0x3e')]['id']}},_0x383256={};_0x383256[_0x97a6('0x2e')]=_[_0x97a6('0x29')](db[_0x97a6('0x3a')][_0x97a6('0x27')]);_0x383256[_0x97a6('0x28')]=_[_0x97a6('0x29')](_0x2d8aaf[_0x97a6('0x28')]);_0x383256[_0x97a6('0x33')]=_[_0x97a6('0x2a')](_0x383256['model'],_0x383256[_0x97a6('0x28')]);_0x2bf992['attributes']=_['intersection'](_0x383256[_0x97a6('0x2e')],qs[_0x97a6('0x2c')](_0x2d8aaf['query']['fields']));_0x2bf992[_0x97a6('0x2b')]=_0x2bf992[_0x97a6('0x2b')][_0x97a6('0x2d')]?_0x2bf992[_0x97a6('0x2b')]:_0x383256['model'];if(_0x2d8aaf[_0x97a6('0x28')][_0x97a6('0x3f')]){_0x2bf992[_0x97a6('0x3b')]=[{'all':!![]}];}_0x2bf992=_[_0x97a6('0x36')]({},_0x2bf992,_0x2d8aaf[_0x97a6('0x39')]);return db[_0x97a6('0x3a')][_0x97a6('0x40')](_0x2bf992)['then'](handleEntityNotFound(_0x11b99a,null))[_0x97a6('0x22')](respondWithResult(_0x11b99a,null))['catch'](handleError(_0x11b99a,null));};exports[_0x97a6('0x41')]=function(_0x108423,_0x5e2a87){return db[_0x97a6('0x3a')][_0x97a6('0x41')](_0x108423[_0x97a6('0x42')],{})[_0x97a6('0x22')](respondWithResult(_0x5e2a87,0xc9))['catch'](handleError(_0x5e2a87,null));};exports[_0x97a6('0x21')]=function(_0x2f2341,_0x2268f3){if(_0x2f2341['body']['id']){delete _0x2f2341['body']['id'];}return db[_0x97a6('0x3a')][_0x97a6('0x40')]({'where':{'id':_0x2f2341['params']['id']}})[_0x97a6('0x22')](handleEntityNotFound(_0x2268f3,null))[_0x97a6('0x22')](saveUpdates(_0x2f2341['body'],null))['then'](respondWithResult(_0x2268f3,null))[_0x97a6('0x3c')](handleError(_0x2268f3,null));};exports[_0x97a6('0x23')]=function(_0x13233e,_0xb811ed){return db[_0x97a6('0x3a')][_0x97a6('0x40')]({'where':{'id':_0x13233e['params']['id']}})[_0x97a6('0x22')](handleEntityNotFound(_0xb811ed,null))['then'](removeEntity(_0xb811ed,null))[_0x97a6('0x3c')](handleError(_0xb811ed,null));};exports[_0x97a6('0x43')]=function(_0x3634cf,_0x5b35b7,_0x9603bb){return db[_0x97a6('0x44')][_0x97a6('0x40')]({'where':{'id':_0x3634cf['params']['id']}})['then'](handleEntityNotFound(_0x5b35b7,null))[_0x97a6('0x22')](function(_0x5007db){if(_0x5007db){return _0x5007db[_0x97a6('0x43')](_0x3634cf[_0x97a6('0x42')][_0x97a6('0x45')],_['omit'](_0x3634cf[_0x97a6('0x42')],[_0x97a6('0x45'),'id'])||{});}})[_0x97a6('0x22')](respondWithResult(_0x5b35b7,null))[_0x97a6('0x3c')](handleError(_0x5b35b7,null));};exports[_0x97a6('0x46')]=function(_0x518b17,_0x33e9fe,_0x3ea6af){var _0x3be90c={};var _0x42e4a9={};var _0x116d50;var _0x4b7d51;return db['Automation'][_0x97a6('0x47')]({'where':{'id':_0x518b17[_0x97a6('0x3e')]['id']}})['then'](handleEntityNotFound(_0x33e9fe,null))[_0x97a6('0x22')](function(_0x460020){if(_0x460020){_0x116d50=_0x460020;_0x42e4a9[_0x97a6('0x2e')]=_[_0x97a6('0x29')](db[_0x97a6('0x44')][_0x97a6('0x27')]);_0x42e4a9[_0x97a6('0x28')]=_[_0x97a6('0x29')](_0x518b17[_0x97a6('0x28')]);_0x42e4a9[_0x97a6('0x33')]=_[_0x97a6('0x2a')](_0x42e4a9[_0x97a6('0x2e')],_0x42e4a9[_0x97a6('0x28')]);_0x3be90c[_0x97a6('0x2b')]=_['intersection'](_0x42e4a9[_0x97a6('0x2e')],qs[_0x97a6('0x2c')](_0x518b17[_0x97a6('0x28')]['fields']));_0x3be90c['attributes']=_0x3be90c[_0x97a6('0x2b')][_0x97a6('0x2d')]?_0x3be90c[_0x97a6('0x2b')]:_0x42e4a9['model'];_0x3be90c[_0x97a6('0x30')]=qs['sort'](_0x518b17[_0x97a6('0x28')][_0x97a6('0x31')]);_0x3be90c['where']=qs[_0x97a6('0x33')](_[_0x97a6('0x34')](_0x518b17['query'],_0x42e4a9[_0x97a6('0x33')]));if(_0x518b17['query'][_0x97a6('0x35')]){_0x3be90c[_0x97a6('0x32')]=_[_0x97a6('0x36')](_0x3be90c[_0x97a6('0x32')],{'$or':_[_0x97a6('0x26')](_0x3be90c[_0x97a6('0x2b')],function(_0x2225a7){var _0x4073dd={};_0x4073dd[_0x2225a7]={'$like':'%'+_0x518b17[_0x97a6('0x28')][_0x97a6('0x35')]+'%'};return _0x4073dd;})});}_0x3be90c=_[_0x97a6('0x36')]({},_0x3be90c,_0x518b17[_0x97a6('0x39')]);return _0x116d50[_0x97a6('0x46')](_0x3be90c);}})[_0x97a6('0x22')](function(_0xa94726){if(_0xa94726){_0x4b7d51=_0xa94726['length'];if(!_0x518b17['query'][_0x97a6('0x2f')](_0x97a6('0x48'))){_0x3be90c[_0x97a6('0x1c')]=qs[_0x97a6('0x1c')](_0x518b17[_0x97a6('0x28')][_0x97a6('0x1c')]);_0x3be90c[_0x97a6('0x1a')]=qs[_0x97a6('0x1a')](_0x518b17[_0x97a6('0x28')][_0x97a6('0x1a')]);}return _0x116d50[_0x97a6('0x46')](_0x3be90c);}})[_0x97a6('0x22')](function(_0x1da6a1){if(_0x1da6a1){return _0x1da6a1?{'count':_0x4b7d51,'rows':_0x1da6a1}:null;}})['then'](respondWithResult(_0x33e9fe,null))[_0x97a6('0x3c')](handleError(_0x33e9fe,null));};exports[_0x97a6('0x49')]=function(_0x4e8a3f,_0x247c88,_0x3b4615){return db[_0x97a6('0x4a')]['find']({'where':{'id':_0x4e8a3f[_0x97a6('0x3e')]['id']}})[_0x97a6('0x22')](handleEntityNotFound(_0x247c88,null))['then'](function(_0x1266b2){if(_0x1266b2){return _0x1266b2['addActions'](_0x4e8a3f['body']['ids'],_['omit'](_0x4e8a3f[_0x97a6('0x42')],[_0x97a6('0x45'),'id'])||{});}})['then'](respondWithResult(_0x247c88,null))[_0x97a6('0x3c')](handleError(_0x247c88,null));};exports[_0x97a6('0x4b')]=function(_0x24031f,_0x5cacc1,_0xe99c11){var _0x1a30fa={};var _0x4544fd={};var _0x246bfb;var _0x152fc8;return db[_0x97a6('0x3a')][_0x97a6('0x47')]({'where':{'id':_0x24031f[_0x97a6('0x3e')]['id']}})[_0x97a6('0x22')](handleEntityNotFound(_0x5cacc1,null))[_0x97a6('0x22')](function(_0x2101d8){if(_0x2101d8){_0x246bfb=_0x2101d8;_0x4544fd['model']=_[_0x97a6('0x29')](db[_0x97a6('0x4a')][_0x97a6('0x27')]);_0x4544fd[_0x97a6('0x28')]=_[_0x97a6('0x29')](_0x24031f[_0x97a6('0x28')]);_0x4544fd[_0x97a6('0x33')]=_[_0x97a6('0x2a')](_0x4544fd[_0x97a6('0x2e')],_0x4544fd[_0x97a6('0x28')]);_0x1a30fa[_0x97a6('0x2b')]=_[_0x97a6('0x2a')](_0x4544fd[_0x97a6('0x2e')],qs[_0x97a6('0x2c')](_0x24031f[_0x97a6('0x28')][_0x97a6('0x2c')]));_0x1a30fa[_0x97a6('0x2b')]=_0x1a30fa[_0x97a6('0x2b')][_0x97a6('0x2d')]?_0x1a30fa[_0x97a6('0x2b')]:_0x4544fd['model'];_0x1a30fa[_0x97a6('0x30')]=qs[_0x97a6('0x31')](_0x24031f['query'][_0x97a6('0x31')]);_0x1a30fa[_0x97a6('0x32')]=qs[_0x97a6('0x33')](_[_0x97a6('0x34')](_0x24031f[_0x97a6('0x28')],_0x4544fd[_0x97a6('0x33')]));if(_0x24031f['query'][_0x97a6('0x35')]){_0x1a30fa[_0x97a6('0x32')]=_['merge'](_0x1a30fa[_0x97a6('0x32')],{'$or':_[_0x97a6('0x26')](_0x1a30fa['attributes'],function(_0x6f6674){var _0x498ce8={};_0x498ce8[_0x6f6674]={'$like':'%'+_0x24031f[_0x97a6('0x28')]['filter']+'%'};return _0x498ce8;})});}_0x1a30fa=_[_0x97a6('0x36')]({},_0x1a30fa,_0x24031f['options']);return _0x246bfb[_0x97a6('0x4b')](_0x1a30fa);}})[_0x97a6('0x22')](function(_0x134542){if(_0x134542){_0x152fc8=_0x134542['length'];if(!_0x24031f[_0x97a6('0x28')][_0x97a6('0x2f')](_0x97a6('0x48'))){_0x1a30fa['limit']=qs[_0x97a6('0x1c')](_0x24031f[_0x97a6('0x28')][_0x97a6('0x1c')]);_0x1a30fa[_0x97a6('0x1a')]=qs[_0x97a6('0x1a')](_0x24031f['query'][_0x97a6('0x1a')]);}return _0x246bfb[_0x97a6('0x4b')](_0x1a30fa);}})[_0x97a6('0x22')](function(_0x28f3a7){if(_0x28f3a7){return _0x28f3a7?{'count':_0x152fc8,'rows':_0x28f3a7}:null;}})[_0x97a6('0x22')](respondWithResult(_0x5cacc1,null))[_0x97a6('0x3c')](handleError(_0x5cacc1,null));};
\ No newline at end of file
+var _0x78fe=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','then','include','findAll','rows','catch','show','includeAll','find','create','body','params','Condition','addConditions','ids','omit','getConditions','findOne','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','error','stack','name','index','map','Automation','rawAttributes','fieldName','type','key','query','keys','intersection','model'];(function(_0x4c3f1c,_0x30d1a5){var _0x2119b4=function(_0x122be9){while(--_0x122be9){_0x4c3f1c['push'](_0x4c3f1c['shift']());}};_0x2119b4(++_0x30d1a5);}(_0x78fe,0x1d5));var _0xe78f=function(_0x55a1a7,_0x2e49cb){_0x55a1a7=_0x55a1a7-0x0;var _0x5afc3b=_0x78fe[_0x55a1a7];return _0x5afc3b;};'use strict';var emlformat=require(_0xe78f('0x0'));var rimraf=require(_0xe78f('0x1'));var zipdir=require(_0xe78f('0x2'));var jsonpatch=require(_0xe78f('0x3'));var rp=require(_0xe78f('0x4'));var moment=require(_0xe78f('0x5'));var BPromise=require(_0xe78f('0x6'));var Mustache=require(_0xe78f('0x7'));var util=require('util');var path=require(_0xe78f('0x8'));var sox=require(_0xe78f('0x9'));var csv=require(_0xe78f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe78f('0xb'));var _=require(_0xe78f('0xc'));var squel=require(_0xe78f('0xd'));var crypto=require(_0xe78f('0xe'));var jsforce=require(_0xe78f('0xf'));var deskjs=require(_0xe78f('0x10'));var toCsv=require(_0xe78f('0xa'));var querystring=require('querystring');var Papa=require(_0xe78f('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe78f('0x12'));var as=require(_0xe78f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xe78f('0x14'));var config=require(_0xe78f('0x15'));var licenseUtil=require(_0xe78f('0x16'));var db=require(_0xe78f('0x17'))['db'];function respondWithStatusCode(_0x3b0870,_0x21db7c){_0x21db7c=_0x21db7c||0xcc;return function(_0x4d5858){if(_0x4d5858){return _0x3b0870['sendStatus'](_0x21db7c);}return _0x3b0870[_0xe78f('0x18')](_0x21db7c)[_0xe78f('0x19')]();};}function respondWithResult(_0x443358,_0x5f2863){_0x5f2863=_0x5f2863||0xc8;return function(_0x2a060d){if(_0x2a060d){return _0x443358[_0xe78f('0x18')](_0x5f2863)[_0xe78f('0x1a')](_0x2a060d);}};}function respondWithFilteredResult(_0x352066,_0x369c7e){return function(_0x35d486){if(_0x35d486){var _0x2885df=typeof _0x369c7e[_0xe78f('0x1b')]==='undefined'&&typeof _0x369c7e[_0xe78f('0x1c')]===_0xe78f('0x1d');var _0x26b910=_0x35d486[_0xe78f('0x1e')];var _0x1dfb04=_0x2885df?0x0:_0x369c7e['offset'];var _0xd04e92=_0x2885df?_0x35d486['count']:_0x369c7e['offset']+_0x369c7e[_0xe78f('0x1c')];var _0x21a535;if(_0xd04e92>=_0x26b910){_0xd04e92=_0x26b910;_0x21a535=0xc8;}else{_0x21a535=0xce;}_0x352066[_0xe78f('0x18')](_0x21a535);return _0x352066[_0xe78f('0x1f')](_0xe78f('0x20'),_0x1dfb04+'-'+_0xd04e92+'/'+_0x26b910)[_0xe78f('0x1a')](_0x35d486);}return null;};}function patchUpdates(_0x32ae9c){return function(_0x2f3fbe){try{jsonpatch[_0xe78f('0x21')](_0x2f3fbe,_0x32ae9c,!![]);}catch(_0x27fbfe){return BPromise[_0xe78f('0x22')](_0x27fbfe);}return _0x2f3fbe[_0xe78f('0x23')]();};}function saveUpdates(_0xcda31e,_0x583e82){return function(_0x1127d2){if(_0x1127d2){return _0x1127d2[_0xe78f('0x24')](_0xcda31e)['then'](function(_0x5d40c9){return _0x5d40c9;});}return null;};}function removeEntity(_0x4383f0,_0x57cb13){return function(_0x268993){if(_0x268993){return _0x268993[_0xe78f('0x25')]()['then'](function(){_0x4383f0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x426d9d,_0x19e457){return function(_0x5aeef5){if(!_0x5aeef5){_0x426d9d[_0xe78f('0x26')](0x194);}return _0x5aeef5;};}function handleError(_0x4dba42,_0x1a1adf){_0x1a1adf=_0x1a1adf||0x1f4;return function(_0x3e5973){logger[_0xe78f('0x27')](_0x3e5973[_0xe78f('0x28')]);if(_0x3e5973[_0xe78f('0x29')]){delete _0x3e5973[_0xe78f('0x29')];}_0x4dba42[_0xe78f('0x18')](_0x1a1adf)['send'](_0x3e5973);};}exports[_0xe78f('0x2a')]=function(_0x2bde4f,_0x3de5be){var _0x3c27d2={},_0x3ed756={},_0x39bc36={'count':0x0,'rows':[]};var _0x39444c=_[_0xe78f('0x2b')](db[_0xe78f('0x2c')][_0xe78f('0x2d')],function(_0x44b060){return{'name':_0x44b060[_0xe78f('0x2e')],'type':_0x44b060[_0xe78f('0x2f')][_0xe78f('0x30')]};});_0x3ed756['model']=_[_0xe78f('0x2b')](_0x39444c,'name');_0x3ed756[_0xe78f('0x31')]=_[_0xe78f('0x32')](_0x2bde4f['query']);_0x3ed756['filters']=_[_0xe78f('0x33')](_0x3ed756[_0xe78f('0x34')],_0x3ed756[_0xe78f('0x31')]);_0x3c27d2[_0xe78f('0x35')]=_[_0xe78f('0x33')](_0x3ed756[_0xe78f('0x34')],qs[_0xe78f('0x36')](_0x2bde4f[_0xe78f('0x31')]['fields']));_0x3c27d2[_0xe78f('0x35')]=_0x3c27d2['attributes'][_0xe78f('0x37')]?_0x3c27d2['attributes']:_0x3ed756[_0xe78f('0x34')];if(!_0x2bde4f[_0xe78f('0x31')][_0xe78f('0x38')](_0xe78f('0x39'))){_0x3c27d2[_0xe78f('0x1c')]=qs['limit'](_0x2bde4f[_0xe78f('0x31')][_0xe78f('0x1c')]);_0x3c27d2[_0xe78f('0x1b')]=qs['offset'](_0x2bde4f['query']['offset']);}_0x3c27d2[_0xe78f('0x3a')]=qs[_0xe78f('0x3b')](_0x2bde4f['query']['sort']);_0x3c27d2[_0xe78f('0x3c')]=qs[_0xe78f('0x3d')](_[_0xe78f('0x3e')](_0x2bde4f[_0xe78f('0x31')],_0x3ed756[_0xe78f('0x3d')]),_0x39444c);if(_0x2bde4f[_0xe78f('0x31')][_0xe78f('0x3f')]){_0x3c27d2[_0xe78f('0x3c')]=_[_0xe78f('0x40')](_0x3c27d2[_0xe78f('0x3c')],{'$or':_['map'](_0x39444c,function(_0x2ac771){if(_0x2ac771[_0xe78f('0x2f')]!==_0xe78f('0x41')){var _0x260f15={};_0x260f15[_0x2ac771[_0xe78f('0x29')]]={'$like':'%'+_0x2bde4f[_0xe78f('0x31')][_0xe78f('0x3f')]+'%'};return _0x260f15;}})});}_0x3c27d2=_[_0xe78f('0x40')]({},_0x3c27d2,_0x2bde4f[_0xe78f('0x42')]);var _0x28383d={'where':_0x3c27d2[_0xe78f('0x3c')]};return db['Automation'][_0xe78f('0x1e')](_0x28383d)[_0xe78f('0x43')](function(_0x14543e){_0x39bc36[_0xe78f('0x1e')]=_0x14543e;if(_0x2bde4f[_0xe78f('0x31')]['includeAll']){_0x3c27d2[_0xe78f('0x44')]=[{'all':!![]}];}return db['Automation'][_0xe78f('0x45')](_0x3c27d2);})[_0xe78f('0x43')](function(_0x2ffaef){_0x39bc36[_0xe78f('0x46')]=_0x2ffaef;return _0x39bc36;})[_0xe78f('0x43')](respondWithFilteredResult(_0x3de5be,_0x3c27d2))[_0xe78f('0x47')](handleError(_0x3de5be,null));};exports[_0xe78f('0x48')]=function(_0x127ebe,_0x45434b){var _0x1bdbe8={'raw':![],'where':{'id':_0x127ebe['params']['id']}},_0x431bb9={};_0x431bb9[_0xe78f('0x34')]=_[_0xe78f('0x32')](db[_0xe78f('0x2c')][_0xe78f('0x2d')]);_0x431bb9['query']=_[_0xe78f('0x32')](_0x127ebe[_0xe78f('0x31')]);_0x431bb9['filters']=_[_0xe78f('0x33')](_0x431bb9[_0xe78f('0x34')],_0x431bb9[_0xe78f('0x31')]);_0x1bdbe8[_0xe78f('0x35')]=_['intersection'](_0x431bb9['model'],qs[_0xe78f('0x36')](_0x127ebe[_0xe78f('0x31')][_0xe78f('0x36')]));_0x1bdbe8[_0xe78f('0x35')]=_0x1bdbe8[_0xe78f('0x35')][_0xe78f('0x37')]?_0x1bdbe8['attributes']:_0x431bb9['model'];if(_0x127ebe[_0xe78f('0x31')][_0xe78f('0x49')]){_0x1bdbe8['include']=[{'all':!![]}];}_0x1bdbe8=_[_0xe78f('0x40')]({},_0x1bdbe8,_0x127ebe['options']);return db[_0xe78f('0x2c')][_0xe78f('0x4a')](_0x1bdbe8)[_0xe78f('0x43')](handleEntityNotFound(_0x45434b,null))[_0xe78f('0x43')](respondWithResult(_0x45434b,null))['catch'](handleError(_0x45434b,null));};exports[_0xe78f('0x4b')]=function(_0x556f3d,_0x3f5a31){return db[_0xe78f('0x2c')][_0xe78f('0x4b')](_0x556f3d[_0xe78f('0x4c')],{})[_0xe78f('0x43')](respondWithResult(_0x3f5a31,0xc9))[_0xe78f('0x47')](handleError(_0x3f5a31,null));};exports[_0xe78f('0x24')]=function(_0x32a908,_0x2488ca){if(_0x32a908[_0xe78f('0x4c')]['id']){delete _0x32a908[_0xe78f('0x4c')]['id'];}return db[_0xe78f('0x2c')]['find']({'where':{'id':_0x32a908[_0xe78f('0x4d')]['id']}})[_0xe78f('0x43')](handleEntityNotFound(_0x2488ca,null))['then'](saveUpdates(_0x32a908[_0xe78f('0x4c')],null))['then'](respondWithResult(_0x2488ca,null))[_0xe78f('0x47')](handleError(_0x2488ca,null));};exports[_0xe78f('0x25')]=function(_0x4e51db,_0x125471){return db['Automation']['find']({'where':{'id':_0x4e51db[_0xe78f('0x4d')]['id']}})[_0xe78f('0x43')](handleEntityNotFound(_0x125471,null))[_0xe78f('0x43')](removeEntity(_0x125471,null))[_0xe78f('0x47')](handleError(_0x125471,null));};exports['addConditions']=function(_0x3c1e6e,_0x50bb57,_0x332120){return db[_0xe78f('0x4e')]['find']({'where':{'id':_0x3c1e6e['params']['id']}})['then'](handleEntityNotFound(_0x50bb57,null))[_0xe78f('0x43')](function(_0x46a36c){if(_0x46a36c){return _0x46a36c[_0xe78f('0x4f')](_0x3c1e6e[_0xe78f('0x4c')][_0xe78f('0x50')],_[_0xe78f('0x51')](_0x3c1e6e['body'],[_0xe78f('0x50'),'id'])||{});}})[_0xe78f('0x43')](respondWithResult(_0x50bb57,null))[_0xe78f('0x47')](handleError(_0x50bb57,null));};exports[_0xe78f('0x52')]=function(_0x3e9815,_0x11fd68,_0x298468){var _0x5aa8bb={};var _0x1cd9cc={};var _0x296900;var _0x47f2ec;return db[_0xe78f('0x2c')][_0xe78f('0x53')]({'where':{'id':_0x3e9815['params']['id']}})['then'](handleEntityNotFound(_0x11fd68,null))[_0xe78f('0x43')](function(_0x2a5fd7){if(_0x2a5fd7){_0x296900=_0x2a5fd7;_0x1cd9cc['model']=_[_0xe78f('0x32')](db[_0xe78f('0x4e')][_0xe78f('0x2d')]);_0x1cd9cc['query']=_[_0xe78f('0x32')](_0x3e9815['query']);_0x1cd9cc[_0xe78f('0x3d')]=_[_0xe78f('0x33')](_0x1cd9cc['model'],_0x1cd9cc[_0xe78f('0x31')]);_0x5aa8bb[_0xe78f('0x35')]=_['intersection'](_0x1cd9cc[_0xe78f('0x34')],qs[_0xe78f('0x36')](_0x3e9815['query'][_0xe78f('0x36')]));_0x5aa8bb[_0xe78f('0x35')]=_0x5aa8bb[_0xe78f('0x35')]['length']?_0x5aa8bb[_0xe78f('0x35')]:_0x1cd9cc['model'];_0x5aa8bb[_0xe78f('0x3a')]=qs[_0xe78f('0x3b')](_0x3e9815['query'][_0xe78f('0x3b')]);_0x5aa8bb[_0xe78f('0x3c')]=qs[_0xe78f('0x3d')](_[_0xe78f('0x3e')](_0x3e9815[_0xe78f('0x31')],_0x1cd9cc[_0xe78f('0x3d')]));if(_0x3e9815[_0xe78f('0x31')][_0xe78f('0x3f')]){_0x5aa8bb[_0xe78f('0x3c')]=_[_0xe78f('0x40')](_0x5aa8bb[_0xe78f('0x3c')],{'$or':_[_0xe78f('0x2b')](_0x5aa8bb[_0xe78f('0x35')],function(_0x5d3b31){var _0x2345f2={};_0x2345f2[_0x5d3b31]={'$like':'%'+_0x3e9815['query'][_0xe78f('0x3f')]+'%'};return _0x2345f2;})});}_0x5aa8bb=_['merge']({},_0x5aa8bb,_0x3e9815[_0xe78f('0x42')]);return _0x296900[_0xe78f('0x52')](_0x5aa8bb);}})[_0xe78f('0x43')](function(_0x3b63df){if(_0x3b63df){_0x47f2ec=_0x3b63df['length'];if(!_0x3e9815[_0xe78f('0x31')][_0xe78f('0x38')](_0xe78f('0x39'))){_0x5aa8bb[_0xe78f('0x1c')]=qs[_0xe78f('0x1c')](_0x3e9815[_0xe78f('0x31')][_0xe78f('0x1c')]);_0x5aa8bb[_0xe78f('0x1b')]=qs[_0xe78f('0x1b')](_0x3e9815[_0xe78f('0x31')][_0xe78f('0x1b')]);}return _0x296900['getConditions'](_0x5aa8bb);}})[_0xe78f('0x43')](function(_0x1ab19e){if(_0x1ab19e){return _0x1ab19e?{'count':_0x47f2ec,'rows':_0x1ab19e}:null;}})[_0xe78f('0x43')](respondWithResult(_0x11fd68,null))[_0xe78f('0x47')](handleError(_0x11fd68,null));};exports[_0xe78f('0x54')]=function(_0x3f663f,_0x2868ad,_0x4195c7){return db[_0xe78f('0x55')][_0xe78f('0x4a')]({'where':{'id':_0x3f663f['params']['id']}})[_0xe78f('0x43')](handleEntityNotFound(_0x2868ad,null))[_0xe78f('0x43')](function(_0x2e895f){if(_0x2e895f){return _0x2e895f['addActions'](_0x3f663f[_0xe78f('0x4c')][_0xe78f('0x50')],_[_0xe78f('0x51')](_0x3f663f[_0xe78f('0x4c')],[_0xe78f('0x50'),'id'])||{});}})[_0xe78f('0x43')](respondWithResult(_0x2868ad,null))['catch'](handleError(_0x2868ad,null));};exports['getActions']=function(_0x4d44e5,_0x470886,_0x460ab7){var _0x2c88a3={};var _0x204152={};var _0x2c588e;var _0x210392;return db['Automation']['findOne']({'where':{'id':_0x4d44e5[_0xe78f('0x4d')]['id']}})['then'](handleEntityNotFound(_0x470886,null))[_0xe78f('0x43')](function(_0x5ceecc){if(_0x5ceecc){_0x2c588e=_0x5ceecc;_0x204152[_0xe78f('0x34')]=_['keys'](db[_0xe78f('0x55')][_0xe78f('0x2d')]);_0x204152['query']=_['keys'](_0x4d44e5[_0xe78f('0x31')]);_0x204152['filters']=_['intersection'](_0x204152[_0xe78f('0x34')],_0x204152[_0xe78f('0x31')]);_0x2c88a3['attributes']=_[_0xe78f('0x33')](_0x204152[_0xe78f('0x34')],qs['fields'](_0x4d44e5['query'][_0xe78f('0x36')]));_0x2c88a3[_0xe78f('0x35')]=_0x2c88a3['attributes'][_0xe78f('0x37')]?_0x2c88a3[_0xe78f('0x35')]:_0x204152[_0xe78f('0x34')];_0x2c88a3['order']=qs[_0xe78f('0x3b')](_0x4d44e5[_0xe78f('0x31')][_0xe78f('0x3b')]);_0x2c88a3[_0xe78f('0x3c')]=qs[_0xe78f('0x3d')](_[_0xe78f('0x3e')](_0x4d44e5[_0xe78f('0x31')],_0x204152[_0xe78f('0x3d')]));if(_0x4d44e5['query'][_0xe78f('0x3f')]){_0x2c88a3['where']=_[_0xe78f('0x40')](_0x2c88a3['where'],{'$or':_['map'](_0x2c88a3[_0xe78f('0x35')],function(_0x671260){var _0x49d328={};_0x49d328[_0x671260]={'$like':'%'+_0x4d44e5[_0xe78f('0x31')][_0xe78f('0x3f')]+'%'};return _0x49d328;})});}_0x2c88a3=_[_0xe78f('0x40')]({},_0x2c88a3,_0x4d44e5['options']);return _0x2c588e[_0xe78f('0x56')](_0x2c88a3);}})[_0xe78f('0x43')](function(_0x99cae4){if(_0x99cae4){_0x210392=_0x99cae4[_0xe78f('0x37')];if(!_0x4d44e5[_0xe78f('0x31')][_0xe78f('0x38')](_0xe78f('0x39'))){_0x2c88a3[_0xe78f('0x1c')]=qs[_0xe78f('0x1c')](_0x4d44e5[_0xe78f('0x31')][_0xe78f('0x1c')]);_0x2c88a3[_0xe78f('0x1b')]=qs[_0xe78f('0x1b')](_0x4d44e5[_0xe78f('0x31')]['offset']);}return _0x2c588e[_0xe78f('0x56')](_0x2c88a3);}})['then'](function(_0x2ba0b9){if(_0x2ba0b9){return _0x2ba0b9?{'count':_0x210392,'rows':_0x2ba0b9}:null;}})['then'](respondWithResult(_0x470886,null))[_0xe78f('0x47')](handleError(_0x470886,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 4594dd8..3b3bef3 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 _0x6abc=['define','Automation','tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./automation.attributes','exports'];(function(_0x5096bf,_0x5eabc8){var _0x1cbd88=function(_0x2e9bd6){while(--_0x2e9bd6){_0x5096bf['push'](_0x5096bf['shift']());}};_0x1cbd88(++_0x5eabc8);}(_0x6abc,0xac));var _0xc6ab=function(_0x2d5df5,_0x282cba){_0x2d5df5=_0x2d5df5-0x0;var _0x48d803=_0x6abc[_0x2d5df5];return _0x48d803;};'use strict';var _=require(_0xc6ab('0x0'));var util=require(_0xc6ab('0x1'));var logger=require(_0xc6ab('0x2'))(_0xc6ab('0x3'));var moment=require(_0xc6ab('0x4'));var BPromise=require(_0xc6ab('0x5'));var rp=require(_0xc6ab('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc6ab('0x7'));var attributes=require(_0xc6ab('0x8'));module[_0xc6ab('0x9')]=function(_0x4e8869,_0x14ee25){return _0x4e8869[_0xc6ab('0xa')](_0xc6ab('0xb'),attributes,{'tableName':_0xc6ab('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe731=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./automation.attributes','exports','Automation','tools_automations'];(function(_0x515283,_0x813dea){var _0x38f836=function(_0x40c8f4){while(--_0x40c8f4){_0x515283['push'](_0x515283['shift']());}};_0x38f836(++_0x813dea);}(_0xe731,0x78));var _0x1e73=function(_0x4c15f0,_0x2c6daa){_0x4c15f0=_0x4c15f0-0x0;var _0x2f5754=_0xe731[_0x4c15f0];return _0x2f5754;};'use strict';var _=require(_0x1e73('0x0'));var util=require('util');var logger=require(_0x1e73('0x1'))(_0x1e73('0x2'));var moment=require(_0x1e73('0x3'));var BPromise=require(_0x1e73('0x4'));var rp=require(_0x1e73('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1e73('0x6'));var config=require(_0x1e73('0x7'));var attributes=require(_0x1e73('0x8'));module[_0x1e73('0x9')]=function(_0x34614e,_0x515ed9){return _0x34614e['define'](_0x1e73('0xa'),attributes,{'tableName':_0x1e73('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 ee783c8..f2d5a5e 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 _0x19e1=['moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','Automation,\x20%s,\x20%s','message','info','result','catch','lodash','util'];(function(_0x534d6d,_0x14dde2){var _0x15f9c6=function(_0xbed43d){while(--_0xbed43d){_0x534d6d['push'](_0x534d6d['shift']());}};_0x15f9c6(++_0x14dde2);}(_0x19e1,0x163));var _0x119e=function(_0x51b1a5,_0x285a4f){_0x51b1a5=_0x51b1a5-0x0;var _0x15c738=_0x19e1[_0x51b1a5];return _0x15c738;};'use strict';var _=require(_0x119e('0x0'));var util=require(_0x119e('0x1'));var moment=require(_0x119e('0x2'));var BPromise=require(_0x119e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x119e('0x4'))['db'];var utils=require(_0x119e('0x5'));var logger=require('../../config/logger')(_0x119e('0x6'));var config=require(_0x119e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x119e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b5306,_0x25e166,_0x16a2ee){return new BPromise(function(_0x1b3797,_0x53d5b7){return client[_0x119e('0x9')](_0x1b5306,_0x16a2ee)[_0x119e('0xa')](function(_0x1a6747){logger['info']('Automation,\x20%s,\x20%s',_0x25e166,_0x119e('0xb'));logger[_0x119e('0xc')](_0x119e('0xd'),_0x25e166,_0x119e('0xb'),JSON[_0x119e('0xe')](_0x1a6747));if(_0x1a6747[_0x119e('0xf')]){if(_0x1a6747[_0x119e('0xf')]['code']===0x1f4){logger[_0x119e('0xf')](_0x119e('0x10'),_0x25e166,_0x1a6747[_0x119e('0xf')][_0x119e('0x11')]);return _0x53d5b7(_0x1a6747[_0x119e('0xf')][_0x119e('0x11')]);}logger['error'](_0x119e('0x10'),_0x25e166,_0x1a6747[_0x119e('0xf')][_0x119e('0x11')]);return _0x1b3797(_0x1a6747[_0x119e('0xf')][_0x119e('0x11')]);}else{logger[_0x119e('0x12')](_0x119e('0x10'),_0x25e166,_0x119e('0xb'));_0x1b3797(_0x1a6747[_0x119e('0x13')][_0x119e('0x11')]);}})[_0x119e('0x14')](function(_0x54c326){logger[_0x119e('0xf')](_0x119e('0x10'),_0x25e166,_0x54c326);_0x53d5b7(_0x54c326);});});}
\ No newline at end of file
+var _0x50a8=['message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','error','code','Automation,\x20%s,\x20%s'];(function(_0x1afe66,_0x3a0198){var _0x185efe=function(_0x563e05){while(--_0x563e05){_0x1afe66['push'](_0x1afe66['shift']());}};_0x185efe(++_0x3a0198);}(_0x50a8,0x193));var _0x850a=function(_0x29982b,_0x594e0){_0x29982b=_0x29982b-0x0;var _0xb1f0a9=_0x50a8[_0x29982b];return _0xb1f0a9;};'use strict';var _=require('lodash');var util=require(_0x850a('0x0'));var moment=require('moment');var BPromise=require(_0x850a('0x1'));var rs=require(_0x850a('0x2'));var fs=require('fs');var Redis=require(_0x850a('0x3'));var db=require(_0x850a('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x850a('0x5'));var jayson=require(_0x850a('0x6'));var client=jayson['client'][_0x850a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4d74c5,_0x29c689,_0x2cfc90){return new BPromise(function(_0x245f43,_0x596f57){return client[_0x850a('0x8')](_0x4d74c5,_0x2cfc90)[_0x850a('0x9')](function(_0x21b814){logger['info']('Automation,\x20%s,\x20%s',_0x29c689,_0x850a('0xa'));logger[_0x850a('0xb')]('Automation,\x20%s,\x20%s,\x20%s',_0x29c689,_0x850a('0xa'),JSON['stringify'](_0x21b814));if(_0x21b814[_0x850a('0xc')]){if(_0x21b814[_0x850a('0xc')][_0x850a('0xd')]===0x1f4){logger[_0x850a('0xc')](_0x850a('0xe'),_0x29c689,_0x21b814['error'][_0x850a('0xf')]);return _0x596f57(_0x21b814[_0x850a('0xc')]['message']);}logger[_0x850a('0xc')](_0x850a('0xe'),_0x29c689,_0x21b814['error'][_0x850a('0xf')]);return _0x245f43(_0x21b814[_0x850a('0xc')][_0x850a('0xf')]);}else{logger[_0x850a('0x10')]('Automation,\x20%s,\x20%s',_0x29c689,_0x850a('0xa'));_0x245f43(_0x21b814[_0x850a('0x11')][_0x850a('0xf')]);}})[_0x850a('0x12')](function(_0x67adce){logger[_0x850a('0xc')]('Automation,\x20%s,\x20%s',_0x29c689,_0x67adce);_0x596f57(_0x67adce);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index e3a6131..1a13f65 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 _0x818f=['addConditions','addActions','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','/:id/actions','getActions','post','create'];(function(_0x5382fe,_0x9b02a){var _0x2c0146=function(_0x9c63f8){while(--_0x9c63f8){_0x5382fe['push'](_0x5382fe['shift']());}};_0x2c0146(++_0x9b02a);}(_0x818f,0x1da));var _0xf818=function(_0x28a480,_0x5b656e){_0x28a480=_0x28a480-0x0;var _0x3410e6=_0x818f[_0x28a480];return _0x3410e6;};'use strict';var multer=require(_0xf818('0x0'));var util=require(_0xf818('0x1'));var path=require(_0xf818('0x2'));var timeout=require(_0xf818('0x3'));var express=require(_0xf818('0x4'));var router=express[_0xf818('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf818('0x6'));var interaction=require(_0xf818('0x7'));var config=require(_0xf818('0x8'));var controller=require(_0xf818('0x9'));router[_0xf818('0xa')]('/',auth[_0xf818('0xb')](),controller[_0xf818('0xc')]);router[_0xf818('0xa')](_0xf818('0xd'),auth['isAuthenticated'](),controller[_0xf818('0xe')]);router[_0xf818('0xa')](_0xf818('0xf'),auth['isAuthenticated'](),controller['getConditions']);router[_0xf818('0xa')](_0xf818('0x10'),auth[_0xf818('0xb')](),controller[_0xf818('0x11')]);router[_0xf818('0x12')]('/',auth['isAuthenticated'](),controller[_0xf818('0x13')]);router[_0xf818('0x12')](_0xf818('0xf'),auth[_0xf818('0xb')](),controller[_0xf818('0x14')]);router['post']('/:id/actions',auth[_0xf818('0xb')](),controller[_0xf818('0x15')]);router[_0xf818('0x16')](_0xf818('0xd'),auth['isAuthenticated'](),controller[_0xf818('0x17')]);router[_0xf818('0x18')](_0xf818('0xd'),auth[_0xf818('0xb')](),controller[_0xf818('0x19')]);module['exports']=router;
\ No newline at end of file
+var _0x581a=['fs-extra','../../components/auth/service','./automation.controller','isAuthenticated','index','get','/:id','show','/:id/conditions','getConditions','getActions','post','create','addConditions','/:id/actions','addActions','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x3deac5,_0x38eef5){var _0x41e636=function(_0x1388dd){while(--_0x1388dd){_0x3deac5['push'](_0x3deac5['shift']());}};_0x41e636(++_0x38eef5);}(_0x581a,0x127));var _0xa581=function(_0x4ed938,_0x31b3db){_0x4ed938=_0x4ed938-0x0;var _0x1770d4=_0x581a[_0x4ed938];return _0x1770d4;};'use strict';var multer=require(_0xa581('0x0'));var util=require(_0xa581('0x1'));var path=require('path');var timeout=require(_0xa581('0x2'));var express=require(_0xa581('0x3'));var router=express[_0xa581('0x4')]();var fs_extra=require(_0xa581('0x5'));var auth=require(_0xa581('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa581('0x7'));router['get']('/',auth[_0xa581('0x8')](),controller[_0xa581('0x9')]);router[_0xa581('0xa')](_0xa581('0xb'),auth[_0xa581('0x8')](),controller[_0xa581('0xc')]);router[_0xa581('0xa')](_0xa581('0xd'),auth[_0xa581('0x8')](),controller[_0xa581('0xe')]);router[_0xa581('0xa')]('/:id/actions',auth[_0xa581('0x8')](),controller[_0xa581('0xf')]);router[_0xa581('0x10')]('/',auth[_0xa581('0x8')](),controller[_0xa581('0x11')]);router[_0xa581('0x10')](_0xa581('0xd'),auth['isAuthenticated'](),controller[_0xa581('0x12')]);router[_0xa581('0x10')](_0xa581('0x13'),auth[_0xa581('0x8')](),controller[_0xa581('0x14')]);router['put'](_0xa581('0xb'),auth[_0xa581('0x8')](),controller[_0xa581('0x15')]);router[_0xa581('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xa581('0x17')]);module[_0xa581('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 beb7cda..e9f614b 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 _0xd9f5=['#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\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\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','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time'];(function(_0xd49e15,_0x5e34ac){var _0x306b6a=function(_0x38ce9c){while(--_0x38ce9c){_0xd49e15['push'](_0xd49e15['shift']());}};_0x306b6a(++_0x5e34ac);}(_0xd9f5,0x1b4));var _0x5d9f=function(_0x16eb19,_0x58cea4){_0x16eb19=_0x16eb19-0x0;var _0x312a25=_0xd9f5[_0x16eb19];return _0x312a25;};'use strict';var Sequelize=require(_0x5d9f('0x0'));module['exports']={'name':{'type':Sequelize[_0x5d9f('0x1')],'unique':_0x5d9f('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x5d9f('0x3')](_0x5d9f('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x5d9f('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x5d9f('0x5')},'limitCalls':{'type':Sequelize[_0x5d9f('0x6')](0x4)[_0x5d9f('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x5d9f('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x5d9f('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x5d9f('0x6')](0x3)[_0x5d9f('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d9f('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x5d9f('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d9f('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5d9f('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d9f('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x5d9f('0x6')](0x3)[_0x5d9f('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d9f('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x5d9f('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d9f('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x5d9f('0x6')](0x5)[_0x5d9f('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d9f('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x5d9f('0x6')](0x3)[_0x5d9f('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x5d9f('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x5d9f('0x1')],'defaultValue':_0x5d9f('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x5d9f('0x3')](_0x5d9f('0x11'),_0x5d9f('0x12'),_0x5d9f('0x13')),'defaultValue':_0x5d9f('0x11')},'dialAMDActive':{'type':Sequelize[_0x5d9f('0x14')],'defaultValue':0x0,'comment':_0x5d9f('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0x5d9f('0x6')](0x9)[_0x5d9f('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x5d9f('0x16')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x5d9f('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x5d9f('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x5d9f('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x5d9f('0x18')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x5d9f('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5d9f('0x19')},'dialAMDMinWordLength':{'type':Sequelize[_0x5d9f('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x5d9f('0x1a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5d9f('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x5d9f('0x1b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5d9f('0x6')](0x9)[_0x5d9f('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x5d9f('0x1c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x5d9f('0x6')](0x5)[_0x5d9f('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x5d9f('0x1d')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x5d9f('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5d9f('0x1e')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x5d9f('0x1f'),_0x5d9f('0x20')),'defaultValue':_0x5d9f('0x1f')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x5d9f('0x6')](0x3)[_0x5d9f('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5d9f('0x21')},'dialCutDigit':{'type':Sequelize[_0x5d9f('0x6')](0x3)[_0x5d9f('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5d9f('0x22')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x5d9f('0x6')](0x3)[_0x5d9f('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x5d9f('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d9f('0x23')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5d9f('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d9f('0x24')},'dialDropRetryFrequency':{'type':Sequelize[_0x5d9f('0x6')](0x5)[_0x5d9f('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d9f('0x25')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x5d9f('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x5d9f('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d9f('0x26')},'dialMachineMaxRetry':{'type':Sequelize[_0x5d9f('0x6')](0x3)[_0x5d9f('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d9f('0x27')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x5d9f('0x6')](0x3)[_0x5d9f('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d9f('0x28')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5d9f('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d9f('0x29')}};
\ No newline at end of file
+var _0xd4bd=['sequelize','exports','STRING','name','ivr','BOOLEAN','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#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','ENUM','ASC','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xd4bd,0x190));var _0xdd4b=function(_0x53e3c2,_0x90a8fd){_0x53e3c2=_0x53e3c2-0x0;var _0x10aa40=_0xd4bd[_0x53e3c2];return _0x10aa40;};'use strict';var Sequelize=require(_0xdd4b('0x0'));module[_0xdd4b('0x1')]={'name':{'type':Sequelize[_0xdd4b('0x2')],'unique':_0xdd4b('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xdd4b('0x4')),'allowNull':![],'defaultValue':_0xdd4b('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xdd4b('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xdd4b('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xdd4b('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xdd4b('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xdd4b('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xdd4b('0x6')](0x3)[_0xdd4b('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdd4b('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xdd4b('0x6')](0x3)[_0xdd4b('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xdd4b('0x6')](0x5)[_0xdd4b('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdd4b('0xa')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdd4b('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xdd4b('0x6')](0x5)[_0xdd4b('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdd4b('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xdd4b('0x6')](0x3)[_0xdd4b('0x8')],'defaultValue':0x3,'comment':_0xdd4b('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xdd4b('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdd4b('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xdd4b('0xd')},'dialTimezone':{'type':Sequelize[_0xdd4b('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xdd4b('0xe'),_0xdd4b('0xf'),_0xdd4b('0x10')),'defaultValue':_0xdd4b('0xe')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xdd4b('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0xdd4b('0x6')](0x9)[_0xdd4b('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xdd4b('0x12')},'dialAMDGreeting':{'type':Sequelize[_0xdd4b('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xdd4b('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xdd4b('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xdd4b('0x6')](0x9)[_0xdd4b('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xdd4b('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0xdd4b('0x6')](0x9)[_0xdd4b('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xdd4b('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xdd4b('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xdd4b('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xdd4b('0x6')](0x9)[_0xdd4b('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xdd4b('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xdd4b('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xdd4b('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xdd4b('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xdd4b('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xdd4b('0x1b')]('DESC',_0xdd4b('0x1c')),'defaultValue':_0xdd4b('0x1d')},'dialPrefix':{'type':Sequelize[_0xdd4b('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xdd4b('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xdd4b('0x1e')},'dialCutDigit':{'type':Sequelize[_0xdd4b('0x6')](0x3)[_0xdd4b('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xdd4b('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdd4b('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdd4b('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xdd4b('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdd4b('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0xdd4b('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdd4b('0x22')},'dialDropRetryFrequency':{'type':Sequelize[_0xdd4b('0x6')](0x5)[_0xdd4b('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdd4b('0x23')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xdd4b('0x6')](0x3)[_0xdd4b('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xdd4b('0x6')](0x5)[_0xdd4b('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdd4b('0x24')},'dialMachineMaxRetry':{'type':Sequelize[_0xdd4b('0x6')](0x3)[_0xdd4b('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdd4b('0x25')},'dialMachineRetryFrequency':{'type':Sequelize[_0xdd4b('0x6')](0x5)[_0xdd4b('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdd4b('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xdd4b('0x6')](0x3)[_0xdd4b('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xdd4b('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdd4b('0x27')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 39db7c5..7addb32 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 _0x8ba2=['insert','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.OrderBY','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','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/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','reject','save','update','then','get','IvrCampaigns','UserProfileResource','error','stack','name','send','index','map','Campaign','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','clone','omit','createdAt','body','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','getHoppers','CmHopper','order','getHopperHistories','findOne','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','ids','spread','dialCheckDuplicateType','always','into','phone','scheduledAt','ContactId','updatedAt','select','field','NOW()','CmListId','ListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','fromQuery','ListId\x20=\x20?'];(function(_0x1152e5,_0x5a8eaf){var _0xd1fcdb=function(_0xabaa2b){while(--_0xabaa2b){_0x1152e5['push'](_0x1152e5['shift']());}};_0xd1fcdb(++_0x5a8eaf);}(_0x8ba2,0x13f));var _0x28ba=function(_0x491266,_0x65e2e6){_0x491266=_0x491266-0x0;var _0x385dea=_0x8ba2[_0x491266];return _0x385dea;};'use strict';var emlformat=require(_0x28ba('0x0'));var rimraf=require(_0x28ba('0x1'));var zipdir=require(_0x28ba('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x28ba('0x3'));var moment=require(_0x28ba('0x4'));var BPromise=require(_0x28ba('0x5'));var Mustache=require('mustache');var util=require(_0x28ba('0x6'));var path=require(_0x28ba('0x7'));var sox=require(_0x28ba('0x8'));var csv=require(_0x28ba('0x9'));var ejs=require(_0x28ba('0xa'));var fs=require('fs');var fs_extra=require(_0x28ba('0xb'));var _=require('lodash');var squel=require(_0x28ba('0xc'));var crypto=require(_0x28ba('0xd'));var jsforce=require(_0x28ba('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x28ba('0x9'));var querystring=require(_0x28ba('0xf'));var Papa=require(_0x28ba('0x10'));var Redis=require(_0x28ba('0x11'));var authService=require(_0x28ba('0x12'));var qs=require(_0x28ba('0x13'));var as=require(_0x28ba('0x14'));var hardwareService=require(_0x28ba('0x15'));var logger=require(_0x28ba('0x16'))(_0x28ba('0x17'));var utils=require('../../config/utils');var config=require(_0x28ba('0x18'));var licenseUtil=require(_0x28ba('0x19'));var db=require(_0x28ba('0x1a'))['db'];function respondWithStatusCode(_0x299f63,_0x1204af){_0x1204af=_0x1204af||0xcc;return function(_0x3a9644){if(_0x3a9644){return _0x299f63[_0x28ba('0x1b')](_0x1204af);}return _0x299f63['status'](_0x1204af)[_0x28ba('0x1c')]();};}function respondWithResult(_0x3cf923,_0x4ebcd6){_0x4ebcd6=_0x4ebcd6||0xc8;return function(_0x29cd51){if(_0x29cd51){return _0x3cf923[_0x28ba('0x1d')](_0x4ebcd6)[_0x28ba('0x1e')](_0x29cd51);}};}function respondWithFilteredResult(_0x1c5998,_0x563797){return function(_0x24b3f3){if(_0x24b3f3){var _0x38df4f=typeof _0x563797[_0x28ba('0x1f')]===_0x28ba('0x20')&&typeof _0x563797[_0x28ba('0x21')]==='undefined';var _0x571c92=_0x24b3f3[_0x28ba('0x22')];var _0x182824=_0x38df4f?0x0:_0x563797[_0x28ba('0x1f')];var _0x2cf1cf=_0x38df4f?_0x24b3f3[_0x28ba('0x22')]:_0x563797[_0x28ba('0x1f')]+_0x563797[_0x28ba('0x21')];var _0x31a45b;if(_0x2cf1cf>=_0x571c92){_0x2cf1cf=_0x571c92;_0x31a45b=0xc8;}else{_0x31a45b=0xce;}_0x1c5998[_0x28ba('0x1d')](_0x31a45b);return _0x1c5998['set']('Content-Range',_0x182824+'-'+_0x2cf1cf+'/'+_0x571c92)[_0x28ba('0x1e')](_0x24b3f3);}return null;};}function patchUpdates(_0x4352a4){return function(_0x5d3d33){try{jsonpatch['apply'](_0x5d3d33,_0x4352a4,!![]);}catch(_0xf9e0f4){return BPromise[_0x28ba('0x23')](_0xf9e0f4);}return _0x5d3d33[_0x28ba('0x24')]();};}function saveUpdates(_0x17b1f4,_0x425732){return function(_0x4ff05c){if(_0x4ff05c){return _0x4ff05c[_0x28ba('0x25')](_0x17b1f4)[_0x28ba('0x26')](function(_0x1684af){return _0x1684af;});}return null;};}function removeEntity(_0x3eec5d,_0x27a579){return function(_0x256892){if(_0x256892){return _0x256892['destroy']()[_0x28ba('0x26')](function(){var _0x46969a=_0x256892[_0x28ba('0x27')]({'plain':!![]});var _0x1d3fd1=_0x28ba('0x28');return db[_0x28ba('0x29')]['destroy']({'where':{'type':_0x1d3fd1,'resourceId':_0x46969a['id']}})[_0x28ba('0x26')](function(){return _0x256892;});})[_0x28ba('0x26')](function(){_0x3eec5d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x36dc29,_0x3e1ce7){return function(_0x5b9237){if(!_0x5b9237){_0x36dc29['sendStatus'](0x194);}return _0x5b9237;};}function handleError(_0x4267b4,_0x3638c5){_0x3638c5=_0x3638c5||0x1f4;return function(_0x39cd83){logger[_0x28ba('0x2a')](_0x39cd83[_0x28ba('0x2b')]);if(_0x39cd83[_0x28ba('0x2c')]){delete _0x39cd83[_0x28ba('0x2c')];}_0x4267b4[_0x28ba('0x1d')](_0x3638c5)[_0x28ba('0x2d')](_0x39cd83);};}exports[_0x28ba('0x2e')]=function(_0x296b66,_0x32ab4b){var _0x27737d={},_0x2c712e={},_0x5f0202={'count':0x0,'rows':[]};var _0x13dfd4=_[_0x28ba('0x2f')](db[_0x28ba('0x30')]['rawAttributes'],function(_0x2c32f3){return{'name':_0x2c32f3[_0x28ba('0x31')],'type':_0x2c32f3[_0x28ba('0x32')]['key']};});_0x2c712e[_0x28ba('0x33')]=_[_0x28ba('0x2f')](_0x13dfd4,_0x28ba('0x2c'));_0x2c712e[_0x28ba('0x34')]=_[_0x28ba('0x35')](_0x296b66[_0x28ba('0x34')]);_0x2c712e[_0x28ba('0x36')]=_[_0x28ba('0x37')](_0x2c712e[_0x28ba('0x33')],_0x2c712e[_0x28ba('0x34')]);_0x27737d['attributes']=_[_0x28ba('0x37')](_0x2c712e[_0x28ba('0x33')],qs[_0x28ba('0x38')](_0x296b66['query'][_0x28ba('0x38')]));_0x27737d[_0x28ba('0x39')]=_0x27737d[_0x28ba('0x39')][_0x28ba('0x3a')]?_0x27737d[_0x28ba('0x39')]:_0x2c712e[_0x28ba('0x33')];if(!_0x296b66[_0x28ba('0x34')][_0x28ba('0x3b')](_0x28ba('0x3c'))){_0x27737d[_0x28ba('0x21')]=qs[_0x28ba('0x21')](_0x296b66[_0x28ba('0x34')]['limit']);_0x27737d['offset']=qs['offset'](_0x296b66[_0x28ba('0x34')][_0x28ba('0x1f')]);}_0x27737d['order']=qs[_0x28ba('0x3d')](_0x296b66[_0x28ba('0x34')]['sort']);_0x27737d['where']=qs[_0x28ba('0x36')](_[_0x28ba('0x3e')](_0x296b66['query'],_0x2c712e['filters']),_0x13dfd4);if(_0x296b66[_0x28ba('0x34')][_0x28ba('0x3f')]){_0x27737d[_0x28ba('0x40')]=_[_0x28ba('0x41')](_0x27737d[_0x28ba('0x40')],{'$or':_[_0x28ba('0x2f')](_0x13dfd4,function(_0x241a4a){if(_0x241a4a[_0x28ba('0x32')]!==_0x28ba('0x42')){var _0x5b0174={};_0x5b0174[_0x241a4a['name']]={'$like':'%'+_0x296b66['query'][_0x28ba('0x3f')]+'%'};return _0x5b0174;}})});}_0x27737d=_[_0x28ba('0x41')]({},_0x27737d,_0x296b66[_0x28ba('0x43')]);var _0x2f5ce4={'where':_0x27737d[_0x28ba('0x40')]};return db['Campaign']['count'](_0x2f5ce4)['then'](function(_0x424f73){_0x5f0202[_0x28ba('0x22')]=_0x424f73;if(_0x296b66[_0x28ba('0x34')][_0x28ba('0x44')]){_0x27737d[_0x28ba('0x45')]=[{'all':!![]}];}return db['Campaign'][_0x28ba('0x46')](_0x27737d);})[_0x28ba('0x26')](function(_0x364b7a){_0x5f0202[_0x28ba('0x47')]=_0x364b7a;return _0x5f0202;})[_0x28ba('0x26')](respondWithFilteredResult(_0x32ab4b,_0x27737d))[_0x28ba('0x48')](handleError(_0x32ab4b,null));};exports[_0x28ba('0x49')]=function(_0x1c12f4,_0x213497){var _0x4c550c={'raw':![],'where':{'id':_0x1c12f4[_0x28ba('0x4a')]['id']}},_0x53f882={};_0x53f882[_0x28ba('0x33')]=_[_0x28ba('0x35')](db[_0x28ba('0x30')][_0x28ba('0x4b')]);_0x53f882['query']=_['keys'](_0x1c12f4['query']);_0x53f882['filters']=_[_0x28ba('0x37')](_0x53f882[_0x28ba('0x33')],_0x53f882[_0x28ba('0x34')]);_0x4c550c[_0x28ba('0x39')]=_[_0x28ba('0x37')](_0x53f882[_0x28ba('0x33')],qs['fields'](_0x1c12f4[_0x28ba('0x34')][_0x28ba('0x38')]));_0x4c550c['attributes']=_0x4c550c['attributes'][_0x28ba('0x3a')]?_0x4c550c['attributes']:_0x53f882[_0x28ba('0x33')];if(_0x1c12f4[_0x28ba('0x34')]['includeAll']){_0x4c550c[_0x28ba('0x45')]=[{'all':!![]}];}_0x4c550c=_['merge']({},_0x4c550c,_0x1c12f4[_0x28ba('0x43')]);return db['Campaign'][_0x28ba('0x4c')](_0x4c550c)[_0x28ba('0x26')](handleEntityNotFound(_0x213497,null))[_0x28ba('0x26')](respondWithResult(_0x213497,null))[_0x28ba('0x48')](handleError(_0x213497,null));};exports[_0x28ba('0x4d')]=function(_0x4047c1,_0x5ccfab){return db[_0x28ba('0x30')]['create'](_0x4047c1['body'],{})[_0x28ba('0x26')](function(_0xd327ac){var _0x21931b=_0x4047c1[_0x28ba('0x4e')]['get']({'plain':!![]});if(!_0x21931b)throw new Error(_0x28ba('0x4f'));if(_0x21931b['role']==='user'){var _0x38bf5b=_0xd327ac[_0x28ba('0x27')]({'plain':!![]});var _0xf0938f=_0x28ba('0x28');return db[_0x28ba('0x50')][_0x28ba('0x4c')]({'where':{'name':_0xf0938f,'userProfileId':_0x21931b[_0x28ba('0x51')]},'raw':!![]})[_0x28ba('0x26')](function(_0x5aac05){if(_0x5aac05&&_0x5aac05[_0x28ba('0x52')]===0x0){return db[_0x28ba('0x29')][_0x28ba('0x4d')]({'name':_0x38bf5b[_0x28ba('0x2c')],'resourceId':_0x38bf5b['id'],'type':_0x5aac05[_0x28ba('0x2c')],'sectionId':_0x5aac05['id']},{})['then'](function(){return _0xd327ac;});}else{return _0xd327ac;}})[_0x28ba('0x48')](function(_0x2ec307){logger[_0x28ba('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ec307);throw _0x2ec307;});}return _0xd327ac;})[_0x28ba('0x26')](respondWithResult(_0x5ccfab,0xc9))[_0x28ba('0x48')](handleError(_0x5ccfab,null));};exports[_0x28ba('0x53')]=function(_0x4f5a05,_0x23e1fc){var _0x5c596d={'where':{'id':_0x4f5a05[_0x28ba('0x4a')]['id']}},_0x42a48f={};_0x42a48f['model']=_[_0x28ba('0x35')](db[_0x28ba('0x30')][_0x28ba('0x4b')]);_0x5c596d[_0x28ba('0x39')]=_[_0x28ba('0x37')](_0x42a48f[_0x28ba('0x33')],qs[_0x28ba('0x38')](_0x4f5a05[_0x28ba('0x34')][_0x28ba('0x38')]));_0x5c596d[_0x28ba('0x39')]=_0x5c596d[_0x28ba('0x39')]['length']?_0x5c596d[_0x28ba('0x39')]:_0x42a48f[_0x28ba('0x33')];if(_0x4f5a05[_0x28ba('0x34')][_0x28ba('0x44')]){_0x5c596d[_0x28ba('0x45')]=[{'all':!![]}];}_0x5c596d=_['merge']({},_0x5c596d,_0x4f5a05[_0x28ba('0x43')]);return db[_0x28ba('0x30')][_0x28ba('0x4c')](_0x5c596d)[_0x28ba('0x26')](handleEntityNotFound(_0x23e1fc,null))[_0x28ba('0x26')](function(_0x346b95){if(_0x346b95){var _0xb70fd6=_0x346b95['get']({'plain':!![]});_0xb70fd6=qs[_0x28ba('0x54')](_0xb70fd6,['id',_0x28ba('0x55'),'updatedAt']);_0x4f5a05[_0x28ba('0x56')]=_[_0x28ba('0x54')](_0x4f5a05['body'],['id','createdAt','updatedAt']);return db['Campaign'][_0x28ba('0x4d')](_[_0x28ba('0x41')](_0xb70fd6,_0x4f5a05['body']),{'include':_0x4f5a05['query'][_0x28ba('0x44')]?[{'all':!![]}]:undefined})[_0x28ba('0x26')](function(_0x197a02){var _0x5619db=_0x4f5a05[_0x28ba('0x4e')][_0x28ba('0x27')]({'plain':!![]});if(!_0x5619db)throw new Error(_0x28ba('0x4f'));if(_0x5619db[_0x28ba('0x57')]===_0x28ba('0x4e')){var _0x26e97b=_0x197a02[_0x28ba('0x27')]({'plain':!![]});var _0x1b6f23=_0x28ba('0x28');return db['UserProfileSection'][_0x28ba('0x4c')]({'where':{'name':_0x1b6f23,'userProfileId':_0x5619db['userProfileId']},'raw':!![]})[_0x28ba('0x26')](function(_0x55011e){if(_0x55011e&&_0x55011e[_0x28ba('0x52')]===0x0){return db['UserProfileResource'][_0x28ba('0x4d')]({'name':_0x26e97b[_0x28ba('0x2c')],'resourceId':_0x26e97b['id'],'type':_0x55011e['name'],'sectionId':_0x55011e['id']},{})['then'](function(){return _0x197a02;});}else{return _0x197a02;}})[_0x28ba('0x48')](function(_0xd9b819){logger[_0x28ba('0x2a')](_0x28ba('0x58'),_0xd9b819);throw _0xd9b819;});}return _0x197a02;});}})[_0x28ba('0x26')](respondWithResult(_0x23e1fc,0xc9))['catch'](handleError(_0x23e1fc,null));};exports['update']=function(_0x307db6,_0x3a309a){if(_0x307db6[_0x28ba('0x56')]['id']){delete _0x307db6['body']['id'];}return db['Campaign'][_0x28ba('0x4c')]({'where':{'id':_0x307db6['params']['id']}})[_0x28ba('0x26')](handleEntityNotFound(_0x3a309a,null))[_0x28ba('0x26')](saveUpdates(_0x307db6[_0x28ba('0x56')],null))[_0x28ba('0x26')](respondWithResult(_0x3a309a,null))['catch'](handleError(_0x3a309a,null));};exports[_0x28ba('0x59')]=function(_0x2406c2,_0x4f3da0){return db['Campaign'][_0x28ba('0x4c')]({'where':{'id':_0x2406c2[_0x28ba('0x4a')]['id']}})[_0x28ba('0x26')](handleEntityNotFound(_0x4f3da0,null))[_0x28ba('0x26')](removeEntity(_0x4f3da0,null))['catch'](handleError(_0x4f3da0,null));};exports[_0x28ba('0x5a')]=function(_0x1c7a28,_0x583c80,_0x20a8af){var _0x3010a1={'raw':!![],'where':{}};var _0x23caa8={};var _0x5f035d={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x1c7a28['params']['id']}})[_0x28ba('0x26')](handleEntityNotFound(_0x583c80,null))[_0x28ba('0x26')](function(_0x21703f){if(_0x21703f){_0x23caa8[_0x28ba('0x33')]=_['keys'](db[_0x28ba('0x5b')][_0x28ba('0x4b')]);_0x23caa8[_0x28ba('0x34')]=_['keys'](_0x1c7a28[_0x28ba('0x34')]);_0x23caa8[_0x28ba('0x36')]=_['intersection'](_0x23caa8[_0x28ba('0x33')],_0x23caa8[_0x28ba('0x34')]);_0x3010a1[_0x28ba('0x39')]=_[_0x28ba('0x37')](_0x23caa8[_0x28ba('0x33')],qs['fields'](_0x1c7a28[_0x28ba('0x34')]['fields']));_0x3010a1[_0x28ba('0x39')]=_0x3010a1[_0x28ba('0x39')][_0x28ba('0x3a')]?_0x3010a1[_0x28ba('0x39')]:_0x23caa8[_0x28ba('0x33')];if(!_0x1c7a28[_0x28ba('0x34')][_0x28ba('0x3b')](_0x28ba('0x3c'))){_0x3010a1[_0x28ba('0x21')]=qs[_0x28ba('0x21')](_0x1c7a28[_0x28ba('0x34')]['limit']);_0x3010a1[_0x28ba('0x1f')]=qs['offset'](_0x1c7a28[_0x28ba('0x34')][_0x28ba('0x1f')]);}_0x3010a1[_0x28ba('0x5c')]=qs['sort'](_0x1c7a28[_0x28ba('0x34')][_0x28ba('0x3d')]);_0x3010a1[_0x28ba('0x40')]=qs[_0x28ba('0x36')](_[_0x28ba('0x3e')](_0x1c7a28['query'],_0x23caa8['filters']));_0x3010a1['where']['CampaignId']=_0x21703f['id'];if(_0x1c7a28[_0x28ba('0x34')][_0x28ba('0x3f')]){_0x3010a1['where']=_['merge'](_0x3010a1['where'],{'$or':_[_0x28ba('0x2f')](_0x3010a1[_0x28ba('0x39')],function(_0x594eda){var _0x92ea20={};_0x92ea20[_0x594eda]={'$like':'%'+_0x1c7a28[_0x28ba('0x34')][_0x28ba('0x3f')]+'%'};return _0x92ea20;})});}_0x3010a1=_[_0x28ba('0x41')]({},_0x3010a1,_0x1c7a28[_0x28ba('0x43')]);return db[_0x28ba('0x5b')][_0x28ba('0x22')]({'where':_0x3010a1[_0x28ba('0x40')]})['then'](function(_0x4d8eb7){_0x5f035d[_0x28ba('0x22')]=_0x4d8eb7;if(_0x1c7a28[_0x28ba('0x34')]['includeAll']){_0x3010a1['include']=[{'all':!![]}];}return db[_0x28ba('0x5b')]['findAll'](_0x3010a1);})[_0x28ba('0x26')](function(_0x5187a9){_0x5f035d[_0x28ba('0x47')]=_0x5187a9;return _0x5f035d;});}})[_0x28ba('0x26')](respondWithFilteredResult(_0x583c80,_0x3010a1))[_0x28ba('0x48')](handleError(_0x583c80,null));};exports[_0x28ba('0x5d')]=function(_0x446eb8,_0x49df4f,_0x30cfd5){var _0x5501dd={'raw':!![],'where':{}};var _0x1479c9={};var _0x14064b={'count':0x0,'rows':[]};return db[_0x28ba('0x30')][_0x28ba('0x5e')]({'where':{'id':_0x446eb8['params']['id']}})[_0x28ba('0x26')](handleEntityNotFound(_0x49df4f,null))[_0x28ba('0x26')](function(_0x3f1ff8){if(_0x3f1ff8){_0x1479c9[_0x28ba('0x33')]=_[_0x28ba('0x35')](db[_0x28ba('0x5f')][_0x28ba('0x4b')]);_0x1479c9[_0x28ba('0x34')]=_[_0x28ba('0x35')](_0x446eb8['query']);_0x1479c9[_0x28ba('0x36')]=_[_0x28ba('0x37')](_0x1479c9[_0x28ba('0x33')],_0x1479c9['query']);_0x5501dd[_0x28ba('0x39')]=_[_0x28ba('0x37')](_0x1479c9[_0x28ba('0x33')],qs[_0x28ba('0x38')](_0x446eb8['query'][_0x28ba('0x38')]));_0x5501dd[_0x28ba('0x39')]=_0x5501dd['attributes'][_0x28ba('0x3a')]?_0x5501dd[_0x28ba('0x39')]:_0x1479c9[_0x28ba('0x33')];if(!_0x446eb8[_0x28ba('0x34')][_0x28ba('0x3b')](_0x28ba('0x3c'))){_0x5501dd[_0x28ba('0x21')]=qs['limit'](_0x446eb8[_0x28ba('0x34')][_0x28ba('0x21')]);_0x5501dd[_0x28ba('0x1f')]=qs[_0x28ba('0x1f')](_0x446eb8['query'][_0x28ba('0x1f')]);}_0x5501dd[_0x28ba('0x5c')]=qs[_0x28ba('0x3d')](_0x446eb8[_0x28ba('0x34')][_0x28ba('0x3d')]);_0x5501dd[_0x28ba('0x40')]=qs[_0x28ba('0x36')](_[_0x28ba('0x3e')](_0x446eb8[_0x28ba('0x34')],_0x1479c9[_0x28ba('0x36')]));_0x5501dd[_0x28ba('0x40')][_0x28ba('0x60')]=_0x3f1ff8['id'];if(_0x446eb8[_0x28ba('0x34')][_0x28ba('0x3f')]){_0x5501dd[_0x28ba('0x40')]=_[_0x28ba('0x41')](_0x5501dd[_0x28ba('0x40')],{'$or':_[_0x28ba('0x2f')](_0x5501dd[_0x28ba('0x39')],function(_0x23989a){var _0x1bf246={};_0x1bf246[_0x23989a]={'$like':'%'+_0x446eb8[_0x28ba('0x34')][_0x28ba('0x3f')]+'%'};return _0x1bf246;})});}_0x5501dd=_[_0x28ba('0x41')]({},_0x5501dd,_0x446eb8[_0x28ba('0x43')]);return db['CmHopperHistory'][_0x28ba('0x22')]({'where':_0x5501dd[_0x28ba('0x40')]})[_0x28ba('0x26')](function(_0x10ae47){_0x14064b['count']=_0x10ae47;if(_0x446eb8[_0x28ba('0x34')][_0x28ba('0x44')]){_0x5501dd[_0x28ba('0x45')]=[{'all':!![]}];}return db[_0x28ba('0x5f')]['findAll'](_0x5501dd);})['then'](function(_0x76c22){_0x14064b[_0x28ba('0x47')]=_0x76c22;return _0x14064b;});}})[_0x28ba('0x26')](respondWithFilteredResult(_0x49df4f,_0x5501dd))[_0x28ba('0x48')](handleError(_0x49df4f,null));};exports[_0x28ba('0x61')]=function(_0x50ae1b,_0x1e73e8,_0x3d14dd){var _0x199678={'raw':!![],'where':{}};var _0x40c504={};var _0x2f2ce0={'count':0x0,'rows':[]};return db[_0x28ba('0x30')][_0x28ba('0x5e')]({'where':{'id':_0x50ae1b[_0x28ba('0x4a')]['id']}})[_0x28ba('0x26')](handleEntityNotFound(_0x1e73e8,null))[_0x28ba('0x26')](function(_0x54e472){if(_0x54e472){_0x40c504[_0x28ba('0x33')]=_[_0x28ba('0x35')](db[_0x28ba('0x62')][_0x28ba('0x4b')]);_0x40c504[_0x28ba('0x34')]=_[_0x28ba('0x35')](_0x50ae1b[_0x28ba('0x34')]);_0x40c504[_0x28ba('0x36')]=_[_0x28ba('0x37')](_0x40c504['model'],_0x40c504['query']);_0x199678['attributes']=_[_0x28ba('0x37')](_0x40c504['model'],qs[_0x28ba('0x38')](_0x50ae1b['query'][_0x28ba('0x38')]));_0x199678[_0x28ba('0x39')]=_0x199678[_0x28ba('0x39')][_0x28ba('0x3a')]?_0x199678[_0x28ba('0x39')]:_0x40c504['model'];if(!_0x50ae1b[_0x28ba('0x34')][_0x28ba('0x3b')](_0x28ba('0x3c'))){_0x199678['limit']=qs[_0x28ba('0x21')](_0x50ae1b[_0x28ba('0x34')]['limit']);_0x199678[_0x28ba('0x1f')]=qs[_0x28ba('0x1f')](_0x50ae1b['query'][_0x28ba('0x1f')]);}_0x199678['order']=qs['sort'](_0x50ae1b[_0x28ba('0x34')][_0x28ba('0x3d')]);_0x199678[_0x28ba('0x40')]=qs[_0x28ba('0x36')](_[_0x28ba('0x3e')](_0x50ae1b[_0x28ba('0x34')],_0x40c504[_0x28ba('0x36')]));_0x199678[_0x28ba('0x40')][_0x28ba('0x60')]=_0x54e472['id'];if(_0x50ae1b[_0x28ba('0x34')]['filter']){_0x199678[_0x28ba('0x40')]=_[_0x28ba('0x41')](_0x199678[_0x28ba('0x40')],{'$or':_[_0x28ba('0x2f')](_0x199678[_0x28ba('0x39')],function(_0x3aae9b){var _0x3f41d8={};_0x3f41d8[_0x3aae9b]={'$like':'%'+_0x50ae1b[_0x28ba('0x34')][_0x28ba('0x3f')]+'%'};return _0x3f41d8;})});}_0x199678=_[_0x28ba('0x41')]({},_0x199678,_0x50ae1b[_0x28ba('0x43')]);return db['CmHopperFinal'][_0x28ba('0x22')]({'where':_0x199678['where']})['then'](function(_0x24dff5){_0x2f2ce0['count']=_0x24dff5;if(_0x50ae1b[_0x28ba('0x34')][_0x28ba('0x44')]){_0x199678[_0x28ba('0x45')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x28ba('0x46')](_0x199678);})['then'](function(_0x4e4706){_0x2f2ce0[_0x28ba('0x47')]=_0x4e4706;return _0x2f2ce0;});}})['then'](respondWithFilteredResult(_0x1e73e8,_0x199678))['catch'](handleError(_0x1e73e8,null));};exports[_0x28ba('0x63')]=function(_0x9620df,_0x5adbef,_0x5c152f){var _0x51a749={'raw':!![],'where':{}};var _0x197c35={};var _0x1ffb9c={'count':0x0,'rows':[]};return db[_0x28ba('0x30')]['findOne']({'where':{'id':_0x9620df['params']['id']}})[_0x28ba('0x26')](handleEntityNotFound(_0x5adbef,null))['then'](function(_0x430f69){if(_0x430f69){_0x197c35[_0x28ba('0x33')]=_[_0x28ba('0x35')](db[_0x28ba('0x64')][_0x28ba('0x4b')]);_0x197c35['query']=_[_0x28ba('0x35')](_0x9620df[_0x28ba('0x34')]);_0x197c35[_0x28ba('0x36')]=_['intersection'](_0x197c35[_0x28ba('0x33')],_0x197c35[_0x28ba('0x34')]);_0x51a749[_0x28ba('0x39')]=_[_0x28ba('0x37')](_0x197c35[_0x28ba('0x33')],qs[_0x28ba('0x38')](_0x9620df[_0x28ba('0x34')][_0x28ba('0x38')]));_0x51a749[_0x28ba('0x39')]=_0x51a749[_0x28ba('0x39')][_0x28ba('0x3a')]?_0x51a749[_0x28ba('0x39')]:_0x197c35[_0x28ba('0x33')];if(!_0x9620df['query'][_0x28ba('0x3b')](_0x28ba('0x3c'))){_0x51a749[_0x28ba('0x21')]=qs['limit'](_0x9620df[_0x28ba('0x34')]['limit']);_0x51a749[_0x28ba('0x1f')]=qs['offset'](_0x9620df[_0x28ba('0x34')]['offset']);}_0x51a749['order']=qs[_0x28ba('0x3d')](_0x9620df[_0x28ba('0x34')]['sort']);_0x51a749[_0x28ba('0x40')]=qs[_0x28ba('0x36')](_[_0x28ba('0x3e')](_0x9620df[_0x28ba('0x34')],_0x197c35[_0x28ba('0x36')]));_0x51a749[_0x28ba('0x40')][_0x28ba('0x60')]=_0x430f69['id'];if(_0x9620df['query'][_0x28ba('0x3f')]){_0x51a749[_0x28ba('0x40')]=_[_0x28ba('0x41')](_0x51a749['where'],{'$or':_[_0x28ba('0x2f')](_0x51a749[_0x28ba('0x39')],function(_0x566c4c){var _0x3565bf={};_0x3565bf[_0x566c4c]={'$like':'%'+_0x9620df[_0x28ba('0x34')][_0x28ba('0x3f')]+'%'};return _0x3565bf;})});}_0x51a749=_['merge']({},_0x51a749,_0x9620df[_0x28ba('0x43')]);return db[_0x28ba('0x64')][_0x28ba('0x22')]({'where':_0x51a749['where']})[_0x28ba('0x26')](function(_0x1df894){_0x1ffb9c[_0x28ba('0x22')]=_0x1df894;if(_0x9620df[_0x28ba('0x34')]['includeAll']){_0x51a749[_0x28ba('0x45')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x51a749);})[_0x28ba('0x26')](function(_0x2b4781){_0x1ffb9c[_0x28ba('0x47')]=_0x2b4781;return _0x1ffb9c;});}})[_0x28ba('0x26')](respondWithFilteredResult(_0x5adbef,_0x51a749))[_0x28ba('0x48')](handleError(_0x5adbef,null));};exports['getLists']=function(_0x385379,_0x533ca2,_0x265ada){var _0x4c8581={};var _0x509ec7={};var _0x2598dc;var _0x528740;return db[_0x28ba('0x30')][_0x28ba('0x5e')]({'where':{'id':_0x385379[_0x28ba('0x4a')]['id']}})[_0x28ba('0x26')](handleEntityNotFound(_0x533ca2,null))[_0x28ba('0x26')](function(_0x1c6a1e){if(_0x1c6a1e){_0x2598dc=_0x1c6a1e;_0x509ec7[_0x28ba('0x33')]=_['keys'](db['CmList']['rawAttributes']);_0x509ec7[_0x28ba('0x34')]=_[_0x28ba('0x35')](_0x385379[_0x28ba('0x34')]);_0x509ec7['filters']=_[_0x28ba('0x37')](_0x509ec7[_0x28ba('0x33')],_0x509ec7[_0x28ba('0x34')]);_0x4c8581['attributes']=_['intersection'](_0x509ec7[_0x28ba('0x33')],qs[_0x28ba('0x38')](_0x385379[_0x28ba('0x34')]['fields']));_0x4c8581[_0x28ba('0x39')]=_0x4c8581['attributes'][_0x28ba('0x3a')]?_0x4c8581['attributes']:_0x509ec7[_0x28ba('0x33')];_0x4c8581[_0x28ba('0x5c')]=qs[_0x28ba('0x3d')](_0x385379[_0x28ba('0x34')][_0x28ba('0x3d')]);_0x4c8581[_0x28ba('0x40')]=qs[_0x28ba('0x36')](_[_0x28ba('0x3e')](_0x385379[_0x28ba('0x34')],_0x509ec7[_0x28ba('0x36')]));if(_0x385379[_0x28ba('0x34')][_0x28ba('0x3f')]){_0x4c8581[_0x28ba('0x40')]=_['merge'](_0x4c8581['where'],{'$or':_[_0x28ba('0x2f')](_0x4c8581['attributes'],function(_0x5c4156){var _0x276c64={};_0x276c64[_0x5c4156]={'$like':'%'+_0x385379['query'][_0x28ba('0x3f')]+'%'};return _0x276c64;})});}_0x4c8581=_[_0x28ba('0x41')]({},_0x4c8581,_0x385379[_0x28ba('0x43')]);return _0x2598dc[_0x28ba('0x65')](_0x4c8581);}})[_0x28ba('0x26')](function(_0x39a74b){if(_0x39a74b){_0x528740=_0x39a74b[_0x28ba('0x3a')];if(!_0x385379[_0x28ba('0x34')][_0x28ba('0x3b')]('nolimit')){_0x4c8581[_0x28ba('0x21')]=qs['limit'](_0x385379[_0x28ba('0x34')][_0x28ba('0x21')]);_0x4c8581[_0x28ba('0x1f')]=qs[_0x28ba('0x1f')](_0x385379[_0x28ba('0x34')][_0x28ba('0x1f')]);}return _0x2598dc[_0x28ba('0x65')](_0x4c8581);}})[_0x28ba('0x26')](function(_0x2a5513){if(_0x2a5513){return _0x2a5513?{'count':_0x528740,'rows':_0x2a5513}:null;}})['then'](respondWithResult(_0x533ca2,null))[_0x28ba('0x48')](handleError(_0x533ca2,null));};exports[_0x28ba('0x66')]=function(_0x2dea45,_0x3ec666,_0x5bdefb){var _0x5a3e6e,_0x1a84c6;var _0x4569ab=[];var _0x5de0f3=moment()[_0x28ba('0x67')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x28ba('0x30')]['find']({'where':{'id':_0x2dea45['params']['id']}})['then'](handleEntityNotFound(_0x3ec666,null))[_0x28ba('0x26')](function(_0x1f85a1){if(_0x1f85a1){_0x1a84c6=_0x1f85a1;return _0x1f85a1['addLists'](_0x2dea45[_0x28ba('0x56')]['ids'],_[_0x28ba('0x54')](_0x2dea45['body'],[_0x28ba('0x68'),'id'])||{});}return null;})[_0x28ba('0x69')](function(_0x48c6ef){var _0x1688ad;var _0x3376a8;_0x5a3e6e=_0x48c6ef||[];var _0x2e5bc2=[];if(_0x48c6ef){for(var _0x3d282f=0x0;_0x3d282f<_0x48c6ef[_0x28ba('0x3a')];_0x3d282f+=0x1){var _0x38b12a=_0x48c6ef[_0x3d282f][_0x28ba('0x27')]({'plain':!![]});_0x1a84c6[_0x28ba('0x6a')]=_0x2dea45[_0x28ba('0x56')][_0x28ba('0x6a')]?_0x2dea45[_0x28ba('0x56')]['dialCheckDuplicateType']:_0x1a84c6[_0x28ba('0x6a')];switch(_0x1a84c6['dialCheckDuplicateType']){case _0x28ba('0x6b'):_0x1688ad=squel['insert']()[_0x28ba('0x6c')]('cm_hopper')['fromQuery']([_0x28ba('0x6d'),_0x28ba('0x6e'),_0x28ba('0x6f'),'ListId',_0x28ba('0x60'),'createdAt',_0x28ba('0x70')],squel[_0x28ba('0x71')]()[_0x28ba('0x72')](_0x28ba('0x6d'),_0x28ba('0x6d'))[_0x28ba('0x72')](_0x28ba('0x73'),_0x28ba('0x6e'))[_0x28ba('0x72')]('id',_0x28ba('0x6f'))[_0x28ba('0x72')](_0x38b12a[_0x28ba('0x74')]['toString'](),_0x28ba('0x75'))['field'](_0x2dea45[_0x28ba('0x4a')]['id'][_0x28ba('0x76')](),_0x28ba('0x60'))[_0x28ba('0x72')]('\x27'+_0x5de0f3+'\x27',_0x28ba('0x55'))[_0x28ba('0x72')]('\x27'+_0x5de0f3+'\x27','updatedAt')[_0x28ba('0x77')](_0x28ba('0x78'))['where'](_0x28ba('0x79'))['where']('ListId\x20=\x20?',_0x38b12a['CmListId']['toString']())[_0x28ba('0x40')](_0x28ba('0x7a'))[_0x28ba('0x40')](_0x28ba('0x7b'),squel[_0x28ba('0x71')]()['field'](_0x28ba('0x7c'))['from']('cm_hopper_final')[_0x28ba('0x40')](_0x28ba('0x7d'),_0x2dea45[_0x28ba('0x4a')]['id']['toString']()))[_0x28ba('0x40')](_0x28ba('0x7b'),squel[_0x28ba('0x71')]()[_0x28ba('0x72')](_0x28ba('0x7e'))['from'](_0x28ba('0x7f'))[_0x28ba('0x40')](_0x28ba('0x7d'),_0x2dea45['params']['id']['toString']())))[_0x28ba('0x76')]();break;case _0x28ba('0x80'):_0x1688ad=squel['insert']()[_0x28ba('0x6c')](_0x28ba('0x7f'))[_0x28ba('0x81')]([_0x28ba('0x6d'),_0x28ba('0x6e'),_0x28ba('0x6f'),'ListId',_0x28ba('0x60'),'createdAt','updatedAt'],squel['select']()[_0x28ba('0x72')](_0x28ba('0x6d'),'phone')[_0x28ba('0x72')](_0x28ba('0x73'),_0x28ba('0x6e'))[_0x28ba('0x72')]('id',_0x28ba('0x6f'))['field'](_0x38b12a['CmListId']['toString'](),'ListId')[_0x28ba('0x72')](_0x2dea45[_0x28ba('0x4a')]['id']['toString'](),_0x28ba('0x60'))[_0x28ba('0x72')]('\x27'+_0x5de0f3+'\x27',_0x28ba('0x55'))[_0x28ba('0x72')]('\x27'+_0x5de0f3+'\x27','updatedAt')['from'](_0x28ba('0x78'))[_0x28ba('0x40')](_0x28ba('0x79'))[_0x28ba('0x40')](_0x28ba('0x82'),_0x38b12a[_0x28ba('0x74')]['toString']())[_0x28ba('0x40')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x28ba('0x7b'),squel[_0x28ba('0x71')]()['field'](_0x28ba('0x7e'))[_0x28ba('0x77')](_0x28ba('0x7f'))[_0x28ba('0x40')]('CampaignId\x20=\x20?',_0x2dea45[_0x28ba('0x4a')]['id'][_0x28ba('0x76')]())))['toString']();break;default:_0x1688ad=squel[_0x28ba('0x83')]()[_0x28ba('0x6c')](_0x28ba('0x7f'))['fromQuery']([_0x28ba('0x6d'),_0x28ba('0x6e'),_0x28ba('0x6f'),'ListId',_0x28ba('0x60'),_0x28ba('0x55'),'updatedAt'],squel[_0x28ba('0x71')]()['field'](_0x28ba('0x6d'),_0x28ba('0x6d'))[_0x28ba('0x72')](_0x28ba('0x73'),'scheduledAt')[_0x28ba('0x72')]('id',_0x28ba('0x6f'))[_0x28ba('0x72')](_0x38b12a['CmListId'][_0x28ba('0x76')](),_0x28ba('0x75'))['field'](_0x2dea45[_0x28ba('0x4a')]['id']['toString'](),_0x28ba('0x60'))[_0x28ba('0x72')]('\x27'+_0x5de0f3+'\x27',_0x28ba('0x55'))[_0x28ba('0x72')]('\x27'+_0x5de0f3+'\x27',_0x28ba('0x70'))[_0x28ba('0x77')](_0x28ba('0x78'))[_0x28ba('0x40')](_0x28ba('0x79'))[_0x28ba('0x40')](_0x28ba('0x82'),_0x38b12a[_0x28ba('0x74')][_0x28ba('0x76')]())[_0x28ba('0x40')]('phone\x20IS\x20NOT\x20NULL'))[_0x28ba('0x76')]();}_0x3376a8=squel[_0x28ba('0x83')]()['into'](_0x28ba('0x84'))['fromQuery']([_0x28ba('0x85'),_0x28ba('0x6e'),_0x28ba('0x6d'),_0x28ba('0x86'),'createdAt',_0x28ba('0x70')],squel[_0x28ba('0x71')]()['field']('h.id','id')['field'](_0x28ba('0x73'),'scheduledAt')[_0x28ba('0x72')]('ci.item',_0x28ba('0x6d'))[_0x28ba('0x72')](_0x28ba('0x87'),_0x28ba('0x86'))[_0x28ba('0x72')]('\x27'+_0x5de0f3+'\x27',_0x28ba('0x55'))[_0x28ba('0x72')]('\x27'+_0x5de0f3+'\x27',_0x28ba('0x70'))[_0x28ba('0x77')](_0x28ba('0x88'),'ci')[_0x28ba('0x89')](_0x28ba('0x7f'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0x28ba('0x40')](_0x28ba('0x8a'),_0x38b12a['CmListId'][_0x28ba('0x76')]())[_0x28ba('0x40')](_0x28ba('0x8b'),_0x2dea45['params']['id'][_0x28ba('0x76')]())[_0x28ba('0x40')](_0x28ba('0x8c'),_0x5de0f3))['toString']();_0x2e5bc2['push'](db['sequelize'][_0x28ba('0x34')](_0x1688ad));_0x4569ab[_0x28ba('0x8d')](db[_0x28ba('0x8e')][_0x28ba('0x34')](_0x3376a8));}return BPromise[_0x28ba('0x8f')](_0x2e5bc2);}})['then'](function(){return BPromise[_0x28ba('0x8f')](_0x4569ab);})[_0x28ba('0x26')](function(){return _0x5a3e6e;})[_0x28ba('0x26')](respondWithResult(_0x3ec666,null))['catch'](handleError(_0x3ec666,null));};exports[_0x28ba('0x90')]=function(_0x5bc61a,_0x1fc67c,_0x309ce9){return db[_0x28ba('0x30')][_0x28ba('0x4c')]({'where':{'id':_0x5bc61a['params']['id']}})[_0x28ba('0x26')](handleEntityNotFound(_0x1fc67c,null))['then'](function(_0x184de3){if(_0x184de3){return _0x184de3[_0x28ba('0x90')](_0x5bc61a[_0x28ba('0x34')][_0x28ba('0x68')]);}})[_0x28ba('0x26')](function(_0x499099){if(_0x499099){return db['CmHopper'][_0x28ba('0x59')]({'where':{'ListId':_0x5bc61a[_0x28ba('0x34')]['ids'],'CampaignId':_0x5bc61a[_0x28ba('0x4a')]['id']}})[_0x28ba('0x26')](function(){return _0x499099;});}})['then'](respondWithStatusCode(_0x1fc67c,null))[_0x28ba('0x48')](handleError(_0x1fc67c,null));};exports[_0x28ba('0x91')]=function(_0x4e7026,_0xa4a083,_0x5109b9){var _0x388565={};var _0x3429b2={};var _0x7b6da9;var _0x57f2b4;return db[_0x28ba('0x30')][_0x28ba('0x5e')]({'where':{'id':_0x4e7026[_0x28ba('0x4a')]['id']}})['then'](handleEntityNotFound(_0xa4a083,null))[_0x28ba('0x26')](function(_0x2132ce){if(_0x2132ce){_0x7b6da9=_0x2132ce;_0x3429b2[_0x28ba('0x33')]=_['keys'](db[_0x28ba('0x92')][_0x28ba('0x4b')]);_0x3429b2[_0x28ba('0x34')]=_[_0x28ba('0x35')](_0x4e7026[_0x28ba('0x34')]);_0x3429b2[_0x28ba('0x36')]=_[_0x28ba('0x37')](_0x3429b2['model'],_0x3429b2[_0x28ba('0x34')]);_0x388565[_0x28ba('0x39')]=_[_0x28ba('0x37')](_0x3429b2['model'],qs[_0x28ba('0x38')](_0x4e7026['query'][_0x28ba('0x38')]));_0x388565[_0x28ba('0x39')]=_0x388565[_0x28ba('0x39')][_0x28ba('0x3a')]?_0x388565[_0x28ba('0x39')]:_0x3429b2[_0x28ba('0x33')];_0x388565[_0x28ba('0x5c')]=qs[_0x28ba('0x3d')](_0x4e7026[_0x28ba('0x34')]['sort']);_0x388565[_0x28ba('0x40')]=qs[_0x28ba('0x36')](_[_0x28ba('0x3e')](_0x4e7026[_0x28ba('0x34')],_0x3429b2[_0x28ba('0x36')]));if(_0x4e7026[_0x28ba('0x34')][_0x28ba('0x3f')]){_0x388565[_0x28ba('0x40')]=_['merge'](_0x388565['where'],{'$or':_[_0x28ba('0x2f')](_0x388565[_0x28ba('0x39')],function(_0x49188c){var _0x19251f={};_0x19251f[_0x49188c]={'$like':'%'+_0x4e7026[_0x28ba('0x34')][_0x28ba('0x3f')]+'%'};return _0x19251f;})});}_0x388565=_[_0x28ba('0x41')]({},_0x388565,_0x4e7026['options']);return _0x7b6da9['getBlackLists'](_0x388565);}})[_0x28ba('0x26')](function(_0x78debf){if(_0x78debf){_0x57f2b4=_0x78debf[_0x28ba('0x3a')];if(!_0x4e7026[_0x28ba('0x34')][_0x28ba('0x3b')](_0x28ba('0x3c'))){_0x388565['limit']=qs['limit'](_0x4e7026['query'][_0x28ba('0x21')]);_0x388565[_0x28ba('0x1f')]=qs[_0x28ba('0x1f')](_0x4e7026['query'][_0x28ba('0x1f')]);}return _0x7b6da9[_0x28ba('0x91')](_0x388565);}})[_0x28ba('0x26')](function(_0x22d960){if(_0x22d960){return _0x22d960?{'count':_0x57f2b4,'rows':_0x22d960}:null;}})[_0x28ba('0x26')](respondWithResult(_0xa4a083,null))['catch'](handleError(_0xa4a083,null));};exports[_0x28ba('0x93')]=function(_0x4be871,_0x203e7d,_0x2789c6){var _0x5e64b9,_0x4f35f9;var _0x30d40a=[];var _0x4f6692=moment()[_0x28ba('0x67')](_0x28ba('0x94'));return db[_0x28ba('0x30')][_0x28ba('0x4c')]({'where':{'id':_0x4be871[_0x28ba('0x4a')]['id']}})[_0x28ba('0x26')](handleEntityNotFound(_0x203e7d,null))[_0x28ba('0x26')](function(_0x52df78){if(_0x52df78){_0x4f35f9=_0x52df78;return _0x52df78[_0x28ba('0x93')](_0x4be871[_0x28ba('0x56')][_0x28ba('0x68')],_[_0x28ba('0x54')](_0x4be871['body'],['ids','id'])||{});}return null;})['spread'](function(_0x4f37c9){var _0x2cb6c9;var _0xa4586c;_0x5e64b9=_0x4f37c9||[];var _0x229486=[];if(_0x4f37c9){for(var _0x5921aa=0x0;_0x5921aa<_0x4f37c9[_0x28ba('0x3a')];_0x5921aa+=0x1){var _0x5b3cf0=_0x4f37c9[_0x5921aa]['get']({'plain':!![]});_0x2cb6c9=squel[_0x28ba('0x83')]()[_0x28ba('0x6c')]('cm_hopper_black')[_0x28ba('0x81')]([_0x28ba('0x6d'),_0x28ba('0x6f'),_0x28ba('0x75'),_0x28ba('0x60'),'createdAt',_0x28ba('0x70')],squel[_0x28ba('0x71')]()[_0x28ba('0x72')](_0x28ba('0x6d'),'phone')[_0x28ba('0x72')]('id','ContactId')['field'](_0x5b3cf0['CmListId'][_0x28ba('0x76')](),'ListId')[_0x28ba('0x72')](_0x4be871[_0x28ba('0x4a')]['id'][_0x28ba('0x76')](),_0x28ba('0x60'))['field'](_0x28ba('0x73'),_0x28ba('0x55'))[_0x28ba('0x72')](_0x28ba('0x73'),_0x28ba('0x70'))['from'](_0x28ba('0x78'))[_0x28ba('0x40')](_0x28ba('0x79'))[_0x28ba('0x40')](_0x28ba('0x82'),_0x5b3cf0[_0x28ba('0x74')][_0x28ba('0x76')]())[_0x28ba('0x40')](_0x28ba('0x7a')))[_0x28ba('0x76')]();_0x229486[_0x28ba('0x8d')](db['sequelize']['query'](_0x2cb6c9));}return BPromise[_0x28ba('0x8f')](_0x229486);}})['then'](function(){return _0x5e64b9;})[_0x28ba('0x26')](respondWithResult(_0x203e7d,null))[_0x28ba('0x48')](handleError(_0x203e7d,null));};exports['removeBlackLists']=function(_0xd44d53,_0x492c9b,_0x1dd82c){return db[_0x28ba('0x30')][_0x28ba('0x4c')]({'where':{'id':_0xd44d53['params']['id']}})['then'](handleEntityNotFound(_0x492c9b,null))['then'](function(_0x134662){if(_0x134662){return _0x134662[_0x28ba('0x95')](_0xd44d53[_0x28ba('0x34')]['ids']);}})[_0x28ba('0x26')](function(_0x177b81){if(_0x177b81){return db[_0x28ba('0x64')][_0x28ba('0x59')]({'where':{'ListId':_0xd44d53[_0x28ba('0x34')][_0x28ba('0x68')],'CampaignId':_0xd44d53['params']['id']}})['then'](function(){return _0x177b81;});}})[_0x28ba('0x26')](respondWithStatusCode(_0x492c9b,null))[_0x28ba('0x48')](handleError(_0x492c9b,null));};
\ No newline at end of file
+var _0xa1aa=['fs-extra','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','get','IvrCampaigns','UserProfileResource','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','catch','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','getHoppers','findOne','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','CmHopperFinal','hasOwnProperty','getHopperBlacks','CmHopperBlack','getLists','CmList','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','spread','dialCheckDuplicateType','into','fromQuery','phone','select','field','NOW()','scheduledAt','CmListId','toString','ListId','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','insert','ContactId','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa1aa,0x19b));var _0xaa1a=function(_0x36c840,_0x4678a1){_0x36c840=_0x36c840-0x0;var _0x3c4c79=_0xa1aa[_0x36c840];return _0x3c4c79;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaa1a('0x0'));var zipdir=require(_0xaa1a('0x1'));var jsonpatch=require(_0xaa1a('0x2'));var rp=require(_0xaa1a('0x3'));var moment=require(_0xaa1a('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaa1a('0x5'));var path=require(_0xaa1a('0x6'));var sox=require('sox');var csv=require(_0xaa1a('0x7'));var ejs=require(_0xaa1a('0x8'));var fs=require('fs');var fs_extra=require(_0xaa1a('0x9'));var _=require('lodash');var squel=require(_0xaa1a('0xa'));var crypto=require('crypto');var jsforce=require(_0xaa1a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xaa1a('0x7'));var querystring=require(_0xaa1a('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xaa1a('0xd'));var qs=require(_0xaa1a('0xe'));var as=require(_0xaa1a('0xf'));var hardwareService=require(_0xaa1a('0x10'));var logger=require('../../config/logger')(_0xaa1a('0x11'));var utils=require(_0xaa1a('0x12'));var config=require(_0xaa1a('0x13'));var licenseUtil=require(_0xaa1a('0x14'));var db=require(_0xaa1a('0x15'))['db'];function respondWithStatusCode(_0x278079,_0x25ae41){_0x25ae41=_0x25ae41||0xcc;return function(_0x2f018d){if(_0x2f018d){return _0x278079[_0xaa1a('0x16')](_0x25ae41);}return _0x278079[_0xaa1a('0x17')](_0x25ae41)['end']();};}function respondWithResult(_0x5b131c,_0x38715a){_0x38715a=_0x38715a||0xc8;return function(_0x3a577f){if(_0x3a577f){return _0x5b131c[_0xaa1a('0x17')](_0x38715a)[_0xaa1a('0x18')](_0x3a577f);}};}function respondWithFilteredResult(_0x43bd93,_0x5da087){return function(_0x90ef70){if(_0x90ef70){var _0x480a27=typeof _0x5da087[_0xaa1a('0x19')]===_0xaa1a('0x1a')&&typeof _0x5da087[_0xaa1a('0x1b')]===_0xaa1a('0x1a');var _0x5ba030=_0x90ef70['count'];var _0x1b3174=_0x480a27?0x0:_0x5da087[_0xaa1a('0x19')];var _0x56ff91=_0x480a27?_0x90ef70[_0xaa1a('0x1c')]:_0x5da087[_0xaa1a('0x19')]+_0x5da087[_0xaa1a('0x1b')];var _0x120080;if(_0x56ff91>=_0x5ba030){_0x56ff91=_0x5ba030;_0x120080=0xc8;}else{_0x120080=0xce;}_0x43bd93[_0xaa1a('0x17')](_0x120080);return _0x43bd93[_0xaa1a('0x1d')]('Content-Range',_0x1b3174+'-'+_0x56ff91+'/'+_0x5ba030)[_0xaa1a('0x18')](_0x90ef70);}return null;};}function patchUpdates(_0x400a06){return function(_0x8586aa){try{jsonpatch[_0xaa1a('0x1e')](_0x8586aa,_0x400a06,!![]);}catch(_0x2c0238){return BPromise[_0xaa1a('0x1f')](_0x2c0238);}return _0x8586aa[_0xaa1a('0x20')]();};}function saveUpdates(_0x5c01b2,_0xa32c54){return function(_0x282f07){if(_0x282f07){return _0x282f07[_0xaa1a('0x21')](_0x5c01b2)['then'](function(_0x262f83){return _0x262f83;});}return null;};}function removeEntity(_0x15b366,_0x583c90){return function(_0x4accdf){if(_0x4accdf){return _0x4accdf[_0xaa1a('0x22')]()[_0xaa1a('0x23')](function(){var _0xd3225b=_0x4accdf[_0xaa1a('0x24')]({'plain':!![]});var _0x582843=_0xaa1a('0x25');return db[_0xaa1a('0x26')]['destroy']({'where':{'type':_0x582843,'resourceId':_0xd3225b['id']}})[_0xaa1a('0x23')](function(){return _0x4accdf;});})[_0xaa1a('0x23')](function(){_0x15b366[_0xaa1a('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43688f,_0x2d1c8f){return function(_0x1b1b67){if(!_0x1b1b67){_0x43688f[_0xaa1a('0x16')](0x194);}return _0x1b1b67;};}function handleError(_0x3f29a8,_0x380a5a){_0x380a5a=_0x380a5a||0x1f4;return function(_0x26fdea){logger['error'](_0x26fdea['stack']);if(_0x26fdea['name']){delete _0x26fdea[_0xaa1a('0x27')];}_0x3f29a8[_0xaa1a('0x17')](_0x380a5a)[_0xaa1a('0x28')](_0x26fdea);};}exports[_0xaa1a('0x29')]=function(_0x559050,_0x14a189){var _0x22ba1d={},_0x2767be={},_0x22b4e3={'count':0x0,'rows':[]};var _0x13afce=_[_0xaa1a('0x2a')](db[_0xaa1a('0x2b')][_0xaa1a('0x2c')],function(_0x2a0d68){return{'name':_0x2a0d68[_0xaa1a('0x2d')],'type':_0x2a0d68[_0xaa1a('0x2e')][_0xaa1a('0x2f')]};});_0x2767be[_0xaa1a('0x30')]=_[_0xaa1a('0x2a')](_0x13afce,_0xaa1a('0x27'));_0x2767be['query']=_['keys'](_0x559050[_0xaa1a('0x31')]);_0x2767be['filters']=_[_0xaa1a('0x32')](_0x2767be[_0xaa1a('0x30')],_0x2767be[_0xaa1a('0x31')]);_0x22ba1d[_0xaa1a('0x33')]=_[_0xaa1a('0x32')](_0x2767be[_0xaa1a('0x30')],qs['fields'](_0x559050[_0xaa1a('0x31')][_0xaa1a('0x34')]));_0x22ba1d[_0xaa1a('0x33')]=_0x22ba1d[_0xaa1a('0x33')][_0xaa1a('0x35')]?_0x22ba1d[_0xaa1a('0x33')]:_0x2767be[_0xaa1a('0x30')];if(!_0x559050[_0xaa1a('0x31')]['hasOwnProperty'](_0xaa1a('0x36'))){_0x22ba1d[_0xaa1a('0x1b')]=qs[_0xaa1a('0x1b')](_0x559050[_0xaa1a('0x31')][_0xaa1a('0x1b')]);_0x22ba1d[_0xaa1a('0x19')]=qs[_0xaa1a('0x19')](_0x559050[_0xaa1a('0x31')][_0xaa1a('0x19')]);}_0x22ba1d[_0xaa1a('0x37')]=qs[_0xaa1a('0x38')](_0x559050[_0xaa1a('0x31')][_0xaa1a('0x38')]);_0x22ba1d[_0xaa1a('0x39')]=qs[_0xaa1a('0x3a')](_[_0xaa1a('0x3b')](_0x559050['query'],_0x2767be['filters']),_0x13afce);if(_0x559050[_0xaa1a('0x31')][_0xaa1a('0x3c')]){_0x22ba1d[_0xaa1a('0x39')]=_[_0xaa1a('0x3d')](_0x22ba1d[_0xaa1a('0x39')],{'$or':_[_0xaa1a('0x2a')](_0x13afce,function(_0x48f1b3){if(_0x48f1b3[_0xaa1a('0x2e')]!=='VIRTUAL'){var _0x3da635={};_0x3da635[_0x48f1b3['name']]={'$like':'%'+_0x559050[_0xaa1a('0x31')][_0xaa1a('0x3c')]+'%'};return _0x3da635;}})});}_0x22ba1d=_[_0xaa1a('0x3d')]({},_0x22ba1d,_0x559050[_0xaa1a('0x3e')]);var _0x5f0170={'where':_0x22ba1d['where']};return db[_0xaa1a('0x2b')][_0xaa1a('0x1c')](_0x5f0170)['then'](function(_0x27971e){_0x22b4e3[_0xaa1a('0x1c')]=_0x27971e;if(_0x559050['query']['includeAll']){_0x22ba1d[_0xaa1a('0x3f')]=[{'all':!![]}];}return db['Campaign'][_0xaa1a('0x40')](_0x22ba1d);})[_0xaa1a('0x23')](function(_0x30011d){_0x22b4e3[_0xaa1a('0x41')]=_0x30011d;return _0x22b4e3;})[_0xaa1a('0x23')](respondWithFilteredResult(_0x14a189,_0x22ba1d))[_0xaa1a('0x42')](handleError(_0x14a189,null));};exports['show']=function(_0x54f7bd,_0x4a2a49){var _0x5ce7f1={'raw':![],'where':{'id':_0x54f7bd['params']['id']}},_0x27fcfd={};_0x27fcfd[_0xaa1a('0x30')]=_[_0xaa1a('0x43')](db[_0xaa1a('0x2b')][_0xaa1a('0x2c')]);_0x27fcfd[_0xaa1a('0x31')]=_[_0xaa1a('0x43')](_0x54f7bd[_0xaa1a('0x31')]);_0x27fcfd[_0xaa1a('0x3a')]=_[_0xaa1a('0x32')](_0x27fcfd[_0xaa1a('0x30')],_0x27fcfd[_0xaa1a('0x31')]);_0x5ce7f1['attributes']=_[_0xaa1a('0x32')](_0x27fcfd[_0xaa1a('0x30')],qs[_0xaa1a('0x34')](_0x54f7bd['query'][_0xaa1a('0x34')]));_0x5ce7f1['attributes']=_0x5ce7f1[_0xaa1a('0x33')][_0xaa1a('0x35')]?_0x5ce7f1[_0xaa1a('0x33')]:_0x27fcfd[_0xaa1a('0x30')];if(_0x54f7bd['query'][_0xaa1a('0x44')]){_0x5ce7f1[_0xaa1a('0x3f')]=[{'all':!![]}];}_0x5ce7f1=_[_0xaa1a('0x3d')]({},_0x5ce7f1,_0x54f7bd[_0xaa1a('0x3e')]);return db[_0xaa1a('0x2b')][_0xaa1a('0x45')](_0x5ce7f1)[_0xaa1a('0x23')](handleEntityNotFound(_0x4a2a49,null))[_0xaa1a('0x23')](respondWithResult(_0x4a2a49,null))[_0xaa1a('0x42')](handleError(_0x4a2a49,null));};exports['create']=function(_0x9a63c0,_0x4327b9){return db[_0xaa1a('0x2b')][_0xaa1a('0x46')](_0x9a63c0[_0xaa1a('0x47')],{})[_0xaa1a('0x23')](function(_0x1aad3a){var _0x3a19be=_0x9a63c0[_0xaa1a('0x48')][_0xaa1a('0x24')]({'plain':!![]});if(!_0x3a19be)throw new Error(_0xaa1a('0x49'));if(_0x3a19be[_0xaa1a('0x4a')]===_0xaa1a('0x48')){var _0x169e85=_0x1aad3a[_0xaa1a('0x24')]({'plain':!![]});var _0x42c5e5=_0xaa1a('0x25');return db[_0xaa1a('0x4b')]['find']({'where':{'name':_0x42c5e5,'userProfileId':_0x3a19be[_0xaa1a('0x4c')]},'raw':!![]})[_0xaa1a('0x23')](function(_0x1b0596){if(_0x1b0596&&_0x1b0596['autoAssociation']===0x0){return db['UserProfileResource'][_0xaa1a('0x46')]({'name':_0x169e85['name'],'resourceId':_0x169e85['id'],'type':_0x1b0596[_0xaa1a('0x27')],'sectionId':_0x1b0596['id']},{})['then'](function(){return _0x1aad3a;});}else{return _0x1aad3a;}})[_0xaa1a('0x42')](function(_0x5bad29){logger[_0xaa1a('0x4d')](_0xaa1a('0x4e'),_0x5bad29);throw _0x5bad29;});}return _0x1aad3a;})[_0xaa1a('0x23')](respondWithResult(_0x4327b9,0xc9))[_0xaa1a('0x42')](handleError(_0x4327b9,null));};exports[_0xaa1a('0x4f')]=function(_0x4fc334,_0x57550d){var _0x4cd226={'where':{'id':_0x4fc334[_0xaa1a('0x50')]['id']}},_0x2ce080={};_0x2ce080[_0xaa1a('0x30')]=_['keys'](db[_0xaa1a('0x2b')][_0xaa1a('0x2c')]);_0x4cd226['attributes']=_['intersection'](_0x2ce080[_0xaa1a('0x30')],qs[_0xaa1a('0x34')](_0x4fc334[_0xaa1a('0x31')][_0xaa1a('0x34')]));_0x4cd226[_0xaa1a('0x33')]=_0x4cd226[_0xaa1a('0x33')][_0xaa1a('0x35')]?_0x4cd226[_0xaa1a('0x33')]:_0x2ce080[_0xaa1a('0x30')];if(_0x4fc334[_0xaa1a('0x31')][_0xaa1a('0x44')]){_0x4cd226[_0xaa1a('0x3f')]=[{'all':!![]}];}_0x4cd226=_['merge']({},_0x4cd226,_0x4fc334[_0xaa1a('0x3e')]);return db['Campaign'][_0xaa1a('0x45')](_0x4cd226)[_0xaa1a('0x23')](handleEntityNotFound(_0x57550d,null))['then'](function(_0x55ad1f){if(_0x55ad1f){var _0xc0cbb8=_0x55ad1f['get']({'plain':!![]});_0xc0cbb8=qs[_0xaa1a('0x51')](_0xc0cbb8,['id',_0xaa1a('0x52'),_0xaa1a('0x53')]);_0x4fc334[_0xaa1a('0x47')]=_[_0xaa1a('0x51')](_0x4fc334[_0xaa1a('0x47')],['id',_0xaa1a('0x52'),_0xaa1a('0x53')]);return db['Campaign'][_0xaa1a('0x46')](_[_0xaa1a('0x3d')](_0xc0cbb8,_0x4fc334['body']),{'include':_0x4fc334[_0xaa1a('0x31')][_0xaa1a('0x44')]?[{'all':!![]}]:undefined})[_0xaa1a('0x23')](function(_0x27aa45){var _0x1c5550=_0x4fc334[_0xaa1a('0x48')]['get']({'plain':!![]});if(!_0x1c5550)throw new Error(_0xaa1a('0x49'));if(_0x1c5550[_0xaa1a('0x4a')]===_0xaa1a('0x48')){var _0x48ce6f=_0x27aa45['get']({'plain':!![]});var _0x43ce51=_0xaa1a('0x25');return db[_0xaa1a('0x4b')]['find']({'where':{'name':_0x43ce51,'userProfileId':_0x1c5550['userProfileId']},'raw':!![]})[_0xaa1a('0x23')](function(_0x37f941){if(_0x37f941&&_0x37f941['autoAssociation']===0x0){return db[_0xaa1a('0x26')][_0xaa1a('0x46')]({'name':_0x48ce6f[_0xaa1a('0x27')],'resourceId':_0x48ce6f['id'],'type':_0x37f941[_0xaa1a('0x27')],'sectionId':_0x37f941['id']},{})[_0xaa1a('0x23')](function(){return _0x27aa45;});}else{return _0x27aa45;}})[_0xaa1a('0x42')](function(_0x50732e){logger[_0xaa1a('0x4d')](_0xaa1a('0x4e'),_0x50732e);throw _0x50732e;});}return _0x27aa45;});}})[_0xaa1a('0x23')](respondWithResult(_0x57550d,0xc9))[_0xaa1a('0x42')](handleError(_0x57550d,null));};exports[_0xaa1a('0x21')]=function(_0x40d6a9,_0x1b2c53){if(_0x40d6a9['body']['id']){delete _0x40d6a9[_0xaa1a('0x47')]['id'];}return db['Campaign'][_0xaa1a('0x45')]({'where':{'id':_0x40d6a9[_0xaa1a('0x50')]['id']}})['then'](handleEntityNotFound(_0x1b2c53,null))[_0xaa1a('0x23')](saveUpdates(_0x40d6a9[_0xaa1a('0x47')],null))[_0xaa1a('0x23')](respondWithResult(_0x1b2c53,null))[_0xaa1a('0x42')](handleError(_0x1b2c53,null));};exports[_0xaa1a('0x22')]=function(_0x2d0476,_0x16c704){return db[_0xaa1a('0x2b')][_0xaa1a('0x45')]({'where':{'id':_0x2d0476[_0xaa1a('0x50')]['id']}})[_0xaa1a('0x23')](handleEntityNotFound(_0x16c704,null))[_0xaa1a('0x23')](removeEntity(_0x16c704,null))[_0xaa1a('0x42')](handleError(_0x16c704,null));};exports[_0xaa1a('0x54')]=function(_0x234c53,_0x57f8a1,_0x4b88b0){var _0xec75db={'raw':!![],'where':{}};var _0xba71f7={};var _0x2d038c={'count':0x0,'rows':[]};return db[_0xaa1a('0x2b')][_0xaa1a('0x55')]({'where':{'id':_0x234c53[_0xaa1a('0x50')]['id']}})[_0xaa1a('0x23')](handleEntityNotFound(_0x57f8a1,null))[_0xaa1a('0x23')](function(_0x5942d4){if(_0x5942d4){_0xba71f7[_0xaa1a('0x30')]=_[_0xaa1a('0x43')](db['CmHopper']['rawAttributes']);_0xba71f7[_0xaa1a('0x31')]=_[_0xaa1a('0x43')](_0x234c53[_0xaa1a('0x31')]);_0xba71f7[_0xaa1a('0x3a')]=_[_0xaa1a('0x32')](_0xba71f7[_0xaa1a('0x30')],_0xba71f7[_0xaa1a('0x31')]);_0xec75db[_0xaa1a('0x33')]=_[_0xaa1a('0x32')](_0xba71f7[_0xaa1a('0x30')],qs[_0xaa1a('0x34')](_0x234c53[_0xaa1a('0x31')][_0xaa1a('0x34')]));_0xec75db[_0xaa1a('0x33')]=_0xec75db[_0xaa1a('0x33')][_0xaa1a('0x35')]?_0xec75db[_0xaa1a('0x33')]:_0xba71f7[_0xaa1a('0x30')];if(!_0x234c53[_0xaa1a('0x31')]['hasOwnProperty'](_0xaa1a('0x36'))){_0xec75db[_0xaa1a('0x1b')]=qs[_0xaa1a('0x1b')](_0x234c53[_0xaa1a('0x31')]['limit']);_0xec75db[_0xaa1a('0x19')]=qs[_0xaa1a('0x19')](_0x234c53[_0xaa1a('0x31')][_0xaa1a('0x19')]);}_0xec75db[_0xaa1a('0x37')]=qs[_0xaa1a('0x38')](_0x234c53[_0xaa1a('0x31')][_0xaa1a('0x38')]);_0xec75db[_0xaa1a('0x39')]=qs['filters'](_[_0xaa1a('0x3b')](_0x234c53[_0xaa1a('0x31')],_0xba71f7['filters']));_0xec75db['where'][_0xaa1a('0x56')]=_0x5942d4['id'];if(_0x234c53[_0xaa1a('0x31')][_0xaa1a('0x3c')]){_0xec75db[_0xaa1a('0x39')]=_[_0xaa1a('0x3d')](_0xec75db[_0xaa1a('0x39')],{'$or':_[_0xaa1a('0x2a')](_0xec75db['attributes'],function(_0x14ed12){var _0x5ac42e={};_0x5ac42e[_0x14ed12]={'$like':'%'+_0x234c53[_0xaa1a('0x31')][_0xaa1a('0x3c')]+'%'};return _0x5ac42e;})});}_0xec75db=_['merge']({},_0xec75db,_0x234c53['options']);return db['CmHopper'][_0xaa1a('0x1c')]({'where':_0xec75db['where']})[_0xaa1a('0x23')](function(_0x573b33){_0x2d038c[_0xaa1a('0x1c')]=_0x573b33;if(_0x234c53['query'][_0xaa1a('0x44')]){_0xec75db[_0xaa1a('0x3f')]=[{'all':!![]}];}return db[_0xaa1a('0x57')]['findAll'](_0xec75db);})['then'](function(_0x1f3682){_0x2d038c[_0xaa1a('0x41')]=_0x1f3682;return _0x2d038c;});}})[_0xaa1a('0x23')](respondWithFilteredResult(_0x57f8a1,_0xec75db))[_0xaa1a('0x42')](handleError(_0x57f8a1,null));};exports[_0xaa1a('0x58')]=function(_0x21d6b3,_0x1223be,_0x26f73f){var _0x409aa2={'raw':!![],'where':{}};var _0x1dfbc1={};var _0xb4a868={'count':0x0,'rows':[]};return db['Campaign'][_0xaa1a('0x55')]({'where':{'id':_0x21d6b3[_0xaa1a('0x50')]['id']}})[_0xaa1a('0x23')](handleEntityNotFound(_0x1223be,null))[_0xaa1a('0x23')](function(_0x35c539){if(_0x35c539){_0x1dfbc1['model']=_[_0xaa1a('0x43')](db[_0xaa1a('0x59')]['rawAttributes']);_0x1dfbc1['query']=_['keys'](_0x21d6b3[_0xaa1a('0x31')]);_0x1dfbc1[_0xaa1a('0x3a')]=_[_0xaa1a('0x32')](_0x1dfbc1['model'],_0x1dfbc1[_0xaa1a('0x31')]);_0x409aa2['attributes']=_['intersection'](_0x1dfbc1[_0xaa1a('0x30')],qs[_0xaa1a('0x34')](_0x21d6b3[_0xaa1a('0x31')][_0xaa1a('0x34')]));_0x409aa2['attributes']=_0x409aa2[_0xaa1a('0x33')]['length']?_0x409aa2[_0xaa1a('0x33')]:_0x1dfbc1[_0xaa1a('0x30')];if(!_0x21d6b3[_0xaa1a('0x31')]['hasOwnProperty'](_0xaa1a('0x36'))){_0x409aa2[_0xaa1a('0x1b')]=qs[_0xaa1a('0x1b')](_0x21d6b3['query']['limit']);_0x409aa2['offset']=qs[_0xaa1a('0x19')](_0x21d6b3[_0xaa1a('0x31')][_0xaa1a('0x19')]);}_0x409aa2[_0xaa1a('0x37')]=qs[_0xaa1a('0x38')](_0x21d6b3[_0xaa1a('0x31')][_0xaa1a('0x38')]);_0x409aa2['where']=qs[_0xaa1a('0x3a')](_[_0xaa1a('0x3b')](_0x21d6b3[_0xaa1a('0x31')],_0x1dfbc1[_0xaa1a('0x3a')]));_0x409aa2[_0xaa1a('0x39')][_0xaa1a('0x56')]=_0x35c539['id'];if(_0x21d6b3['query']['filter']){_0x409aa2['where']=_[_0xaa1a('0x3d')](_0x409aa2[_0xaa1a('0x39')],{'$or':_[_0xaa1a('0x2a')](_0x409aa2[_0xaa1a('0x33')],function(_0x23ee8c){var _0x9fcf4b={};_0x9fcf4b[_0x23ee8c]={'$like':'%'+_0x21d6b3[_0xaa1a('0x31')][_0xaa1a('0x3c')]+'%'};return _0x9fcf4b;})});}_0x409aa2=_['merge']({},_0x409aa2,_0x21d6b3[_0xaa1a('0x3e')]);return db[_0xaa1a('0x59')]['count']({'where':_0x409aa2[_0xaa1a('0x39')]})[_0xaa1a('0x23')](function(_0x984c47){_0xb4a868['count']=_0x984c47;if(_0x21d6b3[_0xaa1a('0x31')]['includeAll']){_0x409aa2['include']=[{'all':!![]}];}return db[_0xaa1a('0x59')][_0xaa1a('0x40')](_0x409aa2);})[_0xaa1a('0x23')](function(_0x82bd71){_0xb4a868[_0xaa1a('0x41')]=_0x82bd71;return _0xb4a868;});}})[_0xaa1a('0x23')](respondWithFilteredResult(_0x1223be,_0x409aa2))[_0xaa1a('0x42')](handleError(_0x1223be,null));};exports['getHopperFinals']=function(_0x56ed8b,_0x3fcead,_0x2ad17b){var _0x589d75={'raw':!![],'where':{}};var _0x80cdef={};var _0x3a3101={'count':0x0,'rows':[]};return db[_0xaa1a('0x2b')][_0xaa1a('0x55')]({'where':{'id':_0x56ed8b[_0xaa1a('0x50')]['id']}})[_0xaa1a('0x23')](handleEntityNotFound(_0x3fcead,null))[_0xaa1a('0x23')](function(_0x200cde){if(_0x200cde){_0x80cdef[_0xaa1a('0x30')]=_[_0xaa1a('0x43')](db[_0xaa1a('0x5a')]['rawAttributes']);_0x80cdef[_0xaa1a('0x31')]=_[_0xaa1a('0x43')](_0x56ed8b[_0xaa1a('0x31')]);_0x80cdef[_0xaa1a('0x3a')]=_[_0xaa1a('0x32')](_0x80cdef[_0xaa1a('0x30')],_0x80cdef[_0xaa1a('0x31')]);_0x589d75[_0xaa1a('0x33')]=_['intersection'](_0x80cdef['model'],qs[_0xaa1a('0x34')](_0x56ed8b['query'][_0xaa1a('0x34')]));_0x589d75[_0xaa1a('0x33')]=_0x589d75['attributes'][_0xaa1a('0x35')]?_0x589d75[_0xaa1a('0x33')]:_0x80cdef[_0xaa1a('0x30')];if(!_0x56ed8b[_0xaa1a('0x31')][_0xaa1a('0x5b')](_0xaa1a('0x36'))){_0x589d75[_0xaa1a('0x1b')]=qs[_0xaa1a('0x1b')](_0x56ed8b[_0xaa1a('0x31')][_0xaa1a('0x1b')]);_0x589d75['offset']=qs[_0xaa1a('0x19')](_0x56ed8b[_0xaa1a('0x31')]['offset']);}_0x589d75['order']=qs[_0xaa1a('0x38')](_0x56ed8b['query'][_0xaa1a('0x38')]);_0x589d75['where']=qs['filters'](_[_0xaa1a('0x3b')](_0x56ed8b['query'],_0x80cdef['filters']));_0x589d75[_0xaa1a('0x39')][_0xaa1a('0x56')]=_0x200cde['id'];if(_0x56ed8b[_0xaa1a('0x31')][_0xaa1a('0x3c')]){_0x589d75[_0xaa1a('0x39')]=_[_0xaa1a('0x3d')](_0x589d75[_0xaa1a('0x39')],{'$or':_[_0xaa1a('0x2a')](_0x589d75[_0xaa1a('0x33')],function(_0x1d6984){var _0x1f2380={};_0x1f2380[_0x1d6984]={'$like':'%'+_0x56ed8b[_0xaa1a('0x31')][_0xaa1a('0x3c')]+'%'};return _0x1f2380;})});}_0x589d75=_[_0xaa1a('0x3d')]({},_0x589d75,_0x56ed8b[_0xaa1a('0x3e')]);return db['CmHopperFinal'][_0xaa1a('0x1c')]({'where':_0x589d75[_0xaa1a('0x39')]})[_0xaa1a('0x23')](function(_0x443ecb){_0x3a3101[_0xaa1a('0x1c')]=_0x443ecb;if(_0x56ed8b['query'][_0xaa1a('0x44')]){_0x589d75[_0xaa1a('0x3f')]=[{'all':!![]}];}return db[_0xaa1a('0x5a')]['findAll'](_0x589d75);})[_0xaa1a('0x23')](function(_0x2fe372){_0x3a3101[_0xaa1a('0x41')]=_0x2fe372;return _0x3a3101;});}})['then'](respondWithFilteredResult(_0x3fcead,_0x589d75))[_0xaa1a('0x42')](handleError(_0x3fcead,null));};exports[_0xaa1a('0x5c')]=function(_0xdd9f5e,_0x5bb405,_0x32b9f4){var _0x3138b1={'raw':!![],'where':{}};var _0x2f16c5={};var _0x1a48b1={'count':0x0,'rows':[]};return db['Campaign'][_0xaa1a('0x55')]({'where':{'id':_0xdd9f5e[_0xaa1a('0x50')]['id']}})[_0xaa1a('0x23')](handleEntityNotFound(_0x5bb405,null))[_0xaa1a('0x23')](function(_0x2cd944){if(_0x2cd944){_0x2f16c5['model']=_[_0xaa1a('0x43')](db[_0xaa1a('0x5d')][_0xaa1a('0x2c')]);_0x2f16c5[_0xaa1a('0x31')]=_[_0xaa1a('0x43')](_0xdd9f5e['query']);_0x2f16c5[_0xaa1a('0x3a')]=_['intersection'](_0x2f16c5[_0xaa1a('0x30')],_0x2f16c5['query']);_0x3138b1['attributes']=_[_0xaa1a('0x32')](_0x2f16c5['model'],qs['fields'](_0xdd9f5e[_0xaa1a('0x31')][_0xaa1a('0x34')]));_0x3138b1[_0xaa1a('0x33')]=_0x3138b1[_0xaa1a('0x33')]['length']?_0x3138b1[_0xaa1a('0x33')]:_0x2f16c5['model'];if(!_0xdd9f5e['query']['hasOwnProperty'](_0xaa1a('0x36'))){_0x3138b1['limit']=qs['limit'](_0xdd9f5e[_0xaa1a('0x31')]['limit']);_0x3138b1[_0xaa1a('0x19')]=qs[_0xaa1a('0x19')](_0xdd9f5e[_0xaa1a('0x31')][_0xaa1a('0x19')]);}_0x3138b1[_0xaa1a('0x37')]=qs[_0xaa1a('0x38')](_0xdd9f5e['query']['sort']);_0x3138b1['where']=qs['filters'](_[_0xaa1a('0x3b')](_0xdd9f5e[_0xaa1a('0x31')],_0x2f16c5['filters']));_0x3138b1[_0xaa1a('0x39')]['CampaignId']=_0x2cd944['id'];if(_0xdd9f5e[_0xaa1a('0x31')][_0xaa1a('0x3c')]){_0x3138b1[_0xaa1a('0x39')]=_[_0xaa1a('0x3d')](_0x3138b1[_0xaa1a('0x39')],{'$or':_[_0xaa1a('0x2a')](_0x3138b1['attributes'],function(_0x5e1e1c){var _0xb371ed={};_0xb371ed[_0x5e1e1c]={'$like':'%'+_0xdd9f5e['query'][_0xaa1a('0x3c')]+'%'};return _0xb371ed;})});}_0x3138b1=_[_0xaa1a('0x3d')]({},_0x3138b1,_0xdd9f5e[_0xaa1a('0x3e')]);return db[_0xaa1a('0x5d')]['count']({'where':_0x3138b1[_0xaa1a('0x39')]})[_0xaa1a('0x23')](function(_0x1eaae4){_0x1a48b1['count']=_0x1eaae4;if(_0xdd9f5e[_0xaa1a('0x31')][_0xaa1a('0x44')]){_0x3138b1[_0xaa1a('0x3f')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x3138b1);})['then'](function(_0x458c9b){_0x1a48b1[_0xaa1a('0x41')]=_0x458c9b;return _0x1a48b1;});}})[_0xaa1a('0x23')](respondWithFilteredResult(_0x5bb405,_0x3138b1))[_0xaa1a('0x42')](handleError(_0x5bb405,null));};exports[_0xaa1a('0x5e')]=function(_0x165c35,_0x291474,_0x4a3120){var _0xab9925={};var _0x54d601={};var _0x565cfa;var _0x13fe6d;return db[_0xaa1a('0x2b')][_0xaa1a('0x55')]({'where':{'id':_0x165c35['params']['id']}})[_0xaa1a('0x23')](handleEntityNotFound(_0x291474,null))[_0xaa1a('0x23')](function(_0x1f84cb){if(_0x1f84cb){_0x565cfa=_0x1f84cb;_0x54d601[_0xaa1a('0x30')]=_[_0xaa1a('0x43')](db[_0xaa1a('0x5f')][_0xaa1a('0x2c')]);_0x54d601['query']=_[_0xaa1a('0x43')](_0x165c35[_0xaa1a('0x31')]);_0x54d601[_0xaa1a('0x3a')]=_[_0xaa1a('0x32')](_0x54d601['model'],_0x54d601['query']);_0xab9925[_0xaa1a('0x33')]=_[_0xaa1a('0x32')](_0x54d601[_0xaa1a('0x30')],qs['fields'](_0x165c35[_0xaa1a('0x31')]['fields']));_0xab9925['attributes']=_0xab9925[_0xaa1a('0x33')][_0xaa1a('0x35')]?_0xab9925[_0xaa1a('0x33')]:_0x54d601['model'];_0xab9925['order']=qs['sort'](_0x165c35[_0xaa1a('0x31')][_0xaa1a('0x38')]);_0xab9925[_0xaa1a('0x39')]=qs[_0xaa1a('0x3a')](_['pick'](_0x165c35[_0xaa1a('0x31')],_0x54d601[_0xaa1a('0x3a')]));if(_0x165c35[_0xaa1a('0x31')]['filter']){_0xab9925[_0xaa1a('0x39')]=_['merge'](_0xab9925['where'],{'$or':_[_0xaa1a('0x2a')](_0xab9925[_0xaa1a('0x33')],function(_0x3efdb5){var _0x7e03f2={};_0x7e03f2[_0x3efdb5]={'$like':'%'+_0x165c35[_0xaa1a('0x31')][_0xaa1a('0x3c')]+'%'};return _0x7e03f2;})});}_0xab9925=_[_0xaa1a('0x3d')]({},_0xab9925,_0x165c35[_0xaa1a('0x3e')]);return _0x565cfa[_0xaa1a('0x5e')](_0xab9925);}})[_0xaa1a('0x23')](function(_0x4fb22d){if(_0x4fb22d){_0x13fe6d=_0x4fb22d['length'];if(!_0x165c35['query'][_0xaa1a('0x5b')](_0xaa1a('0x36'))){_0xab9925[_0xaa1a('0x1b')]=qs['limit'](_0x165c35[_0xaa1a('0x31')]['limit']);_0xab9925[_0xaa1a('0x19')]=qs[_0xaa1a('0x19')](_0x165c35[_0xaa1a('0x31')][_0xaa1a('0x19')]);}return _0x565cfa['getLists'](_0xab9925);}})[_0xaa1a('0x23')](function(_0x220952){if(_0x220952){return _0x220952?{'count':_0x13fe6d,'rows':_0x220952}:null;}})[_0xaa1a('0x23')](respondWithResult(_0x291474,null))['catch'](handleError(_0x291474,null));};exports['addLists']=function(_0xd7fdca,_0x4d1d38,_0x3652f6){var _0x144c11,_0x7a0ad2;var _0x4751d9=[];var _0x328947=moment()['format'](_0xaa1a('0x60'));return db[_0xaa1a('0x2b')][_0xaa1a('0x45')]({'where':{'id':_0xd7fdca[_0xaa1a('0x50')]['id']}})['then'](handleEntityNotFound(_0x4d1d38,null))['then'](function(_0xaad1e6){if(_0xaad1e6){_0x7a0ad2=_0xaad1e6;return _0xaad1e6[_0xaa1a('0x61')](_0xd7fdca[_0xaa1a('0x47')][_0xaa1a('0x62')],_[_0xaa1a('0x51')](_0xd7fdca[_0xaa1a('0x47')],[_0xaa1a('0x62'),'id'])||{});}return null;})[_0xaa1a('0x63')](function(_0x6e9277){var _0x46735e;var _0x22eb26;_0x144c11=_0x6e9277||[];var _0x23c409=[];if(_0x6e9277){for(var _0x12041e=0x0;_0x12041e<_0x6e9277[_0xaa1a('0x35')];_0x12041e+=0x1){var _0x49da0e=_0x6e9277[_0x12041e]['get']({'plain':!![]});_0x7a0ad2[_0xaa1a('0x64')]=_0xd7fdca[_0xaa1a('0x47')]['dialCheckDuplicateType']?_0xd7fdca[_0xaa1a('0x47')][_0xaa1a('0x64')]:_0x7a0ad2[_0xaa1a('0x64')];switch(_0x7a0ad2[_0xaa1a('0x64')]){case'always':_0x46735e=squel['insert']()[_0xaa1a('0x65')]('cm_hopper')[_0xaa1a('0x66')]([_0xaa1a('0x67'),'scheduledAt','ContactId','ListId',_0xaa1a('0x56'),'createdAt',_0xaa1a('0x53')],squel[_0xaa1a('0x68')]()['field']('phone',_0xaa1a('0x67'))[_0xaa1a('0x69')](_0xaa1a('0x6a'),_0xaa1a('0x6b'))['field']('id','ContactId')[_0xaa1a('0x69')](_0x49da0e[_0xaa1a('0x6c')][_0xaa1a('0x6d')](),_0xaa1a('0x6e'))['field'](_0xd7fdca[_0xaa1a('0x50')]['id']['toString'](),_0xaa1a('0x56'))[_0xaa1a('0x69')]('\x27'+_0x328947+'\x27',_0xaa1a('0x52'))[_0xaa1a('0x69')]('\x27'+_0x328947+'\x27',_0xaa1a('0x53'))[_0xaa1a('0x6f')](_0xaa1a('0x70'))[_0xaa1a('0x39')]('deletedAt\x20IS\x20NULL')[_0xaa1a('0x39')](_0xaa1a('0x71'),_0x49da0e[_0xaa1a('0x6c')][_0xaa1a('0x6d')]())['where'](_0xaa1a('0x72'))[_0xaa1a('0x39')](_0xaa1a('0x73'),squel[_0xaa1a('0x68')]()[_0xaa1a('0x69')]('COALESCE(calleridnum,\x27\x27)')[_0xaa1a('0x6f')](_0xaa1a('0x74'))['where'](_0xaa1a('0x75'),_0xd7fdca[_0xaa1a('0x50')]['id'][_0xaa1a('0x6d')]()))[_0xaa1a('0x39')](_0xaa1a('0x73'),squel['select']()[_0xaa1a('0x69')](_0xaa1a('0x76'))[_0xaa1a('0x6f')](_0xaa1a('0x77'))[_0xaa1a('0x39')](_0xaa1a('0x75'),_0xd7fdca['params']['id']['toString']())))[_0xaa1a('0x6d')]();break;case _0xaa1a('0x78'):_0x46735e=squel[_0xaa1a('0x79')]()[_0xaa1a('0x65')](_0xaa1a('0x77'))['fromQuery']([_0xaa1a('0x67'),_0xaa1a('0x6b'),_0xaa1a('0x7a'),_0xaa1a('0x6e'),_0xaa1a('0x56'),_0xaa1a('0x52'),'updatedAt'],squel[_0xaa1a('0x68')]()[_0xaa1a('0x69')](_0xaa1a('0x67'),'phone')['field'](_0xaa1a('0x6a'),_0xaa1a('0x6b'))[_0xaa1a('0x69')]('id',_0xaa1a('0x7a'))[_0xaa1a('0x69')](_0x49da0e[_0xaa1a('0x6c')][_0xaa1a('0x6d')](),_0xaa1a('0x6e'))['field'](_0xd7fdca[_0xaa1a('0x50')]['id']['toString'](),_0xaa1a('0x56'))[_0xaa1a('0x69')]('\x27'+_0x328947+'\x27',_0xaa1a('0x52'))[_0xaa1a('0x69')]('\x27'+_0x328947+'\x27',_0xaa1a('0x53'))['from'](_0xaa1a('0x70'))[_0xaa1a('0x39')](_0xaa1a('0x7b'))[_0xaa1a('0x39')](_0xaa1a('0x71'),_0x49da0e[_0xaa1a('0x6c')][_0xaa1a('0x6d')]())[_0xaa1a('0x39')](_0xaa1a('0x72'))[_0xaa1a('0x39')](_0xaa1a('0x73'),squel[_0xaa1a('0x68')]()['field'](_0xaa1a('0x76'))['from']('cm_hopper')[_0xaa1a('0x39')]('CampaignId\x20=\x20?',_0xd7fdca[_0xaa1a('0x50')]['id']['toString']())))[_0xaa1a('0x6d')]();break;default:_0x46735e=squel[_0xaa1a('0x79')]()['into'](_0xaa1a('0x77'))['fromQuery']([_0xaa1a('0x67'),_0xaa1a('0x6b'),_0xaa1a('0x7a'),_0xaa1a('0x6e'),'CampaignId',_0xaa1a('0x52'),_0xaa1a('0x53')],squel[_0xaa1a('0x68')]()['field'](_0xaa1a('0x67'),_0xaa1a('0x67'))[_0xaa1a('0x69')](_0xaa1a('0x6a'),_0xaa1a('0x6b'))[_0xaa1a('0x69')]('id','ContactId')[_0xaa1a('0x69')](_0x49da0e[_0xaa1a('0x6c')][_0xaa1a('0x6d')](),'ListId')[_0xaa1a('0x69')](_0xd7fdca['params']['id'][_0xaa1a('0x6d')](),_0xaa1a('0x56'))[_0xaa1a('0x69')]('\x27'+_0x328947+'\x27',_0xaa1a('0x52'))[_0xaa1a('0x69')]('\x27'+_0x328947+'\x27',_0xaa1a('0x53'))[_0xaa1a('0x6f')](_0xaa1a('0x70'))[_0xaa1a('0x39')](_0xaa1a('0x7b'))['where'](_0xaa1a('0x71'),_0x49da0e['CmListId'][_0xaa1a('0x6d')]())[_0xaa1a('0x39')](_0xaa1a('0x72')))[_0xaa1a('0x6d')]();}_0x22eb26=squel['insert']()[_0xaa1a('0x65')](_0xaa1a('0x7c'))[_0xaa1a('0x66')]([_0xaa1a('0x7d'),_0xaa1a('0x6b'),_0xaa1a('0x67'),_0xaa1a('0x7e'),_0xaa1a('0x52'),_0xaa1a('0x53')],squel[_0xaa1a('0x68')]()[_0xaa1a('0x69')]('h.id','id')['field']('NOW()','scheduledAt')['field']('ci.item',_0xaa1a('0x67'))[_0xaa1a('0x69')](_0xaa1a('0x7f'),_0xaa1a('0x7e'))[_0xaa1a('0x69')]('\x27'+_0x328947+'\x27','createdAt')['field']('\x27'+_0x328947+'\x27',_0xaa1a('0x53'))[_0xaa1a('0x6f')](_0xaa1a('0x80'),'ci')[_0xaa1a('0x81')](_0xaa1a('0x77'),'h',_0xaa1a('0x82'))[_0xaa1a('0x39')](_0xaa1a('0x83'),_0x49da0e[_0xaa1a('0x6c')][_0xaa1a('0x6d')]())[_0xaa1a('0x39')]('h.CampaignId=?',_0xd7fdca[_0xaa1a('0x50')]['id'][_0xaa1a('0x6d')]())['where'](_0xaa1a('0x84'),_0x328947))['toString']();_0x23c409[_0xaa1a('0x85')](db['sequelize'][_0xaa1a('0x31')](_0x46735e));_0x4751d9['push'](db[_0xaa1a('0x86')][_0xaa1a('0x31')](_0x22eb26));}return BPromise[_0xaa1a('0x87')](_0x23c409);}})[_0xaa1a('0x23')](function(){return BPromise[_0xaa1a('0x87')](_0x4751d9);})[_0xaa1a('0x23')](function(){return _0x144c11;})['then'](respondWithResult(_0x4d1d38,null))['catch'](handleError(_0x4d1d38,null));};exports[_0xaa1a('0x88')]=function(_0x2ad3fc,_0x5e980b,_0x4a02f6){return db[_0xaa1a('0x2b')]['find']({'where':{'id':_0x2ad3fc['params']['id']}})['then'](handleEntityNotFound(_0x5e980b,null))[_0xaa1a('0x23')](function(_0x2f5f10){if(_0x2f5f10){return _0x2f5f10[_0xaa1a('0x88')](_0x2ad3fc[_0xaa1a('0x31')][_0xaa1a('0x62')]);}})[_0xaa1a('0x23')](function(_0x46d0f1){if(_0x46d0f1){return db[_0xaa1a('0x57')][_0xaa1a('0x22')]({'where':{'ListId':_0x2ad3fc[_0xaa1a('0x31')][_0xaa1a('0x62')],'CampaignId':_0x2ad3fc[_0xaa1a('0x50')]['id']}})[_0xaa1a('0x23')](function(){return _0x46d0f1;});}})[_0xaa1a('0x23')](respondWithStatusCode(_0x5e980b,null))[_0xaa1a('0x42')](handleError(_0x5e980b,null));};exports['getBlackLists']=function(_0x5ebd9e,_0x45b799,_0x43a69f){var _0x534e67={};var _0x427ae7={};var _0x305ed9;var _0x24e647;return db[_0xaa1a('0x2b')][_0xaa1a('0x55')]({'where':{'id':_0x5ebd9e[_0xaa1a('0x50')]['id']}})[_0xaa1a('0x23')](handleEntityNotFound(_0x45b799,null))[_0xaa1a('0x23')](function(_0x4165fe){if(_0x4165fe){_0x305ed9=_0x4165fe;_0x427ae7[_0xaa1a('0x30')]=_[_0xaa1a('0x43')](db[_0xaa1a('0x5f')][_0xaa1a('0x2c')]);_0x427ae7[_0xaa1a('0x31')]=_[_0xaa1a('0x43')](_0x5ebd9e[_0xaa1a('0x31')]);_0x427ae7[_0xaa1a('0x3a')]=_[_0xaa1a('0x32')](_0x427ae7[_0xaa1a('0x30')],_0x427ae7[_0xaa1a('0x31')]);_0x534e67[_0xaa1a('0x33')]=_[_0xaa1a('0x32')](_0x427ae7['model'],qs['fields'](_0x5ebd9e[_0xaa1a('0x31')][_0xaa1a('0x34')]));_0x534e67[_0xaa1a('0x33')]=_0x534e67[_0xaa1a('0x33')][_0xaa1a('0x35')]?_0x534e67[_0xaa1a('0x33')]:_0x427ae7[_0xaa1a('0x30')];_0x534e67['order']=qs[_0xaa1a('0x38')](_0x5ebd9e[_0xaa1a('0x31')][_0xaa1a('0x38')]);_0x534e67[_0xaa1a('0x39')]=qs[_0xaa1a('0x3a')](_['pick'](_0x5ebd9e['query'],_0x427ae7[_0xaa1a('0x3a')]));if(_0x5ebd9e[_0xaa1a('0x31')][_0xaa1a('0x3c')]){_0x534e67['where']=_[_0xaa1a('0x3d')](_0x534e67[_0xaa1a('0x39')],{'$or':_['map'](_0x534e67['attributes'],function(_0x2225a4){var _0x440893={};_0x440893[_0x2225a4]={'$like':'%'+_0x5ebd9e['query'][_0xaa1a('0x3c')]+'%'};return _0x440893;})});}_0x534e67=_['merge']({},_0x534e67,_0x5ebd9e[_0xaa1a('0x3e')]);return _0x305ed9['getBlackLists'](_0x534e67);}})[_0xaa1a('0x23')](function(_0x46bbb8){if(_0x46bbb8){_0x24e647=_0x46bbb8[_0xaa1a('0x35')];if(!_0x5ebd9e[_0xaa1a('0x31')]['hasOwnProperty'](_0xaa1a('0x36'))){_0x534e67[_0xaa1a('0x1b')]=qs[_0xaa1a('0x1b')](_0x5ebd9e['query'][_0xaa1a('0x1b')]);_0x534e67[_0xaa1a('0x19')]=qs['offset'](_0x5ebd9e[_0xaa1a('0x31')]['offset']);}return _0x305ed9[_0xaa1a('0x89')](_0x534e67);}})[_0xaa1a('0x23')](function(_0xcb93c6){if(_0xcb93c6){return _0xcb93c6?{'count':_0x24e647,'rows':_0xcb93c6}:null;}})[_0xaa1a('0x23')](respondWithResult(_0x45b799,null))[_0xaa1a('0x42')](handleError(_0x45b799,null));};exports[_0xaa1a('0x8a')]=function(_0x4eb3db,_0x28c478,_0x441bfb){var _0x278f5c,_0x30c88d;var _0x4896a9=[];var _0x3a2be8=moment()[_0xaa1a('0x8b')](_0xaa1a('0x60'));return db['Campaign'][_0xaa1a('0x45')]({'where':{'id':_0x4eb3db[_0xaa1a('0x50')]['id']}})[_0xaa1a('0x23')](handleEntityNotFound(_0x28c478,null))[_0xaa1a('0x23')](function(_0x295e24){if(_0x295e24){_0x30c88d=_0x295e24;return _0x295e24[_0xaa1a('0x8a')](_0x4eb3db[_0xaa1a('0x47')][_0xaa1a('0x62')],_[_0xaa1a('0x51')](_0x4eb3db[_0xaa1a('0x47')],[_0xaa1a('0x62'),'id'])||{});}return null;})[_0xaa1a('0x63')](function(_0x1367d1){var _0xd30d75;var _0x533401;_0x278f5c=_0x1367d1||[];var _0x3fe13f=[];if(_0x1367d1){for(var _0x26b661=0x0;_0x26b661<_0x1367d1[_0xaa1a('0x35')];_0x26b661+=0x1){var _0x150c34=_0x1367d1[_0x26b661]['get']({'plain':!![]});_0xd30d75=squel[_0xaa1a('0x79')]()[_0xaa1a('0x65')]('cm_hopper_black')[_0xaa1a('0x66')](['phone',_0xaa1a('0x7a'),_0xaa1a('0x6e'),_0xaa1a('0x56'),_0xaa1a('0x52'),_0xaa1a('0x53')],squel[_0xaa1a('0x68')]()[_0xaa1a('0x69')]('phone','phone')['field']('id',_0xaa1a('0x7a'))[_0xaa1a('0x69')](_0x150c34['CmListId'][_0xaa1a('0x6d')](),_0xaa1a('0x6e'))[_0xaa1a('0x69')](_0x4eb3db[_0xaa1a('0x50')]['id'][_0xaa1a('0x6d')](),_0xaa1a('0x56'))[_0xaa1a('0x69')]('NOW()','createdAt')[_0xaa1a('0x69')](_0xaa1a('0x6a'),'updatedAt')[_0xaa1a('0x6f')]('cm_contacts')[_0xaa1a('0x39')]('deletedAt\x20IS\x20NULL')[_0xaa1a('0x39')](_0xaa1a('0x71'),_0x150c34[_0xaa1a('0x6c')][_0xaa1a('0x6d')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0xaa1a('0x6d')]();_0x3fe13f[_0xaa1a('0x85')](db['sequelize'][_0xaa1a('0x31')](_0xd30d75));}return BPromise[_0xaa1a('0x87')](_0x3fe13f);}})[_0xaa1a('0x23')](function(){return _0x278f5c;})[_0xaa1a('0x23')](respondWithResult(_0x28c478,null))[_0xaa1a('0x42')](handleError(_0x28c478,null));};exports['removeBlackLists']=function(_0x1eac25,_0x27ebfa,_0x472371){return db[_0xaa1a('0x2b')][_0xaa1a('0x45')]({'where':{'id':_0x1eac25['params']['id']}})['then'](handleEntityNotFound(_0x27ebfa,null))[_0xaa1a('0x23')](function(_0x45fd93){if(_0x45fd93){return _0x45fd93['removeBlackLists'](_0x1eac25['query']['ids']);}})[_0xaa1a('0x23')](function(_0x1518ad){if(_0x1518ad){return db[_0xaa1a('0x5d')][_0xaa1a('0x22')]({'where':{'ListId':_0x1eac25[_0xaa1a('0x31')][_0xaa1a('0x62')],'CampaignId':_0x1eac25[_0xaa1a('0x50')]['id']}})[_0xaa1a('0x23')](function(){return _0x1518ad;});}})[_0xaa1a('0x23')](respondWithStatusCode(_0x27ebfa,null))[_0xaa1a('0x42')](handleError(_0x27ebfa,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 85780ce..ef5c243 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(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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(_0x1d0a89,_0x11eda8){var _0x29a843=function(_0x1a0fbe){while(--_0x1a0fbe){_0x1d0a89['push'](_0x1d0a89['shift']());}};_0x29a843(++_0x11eda8);}(_0x7a54,0x106));var _0x47a5=function(_0xee5f88,_0x355b6c){_0xee5f88=_0xee5f88-0x0;var _0x38476d=_0x7a54[_0xee5f88];return _0x38476d;};'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 e1b324a..33a2588 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 _0x80fb=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetCampaign','findAll','options','raw','where','attributes','limit','include','map','model','util','moment'];(function(_0x3fa65a,_0x5eb65a){var _0x102bbb=function(_0xb3e8c7){while(--_0xb3e8c7){_0x3fa65a['push'](_0x3fa65a['shift']());}};_0x102bbb(++_0x5eb65a);}(_0x80fb,0x11e));var _0xb80f=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0x80fb[_0x50aa2e];return _0x5e07f0;};'use strict';var _=require('lodash');var util=require(_0xb80f('0x0'));var moment=require(_0xb80f('0x1'));var BPromise=require('bluebird');var rs=require(_0xb80f('0x2'));var fs=require('fs');var Redis=require(_0xb80f('0x3'));var db=require(_0xb80f('0x4'))['db'];var utils=require(_0xb80f('0x5'));var logger=require(_0xb80f('0x6'))(_0xb80f('0x7'));var config=require(_0xb80f('0x8'));var jayson=require(_0xb80f('0x9'));var client=jayson['client'][_0xb80f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x251de5,_0x44cc46,_0x2083ab){return new BPromise(function(_0x28027c,_0x1094bb){return client[_0xb80f('0xb')](_0x251de5,_0x2083ab)[_0xb80f('0xc')](function(_0x197faa){logger[_0xb80f('0xd')](_0xb80f('0xe'),_0x44cc46,_0xb80f('0xf'));logger[_0xb80f('0x10')](_0xb80f('0x11'),_0x44cc46,_0xb80f('0xf'),JSON[_0xb80f('0x12')](_0x197faa));if(_0x197faa['error']){if(_0x197faa[_0xb80f('0x13')]['code']===0x1f4){logger[_0xb80f('0x13')](_0xb80f('0xe'),_0x44cc46,_0x197faa[_0xb80f('0x13')][_0xb80f('0x14')]);return _0x1094bb(_0x197faa[_0xb80f('0x13')][_0xb80f('0x14')]);}logger[_0xb80f('0x13')](_0xb80f('0xe'),_0x44cc46,_0x197faa[_0xb80f('0x13')][_0xb80f('0x14')]);return _0x28027c(_0x197faa[_0xb80f('0x13')][_0xb80f('0x14')]);}else{logger[_0xb80f('0xd')](_0xb80f('0xe'),_0x44cc46,_0xb80f('0xf'));_0x28027c(_0x197faa['result'][_0xb80f('0x14')]);}})[_0xb80f('0x15')](function(_0x541c7b){logger['error'](_0xb80f('0xe'),_0x44cc46,_0x541c7b);_0x1094bb(_0x541c7b);});});}exports[_0xb80f('0x16')]=function(_0x6e017c){var _0x353d77=this;return new Promise(function(_0x267f79,_0x347b46){return db['Campaign'][_0xb80f('0x17')]({'raw':_0x6e017c[_0xb80f('0x18')]?_0x6e017c[_0xb80f('0x18')][_0xb80f('0x19')]===undefined?!![]:![]:!![],'where':_0x6e017c[_0xb80f('0x18')]?_0x6e017c[_0xb80f('0x18')][_0xb80f('0x1a')]||null:null,'attributes':_0x6e017c[_0xb80f('0x18')]?_0x6e017c[_0xb80f('0x18')][_0xb80f('0x1b')]||null:null,'limit':_0x6e017c[_0xb80f('0x18')]?_0x6e017c['options'][_0xb80f('0x1c')]||null:null,'include':_0x6e017c['options']?_0x6e017c[_0xb80f('0x18')][_0xb80f('0x1d')]?_['map'](_0x6e017c[_0xb80f('0x18')][_0xb80f('0x1d')],function(_0x4e46fa){return{'model':db[_0x4e46fa['model']],'as':_0x4e46fa['as'],'attributes':_0x4e46fa[_0xb80f('0x1b')],'include':_0x4e46fa[_0xb80f('0x1d')]?_[_0xb80f('0x1e')](_0x4e46fa['include'],function(_0x206209){return{'model':db[_0x206209['model']],'as':_0x206209['as'],'attributes':_0x206209['attributes'],'include':_0x206209[_0xb80f('0x1d')]?_[_0xb80f('0x1e')](_0x206209[_0xb80f('0x1d')],function(_0x12aa3e){return{'model':db[_0x12aa3e[_0xb80f('0x1f')]],'as':_0x12aa3e['as'],'attributes':_0x12aa3e[_0xb80f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb80f('0xc')](function(_0xbffa6e){logger['info']('GetCampaign',_0x6e017c);logger['debug']('GetCampaign',_0x6e017c,JSON[_0xb80f('0x12')](_0xbffa6e));_0x267f79(_0xbffa6e);})[_0xb80f('0x15')](function(_0xe2551e){logger[_0xb80f('0x13')](_0xb80f('0x16'),_0xe2551e[_0xb80f('0x14')],_0x6e017c);_0x347b46(_0x353d77['error'](0x1f4,_0xe2551e[_0xb80f('0x14')]));});});};
\ No newline at end of file
+var _0x502a=['client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','where','attributes','limit','include','map','model','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x5e4e16,_0x324778){var _0x22a0f0=function(_0x283d15){while(--_0x283d15){_0x5e4e16['push'](_0x5e4e16['shift']());}};_0x22a0f0(++_0x324778);}(_0x502a,0xd8));var _0xa502=function(_0x5bb9e4,_0x12c8ce){_0x5bb9e4=_0x5bb9e4-0x0;var _0x317640=_0x502a[_0x5bb9e4];return _0x317640;};'use strict';var _=require(_0xa502('0x0'));var util=require(_0xa502('0x1'));var moment=require('moment');var BPromise=require(_0xa502('0x2'));var rs=require(_0xa502('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa502('0x4'));var logger=require('../../config/logger')(_0xa502('0x5'));var config=require(_0xa502('0x6'));var jayson=require(_0xa502('0x7'));var client=jayson[_0xa502('0x8')][_0xa502('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x489407,_0x329022,_0x29fb03){return new BPromise(function(_0x4d30f2,_0x4e4e5d){return client[_0xa502('0xa')](_0x489407,_0x29fb03)[_0xa502('0xb')](function(_0x5251fa){logger[_0xa502('0xc')](_0xa502('0xd'),_0x329022,_0xa502('0xe'));logger['debug'](_0xa502('0xf'),_0x329022,_0xa502('0xe'),JSON[_0xa502('0x10')](_0x5251fa));if(_0x5251fa['error']){if(_0x5251fa[_0xa502('0x11')][_0xa502('0x12')]===0x1f4){logger['error'](_0xa502('0xd'),_0x329022,_0x5251fa[_0xa502('0x11')]['message']);return _0x4e4e5d(_0x5251fa[_0xa502('0x11')][_0xa502('0x13')]);}logger[_0xa502('0x11')]('Campaign,\x20%s,\x20%s',_0x329022,_0x5251fa[_0xa502('0x11')][_0xa502('0x13')]);return _0x4d30f2(_0x5251fa[_0xa502('0x11')]['message']);}else{logger[_0xa502('0xc')](_0xa502('0xd'),_0x329022,_0xa502('0xe'));_0x4d30f2(_0x5251fa[_0xa502('0x14')][_0xa502('0x13')]);}})[_0xa502('0x15')](function(_0x3107a0){logger[_0xa502('0x11')](_0xa502('0xd'),_0x329022,_0x3107a0);_0x4e4e5d(_0x3107a0);});});}exports[_0xa502('0x16')]=function(_0x1445ec){var _0x315455=this;return new Promise(function(_0x1d2f3d,_0x166453){return db[_0xa502('0x17')][_0xa502('0x18')]({'raw':_0x1445ec[_0xa502('0x19')]?_0x1445ec[_0xa502('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1445ec['options']?_0x1445ec[_0xa502('0x19')][_0xa502('0x1a')]||null:null,'attributes':_0x1445ec[_0xa502('0x19')]?_0x1445ec[_0xa502('0x19')][_0xa502('0x1b')]||null:null,'limit':_0x1445ec[_0xa502('0x19')]?_0x1445ec[_0xa502('0x19')][_0xa502('0x1c')]||null:null,'include':_0x1445ec[_0xa502('0x19')]?_0x1445ec[_0xa502('0x19')][_0xa502('0x1d')]?_[_0xa502('0x1e')](_0x1445ec['options'][_0xa502('0x1d')],function(_0x1e6c5a){return{'model':db[_0x1e6c5a[_0xa502('0x1f')]],'as':_0x1e6c5a['as'],'attributes':_0x1e6c5a[_0xa502('0x1b')],'include':_0x1e6c5a[_0xa502('0x1d')]?_[_0xa502('0x1e')](_0x1e6c5a[_0xa502('0x1d')],function(_0x55476d){return{'model':db[_0x55476d['model']],'as':_0x55476d['as'],'attributes':_0x55476d[_0xa502('0x1b')],'include':_0x55476d['include']?_[_0xa502('0x1e')](_0x55476d[_0xa502('0x1d')],function(_0x5d04ad){return{'model':db[_0x5d04ad[_0xa502('0x1f')]],'as':_0x5d04ad['as'],'attributes':_0x5d04ad[_0xa502('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb2c9a0){logger[_0xa502('0xc')](_0xa502('0x16'),_0x1445ec);logger['debug']('GetCampaign',_0x1445ec,JSON['stringify'](_0xb2c9a0));_0x1d2f3d(_0xb2c9a0);})[_0xa502('0x15')](function(_0x34f7fa){logger['error']('GetCampaign',_0x34f7fa[_0xa502('0x13')],_0x1445ec);_0x166453(_0x315455[_0xa502('0x11')](0x1f4,_0x34f7fa['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index c9ccbdb..9ed9b08 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 _0xa85e=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','getHopperBlacks','getLists','/:id/blacklists','create','post','/:id/clone','clone','/:id/lists','addLists','addBlackLists','put','update','delete','removeLists','removeBlackLists','exports','multer','util','path'];(function(_0x1a15ad,_0x11ba25){var _0xae0190=function(_0x3e5f91){while(--_0x3e5f91){_0x1a15ad['push'](_0x1a15ad['shift']());}};_0xae0190(++_0x11ba25);}(_0xa85e,0x141));var _0xea85=function(_0x343090,_0x433a80){_0x343090=_0x343090-0x0;var _0x3ff3e8=_0xa85e[_0x343090];return _0x3ff3e8;};'use strict';var multer=require(_0xea85('0x0'));var util=require(_0xea85('0x1'));var path=require(_0xea85('0x2'));var timeout=require(_0xea85('0x3'));var express=require(_0xea85('0x4'));var router=express['Router']();var fs_extra=require(_0xea85('0x5'));var auth=require(_0xea85('0x6'));var interaction=require(_0xea85('0x7'));var config=require(_0xea85('0x8'));var controller=require(_0xea85('0x9'));router['get']('/',auth[_0xea85('0xa')](),controller[_0xea85('0xb')]);router[_0xea85('0xc')](_0xea85('0xd'),auth['isAuthenticated'](),controller[_0xea85('0xe')]);router[_0xea85('0xc')](_0xea85('0xf'),auth[_0xea85('0xa')](),controller[_0xea85('0x10')]);router[_0xea85('0xc')](_0xea85('0x11'),auth['isAuthenticated'](),controller[_0xea85('0x12')]);router[_0xea85('0xc')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0xea85('0x13')]);router[_0xea85('0xc')]('/:id/hopper_black',auth[_0xea85('0xa')](),controller[_0xea85('0x14')]);router[_0xea85('0xc')]('/:id/lists',auth[_0xea85('0xa')](),controller[_0xea85('0x15')]);router[_0xea85('0xc')](_0xea85('0x16'),auth['isAuthenticated'](),controller['getBlackLists']);router['post']('/',auth[_0xea85('0xa')](),controller[_0xea85('0x17')]);router[_0xea85('0x18')](_0xea85('0x19'),auth[_0xea85('0xa')](),controller[_0xea85('0x1a')]);router['post'](_0xea85('0x1b'),auth[_0xea85('0xa')](),controller[_0xea85('0x1c')]);router[_0xea85('0x18')](_0xea85('0x16'),auth[_0xea85('0xa')](),controller[_0xea85('0x1d')]);router[_0xea85('0x1e')](_0xea85('0xd'),auth['isAuthenticated'](),controller[_0xea85('0x1f')]);router['delete'](_0xea85('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0xea85('0x20')](_0xea85('0x1b'),auth[_0xea85('0xa')](),controller[_0xea85('0x21')]);router[_0xea85('0x20')]('/:id/blacklists',auth[_0xea85('0xa')](),controller[_0xea85('0x22')]);module[_0xea85('0x23')]=router;
\ No newline at end of file
+var _0xccc7=['getHopperHistories','getHopperFinals','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','/:id','update','destroy','delete','/:id/lists','removeBlackLists','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers'];(function(_0x1e54ff,_0x5d8b68){var _0x53eb79=function(_0x35e2cc){while(--_0x35e2cc){_0x1e54ff['push'](_0x1e54ff['shift']());}};_0x53eb79(++_0x5d8b68);}(_0xccc7,0x17e));var _0x7ccc=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xccc7[_0x40220a];return _0x3903cc;};'use strict';var multer=require(_0x7ccc('0x0'));var util=require(_0x7ccc('0x1'));var path=require(_0x7ccc('0x2'));var timeout=require(_0x7ccc('0x3'));var express=require('express');var router=express[_0x7ccc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7ccc('0x5'));var interaction=require(_0x7ccc('0x6'));var config=require(_0x7ccc('0x7'));var controller=require(_0x7ccc('0x8'));router[_0x7ccc('0x9')]('/',auth[_0x7ccc('0xa')](),controller[_0x7ccc('0xb')]);router[_0x7ccc('0x9')]('/:id',auth[_0x7ccc('0xa')](),controller[_0x7ccc('0xc')]);router['get'](_0x7ccc('0xd'),auth[_0x7ccc('0xa')](),controller['getHoppers']);router['get']('/:id/hopper_histories',auth[_0x7ccc('0xa')](),controller[_0x7ccc('0xe')]);router[_0x7ccc('0x9')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0x7ccc('0xf')]);router[_0x7ccc('0x9')]('/:id/hopper_black',auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0x7ccc('0x9')]('/:id/lists',auth[_0x7ccc('0xa')](),controller[_0x7ccc('0x10')]);router[_0x7ccc('0x9')](_0x7ccc('0x11'),auth[_0x7ccc('0xa')](),controller[_0x7ccc('0x12')]);router[_0x7ccc('0x13')]('/',auth[_0x7ccc('0xa')](),controller[_0x7ccc('0x14')]);router['post'](_0x7ccc('0x15'),auth[_0x7ccc('0xa')](),controller[_0x7ccc('0x16')]);router[_0x7ccc('0x13')]('/:id/lists',auth[_0x7ccc('0xa')](),controller[_0x7ccc('0x17')]);router[_0x7ccc('0x13')]('/:id/blacklists',auth[_0x7ccc('0xa')](),controller[_0x7ccc('0x18')]);router[_0x7ccc('0x19')](_0x7ccc('0x1a'),auth[_0x7ccc('0xa')](),controller[_0x7ccc('0x1b')]);router['delete']('/:id',auth[_0x7ccc('0xa')](),controller[_0x7ccc('0x1c')]);router[_0x7ccc('0x1d')](_0x7ccc('0x1e'),auth[_0x7ccc('0xa')](),controller['removeLists']);router[_0x7ccc('0x1d')]('/:id/blacklists',auth[_0x7ccc('0xa')](),controller[_0x7ccc('0x1f')]);module[_0x7ccc('0x20')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 946a87e..efcb6fe 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 _0xe3fd=['key','sequelize','exports','STRING','getDataValue'];(function(_0x528805,_0x574afc){var _0x1a1fe1=function(_0x30aa01){while(--_0x30aa01){_0x528805['push'](_0x528805['shift']());}};_0x1a1fe1(++_0x574afc);}(_0xe3fd,0x169));var _0xde3f=function(_0x20a29e,_0x3340b8){_0x20a29e=_0x20a29e-0x0;var _0x1a4fcf=_0xe3fd[_0x20a29e];return _0x1a4fcf;};'use strict';var Sequelize=require(_0xde3f('0x0'));module[_0xde3f('0x1')]={'key':{'type':Sequelize[_0xde3f('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0xde3f('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xde3f('0x3')](_0xde3f('0x4'));}}};
\ No newline at end of file
+var _0x77ec=['VIRTUAL','getDataValue','exports','STRING','TEXT'];(function(_0x2b18d8,_0x21778e){var _0x2bcce2=function(_0xc14e4b){while(--_0xc14e4b){_0x2b18d8['push'](_0x2b18d8['shift']());}};_0x2bcce2(++_0x21778e);}(_0x77ec,0x124));var _0xc77e=function(_0x40c792,_0x137005){_0x40c792=_0x40c792-0x0;var _0x57bb53=_0x77ec[_0x40c792];return _0x57bb53;};'use strict';var Sequelize=require('sequelize');module[_0xc77e('0x0')]={'key':{'type':Sequelize[_0xc77e('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xc77e('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xc77e('0x3')],'get':function(){return this[_0xc77e('0x4')]('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 8833acd..c6f56e5 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 _0xed8d=['map','CannedAnswer','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','where','pick','merge','filter','options','rows','catch','show','params','includeAll','include','find','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','apply','reject','update','then','destroy','CannedAnswers','error','stack','name','send'];(function(_0x509f34,_0x5abe46){var _0x2a96db=function(_0x2cfe16){while(--_0x2cfe16){_0x509f34['push'](_0x509f34['shift']());}};_0x2a96db(++_0x5abe46);}(_0xed8d,0x128));var _0xded8=function(_0x3495b7,_0x3054fd){_0x3495b7=_0x3495b7-0x0;var _0x55eff5=_0xed8d[_0x3495b7];return _0x55eff5;};'use strict';var emlformat=require(_0xded8('0x0'));var rimraf=require(_0xded8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xded8('0x2'));var rp=require(_0xded8('0x3'));var moment=require('moment');var BPromise=require(_0xded8('0x4'));var Mustache=require(_0xded8('0x5'));var util=require(_0xded8('0x6'));var path=require(_0xded8('0x7'));var sox=require(_0xded8('0x8'));var csv=require('to-csv');var ejs=require(_0xded8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xded8('0xa'));var crypto=require(_0xded8('0xb'));var jsforce=require(_0xded8('0xc'));var deskjs=require(_0xded8('0xd'));var toCsv=require(_0xded8('0xe'));var querystring=require(_0xded8('0xf'));var Papa=require(_0xded8('0x10'));var Redis=require(_0xded8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xded8('0x12'));var as=require(_0xded8('0x13'));var hardwareService=require(_0xded8('0x14'));var logger=require(_0xded8('0x15'))(_0xded8('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xded8('0x17'));var db=require(_0xded8('0x18'))['db'];function respondWithStatusCode(_0x18d4c3,_0x309f78){_0x309f78=_0x309f78||0xcc;return function(_0x20c552){if(_0x20c552){return _0x18d4c3[_0xded8('0x19')](_0x309f78);}return _0x18d4c3['status'](_0x309f78)[_0xded8('0x1a')]();};}function respondWithResult(_0x55ccaa,_0x31297b){_0x31297b=_0x31297b||0xc8;return function(_0x7bcc11){if(_0x7bcc11){return _0x55ccaa['status'](_0x31297b)[_0xded8('0x1b')](_0x7bcc11);}};}function respondWithFilteredResult(_0xd583c7,_0x1c6403){return function(_0x1684d4){if(_0x1684d4){var _0x370d42=typeof _0x1c6403[_0xded8('0x1c')]===_0xded8('0x1d')&&typeof _0x1c6403['limit']===_0xded8('0x1d');var _0x43fb3f=_0x1684d4[_0xded8('0x1e')];var _0x4aefdf=_0x370d42?0x0:_0x1c6403[_0xded8('0x1c')];var _0x2207e3=_0x370d42?_0x1684d4[_0xded8('0x1e')]:_0x1c6403['offset']+_0x1c6403[_0xded8('0x1f')];var _0xdc5896;if(_0x2207e3>=_0x43fb3f){_0x2207e3=_0x43fb3f;_0xdc5896=0xc8;}else{_0xdc5896=0xce;}_0xd583c7[_0xded8('0x20')](_0xdc5896);return _0xd583c7[_0xded8('0x21')]('Content-Range',_0x4aefdf+'-'+_0x2207e3+'/'+_0x43fb3f)[_0xded8('0x1b')](_0x1684d4);}return null;};}function patchUpdates(_0x173828){return function(_0x16a655){try{jsonpatch[_0xded8('0x22')](_0x16a655,_0x173828,!![]);}catch(_0xfed3d3){return BPromise[_0xded8('0x23')](_0xfed3d3);}return _0x16a655['save']();};}function saveUpdates(_0x44161e,_0x2d8714){return function(_0x156f52){if(_0x156f52){return _0x156f52[_0xded8('0x24')](_0x44161e)[_0xded8('0x25')](function(_0x5d38b2){return _0x5d38b2;});}return null;};}function removeEntity(_0x830f5c,_0x20a5dc){return function(_0x39f0e3){if(_0x39f0e3){return _0x39f0e3[_0xded8('0x26')]()[_0xded8('0x25')](function(){var _0x4675a7=_0x39f0e3['get']({'plain':!![]});var _0x9cb396=_0xded8('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x9cb396,'resourceId':_0x4675a7['id']}})[_0xded8('0x25')](function(){return _0x39f0e3;});})[_0xded8('0x25')](function(){_0x830f5c['status'](0xcc)[_0xded8('0x1a')]();});}};}function handleEntityNotFound(_0x4c2b72,_0x5e0b58){return function(_0x3fa3b8){if(!_0x3fa3b8){_0x4c2b72['sendStatus'](0x194);}return _0x3fa3b8;};}function handleError(_0x12f649,_0xd68c2){_0xd68c2=_0xd68c2||0x1f4;return function(_0x471fd0){logger[_0xded8('0x28')](_0x471fd0[_0xded8('0x29')]);if(_0x471fd0[_0xded8('0x2a')]){delete _0x471fd0[_0xded8('0x2a')];}_0x12f649[_0xded8('0x20')](_0xd68c2)[_0xded8('0x2b')](_0x471fd0);};}exports['index']=function(_0x2c3a6a,_0x3d330f){var _0x38908d={},_0x29855f={},_0xff33ad={'count':0x0,'rows':[]};var _0x60ae4c=_[_0xded8('0x2c')](db[_0xded8('0x2d')][_0xded8('0x2e')],function(_0x5cfe66){return{'name':_0x5cfe66[_0xded8('0x2f')],'type':_0x5cfe66[_0xded8('0x30')]['key']};});_0x29855f[_0xded8('0x31')]=_['map'](_0x60ae4c,_0xded8('0x2a'));_0x29855f[_0xded8('0x32')]=_[_0xded8('0x33')](_0x2c3a6a['query']);_0x29855f[_0xded8('0x34')]=_[_0xded8('0x35')](_0x29855f['model'],_0x29855f[_0xded8('0x32')]);_0x38908d['attributes']=_[_0xded8('0x35')](_0x29855f[_0xded8('0x31')],qs['fields'](_0x2c3a6a['query'][_0xded8('0x36')]));_0x38908d[_0xded8('0x37')]=_0x38908d[_0xded8('0x37')][_0xded8('0x38')]?_0x38908d[_0xded8('0x37')]:_0x29855f[_0xded8('0x31')];if(!_0x2c3a6a[_0xded8('0x32')]['hasOwnProperty'](_0xded8('0x39'))){_0x38908d[_0xded8('0x1f')]=qs['limit'](_0x2c3a6a['query'][_0xded8('0x1f')]);_0x38908d['offset']=qs[_0xded8('0x1c')](_0x2c3a6a[_0xded8('0x32')][_0xded8('0x1c')]);}_0x38908d[_0xded8('0x3a')]=qs['sort'](_0x2c3a6a[_0xded8('0x32')]['sort']);_0x38908d[_0xded8('0x3b')]=qs[_0xded8('0x34')](_[_0xded8('0x3c')](_0x2c3a6a[_0xded8('0x32')],_0x29855f[_0xded8('0x34')]),_0x60ae4c);if(_0x2c3a6a[_0xded8('0x32')]['filter']){_0x38908d[_0xded8('0x3b')]=_[_0xded8('0x3d')](_0x38908d[_0xded8('0x3b')],{'$or':[{'key':{'$like':'%'+_0x2c3a6a[_0xded8('0x32')][_0xded8('0x3e')]+'%'}},{'value':{'$like':'%'+_0x2c3a6a[_0xded8('0x32')][_0xded8('0x3e')]+'%'}}]});}_0x38908d=_[_0xded8('0x3d')]({},_0x38908d,_0x2c3a6a[_0xded8('0x3f')]);var _0x192e58={'where':_0x38908d[_0xded8('0x3b')]};return db[_0xded8('0x2d')][_0xded8('0x1e')](_0x192e58)[_0xded8('0x25')](function(_0x4be6af){_0xff33ad[_0xded8('0x1e')]=_0x4be6af;if(_0x2c3a6a[_0xded8('0x32')]['includeAll']){_0x38908d['include']=[{'all':!![]}];}return db[_0xded8('0x2d')]['findAll'](_0x38908d);})[_0xded8('0x25')](function(_0x549759){_0xff33ad[_0xded8('0x40')]=_0x549759;return _0xff33ad;})[_0xded8('0x25')](respondWithFilteredResult(_0x3d330f,_0x38908d))[_0xded8('0x41')](handleError(_0x3d330f,null));};exports[_0xded8('0x42')]=function(_0x491336,_0x22b184){var _0x1289d8={'raw':!![],'where':{'id':_0x491336[_0xded8('0x43')]['id']}},_0x57aff7={};_0x57aff7[_0xded8('0x31')]=_['keys'](db['CannedAnswer'][_0xded8('0x2e')]);_0x57aff7[_0xded8('0x32')]=_[_0xded8('0x33')](_0x491336['query']);_0x57aff7[_0xded8('0x34')]=_[_0xded8('0x35')](_0x57aff7[_0xded8('0x31')],_0x57aff7[_0xded8('0x32')]);_0x1289d8[_0xded8('0x37')]=_[_0xded8('0x35')](_0x57aff7[_0xded8('0x31')],qs['fields'](_0x491336[_0xded8('0x32')][_0xded8('0x36')]));_0x1289d8[_0xded8('0x37')]=_0x1289d8[_0xded8('0x37')][_0xded8('0x38')]?_0x1289d8[_0xded8('0x37')]:_0x57aff7[_0xded8('0x31')];if(_0x491336[_0xded8('0x32')][_0xded8('0x44')]){_0x1289d8[_0xded8('0x45')]=[{'all':!![]}];}_0x1289d8=_[_0xded8('0x3d')]({},_0x1289d8,_0x491336[_0xded8('0x3f')]);return db['CannedAnswer'][_0xded8('0x46')](_0x1289d8)[_0xded8('0x25')](handleEntityNotFound(_0x22b184,null))[_0xded8('0x25')](respondWithResult(_0x22b184,null))[_0xded8('0x41')](handleError(_0x22b184,null));};exports[_0xded8('0x24')]=function(_0x5c385b,_0x22648b){if(_0x5c385b[_0xded8('0x47')]['id']){delete _0x5c385b[_0xded8('0x47')]['id'];}return db[_0xded8('0x2d')][_0xded8('0x46')]({'where':{'id':_0x5c385b[_0xded8('0x43')]['id']}})[_0xded8('0x25')](handleEntityNotFound(_0x22648b,null))[_0xded8('0x25')](saveUpdates(_0x5c385b[_0xded8('0x47')],null))[_0xded8('0x25')](respondWithResult(_0x22648b,null))[_0xded8('0x41')](handleError(_0x22648b,null));};exports[_0xded8('0x26')]=function(_0xc400d4,_0x2c3e3f){return db['CannedAnswer'][_0xded8('0x46')]({'where':{'id':_0xc400d4[_0xded8('0x43')]['id']}})[_0xded8('0x25')](handleEntityNotFound(_0x2c3e3f,null))[_0xded8('0x25')](removeEntity(_0x2c3e3f,null))[_0xded8('0x41')](handleError(_0x2c3e3f,null));};exports[_0xded8('0x48')]=function(_0x1cb137,_0x383458){var _0x187bb6={'key':_0x1cb137[_0xded8('0x47')][_0xded8('0x49')]};if(_0x1cb137['body'][_0xded8('0x4a')]){_0x187bb6[_0xded8('0x4a')]=_0x1cb137[_0xded8('0x47')][_0xded8('0x4a')];}else if(_0x1cb137[_0xded8('0x47')][_0xded8('0x4b')]){_0x187bb6[_0xded8('0x4b')]=_0x1cb137[_0xded8('0x47')][_0xded8('0x4b')];}else if(_0x1cb137['body'][_0xded8('0x4c')]){_0x187bb6[_0xded8('0x4c')]=_0x1cb137[_0xded8('0x47')][_0xded8('0x4c')];}else if(_0x1cb137[_0xded8('0x47')][_0xded8('0x4d')]){_0x187bb6[_0xded8('0x4d')]=_0x1cb137[_0xded8('0x47')][_0xded8('0x4d')];}return db[_0xded8('0x2d')][_0xded8('0x46')]({'where':_0x187bb6})[_0xded8('0x25')](function(_0x7c0970){if(_0x7c0970){throw new db[(_0xded8('0x4e'))]['ValidationError'](_0xded8('0x4f'));}return db['CannedAnswer']['create'](_0x1cb137[_0xded8('0x47')]);})[_0xded8('0x25')](function(_0x42d287){var _0x22a063=_0x1cb137[_0xded8('0x50')][_0xded8('0x51')]({'plain':!![]});if(!_0x22a063)throw new Error(_0xded8('0x52'));if(_0x22a063['role']===_0xded8('0x50')){var _0x26be98=_0x42d287['get']({'plain':!![]});return db['UserProfileSection'][_0xded8('0x46')]({'where':{'name':'CannedAnswers','userProfileId':_0x22a063[_0xded8('0x53')]},'raw':!![]})[_0xded8('0x25')](function(_0x348be1){if(_0x348be1&&_0x348be1[_0xded8('0x54')]===0x0){return db['UserProfileResource'][_0xded8('0x48')]({'name':_0x26be98[_0xded8('0x2a')],'resourceId':_0x26be98['id'],'type':_0x348be1['name'],'sectionId':_0x348be1['id']},{})[_0xded8('0x25')](function(){return _0x42d287;});}else{return _0x42d287;}})[_0xded8('0x41')](function(_0x41199b){logger[_0xded8('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x41199b);throw _0x41199b;});}return _0x42d287;})[_0xded8('0x25')](respondWithResult(_0x383458,0xc9))[_0xded8('0x41')](handleError(_0x383458,null));};
\ No newline at end of file
+var _0xef87=['pick','filter','count','include','findAll','rows','catch','show','params','keys','includeAll','merge','options','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','destroy','CannedAnswers','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x340380,_0x4bd2a8){var _0x49ce1c=function(_0x4cb9e2){while(--_0x4cb9e2){_0x340380['push'](_0x340380['shift']());}};_0x49ce1c(++_0x4bd2a8);}(_0xef87,0x77));var _0x7ef8=function(_0x3f3b58,_0x77cb16){_0x3f3b58=_0x3f3b58-0x0;var _0x4eb22f=_0xef87[_0x3f3b58];return _0x4eb22f;};'use strict';var emlformat=require(_0x7ef8('0x0'));var rimraf=require(_0x7ef8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7ef8('0x2'));var rp=require(_0x7ef8('0x3'));var moment=require(_0x7ef8('0x4'));var BPromise=require(_0x7ef8('0x5'));var Mustache=require(_0x7ef8('0x6'));var util=require('util');var path=require(_0x7ef8('0x7'));var sox=require(_0x7ef8('0x8'));var csv=require('to-csv');var ejs=require(_0x7ef8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7ef8('0xa'));var squel=require('squel');var crypto=require(_0x7ef8('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7ef8('0xc'));var querystring=require(_0x7ef8('0xd'));var Papa=require('papaparse');var Redis=require(_0x7ef8('0xe'));var authService=require(_0x7ef8('0xf'));var qs=require(_0x7ef8('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7ef8('0x11'));var logger=require(_0x7ef8('0x12'))(_0x7ef8('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7ef8('0x14'));var db=require(_0x7ef8('0x15'))['db'];function respondWithStatusCode(_0x475f8e,_0x80bca4){_0x80bca4=_0x80bca4||0xcc;return function(_0x459358){if(_0x459358){return _0x475f8e[_0x7ef8('0x16')](_0x80bca4);}return _0x475f8e['status'](_0x80bca4)[_0x7ef8('0x17')]();};}function respondWithResult(_0x54d66e,_0x1a408d){_0x1a408d=_0x1a408d||0xc8;return function(_0x24b5d1){if(_0x24b5d1){return _0x54d66e[_0x7ef8('0x18')](_0x1a408d)[_0x7ef8('0x19')](_0x24b5d1);}};}function respondWithFilteredResult(_0x22928f,_0x2ceb24){return function(_0x3898ca){if(_0x3898ca){var _0x411ba9=typeof _0x2ceb24[_0x7ef8('0x1a')]===_0x7ef8('0x1b')&&typeof _0x2ceb24[_0x7ef8('0x1c')]==='undefined';var _0x275526=_0x3898ca['count'];var _0x509f7f=_0x411ba9?0x0:_0x2ceb24['offset'];var _0x4bcdca=_0x411ba9?_0x3898ca['count']:_0x2ceb24[_0x7ef8('0x1a')]+_0x2ceb24[_0x7ef8('0x1c')];var _0xf94e2c;if(_0x4bcdca>=_0x275526){_0x4bcdca=_0x275526;_0xf94e2c=0xc8;}else{_0xf94e2c=0xce;}_0x22928f['status'](_0xf94e2c);return _0x22928f[_0x7ef8('0x1d')](_0x7ef8('0x1e'),_0x509f7f+'-'+_0x4bcdca+'/'+_0x275526)[_0x7ef8('0x19')](_0x3898ca);}return null;};}function patchUpdates(_0x1e0a72){return function(_0x5b2c2e){try{jsonpatch['apply'](_0x5b2c2e,_0x1e0a72,!![]);}catch(_0x50f2ec){return BPromise[_0x7ef8('0x1f')](_0x50f2ec);}return _0x5b2c2e[_0x7ef8('0x20')]();};}function saveUpdates(_0x47f52,_0x4085d3){return function(_0x3bf911){if(_0x3bf911){return _0x3bf911[_0x7ef8('0x21')](_0x47f52)[_0x7ef8('0x22')](function(_0x32d634){return _0x32d634;});}return null;};}function removeEntity(_0x13570a,_0x5b8c29){return function(_0xb7e7a8){if(_0xb7e7a8){return _0xb7e7a8[_0x7ef8('0x23')]()[_0x7ef8('0x22')](function(){var _0x5ab29f=_0xb7e7a8['get']({'plain':!![]});var _0xc5cd1a=_0x7ef8('0x24');return db['UserProfileResource'][_0x7ef8('0x23')]({'where':{'type':_0xc5cd1a,'resourceId':_0x5ab29f['id']}})['then'](function(){return _0xb7e7a8;});})[_0x7ef8('0x22')](function(){_0x13570a[_0x7ef8('0x18')](0xcc)[_0x7ef8('0x17')]();});}};}function handleEntityNotFound(_0x5e8595,_0x945161){return function(_0xaec23d){if(!_0xaec23d){_0x5e8595['sendStatus'](0x194);}return _0xaec23d;};}function handleError(_0x4ccf33,_0x2ce598){_0x2ce598=_0x2ce598||0x1f4;return function(_0x344be4){logger[_0x7ef8('0x25')](_0x344be4[_0x7ef8('0x26')]);if(_0x344be4[_0x7ef8('0x27')]){delete _0x344be4[_0x7ef8('0x27')];}_0x4ccf33['status'](_0x2ce598)[_0x7ef8('0x28')](_0x344be4);};}exports[_0x7ef8('0x29')]=function(_0x4d5c1d,_0x2bb3f7){var _0x5389e9={},_0x458f21={},_0x5510f5={'count':0x0,'rows':[]};var _0x2384e8=_[_0x7ef8('0x2a')](db[_0x7ef8('0x2b')][_0x7ef8('0x2c')],function(_0x352308){return{'name':_0x352308[_0x7ef8('0x2d')],'type':_0x352308['type'][_0x7ef8('0x2e')]};});_0x458f21[_0x7ef8('0x2f')]=_[_0x7ef8('0x2a')](_0x2384e8,'name');_0x458f21[_0x7ef8('0x30')]=_['keys'](_0x4d5c1d[_0x7ef8('0x30')]);_0x458f21[_0x7ef8('0x31')]=_[_0x7ef8('0x32')](_0x458f21['model'],_0x458f21[_0x7ef8('0x30')]);_0x5389e9['attributes']=_[_0x7ef8('0x32')](_0x458f21['model'],qs[_0x7ef8('0x33')](_0x4d5c1d[_0x7ef8('0x30')][_0x7ef8('0x33')]));_0x5389e9[_0x7ef8('0x34')]=_0x5389e9['attributes'][_0x7ef8('0x35')]?_0x5389e9[_0x7ef8('0x34')]:_0x458f21[_0x7ef8('0x2f')];if(!_0x4d5c1d['query'][_0x7ef8('0x36')](_0x7ef8('0x37'))){_0x5389e9['limit']=qs['limit'](_0x4d5c1d['query'][_0x7ef8('0x1c')]);_0x5389e9['offset']=qs[_0x7ef8('0x1a')](_0x4d5c1d[_0x7ef8('0x30')][_0x7ef8('0x1a')]);}_0x5389e9[_0x7ef8('0x38')]=qs['sort'](_0x4d5c1d[_0x7ef8('0x30')][_0x7ef8('0x39')]);_0x5389e9[_0x7ef8('0x3a')]=qs['filters'](_[_0x7ef8('0x3b')](_0x4d5c1d['query'],_0x458f21['filters']),_0x2384e8);if(_0x4d5c1d['query']['filter']){_0x5389e9[_0x7ef8('0x3a')]=_['merge'](_0x5389e9['where'],{'$or':[{'key':{'$like':'%'+_0x4d5c1d[_0x7ef8('0x30')][_0x7ef8('0x3c')]+'%'}},{'value':{'$like':'%'+_0x4d5c1d[_0x7ef8('0x30')][_0x7ef8('0x3c')]+'%'}}]});}_0x5389e9=_['merge']({},_0x5389e9,_0x4d5c1d['options']);var _0x373177={'where':_0x5389e9['where']};return db['CannedAnswer'][_0x7ef8('0x3d')](_0x373177)[_0x7ef8('0x22')](function(_0x32f51f){_0x5510f5[_0x7ef8('0x3d')]=_0x32f51f;if(_0x4d5c1d['query']['includeAll']){_0x5389e9[_0x7ef8('0x3e')]=[{'all':!![]}];}return db[_0x7ef8('0x2b')][_0x7ef8('0x3f')](_0x5389e9);})[_0x7ef8('0x22')](function(_0x3d1c6d){_0x5510f5[_0x7ef8('0x40')]=_0x3d1c6d;return _0x5510f5;})[_0x7ef8('0x22')](respondWithFilteredResult(_0x2bb3f7,_0x5389e9))[_0x7ef8('0x41')](handleError(_0x2bb3f7,null));};exports[_0x7ef8('0x42')]=function(_0x4ca94b,_0x2ffe55){var _0x31424a={'raw':!![],'where':{'id':_0x4ca94b[_0x7ef8('0x43')]['id']}},_0x4fead3={};_0x4fead3[_0x7ef8('0x2f')]=_[_0x7ef8('0x44')](db[_0x7ef8('0x2b')][_0x7ef8('0x2c')]);_0x4fead3[_0x7ef8('0x30')]=_[_0x7ef8('0x44')](_0x4ca94b[_0x7ef8('0x30')]);_0x4fead3[_0x7ef8('0x31')]=_[_0x7ef8('0x32')](_0x4fead3[_0x7ef8('0x2f')],_0x4fead3[_0x7ef8('0x30')]);_0x31424a['attributes']=_['intersection'](_0x4fead3[_0x7ef8('0x2f')],qs[_0x7ef8('0x33')](_0x4ca94b[_0x7ef8('0x30')]['fields']));_0x31424a['attributes']=_0x31424a[_0x7ef8('0x34')][_0x7ef8('0x35')]?_0x31424a[_0x7ef8('0x34')]:_0x4fead3[_0x7ef8('0x2f')];if(_0x4ca94b['query'][_0x7ef8('0x45')]){_0x31424a['include']=[{'all':!![]}];}_0x31424a=_[_0x7ef8('0x46')]({},_0x31424a,_0x4ca94b[_0x7ef8('0x47')]);return db[_0x7ef8('0x2b')][_0x7ef8('0x48')](_0x31424a)[_0x7ef8('0x22')](handleEntityNotFound(_0x2ffe55,null))['then'](respondWithResult(_0x2ffe55,null))[_0x7ef8('0x41')](handleError(_0x2ffe55,null));};exports[_0x7ef8('0x21')]=function(_0x16710e,_0x4b3872){if(_0x16710e['body']['id']){delete _0x16710e['body']['id'];}return db[_0x7ef8('0x2b')]['find']({'where':{'id':_0x16710e['params']['id']}})['then'](handleEntityNotFound(_0x4b3872,null))[_0x7ef8('0x22')](saveUpdates(_0x16710e[_0x7ef8('0x49')],null))[_0x7ef8('0x22')](respondWithResult(_0x4b3872,null))[_0x7ef8('0x41')](handleError(_0x4b3872,null));};exports[_0x7ef8('0x23')]=function(_0x40f5b2,_0x2fe775){return db[_0x7ef8('0x2b')][_0x7ef8('0x48')]({'where':{'id':_0x40f5b2['params']['id']}})[_0x7ef8('0x22')](handleEntityNotFound(_0x2fe775,null))['then'](removeEntity(_0x2fe775,null))[_0x7ef8('0x41')](handleError(_0x2fe775,null));};exports[_0x7ef8('0x4a')]=function(_0x4a0534,_0x14c3c0){var _0x559daf={'key':_0x4a0534[_0x7ef8('0x49')][_0x7ef8('0x2e')]};if(_0x4a0534['body'][_0x7ef8('0x4b')]){_0x559daf[_0x7ef8('0x4b')]=_0x4a0534[_0x7ef8('0x49')][_0x7ef8('0x4b')];}else if(_0x4a0534[_0x7ef8('0x49')][_0x7ef8('0x4c')]){_0x559daf[_0x7ef8('0x4c')]=_0x4a0534['body'][_0x7ef8('0x4c')];}else if(_0x4a0534['body'][_0x7ef8('0x4d')]){_0x559daf[_0x7ef8('0x4d')]=_0x4a0534['body'][_0x7ef8('0x4d')];}else if(_0x4a0534['body'][_0x7ef8('0x4e')]){_0x559daf[_0x7ef8('0x4e')]=_0x4a0534[_0x7ef8('0x49')][_0x7ef8('0x4e')];}return db['CannedAnswer'][_0x7ef8('0x48')]({'where':_0x559daf})[_0x7ef8('0x22')](function(_0x57d1be){if(_0x57d1be){throw new db[(_0x7ef8('0x4f'))][(_0x7ef8('0x50'))](_0x7ef8('0x51'));}return db[_0x7ef8('0x2b')][_0x7ef8('0x4a')](_0x4a0534[_0x7ef8('0x49')]);})[_0x7ef8('0x22')](function(_0x222544){var _0x168e24=_0x4a0534['user']['get']({'plain':!![]});if(!_0x168e24)throw new Error(_0x7ef8('0x52'));if(_0x168e24['role']==='user'){var _0x3cf2a4=_0x222544[_0x7ef8('0x53')]({'plain':!![]});return db[_0x7ef8('0x54')][_0x7ef8('0x48')]({'where':{'name':'CannedAnswers','userProfileId':_0x168e24[_0x7ef8('0x55')]},'raw':!![]})[_0x7ef8('0x22')](function(_0x35968a){if(_0x35968a&&_0x35968a[_0x7ef8('0x56')]===0x0){return db[_0x7ef8('0x57')]['create']({'name':_0x3cf2a4[_0x7ef8('0x27')],'resourceId':_0x3cf2a4['id'],'type':_0x35968a['name'],'sectionId':_0x35968a['id']},{})['then'](function(){return _0x222544;});}else{return _0x222544;}})['catch'](function(_0x214e8f){logger[_0x7ef8('0x25')](_0x7ef8('0x58'),_0x214e8f);throw _0x214e8f;});}return _0x222544;})['then'](respondWithResult(_0x14c3c0,0xc9))[_0x7ef8('0x41')](handleError(_0x14c3c0,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 0b17dbf..5da0134 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 _0x6267=['bluebird','path','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer','utf8mb4_unicode_ci','util','api','moment'];(function(_0x5db336,_0x403b3e){var _0x2dab9b=function(_0x590e44){while(--_0x590e44){_0x5db336['push'](_0x5db336['shift']());}};_0x2dab9b(++_0x403b3e);}(_0x6267,0x1ec));var _0x7626=function(_0x54ca07,_0x391a32){_0x54ca07=_0x54ca07-0x0;var _0x26d07e=_0x6267[_0x54ca07];return _0x26d07e;};'use strict';var _=require('lodash');var util=require(_0x7626('0x0'));var logger=require('../../config/logger')(_0x7626('0x1'));var moment=require(_0x7626('0x2'));var BPromise=require(_0x7626('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7626('0x4'));var rimraf=require(_0x7626('0x5'));var config=require('../../config/environment');var attributes=require(_0x7626('0x6'));module[_0x7626('0x7')]=function(_0x1316a4,_0x8e79f9){return _0x1316a4[_0x7626('0x8')](_0x7626('0x9'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x7626('0xa')});};
\ No newline at end of file
+var _0x116c=['./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x5a8b3f,_0x138789){var _0x3f7fe0=function(_0x2b0ed0){while(--_0x2b0ed0){_0x5a8b3f['push'](_0x5a8b3f['shift']());}};_0x3f7fe0(++_0x138789);}(_0x116c,0xca));var _0xc116=function(_0x4afcd3,_0x48fe21){_0x4afcd3=_0x4afcd3-0x0;var _0x67c766=_0x116c[_0x4afcd3];return _0x67c766;};'use strict';var _=require(_0xc116('0x0'));var util=require(_0xc116('0x1'));var logger=require(_0xc116('0x2'))(_0xc116('0x3'));var moment=require(_0xc116('0x4'));var BPromise=require('bluebird');var rp=require(_0xc116('0x5'));var fs=require('fs');var path=require(_0xc116('0x6'));var rimraf=require('rimraf');var config=require(_0xc116('0x7'));var attributes=require(_0xc116('0x8'));module[_0xc116('0x9')]=function(_0x6ad633,_0x5950a1){return _0x6ad633[_0xc116('0xa')](_0xc116('0xb'),attributes,{'tableName':_0xc116('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc116('0xd'),'collate':_0xc116('0xe')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 0da2da3..69cecbe 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(_0x5824c3,_0xcb653f){var _0x3c8c08=function(_0x44896a){while(--_0x44896a){_0x5824c3['push'](_0x5824c3['shift']());}};_0x3c8c08(++_0xcb653f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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(_0x1a17c9,_0x61b5f5){var _0x265790=function(_0x5e97f4){while(--_0x5e97f4){_0x1a17c9['push'](_0x1a17c9['shift']());}};_0x265790(++_0x61b5f5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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 b3f1f17..c7dbf4b 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 _0xab11=['index','/:id','create','put','update','exports','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xab11,0x1e2));var _0x1ab1=function(_0x5c15f4,_0x2acb27){_0x5c15f4=_0x5c15f4-0x0;var _0x4637eb=_0xab11[_0x5c15f4];return _0x4637eb;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1ab1('0x0'));var router=express[_0x1ab1('0x1')]();var fs_extra=require(_0x1ab1('0x2'));var auth=require(_0x1ab1('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x1ab1('0x4'));var controller=require(_0x1ab1('0x5'));router[_0x1ab1('0x6')]('/',auth[_0x1ab1('0x7')](),controller[_0x1ab1('0x8')]);router[_0x1ab1('0x6')](_0x1ab1('0x9'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x1ab1('0xa')]);router[_0x1ab1('0xb')](_0x1ab1('0x9'),auth[_0x1ab1('0x7')](),controller[_0x1ab1('0xc')]);router['delete']('/:id',auth[_0x1ab1('0x7')](),controller['destroy']);module[_0x1ab1('0xd')]=router;
\ No newline at end of file
+var _0x822e=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get','post','create','/:id','delete','exports','util'];(function(_0x196a7d,_0xaca0c6){var _0x1225fa=function(_0x2c4ee8){while(--_0x2c4ee8){_0x196a7d['push'](_0x196a7d['shift']());}};_0x1225fa(++_0xaca0c6);}(_0x822e,0x1c1));var _0xe822=function(_0x5b6dbb,_0x2817e4){_0x5b6dbb=_0x5b6dbb-0x0;var _0x639b58=_0x822e[_0x5b6dbb];return _0x639b58;};'use strict';var multer=require('multer');var util=require(_0xe822('0x0'));var path=require(_0xe822('0x1'));var timeout=require(_0xe822('0x2'));var express=require(_0xe822('0x3'));var router=express[_0xe822('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe822('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe822('0x6'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0xe822('0x7')](),controller[_0xe822('0x8')]);router[_0xe822('0x9')]('/:id',auth[_0xe822('0x7')](),controller['show']);router[_0xe822('0xa')]('/',auth[_0xe822('0x7')](),controller[_0xe822('0xb')]);router['put'](_0xe822('0xc'),auth[_0xe822('0x7')](),controller['update']);router[_0xe822('0xd')]('/:id',auth[_0xe822('0x7')](),controller['destroy']);module[_0xe822('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 2c5be50..156b13f 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 _0x7d71=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x3cebff,_0x20b43d){var _0x6e5423=function(_0x1043e1){while(--_0x1043e1){_0x3cebff['push'](_0x3cebff['shift']());}};_0x6e5423(++_0x20b43d);}(_0x7d71,0x192));var _0x17d7=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0x7d71[_0xdc37a1];return _0x99b4fe;};'use strict';var Sequelize=require(_0x17d7('0x0'));module[_0x17d7('0x1')]={'calldate':{'type':Sequelize[_0x17d7('0x2')],'allowNull':![],'defaultValue':_0x17d7('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x17d7('0x4')]},'dst':{'type':Sequelize[_0x17d7('0x4')]},'dcontext':{'type':Sequelize[_0x17d7('0x4')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x17d7('0x4')]},'lastapp':{'type':Sequelize[_0x17d7('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x17d7('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x17d7('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x17d7('0x4')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x17d7('0x4')]},'linkedid':{'type':Sequelize[_0x17d7('0x4')]},'sequence':{'type':Sequelize[_0x17d7('0x4')]},'peeraccount':{'type':Sequelize[_0x17d7('0x4')]},'type':{'type':Sequelize[_0x17d7('0x4')]},'tag':{'type':Sequelize[_0x17d7('0x4')]}};
\ No newline at end of file
+var _0x4deb=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x1f1a23,_0x977f36){var _0x207fce=function(_0x549667){while(--_0x549667){_0x1f1a23['push'](_0x1f1a23['shift']());}};_0x207fce(++_0x977f36);}(_0x4deb,0x17a));var _0xb4de=function(_0xb1b616,_0x3b9023){_0xb1b616=_0xb1b616-0x0;var _0x1259b0=_0x4deb[_0xb1b616];return _0x1259b0;};'use strict';var Sequelize=require(_0xb4de('0x0'));module[_0xb4de('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xb4de('0x2')},'clid':{'type':Sequelize[_0xb4de('0x3')]},'src':{'type':Sequelize[_0xb4de('0x3')]},'dst':{'type':Sequelize[_0xb4de('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xb4de('0x3')]},'dstchannel':{'type':Sequelize[_0xb4de('0x3')]},'lastapp':{'type':Sequelize[_0xb4de('0x3')]},'lastdata':{'type':Sequelize[_0xb4de('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xb4de('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb4de('0x3')]},'amaflags':{'type':Sequelize[_0xb4de('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xb4de('0x3')]},'userfield':{'type':Sequelize[_0xb4de('0x3')]},'uniqueid':{'type':Sequelize[_0xb4de('0x3')]},'linkedid':{'type':Sequelize[_0xb4de('0x3')]},'sequence':{'type':Sequelize[_0xb4de('0x3')]},'peeraccount':{'type':Sequelize[_0xb4de('0x3')]},'type':{'type':Sequelize[_0xb4de('0x3')]},'tag':{'type':Sequelize[_0xb4de('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index ecbd8ed..6261ec1 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 _0x277c=['destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','params','Cdr','catch','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','apply','reject','save','update','then'];(function(_0x199622,_0x5a19ba){var _0x473756=function(_0x3a27eb){while(--_0x3a27eb){_0x199622['push'](_0x199622['shift']());}};_0x473756(++_0x5a19ba);}(_0x277c,0x153));var _0xc277=function(_0x38ccfa,_0x7ee5d4){_0x38ccfa=_0x38ccfa-0x0;var _0x2481e9=_0x277c[_0x38ccfa];return _0x2481e9;};'use strict';var emlformat=require(_0xc277('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc277('0x1'));var jsonpatch=require(_0xc277('0x2'));var rp=require(_0xc277('0x3'));var moment=require(_0xc277('0x4'));var BPromise=require(_0xc277('0x5'));var Mustache=require(_0xc277('0x6'));var util=require(_0xc277('0x7'));var path=require(_0xc277('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc277('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc277('0xa'));var squel=require('squel');var crypto=require(_0xc277('0xb'));var jsforce=require(_0xc277('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc277('0xd'));var querystring=require(_0xc277('0xe'));var Papa=require(_0xc277('0xf'));var Redis=require(_0xc277('0x10'));var authService=require(_0xc277('0x11'));var qs=require(_0xc277('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc277('0x13'))(_0xc277('0x14'));var utils=require(_0xc277('0x15'));var config=require(_0xc277('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc277('0x17'))['db'];function respondWithStatusCode(_0x4a7700,_0xb6b933){_0xb6b933=_0xb6b933||0xcc;return function(_0x2bba87){if(_0x2bba87){return _0x4a7700[_0xc277('0x18')](_0xb6b933);}return _0x4a7700[_0xc277('0x19')](_0xb6b933)['end']();};}function respondWithResult(_0x222bc8,_0x182d35){_0x182d35=_0x182d35||0xc8;return function(_0x8895bd){if(_0x8895bd){return _0x222bc8['status'](_0x182d35)['json'](_0x8895bd);}};}function respondWithFilteredResult(_0x178e6d,_0x5c212c){return function(_0x46d20c){if(_0x46d20c){var _0x5d73f8=typeof _0x5c212c[_0xc277('0x1a')]===_0xc277('0x1b')&&typeof _0x5c212c[_0xc277('0x1c')]==='undefined';var _0x5cdb4b=_0x46d20c[_0xc277('0x1d')];var _0x4d23a7=_0x5d73f8?0x0:_0x5c212c['offset'];var _0x1e1a9b=_0x5d73f8?_0x46d20c[_0xc277('0x1d')]:_0x5c212c[_0xc277('0x1a')]+_0x5c212c[_0xc277('0x1c')];var _0xe2b7c1;if(_0x1e1a9b>=_0x5cdb4b){_0x1e1a9b=_0x5cdb4b;_0xe2b7c1=0xc8;}else{_0xe2b7c1=0xce;}_0x178e6d[_0xc277('0x19')](_0xe2b7c1);return _0x178e6d[_0xc277('0x1e')]('Content-Range',_0x4d23a7+'-'+_0x1e1a9b+'/'+_0x5cdb4b)['json'](_0x46d20c);}return null;};}function patchUpdates(_0x697d6f){return function(_0x28900e){try{jsonpatch[_0xc277('0x1f')](_0x28900e,_0x697d6f,!![]);}catch(_0x28b7b1){return BPromise[_0xc277('0x20')](_0x28b7b1);}return _0x28900e[_0xc277('0x21')]();};}function saveUpdates(_0xb4685f,_0x42cb0b){return function(_0x1bc888){if(_0x1bc888){return _0x1bc888[_0xc277('0x22')](_0xb4685f)[_0xc277('0x23')](function(_0x57a198){return _0x57a198;});}return null;};}function removeEntity(_0x2b9936,_0x21af1b){return function(_0x54b2e1){if(_0x54b2e1){return _0x54b2e1[_0xc277('0x24')]()['then'](function(){_0x2b9936['status'](0xcc)[_0xc277('0x25')]();});}};}function handleEntityNotFound(_0x57b03,_0x1583b6){return function(_0x436784){if(!_0x436784){_0x57b03[_0xc277('0x18')](0x194);}return _0x436784;};}function handleError(_0x3aa598,_0x37b893){_0x37b893=_0x37b893||0x1f4;return function(_0x9ad1c5){logger[_0xc277('0x26')](_0x9ad1c5[_0xc277('0x27')]);if(_0x9ad1c5[_0xc277('0x28')]){delete _0x9ad1c5['name'];}_0x3aa598['status'](_0x37b893)[_0xc277('0x29')](_0x9ad1c5);};}exports[_0xc277('0x2a')]=function(_0x4ebb0f,_0x4efc1e){var _0x388717={},_0x3bc773={},_0x37e27b={'count':0x0,'rows':[]};var _0x21c78c=_[_0xc277('0x2b')](db['Cdr'][_0xc277('0x2c')],function(_0x5edf7e){return{'name':_0x5edf7e[_0xc277('0x2d')],'type':_0x5edf7e[_0xc277('0x2e')][_0xc277('0x2f')]};});_0x3bc773[_0xc277('0x30')]=_['map'](_0x21c78c,_0xc277('0x28'));_0x3bc773['query']=_[_0xc277('0x31')](_0x4ebb0f[_0xc277('0x32')]);_0x3bc773[_0xc277('0x33')]=_[_0xc277('0x34')](_0x3bc773['model'],_0x3bc773[_0xc277('0x32')]);_0x388717[_0xc277('0x35')]=_['intersection'](_0x3bc773[_0xc277('0x30')],qs['fields'](_0x4ebb0f[_0xc277('0x32')][_0xc277('0x36')]));_0x388717[_0xc277('0x35')]=_0x388717[_0xc277('0x35')][_0xc277('0x37')]?_0x388717[_0xc277('0x35')]:_0x3bc773[_0xc277('0x30')];if(!_0x4ebb0f[_0xc277('0x32')][_0xc277('0x38')](_0xc277('0x39'))){_0x388717[_0xc277('0x1c')]=qs['limit'](_0x4ebb0f[_0xc277('0x32')][_0xc277('0x1c')]);_0x388717[_0xc277('0x1a')]=qs['offset'](_0x4ebb0f[_0xc277('0x32')][_0xc277('0x1a')]);}_0x388717[_0xc277('0x3a')]=qs[_0xc277('0x3b')](_0x4ebb0f[_0xc277('0x32')]['sort']);_0x388717['where']=qs[_0xc277('0x33')](_['pick'](_0x4ebb0f[_0xc277('0x32')],_0x3bc773[_0xc277('0x33')]),_0x21c78c);if(_0x4ebb0f[_0xc277('0x32')][_0xc277('0x3c')]){_0x388717[_0xc277('0x3d')]=_[_0xc277('0x3e')](_0x388717[_0xc277('0x3d')],{'$or':_[_0xc277('0x2b')](_0x21c78c,function(_0x2e35b5){if(_0x2e35b5[_0xc277('0x2e')]!==_0xc277('0x3f')){var _0x4eaa6c={};_0x4eaa6c[_0x2e35b5[_0xc277('0x28')]]={'$like':'%'+_0x4ebb0f[_0xc277('0x32')][_0xc277('0x3c')]+'%'};return _0x4eaa6c;}})});}_0x388717=_['merge']({},_0x388717,_0x4ebb0f[_0xc277('0x40')]);var _0x278a92={'where':_0x388717['where']};return db['Cdr'][_0xc277('0x1d')](_0x278a92)[_0xc277('0x23')](function(_0x22c5b3){_0x37e27b[_0xc277('0x1d')]=_0x22c5b3;if(_0x4ebb0f[_0xc277('0x32')][_0xc277('0x41')]){_0x388717[_0xc277('0x42')]=[{'all':!![]}];}return db['Cdr'][_0xc277('0x43')](_0x388717);})[_0xc277('0x23')](function(_0x142ca6){_0x37e27b['rows']=_0x142ca6;return _0x37e27b;})['then'](respondWithFilteredResult(_0x4efc1e,_0x388717))['catch'](handleError(_0x4efc1e,null));};exports['show']=function(_0x519f14,_0x25723a){var _0x4a26e3={'raw':!![],'where':{'id':_0x519f14[_0xc277('0x44')]['id']}},_0x46fda3={};_0x46fda3[_0xc277('0x30')]=_['keys'](db[_0xc277('0x45')][_0xc277('0x2c')]);_0x46fda3[_0xc277('0x32')]=_[_0xc277('0x31')](_0x519f14['query']);_0x46fda3[_0xc277('0x33')]=_[_0xc277('0x34')](_0x46fda3['model'],_0x46fda3[_0xc277('0x32')]);_0x4a26e3[_0xc277('0x35')]=_[_0xc277('0x34')](_0x46fda3[_0xc277('0x30')],qs[_0xc277('0x36')](_0x519f14[_0xc277('0x32')][_0xc277('0x36')]));_0x4a26e3[_0xc277('0x35')]=_0x4a26e3[_0xc277('0x35')][_0xc277('0x37')]?_0x4a26e3[_0xc277('0x35')]:_0x46fda3['model'];if(_0x519f14[_0xc277('0x32')][_0xc277('0x41')]){_0x4a26e3[_0xc277('0x42')]=[{'all':!![]}];}_0x4a26e3=_[_0xc277('0x3e')]({},_0x4a26e3,_0x519f14['options']);return db[_0xc277('0x45')]['find'](_0x4a26e3)[_0xc277('0x23')](handleEntityNotFound(_0x25723a,null))[_0xc277('0x23')](respondWithResult(_0x25723a,null))[_0xc277('0x46')](handleError(_0x25723a,null));};exports[_0xc277('0x47')]=function(_0x4129bc,_0x57c759){return db[_0xc277('0x45')][_0xc277('0x47')](_0x4129bc[_0xc277('0x48')],{})[_0xc277('0x23')](respondWithResult(_0x57c759,0xc9))['catch'](handleError(_0x57c759,null));};exports[_0xc277('0x22')]=function(_0x9c910a,_0x150876){if(_0x9c910a['body']['id']){delete _0x9c910a[_0xc277('0x48')]['id'];}return db['Cdr'][_0xc277('0x49')]({'where':{'id':_0x9c910a[_0xc277('0x44')]['id']}})[_0xc277('0x23')](handleEntityNotFound(_0x150876,null))[_0xc277('0x23')](saveUpdates(_0x9c910a[_0xc277('0x48')],null))[_0xc277('0x23')](respondWithResult(_0x150876,null))[_0xc277('0x46')](handleError(_0x150876,null));};exports[_0xc277('0x24')]=function(_0x8752f2,_0x25f5e1){return db[_0xc277('0x45')][_0xc277('0x49')]({'where':{'id':_0x8752f2['params']['id']}})[_0xc277('0x23')](handleEntityNotFound(_0x25f5e1,null))['then'](removeEntity(_0x25f5e1,null))[_0xc277('0x46')](handleError(_0x25f5e1,null));};exports[_0xc277('0x4a')]=function(_0x1900ca,_0x33b032){return db[_0xc277('0x45')]['describe']()[_0xc277('0x23')](respondWithResult(_0x33b032,null))[_0xc277('0x46')](handleError(_0x33b032,null));};
\ No newline at end of file
+var _0x2caf=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','name','send','index','map','Cdr','rawAttributes','fieldName'];(function(_0xeeb4ce,_0x527f54){var _0x153a7d=function(_0x486805){while(--_0x486805){_0xeeb4ce['push'](_0xeeb4ce['shift']());}};_0x153a7d(++_0x527f54);}(_0x2caf,0x6a));var _0xf2ca=function(_0x423320,_0x5c7fff){_0x423320=_0x423320-0x0;var _0xa07230=_0x2caf[_0x423320];return _0xa07230;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf2ca('0x0'));var rp=require('request-promise');var moment=require(_0xf2ca('0x1'));var BPromise=require(_0xf2ca('0x2'));var Mustache=require(_0xf2ca('0x3'));var util=require(_0xf2ca('0x4'));var path=require(_0xf2ca('0x5'));var sox=require(_0xf2ca('0x6'));var csv=require(_0xf2ca('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf2ca('0x8'));var _=require(_0xf2ca('0x9'));var squel=require(_0xf2ca('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf2ca('0xb'));var toCsv=require(_0xf2ca('0x7'));var querystring=require(_0xf2ca('0xc'));var Papa=require(_0xf2ca('0xd'));var Redis=require(_0xf2ca('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xf2ca('0xf'));var as=require(_0xf2ca('0x10'));var hardwareService=require(_0xf2ca('0x11'));var logger=require(_0xf2ca('0x12'))(_0xf2ca('0x13'));var utils=require(_0xf2ca('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf2ca('0x15'));var db=require(_0xf2ca('0x16'))['db'];function respondWithStatusCode(_0x54a3cb,_0x88529f){_0x88529f=_0x88529f||0xcc;return function(_0x383112){if(_0x383112){return _0x54a3cb['sendStatus'](_0x88529f);}return _0x54a3cb['status'](_0x88529f)[_0xf2ca('0x17')]();};}function respondWithResult(_0x52a278,_0x284484){_0x284484=_0x284484||0xc8;return function(_0x3123fe){if(_0x3123fe){return _0x52a278[_0xf2ca('0x18')](_0x284484)[_0xf2ca('0x19')](_0x3123fe);}};}function respondWithFilteredResult(_0x410997,_0x2057a2){return function(_0x2ddfac){if(_0x2ddfac){var _0x5aec64=typeof _0x2057a2[_0xf2ca('0x1a')]==='undefined'&&typeof _0x2057a2[_0xf2ca('0x1b')]==='undefined';var _0x235e79=_0x2ddfac[_0xf2ca('0x1c')];var _0x59ea3c=_0x5aec64?0x0:_0x2057a2[_0xf2ca('0x1a')];var _0x160230=_0x5aec64?_0x2ddfac[_0xf2ca('0x1c')]:_0x2057a2[_0xf2ca('0x1a')]+_0x2057a2[_0xf2ca('0x1b')];var _0x1ca233;if(_0x160230>=_0x235e79){_0x160230=_0x235e79;_0x1ca233=0xc8;}else{_0x1ca233=0xce;}_0x410997[_0xf2ca('0x18')](_0x1ca233);return _0x410997[_0xf2ca('0x1d')](_0xf2ca('0x1e'),_0x59ea3c+'-'+_0x160230+'/'+_0x235e79)[_0xf2ca('0x19')](_0x2ddfac);}return null;};}function patchUpdates(_0xea662){return function(_0x55dc6a){try{jsonpatch[_0xf2ca('0x1f')](_0x55dc6a,_0xea662,!![]);}catch(_0x45a028){return BPromise[_0xf2ca('0x20')](_0x45a028);}return _0x55dc6a[_0xf2ca('0x21')]();};}function saveUpdates(_0x41cb71,_0x386c58){return function(_0x1bbd60){if(_0x1bbd60){return _0x1bbd60[_0xf2ca('0x22')](_0x41cb71)['then'](function(_0x14791b){return _0x14791b;});}return null;};}function removeEntity(_0x1767f7,_0x56ebed){return function(_0x1c032c){if(_0x1c032c){return _0x1c032c[_0xf2ca('0x23')]()[_0xf2ca('0x24')](function(){_0x1767f7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xbfcb0b,_0x1b3c01){return function(_0x214fa9){if(!_0x214fa9){_0xbfcb0b[_0xf2ca('0x25')](0x194);}return _0x214fa9;};}function handleError(_0x1255ba,_0x427a17){_0x427a17=_0x427a17||0x1f4;return function(_0x339e10){logger[_0xf2ca('0x26')](_0x339e10['stack']);if(_0x339e10[_0xf2ca('0x27')]){delete _0x339e10[_0xf2ca('0x27')];}_0x1255ba[_0xf2ca('0x18')](_0x427a17)[_0xf2ca('0x28')](_0x339e10);};}exports[_0xf2ca('0x29')]=function(_0x41fc04,_0x17707e){var _0xb0ae21={},_0x1b44fb={},_0x20a523={'count':0x0,'rows':[]};var _0xf92250=_[_0xf2ca('0x2a')](db[_0xf2ca('0x2b')][_0xf2ca('0x2c')],function(_0x2b0649){return{'name':_0x2b0649[_0xf2ca('0x2d')],'type':_0x2b0649[_0xf2ca('0x2e')][_0xf2ca('0x2f')]};});_0x1b44fb[_0xf2ca('0x30')]=_['map'](_0xf92250,_0xf2ca('0x27'));_0x1b44fb[_0xf2ca('0x31')]=_[_0xf2ca('0x32')](_0x41fc04[_0xf2ca('0x31')]);_0x1b44fb[_0xf2ca('0x33')]=_[_0xf2ca('0x34')](_0x1b44fb[_0xf2ca('0x30')],_0x1b44fb[_0xf2ca('0x31')]);_0xb0ae21[_0xf2ca('0x35')]=_['intersection'](_0x1b44fb[_0xf2ca('0x30')],qs[_0xf2ca('0x36')](_0x41fc04[_0xf2ca('0x31')]['fields']));_0xb0ae21[_0xf2ca('0x35')]=_0xb0ae21['attributes'][_0xf2ca('0x37')]?_0xb0ae21[_0xf2ca('0x35')]:_0x1b44fb[_0xf2ca('0x30')];if(!_0x41fc04[_0xf2ca('0x31')][_0xf2ca('0x38')]('nolimit')){_0xb0ae21['limit']=qs[_0xf2ca('0x1b')](_0x41fc04['query'][_0xf2ca('0x1b')]);_0xb0ae21[_0xf2ca('0x1a')]=qs[_0xf2ca('0x1a')](_0x41fc04[_0xf2ca('0x31')][_0xf2ca('0x1a')]);}_0xb0ae21[_0xf2ca('0x39')]=qs[_0xf2ca('0x3a')](_0x41fc04[_0xf2ca('0x31')][_0xf2ca('0x3a')]);_0xb0ae21[_0xf2ca('0x3b')]=qs[_0xf2ca('0x33')](_[_0xf2ca('0x3c')](_0x41fc04[_0xf2ca('0x31')],_0x1b44fb[_0xf2ca('0x33')]),_0xf92250);if(_0x41fc04[_0xf2ca('0x31')][_0xf2ca('0x3d')]){_0xb0ae21['where']=_[_0xf2ca('0x3e')](_0xb0ae21[_0xf2ca('0x3b')],{'$or':_[_0xf2ca('0x2a')](_0xf92250,function(_0x148570){if(_0x148570['type']!==_0xf2ca('0x3f')){var _0x4b0e0e={};_0x4b0e0e[_0x148570[_0xf2ca('0x27')]]={'$like':'%'+_0x41fc04[_0xf2ca('0x31')][_0xf2ca('0x3d')]+'%'};return _0x4b0e0e;}})});}_0xb0ae21=_[_0xf2ca('0x3e')]({},_0xb0ae21,_0x41fc04[_0xf2ca('0x40')]);var _0x4fbaec={'where':_0xb0ae21[_0xf2ca('0x3b')]};return db[_0xf2ca('0x2b')]['count'](_0x4fbaec)[_0xf2ca('0x24')](function(_0x29ebce){_0x20a523[_0xf2ca('0x1c')]=_0x29ebce;if(_0x41fc04['query'][_0xf2ca('0x41')]){_0xb0ae21['include']=[{'all':!![]}];}return db[_0xf2ca('0x2b')][_0xf2ca('0x42')](_0xb0ae21);})[_0xf2ca('0x24')](function(_0x43b2c2){_0x20a523[_0xf2ca('0x43')]=_0x43b2c2;return _0x20a523;})[_0xf2ca('0x24')](respondWithFilteredResult(_0x17707e,_0xb0ae21))[_0xf2ca('0x44')](handleError(_0x17707e,null));};exports[_0xf2ca('0x45')]=function(_0x43b3c7,_0x128535){var _0x17de81={'raw':!![],'where':{'id':_0x43b3c7[_0xf2ca('0x46')]['id']}},_0x3360d9={};_0x3360d9[_0xf2ca('0x30')]=_[_0xf2ca('0x32')](db['Cdr'][_0xf2ca('0x2c')]);_0x3360d9[_0xf2ca('0x31')]=_[_0xf2ca('0x32')](_0x43b3c7[_0xf2ca('0x31')]);_0x3360d9[_0xf2ca('0x33')]=_[_0xf2ca('0x34')](_0x3360d9[_0xf2ca('0x30')],_0x3360d9[_0xf2ca('0x31')]);_0x17de81[_0xf2ca('0x35')]=_[_0xf2ca('0x34')](_0x3360d9[_0xf2ca('0x30')],qs[_0xf2ca('0x36')](_0x43b3c7[_0xf2ca('0x31')]['fields']));_0x17de81['attributes']=_0x17de81[_0xf2ca('0x35')][_0xf2ca('0x37')]?_0x17de81['attributes']:_0x3360d9[_0xf2ca('0x30')];if(_0x43b3c7['query'][_0xf2ca('0x41')]){_0x17de81[_0xf2ca('0x47')]=[{'all':!![]}];}_0x17de81=_[_0xf2ca('0x3e')]({},_0x17de81,_0x43b3c7['options']);return db[_0xf2ca('0x2b')][_0xf2ca('0x48')](_0x17de81)['then'](handleEntityNotFound(_0x128535,null))[_0xf2ca('0x24')](respondWithResult(_0x128535,null))[_0xf2ca('0x44')](handleError(_0x128535,null));};exports[_0xf2ca('0x49')]=function(_0x3e92cf,_0x4a6439){return db[_0xf2ca('0x2b')][_0xf2ca('0x49')](_0x3e92cf[_0xf2ca('0x4a')],{})['then'](respondWithResult(_0x4a6439,0xc9))['catch'](handleError(_0x4a6439,null));};exports[_0xf2ca('0x22')]=function(_0x2f7596,_0x1a65c6){if(_0x2f7596[_0xf2ca('0x4a')]['id']){delete _0x2f7596[_0xf2ca('0x4a')]['id'];}return db[_0xf2ca('0x2b')]['find']({'where':{'id':_0x2f7596['params']['id']}})[_0xf2ca('0x24')](handleEntityNotFound(_0x1a65c6,null))[_0xf2ca('0x24')](saveUpdates(_0x2f7596['body'],null))[_0xf2ca('0x24')](respondWithResult(_0x1a65c6,null))['catch'](handleError(_0x1a65c6,null));};exports[_0xf2ca('0x23')]=function(_0x59bbb8,_0x26a483){return db['Cdr']['find']({'where':{'id':_0x59bbb8[_0xf2ca('0x46')]['id']}})[_0xf2ca('0x24')](handleEntityNotFound(_0x26a483,null))['then'](removeEntity(_0x26a483,null))[_0xf2ca('0x44')](handleError(_0x26a483,null));};exports[_0xf2ca('0x4b')]=function(_0x2eb8d5,_0x14850c){return db[_0xf2ca('0x2b')][_0xf2ca('0x4b')]()['then'](respondWithResult(_0x14850c,null))[_0xf2ca('0x44')](handleError(_0x14850c,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 1f5b655..7591b8e 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x500149,_0x71bbc8){var _0x3ff783=function(_0x3cc141){while(--_0x3cc141){_0x500149['push'](_0x500149['shift']());}};_0x3ff783(++_0x71bbc8);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x5a9ae2,_0x395af6){var _0x514ada=function(_0x1d371b){while(--_0x1d371b){_0x5a9ae2['push'](_0x5a9ae2['shift']());}};_0x514ada(++_0x395af6);}(_0x7a54,0x106));var _0x47a5=function(_0x5bcb0d,_0x20b514){_0x5bcb0d=_0x5bcb0d-0x0;var _0x1bac99=_0x7a54[_0x5bcb0d];return _0x1bac99;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 383769c..7141b12 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 _0xe53f=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','info','result'];(function(_0x498fbd,_0x8e5e4e){var _0xa61533=function(_0x4e94ee){while(--_0x4e94ee){_0x498fbd['push'](_0x498fbd['shift']());}};_0xa61533(++_0x8e5e4e);}(_0xe53f,0x94));var _0xfe53=function(_0x4599cb,_0x260d16){_0x4599cb=_0x4599cb-0x0;var _0x3218e1=_0xe53f[_0x4599cb];return _0x3218e1;};'use strict';var _=require(_0xfe53('0x0'));var util=require(_0xfe53('0x1'));var moment=require(_0xfe53('0x2'));var BPromise=require(_0xfe53('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe53('0x4'));var db=require(_0xfe53('0x5'))['db'];var utils=require(_0xfe53('0x6'));var logger=require(_0xfe53('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfe53('0x8')][_0xfe53('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3443bf,_0x464253,_0x3e6c89){return new BPromise(function(_0x42e7a5,_0x4d3027){return client['request'](_0x3443bf,_0x3e6c89)[_0xfe53('0xa')](function(_0x5a13c5){logger['info'](_0xfe53('0xb'),_0x464253,_0xfe53('0xc'));logger[_0xfe53('0xd')](_0xfe53('0xe'),_0x464253,_0xfe53('0xc'),JSON['stringify'](_0x5a13c5));if(_0x5a13c5['error']){if(_0x5a13c5[_0xfe53('0xf')][_0xfe53('0x10')]===0x1f4){logger['error'](_0xfe53('0xb'),_0x464253,_0x5a13c5[_0xfe53('0xf')][_0xfe53('0x11')]);return _0x4d3027(_0x5a13c5[_0xfe53('0xf')][_0xfe53('0x11')]);}logger[_0xfe53('0xf')]('Cdr,\x20%s,\x20%s',_0x464253,_0x5a13c5[_0xfe53('0xf')][_0xfe53('0x11')]);return _0x42e7a5(_0x5a13c5[_0xfe53('0xf')]['message']);}else{logger[_0xfe53('0x12')](_0xfe53('0xb'),_0x464253,_0xfe53('0xc'));_0x42e7a5(_0x5a13c5[_0xfe53('0x13')]['message']);}})[_0xfe53('0x14')](function(_0x1a933a){logger[_0xfe53('0xf')](_0xfe53('0xb'),_0x464253,_0x1a933a);_0x4d3027(_0x1a933a);});});}
\ No newline at end of file
+var _0x2786=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Cdr,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x7211f3,_0x1a6d00){var _0x319b31=function(_0x5a5c18){while(--_0x5a5c18){_0x7211f3['push'](_0x7211f3['shift']());}};_0x319b31(++_0x1a6d00);}(_0x2786,0x1c6));var _0x6278=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x2786[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x6278('0x0'));var util=require(_0x6278('0x1'));var moment=require(_0x6278('0x2'));var BPromise=require(_0x6278('0x3'));var rs=require(_0x6278('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6278('0x5'));var logger=require(_0x6278('0x6'))(_0x6278('0x7'));var config=require('../../config/environment');var jayson=require(_0x6278('0x8'));var client=jayson[_0x6278('0x9')][_0x6278('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe06659,_0x5f0a64,_0x5cfc4c){return new BPromise(function(_0x13aa0d,_0x1d8798){return client[_0x6278('0xb')](_0xe06659,_0x5cfc4c)[_0x6278('0xc')](function(_0x3d3fc4){logger[_0x6278('0xd')]('Cdr,\x20%s,\x20%s',_0x5f0a64,'request\x20sent');logger[_0x6278('0xe')](_0x6278('0xf'),_0x5f0a64,_0x6278('0x10'),JSON[_0x6278('0x11')](_0x3d3fc4));if(_0x3d3fc4[_0x6278('0x12')]){if(_0x3d3fc4[_0x6278('0x12')][_0x6278('0x13')]===0x1f4){logger[_0x6278('0x12')](_0x6278('0x14'),_0x5f0a64,_0x3d3fc4[_0x6278('0x12')][_0x6278('0x15')]);return _0x1d8798(_0x3d3fc4['error'][_0x6278('0x15')]);}logger[_0x6278('0x12')]('Cdr,\x20%s,\x20%s',_0x5f0a64,_0x3d3fc4[_0x6278('0x12')]['message']);return _0x13aa0d(_0x3d3fc4[_0x6278('0x12')]['message']);}else{logger[_0x6278('0xd')](_0x6278('0x14'),_0x5f0a64,_0x6278('0x10'));_0x13aa0d(_0x3d3fc4[_0x6278('0x16')][_0x6278('0x15')]);}})[_0x6278('0x17')](function(_0x4f4ece){logger[_0x6278('0x12')]('Cdr,\x20%s,\x20%s',_0x5f0a64,_0x4f4ece);_0x1d8798(_0x4f4ece);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 3f26b8b..0d187c0 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(_0xd034c8,_0x4b5fbe){var _0x37c283=function(_0x1fc5c3){while(--_0x1fc5c3){_0xd034c8['push'](_0xd034c8['shift']());}};_0x37c283(++_0x4b5fbe);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x5200c2,_0x1bf45d){var _0x18758b=function(_0x320f4a){while(--_0x320f4a){_0x5200c2['push'](_0x5200c2['shift']());}};_0x18758b(++_0x1bf45d);}(_0xb10b,0x12a));var _0xbb10=function(_0x304b67,_0x31cb39){_0x304b67=_0x304b67-0x0;var _0x493afb=_0xb10b[_0x304b67];return _0x493afb;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 0832116..aaab4fc 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 _0xc8d9=['*,*,*,*','sequelize','exports','INTEGER','STRING','TEXT'];(function(_0x42341c,_0xfc7745){var _0x9db5e1=function(_0x4b96a1){while(--_0x4b96a1){_0x42341c['push'](_0x42341c['shift']());}};_0x9db5e1(++_0xfc7745);}(_0xc8d9,0x85));var _0x9c8d=function(_0x34b6aa,_0x5ddd29){_0x34b6aa=_0x34b6aa-0x0;var _0x3ead29=_0xc8d9[_0x34b6aa];return _0x3ead29;};'use strict';var Sequelize=require(_0x9c8d('0x0'));module[_0x9c8d('0x1')]={'priority':{'type':Sequelize[_0x9c8d('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9c8d('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x9c8d('0x4')]()},'description':{'type':Sequelize[_0x9c8d('0x3')]},'interval':{'type':Sequelize[_0x9c8d('0x3')],'defaultValue':_0x9c8d('0x5')}};
\ No newline at end of file
+var _0x29bb=['STRING','noop','TEXT','sequelize','exports'];(function(_0x968a88,_0x1e0825){var _0x22bf31=function(_0x7b5a90){while(--_0x7b5a90){_0x968a88['push'](_0x968a88['shift']());}};_0x22bf31(++_0x1e0825);}(_0x29bb,0x17f));var _0xb29b=function(_0x491f0e,_0x3355e6){_0x491f0e=_0x491f0e-0x0;var _0x543076=_0x29bb[_0x491f0e];return _0x543076;};'use strict';var Sequelize=require(_0xb29b('0x0'));module[_0xb29b('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xb29b('0x2')],'allowNull':![],'defaultValue':_0xb29b('0x3')},'appdata':{'type':Sequelize[_0xb29b('0x4')]()},'description':{'type':Sequelize[_0xb29b('0x2')]},'interval':{'type':Sequelize[_0xb29b('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 56ec0b8..b6780b0 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 _0xae2b=['intersection','model','attributes','fields','length','includeAll','include','merge','find','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','set','Content-Range','apply','save','update','destroy','then','error','name','send','show','params','keys','ChatApplication','rawAttributes','query','filters'];(function(_0x2d8125,_0x5de964){var _0x9ccfa5=function(_0x4afc8f){while(--_0x4afc8f){_0x2d8125['push'](_0x2d8125['shift']());}};_0x9ccfa5(++_0x5de964);}(_0xae2b,0xb3));var _0xbae2=function(_0x48a38a,_0x58ddb7){_0x48a38a=_0x48a38a-0x0;var _0x4feaa6=_0xae2b[_0x48a38a];return _0x4feaa6;};'use strict';var emlformat=require(_0xbae2('0x0'));var rimraf=require(_0xbae2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbae2('0x2'));var rp=require(_0xbae2('0x3'));var moment=require(_0xbae2('0x4'));var BPromise=require(_0xbae2('0x5'));var Mustache=require(_0xbae2('0x6'));var util=require(_0xbae2('0x7'));var path=require('path');var sox=require(_0xbae2('0x8'));var csv=require('to-csv');var ejs=require(_0xbae2('0x9'));var fs=require('fs');var fs_extra=require(_0xbae2('0xa'));var _=require(_0xbae2('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbae2('0xc'));var querystring=require(_0xbae2('0xd'));var Papa=require(_0xbae2('0xe'));var Redis=require(_0xbae2('0xf'));var authService=require(_0xbae2('0x10'));var qs=require(_0xbae2('0x11'));var as=require(_0xbae2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xbae2('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xbae2('0x14'));var db=require(_0xbae2('0x15'))['db'];function respondWithStatusCode(_0x1b28ce,_0x4c39ef){_0x4c39ef=_0x4c39ef||0xcc;return function(_0x381f69){if(_0x381f69){return _0x1b28ce[_0xbae2('0x16')](_0x4c39ef);}return _0x1b28ce['status'](_0x4c39ef)[_0xbae2('0x17')]();};}function respondWithResult(_0x10aa05,_0xe206f3){_0xe206f3=_0xe206f3||0xc8;return function(_0x379104){if(_0x379104){return _0x10aa05[_0xbae2('0x18')](_0xe206f3)[_0xbae2('0x19')](_0x379104);}};}function respondWithFilteredResult(_0x16263d,_0x4d687b){return function(_0x2e4775){if(_0x2e4775){var _0x523e23=typeof _0x4d687b[_0xbae2('0x1a')]===_0xbae2('0x1b')&&typeof _0x4d687b['limit']===_0xbae2('0x1b');var _0x45ab0f=_0x2e4775['count'];var _0x27e323=_0x523e23?0x0:_0x4d687b[_0xbae2('0x1a')];var _0x46145a=_0x523e23?_0x2e4775['count']:_0x4d687b[_0xbae2('0x1a')]+_0x4d687b['limit'];var _0x4ee2d1;if(_0x46145a>=_0x45ab0f){_0x46145a=_0x45ab0f;_0x4ee2d1=0xc8;}else{_0x4ee2d1=0xce;}_0x16263d[_0xbae2('0x18')](_0x4ee2d1);return _0x16263d[_0xbae2('0x1c')](_0xbae2('0x1d'),_0x27e323+'-'+_0x46145a+'/'+_0x45ab0f)[_0xbae2('0x19')](_0x2e4775);}return null;};}function patchUpdates(_0x53b581){return function(_0x14bbe8){try{jsonpatch[_0xbae2('0x1e')](_0x14bbe8,_0x53b581,!![]);}catch(_0x4a42be){return BPromise['reject'](_0x4a42be);}return _0x14bbe8[_0xbae2('0x1f')]();};}function saveUpdates(_0x3f1e04,_0xd01446){return function(_0x1b9b24){if(_0x1b9b24){return _0x1b9b24[_0xbae2('0x20')](_0x3f1e04)['then'](function(_0x5b93a6){return _0x5b93a6;});}return null;};}function removeEntity(_0x4631b8,_0x2337f0){return function(_0x55deca){if(_0x55deca){return _0x55deca[_0xbae2('0x21')]()[_0xbae2('0x22')](function(){_0x4631b8[_0xbae2('0x18')](0xcc)[_0xbae2('0x17')]();});}};}function handleEntityNotFound(_0x5b084f,_0x472e4a){return function(_0x4827c1){if(!_0x4827c1){_0x5b084f[_0xbae2('0x16')](0x194);}return _0x4827c1;};}function handleError(_0x90a9a8,_0x245a74){_0x245a74=_0x245a74||0x1f4;return function(_0x352fd2){logger[_0xbae2('0x23')](_0x352fd2['stack']);if(_0x352fd2[_0xbae2('0x24')]){delete _0x352fd2[_0xbae2('0x24')];}_0x90a9a8['status'](_0x245a74)[_0xbae2('0x25')](_0x352fd2);};}exports[_0xbae2('0x26')]=function(_0x339f83,_0x1f96c7){var _0x25eba1={'raw':!![],'where':{'id':_0x339f83[_0xbae2('0x27')]['id']}},_0x513f70={};_0x513f70['model']=_[_0xbae2('0x28')](db[_0xbae2('0x29')][_0xbae2('0x2a')]);_0x513f70[_0xbae2('0x2b')]=_[_0xbae2('0x28')](_0x339f83[_0xbae2('0x2b')]);_0x513f70[_0xbae2('0x2c')]=_[_0xbae2('0x2d')](_0x513f70[_0xbae2('0x2e')],_0x513f70[_0xbae2('0x2b')]);_0x25eba1[_0xbae2('0x2f')]=_[_0xbae2('0x2d')](_0x513f70[_0xbae2('0x2e')],qs[_0xbae2('0x30')](_0x339f83[_0xbae2('0x2b')][_0xbae2('0x30')]));_0x25eba1['attributes']=_0x25eba1[_0xbae2('0x2f')][_0xbae2('0x31')]?_0x25eba1['attributes']:_0x513f70['model'];if(_0x339f83[_0xbae2('0x2b')][_0xbae2('0x32')]){_0x25eba1[_0xbae2('0x33')]=[{'all':!![]}];}_0x25eba1=_[_0xbae2('0x34')]({},_0x25eba1,_0x339f83['options']);return db[_0xbae2('0x29')][_0xbae2('0x35')](_0x25eba1)[_0xbae2('0x22')](handleEntityNotFound(_0x1f96c7,null))[_0xbae2('0x22')](respondWithResult(_0x1f96c7,null))[_0xbae2('0x36')](handleError(_0x1f96c7,null));};exports[_0xbae2('0x20')]=function(_0x1a6030,_0x26203e){if(_0x1a6030[_0xbae2('0x37')]['id']){delete _0x1a6030['body']['id'];}return db[_0xbae2('0x29')][_0xbae2('0x35')]({'where':{'id':_0x1a6030[_0xbae2('0x27')]['id']}})[_0xbae2('0x22')](handleEntityNotFound(_0x26203e,null))['then'](saveUpdates(_0x1a6030[_0xbae2('0x37')],null))[_0xbae2('0x22')](respondWithResult(_0x26203e,null))[_0xbae2('0x36')](handleError(_0x26203e,null));};exports[_0xbae2('0x21')]=function(_0x3cd094,_0x4bbb21){return db[_0xbae2('0x29')]['find']({'where':{'id':_0x3cd094[_0xbae2('0x27')]['id']}})[_0xbae2('0x22')](handleEntityNotFound(_0x4bbb21,null))[_0xbae2('0x22')](removeEntity(_0x4bbb21,null))[_0xbae2('0x36')](handleError(_0x4bbb21,null));};
\ No newline at end of file
+var _0xc788=['Content-Range','apply','save','update','then','destroy','error','name','send','show','model','ChatApplication','rawAttributes','query','filters','attributes','fields','includeAll','include','merge','options','find','catch','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0xc788,0xc4));var _0x8c78=function(_0x346962,_0x4f69d6){_0x346962=_0x346962-0x0;var _0x3f2a3d=_0xc788[_0x346962];return _0x3f2a3d;};'use strict';var emlformat=require(_0x8c78('0x0'));var rimraf=require(_0x8c78('0x1'));var zipdir=require(_0x8c78('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8c78('0x3'));var BPromise=require(_0x8c78('0x4'));var Mustache=require(_0x8c78('0x5'));var util=require(_0x8c78('0x6'));var path=require(_0x8c78('0x7'));var sox=require('sox');var csv=require(_0x8c78('0x8'));var ejs=require(_0x8c78('0x9'));var fs=require('fs');var fs_extra=require(_0x8c78('0xa'));var _=require(_0x8c78('0xb'));var squel=require(_0x8c78('0xc'));var crypto=require('crypto');var jsforce=require(_0x8c78('0xd'));var deskjs=require(_0x8c78('0xe'));var toCsv=require(_0x8c78('0x8'));var querystring=require(_0x8c78('0xf'));var Papa=require(_0x8c78('0x10'));var Redis=require(_0x8c78('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8c78('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c78('0x13'));var logger=require(_0x8c78('0x14'))('api');var utils=require(_0x8c78('0x15'));var config=require(_0x8c78('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8c78('0x17'))['db'];function respondWithStatusCode(_0x4b2eca,_0x56a802){_0x56a802=_0x56a802||0xcc;return function(_0x349dfa){if(_0x349dfa){return _0x4b2eca[_0x8c78('0x18')](_0x56a802);}return _0x4b2eca[_0x8c78('0x19')](_0x56a802)[_0x8c78('0x1a')]();};}function respondWithResult(_0x2eedff,_0x3d1306){_0x3d1306=_0x3d1306||0xc8;return function(_0xe5f8ae){if(_0xe5f8ae){return _0x2eedff[_0x8c78('0x19')](_0x3d1306)[_0x8c78('0x1b')](_0xe5f8ae);}};}function respondWithFilteredResult(_0x1157d0,_0x4ff4b0){return function(_0x1fa78e){if(_0x1fa78e){var _0x293cfe=typeof _0x4ff4b0['offset']===_0x8c78('0x1c')&&typeof _0x4ff4b0[_0x8c78('0x1d')]===_0x8c78('0x1c');var _0x23824e=_0x1fa78e[_0x8c78('0x1e')];var _0x461eff=_0x293cfe?0x0:_0x4ff4b0['offset'];var _0x4f7bf9=_0x293cfe?_0x1fa78e[_0x8c78('0x1e')]:_0x4ff4b0['offset']+_0x4ff4b0['limit'];var _0xece4f0;if(_0x4f7bf9>=_0x23824e){_0x4f7bf9=_0x23824e;_0xece4f0=0xc8;}else{_0xece4f0=0xce;}_0x1157d0['status'](_0xece4f0);return _0x1157d0[_0x8c78('0x1f')](_0x8c78('0x20'),_0x461eff+'-'+_0x4f7bf9+'/'+_0x23824e)['json'](_0x1fa78e);}return null;};}function patchUpdates(_0x6c9a12){return function(_0x5b111b){try{jsonpatch[_0x8c78('0x21')](_0x5b111b,_0x6c9a12,!![]);}catch(_0x3af73c){return BPromise['reject'](_0x3af73c);}return _0x5b111b[_0x8c78('0x22')]();};}function saveUpdates(_0x188cc3,_0x499603){return function(_0x2bc595){if(_0x2bc595){return _0x2bc595[_0x8c78('0x23')](_0x188cc3)[_0x8c78('0x24')](function(_0x9581c6){return _0x9581c6;});}return null;};}function removeEntity(_0x215940,_0x20f483){return function(_0xbfdf6f){if(_0xbfdf6f){return _0xbfdf6f[_0x8c78('0x25')]()[_0x8c78('0x24')](function(){_0x215940['status'](0xcc)[_0x8c78('0x1a')]();});}};}function handleEntityNotFound(_0x458763,_0x1d1cef){return function(_0x49cccb){if(!_0x49cccb){_0x458763[_0x8c78('0x18')](0x194);}return _0x49cccb;};}function handleError(_0x5d7445,_0xe85d05){_0xe85d05=_0xe85d05||0x1f4;return function(_0x24f9a7){logger[_0x8c78('0x26')](_0x24f9a7['stack']);if(_0x24f9a7[_0x8c78('0x27')]){delete _0x24f9a7[_0x8c78('0x27')];}_0x5d7445['status'](_0xe85d05)[_0x8c78('0x28')](_0x24f9a7);};}exports[_0x8c78('0x29')]=function(_0x394c1d,_0x36e8e5){var _0x253776={'raw':!![],'where':{'id':_0x394c1d['params']['id']}},_0x2ab5cc={};_0x2ab5cc[_0x8c78('0x2a')]=_['keys'](db[_0x8c78('0x2b')][_0x8c78('0x2c')]);_0x2ab5cc[_0x8c78('0x2d')]=_['keys'](_0x394c1d[_0x8c78('0x2d')]);_0x2ab5cc[_0x8c78('0x2e')]=_['intersection'](_0x2ab5cc[_0x8c78('0x2a')],_0x2ab5cc[_0x8c78('0x2d')]);_0x253776[_0x8c78('0x2f')]=_['intersection'](_0x2ab5cc[_0x8c78('0x2a')],qs[_0x8c78('0x30')](_0x394c1d[_0x8c78('0x2d')]['fields']));_0x253776[_0x8c78('0x2f')]=_0x253776[_0x8c78('0x2f')]['length']?_0x253776[_0x8c78('0x2f')]:_0x2ab5cc[_0x8c78('0x2a')];if(_0x394c1d[_0x8c78('0x2d')][_0x8c78('0x31')]){_0x253776[_0x8c78('0x32')]=[{'all':!![]}];}_0x253776=_[_0x8c78('0x33')]({},_0x253776,_0x394c1d[_0x8c78('0x34')]);return db[_0x8c78('0x2b')][_0x8c78('0x35')](_0x253776)[_0x8c78('0x24')](handleEntityNotFound(_0x36e8e5,null))['then'](respondWithResult(_0x36e8e5,null))[_0x8c78('0x36')](handleError(_0x36e8e5,null));};exports[_0x8c78('0x23')]=function(_0x2e0c6c,_0xc503ab){if(_0x2e0c6c[_0x8c78('0x37')]['id']){delete _0x2e0c6c['body']['id'];}return db[_0x8c78('0x2b')][_0x8c78('0x35')]({'where':{'id':_0x2e0c6c[_0x8c78('0x38')]['id']}})['then'](handleEntityNotFound(_0xc503ab,null))[_0x8c78('0x24')](saveUpdates(_0x2e0c6c[_0x8c78('0x37')],null))['then'](respondWithResult(_0xc503ab,null))[_0x8c78('0x36')](handleError(_0xc503ab,null));};exports['destroy']=function(_0xee735e,_0xf6cc5f){return db[_0x8c78('0x2b')][_0x8c78('0x35')]({'where':{'id':_0xee735e['params']['id']}})[_0x8c78('0x24')](handleEntityNotFound(_0xf6cc5f,null))['then'](removeEntity(_0xf6cc5f,null))[_0x8c78('0x36')](handleError(_0xf6cc5f,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 17d9819..5fad313 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 _0x16c2=['request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','chat_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','bluebird'];(function(_0xc6bd48,_0x18e451){var _0x249015=function(_0x1c688c){while(--_0x1c688c){_0xc6bd48['push'](_0xc6bd48['shift']());}};_0x249015(++_0x18e451);}(_0x16c2,0x176));var _0x216c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x16c2[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x216c('0x0'));var logger=require(_0x216c('0x1'))('api');var moment=require('moment');var BPromise=require(_0x216c('0x2'));var rp=require(_0x216c('0x3'));var fs=require('fs');var path=require(_0x216c('0x4'));var rimraf=require(_0x216c('0x5'));var config=require(_0x216c('0x6'));var attributes=require(_0x216c('0x7'));module[_0x216c('0x8')]=function(_0x12a6df,_0x39c90f){return _0x12a6df[_0x216c('0x9')]('ChatApplication',attributes,{'tableName':_0x216c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x216c('0xb'),'collate':_0x216c('0xc')});};
\ No newline at end of file
+var _0xded8=['bluebird','request-promise','../../config/environment','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment'];(function(_0x4e1bc0,_0x2fd996){var _0x151f70=function(_0x236460){while(--_0x236460){_0x4e1bc0['push'](_0x4e1bc0['shift']());}};_0x151f70(++_0x2fd996);}(_0xded8,0x130));var _0x8ded=function(_0x93049d,_0xc5029a){_0x93049d=_0x93049d-0x0;var _0x74b58e=_0xded8[_0x93049d];return _0x74b58e;};'use strict';var _=require(_0x8ded('0x0'));var util=require(_0x8ded('0x1'));var logger=require('../../config/logger')(_0x8ded('0x2'));var moment=require(_0x8ded('0x3'));var BPromise=require(_0x8ded('0x4'));var rp=require(_0x8ded('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8ded('0x6'));var attributes=require('./chatApplication.attributes');module['exports']=function(_0x3ca3c3,_0x132454){return _0x3ca3c3['define'](_0x8ded('0x7'),attributes,{'tableName':_0x8ded('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8ded('0x9'),'collate':_0x8ded('0xa')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 912731d..7e121ee 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 _0xfee1=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x38c632,_0x14e8e6){var _0x12737e=function(_0x3e0fe4){while(--_0x3e0fe4){_0x38c632['push'](_0x38c632['shift']());}};_0x12737e(++_0x14e8e6);}(_0xfee1,0x1c3));var _0x1fee=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xfee1[_0x16d10f];return _0x50c823;};'use strict';var _=require('lodash');var util=require(_0x1fee('0x0'));var moment=require(_0x1fee('0x1'));var BPromise=require('bluebird');var rs=require(_0x1fee('0x2'));var fs=require('fs');var Redis=require(_0x1fee('0x3'));var db=require(_0x1fee('0x4'))['db'];var utils=require(_0x1fee('0x5'));var logger=require(_0x1fee('0x6'))(_0x1fee('0x7'));var config=require(_0x1fee('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1fee('0x9')][_0x1fee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ee2dd,_0x66a3a2,_0x67bbb7){return new BPromise(function(_0x4cd843,_0x13c424){return client[_0x1fee('0xb')](_0x2ee2dd,_0x67bbb7)[_0x1fee('0xc')](function(_0x4465aa){logger[_0x1fee('0xd')]('ChatApplication,\x20%s,\x20%s',_0x66a3a2,'request\x20sent');logger[_0x1fee('0xe')](_0x1fee('0xf'),_0x66a3a2,_0x1fee('0x10'),JSON[_0x1fee('0x11')](_0x4465aa));if(_0x4465aa['error']){if(_0x4465aa[_0x1fee('0x12')][_0x1fee('0x13')]===0x1f4){logger[_0x1fee('0x12')](_0x1fee('0x14'),_0x66a3a2,_0x4465aa['error'][_0x1fee('0x15')]);return _0x13c424(_0x4465aa[_0x1fee('0x12')][_0x1fee('0x15')]);}logger[_0x1fee('0x12')](_0x1fee('0x14'),_0x66a3a2,_0x4465aa[_0x1fee('0x12')][_0x1fee('0x15')]);return _0x4cd843(_0x4465aa[_0x1fee('0x12')][_0x1fee('0x15')]);}else{logger['info'](_0x1fee('0x14'),_0x66a3a2,_0x1fee('0x10'));_0x4cd843(_0x4465aa[_0x1fee('0x16')]['message']);}})[_0x1fee('0x17')](function(_0x2fe087){logger[_0x1fee('0x12')](_0x1fee('0x14'),_0x66a3a2,_0x2fe087);_0x13c424(_0x2fe087);});});}
\ No newline at end of file
+var _0x2a02=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','message'];(function(_0x3357e1,_0x270952){var _0x200fe5=function(_0xf9e639){while(--_0xf9e639){_0x3357e1['push'](_0x3357e1['shift']());}};_0x200fe5(++_0x270952);}(_0x2a02,0x1d0));var _0x22a0=function(_0x37d3f3,_0xca010f){_0x37d3f3=_0x37d3f3-0x0;var _0x185c9c=_0x2a02[_0x37d3f3];return _0x185c9c;};'use strict';var _=require(_0x22a0('0x0'));var util=require('util');var moment=require(_0x22a0('0x1'));var BPromise=require(_0x22a0('0x2'));var rs=require(_0x22a0('0x3'));var fs=require('fs');var Redis=require(_0x22a0('0x4'));var db=require(_0x22a0('0x5'))['db'];var utils=require(_0x22a0('0x6'));var logger=require(_0x22a0('0x7'))('rpc');var config=require(_0x22a0('0x8'));var jayson=require(_0x22a0('0x9'));var client=jayson['client'][_0x22a0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xcbb92d,_0x39fa7a,_0x328a8f){return new BPromise(function(_0x1c4501,_0x38e282){return client[_0x22a0('0xb')](_0xcbb92d,_0x328a8f)[_0x22a0('0xc')](function(_0x58db2d){logger[_0x22a0('0xd')](_0x22a0('0xe'),_0x39fa7a,'request\x20sent');logger[_0x22a0('0xf')](_0x22a0('0x10'),_0x39fa7a,_0x22a0('0x11'),JSON['stringify'](_0x58db2d));if(_0x58db2d[_0x22a0('0x12')]){if(_0x58db2d[_0x22a0('0x12')]['code']===0x1f4){logger['error'](_0x22a0('0xe'),_0x39fa7a,_0x58db2d[_0x22a0('0x12')][_0x22a0('0x13')]);return _0x38e282(_0x58db2d[_0x22a0('0x12')]['message']);}logger[_0x22a0('0x12')](_0x22a0('0xe'),_0x39fa7a,_0x58db2d[_0x22a0('0x12')][_0x22a0('0x13')]);return _0x1c4501(_0x58db2d[_0x22a0('0x12')][_0x22a0('0x13')]);}else{logger[_0x22a0('0xd')](_0x22a0('0xe'),_0x39fa7a,_0x22a0('0x11'));_0x1c4501(_0x58db2d[_0x22a0('0x14')][_0x22a0('0x13')]);}})[_0x22a0('0x15')](function(_0x1995ac){logger[_0x22a0('0x12')](_0x22a0('0xe'),_0x39fa7a,_0x1995ac);_0x38e282(_0x1995ac);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 43330e1..85cb179 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 _0x9b12=['update','delete','destroy','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','/:id','isAuthenticated','show','put'];(function(_0x89ee68,_0x18ca4d){var _0x1dfd3b=function(_0x2f8d31){while(--_0x2f8d31){_0x89ee68['push'](_0x89ee68['shift']());}};_0x1dfd3b(++_0x18ca4d);}(_0x9b12,0x155));var _0x29b1=function(_0x10c24b,_0xc63503){_0x10c24b=_0x10c24b-0x0;var _0x491610=_0x9b12[_0x10c24b];return _0x491610;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x29b1('0x0'));var express=require(_0x29b1('0x1'));var router=express[_0x29b1('0x2')]();var fs_extra=require(_0x29b1('0x3'));var auth=require(_0x29b1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x29b1('0x5'));var controller=require('./chatApplication.controller');router['get'](_0x29b1('0x6'),auth[_0x29b1('0x7')](),controller[_0x29b1('0x8')]);router[_0x29b1('0x9')](_0x29b1('0x6'),auth[_0x29b1('0x7')](),controller[_0x29b1('0xa')]);router[_0x29b1('0xb')](_0x29b1('0x6'),auth['isAuthenticated'](),controller[_0x29b1('0xc')]);module['exports']=router;
\ No newline at end of file
+var _0xda60=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','show','put','/:id','update','delete','exports','Router','fs-extra'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xda60,0xc2));var _0x0da6=function(_0x214450,_0x1f80ad){_0x214450=_0x214450-0x0;var _0xf0321f=_0xda60[_0x214450];return _0xf0321f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0da6('0x0')]();var fs_extra=require(_0x0da6('0x1'));var auth=require(_0x0da6('0x2'));var interaction=require(_0x0da6('0x3'));var config=require(_0x0da6('0x4'));var controller=require(_0x0da6('0x5'));router[_0x0da6('0x6')]('/:id',auth[_0x0da6('0x7')](),controller[_0x0da6('0x8')]);router[_0x0da6('0x9')](_0x0da6('0xa'),auth[_0x0da6('0x7')](),controller[_0x0da6('0xb')]);router[_0x0da6('0xc')](_0x0da6('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x0da6('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index ebd8138..ca36f82 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 _0xba55=['STRING','sequelize','exports'];(function(_0x23f7ed,_0x2d3f56){var _0x54e09b=function(_0x158ff9){while(--_0x158ff9){_0x23f7ed['push'](_0x23f7ed['shift']());}};_0x54e09b(++_0x2d3f56);}(_0xba55,0x1f3));var _0x5ba5=function(_0x5c1c58,_0x213cd4){_0x5c1c58=_0x5c1c58-0x0;var _0x25cf5e=_0xba55[_0x5c1c58];return _0x25cf5e;};'use strict';var Sequelize=require(_0x5ba5('0x0'));module[_0x5ba5('0x1')]={'name':{'type':Sequelize[_0x5ba5('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5ba5('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x0755=['sequelize','exports','STRING','BOOLEAN'];(function(_0x444a22,_0xbd20cf){var _0x26dffa=function(_0x5ba8f2){while(--_0x5ba8f2){_0x444a22['push'](_0x444a22['shift']());}};_0x26dffa(++_0xbd20cf);}(_0x0755,0x7c));var _0x5075=function(_0x31d03c,_0x158cef){_0x31d03c=_0x31d03c-0x0;var _0x420e61=_0x0755[_0x31d03c];return _0x420e61;};'use strict';var Sequelize=require(_0x5075('0x0'));module[_0x5075('0x1')]={'name':{'type':Sequelize[_0x5075('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5075('0x2')]},'write':{'type':Sequelize[_0x5075('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 88bb181..749fc9f 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 _0xc24b=['filter','merge','VIRTUAL','include','ChatGroup','findAll','catch','show','params','keys','fields','options','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','User','order','sort','removeMembers','ChatGroupId','getMessages','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','send','map','rawAttributes','type','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','where','pick'];(function(_0x25fe5,_0x2b26dc){var _0x3b299f=function(_0x399b12){while(--_0x399b12){_0x25fe5['push'](_0x25fe5['shift']());}};_0x3b299f(++_0x2b26dc);}(_0xc24b,0xe0));var _0xbc24=function(_0x2ef8f1,_0x1280a3){_0x2ef8f1=_0x2ef8f1-0x0;var _0x17498d=_0xc24b[_0x2ef8f1];return _0x17498d;};'use strict';var emlformat=require(_0xbc24('0x0'));var rimraf=require(_0xbc24('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbc24('0x2'));var rp=require(_0xbc24('0x3'));var moment=require(_0xbc24('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbc24('0x5'));var util=require(_0xbc24('0x6'));var path=require(_0xbc24('0x7'));var sox=require(_0xbc24('0x8'));var csv=require(_0xbc24('0x9'));var ejs=require(_0xbc24('0xa'));var fs=require('fs');var fs_extra=require(_0xbc24('0xb'));var _=require(_0xbc24('0xc'));var squel=require(_0xbc24('0xd'));var crypto=require(_0xbc24('0xe'));var jsforce=require(_0xbc24('0xf'));var deskjs=require(_0xbc24('0x10'));var toCsv=require(_0xbc24('0x9'));var querystring=require(_0xbc24('0x11'));var Papa=require(_0xbc24('0x12'));var Redis=require(_0xbc24('0x13'));var authService=require(_0xbc24('0x14'));var qs=require(_0xbc24('0x15'));var as=require(_0xbc24('0x16'));var hardwareService=require(_0xbc24('0x17'));var logger=require('../../config/logger')(_0xbc24('0x18'));var utils=require(_0xbc24('0x19'));var config=require(_0xbc24('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xbc24('0x1b'))['db'];config['redis']=_[_0xbc24('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatGroup.socket')[_0xbc24('0x1d')](socket);function respondWithStatusCode(_0x873777,_0x4e2201){_0x4e2201=_0x4e2201||0xcc;return function(_0x26d897){if(_0x26d897){return _0x873777['sendStatus'](_0x4e2201);}return _0x873777[_0xbc24('0x1e')](_0x4e2201)[_0xbc24('0x1f')]();};}function respondWithResult(_0x1beee6,_0x1b71e8){_0x1b71e8=_0x1b71e8||0xc8;return function(_0x2069fd){if(_0x2069fd){return _0x1beee6[_0xbc24('0x1e')](_0x1b71e8)[_0xbc24('0x20')](_0x2069fd);}};}function respondWithFilteredResult(_0x3b4365,_0x3ab1e9){return function(_0x4bca56){if(_0x4bca56){var _0x44bafd=typeof _0x3ab1e9[_0xbc24('0x21')]===_0xbc24('0x22')&&typeof _0x3ab1e9[_0xbc24('0x23')]==='undefined';var _0x20e735=_0x4bca56[_0xbc24('0x24')];var _0x473ba7=_0x44bafd?0x0:_0x3ab1e9['offset'];var _0x399542=_0x44bafd?_0x4bca56[_0xbc24('0x24')]:_0x3ab1e9[_0xbc24('0x21')]+_0x3ab1e9[_0xbc24('0x23')];var _0x5a042b;if(_0x399542>=_0x20e735){_0x399542=_0x20e735;_0x5a042b=0xc8;}else{_0x5a042b=0xce;}_0x3b4365[_0xbc24('0x1e')](_0x5a042b);return _0x3b4365[_0xbc24('0x25')](_0xbc24('0x26'),_0x473ba7+'-'+_0x399542+'/'+_0x20e735)['json'](_0x4bca56);}return null;};}function patchUpdates(_0x50bfce){return function(_0x330811){try{jsonpatch[_0xbc24('0x27')](_0x330811,_0x50bfce,!![]);}catch(_0x28382c){return BPromise[_0xbc24('0x28')](_0x28382c);}return _0x330811['save']();};}function saveUpdates(_0x4d78e8,_0x1d3977){return function(_0xb20938){if(_0xb20938){return _0xb20938[_0xbc24('0x29')](_0x4d78e8)[_0xbc24('0x2a')](function(_0x583aa2){return _0x583aa2;});}return null;};}function removeEntity(_0x20f4ac,_0x39ad2c){return function(_0x2a6428){if(_0x2a6428){return _0x2a6428[_0xbc24('0x2b')]()['then'](function(){_0x20f4ac[_0xbc24('0x1e')](0xcc)[_0xbc24('0x1f')]();});}};}function handleEntityNotFound(_0x1d1e12,_0x2ee972){return function(_0x50a499){if(!_0x50a499){_0x1d1e12[_0xbc24('0x2c')](0x194);}return _0x50a499;};}function handleError(_0x27941d,_0xde0c63){_0xde0c63=_0xde0c63||0x1f4;return function(_0x2da41c){logger['error'](_0x2da41c[_0xbc24('0x2d')]);if(_0x2da41c[_0xbc24('0x2e')]){delete _0x2da41c[_0xbc24('0x2e')];}_0x27941d[_0xbc24('0x1e')](_0xde0c63)[_0xbc24('0x2f')](_0x2da41c);};}exports['index']=function(_0x4de004,_0x5f5e5f){var _0x243838={},_0x4d3a4c={},_0x5bed34={'count':0x0,'rows':[]};var _0x562773=_[_0xbc24('0x30')](db['ChatGroup'][_0xbc24('0x31')],function(_0x2ff5cc){return{'name':_0x2ff5cc['fieldName'],'type':_0x2ff5cc[_0xbc24('0x32')]['key']};});_0x4d3a4c[_0xbc24('0x33')]=_[_0xbc24('0x30')](_0x562773,_0xbc24('0x2e'));_0x4d3a4c[_0xbc24('0x34')]=_['keys'](_0x4de004[_0xbc24('0x34')]);_0x4d3a4c[_0xbc24('0x35')]=_[_0xbc24('0x36')](_0x4d3a4c[_0xbc24('0x33')],_0x4d3a4c['query']);_0x243838[_0xbc24('0x37')]=_[_0xbc24('0x36')](_0x4d3a4c[_0xbc24('0x33')],qs['fields'](_0x4de004[_0xbc24('0x34')]['fields']));_0x243838['attributes']=_0x243838['attributes'][_0xbc24('0x38')]?_0x243838['attributes']:_0x4d3a4c[_0xbc24('0x33')];if(!_0x4de004[_0xbc24('0x34')][_0xbc24('0x39')](_0xbc24('0x3a'))){_0x243838[_0xbc24('0x23')]=qs[_0xbc24('0x23')](_0x4de004[_0xbc24('0x34')][_0xbc24('0x23')]);_0x243838[_0xbc24('0x21')]=qs[_0xbc24('0x21')](_0x4de004[_0xbc24('0x34')][_0xbc24('0x21')]);}_0x243838['order']=qs['sort'](_0x4de004[_0xbc24('0x34')]['sort']);_0x243838[_0xbc24('0x3b')]=qs['filters'](_[_0xbc24('0x3c')](_0x4de004[_0xbc24('0x34')],_0x4d3a4c[_0xbc24('0x35')]),_0x562773);if(_0x4de004['query'][_0xbc24('0x3d')]){_0x243838[_0xbc24('0x3b')]=_[_0xbc24('0x3e')](_0x243838[_0xbc24('0x3b')],{'$or':_[_0xbc24('0x30')](_0x562773,function(_0x775b25){if(_0x775b25[_0xbc24('0x32')]!==_0xbc24('0x3f')){var _0x3962f1={};_0x3962f1[_0x775b25[_0xbc24('0x2e')]]={'$like':'%'+_0x4de004[_0xbc24('0x34')][_0xbc24('0x3d')]+'%'};return _0x3962f1;}})});}_0x243838=_[_0xbc24('0x3e')]({},_0x243838,_0x4de004['options']);var _0x56f22e={'where':_0x243838[_0xbc24('0x3b')]};return db['ChatGroup']['count'](_0x56f22e)[_0xbc24('0x2a')](function(_0x3ac787){_0x5bed34[_0xbc24('0x24')]=_0x3ac787;if(_0x4de004[_0xbc24('0x34')]['includeAll']){_0x243838[_0xbc24('0x40')]=[{'all':!![]}];}return db[_0xbc24('0x41')][_0xbc24('0x42')](_0x243838);})[_0xbc24('0x2a')](function(_0x1acbef){_0x5bed34['rows']=_0x1acbef;return _0x5bed34;})[_0xbc24('0x2a')](respondWithFilteredResult(_0x5f5e5f,_0x243838))[_0xbc24('0x43')](handleError(_0x5f5e5f,null));};exports[_0xbc24('0x44')]=function(_0x3cf0b7,_0x1425c){var _0x4087c3={'raw':!![],'where':{'id':_0x3cf0b7[_0xbc24('0x45')]['id']}},_0x3184ae={};_0x3184ae[_0xbc24('0x33')]=_['keys'](db[_0xbc24('0x41')][_0xbc24('0x31')]);_0x3184ae[_0xbc24('0x34')]=_[_0xbc24('0x46')](_0x3cf0b7[_0xbc24('0x34')]);_0x3184ae[_0xbc24('0x35')]=_[_0xbc24('0x36')](_0x3184ae[_0xbc24('0x33')],_0x3184ae[_0xbc24('0x34')]);_0x4087c3[_0xbc24('0x37')]=_[_0xbc24('0x36')](_0x3184ae['model'],qs[_0xbc24('0x47')](_0x3cf0b7[_0xbc24('0x34')][_0xbc24('0x47')]));_0x4087c3[_0xbc24('0x37')]=_0x4087c3['attributes'][_0xbc24('0x38')]?_0x4087c3[_0xbc24('0x37')]:_0x3184ae[_0xbc24('0x33')];if(_0x3cf0b7[_0xbc24('0x34')]['includeAll']){_0x4087c3['include']=[{'all':!![]}];}_0x4087c3=_[_0xbc24('0x3e')]({},_0x4087c3,_0x3cf0b7[_0xbc24('0x48')]);return db[_0xbc24('0x41')][_0xbc24('0x49')](_0x4087c3)[_0xbc24('0x2a')](handleEntityNotFound(_0x1425c,null))[_0xbc24('0x2a')](respondWithResult(_0x1425c,null))['catch'](handleError(_0x1425c,null));};exports[_0xbc24('0x4a')]=function(_0x5a246a,_0x347988){return db[_0xbc24('0x41')][_0xbc24('0x4a')](_0x5a246a[_0xbc24('0x4b')],{})[_0xbc24('0x2a')](respondWithResult(_0x347988,0xc9))['catch'](handleError(_0x347988,null));};exports[_0xbc24('0x29')]=function(_0x464735,_0x3ef9a7){if(_0x464735[_0xbc24('0x4b')]['id']){delete _0x464735[_0xbc24('0x4b')]['id'];}return db[_0xbc24('0x41')][_0xbc24('0x49')]({'where':{'id':_0x464735['params']['id']}})['then'](handleEntityNotFound(_0x3ef9a7,null))['then'](saveUpdates(_0x464735[_0xbc24('0x4b')],null))[_0xbc24('0x2a')](respondWithResult(_0x3ef9a7,null))[_0xbc24('0x43')](handleError(_0x3ef9a7,null));};exports[_0xbc24('0x2b')]=function(_0x256fdd,_0x16074f){return db[_0xbc24('0x41')][_0xbc24('0x49')]({'where':{'id':_0x256fdd['params']['id']}})[_0xbc24('0x2a')](handleEntityNotFound(_0x16074f,null))[_0xbc24('0x2a')](removeEntity(_0x16074f,null))[_0xbc24('0x43')](handleError(_0x16074f,null));};exports['describe']=function(_0x278745,_0x3c485a){return db['ChatGroup'][_0xbc24('0x4c')]()[_0xbc24('0x2a')](respondWithResult(_0x3c485a,null))[_0xbc24('0x43')](handleError(_0x3c485a,null));};exports[_0xbc24('0x4d')]=function(_0x4b23cd,_0x39c86f,_0x1f1f77){return db[_0xbc24('0x4e')]['count']({'where':{'ChatGroupId':_0x4b23cd[_0xbc24('0x45')]['id'],'ToId':_0x4b23cd[_0xbc24('0x4f')]['id'],'read':![]}})[_0xbc24('0x2a')](function(_0x41a262){return{'id':_[_0xbc24('0x50')](_0x4b23cd[_0xbc24('0x45')]['id']),'count':_0x41a262};})[_0xbc24('0x2a')](respondWithResult(_0x39c86f,null))[_0xbc24('0x43')](handleError(_0x39c86f,null));};exports[_0xbc24('0x51')]=function(_0x5c08ef,_0x470893,_0x1dcef2){return db[_0xbc24('0x41')][_0xbc24('0x49')]({'where':{'id':_0x5c08ef['params']['id']}})['then'](handleEntityNotFound(_0x470893,null))[_0xbc24('0x2a')](function(_0x46a017){if(_0x46a017){return _0x46a017['addMembers'](_0x5c08ef['body'][_0xbc24('0x52')],_[_0xbc24('0x53')](_0x5c08ef[_0xbc24('0x4b')],[_0xbc24('0x52'),'id'])||{});}})[_0xbc24('0x2a')](respondWithResult(_0x470893,null))[_0xbc24('0x43')](handleError(_0x470893,null));};exports[_0xbc24('0x54')]=function(_0x1b7f3a,_0x2d8bb1,_0x2a6b9b){var _0x1f5cdb={};var _0x9c60ec={};var _0x3e8a8a;var _0x53f057;return db[_0xbc24('0x41')]['findOne']({'where':{'id':_0x1b7f3a[_0xbc24('0x45')]['id']}})[_0xbc24('0x2a')](handleEntityNotFound(_0x2d8bb1,null))[_0xbc24('0x2a')](function(_0xce75fc){if(_0xce75fc){_0x3e8a8a=_0xce75fc;_0x9c60ec[_0xbc24('0x33')]=_['keys'](db[_0xbc24('0x55')][_0xbc24('0x31')]);_0x9c60ec[_0xbc24('0x34')]=_[_0xbc24('0x46')](_0x1b7f3a[_0xbc24('0x34')]);_0x9c60ec['filters']=_['intersection'](_0x9c60ec[_0xbc24('0x33')],_0x9c60ec[_0xbc24('0x34')]);_0x1f5cdb[_0xbc24('0x37')]=_[_0xbc24('0x36')](_0x9c60ec[_0xbc24('0x33')],qs[_0xbc24('0x47')](_0x1b7f3a[_0xbc24('0x34')][_0xbc24('0x47')]));_0x1f5cdb[_0xbc24('0x37')]=_0x1f5cdb[_0xbc24('0x37')][_0xbc24('0x38')]?_0x1f5cdb['attributes']:_0x9c60ec[_0xbc24('0x33')];_0x1f5cdb[_0xbc24('0x56')]=qs[_0xbc24('0x57')](_0x1b7f3a[_0xbc24('0x34')][_0xbc24('0x57')]);_0x1f5cdb[_0xbc24('0x3b')]=qs[_0xbc24('0x35')](_[_0xbc24('0x3c')](_0x1b7f3a[_0xbc24('0x34')],_0x9c60ec[_0xbc24('0x35')]));if(_0x1b7f3a['query'][_0xbc24('0x3d')]){_0x1f5cdb[_0xbc24('0x3b')]=_['merge'](_0x1f5cdb[_0xbc24('0x3b')],{'$or':_[_0xbc24('0x30')](_0x1f5cdb['attributes'],function(_0x79fb81){var _0x28e567={};_0x28e567[_0x79fb81]={'$like':'%'+_0x1b7f3a['query']['filter']+'%'};return _0x28e567;})});}_0x1f5cdb=_[_0xbc24('0x3e')]({},_0x1f5cdb,_0x1b7f3a[_0xbc24('0x48')]);return _0x3e8a8a[_0xbc24('0x54')](_0x1f5cdb);}})[_0xbc24('0x2a')](function(_0x2fd68e){if(_0x2fd68e){_0x53f057=_0x2fd68e['length'];if(!_0x1b7f3a[_0xbc24('0x34')][_0xbc24('0x39')](_0xbc24('0x3a'))){_0x1f5cdb[_0xbc24('0x23')]=qs['limit'](_0x1b7f3a[_0xbc24('0x34')][_0xbc24('0x23')]);_0x1f5cdb['offset']=qs[_0xbc24('0x21')](_0x1b7f3a[_0xbc24('0x34')][_0xbc24('0x21')]);}return _0x3e8a8a['getMembers'](_0x1f5cdb);}})[_0xbc24('0x2a')](function(_0x1be9d6){if(_0x1be9d6){return _0x1be9d6?{'count':_0x53f057,'rows':_0x1be9d6}:null;}})['then'](respondWithResult(_0x2d8bb1,null))[_0xbc24('0x43')](handleError(_0x2d8bb1,null));};exports[_0xbc24('0x58')]=function(_0x5280c4,_0x5e60b0,_0x5504c9){return db[_0xbc24('0x41')][_0xbc24('0x49')]({'where':{'id':_0x5280c4[_0xbc24('0x45')]['id']}})[_0xbc24('0x2a')](handleEntityNotFound(_0x5e60b0,null))[_0xbc24('0x2a')](function(_0x342076){if(_0x342076){return _0x342076[_0xbc24('0x58')](_0x5280c4[_0xbc24('0x34')]['ids']);}})[_0xbc24('0x2a')](respondWithStatusCode(_0x5e60b0,null))['catch'](handleError(_0x5e60b0,null));};exports['addMessage']=function(_0xccadea,_0x539b49,_0x3893a6){if(_0xccadea[_0xbc24('0x4b')]['id']){delete _0xccadea[_0xbc24('0x4b')]['id'];}return db[_0xbc24('0x41')]['find']({'where':{'id':_0xccadea[_0xbc24('0x45')]['id']}})[_0xbc24('0x2a')](handleEntityNotFound(_0x539b49,null))[_0xbc24('0x2a')](function(_0x26038e){if(_0x26038e){_0xccadea[_0xbc24('0x4b')][_0xbc24('0x59')]=_0x26038e['id'];return db[_0xbc24('0x4e')][_0xbc24('0x4a')](_0xccadea['body']);}})['then'](respondWithResult(_0x539b49,null))[_0xbc24('0x43')](handleError(_0x539b49,null));};exports[_0xbc24('0x5a')]=function(_0x14b66f,_0x25c41b,_0x44a62c){var _0x3e61b3={};var _0x4abeed={};var _0x2c9b33;var _0x4498d5;return db['ChatGroup'][_0xbc24('0x5b')]({'where':{'id':_0x14b66f['params']['id']}})[_0xbc24('0x2a')](handleEntityNotFound(_0x25c41b,null))['then'](function(_0x52ff6b){if(_0x52ff6b){_0x2c9b33=_0x52ff6b;_0x4abeed['model']=_[_0xbc24('0x46')](db['ChatInternalMessage'][_0xbc24('0x31')]);_0x4abeed[_0xbc24('0x34')]=_[_0xbc24('0x46')](_0x14b66f[_0xbc24('0x34')]);_0x4abeed[_0xbc24('0x35')]=_[_0xbc24('0x36')](_0x4abeed['model'],_0x4abeed[_0xbc24('0x34')]);_0x3e61b3['attributes']=_[_0xbc24('0x36')](_0x4abeed[_0xbc24('0x33')],qs['fields'](_0x14b66f[_0xbc24('0x34')]['fields']));_0x3e61b3['attributes']=_0x3e61b3[_0xbc24('0x37')][_0xbc24('0x38')]?_0x3e61b3[_0xbc24('0x37')]:_0x4abeed[_0xbc24('0x33')];_0x3e61b3[_0xbc24('0x56')]=qs[_0xbc24('0x57')](_0x14b66f[_0xbc24('0x34')]['sort']);_0x3e61b3[_0xbc24('0x3b')]=qs[_0xbc24('0x35')](_[_0xbc24('0x3c')](_0x14b66f[_0xbc24('0x34')],_0x4abeed[_0xbc24('0x35')]));if(_0x14b66f[_0xbc24('0x34')][_0xbc24('0x3d')]){_0x3e61b3[_0xbc24('0x3b')]=_[_0xbc24('0x3e')](_0x3e61b3[_0xbc24('0x3b')],{'$or':_[_0xbc24('0x30')](_0x3e61b3['attributes'],function(_0x40829e){var _0x2a3170={};_0x2a3170[_0x40829e]={'$like':'%'+_0x14b66f['query'][_0xbc24('0x3d')]+'%'};return _0x2a3170;})});}if(_0x14b66f[_0xbc24('0x34')][_0xbc24('0x5c')]){var _0x4d4878=_0x14b66f[_0xbc24('0x34')][_0xbc24('0x5c')]['split'](',');var _0x5b241c={};_0x5b241c[_0x4d4878[0x0]]={'$gte':moment(_0x4d4878[0x1])[_0xbc24('0x5d')](_0xbc24('0x5e'))};_0x3e61b3[_0xbc24('0x3b')]=_[_0xbc24('0x3e')](_0x3e61b3['where'],_0x5b241c);}_0x3e61b3=_['merge']({},_0x3e61b3,_0x14b66f[_0xbc24('0x48')]);return _0x2c9b33[_0xbc24('0x5a')](_0x3e61b3);}})[_0xbc24('0x2a')](function(_0x2c98c2){if(_0x2c98c2){_0x4498d5=_0x2c98c2['length'];if(!_0x14b66f[_0xbc24('0x34')]['hasOwnProperty'](_0xbc24('0x3a'))){_0x3e61b3['limit']=qs[_0xbc24('0x23')](_0x14b66f[_0xbc24('0x34')][_0xbc24('0x23')]);_0x3e61b3[_0xbc24('0x21')]=qs[_0xbc24('0x21')](_0x14b66f[_0xbc24('0x34')]['offset']);}return _0x2c9b33[_0xbc24('0x5a')](_0x3e61b3);}})['then'](function(_0x376ac3){if(_0x376ac3){return _0x376ac3?{'count':_0x4498d5,'rows':_0x376ac3}:null;}})[_0xbc24('0x2a')](respondWithResult(_0x25c41b,null))['catch'](handleError(_0x25c41b,null));};
\ No newline at end of file
+var _0x10d6=['rows','catch','show','params','options','find','create','body','update','destroy','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','findOne','User','getMembers','removeMembers','ids','addMessage','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','defaults','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','json','limit','offset','set','Content-Range','reject','then','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','count','includeAll','include','findAll'];(function(_0x553c6f,_0xdaf6e5){var _0x15bb77=function(_0x2439d9){while(--_0x2439d9){_0x553c6f['push'](_0x553c6f['shift']());}};_0x15bb77(++_0xdaf6e5);}(_0x10d6,0x1ad));var _0x610d=function(_0x462017,_0x59d18b){_0x462017=_0x462017-0x0;var _0x195959=_0x10d6[_0x462017];return _0x195959;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x610d('0x0'));var zipdir=require(_0x610d('0x1'));var jsonpatch=require(_0x610d('0x2'));var rp=require(_0x610d('0x3'));var moment=require(_0x610d('0x4'));var BPromise=require(_0x610d('0x5'));var Mustache=require(_0x610d('0x6'));var util=require(_0x610d('0x7'));var path=require('path');var sox=require(_0x610d('0x8'));var csv=require(_0x610d('0x9'));var ejs=require(_0x610d('0xa'));var fs=require('fs');var fs_extra=require(_0x610d('0xb'));var _=require(_0x610d('0xc'));var squel=require(_0x610d('0xd'));var crypto=require(_0x610d('0xe'));var jsforce=require(_0x610d('0xf'));var deskjs=require(_0x610d('0x10'));var toCsv=require(_0x610d('0x9'));var querystring=require(_0x610d('0x11'));var Papa=require(_0x610d('0x12'));var Redis=require(_0x610d('0x13'));var authService=require(_0x610d('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x610d('0x15'));var hardwareService=require(_0x610d('0x16'));var logger=require(_0x610d('0x17'))(_0x610d('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x610d('0x19'))['db'];config['redis']=_[_0x610d('0x1a')](config['redis'],{'host':_0x610d('0x1b'),'port':0x18eb});var socket=require(_0x610d('0x1c'))(new Redis(config['redis']));require(_0x610d('0x1d'))['register'](socket);function respondWithStatusCode(_0x2a912a,_0x41b3eb){_0x41b3eb=_0x41b3eb||0xcc;return function(_0x50f986){if(_0x50f986){return _0x2a912a[_0x610d('0x1e')](_0x41b3eb);}return _0x2a912a[_0x610d('0x1f')](_0x41b3eb)[_0x610d('0x20')]();};}function respondWithResult(_0x37b695,_0x8b6a7b){_0x8b6a7b=_0x8b6a7b||0xc8;return function(_0x4062b7){if(_0x4062b7){return _0x37b695[_0x610d('0x1f')](_0x8b6a7b)[_0x610d('0x21')](_0x4062b7);}};}function respondWithFilteredResult(_0x51d485,_0x56409b){return function(_0x110e24){if(_0x110e24){var _0x317f04=typeof _0x56409b['offset']==='undefined'&&typeof _0x56409b[_0x610d('0x22')]==='undefined';var _0xa2913b=_0x110e24['count'];var _0x4c5abb=_0x317f04?0x0:_0x56409b[_0x610d('0x23')];var _0x328cca=_0x317f04?_0x110e24['count']:_0x56409b[_0x610d('0x23')]+_0x56409b['limit'];var _0x126cdc;if(_0x328cca>=_0xa2913b){_0x328cca=_0xa2913b;_0x126cdc=0xc8;}else{_0x126cdc=0xce;}_0x51d485[_0x610d('0x1f')](_0x126cdc);return _0x51d485[_0x610d('0x24')](_0x610d('0x25'),_0x4c5abb+'-'+_0x328cca+'/'+_0xa2913b)[_0x610d('0x21')](_0x110e24);}return null;};}function patchUpdates(_0x40d7ed){return function(_0x3561f7){try{jsonpatch['apply'](_0x3561f7,_0x40d7ed,!![]);}catch(_0x3ad3db){return BPromise[_0x610d('0x26')](_0x3ad3db);}return _0x3561f7['save']();};}function saveUpdates(_0x36c7de,_0x4c8aa1){return function(_0x30a872){if(_0x30a872){return _0x30a872['update'](_0x36c7de)['then'](function(_0x30268d){return _0x30268d;});}return null;};}function removeEntity(_0x2762eb,_0x5768e4){return function(_0x38d75c){if(_0x38d75c){return _0x38d75c['destroy']()[_0x610d('0x27')](function(){_0x2762eb[_0x610d('0x1f')](0xcc)[_0x610d('0x20')]();});}};}function handleEntityNotFound(_0x42deea,_0x30e894){return function(_0x258b4f){if(!_0x258b4f){_0x42deea[_0x610d('0x1e')](0x194);}return _0x258b4f;};}function handleError(_0x25cd90,_0x2e6bc9){_0x2e6bc9=_0x2e6bc9||0x1f4;return function(_0x3858cd){logger[_0x610d('0x28')](_0x3858cd[_0x610d('0x29')]);if(_0x3858cd[_0x610d('0x2a')]){delete _0x3858cd[_0x610d('0x2a')];}_0x25cd90[_0x610d('0x1f')](_0x2e6bc9)[_0x610d('0x2b')](_0x3858cd);};}exports[_0x610d('0x2c')]=function(_0x9507a4,_0x546599){var _0x7d51e3={},_0xd15365={},_0x4f4c3c={'count':0x0,'rows':[]};var _0x49ff57=_[_0x610d('0x2d')](db[_0x610d('0x2e')][_0x610d('0x2f')],function(_0x5383ab){return{'name':_0x5383ab[_0x610d('0x30')],'type':_0x5383ab['type'][_0x610d('0x31')]};});_0xd15365[_0x610d('0x32')]=_[_0x610d('0x2d')](_0x49ff57,_0x610d('0x2a'));_0xd15365[_0x610d('0x33')]=_[_0x610d('0x34')](_0x9507a4['query']);_0xd15365['filters']=_['intersection'](_0xd15365['model'],_0xd15365['query']);_0x7d51e3[_0x610d('0x35')]=_[_0x610d('0x36')](_0xd15365['model'],qs[_0x610d('0x37')](_0x9507a4[_0x610d('0x33')][_0x610d('0x37')]));_0x7d51e3[_0x610d('0x35')]=_0x7d51e3[_0x610d('0x35')][_0x610d('0x38')]?_0x7d51e3['attributes']:_0xd15365['model'];if(!_0x9507a4[_0x610d('0x33')]['hasOwnProperty'](_0x610d('0x39'))){_0x7d51e3['limit']=qs[_0x610d('0x22')](_0x9507a4[_0x610d('0x33')][_0x610d('0x22')]);_0x7d51e3['offset']=qs[_0x610d('0x23')](_0x9507a4[_0x610d('0x33')][_0x610d('0x23')]);}_0x7d51e3[_0x610d('0x3a')]=qs[_0x610d('0x3b')](_0x9507a4[_0x610d('0x33')][_0x610d('0x3b')]);_0x7d51e3[_0x610d('0x3c')]=qs[_0x610d('0x3d')](_[_0x610d('0x3e')](_0x9507a4[_0x610d('0x33')],_0xd15365[_0x610d('0x3d')]),_0x49ff57);if(_0x9507a4[_0x610d('0x33')][_0x610d('0x3f')]){_0x7d51e3[_0x610d('0x3c')]=_['merge'](_0x7d51e3['where'],{'$or':_[_0x610d('0x2d')](_0x49ff57,function(_0x16dfd2){if(_0x16dfd2[_0x610d('0x40')]!==_0x610d('0x41')){var _0xcaafe2={};_0xcaafe2[_0x16dfd2['name']]={'$like':'%'+_0x9507a4['query']['filter']+'%'};return _0xcaafe2;}})});}_0x7d51e3=_[_0x610d('0x42')]({},_0x7d51e3,_0x9507a4['options']);var _0xd9b20={'where':_0x7d51e3[_0x610d('0x3c')]};return db[_0x610d('0x2e')][_0x610d('0x43')](_0xd9b20)[_0x610d('0x27')](function(_0x12694f){_0x4f4c3c[_0x610d('0x43')]=_0x12694f;if(_0x9507a4[_0x610d('0x33')][_0x610d('0x44')]){_0x7d51e3[_0x610d('0x45')]=[{'all':!![]}];}return db[_0x610d('0x2e')][_0x610d('0x46')](_0x7d51e3);})[_0x610d('0x27')](function(_0x335d09){_0x4f4c3c[_0x610d('0x47')]=_0x335d09;return _0x4f4c3c;})[_0x610d('0x27')](respondWithFilteredResult(_0x546599,_0x7d51e3))[_0x610d('0x48')](handleError(_0x546599,null));};exports[_0x610d('0x49')]=function(_0x5ad80b,_0x876aff){var _0x5edb25={'raw':!![],'where':{'id':_0x5ad80b[_0x610d('0x4a')]['id']}},_0x4eb540={};_0x4eb540[_0x610d('0x32')]=_[_0x610d('0x34')](db['ChatGroup'][_0x610d('0x2f')]);_0x4eb540[_0x610d('0x33')]=_['keys'](_0x5ad80b[_0x610d('0x33')]);_0x4eb540[_0x610d('0x3d')]=_[_0x610d('0x36')](_0x4eb540[_0x610d('0x32')],_0x4eb540['query']);_0x5edb25['attributes']=_['intersection'](_0x4eb540[_0x610d('0x32')],qs['fields'](_0x5ad80b[_0x610d('0x33')][_0x610d('0x37')]));_0x5edb25[_0x610d('0x35')]=_0x5edb25[_0x610d('0x35')][_0x610d('0x38')]?_0x5edb25[_0x610d('0x35')]:_0x4eb540[_0x610d('0x32')];if(_0x5ad80b[_0x610d('0x33')][_0x610d('0x44')]){_0x5edb25[_0x610d('0x45')]=[{'all':!![]}];}_0x5edb25=_[_0x610d('0x42')]({},_0x5edb25,_0x5ad80b[_0x610d('0x4b')]);return db['ChatGroup'][_0x610d('0x4c')](_0x5edb25)[_0x610d('0x27')](handleEntityNotFound(_0x876aff,null))[_0x610d('0x27')](respondWithResult(_0x876aff,null))[_0x610d('0x48')](handleError(_0x876aff,null));};exports[_0x610d('0x4d')]=function(_0x2d8da0,_0x32ceda){return db['ChatGroup']['create'](_0x2d8da0[_0x610d('0x4e')],{})['then'](respondWithResult(_0x32ceda,0xc9))[_0x610d('0x48')](handleError(_0x32ceda,null));};exports[_0x610d('0x4f')]=function(_0x38a794,_0x2fb8d9){if(_0x38a794['body']['id']){delete _0x38a794['body']['id'];}return db[_0x610d('0x2e')][_0x610d('0x4c')]({'where':{'id':_0x38a794[_0x610d('0x4a')]['id']}})[_0x610d('0x27')](handleEntityNotFound(_0x2fb8d9,null))[_0x610d('0x27')](saveUpdates(_0x38a794[_0x610d('0x4e')],null))[_0x610d('0x27')](respondWithResult(_0x2fb8d9,null))['catch'](handleError(_0x2fb8d9,null));};exports[_0x610d('0x50')]=function(_0x2f7983,_0x1a5546){return db[_0x610d('0x2e')][_0x610d('0x4c')]({'where':{'id':_0x2f7983[_0x610d('0x4a')]['id']}})[_0x610d('0x27')](handleEntityNotFound(_0x1a5546,null))['then'](removeEntity(_0x1a5546,null))[_0x610d('0x48')](handleError(_0x1a5546,null));};exports[_0x610d('0x51')]=function(_0x254c3d,_0x4d7bb0){return db['ChatGroup']['describe']()[_0x610d('0x27')](respondWithResult(_0x4d7bb0,null))[_0x610d('0x48')](handleError(_0x4d7bb0,null));};exports[_0x610d('0x52')]=function(_0xc8e86c,_0x160b79,_0x502485){return db[_0x610d('0x53')][_0x610d('0x43')]({'where':{'ChatGroupId':_0xc8e86c[_0x610d('0x4a')]['id'],'ToId':_0xc8e86c[_0x610d('0x54')]['id'],'read':![]}})['then'](function(_0x57e42f){return{'id':_[_0x610d('0x55')](_0xc8e86c[_0x610d('0x4a')]['id']),'count':_0x57e42f};})[_0x610d('0x27')](respondWithResult(_0x160b79,null))['catch'](handleError(_0x160b79,null));};exports[_0x610d('0x56')]=function(_0x18867c,_0x3c0b2d,_0x42bc06){return db[_0x610d('0x2e')][_0x610d('0x4c')]({'where':{'id':_0x18867c[_0x610d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3c0b2d,null))[_0x610d('0x27')](function(_0x13608f){if(_0x13608f){return _0x13608f[_0x610d('0x56')](_0x18867c[_0x610d('0x4e')]['ids'],_[_0x610d('0x57')](_0x18867c[_0x610d('0x4e')],['ids','id'])||{});}})[_0x610d('0x27')](respondWithResult(_0x3c0b2d,null))[_0x610d('0x48')](handleError(_0x3c0b2d,null));};exports['getMembers']=function(_0x3bb7db,_0x23b705,_0x187835){var _0x3223eb={};var _0x59baf4={};var _0x2be9f9;var _0x3c0447;return db[_0x610d('0x2e')][_0x610d('0x58')]({'where':{'id':_0x3bb7db['params']['id']}})[_0x610d('0x27')](handleEntityNotFound(_0x23b705,null))[_0x610d('0x27')](function(_0x5bd15a){if(_0x5bd15a){_0x2be9f9=_0x5bd15a;_0x59baf4[_0x610d('0x32')]=_['keys'](db[_0x610d('0x59')][_0x610d('0x2f')]);_0x59baf4[_0x610d('0x33')]=_[_0x610d('0x34')](_0x3bb7db[_0x610d('0x33')]);_0x59baf4[_0x610d('0x3d')]=_[_0x610d('0x36')](_0x59baf4['model'],_0x59baf4['query']);_0x3223eb[_0x610d('0x35')]=_[_0x610d('0x36')](_0x59baf4[_0x610d('0x32')],qs[_0x610d('0x37')](_0x3bb7db[_0x610d('0x33')][_0x610d('0x37')]));_0x3223eb[_0x610d('0x35')]=_0x3223eb[_0x610d('0x35')][_0x610d('0x38')]?_0x3223eb['attributes']:_0x59baf4['model'];_0x3223eb[_0x610d('0x3a')]=qs[_0x610d('0x3b')](_0x3bb7db[_0x610d('0x33')][_0x610d('0x3b')]);_0x3223eb[_0x610d('0x3c')]=qs[_0x610d('0x3d')](_[_0x610d('0x3e')](_0x3bb7db[_0x610d('0x33')],_0x59baf4[_0x610d('0x3d')]));if(_0x3bb7db[_0x610d('0x33')]['filter']){_0x3223eb[_0x610d('0x3c')]=_[_0x610d('0x42')](_0x3223eb[_0x610d('0x3c')],{'$or':_[_0x610d('0x2d')](_0x3223eb[_0x610d('0x35')],function(_0x2d5f52){var _0x84be3f={};_0x84be3f[_0x2d5f52]={'$like':'%'+_0x3bb7db[_0x610d('0x33')][_0x610d('0x3f')]+'%'};return _0x84be3f;})});}_0x3223eb=_['merge']({},_0x3223eb,_0x3bb7db[_0x610d('0x4b')]);return _0x2be9f9[_0x610d('0x5a')](_0x3223eb);}})[_0x610d('0x27')](function(_0x223b32){if(_0x223b32){_0x3c0447=_0x223b32[_0x610d('0x38')];if(!_0x3bb7db['query']['hasOwnProperty']('nolimit')){_0x3223eb['limit']=qs[_0x610d('0x22')](_0x3bb7db['query'][_0x610d('0x22')]);_0x3223eb[_0x610d('0x23')]=qs[_0x610d('0x23')](_0x3bb7db[_0x610d('0x33')][_0x610d('0x23')]);}return _0x2be9f9[_0x610d('0x5a')](_0x3223eb);}})['then'](function(_0x5cfe81){if(_0x5cfe81){return _0x5cfe81?{'count':_0x3c0447,'rows':_0x5cfe81}:null;}})[_0x610d('0x27')](respondWithResult(_0x23b705,null))['catch'](handleError(_0x23b705,null));};exports[_0x610d('0x5b')]=function(_0x58ccf9,_0x1c8775,_0x1817ef){return db[_0x610d('0x2e')][_0x610d('0x4c')]({'where':{'id':_0x58ccf9['params']['id']}})['then'](handleEntityNotFound(_0x1c8775,null))[_0x610d('0x27')](function(_0x338642){if(_0x338642){return _0x338642['removeMembers'](_0x58ccf9['query'][_0x610d('0x5c')]);}})[_0x610d('0x27')](respondWithStatusCode(_0x1c8775,null))['catch'](handleError(_0x1c8775,null));};exports[_0x610d('0x5d')]=function(_0x51ebe2,_0x136d04,_0x3ca0c3){if(_0x51ebe2['body']['id']){delete _0x51ebe2[_0x610d('0x4e')]['id'];}return db[_0x610d('0x2e')][_0x610d('0x4c')]({'where':{'id':_0x51ebe2[_0x610d('0x4a')]['id']}})[_0x610d('0x27')](handleEntityNotFound(_0x136d04,null))['then'](function(_0x1f8215){if(_0x1f8215){_0x51ebe2[_0x610d('0x4e')]['ChatGroupId']=_0x1f8215['id'];return db[_0x610d('0x53')][_0x610d('0x4d')](_0x51ebe2[_0x610d('0x4e')]);}})['then'](respondWithResult(_0x136d04,null))[_0x610d('0x48')](handleError(_0x136d04,null));};exports[_0x610d('0x5e')]=function(_0x557e55,_0x4c440e,_0x406955){var _0x47c343={};var _0x4b966e={};var _0x2388f6;var _0x20342b;return db[_0x610d('0x2e')][_0x610d('0x58')]({'where':{'id':_0x557e55[_0x610d('0x4a')]['id']}})[_0x610d('0x27')](handleEntityNotFound(_0x4c440e,null))[_0x610d('0x27')](function(_0x58e705){if(_0x58e705){_0x2388f6=_0x58e705;_0x4b966e[_0x610d('0x32')]=_[_0x610d('0x34')](db[_0x610d('0x53')][_0x610d('0x2f')]);_0x4b966e[_0x610d('0x33')]=_[_0x610d('0x34')](_0x557e55[_0x610d('0x33')]);_0x4b966e['filters']=_[_0x610d('0x36')](_0x4b966e['model'],_0x4b966e[_0x610d('0x33')]);_0x47c343[_0x610d('0x35')]=_['intersection'](_0x4b966e[_0x610d('0x32')],qs[_0x610d('0x37')](_0x557e55[_0x610d('0x33')][_0x610d('0x37')]));_0x47c343['attributes']=_0x47c343[_0x610d('0x35')][_0x610d('0x38')]?_0x47c343[_0x610d('0x35')]:_0x4b966e[_0x610d('0x32')];_0x47c343[_0x610d('0x3a')]=qs[_0x610d('0x3b')](_0x557e55['query']['sort']);_0x47c343[_0x610d('0x3c')]=qs[_0x610d('0x3d')](_[_0x610d('0x3e')](_0x557e55[_0x610d('0x33')],_0x4b966e['filters']));if(_0x557e55[_0x610d('0x33')]['filter']){_0x47c343['where']=_[_0x610d('0x42')](_0x47c343[_0x610d('0x3c')],{'$or':_[_0x610d('0x2d')](_0x47c343[_0x610d('0x35')],function(_0x1899e9){var _0x380e91={};_0x380e91[_0x1899e9]={'$like':'%'+_0x557e55[_0x610d('0x33')]['filter']+'%'};return _0x380e91;})});}if(_0x557e55[_0x610d('0x33')][_0x610d('0x5f')]){var _0x596334=_0x557e55[_0x610d('0x33')]['$gte'][_0x610d('0x60')](',');var _0x5bf11f={};_0x5bf11f[_0x596334[0x0]]={'$gte':moment(_0x596334[0x1])[_0x610d('0x61')](_0x610d('0x62'))};_0x47c343[_0x610d('0x3c')]=_[_0x610d('0x42')](_0x47c343[_0x610d('0x3c')],_0x5bf11f);}_0x47c343=_[_0x610d('0x42')]({},_0x47c343,_0x557e55[_0x610d('0x4b')]);return _0x2388f6['getMessages'](_0x47c343);}})[_0x610d('0x27')](function(_0x2dd20b){if(_0x2dd20b){_0x20342b=_0x2dd20b['length'];if(!_0x557e55[_0x610d('0x33')][_0x610d('0x63')](_0x610d('0x39'))){_0x47c343['limit']=qs[_0x610d('0x22')](_0x557e55[_0x610d('0x33')][_0x610d('0x22')]);_0x47c343[_0x610d('0x23')]=qs[_0x610d('0x23')](_0x557e55[_0x610d('0x33')][_0x610d('0x23')]);}return _0x2388f6[_0x610d('0x5e')](_0x47c343);}})['then'](function(_0x2573b0){if(_0x2573b0){return _0x2573b0?{'count':_0x20342b,'rows':_0x2573b0}:null;}})[_0x610d('0x27')](respondWithResult(_0x4c440e,null))['catch'](handleError(_0x4c440e,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 830d6f4..d49ab45 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 _0xa412=['ChatGroup','setMaxListeners','save','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x2d2263,_0xa41e95){var _0x740645=function(_0x351dd7){while(--_0x351dd7){_0x2d2263['push'](_0x2d2263['shift']());}};_0x740645(++_0xa41e95);}(_0xa412,0x127));var _0x2a41=function(_0x5d33e1,_0x16fbff){_0x5d33e1=_0x5d33e1-0x0;var _0xa5bd10=_0xa412[_0x5d33e1];return _0xa5bd10;};'use strict';var EventEmitter=require(_0x2a41('0x0'));var ChatGroup=require(_0x2a41('0x1'))['db'][_0x2a41('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x2a41('0x3')](0x0);var events={'afterCreate':_0x2a41('0x4'),'afterUpdate':'update','afterDestroy':_0x2a41('0x5')};function emitEvent(_0x5d9c6a){return function(_0x1d8e03,_0x35e0ae,_0x4fc641){ChatGroupEvents[_0x2a41('0x6')](_0x5d9c6a+':'+_0x1d8e03['id'],_0x1d8e03);ChatGroupEvents[_0x2a41('0x6')](_0x5d9c6a,_0x1d8e03);_0x4fc641(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x2a41('0x7')](e,emitEvent(event));}}module[_0x2a41('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0xa73a=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x38b3ed,_0x86e274){var _0x34a9ed=function(_0x5703b9){while(--_0x5703b9){_0x38b3ed['push'](_0x38b3ed['shift']());}};_0x34a9ed(++_0x86e274);}(_0xa73a,0xe5));var _0xaa73=function(_0x593564,_0x43583f){_0x593564=_0x593564-0x0;var _0x211a89=_0xa73a[_0x593564];return _0x211a89;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0xaa73('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xaa73('0x1')](0x0);var events={'afterCreate':_0xaa73('0x2'),'afterUpdate':_0xaa73('0x3'),'afterDestroy':'remove'};function emitEvent(_0x110286){return function(_0x2654a8,_0x3b5e5f,_0x51df2e){ChatGroupEvents['emit'](_0x110286+':'+_0x2654a8['id'],_0x2654a8);ChatGroupEvents[_0xaa73('0x4')](_0x110286,_0x2654a8);_0x51df2e(null);};}for(var e in events){if(events[_0xaa73('0x5')](e)){var event=events[e];ChatGroup[_0xaa73('0x6')](e,emitEvent(event));}}module[_0xaa73('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 82f8f08..71967b8 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 _0xb493=['request-promise','rimraf','../../config/environment','./chatGroup.attributes','ChatGroup','chat_groups','lodash','../../config/logger','api','moment'];(function(_0x1d7bbd,_0x327073){var _0x520685=function(_0x24e215){while(--_0x24e215){_0x1d7bbd['push'](_0x1d7bbd['shift']());}};_0x520685(++_0x327073);}(_0xb493,0x1f0));var _0x3b49=function(_0x59ac21,_0x442dd3){_0x59ac21=_0x59ac21-0x0;var _0x44846a=_0xb493[_0x59ac21];return _0x44846a;};'use strict';var _=require(_0x3b49('0x0'));var util=require('util');var logger=require(_0x3b49('0x1'))(_0x3b49('0x2'));var moment=require(_0x3b49('0x3'));var BPromise=require('bluebird');var rp=require(_0x3b49('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3b49('0x5'));var config=require(_0x3b49('0x6'));var attributes=require(_0x3b49('0x7'));module['exports']=function(_0x1d0f3f,_0x1742a7){return _0x1d0f3f['define'](_0x3b49('0x8'),attributes,{'tableName':_0x3b49('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7dea=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','ChatGroup'];(function(_0x35eb73,_0x2da2a1){var _0x1a14f4=function(_0x484e88){while(--_0x484e88){_0x35eb73['push'](_0x35eb73['shift']());}};_0x1a14f4(++_0x2da2a1);}(_0x7dea,0xbe));var _0xa7de=function(_0x5bf9c0,_0x206f4c){_0x5bf9c0=_0x5bf9c0-0x0;var _0x285285=_0x7dea[_0x5bf9c0];return _0x285285;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa7de('0x0'))(_0xa7de('0x1'));var moment=require(_0xa7de('0x2'));var BPromise=require(_0xa7de('0x3'));var rp=require(_0xa7de('0x4'));var fs=require('fs');var path=require(_0xa7de('0x5'));var rimraf=require(_0xa7de('0x6'));var config=require(_0xa7de('0x7'));var attributes=require('./chatGroup.attributes');module[_0xa7de('0x8')]=function(_0x4ad575,_0x2cc272){return _0x4ad575['define'](_0xa7de('0x9'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index fa1ff6d..fffd872 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 _0x851c=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','localhost','./chatGroup.socket','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment'];(function(_0x26d806,_0x411f4b){var _0x2218d6=function(_0xa84a7a){while(--_0xa84a7a){_0x26d806['push'](_0x26d806['shift']());}};_0x2218d6(++_0x411f4b);}(_0x851c,0x19d));var _0xc851=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x851c[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xc851('0x0'));var util=require(_0xc851('0x1'));var moment=require(_0xc851('0x2'));var BPromise=require(_0xc851('0x3'));var rs=require(_0xc851('0x4'));var fs=require('fs');var Redis=require(_0xc851('0x5'));var db=require(_0xc851('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc851('0x7'))(_0xc851('0x8'));var config=require('../../config/environment');var jayson=require(_0xc851('0x9'));var client=jayson[_0xc851('0xa')]['http']({'port':0x232a});config[_0xc851('0xb')]=_['defaults'](config['redis'],{'host':_0xc851('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc851('0xd'))[_0xc851('0xe')](socket);function respondWithRpcPromise(_0x3b4e80,_0x177de0,_0x1f1524){return new BPromise(function(_0x1ee38d,_0x33772a){return client[_0xc851('0xf')](_0x3b4e80,_0x1f1524)['then'](function(_0x3a1ce8){logger[_0xc851('0x10')](_0xc851('0x11'),_0x177de0,_0xc851('0x12'));logger[_0xc851('0x13')](_0xc851('0x14'),_0x177de0,_0xc851('0x12'),JSON[_0xc851('0x15')](_0x3a1ce8));if(_0x3a1ce8[_0xc851('0x16')]){if(_0x3a1ce8[_0xc851('0x16')][_0xc851('0x17')]===0x1f4){logger[_0xc851('0x16')](_0xc851('0x11'),_0x177de0,_0x3a1ce8[_0xc851('0x16')][_0xc851('0x18')]);return _0x33772a(_0x3a1ce8[_0xc851('0x16')]['message']);}logger[_0xc851('0x16')]('ChatGroup,\x20%s,\x20%s',_0x177de0,_0x3a1ce8[_0xc851('0x16')]['message']);return _0x1ee38d(_0x3a1ce8[_0xc851('0x16')][_0xc851('0x18')]);}else{logger[_0xc851('0x10')](_0xc851('0x11'),_0x177de0,_0xc851('0x12'));_0x1ee38d(_0x3a1ce8[_0xc851('0x19')][_0xc851('0x18')]);}})['catch'](function(_0x27c098){logger[_0xc851('0x16')]('ChatGroup,\x20%s,\x20%s',_0x177de0,_0x27c098);_0x33772a(_0x27c098);});});}
\ No newline at end of file
+var _0x8d6f=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','ChatGroup,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x8d6f,0x1bb));var _0xf8d6=function(_0x378c25,_0x224d7b){_0x378c25=_0x378c25-0x0;var _0x2179f1=_0x8d6f[_0x378c25];return _0x2179f1;};'use strict';var _=require(_0xf8d6('0x0'));var util=require(_0xf8d6('0x1'));var moment=require(_0xf8d6('0x2'));var BPromise=require(_0xf8d6('0x3'));var rs=require(_0xf8d6('0x4'));var fs=require('fs');var Redis=require(_0xf8d6('0x5'));var db=require(_0xf8d6('0x6'))['db'];var utils=require(_0xf8d6('0x7'));var logger=require(_0xf8d6('0x8'))(_0xf8d6('0x9'));var config=require(_0xf8d6('0xa'));var jayson=require(_0xf8d6('0xb'));var client=jayson['client']['http']({'port':0x232a});config[_0xf8d6('0xc')]=_['defaults'](config[_0xf8d6('0xc')],{'host':_0xf8d6('0xd'),'port':0x18eb});var socket=require(_0xf8d6('0xe'))(new Redis(config['redis']));require(_0xf8d6('0xf'))[_0xf8d6('0x10')](socket);function respondWithRpcPromise(_0x400250,_0x10efc3,_0xdcdd90){return new BPromise(function(_0x1f07fc,_0x56ba54){return client[_0xf8d6('0x11')](_0x400250,_0xdcdd90)['then'](function(_0x119896){logger['info']('ChatGroup,\x20%s,\x20%s',_0x10efc3,_0xf8d6('0x12'));logger[_0xf8d6('0x13')](_0xf8d6('0x14'),_0x10efc3,_0xf8d6('0x12'),JSON[_0xf8d6('0x15')](_0x119896));if(_0x119896['error']){if(_0x119896['error'][_0xf8d6('0x16')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x10efc3,_0x119896[_0xf8d6('0x17')]['message']);return _0x56ba54(_0x119896[_0xf8d6('0x17')][_0xf8d6('0x18')]);}logger[_0xf8d6('0x17')]('ChatGroup,\x20%s,\x20%s',_0x10efc3,_0x119896['error'][_0xf8d6('0x18')]);return _0x1f07fc(_0x119896[_0xf8d6('0x17')]['message']);}else{logger[_0xf8d6('0x19')](_0xf8d6('0x1a'),_0x10efc3,_0xf8d6('0x12'));_0x1f07fc(_0x119896[_0xf8d6('0x1b')][_0xf8d6('0x18')]);}})['catch'](function(_0x2bcc24){logger[_0xf8d6('0x17')]('ChatGroup,\x20%s,\x20%s',_0x10efc3,_0x2bcc24);_0x56ba54(_0x2bcc24);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 6101da1..7f63493 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 _0x4f14=['update','emit','removeListener','save'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4f14,0xb3));var _0x44f1=function(_0x3dc834,_0x448eff){_0x3dc834=_0x3dc834-0x0;var _0x313600=_0x4f14[_0x3dc834];return _0x313600;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x44f1('0x0'),'remove',_0x44f1('0x1')];function createListener(_0x2bac3f,_0x2ff9fb){return function(_0x4ee5c2){_0x2ff9fb[_0x44f1('0x2')](_0x2bac3f,_0x4ee5c2);};}function removeListener(_0x2490a0,_0x3a0e41){return function(){ChatGroupEvents[_0x44f1('0x3')](_0x2490a0,_0x3a0e41);};}exports['register']=function(_0x95aaa0){for(var _0x5aea8b=0x0,_0x1e47a7=events['length'];_0x5aea8b<_0x1e47a7;_0x5aea8b++){var _0x10a3b4=events[_0x5aea8b];var _0x332d7b=createListener('chatGroup:'+_0x10a3b4,_0x95aaa0);ChatGroupEvents['on'](_0x10a3b4,_0x332d7b);}};
\ No newline at end of file
+var _0x2752=['removeListener','register','length','chatGroup:','save'];(function(_0x13da9d,_0x3bd432){var _0x20ce98=function(_0x1cfad5){while(--_0x1cfad5){_0x13da9d['push'](_0x13da9d['shift']());}};_0x20ce98(++_0x3bd432);}(_0x2752,0x15d));var _0x2275=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2752[_0x321bb2];return _0x9c12ed;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x2275('0x0'),'remove','update'];function createListener(_0x1d74c5,_0x181260){return function(_0x12ab1e){_0x181260['emit'](_0x1d74c5,_0x12ab1e);};}function removeListener(_0x199cbe,_0x67bf73){return function(){ChatGroupEvents[_0x2275('0x1')](_0x199cbe,_0x67bf73);};}exports[_0x2275('0x2')]=function(_0x633265){for(var _0x411170=0x0,_0x361673=events[_0x2275('0x3')];_0x411170<_0x361673;_0x411170++){var _0x56069b=events[_0x411170];var _0x2ab578=createListener(_0x2275('0x4')+_0x56069b,_0x633265);ChatGroupEvents['on'](_0x56069b,_0x2ab578);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 0041574..08f19db 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 _0xad99=['put','update','delete','removeMembers','exports','multer','util','path','express','fs-extra','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/:id','show','/:id/unread','/:id/members','/:id/messages','getMessages','post','create','addMembers','addMessage'];(function(_0x1213c3,_0x4167e0){var _0x6671c2=function(_0x49bf51){while(--_0x49bf51){_0x1213c3['push'](_0x1213c3['shift']());}};_0x6671c2(++_0x4167e0);}(_0xad99,0x17c));var _0x9ad9=function(_0x58a242,_0x803cc6){_0x58a242=_0x58a242-0x0;var _0x375e32=_0xad99[_0x58a242];return _0x375e32;};'use strict';var multer=require(_0x9ad9('0x0'));var util=require(_0x9ad9('0x1'));var path=require(_0x9ad9('0x2'));var timeout=require('connect-timeout');var express=require(_0x9ad9('0x3'));var router=express['Router']();var fs_extra=require(_0x9ad9('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9ad9('0x5'));var controller=require(_0x9ad9('0x6'));router[_0x9ad9('0x7')]('/',auth[_0x9ad9('0x8')](),controller[_0x9ad9('0x9')]);router[_0x9ad9('0x7')]('/describe',auth[_0x9ad9('0x8')](),controller['describe']);router['get'](_0x9ad9('0xa'),auth[_0x9ad9('0x8')](),controller[_0x9ad9('0xb')]);router[_0x9ad9('0x7')](_0x9ad9('0xc'),auth[_0x9ad9('0x8')](),controller['getUnread']);router[_0x9ad9('0x7')](_0x9ad9('0xd'),auth[_0x9ad9('0x8')](),controller['getMembers']);router[_0x9ad9('0x7')](_0x9ad9('0xe'),auth[_0x9ad9('0x8')](),controller[_0x9ad9('0xf')]);router[_0x9ad9('0x10')]('/',auth[_0x9ad9('0x8')](),controller[_0x9ad9('0x11')]);router[_0x9ad9('0x10')]('/:id/members',auth[_0x9ad9('0x8')](),controller[_0x9ad9('0x12')]);router['post']('/:id/messages',auth[_0x9ad9('0x8')](),controller[_0x9ad9('0x13')]);router[_0x9ad9('0x14')](_0x9ad9('0xa'),auth[_0x9ad9('0x8')](),controller[_0x9ad9('0x15')]);router[_0x9ad9('0x16')](_0x9ad9('0xa'),auth[_0x9ad9('0x8')](),controller['destroy']);router[_0x9ad9('0x16')](_0x9ad9('0xd'),auth['isAuthenticated'](),controller[_0x9ad9('0x17')]);module[_0x9ad9('0x18')]=router;
\ No newline at end of file
+var _0x9df4=['get','isAuthenticated','index','/describe','/:id','show','/:id/unread','/:id/members','getMembers','/:id/messages','post','create','addMembers','put','update','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x9df4,0xc0));var _0x49df=function(_0x5d5ead,_0x4034ac){_0x5d5ead=_0x5d5ead-0x0;var _0x4eb7ba=_0x9df4[_0x5d5ead];return _0x4eb7ba;};'use strict';var multer=require(_0x49df('0x0'));var util=require(_0x49df('0x1'));var path=require(_0x49df('0x2'));var timeout=require(_0x49df('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x49df('0x4'));var auth=require(_0x49df('0x5'));var interaction=require(_0x49df('0x6'));var config=require(_0x49df('0x7'));var controller=require('./chatGroup.controller');router[_0x49df('0x8')]('/',auth[_0x49df('0x9')](),controller[_0x49df('0xa')]);router[_0x49df('0x8')](_0x49df('0xb'),auth[_0x49df('0x9')](),controller['describe']);router[_0x49df('0x8')](_0x49df('0xc'),auth[_0x49df('0x9')](),controller[_0x49df('0xd')]);router['get'](_0x49df('0xe'),auth[_0x49df('0x9')](),controller['getUnread']);router[_0x49df('0x8')](_0x49df('0xf'),auth[_0x49df('0x9')](),controller[_0x49df('0x10')]);router[_0x49df('0x8')](_0x49df('0x11'),auth[_0x49df('0x9')](),controller['getMessages']);router[_0x49df('0x12')]('/',auth[_0x49df('0x9')](),controller[_0x49df('0x13')]);router[_0x49df('0x12')](_0x49df('0xf'),auth[_0x49df('0x9')](),controller[_0x49df('0x14')]);router['post'](_0x49df('0x11'),auth[_0x49df('0x9')](),controller['addMessage']);router[_0x49df('0x15')](_0x49df('0xc'),auth[_0x49df('0x9')](),controller[_0x49df('0x16')]);router[_0x49df('0x17')](_0x49df('0xc'),auth[_0x49df('0x9')](),controller[_0x49df('0x18')]);router['delete'](_0x49df('0xf'),auth['isAuthenticated'](),controller['removeMembers']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 103fb17..0607a13 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 _0x7269=['star','thumb','TEXT','STRING','DATE','long','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7269,0x76));var _0x9726=function(_0x67f4e2,_0x26593b){_0x67f4e2=_0x67f4e2-0x0;var _0x5561c3=_0x7269[_0x67f4e2];return _0x5561c3;};'use strict';var Sequelize=require(_0x9726('0x0'));module[_0x9726('0x1')]={'closed':{'type':Sequelize[_0x9726('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0x9726('0x3'),_0x9726('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x9726('0x5')]},'pathTranscript':{'type':Sequelize[_0x9726('0x5')]},'mailTranscript':{'type':Sequelize[_0x9726('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x9726('0x7')]},'disposition':{'type':Sequelize[_0x9726('0x6')]},'secondDisposition':{'type':Sequelize[_0x9726('0x6')]},'thirdDisposition':{'type':Sequelize[_0x9726('0x6')]},'note':{'type':Sequelize[_0x9726('0x6')]},'browserName':{'type':Sequelize[_0x9726('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x9726('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x9726('0x6')]},'deviceVendor':{'type':Sequelize[_0x9726('0x6')]},'deviceType':{'type':Sequelize[_0x9726('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x9726('0x6')]},'formData':{'type':Sequelize[_0x9726('0x5')](_0x9726('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x9726('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x9726('0x9')]('in',_0x9726('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x9726('0x6')]},'customerPort':{'type':Sequelize[_0x9726('0x6')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xbdb7=['thumb','TEXT','STRING','long','DATE','sequelize','exports','BOOLEAN','INTEGER','ENUM','star'];(function(_0x56b51d,_0x5650af){var _0x5bbdec=function(_0x34c968){while(--_0x34c968){_0x56b51d['push'](_0x56b51d['shift']());}};_0x5bbdec(++_0x5650af);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x2e16d8,_0x1110ff){_0x2e16d8=_0x2e16d8-0x0;var _0xbb0a07=_0xbdb7[_0x2e16d8];return _0xbb0a07;};'use strict';var Sequelize=require(_0x7bdb('0x0'));module[_0x7bdb('0x1')]={'closed':{'type':Sequelize[_0x7bdb('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x7bdb('0x3')]},'ratingType':{'type':Sequelize[_0x7bdb('0x4')](_0x7bdb('0x5'),_0x7bdb('0x6')),'defaultValue':_0x7bdb('0x5')},'ratingMessage':{'type':Sequelize[_0x7bdb('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x7bdb('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x7bdb('0x8')]},'thirdDisposition':{'type':Sequelize[_0x7bdb('0x8')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x7bdb('0x8')]},'osName':{'type':Sequelize[_0x7bdb('0x8')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x7bdb('0x8')]},'deviceType':{'type':Sequelize[_0x7bdb('0x8')]},'referer':{'type':Sequelize[_0x7bdb('0x7')]},'customerIp':{'type':Sequelize[_0x7bdb('0x8')]},'formData':{'type':Sequelize[_0x7bdb('0x7')](_0x7bdb('0x9'))},'read1stAt':{'type':Sequelize[_0x7bdb('0xa')]},'lastMsgAt':{'type':Sequelize[_0x7bdb('0xa')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x7bdb('0x8')]},'vidaooSessionId':{'type':Sequelize[_0x7bdb('0x7')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 73d667f..404840a 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 _0xf263=['ids','getMessages','hasOwnProperty','sort','where','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','nolimit','order','pick','includeAgent','push','alias','setTags','omit','Tag','color','emit','chatInteractionTags:save','removeTags','toString','server','files','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','direction','read','ChatWebsite','Account','Owner','get','mkdirSync','Chat','closed','browserName','osName','referer','customerIp','customerPort','N.A.','existsSync','createReadStream','pipe','createWriteStream','value','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','update','destroy','name','render','merge','body','contact','interaction','account','index','map','ChatInteraction','rawAttributes','fieldName','type','key','findAll','chat','user','show','query','keys','filters','intersection','model','fields','attributes','length','includeAll','include','options','find','create','params','describe','createVidaooSession','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','follow','isNull','vidaooMetadata','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','originalname','file','filename','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','join','root','offline-chat/','basename','download','mailTranscript','format','transcript-%s.txt','pathTranscript','User','ContactId','Messages','%s%d','System','customer','Visitor','agentIdentifier','website_alias','agentAlias','agent_alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','MailAccount','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage'];(function(_0x4c2f5d,_0x1986e3){var _0x44e650=function(_0x1d6a4f){while(--_0x1d6a4f){_0x4c2f5d['push'](_0x4c2f5d['shift']());}};_0x44e650(++_0x1986e3);}(_0xf263,0x106));var _0x3f26=function(_0x50fda9,_0x5ee44b){_0x50fda9=_0x50fda9-0x0;var _0x36b92b=_0xf263[_0x50fda9];return _0x36b92b;};'use strict';var rimraf=require(_0x3f26('0x0'));var zipdir=require(_0x3f26('0x1'));var rp=require(_0x3f26('0x2'));var moment=require(_0x3f26('0x3'));var BPromise=require(_0x3f26('0x4'));var Mustache=require(_0x3f26('0x5'));var util=require('util');var path=require(_0x3f26('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0x3f26('0x7'));var interaction=require(_0x3f26('0x8'));var qs=require(_0x3f26('0x9'));var pdf=require(_0x3f26('0xa'));var logger=require(_0x3f26('0xb'))(_0x3f26('0xc'));var config=require(_0x3f26('0xd'));var db=require('../../mysqldb')['db'];config[_0x3f26('0xe')]=_['defaults'](config[_0x3f26('0xe')],{'host':_0x3f26('0xf'),'port':0x18eb});var socket=require(_0x3f26('0x10'))(new Redis(config['redis']));require(_0x3f26('0x11'))[_0x3f26('0x12')](socket);var jayson=require(_0x3f26('0x13'));var client=jayson[_0x3f26('0x14')][_0x3f26('0x15')]({'port':0x232b});var client9004=jayson['client'][_0x3f26('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x4628ef,_0x541c32,_0x4d2cbf,_0x6cdfcd){return new BPromise(function(_0x33c796,_0x4268cd){var _0x387412=_0x6cdfcd||client;return _0x387412[_0x3f26('0x16')](_0x4628ef,_0x4d2cbf)[_0x3f26('0x17')](function(_0x4829b6){logger[_0x3f26('0x18')](_0x3f26('0x19'),_0x541c32,_0x3f26('0x1a'));logger[_0x3f26('0x1b')](_0x3f26('0x1c'),_0x541c32,_0x3f26('0x1a'),JSON['stringify'](_0x4829b6));if(_0x4829b6[_0x3f26('0x1d')]){if(_0x4829b6[_0x3f26('0x1d')][_0x3f26('0x1e')]===0x1f4){logger[_0x3f26('0x1d')](_0x3f26('0x19'),_0x541c32,_0x4829b6['error'][_0x3f26('0x1f')]);return _0x4268cd(_0x4829b6['error'][_0x3f26('0x1f')]);}logger[_0x3f26('0x1d')](_0x3f26('0x19'),_0x541c32,_0x4829b6[_0x3f26('0x1d')][_0x3f26('0x1f')]);return _0x33c796(_0x4829b6[_0x3f26('0x1d')][_0x3f26('0x1f')]);}else{logger['info'](_0x3f26('0x19'),_0x541c32,_0x3f26('0x1a'));_0x33c796(_0x4829b6[_0x3f26('0x20')][_0x3f26('0x1f')]);}})[_0x3f26('0x21')](function(_0x3eb7e5){logger[_0x3f26('0x1d')](_0x3f26('0x19'),_0x541c32,_0x3eb7e5);_0x4268cd(_0x3eb7e5);});});}function respondWithStatusCode(_0x3596ce,_0x4877c8){_0x4877c8=_0x4877c8||0xcc;return function(_0x506ba6){if(_0x506ba6){return _0x3596ce[_0x3f26('0x22')](_0x4877c8);}return _0x3596ce[_0x3f26('0x23')](_0x4877c8)[_0x3f26('0x24')]();};}function respondWithResult(_0x1276c0,_0x27a9a6){_0x27a9a6=_0x27a9a6||0xc8;return function(_0x130f17){if(_0x130f17){return _0x1276c0['status'](_0x27a9a6)[_0x3f26('0x25')](_0x130f17);}};}function respondWithFilteredResult(_0x7e0a03,_0x69b8ef){return function(_0x3c8d7b){if(_0x3c8d7b){var _0x2a542a=typeof _0x69b8ef[_0x3f26('0x26')]===_0x3f26('0x27')&&typeof _0x69b8ef[_0x3f26('0x28')]==='undefined';var _0xd10831=_0x3c8d7b[_0x3f26('0x29')];var _0x3a5ba0=_0x2a542a?0x0:_0x69b8ef[_0x3f26('0x26')];var _0x33ce14=_0x2a542a?_0x3c8d7b[_0x3f26('0x29')]:_0x69b8ef[_0x3f26('0x26')]+_0x69b8ef['limit'];var _0x5b633a;if(_0x33ce14>=_0xd10831){_0x33ce14=_0xd10831;_0x5b633a=0xc8;}else{_0x5b633a=0xce;}_0x7e0a03[_0x3f26('0x23')](_0x5b633a);return _0x7e0a03[_0x3f26('0x2a')]('Content-Range',_0x3a5ba0+'-'+_0x33ce14+'/'+_0xd10831)['json'](_0x3c8d7b);}return null;};}function saveUpdates(_0x53b3f6){return function(_0x394e79){if(_0x394e79){return _0x394e79[_0x3f26('0x2b')](_0x53b3f6)[_0x3f26('0x17')](function(_0x162139){return _0x162139;});}return null;};}function removeEntity(_0x597d38){return function(_0x26a0da){if(_0x26a0da){return _0x26a0da[_0x3f26('0x2c')]()[_0x3f26('0x17')](function(){_0x597d38['status'](0xcc)[_0x3f26('0x24')]();});}};}function handleEntityNotFound(_0x45c0e3){return function(_0x5d4979){if(!_0x5d4979){_0x45c0e3['sendStatus'](0x194);}return _0x5d4979;};}function handleError(_0x2f015c,_0x10ed03){_0x10ed03=_0x10ed03||0x1f4;return function(_0x1ed0a0){logger[_0x3f26('0x1d')](_0x1ed0a0['stack']);if(_0x1ed0a0[_0x3f26('0x2d')]){delete _0x1ed0a0[_0x3f26('0x2d')];}_0x2f015c['status'](_0x10ed03)['send'](_0x1ed0a0);};}function getMustacheRender(_0x1f7204,_0x22d5be){return Mustache[_0x3f26('0x2e')](_0x1f7204,_[_0x3f26('0x2f')](_0x22d5be[_0x3f26('0x30')],{'contact':_0x22d5be[_0x3f26('0x31')],'message':_0x22d5be[_0x3f26('0x1f')],'agent':_0x22d5be['agent'],'interaction':_0x22d5be[_0x3f26('0x32')],'account':_0x22d5be[_0x3f26('0x33')]}))||'';}exports[_0x3f26('0x34')]=function(_0xd0f0b7,_0x40f89b){var _0x343931={};var _0x50e637=_[_0x3f26('0x35')](db[_0x3f26('0x36')][_0x3f26('0x37')],function(_0x1b395c){return{'name':_0x1b395c[_0x3f26('0x38')],'type':_0x1b395c[_0x3f26('0x39')][_0x3f26('0x3a')]};});_0x343931=qs['getOptions'](_0x50e637,_0xd0f0b7);return interaction[_0x3f26('0x3b')](_0x3f26('0x3c'),_0xd0f0b7['query'],_0xd0f0b7[_0x3f26('0x3d')],_0x343931,_0x50e637)[_0x3f26('0x17')](respondWithFilteredResult(_0x40f89b,_0x343931))[_0x3f26('0x21')](handleError(_0x40f89b,null));};exports[_0x3f26('0x3e')]=function(_0x5b4243,_0x1d97eb){var _0x6c455e={'raw':![],'where':{'id':_0x5b4243['params']['id']}},_0x3876b8={};_0x3876b8['model']=_['keys'](db[_0x3f26('0x36')]['rawAttributes']);_0x3876b8[_0x3f26('0x3f')]=_[_0x3f26('0x40')](_0x5b4243[_0x3f26('0x3f')]);_0x3876b8[_0x3f26('0x41')]=_[_0x3f26('0x42')](_0x3876b8[_0x3f26('0x43')],_0x3876b8['query']);_0x6c455e['attributes']=_['intersection'](_0x3876b8[_0x3f26('0x43')],qs['fields'](_0x5b4243[_0x3f26('0x3f')][_0x3f26('0x44')]));_0x6c455e[_0x3f26('0x45')]=_0x6c455e[_0x3f26('0x45')][_0x3f26('0x46')]?_0x6c455e[_0x3f26('0x45')]:_0x3876b8[_0x3f26('0x43')];if(_0x5b4243[_0x3f26('0x3f')][_0x3f26('0x47')]){_0x6c455e[_0x3f26('0x48')]=[{'all':!![]}];}_0x6c455e=_['merge']({},_0x6c455e,_0x5b4243[_0x3f26('0x49')]);return db[_0x3f26('0x36')][_0x3f26('0x4a')](_0x6c455e)[_0x3f26('0x17')](handleEntityNotFound(_0x1d97eb,null))[_0x3f26('0x17')](respondWithResult(_0x1d97eb,null))[_0x3f26('0x21')](handleError(_0x1d97eb,null));};exports[_0x3f26('0x4b')]=function(_0x47227a,_0x1a6e4e){return db[_0x3f26('0x36')][_0x3f26('0x4b')](_0x47227a['body'],{})[_0x3f26('0x17')](respondWithResult(_0x1a6e4e,0xc9))[_0x3f26('0x21')](handleError(_0x1a6e4e,null));};exports[_0x3f26('0x2b')]=function(_0x3505ce,_0x3f3ad1){if(_0x3505ce[_0x3f26('0x30')]['id']){delete _0x3505ce[_0x3f26('0x30')]['id'];}return db[_0x3f26('0x36')][_0x3f26('0x4a')]({'where':{'id':_0x3505ce['params']['id']}})[_0x3f26('0x17')](handleEntityNotFound(_0x3f3ad1,null))[_0x3f26('0x17')](saveUpdates(_0x3505ce[_0x3f26('0x30')],null))['then'](respondWithResult(_0x3f3ad1,null))[_0x3f26('0x21')](handleError(_0x3f3ad1,null));};exports['destroy']=function(_0x1b15ad,_0x599b53){return db['ChatInteraction'][_0x3f26('0x4a')]({'where':{'id':_0x1b15ad[_0x3f26('0x4c')]['id']}})[_0x3f26('0x17')](handleEntityNotFound(_0x599b53,null))['then'](removeEntity(_0x599b53,null))[_0x3f26('0x21')](handleError(_0x599b53,null));};exports['describe']=function(_0x2c060f,_0x1846fe){return db[_0x3f26('0x36')][_0x3f26('0x4d')]()['then'](respondWithResult(_0x1846fe,null))[_0x3f26('0x21')](handleError(_0x1846fe,null));};exports[_0x3f26('0x4e')]=function(_0x51f97c,_0xbc31de){var _0x353b16=_0x51f97c[_0x3f26('0x4c')]['id'];var _0x4dde4d;var _0x251e73;var _0x58a627;return db['ChatInteraction'][_0x3f26('0x4f')]({'where':{'id':_0x353b16}})[_0x3f26('0x17')](function(_0x316afb){_0x4dde4d=_0x316afb;return db['ChatWebsite'][_0x3f26('0x4f')]({'where':{'id':_0x316afb[_0x3f26('0x50')]},'attributes':['id',_0x3f26('0x51'),_0x3f26('0x52'),_0x3f26('0x53'),_0x3f26('0x54'),'vidaooMetadata'],'raw':!![]});})[_0x3f26('0x17')](function(_0x57806e){if(_0x57806e&&_0x57806e[_0x3f26('0x51')]&&_0x57806e[_0x3f26('0x52')]){_0x251e73=_0x57806e;var _0x58f849={'interaction':{'id':_0x353b16},'agent':{'id':_0x51f97c[_0x3f26('0x3d')]['id'],'name':_0x51f97c[_0x3f26('0x3d')][_0x3f26('0x2d')],'fullname':_0x51f97c[_0x3f26('0x3d')][_0x3f26('0x55')],'email':_0x51f97c['user'][_0x3f26('0x56')]},'contact':_0x51f97c[_0x3f26('0x30')][_0x3f26('0x31')],'account':_0x51f97c[_0x3f26('0x30')][_0x3f26('0x33')]};var _0x55e63b={'rejectUnauthorized':![],'method':_0x3f26('0x57'),'url':_0x3f26('0x58'),'headers':{'X-APIKEY':_0x57806e['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x51f97c[_0x3f26('0x3d')][_0x3f26('0x56')]],'buttons':null,'topic':_0x251e73[_0x3f26('0x53')],'note':_['isNull'](_0x251e73[_0x3f26('0x54')])?null:getMustacheRender(_0x251e73['vidaooNote'],_0x58f849),'metadata':null},'redirect':_0x3f26('0x59'),'json':!![]};try{if(!_[_0x3f26('0x5a')](_0x251e73['vidaooMetadata'])){var _0x4cd470=getMustacheRender(_0x251e73[_0x3f26('0x5b')],_0x58f849);var _0x16f1bc=JSON[_0x3f26('0x5c')](_0x4cd470);_0x55e63b[_0x3f26('0x30')][_0x3f26('0x5d')]=_0x16f1bc;}}catch(_0x468c63){throw new db[(_0x3f26('0x5e'))][(_0x3f26('0x5f'))](_0x3f26('0x60'));}return rp(_0x55e63b);}else{throw new db[(_0x3f26('0x5e'))][(_0x3f26('0x5f'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x3f26('0x17')](function(_0x293299){_0x58a627=_0x293299;if(_0x58a627['id']){var _0x2552b4={'body':_0x58a627[_0x3f26('0x61')],'ChatWebsiteId':_0x251e73['id'],'ChatInteractionId':_0x4dde4d['id'],'direction':_0x3f26('0x62'),'UserId':_0x51f97c[_0x3f26('0x3d')]['id']};return db[_0x3f26('0x63')][_0x3f26('0x4b')](_0x2552b4,{});}else{throw new db[(_0x3f26('0x5e'))][(_0x3f26('0x5f'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x3f26('0x17')](function(){return _0x4dde4d[_0x3f26('0x64')]({'vidaooSessionId':_0x58a627['id']});})['then'](respondWithResult(_0xbc31de,null))['catch'](handleError(_0xbc31de,null));};exports[_0x3f26('0x65')]=function(_0x4a146c,_0x2a5d78){if(_0x4a146c[_0x3f26('0x30')]['id']){delete _0x4a146c[_0x3f26('0x30')]['id'];}return db[_0x3f26('0x36')][_0x3f26('0x4a')]({'where':{'id':_0x4a146c[_0x3f26('0x4c')]['id']},'include':[{'model':db[_0x3f26('0x66')],'as':'Contact'}]})[_0x3f26('0x17')](handleEntityNotFound(_0x2a5d78,null))[_0x3f26('0x17')](saveUpdates(_0x4a146c[_0x3f26('0x30')],null))[_0x3f26('0x17')](respondWithResult(_0x2a5d78,null))[_0x3f26('0x21')](handleError(_0x2a5d78,null));};exports[_0x3f26('0x67')]=function(_0x284dba,_0x54bc29){if(_0x284dba['body']['id']){delete _0x284dba[_0x3f26('0x30')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x284dba[_0x3f26('0x4c')]['id']}})['then'](function(_0x12d566){if(!_0x12d566){logger[_0x3f26('0x1d')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x3f26('0x67'),0x194,_0x3f26('0x68'));_0x54bc29['sendStatus'](0x194);}else{if(_0x12d566[_0x3f26('0x69')]){throw new db[(_0x3f26('0x5e'))][(_0x3f26('0x5f'))](_0x3f26('0x6a'));}}return _0x12d566;})[_0x3f26('0x17')](function(_0x1c11a1){if(_0x1c11a1){return _0x1c11a1[_0x3f26('0x2b')]({'closed':_0x284dba[_0x3f26('0x30')]['closed'],'disposition':_0x284dba[_0x3f26('0x30')][_0x3f26('0x6b')]})[_0x3f26('0x17')](function(_0x203edd){return _0x203edd;});}})['then'](function(){return respondWithRpcPromise(_0x3f26('0x6c'),'abandon',_0x284dba[_0x3f26('0x30')],client9004);})[_0x3f26('0x17')](respondWithResult(_0x54bc29,null))[_0x3f26('0x21')](handleError(_0x54bc29,null));};exports[_0x3f26('0x6d')]=function(_0x21afaa,_0x2a9989){_0x21afaa[_0x3f26('0x30')]['name']=_0x21afaa['file'][_0x3f26('0x6e')];_0x21afaa[_0x3f26('0x30')]['basename']=_0x21afaa[_0x3f26('0x6f')][_0x3f26('0x70')];_0x21afaa[_0x3f26('0x30')][_0x3f26('0x39')]=_0x21afaa[_0x3f26('0x6f')]['mimetype'];return db[_0x3f26('0x71')][_0x3f26('0x4b')](_0x21afaa[_0x3f26('0x30')])[_0x3f26('0x17')](respondWithResult(_0x2a9989,0xc9))[_0x3f26('0x21')](handleError(_0x2a9989,null));};exports[_0x3f26('0x72')]=function(_0x9909ae,_0x1da204){return db[_0x3f26('0x36')][_0x3f26('0x4f')]({'where':{'id':_0x9909ae[_0x3f26('0x4c')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x1da204,null))[_0x3f26('0x17')](function(_0xd222cf){if(_0xd222cf){if(_0xd222cf['closed']){return _0x1da204[_0x3f26('0x23')](0x193)['json']({'status':0x193,'message':_0x3f26('0x73')});}return db[_0x3f26('0x71')]['findOne']({'where':{'id':_0x9909ae[_0x3f26('0x3f')]['attachId']},'raw':!![]})[_0x3f26('0x17')](handleEntityNotFound(_0x1da204,null));}})['then'](function(_0x2e539f){if(_0x2e539f){var _0x5be864=_0x2e539f[_0x3f26('0x74')]!==null;var _0x123f67=path[_0x3f26('0x75')](config[_0x3f26('0x76')],'server/files/attachments/');if(_0x5be864){_0x123f67=path['join'](_0x123f67,_0x3f26('0x77'));}var _0x412bfd=path[_0x3f26('0x75')](_0x123f67,_0x2e539f[_0x3f26('0x78')]);return _0x1da204[_0x3f26('0x79')](_0x412bfd);}})[_0x3f26('0x21')](handleError(_0x1da204,null));};exports['close']=function(_0x57e86e,_0x39bfa7){var _0x1cb9a0=null;var _0x355c5f=null;var _0xbd9559=null;if(_0x57e86e[_0x3f26('0x30')]['id']){delete _0x57e86e[_0x3f26('0x30')]['id'];}if(_0x57e86e['body'][_0x3f26('0x7a')]){_0xbd9559=path[_0x3f26('0x75')](config['root'],'server/files/chat/upload/',util[_0x3f26('0x7b')](_0x3f26('0x7c'),Date['now']()));_0x57e86e['body'][_0x3f26('0x7d')]=_0xbd9559;}return db[_0x3f26('0x36')][_0x3f26('0x4a')]({'where':{'id':_0x57e86e['params']['id']},'include':[{'model':db[_0x3f26('0x63')],'as':'Messages','include':[{'model':db[_0x3f26('0x7e')],'as':_0x3f26('0x7e')}]}]})['then'](handleEntityNotFound(_0x39bfa7,null))[_0x3f26('0x17')](saveUpdates(_0x57e86e[_0x3f26('0x30')],null))[_0x3f26('0x17')](function(_0x247d0a){if(_0x247d0a){_0x1cb9a0=_0x247d0a;return db['ChatWebsite'][_0x3f26('0x4a')]({'where':{'id':_0x1cb9a0[_0x3f26('0x50')]}});}})[_0x3f26('0x17')](function(_0x320f94){if(_0x320f94){_0x355c5f=_0x320f94;return db[_0x3f26('0x66')][_0x3f26('0x4a')]({'where':{'id':_0x1cb9a0[_0x3f26('0x7f')]}});}})[_0x3f26('0x17')](function(_0x44473e){if(_0x44473e){if(_0xbd9559){var _0x232c32=null;for(var _0x4372ab=0x1;_0x4372ab<_0x1cb9a0[_0x3f26('0x80')][_0x3f26('0x46')];++_0x4372ab){_0x232c32=_0x1cb9a0['Messages'][_0x4372ab];var _0x383d9c=_0x232c32['UserId']?util[_0x3f26('0x7b')](_0x3f26('0x81'),_0x355c5f['agentAlias'],_0x232c32[_0x3f26('0x69')]):_0x3f26('0x82');var _0x314486=_0x57e86e[_0x3f26('0x30')][_0x3f26('0x83')]||util[_0x3f26('0x7b')]('%s%d',_0x3f26('0x84'),_0x232c32[_0x3f26('0x7f')]);switch(_0x355c5f[_0x3f26('0x85')]){case _0x3f26('0x86'):_0x383d9c=_0x232c32[_0x3f26('0x69')]?util[_0x3f26('0x7b')](_0x3f26('0x81'),_0x355c5f[_0x3f26('0x87')],_0x232c32['UserId']):_0x3f26('0x82');break;case _0x3f26('0x88'):_0x383d9c=_0x232c32[_0x3f26('0x69')]?_0x232c32[_0x3f26('0x7e')]['alias']||_0x232c32['User']['fullname']:'System';break;case'agent_fullname':_0x383d9c=_0x232c32[_0x3f26('0x69')]?_0x232c32[_0x3f26('0x7e')]['fullname']:_0x3f26('0x82');break;default:_0x383d9c=_0x232c32[_0x3f26('0x69')]?util['format']('%s%d',_0x355c5f[_0x3f26('0x87')],_0x232c32[_0x3f26('0x69')]):_0x3f26('0x82');}var _0x256c4a=util[_0x3f26('0x7b')](_0x3f26('0x89'),moment(_0x232c32[_0x3f26('0x8a')])[_0x3f26('0x7b')](_0x3f26('0x8b')),_0x232c32['direction']==='in'?_0x314486:_0x383d9c,_0x232c32[_0x3f26('0x30')]);if(!_0x232c32[_0x3f26('0x8c')]){fs['appendFileSync'](_0xbd9559,_0x256c4a);}}return db[_0x3f26('0x8d')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x3f26('0x8e'),'raw':!![],'include':[{'model':db[_0x3f26('0x8f')],'as':_0x3f26('0x8f'),'raw':!![]}]}]});}}})[_0x3f26('0x17')](function(_0x36da0d){if(!_0x36da0d||!_0x36da0d[_0x3f26('0x8e')]||!_0x57e86e['body'])return _0x1cb9a0;var _0x53e225=_0x36da0d[_0x3f26('0x90')]();return respondWithRpcPromise(_0x3f26('0x91'),_0x3f26('0x92'),{'account':_0x53e225,'message':{'from':util['format'](_0x3f26('0x93'),_0x36da0d['name'],_0x36da0d[_0x3f26('0x56')]||_0x36da0d['Smtp'][_0x3f26('0x3d')]),'to':_0x57e86e['body'][_0x3f26('0x7a')],'subject':_0x3f26('0x94'),'text':util[_0x3f26('0x7b')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x57e86e[_0x3f26('0x30')][_0x3f26('0x7a')]),'attachments':[{'path':_0xbd9559}]}})[_0x3f26('0x17')](function(){return _0x1cb9a0;})[_0x3f26('0x21')](function(_0x178ad8){logger['error'](_0x178ad8);});})[_0x3f26('0x17')](respondWithStatusCode(_0x39bfa7,0xc8))[_0x3f26('0x21')](handleError(_0x39bfa7,null));};exports[_0x3f26('0x95')]=function(_0x1c8918,_0x1ea6f5){return db[_0x3f26('0x63')][_0x3f26('0x4a')]({'where':{'id':_0x1c8918['params']['id']}})[_0x3f26('0x17')](handleEntityNotFound(_0x1ea6f5,null))['then'](function(_0x2f290a){if(_0x2f290a){return _0x2f290a[_0x3f26('0x95')](_0x1c8918[_0x3f26('0x30')]['ids'],_['omit'](_0x1c8918[_0x3f26('0x30')],[_0x3f26('0x96'),'id'])||{});}})['then'](respondWithResult(_0x1ea6f5,null))[_0x3f26('0x21')](handleError(_0x1ea6f5,null));};exports[_0x3f26('0x97')]=function(_0x2e9a41,_0x4e1ec6){var _0x425729={'raw':![],'where':{}};var _0x5a0eac={};var _0x28ae3b={'count':0x0,'rows':[]};return db[_0x3f26('0x36')][_0x3f26('0x4f')]({'where':{'id':_0x2e9a41[_0x3f26('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4e1ec6,null))['then'](function(_0x1cb6de){if(_0x1cb6de){_0x5a0eac[_0x3f26('0x43')]=_[_0x3f26('0x40')](db[_0x3f26('0x63')][_0x3f26('0x37')]);_0x5a0eac[_0x3f26('0x3f')]=_['keys'](_0x2e9a41[_0x3f26('0x3f')]);_0x5a0eac[_0x3f26('0x41')]=_[_0x3f26('0x42')](_0x5a0eac[_0x3f26('0x43')],_0x5a0eac[_0x3f26('0x3f')]);_0x425729['attributes']=_['intersection'](_0x5a0eac[_0x3f26('0x43')],qs[_0x3f26('0x44')](_0x2e9a41[_0x3f26('0x3f')][_0x3f26('0x44')]));_0x425729[_0x3f26('0x45')]=_0x425729['attributes'][_0x3f26('0x46')]?_0x425729[_0x3f26('0x45')]:_0x5a0eac['model'];if(!_0x2e9a41[_0x3f26('0x3f')][_0x3f26('0x98')]('nolimit')){_0x425729[_0x3f26('0x28')]=qs[_0x3f26('0x28')](_0x2e9a41[_0x3f26('0x3f')][_0x3f26('0x28')]);_0x425729[_0x3f26('0x26')]=qs[_0x3f26('0x26')](_0x2e9a41[_0x3f26('0x3f')]['offset']);}_0x425729['order']=qs[_0x3f26('0x99')](_0x2e9a41[_0x3f26('0x3f')]['sort']);_0x425729[_0x3f26('0x9a')]=qs[_0x3f26('0x41')](_['pick'](_0x2e9a41[_0x3f26('0x3f')],_0x5a0eac[_0x3f26('0x41')]));_0x425729[_0x3f26('0x9a')]['ChatInteractionId']=_0x1cb6de['id'];if(_0x2e9a41['query'][_0x3f26('0x9b')]){_0x425729[_0x3f26('0x9a')]=_[_0x3f26('0x2f')](_0x425729[_0x3f26('0x9a')],{'$or':_['map'](_0x425729[_0x3f26('0x45')],function(_0x43eda3){var _0x3cb04f={};_0x3cb04f[_0x43eda3]={'$like':'%'+_0x2e9a41[_0x3f26('0x3f')][_0x3f26('0x9b')]+'%'};return _0x3cb04f;})});}if(_0x2e9a41[_0x3f26('0x3f')][_0x3f26('0x9c')]){var _0x20e3e5=_0x2e9a41[_0x3f26('0x3f')][_0x3f26('0x9c')][_0x3f26('0x9d')](',');var _0x2e06e6={};_0x2e06e6[_0x20e3e5[0x0]]={'$gte':moment(_0x20e3e5[0x1])['format'](_0x3f26('0x9e'))};_0x425729[_0x3f26('0x9a')]=_['merge'](_0x425729[_0x3f26('0x9a')],_0x2e06e6);}_0x425729=_[_0x3f26('0x2f')]({},_0x425729,_0x2e9a41[_0x3f26('0x49')]);return db[_0x3f26('0x63')][_0x3f26('0x29')]({'where':_0x425729[_0x3f26('0x9a')]})[_0x3f26('0x17')](function(_0x4f151d){_0x28ae3b['count']=_0x4f151d;if(_0x2e9a41[_0x3f26('0x3f')][_0x3f26('0x47')]){_0x425729[_0x3f26('0x48')]=[{'all':!![]}];}return db[_0x3f26('0x63')][_0x3f26('0x3b')](_0x425729);})[_0x3f26('0x17')](function(_0x303649){_0x28ae3b['rows']=_0x303649;return _0x28ae3b;});}})[_0x3f26('0x17')](respondWithFilteredResult(_0x4e1ec6,_0x425729))[_0x3f26('0x21')](handleError(_0x4e1ec6,null));};exports['getMyMessages']=function(_0x1627b,_0x5de1db){var _0x189ae2={'where':{}},_0x49eb49={},_0x2ee75a={'count':0x0,'rows':[]};return db[_0x3f26('0x36')][_0x3f26('0x4f')]({'where':{'id':_0x1627b[_0x3f26('0x4c')]['id']}})[_0x3f26('0x17')](handleEntityNotFound(_0x5de1db,null))[_0x3f26('0x17')](function(_0x4abe32){if(_0x4abe32){_0x49eb49[_0x3f26('0x43')]=_[_0x3f26('0x40')](db[_0x3f26('0x63')]['rawAttributes']);_0x49eb49[_0x3f26('0x3f')]=_[_0x3f26('0x40')](_0x1627b[_0x3f26('0x3f')]);_0x49eb49[_0x3f26('0x41')]=_[_0x3f26('0x42')](_0x49eb49[_0x3f26('0x43')],_0x49eb49[_0x3f26('0x3f')]);_0x189ae2[_0x3f26('0x45')]=_[_0x3f26('0x42')](_0x49eb49[_0x3f26('0x43')],qs[_0x3f26('0x44')](_0x1627b['query'][_0x3f26('0x44')]));_0x189ae2[_0x3f26('0x45')]=_0x189ae2['attributes'][_0x3f26('0x46')]?_0x189ae2[_0x3f26('0x45')]:_0x49eb49[_0x3f26('0x43')];if(!_0x1627b[_0x3f26('0x3f')][_0x3f26('0x98')](_0x3f26('0x9f'))){_0x189ae2[_0x3f26('0x28')]=qs['limit'](_0x1627b[_0x3f26('0x3f')][_0x3f26('0x28')]);_0x189ae2['offset']=qs['offset'](_0x1627b[_0x3f26('0x3f')][_0x3f26('0x26')]);}_0x189ae2[_0x3f26('0xa0')]=qs[_0x3f26('0x99')](_0x1627b['query'][_0x3f26('0x99')]);_0x189ae2[_0x3f26('0x9a')]=qs[_0x3f26('0x41')](_[_0x3f26('0xa1')](_0x1627b[_0x3f26('0x3f')],_0x49eb49[_0x3f26('0x41')]));_0x189ae2[_0x3f26('0x9a')]['ChatInteractionId']=_0x4abe32['id'];if(_0x1627b['query'][_0x3f26('0x9b')]){_0x189ae2[_0x3f26('0x9a')]=_[_0x3f26('0x2f')](_0x189ae2[_0x3f26('0x9a')],{'$or':_['map'](_0x189ae2['attributes'],function(_0x4d6132){var _0x1d1cdd={};_0x1d1cdd[_0x4d6132]={'$like':'%'+_0x1627b['query'][_0x3f26('0x9b')]+'%'};return _0x1d1cdd;})});}_0x189ae2[_0x3f26('0x9a')][_0x3f26('0x8c')]=![];if(_0x1627b['query']['id']){_0x189ae2[_0x3f26('0x9a')]['id']={'$gt':_0x1627b[_0x3f26('0x3f')]['id']};}_0x189ae2=_['merge']({},_0x189ae2,_0x1627b[_0x3f26('0x49')]);return db[_0x3f26('0x63')]['count']({'where':_0x189ae2['where']})[_0x3f26('0x17')](function(_0x4b6fb8){_0x2ee75a[_0x3f26('0x29')]=_0x4b6fb8;_0x189ae2[_0x3f26('0x48')]=[];if(_0x1627b[_0x3f26('0x3f')][_0x3f26('0xa2')]){_0x189ae2[_0x3f26('0x48')][_0x3f26('0xa3')]({'model':db[_0x3f26('0x7e')],'as':'User','attributes':['id',_0x3f26('0x55'),_0x3f26('0xa4')]});}if(_0x1627b[_0x3f26('0x3f')][_0x3f26('0x47')]){_0x189ae2['include']=[{'all':!![]}];}return db[_0x3f26('0x63')][_0x3f26('0x3b')](_0x189ae2);})[_0x3f26('0x17')](function(_0x17e4e6){_0x2ee75a['rows']=_0x17e4e6;return _0x2ee75a;});}})[_0x3f26('0x17')](respondWithFilteredResult(_0x5de1db,_0x189ae2))[_0x3f26('0x21')](handleError(_0x5de1db,null));};exports['addTags']=function(_0x593903,_0x57e7cb){return db[_0x3f26('0x36')][_0x3f26('0x4a')]({'where':{'id':_0x593903['params']['id']}})['then'](handleEntityNotFound(_0x57e7cb,null))['then'](function(_0x5519c1){if(_0x5519c1){return _0x5519c1[_0x3f26('0xa5')](_0x593903[_0x3f26('0x30')]['ids'],_[_0x3f26('0xa6')](_0x593903[_0x3f26('0x30')],[_0x3f26('0x96'),'id'])||{})['spread'](function(){return db[_0x3f26('0xa7')][_0x3f26('0x3b')]({'attributes':['id',_0x3f26('0x2d'),_0x3f26('0xa8')],'where':{'id':_0x593903[_0x3f26('0x30')][_0x3f26('0x96')]}});})['then'](function(_0x35bd9d){socket[_0x3f26('0xa9')](_0x3f26('0xaa'),{'id':Number(_0x593903[_0x3f26('0x4c')]['id']),'tags':_0x35bd9d||[]});return{'id':Number(_0x593903[_0x3f26('0x4c')]['id']),'tags':_0x35bd9d||[]};});}})['then'](respondWithResult(_0x57e7cb,null))['catch'](handleError(_0x57e7cb,null));};exports[_0x3f26('0xab')]=function(_0x4476a5,_0x59cf6e){return db[_0x3f26('0x36')][_0x3f26('0x4a')]({'where':{'id':_0x4476a5[_0x3f26('0x4c')]['id']}})['then'](handleEntityNotFound(_0x59cf6e,null))[_0x3f26('0x17')](function(_0x184563){if(_0x184563){return _0x184563['removeTags'](_0x4476a5['query'][_0x3f26('0x96')]);}})[_0x3f26('0x17')](respondWithStatusCode(_0x59cf6e,null))[_0x3f26('0x21')](handleError(_0x59cf6e,null));};exports[_0x3f26('0x79')]=function(_0x16991c,_0x36f4e6){var _0x2ed22b=moment()['unix']()[_0x3f26('0xac')]();var _0x55ddbb=path[_0x3f26('0x75')](config[_0x3f26('0x76')],_0x3f26('0xad'),_0x3f26('0xae'),'tmp');var _0x1e2591=path[_0x3f26('0x75')](config[_0x3f26('0x76')],_0x3f26('0xad'),'files',_0x3f26('0xaf'));var _0x39342b=path['join'](_0x55ddbb,_0x2ed22b);var _0x14fa39=util[_0x3f26('0x7b')](_0x3f26('0xb0'),_0x16991c[_0x3f26('0x4c')]['id'],_0x2ed22b);var _0x2d5006=path[_0x3f26('0x75')](_0x55ddbb,_0x14fa39);var _0x405752=[];_0x405752[_0x3f26('0xa3')]({'model':db[_0x3f26('0x7e')],'as':_0x3f26('0x7e'),'attributes':['id',_0x3f26('0x55')],'raw':!![]});_0x405752[_0x3f26('0xa3')]({'model':db[_0x3f26('0x66')],'as':_0x3f26('0xb1'),'attributes':['id',_0x3f26('0xb2'),_0x3f26('0xb3')],'raw':!![]});if(_0x16991c[_0x3f26('0x3f')][_0x3f26('0xaf')]){_0x405752[_0x3f26('0xa3')]({'model':db[_0x3f26('0x71')],'as':_0x3f26('0x71'),'raw':!![]});}var _0x2373dd=[{'model':db['ChatMessage'],'as':_0x3f26('0x80'),'attributes':['id','body','createdAt',_0x3f26('0xb4'),'secret',_0x3f26('0xb5')],'include':_0x405752}];_0x2373dd[_0x3f26('0xa3')]({'model':db[_0x3f26('0xb6')],'as':_0x3f26('0xb7'),'attributes':['id',_0x3f26('0x2d')]});_0x2373dd['push']({'model':db[_0x3f26('0x7e')],'as':_0x3f26('0xb8'),'attributes':['id',_0x3f26('0x55')]});return db[_0x3f26('0x36')][_0x3f26('0x4a')]({'where':{'id':_0x16991c[_0x3f26('0x4c')]['id']},'include':_0x2373dd})[_0x3f26('0x17')](handleEntityNotFound(_0x36f4e6,null))[_0x3f26('0x17')](function(_0x3ccc0c){if(_0x3ccc0c){var _0x48d3e5=_0x3ccc0c[_0x3f26('0xb9')]({'plain':!![]});fs[_0x3f26('0xba')](_0x39342b);var _0x43da79={'channel':_0x3f26('0xbb'),'account':_0x48d3e5[_0x3f26('0xb7')]['name'],'agent':_0x48d3e5[_0x3f26('0xb8')]?_0x48d3e5[_0x3f26('0xb8')][_0x3f26('0x55')]:'N.A.','createdAt':moment(_0x48d3e5[_0x3f26('0x8a')])[_0x3f26('0x7b')]('YYYY-MM-DD\x20HH:mm:ss')[_0x3f26('0xac')](),'closedAt':_0x48d3e5[_0x3f26('0xbc')]?moment(_0x48d3e5['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x3f26('0xac')]():'','disposition':_0x48d3e5[_0x3f26('0x6b')],'chatInfo':{'browser':_0x48d3e5[_0x3f26('0xbd')],'os':_0x48d3e5[_0x3f26('0xbe')],'referer':_0x48d3e5[_0x3f26('0xbf')],'customerIp':_0x48d3e5[_0x3f26('0xc0')],'customerPort':_0x48d3e5[_0x3f26('0xc1')]?_0x48d3e5[_0x3f26('0xc1')]:_0x3f26('0xc2')},'messages':_(_0x48d3e5[_0x3f26('0x80')])['tail']()[_0x3f26('0x9b')]({'secret':![]})[_0x3f26('0x35')](function(_0x3c3524){if(_0x3c3524[_0x3f26('0x71')]){var _0x20e64f=path[_0x3f26('0x75')](_0x1e2591,_0x3c3524['Attachment'][_0x3f26('0x78')]);if(fs[_0x3f26('0xc3')](_0x20e64f)){fs[_0x3f26('0xc4')](_0x20e64f)[_0x3f26('0xc5')](fs[_0x3f26('0xc6')](path[_0x3f26('0x75')](_0x39342b,_0x3c3524[_0x3f26('0x71')][_0x3f26('0x78')])));}}return{'date':moment(_0x3c3524[_0x3f26('0x8a')])[_0x3f26('0x7b')](_0x3f26('0x9e'))[_0x3f26('0xac')](),'sender':_0x3c3524[_0x3f26('0xb4')]===_0x3f26('0x62')?_0x3c3524[_0x3f26('0x7e')]?_0x3c3524['User'][_0x3f26('0x55')]:_0x3f26('0x82'):_0x3c3524[_0x3f26('0xb1')][_0x3f26('0xb2')]+(_0x3c3524[_0x3f26('0xb1')][_0x3f26('0xb3')]?'\x20'+_0x3c3524[_0x3f26('0xb1')]['lastName']:''),'body':_0x3c3524[_0x3f26('0x71')]?_0x3c3524[_0x3f26('0x71')][_0x3f26('0x78')]:_0x3c3524[_0x3f26('0x30')],'direction':_0x3c3524[_0x3f26('0xb4')]==='out'?'A':'C','secret':_0x3c3524[_0x3f26('0x8c')],'read':_0x3c3524['read'],'attachment':_0x3c3524[_0x3f26('0x71')]};})[_0x3f26('0xc7')]()};return ejs[_0x3f26('0xc8')](path[_0x3f26('0x75')](config[_0x3f26('0x76')],_0x3f26('0xad'),_0x3f26('0xc9'),_0x3f26('0xca')),{'interaction':_0x43da79})['then'](function(_0x1db557){var _0x4d208f=path[_0x3f26('0x75')](_0x39342b,_0x3f26('0xcb')+_0x48d3e5['id']+'-'+_0x2ed22b+'.pdf');var _0x47efe4={'path':_0x4d208f,'channel':_0x3f26('0xbb'),'interactionId':_0x48d3e5['id']};return pdf[_0x3f26('0xcc')](_0x1db557,_0x47efe4);})['then'](function(){return new Promise(function(_0x55e444,_0x1619c0){zipdir(_0x39342b,{'saveTo':_0x2d5006},function(_0x49fce6,_0x488b19){if(_0x49fce6)return _0x1619c0(_0x49fce6);return _0x55e444(_0x488b19);});})[_0x3f26('0x17')](function(){return new BPromise(function(_0x229b67,_0x49b3d4){rimraf(_0x39342b,function(_0x313061){if(_0x313061)_0x49b3d4(_0x313061);return _0x229b67();});});})[_0x3f26('0x17')](function(){return _0x36f4e6[_0x3f26('0x79')](_0x2d5006,_0x14fa39,function(_0x13786d){if(_0x13786d){logger[_0x3f26('0x1d')]('err',_0x13786d);}else{fs[_0x3f26('0xcd')](_0x2d5006);}});});});}else{return _0x36f4e6[_0x3f26('0x22')](0xc8);}})[_0x3f26('0x21')](handleError(_0x36f4e6,null));};
\ No newline at end of file
+var _0x1c00=['jayson/promise','http','client','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','end','json','offset','limit','count','set','Content-Range','stack','name','send','merge','body','contact','agent','interaction','index','ChatInteraction','rawAttributes','type','getOptions','findAll','query','user','catch','model','keys','filters','attributes','fields','length','includeAll','include','find','create','params','destroy','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','update','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','now','pathTranscript','Messages','User','ContactId','System','customer','%s%d','Visitor','agentIdentifier','website_alias','agentAlias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','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','ChatMessage','intersection','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','getMyMessages','filter','map','includeAgent','addTags','Tag','color','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','tmp','attachments','transcript-%d-%s.zip','push','Contact','firstName','lastName','direction','read','Account','Owner','N.A.','browserName','referer','customerIp','customerPort','existsSync','createWriteStream','out','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Chat','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket'];(function(_0x4458e3,_0x54273d){var _0x3bfec0=function(_0x59fa08){while(--_0x59fa08){_0x4458e3['push'](_0x4458e3['shift']());}};_0x3bfec0(++_0x54273d);}(_0x1c00,0x191));var _0x01c0=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x1c00[_0x1cb18a];return _0x22442e;};'use strict';var rimraf=require(_0x01c0('0x0'));var zipdir=require(_0x01c0('0x1'));var rp=require(_0x01c0('0x2'));var moment=require(_0x01c0('0x3'));var BPromise=require(_0x01c0('0x4'));var Mustache=require(_0x01c0('0x5'));var util=require(_0x01c0('0x6'));var path=require(_0x01c0('0x7'));var ejs=require(_0x01c0('0x8'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x01c0('0x9'));var interaction=require(_0x01c0('0xa'));var qs=require(_0x01c0('0xb'));var pdf=require(_0x01c0('0xc'));var logger=require(_0x01c0('0xd'))(_0x01c0('0xe'));var config=require(_0x01c0('0xf'));var db=require(_0x01c0('0x10'))['db'];config[_0x01c0('0x11')]=_['defaults'](config[_0x01c0('0x11')],{'host':_0x01c0('0x12'),'port':0x18eb});var socket=require(_0x01c0('0x13'))(new Redis(config[_0x01c0('0x11')]));require(_0x01c0('0x14'))['register'](socket);var jayson=require(_0x01c0('0x15'));var client=jayson['client'][_0x01c0('0x16')]({'port':0x232b});var client9004=jayson[_0x01c0('0x17')][_0x01c0('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x3667f4,_0x1c1ccd,_0x10689b,_0x117375){return new BPromise(function(_0x46d425,_0x1ad409){var _0x5f2ab0=_0x117375||client;return _0x5f2ab0[_0x01c0('0x18')](_0x3667f4,_0x10689b)[_0x01c0('0x19')](function(_0x58435c){logger['info'](_0x01c0('0x1a'),_0x1c1ccd,_0x01c0('0x1b'));logger[_0x01c0('0x1c')](_0x01c0('0x1d'),_0x1c1ccd,_0x01c0('0x1b'),JSON[_0x01c0('0x1e')](_0x58435c));if(_0x58435c['error']){if(_0x58435c[_0x01c0('0x1f')][_0x01c0('0x20')]===0x1f4){logger[_0x01c0('0x1f')]('ChatInteraction,\x20%s,\x20%s',_0x1c1ccd,_0x58435c[_0x01c0('0x1f')][_0x01c0('0x21')]);return _0x1ad409(_0x58435c['error'][_0x01c0('0x21')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x1c1ccd,_0x58435c[_0x01c0('0x1f')][_0x01c0('0x21')]);return _0x46d425(_0x58435c[_0x01c0('0x1f')][_0x01c0('0x21')]);}else{logger[_0x01c0('0x22')](_0x01c0('0x1a'),_0x1c1ccd,'request\x20sent');_0x46d425(_0x58435c[_0x01c0('0x23')]['message']);}})['catch'](function(_0x287ac0){logger[_0x01c0('0x1f')]('ChatInteraction,\x20%s,\x20%s',_0x1c1ccd,_0x287ac0);_0x1ad409(_0x287ac0);});});}function respondWithStatusCode(_0x1ed54f,_0x4775c5){_0x4775c5=_0x4775c5||0xcc;return function(_0x31be16){if(_0x31be16){return _0x1ed54f[_0x01c0('0x24')](_0x4775c5);}return _0x1ed54f[_0x01c0('0x25')](_0x4775c5)[_0x01c0('0x26')]();};}function respondWithResult(_0x1420db,_0x5b5a43){_0x5b5a43=_0x5b5a43||0xc8;return function(_0x54759a){if(_0x54759a){return _0x1420db[_0x01c0('0x25')](_0x5b5a43)[_0x01c0('0x27')](_0x54759a);}};}function respondWithFilteredResult(_0x4e4633,_0x2453fe){return function(_0x4b1036){if(_0x4b1036){var _0x124ed7=typeof _0x2453fe[_0x01c0('0x28')]==='undefined'&&typeof _0x2453fe[_0x01c0('0x29')]==='undefined';var _0x54109f=_0x4b1036[_0x01c0('0x2a')];var _0x3c2b65=_0x124ed7?0x0:_0x2453fe['offset'];var _0x5cb249=_0x124ed7?_0x4b1036['count']:_0x2453fe[_0x01c0('0x28')]+_0x2453fe['limit'];var _0x325784;if(_0x5cb249>=_0x54109f){_0x5cb249=_0x54109f;_0x325784=0xc8;}else{_0x325784=0xce;}_0x4e4633[_0x01c0('0x25')](_0x325784);return _0x4e4633[_0x01c0('0x2b')](_0x01c0('0x2c'),_0x3c2b65+'-'+_0x5cb249+'/'+_0x54109f)[_0x01c0('0x27')](_0x4b1036);}return null;};}function saveUpdates(_0x58743b){return function(_0x267624){if(_0x267624){return _0x267624['update'](_0x58743b)[_0x01c0('0x19')](function(_0x4bee03){return _0x4bee03;});}return null;};}function removeEntity(_0x154a7b){return function(_0x1bf5aa){if(_0x1bf5aa){return _0x1bf5aa['destroy']()['then'](function(){_0x154a7b[_0x01c0('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3df3ad){return function(_0x2f9799){if(!_0x2f9799){_0x3df3ad[_0x01c0('0x24')](0x194);}return _0x2f9799;};}function handleError(_0x4d1b5e,_0x5557b1){_0x5557b1=_0x5557b1||0x1f4;return function(_0xb15874){logger[_0x01c0('0x1f')](_0xb15874[_0x01c0('0x2d')]);if(_0xb15874['name']){delete _0xb15874[_0x01c0('0x2e')];}_0x4d1b5e['status'](_0x5557b1)[_0x01c0('0x2f')](_0xb15874);};}function getMustacheRender(_0x3918db,_0x2fe498){return Mustache['render'](_0x3918db,_[_0x01c0('0x30')](_0x2fe498[_0x01c0('0x31')],{'contact':_0x2fe498[_0x01c0('0x32')],'message':_0x2fe498['message'],'agent':_0x2fe498[_0x01c0('0x33')],'interaction':_0x2fe498[_0x01c0('0x34')],'account':_0x2fe498['account']}))||'';}exports[_0x01c0('0x35')]=function(_0x5deefa,_0x585184){var _0x29c50d={};var _0x5001c8=_['map'](db[_0x01c0('0x36')][_0x01c0('0x37')],function(_0x59af35){return{'name':_0x59af35['fieldName'],'type':_0x59af35[_0x01c0('0x38')]['key']};});_0x29c50d=qs[_0x01c0('0x39')](_0x5001c8,_0x5deefa);return interaction[_0x01c0('0x3a')]('chat',_0x5deefa[_0x01c0('0x3b')],_0x5deefa[_0x01c0('0x3c')],_0x29c50d,_0x5001c8)['then'](respondWithFilteredResult(_0x585184,_0x29c50d))[_0x01c0('0x3d')](handleError(_0x585184,null));};exports['show']=function(_0xb01415,_0x1dc001){var _0x548ac8={'raw':![],'where':{'id':_0xb01415['params']['id']}},_0x3bd304={};_0x3bd304[_0x01c0('0x3e')]=_[_0x01c0('0x3f')](db[_0x01c0('0x36')][_0x01c0('0x37')]);_0x3bd304[_0x01c0('0x3b')]=_[_0x01c0('0x3f')](_0xb01415[_0x01c0('0x3b')]);_0x3bd304[_0x01c0('0x40')]=_['intersection'](_0x3bd304[_0x01c0('0x3e')],_0x3bd304[_0x01c0('0x3b')]);_0x548ac8[_0x01c0('0x41')]=_['intersection'](_0x3bd304[_0x01c0('0x3e')],qs[_0x01c0('0x42')](_0xb01415[_0x01c0('0x3b')][_0x01c0('0x42')]));_0x548ac8['attributes']=_0x548ac8[_0x01c0('0x41')][_0x01c0('0x43')]?_0x548ac8[_0x01c0('0x41')]:_0x3bd304[_0x01c0('0x3e')];if(_0xb01415[_0x01c0('0x3b')][_0x01c0('0x44')]){_0x548ac8[_0x01c0('0x45')]=[{'all':!![]}];}_0x548ac8=_['merge']({},_0x548ac8,_0xb01415['options']);return db[_0x01c0('0x36')][_0x01c0('0x46')](_0x548ac8)[_0x01c0('0x19')](handleEntityNotFound(_0x1dc001,null))[_0x01c0('0x19')](respondWithResult(_0x1dc001,null))[_0x01c0('0x3d')](handleError(_0x1dc001,null));};exports[_0x01c0('0x47')]=function(_0x384f9d,_0x51e141){return db[_0x01c0('0x36')][_0x01c0('0x47')](_0x384f9d['body'],{})[_0x01c0('0x19')](respondWithResult(_0x51e141,0xc9))[_0x01c0('0x3d')](handleError(_0x51e141,null));};exports['update']=function(_0x12395d,_0x2987dd){if(_0x12395d[_0x01c0('0x31')]['id']){delete _0x12395d[_0x01c0('0x31')]['id'];}return db[_0x01c0('0x36')][_0x01c0('0x46')]({'where':{'id':_0x12395d[_0x01c0('0x48')]['id']}})[_0x01c0('0x19')](handleEntityNotFound(_0x2987dd,null))[_0x01c0('0x19')](saveUpdates(_0x12395d[_0x01c0('0x31')],null))['then'](respondWithResult(_0x2987dd,null))[_0x01c0('0x3d')](handleError(_0x2987dd,null));};exports[_0x01c0('0x49')]=function(_0x158bb8,_0x56f8e0){return db[_0x01c0('0x36')][_0x01c0('0x46')]({'where':{'id':_0x158bb8[_0x01c0('0x48')]['id']}})[_0x01c0('0x19')](handleEntityNotFound(_0x56f8e0,null))['then'](removeEntity(_0x56f8e0,null))[_0x01c0('0x3d')](handleError(_0x56f8e0,null));};exports['describe']=function(_0x8ce419,_0x102d22){return db['ChatInteraction'][_0x01c0('0x4a')]()[_0x01c0('0x19')](respondWithResult(_0x102d22,null))['catch'](handleError(_0x102d22,null));};exports[_0x01c0('0x4b')]=function(_0x3ab92c,_0xc9e05c){var _0x4a1c1c=_0x3ab92c[_0x01c0('0x48')]['id'];var _0x37347f;var _0x527c6a;var _0x27b6cb;return db[_0x01c0('0x36')][_0x01c0('0x4c')]({'where':{'id':_0x4a1c1c}})['then'](function(_0x50e6d3){_0x37347f=_0x50e6d3;return db[_0x01c0('0x4d')][_0x01c0('0x4c')]({'where':{'id':_0x50e6d3[_0x01c0('0x4e')]},'attributes':['id','vidaooApiKey',_0x01c0('0x4f'),_0x01c0('0x50'),_0x01c0('0x51'),_0x01c0('0x52')],'raw':!![]});})[_0x01c0('0x19')](function(_0x50baeb){if(_0x50baeb&&_0x50baeb[_0x01c0('0x53')]&&_0x50baeb[_0x01c0('0x4f')]){_0x527c6a=_0x50baeb;var _0x5884c0={'interaction':{'id':_0x4a1c1c},'agent':{'id':_0x3ab92c[_0x01c0('0x3c')]['id'],'name':_0x3ab92c[_0x01c0('0x3c')][_0x01c0('0x2e')],'fullname':_0x3ab92c['user'][_0x01c0('0x54')],'email':_0x3ab92c['user'][_0x01c0('0x55')]},'contact':_0x3ab92c[_0x01c0('0x31')][_0x01c0('0x32')],'account':_0x3ab92c[_0x01c0('0x31')]['account']};var _0x579bd3={'rejectUnauthorized':![],'method':_0x01c0('0x56'),'url':_0x01c0('0x57'),'headers':{'X-APIKEY':_0x50baeb['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x3ab92c['user'][_0x01c0('0x55')]],'buttons':null,'topic':_0x527c6a[_0x01c0('0x50')],'note':_[_0x01c0('0x58')](_0x527c6a[_0x01c0('0x51')])?null:getMustacheRender(_0x527c6a['vidaooNote'],_0x5884c0),'metadata':null},'redirect':_0x01c0('0x59'),'json':!![]};try{if(!_['isNull'](_0x527c6a[_0x01c0('0x52')])){var _0x32ae74=getMustacheRender(_0x527c6a[_0x01c0('0x52')],_0x5884c0);var _0x3d9c6e=JSON[_0x01c0('0x5a')](_0x32ae74);_0x579bd3[_0x01c0('0x31')][_0x01c0('0x5b')]=_0x3d9c6e;}}catch(_0x143c88){throw new db[(_0x01c0('0x5c'))][(_0x01c0('0x5d'))](_0x01c0('0x5e'));}return rp(_0x579bd3);}else{throw new db['Sequelize'][(_0x01c0('0x5d'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x01c0('0x19')](function(_0x136bf5){_0x27b6cb=_0x136bf5;if(_0x27b6cb['id']){var _0x1ef6a1={'body':_0x27b6cb[_0x01c0('0x5f')],'ChatWebsiteId':_0x527c6a['id'],'ChatInteractionId':_0x37347f['id'],'direction':'out','UserId':_0x3ab92c[_0x01c0('0x3c')]['id']};return db['ChatMessage'][_0x01c0('0x47')](_0x1ef6a1,{});}else{throw new db[(_0x01c0('0x5c'))]['ValidationError'](_0x01c0('0x60'));}})['then'](function(){return _0x37347f[_0x01c0('0x61')]({'vidaooSessionId':_0x27b6cb['id']});})[_0x01c0('0x19')](respondWithResult(_0xc9e05c,null))['catch'](handleError(_0xc9e05c,null));};exports['customUpdate']=function(_0x12b509,_0x3d4160){if(_0x12b509[_0x01c0('0x31')]['id']){delete _0x12b509[_0x01c0('0x31')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x12b509[_0x01c0('0x48')]['id']},'include':[{'model':db[_0x01c0('0x62')],'as':'Contact'}]})[_0x01c0('0x19')](handleEntityNotFound(_0x3d4160,null))[_0x01c0('0x19')](saveUpdates(_0x12b509['body'],null))[_0x01c0('0x19')](respondWithResult(_0x3d4160,null))[_0x01c0('0x3d')](handleError(_0x3d4160,null));};exports[_0x01c0('0x63')]=function(_0x56032d,_0x2ebc94){if(_0x56032d[_0x01c0('0x31')]['id']){delete _0x56032d['body']['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x56032d[_0x01c0('0x48')]['id']}})[_0x01c0('0x19')](function(_0x1e20fb){if(!_0x1e20fb){logger[_0x01c0('0x1f')](_0x01c0('0x64'),_0x01c0('0x63'),0x194,_0x01c0('0x65'));_0x2ebc94[_0x01c0('0x24')](0x194);}else{if(_0x1e20fb[_0x01c0('0x66')]){throw new db[(_0x01c0('0x5c'))][(_0x01c0('0x5d'))](_0x01c0('0x67'));}}return _0x1e20fb;})[_0x01c0('0x19')](function(_0x19ccd8){if(_0x19ccd8){return _0x19ccd8[_0x01c0('0x68')]({'closed':_0x56032d[_0x01c0('0x31')][_0x01c0('0x69')],'disposition':_0x56032d['body'][_0x01c0('0x6a')]})[_0x01c0('0x19')](function(_0x158d08){return _0x158d08;});}})[_0x01c0('0x19')](function(){return respondWithRpcPromise(_0x01c0('0x6b'),_0x01c0('0x63'),_0x56032d[_0x01c0('0x31')],client9004);})['then'](respondWithResult(_0x2ebc94,null))[_0x01c0('0x3d')](handleError(_0x2ebc94,null));};exports[_0x01c0('0x6c')]=function(_0x36e176,_0x53ce4d){_0x36e176[_0x01c0('0x31')]['name']=_0x36e176[_0x01c0('0x6d')][_0x01c0('0x6e')];_0x36e176['body'][_0x01c0('0x6f')]=_0x36e176[_0x01c0('0x6d')][_0x01c0('0x70')];_0x36e176[_0x01c0('0x31')][_0x01c0('0x38')]=_0x36e176['file']['mimetype'];return db[_0x01c0('0x71')][_0x01c0('0x47')](_0x36e176[_0x01c0('0x31')])[_0x01c0('0x19')](respondWithResult(_0x53ce4d,0xc9))[_0x01c0('0x3d')](handleError(_0x53ce4d,null));};exports[_0x01c0('0x72')]=function(_0x1469f2,_0x3bc3f1){return db[_0x01c0('0x36')][_0x01c0('0x4c')]({'where':{'id':_0x1469f2[_0x01c0('0x48')]['id']},'raw':!![]})[_0x01c0('0x19')](handleEntityNotFound(_0x3bc3f1,null))[_0x01c0('0x19')](function(_0x4770f8){if(_0x4770f8){if(_0x4770f8[_0x01c0('0x69')]){return _0x3bc3f1[_0x01c0('0x25')](0x193)['json']({'status':0x193,'message':_0x01c0('0x73')});}return db[_0x01c0('0x71')]['findOne']({'where':{'id':_0x1469f2['query'][_0x01c0('0x74')]},'raw':!![]})[_0x01c0('0x19')](handleEntityNotFound(_0x3bc3f1,null));}})['then'](function(_0x272deb){if(_0x272deb){var _0x2958c6=_0x272deb[_0x01c0('0x75')]!==null;var _0x2edd2b=path[_0x01c0('0x76')](config[_0x01c0('0x77')],'server/files/attachments/');if(_0x2958c6){_0x2edd2b=path[_0x01c0('0x76')](_0x2edd2b,_0x01c0('0x78'));}var _0x4349f9=path[_0x01c0('0x76')](_0x2edd2b,_0x272deb[_0x01c0('0x6f')]);return _0x3bc3f1[_0x01c0('0x79')](_0x4349f9);}})[_0x01c0('0x3d')](handleError(_0x3bc3f1,null));};exports[_0x01c0('0x7a')]=function(_0x13c308,_0x5f1bb6){var _0x413039=null;var _0x2de3ff=null;var _0x47e76e=null;if(_0x13c308['body']['id']){delete _0x13c308['body']['id'];}if(_0x13c308[_0x01c0('0x31')][_0x01c0('0x7b')]){_0x47e76e=path[_0x01c0('0x76')](config[_0x01c0('0x77')],_0x01c0('0x7c'),util[_0x01c0('0x7d')]('transcript-%s.txt',Date[_0x01c0('0x7e')]()));_0x13c308['body'][_0x01c0('0x7f')]=_0x47e76e;}return db[_0x01c0('0x36')][_0x01c0('0x46')]({'where':{'id':_0x13c308[_0x01c0('0x48')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x01c0('0x80'),'include':[{'model':db[_0x01c0('0x81')],'as':'User'}]}]})[_0x01c0('0x19')](handleEntityNotFound(_0x5f1bb6,null))['then'](saveUpdates(_0x13c308[_0x01c0('0x31')],null))['then'](function(_0x214250){if(_0x214250){_0x413039=_0x214250;return db[_0x01c0('0x4d')][_0x01c0('0x46')]({'where':{'id':_0x413039[_0x01c0('0x4e')]}});}})[_0x01c0('0x19')](function(_0x1c8841){if(_0x1c8841){_0x2de3ff=_0x1c8841;return db[_0x01c0('0x62')][_0x01c0('0x46')]({'where':{'id':_0x413039[_0x01c0('0x82')]}});}})[_0x01c0('0x19')](function(_0x14a327){if(_0x14a327){if(_0x47e76e){var _0x580dff=null;for(var _0x2ec3ea=0x1;_0x2ec3ea<_0x413039['Messages'][_0x01c0('0x43')];++_0x2ec3ea){_0x580dff=_0x413039[_0x01c0('0x80')][_0x2ec3ea];var _0x121990=_0x580dff['UserId']?util[_0x01c0('0x7d')]('%s%d',_0x2de3ff['agentAlias'],_0x580dff[_0x01c0('0x66')]):_0x01c0('0x83');var _0x287af3=_0x13c308[_0x01c0('0x31')][_0x01c0('0x84')]||util[_0x01c0('0x7d')](_0x01c0('0x85'),_0x01c0('0x86'),_0x580dff[_0x01c0('0x82')]);switch(_0x2de3ff[_0x01c0('0x87')]){case _0x01c0('0x88'):_0x121990=_0x580dff[_0x01c0('0x66')]?util[_0x01c0('0x7d')](_0x01c0('0x85'),_0x2de3ff[_0x01c0('0x89')],_0x580dff[_0x01c0('0x66')]):'System';break;case'agent_alias':_0x121990=_0x580dff['UserId']?_0x580dff[_0x01c0('0x81')][_0x01c0('0x8a')]||_0x580dff[_0x01c0('0x81')][_0x01c0('0x54')]:_0x01c0('0x83');break;case _0x01c0('0x8b'):_0x121990=_0x580dff[_0x01c0('0x66')]?_0x580dff['User'][_0x01c0('0x54')]:_0x01c0('0x83');break;default:_0x121990=_0x580dff[_0x01c0('0x66')]?util['format']('%s%d',_0x2de3ff[_0x01c0('0x89')],_0x580dff[_0x01c0('0x66')]):'System';}var _0x44cc70=util['format'](_0x01c0('0x8c'),moment(_0x580dff[_0x01c0('0x8d')])[_0x01c0('0x7d')](_0x01c0('0x8e')),_0x580dff['direction']==='in'?_0x287af3:_0x121990,_0x580dff[_0x01c0('0x31')]);if(!_0x580dff[_0x01c0('0x8f')]){fs['appendFileSync'](_0x47e76e,_0x44cc70);}}return db[_0x01c0('0x90')][_0x01c0('0x4c')]({'where':{'service':!![]},'include':[{'model':db[_0x01c0('0x91')],'as':_0x01c0('0x92'),'raw':!![],'include':[{'model':db[_0x01c0('0x93')],'as':_0x01c0('0x93'),'raw':!![]}]}]});}}})[_0x01c0('0x19')](function(_0x1b10b9){if(!_0x1b10b9||!_0x1b10b9[_0x01c0('0x92')]||!_0x13c308[_0x01c0('0x31')])return _0x413039;var _0x5dcfe2=_0x1b10b9[_0x01c0('0x94')]();return respondWithRpcPromise('SendMail',_0x01c0('0x95'),{'account':_0x5dcfe2,'message':{'from':util[_0x01c0('0x7d')](_0x01c0('0x96'),_0x1b10b9[_0x01c0('0x2e')],_0x1b10b9[_0x01c0('0x55')]||_0x1b10b9['Smtp']['user']),'to':_0x13c308[_0x01c0('0x31')][_0x01c0('0x7b')],'subject':_0x01c0('0x97'),'text':util[_0x01c0('0x7d')](_0x01c0('0x98'),_0x13c308[_0x01c0('0x31')][_0x01c0('0x7b')]),'attachments':[{'path':_0x47e76e}]}})[_0x01c0('0x19')](function(){return _0x413039;})[_0x01c0('0x3d')](function(_0x37195c){logger[_0x01c0('0x1f')](_0x37195c);});})[_0x01c0('0x19')](respondWithStatusCode(_0x5f1bb6,0xc8))[_0x01c0('0x3d')](handleError(_0x5f1bb6,null));};exports[_0x01c0('0x99')]=function(_0x55cff,_0x20afb6){return db['ChatMessage'][_0x01c0('0x46')]({'where':{'id':_0x55cff[_0x01c0('0x48')]['id']}})[_0x01c0('0x19')](handleEntityNotFound(_0x20afb6,null))[_0x01c0('0x19')](function(_0xc5be7a){if(_0xc5be7a){return _0xc5be7a['addMessage'](_0x55cff[_0x01c0('0x31')][_0x01c0('0x9a')],_[_0x01c0('0x9b')](_0x55cff[_0x01c0('0x31')],['ids','id'])||{});}})[_0x01c0('0x19')](respondWithResult(_0x20afb6,null))['catch'](handleError(_0x20afb6,null));};exports[_0x01c0('0x9c')]=function(_0x411111,_0x3b6149){var _0x4762c9={'raw':![],'where':{}};var _0x1974cc={};var _0x3d2fc6={'count':0x0,'rows':[]};return db[_0x01c0('0x36')][_0x01c0('0x4c')]({'where':{'id':_0x411111['params']['id']}})[_0x01c0('0x19')](handleEntityNotFound(_0x3b6149,null))[_0x01c0('0x19')](function(_0x4333f8){if(_0x4333f8){_0x1974cc['model']=_[_0x01c0('0x3f')](db[_0x01c0('0x9d')]['rawAttributes']);_0x1974cc[_0x01c0('0x3b')]=_['keys'](_0x411111[_0x01c0('0x3b')]);_0x1974cc[_0x01c0('0x40')]=_[_0x01c0('0x9e')](_0x1974cc[_0x01c0('0x3e')],_0x1974cc['query']);_0x4762c9[_0x01c0('0x41')]=_[_0x01c0('0x9e')](_0x1974cc[_0x01c0('0x3e')],qs[_0x01c0('0x42')](_0x411111[_0x01c0('0x3b')]['fields']));_0x4762c9[_0x01c0('0x41')]=_0x4762c9['attributes'][_0x01c0('0x43')]?_0x4762c9[_0x01c0('0x41')]:_0x1974cc[_0x01c0('0x3e')];if(!_0x411111['query'][_0x01c0('0x9f')](_0x01c0('0xa0'))){_0x4762c9[_0x01c0('0x29')]=qs[_0x01c0('0x29')](_0x411111['query'][_0x01c0('0x29')]);_0x4762c9[_0x01c0('0x28')]=qs['offset'](_0x411111[_0x01c0('0x3b')][_0x01c0('0x28')]);}_0x4762c9[_0x01c0('0xa1')]=qs[_0x01c0('0xa2')](_0x411111['query'][_0x01c0('0xa2')]);_0x4762c9[_0x01c0('0xa3')]=qs[_0x01c0('0x40')](_[_0x01c0('0xa4')](_0x411111[_0x01c0('0x3b')],_0x1974cc[_0x01c0('0x40')]));_0x4762c9[_0x01c0('0xa3')][_0x01c0('0xa5')]=_0x4333f8['id'];if(_0x411111[_0x01c0('0x3b')]['filter']){_0x4762c9[_0x01c0('0xa3')]=_[_0x01c0('0x30')](_0x4762c9[_0x01c0('0xa3')],{'$or':_['map'](_0x4762c9['attributes'],function(_0x4832f7){var _0x322084={};_0x322084[_0x4832f7]={'$like':'%'+_0x411111[_0x01c0('0x3b')]['filter']+'%'};return _0x322084;})});}if(_0x411111[_0x01c0('0x3b')]['$gte']){var _0x41b7aa=_0x411111[_0x01c0('0x3b')][_0x01c0('0xa6')][_0x01c0('0xa7')](',');var _0x4a5a78={};_0x4a5a78[_0x41b7aa[0x0]]={'$gte':moment(_0x41b7aa[0x1])[_0x01c0('0x7d')](_0x01c0('0xa8'))};_0x4762c9[_0x01c0('0xa3')]=_[_0x01c0('0x30')](_0x4762c9[_0x01c0('0xa3')],_0x4a5a78);}_0x4762c9=_[_0x01c0('0x30')]({},_0x4762c9,_0x411111[_0x01c0('0xa9')]);return db[_0x01c0('0x9d')][_0x01c0('0x2a')]({'where':_0x4762c9[_0x01c0('0xa3')]})['then'](function(_0x20e1fc){_0x3d2fc6[_0x01c0('0x2a')]=_0x20e1fc;if(_0x411111[_0x01c0('0x3b')][_0x01c0('0x44')]){_0x4762c9[_0x01c0('0x45')]=[{'all':!![]}];}return db[_0x01c0('0x9d')][_0x01c0('0x3a')](_0x4762c9);})[_0x01c0('0x19')](function(_0x403bbe){_0x3d2fc6['rows']=_0x403bbe;return _0x3d2fc6;});}})[_0x01c0('0x19')](respondWithFilteredResult(_0x3b6149,_0x4762c9))['catch'](handleError(_0x3b6149,null));};exports[_0x01c0('0xaa')]=function(_0x276810,_0x40c3a7){var _0x403722={'where':{}},_0x40675c={},_0x339cdb={'count':0x0,'rows':[]};return db[_0x01c0('0x36')][_0x01c0('0x4c')]({'where':{'id':_0x276810[_0x01c0('0x48')]['id']}})['then'](handleEntityNotFound(_0x40c3a7,null))[_0x01c0('0x19')](function(_0x4d951d){if(_0x4d951d){_0x40675c[_0x01c0('0x3e')]=_[_0x01c0('0x3f')](db[_0x01c0('0x9d')][_0x01c0('0x37')]);_0x40675c['query']=_[_0x01c0('0x3f')](_0x276810[_0x01c0('0x3b')]);_0x40675c[_0x01c0('0x40')]=_['intersection'](_0x40675c[_0x01c0('0x3e')],_0x40675c[_0x01c0('0x3b')]);_0x403722[_0x01c0('0x41')]=_[_0x01c0('0x9e')](_0x40675c['model'],qs[_0x01c0('0x42')](_0x276810[_0x01c0('0x3b')][_0x01c0('0x42')]));_0x403722[_0x01c0('0x41')]=_0x403722[_0x01c0('0x41')][_0x01c0('0x43')]?_0x403722[_0x01c0('0x41')]:_0x40675c[_0x01c0('0x3e')];if(!_0x276810['query']['hasOwnProperty']('nolimit')){_0x403722['limit']=qs[_0x01c0('0x29')](_0x276810['query'][_0x01c0('0x29')]);_0x403722['offset']=qs['offset'](_0x276810[_0x01c0('0x3b')]['offset']);}_0x403722[_0x01c0('0xa1')]=qs[_0x01c0('0xa2')](_0x276810[_0x01c0('0x3b')][_0x01c0('0xa2')]);_0x403722[_0x01c0('0xa3')]=qs[_0x01c0('0x40')](_['pick'](_0x276810['query'],_0x40675c[_0x01c0('0x40')]));_0x403722[_0x01c0('0xa3')][_0x01c0('0xa5')]=_0x4d951d['id'];if(_0x276810[_0x01c0('0x3b')][_0x01c0('0xab')]){_0x403722[_0x01c0('0xa3')]=_[_0x01c0('0x30')](_0x403722[_0x01c0('0xa3')],{'$or':_[_0x01c0('0xac')](_0x403722[_0x01c0('0x41')],function(_0x1969ae){var _0x1e47d7={};_0x1e47d7[_0x1969ae]={'$like':'%'+_0x276810[_0x01c0('0x3b')][_0x01c0('0xab')]+'%'};return _0x1e47d7;})});}_0x403722[_0x01c0('0xa3')][_0x01c0('0x8f')]=![];if(_0x276810[_0x01c0('0x3b')]['id']){_0x403722[_0x01c0('0xa3')]['id']={'$gt':_0x276810[_0x01c0('0x3b')]['id']};}_0x403722=_['merge']({},_0x403722,_0x276810[_0x01c0('0xa9')]);return db[_0x01c0('0x9d')][_0x01c0('0x2a')]({'where':_0x403722[_0x01c0('0xa3')]})['then'](function(_0x22f8a4){_0x339cdb['count']=_0x22f8a4;_0x403722['include']=[];if(_0x276810['query'][_0x01c0('0xad')]){_0x403722[_0x01c0('0x45')]['push']({'model':db[_0x01c0('0x81')],'as':_0x01c0('0x81'),'attributes':['id',_0x01c0('0x54'),_0x01c0('0x8a')]});}if(_0x276810['query'][_0x01c0('0x44')]){_0x403722['include']=[{'all':!![]}];}return db[_0x01c0('0x9d')][_0x01c0('0x3a')](_0x403722);})['then'](function(_0x450c69){_0x339cdb['rows']=_0x450c69;return _0x339cdb;});}})['then'](respondWithFilteredResult(_0x40c3a7,_0x403722))['catch'](handleError(_0x40c3a7,null));};exports[_0x01c0('0xae')]=function(_0x58f286,_0x1063eb){return db[_0x01c0('0x36')]['find']({'where':{'id':_0x58f286[_0x01c0('0x48')]['id']}})[_0x01c0('0x19')](handleEntityNotFound(_0x1063eb,null))[_0x01c0('0x19')](function(_0x57cbfe){if(_0x57cbfe){return _0x57cbfe['setTags'](_0x58f286[_0x01c0('0x31')]['ids'],_[_0x01c0('0x9b')](_0x58f286[_0x01c0('0x31')],[_0x01c0('0x9a'),'id'])||{})['spread'](function(){return db[_0x01c0('0xaf')]['findAll']({'attributes':['id',_0x01c0('0x2e'),_0x01c0('0xb0')],'where':{'id':_0x58f286[_0x01c0('0x31')]['ids']}});})[_0x01c0('0x19')](function(_0x5c857c){socket[_0x01c0('0xb1')](_0x01c0('0xb2'),{'id':Number(_0x58f286[_0x01c0('0x48')]['id']),'tags':_0x5c857c||[]});return{'id':Number(_0x58f286[_0x01c0('0x48')]['id']),'tags':_0x5c857c||[]};});}})['then'](respondWithResult(_0x1063eb,null))[_0x01c0('0x3d')](handleError(_0x1063eb,null));};exports[_0x01c0('0xb3')]=function(_0x348a41,_0x473f39){return db[_0x01c0('0x36')][_0x01c0('0x46')]({'where':{'id':_0x348a41[_0x01c0('0x48')]['id']}})[_0x01c0('0x19')](handleEntityNotFound(_0x473f39,null))[_0x01c0('0x19')](function(_0x4326af){if(_0x4326af){return _0x4326af[_0x01c0('0xb3')](_0x348a41['query']['ids']);}})[_0x01c0('0x19')](respondWithStatusCode(_0x473f39,null))['catch'](handleError(_0x473f39,null));};exports[_0x01c0('0x79')]=function(_0x4b4709,_0x933634){var _0x237cf8=moment()[_0x01c0('0xb4')]()[_0x01c0('0xb5')]();var _0x3ef373=path[_0x01c0('0x76')](config[_0x01c0('0x77')],_0x01c0('0xb6'),_0x01c0('0xb7'),_0x01c0('0xb8'));var _0xab0a4f=path[_0x01c0('0x76')](config[_0x01c0('0x77')],_0x01c0('0xb6'),_0x01c0('0xb7'),_0x01c0('0xb9'));var _0x484d78=path[_0x01c0('0x76')](_0x3ef373,_0x237cf8);var _0x453b29=util[_0x01c0('0x7d')](_0x01c0('0xba'),_0x4b4709[_0x01c0('0x48')]['id'],_0x237cf8);var _0x2a9de8=path[_0x01c0('0x76')](_0x3ef373,_0x453b29);var _0xdfd3f6=[];_0xdfd3f6[_0x01c0('0xbb')]({'model':db[_0x01c0('0x81')],'as':_0x01c0('0x81'),'attributes':['id',_0x01c0('0x54')],'raw':!![]});_0xdfd3f6[_0x01c0('0xbb')]({'model':db['CmContact'],'as':_0x01c0('0xbc'),'attributes':['id',_0x01c0('0xbd'),_0x01c0('0xbe')],'raw':!![]});if(_0x4b4709[_0x01c0('0x3b')]['attachments']){_0xdfd3f6[_0x01c0('0xbb')]({'model':db[_0x01c0('0x71')],'as':_0x01c0('0x71'),'raw':!![]});}var _0x23bd47=[{'model':db[_0x01c0('0x9d')],'as':'Messages','attributes':['id',_0x01c0('0x31'),_0x01c0('0x8d'),_0x01c0('0xbf'),_0x01c0('0x8f'),_0x01c0('0xc0')],'include':_0xdfd3f6}];_0x23bd47[_0x01c0('0xbb')]({'model':db[_0x01c0('0x4d')],'as':_0x01c0('0xc1'),'attributes':['id',_0x01c0('0x2e')]});_0x23bd47[_0x01c0('0xbb')]({'model':db['User'],'as':_0x01c0('0xc2'),'attributes':['id',_0x01c0('0x54')]});return db[_0x01c0('0x36')][_0x01c0('0x46')]({'where':{'id':_0x4b4709[_0x01c0('0x48')]['id']},'include':_0x23bd47})[_0x01c0('0x19')](handleEntityNotFound(_0x933634,null))[_0x01c0('0x19')](function(_0x323abe){if(_0x323abe){var _0x55a703=_0x323abe['get']({'plain':!![]});fs['mkdirSync'](_0x484d78);var _0x17903e={'channel':'Chat','account':_0x55a703[_0x01c0('0xc1')][_0x01c0('0x2e')],'agent':_0x55a703[_0x01c0('0xc2')]?_0x55a703['Owner'][_0x01c0('0x54')]:_0x01c0('0xc3'),'createdAt':moment(_0x55a703[_0x01c0('0x8d')])[_0x01c0('0x7d')]('YYYY-MM-DD\x20HH:mm:ss')[_0x01c0('0xb5')](),'closedAt':_0x55a703[_0x01c0('0x69')]?moment(_0x55a703['closedAt'])['format'](_0x01c0('0xa8'))[_0x01c0('0xb5')]():'','disposition':_0x55a703['disposition'],'chatInfo':{'browser':_0x55a703[_0x01c0('0xc4')],'os':_0x55a703['osName'],'referer':_0x55a703[_0x01c0('0xc5')],'customerIp':_0x55a703[_0x01c0('0xc6')],'customerPort':_0x55a703[_0x01c0('0xc7')]?_0x55a703[_0x01c0('0xc7')]:_0x01c0('0xc3')},'messages':_(_0x55a703[_0x01c0('0x80')])['tail']()['filter']({'secret':![]})[_0x01c0('0xac')](function(_0x34d14a){if(_0x34d14a['Attachment']){var _0x10d697=path[_0x01c0('0x76')](_0xab0a4f,_0x34d14a[_0x01c0('0x71')][_0x01c0('0x6f')]);if(fs[_0x01c0('0xc8')](_0x10d697)){fs['createReadStream'](_0x10d697)['pipe'](fs[_0x01c0('0xc9')](path[_0x01c0('0x76')](_0x484d78,_0x34d14a[_0x01c0('0x71')]['basename'])));}}return{'date':moment(_0x34d14a[_0x01c0('0x8d')])[_0x01c0('0x7d')](_0x01c0('0xa8'))[_0x01c0('0xb5')](),'sender':_0x34d14a[_0x01c0('0xbf')]===_0x01c0('0xca')?_0x34d14a[_0x01c0('0x81')]?_0x34d14a['User'][_0x01c0('0x54')]:_0x01c0('0x83'):_0x34d14a[_0x01c0('0xbc')][_0x01c0('0xbd')]+(_0x34d14a[_0x01c0('0xbc')][_0x01c0('0xbe')]?'\x20'+_0x34d14a[_0x01c0('0xbc')][_0x01c0('0xbe')]:''),'body':_0x34d14a['Attachment']?_0x34d14a[_0x01c0('0x71')][_0x01c0('0x6f')]:_0x34d14a[_0x01c0('0x31')],'direction':_0x34d14a[_0x01c0('0xbf')]===_0x01c0('0xca')?'A':'C','secret':_0x34d14a[_0x01c0('0x8f')],'read':_0x34d14a[_0x01c0('0xc0')],'attachment':_0x34d14a[_0x01c0('0x71')]};})[_0x01c0('0xcb')]()};return ejs[_0x01c0('0xcc')](path[_0x01c0('0x76')](config['root'],_0x01c0('0xb6'),_0x01c0('0xcd'),_0x01c0('0xce')),{'interaction':_0x17903e})[_0x01c0('0x19')](function(_0x188bdc){var _0x3a4b53=path['join'](_0x484d78,_0x01c0('0xcf')+_0x55a703['id']+'-'+_0x237cf8+_0x01c0('0xd0'));var _0x130a2b={'path':_0x3a4b53,'channel':_0x01c0('0xd1'),'interactionId':_0x55a703['id']};return pdf['createPdfFromHTML'](_0x188bdc,_0x130a2b);})[_0x01c0('0x19')](function(){return new Promise(function(_0x1257c2,_0x312114){zipdir(_0x484d78,{'saveTo':_0x2a9de8},function(_0x719e96,_0x24e9de){if(_0x719e96)return _0x312114(_0x719e96);return _0x1257c2(_0x24e9de);});})[_0x01c0('0x19')](function(){return new BPromise(function(_0xb11820,_0x4d105b){rimraf(_0x484d78,function(_0x33175e){if(_0x33175e)_0x4d105b(_0x33175e);return _0xb11820();});});})[_0x01c0('0x19')](function(){return _0x933634[_0x01c0('0x79')](_0x2a9de8,_0x453b29,function(_0x51e41c){if(_0x51e41c){logger[_0x01c0('0x1f')]('err',_0x51e41c);}else{fs[_0x01c0('0xd2')](_0x2a9de8);}});});});}else{return _0x933634[_0x01c0('0x24')](0xc8);}})['catch'](handleError(_0x933634,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 06cd63f..833c57e 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 _0xe68e=['exports','events','ChatInteraction','../../mysqldb','ChatMessage','save','update','remove','getUsers','then','setDataValue','Users','unreadMessages','length','emit','hasOwnProperty'];(function(_0x448313,_0x2b5e0f){var _0x3740be=function(_0x130a0d){while(--_0x130a0d){_0x448313['push'](_0x448313['shift']());}};_0x3740be(++_0x2b5e0f);}(_0xe68e,0x131));var _0xee68=function(_0x5ea2f9,_0x320917){_0x5ea2f9=_0x5ea2f9-0x0;var _0x36e586=_0xe68e[_0x5ea2f9];return _0x36e586;};'use strict';var EventEmitter=require(_0xee68('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0xee68('0x1')];var ChatMessage=require(_0xee68('0x2'))['db'][_0xee68('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xee68('0x4'),'afterUpdate':_0xee68('0x5'),'afterDestroy':_0xee68('0x6')};function emitEvent(_0x39c505){return function(_0x168049,_0x2de35f,_0x46ff23){_0x168049[_0xee68('0x7')]({'attributes':['id'],'raw':!![]})[_0xee68('0x8')](function(_0x50f6ab){_0x168049[_0xee68('0x9')](_0xee68('0xa'),_0x50f6ab['map'](function(_0x265736){return{'id':_0x265736['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x168049['id'],'direction':'in','read':![]},'raw':!![]});})[_0xee68('0x8')](function(_0x5a5a7b){_0x168049['setDataValue'](_0xee68('0xb'),_0x5a5a7b[_0xee68('0xc')]);ChatInteractionEvents['emit'](_0x39c505+':'+_0x168049['id'],_0x168049);ChatInteractionEvents[_0xee68('0xd')](_0x39c505,_0x168049);_0x46ff23(null);})['catch'](_0x46ff23(null));};}for(var e in events){if(events[_0xee68('0xe')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xee68('0xf')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x2a81=['update','remove','setDataValue','Users','map','findAll','then','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','ChatInteraction','ChatMessage','save'];(function(_0x14b708,_0x312684){var _0x570268=function(_0x4953e0){while(--_0x4953e0){_0x14b708['push'](_0x14b708['shift']());}};_0x570268(++_0x312684);}(_0x2a81,0x1d8));var _0x12a8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2a81[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x12a8('0x0'))['db'][_0x12a8('0x1')];var ChatMessage=require('../../mysqldb')['db'][_0x12a8('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x12a8('0x3'),'afterUpdate':_0x12a8('0x4'),'afterDestroy':_0x12a8('0x5')};function emitEvent(_0x48af7b){return function(_0x11f4e9,_0x267bf3,_0x34c3a7){_0x11f4e9['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x1e8729){_0x11f4e9[_0x12a8('0x6')](_0x12a8('0x7'),_0x1e8729[_0x12a8('0x8')](function(_0x2c9a08){return{'id':_0x2c9a08['id']};}));return ChatMessage[_0x12a8('0x9')]({'where':{'ChatInteractionId':_0x11f4e9['id'],'direction':'in','read':![]},'raw':!![]});})[_0x12a8('0xa')](function(_0x147510){_0x11f4e9['setDataValue']('unreadMessages',_0x147510[_0x12a8('0xb')]);ChatInteractionEvents[_0x12a8('0xc')](_0x48af7b+':'+_0x11f4e9['id'],_0x11f4e9);ChatInteractionEvents['emit'](_0x48af7b,_0x11f4e9);_0x34c3a7(null);})[_0x12a8('0xd')](_0x34c3a7(null));};}for(var e in events){if(events[_0x12a8('0xe')](e)){var event=events[e];ChatInteraction[_0x12a8('0xf')](e,emitEvent(event));}}module[_0x12a8('0x10')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 005a215..bd6a63d 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 _0x9349=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash'];(function(_0x1e7aff,_0x1c843b){var _0x2a16bf=function(_0x2eceee){while(--_0x2eceee){_0x1e7aff['push'](_0x1e7aff['shift']());}};_0x2a16bf(++_0x1c843b);}(_0x9349,0x19d));var _0x9934=function(_0x40507a,_0x110395){_0x40507a=_0x40507a-0x0;var _0x4f72de=_0x9349[_0x40507a];return _0x4f72de;};'use strict';var _=require(_0x9934('0x0'));var util=require(_0x9934('0x1'));var logger=require(_0x9934('0x2'))(_0x9934('0x3'));var moment=require(_0x9934('0x4'));var BPromise=require('bluebird');var rp=require(_0x9934('0x5'));var fs=require('fs');var path=require(_0x9934('0x6'));var rimraf=require(_0x9934('0x7'));var config=require(_0x9934('0x8'));var attributes=require(_0x9934('0x9'));module[_0x9934('0xa')]=function(_0x4b8665,_0x3d12c9){return _0x4b8665[_0x9934('0xb')](_0x9934('0xc'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x735792,_0x16f889,_0x1d0931){if(_0x735792['changed'](_0x9934('0xd'))){_0x735792[_0x9934('0xe')]=moment()[_0x9934('0xf')](_0x9934('0x10'));}_0x1d0931(null,_0x735792);}},'charset':'utf8mb4','collate':_0x9934('0x11')});};
\ No newline at end of file
+var _0x37cb=['ChatInteraction','chat_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./chatInteraction.attributes','define'];(function(_0x2ff762,_0x342c0b){var _0x158b02=function(_0x13c38e){while(--_0x13c38e){_0x2ff762['push'](_0x2ff762['shift']());}};_0x158b02(++_0x342c0b);}(_0x37cb,0x142));var _0xb37c=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x37cb[_0x525c7b];return _0x27b33e;};'use strict';var _=require('lodash');var util=require(_0xb37c('0x0'));var logger=require(_0xb37c('0x1'))('api');var moment=require('moment');var BPromise=require(_0xb37c('0x2'));var rp=require(_0xb37c('0x3'));var fs=require('fs');var path=require(_0xb37c('0x4'));var rimraf=require('rimraf');var config=require(_0xb37c('0x5'));var attributes=require(_0xb37c('0x6'));module['exports']=function(_0x19e56a,_0xb98122){return _0x19e56a[_0xb37c('0x7')](_0xb37c('0x8'),attributes,{'tableName':_0xb37c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x161403,_0x361570,_0x449417){if(_0x161403[_0xb37c('0xa')](_0xb37c('0xb'))){_0x161403[_0xb37c('0xc')]=moment()['format'](_0xb37c('0xd'));}_0x449417(null,_0x161403);}},'charset':'utf8mb4','collate':_0xb37c('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index ed75474..ab66630 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 _0xc7fe=['request\x20sent','stringify','error','code','message','result','catch','options','where','attributes','limit','UpdateChatInteraction','debug','ChatInteraction','find','addTags','body','omit','spread','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s'];(function(_0x2b522e,_0xf42ddc){var _0x3ade0e=function(_0x4f5028){while(--_0x4f5028){_0x2b522e['push'](_0x2b522e['shift']());}};_0x3ade0e(++_0xf42ddc);}(_0xc7fe,0xd2));var _0xec7f=function(_0x41c381,_0x1176bd){_0x41c381=_0x41c381-0x0;var _0x427981=_0xc7fe[_0x41c381];return _0x427981;};'use strict';var _=require(_0xec7f('0x0'));var util=require(_0xec7f('0x1'));var moment=require(_0xec7f('0x2'));var BPromise=require(_0xec7f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xec7f('0x4'))['db'];var utils=require(_0xec7f('0x5'));var logger=require('../../config/logger')(_0xec7f('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xec7f('0x7')][_0xec7f('0x8')]({'port':0x232a});config[_0xec7f('0x9')]=_[_0xec7f('0xa')](config[_0xec7f('0x9')],{'host':_0xec7f('0xb'),'port':0x18eb});var socket=require(_0xec7f('0xc'))(new Redis(config[_0xec7f('0x9')]));require(_0xec7f('0xd'))['register'](socket);function respondWithRpcPromise(_0x2529f0,_0x2218f8,_0x109aa0){return new BPromise(function(_0x51db89,_0x52bc1a){return client[_0xec7f('0xe')](_0x2529f0,_0x109aa0)[_0xec7f('0xf')](function(_0x269779){logger[_0xec7f('0x10')](_0xec7f('0x11'),_0x2218f8,_0xec7f('0x12'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2218f8,'request\x20sent',JSON[_0xec7f('0x13')](_0x269779));if(_0x269779['error']){if(_0x269779[_0xec7f('0x14')][_0xec7f('0x15')]===0x1f4){logger['error'](_0xec7f('0x11'),_0x2218f8,_0x269779[_0xec7f('0x14')]['message']);return _0x52bc1a(_0x269779[_0xec7f('0x14')][_0xec7f('0x16')]);}logger[_0xec7f('0x14')](_0xec7f('0x11'),_0x2218f8,_0x269779[_0xec7f('0x14')][_0xec7f('0x16')]);return _0x51db89(_0x269779[_0xec7f('0x14')][_0xec7f('0x16')]);}else{logger[_0xec7f('0x10')](_0xec7f('0x11'),_0x2218f8,_0xec7f('0x12'));_0x51db89(_0x269779[_0xec7f('0x17')]['message']);}})[_0xec7f('0x18')](function(_0x26fce1){logger[_0xec7f('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x2218f8,_0x26fce1);_0x52bc1a(_0x26fce1);});});}exports['UpdateChatInteraction']=function(_0x449268){var _0x538f51=this;return new Promise(function(_0x1f1e06,_0x5277b5){return db['ChatInteraction']['update'](_0x449268['body'],{'raw':_0x449268[_0xec7f('0x19')]?_0x449268[_0xec7f('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x449268[_0xec7f('0x19')]?_0x449268[_0xec7f('0x19')][_0xec7f('0x1a')]||null:null,'attributes':_0x449268[_0xec7f('0x19')]?_0x449268[_0xec7f('0x19')][_0xec7f('0x1b')]||null:null,'limit':_0x449268[_0xec7f('0x19')]?_0x449268[_0xec7f('0x19')][_0xec7f('0x1c')]||null:null})[_0xec7f('0xf')](function(_0x44a520){logger[_0xec7f('0x10')](_0xec7f('0x1d'),_0x449268);logger[_0xec7f('0x1e')](_0xec7f('0x1d'),_0x449268,JSON['stringify'](_0x44a520));_0x1f1e06(_0x44a520);})[_0xec7f('0x18')](function(_0x5f1241){logger[_0xec7f('0x14')]('UpdateChatInteraction',_0x5f1241[_0xec7f('0x16')],_0x449268);_0x5277b5(_0x538f51[_0xec7f('0x14')](0x1f4,_0x5f1241[_0xec7f('0x16')]));});});};exports['AddTagsToChatInteraction']=function(_0x3dc91a){return new Promise(function(_0x22c687,_0x3f59c1){return db[_0xec7f('0x1f')][_0xec7f('0x20')]({'where':_0x3dc91a[_0xec7f('0x19')]?_0x3dc91a[_0xec7f('0x19')][_0xec7f('0x1a')]||null:null})[_0xec7f('0xf')](function(_0x5253ab){if(_0x5253ab){return _0x5253ab[_0xec7f('0x21')](_0x3dc91a[_0xec7f('0x22')]['ids'],_[_0xec7f('0x23')](_0x3dc91a[_0xec7f('0x22')],['ids','id'])||{});}})[_0xec7f('0x24')](function(_0x3096f4){logger['info'](_0xec7f('0x25'),_0x3dc91a);logger[_0xec7f('0x1e')](_0xec7f('0x25'),_0x3dc91a,JSON['stringify'](_0x3096f4));_0x22c687(_0x3096f4);})['catch'](function(_0x326acb){logger[_0xec7f('0x14')](_0xec7f('0x25'),_0x326acb[_0xec7f('0x16')],_0x3dc91a);_0x3f59c1(_this[_0xec7f('0x14')](0x1f4,_0x326acb['message']));});});};
\ No newline at end of file
+var _0x56b9=['spread','AddTags','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','register','request','then','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateChatInteraction','ChatInteraction','body','options','raw','where','attributes','limit','debug','catch','AddTagsToChatInteraction','find','addTags','ids'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x56b9,0x121));var _0x956b=function(_0x1effc9,_0x4496d1){_0x1effc9=_0x1effc9-0x0;var _0x1cb7e5=_0x56b9[_0x1effc9];return _0x1cb7e5;};'use strict';var _=require(_0x956b('0x0'));var util=require(_0x956b('0x1'));var moment=require(_0x956b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x956b('0x3'))['db'];var utils=require(_0x956b('0x4'));var logger=require(_0x956b('0x5'))(_0x956b('0x6'));var config=require(_0x956b('0x7'));var jayson=require(_0x956b('0x8'));var client=jayson[_0x956b('0x9')][_0x956b('0xa')]({'port':0x232a});config['redis']=_[_0x956b('0xb')](config[_0x956b('0xc')],{'host':_0x956b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInteraction.socket')[_0x956b('0xe')](socket);function respondWithRpcPromise(_0x400f64,_0x4f16eb,_0x30329e){return new BPromise(function(_0x15b924,_0x3424e6){return client[_0x956b('0xf')](_0x400f64,_0x30329e)[_0x956b('0x10')](function(_0x547af1){logger[_0x956b('0x11')](_0x956b('0x12'),_0x4f16eb,'request\x20sent');logger['debug'](_0x956b('0x13'),_0x4f16eb,_0x956b('0x14'),JSON[_0x956b('0x15')](_0x547af1));if(_0x547af1[_0x956b('0x16')]){if(_0x547af1[_0x956b('0x16')]['code']===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x4f16eb,_0x547af1[_0x956b('0x16')][_0x956b('0x17')]);return _0x3424e6(_0x547af1[_0x956b('0x16')][_0x956b('0x17')]);}logger['error'](_0x956b('0x12'),_0x4f16eb,_0x547af1[_0x956b('0x16')]['message']);return _0x15b924(_0x547af1['error'][_0x956b('0x17')]);}else{logger[_0x956b('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x4f16eb,_0x956b('0x14'));_0x15b924(_0x547af1[_0x956b('0x18')][_0x956b('0x17')]);}})['catch'](function(_0x248d08){logger[_0x956b('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x4f16eb,_0x248d08);_0x3424e6(_0x248d08);});});}exports[_0x956b('0x19')]=function(_0xb0587c){var _0x5dcf12=this;return new Promise(function(_0x1a0340,_0x1f49b6){return db[_0x956b('0x1a')]['update'](_0xb0587c[_0x956b('0x1b')],{'raw':_0xb0587c[_0x956b('0x1c')]?_0xb0587c[_0x956b('0x1c')][_0x956b('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb0587c['options']?_0xb0587c[_0x956b('0x1c')][_0x956b('0x1e')]||null:null,'attributes':_0xb0587c['options']?_0xb0587c[_0x956b('0x1c')][_0x956b('0x1f')]||null:null,'limit':_0xb0587c['options']?_0xb0587c[_0x956b('0x1c')][_0x956b('0x20')]||null:null})[_0x956b('0x10')](function(_0x243834){logger[_0x956b('0x11')]('UpdateChatInteraction',_0xb0587c);logger[_0x956b('0x21')]('UpdateChatInteraction',_0xb0587c,JSON[_0x956b('0x15')](_0x243834));_0x1a0340(_0x243834);})[_0x956b('0x22')](function(_0x5b0dea){logger[_0x956b('0x16')](_0x956b('0x19'),_0x5b0dea[_0x956b('0x17')],_0xb0587c);_0x1f49b6(_0x5dcf12['error'](0x1f4,_0x5b0dea[_0x956b('0x17')]));});});};exports[_0x956b('0x23')]=function(_0x3a3b60){return new Promise(function(_0x4abc5f,_0x162776){return db['ChatInteraction'][_0x956b('0x24')]({'where':_0x3a3b60[_0x956b('0x1c')]?_0x3a3b60[_0x956b('0x1c')][_0x956b('0x1e')]||null:null})['then'](function(_0x18e86c){if(_0x18e86c){return _0x18e86c[_0x956b('0x25')](_0x3a3b60[_0x956b('0x1b')][_0x956b('0x26')],_['omit'](_0x3a3b60[_0x956b('0x1b')],['ids','id'])||{});}})[_0x956b('0x27')](function(_0x3fed1d){logger['info'](_0x956b('0x28'),_0x3a3b60);logger[_0x956b('0x21')]('AddTags',_0x3a3b60,JSON[_0x956b('0x15')](_0x3fed1d));_0x4abc5f(_0x3fed1d);})[_0x956b('0x22')](function(_0x4d0042){logger[_0x956b('0x16')](_0x956b('0x28'),_0x4d0042['message'],_0x3a3b60);_0x162776(_this[_0x956b('0x16')](0x1f4,_0x4d0042['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index f7384c5..858a24f 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 _0xaa3f=['register','length','chatInteraction:','./chatInteraction.events','remove','update','emit','removeListener'];(function(_0x1b4af6,_0xd59625){var _0x105d96=function(_0x31995e){while(--_0x31995e){_0x1b4af6['push'](_0x1b4af6['shift']());}};_0x105d96(++_0xd59625);}(_0xaa3f,0x1f3));var _0xfaa3=function(_0x231e7c,_0x22bb4b){_0x231e7c=_0x231e7c-0x0;var _0x292777=_0xaa3f[_0x231e7c];return _0x292777;};'use strict';var ChatInteractionEvents=require(_0xfaa3('0x0'));var events=['save',_0xfaa3('0x1'),_0xfaa3('0x2')];function createListener(_0x3a65d6,_0x147332){return function(_0xa86cca){_0x147332[_0xfaa3('0x3')](_0x3a65d6,_0xa86cca);};}function removeListener(_0x15e5dd,_0x2fa26a){return function(){ChatInteractionEvents[_0xfaa3('0x4')](_0x15e5dd,_0x2fa26a);};}exports[_0xfaa3('0x5')]=function(_0xe9a86d){for(var _0x46e6b9=0x0,_0xc4efb7=events[_0xfaa3('0x6')];_0x46e6b9<_0xc4efb7;_0x46e6b9++){var _0x2462ca=events[_0x46e6b9];var _0x355fa9=createListener(_0xfaa3('0x7')+_0x2462ca,_0xe9a86d);ChatInteractionEvents['on'](_0x2462ca,_0x355fa9);}};
\ No newline at end of file
+var _0x633c=['removeListener','register','length','chatInteraction:','update','emit'];(function(_0x3fc8b2,_0x2bf333){var _0x53d271=function(_0x229073){while(--_0x229073){_0x3fc8b2['push'](_0x3fc8b2['shift']());}};_0x53d271(++_0x2bf333);}(_0x633c,0x1b4));var _0xc633=function(_0x517b07,_0x5ce005){_0x517b07=_0x517b07-0x0;var _0x29723f=_0x633c[_0x517b07];return _0x29723f;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save','remove',_0xc633('0x0')];function createListener(_0x503585,_0x109346){return function(_0x1ccc73){_0x109346[_0xc633('0x1')](_0x503585,_0x1ccc73);};}function removeListener(_0xd03cb6,_0x3ce630){return function(){ChatInteractionEvents[_0xc633('0x2')](_0xd03cb6,_0x3ce630);};}exports[_0xc633('0x3')]=function(_0x4a6010){for(var _0x52f495=0x0,_0x3d09d3=events[_0xc633('0x4')];_0x52f495<_0x3d09d3;_0x52f495++){var _0x1dde0d=events[_0x52f495];var _0x230f83=createListener(_0xc633('0x5')+_0x1dde0d,_0x4a6010);ChatInteractionEvents['on'](_0x1dde0d,_0x230f83);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 5d5c231..ad5ab6b 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 _0xd1d6=['format','%s-%s','now','originalname','replace','single','file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','chatinteraction:update','update','/:id/custom_update','customUpdate','put','close','destroy','delete','/:id/tags','removeTags','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','create','createVidaooSession','diskStorage','join','root','server/files/attachments/'];(function(_0x3b5af0,_0x372fc7){var _0x10db5e=function(_0x1a40d8){while(--_0x1a40d8){_0x3b5af0['push'](_0x3b5af0['shift']());}};_0x10db5e(++_0x372fc7);}(_0xd1d6,0x1f4));var _0x6d1d=function(_0x1f731d,_0x26b299){_0x1f731d=_0x1f731d-0x0;var _0x3c83b3=_0xd1d6[_0x1f731d];return _0x3c83b3;};'use strict';var multer=require(_0x6d1d('0x0'));var util=require('util');var path=require(_0x6d1d('0x1'));var timeout=require(_0x6d1d('0x2'));var express=require(_0x6d1d('0x3'));var router=express['Router']();var fs_extra=require(_0x6d1d('0x4'));var auth=require(_0x6d1d('0x5'));var interaction=require(_0x6d1d('0x6'));var config=require(_0x6d1d('0x7'));var controller=require('./chatInteraction.controller');router[_0x6d1d('0x8')]('/',auth[_0x6d1d('0x9')](),controller[_0x6d1d('0xa')]);router[_0x6d1d('0x8')](_0x6d1d('0xb'),auth[_0x6d1d('0x9')](),controller[_0x6d1d('0xc')]);router[_0x6d1d('0x8')](_0x6d1d('0xd'),auth[_0x6d1d('0xe')](),controller[_0x6d1d('0xf')]);router[_0x6d1d('0x8')](_0x6d1d('0x10'),auth[_0x6d1d('0xe')](),controller[_0x6d1d('0x11')]);router['get'](_0x6d1d('0x12'),auth[_0x6d1d('0x9')](),controller[_0x6d1d('0x13')]);router[_0x6d1d('0x8')](_0x6d1d('0x14'),auth[_0x6d1d('0xe')](),controller[_0x6d1d('0x15')]);router['get'](_0x6d1d('0x16'),auth[_0x6d1d('0x9')](),controller['download']);router[_0x6d1d('0x17')]('/',auth['isAuthenticated'](),controller[_0x6d1d('0x18')]);router[_0x6d1d('0x17')]('/:id/vidaoo',auth[_0x6d1d('0x9')](),controller[_0x6d1d('0x19')]);var upload=multer({'storage':multer[_0x6d1d('0x1a')]({'destination':function(_0x2d8a2f,_0x1d3c8a,_0x1ef6ff){_0x1ef6ff(null,path[_0x6d1d('0x1b')](config[_0x6d1d('0x1c')],_0x6d1d('0x1d')));},'filename':function(_0x5cda5b,_0x3fb111,_0xf61bf){_0xf61bf(null,util[_0x6d1d('0x1e')](_0x6d1d('0x1f'),Date[_0x6d1d('0x20')](),_0x3fb111[_0x6d1d('0x21')][_0x6d1d('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x6d1d('0x17')]('/:id/attachment_upload',upload[_0x6d1d('0x23')](_0x6d1d('0x24')),controller[_0x6d1d('0x25')]);router['post'](_0x6d1d('0x12'),auth[_0x6d1d('0xe')](),controller[_0x6d1d('0x26')]);router['post']('/:id/tags',auth[_0x6d1d('0x9')](),interaction[_0x6d1d('0x27')](_0x6d1d('0x28'),_0x6d1d('0x29')),controller['addTags']);router['put'](_0x6d1d('0xd'),auth[_0x6d1d('0x9')](),interaction[_0x6d1d('0x27')](_0x6d1d('0x28'),_0x6d1d('0x2a')),controller[_0x6d1d('0x2b')]);router['put'](_0x6d1d('0x2c'),controller[_0x6d1d('0x2d')]);router[_0x6d1d('0x2e')]('/:id/abandon',auth[_0x6d1d('0xe')](),controller['abandon']);router['put']('/:id/close',controller[_0x6d1d('0x2f')]);router['delete'](_0x6d1d('0xd'),auth[_0x6d1d('0x9')](),interaction[_0x6d1d('0x27')]('chat','chatinteraction:destroy'),controller[_0x6d1d('0x30')]);router[_0x6d1d('0x31')](_0x6d1d('0x32'),auth['isAuthenticated'](),controller[_0x6d1d('0x33')]);module[_0x6d1d('0x34')]=router;
\ No newline at end of file
+var _0xf78e=['Router','fs-extra','../../components/auth/service','./chatInteraction.controller','isAuthenticated','describe','get','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','server/files/attachments/','now','originalname','replace','/:id/attachment_upload','single','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','update','customUpdate','/:id/abandon','abandon','/:id/close','delete','/:id','chatinteraction:destroy','exports','multer','util','path','connect-timeout'];(function(_0x2f776d,_0x2f4345){var _0x4b2bf0=function(_0x32c31d){while(--_0x32c31d){_0x2f776d['push'](_0x2f776d['shift']());}};_0x4b2bf0(++_0x2f4345);}(_0xf78e,0x184));var _0xef78=function(_0x4d5d1e,_0x6e992b){_0x4d5d1e=_0x4d5d1e-0x0;var _0x498465=_0xf78e[_0x4d5d1e];return _0x498465;};'use strict';var multer=require(_0xef78('0x0'));var util=require(_0xef78('0x1'));var path=require(_0xef78('0x2'));var timeout=require(_0xef78('0x3'));var express=require('express');var router=express[_0xef78('0x4')]();var fs_extra=require(_0xef78('0x5'));var auth=require(_0xef78('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xef78('0x7'));router['get']('/',auth[_0xef78('0x8')](),controller['index']);router['get']('/describe',auth[_0xef78('0x8')](),controller[_0xef78('0x9')]);router[_0xef78('0xa')]('/:id',auth[_0xef78('0xb')](),controller[_0xef78('0xc')]);router[_0xef78('0xa')](_0xef78('0xd'),auth[_0xef78('0xb')](),controller[_0xef78('0xe')]);router[_0xef78('0xa')](_0xef78('0xf'),auth[_0xef78('0x8')](),controller[_0xef78('0x10')]);router[_0xef78('0xa')](_0xef78('0x11'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router[_0xef78('0xa')](_0xef78('0x12'),auth[_0xef78('0x8')](),controller[_0xef78('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0xef78('0x14')]);router[_0xef78('0x15')](_0xef78('0x16'),auth[_0xef78('0x8')](),controller[_0xef78('0x17')]);var upload=multer({'storage':multer[_0xef78('0x18')]({'destination':function(_0x36fd55,_0x3f1f51,_0x39117d){_0x39117d(null,path[_0xef78('0x19')](config['root'],_0xef78('0x1a')));},'filename':function(_0x160d18,_0xbb7ca7,_0x1e6e28){_0x1e6e28(null,util['format']('%s-%s',Date[_0xef78('0x1b')](),_0xbb7ca7[_0xef78('0x1c')][_0xef78('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xef78('0x15')](_0xef78('0x1e'),upload[_0xef78('0x1f')]('file'),controller[_0xef78('0x20')]);router[_0xef78('0x15')](_0xef78('0xf'),auth[_0xef78('0xb')](),controller[_0xef78('0x21')]);router[_0xef78('0x15')](_0xef78('0x22'),auth[_0xef78('0x8')](),interaction[_0xef78('0x23')](_0xef78('0x24'),_0xef78('0x25')),controller[_0xef78('0x26')]);router[_0xef78('0x27')]('/:id',auth[_0xef78('0x8')](),interaction[_0xef78('0x23')](_0xef78('0x24'),'chatinteraction:update'),controller[_0xef78('0x28')]);router[_0xef78('0x27')]('/:id/custom_update',controller[_0xef78('0x29')]);router['put'](_0xef78('0x2a'),auth['isChatInteractionAuthorized'](),controller[_0xef78('0x2b')]);router[_0xef78('0x27')](_0xef78('0x2c'),controller['close']);router[_0xef78('0x2d')](_0xef78('0x2e'),auth[_0xef78('0x8')](),interaction[_0xef78('0x23')](_0xef78('0x24'),_0xef78('0x2f')),controller['destroy']);router[_0xef78('0x2d')]('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module[_0xef78('0x30')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 44c3c07..ca17925 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 _0x38d2=['BOOLEAN','INTEGER','exports'];(function(_0x4b4c39,_0x53bd51){var _0x43265c=function(_0x4857e0){while(--_0x4857e0){_0x4b4c39['push'](_0x4b4c39['shift']());}};_0x43265c(++_0x53bd51);}(_0x38d2,0x17f));var _0x238d=function(_0x113070,_0x5a1b3f){_0x113070=_0x113070-0x0;var _0x15e85b=_0x38d2[_0x113070];return _0x15e85b;};'use strict';var Sequelize=require('sequelize');module[_0x238d('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x238d('0x1')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x238d('0x2')]}};
\ No newline at end of file
+var _0xc7f3=['sequelize','exports','medium','BOOLEAN'];(function(_0x3871d8,_0x5da6b2){var _0xe85d42=function(_0x5386bb){while(--_0x5386bb){_0x3871d8['push'](_0x3871d8['shift']());}};_0xe85d42(++_0x5da6b2);}(_0xc7f3,0x1f4));var _0x3c7f=function(_0x1057a3,_0x28d9b7){_0x1057a3=_0x1057a3-0x0;var _0x131cdb=_0xc7f3[_0x1057a3];return _0x131cdb;};'use strict';var Sequelize=require(_0x3c7f('0x0'));module[_0x3c7f('0x1')]={'body':{'type':Sequelize['TEXT'](_0x3c7f('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x3c7f('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 47eaf8c..e7a80ca 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 _0xbb2c=['userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','createdAt','ToId','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','ChatInternalMessage','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','get','messages','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','agent','admin','user','fullname','role','internal','online','lastLoginAt','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection'];(function(_0x14e693,_0x1bcdae){var _0x40c656=function(_0x4dcacc){while(--_0x4dcacc){_0x14e693['push'](_0x14e693['shift']());}};_0x40c656(++_0x1bcdae);}(_0xbb2c,0x15f));var _0xcbb2=function(_0x5a97c8,_0x466425){_0x5a97c8=_0x5a97c8-0x0;var _0x5b4d0f=_0xbb2c[_0x5a97c8];return _0x5b4d0f;};'use strict';var emlformat=require(_0xcbb2('0x0'));var rimraf=require(_0xcbb2('0x1'));var zipdir=require(_0xcbb2('0x2'));var jsonpatch=require(_0xcbb2('0x3'));var rp=require('request-promise');var moment=require(_0xcbb2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcbb2('0x5'));var util=require(_0xcbb2('0x6'));var path=require(_0xcbb2('0x7'));var sox=require(_0xcbb2('0x8'));var csv=require('to-csv');var ejs=require(_0xcbb2('0x9'));var fs=require('fs');var fs_extra=require(_0xcbb2('0xa'));var _=require(_0xcbb2('0xb'));var squel=require(_0xcbb2('0xc'));var crypto=require('crypto');var jsforce=require(_0xcbb2('0xd'));var deskjs=require(_0xcbb2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xcbb2('0xf'));var Papa=require(_0xcbb2('0x10'));var Redis=require('ioredis');var authService=require(_0xcbb2('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xcbb2('0x12'));var hardwareService=require(_0xcbb2('0x13'));var logger=require(_0xcbb2('0x14'))(_0xcbb2('0x15'));var utils=require(_0xcbb2('0x16'));var config=require(_0xcbb2('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xcbb2('0x18'))['db'];config[_0xcbb2('0x19')]=_[_0xcbb2('0x1a')](config['redis'],{'host':_0xcbb2('0x1b'),'port':0x18eb});var socket=require(_0xcbb2('0x1c'))(new Redis(config[_0xcbb2('0x19')]));require(_0xcbb2('0x1d'))[_0xcbb2('0x1e')](socket);function respondWithStatusCode(_0x3449ad,_0x15008c){_0x15008c=_0x15008c||0xcc;return function(_0x5b6c4b){if(_0x5b6c4b){return _0x3449ad[_0xcbb2('0x1f')](_0x15008c);}return _0x3449ad[_0xcbb2('0x20')](_0x15008c)[_0xcbb2('0x21')]();};}function respondWithResult(_0x594b1f,_0x384a0d){_0x384a0d=_0x384a0d||0xc8;return function(_0x37c221){if(_0x37c221){return _0x594b1f[_0xcbb2('0x20')](_0x384a0d)[_0xcbb2('0x22')](_0x37c221);}};}function respondWithFilteredResult(_0x2945e1,_0x388309){return function(_0x3052e9){if(_0x3052e9){var _0x50315d=typeof _0x388309['offset']===_0xcbb2('0x23')&&typeof _0x388309[_0xcbb2('0x24')]==='undefined';var _0xfdcd6d=_0x3052e9[_0xcbb2('0x25')];var _0x2b828c=_0x50315d?0x0:_0x388309[_0xcbb2('0x26')];var _0x478bca=_0x50315d?_0x3052e9[_0xcbb2('0x25')]:_0x388309[_0xcbb2('0x26')]+_0x388309[_0xcbb2('0x24')];var _0x24cc71;if(_0x478bca>=_0xfdcd6d){_0x478bca=_0xfdcd6d;_0x24cc71=0xc8;}else{_0x24cc71=0xce;}_0x2945e1[_0xcbb2('0x20')](_0x24cc71);return _0x2945e1[_0xcbb2('0x27')](_0xcbb2('0x28'),_0x2b828c+'-'+_0x478bca+'/'+_0xfdcd6d)['json'](_0x3052e9);}return null;};}function patchUpdates(_0x1500ec){return function(_0x32d11d){try{jsonpatch[_0xcbb2('0x29')](_0x32d11d,_0x1500ec,!![]);}catch(_0x339449){return BPromise[_0xcbb2('0x2a')](_0x339449);}return _0x32d11d[_0xcbb2('0x2b')]();};}function saveUpdates(_0x2e3457,_0x28edda){return function(_0x530c0f){if(_0x530c0f){return _0x530c0f[_0xcbb2('0x2c')](_0x2e3457)['then'](function(_0x1f388f){return _0x1f388f;});}return null;};}function removeEntity(_0x46b610,_0x1ff20d){return function(_0x555d75){if(_0x555d75){return _0x555d75[_0xcbb2('0x2d')]()[_0xcbb2('0x2e')](function(){_0x46b610['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x30d344,_0x5126ba){return function(_0xacfa9d){if(!_0xacfa9d){_0x30d344[_0xcbb2('0x1f')](0x194);}return _0xacfa9d;};}function handleError(_0x45f724,_0x46d2ae){_0x46d2ae=_0x46d2ae||0x1f4;return function(_0x22ad31){logger['error'](_0x22ad31[_0xcbb2('0x2f')]);if(_0x22ad31[_0xcbb2('0x30')]){delete _0x22ad31[_0xcbb2('0x30')];}_0x45f724[_0xcbb2('0x20')](_0x46d2ae)[_0xcbb2('0x31')](_0x22ad31);};}exports[_0xcbb2('0x32')]=function(_0x3c63af,_0xe2e2ec){var _0x4b9edc={},_0x84d358={},_0x37500e={'count':0x0,'rows':[]};var _0x436d78=_['map'](db[_0xcbb2('0x33')][_0xcbb2('0x34')],function(_0x2577b7){return{'name':_0x2577b7[_0xcbb2('0x35')],'type':_0x2577b7[_0xcbb2('0x36')][_0xcbb2('0x37')]};});_0x84d358['model']=_[_0xcbb2('0x38')](_0x436d78,_0xcbb2('0x30'));_0x84d358[_0xcbb2('0x39')]=_[_0xcbb2('0x3a')](_0x3c63af[_0xcbb2('0x39')]);_0x84d358[_0xcbb2('0x3b')]=_[_0xcbb2('0x3c')](_0x84d358[_0xcbb2('0x3d')],_0x84d358[_0xcbb2('0x39')]);_0x4b9edc['attributes']=_[_0xcbb2('0x3c')](_0x84d358[_0xcbb2('0x3d')],qs['fields'](_0x3c63af[_0xcbb2('0x39')]['fields']));_0x4b9edc[_0xcbb2('0x3e')]=_0x4b9edc[_0xcbb2('0x3e')][_0xcbb2('0x3f')]?_0x4b9edc['attributes']:_0x84d358[_0xcbb2('0x3d')];if(!_0x3c63af['query'][_0xcbb2('0x40')](_0xcbb2('0x41'))){_0x4b9edc[_0xcbb2('0x24')]=qs[_0xcbb2('0x24')](_0x3c63af[_0xcbb2('0x39')][_0xcbb2('0x24')]);_0x4b9edc[_0xcbb2('0x26')]=qs['offset'](_0x3c63af[_0xcbb2('0x39')][_0xcbb2('0x26')]);}_0x4b9edc[_0xcbb2('0x42')]=qs[_0xcbb2('0x43')](_0x3c63af[_0xcbb2('0x39')][_0xcbb2('0x43')]);_0x4b9edc[_0xcbb2('0x44')]=qs[_0xcbb2('0x3b')](_[_0xcbb2('0x45')](_0x3c63af['query'],_0x84d358[_0xcbb2('0x3b')]),_0x436d78);if(_0x3c63af['query'][_0xcbb2('0x46')]){_0x4b9edc[_0xcbb2('0x44')]=_[_0xcbb2('0x47')](_0x4b9edc[_0xcbb2('0x44')],{'$or':_[_0xcbb2('0x38')](_0x436d78,function(_0x19f8b2){if(_0x19f8b2[_0xcbb2('0x36')]!==_0xcbb2('0x48')){var _0xbb0218={};_0xbb0218[_0x19f8b2['name']]={'$like':'%'+_0x3c63af[_0xcbb2('0x39')]['filter']+'%'};return _0xbb0218;}})});}_0x4b9edc=_[_0xcbb2('0x47')]({},_0x4b9edc,_0x3c63af[_0xcbb2('0x49')]);var _0x288ccc={'where':_0x4b9edc[_0xcbb2('0x44')]};return db[_0xcbb2('0x33')][_0xcbb2('0x25')](_0x288ccc)[_0xcbb2('0x2e')](function(_0x36cc45){_0x37500e['count']=_0x36cc45;if(_0x3c63af[_0xcbb2('0x39')][_0xcbb2('0x4a')]){_0x4b9edc[_0xcbb2('0x4b')]=[{'all':!![]}];}return db[_0xcbb2('0x33')][_0xcbb2('0x4c')](_0x4b9edc);})[_0xcbb2('0x2e')](function(_0x44a040){_0x37500e[_0xcbb2('0x4d')]=_0x44a040;return _0x37500e;})[_0xcbb2('0x2e')](respondWithFilteredResult(_0xe2e2ec,_0x4b9edc))[_0xcbb2('0x4e')](handleError(_0xe2e2ec,null));};exports[_0xcbb2('0x4f')]=function(_0x51f3e5,_0x5003d4){var _0x4d4027={'raw':!![],'where':{'id':_0x51f3e5['params']['id']}},_0x13f4d4={};_0x13f4d4[_0xcbb2('0x3d')]=_['keys'](db['ChatInternalMessage'][_0xcbb2('0x34')]);_0x13f4d4[_0xcbb2('0x39')]=_[_0xcbb2('0x3a')](_0x51f3e5[_0xcbb2('0x39')]);_0x13f4d4[_0xcbb2('0x3b')]=_[_0xcbb2('0x3c')](_0x13f4d4[_0xcbb2('0x3d')],_0x13f4d4[_0xcbb2('0x39')]);_0x4d4027[_0xcbb2('0x3e')]=_[_0xcbb2('0x3c')](_0x13f4d4[_0xcbb2('0x3d')],qs['fields'](_0x51f3e5[_0xcbb2('0x39')]['fields']));_0x4d4027[_0xcbb2('0x3e')]=_0x4d4027[_0xcbb2('0x3e')][_0xcbb2('0x3f')]?_0x4d4027[_0xcbb2('0x3e')]:_0x13f4d4[_0xcbb2('0x3d')];if(_0x51f3e5[_0xcbb2('0x39')]['includeAll']){_0x4d4027['include']=[{'all':!![]}];}_0x4d4027=_[_0xcbb2('0x47')]({},_0x4d4027,_0x51f3e5[_0xcbb2('0x49')]);return db[_0xcbb2('0x33')][_0xcbb2('0x50')](_0x4d4027)[_0xcbb2('0x2e')](handleEntityNotFound(_0x5003d4,null))[_0xcbb2('0x2e')](respondWithResult(_0x5003d4,null))['catch'](handleError(_0x5003d4,null));};exports[_0xcbb2('0x51')]=function(_0x9ebd19,_0x4313de){return db[_0xcbb2('0x33')]['create'](_0x9ebd19['body'],{})['then'](respondWithResult(_0x4313de,0xc9))[_0xcbb2('0x4e')](handleError(_0x4313de,null));};exports[_0xcbb2('0x2c')]=function(_0x19d318,_0x5d2060){if(_0x19d318['body']['id']){delete _0x19d318[_0xcbb2('0x52')]['id'];}return db[_0xcbb2('0x33')]['find']({'where':{'id':_0x19d318[_0xcbb2('0x53')]['id']}})[_0xcbb2('0x2e')](handleEntityNotFound(_0x5d2060,null))[_0xcbb2('0x2e')](saveUpdates(_0x19d318['body'],null))[_0xcbb2('0x2e')](respondWithResult(_0x5d2060,null))[_0xcbb2('0x4e')](handleError(_0x5d2060,null));};exports[_0xcbb2('0x2d')]=function(_0x1476a7,_0x1aee05){return db[_0xcbb2('0x33')][_0xcbb2('0x50')]({'where':{'id':_0x1476a7['params']['id']}})[_0xcbb2('0x2e')](handleEntityNotFound(_0x1aee05,null))[_0xcbb2('0x2e')](removeEntity(_0x1aee05,null))['catch'](handleError(_0x1aee05,null));};exports[_0xcbb2('0x54')]=function(_0xe8aca1,_0x219ddf){return db[_0xcbb2('0x33')][_0xcbb2('0x54')]()[_0xcbb2('0x2e')](respondWithResult(_0x219ddf,null))[_0xcbb2('0x4e')](handleError(_0x219ddf,null));};function wrapUser(_0x5766fb){return function(_0x11ea48){var _0xd71e1f=_0x5766fb[_0xcbb2('0x55')]({'plain':!![]});_0xd71e1f[_0xcbb2('0x56')]=[];if(_0x11ea48){_0xd71e1f[_0xcbb2('0x57')]=_0x11ea48['createdAt'];_0xd71e1f['lastMessage']=_0x11ea48;}else{_0xd71e1f[_0xcbb2('0x57')]=moment(0x0)[_0xcbb2('0x58')](_0xcbb2('0x59'));_0xd71e1f[_0xcbb2('0x5a')]={};}return _0xd71e1f;};}exports[_0xcbb2('0x5b')]=function(_0x46dcad,_0x54ac65,_0x1fe190){var _0x4c2828=[];return db['User'][_0xcbb2('0x4c')]({'where':{'role':[_0xcbb2('0x5c'),_0xcbb2('0x5d'),_0xcbb2('0x5e')]},'attributes':['id',_0xcbb2('0x5f'),_0xcbb2('0x30'),_0xcbb2('0x60'),'userpic',_0xcbb2('0x61'),_0xcbb2('0x62'),_0xcbb2('0x63'),'allowmessenger',_0xcbb2('0x64')],'order':qs[_0xcbb2('0x43')]('-online'),'include':[{'model':db[_0xcbb2('0x65')],'as':_0xcbb2('0x66'),'attributes':['id',_0xcbb2('0x30'),_0xcbb2('0x36')],'through':{'attributes':[]}}]})[_0xcbb2('0x2e')](function(_0x261b55){if(_0x261b55){var _0x1cbaa8=_0x46dcad[_0xcbb2('0x5e')][_0xcbb2('0x55')]({'plain':!![]});if(!_0x1cbaa8)throw new Error(_0xcbb2('0x67'));if(_0x1cbaa8[_0xcbb2('0x60')]===_0xcbb2('0x5e')){return db[_0xcbb2('0x68')][_0xcbb2('0x50')]({'where':{'name':'Agents','userProfileId':_0x1cbaa8[_0xcbb2('0x69')]},'raw':!![]})[_0xcbb2('0x2e')](function(_0x382f06){if(_0x382f06){if(_0x382f06[_0xcbb2('0x6a')]===0x0){return db[_0xcbb2('0x6b')][_0xcbb2('0x4c')]({'where':{'sectionId':_0x382f06['id']},'raw':!![]})[_0xcbb2('0x2e')](function(_0x1d9b50){var _0x224856=[];if(_[_0xcbb2('0x6c')](_0x1d9b50)){_0x224856=_[_0xcbb2('0x46')](_0x261b55,function(_0x1fd369){if(_0x1fd369[_0xcbb2('0x60')]!==_0xcbb2('0x5c')){return _0x1fd369;}});return _0x224856;}else{for(var _0x31be1c=0x0;_0x31be1c<_0x261b55[_0xcbb2('0x3f')];_0x31be1c++){var _0x37194b=_0x261b55[_0x31be1c];if(_0x37194b[_0xcbb2('0x60')]===_0xcbb2('0x5c')){var _0x3ad9a1=_[_0xcbb2('0x50')](_0x1d9b50,function(_0x4611ea){return _0x4611ea[_0xcbb2('0x6d')]===_0x37194b['id'];});if(_0x3ad9a1)_0x224856[_0xcbb2('0x6e')](_0x37194b);}else{_0x224856[_0xcbb2('0x6e')](_0x37194b);}}return _0x224856;}});}else{return _0x261b55;}}else{var _0x1ed524=_[_0xcbb2('0x46')](_0x261b55,function(_0x24b0a5){if(_0x24b0a5[_0xcbb2('0x60')]!==_0xcbb2('0x5c')){return _0x24b0a5;}});return _0x1ed524;}});}else{return _0x261b55;}}})[_0xcbb2('0x2e')](function(_0x3771bb){var _0x4b305a=[];if(_0x3771bb){_0x4c2828=_0x3771bb;for(var _0x19f3a9=0x0;_0x19f3a9<_0x3771bb['length'];_0x19f3a9+=0x1){_0x4c2828[_0x19f3a9][_0xcbb2('0x56')]=[];_0x4b305a[_0xcbb2('0x6e')](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x46dcad[_0xcbb2('0x5e')]['id'],_0x3771bb[_0x19f3a9]['id']],'ToId':[_0x46dcad['user']['id'],_0x3771bb[_0x19f3a9]['id']],'ChatGroupId':null},'attributes':['id',_0xcbb2('0x6f'),'FromId',_0xcbb2('0x70'),'read',_0xcbb2('0x52')],'order':qs[_0xcbb2('0x43')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xcbb2('0x2e')](wrapUser(_0x3771bb[_0x19f3a9])));}return BPromise[_0xcbb2('0x71')](_0x4b305a);}return[];})[_0xcbb2('0x2e')](function(_0xd55b44){return{'rows':_0xd55b44,'count':_0xd55b44['length']};})['then'](respondWithResult(_0x54ac65,null))[_0xcbb2('0x4e')](handleError(_0x54ac65,null));};
\ No newline at end of file
+var _0x8ebe=['ToId','read','-createdAt','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','redis','localhost','./chatInternalMessage.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','ChatInternalMessage','findAll','catch','show','params','include','find','create','body','describe','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','role','internal','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','autoAssociation','UserProfileResource','resourceId','push','messages','FromId'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8ebe,0x144));var _0xe8eb=function(_0x2e8775,_0x310049){_0x2e8775=_0x2e8775-0x0;var _0x4cbf35=_0x8ebe[_0x2e8775];return _0x4cbf35;};'use strict';var emlformat=require(_0xe8eb('0x0'));var rimraf=require(_0xe8eb('0x1'));var zipdir=require(_0xe8eb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe8eb('0x3'));var moment=require(_0xe8eb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe8eb('0x5'));var util=require('util');var path=require(_0xe8eb('0x6'));var sox=require('sox');var csv=require(_0xe8eb('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8eb('0x8'));var _=require(_0xe8eb('0x9'));var squel=require('squel');var crypto=require(_0xe8eb('0xa'));var jsforce=require(_0xe8eb('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe8eb('0xc'));var Papa=require(_0xe8eb('0xd'));var Redis=require(_0xe8eb('0xe'));var authService=require(_0xe8eb('0xf'));var qs=require(_0xe8eb('0x10'));var as=require(_0xe8eb('0x11'));var hardwareService=require(_0xe8eb('0x12'));var logger=require('../../config/logger')(_0xe8eb('0x13'));var utils=require(_0xe8eb('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xe8eb('0x15')]=_['defaults'](config[_0xe8eb('0x15')],{'host':_0xe8eb('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe8eb('0x17'))[_0xe8eb('0x18')](socket);function respondWithStatusCode(_0x21f5a4,_0x46ebfe){_0x46ebfe=_0x46ebfe||0xcc;return function(_0x5b7325){if(_0x5b7325){return _0x21f5a4[_0xe8eb('0x19')](_0x46ebfe);}return _0x21f5a4[_0xe8eb('0x1a')](_0x46ebfe)['end']();};}function respondWithResult(_0x1d4b70,_0xa8deef){_0xa8deef=_0xa8deef||0xc8;return function(_0x8a43eb){if(_0x8a43eb){return _0x1d4b70[_0xe8eb('0x1a')](_0xa8deef)[_0xe8eb('0x1b')](_0x8a43eb);}};}function respondWithFilteredResult(_0x504b52,_0x2ae0d5){return function(_0x5b6cba){if(_0x5b6cba){var _0x3cb7e8=typeof _0x2ae0d5[_0xe8eb('0x1c')]==='undefined'&&typeof _0x2ae0d5[_0xe8eb('0x1d')]===_0xe8eb('0x1e');var _0x130438=_0x5b6cba[_0xe8eb('0x1f')];var _0x1fe21d=_0x3cb7e8?0x0:_0x2ae0d5['offset'];var _0x2b5362=_0x3cb7e8?_0x5b6cba[_0xe8eb('0x1f')]:_0x2ae0d5[_0xe8eb('0x1c')]+_0x2ae0d5[_0xe8eb('0x1d')];var _0x6dd770;if(_0x2b5362>=_0x130438){_0x2b5362=_0x130438;_0x6dd770=0xc8;}else{_0x6dd770=0xce;}_0x504b52['status'](_0x6dd770);return _0x504b52[_0xe8eb('0x20')](_0xe8eb('0x21'),_0x1fe21d+'-'+_0x2b5362+'/'+_0x130438)['json'](_0x5b6cba);}return null;};}function patchUpdates(_0x4d5b23){return function(_0x1ea5cc){try{jsonpatch['apply'](_0x1ea5cc,_0x4d5b23,!![]);}catch(_0x530929){return BPromise[_0xe8eb('0x22')](_0x530929);}return _0x1ea5cc[_0xe8eb('0x23')]();};}function saveUpdates(_0x3505e6,_0x4b01fb){return function(_0x5dd990){if(_0x5dd990){return _0x5dd990[_0xe8eb('0x24')](_0x3505e6)[_0xe8eb('0x25')](function(_0x427273){return _0x427273;});}return null;};}function removeEntity(_0x120dbd,_0x418a62){return function(_0x2bc08f){if(_0x2bc08f){return _0x2bc08f[_0xe8eb('0x26')]()[_0xe8eb('0x25')](function(){_0x120dbd[_0xe8eb('0x1a')](0xcc)[_0xe8eb('0x27')]();});}};}function handleEntityNotFound(_0x5e0eb9,_0x28bbff){return function(_0x8c1005){if(!_0x8c1005){_0x5e0eb9[_0xe8eb('0x19')](0x194);}return _0x8c1005;};}function handleError(_0x59fa5a,_0x38269f){_0x38269f=_0x38269f||0x1f4;return function(_0x480a88){logger[_0xe8eb('0x28')](_0x480a88[_0xe8eb('0x29')]);if(_0x480a88[_0xe8eb('0x2a')]){delete _0x480a88[_0xe8eb('0x2a')];}_0x59fa5a['status'](_0x38269f)[_0xe8eb('0x2b')](_0x480a88);};}exports[_0xe8eb('0x2c')]=function(_0x48f659,_0x365a6a){var _0x44daf1={},_0x38c645={},_0x52cfeb={'count':0x0,'rows':[]};var _0x3e634d=_[_0xe8eb('0x2d')](db['ChatInternalMessage'][_0xe8eb('0x2e')],function(_0x4c3b0c){return{'name':_0x4c3b0c[_0xe8eb('0x2f')],'type':_0x4c3b0c[_0xe8eb('0x30')][_0xe8eb('0x31')]};});_0x38c645['model']=_[_0xe8eb('0x2d')](_0x3e634d,'name');_0x38c645[_0xe8eb('0x32')]=_[_0xe8eb('0x33')](_0x48f659[_0xe8eb('0x32')]);_0x38c645[_0xe8eb('0x34')]=_[_0xe8eb('0x35')](_0x38c645['model'],_0x38c645[_0xe8eb('0x32')]);_0x44daf1['attributes']=_[_0xe8eb('0x35')](_0x38c645[_0xe8eb('0x36')],qs[_0xe8eb('0x37')](_0x48f659[_0xe8eb('0x32')][_0xe8eb('0x37')]));_0x44daf1[_0xe8eb('0x38')]=_0x44daf1[_0xe8eb('0x38')][_0xe8eb('0x39')]?_0x44daf1[_0xe8eb('0x38')]:_0x38c645['model'];if(!_0x48f659[_0xe8eb('0x32')]['hasOwnProperty'](_0xe8eb('0x3a'))){_0x44daf1['limit']=qs[_0xe8eb('0x1d')](_0x48f659[_0xe8eb('0x32')][_0xe8eb('0x1d')]);_0x44daf1[_0xe8eb('0x1c')]=qs[_0xe8eb('0x1c')](_0x48f659[_0xe8eb('0x32')]['offset']);}_0x44daf1[_0xe8eb('0x3b')]=qs[_0xe8eb('0x3c')](_0x48f659['query'][_0xe8eb('0x3c')]);_0x44daf1[_0xe8eb('0x3d')]=qs[_0xe8eb('0x34')](_[_0xe8eb('0x3e')](_0x48f659[_0xe8eb('0x32')],_0x38c645[_0xe8eb('0x34')]),_0x3e634d);if(_0x48f659[_0xe8eb('0x32')][_0xe8eb('0x3f')]){_0x44daf1[_0xe8eb('0x3d')]=_[_0xe8eb('0x40')](_0x44daf1[_0xe8eb('0x3d')],{'$or':_['map'](_0x3e634d,function(_0x10331a){if(_0x10331a[_0xe8eb('0x30')]!=='VIRTUAL'){var _0x61f325={};_0x61f325[_0x10331a['name']]={'$like':'%'+_0x48f659['query'][_0xe8eb('0x3f')]+'%'};return _0x61f325;}})});}_0x44daf1=_['merge']({},_0x44daf1,_0x48f659[_0xe8eb('0x41')]);var _0x394c91={'where':_0x44daf1[_0xe8eb('0x3d')]};return db['ChatInternalMessage'][_0xe8eb('0x1f')](_0x394c91)[_0xe8eb('0x25')](function(_0x25f8df){_0x52cfeb[_0xe8eb('0x1f')]=_0x25f8df;if(_0x48f659[_0xe8eb('0x32')][_0xe8eb('0x42')]){_0x44daf1['include']=[{'all':!![]}];}return db[_0xe8eb('0x43')][_0xe8eb('0x44')](_0x44daf1);})[_0xe8eb('0x25')](function(_0xa18d52){_0x52cfeb['rows']=_0xa18d52;return _0x52cfeb;})['then'](respondWithFilteredResult(_0x365a6a,_0x44daf1))[_0xe8eb('0x45')](handleError(_0x365a6a,null));};exports[_0xe8eb('0x46')]=function(_0x3f803c,_0x40e249){var _0x31c81e={'raw':!![],'where':{'id':_0x3f803c[_0xe8eb('0x47')]['id']}},_0x170678={};_0x170678[_0xe8eb('0x36')]=_[_0xe8eb('0x33')](db[_0xe8eb('0x43')][_0xe8eb('0x2e')]);_0x170678[_0xe8eb('0x32')]=_[_0xe8eb('0x33')](_0x3f803c['query']);_0x170678[_0xe8eb('0x34')]=_[_0xe8eb('0x35')](_0x170678[_0xe8eb('0x36')],_0x170678[_0xe8eb('0x32')]);_0x31c81e['attributes']=_['intersection'](_0x170678['model'],qs[_0xe8eb('0x37')](_0x3f803c[_0xe8eb('0x32')][_0xe8eb('0x37')]));_0x31c81e['attributes']=_0x31c81e[_0xe8eb('0x38')]['length']?_0x31c81e['attributes']:_0x170678[_0xe8eb('0x36')];if(_0x3f803c[_0xe8eb('0x32')][_0xe8eb('0x42')]){_0x31c81e[_0xe8eb('0x48')]=[{'all':!![]}];}_0x31c81e=_[_0xe8eb('0x40')]({},_0x31c81e,_0x3f803c[_0xe8eb('0x41')]);return db['ChatInternalMessage'][_0xe8eb('0x49')](_0x31c81e)['then'](handleEntityNotFound(_0x40e249,null))['then'](respondWithResult(_0x40e249,null))['catch'](handleError(_0x40e249,null));};exports[_0xe8eb('0x4a')]=function(_0x296432,_0x146176){return db[_0xe8eb('0x43')][_0xe8eb('0x4a')](_0x296432[_0xe8eb('0x4b')],{})[_0xe8eb('0x25')](respondWithResult(_0x146176,0xc9))[_0xe8eb('0x45')](handleError(_0x146176,null));};exports[_0xe8eb('0x24')]=function(_0x31677f,_0x5539d1){if(_0x31677f[_0xe8eb('0x4b')]['id']){delete _0x31677f['body']['id'];}return db[_0xe8eb('0x43')][_0xe8eb('0x49')]({'where':{'id':_0x31677f[_0xe8eb('0x47')]['id']}})[_0xe8eb('0x25')](handleEntityNotFound(_0x5539d1,null))[_0xe8eb('0x25')](saveUpdates(_0x31677f['body'],null))[_0xe8eb('0x25')](respondWithResult(_0x5539d1,null))[_0xe8eb('0x45')](handleError(_0x5539d1,null));};exports[_0xe8eb('0x26')]=function(_0x284922,_0x5a1861){return db[_0xe8eb('0x43')][_0xe8eb('0x49')]({'where':{'id':_0x284922[_0xe8eb('0x47')]['id']}})[_0xe8eb('0x25')](handleEntityNotFound(_0x5a1861,null))[_0xe8eb('0x25')](removeEntity(_0x5a1861,null))[_0xe8eb('0x45')](handleError(_0x5a1861,null));};exports[_0xe8eb('0x4c')]=function(_0x5a365a,_0x26e610){return db[_0xe8eb('0x43')][_0xe8eb('0x4c')]()['then'](respondWithResult(_0x26e610,null))['catch'](handleError(_0x26e610,null));};function wrapUser(_0xa1fe58){return function(_0x515db8){var _0x2e88b5=_0xa1fe58['get']({'plain':!![]});_0x2e88b5['messages']=[];if(_0x515db8){_0x2e88b5['lastMessageAt']=_0x515db8[_0xe8eb('0x4d')];_0x2e88b5[_0xe8eb('0x4e')]=_0x515db8;}else{_0x2e88b5[_0xe8eb('0x4f')]=moment(0x0)[_0xe8eb('0x50')](_0xe8eb('0x51'));_0x2e88b5[_0xe8eb('0x4e')]={};}return _0x2e88b5;};}exports[_0xe8eb('0x52')]=function(_0x1692eb,_0x10f95c,_0x4c2cf6){var _0x432185=[];return db[_0xe8eb('0x53')][_0xe8eb('0x44')]({'where':{'role':[_0xe8eb('0x54'),_0xe8eb('0x55'),'user']},'attributes':['id','fullname',_0xe8eb('0x2a'),_0xe8eb('0x56'),'userpic',_0xe8eb('0x57'),_0xe8eb('0x58'),_0xe8eb('0x59'),_0xe8eb('0x5a'),_0xe8eb('0x5b')],'order':qs['sort']('-online'),'include':[{'model':db[_0xe8eb('0x5c')],'as':'VoiceQueues','attributes':['id',_0xe8eb('0x2a'),_0xe8eb('0x30')],'through':{'attributes':[]}}]})[_0xe8eb('0x25')](function(_0xfd9865){if(_0xfd9865){var _0x5c441c=_0x1692eb[_0xe8eb('0x5d')][_0xe8eb('0x5e')]({'plain':!![]});if(!_0x5c441c)throw new Error(_0xe8eb('0x5f'));if(_0x5c441c['role']==='user'){return db['UserProfileSection'][_0xe8eb('0x49')]({'where':{'name':_0xe8eb('0x60'),'userProfileId':_0x5c441c[_0xe8eb('0x61')]},'raw':!![]})['then'](function(_0x57c8d7){if(_0x57c8d7){if(_0x57c8d7[_0xe8eb('0x62')]===0x0){return db[_0xe8eb('0x63')][_0xe8eb('0x44')]({'where':{'sectionId':_0x57c8d7['id']},'raw':!![]})[_0xe8eb('0x25')](function(_0x4e59c6){var _0x100d3c=[];if(_['isEmpty'](_0x4e59c6)){_0x100d3c=_[_0xe8eb('0x3f')](_0xfd9865,function(_0x13f6f7){if(_0x13f6f7[_0xe8eb('0x56')]!==_0xe8eb('0x54')){return _0x13f6f7;}});return _0x100d3c;}else{for(var _0x2f0f3e=0x0;_0x2f0f3e<_0xfd9865[_0xe8eb('0x39')];_0x2f0f3e++){var _0x568aa4=_0xfd9865[_0x2f0f3e];if(_0x568aa4[_0xe8eb('0x56')]==='agent'){var _0x2713a6=_[_0xe8eb('0x49')](_0x4e59c6,function(_0x4606ee){return _0x4606ee[_0xe8eb('0x64')]===_0x568aa4['id'];});if(_0x2713a6)_0x100d3c['push'](_0x568aa4);}else{_0x100d3c[_0xe8eb('0x65')](_0x568aa4);}}return _0x100d3c;}});}else{return _0xfd9865;}}else{var _0x1cc63c=_[_0xe8eb('0x3f')](_0xfd9865,function(_0x297039){if(_0x297039[_0xe8eb('0x56')]!==_0xe8eb('0x54')){return _0x297039;}});return _0x1cc63c;}});}else{return _0xfd9865;}}})[_0xe8eb('0x25')](function(_0xdaa1ba){var _0x1d902b=[];if(_0xdaa1ba){_0x432185=_0xdaa1ba;for(var _0x2e4c2b=0x0;_0x2e4c2b<_0xdaa1ba['length'];_0x2e4c2b+=0x1){_0x432185[_0x2e4c2b][_0xe8eb('0x66')]=[];_0x1d902b[_0xe8eb('0x65')](db['ChatInternalMessage'][_0xe8eb('0x49')]({'where':{'FromId':[_0x1692eb[_0xe8eb('0x5d')]['id'],_0xdaa1ba[_0x2e4c2b]['id']],'ToId':[_0x1692eb[_0xe8eb('0x5d')]['id'],_0xdaa1ba[_0x2e4c2b]['id']],'ChatGroupId':null},'attributes':['id',_0xe8eb('0x4d'),_0xe8eb('0x67'),_0xe8eb('0x68'),_0xe8eb('0x69'),_0xe8eb('0x4b')],'order':qs[_0xe8eb('0x3c')](_0xe8eb('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xe8eb('0x25')](wrapUser(_0xdaa1ba[_0x2e4c2b])));}return BPromise['all'](_0x1d902b);}return[];})[_0xe8eb('0x25')](function(_0x40c2c2){return{'rows':_0x40c2c2,'count':_0x40c2c2['length']};})['then'](respondWithResult(_0x10f95c,null))['catch'](handleError(_0x10f95c,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index b4642a1..890f712 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 _0x9ef5=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','ChatInternalMessage'];(function(_0x38a54d,_0x132fde){var _0x2d1b0e=function(_0x11cac8){while(--_0x11cac8){_0x38a54d['push'](_0x38a54d['shift']());}};_0x2d1b0e(++_0x132fde);}(_0x9ef5,0x1a7));var _0x59ef=function(_0x15cdcb,_0x4340e9){_0x15cdcb=_0x15cdcb-0x0;var _0x37b069=_0x9ef5[_0x15cdcb];return _0x37b069;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0x59ef('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x59ef('0x1')](0x0);var events={'afterCreate':_0x59ef('0x2'),'afterUpdate':_0x59ef('0x3'),'afterDestroy':_0x59ef('0x4')};function emitEvent(_0x34be92){return function(_0x376e24,_0xe08bea,_0x58e0cc){ChatInternalMessageEvents[_0x59ef('0x5')](_0x34be92+':'+_0x376e24['id'],_0x376e24);ChatInternalMessageEvents[_0x59ef('0x5')](_0x34be92,_0x376e24);_0x58e0cc(null);};}for(var e in events){if(events[_0x59ef('0x6')](e)){var event=events[e];ChatInternalMessage[_0x59ef('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x68a5=['events','ChatInternalMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x25aed1,_0x169850){var _0x53378c=function(_0x1aa8f7){while(--_0x1aa8f7){_0x25aed1['push'](_0x25aed1['shift']());}};_0x53378c(++_0x169850);}(_0x68a5,0xfc));var _0x568a=function(_0x2d7471,_0x4ba3ef){_0x2d7471=_0x2d7471-0x0;var _0x534f65=_0x68a5[_0x2d7471];return _0x534f65;};'use strict';var EventEmitter=require(_0x568a('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x568a('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x568a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x568a('0x3'),'afterDestroy':_0x568a('0x4')};function emitEvent(_0x2f3a02){return function(_0x2d4dce,_0x53dca3,_0xac8b08){ChatInternalMessageEvents['emit'](_0x2f3a02+':'+_0x2d4dce['id'],_0x2d4dce);ChatInternalMessageEvents[_0x568a('0x5')](_0x2f3a02,_0x2d4dce);_0xac8b08(null);};}for(var e in events){if(events[_0x568a('0x6')](e)){var event=events[e];ChatInternalMessage[_0x568a('0x7')](e,emitEvent(event));}}module[_0x568a('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 66c2a4d..3b7a31b 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 _0xb1cd=['../../config/logger','api','rimraf','../../config/environment','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xb1cd,0x1ae));var _0xdb1c=function(_0x469a16,_0x14f570){_0x469a16=_0x469a16-0x0;var _0x4785ab=_0xb1cd[_0x469a16];return _0x4785ab;};'use strict';var _=require(_0xdb1c('0x0'));var util=require(_0xdb1c('0x1'));var logger=require(_0xdb1c('0x2'))(_0xdb1c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdb1c('0x4'));var config=require(_0xdb1c('0x5'));var attributes=require('./chatInternalMessage.attributes');module[_0xdb1c('0x6')]=function(_0x47eab7,_0xdbe486){return _0x47eab7[_0xdb1c('0x7')](_0xdb1c('0x8'),attributes,{'tableName':_0xdb1c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdb1c('0xa'),'collate':_0xdb1c('0xb')});};
\ No newline at end of file
+var _0x9d69=['exports','define','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','rimraf','./chatInternalMessage.attributes'];(function(_0x1597e2,_0x388d3e){var _0x4c8c0a=function(_0x3d4795){while(--_0x3d4795){_0x1597e2['push'](_0x1597e2['shift']());}};_0x4c8c0a(++_0x388d3e);}(_0x9d69,0x94));var _0x99d6=function(_0x3b17e4,_0x33a283){_0x3b17e4=_0x3b17e4-0x0;var _0x3f035f=_0x9d69[_0x3b17e4];return _0x3f035f;};'use strict';var _=require(_0x99d6('0x0'));var util=require(_0x99d6('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x99d6('0x2'));var BPromise=require(_0x99d6('0x3'));var rp=require(_0x99d6('0x4'));var fs=require('fs');var path=require(_0x99d6('0x5'));var rimraf=require(_0x99d6('0x6'));var config=require('../../config/environment');var attributes=require(_0x99d6('0x7'));module[_0x99d6('0x8')]=function(_0x5c837f,_0x5bfd39){return _0x5c837f[_0x99d6('0x9')]('ChatInternalMessage',attributes,{'tableName':_0x99d6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x99d6('0xb'),'collate':_0x99d6('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 2231aa4..06450d7 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 _0x145a=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','result','message','catch'];(function(_0x45aa4d,_0x2ac498){var _0x3dfbfd=function(_0x3b2d1e){while(--_0x3b2d1e){_0x45aa4d['push'](_0x45aa4d['shift']());}};_0x3dfbfd(++_0x2ac498);}(_0x145a,0x100));var _0xa145=function(_0x121f08,_0x230354){_0x121f08=_0x121f08-0x0;var _0x3a97d9=_0x145a[_0x121f08];return _0x3a97d9;};'use strict';var _=require(_0xa145('0x0'));var util=require(_0xa145('0x1'));var moment=require(_0xa145('0x2'));var BPromise=require(_0xa145('0x3'));var rs=require(_0xa145('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa145('0x5'))['db'];var utils=require(_0xa145('0x6'));var logger=require(_0xa145('0x7'))(_0xa145('0x8'));var config=require(_0xa145('0x9'));var jayson=require(_0xa145('0xa'));var client=jayson[_0xa145('0xb')][_0xa145('0xc')]({'port':0x232a});config['redis']=_[_0xa145('0xd')](config[_0xa145('0xe')],{'host':_0xa145('0xf'),'port':0x18eb});var socket=require(_0xa145('0x10'))(new Redis(config[_0xa145('0xe')]));require(_0xa145('0x11'))[_0xa145('0x12')](socket);function respondWithRpcPromise(_0xe6f304,_0x2fe332,_0x50a11f){return new BPromise(function(_0x59f71d,_0x4fccfa){return client[_0xa145('0x13')](_0xe6f304,_0x50a11f)[_0xa145('0x14')](function(_0x1e91ce){logger[_0xa145('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x2fe332,'request\x20sent');logger[_0xa145('0x16')](_0xa145('0x17'),_0x2fe332,_0xa145('0x18'),JSON[_0xa145('0x19')](_0x1e91ce));if(_0x1e91ce['error']){if(_0x1e91ce[_0xa145('0x1a')][_0xa145('0x1b')]===0x1f4){logger[_0xa145('0x1a')](_0xa145('0x1c'),_0x2fe332,_0x1e91ce[_0xa145('0x1a')]['message']);return _0x4fccfa(_0x1e91ce[_0xa145('0x1a')]['message']);}logger[_0xa145('0x1a')](_0xa145('0x1c'),_0x2fe332,_0x1e91ce[_0xa145('0x1a')]['message']);return _0x59f71d(_0x1e91ce[_0xa145('0x1a')]['message']);}else{logger[_0xa145('0x15')](_0xa145('0x1c'),_0x2fe332,_0xa145('0x18'));_0x59f71d(_0x1e91ce[_0xa145('0x1d')][_0xa145('0x1e')]);}})[_0xa145('0x1f')](function(_0x207cc1){logger[_0xa145('0x1a')](_0xa145('0x1c'),_0x2fe332,_0x207cc1);_0x4fccfa(_0x207cc1);});});}
\ No newline at end of file
+var _0xcd9e=['socket.io-emitter','register','info','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','ChatInternalMessage,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xcd9e,0x6e));var _0xecd9=function(_0x3205c7,_0x2709f4){_0x3205c7=_0x3205c7-0x0;var _0xdab1cd=_0xcd9e[_0x3205c7];return _0xdab1cd;};'use strict';var _=require(_0xecd9('0x0'));var util=require(_0xecd9('0x1'));var moment=require(_0xecd9('0x2'));var BPromise=require(_0xecd9('0x3'));var rs=require(_0xecd9('0x4'));var fs=require('fs');var Redis=require(_0xecd9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xecd9('0x6'));var logger=require(_0xecd9('0x7'))('rpc');var config=require(_0xecd9('0x8'));var jayson=require(_0xecd9('0x9'));var client=jayson[_0xecd9('0xa')][_0xecd9('0xb')]({'port':0x232a});config[_0xecd9('0xc')]=_[_0xecd9('0xd')](config[_0xecd9('0xc')],{'host':_0xecd9('0xe'),'port':0x18eb});var socket=require(_0xecd9('0xf'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0xecd9('0x10')](socket);function respondWithRpcPromise(_0xc8c23b,_0x2460f9,_0x5cb959){return new BPromise(function(_0x51567c,_0x5b2924){return client['request'](_0xc8c23b,_0x5cb959)['then'](function(_0x4b831c){logger[_0xecd9('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x2460f9,'request\x20sent');logger[_0xecd9('0x12')](_0xecd9('0x13'),_0x2460f9,_0xecd9('0x14'),JSON['stringify'](_0x4b831c));if(_0x4b831c[_0xecd9('0x15')]){if(_0x4b831c['error']['code']===0x1f4){logger[_0xecd9('0x15')](_0xecd9('0x16'),_0x2460f9,_0x4b831c[_0xecd9('0x15')]['message']);return _0x5b2924(_0x4b831c['error']['message']);}logger[_0xecd9('0x15')](_0xecd9('0x16'),_0x2460f9,_0x4b831c[_0xecd9('0x15')]['message']);return _0x51567c(_0x4b831c[_0xecd9('0x15')][_0xecd9('0x17')]);}else{logger[_0xecd9('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x2460f9,_0xecd9('0x14'));_0x51567c(_0x4b831c[_0xecd9('0x18')][_0xecd9('0x17')]);}})['catch'](function(_0x28360a){logger[_0xecd9('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x2460f9,_0x28360a);_0x5b2924(_0x28360a);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 5e475c2..31e5526 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 _0x4166=['update','emit','register','length','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x1e0e84,_0x41f33d){var _0x2d24a4=function(_0x2a2ac3){while(--_0x2a2ac3){_0x1e0e84['push'](_0x1e0e84['shift']());}};_0x2d24a4(++_0x41f33d);}(_0x4166,0x91));var _0x6416=function(_0x1bbdc0,_0x1d9d11){_0x1bbdc0=_0x1bbdc0-0x0;var _0x5da71c=_0x4166[_0x1bbdc0];return _0x5da71c;};'use strict';var ChatInternalMessageEvents=require(_0x6416('0x0'));var events=[_0x6416('0x1'),'remove',_0x6416('0x2')];function createListener(_0x9963c7,_0x25fc76){return function(_0xe5a878){_0x25fc76[_0x6416('0x3')](_0x9963c7,_0xe5a878);};}function removeListener(_0x53fb40,_0x18c246){return function(){ChatInternalMessageEvents['removeListener'](_0x53fb40,_0x18c246);};}exports[_0x6416('0x4')]=function(_0x4254b4){for(var _0x15d95a=0x0,_0x4b8bd3=events[_0x6416('0x5')];_0x15d95a<_0x4b8bd3;_0x15d95a++){var _0xf336fe=events[_0x15d95a];var _0x3af086=createListener(_0x6416('0x6')+_0xf336fe,_0x4254b4);ChatInternalMessageEvents['on'](_0xf336fe,_0x3af086);}};
\ No newline at end of file
+var _0x5cb5=['save','update','emit','register','length','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x3acee8,_0x5f3924){var _0x5046cc=function(_0x338def){while(--_0x338def){_0x3acee8['push'](_0x3acee8['shift']());}};_0x5046cc(++_0x5f3924);}(_0x5cb5,0x68));var _0x55cb=function(_0x48a24a,_0x3cb63c){_0x48a24a=_0x48a24a-0x0;var _0x5e35d8=_0x5cb5[_0x48a24a];return _0x5e35d8;};'use strict';var ChatInternalMessageEvents=require(_0x55cb('0x0'));var events=[_0x55cb('0x1'),'remove',_0x55cb('0x2')];function createListener(_0x1eb9b3,_0x53d826){return function(_0x5d44a4){_0x53d826[_0x55cb('0x3')](_0x1eb9b3,_0x5d44a4);};}function removeListener(_0x39bcdb,_0x4783f5){return function(){ChatInternalMessageEvents['removeListener'](_0x39bcdb,_0x4783f5);};}exports[_0x55cb('0x4')]=function(_0x335be5){for(var _0x5ee9e4=0x0,_0x33e690=events[_0x55cb('0x5')];_0x5ee9e4<_0x33e690;_0x5ee9e4++){var _0x463b79=events[_0x5ee9e4];var _0x3243a9=createListener(_0x55cb('0x6')+_0x463b79,_0x335be5);ChatInternalMessageEvents['on'](_0x463b79,_0x3243a9);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index d62ed90..111a051 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 _0x355c=['isAuthenticated','/describe','/users','getUsers','show','post','create','put','delete','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatInternalMessage.controller','get'];(function(_0x25f350,_0x5a6a01){var _0x484427=function(_0x20a8cd){while(--_0x20a8cd){_0x25f350['push'](_0x25f350['shift']());}};_0x484427(++_0x5a6a01);}(_0x355c,0x89));var _0xc355=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0x355c[_0x35da42];return _0x370035;};'use strict';var multer=require(_0xc355('0x0'));var util=require(_0xc355('0x1'));var path=require(_0xc355('0x2'));var timeout=require(_0xc355('0x3'));var express=require(_0xc355('0x4'));var router=express[_0xc355('0x5')]();var fs_extra=require(_0xc355('0x6'));var auth=require(_0xc355('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc355('0x8'));router[_0xc355('0x9')]('/',auth[_0xc355('0xa')](),controller['index']);router[_0xc355('0x9')](_0xc355('0xb'),auth[_0xc355('0xa')](),controller['describe']);router['get'](_0xc355('0xc'),auth[_0xc355('0xa')](),controller[_0xc355('0xd')]);router[_0xc355('0x9')]('/:id',auth[_0xc355('0xa')](),controller[_0xc355('0xe')]);router[_0xc355('0xf')]('/',auth[_0xc355('0xa')](),controller[_0xc355('0x10')]);router[_0xc355('0x11')]('/:id',controller['update']);router[_0xc355('0x12')](_0xc355('0x13'),auth['isAuthenticated'](),controller['destroy']);module[_0xc355('0x14')]=router;
\ No newline at end of file
+var _0xdb77=['post','create','put','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','/users','getUsers','/:id','show'];(function(_0x532852,_0xd1fa3f){var _0x4fe212=function(_0x2f4b33){while(--_0x2f4b33){_0x532852['push'](_0x532852['shift']());}};_0x4fe212(++_0xd1fa3f);}(_0xdb77,0xa0));var _0x7db7=function(_0x212a29,_0x534614){_0x212a29=_0x212a29-0x0;var _0x5b3239=_0xdb77[_0x212a29];return _0x5b3239;};'use strict';var multer=require(_0x7db7('0x0'));var util=require('util');var path=require(_0x7db7('0x1'));var timeout=require(_0x7db7('0x2'));var express=require(_0x7db7('0x3'));var router=express['Router']();var fs_extra=require(_0x7db7('0x4'));var auth=require(_0x7db7('0x5'));var interaction=require(_0x7db7('0x6'));var config=require(_0x7db7('0x7'));var controller=require(_0x7db7('0x8'));router[_0x7db7('0x9')]('/',auth[_0x7db7('0xa')](),controller['index']);router['get'](_0x7db7('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x7db7('0xc'),auth[_0x7db7('0xa')](),controller[_0x7db7('0xd')]);router[_0x7db7('0x9')](_0x7db7('0xe'),auth[_0x7db7('0xa')](),controller[_0x7db7('0xf')]);router[_0x7db7('0x10')]('/',auth[_0x7db7('0xa')](),controller[_0x7db7('0x11')]);router[_0x7db7('0x12')](_0x7db7('0xe'),controller[_0x7db7('0x13')]);router[_0x7db7('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x7db7('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 45e67c8..4005601 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 _0x1bd1=['BOOLEAN','DATE','STRING','sequelize','exports','TEXT'];(function(_0x23d2b1,_0x33aa9b){var _0xc2d344=function(_0x2cff18){while(--_0x2cff18){_0x23d2b1['push'](_0x23d2b1['shift']());}};_0xc2d344(++_0x33aa9b);}(_0x1bd1,0x123));var _0x11bd=function(_0x1ca3b2,_0x499086){_0x1ca3b2=_0x1ca3b2-0x0;var _0x320a2c=_0x1bd1[_0x1ca3b2];return _0x320a2c;};'use strict';var Sequelize=require(_0x11bd('0x0'));module[_0x11bd('0x1')]={'body':{'type':Sequelize[_0x11bd('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x11bd('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x11bd('0x4')]},'providerName':{'type':Sequelize[_0x11bd('0x5')]},'providerResponse':{'type':Sequelize[_0x11bd('0x2')]}};
\ No newline at end of file
+var _0x6ae2=['medium','BOOLEAN','ENUM','out','STRING','sequelize','exports','TEXT'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x6ae2,0x1ed));var _0x26ae=function(_0x2bfe28,_0x428889){_0x2bfe28=_0x2bfe28-0x0;var _0x93b61e=_0x6ae2[_0x2bfe28];return _0x93b61e;};'use strict';var Sequelize=require(_0x26ae('0x0'));module[_0x26ae('0x1')]={'body':{'type':Sequelize[_0x26ae('0x2')](_0x26ae('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x26ae('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x26ae('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x26ae('0x5')]('in',_0x26ae('0x6')),'defaultValue':_0x26ae('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x26ae('0x7')]},'providerResponse':{'type':Sequelize[_0x26ae('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 411359e..2428efd 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 _0x4b4d=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatMessage,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','save','then','stack','name','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','update','destroy','describe','chat-interactions','accept','chat','readAt','UserId','user','get','ChatInteraction','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','User','agent','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','ChatInteractionId','RejectMessage','ContactId','rejectmessage','parse','formData','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x38e853,_0x17632d){var _0x808e46=function(_0x58c848){while(--_0x58c848){_0x38e853['push'](_0x38e853['shift']());}};_0x808e46(++_0x17632d);}(_0x4b4d,0x71));var _0xd4b4=function(_0x2a24e6,_0x5a80ae){_0x2a24e6=_0x2a24e6-0x0;var _0x5bdcfc=_0x4b4d[_0x2a24e6];return _0x5bdcfc;};'use strict';var emlformat=require(_0xd4b4('0x0'));var rimraf=require(_0xd4b4('0x1'));var zipdir=require(_0xd4b4('0x2'));var jsonpatch=require(_0xd4b4('0x3'));var rp=require(_0xd4b4('0x4'));var moment=require(_0xd4b4('0x5'));var BPromise=require(_0xd4b4('0x6'));var Mustache=require(_0xd4b4('0x7'));var util=require(_0xd4b4('0x8'));var path=require(_0xd4b4('0x9'));var sox=require('sox');var csv=require(_0xd4b4('0xa'));var ejs=require(_0xd4b4('0xb'));var fs=require('fs');var fs_extra=require(_0xd4b4('0xc'));var _=require('lodash');var squel=require(_0xd4b4('0xd'));var crypto=require(_0xd4b4('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd4b4('0xf'));var Papa=require(_0xd4b4('0x10'));var Redis=require(_0xd4b4('0x11'));var authService=require(_0xd4b4('0x12'));var qs=require(_0xd4b4('0x13'));var as=require(_0xd4b4('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd4b4('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xd4b4('0x16'));var licenseUtil=require(_0xd4b4('0x17'));var db=require(_0xd4b4('0x18'))['db'];config[_0xd4b4('0x19')]=_['defaults'](config['redis'],{'host':_0xd4b4('0x1a'),'port':0x18eb});var socket=require(_0xd4b4('0x1b'))(new Redis(config['redis']));require('./chatMessage.socket')[_0xd4b4('0x1c')](socket);var jayson=require(_0xd4b4('0x1d'));var client=jayson[_0xd4b4('0x1e')][_0xd4b4('0x1f')]({'port':0x232c});var client9002=jayson[_0xd4b4('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41b019,_0x555c0e,_0x1f76a0,_0x4454ce){return new BPromise(function(_0x4b74b1,_0x4182db){var _0x5a60e7=_0x4454ce||client;return _0x5a60e7[_0xd4b4('0x20')](_0x41b019,_0x1f76a0)['then'](function(_0x32da86){logger[_0xd4b4('0x21')]('ChatMessage,\x20%s,\x20%s',_0x555c0e,_0xd4b4('0x22'));logger[_0xd4b4('0x23')](_0xd4b4('0x24'),_0x555c0e,_0xd4b4('0x22'),JSON[_0xd4b4('0x25')](_0x32da86));if(_0x32da86[_0xd4b4('0x26')]){if(_0x32da86[_0xd4b4('0x26')][_0xd4b4('0x27')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x555c0e,_0x32da86[_0xd4b4('0x26')][_0xd4b4('0x28')]);return _0x4182db(_0x32da86[_0xd4b4('0x26')][_0xd4b4('0x28')]);}logger[_0xd4b4('0x26')](_0xd4b4('0x29'),_0x555c0e,_0x32da86['error'][_0xd4b4('0x28')]);return _0x4b74b1(_0x32da86[_0xd4b4('0x26')][_0xd4b4('0x28')]);}else{logger['info'](_0xd4b4('0x29'),_0x555c0e,'request\x20sent');_0x4b74b1(_0x32da86[_0xd4b4('0x2a')]['message']);}})[_0xd4b4('0x2b')](function(_0x25ffcf){logger[_0xd4b4('0x26')]('ChatMessage,\x20%s,\x20%s',_0x555c0e,_0x25ffcf);_0x4182db(_0x25ffcf);});});}function respondWithStatusCode(_0x2c82d3,_0x200ce6){_0x200ce6=_0x200ce6||0xcc;return function(_0x27fe47){if(_0x27fe47){return _0x2c82d3[_0xd4b4('0x2c')](_0x200ce6);}return _0x2c82d3[_0xd4b4('0x2d')](_0x200ce6)[_0xd4b4('0x2e')]();};}function respondWithResult(_0x1b9ea4,_0x10b6bf){_0x10b6bf=_0x10b6bf||0xc8;return function(_0x35c3a2){if(_0x35c3a2){return _0x1b9ea4[_0xd4b4('0x2d')](_0x10b6bf)[_0xd4b4('0x2f')](_0x35c3a2);}};}function respondWithFilteredResult(_0x1edb05,_0x59e99a){return function(_0x28f6da){if(_0x28f6da){var _0x5dcd76=typeof _0x59e99a[_0xd4b4('0x30')]===_0xd4b4('0x31')&&typeof _0x59e99a[_0xd4b4('0x32')]===_0xd4b4('0x31');var _0x17ac2d=_0x28f6da[_0xd4b4('0x33')];var _0x4f698b=_0x5dcd76?0x0:_0x59e99a[_0xd4b4('0x30')];var _0x4da644=_0x5dcd76?_0x28f6da['count']:_0x59e99a['offset']+_0x59e99a[_0xd4b4('0x32')];var _0x147bc6;if(_0x4da644>=_0x17ac2d){_0x4da644=_0x17ac2d;_0x147bc6=0xc8;}else{_0x147bc6=0xce;}_0x1edb05[_0xd4b4('0x2d')](_0x147bc6);return _0x1edb05[_0xd4b4('0x34')]('Content-Range',_0x4f698b+'-'+_0x4da644+'/'+_0x17ac2d)[_0xd4b4('0x2f')](_0x28f6da);}return null;};}function patchUpdates(_0x86e20c){return function(_0x320380){try{jsonpatch['apply'](_0x320380,_0x86e20c,!![]);}catch(_0x4feb31){return BPromise['reject'](_0x4feb31);}return _0x320380[_0xd4b4('0x35')]();};}function saveUpdates(_0x4e58d3,_0x148181){return function(_0x510a52){if(_0x510a52){return _0x510a52['update'](_0x4e58d3)['then'](function(_0x1b58b7){return _0x1b58b7;});}return null;};}function removeEntity(_0x1b5ef4,_0x5a89f7){return function(_0x1e132c){if(_0x1e132c){return _0x1e132c['destroy']()[_0xd4b4('0x36')](function(){_0x1b5ef4[_0xd4b4('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x586932,_0x113fb9){return function(_0x4566f3){if(!_0x4566f3){_0x586932['sendStatus'](0x194);}return _0x4566f3;};}function handleError(_0x80cb74,_0x4aa87c){_0x4aa87c=_0x4aa87c||0x1f4;return function(_0x3d55ff){logger['error'](_0x3d55ff[_0xd4b4('0x37')]);if(_0x3d55ff[_0xd4b4('0x38')]){delete _0x3d55ff[_0xd4b4('0x38')];}_0x80cb74['status'](_0x4aa87c)['send'](_0x3d55ff);};}exports[_0xd4b4('0x39')]=function(_0x111b7a,_0x35bc6d){var _0x1a2637={},_0x429481={},_0x4fbe2b={'count':0x0,'rows':[]};var _0x15e17b=_[_0xd4b4('0x3a')](db[_0xd4b4('0x3b')][_0xd4b4('0x3c')],function(_0x2e2c9a){return{'name':_0x2e2c9a[_0xd4b4('0x3d')],'type':_0x2e2c9a[_0xd4b4('0x3e')][_0xd4b4('0x3f')]};});_0x429481[_0xd4b4('0x40')]=_[_0xd4b4('0x3a')](_0x15e17b,_0xd4b4('0x38'));_0x429481[_0xd4b4('0x41')]=_[_0xd4b4('0x42')](_0x111b7a['query']);_0x429481['filters']=_[_0xd4b4('0x43')](_0x429481['model'],_0x429481[_0xd4b4('0x41')]);_0x1a2637[_0xd4b4('0x44')]=_[_0xd4b4('0x43')](_0x429481[_0xd4b4('0x40')],qs[_0xd4b4('0x45')](_0x111b7a[_0xd4b4('0x41')][_0xd4b4('0x45')]));_0x1a2637['attributes']=_0x1a2637[_0xd4b4('0x44')][_0xd4b4('0x46')]?_0x1a2637[_0xd4b4('0x44')]:_0x429481[_0xd4b4('0x40')];if(!_0x111b7a[_0xd4b4('0x41')][_0xd4b4('0x47')]('nolimit')){_0x1a2637[_0xd4b4('0x32')]=qs[_0xd4b4('0x32')](_0x111b7a[_0xd4b4('0x41')]['limit']);_0x1a2637['offset']=qs['offset'](_0x111b7a[_0xd4b4('0x41')][_0xd4b4('0x30')]);}_0x1a2637[_0xd4b4('0x48')]=qs[_0xd4b4('0x49')](_0x111b7a[_0xd4b4('0x41')][_0xd4b4('0x49')]);_0x1a2637[_0xd4b4('0x4a')]=qs[_0xd4b4('0x4b')](_[_0xd4b4('0x4c')](_0x111b7a[_0xd4b4('0x41')],_0x429481[_0xd4b4('0x4b')]),_0x15e17b);if(_0x111b7a['query']['filter']){_0x1a2637['where']=_[_0xd4b4('0x4d')](_0x1a2637[_0xd4b4('0x4a')],{'$or':_[_0xd4b4('0x3a')](_0x15e17b,function(_0x390838){if(_0x390838['type']!=='VIRTUAL'){var _0xa4fb9b={};_0xa4fb9b[_0x390838[_0xd4b4('0x38')]]={'$like':'%'+_0x111b7a[_0xd4b4('0x41')]['filter']+'%'};return _0xa4fb9b;}})});}_0x1a2637=_[_0xd4b4('0x4d')]({},_0x1a2637,_0x111b7a[_0xd4b4('0x4e')]);var _0xafa949={'where':_0x1a2637[_0xd4b4('0x4a')]};return db[_0xd4b4('0x3b')][_0xd4b4('0x33')](_0xafa949)[_0xd4b4('0x36')](function(_0x14967f){_0x4fbe2b[_0xd4b4('0x33')]=_0x14967f;if(_0x111b7a[_0xd4b4('0x41')][_0xd4b4('0x4f')]){_0x1a2637[_0xd4b4('0x50')]=[{'all':!![]}];}return db['ChatMessage'][_0xd4b4('0x51')](_0x1a2637);})[_0xd4b4('0x36')](function(_0x3dfa65){_0x4fbe2b[_0xd4b4('0x52')]=_0x3dfa65;return _0x4fbe2b;})[_0xd4b4('0x36')](respondWithFilteredResult(_0x35bc6d,_0x1a2637))[_0xd4b4('0x2b')](handleError(_0x35bc6d,null));};exports[_0xd4b4('0x53')]=function(_0x21dd8f,_0x4809ed){var _0x16bf39={'raw':!![],'where':{'id':_0x21dd8f[_0xd4b4('0x54')]['id']}},_0x3d48d2={};_0x3d48d2['model']=_['keys'](db[_0xd4b4('0x3b')][_0xd4b4('0x3c')]);_0x3d48d2['query']=_['keys'](_0x21dd8f[_0xd4b4('0x41')]);_0x3d48d2['filters']=_['intersection'](_0x3d48d2['model'],_0x3d48d2[_0xd4b4('0x41')]);_0x16bf39[_0xd4b4('0x44')]=_[_0xd4b4('0x43')](_0x3d48d2[_0xd4b4('0x40')],qs['fields'](_0x21dd8f[_0xd4b4('0x41')][_0xd4b4('0x45')]));_0x16bf39[_0xd4b4('0x44')]=_0x16bf39[_0xd4b4('0x44')][_0xd4b4('0x46')]?_0x16bf39[_0xd4b4('0x44')]:_0x3d48d2[_0xd4b4('0x40')];if(_0x21dd8f[_0xd4b4('0x41')]['includeAll']){_0x16bf39[_0xd4b4('0x50')]=[{'all':!![]}];}_0x16bf39=_[_0xd4b4('0x4d')]({},_0x16bf39,_0x21dd8f['options']);return db[_0xd4b4('0x3b')][_0xd4b4('0x55')](_0x16bf39)[_0xd4b4('0x36')](handleEntityNotFound(_0x4809ed,null))['then'](respondWithResult(_0x4809ed,null))[_0xd4b4('0x2b')](handleError(_0x4809ed,null));};exports['create']=function(_0x46e18b,_0x1caf91){return db[_0xd4b4('0x3b')][_0xd4b4('0x56')](_0x46e18b[_0xd4b4('0x57')],{})[_0xd4b4('0x36')](respondWithResult(_0x1caf91,0xc9))[_0xd4b4('0x2b')](handleError(_0x1caf91,null));};exports[_0xd4b4('0x58')]=function(_0x4cb09e,_0x3c02a6){if(_0x4cb09e[_0xd4b4('0x57')]['id']){delete _0x4cb09e[_0xd4b4('0x57')]['id'];}return db[_0xd4b4('0x3b')][_0xd4b4('0x55')]({'where':{'id':_0x4cb09e['params']['id']}})[_0xd4b4('0x36')](handleEntityNotFound(_0x3c02a6,null))[_0xd4b4('0x36')](saveUpdates(_0x4cb09e[_0xd4b4('0x57')],null))[_0xd4b4('0x36')](respondWithResult(_0x3c02a6,null))[_0xd4b4('0x2b')](handleError(_0x3c02a6,null));};exports[_0xd4b4('0x59')]=function(_0x78ab41,_0x12cab9){return db[_0xd4b4('0x3b')]['find']({'where':{'id':_0x78ab41[_0xd4b4('0x54')]['id']}})[_0xd4b4('0x36')](handleEntityNotFound(_0x12cab9,null))['then'](removeEntity(_0x12cab9,null))[_0xd4b4('0x2b')](handleError(_0x12cab9,null));};exports[_0xd4b4('0x5a')]=function(_0xb98f19,_0xd8e7){return db['ChatMessage']['describe']()['then'](respondWithResult(_0xd8e7,null))[_0xd4b4('0x2b')](handleError(_0xd8e7,null));};var interaction_log=require('../../config/logger')(_0xd4b4('0x5b'));exports[_0xd4b4('0x5c')]=function(_0x19548d,_0x3d561a,_0x558961){var _0x3dee7f={'agent':{},'channel':_0xd4b4('0x5d')};if(_0x19548d['body']['id']){delete _0x19548d[_0xd4b4('0x57')]['id'];}_0x19548d[_0xd4b4('0x57')]['read']=!![];_0x19548d['body'][_0xd4b4('0x5e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x19548d[_0xd4b4('0x57')]['UserId']=_0x19548d[_0xd4b4('0x57')][_0xd4b4('0x5f')]||_0x19548d[_0xd4b4('0x60')]['id'];_0x3dee7f['agent']['id']=_0x19548d[_0xd4b4('0x57')][_0xd4b4('0x5f')];return db[_0xd4b4('0x3b')][_0xd4b4('0x55')]({'where':{'id':_0x19548d['params']['id'],'UserId':null}})[_0xd4b4('0x36')](handleEntityNotFound(_0x3d561a,null))[_0xd4b4('0x36')](saveUpdates(_0x19548d[_0xd4b4('0x57')],null))[_0xd4b4('0x36')](function(_0x2e97c3){if(_0x2e97c3){_0x3dee7f['message']=_0x2e97c3[_0xd4b4('0x61')]({'plain':!![]});return db[_0xd4b4('0x62')][_0xd4b4('0x55')]({'where':{'id':_0x2e97c3['ChatInteractionId']}});}return null;})[_0xd4b4('0x36')](handleEntityNotFound(_0x3d561a,null))[_0xd4b4('0x36')](function(_0x210fa6){if(_0x210fa6){return _0x210fa6['update']({'UserId':_0x19548d[_0xd4b4('0x57')][_0xd4b4('0x5f')],'read1stAt':_[_0xd4b4('0x63')](_0x210fa6[_0xd4b4('0x64')])?moment()[_0xd4b4('0x65')](_0xd4b4('0x66')):undefined});}return null;})[_0xd4b4('0x36')](function(_0x465cf8){if(_0x465cf8){_0x3dee7f[_0xd4b4('0x67')]=_0x465cf8[_0xd4b4('0x61')]({'plain':!![]});interaction_log[_0xd4b4('0x21')](_0xd4b4('0x68'),_0x19548d[_0xd4b4('0x60')]['id'],_0x19548d[_0xd4b4('0x60')][_0xd4b4('0x38')],_0x19548d[_0xd4b4('0x60')][_0xd4b4('0x69')],_0x3dee7f[_0xd4b4('0x67')]['id'],_0x19548d[_0xd4b4('0x57')]?JSON[_0xd4b4('0x25')](_0x19548d[_0xd4b4('0x57')]):_0xd4b4('0x6a'));return respondWithRpcPromise(_0xd4b4('0x6b'),_0xd4b4('0x6c'),_0x3dee7f);}return null;})[_0xd4b4('0x36')](function(_0x438620){var _0x100d2c=_0xd4b4('0x6d')+_0x438620[_0xd4b4('0x28')]['ContactId'];return db[_0xd4b4('0x6e')][_0xd4b4('0x41')](_0x100d2c,{'type':db[_0xd4b4('0x6f')]['QueryTypes'][_0xd4b4('0x70')],'raw':!![]})[_0xd4b4('0x36')](function(_0x3e20ba){return _0x3e20ba;});})[_0xd4b4('0x36')](function(_0x27df0b){if(_0x27df0b){_0x3dee7f[_0xd4b4('0x28')][_0xd4b4('0x71')]=_0x27df0b[0x0];if(!_0x19548d[_0xd4b4('0x57')]['UserId'])return;return db[_0xd4b4('0x72')][_0xd4b4('0x55')]({'where':{'id':_0x19548d['body']['UserId'],'role':_0xd4b4('0x73')},'attributes':['id',_0xd4b4('0x38'),_0xd4b4('0x74'),_0xd4b4('0x75'),'internal'],'raw':!![]});}return null;})[_0xd4b4('0x36')](function(_0x5eebea){if(!_0x5eebea)return null;_0x3dee7f[_0xd4b4('0x28')][_0xd4b4('0x73')]=_0x5eebea;return _0x3dee7f;})[_0xd4b4('0x36')](function(_0x97905d){if(_0x97905d){if(_0x19548d[_0xd4b4('0x57')][_0xd4b4('0x76')]){_0x3dee7f[_0xd4b4('0x28')][_0xd4b4('0x77')]=util[_0xd4b4('0x65')](_0xd4b4('0x78'),_0x19548d[_0xd4b4('0x60')][_0xd4b4('0x38')]);_0x3dee7f[_0xd4b4('0x28')][_0xd4b4('0x79')]=_0x3dee7f[_0xd4b4('0x79')];_0x3dee7f['message'][_0xd4b4('0x7a')]=_0x3dee7f[_0xd4b4('0x79')];_0x3dee7f[_0xd4b4('0x28')][_0xd4b4('0x7b')]=_0xd4b4('0x5c');return respondWithRpcPromise(_0xd4b4('0x7c'),_0xd4b4('0x7c'),{'event':_0xd4b4('0x7d'),'message':_[_0xd4b4('0x4d')](_0x3dee7f[_0xd4b4('0x28')],JSON['parse'](_0x3dee7f['interaction']['formData']))},client9002)[_0xd4b4('0x36')](function(){return _0x3dee7f;});}return _0x3dee7f;}return null;})[_0xd4b4('0x36')](respondWithResult(_0x3d561a,null))[_0xd4b4('0x2b')](handleError(_0x3d561a,null));};var interaction_log=require(_0xd4b4('0x15'))(_0xd4b4('0x5b'));exports['reject']=function(_0x5ac4c5,_0x17a879,_0x3347ec){var _0x416bb3={'agent':{},'channel':_0xd4b4('0x5d')};if(_0x5ac4c5['body']['id']){delete _0x5ac4c5[_0xd4b4('0x57')]['id'];}_0x5ac4c5[_0xd4b4('0x57')][_0xd4b4('0x5f')]=_0x5ac4c5[_0xd4b4('0x57')][_0xd4b4('0x5f')]||_0x5ac4c5[_0xd4b4('0x60')]['id'];_0x416bb3[_0xd4b4('0x73')]['id']=_0x5ac4c5[_0xd4b4('0x57')][_0xd4b4('0x5f')];return db[_0xd4b4('0x3b')]['find']({'where':{'id':_0x5ac4c5[_0xd4b4('0x54')]['id'],'UserId':null}})[_0xd4b4('0x36')](handleEntityNotFound(_0x17a879,null))['then'](function(_0x598398){if(_0x598398){_0x416bb3[_0xd4b4('0x28')]=_0x598398[_0xd4b4('0x61')]({'plain':!![]});return db[_0xd4b4('0x62')][_0xd4b4('0x55')]({'where':{'id':_0x598398[_0xd4b4('0x7e')]}});}return null;})[_0xd4b4('0x36')](handleEntityNotFound(_0x17a879,null))[_0xd4b4('0x36')](function(_0x364f7a){if(_0x364f7a){_0x416bb3[_0xd4b4('0x67')]=_0x364f7a['get']({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5ac4c5[_0xd4b4('0x60')]['id'],_0x5ac4c5[_0xd4b4('0x60')]['name'],_0x5ac4c5[_0xd4b4('0x60')]['role'],_0x416bb3[_0xd4b4('0x67')]['id'],_0x5ac4c5[_0xd4b4('0x57')]?JSON['stringify'](_0x5ac4c5['body']):'null');return respondWithRpcPromise(_0xd4b4('0x7f'),'rejectMessage',_0x416bb3);}return null;})[_0xd4b4('0x36')](function(_0x4f75d8){var _0x30916f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4f75d8[_0xd4b4('0x28')][_0xd4b4('0x80')];return db[_0xd4b4('0x6e')][_0xd4b4('0x41')](_0x30916f,{'type':db[_0xd4b4('0x6f')]['QueryTypes'][_0xd4b4('0x70')],'raw':!![]})[_0xd4b4('0x36')](function(_0x44f1ca){return _0x44f1ca;});})[_0xd4b4('0x36')](function(_0xa69a27){if(_0xa69a27){_0x416bb3[_0xd4b4('0x28')][_0xd4b4('0x71')]=_0xa69a27[0x0];if(!_0x5ac4c5[_0xd4b4('0x57')]['UserId'])return;return db[_0xd4b4('0x72')][_0xd4b4('0x55')]({'where':{'id':_0x5ac4c5[_0xd4b4('0x57')]['UserId'],'role':_0xd4b4('0x73')},'attributes':['id','name',_0xd4b4('0x74'),_0xd4b4('0x75'),'internal'],'raw':!![]});}return null;})['then'](function(_0x17fcd6){if(!_0x17fcd6)return null;_0x416bb3[_0xd4b4('0x28')][_0xd4b4('0x73')]=_0x17fcd6;return _0x416bb3;})[_0xd4b4('0x36')](function(_0xc6e628){if(_0xc6e628){_0xc6e628[_0xd4b4('0x28')][_0xd4b4('0x77')]=util[_0xd4b4('0x65')](_0xd4b4('0x78'),_0x5ac4c5[_0xd4b4('0x60')][_0xd4b4('0x38')]);_0xc6e628[_0xd4b4('0x28')]['channel']=_0x416bb3['channel'];_0xc6e628['message'][_0xd4b4('0x7a')]=_0x416bb3[_0xd4b4('0x79')];_0xc6e628[_0xd4b4('0x28')]['event']='reject';respondWithRpcPromise(_0xd4b4('0x7c'),'EventManager',{'event':_0xd4b4('0x81'),'message':_[_0xd4b4('0x4d')](_0x416bb3[_0xd4b4('0x28')],JSON[_0xd4b4('0x82')](_0x416bb3['interaction'][_0xd4b4('0x83')]))},client9002);return _0x416bb3;}return null;})['then'](respondWithResult(_0x17a879,null))['catch'](handleError(_0x17a879,null));};
\ No newline at end of file
+var _0x6e46=['query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','merge','then','includeAll','include','findAll','rows','show','params','create','body','find','describe','chat-interactions','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','fullname','email','internal','SIP/%s','channel','motionChannel','acceptmessage','formData','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','interface','parse','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','./chatMessage.socket','register','jayson/promise','client','http','request','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','limit','count','set','Content-Range','save','update','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model'];(function(_0x506181,_0x59cf27){var _0x758102=function(_0x114438){while(--_0x114438){_0x506181['push'](_0x506181['shift']());}};_0x758102(++_0x59cf27);}(_0x6e46,0xbe));var _0x66e4=function(_0x896344,_0x49b418){_0x896344=_0x896344-0x0;var _0x399677=_0x6e46[_0x896344];return _0x399677;};'use strict';var emlformat=require(_0x66e4('0x0'));var rimraf=require(_0x66e4('0x1'));var zipdir=require(_0x66e4('0x2'));var jsonpatch=require(_0x66e4('0x3'));var rp=require(_0x66e4('0x4'));var moment=require(_0x66e4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x66e4('0x6'));var csv=require('to-csv');var ejs=require(_0x66e4('0x7'));var fs=require('fs');var fs_extra=require(_0x66e4('0x8'));var _=require(_0x66e4('0x9'));var squel=require('squel');var crypto=require(_0x66e4('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x66e4('0xb'));var toCsv=require(_0x66e4('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x66e4('0xd'));var authService=require(_0x66e4('0xe'));var qs=require(_0x66e4('0xf'));var as=require(_0x66e4('0x10'));var hardwareService=require(_0x66e4('0x11'));var logger=require(_0x66e4('0x12'))('api');var utils=require(_0x66e4('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x66e4('0x14'));var db=require(_0x66e4('0x15'))['db'];config['redis']=_[_0x66e4('0x16')](config[_0x66e4('0x17')],{'host':_0x66e4('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x66e4('0x17')]));require(_0x66e4('0x19'))[_0x66e4('0x1a')](socket);var jayson=require(_0x66e4('0x1b'));var client=jayson[_0x66e4('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0x66e4('0x1c')][_0x66e4('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x47df71,_0x2d9041,_0x5a0131,_0x1f8266){return new BPromise(function(_0x31c09a,_0x275ae4){var _0x2dd1e1=_0x1f8266||client;return _0x2dd1e1[_0x66e4('0x1e')](_0x47df71,_0x5a0131)['then'](function(_0x412752){logger[_0x66e4('0x1f')](_0x66e4('0x20'),_0x2d9041,_0x66e4('0x21'));logger[_0x66e4('0x22')](_0x66e4('0x23'),_0x2d9041,_0x66e4('0x21'),JSON[_0x66e4('0x24')](_0x412752));if(_0x412752[_0x66e4('0x25')]){if(_0x412752[_0x66e4('0x25')][_0x66e4('0x26')]===0x1f4){logger[_0x66e4('0x25')](_0x66e4('0x20'),_0x2d9041,_0x412752[_0x66e4('0x25')][_0x66e4('0x27')]);return _0x275ae4(_0x412752[_0x66e4('0x25')][_0x66e4('0x27')]);}logger[_0x66e4('0x25')](_0x66e4('0x20'),_0x2d9041,_0x412752['error']['message']);return _0x31c09a(_0x412752['error']['message']);}else{logger[_0x66e4('0x1f')]('ChatMessage,\x20%s,\x20%s',_0x2d9041,_0x66e4('0x21'));_0x31c09a(_0x412752[_0x66e4('0x28')][_0x66e4('0x27')]);}})[_0x66e4('0x29')](function(_0x27f6e5){logger['error']('ChatMessage,\x20%s,\x20%s',_0x2d9041,_0x27f6e5);_0x275ae4(_0x27f6e5);});});}function respondWithStatusCode(_0x4336dc,_0x271843){_0x271843=_0x271843||0xcc;return function(_0x1504cb){if(_0x1504cb){return _0x4336dc[_0x66e4('0x2a')](_0x271843);}return _0x4336dc[_0x66e4('0x2b')](_0x271843)[_0x66e4('0x2c')]();};}function respondWithResult(_0x136780,_0xb362bd){_0xb362bd=_0xb362bd||0xc8;return function(_0x368a7f){if(_0x368a7f){return _0x136780['status'](_0xb362bd)[_0x66e4('0x2d')](_0x368a7f);}};}function respondWithFilteredResult(_0x18bee2,_0x439357){return function(_0x127414){if(_0x127414){var _0x2c9b67=typeof _0x439357[_0x66e4('0x2e')]===_0x66e4('0x2f')&&typeof _0x439357[_0x66e4('0x30')]===_0x66e4('0x2f');var _0x4d468e=_0x127414[_0x66e4('0x31')];var _0x518817=_0x2c9b67?0x0:_0x439357[_0x66e4('0x2e')];var _0x54e9d7=_0x2c9b67?_0x127414[_0x66e4('0x31')]:_0x439357['offset']+_0x439357[_0x66e4('0x30')];var _0x593b70;if(_0x54e9d7>=_0x4d468e){_0x54e9d7=_0x4d468e;_0x593b70=0xc8;}else{_0x593b70=0xce;}_0x18bee2['status'](_0x593b70);return _0x18bee2[_0x66e4('0x32')](_0x66e4('0x33'),_0x518817+'-'+_0x54e9d7+'/'+_0x4d468e)[_0x66e4('0x2d')](_0x127414);}return null;};}function patchUpdates(_0x4981f3){return function(_0x3525c8){try{jsonpatch['apply'](_0x3525c8,_0x4981f3,!![]);}catch(_0x5927cd){return BPromise['reject'](_0x5927cd);}return _0x3525c8[_0x66e4('0x34')]();};}function saveUpdates(_0x1de740,_0xd2b89d){return function(_0x5c6f54){if(_0x5c6f54){return _0x5c6f54[_0x66e4('0x35')](_0x1de740)['then'](function(_0x29b07f){return _0x29b07f;});}return null;};}function removeEntity(_0x1de011,_0x11ea3c){return function(_0x2898a5){if(_0x2898a5){return _0x2898a5[_0x66e4('0x36')]()['then'](function(){_0x1de011['status'](0xcc)[_0x66e4('0x2c')]();});}};}function handleEntityNotFound(_0x2481ee,_0x45db5d){return function(_0xd3e2de){if(!_0xd3e2de){_0x2481ee[_0x66e4('0x2a')](0x194);}return _0xd3e2de;};}function handleError(_0x22652f,_0x1846e9){_0x1846e9=_0x1846e9||0x1f4;return function(_0x5ec3e1){logger[_0x66e4('0x25')](_0x5ec3e1[_0x66e4('0x37')]);if(_0x5ec3e1['name']){delete _0x5ec3e1[_0x66e4('0x38')];}_0x22652f['status'](_0x1846e9)[_0x66e4('0x39')](_0x5ec3e1);};}exports[_0x66e4('0x3a')]=function(_0x3fa070,_0x451bf0){var _0x585e5b={},_0x267368={},_0x48351c={'count':0x0,'rows':[]};var _0x1262ca=_[_0x66e4('0x3b')](db[_0x66e4('0x3c')][_0x66e4('0x3d')],function(_0x3d69a6){return{'name':_0x3d69a6[_0x66e4('0x3e')],'type':_0x3d69a6[_0x66e4('0x3f')][_0x66e4('0x40')]};});_0x267368[_0x66e4('0x41')]=_[_0x66e4('0x3b')](_0x1262ca,_0x66e4('0x38'));_0x267368[_0x66e4('0x42')]=_[_0x66e4('0x43')](_0x3fa070['query']);_0x267368[_0x66e4('0x44')]=_[_0x66e4('0x45')](_0x267368[_0x66e4('0x41')],_0x267368[_0x66e4('0x42')]);_0x585e5b['attributes']=_['intersection'](_0x267368[_0x66e4('0x41')],qs[_0x66e4('0x46')](_0x3fa070[_0x66e4('0x42')][_0x66e4('0x46')]));_0x585e5b[_0x66e4('0x47')]=_0x585e5b[_0x66e4('0x47')][_0x66e4('0x48')]?_0x585e5b[_0x66e4('0x47')]:_0x267368[_0x66e4('0x41')];if(!_0x3fa070[_0x66e4('0x42')]['hasOwnProperty'](_0x66e4('0x49'))){_0x585e5b[_0x66e4('0x30')]=qs[_0x66e4('0x30')](_0x3fa070[_0x66e4('0x42')][_0x66e4('0x30')]);_0x585e5b[_0x66e4('0x2e')]=qs[_0x66e4('0x2e')](_0x3fa070['query'][_0x66e4('0x2e')]);}_0x585e5b['order']=qs[_0x66e4('0x4a')](_0x3fa070[_0x66e4('0x42')]['sort']);_0x585e5b[_0x66e4('0x4b')]=qs[_0x66e4('0x44')](_[_0x66e4('0x4c')](_0x3fa070[_0x66e4('0x42')],_0x267368[_0x66e4('0x44')]),_0x1262ca);if(_0x3fa070[_0x66e4('0x42')]['filter']){_0x585e5b[_0x66e4('0x4b')]=_[_0x66e4('0x4d')](_0x585e5b[_0x66e4('0x4b')],{'$or':_[_0x66e4('0x3b')](_0x1262ca,function(_0x3275d5){if(_0x3275d5[_0x66e4('0x3f')]!=='VIRTUAL'){var _0x58f75c={};_0x58f75c[_0x3275d5['name']]={'$like':'%'+_0x3fa070[_0x66e4('0x42')]['filter']+'%'};return _0x58f75c;}})});}_0x585e5b=_[_0x66e4('0x4d')]({},_0x585e5b,_0x3fa070['options']);var _0x114b45={'where':_0x585e5b[_0x66e4('0x4b')]};return db[_0x66e4('0x3c')][_0x66e4('0x31')](_0x114b45)[_0x66e4('0x4e')](function(_0x261afc){_0x48351c[_0x66e4('0x31')]=_0x261afc;if(_0x3fa070[_0x66e4('0x42')][_0x66e4('0x4f')]){_0x585e5b[_0x66e4('0x50')]=[{'all':!![]}];}return db[_0x66e4('0x3c')][_0x66e4('0x51')](_0x585e5b);})[_0x66e4('0x4e')](function(_0x24276a){_0x48351c[_0x66e4('0x52')]=_0x24276a;return _0x48351c;})['then'](respondWithFilteredResult(_0x451bf0,_0x585e5b))[_0x66e4('0x29')](handleError(_0x451bf0,null));};exports[_0x66e4('0x53')]=function(_0x24e6ce,_0x5c0b3f){var _0x22b120={'raw':!![],'where':{'id':_0x24e6ce[_0x66e4('0x54')]['id']}},_0x5554d5={};_0x5554d5['model']=_[_0x66e4('0x43')](db[_0x66e4('0x3c')][_0x66e4('0x3d')]);_0x5554d5['query']=_['keys'](_0x24e6ce[_0x66e4('0x42')]);_0x5554d5['filters']=_[_0x66e4('0x45')](_0x5554d5[_0x66e4('0x41')],_0x5554d5[_0x66e4('0x42')]);_0x22b120[_0x66e4('0x47')]=_['intersection'](_0x5554d5['model'],qs[_0x66e4('0x46')](_0x24e6ce[_0x66e4('0x42')][_0x66e4('0x46')]));_0x22b120['attributes']=_0x22b120[_0x66e4('0x47')][_0x66e4('0x48')]?_0x22b120[_0x66e4('0x47')]:_0x5554d5[_0x66e4('0x41')];if(_0x24e6ce[_0x66e4('0x42')][_0x66e4('0x4f')]){_0x22b120['include']=[{'all':!![]}];}_0x22b120=_[_0x66e4('0x4d')]({},_0x22b120,_0x24e6ce['options']);return db[_0x66e4('0x3c')]['find'](_0x22b120)['then'](handleEntityNotFound(_0x5c0b3f,null))[_0x66e4('0x4e')](respondWithResult(_0x5c0b3f,null))['catch'](handleError(_0x5c0b3f,null));};exports[_0x66e4('0x55')]=function(_0x4b0cef,_0x290724){return db['ChatMessage'][_0x66e4('0x55')](_0x4b0cef['body'],{})[_0x66e4('0x4e')](respondWithResult(_0x290724,0xc9))['catch'](handleError(_0x290724,null));};exports[_0x66e4('0x35')]=function(_0x5259e4,_0x7df1f3){if(_0x5259e4[_0x66e4('0x56')]['id']){delete _0x5259e4['body']['id'];}return db[_0x66e4('0x3c')][_0x66e4('0x57')]({'where':{'id':_0x5259e4[_0x66e4('0x54')]['id']}})[_0x66e4('0x4e')](handleEntityNotFound(_0x7df1f3,null))[_0x66e4('0x4e')](saveUpdates(_0x5259e4[_0x66e4('0x56')],null))[_0x66e4('0x4e')](respondWithResult(_0x7df1f3,null))['catch'](handleError(_0x7df1f3,null));};exports[_0x66e4('0x36')]=function(_0x38ac03,_0x45180f){return db[_0x66e4('0x3c')][_0x66e4('0x57')]({'where':{'id':_0x38ac03['params']['id']}})[_0x66e4('0x4e')](handleEntityNotFound(_0x45180f,null))[_0x66e4('0x4e')](removeEntity(_0x45180f,null))[_0x66e4('0x29')](handleError(_0x45180f,null));};exports[_0x66e4('0x58')]=function(_0x350b88,_0xf6287b){return db[_0x66e4('0x3c')][_0x66e4('0x58')]()[_0x66e4('0x4e')](respondWithResult(_0xf6287b,null))[_0x66e4('0x29')](handleError(_0xf6287b,null));};var interaction_log=require(_0x66e4('0x12'))(_0x66e4('0x59'));exports[_0x66e4('0x5a')]=function(_0x417966,_0x12167c,_0x1fe6b5){var _0x4c73e5={'agent':{},'channel':_0x66e4('0x5b')};if(_0x417966['body']['id']){delete _0x417966[_0x66e4('0x56')]['id'];}_0x417966['body'][_0x66e4('0x5c')]=!![];_0x417966['body']['readAt']=moment()[_0x66e4('0x5d')](_0x66e4('0x5e'));_0x417966[_0x66e4('0x56')][_0x66e4('0x5f')]=_0x417966[_0x66e4('0x56')][_0x66e4('0x5f')]||_0x417966[_0x66e4('0x60')]['id'];_0x4c73e5[_0x66e4('0x61')]['id']=_0x417966[_0x66e4('0x56')][_0x66e4('0x5f')];return db['ChatMessage']['find']({'where':{'id':_0x417966[_0x66e4('0x54')]['id'],'UserId':null}})[_0x66e4('0x4e')](handleEntityNotFound(_0x12167c,null))['then'](saveUpdates(_0x417966[_0x66e4('0x56')],null))[_0x66e4('0x4e')](function(_0x4c2617){if(_0x4c2617){_0x4c73e5['message']=_0x4c2617[_0x66e4('0x62')]({'plain':!![]});return db[_0x66e4('0x63')][_0x66e4('0x57')]({'where':{'id':_0x4c2617[_0x66e4('0x64')]}});}return null;})[_0x66e4('0x4e')](handleEntityNotFound(_0x12167c,null))['then'](function(_0x220c38){if(_0x220c38){return _0x220c38['update']({'UserId':_0x417966[_0x66e4('0x56')][_0x66e4('0x5f')],'read1stAt':_['isNil'](_0x220c38[_0x66e4('0x65')])?moment()[_0x66e4('0x5d')](_0x66e4('0x5e')):undefined});}return null;})[_0x66e4('0x4e')](function(_0x501d03){if(_0x501d03){_0x4c73e5['interaction']=_0x501d03[_0x66e4('0x62')]({'plain':!![]});interaction_log[_0x66e4('0x1f')](_0x66e4('0x66'),_0x417966[_0x66e4('0x60')]['id'],_0x417966[_0x66e4('0x60')][_0x66e4('0x38')],_0x417966['user'][_0x66e4('0x67')],_0x4c73e5[_0x66e4('0x68')]['id'],_0x417966[_0x66e4('0x56')]?JSON['stringify'](_0x417966[_0x66e4('0x56')]):_0x66e4('0x69'));return respondWithRpcPromise(_0x66e4('0x6a'),_0x66e4('0x6b'),_0x4c73e5);}return null;})[_0x66e4('0x4e')](function(_0x23a077){var _0x1c096a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x23a077[_0x66e4('0x27')][_0x66e4('0x6c')];return db[_0x66e4('0x6d')][_0x66e4('0x42')](_0x1c096a,{'type':db[_0x66e4('0x6e')][_0x66e4('0x6f')][_0x66e4('0x70')],'raw':!![]})[_0x66e4('0x4e')](function(_0x339861){return _0x339861;});})[_0x66e4('0x4e')](function(_0xc44484){if(_0xc44484){_0x4c73e5[_0x66e4('0x27')]['contact']=_0xc44484[0x0];if(!_0x417966['body'][_0x66e4('0x5f')])return;return db['User'][_0x66e4('0x57')]({'where':{'id':_0x417966[_0x66e4('0x56')][_0x66e4('0x5f')],'role':_0x66e4('0x61')},'attributes':['id',_0x66e4('0x38'),_0x66e4('0x71'),_0x66e4('0x72'),_0x66e4('0x73')],'raw':!![]});}return null;})['then'](function(_0x568c0a){if(!_0x568c0a)return null;_0x4c73e5[_0x66e4('0x27')][_0x66e4('0x61')]=_0x568c0a;return _0x4c73e5;})[_0x66e4('0x4e')](function(_0x125b92){if(_0x125b92){if(_0x417966[_0x66e4('0x56')]['manual']){_0x4c73e5['message']['interface']=util['format'](_0x66e4('0x74'),_0x417966['user'][_0x66e4('0x38')]);_0x4c73e5[_0x66e4('0x27')][_0x66e4('0x75')]=_0x4c73e5['channel'];_0x4c73e5[_0x66e4('0x27')][_0x66e4('0x76')]=_0x4c73e5[_0x66e4('0x75')];_0x4c73e5[_0x66e4('0x27')]['event']=_0x66e4('0x5a');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x66e4('0x77'),'message':_[_0x66e4('0x4d')](_0x4c73e5[_0x66e4('0x27')],JSON['parse'](_0x4c73e5[_0x66e4('0x68')][_0x66e4('0x78')]))},client9002)[_0x66e4('0x4e')](function(){return _0x4c73e5;});}return _0x4c73e5;}return null;})[_0x66e4('0x4e')](respondWithResult(_0x12167c,null))[_0x66e4('0x29')](handleError(_0x12167c,null));};var interaction_log=require(_0x66e4('0x12'))(_0x66e4('0x59'));exports[_0x66e4('0x79')]=function(_0x201bd7,_0x2a8b32,_0x1098cb){var _0x401fc3={'agent':{},'channel':_0x66e4('0x5b')};if(_0x201bd7[_0x66e4('0x56')]['id']){delete _0x201bd7['body']['id'];}_0x201bd7[_0x66e4('0x56')][_0x66e4('0x5f')]=_0x201bd7[_0x66e4('0x56')][_0x66e4('0x5f')]||_0x201bd7['user']['id'];_0x401fc3['agent']['id']=_0x201bd7[_0x66e4('0x56')][_0x66e4('0x5f')];return db[_0x66e4('0x3c')][_0x66e4('0x57')]({'where':{'id':_0x201bd7['params']['id'],'UserId':null}})[_0x66e4('0x4e')](handleEntityNotFound(_0x2a8b32,null))[_0x66e4('0x4e')](function(_0x33c79e){if(_0x33c79e){_0x401fc3['message']=_0x33c79e['get']({'plain':!![]});return db[_0x66e4('0x63')]['find']({'where':{'id':_0x33c79e[_0x66e4('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x2a8b32,null))[_0x66e4('0x4e')](function(_0x511e8a){if(_0x511e8a){_0x401fc3[_0x66e4('0x68')]=_0x511e8a[_0x66e4('0x62')]({'plain':!![]});interaction_log[_0x66e4('0x1f')](_0x66e4('0x7a'),_0x201bd7[_0x66e4('0x60')]['id'],_0x201bd7['user']['name'],_0x201bd7[_0x66e4('0x60')]['role'],_0x401fc3[_0x66e4('0x68')]['id'],_0x201bd7[_0x66e4('0x56')]?JSON[_0x66e4('0x24')](_0x201bd7[_0x66e4('0x56')]):_0x66e4('0x69'));return respondWithRpcPromise(_0x66e4('0x7b'),_0x66e4('0x7c'),_0x401fc3);}return null;})[_0x66e4('0x4e')](function(_0x56e429){var _0x23a246=_0x66e4('0x7d')+_0x56e429[_0x66e4('0x27')]['ContactId'];return db[_0x66e4('0x6d')]['query'](_0x23a246,{'type':db[_0x66e4('0x6e')]['QueryTypes']['SELECT'],'raw':!![]})[_0x66e4('0x4e')](function(_0x3a563e){return _0x3a563e;});})[_0x66e4('0x4e')](function(_0x34ec50){if(_0x34ec50){_0x401fc3[_0x66e4('0x27')]['contact']=_0x34ec50[0x0];if(!_0x201bd7['body'][_0x66e4('0x5f')])return;return db['User'][_0x66e4('0x57')]({'where':{'id':_0x201bd7[_0x66e4('0x56')][_0x66e4('0x5f')],'role':_0x66e4('0x61')},'attributes':['id',_0x66e4('0x38'),_0x66e4('0x71'),_0x66e4('0x72'),_0x66e4('0x73')],'raw':!![]});}return null;})[_0x66e4('0x4e')](function(_0x2a4f90){if(!_0x2a4f90)return null;_0x401fc3[_0x66e4('0x27')][_0x66e4('0x61')]=_0x2a4f90;return _0x401fc3;})[_0x66e4('0x4e')](function(_0x1b6ae2){if(_0x1b6ae2){_0x1b6ae2[_0x66e4('0x27')][_0x66e4('0x7e')]=util['format'](_0x66e4('0x74'),_0x201bd7[_0x66e4('0x60')]['name']);_0x1b6ae2['message'][_0x66e4('0x75')]=_0x401fc3[_0x66e4('0x75')];_0x1b6ae2[_0x66e4('0x27')][_0x66e4('0x76')]=_0x401fc3[_0x66e4('0x75')];_0x1b6ae2['message']['event']=_0x66e4('0x79');respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_[_0x66e4('0x4d')](_0x401fc3[_0x66e4('0x27')],JSON[_0x66e4('0x7f')](_0x401fc3[_0x66e4('0x68')]['formData']))},client9002);return _0x401fc3;}return null;})[_0x66e4('0x4e')](respondWithResult(_0x2a8b32,null))[_0x66e4('0x29')](handleError(_0x2a8b32,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index a314ac2..7a8d69c 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 _0x3f36=['ChatMessage','save','update','remove','emit','exports','events','../../mysqldb'];(function(_0x3f25ee,_0x9c86df){var _0x2523fd=function(_0x98679e){while(--_0x98679e){_0x3f25ee['push'](_0x3f25ee['shift']());}};_0x2523fd(++_0x9c86df);}(_0x3f36,0x176));var _0x63f3=function(_0x5a1cc9,_0x28f54d){_0x5a1cc9=_0x5a1cc9-0x0;var _0x471761=_0x3f36[_0x5a1cc9];return _0x471761;};'use strict';var EventEmitter=require(_0x63f3('0x0'));var ChatMessage=require(_0x63f3('0x1'))['db'][_0x63f3('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x63f3('0x3'),'afterUpdate':_0x63f3('0x4'),'afterDestroy':_0x63f3('0x5')};function emitEvent(_0x45ffd4){return function(_0x482d1f,_0x281c90,_0x4c503b){ChatMessageEvents[_0x63f3('0x6')](_0x45ffd4+':'+_0x482d1f['id'],_0x482d1f);ChatMessageEvents[_0x63f3('0x6')](_0x45ffd4,_0x482d1f);_0x4c503b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x63f3('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0x03cc=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','events','ChatMessage'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x03cc,0x17e));var _0xc03c=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x03cc[_0x3ab51d];return _0x29a04e;};'use strict';var EventEmitter=require(_0xc03c('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0xc03c('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xc03c('0x2')](0x0);var events={'afterCreate':_0xc03c('0x3'),'afterUpdate':'update','afterDestroy':_0xc03c('0x4')};function emitEvent(_0x216cb5){return function(_0x104bbf,_0x3b2f9b,_0x448f68){ChatMessageEvents[_0xc03c('0x5')](_0x216cb5+':'+_0x104bbf['id'],_0x104bbf);ChatMessageEvents[_0xc03c('0x5')](_0x216cb5,_0x104bbf);_0x448f68(null);};}for(var e in events){if(events[_0xc03c('0x6')](e)){var event=events[e];ChatMessage[_0xc03c('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 51494b4..0d10526 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 _0x507e=['ChatInteractionId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','rimraf','./chatMessage.attributes','ChatMessage','chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne'];(function(_0x40292e,_0xaa2a7b){var _0x1ed986=function(_0x10dbef){while(--_0x10dbef){_0x40292e['push'](_0x40292e['shift']());}};_0x1ed986(++_0xaa2a7b);}(_0x507e,0x98));var _0xe507=function(_0x2fcf18,_0x10009a){_0x2fcf18=_0x2fcf18-0x0;var _0x4c68cc=_0x507e[_0x2fcf18];return _0x4c68cc;};'use strict';var _=require(_0xe507('0x0'));var util=require(_0xe507('0x1'));var logger=require(_0xe507('0x2'))(_0xe507('0x3'));var moment=require(_0xe507('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe507('0x5'));var rimraf=require(_0xe507('0x6'));var config=require('../../config/environment');var attributes=require(_0xe507('0x7'));module['exports']=function(_0x2245d7,_0x1066e7){return _0x2245d7['define'](_0xe507('0x8'),attributes,{'tableName':_0xe507('0x9'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xe507('0xa')],'type':_0xe507('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xb4b049,_0x3e7dd5,_0xc9796e){var _0x21094f=_0x2245d7[_0xe507('0xc')];var _0x1663ec=_0xb4b049[_0xe507('0xd')]({'plain':!![]});if(_0x1663ec[_0xe507('0xe')][_0xe507('0xf')]()==='in'||_0x1663ec[_0xe507('0xe')]['toLowerCase']()===_0xe507('0x10')&&!_0x1663ec[_0xe507('0x11')]&&!_[_0xe507('0x12')](_0x1663ec[_0xe507('0x13')])){_0x21094f[_0xe507('0x14')][_0xe507('0x15')]({'where':{'id':_0x1663ec[_0xe507('0x16')]}})[_0xe507('0x17')](function(_0x2256ac){if(_0x2256ac){_0x2256ac[_0xe507('0x18')]({'lastMsgAt':_0x1663ec['createdAt'],'lastMsgDirection':_0x1663ec[_0xe507('0xe')][_0xe507('0xf')]()});}})[_0xe507('0x19')](function(_0x55250c){console[_0xe507('0x1a')](_0x55250c);});}_0xc9796e();}},'charset':_0xe507('0x1b'),'collate':_0xe507('0x1c')});};
\ No newline at end of file
+var _0x3544=['lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','UserId','ChatInteraction','ChatInteractionId','then','update','catch','error'];(function(_0x9ce050,_0x591cd4){var _0x3f754e=function(_0x1e61fc){while(--_0x1e61fc){_0x9ce050['push'](_0x9ce050['shift']());}};_0x3f754e(++_0x591cd4);}(_0x3544,0x70));var _0x4354=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x3544[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0x4354('0x0'));var util=require(_0x4354('0x1'));var logger=require(_0x4354('0x2'))('api');var moment=require(_0x4354('0x3'));var BPromise=require(_0x4354('0x4'));var rp=require(_0x4354('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4354('0x6'));var config=require(_0x4354('0x7'));var attributes=require(_0x4354('0x8'));module[_0x4354('0x9')]=function(_0x5ca913,_0x4a0e1e){return _0x5ca913[_0x4354('0xa')](_0x4354('0xb'),attributes,{'tableName':_0x4354('0xc'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x4354('0xd')],'type':_0x4354('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x537b64,_0x114701,_0xbc0c35){var _0x42bc38=_0x5ca913[_0x4354('0xf')];var _0x20cef4=_0x537b64[_0x4354('0x10')]({'plain':!![]});if(_0x20cef4['direction'][_0x4354('0x11')]()==='in'||_0x20cef4[_0x4354('0x12')][_0x4354('0x11')]()===_0x4354('0x13')&&!_0x20cef4[_0x4354('0x14')]&&!_['isNil'](_0x20cef4[_0x4354('0x15')])){_0x42bc38[_0x4354('0x16')]['findOne']({'where':{'id':_0x20cef4[_0x4354('0x17')]}})[_0x4354('0x18')](function(_0x523449){if(_0x523449){_0x523449[_0x4354('0x19')]({'lastMsgAt':_0x20cef4['createdAt'],'lastMsgDirection':_0x20cef4[_0x4354('0x12')]['toLowerCase']()});}})[_0x4354('0x1a')](function(_0x18bcfd){console[_0x4354('0x1b')](_0x18bcfd);});}_0xbc0c35();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 40ad3b4..b2ef45f 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 _0xadc2=['stringify','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateChatMessage','ChatMessage','create','options','raw'];(function(_0x31e4c6,_0x27d39c){var _0x56c225=function(_0x54fb1a){while(--_0x54fb1a){_0x31e4c6['push'](_0x31e4c6['shift']());}};_0x56c225(++_0x27d39c);}(_0xadc2,0x187));var _0x2adc=function(_0x79a6e8,_0x1c2b24){_0x79a6e8=_0x79a6e8-0x0;var _0xeeb993=_0xadc2[_0x79a6e8];return _0xeeb993;};'use strict';var _=require(_0x2adc('0x0'));var util=require('util');var moment=require(_0x2adc('0x1'));var BPromise=require(_0x2adc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2adc('0x3'));var db=require(_0x2adc('0x4'))['db'];var utils=require(_0x2adc('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x2adc('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2adc('0x7')]['http']({'port':0x232a});config[_0x2adc('0x8')]=_[_0x2adc('0x9')](config[_0x2adc('0x8')],{'host':_0x2adc('0xa'),'port':0x18eb});var socket=require(_0x2adc('0xb'))(new Redis(config[_0x2adc('0x8')]));require(_0x2adc('0xc'))['register'](socket);function respondWithRpcPromise(_0x5ecc9e,_0x47bd14,_0x2004d4){return new BPromise(function(_0x195413,_0x4f0a5f){return client[_0x2adc('0xd')](_0x5ecc9e,_0x2004d4)[_0x2adc('0xe')](function(_0x2fc249){logger[_0x2adc('0xf')](_0x2adc('0x10'),_0x47bd14,_0x2adc('0x11'));logger[_0x2adc('0x12')](_0x2adc('0x13'),_0x47bd14,_0x2adc('0x11'),JSON['stringify'](_0x2fc249));if(_0x2fc249[_0x2adc('0x14')]){if(_0x2fc249['error'][_0x2adc('0x15')]===0x1f4){logger[_0x2adc('0x14')](_0x2adc('0x10'),_0x47bd14,_0x2fc249[_0x2adc('0x14')][_0x2adc('0x16')]);return _0x4f0a5f(_0x2fc249[_0x2adc('0x14')][_0x2adc('0x16')]);}logger[_0x2adc('0x14')](_0x2adc('0x10'),_0x47bd14,_0x2fc249['error'][_0x2adc('0x16')]);return _0x195413(_0x2fc249[_0x2adc('0x14')][_0x2adc('0x16')]);}else{logger[_0x2adc('0xf')](_0x2adc('0x10'),_0x47bd14,_0x2adc('0x11'));_0x195413(_0x2fc249['result'][_0x2adc('0x16')]);}})[_0x2adc('0x17')](function(_0x532936){logger['error'](_0x2adc('0x10'),_0x47bd14,_0x532936);_0x4f0a5f(_0x532936);});});}exports[_0x2adc('0x18')]=function(_0x4ae909){var _0x58f93b=this;return new Promise(function(_0x7a68e1,_0xae0697){return db[_0x2adc('0x19')][_0x2adc('0x1a')](_0x4ae909['body'],{'raw':_0x4ae909[_0x2adc('0x1b')]?_0x4ae909[_0x2adc('0x1b')][_0x2adc('0x1c')]===undefined?!![]:![]:!![]})[_0x2adc('0xe')](function(_0x5382f2){logger[_0x2adc('0xf')](_0x2adc('0x18'),_0x4ae909);logger[_0x2adc('0x12')](_0x2adc('0x18'),_0x4ae909,JSON[_0x2adc('0x1d')](_0x5382f2));_0x7a68e1(_0x5382f2);})[_0x2adc('0x17')](function(_0xe53f4b){logger[_0x2adc('0x14')](_0x2adc('0x18'),_0xe53f4b['message'],_0x4ae909);_0xae0697(_0x58f93b[_0x2adc('0x14')](0x1f4,_0xe53f4b['message']));});});};
\ No newline at end of file
+var _0x46f2=['localhost','socket.io-emitter','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateChatMessage','create','body','raw','debug','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x542f28,_0x56b45d){var _0x4b728c=function(_0x41acd4){while(--_0x41acd4){_0x542f28['push'](_0x542f28['shift']());}};_0x4b728c(++_0x56b45d);}(_0x46f2,0x133));var _0x246f=function(_0x5d7bfa,_0x1c1789){_0x5d7bfa=_0x5d7bfa-0x0;var _0x341b8e=_0x46f2[_0x5d7bfa];return _0x341b8e;};'use strict';var _=require(_0x246f('0x0'));var util=require(_0x246f('0x1'));var moment=require(_0x246f('0x2'));var BPromise=require(_0x246f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x246f('0x4'));var db=require(_0x246f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x246f('0x6'))(_0x246f('0x7'));var config=require(_0x246f('0x8'));var jayson=require(_0x246f('0x9'));var client=jayson[_0x246f('0xa')][_0x246f('0xb')]({'port':0x232a});config[_0x246f('0xc')]=_['defaults'](config[_0x246f('0xc')],{'host':_0x246f('0xd'),'port':0x18eb});var socket=require(_0x246f('0xe'))(new Redis(config[_0x246f('0xc')]));require('./chatMessage.socket')[_0x246f('0xf')](socket);function respondWithRpcPromise(_0x132223,_0x4a0a64,_0x9c91a1){return new BPromise(function(_0x85a6e,_0x3fe60f){return client[_0x246f('0x10')](_0x132223,_0x9c91a1)[_0x246f('0x11')](function(_0x590e22){logger['info'](_0x246f('0x12'),_0x4a0a64,_0x246f('0x13'));logger['debug'](_0x246f('0x14'),_0x4a0a64,_0x246f('0x13'),JSON['stringify'](_0x590e22));if(_0x590e22[_0x246f('0x15')]){if(_0x590e22[_0x246f('0x15')][_0x246f('0x16')]===0x1f4){logger['error'](_0x246f('0x12'),_0x4a0a64,_0x590e22[_0x246f('0x15')][_0x246f('0x17')]);return _0x3fe60f(_0x590e22['error'][_0x246f('0x17')]);}logger[_0x246f('0x15')](_0x246f('0x12'),_0x4a0a64,_0x590e22[_0x246f('0x15')]['message']);return _0x85a6e(_0x590e22['error']['message']);}else{logger['info'](_0x246f('0x12'),_0x4a0a64,_0x246f('0x13'));_0x85a6e(_0x590e22[_0x246f('0x18')][_0x246f('0x17')]);}})[_0x246f('0x19')](function(_0x5718e3){logger[_0x246f('0x15')](_0x246f('0x12'),_0x4a0a64,_0x5718e3);_0x3fe60f(_0x5718e3);});});}exports[_0x246f('0x1a')]=function(_0x2d55ab){var _0x3d5f8d=this;return new Promise(function(_0x798d82,_0x32c39f){return db['ChatMessage'][_0x246f('0x1b')](_0x2d55ab[_0x246f('0x1c')],{'raw':_0x2d55ab['options']?_0x2d55ab['options'][_0x246f('0x1d')]===undefined?!![]:![]:!![]})[_0x246f('0x11')](function(_0x16e4ff){logger['info'](_0x246f('0x1a'),_0x2d55ab);logger[_0x246f('0x1e')](_0x246f('0x1a'),_0x2d55ab,JSON[_0x246f('0x1f')](_0x16e4ff));_0x798d82(_0x16e4ff);})[_0x246f('0x19')](function(_0x2aace3){logger[_0x246f('0x15')]('CreateChatMessage',_0x2aace3[_0x246f('0x17')],_0x2d55ab);_0x32c39f(_0x3d5f8d['error'](0x1f4,_0x2aace3[_0x246f('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 2f93300..e35e768 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 _0x432b=['remove','update','removeListener','length','chatMessage:','./chatMessage.events'];(function(_0x456cbb,_0x547275){var _0x9c3a70=function(_0x1c8686){while(--_0x1c8686){_0x456cbb['push'](_0x456cbb['shift']());}};_0x9c3a70(++_0x547275);}(_0x432b,0x161));var _0xb432=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x432b[_0x3dd15e];return _0x231fd0;};'use strict';var ChatMessageEvents=require(_0xb432('0x0'));var events=['save',_0xb432('0x1'),_0xb432('0x2')];function createListener(_0x7170b6,_0xee80f1){return function(_0x5173f6){_0xee80f1['emit'](_0x7170b6,_0x5173f6);};}function removeListener(_0x93e722,_0x4cefc4){return function(){ChatMessageEvents[_0xb432('0x3')](_0x93e722,_0x4cefc4);};}exports['register']=function(_0x143093){for(var _0x3f1a78=0x0,_0x274447=events[_0xb432('0x4')];_0x3f1a78<_0x274447;_0x3f1a78++){var _0x14fed4=events[_0x3f1a78];var _0x6833df=createListener(_0xb432('0x5')+_0x14fed4,_0x143093);ChatMessageEvents['on'](_0x14fed4,_0x6833df);}};
\ No newline at end of file
+var _0x0faf=['update','emit','removeListener','length','chatMessage:','./chatMessage.events','remove'];(function(_0x4ac424,_0x554b5d){var _0xe1b890=function(_0x5e85c4){while(--_0x5e85c4){_0x4ac424['push'](_0x4ac424['shift']());}};_0xe1b890(++_0x554b5d);}(_0x0faf,0x132));var _0xf0fa=function(_0x172948,_0x4262cc){_0x172948=_0x172948-0x0;var _0x4aeaa9=_0x0faf[_0x172948];return _0x4aeaa9;};'use strict';var ChatMessageEvents=require(_0xf0fa('0x0'));var events=['save',_0xf0fa('0x1'),_0xf0fa('0x2')];function createListener(_0x2c6207,_0x35a260){return function(_0xccb93e){_0x35a260[_0xf0fa('0x3')](_0x2c6207,_0xccb93e);};}function removeListener(_0x515b12,_0xc83253){return function(){ChatMessageEvents[_0xf0fa('0x4')](_0x515b12,_0xc83253);};}exports['register']=function(_0x3637a3){for(var _0x44ffa0=0x0,_0x25b5c4=events[_0xf0fa('0x5')];_0x44ffa0<_0x25b5c4;_0x44ffa0++){var _0x2db1d9=events[_0x44ffa0];var _0x587865=createListener(_0xf0fa('0x6')+_0x2db1d9,_0x3637a3);ChatMessageEvents['on'](_0x2db1d9,_0x587865);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index dd9f82a..d6e6f1c 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 _0x75a8=['./chatMessage.controller','isAuthenticated','index','/describe','describe','get','show','tracked','chat','chatmessage:create','create','/:id','update','put','/:id/accept','/:id/reject','delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x17c852,_0xa5e905){var _0x2a6cfa=function(_0x4a064a){while(--_0x4a064a){_0x17c852['push'](_0x17c852['shift']());}};_0x2a6cfa(++_0xa5e905);}(_0x75a8,0xc1));var _0x875a=function(_0x2f9fba,_0x4214c6){_0x2f9fba=_0x2f9fba-0x0;var _0x51743d=_0x75a8[_0x2f9fba];return _0x51743d;};'use strict';var multer=require('multer');var util=require(_0x875a('0x0'));var path=require(_0x875a('0x1'));var timeout=require('connect-timeout');var express=require(_0x875a('0x2'));var router=express[_0x875a('0x3')]();var fs_extra=require(_0x875a('0x4'));var auth=require(_0x875a('0x5'));var interaction=require(_0x875a('0x6'));var config=require('../../config/environment');var controller=require(_0x875a('0x7'));router['get']('/',auth[_0x875a('0x8')](),controller[_0x875a('0x9')]);router['get'](_0x875a('0xa'),auth['isAuthenticated'](),controller[_0x875a('0xb')]);router[_0x875a('0xc')]('/:id',auth[_0x875a('0x8')](),controller[_0x875a('0xd')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x875a('0xe')](_0x875a('0xf'),_0x875a('0x10')),controller[_0x875a('0x11')]);router['put'](_0x875a('0x12'),controller[_0x875a('0x13')]);router[_0x875a('0x14')](_0x875a('0x15'),auth['isAuthenticated'](),controller['accept']);router[_0x875a('0x14')](_0x875a('0x16'),auth[_0x875a('0x8')](),controller['reject']);router[_0x875a('0x17')](_0x875a('0x12'),auth[_0x875a('0x8')](),controller['destroy']);module[_0x875a('0x18')]=router;
\ No newline at end of file
+var _0xec31=['../../config/environment','./chatMessage.controller','index','get','isAuthenticated','describe','/:id','show','post','create','put','update','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3d35a2,_0x1240da){var _0x539ed2=function(_0xf2c2e9){while(--_0xf2c2e9){_0x3d35a2['push'](_0x3d35a2['shift']());}};_0x539ed2(++_0x1240da);}(_0xec31,0xd2));var _0x1ec3=function(_0x37b0ba,_0xe3601e){_0x37b0ba=_0x37b0ba-0x0;var _0x20586f=_0xec31[_0x37b0ba];return _0x20586f;};'use strict';var multer=require(_0x1ec3('0x0'));var util=require('util');var path=require(_0x1ec3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1ec3('0x2')]();var fs_extra=require(_0x1ec3('0x3'));var auth=require(_0x1ec3('0x4'));var interaction=require(_0x1ec3('0x5'));var config=require(_0x1ec3('0x6'));var controller=require(_0x1ec3('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x1ec3('0x8')]);router[_0x1ec3('0x9')]('/describe',auth[_0x1ec3('0xa')](),controller[_0x1ec3('0xb')]);router[_0x1ec3('0x9')](_0x1ec3('0xc'),auth['isAuthenticated'](),controller[_0x1ec3('0xd')]);router[_0x1ec3('0xe')]('/',auth[_0x1ec3('0xa')](),interaction['tracked']('chat','chatmessage:create'),controller[_0x1ec3('0xf')]);router[_0x1ec3('0x10')](_0x1ec3('0xc'),controller[_0x1ec3('0x11')]);router[_0x1ec3('0x10')](_0x1ec3('0x12'),auth['isAuthenticated'](),controller[_0x1ec3('0x13')]);router[_0x1ec3('0x10')](_0x1ec3('0x14'),auth['isAuthenticated'](),controller['reject']);router[_0x1ec3('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x1ec3('0x16')]);module[_0x1ec3('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index f1b9769..4233607 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 _0x0b0e=['medium','sequelize','TEXT'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2cef86,_0xbae0a6){_0x2cef86=_0x2cef86-0x0;var _0x46dfd6=_0x0b0e[_0x2cef86];return _0x46dfd6;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0xadb5=['medium','TEXT','exports'];(function(_0x3a155c,_0x513947){var _0x414949=function(_0x5c0860){while(--_0x5c0860){_0x3a155c['push'](_0x3a155c['shift']());}};_0x414949(++_0x513947);}(_0xadb5,0xad));var _0x5adb=function(_0x1cafb7,_0x32ac35){_0x1cafb7=_0x1cafb7-0x0;var _0xa94212=_0xadb5[_0x1cafb7];return _0xa94212;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index c15d8a7..8b00dff 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x1ba832,_0x2e39a5){var _0x35e956=function(_0x1efa4f){while(--_0x1efa4f){_0x1ba832['push'](_0x1ba832['shift']());}};_0x35e956(++_0x2e39a5);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x7a54,0x106));var _0x47a5=function(_0x473df4,_0x1b864b){_0x473df4=_0x473df4-0x0;var _0x2c0380=_0x7a54[_0x473df4];return _0x2c0380;};'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 5afdfcf..261390e 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 _0x9983=['emit','exports','events','ChatOfflineMessage','setMaxListeners','save','remove'];(function(_0x5704b1,_0x4b142d){var _0x3bff7f=function(_0x28677d){while(--_0x28677d){_0x5704b1['push'](_0x5704b1['shift']());}};_0x3bff7f(++_0x4b142d);}(_0x9983,0x159));var _0x3998=function(_0x66c8e8,_0x304ead){_0x66c8e8=_0x66c8e8-0x0;var _0x77f6e6=_0x9983[_0x66c8e8];return _0x77f6e6;};'use strict';var EventEmitter=require(_0x3998('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0x3998('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x3998('0x2')](0x0);var events={'afterCreate':_0x3998('0x3'),'afterUpdate':'update','afterDestroy':_0x3998('0x4')};function emitEvent(_0x57fbfd){return function(_0x125bb5,_0x777c1,_0xd9014f){ChatOfflineMessageEvents[_0x3998('0x5')](_0x57fbfd+':'+_0x125bb5['id'],_0x125bb5);ChatOfflineMessageEvents['emit'](_0x57fbfd,_0x125bb5);_0xd9014f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x3998('0x6')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xfcac=['save','update','hasOwnProperty','hook','exports','events','setMaxListeners'];(function(_0x579726,_0x8c63ff){var _0x15c7d8=function(_0x80a3ce){while(--_0x80a3ce){_0x579726['push'](_0x579726['shift']());}};_0x15c7d8(++_0x8c63ff);}(_0xfcac,0x1a9));var _0xcfca=function(_0x154cda,_0x3aa6ae){_0x154cda=_0x154cda-0x0;var _0x1861cd=_0xfcac[_0x154cda];return _0x1861cd;};'use strict';var EventEmitter=require(_0xcfca('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xcfca('0x1')](0x0);var events={'afterCreate':_0xcfca('0x2'),'afterUpdate':_0xcfca('0x3'),'afterDestroy':'remove'};function emitEvent(_0x94dc1b){return function(_0x406b59,_0xb0ebe6,_0x2768b1){ChatOfflineMessageEvents['emit'](_0x94dc1b+':'+_0x406b59['id'],_0x406b59);ChatOfflineMessageEvents['emit'](_0x94dc1b,_0x406b59);_0x2768b1(null);};}for(var e in events){if(events[_0xcfca('0x4')](e)){var event=events[e];ChatOfflineMessage[_0xcfca('0x5')](e,emitEvent(event));}}module[_0xcfca('0x6')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 142b64f..c45e66e 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 _0x3f54=['ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3f54,0xe4));var _0x43f5=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x3f54[_0x3ab9ee];return _0x82ee88;};'use strict';var attributes=require(_0x43f5('0x0'));module[_0x43f5('0x1')]=function(_0x2c75f5){return _0x2c75f5[_0x43f5('0x2')](_0x43f5('0x3'),attributes,{'tableName':_0x43f5('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x43f5('0x5'),'collate':_0x43f5('0x6')});};
\ No newline at end of file
+var _0x48b6=['utf8mb4_unicode_ci','exports','define','chat_offline_messages','utf8mb4'];(function(_0x135fb4,_0x50e172){var _0x1b7f11=function(_0x3d10e0){while(--_0x3d10e0){_0x135fb4['push'](_0x135fb4['shift']());}};_0x1b7f11(++_0x50e172);}(_0x48b6,0x1b4));var _0x648b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x48b6[_0x3dd15e];return _0x231fd0;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x648b('0x0')]=function(_0x15bac){return _0x15bac[_0x648b('0x1')]('ChatOfflineMessage',attributes,{'tableName':_0x648b('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x648b('0x3'),'collate':_0x648b('0x4')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 00e3e56..a8c9a81 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 _0x99fb=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash'];(function(_0x23796f,_0x15e83c){var _0x2ec3ca=function(_0x1436f7){while(--_0x1436f7){_0x23796f['push'](_0x23796f['shift']());}};_0x2ec3ca(++_0x15e83c);}(_0x99fb,0x92));var _0xb99f=function(_0x27a1df,_0xc3e527){_0x27a1df=_0x27a1df-0x0;var _0x4173cf=_0x99fb[_0x27a1df];return _0x4173cf;};'use strict';var _=require(_0xb99f('0x0'));var util=require('util');var moment=require(_0xb99f('0x1'));var BPromise=require(_0xb99f('0x2'));var rs=require(_0xb99f('0x3'));var fs=require('fs');var Redis=require(_0xb99f('0x4'));var db=require(_0xb99f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb99f('0x6'))(_0xb99f('0x7'));var config=require('../../config/environment');var jayson=require(_0xb99f('0x8'));var client=jayson[_0xb99f('0x9')][_0xb99f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f264e,_0x182c0c,_0x479d65){return new BPromise(function(_0xe317ff,_0x57b816){return client[_0xb99f('0xb')](_0x5f264e,_0x479d65)[_0xb99f('0xc')](function(_0x5e944b){logger[_0xb99f('0xd')](_0xb99f('0xe'),_0x182c0c,_0xb99f('0xf'));logger[_0xb99f('0x10')](_0xb99f('0x11'),_0x182c0c,_0xb99f('0xf'),JSON[_0xb99f('0x12')](_0x5e944b));if(_0x5e944b['error']){if(_0x5e944b[_0xb99f('0x13')]['code']===0x1f4){logger['error'](_0xb99f('0xe'),_0x182c0c,_0x5e944b[_0xb99f('0x13')][_0xb99f('0x14')]);return _0x57b816(_0x5e944b[_0xb99f('0x13')][_0xb99f('0x14')]);}logger['error'](_0xb99f('0xe'),_0x182c0c,_0x5e944b['error'][_0xb99f('0x14')]);return _0xe317ff(_0x5e944b[_0xb99f('0x13')]['message']);}else{logger[_0xb99f('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x182c0c,_0xb99f('0xf'));_0xe317ff(_0x5e944b['result'][_0xb99f('0x14')]);}})['catch'](function(_0x37a14c){logger['error'](_0xb99f('0xe'),_0x182c0c,_0x37a14c);_0x57b816(_0x37a14c);});});}
\ No newline at end of file
+var _0x89fe=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x89fe,0x83));var _0xe89f=function(_0x2e75c4,_0x5f39c8){_0x2e75c4=_0x2e75c4-0x0;var _0xed86a7=_0x89fe[_0x2e75c4];return _0xed86a7;};'use strict';var _=require(_0xe89f('0x0'));var util=require(_0xe89f('0x1'));var moment=require(_0xe89f('0x2'));var BPromise=require(_0xe89f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe89f('0x4'));var db=require(_0xe89f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe89f('0x6'))(_0xe89f('0x7'));var config=require(_0xe89f('0x8'));var jayson=require(_0xe89f('0x9'));var client=jayson[_0xe89f('0xa')][_0xe89f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24358f,_0x5427d2,_0x4639f0){return new BPromise(function(_0x3e9998,_0x7043f3){return client[_0xe89f('0xc')](_0x24358f,_0x4639f0)[_0xe89f('0xd')](function(_0x4fa2fa){logger[_0xe89f('0xe')](_0xe89f('0xf'),_0x5427d2,_0xe89f('0x10'));logger[_0xe89f('0x11')](_0xe89f('0x12'),_0x5427d2,_0xe89f('0x10'),JSON[_0xe89f('0x13')](_0x4fa2fa));if(_0x4fa2fa[_0xe89f('0x14')]){if(_0x4fa2fa[_0xe89f('0x14')][_0xe89f('0x15')]===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x5427d2,_0x4fa2fa['error']['message']);return _0x7043f3(_0x4fa2fa['error'][_0xe89f('0x16')]);}logger[_0xe89f('0x14')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5427d2,_0x4fa2fa['error'][_0xe89f('0x16')]);return _0x3e9998(_0x4fa2fa[_0xe89f('0x14')][_0xe89f('0x16')]);}else{logger[_0xe89f('0xe')](_0xe89f('0xf'),_0x5427d2,_0xe89f('0x10'));_0x3e9998(_0x4fa2fa[_0xe89f('0x17')][_0xe89f('0x16')]);}})[_0xe89f('0x18')](function(_0x16bfe0){logger['error'](_0xe89f('0xf'),_0x5427d2,_0x16bfe0);_0x7043f3(_0x16bfe0);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 83ff855..e378339 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 _0xea19=['/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index'];(function(_0x1b776e,_0x1d341e){var _0x3b8294=function(_0x352b9a){while(--_0x352b9a){_0x1b776e['push'](_0x1b776e['shift']());}};_0x3b8294(++_0x1d341e);}(_0xea19,0x9d));var _0x9ea1=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xea19[_0x297fd3];return _0x2af381;};'use strict';var multer=require(_0x9ea1('0x0'));var util=require(_0x9ea1('0x1'));var path=require(_0x9ea1('0x2'));var timeout=require(_0x9ea1('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9ea1('0x4'));var interaction=require(_0x9ea1('0x5'));var config=require(_0x9ea1('0x6'));var controller=require(_0x9ea1('0x7'));router[_0x9ea1('0x8')]('/',auth[_0x9ea1('0x9')](),controller[_0x9ea1('0xa')]);router[_0x9ea1('0x8')](_0x9ea1('0xb'),auth[_0x9ea1('0x9')](),controller[_0x9ea1('0xc')]);router[_0x9ea1('0x8')](_0x9ea1('0xd'),auth[_0x9ea1('0x9')](),controller[_0x9ea1('0xe')]);router[_0x9ea1('0xf')]('/',auth[_0x9ea1('0x9')](),controller[_0x9ea1('0x10')]);router[_0x9ea1('0x11')](_0x9ea1('0xd'),auth[_0x9ea1('0x9')](),controller[_0x9ea1('0x12')]);router['delete'](_0x9ea1('0xd'),auth[_0x9ea1('0x9')](),controller[_0x9ea1('0x13')]);module[_0x9ea1('0x14')]=router;
\ No newline at end of file
+var _0x1901=['delete','destroy','exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','post','create','update'];(function(_0x41eb03,_0x288379){var _0x224460=function(_0x432887){while(--_0x432887){_0x41eb03['push'](_0x41eb03['shift']());}};_0x224460(++_0x288379);}(_0x1901,0x19b));var _0x1190=function(_0x8f0df1,_0x2ba68f){_0x8f0df1=_0x8f0df1-0x0;var _0x2929a8=_0x1901[_0x8f0df1];return _0x2929a8;};'use strict';var multer=require(_0x1190('0x0'));var util=require('util');var path=require(_0x1190('0x1'));var timeout=require('connect-timeout');var express=require(_0x1190('0x2'));var router=express[_0x1190('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1190('0x4'));var config=require(_0x1190('0x5'));var controller=require('./chatOfflineMessage.controller');router[_0x1190('0x6')]('/',auth[_0x1190('0x7')](),controller['index']);router['get']('/describe',auth[_0x1190('0x7')](),controller[_0x1190('0x8')]);router['get'](_0x1190('0x9'),auth['isAuthenticated'](),controller[_0x1190('0xa')]);router[_0x1190('0xb')]('/',auth[_0x1190('0x7')](),controller[_0x1190('0xc')]);router['put']('/:id',auth[_0x1190('0x7')](),controller[_0x1190('0xd')]);router[_0x1190('0xe')](_0x1190('0x9'),auth[_0x1190('0x7')](),controller[_0x1190('0xf')]);module[_0x1190('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index f1fa748..5dc90cb 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 _0xd17b=['STRING','mouseOver','timeout','INTEGER','sequelize','exports'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xd17b,0x11e));var _0xbd17=function(_0x291f8b,_0x3b5591){_0x291f8b=_0x291f8b-0x0;var _0x275171=_0xd17b[_0x291f8b];return _0x275171;};'use strict';var Sequelize=require(_0xbd17('0x0'));module[_0xbd17('0x1')]={'name':{'type':Sequelize[_0xbd17('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbd17('0x3'),_0xbd17('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xbd17('0x2')]},'timeout':{'type':Sequelize[_0xbd17('0x5')]}};
\ No newline at end of file
+var _0x1a56=['timeout','STRING','ENUM','mouseOver'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x1a56,0x8d));var _0x61a5=function(_0x25c988,_0xce8221){_0x25c988=_0x25c988-0x0;var _0x45fcc2=_0x1a56[_0x25c988];return _0x45fcc2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x61a5('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x61a5('0x1')](_0x61a5('0x2'),_0x61a5('0x3')),'defaultValue':_0x61a5('0x2')},'selector':{'type':Sequelize[_0x61a5('0x0')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 68ac13d..af1a8a8 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 _0xf4d9=['eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','model','keys','ChatProactiveAction','query','attributes','intersection','fields','length','includeAll','merge','options','catch','create','body','find','params'];(function(_0x466286,_0x4ab711){var _0x2b740a=function(_0x10c51f){while(--_0x10c51f){_0x466286['push'](_0x466286['shift']());}};_0x2b740a(++_0x4ab711);}(_0xf4d9,0x7c));var _0x9f4d=function(_0xdba320,_0xebd2d1){_0xdba320=_0xdba320-0x0;var _0x250abb=_0xf4d9[_0xdba320];return _0x250abb;};'use strict';var emlformat=require(_0x9f4d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9f4d('0x1'));var jsonpatch=require(_0x9f4d('0x2'));var rp=require(_0x9f4d('0x3'));var moment=require(_0x9f4d('0x4'));var BPromise=require(_0x9f4d('0x5'));var Mustache=require('mustache');var util=require(_0x9f4d('0x6'));var path=require(_0x9f4d('0x7'));var sox=require(_0x9f4d('0x8'));var csv=require('to-csv');var ejs=require(_0x9f4d('0x9'));var fs=require('fs');var fs_extra=require(_0x9f4d('0xa'));var _=require(_0x9f4d('0xb'));var squel=require('squel');var crypto=require(_0x9f4d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9f4d('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9f4d('0xe'));var Papa=require(_0x9f4d('0xf'));var Redis=require(_0x9f4d('0x10'));var authService=require(_0x9f4d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9f4d('0x12'));var hardwareService=require(_0x9f4d('0x13'));var logger=require(_0x9f4d('0x14'))(_0x9f4d('0x15'));var utils=require(_0x9f4d('0x16'));var config=require(_0x9f4d('0x17'));var licenseUtil=require(_0x9f4d('0x18'));var db=require(_0x9f4d('0x19'))['db'];function respondWithStatusCode(_0x13c6fc,_0x112a7d){_0x112a7d=_0x112a7d||0xcc;return function(_0xfb475c){if(_0xfb475c){return _0x13c6fc['sendStatus'](_0x112a7d);}return _0x13c6fc[_0x9f4d('0x1a')](_0x112a7d)[_0x9f4d('0x1b')]();};}function respondWithResult(_0x35e7d4,_0x581e17){_0x581e17=_0x581e17||0xc8;return function(_0x12d180){if(_0x12d180){return _0x35e7d4[_0x9f4d('0x1a')](_0x581e17)[_0x9f4d('0x1c')](_0x12d180);}};}function respondWithFilteredResult(_0x178d8e,_0x514c01){return function(_0x4c8197){if(_0x4c8197){var _0x50534f=typeof _0x514c01[_0x9f4d('0x1d')]===_0x9f4d('0x1e')&&typeof _0x514c01[_0x9f4d('0x1f')]===_0x9f4d('0x1e');var _0x214195=_0x4c8197[_0x9f4d('0x20')];var _0x4f8bb9=_0x50534f?0x0:_0x514c01[_0x9f4d('0x1d')];var _0x3e0b7d=_0x50534f?_0x4c8197[_0x9f4d('0x20')]:_0x514c01[_0x9f4d('0x1d')]+_0x514c01[_0x9f4d('0x1f')];var _0x566d56;if(_0x3e0b7d>=_0x214195){_0x3e0b7d=_0x214195;_0x566d56=0xc8;}else{_0x566d56=0xce;}_0x178d8e[_0x9f4d('0x1a')](_0x566d56);return _0x178d8e[_0x9f4d('0x21')](_0x9f4d('0x22'),_0x4f8bb9+'-'+_0x3e0b7d+'/'+_0x214195)[_0x9f4d('0x1c')](_0x4c8197);}return null;};}function patchUpdates(_0x30577b){return function(_0x14cd44){try{jsonpatch[_0x9f4d('0x23')](_0x14cd44,_0x30577b,!![]);}catch(_0x3917ec){return BPromise[_0x9f4d('0x24')](_0x3917ec);}return _0x14cd44[_0x9f4d('0x25')]();};}function saveUpdates(_0x4f8c11,_0x5bc6ea){return function(_0xc4fd4){if(_0xc4fd4){return _0xc4fd4[_0x9f4d('0x26')](_0x4f8c11)['then'](function(_0x123fd2){return _0x123fd2;});}return null;};}function removeEntity(_0xa900ce,_0x392f65){return function(_0x3e9818){if(_0x3e9818){return _0x3e9818[_0x9f4d('0x27')]()[_0x9f4d('0x28')](function(){_0xa900ce[_0x9f4d('0x1a')](0xcc)[_0x9f4d('0x1b')]();});}};}function handleEntityNotFound(_0x1c1c9f,_0x5a1d6b){return function(_0x3c4541){if(!_0x3c4541){_0x1c1c9f[_0x9f4d('0x29')](0x194);}return _0x3c4541;};}function handleError(_0x46daca,_0x5b126a){_0x5b126a=_0x5b126a||0x1f4;return function(_0x74fa29){logger[_0x9f4d('0x2a')](_0x74fa29[_0x9f4d('0x2b')]);if(_0x74fa29[_0x9f4d('0x2c')]){delete _0x74fa29[_0x9f4d('0x2c')];}_0x46daca[_0x9f4d('0x1a')](_0x5b126a)[_0x9f4d('0x2d')](_0x74fa29);};}exports['show']=function(_0x4eb918,_0x461ebf){var _0x56b90a={'raw':!![],'where':{'id':_0x4eb918['params']['id']}},_0x16db57={};_0x16db57[_0x9f4d('0x2e')]=_[_0x9f4d('0x2f')](db[_0x9f4d('0x30')]['rawAttributes']);_0x16db57[_0x9f4d('0x31')]=_['keys'](_0x4eb918[_0x9f4d('0x31')]);_0x16db57['filters']=_['intersection'](_0x16db57[_0x9f4d('0x2e')],_0x16db57[_0x9f4d('0x31')]);_0x56b90a[_0x9f4d('0x32')]=_[_0x9f4d('0x33')](_0x16db57[_0x9f4d('0x2e')],qs[_0x9f4d('0x34')](_0x4eb918[_0x9f4d('0x31')]['fields']));_0x56b90a[_0x9f4d('0x32')]=_0x56b90a[_0x9f4d('0x32')][_0x9f4d('0x35')]?_0x56b90a[_0x9f4d('0x32')]:_0x16db57[_0x9f4d('0x2e')];if(_0x4eb918[_0x9f4d('0x31')][_0x9f4d('0x36')]){_0x56b90a['include']=[{'all':!![]}];}_0x56b90a=_[_0x9f4d('0x37')]({},_0x56b90a,_0x4eb918[_0x9f4d('0x38')]);return db[_0x9f4d('0x30')]['find'](_0x56b90a)[_0x9f4d('0x28')](handleEntityNotFound(_0x461ebf,null))[_0x9f4d('0x28')](respondWithResult(_0x461ebf,null))[_0x9f4d('0x39')](handleError(_0x461ebf,null));};exports[_0x9f4d('0x3a')]=function(_0xb29b50,_0x1c0fde){return db[_0x9f4d('0x30')][_0x9f4d('0x3a')](_0xb29b50[_0x9f4d('0x3b')],{})[_0x9f4d('0x28')](respondWithResult(_0x1c0fde,0xc9))[_0x9f4d('0x39')](handleError(_0x1c0fde,null));};exports['update']=function(_0x2bc3b5,_0x32eefe){if(_0x2bc3b5[_0x9f4d('0x3b')]['id']){delete _0x2bc3b5[_0x9f4d('0x3b')]['id'];}return db[_0x9f4d('0x30')][_0x9f4d('0x3c')]({'where':{'id':_0x2bc3b5[_0x9f4d('0x3d')]['id']}})[_0x9f4d('0x28')](handleEntityNotFound(_0x32eefe,null))[_0x9f4d('0x28')](saveUpdates(_0x2bc3b5[_0x9f4d('0x3b')],null))[_0x9f4d('0x28')](respondWithResult(_0x32eefe,null))[_0x9f4d('0x39')](handleError(_0x32eefe,null));};exports['destroy']=function(_0x440d05,_0x3d5f26){return db[_0x9f4d('0x30')][_0x9f4d('0x3c')]({'where':{'id':_0x440d05[_0x9f4d('0x3d')]['id']}})[_0x9f4d('0x28')](handleEntityNotFound(_0x3d5f26,null))['then'](removeEntity(_0x3d5f26,null))[_0x9f4d('0x39')](handleError(_0x3d5f26,null));};
\ No newline at end of file
+var _0x8917=['../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','Content-Range','json','reject','save','update','destroy','then','sendStatus','stack','name','send','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','ChatProactiveAction','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x4d0cf4,_0x479876){var _0x5cba11=function(_0x59e7cc){while(--_0x59e7cc){_0x4d0cf4['push'](_0x4d0cf4['shift']());}};_0x5cba11(++_0x479876);}(_0x8917,0x1d7));var _0x7891=function(_0x2061fa,_0x2b5b03){_0x2061fa=_0x2061fa-0x0;var _0x191585=_0x8917[_0x2061fa];return _0x191585;};'use strict';var emlformat=require(_0x7891('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7891('0x1'));var jsonpatch=require(_0x7891('0x2'));var rp=require(_0x7891('0x3'));var moment=require(_0x7891('0x4'));var BPromise=require(_0x7891('0x5'));var Mustache=require(_0x7891('0x6'));var util=require(_0x7891('0x7'));var path=require(_0x7891('0x8'));var sox=require(_0x7891('0x9'));var csv=require('to-csv');var ejs=require(_0x7891('0xa'));var fs=require('fs');var fs_extra=require(_0x7891('0xb'));var _=require(_0x7891('0xc'));var squel=require(_0x7891('0xd'));var crypto=require(_0x7891('0xe'));var jsforce=require(_0x7891('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7891('0x10'));var querystring=require('querystring');var Papa=require(_0x7891('0x11'));var Redis=require(_0x7891('0x12'));var authService=require(_0x7891('0x13'));var qs=require(_0x7891('0x14'));var as=require(_0x7891('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7891('0x16'))(_0x7891('0x17'));var utils=require(_0x7891('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7891('0x19'));var db=require(_0x7891('0x1a'))['db'];function respondWithStatusCode(_0x1a1dbc,_0x31692f){_0x31692f=_0x31692f||0xcc;return function(_0x1b481e){if(_0x1b481e){return _0x1a1dbc['sendStatus'](_0x31692f);}return _0x1a1dbc[_0x7891('0x1b')](_0x31692f)[_0x7891('0x1c')]();};}function respondWithResult(_0x2517f1,_0xc56bc0){_0xc56bc0=_0xc56bc0||0xc8;return function(_0x71e75c){if(_0x71e75c){return _0x2517f1[_0x7891('0x1b')](_0xc56bc0)['json'](_0x71e75c);}};}function respondWithFilteredResult(_0x1fa45b,_0x21a74f){return function(_0x5bfe12){if(_0x5bfe12){var _0x23286b=typeof _0x21a74f[_0x7891('0x1d')]==='undefined'&&typeof _0x21a74f[_0x7891('0x1e')]===_0x7891('0x1f');var _0x250f65=_0x5bfe12[_0x7891('0x20')];var _0x9ff8c2=_0x23286b?0x0:_0x21a74f[_0x7891('0x1d')];var _0x457f50=_0x23286b?_0x5bfe12[_0x7891('0x20')]:_0x21a74f[_0x7891('0x1d')]+_0x21a74f[_0x7891('0x1e')];var _0x20da1e;if(_0x457f50>=_0x250f65){_0x457f50=_0x250f65;_0x20da1e=0xc8;}else{_0x20da1e=0xce;}_0x1fa45b['status'](_0x20da1e);return _0x1fa45b['set'](_0x7891('0x21'),_0x9ff8c2+'-'+_0x457f50+'/'+_0x250f65)[_0x7891('0x22')](_0x5bfe12);}return null;};}function patchUpdates(_0x30b2ae){return function(_0x4c76fe){try{jsonpatch['apply'](_0x4c76fe,_0x30b2ae,!![]);}catch(_0x19a628){return BPromise[_0x7891('0x23')](_0x19a628);}return _0x4c76fe[_0x7891('0x24')]();};}function saveUpdates(_0x36f66a,_0x155a97){return function(_0xf09f20){if(_0xf09f20){return _0xf09f20[_0x7891('0x25')](_0x36f66a)['then'](function(_0x28a917){return _0x28a917;});}return null;};}function removeEntity(_0xab091c,_0x27f2e0){return function(_0x2de356){if(_0x2de356){return _0x2de356[_0x7891('0x26')]()[_0x7891('0x27')](function(){_0xab091c[_0x7891('0x1b')](0xcc)[_0x7891('0x1c')]();});}};}function handleEntityNotFound(_0x24372f,_0x2acda5){return function(_0x55108b){if(!_0x55108b){_0x24372f[_0x7891('0x28')](0x194);}return _0x55108b;};}function handleError(_0x369740,_0x397d03){_0x397d03=_0x397d03||0x1f4;return function(_0x12ed70){logger['error'](_0x12ed70[_0x7891('0x29')]);if(_0x12ed70['name']){delete _0x12ed70[_0x7891('0x2a')];}_0x369740[_0x7891('0x1b')](_0x397d03)[_0x7891('0x2b')](_0x12ed70);};}exports['show']=function(_0x4009f8,_0x1a6bef){var _0x44442f={'raw':!![],'where':{'id':_0x4009f8[_0x7891('0x2c')]['id']}},_0x263f13={};_0x263f13[_0x7891('0x2d')]=_[_0x7891('0x2e')](db['ChatProactiveAction'][_0x7891('0x2f')]);_0x263f13['query']=_[_0x7891('0x2e')](_0x4009f8[_0x7891('0x30')]);_0x263f13[_0x7891('0x31')]=_[_0x7891('0x32')](_0x263f13[_0x7891('0x2d')],_0x263f13[_0x7891('0x30')]);_0x44442f[_0x7891('0x33')]=_['intersection'](_0x263f13[_0x7891('0x2d')],qs[_0x7891('0x34')](_0x4009f8[_0x7891('0x30')][_0x7891('0x34')]));_0x44442f[_0x7891('0x33')]=_0x44442f[_0x7891('0x33')][_0x7891('0x35')]?_0x44442f['attributes']:_0x263f13['model'];if(_0x4009f8['query']['includeAll']){_0x44442f[_0x7891('0x36')]=[{'all':!![]}];}_0x44442f=_[_0x7891('0x37')]({},_0x44442f,_0x4009f8[_0x7891('0x38')]);return db[_0x7891('0x39')][_0x7891('0x3a')](_0x44442f)[_0x7891('0x27')](handleEntityNotFound(_0x1a6bef,null))['then'](respondWithResult(_0x1a6bef,null))[_0x7891('0x3b')](handleError(_0x1a6bef,null));};exports[_0x7891('0x3c')]=function(_0x19e258,_0x2c1c67){return db[_0x7891('0x39')][_0x7891('0x3c')](_0x19e258[_0x7891('0x3d')],{})['then'](respondWithResult(_0x2c1c67,0xc9))[_0x7891('0x3b')](handleError(_0x2c1c67,null));};exports['update']=function(_0x16ca6d,_0x5ba995){if(_0x16ca6d[_0x7891('0x3d')]['id']){delete _0x16ca6d[_0x7891('0x3d')]['id'];}return db[_0x7891('0x39')][_0x7891('0x3a')]({'where':{'id':_0x16ca6d[_0x7891('0x2c')]['id']}})['then'](handleEntityNotFound(_0x5ba995,null))[_0x7891('0x27')](saveUpdates(_0x16ca6d[_0x7891('0x3d')],null))[_0x7891('0x27')](respondWithResult(_0x5ba995,null))[_0x7891('0x3b')](handleError(_0x5ba995,null));};exports[_0x7891('0x26')]=function(_0x516d5c,_0x4e63ee){return db['ChatProactiveAction'][_0x7891('0x3a')]({'where':{'id':_0x516d5c[_0x7891('0x2c')]['id']}})[_0x7891('0x27')](handleEntityNotFound(_0x4e63ee,null))[_0x7891('0x27')](removeEntity(_0x4e63ee,null))[_0x7891('0x3b')](handleError(_0x4e63ee,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 2456bd8..25b7b58 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 _0x1961=['define','ChatProactiveAction','chat_proactive_actions','lodash','util','api','bluebird','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports'];(function(_0x1a86c1,_0xb46e14){var _0x496463=function(_0x498a74){while(--_0x498a74){_0x1a86c1['push'](_0x1a86c1['shift']());}};_0x496463(++_0xb46e14);}(_0x1961,0xb7));var _0x1196=function(_0x467798,_0x12dee9){_0x467798=_0x467798-0x0;var _0x2e6413=_0x1961[_0x467798];return _0x2e6413;};'use strict';var _=require(_0x1196('0x0'));var util=require(_0x1196('0x1'));var logger=require('../../config/logger')(_0x1196('0x2'));var moment=require('moment');var BPromise=require(_0x1196('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1196('0x4'));var rimraf=require(_0x1196('0x5'));var config=require(_0x1196('0x6'));var attributes=require(_0x1196('0x7'));module[_0x1196('0x8')]=function(_0x52eaf0,_0x445965){return _0x52eaf0[_0x1196('0x9')](_0x1196('0xa'),attributes,{'tableName':_0x1196('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa396=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction'];(function(_0x3b0836,_0x4587b4){var _0x310494=function(_0x4e3e11){while(--_0x4e3e11){_0x3b0836['push'](_0x3b0836['shift']());}};_0x310494(++_0x4587b4);}(_0xa396,0x1a0));var _0x6a39=function(_0x49a802,_0x28f58d){_0x49a802=_0x49a802-0x0;var _0x552818=_0xa396[_0x49a802];return _0x552818;};'use strict';var _=require(_0x6a39('0x0'));var util=require(_0x6a39('0x1'));var logger=require(_0x6a39('0x2'))(_0x6a39('0x3'));var moment=require('moment');var BPromise=require(_0x6a39('0x4'));var rp=require(_0x6a39('0x5'));var fs=require('fs');var path=require(_0x6a39('0x6'));var rimraf=require(_0x6a39('0x7'));var config=require(_0x6a39('0x8'));var attributes=require(_0x6a39('0x9'));module[_0x6a39('0xa')]=function(_0x4e7fe0,_0x39756a){return _0x4e7fe0[_0x6a39('0xb')](_0x6a39('0xc'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 064b60f..524415d 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 _0xaba4=['lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch'];(function(_0x28e41f,_0x4d037f){var _0x4ac8fa=function(_0x48b817){while(--_0x48b817){_0x28e41f['push'](_0x28e41f['shift']());}};_0x4ac8fa(++_0x4d037f);}(_0xaba4,0x11e));var _0x4aba=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaba4[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x4aba('0x0'));var util=require(_0x4aba('0x1'));var moment=require(_0x4aba('0x2'));var BPromise=require(_0x4aba('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4aba('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4aba('0x5'));var logger=require(_0x4aba('0x6'))(_0x4aba('0x7'));var config=require(_0x4aba('0x8'));var jayson=require(_0x4aba('0x9'));var client=jayson[_0x4aba('0xa')][_0x4aba('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x535937,_0x2f6925,_0x9e4be){return new BPromise(function(_0x3953e9,_0x135fc9){return client['request'](_0x535937,_0x9e4be)[_0x4aba('0xc')](function(_0x464c11){logger[_0x4aba('0xd')](_0x4aba('0xe'),_0x2f6925,'request\x20sent');logger[_0x4aba('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x2f6925,_0x4aba('0x10'),JSON[_0x4aba('0x11')](_0x464c11));if(_0x464c11[_0x4aba('0x12')]){if(_0x464c11['error']['code']===0x1f4){logger[_0x4aba('0x12')](_0x4aba('0xe'),_0x2f6925,_0x464c11['error'][_0x4aba('0x13')]);return _0x135fc9(_0x464c11[_0x4aba('0x12')][_0x4aba('0x13')]);}logger['error'](_0x4aba('0xe'),_0x2f6925,_0x464c11[_0x4aba('0x12')][_0x4aba('0x13')]);return _0x3953e9(_0x464c11[_0x4aba('0x12')][_0x4aba('0x13')]);}else{logger[_0x4aba('0xd')](_0x4aba('0xe'),_0x2f6925,_0x4aba('0x10'));_0x3953e9(_0x464c11[_0x4aba('0x14')][_0x4aba('0x13')]);}})[_0x4aba('0x15')](function(_0x1515eb){logger[_0x4aba('0x12')](_0x4aba('0xe'),_0x2f6925,_0x1515eb);_0x135fc9(_0x1515eb);});});}
\ No newline at end of file
+var _0x1b7c=['code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x365b19,_0x445a8b){var _0xa1c9f=function(_0x4a620b){while(--_0x4a620b){_0x365b19['push'](_0x365b19['shift']());}};_0xa1c9f(++_0x445a8b);}(_0x1b7c,0x12f));var _0xc1b7=function(_0x1d014c,_0xf20d82){_0x1d014c=_0x1d014c-0x0;var _0xc51585=_0x1b7c[_0x1d014c];return _0xc51585;};'use strict';var _=require(_0xc1b7('0x0'));var util=require(_0xc1b7('0x1'));var moment=require('moment');var BPromise=require(_0xc1b7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1b7('0x3'));var db=require(_0xc1b7('0x4'))['db'];var utils=require(_0xc1b7('0x5'));var logger=require('../../config/logger')(_0xc1b7('0x6'));var config=require(_0xc1b7('0x7'));var jayson=require(_0xc1b7('0x8'));var client=jayson[_0xc1b7('0x9')][_0xc1b7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f0212,_0x2dd97d,_0x2db29b){return new BPromise(function(_0x39230c,_0x8d695d){return client[_0xc1b7('0xb')](_0x1f0212,_0x2db29b)[_0xc1b7('0xc')](function(_0x524f5a){logger[_0xc1b7('0xd')](_0xc1b7('0xe'),_0x2dd97d,_0xc1b7('0xf'));logger['debug'](_0xc1b7('0x10'),_0x2dd97d,'request\x20sent',JSON[_0xc1b7('0x11')](_0x524f5a));if(_0x524f5a[_0xc1b7('0x12')]){if(_0x524f5a[_0xc1b7('0x12')][_0xc1b7('0x13')]===0x1f4){logger['error'](_0xc1b7('0xe'),_0x2dd97d,_0x524f5a[_0xc1b7('0x12')][_0xc1b7('0x14')]);return _0x8d695d(_0x524f5a['error'][_0xc1b7('0x14')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x2dd97d,_0x524f5a['error'][_0xc1b7('0x14')]);return _0x39230c(_0x524f5a['error'][_0xc1b7('0x14')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x2dd97d,_0xc1b7('0xf'));_0x39230c(_0x524f5a[_0xc1b7('0x15')][_0xc1b7('0x14')]);}})[_0xc1b7('0x16')](function(_0x33dd67){logger[_0xc1b7('0x12')](_0xc1b7('0xe'),_0x2dd97d,_0x33dd67);_0x8d695d(_0x33dd67);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 98ff516..5f3adb9 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 _0x425d=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x425d,0x1e0));var _0xd425=function(_0x4c11f7,_0x5a0447){_0x4c11f7=_0x4c11f7-0x0;var _0x587d6b=_0x425d[_0x4c11f7];return _0x587d6b;};'use strict';var multer=require(_0xd425('0x0'));var util=require('util');var path=require(_0xd425('0x1'));var timeout=require(_0xd425('0x2'));var express=require(_0xd425('0x3'));var router=express[_0xd425('0x4')]();var fs_extra=require(_0xd425('0x5'));var auth=require(_0xd425('0x6'));var interaction=require(_0xd425('0x7'));var config=require('../../config/environment');var controller=require(_0xd425('0x8'));router[_0xd425('0x9')](_0xd425('0xa'),auth[_0xd425('0xb')](),controller[_0xd425('0xc')]);router[_0xd425('0xd')]('/',auth['isAuthenticated'](),controller[_0xd425('0xe')]);router[_0xd425('0xf')](_0xd425('0xa'),auth[_0xd425('0xb')](),controller[_0xd425('0x10')]);router[_0xd425('0x11')](_0xd425('0xa'),auth[_0xd425('0xb')](),controller[_0xd425('0x12')]);module[_0xd425('0x13')]=router;
\ No newline at end of file
+var _0x7c09=['delete','/:id','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','show','post','isAuthenticated','create','put'];(function(_0x260e4b,_0x54668d){var _0x18dfba=function(_0x37b530){while(--_0x37b530){_0x260e4b['push'](_0x260e4b['shift']());}};_0x18dfba(++_0x54668d);}(_0x7c09,0x102));var _0x97c0=function(_0x29ab38,_0x40c988){_0x29ab38=_0x29ab38-0x0;var _0xbfa2de=_0x7c09[_0x29ab38];return _0xbfa2de;};'use strict';var multer=require('multer');var util=require(_0x97c0('0x0'));var path=require(_0x97c0('0x1'));var timeout=require('connect-timeout');var express=require(_0x97c0('0x2'));var router=express[_0x97c0('0x3')]();var fs_extra=require(_0x97c0('0x4'));var auth=require(_0x97c0('0x5'));var interaction=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var controller=require(_0x97c0('0x8'));router['get']('/:id',auth['isAuthenticated'](),controller[_0x97c0('0x9')]);router[_0x97c0('0xa')]('/',auth[_0x97c0('0xb')](),controller[_0x97c0('0xc')]);router[_0x97c0('0xd')]('/:id',auth[_0x97c0('0xb')](),controller['update']);router[_0x97c0('0xe')](_0x97c0('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x97c0('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 240fc6b..35e606c 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 _0x15fa=['STRING','INTEGER','rrmemory','beepall','roundrobin','sequelize'];(function(_0x297aff,_0xa68434){var _0x4a27d4=function(_0x644660){while(--_0x644660){_0x297aff['push'](_0x297aff['shift']());}};_0x4a27d4(++_0xa68434);}(_0x15fa,0x1d3));var _0xa15f=function(_0x22a42f,_0x3295a8){_0x22a42f=_0x22a42f-0x0;var _0x5ec443=_0x15fa[_0x22a42f];return _0x5ec443;};'use strict';var Sequelize=require(_0xa15f('0x0'));module['exports']={'name':{'type':Sequelize[_0xa15f('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xa15f('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xa15f('0x3'),_0xa15f('0x4'),_0xa15f('0x5'))}};
\ No newline at end of file
+var _0x0191=['roundrobin','sequelize','STRING','name','INTEGER','ENUM'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x0191,0x13f));var _0x1019=function(_0x1fe8be,_0x5e7860){_0x1fe8be=_0x1fe8be-0x0;var _0x1449bb=_0x0191[_0x1fe8be];return _0x1449bb;};'use strict';var Sequelize=require(_0x1019('0x0'));module['exports']={'name':{'type':Sequelize[_0x1019('0x1')],'unique':_0x1019('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x1019('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1019('0x4')]('rrmemory','beepall',_0x1019('0x5'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 5e31785..1d84e7a 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 _0xf82c=['updatedAt','createdAt','format','SIP','getTeams','addTeams','ids','User','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','push','toString','QueryTypes','every','TeamId','includes','union','compact','isEmpty','removeAgents','userChatQueue:remove','addAgents','userChatQueue:save','isArray','getAgents','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','defaults','redis','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','request\x20sent','result','catch','sendStatus','status','end','offset','limit','count','set','Content-Range','json','reject','save','destroy','get','ChatQueues','UserProfileResource','stack','name','send','map','ChatQueue','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','order','ChatQueueId','UserId','agent','chatPause'];(function(_0x21080b,_0x4e267e){var _0x59de05=function(_0x3983ac){while(--_0x3983ac){_0x21080b['push'](_0x21080b['shift']());}};_0x59de05(++_0x4e267e);}(_0xf82c,0x1dd));var _0xcf82=function(_0x5d6ea8,_0x43b332){_0x5d6ea8=_0x5d6ea8-0x0;var _0x1d973f=_0xf82c[_0x5d6ea8];return _0x1d973f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcf82('0x0'));var zipdir=require(_0xcf82('0x1'));var jsonpatch=require(_0xcf82('0x2'));var rp=require('request-promise');var moment=require(_0xcf82('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcf82('0x4'));var util=require(_0xcf82('0x5'));var path=require(_0xcf82('0x6'));var sox=require(_0xcf82('0x7'));var csv=require(_0xcf82('0x8'));var ejs=require(_0xcf82('0x9'));var fs=require('fs');var fs_extra=require(_0xcf82('0xa'));var _=require(_0xcf82('0xb'));var squel=require(_0xcf82('0xc'));var crypto=require(_0xcf82('0xd'));var jsforce=require(_0xcf82('0xe'));var deskjs=require(_0xcf82('0xf'));var toCsv=require(_0xcf82('0x8'));var querystring=require(_0xcf82('0x10'));var Papa=require(_0xcf82('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcf82('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcf82('0x13'));var logger=require(_0xcf82('0x14'))(_0xcf82('0x15'));var utils=require('../../config/utils');var config=require(_0xcf82('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xcf82('0x17')](config[_0xcf82('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xcf82('0x19'))(new Redis(config['redis']));require(_0xcf82('0x1a'))[_0xcf82('0x1b')](socket);var jayson=require(_0xcf82('0x1c'));var client=jayson[_0xcf82('0x1d')][_0xcf82('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3c77f0,_0x4fbd5b,_0x547085,_0x5a85a2){return new BPromise(function(_0x3f0742,_0x507025){var _0x1ae40b=_0x5a85a2||client;return _0x1ae40b[_0xcf82('0x1f')](_0x3c77f0,_0x547085)[_0xcf82('0x20')](function(_0x53c0fb){logger[_0xcf82('0x21')]('ChatQueue,\x20%s,\x20%s',_0x4fbd5b,'request\x20sent');logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x4fbd5b,'request\x20sent',JSON[_0xcf82('0x22')](_0x53c0fb));if(_0x53c0fb['error']){if(_0x53c0fb[_0xcf82('0x23')][_0xcf82('0x24')]===0x1f4){logger['error'](_0xcf82('0x25'),_0x4fbd5b,_0x53c0fb[_0xcf82('0x23')]['message']);return _0x507025(_0x53c0fb[_0xcf82('0x23')]['message']);}logger['error'](_0xcf82('0x25'),_0x4fbd5b,_0x53c0fb['error'][_0xcf82('0x26')]);return _0x3f0742(_0x53c0fb[_0xcf82('0x23')][_0xcf82('0x26')]);}else{logger[_0xcf82('0x21')]('ChatQueue,\x20%s,\x20%s',_0x4fbd5b,_0xcf82('0x27'));_0x3f0742(_0x53c0fb[_0xcf82('0x28')][_0xcf82('0x26')]);}})[_0xcf82('0x29')](function(_0x911b2f){logger[_0xcf82('0x23')](_0xcf82('0x25'),_0x4fbd5b,_0x911b2f);_0x507025(_0x911b2f);});});}function respondWithStatusCode(_0x51ff36,_0x2a48e1){_0x2a48e1=_0x2a48e1||0xcc;return function(_0x2945b6){if(_0x2945b6){return _0x51ff36[_0xcf82('0x2a')](_0x2a48e1);}return _0x51ff36[_0xcf82('0x2b')](_0x2a48e1)[_0xcf82('0x2c')]();};}function respondWithResult(_0x777c2f,_0x392c2d){_0x392c2d=_0x392c2d||0xc8;return function(_0x2ec170){if(_0x2ec170){return _0x777c2f['status'](_0x392c2d)['json'](_0x2ec170);}};}function respondWithFilteredResult(_0x1e3ab3,_0x8744e6){return function(_0x1a143f){if(_0x1a143f){var _0x43caa9=typeof _0x8744e6[_0xcf82('0x2d')]==='undefined'&&typeof _0x8744e6[_0xcf82('0x2e')]==='undefined';var _0x5d5702=_0x1a143f['count'];var _0x12f9f6=_0x43caa9?0x0:_0x8744e6['offset'];var _0x15e0cb=_0x43caa9?_0x1a143f[_0xcf82('0x2f')]:_0x8744e6['offset']+_0x8744e6[_0xcf82('0x2e')];var _0x430cd5;if(_0x15e0cb>=_0x5d5702){_0x15e0cb=_0x5d5702;_0x430cd5=0xc8;}else{_0x430cd5=0xce;}_0x1e3ab3['status'](_0x430cd5);return _0x1e3ab3[_0xcf82('0x30')](_0xcf82('0x31'),_0x12f9f6+'-'+_0x15e0cb+'/'+_0x5d5702)[_0xcf82('0x32')](_0x1a143f);}return null;};}function patchUpdates(_0xaecd3){return function(_0x2bca62){try{jsonpatch['apply'](_0x2bca62,_0xaecd3,!![]);}catch(_0x98e0a){return BPromise[_0xcf82('0x33')](_0x98e0a);}return _0x2bca62[_0xcf82('0x34')]();};}function saveUpdates(_0x5da814,_0x441bdc){return function(_0x26544c){if(_0x26544c){return _0x26544c['update'](_0x5da814)[_0xcf82('0x20')](function(_0x49c15d){return _0x49c15d;});}return null;};}function removeEntity(_0x1b46e9,_0x5884c2){return function(_0x13c5f4){if(_0x13c5f4){return _0x13c5f4[_0xcf82('0x35')]()['then'](function(){var _0x375e18=_0x13c5f4[_0xcf82('0x36')]({'plain':!![]});var _0x7b4bed=_0xcf82('0x37');return db[_0xcf82('0x38')]['destroy']({'where':{'type':_0x7b4bed,'resourceId':_0x375e18['id']}})['then'](function(){return _0x13c5f4;});})[_0xcf82('0x20')](function(){_0x1b46e9[_0xcf82('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36e894,_0x13177d){return function(_0x570063){if(!_0x570063){_0x36e894[_0xcf82('0x2a')](0x194);}return _0x570063;};}function handleError(_0x424966,_0x55f15e){_0x55f15e=_0x55f15e||0x1f4;return function(_0x2c0a83){logger[_0xcf82('0x23')](_0x2c0a83[_0xcf82('0x39')]);if(_0x2c0a83[_0xcf82('0x3a')]){delete _0x2c0a83[_0xcf82('0x3a')];}_0x424966[_0xcf82('0x2b')](_0x55f15e)[_0xcf82('0x3b')](_0x2c0a83);};}exports['index']=function(_0x2b9410,_0x9000b6){var _0x13c23f={},_0x4c4a4c={},_0x38a028={'count':0x0,'rows':[]};var _0xb1e22a=_[_0xcf82('0x3c')](db[_0xcf82('0x3d')][_0xcf82('0x3e')],function(_0x2ff07b){return{'name':_0x2ff07b[_0xcf82('0x3f')],'type':_0x2ff07b[_0xcf82('0x40')]['key']};});_0x4c4a4c['model']=_[_0xcf82('0x3c')](_0xb1e22a,_0xcf82('0x3a'));_0x4c4a4c[_0xcf82('0x41')]=_[_0xcf82('0x42')](_0x2b9410[_0xcf82('0x41')]);_0x4c4a4c[_0xcf82('0x43')]=_[_0xcf82('0x44')](_0x4c4a4c['model'],_0x4c4a4c[_0xcf82('0x41')]);_0x13c23f[_0xcf82('0x45')]=_[_0xcf82('0x44')](_0x4c4a4c[_0xcf82('0x46')],qs[_0xcf82('0x47')](_0x2b9410[_0xcf82('0x41')][_0xcf82('0x47')]));_0x13c23f[_0xcf82('0x45')]=_0x13c23f[_0xcf82('0x45')][_0xcf82('0x48')]?_0x13c23f[_0xcf82('0x45')]:_0x4c4a4c[_0xcf82('0x46')];if(!_0x2b9410[_0xcf82('0x41')][_0xcf82('0x49')](_0xcf82('0x4a'))){_0x13c23f[_0xcf82('0x2e')]=qs[_0xcf82('0x2e')](_0x2b9410[_0xcf82('0x41')][_0xcf82('0x2e')]);_0x13c23f[_0xcf82('0x2d')]=qs[_0xcf82('0x2d')](_0x2b9410[_0xcf82('0x41')]['offset']);}_0x13c23f['order']=qs[_0xcf82('0x4b')](_0x2b9410[_0xcf82('0x41')][_0xcf82('0x4b')]);_0x13c23f[_0xcf82('0x4c')]=qs[_0xcf82('0x43')](_[_0xcf82('0x4d')](_0x2b9410['query'],_0x4c4a4c[_0xcf82('0x43')]),_0xb1e22a);if(_0x2b9410[_0xcf82('0x41')]['filter']){_0x13c23f[_0xcf82('0x4c')]=_[_0xcf82('0x4e')](_0x13c23f[_0xcf82('0x4c')],{'$or':_[_0xcf82('0x3c')](_0xb1e22a,function(_0x288b25){if(_0x288b25[_0xcf82('0x40')]!==_0xcf82('0x4f')){var _0x427f5c={};_0x427f5c[_0x288b25[_0xcf82('0x3a')]]={'$like':'%'+_0x2b9410['query'][_0xcf82('0x50')]+'%'};return _0x427f5c;}})});}_0x13c23f=_['merge']({},_0x13c23f,_0x2b9410[_0xcf82('0x51')]);var _0x2683e6={'where':_0x13c23f[_0xcf82('0x4c')]};return db[_0xcf82('0x3d')][_0xcf82('0x2f')](_0x2683e6)[_0xcf82('0x20')](function(_0x5483b3){_0x38a028['count']=_0x5483b3;if(_0x2b9410[_0xcf82('0x41')][_0xcf82('0x52')]){_0x13c23f[_0xcf82('0x53')]=[{'all':!![]}];}return db[_0xcf82('0x3d')][_0xcf82('0x54')](_0x13c23f);})[_0xcf82('0x20')](function(_0x1f978a){_0x38a028[_0xcf82('0x55')]=_0x1f978a;return _0x38a028;})[_0xcf82('0x20')](respondWithFilteredResult(_0x9000b6,_0x13c23f))[_0xcf82('0x29')](handleError(_0x9000b6,null));};exports[_0xcf82('0x56')]=function(_0x3010b5,_0x8d1295){var _0x54074f={'raw':!![],'where':{'id':_0x3010b5[_0xcf82('0x57')]['id']}},_0x268ffe={};_0x268ffe[_0xcf82('0x46')]=_['keys'](db[_0xcf82('0x3d')][_0xcf82('0x3e')]);_0x268ffe[_0xcf82('0x41')]=_[_0xcf82('0x42')](_0x3010b5['query']);_0x268ffe[_0xcf82('0x43')]=_[_0xcf82('0x44')](_0x268ffe[_0xcf82('0x46')],_0x268ffe[_0xcf82('0x41')]);_0x54074f['attributes']=_[_0xcf82('0x44')](_0x268ffe[_0xcf82('0x46')],qs['fields'](_0x3010b5[_0xcf82('0x41')][_0xcf82('0x47')]));_0x54074f['attributes']=_0x54074f[_0xcf82('0x45')][_0xcf82('0x48')]?_0x54074f['attributes']:_0x268ffe[_0xcf82('0x46')];if(_0x3010b5[_0xcf82('0x41')][_0xcf82('0x52')]){_0x54074f['include']=[{'all':!![]}];}_0x54074f=_['merge']({},_0x54074f,_0x3010b5[_0xcf82('0x51')]);return db[_0xcf82('0x3d')][_0xcf82('0x58')](_0x54074f)[_0xcf82('0x20')](handleEntityNotFound(_0x8d1295,null))[_0xcf82('0x20')](respondWithResult(_0x8d1295,null))[_0xcf82('0x29')](handleError(_0x8d1295,null));};exports['create']=function(_0xba42f8,_0x3fbb39){return db[_0xcf82('0x3d')]['create'](_0xba42f8[_0xcf82('0x59')],{})['then'](function(_0x1e5de5){var _0x1fa2ea=_0xba42f8[_0xcf82('0x5a')][_0xcf82('0x36')]({'plain':!![]});if(!_0x1fa2ea)throw new Error(_0xcf82('0x5b'));if(_0x1fa2ea['role']===_0xcf82('0x5a')){var _0x317462=_0x1e5de5[_0xcf82('0x36')]({'plain':!![]});var _0x39b9f0=_0xcf82('0x37');return db['UserProfileSection'][_0xcf82('0x58')]({'where':{'name':_0x39b9f0,'userProfileId':_0x1fa2ea[_0xcf82('0x5c')]},'raw':!![]})[_0xcf82('0x20')](function(_0x3ecfa8){if(_0x3ecfa8&&_0x3ecfa8['autoAssociation']===0x0){return db[_0xcf82('0x38')]['create']({'name':_0x317462[_0xcf82('0x3a')],'resourceId':_0x317462['id'],'type':_0x3ecfa8[_0xcf82('0x3a')],'sectionId':_0x3ecfa8['id']},{})['then'](function(){return _0x1e5de5;});}else{return _0x1e5de5;}})['catch'](function(_0x2ae891){logger[_0xcf82('0x23')](_0xcf82('0x5d'),_0x2ae891);throw _0x2ae891;});}return _0x1e5de5;})[_0xcf82('0x20')](respondWithResult(_0x3fbb39,0xc9))[_0xcf82('0x29')](handleError(_0x3fbb39,null));};exports['update']=function(_0xb6b6c7,_0x2c1655){if(_0xb6b6c7['body']['id']){delete _0xb6b6c7[_0xcf82('0x59')]['id'];}return db['ChatQueue'][_0xcf82('0x58')]({'where':{'id':_0xb6b6c7[_0xcf82('0x57')]['id']}})[_0xcf82('0x20')](handleEntityNotFound(_0x2c1655,null))[_0xcf82('0x20')](saveUpdates(_0xb6b6c7[_0xcf82('0x59')],null))[_0xcf82('0x20')](respondWithResult(_0x2c1655,null))[_0xcf82('0x29')](handleError(_0x2c1655,null));};exports['destroy']=function(_0x42f49b,_0x10bc96){return db['ChatQueue'][_0xcf82('0x58')]({'where':{'id':_0x42f49b[_0xcf82('0x57')]['id']}})[_0xcf82('0x20')](handleEntityNotFound(_0x10bc96,null))[_0xcf82('0x20')](removeEntity(_0x10bc96,null))[_0xcf82('0x29')](handleError(_0x10bc96,null));};exports[_0xcf82('0x5e')]=function(_0x54bc56,_0x1cf403){return db['ChatQueue']['describe']()[_0xcf82('0x20')](respondWithResult(_0x1cf403,null))[_0xcf82('0x29')](handleError(_0x1cf403,null));};exports[_0xcf82('0x5f')]=function(_0x200474,_0x534372,_0xead7d8){var _0x1c581c={'raw':!![],'where':{}},_0x7ae638={},_0x24e981;return db['ChatQueue'][_0xcf82('0x60')]({'where':{'id':_0x200474[_0xcf82('0x57')]['id']}})[_0xcf82('0x20')](handleEntityNotFound(_0x534372,null))['then'](function(_0x19e62d){if(_0x19e62d){_0x24e981=_0x19e62d[_0xcf82('0x36')]({'plain':!![]});_0x7ae638[_0xcf82('0x46')]=_['keys'](db[_0xcf82('0x61')]['rawAttributes']);_0x7ae638['query']=_[_0xcf82('0x42')](_0x200474[_0xcf82('0x41')]);_0x7ae638[_0xcf82('0x43')]=_['intersection'](_0x7ae638[_0xcf82('0x46')],_0x7ae638[_0xcf82('0x41')]);_0x1c581c[_0xcf82('0x45')]=_[_0xcf82('0x44')](_0x7ae638[_0xcf82('0x46')],qs[_0xcf82('0x47')](_0x200474[_0xcf82('0x41')][_0xcf82('0x47')]));_0x1c581c['attributes']=_0x1c581c[_0xcf82('0x45')][_0xcf82('0x48')]?_0x1c581c['attributes']:_0x7ae638[_0xcf82('0x46')];if(!_0x200474[_0xcf82('0x41')][_0xcf82('0x49')]('nolimit')){_0x1c581c[_0xcf82('0x2e')]=qs[_0xcf82('0x2e')](_0x200474[_0xcf82('0x41')][_0xcf82('0x2e')]);_0x1c581c[_0xcf82('0x2d')]=qs[_0xcf82('0x2d')](_0x200474[_0xcf82('0x41')][_0xcf82('0x2d')]);}_0x1c581c[_0xcf82('0x62')]=qs['sort'](_0x200474['query'][_0xcf82('0x4b')]);_0x1c581c[_0xcf82('0x4c')]=qs[_0xcf82('0x43')](_[_0xcf82('0x4d')](_0x200474[_0xcf82('0x41')],_0x7ae638['filters']));_0x1c581c['where'][_0xcf82('0x63')]=_0x19e62d['id'];if(_0x200474[_0xcf82('0x41')][_0xcf82('0x50')]){_0x1c581c[_0xcf82('0x4c')]=_[_0xcf82('0x4e')](_0x1c581c[_0xcf82('0x4c')],{'$or':_[_0xcf82('0x3c')](_0x1c581c['attributes'],function(_0x49aef3){var _0x5ec274={};_0x5ec274[_0x49aef3]={'$like':'%'+_0x200474[_0xcf82('0x41')][_0xcf82('0x50')]+'%'};return _0x5ec274;})});}_0x1c581c=_[_0xcf82('0x4e')]({},_0x1c581c,_0x200474[_0xcf82('0x51')]);return db['UserChatQueue']['findAll'](_0x1c581c);}})[_0xcf82('0x20')](function(_0x752da6){if(_0x752da6){return db['User']['findAndCountAll']({'where':{'id':_[_0xcf82('0x3c')](_0x752da6,_0xcf82('0x64')),'role':_0xcf82('0x65')},'attributes':['id',_0xcf82('0x3a'),_0xcf82('0x66'),_0xcf82('0x67'),_0xcf82('0x68')]});}})[_0xcf82('0x20')](function(_0xd48830){if(_0xd48830){return{'count':_0xd48830['count'],'rows':_[_0xcf82('0x3c')](_0xd48830[_0xcf82('0x55')],function(_0x2d3569){return{'membername':_0x2d3569['name'],'UserId':_0x2d3569['id'],'queue_name':_0x24e981[_0xcf82('0x3a')],'ChatQueueId':_0x24e981['id'],'interface':util[_0xcf82('0x69')]('%s/%s',_0xcf82('0x6a'),_0x2d3569[_0xcf82('0x3a')]),'penalty':0x0,'paused':_0x2d3569[_0xcf82('0x66')],'createdAt':_0x2d3569[_0xcf82('0x68')],'updatedAt':_0x2d3569[_0xcf82('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x534372,_0x1c581c))[_0xcf82('0x29')](handleError(_0x534372,null));};exports[_0xcf82('0x6b')]=function(_0x51d535,_0x1dc690,_0x2b2748){var _0x19ad2a={};var _0x434f69={};var _0x3795dc;var _0x4e79e0;return db[_0xcf82('0x3d')][_0xcf82('0x60')]({'where':{'id':_0x51d535[_0xcf82('0x57')]['id']}})[_0xcf82('0x20')](handleEntityNotFound(_0x1dc690,null))[_0xcf82('0x20')](function(_0x386b68){if(_0x386b68){_0x3795dc=_0x386b68;_0x434f69['model']=_['keys'](db['Team'][_0xcf82('0x3e')]);_0x434f69[_0xcf82('0x41')]=_[_0xcf82('0x42')](_0x51d535['query']);_0x434f69[_0xcf82('0x43')]=_['intersection'](_0x434f69[_0xcf82('0x46')],_0x434f69['query']);_0x19ad2a[_0xcf82('0x45')]=_[_0xcf82('0x44')](_0x434f69['model'],qs[_0xcf82('0x47')](_0x51d535[_0xcf82('0x41')][_0xcf82('0x47')]));_0x19ad2a['attributes']=_0x19ad2a[_0xcf82('0x45')][_0xcf82('0x48')]?_0x19ad2a[_0xcf82('0x45')]:_0x434f69[_0xcf82('0x46')];_0x19ad2a[_0xcf82('0x62')]=qs[_0xcf82('0x4b')](_0x51d535[_0xcf82('0x41')][_0xcf82('0x4b')]);_0x19ad2a[_0xcf82('0x4c')]=qs[_0xcf82('0x43')](_[_0xcf82('0x4d')](_0x51d535[_0xcf82('0x41')],_0x434f69['filters']));if(_0x51d535[_0xcf82('0x41')][_0xcf82('0x50')]){_0x19ad2a[_0xcf82('0x4c')]=_[_0xcf82('0x4e')](_0x19ad2a[_0xcf82('0x4c')],{'$or':_[_0xcf82('0x3c')](_0x19ad2a[_0xcf82('0x45')],function(_0x17cca0){var _0xeb7de={};_0xeb7de[_0x17cca0]={'$like':'%'+_0x51d535['query'][_0xcf82('0x50')]+'%'};return _0xeb7de;})});}_0x19ad2a=_['merge']({},_0x19ad2a,_0x51d535['options']);return _0x3795dc[_0xcf82('0x6b')](_0x19ad2a);}})[_0xcf82('0x20')](function(_0x11cd2b){if(_0x11cd2b){_0x4e79e0=_0x11cd2b[_0xcf82('0x48')];if(!_0x51d535[_0xcf82('0x41')][_0xcf82('0x49')](_0xcf82('0x4a'))){_0x19ad2a[_0xcf82('0x2e')]=qs[_0xcf82('0x2e')](_0x51d535[_0xcf82('0x41')][_0xcf82('0x2e')]);_0x19ad2a[_0xcf82('0x2d')]=qs[_0xcf82('0x2d')](_0x51d535[_0xcf82('0x41')]['offset']);}return _0x3795dc['getTeams'](_0x19ad2a);}})['then'](function(_0x35f0be){if(_0x35f0be){return _0x35f0be?{'count':_0x4e79e0,'rows':_0x35f0be}:null;}})['then'](respondWithResult(_0x1dc690,null))['catch'](handleError(_0x1dc690,null));};exports[_0xcf82('0x6c')]=function(_0x84ac17,_0x225d4a,_0x3047d1){var _0x322a63=_0x84ac17[_0xcf82('0x59')][_0xcf82('0x6d')];return db['Team'][_0xcf82('0x54')]({'where':{'id':_0x322a63},'attributes':['id'],'include':[{'model':db[_0xcf82('0x6e')],'as':'Agents','attributes':['id',_0xcf82('0x3a'),_0xcf82('0x6f'),_0xcf82('0x70'),_0xcf82('0x71')],'raw':!![]}]})['then'](function(_0x1308f1){if(_0x1308f1){var _0x13b9c1=_[_0xcf82('0x72')](_0x1308f1,function(_0x307558){var _0x2b0934=_0x307558[_0xcf82('0x36')]({'plain':!![]});return _0x2b0934[_0xcf82('0x73')];});return db[_0xcf82('0x3d')][_0xcf82('0x58')]({'where':{'id':_0x84ac17[_0xcf82('0x57')]['id']}})[_0xcf82('0x20')](function(_0x2191ca){return db[_0xcf82('0x74')][_0xcf82('0x75')](function(_0x2baf76){return _0x2191ca['addTeams'](_0x322a63,{'transaction':_0x2baf76})[_0xcf82('0x20')](function(){return BPromise[_0xcf82('0x76')](_0x13b9c1,function(_0x5b1745){return db[_0xcf82('0x61')][_0xcf82('0x77')]({'where':{'UserId':_0x5b1745['id'],'ChatQueueId':_0x84ac17['params']['id']},'transaction':_0x2baf76});});})[_0xcf82('0x20')](function(){_0x13b9c1[_0xcf82('0x78')](function(_0x889dad){socket[_0xcf82('0x79')]('userChatQueue:save',{'UserId':_0x889dad['id'],'ChatQueueId':_0x2191ca['id']});});});});});}})['then'](respondWithStatusCode(_0x225d4a,null))[_0xcf82('0x29')](handleError(_0x225d4a,null));};exports[_0xcf82('0x7a')]=function(_0x380e35,_0x102767,_0x18c831){return db['Team']['findAll']({'where':{'id':_0x380e35[_0xcf82('0x41')][_0xcf82('0x6d')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xcf82('0x73'),'attributes':['id'],'raw':!![]}]})[_0xcf82('0x20')](handleEntityNotFound(_0x102767,null))[_0xcf82('0x20')](function(_0x5bf3f8){var _0x20c2d5=_[_0xcf82('0x3c')](_0x5bf3f8,'id');var _0x3f4669=[];var _0x24ab87=[];var _0x13fd70=squel[_0xcf82('0x7b')]();_0x13fd70[_0xcf82('0x7c')](_0xcf82('0x7d'))[_0xcf82('0x7e')](_0xcf82('0x7f'),'tq')[_0xcf82('0x80')](_0xcf82('0x81'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('ChatQueueId\x20=\x20?',_0x380e35[_0xcf82('0x57')]['id']);for(var _0x21916d=0x0;_0x21916d<_0x5bf3f8[_0xcf82('0x48')];_0x21916d+=0x1){let _0x5b425e=_0x5bf3f8[_0x21916d];for(var _0x8ed187=0x0;_0x8ed187<_0x5b425e['Agents'][_0xcf82('0x48')];_0x8ed187+=0x1){let _0x3f414f=_0x5b425e[_0xcf82('0x73')][_0x8ed187];var _0x280eb7=_0x13fd70['clone']();_0x280eb7[_0xcf82('0x4c')]('ut.UserId\x20=\x20?',_0x3f414f['id']);_0x24ab87[_0xcf82('0x82')](db[_0xcf82('0x74')][_0xcf82('0x41')](_0x280eb7[_0xcf82('0x83')](),{'type':db[_0xcf82('0x74')][_0xcf82('0x84')]['SELECT']})[_0xcf82('0x20')](function(_0x5f4b20){if(_0x5f4b20[_0xcf82('0x48')]===0x1){return _0x3f414f['id'];}else{var _0x5c0323=_[_0xcf82('0x85')](_[_0xcf82('0x3c')](_0x5f4b20,_0xcf82('0x86')),function(_0x1c0cc5){return _[_0xcf82('0x87')](_0x20c2d5,_0x1c0cc5);});if(_0x5c0323){return _0x3f414f['id'];}}}));}}return BPromise['all'](_0x24ab87)[_0xcf82('0x20')](function(_0x20ec86){_0x3f4669=_(_0x3f4669)[_0xcf82('0x88')](_0x20ec86)[_0xcf82('0x89')]()['value']();return db[_0xcf82('0x3d')][_0xcf82('0x58')]({'where':{'id':_0x380e35['params']['id']}})[_0xcf82('0x20')](function(_0x4b95ae){return db[_0xcf82('0x74')][_0xcf82('0x75')](function(_0x1843eb){return _0x4b95ae[_0xcf82('0x7a')](_0x380e35[_0xcf82('0x41')]['ids'],{'transaction':_0x1843eb})[_0xcf82('0x20')](function(){if(!_[_0xcf82('0x8a')](_0x3f4669)){return _0x4b95ae[_0xcf82('0x8b')](_0x3f4669,{'transaction':_0x1843eb});}})[_0xcf82('0x20')](function(){_0x3f4669['forEach'](function(_0x491abc){socket[_0xcf82('0x79')](_0xcf82('0x8c'),{'UserId':_0x491abc,'ChatQueueId':_0x4b95ae['id']});});});});});});})['then'](respondWithStatusCode(_0x102767,null))['catch'](handleError(_0x102767,null));};exports[_0xcf82('0x8d')]=function(_0xa91ef3,_0x38ac41,_0x2c4e69){return db[_0xcf82('0x3d')]['find']({'where':{'id':_0xa91ef3['params']['id']}})[_0xcf82('0x20')](handleEntityNotFound(_0x38ac41,null))[_0xcf82('0x20')](function(_0x13fff2){if(_0x13fff2){return _0x13fff2[_0xcf82('0x8d')](_0xa91ef3['body']['ids'],_['omit'](_0xa91ef3[_0xcf82('0x59')],[_0xcf82('0x6d'),'id'])||{})['spread'](function(_0x2de89f){for(var _0x13f9b1=0x0;_0x13f9b1<_0xa91ef3['body']['ids'][_0xcf82('0x48')];_0x13f9b1+=0x1){socket[_0xcf82('0x79')](_0xcf82('0x8e'),{'UserId':Number(_0xa91ef3[_0xcf82('0x59')][_0xcf82('0x6d')][_0x13f9b1]),'ChatQueueId':Number(_0xa91ef3[_0xcf82('0x57')]['id'])});}return _0x2de89f;});}})[_0xcf82('0x20')](respondWithResult(_0x38ac41,null))['catch'](handleError(_0x38ac41,null));};exports[_0xcf82('0x8b')]=function(_0x286222,_0x193e22,_0x7e4a38){return db[_0xcf82('0x3d')][_0xcf82('0x58')]({'where':{'id':_0x286222[_0xcf82('0x57')]['id']}})['then'](handleEntityNotFound(_0x193e22,null))['then'](function(_0x1ec2d3){if(_0x1ec2d3){return _0x1ec2d3[_0xcf82('0x8b')](_0x286222[_0xcf82('0x41')][_0xcf82('0x6d')])['then'](function(){if(_[_0xcf82('0x8f')](_0x286222[_0xcf82('0x41')][_0xcf82('0x6d')])){for(var _0x14ff11=0x0;_0x14ff11<_0x286222[_0xcf82('0x41')][_0xcf82('0x6d')][_0xcf82('0x48')];_0x14ff11+=0x1){socket[_0xcf82('0x79')](_0xcf82('0x8c'),{'UserId':Number(_0x286222[_0xcf82('0x41')][_0xcf82('0x6d')][_0x14ff11]),'ChatQueueId':Number(_0x286222['params']['id'])});}}else{socket['emit'](_0xcf82('0x8c'),{'UserId':Number(_0x286222[_0xcf82('0x41')][_0xcf82('0x6d')]),'ChatQueueId':Number(_0x286222[_0xcf82('0x57')]['id'])});}});}})[_0xcf82('0x20')](respondWithStatusCode(_0x193e22,null))['catch'](handleError(_0x193e22,null));};exports[_0xcf82('0x90')]=function(_0x1e2ab7,_0x469803,_0x5a038f){var _0xd20232={};var _0xe3ccd6={};var _0x319c88;var _0x579af4;return db['ChatQueue']['findOne']({'where':{'id':_0x1e2ab7[_0xcf82('0x57')]['id']}})[_0xcf82('0x20')](handleEntityNotFound(_0x469803,null))[_0xcf82('0x20')](function(_0xcd58b8){if(_0xcd58b8){_0x319c88=_0xcd58b8;_0xe3ccd6[_0xcf82('0x46')]=_[_0xcf82('0x42')](db[_0xcf82('0x6e')][_0xcf82('0x3e')]);_0xe3ccd6[_0xcf82('0x41')]=_[_0xcf82('0x42')](_0x1e2ab7[_0xcf82('0x41')]);_0xe3ccd6[_0xcf82('0x43')]=_[_0xcf82('0x44')](_0xe3ccd6[_0xcf82('0x46')],_0xe3ccd6[_0xcf82('0x41')]);_0xd20232[_0xcf82('0x45')]=_[_0xcf82('0x44')](_0xe3ccd6[_0xcf82('0x46')],qs['fields'](_0x1e2ab7[_0xcf82('0x41')][_0xcf82('0x47')]));_0xd20232[_0xcf82('0x45')]=_0xd20232['attributes']['length']?_0xd20232[_0xcf82('0x45')]:_0xe3ccd6[_0xcf82('0x46')];_0xd20232[_0xcf82('0x62')]=qs['sort'](_0x1e2ab7[_0xcf82('0x41')]['sort']);_0xd20232[_0xcf82('0x4c')]=qs[_0xcf82('0x43')](_['pick'](_0x1e2ab7['query'],_0xe3ccd6[_0xcf82('0x43')]));if(_0x1e2ab7['query']['filter']){_0xd20232['where']=_[_0xcf82('0x4e')](_0xd20232[_0xcf82('0x4c')],{'$or':_[_0xcf82('0x3c')](_0xd20232[_0xcf82('0x45')],function(_0x6d8268){var _0x3f2fd7={};_0x3f2fd7[_0x6d8268]={'$like':'%'+_0x1e2ab7[_0xcf82('0x41')][_0xcf82('0x50')]+'%'};return _0x3f2fd7;})});}_0xd20232=_['merge']({},_0xd20232,_0x1e2ab7[_0xcf82('0x51')]);return _0x319c88['getAgents'](_0xd20232);}})[_0xcf82('0x20')](function(_0x58ebf8){if(_0x58ebf8){_0x579af4=_0x58ebf8[_0xcf82('0x48')];if(!_0x1e2ab7[_0xcf82('0x41')][_0xcf82('0x49')]('nolimit')){_0xd20232['limit']=qs[_0xcf82('0x2e')](_0x1e2ab7[_0xcf82('0x41')][_0xcf82('0x2e')]);_0xd20232[_0xcf82('0x2d')]=qs[_0xcf82('0x2d')](_0x1e2ab7[_0xcf82('0x41')][_0xcf82('0x2d')]);}return _0x319c88[_0xcf82('0x90')](_0xd20232);}})[_0xcf82('0x20')](function(_0x5aaf20){if(_0x5aaf20){return _0x5aaf20?{'count':_0x579af4,'rows':_0x5aaf20}:null;}})[_0xcf82('0x20')](respondWithResult(_0x469803,null))[_0xcf82('0x29')](handleError(_0x469803,null));};
\ No newline at end of file
+var _0x5f64=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','UserChatQueue','hasOwnProperty','nolimit','findAll','User','findAndCountAll','UserId','chatPause','createdAt','rows','format','%s/%s','SIP','getTeams','Team','addTeams','ids','online','voicePause','interface','Agents','sequelize','transaction','each','forEach','emit','userChatQueue:save','field','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','push','SELECT','TeamId','includes','all','union','value','removeTeams','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','json','offset','limit','count','apply','reject','save','get','UserProfileResource','destroy','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','ChatQueue','includeAll','catch','rawAttributes','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','UserProfileSection'];(function(_0x2d6197,_0x82ebfb){var _0x4d0e75=function(_0x577e7a){while(--_0x577e7a){_0x2d6197['push'](_0x2d6197['shift']());}};_0x4d0e75(++_0x82ebfb);}(_0x5f64,0x155));var _0x45f6=function(_0x3b96cf,_0x1592f2){_0x3b96cf=_0x3b96cf-0x0;var _0x2e315a=_0x5f64[_0x3b96cf];return _0x2e315a;};'use strict';var emlformat=require(_0x45f6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x45f6('0x1'));var jsonpatch=require(_0x45f6('0x2'));var rp=require(_0x45f6('0x3'));var moment=require('moment');var BPromise=require(_0x45f6('0x4'));var Mustache=require(_0x45f6('0x5'));var util=require(_0x45f6('0x6'));var path=require('path');var sox=require(_0x45f6('0x7'));var csv=require('to-csv');var ejs=require(_0x45f6('0x8'));var fs=require('fs');var fs_extra=require(_0x45f6('0x9'));var _=require(_0x45f6('0xa'));var squel=require(_0x45f6('0xb'));var crypto=require(_0x45f6('0xc'));var jsforce=require(_0x45f6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x45f6('0xe'));var querystring=require(_0x45f6('0xf'));var Papa=require(_0x45f6('0x10'));var Redis=require(_0x45f6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x45f6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x45f6('0x13'));var logger=require(_0x45f6('0x14'))(_0x45f6('0x15'));var utils=require(_0x45f6('0x16'));var config=require(_0x45f6('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x45f6('0x18'))['db'];config[_0x45f6('0x19')]=_[_0x45f6('0x1a')](config[_0x45f6('0x19')],{'host':_0x45f6('0x1b'),'port':0x18eb});var socket=require(_0x45f6('0x1c'))(new Redis(config['redis']));require('./chatQueue.socket')[_0x45f6('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x45f6('0x1e')][_0x45f6('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0xb52dc0,_0x55b65e,_0x2b2025,_0x2ea016){return new BPromise(function(_0x5066d5,_0x50df74){var _0x2e6910=_0x2ea016||client;return _0x2e6910['request'](_0xb52dc0,_0x2b2025)[_0x45f6('0x20')](function(_0xaab990){logger[_0x45f6('0x21')](_0x45f6('0x22'),_0x55b65e,_0x45f6('0x23'));logger[_0x45f6('0x24')](_0x45f6('0x25'),_0x55b65e,_0x45f6('0x23'),JSON['stringify'](_0xaab990));if(_0xaab990[_0x45f6('0x26')]){if(_0xaab990[_0x45f6('0x26')][_0x45f6('0x27')]===0x1f4){logger['error'](_0x45f6('0x22'),_0x55b65e,_0xaab990[_0x45f6('0x26')]['message']);return _0x50df74(_0xaab990[_0x45f6('0x26')][_0x45f6('0x28')]);}logger[_0x45f6('0x26')]('ChatQueue,\x20%s,\x20%s',_0x55b65e,_0xaab990['error'][_0x45f6('0x28')]);return _0x5066d5(_0xaab990['error'][_0x45f6('0x28')]);}else{logger[_0x45f6('0x21')](_0x45f6('0x22'),_0x55b65e,_0x45f6('0x23'));_0x5066d5(_0xaab990[_0x45f6('0x29')][_0x45f6('0x28')]);}})['catch'](function(_0x1ec33a){logger['error']('ChatQueue,\x20%s,\x20%s',_0x55b65e,_0x1ec33a);_0x50df74(_0x1ec33a);});});}function respondWithStatusCode(_0x391434,_0x242c78){_0x242c78=_0x242c78||0xcc;return function(_0x9440ab){if(_0x9440ab){return _0x391434[_0x45f6('0x2a')](_0x242c78);}return _0x391434[_0x45f6('0x2b')](_0x242c78)[_0x45f6('0x2c')]();};}function respondWithResult(_0x1b2d42,_0x4e60e3){_0x4e60e3=_0x4e60e3||0xc8;return function(_0x55be01){if(_0x55be01){return _0x1b2d42[_0x45f6('0x2b')](_0x4e60e3)[_0x45f6('0x2d')](_0x55be01);}};}function respondWithFilteredResult(_0x1036e9,_0x4c258c){return function(_0x1ca403){if(_0x1ca403){var _0x29dc21=typeof _0x4c258c[_0x45f6('0x2e')]==='undefined'&&typeof _0x4c258c[_0x45f6('0x2f')]==='undefined';var _0x2c7b03=_0x1ca403[_0x45f6('0x30')];var _0x5b3cd2=_0x29dc21?0x0:_0x4c258c[_0x45f6('0x2e')];var _0xe9fff5=_0x29dc21?_0x1ca403[_0x45f6('0x30')]:_0x4c258c['offset']+_0x4c258c[_0x45f6('0x2f')];var _0x5572f5;if(_0xe9fff5>=_0x2c7b03){_0xe9fff5=_0x2c7b03;_0x5572f5=0xc8;}else{_0x5572f5=0xce;}_0x1036e9[_0x45f6('0x2b')](_0x5572f5);return _0x1036e9['set']('Content-Range',_0x5b3cd2+'-'+_0xe9fff5+'/'+_0x2c7b03)['json'](_0x1ca403);}return null;};}function patchUpdates(_0x28f639){return function(_0x56a382){try{jsonpatch[_0x45f6('0x31')](_0x56a382,_0x28f639,!![]);}catch(_0x548c49){return BPromise[_0x45f6('0x32')](_0x548c49);}return _0x56a382[_0x45f6('0x33')]();};}function saveUpdates(_0x22681f,_0x23a4db){return function(_0x5eb7b8){if(_0x5eb7b8){return _0x5eb7b8['update'](_0x22681f)['then'](function(_0x43afaf){return _0x43afaf;});}return null;};}function removeEntity(_0x4cc952,_0x32d90c){return function(_0x3f133d){if(_0x3f133d){return _0x3f133d['destroy']()['then'](function(){var _0x4f27f7=_0x3f133d[_0x45f6('0x34')]({'plain':!![]});var _0x2ba446='ChatQueues';return db[_0x45f6('0x35')][_0x45f6('0x36')]({'where':{'type':_0x2ba446,'resourceId':_0x4f27f7['id']}})[_0x45f6('0x20')](function(){return _0x3f133d;});})[_0x45f6('0x20')](function(){_0x4cc952[_0x45f6('0x2b')](0xcc)[_0x45f6('0x2c')]();});}};}function handleEntityNotFound(_0x57a16f,_0x121de2){return function(_0x19982e){if(!_0x19982e){_0x57a16f[_0x45f6('0x2a')](0x194);}return _0x19982e;};}function handleError(_0x2197a3,_0x2683c6){_0x2683c6=_0x2683c6||0x1f4;return function(_0x27d34f){logger[_0x45f6('0x26')](_0x27d34f[_0x45f6('0x37')]);if(_0x27d34f[_0x45f6('0x38')]){delete _0x27d34f[_0x45f6('0x38')];}_0x2197a3[_0x45f6('0x2b')](_0x2683c6)[_0x45f6('0x39')](_0x27d34f);};}exports[_0x45f6('0x3a')]=function(_0x3db4f8,_0xe75b58){var _0x5dd263={},_0x1565b0={},_0x381ac5={'count':0x0,'rows':[]};var _0xb26157=_[_0x45f6('0x3b')](db['ChatQueue']['rawAttributes'],function(_0x3ce19e){return{'name':_0x3ce19e[_0x45f6('0x3c')],'type':_0x3ce19e[_0x45f6('0x3d')][_0x45f6('0x3e')]};});_0x1565b0[_0x45f6('0x3f')]=_[_0x45f6('0x3b')](_0xb26157,_0x45f6('0x38'));_0x1565b0[_0x45f6('0x40')]=_[_0x45f6('0x41')](_0x3db4f8[_0x45f6('0x40')]);_0x1565b0[_0x45f6('0x42')]=_[_0x45f6('0x43')](_0x1565b0[_0x45f6('0x3f')],_0x1565b0[_0x45f6('0x40')]);_0x5dd263[_0x45f6('0x44')]=_['intersection'](_0x1565b0['model'],qs[_0x45f6('0x45')](_0x3db4f8['query'][_0x45f6('0x45')]));_0x5dd263[_0x45f6('0x44')]=_0x5dd263[_0x45f6('0x44')][_0x45f6('0x46')]?_0x5dd263[_0x45f6('0x44')]:_0x1565b0[_0x45f6('0x3f')];if(!_0x3db4f8[_0x45f6('0x40')]['hasOwnProperty']('nolimit')){_0x5dd263[_0x45f6('0x2f')]=qs[_0x45f6('0x2f')](_0x3db4f8[_0x45f6('0x40')][_0x45f6('0x2f')]);_0x5dd263[_0x45f6('0x2e')]=qs['offset'](_0x3db4f8['query'][_0x45f6('0x2e')]);}_0x5dd263[_0x45f6('0x47')]=qs[_0x45f6('0x48')](_0x3db4f8['query']['sort']);_0x5dd263[_0x45f6('0x49')]=qs[_0x45f6('0x42')](_[_0x45f6('0x4a')](_0x3db4f8[_0x45f6('0x40')],_0x1565b0[_0x45f6('0x42')]),_0xb26157);if(_0x3db4f8[_0x45f6('0x40')][_0x45f6('0x4b')]){_0x5dd263['where']=_[_0x45f6('0x4c')](_0x5dd263[_0x45f6('0x49')],{'$or':_['map'](_0xb26157,function(_0x378e46){if(_0x378e46[_0x45f6('0x3d')]!==_0x45f6('0x4d')){var _0x520762={};_0x520762[_0x378e46[_0x45f6('0x38')]]={'$like':'%'+_0x3db4f8[_0x45f6('0x40')][_0x45f6('0x4b')]+'%'};return _0x520762;}})});}_0x5dd263=_['merge']({},_0x5dd263,_0x3db4f8['options']);var _0x1a4c41={'where':_0x5dd263[_0x45f6('0x49')]};return db[_0x45f6('0x4e')]['count'](_0x1a4c41)[_0x45f6('0x20')](function(_0x4a96ec){_0x381ac5[_0x45f6('0x30')]=_0x4a96ec;if(_0x3db4f8[_0x45f6('0x40')][_0x45f6('0x4f')]){_0x5dd263['include']=[{'all':!![]}];}return db[_0x45f6('0x4e')]['findAll'](_0x5dd263);})[_0x45f6('0x20')](function(_0x56579a){_0x381ac5['rows']=_0x56579a;return _0x381ac5;})[_0x45f6('0x20')](respondWithFilteredResult(_0xe75b58,_0x5dd263))[_0x45f6('0x50')](handleError(_0xe75b58,null));};exports['show']=function(_0x215a8b,_0x5a7998){var _0x12f860={'raw':!![],'where':{'id':_0x215a8b['params']['id']}},_0x11a37e={};_0x11a37e['model']=_[_0x45f6('0x41')](db[_0x45f6('0x4e')][_0x45f6('0x51')]);_0x11a37e[_0x45f6('0x40')]=_[_0x45f6('0x41')](_0x215a8b['query']);_0x11a37e['filters']=_[_0x45f6('0x43')](_0x11a37e[_0x45f6('0x3f')],_0x11a37e['query']);_0x12f860[_0x45f6('0x44')]=_[_0x45f6('0x43')](_0x11a37e[_0x45f6('0x3f')],qs[_0x45f6('0x45')](_0x215a8b['query'][_0x45f6('0x45')]));_0x12f860[_0x45f6('0x44')]=_0x12f860[_0x45f6('0x44')][_0x45f6('0x46')]?_0x12f860[_0x45f6('0x44')]:_0x11a37e[_0x45f6('0x3f')];if(_0x215a8b['query'][_0x45f6('0x4f')]){_0x12f860['include']=[{'all':!![]}];}_0x12f860=_['merge']({},_0x12f860,_0x215a8b[_0x45f6('0x52')]);return db[_0x45f6('0x4e')][_0x45f6('0x53')](_0x12f860)[_0x45f6('0x20')](handleEntityNotFound(_0x5a7998,null))['then'](respondWithResult(_0x5a7998,null))['catch'](handleError(_0x5a7998,null));};exports[_0x45f6('0x54')]=function(_0x9c40eb,_0x451aa2){return db['ChatQueue'][_0x45f6('0x54')](_0x9c40eb[_0x45f6('0x55')],{})['then'](function(_0x9d3509){var _0x119e18=_0x9c40eb[_0x45f6('0x56')][_0x45f6('0x34')]({'plain':!![]});if(!_0x119e18)throw new Error(_0x45f6('0x57'));if(_0x119e18[_0x45f6('0x58')]===_0x45f6('0x56')){var _0xbff8e3=_0x9d3509[_0x45f6('0x34')]({'plain':!![]});var _0x125104=_0x45f6('0x59');return db[_0x45f6('0x5a')][_0x45f6('0x53')]({'where':{'name':_0x125104,'userProfileId':_0x119e18[_0x45f6('0x5b')]},'raw':!![]})[_0x45f6('0x20')](function(_0xcd2ae4){if(_0xcd2ae4&&_0xcd2ae4[_0x45f6('0x5c')]===0x0){return db[_0x45f6('0x35')][_0x45f6('0x54')]({'name':_0xbff8e3['name'],'resourceId':_0xbff8e3['id'],'type':_0xcd2ae4[_0x45f6('0x38')],'sectionId':_0xcd2ae4['id']},{})[_0x45f6('0x20')](function(){return _0x9d3509;});}else{return _0x9d3509;}})[_0x45f6('0x50')](function(_0x18e53c){logger[_0x45f6('0x26')](_0x45f6('0x5d'),_0x18e53c);throw _0x18e53c;});}return _0x9d3509;})[_0x45f6('0x20')](respondWithResult(_0x451aa2,0xc9))[_0x45f6('0x50')](handleError(_0x451aa2,null));};exports['update']=function(_0x36eee2,_0x3005a3){if(_0x36eee2['body']['id']){delete _0x36eee2[_0x45f6('0x55')]['id'];}return db['ChatQueue'][_0x45f6('0x53')]({'where':{'id':_0x36eee2[_0x45f6('0x5e')]['id']}})[_0x45f6('0x20')](handleEntityNotFound(_0x3005a3,null))['then'](saveUpdates(_0x36eee2['body'],null))[_0x45f6('0x20')](respondWithResult(_0x3005a3,null))[_0x45f6('0x50')](handleError(_0x3005a3,null));};exports['destroy']=function(_0x190474,_0x4e3373){return db[_0x45f6('0x4e')][_0x45f6('0x53')]({'where':{'id':_0x190474[_0x45f6('0x5e')]['id']}})[_0x45f6('0x20')](handleEntityNotFound(_0x4e3373,null))['then'](removeEntity(_0x4e3373,null))['catch'](handleError(_0x4e3373,null));};exports['describe']=function(_0x4e355a,_0x23136d){return db[_0x45f6('0x4e')]['describe']()[_0x45f6('0x20')](respondWithResult(_0x23136d,null))[_0x45f6('0x50')](handleError(_0x23136d,null));};exports['getMembers']=function(_0x3ed9be,_0x42fa4e,_0x36e467){var _0x409282={'raw':!![],'where':{}},_0x44af68={},_0x1b4d32;return db[_0x45f6('0x4e')]['findOne']({'where':{'id':_0x3ed9be[_0x45f6('0x5e')]['id']}})['then'](handleEntityNotFound(_0x42fa4e,null))[_0x45f6('0x20')](function(_0x2c9de7){if(_0x2c9de7){_0x1b4d32=_0x2c9de7['get']({'plain':!![]});_0x44af68[_0x45f6('0x3f')]=_[_0x45f6('0x41')](db[_0x45f6('0x5f')][_0x45f6('0x51')]);_0x44af68[_0x45f6('0x40')]=_[_0x45f6('0x41')](_0x3ed9be['query']);_0x44af68['filters']=_['intersection'](_0x44af68[_0x45f6('0x3f')],_0x44af68[_0x45f6('0x40')]);_0x409282[_0x45f6('0x44')]=_[_0x45f6('0x43')](_0x44af68[_0x45f6('0x3f')],qs[_0x45f6('0x45')](_0x3ed9be[_0x45f6('0x40')][_0x45f6('0x45')]));_0x409282[_0x45f6('0x44')]=_0x409282[_0x45f6('0x44')][_0x45f6('0x46')]?_0x409282[_0x45f6('0x44')]:_0x44af68[_0x45f6('0x3f')];if(!_0x3ed9be[_0x45f6('0x40')][_0x45f6('0x60')](_0x45f6('0x61'))){_0x409282[_0x45f6('0x2f')]=qs['limit'](_0x3ed9be['query']['limit']);_0x409282[_0x45f6('0x2e')]=qs['offset'](_0x3ed9be[_0x45f6('0x40')][_0x45f6('0x2e')]);}_0x409282[_0x45f6('0x47')]=qs[_0x45f6('0x48')](_0x3ed9be[_0x45f6('0x40')]['sort']);_0x409282[_0x45f6('0x49')]=qs[_0x45f6('0x42')](_[_0x45f6('0x4a')](_0x3ed9be[_0x45f6('0x40')],_0x44af68[_0x45f6('0x42')]));_0x409282[_0x45f6('0x49')]['ChatQueueId']=_0x2c9de7['id'];if(_0x3ed9be[_0x45f6('0x40')][_0x45f6('0x4b')]){_0x409282[_0x45f6('0x49')]=_['merge'](_0x409282[_0x45f6('0x49')],{'$or':_[_0x45f6('0x3b')](_0x409282['attributes'],function(_0xb5c23e){var _0x2b7b0f={};_0x2b7b0f[_0xb5c23e]={'$like':'%'+_0x3ed9be[_0x45f6('0x40')][_0x45f6('0x4b')]+'%'};return _0x2b7b0f;})});}_0x409282=_[_0x45f6('0x4c')]({},_0x409282,_0x3ed9be[_0x45f6('0x52')]);return db['UserChatQueue'][_0x45f6('0x62')](_0x409282);}})[_0x45f6('0x20')](function(_0x4703d7){if(_0x4703d7){return db[_0x45f6('0x63')][_0x45f6('0x64')]({'where':{'id':_[_0x45f6('0x3b')](_0x4703d7,_0x45f6('0x65')),'role':'agent'},'attributes':['id',_0x45f6('0x38'),_0x45f6('0x66'),'updatedAt',_0x45f6('0x67')]});}})[_0x45f6('0x20')](function(_0x5bfdd2){if(_0x5bfdd2){return{'count':_0x5bfdd2['count'],'rows':_[_0x45f6('0x3b')](_0x5bfdd2[_0x45f6('0x68')],function(_0x1e0c90){return{'membername':_0x1e0c90[_0x45f6('0x38')],'UserId':_0x1e0c90['id'],'queue_name':_0x1b4d32[_0x45f6('0x38')],'ChatQueueId':_0x1b4d32['id'],'interface':util[_0x45f6('0x69')](_0x45f6('0x6a'),_0x45f6('0x6b'),_0x1e0c90['name']),'penalty':0x0,'paused':_0x1e0c90[_0x45f6('0x66')],'createdAt':_0x1e0c90['createdAt'],'updatedAt':_0x1e0c90['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x42fa4e,_0x409282))[_0x45f6('0x50')](handleError(_0x42fa4e,null));};exports[_0x45f6('0x6c')]=function(_0x343d6f,_0x460099,_0x5e5beb){var _0x6ab762={};var _0x132141={};var _0x5c479a;var _0x18de7f;return db['ChatQueue']['findOne']({'where':{'id':_0x343d6f[_0x45f6('0x5e')]['id']}})[_0x45f6('0x20')](handleEntityNotFound(_0x460099,null))[_0x45f6('0x20')](function(_0x3649d5){if(_0x3649d5){_0x5c479a=_0x3649d5;_0x132141[_0x45f6('0x3f')]=_[_0x45f6('0x41')](db[_0x45f6('0x6d')][_0x45f6('0x51')]);_0x132141['query']=_[_0x45f6('0x41')](_0x343d6f[_0x45f6('0x40')]);_0x132141[_0x45f6('0x42')]=_[_0x45f6('0x43')](_0x132141[_0x45f6('0x3f')],_0x132141[_0x45f6('0x40')]);_0x6ab762[_0x45f6('0x44')]=_[_0x45f6('0x43')](_0x132141[_0x45f6('0x3f')],qs[_0x45f6('0x45')](_0x343d6f['query'][_0x45f6('0x45')]));_0x6ab762['attributes']=_0x6ab762[_0x45f6('0x44')][_0x45f6('0x46')]?_0x6ab762[_0x45f6('0x44')]:_0x132141[_0x45f6('0x3f')];_0x6ab762[_0x45f6('0x47')]=qs[_0x45f6('0x48')](_0x343d6f[_0x45f6('0x40')]['sort']);_0x6ab762[_0x45f6('0x49')]=qs[_0x45f6('0x42')](_[_0x45f6('0x4a')](_0x343d6f[_0x45f6('0x40')],_0x132141[_0x45f6('0x42')]));if(_0x343d6f[_0x45f6('0x40')][_0x45f6('0x4b')]){_0x6ab762[_0x45f6('0x49')]=_[_0x45f6('0x4c')](_0x6ab762[_0x45f6('0x49')],{'$or':_[_0x45f6('0x3b')](_0x6ab762['attributes'],function(_0x1c7442){var _0x3296b8={};_0x3296b8[_0x1c7442]={'$like':'%'+_0x343d6f['query'][_0x45f6('0x4b')]+'%'};return _0x3296b8;})});}_0x6ab762=_[_0x45f6('0x4c')]({},_0x6ab762,_0x343d6f[_0x45f6('0x52')]);return _0x5c479a[_0x45f6('0x6c')](_0x6ab762);}})['then'](function(_0x5e4c67){if(_0x5e4c67){_0x18de7f=_0x5e4c67[_0x45f6('0x46')];if(!_0x343d6f[_0x45f6('0x40')][_0x45f6('0x60')](_0x45f6('0x61'))){_0x6ab762['limit']=qs[_0x45f6('0x2f')](_0x343d6f[_0x45f6('0x40')]['limit']);_0x6ab762[_0x45f6('0x2e')]=qs['offset'](_0x343d6f['query'][_0x45f6('0x2e')]);}return _0x5c479a[_0x45f6('0x6c')](_0x6ab762);}})['then'](function(_0x61f436){if(_0x61f436){return _0x61f436?{'count':_0x18de7f,'rows':_0x61f436}:null;}})['then'](respondWithResult(_0x460099,null))[_0x45f6('0x50')](handleError(_0x460099,null));};exports[_0x45f6('0x6e')]=function(_0x53a976,_0x26b20e,_0x32b33a){var _0x524f94=_0x53a976['body'][_0x45f6('0x6f')];return db[_0x45f6('0x6d')][_0x45f6('0x62')]({'where':{'id':_0x524f94},'attributes':['id'],'include':[{'model':db[_0x45f6('0x63')],'as':'Agents','attributes':['id','name',_0x45f6('0x70'),_0x45f6('0x71'),_0x45f6('0x72')],'raw':!![]}]})[_0x45f6('0x20')](function(_0x1b1e9f){if(_0x1b1e9f){var _0x1f0fbe=_['flatMap'](_0x1b1e9f,function(_0x3e07cf){var _0x555f7d=_0x3e07cf[_0x45f6('0x34')]({'plain':!![]});return _0x555f7d[_0x45f6('0x73')];});return db[_0x45f6('0x4e')]['find']({'where':{'id':_0x53a976[_0x45f6('0x5e')]['id']}})[_0x45f6('0x20')](function(_0x5af0ee){return db[_0x45f6('0x74')][_0x45f6('0x75')](function(_0xbadc23){return _0x5af0ee['addTeams'](_0x524f94,{'transaction':_0xbadc23})[_0x45f6('0x20')](function(){return BPromise[_0x45f6('0x76')](_0x1f0fbe,function(_0xad8b1b){return db[_0x45f6('0x5f')]['findOrCreate']({'where':{'UserId':_0xad8b1b['id'],'ChatQueueId':_0x53a976[_0x45f6('0x5e')]['id']},'transaction':_0xbadc23});});})[_0x45f6('0x20')](function(){_0x1f0fbe[_0x45f6('0x77')](function(_0x318822){socket[_0x45f6('0x78')](_0x45f6('0x79'),{'UserId':_0x318822['id'],'ChatQueueId':_0x5af0ee['id']});});});});});}})[_0x45f6('0x20')](respondWithStatusCode(_0x26b20e,null))['catch'](handleError(_0x26b20e,null));};exports['removeTeams']=function(_0x3f7bd3,_0x467a05,_0x2b6c06){return db[_0x45f6('0x6d')][_0x45f6('0x62')]({'where':{'id':_0x3f7bd3[_0x45f6('0x40')][_0x45f6('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x45f6('0x63')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x45f6('0x20')](handleEntityNotFound(_0x467a05,null))[_0x45f6('0x20')](function(_0x537346){var _0x241249=_['map'](_0x537346,'id');var _0x5ea906=[];var _0x479c92=[];var _0x47b5df=squel['select']();_0x47b5df[_0x45f6('0x7a')]('tq.TeamId')[_0x45f6('0x7b')](_0x45f6('0x7c'),'tq')[_0x45f6('0x7d')](_0x45f6('0x7e'),'ut',_0x45f6('0x7f'))['where'](_0x45f6('0x80'),_0x3f7bd3[_0x45f6('0x5e')]['id']);for(var _0x2de5a6=0x0;_0x2de5a6<_0x537346['length'];_0x2de5a6+=0x1){let _0x233380=_0x537346[_0x2de5a6];for(var _0x1c1889=0x0;_0x1c1889<_0x233380['Agents'][_0x45f6('0x46')];_0x1c1889+=0x1){let _0xcee8cc=_0x233380[_0x45f6('0x73')][_0x1c1889];var _0x52294a=_0x47b5df['clone']();_0x52294a['where']('ut.UserId\x20=\x20?',_0xcee8cc['id']);_0x479c92[_0x45f6('0x81')](db[_0x45f6('0x74')]['query'](_0x52294a['toString'](),{'type':db[_0x45f6('0x74')]['QueryTypes'][_0x45f6('0x82')]})[_0x45f6('0x20')](function(_0xfea7b6){if(_0xfea7b6['length']===0x1){return _0xcee8cc['id'];}else{var _0x1ab9fc=_['every'](_[_0x45f6('0x3b')](_0xfea7b6,_0x45f6('0x83')),function(_0x5a4eca){return _[_0x45f6('0x84')](_0x241249,_0x5a4eca);});if(_0x1ab9fc){return _0xcee8cc['id'];}}}));}}return BPromise[_0x45f6('0x85')](_0x479c92)[_0x45f6('0x20')](function(_0x4d0895){_0x5ea906=_(_0x5ea906)[_0x45f6('0x86')](_0x4d0895)['compact']()[_0x45f6('0x87')]();return db[_0x45f6('0x4e')]['find']({'where':{'id':_0x3f7bd3[_0x45f6('0x5e')]['id']}})[_0x45f6('0x20')](function(_0x29a654){return db['sequelize'][_0x45f6('0x75')](function(_0xc78c3b){return _0x29a654[_0x45f6('0x88')](_0x3f7bd3[_0x45f6('0x40')][_0x45f6('0x6f')],{'transaction':_0xc78c3b})[_0x45f6('0x20')](function(){if(!_[_0x45f6('0x89')](_0x5ea906)){return _0x29a654[_0x45f6('0x8a')](_0x5ea906,{'transaction':_0xc78c3b});}})[_0x45f6('0x20')](function(){_0x5ea906[_0x45f6('0x77')](function(_0x584c20){socket[_0x45f6('0x78')](_0x45f6('0x8b'),{'UserId':_0x584c20,'ChatQueueId':_0x29a654['id']});});});});});});})[_0x45f6('0x20')](respondWithStatusCode(_0x467a05,null))[_0x45f6('0x50')](handleError(_0x467a05,null));};exports[_0x45f6('0x8c')]=function(_0x9dc465,_0x170581,_0x1e5f69){return db['ChatQueue']['find']({'where':{'id':_0x9dc465[_0x45f6('0x5e')]['id']}})[_0x45f6('0x20')](handleEntityNotFound(_0x170581,null))[_0x45f6('0x20')](function(_0x1e5d8f){if(_0x1e5d8f){return _0x1e5d8f[_0x45f6('0x8c')](_0x9dc465[_0x45f6('0x55')]['ids'],_['omit'](_0x9dc465['body'],['ids','id'])||{})[_0x45f6('0x8d')](function(_0x5be0b1){for(var _0x3ed5ab=0x0;_0x3ed5ab<_0x9dc465[_0x45f6('0x55')][_0x45f6('0x6f')][_0x45f6('0x46')];_0x3ed5ab+=0x1){socket[_0x45f6('0x78')]('userChatQueue:save',{'UserId':Number(_0x9dc465[_0x45f6('0x55')][_0x45f6('0x6f')][_0x3ed5ab]),'ChatQueueId':Number(_0x9dc465[_0x45f6('0x5e')]['id'])});}return _0x5be0b1;});}})[_0x45f6('0x20')](respondWithResult(_0x170581,null))['catch'](handleError(_0x170581,null));};exports['removeAgents']=function(_0x1ec103,_0x25097b,_0x43198d){return db[_0x45f6('0x4e')][_0x45f6('0x53')]({'where':{'id':_0x1ec103[_0x45f6('0x5e')]['id']}})['then'](handleEntityNotFound(_0x25097b,null))[_0x45f6('0x20')](function(_0x567eb6){if(_0x567eb6){return _0x567eb6['removeAgents'](_0x1ec103[_0x45f6('0x40')][_0x45f6('0x6f')])[_0x45f6('0x20')](function(){if(_[_0x45f6('0x8e')](_0x1ec103[_0x45f6('0x40')]['ids'])){for(var _0x4dbc04=0x0;_0x4dbc04<_0x1ec103[_0x45f6('0x40')][_0x45f6('0x6f')][_0x45f6('0x46')];_0x4dbc04+=0x1){socket[_0x45f6('0x78')](_0x45f6('0x8b'),{'UserId':Number(_0x1ec103['query'][_0x45f6('0x6f')][_0x4dbc04]),'ChatQueueId':Number(_0x1ec103[_0x45f6('0x5e')]['id'])});}}else{socket[_0x45f6('0x78')](_0x45f6('0x8b'),{'UserId':Number(_0x1ec103[_0x45f6('0x40')][_0x45f6('0x6f')]),'ChatQueueId':Number(_0x1ec103[_0x45f6('0x5e')]['id'])});}});}})[_0x45f6('0x20')](respondWithStatusCode(_0x25097b,null))[_0x45f6('0x50')](handleError(_0x25097b,null));};exports[_0x45f6('0x8f')]=function(_0x59c9b1,_0x4b2e31,_0x87a7a4){var _0x456c54={};var _0x40aeda={};var _0x111b5c;var _0x5f041d;return db[_0x45f6('0x4e')]['findOne']({'where':{'id':_0x59c9b1[_0x45f6('0x5e')]['id']}})[_0x45f6('0x20')](handleEntityNotFound(_0x4b2e31,null))[_0x45f6('0x20')](function(_0x5c5292){if(_0x5c5292){_0x111b5c=_0x5c5292;_0x40aeda[_0x45f6('0x3f')]=_[_0x45f6('0x41')](db[_0x45f6('0x63')]['rawAttributes']);_0x40aeda[_0x45f6('0x40')]=_[_0x45f6('0x41')](_0x59c9b1[_0x45f6('0x40')]);_0x40aeda[_0x45f6('0x42')]=_['intersection'](_0x40aeda[_0x45f6('0x3f')],_0x40aeda[_0x45f6('0x40')]);_0x456c54[_0x45f6('0x44')]=_[_0x45f6('0x43')](_0x40aeda[_0x45f6('0x3f')],qs['fields'](_0x59c9b1[_0x45f6('0x40')][_0x45f6('0x45')]));_0x456c54['attributes']=_0x456c54[_0x45f6('0x44')][_0x45f6('0x46')]?_0x456c54[_0x45f6('0x44')]:_0x40aeda['model'];_0x456c54['order']=qs['sort'](_0x59c9b1[_0x45f6('0x40')][_0x45f6('0x48')]);_0x456c54[_0x45f6('0x49')]=qs[_0x45f6('0x42')](_[_0x45f6('0x4a')](_0x59c9b1[_0x45f6('0x40')],_0x40aeda[_0x45f6('0x42')]));if(_0x59c9b1['query'][_0x45f6('0x4b')]){_0x456c54[_0x45f6('0x49')]=_['merge'](_0x456c54[_0x45f6('0x49')],{'$or':_[_0x45f6('0x3b')](_0x456c54[_0x45f6('0x44')],function(_0x409fbe){var _0x452800={};_0x452800[_0x409fbe]={'$like':'%'+_0x59c9b1[_0x45f6('0x40')]['filter']+'%'};return _0x452800;})});}_0x456c54=_['merge']({},_0x456c54,_0x59c9b1['options']);return _0x111b5c[_0x45f6('0x8f')](_0x456c54);}})[_0x45f6('0x20')](function(_0xce4135){if(_0xce4135){_0x5f041d=_0xce4135[_0x45f6('0x46')];if(!_0x59c9b1[_0x45f6('0x40')][_0x45f6('0x60')](_0x45f6('0x61'))){_0x456c54['limit']=qs[_0x45f6('0x2f')](_0x59c9b1[_0x45f6('0x40')][_0x45f6('0x2f')]);_0x456c54[_0x45f6('0x2e')]=qs[_0x45f6('0x2e')](_0x59c9b1['query'][_0x45f6('0x2e')]);}return _0x111b5c[_0x45f6('0x8f')](_0x456c54);}})[_0x45f6('0x20')](function(_0x213bce){if(_0x213bce){return _0x213bce?{'count':_0x5f041d,'rows':_0x213bce}:null;}})[_0x45f6('0x20')](respondWithResult(_0x4b2e31,null))['catch'](handleError(_0x4b2e31,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 6b7fd14..37cf7f9 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 _0x117d=['update','remove','emit','hasOwnProperty','events','../../mysqldb','ChatQueue','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x117d,0xac));var _0xd117=function(_0x5eb22e,_0x27cbac){_0x5eb22e=_0x5eb22e-0x0;var _0x27fed5=_0x117d[_0x5eb22e];return _0x27fed5;};'use strict';var EventEmitter=require(_0xd117('0x0'));var ChatQueue=require(_0xd117('0x1'))['db'][_0xd117('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd117('0x3'),'afterUpdate':_0xd117('0x4'),'afterDestroy':_0xd117('0x5')};function emitEvent(_0x3c057f){return function(_0x379647,_0x5669d1,_0x3a628c){ChatQueueEvents[_0xd117('0x6')](_0x3c057f+':'+_0x379647['id'],_0x379647);ChatQueueEvents[_0xd117('0x6')](_0x3c057f,_0x379647);_0x3a628c(null);};}for(var e in events){if(events[_0xd117('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0x54e5=['save','update','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue'];(function(_0x56b220,_0x3f63d6){var _0x32d387=function(_0x3aa72c){while(--_0x3aa72c){_0x56b220['push'](_0x56b220['shift']());}};_0x32d387(++_0x3f63d6);}(_0x54e5,0x145));var _0x554e=function(_0x59831f,_0x5154ca){_0x59831f=_0x59831f-0x0;var _0x11f70c=_0x54e5[_0x59831f];return _0x11f70c;};'use strict';var EventEmitter=require(_0x554e('0x0'));var ChatQueue=require(_0x554e('0x1'))['db'][_0x554e('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x554e('0x3'),'afterUpdate':_0x554e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x434b88){return function(_0x587a8e,_0x254240,_0x143630){ChatQueueEvents['emit'](_0x434b88+':'+_0x587a8e['id'],_0x587a8e);ChatQueueEvents['emit'](_0x434b88,_0x587a8e);_0x143630(null);};}for(var e in events){if(events[_0x554e('0x5')](e)){var event=events[e];ChatQueue[_0x554e('0x6')](e,emitEvent(event));}}module[_0x554e('0x7')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 786ac26..95433d5 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 _0x2f27=['bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','chat_queues','lodash','util','../../config/logger','api','moment'];(function(_0x3f6cf1,_0x142089){var _0x383c19=function(_0x4305b0){while(--_0x4305b0){_0x3f6cf1['push'](_0x3f6cf1['shift']());}};_0x383c19(++_0x142089);}(_0x2f27,0x192));var _0x72f2=function(_0xacf58b,_0x57ddc3){_0xacf58b=_0xacf58b-0x0;var _0x58d3dd=_0x2f27[_0xacf58b];return _0x58d3dd;};'use strict';var _=require(_0x72f2('0x0'));var util=require(_0x72f2('0x1'));var logger=require(_0x72f2('0x2'))(_0x72f2('0x3'));var moment=require(_0x72f2('0x4'));var BPromise=require(_0x72f2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x72f2('0x6'));var rimraf=require(_0x72f2('0x7'));var config=require(_0x72f2('0x8'));var attributes=require(_0x72f2('0x9'));module['exports']=function(_0x5e41e2,_0x3b434c){return _0x5e41e2['define']('ChatQueue',attributes,{'tableName':_0x72f2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xab42=['ChatQueue','chat_queues','util','../../config/logger','api','moment','bluebird','rimraf','./chatQueue.attributes','exports','define'];(function(_0x292423,_0x1759b7){var _0x2801cb=function(_0x23c821){while(--_0x23c821){_0x292423['push'](_0x292423['shift']());}};_0x2801cb(++_0x1759b7);}(_0xab42,0x183));var _0x2ab4=function(_0x5073c9,_0xe3c981){_0x5073c9=_0x5073c9-0x0;var _0x26e187=_0xab42[_0x5073c9];return _0x26e187;};'use strict';var _=require('lodash');var util=require(_0x2ab4('0x0'));var logger=require(_0x2ab4('0x1'))(_0x2ab4('0x2'));var moment=require(_0x2ab4('0x3'));var BPromise=require(_0x2ab4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2ab4('0x5'));var config=require('../../config/environment');var attributes=require(_0x2ab4('0x6'));module[_0x2ab4('0x7')]=function(_0x4b76ad,_0x236fe8){return _0x4b76ad[_0x2ab4('0x8')](_0x2ab4('0x9'),attributes,{'tableName':_0x2ab4('0xa'),'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 6bbed6e..0f21f3f 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 _0xd193=['../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ChatQueue','findAll','options','raw','attributes','limit','include','model','map','GetChatQueue','ShowChatQueue','where','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x4031e5,_0x5d9cd0){var _0x25b248=function(_0x3f0d9a){while(--_0x3f0d9a){_0x4031e5['push'](_0x4031e5['shift']());}};_0x25b248(++_0x5d9cd0);}(_0xd193,0x119));var _0x3d19=function(_0x10906d,_0x4f2405){_0x10906d=_0x10906d-0x0;var _0x27a475=_0xd193[_0x10906d];return _0x27a475;};'use strict';var _=require(_0x3d19('0x0'));var util=require(_0x3d19('0x1'));var moment=require(_0x3d19('0x2'));var BPromise=require(_0x3d19('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3d19('0x4'))['db'];var utils=require(_0x3d19('0x5'));var logger=require(_0x3d19('0x6'))(_0x3d19('0x7'));var config=require('../../config/environment');var jayson=require(_0x3d19('0x8'));var client=jayson[_0x3d19('0x9')][_0x3d19('0xa')]({'port':0x232a});config[_0x3d19('0xb')]=_[_0x3d19('0xc')](config[_0x3d19('0xb')],{'host':_0x3d19('0xd'),'port':0x18eb});var socket=require(_0x3d19('0xe'))(new Redis(config[_0x3d19('0xb')]));require(_0x3d19('0xf'))['register'](socket);function respondWithRpcPromise(_0x3da59c,_0x59a7e1,_0x41e93f){return new BPromise(function(_0x1a7313,_0x18ce15){return client[_0x3d19('0x10')](_0x3da59c,_0x41e93f)[_0x3d19('0x11')](function(_0x5543a0){logger[_0x3d19('0x12')](_0x3d19('0x13'),_0x59a7e1,'request\x20sent');logger[_0x3d19('0x14')](_0x3d19('0x15'),_0x59a7e1,_0x3d19('0x16'),JSON[_0x3d19('0x17')](_0x5543a0));if(_0x5543a0[_0x3d19('0x18')]){if(_0x5543a0[_0x3d19('0x18')][_0x3d19('0x19')]===0x1f4){logger[_0x3d19('0x18')](_0x3d19('0x13'),_0x59a7e1,_0x5543a0[_0x3d19('0x18')]['message']);return _0x18ce15(_0x5543a0[_0x3d19('0x18')][_0x3d19('0x1a')]);}logger[_0x3d19('0x18')](_0x3d19('0x13'),_0x59a7e1,_0x5543a0[_0x3d19('0x18')][_0x3d19('0x1a')]);return _0x1a7313(_0x5543a0[_0x3d19('0x18')]['message']);}else{logger[_0x3d19('0x12')](_0x3d19('0x13'),_0x59a7e1,'request\x20sent');_0x1a7313(_0x5543a0[_0x3d19('0x1b')][_0x3d19('0x1a')]);}})[_0x3d19('0x1c')](function(_0x15b379){logger['error'](_0x3d19('0x13'),_0x59a7e1,_0x15b379);_0x18ce15(_0x15b379);});});}exports['GetChatQueue']=function(_0x41812e){var _0x1c1ada=this;return new Promise(function(_0x2232ce,_0x32f2f7){return db[_0x3d19('0x1d')][_0x3d19('0x1e')]({'raw':_0x41812e[_0x3d19('0x1f')]?_0x41812e['options'][_0x3d19('0x20')]===undefined?!![]:![]:!![],'where':_0x41812e[_0x3d19('0x1f')]?_0x41812e[_0x3d19('0x1f')]['where']||null:null,'attributes':_0x41812e[_0x3d19('0x1f')]?_0x41812e[_0x3d19('0x1f')][_0x3d19('0x21')]||null:null,'limit':_0x41812e[_0x3d19('0x1f')]?_0x41812e[_0x3d19('0x1f')][_0x3d19('0x22')]||null:null,'include':_0x41812e['options']?_0x41812e[_0x3d19('0x1f')][_0x3d19('0x23')]?_['map'](_0x41812e[_0x3d19('0x1f')][_0x3d19('0x23')],function(_0xb2b9d7){return{'model':db[_0xb2b9d7[_0x3d19('0x24')]],'as':_0xb2b9d7['as'],'attributes':_0xb2b9d7[_0x3d19('0x21')],'include':_0xb2b9d7[_0x3d19('0x23')]?_[_0x3d19('0x25')](_0xb2b9d7[_0x3d19('0x23')],function(_0x2b8fbc){return{'model':db[_0x2b8fbc[_0x3d19('0x24')]],'as':_0x2b8fbc['as'],'attributes':_0x2b8fbc['attributes'],'include':_0x2b8fbc[_0x3d19('0x23')]?_[_0x3d19('0x25')](_0x2b8fbc['include'],function(_0x41736a){return{'model':db[_0x41736a[_0x3d19('0x24')]],'as':_0x41736a['as'],'attributes':_0x41736a[_0x3d19('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3d19('0x11')](function(_0x14791b){logger[_0x3d19('0x12')](_0x3d19('0x26'),_0x41812e);logger[_0x3d19('0x14')](_0x3d19('0x26'),_0x41812e,JSON[_0x3d19('0x17')](_0x14791b));_0x2232ce(_0x14791b);})[_0x3d19('0x1c')](function(_0x1abd12){logger[_0x3d19('0x18')](_0x3d19('0x26'),_0x1abd12[_0x3d19('0x1a')],_0x41812e);_0x32f2f7(_0x1c1ada[_0x3d19('0x18')](0x1f4,_0x1abd12[_0x3d19('0x1a')]));});});};exports[_0x3d19('0x27')]=function(_0x5a0baa){var _0x19b516=this;return new Promise(function(_0x35c027,_0x582c08){return db[_0x3d19('0x1d')]['find']({'raw':_0x5a0baa[_0x3d19('0x1f')]?_0x5a0baa['options'][_0x3d19('0x20')]===undefined?!![]:![]:!![],'where':_0x5a0baa[_0x3d19('0x1f')]?_0x5a0baa[_0x3d19('0x1f')][_0x3d19('0x28')]||null:null,'attributes':_0x5a0baa['options']?_0x5a0baa[_0x3d19('0x1f')][_0x3d19('0x21')]||null:null,'include':_0x5a0baa[_0x3d19('0x1f')]?_0x5a0baa[_0x3d19('0x1f')][_0x3d19('0x23')]?_[_0x3d19('0x25')](_0x5a0baa[_0x3d19('0x1f')][_0x3d19('0x23')],function(_0x9465ab){return{'model':db[_0x9465ab[_0x3d19('0x24')]],'as':_0x9465ab['as'],'attributes':_0x9465ab[_0x3d19('0x21')],'include':_0x9465ab[_0x3d19('0x23')]?_[_0x3d19('0x25')](_0x9465ab[_0x3d19('0x23')],function(_0x48c73a){return{'model':db[_0x48c73a['model']],'as':_0x48c73a['as'],'attributes':_0x48c73a[_0x3d19('0x21')],'include':_0x48c73a['include']?_[_0x3d19('0x25')](_0x48c73a['include'],function(_0x25958c){return{'model':db[_0x25958c[_0x3d19('0x24')]],'as':_0x25958c['as'],'attributes':_0x25958c[_0x3d19('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ccd5f){logger[_0x3d19('0x12')](_0x3d19('0x27'),_0x5a0baa);logger[_0x3d19('0x14')]('ShowChatQueue',_0x5a0baa,JSON[_0x3d19('0x17')](_0x3ccd5f));_0x35c027(_0x3ccd5f);})[_0x3d19('0x1c')](function(_0x2b0b42){logger[_0x3d19('0x18')](_0x3d19('0x27'),_0x2b0b42[_0x3d19('0x1a')],_0x5a0baa);_0x582c08(_0x19b516[_0x3d19('0x18')](0x1f4,_0x2b0b42['message']));});});};
\ No newline at end of file
+var _0xa212=['attributes','limit','map','include','model','then','ShowChatQueue','find','lodash','util','moment','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','./chatQueue.socket','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw'];(function(_0x48794b,_0x263f18){var _0x26ffeb=function(_0x7d4660){while(--_0x7d4660){_0x48794b['push'](_0x48794b['shift']());}};_0x26ffeb(++_0x263f18);}(_0xa212,0xec));var _0x2a21=function(_0x56782b,_0x571079){_0x56782b=_0x56782b-0x0;var _0xcc177=_0xa212[_0x56782b];return _0xcc177;};'use strict';var _=require(_0x2a21('0x0'));var util=require(_0x2a21('0x1'));var moment=require(_0x2a21('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2a21('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2a21('0x4'));var config=require(_0x2a21('0x5'));var jayson=require(_0x2a21('0x6'));var client=jayson[_0x2a21('0x7')][_0x2a21('0x8')]({'port':0x232a});config['redis']=_[_0x2a21('0x9')](config[_0x2a21('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2a21('0xa')]));require(_0x2a21('0xb'))[_0x2a21('0xc')](socket);function respondWithRpcPromise(_0x4ccd7f,_0x1cb5d3,_0x44d6ed){return new BPromise(function(_0x3b6858,_0x222ab1){return client[_0x2a21('0xd')](_0x4ccd7f,_0x44d6ed)['then'](function(_0x1ced22){logger[_0x2a21('0xe')](_0x2a21('0xf'),_0x1cb5d3,_0x2a21('0x10'));logger[_0x2a21('0x11')](_0x2a21('0x12'),_0x1cb5d3,_0x2a21('0x10'),JSON[_0x2a21('0x13')](_0x1ced22));if(_0x1ced22['error']){if(_0x1ced22[_0x2a21('0x14')][_0x2a21('0x15')]===0x1f4){logger[_0x2a21('0x14')](_0x2a21('0xf'),_0x1cb5d3,_0x1ced22[_0x2a21('0x14')][_0x2a21('0x16')]);return _0x222ab1(_0x1ced22[_0x2a21('0x14')][_0x2a21('0x16')]);}logger[_0x2a21('0x14')](_0x2a21('0xf'),_0x1cb5d3,_0x1ced22[_0x2a21('0x14')][_0x2a21('0x16')]);return _0x3b6858(_0x1ced22['error'][_0x2a21('0x16')]);}else{logger[_0x2a21('0xe')](_0x2a21('0xf'),_0x1cb5d3,_0x2a21('0x10'));_0x3b6858(_0x1ced22[_0x2a21('0x17')][_0x2a21('0x16')]);}})[_0x2a21('0x18')](function(_0x3af061){logger[_0x2a21('0x14')](_0x2a21('0xf'),_0x1cb5d3,_0x3af061);_0x222ab1(_0x3af061);});});}exports[_0x2a21('0x19')]=function(_0x403e2c){var _0x11f2ce=this;return new Promise(function(_0x2e6d08,_0x470093){return db[_0x2a21('0x1a')][_0x2a21('0x1b')]({'raw':_0x403e2c[_0x2a21('0x1c')]?_0x403e2c[_0x2a21('0x1c')][_0x2a21('0x1d')]===undefined?!![]:![]:!![],'where':_0x403e2c[_0x2a21('0x1c')]?_0x403e2c['options']['where']||null:null,'attributes':_0x403e2c['options']?_0x403e2c[_0x2a21('0x1c')][_0x2a21('0x1e')]||null:null,'limit':_0x403e2c[_0x2a21('0x1c')]?_0x403e2c[_0x2a21('0x1c')][_0x2a21('0x1f')]||null:null,'include':_0x403e2c[_0x2a21('0x1c')]?_0x403e2c[_0x2a21('0x1c')]['include']?_[_0x2a21('0x20')](_0x403e2c[_0x2a21('0x1c')][_0x2a21('0x21')],function(_0x336738){return{'model':db[_0x336738['model']],'as':_0x336738['as'],'attributes':_0x336738[_0x2a21('0x1e')],'include':_0x336738[_0x2a21('0x21')]?_[_0x2a21('0x20')](_0x336738['include'],function(_0x3d7238){return{'model':db[_0x3d7238[_0x2a21('0x22')]],'as':_0x3d7238['as'],'attributes':_0x3d7238[_0x2a21('0x1e')],'include':_0x3d7238[_0x2a21('0x21')]?_[_0x2a21('0x20')](_0x3d7238[_0x2a21('0x21')],function(_0x570f65){return{'model':db[_0x570f65[_0x2a21('0x22')]],'as':_0x570f65['as'],'attributes':_0x570f65[_0x2a21('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2a21('0x23')](function(_0xe61e76){logger[_0x2a21('0xe')](_0x2a21('0x19'),_0x403e2c);logger[_0x2a21('0x11')](_0x2a21('0x19'),_0x403e2c,JSON[_0x2a21('0x13')](_0xe61e76));_0x2e6d08(_0xe61e76);})['catch'](function(_0x5112e6){logger[_0x2a21('0x14')](_0x2a21('0x19'),_0x5112e6[_0x2a21('0x16')],_0x403e2c);_0x470093(_0x11f2ce[_0x2a21('0x14')](0x1f4,_0x5112e6[_0x2a21('0x16')]));});});};exports[_0x2a21('0x24')]=function(_0x33b412){var _0x38be0a=this;return new Promise(function(_0x5b72f3,_0x304479){return db[_0x2a21('0x1a')][_0x2a21('0x25')]({'raw':_0x33b412[_0x2a21('0x1c')]?_0x33b412[_0x2a21('0x1c')][_0x2a21('0x1d')]===undefined?!![]:![]:!![],'where':_0x33b412['options']?_0x33b412['options']['where']||null:null,'attributes':_0x33b412[_0x2a21('0x1c')]?_0x33b412['options'][_0x2a21('0x1e')]||null:null,'include':_0x33b412[_0x2a21('0x1c')]?_0x33b412['options']['include']?_[_0x2a21('0x20')](_0x33b412['options']['include'],function(_0x2b0e0f){return{'model':db[_0x2b0e0f[_0x2a21('0x22')]],'as':_0x2b0e0f['as'],'attributes':_0x2b0e0f['attributes'],'include':_0x2b0e0f['include']?_['map'](_0x2b0e0f[_0x2a21('0x21')],function(_0x40455e){return{'model':db[_0x40455e[_0x2a21('0x22')]],'as':_0x40455e['as'],'attributes':_0x40455e['attributes'],'include':_0x40455e[_0x2a21('0x21')]?_[_0x2a21('0x20')](_0x40455e[_0x2a21('0x21')],function(_0x5747be){return{'model':db[_0x5747be[_0x2a21('0x22')]],'as':_0x5747be['as'],'attributes':_0x5747be[_0x2a21('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2a21('0x23')](function(_0x5393a3){logger[_0x2a21('0xe')](_0x2a21('0x24'),_0x33b412);logger[_0x2a21('0x11')](_0x2a21('0x24'),_0x33b412,JSON[_0x2a21('0x13')](_0x5393a3));_0x5b72f3(_0x5393a3);})[_0x2a21('0x18')](function(_0x4f29e3){logger[_0x2a21('0x14')](_0x2a21('0x24'),_0x4f29e3['message'],_0x33b412);_0x304479(_0x38be0a['error'](0x1f4,_0x4f29e3[_0x2a21('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 617e7da..099bc31 100644
--- a/server/api/chatQueue/chatQueue.socket.js
+++ b/server/api/chatQueue/chatQueue.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8d0e=['save','remove','update','emit','removeListener','length','chatQueue:','./chatQueue.events'];(function(_0xd7f8f7,_0x42785e){var _0x34b92c=function(_0x4833c9){while(--_0x4833c9){_0xd7f8f7['push'](_0xd7f8f7['shift']());}};_0x34b92c(++_0x42785e);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x57e4ca,_0x40e237){_0x57e4ca=_0x57e4ca-0x0;var _0x2084db=_0x8d0e[_0x57e4ca];return _0x2084db;};'use strict';var ChatQueueEvents=require(_0xe8d0('0x0'));var events=[_0xe8d0('0x1'),_0xe8d0('0x2'),_0xe8d0('0x3')];function createListener(_0x2eae0c,_0x3584ab){return function(_0x15521e){_0x3584ab[_0xe8d0('0x4')](_0x2eae0c,_0x15521e);};}function removeListener(_0x32cee9,_0x579cb9){return function(){ChatQueueEvents[_0xe8d0('0x5')](_0x32cee9,_0x579cb9);};}exports['register']=function(_0x560dab){for(var _0x2e2985=0x0,_0x92483d=events[_0xe8d0('0x6')];_0x2e2985<_0x92483d;_0x2e2985++){var _0xcc03d0=events[_0x2e2985];var _0x2b6dce=createListener(_0xe8d0('0x7')+_0xcc03d0,_0x560dab);ChatQueueEvents['on'](_0xcc03d0,_0x2b6dce);}};
\ No newline at end of file
+var _0x0c02=['save','remove','emit','removeListener','register','chatQueue:'];(function(_0x169f86,_0xadf81f){var _0x30cced=function(_0x84611b){while(--_0x84611b){_0x169f86['push'](_0x169f86['shift']());}};_0x30cced(++_0xadf81f);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x20c0('0x0'),_0x20c0('0x1'),'update'];function createListener(_0x1338cf,_0x5c8750){return function(_0x454922){_0x5c8750[_0x20c0('0x2')](_0x1338cf,_0x454922);};}function removeListener(_0x38022e,_0x2e9d65){return function(){ChatQueueEvents[_0x20c0('0x3')](_0x38022e,_0x2e9d65);};}exports[_0x20c0('0x4')]=function(_0x13312d){for(var _0xd25ee8=0x0,_0x5d6408=events['length'];_0xd25ee8<_0x5d6408;_0xd25ee8++){var _0x5da127=events[_0xd25ee8];var _0x4db532=createListener(_0x20c0('0x5')+_0x5da127,_0x13312d);ChatQueueEvents['on'](_0x5da127,_0x4db532);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 741d34c..d9bf04c 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 _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x50993d,_0xdb0f36){var _0x5f3d4a=function(_0x3e5025){while(--_0x3e5025){_0x50993d['push'](_0x50993d['shift']());}};_0x5f3d4a(++_0xdb0f36);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+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(_0xae11a3,_0x93a629){var _0x481f5f=function(_0x46a4b3){while(--_0x46a4b3){_0xae11a3['push'](_0xae11a3['shift']());}};_0x481f5f(++_0x93a629);}(_0xe14b,0x93));var _0xbe14=function(_0x4a9a9b,_0x21fa9f){_0x4a9a9b=_0x4a9a9b-0x0;var _0x33c8d4=_0xe14b[_0x4a9a9b];return _0x33c8d4;};'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 3b643c8..18f92e8 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 _0xabfb=['exports','STRING','DATE','moment'];(function(_0x1994d0,_0x542633){var _0x1832cd=function(_0x28bc35){while(--_0x28bc35){_0x1994d0['push'](_0x1994d0['shift']());}};_0x1832cd(++_0x542633);}(_0xabfb,0x177));var _0xbabf=function(_0x4a599b,_0x1d2125){_0x4a599b=_0x4a599b-0x0;var _0x2d53d3=_0xabfb[_0x4a599b];return _0x2d53d3;};'use strict';var moment=require(_0xbabf('0x0'));var Sequelize=require('sequelize');module[_0xbabf('0x1')]={'uniqueid':{'type':Sequelize[_0xbabf('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xbabf('0x2')]},'joinAt':{'type':Sequelize[_0xbabf('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xbabf('0x3')]},'exitAt':{'type':Sequelize[_0xbabf('0x3')]},'reason':{'type':Sequelize[_0xbabf('0x2')]}};
\ No newline at end of file
+var _0xef6d=['sequelize','exports','STRING','DATE'];(function(_0x3a7aa8,_0xcf6f10){var _0x32a6ff=function(_0x2ce831){while(--_0x2ce831){_0x3a7aa8['push'](_0x3a7aa8['shift']());}};_0x32a6ff(++_0xcf6f10);}(_0xef6d,0x12c));var _0xdef6=function(_0x49bee0,_0x4f1aaf){_0x49bee0=_0x49bee0-0x0;var _0x411764=_0xef6d[_0x49bee0];return _0x411764;};'use strict';var moment=require('moment');var Sequelize=require(_0xdef6('0x0'));module[_0xdef6('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xdef6('0x2')]},'joinAt':{'type':Sequelize[_0xdef6('0x3')]},'leaveAt':{'type':Sequelize[_0xdef6('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xdef6('0x3')]},'reason':{'type':Sequelize[_0xdef6('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index b0cdc7c..9dc806b 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 _0x7c09=['map','ChatQueueReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index'];(function(_0x41c551,_0x544082){var _0x35d26b=function(_0x262254){while(--_0x262254){_0x41c551['push'](_0x41c551['shift']());}};_0x35d26b(++_0x544082);}(_0x7c09,0x102));var _0x97c0=function(_0x3b33a2,_0x552461){_0x3b33a2=_0x3b33a2-0x0;var _0x42952c=_0x7c09[_0x3b33a2];return _0x42952c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x97c0('0x0'));var zipdir=require(_0x97c0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x97c0('0x2'));var moment=require(_0x97c0('0x3'));var BPromise=require(_0x97c0('0x4'));var Mustache=require(_0x97c0('0x5'));var util=require(_0x97c0('0x6'));var path=require(_0x97c0('0x7'));var sox=require(_0x97c0('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x97c0('0x9'));var squel=require(_0x97c0('0xa'));var crypto=require(_0x97c0('0xb'));var jsforce=require(_0x97c0('0xc'));var deskjs=require(_0x97c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x97c0('0xe'));var Papa=require('papaparse');var Redis=require(_0x97c0('0xf'));var authService=require(_0x97c0('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x97c0('0x11'));var logger=require(_0x97c0('0x12'))(_0x97c0('0x13'));var utils=require(_0x97c0('0x14'));var config=require(_0x97c0('0x15'));var licenseUtil=require(_0x97c0('0x16'));var db=require(_0x97c0('0x17'))['db'];function respondWithStatusCode(_0x39a3b4,_0x9ca3c1){_0x9ca3c1=_0x9ca3c1||0xcc;return function(_0x2ecf34){if(_0x2ecf34){return _0x39a3b4[_0x97c0('0x18')](_0x9ca3c1);}return _0x39a3b4[_0x97c0('0x19')](_0x9ca3c1)[_0x97c0('0x1a')]();};}function respondWithResult(_0x514782,_0x3f2fc2){_0x3f2fc2=_0x3f2fc2||0xc8;return function(_0x15b336){if(_0x15b336){return _0x514782[_0x97c0('0x19')](_0x3f2fc2)['json'](_0x15b336);}};}function respondWithFilteredResult(_0x42027d,_0x9ca6a8){return function(_0x379951){if(_0x379951){var _0x21e5f7=typeof _0x9ca6a8[_0x97c0('0x1b')]===_0x97c0('0x1c')&&typeof _0x9ca6a8['limit']===_0x97c0('0x1c');var _0x3ae7c4=_0x379951['count'];var _0x560ac0=_0x21e5f7?0x0:_0x9ca6a8[_0x97c0('0x1b')];var _0x179d43=_0x21e5f7?_0x379951[_0x97c0('0x1d')]:_0x9ca6a8[_0x97c0('0x1b')]+_0x9ca6a8[_0x97c0('0x1e')];var _0x4fed42;if(_0x179d43>=_0x3ae7c4){_0x179d43=_0x3ae7c4;_0x4fed42=0xc8;}else{_0x4fed42=0xce;}_0x42027d[_0x97c0('0x19')](_0x4fed42);return _0x42027d[_0x97c0('0x1f')](_0x97c0('0x20'),_0x560ac0+'-'+_0x179d43+'/'+_0x3ae7c4)['json'](_0x379951);}return null;};}function patchUpdates(_0x554122){return function(_0x2b74a2){try{jsonpatch[_0x97c0('0x21')](_0x2b74a2,_0x554122,!![]);}catch(_0x169f19){return BPromise['reject'](_0x169f19);}return _0x2b74a2[_0x97c0('0x22')]();};}function saveUpdates(_0x20bc4c,_0x31ffb7){return function(_0x272314){if(_0x272314){return _0x272314[_0x97c0('0x23')](_0x20bc4c)[_0x97c0('0x24')](function(_0x9dff60){return _0x9dff60;});}return null;};}function removeEntity(_0x5ac457,_0x60ab00){return function(_0x29b3aa){if(_0x29b3aa){return _0x29b3aa[_0x97c0('0x25')]()[_0x97c0('0x24')](function(){_0x5ac457['status'](0xcc)[_0x97c0('0x1a')]();});}};}function handleEntityNotFound(_0x14cada,_0x52a429){return function(_0x2ec9d6){if(!_0x2ec9d6){_0x14cada[_0x97c0('0x18')](0x194);}return _0x2ec9d6;};}function handleError(_0x447316,_0x4af5a5){_0x4af5a5=_0x4af5a5||0x1f4;return function(_0x4f11ba){logger['error'](_0x4f11ba[_0x97c0('0x26')]);if(_0x4f11ba[_0x97c0('0x27')]){delete _0x4f11ba[_0x97c0('0x27')];}_0x447316[_0x97c0('0x19')](_0x4af5a5)[_0x97c0('0x28')](_0x4f11ba);};}exports[_0x97c0('0x29')]=function(_0x4a3645,_0x10e47e){var _0x1c183f={},_0x325090={},_0x4ad645={'count':0x0,'rows':[]};var _0x14617c=_[_0x97c0('0x2a')](db[_0x97c0('0x2b')][_0x97c0('0x2c')],function(_0x2a7b2b){return{'name':_0x2a7b2b['fieldName'],'type':_0x2a7b2b['type'][_0x97c0('0x2d')]};});_0x325090[_0x97c0('0x2e')]=_[_0x97c0('0x2a')](_0x14617c,'name');_0x325090[_0x97c0('0x2f')]=_[_0x97c0('0x30')](_0x4a3645['query']);_0x325090[_0x97c0('0x31')]=_[_0x97c0('0x32')](_0x325090[_0x97c0('0x2e')],_0x325090[_0x97c0('0x2f')]);_0x1c183f[_0x97c0('0x33')]=_[_0x97c0('0x32')](_0x325090[_0x97c0('0x2e')],qs[_0x97c0('0x34')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x34')]));_0x1c183f[_0x97c0('0x33')]=_0x1c183f[_0x97c0('0x33')][_0x97c0('0x35')]?_0x1c183f[_0x97c0('0x33')]:_0x325090[_0x97c0('0x2e')];if(!_0x4a3645['query'][_0x97c0('0x36')](_0x97c0('0x37'))){_0x1c183f[_0x97c0('0x1e')]=qs[_0x97c0('0x1e')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x1e')]);_0x1c183f[_0x97c0('0x1b')]=qs[_0x97c0('0x1b')](_0x4a3645['query'][_0x97c0('0x1b')]);}_0x1c183f['order']=qs[_0x97c0('0x38')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x38')]);_0x1c183f[_0x97c0('0x39')]=qs[_0x97c0('0x31')](_[_0x97c0('0x3a')](_0x4a3645[_0x97c0('0x2f')],_0x325090[_0x97c0('0x31')]),_0x14617c);if(_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x3b')]){_0x1c183f[_0x97c0('0x39')]=_['merge'](_0x1c183f[_0x97c0('0x39')],{'$or':_[_0x97c0('0x2a')](_0x14617c,function(_0x4d47b1){if(_0x4d47b1[_0x97c0('0x3c')]!==_0x97c0('0x3d')){var _0x2aeffc={};_0x2aeffc[_0x4d47b1[_0x97c0('0x27')]]={'$like':'%'+_0x4a3645['query'][_0x97c0('0x3b')]+'%'};return _0x2aeffc;}})});}_0x1c183f=_['merge']({},_0x1c183f,_0x4a3645[_0x97c0('0x3e')]);var _0x64cfcd={'where':_0x1c183f['where']};return db[_0x97c0('0x2b')][_0x97c0('0x1d')](_0x64cfcd)[_0x97c0('0x24')](function(_0xb13649){_0x4ad645[_0x97c0('0x1d')]=_0xb13649;if(_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x3f')]){_0x1c183f[_0x97c0('0x40')]=[{'all':!![]}];}return db[_0x97c0('0x2b')][_0x97c0('0x41')](_0x1c183f);})[_0x97c0('0x24')](function(_0x2cca4c){_0x4ad645[_0x97c0('0x42')]=_0x2cca4c;return _0x4ad645;})['then'](respondWithFilteredResult(_0x10e47e,_0x1c183f))[_0x97c0('0x43')](handleError(_0x10e47e,null));};exports[_0x97c0('0x44')]=function(_0x1dc6ff,_0x142421){var _0x312fce={'raw':!![],'where':{'id':_0x1dc6ff[_0x97c0('0x45')]['id']}},_0x375ebc={};_0x375ebc['model']=_['keys'](db[_0x97c0('0x2b')][_0x97c0('0x2c')]);_0x375ebc[_0x97c0('0x2f')]=_[_0x97c0('0x30')](_0x1dc6ff[_0x97c0('0x2f')]);_0x375ebc['filters']=_['intersection'](_0x375ebc['model'],_0x375ebc[_0x97c0('0x2f')]);_0x312fce['attributes']=_['intersection'](_0x375ebc[_0x97c0('0x2e')],qs[_0x97c0('0x34')](_0x1dc6ff[_0x97c0('0x2f')][_0x97c0('0x34')]));_0x312fce[_0x97c0('0x33')]=_0x312fce['attributes'][_0x97c0('0x35')]?_0x312fce[_0x97c0('0x33')]:_0x375ebc[_0x97c0('0x2e')];if(_0x1dc6ff[_0x97c0('0x2f')][_0x97c0('0x3f')]){_0x312fce[_0x97c0('0x40')]=[{'all':!![]}];}_0x312fce=_[_0x97c0('0x46')]({},_0x312fce,_0x1dc6ff[_0x97c0('0x3e')]);return db[_0x97c0('0x2b')][_0x97c0('0x47')](_0x312fce)['then'](handleEntityNotFound(_0x142421,null))[_0x97c0('0x24')](respondWithResult(_0x142421,null))[_0x97c0('0x43')](handleError(_0x142421,null));};exports[_0x97c0('0x48')]=function(_0x276c98,_0x4ff0a5){return db['ChatQueueReport'][_0x97c0('0x48')](_0x276c98[_0x97c0('0x49')],{})[_0x97c0('0x24')](respondWithResult(_0x4ff0a5,0xc9))['catch'](handleError(_0x4ff0a5,null));};exports[_0x97c0('0x23')]=function(_0xac56ac,_0x240f68){if(_0xac56ac[_0x97c0('0x49')]['id']){delete _0xac56ac[_0x97c0('0x49')]['id'];}return db['ChatQueueReport'][_0x97c0('0x47')]({'where':{'id':_0xac56ac[_0x97c0('0x45')]['id']}})[_0x97c0('0x24')](handleEntityNotFound(_0x240f68,null))['then'](saveUpdates(_0xac56ac['body'],null))[_0x97c0('0x24')](respondWithResult(_0x240f68,null))['catch'](handleError(_0x240f68,null));};exports['destroy']=function(_0x473b63,_0x20e2a5){return db[_0x97c0('0x2b')]['find']({'where':{'id':_0x473b63['params']['id']}})['then'](handleEntityNotFound(_0x20e2a5,null))[_0x97c0('0x24')](removeEntity(_0x20e2a5,null))[_0x97c0('0x43')](handleError(_0x20e2a5,null));};exports[_0x97c0('0x4a')]=function(_0xdb2767,_0x397065){return db[_0x97c0('0x2b')][_0x97c0('0x4a')]()['then'](respondWithResult(_0x397065,null))[_0x97c0('0x43')](handleError(_0x397065,null));};
\ No newline at end of file
+var _0xbd0a=['undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','status','error','stack','name','send','index','map','ChatQueueReport','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','find','create','body','describe','eml-format','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset'];(function(_0x3200e9,_0x318b57){var _0x7d108d=function(_0x39de50){while(--_0x39de50){_0x3200e9['push'](_0x3200e9['shift']());}};_0x7d108d(++_0x318b57);}(_0xbd0a,0x1b9));var _0xabd0=function(_0x5938fe,_0x2a2748){_0x5938fe=_0x5938fe-0x0;var _0x4de17f=_0xbd0a[_0x5938fe];return _0x4de17f;};'use strict';var emlformat=require(_0xabd0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xabd0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xabd0('0x2'));var Mustache=require(_0xabd0('0x3'));var util=require(_0xabd0('0x4'));var path=require(_0xabd0('0x5'));var sox=require(_0xabd0('0x6'));var csv=require(_0xabd0('0x7'));var ejs=require(_0xabd0('0x8'));var fs=require('fs');var fs_extra=require(_0xabd0('0x9'));var _=require(_0xabd0('0xa'));var squel=require('squel');var crypto=require(_0xabd0('0xb'));var jsforce=require(_0xabd0('0xc'));var deskjs=require(_0xabd0('0xd'));var toCsv=require('to-csv');var querystring=require(_0xabd0('0xe'));var Papa=require('papaparse');var Redis=require(_0xabd0('0xf'));var authService=require(_0xabd0('0x10'));var qs=require(_0xabd0('0x11'));var as=require(_0xabd0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xabd0('0x13'))('api');var utils=require(_0xabd0('0x14'));var config=require(_0xabd0('0x15'));var licenseUtil=require(_0xabd0('0x16'));var db=require(_0xabd0('0x17'))['db'];function respondWithStatusCode(_0x3bf33,_0xd66d68){_0xd66d68=_0xd66d68||0xcc;return function(_0x5b0f34){if(_0x5b0f34){return _0x3bf33[_0xabd0('0x18')](_0xd66d68);}return _0x3bf33['status'](_0xd66d68)[_0xabd0('0x19')]();};}function respondWithResult(_0x145f76,_0x5ceb94){_0x5ceb94=_0x5ceb94||0xc8;return function(_0x56ba31){if(_0x56ba31){return _0x145f76['status'](_0x5ceb94)['json'](_0x56ba31);}};}function respondWithFilteredResult(_0x679d0b,_0x26d8fd){return function(_0x97f4ec){if(_0x97f4ec){var _0xdb7a40=typeof _0x26d8fd[_0xabd0('0x1a')]===_0xabd0('0x1b')&&typeof _0x26d8fd[_0xabd0('0x1c')]===_0xabd0('0x1b');var _0x2d17b1=_0x97f4ec['count'];var _0x3a0ace=_0xdb7a40?0x0:_0x26d8fd['offset'];var _0x579dcd=_0xdb7a40?_0x97f4ec[_0xabd0('0x1d')]:_0x26d8fd[_0xabd0('0x1a')]+_0x26d8fd[_0xabd0('0x1c')];var _0x23f955;if(_0x579dcd>=_0x2d17b1){_0x579dcd=_0x2d17b1;_0x23f955=0xc8;}else{_0x23f955=0xce;}_0x679d0b['status'](_0x23f955);return _0x679d0b[_0xabd0('0x1e')](_0xabd0('0x1f'),_0x3a0ace+'-'+_0x579dcd+'/'+_0x2d17b1)['json'](_0x97f4ec);}return null;};}function patchUpdates(_0x56c2f5){return function(_0x1c955e){try{jsonpatch[_0xabd0('0x20')](_0x1c955e,_0x56c2f5,!![]);}catch(_0x4d9416){return BPromise[_0xabd0('0x21')](_0x4d9416);}return _0x1c955e[_0xabd0('0x22')]();};}function saveUpdates(_0xa1ebf,_0x1e077e){return function(_0x4c9f3a){if(_0x4c9f3a){return _0x4c9f3a[_0xabd0('0x23')](_0xa1ebf)[_0xabd0('0x24')](function(_0x3376bc){return _0x3376bc;});}return null;};}function removeEntity(_0x462420,_0x264167){return function(_0xf6dbad){if(_0xf6dbad){return _0xf6dbad[_0xabd0('0x25')]()[_0xabd0('0x24')](function(){_0x462420[_0xabd0('0x26')](0xcc)[_0xabd0('0x19')]();});}};}function handleEntityNotFound(_0x52c8be,_0x369dd0){return function(_0x2699c4){if(!_0x2699c4){_0x52c8be[_0xabd0('0x18')](0x194);}return _0x2699c4;};}function handleError(_0x3e0dd2,_0x31b869){_0x31b869=_0x31b869||0x1f4;return function(_0x399996){logger[_0xabd0('0x27')](_0x399996[_0xabd0('0x28')]);if(_0x399996[_0xabd0('0x29')]){delete _0x399996[_0xabd0('0x29')];}_0x3e0dd2[_0xabd0('0x26')](_0x31b869)[_0xabd0('0x2a')](_0x399996);};}exports[_0xabd0('0x2b')]=function(_0x3246de,_0x1fe955){var _0x15096f={},_0x5427a0={},_0x1c0d90={'count':0x0,'rows':[]};var _0x2d4c55=_[_0xabd0('0x2c')](db[_0xabd0('0x2d')]['rawAttributes'],function(_0x1ef94b){return{'name':_0x1ef94b[_0xabd0('0x2e')],'type':_0x1ef94b[_0xabd0('0x2f')]['key']};});_0x5427a0[_0xabd0('0x30')]=_[_0xabd0('0x2c')](_0x2d4c55,'name');_0x5427a0[_0xabd0('0x31')]=_['keys'](_0x3246de[_0xabd0('0x31')]);_0x5427a0[_0xabd0('0x32')]=_[_0xabd0('0x33')](_0x5427a0[_0xabd0('0x30')],_0x5427a0[_0xabd0('0x31')]);_0x15096f[_0xabd0('0x34')]=_['intersection'](_0x5427a0[_0xabd0('0x30')],qs[_0xabd0('0x35')](_0x3246de[_0xabd0('0x31')][_0xabd0('0x35')]));_0x15096f[_0xabd0('0x34')]=_0x15096f[_0xabd0('0x34')][_0xabd0('0x36')]?_0x15096f[_0xabd0('0x34')]:_0x5427a0[_0xabd0('0x30')];if(!_0x3246de[_0xabd0('0x31')][_0xabd0('0x37')](_0xabd0('0x38'))){_0x15096f[_0xabd0('0x1c')]=qs[_0xabd0('0x1c')](_0x3246de[_0xabd0('0x31')]['limit']);_0x15096f['offset']=qs['offset'](_0x3246de[_0xabd0('0x31')][_0xabd0('0x1a')]);}_0x15096f[_0xabd0('0x39')]=qs[_0xabd0('0x3a')](_0x3246de[_0xabd0('0x31')]['sort']);_0x15096f['where']=qs['filters'](_[_0xabd0('0x3b')](_0x3246de['query'],_0x5427a0[_0xabd0('0x32')]),_0x2d4c55);if(_0x3246de[_0xabd0('0x31')][_0xabd0('0x3c')]){_0x15096f[_0xabd0('0x3d')]=_[_0xabd0('0x3e')](_0x15096f[_0xabd0('0x3d')],{'$or':_[_0xabd0('0x2c')](_0x2d4c55,function(_0x42e86e){if(_0x42e86e['type']!==_0xabd0('0x3f')){var _0x592de0={};_0x592de0[_0x42e86e['name']]={'$like':'%'+_0x3246de[_0xabd0('0x31')][_0xabd0('0x3c')]+'%'};return _0x592de0;}})});}_0x15096f=_[_0xabd0('0x3e')]({},_0x15096f,_0x3246de[_0xabd0('0x40')]);var _0x1b8687={'where':_0x15096f['where']};return db[_0xabd0('0x2d')][_0xabd0('0x1d')](_0x1b8687)[_0xabd0('0x24')](function(_0x2e0bdf){_0x1c0d90['count']=_0x2e0bdf;if(_0x3246de[_0xabd0('0x31')][_0xabd0('0x41')]){_0x15096f[_0xabd0('0x42')]=[{'all':!![]}];}return db[_0xabd0('0x2d')][_0xabd0('0x43')](_0x15096f);})[_0xabd0('0x24')](function(_0x2aa5a9){_0x1c0d90[_0xabd0('0x44')]=_0x2aa5a9;return _0x1c0d90;})[_0xabd0('0x24')](respondWithFilteredResult(_0x1fe955,_0x15096f))[_0xabd0('0x45')](handleError(_0x1fe955,null));};exports[_0xabd0('0x46')]=function(_0x975bbe,_0x237a33){var _0x514ea3={'raw':!![],'where':{'id':_0x975bbe[_0xabd0('0x47')]['id']}},_0x2ba135={};_0x2ba135[_0xabd0('0x30')]=_['keys'](db['ChatQueueReport'][_0xabd0('0x48')]);_0x2ba135[_0xabd0('0x31')]=_[_0xabd0('0x49')](_0x975bbe[_0xabd0('0x31')]);_0x2ba135[_0xabd0('0x32')]=_['intersection'](_0x2ba135['model'],_0x2ba135[_0xabd0('0x31')]);_0x514ea3[_0xabd0('0x34')]=_[_0xabd0('0x33')](_0x2ba135[_0xabd0('0x30')],qs[_0xabd0('0x35')](_0x975bbe['query'][_0xabd0('0x35')]));_0x514ea3[_0xabd0('0x34')]=_0x514ea3[_0xabd0('0x34')]['length']?_0x514ea3[_0xabd0('0x34')]:_0x2ba135[_0xabd0('0x30')];if(_0x975bbe[_0xabd0('0x31')][_0xabd0('0x41')]){_0x514ea3['include']=[{'all':!![]}];}_0x514ea3=_[_0xabd0('0x3e')]({},_0x514ea3,_0x975bbe[_0xabd0('0x40')]);return db[_0xabd0('0x2d')][_0xabd0('0x4a')](_0x514ea3)['then'](handleEntityNotFound(_0x237a33,null))[_0xabd0('0x24')](respondWithResult(_0x237a33,null))[_0xabd0('0x45')](handleError(_0x237a33,null));};exports[_0xabd0('0x4b')]=function(_0xc80459,_0x2a1069){return db[_0xabd0('0x2d')]['create'](_0xc80459['body'],{})[_0xabd0('0x24')](respondWithResult(_0x2a1069,0xc9))['catch'](handleError(_0x2a1069,null));};exports['update']=function(_0x2293bd,_0x1610d9){if(_0x2293bd[_0xabd0('0x4c')]['id']){delete _0x2293bd[_0xabd0('0x4c')]['id'];}return db['ChatQueueReport'][_0xabd0('0x4a')]({'where':{'id':_0x2293bd[_0xabd0('0x47')]['id']}})[_0xabd0('0x24')](handleEntityNotFound(_0x1610d9,null))[_0xabd0('0x24')](saveUpdates(_0x2293bd['body'],null))['then'](respondWithResult(_0x1610d9,null))[_0xabd0('0x45')](handleError(_0x1610d9,null));};exports[_0xabd0('0x25')]=function(_0x16dd64,_0x32a5c9){return db[_0xabd0('0x2d')][_0xabd0('0x4a')]({'where':{'id':_0x16dd64[_0xabd0('0x47')]['id']}})[_0xabd0('0x24')](handleEntityNotFound(_0x32a5c9,null))[_0xabd0('0x24')](removeEntity(_0x32a5c9,null))['catch'](handleError(_0x32a5c9,null));};exports[_0xabd0('0x4d')]=function(_0x284ea4,_0x4e951f){return db[_0xabd0('0x2d')][_0xabd0('0x4d')]()[_0xabd0('0x24')](respondWithResult(_0x4e951f,null))[_0xabd0('0x45')](handleError(_0x4e951f,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index d2341ac..656e521 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 _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x189036,_0x23ba9e){var _0x5a1428=function(_0x2dd4ac){while(--_0x2dd4ac){_0x189036['push'](_0x189036['shift']());}};_0x5a1428(++_0x23ba9e);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x59aaf4,_0x3d8cfb){var _0x3d0d14=function(_0x51dbb4){while(--_0x51dbb4){_0x59aaf4['push'](_0x59aaf4['shift']());}};_0x3d0d14(++_0x3d8cfb);}(_0xbaf0,0x12a));var _0x0baf=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xbaf0[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index aacb7eb..98942a0 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 _0x2539=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','info','where','limit','UpdateChatQueueReport','moment'];(function(_0x459a0a,_0x25c46f){var _0x4ab46c=function(_0x451a6a){while(--_0x451a6a){_0x459a0a['push'](_0x459a0a['shift']());}};_0x4ab46c(++_0x25c46f);}(_0x2539,0x9a));var _0x9253=function(_0x22c7b4,_0x5f4aaa){_0x22c7b4=_0x22c7b4-0x0;var _0x2aed72=_0x2539[_0x22c7b4];return _0x2aed72;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9253('0x0'));var BPromise=require(_0x9253('0x1'));var rs=require(_0x9253('0x2'));var fs=require('fs');var Redis=require(_0x9253('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9253('0x4'));var logger=require(_0x9253('0x5'))(_0x9253('0x6'));var config=require(_0x9253('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9253('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc1dd63,_0x24dd51,_0x320195){return new BPromise(function(_0x5cb36a,_0x3506a6){return client[_0x9253('0x9')](_0xc1dd63,_0x320195)[_0x9253('0xa')](function(_0x472c9a){logger['info'](_0x9253('0xb'),_0x24dd51,_0x9253('0xc'));logger[_0x9253('0xd')](_0x9253('0xe'),_0x24dd51,_0x9253('0xc'),JSON[_0x9253('0xf')](_0x472c9a));if(_0x472c9a['error']){if(_0x472c9a[_0x9253('0x10')][_0x9253('0x11')]===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x24dd51,_0x472c9a['error']['message']);return _0x3506a6(_0x472c9a[_0x9253('0x10')][_0x9253('0x12')]);}logger[_0x9253('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x24dd51,_0x472c9a['error'][_0x9253('0x12')]);return _0x5cb36a(_0x472c9a['error'][_0x9253('0x12')]);}else{logger['info'](_0x9253('0xb'),_0x24dd51,_0x9253('0xc'));_0x5cb36a(_0x472c9a[_0x9253('0x13')][_0x9253('0x12')]);}})[_0x9253('0x14')](function(_0x5b53dc){logger[_0x9253('0x10')](_0x9253('0xb'),_0x24dd51,_0x5b53dc);_0x3506a6(_0x5b53dc);});});}exports[_0x9253('0x15')]=function(_0x1e68c1){var _0x5cbede=this;return new Promise(function(_0x726604,_0x52c1e0){return db[_0x9253('0x16')][_0x9253('0x17')](_0x1e68c1[_0x9253('0x18')],{'raw':_0x1e68c1['options']?_0x1e68c1[_0x9253('0x19')][_0x9253('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x319ac9){logger[_0x9253('0x1b')](_0x9253('0x15'),_0x1e68c1);logger['debug']('CreateChatQueueReport',_0x1e68c1,JSON[_0x9253('0xf')](_0x319ac9));_0x726604(_0x319ac9);})[_0x9253('0x14')](function(_0x6578ff){logger[_0x9253('0x10')](_0x9253('0x15'),_0x6578ff[_0x9253('0x12')],_0x1e68c1);_0x52c1e0(_0x5cbede[_0x9253('0x10')](0x1f4,_0x6578ff['message']));});});};exports['UpdateChatQueueReport']=function(_0x420e92){var _0x5e422e=this;return new Promise(function(_0x56e336,_0x32a8f7){return db[_0x9253('0x16')]['update'](_0x420e92['body'],{'raw':_0x420e92[_0x9253('0x19')]?_0x420e92['options'][_0x9253('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x420e92[_0x9253('0x19')]?_0x420e92[_0x9253('0x19')][_0x9253('0x1c')]||null:null,'attributes':_0x420e92[_0x9253('0x19')]?_0x420e92[_0x9253('0x19')]['attributes']||null:null,'limit':_0x420e92['options']?_0x420e92[_0x9253('0x19')][_0x9253('0x1d')]||null:null})[_0x9253('0xa')](function(_0x45045e){logger['info'](_0x9253('0x1e'),_0x420e92);logger[_0x9253('0xd')](_0x9253('0x1e'),_0x420e92,JSON['stringify'](_0x45045e));_0x56e336(_0x45045e);})[_0x9253('0x14')](function(_0x4dab6c){logger[_0x9253('0x10')]('UpdateChatQueueReport',_0x4dab6c[_0x9253('0x12')],_0x420e92);_0x32a8f7(_0x5e422e[_0x9253('0x10')](0x1f4,_0x4dab6c[_0x9253('0x12')]));});});};
\ No newline at end of file
+var _0x7fa6=['raw','catch','UpdateChatQueueReport','update','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','CreateChatQueueReport','create','body','options'];(function(_0x29405a,_0x38a2cf){var _0x46e4ed=function(_0x3d1f2b){while(--_0x3d1f2b){_0x29405a['push'](_0x29405a['shift']());}};_0x46e4ed(++_0x38a2cf);}(_0x7fa6,0xed));var _0x67fa=function(_0x31c2ea,_0x4727b7){_0x31c2ea=_0x31c2ea-0x0;var _0x46ee30=_0x7fa6[_0x31c2ea];return _0x46ee30;};'use strict';var _=require(_0x67fa('0x0'));var util=require(_0x67fa('0x1'));var moment=require(_0x67fa('0x2'));var BPromise=require(_0x67fa('0x3'));var rs=require(_0x67fa('0x4'));var fs=require('fs');var Redis=require(_0x67fa('0x5'));var db=require(_0x67fa('0x6'))['db'];var utils=require(_0x67fa('0x7'));var logger=require(_0x67fa('0x8'))('rpc');var config=require(_0x67fa('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x67fa('0xa')][_0x67fa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11f43a,_0x32891a,_0x5ae3fd){return new BPromise(function(_0x1874e8,_0x2cefe6){return client['request'](_0x11f43a,_0x5ae3fd)[_0x67fa('0xc')](function(_0x6b1104){logger[_0x67fa('0xd')](_0x67fa('0xe'),_0x32891a,_0x67fa('0xf'));logger[_0x67fa('0x10')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x32891a,_0x67fa('0xf'),JSON[_0x67fa('0x11')](_0x6b1104));if(_0x6b1104[_0x67fa('0x12')]){if(_0x6b1104['error']['code']===0x1f4){logger[_0x67fa('0x12')](_0x67fa('0xe'),_0x32891a,_0x6b1104[_0x67fa('0x12')]['message']);return _0x2cefe6(_0x6b1104['error'][_0x67fa('0x13')]);}logger[_0x67fa('0x12')](_0x67fa('0xe'),_0x32891a,_0x6b1104[_0x67fa('0x12')][_0x67fa('0x13')]);return _0x1874e8(_0x6b1104[_0x67fa('0x12')][_0x67fa('0x13')]);}else{logger[_0x67fa('0xd')](_0x67fa('0xe'),_0x32891a,_0x67fa('0xf'));_0x1874e8(_0x6b1104['result'][_0x67fa('0x13')]);}})['catch'](function(_0x1696c8){logger[_0x67fa('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x32891a,_0x1696c8);_0x2cefe6(_0x1696c8);});});}exports[_0x67fa('0x14')]=function(_0x23c7b9){var _0xccb14c=this;return new Promise(function(_0x1e2033,_0x3788a2){return db['ChatQueueReport'][_0x67fa('0x15')](_0x23c7b9[_0x67fa('0x16')],{'raw':_0x23c7b9[_0x67fa('0x17')]?_0x23c7b9[_0x67fa('0x17')][_0x67fa('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x2495d2){logger[_0x67fa('0xd')](_0x67fa('0x14'),_0x23c7b9);logger[_0x67fa('0x10')](_0x67fa('0x14'),_0x23c7b9,JSON[_0x67fa('0x11')](_0x2495d2));_0x1e2033(_0x2495d2);})[_0x67fa('0x19')](function(_0x270b0e){logger[_0x67fa('0x12')](_0x67fa('0x14'),_0x270b0e[_0x67fa('0x13')],_0x23c7b9);_0x3788a2(_0xccb14c[_0x67fa('0x12')](0x1f4,_0x270b0e[_0x67fa('0x13')]));});});};exports[_0x67fa('0x1a')]=function(_0x366bf7){var _0x4950e9=this;return new Promise(function(_0x3addc5,_0x48fbcb){return db['ChatQueueReport'][_0x67fa('0x1b')](_0x366bf7['body'],{'raw':_0x366bf7['options']?_0x366bf7[_0x67fa('0x17')][_0x67fa('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x366bf7[_0x67fa('0x17')]?_0x366bf7['options'][_0x67fa('0x1c')]||null:null,'attributes':_0x366bf7[_0x67fa('0x17')]?_0x366bf7[_0x67fa('0x17')]['attributes']||null:null,'limit':_0x366bf7[_0x67fa('0x17')]?_0x366bf7[_0x67fa('0x17')]['limit']||null:null})[_0x67fa('0xc')](function(_0x5f12c4){logger[_0x67fa('0xd')]('UpdateChatQueueReport',_0x366bf7);logger[_0x67fa('0x10')](_0x67fa('0x1a'),_0x366bf7,JSON[_0x67fa('0x11')](_0x5f12c4));_0x3addc5(_0x5f12c4);})[_0x67fa('0x19')](function(_0x478292){logger[_0x67fa('0x12')]('UpdateChatQueueReport',_0x478292[_0x67fa('0x13')],_0x366bf7);_0x48fbcb(_0x4950e9['error'](0x1f4,_0x478292[_0x67fa('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index c82aab3..4ba1eca 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 _0xdcb4=['post','create','put','update','/:id','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x1af05b,_0x5134b5){var _0x5be7cc=function(_0x2d4ac0){while(--_0x2d4ac0){_0x1af05b['push'](_0x1af05b['shift']());}};_0x5be7cc(++_0x5134b5);}(_0xdcb4,0xcd));var _0x4dcb=function(_0x219746,_0x553e06){_0x219746=_0x219746-0x0;var _0x1d7759=_0xdcb4[_0x219746];return _0x1d7759;};'use strict';var multer=require(_0x4dcb('0x0'));var util=require('util');var path=require(_0x4dcb('0x1'));var timeout=require('connect-timeout');var express=require(_0x4dcb('0x2'));var router=express[_0x4dcb('0x3')]();var fs_extra=require(_0x4dcb('0x4'));var auth=require(_0x4dcb('0x5'));var interaction=require(_0x4dcb('0x6'));var config=require(_0x4dcb('0x7'));var controller=require(_0x4dcb('0x8'));router[_0x4dcb('0x9')]('/',auth[_0x4dcb('0xa')](),controller[_0x4dcb('0xb')]);router[_0x4dcb('0x9')](_0x4dcb('0xc'),auth[_0x4dcb('0xa')](),controller[_0x4dcb('0xd')]);router[_0x4dcb('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x4dcb('0xe')]);router[_0x4dcb('0xf')]('/',auth[_0x4dcb('0xa')](),controller[_0x4dcb('0x10')]);router[_0x4dcb('0x11')]('/:id',auth[_0x4dcb('0xa')](),controller[_0x4dcb('0x12')]);router['delete'](_0x4dcb('0x13'),auth['isAuthenticated'](),controller[_0x4dcb('0x14')]);module[_0x4dcb('0x15')]=router;
\ No newline at end of file
+var _0x3561=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','describe','/:id','create','update','delete','destroy'];(function(_0x2781ae,_0x250809){var _0x329fc1=function(_0x4fe266){while(--_0x4fe266){_0x2781ae['push'](_0x2781ae['shift']());}};_0x329fc1(++_0x250809);}(_0x3561,0x120));var _0x1356=function(_0x4012d8,_0x178854){_0x4012d8=_0x4012d8-0x0;var _0x3019a3=_0x3561[_0x4012d8];return _0x3019a3;};'use strict';var multer=require(_0x1356('0x0'));var util=require(_0x1356('0x1'));var path=require('path');var timeout=require(_0x1356('0x2'));var express=require(_0x1356('0x3'));var router=express[_0x1356('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1356('0x5'));var interaction=require(_0x1356('0x6'));var config=require(_0x1356('0x7'));var controller=require('./chatQueueReport.controller');router['get']('/',auth[_0x1356('0x8')](),controller[_0x1356('0x9')]);router['get']('/describe',auth[_0x1356('0x8')](),controller[_0x1356('0xa')]);router['get'](_0x1356('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x1356('0x8')](),controller[_0x1356('0xc')]);router['put']('/:id',auth[_0x1356('0x8')](),controller[_0x1356('0xd')]);router[_0x1356('0xe')]('/:id',auth[_0x1356('0x8')](),controller[_0x1356('0xf')]);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 48c94df..63a0b78 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x30063a,_0x4a55c8){var _0x2024d2=function(_0x54df95){while(--_0x54df95){_0x30063a['push'](_0x30063a['shift']());}};_0x2024d2(++_0x4a55c8);}(_0xaa88,0x137));var _0x8aa8=function(_0x3cae69,_0x233c38){_0x3cae69=_0x3cae69-0x0;var _0x3128eb=_0xaa88[_0x3cae69];return _0x3128eb;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}};
\ No newline at end of file
+var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x95014d,_0x16fdc7){var _0x2f9e3e=function(_0x13f0ab){while(--_0x13f0ab){_0x95014d['push'](_0x95014d['shift']());}};_0x2f9e3e(++_0x16fdc7);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3fe042,_0x1106f7){_0x3fe042=_0x3fe042-0x0;var _0x7d4a1f=_0xcb91[_0x3fe042];return _0x7d4a1f;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index c6141c8..6404f79 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 _0xa54e=['findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','index','map','ChatTransferReport','type','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include'];(function(_0x1ace2a,_0xf9562d){var _0x454712=function(_0x46f12f){while(--_0x46f12f){_0x1ace2a['push'](_0x1ace2a['shift']());}};_0x454712(++_0xf9562d);}(_0xa54e,0x1d3));var _0xea54=function(_0x5ef7b8,_0x15cc07){_0x5ef7b8=_0x5ef7b8-0x0;var _0x2c7148=_0xa54e[_0x5ef7b8];return _0x2c7148;};'use strict';var emlformat=require(_0xea54('0x0'));var rimraf=require(_0xea54('0x1'));var zipdir=require(_0xea54('0x2'));var jsonpatch=require(_0xea54('0x3'));var rp=require('request-promise');var moment=require(_0xea54('0x4'));var BPromise=require(_0xea54('0x5'));var Mustache=require(_0xea54('0x6'));var util=require(_0xea54('0x7'));var path=require('path');var sox=require(_0xea54('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xea54('0x9'));var _=require('lodash');var squel=require(_0xea54('0xa'));var crypto=require(_0xea54('0xb'));var jsforce=require(_0xea54('0xc'));var deskjs=require(_0xea54('0xd'));var toCsv=require(_0xea54('0xe'));var querystring=require(_0xea54('0xf'));var Papa=require(_0xea54('0x10'));var Redis=require('ioredis');var authService=require(_0xea54('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xea54('0x12'))(_0xea54('0x13'));var utils=require(_0xea54('0x14'));var config=require(_0xea54('0x15'));var licenseUtil=require(_0xea54('0x16'));var db=require(_0xea54('0x17'))['db'];function respondWithStatusCode(_0x3b8dd5,_0x4895b3){_0x4895b3=_0x4895b3||0xcc;return function(_0x241de7){if(_0x241de7){return _0x3b8dd5[_0xea54('0x18')](_0x4895b3);}return _0x3b8dd5[_0xea54('0x19')](_0x4895b3)[_0xea54('0x1a')]();};}function respondWithResult(_0x56b63b,_0x2de7d8){_0x2de7d8=_0x2de7d8||0xc8;return function(_0x2e783d){if(_0x2e783d){return _0x56b63b[_0xea54('0x19')](_0x2de7d8)['json'](_0x2e783d);}};}function respondWithFilteredResult(_0x347c49,_0x1e9e5a){return function(_0x34ad3e){if(_0x34ad3e){var _0x4588ce=typeof _0x1e9e5a[_0xea54('0x1b')]===_0xea54('0x1c')&&typeof _0x1e9e5a[_0xea54('0x1d')]===_0xea54('0x1c');var _0x287680=_0x34ad3e['count'];var _0x1925d5=_0x4588ce?0x0:_0x1e9e5a[_0xea54('0x1b')];var _0x40ccda=_0x4588ce?_0x34ad3e[_0xea54('0x1e')]:_0x1e9e5a[_0xea54('0x1b')]+_0x1e9e5a[_0xea54('0x1d')];var _0x4b19be;if(_0x40ccda>=_0x287680){_0x40ccda=_0x287680;_0x4b19be=0xc8;}else{_0x4b19be=0xce;}_0x347c49[_0xea54('0x19')](_0x4b19be);return _0x347c49[_0xea54('0x1f')](_0xea54('0x20'),_0x1925d5+'-'+_0x40ccda+'/'+_0x287680)[_0xea54('0x21')](_0x34ad3e);}return null;};}function patchUpdates(_0x57ee75){return function(_0xb229fd){try{jsonpatch[_0xea54('0x22')](_0xb229fd,_0x57ee75,!![]);}catch(_0x42f740){return BPromise[_0xea54('0x23')](_0x42f740);}return _0xb229fd[_0xea54('0x24')]();};}function saveUpdates(_0x19176d,_0x7e082d){return function(_0x52e541){if(_0x52e541){return _0x52e541[_0xea54('0x25')](_0x19176d)[_0xea54('0x26')](function(_0x40b833){return _0x40b833;});}return null;};}function removeEntity(_0x18bd55,_0x27420e){return function(_0xf1b378){if(_0xf1b378){return _0xf1b378[_0xea54('0x27')]()[_0xea54('0x26')](function(){_0x18bd55[_0xea54('0x19')](0xcc)[_0xea54('0x1a')]();});}};}function handleEntityNotFound(_0x260b87,_0x5664a3){return function(_0x1632e3){if(!_0x1632e3){_0x260b87[_0xea54('0x18')](0x194);}return _0x1632e3;};}function handleError(_0x315a1d,_0xe818ce){_0xe818ce=_0xe818ce||0x1f4;return function(_0x2c5d8d){logger[_0xea54('0x28')](_0x2c5d8d['stack']);if(_0x2c5d8d['name']){delete _0x2c5d8d[_0xea54('0x29')];}_0x315a1d[_0xea54('0x19')](_0xe818ce)['send'](_0x2c5d8d);};}exports[_0xea54('0x2a')]=function(_0x11defc,_0x1d669a){var _0x26cd74={},_0x602631={},_0x325440={'count':0x0,'rows':[]};var _0x369313=_[_0xea54('0x2b')](db[_0xea54('0x2c')]['rawAttributes'],function(_0x379953){return{'name':_0x379953['fieldName'],'type':_0x379953[_0xea54('0x2d')]['key']};});_0x602631['model']=_[_0xea54('0x2b')](_0x369313,_0xea54('0x29'));_0x602631[_0xea54('0x2e')]=_['keys'](_0x11defc[_0xea54('0x2e')]);_0x602631[_0xea54('0x2f')]=_[_0xea54('0x30')](_0x602631['model'],_0x602631['query']);_0x26cd74[_0xea54('0x31')]=_[_0xea54('0x30')](_0x602631[_0xea54('0x32')],qs[_0xea54('0x33')](_0x11defc[_0xea54('0x2e')][_0xea54('0x33')]));_0x26cd74['attributes']=_0x26cd74[_0xea54('0x31')][_0xea54('0x34')]?_0x26cd74['attributes']:_0x602631[_0xea54('0x32')];if(!_0x11defc['query'][_0xea54('0x35')](_0xea54('0x36'))){_0x26cd74[_0xea54('0x1d')]=qs['limit'](_0x11defc[_0xea54('0x2e')][_0xea54('0x1d')]);_0x26cd74[_0xea54('0x1b')]=qs[_0xea54('0x1b')](_0x11defc[_0xea54('0x2e')]['offset']);}_0x26cd74[_0xea54('0x37')]=qs[_0xea54('0x38')](_0x11defc[_0xea54('0x2e')]['sort']);_0x26cd74[_0xea54('0x39')]=qs[_0xea54('0x2f')](_[_0xea54('0x3a')](_0x11defc[_0xea54('0x2e')],_0x602631['filters']),_0x369313);if(_0x11defc[_0xea54('0x2e')]['filter']){_0x26cd74['where']=_[_0xea54('0x3b')](_0x26cd74[_0xea54('0x39')],{'$or':_[_0xea54('0x2b')](_0x369313,function(_0x5ab9f8){if(_0x5ab9f8['type']!==_0xea54('0x3c')){var _0x476d73={};_0x476d73[_0x5ab9f8['name']]={'$like':'%'+_0x11defc[_0xea54('0x2e')][_0xea54('0x3d')]+'%'};return _0x476d73;}})});}_0x26cd74=_[_0xea54('0x3b')]({},_0x26cd74,_0x11defc[_0xea54('0x3e')]);var _0x2dbf26={'where':_0x26cd74[_0xea54('0x39')]};return db['ChatTransferReport'][_0xea54('0x1e')](_0x2dbf26)[_0xea54('0x26')](function(_0x5cd9c8){_0x325440[_0xea54('0x1e')]=_0x5cd9c8;if(_0x11defc['query'][_0xea54('0x3f')]){_0x26cd74[_0xea54('0x40')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xea54('0x41')](_0x26cd74);})[_0xea54('0x26')](function(_0x724296){_0x325440[_0xea54('0x42')]=_0x724296;return _0x325440;})[_0xea54('0x26')](respondWithFilteredResult(_0x1d669a,_0x26cd74))[_0xea54('0x43')](handleError(_0x1d669a,null));};exports[_0xea54('0x44')]=function(_0x2e0a5e,_0x4c0c82){var _0x4c47e1={'raw':!![],'where':{'id':_0x2e0a5e[_0xea54('0x45')]['id']}},_0x370ac6={};_0x370ac6[_0xea54('0x32')]=_[_0xea54('0x46')](db[_0xea54('0x2c')][_0xea54('0x47')]);_0x370ac6[_0xea54('0x2e')]=_[_0xea54('0x46')](_0x2e0a5e[_0xea54('0x2e')]);_0x370ac6[_0xea54('0x2f')]=_[_0xea54('0x30')](_0x370ac6[_0xea54('0x32')],_0x370ac6[_0xea54('0x2e')]);_0x4c47e1[_0xea54('0x31')]=_[_0xea54('0x30')](_0x370ac6[_0xea54('0x32')],qs[_0xea54('0x33')](_0x2e0a5e[_0xea54('0x2e')][_0xea54('0x33')]));_0x4c47e1[_0xea54('0x31')]=_0x4c47e1[_0xea54('0x31')][_0xea54('0x34')]?_0x4c47e1[_0xea54('0x31')]:_0x370ac6[_0xea54('0x32')];if(_0x2e0a5e[_0xea54('0x2e')][_0xea54('0x3f')]){_0x4c47e1[_0xea54('0x40')]=[{'all':!![]}];}_0x4c47e1=_[_0xea54('0x3b')]({},_0x4c47e1,_0x2e0a5e[_0xea54('0x3e')]);return db[_0xea54('0x2c')][_0xea54('0x48')](_0x4c47e1)[_0xea54('0x26')](handleEntityNotFound(_0x4c0c82,null))[_0xea54('0x26')](respondWithResult(_0x4c0c82,null))[_0xea54('0x43')](handleError(_0x4c0c82,null));};exports['create']=function(_0x293fc0,_0x1f45a8){return db[_0xea54('0x2c')][_0xea54('0x49')](_0x293fc0[_0xea54('0x4a')],{})['then'](respondWithResult(_0x1f45a8,0xc9))[_0xea54('0x43')](handleError(_0x1f45a8,null));};exports['update']=function(_0x3f3624,_0x42e9a1){if(_0x3f3624[_0xea54('0x4a')]['id']){delete _0x3f3624[_0xea54('0x4a')]['id'];}return db[_0xea54('0x2c')]['find']({'where':{'id':_0x3f3624[_0xea54('0x45')]['id']}})[_0xea54('0x26')](handleEntityNotFound(_0x42e9a1,null))['then'](saveUpdates(_0x3f3624[_0xea54('0x4a')],null))['then'](respondWithResult(_0x42e9a1,null))[_0xea54('0x43')](handleError(_0x42e9a1,null));};exports[_0xea54('0x27')]=function(_0x2d0af7,_0x246e04){return db[_0xea54('0x2c')][_0xea54('0x48')]({'where':{'id':_0x2d0af7['params']['id']}})[_0xea54('0x26')](handleEntityNotFound(_0x246e04,null))[_0xea54('0x26')](removeEntity(_0x246e04,null))[_0xea54('0x43')](handleError(_0x246e04,null));};exports[_0xea54('0x4b')]=function(_0x49a50a,_0x23ffbc){return db[_0xea54('0x2c')][_0xea54('0x4b')]()[_0xea54('0x26')](respondWithResult(_0x23ffbc,null))[_0xea54('0x43')](handleError(_0x23ffbc,null));};
\ No newline at end of file
+var _0x27d8=['includeAll','include','rows','catch','create','update','body','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','destroy','then','stack','send','index','ChatTransferReport','rawAttributes','fieldName','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','filter','options'];(function(_0x9f8e85,_0x18b847){var _0x11ce2f=function(_0x56c2e0){while(--_0x56c2e0){_0x9f8e85['push'](_0x9f8e85['shift']());}};_0x11ce2f(++_0x18b847);}(_0x27d8,0x1b4));var _0x827d=function(_0x5216e0,_0x4f8cb9){_0x5216e0=_0x5216e0-0x0;var _0x5b3f40=_0x27d8[_0x5216e0];return _0x5b3f40;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x827d('0x0'));var zipdir=require(_0x827d('0x1'));var jsonpatch=require(_0x827d('0x2'));var rp=require(_0x827d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x827d('0x4'));var sox=require('sox');var csv=require(_0x827d('0x5'));var ejs=require(_0x827d('0x6'));var fs=require('fs');var fs_extra=require(_0x827d('0x7'));var _=require('lodash');var squel=require(_0x827d('0x8'));var crypto=require(_0x827d('0x9'));var jsforce=require(_0x827d('0xa'));var deskjs=require(_0x827d('0xb'));var toCsv=require(_0x827d('0x5'));var querystring=require(_0x827d('0xc'));var Papa=require(_0x827d('0xd'));var Redis=require(_0x827d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x827d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x827d('0x10'));var logger=require(_0x827d('0x11'))('api');var utils=require(_0x827d('0x12'));var config=require(_0x827d('0x13'));var licenseUtil=require(_0x827d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20ff9b,_0x28f7b9){_0x28f7b9=_0x28f7b9||0xcc;return function(_0x3e0be){if(_0x3e0be){return _0x20ff9b[_0x827d('0x15')](_0x28f7b9);}return _0x20ff9b[_0x827d('0x16')](_0x28f7b9)[_0x827d('0x17')]();};}function respondWithResult(_0x1d2e9a,_0x35ca72){_0x35ca72=_0x35ca72||0xc8;return function(_0x2a1c38){if(_0x2a1c38){return _0x1d2e9a['status'](_0x35ca72)[_0x827d('0x18')](_0x2a1c38);}};}function respondWithFilteredResult(_0x1b5dad,_0x3a7048){return function(_0xec90a){if(_0xec90a){var _0x455cd1=typeof _0x3a7048[_0x827d('0x19')]===_0x827d('0x1a')&&typeof _0x3a7048[_0x827d('0x1b')]==='undefined';var _0x52e8c0=_0xec90a[_0x827d('0x1c')];var _0x299075=_0x455cd1?0x0:_0x3a7048[_0x827d('0x19')];var _0x13a057=_0x455cd1?_0xec90a['count']:_0x3a7048[_0x827d('0x19')]+_0x3a7048[_0x827d('0x1b')];var _0x21b32f;if(_0x13a057>=_0x52e8c0){_0x13a057=_0x52e8c0;_0x21b32f=0xc8;}else{_0x21b32f=0xce;}_0x1b5dad[_0x827d('0x16')](_0x21b32f);return _0x1b5dad[_0x827d('0x1d')]('Content-Range',_0x299075+'-'+_0x13a057+'/'+_0x52e8c0)[_0x827d('0x18')](_0xec90a);}return null;};}function patchUpdates(_0x4e4c05){return function(_0x2e370f){try{jsonpatch[_0x827d('0x1e')](_0x2e370f,_0x4e4c05,!![]);}catch(_0x37f6e4){return BPromise[_0x827d('0x1f')](_0x37f6e4);}return _0x2e370f[_0x827d('0x20')]();};}function saveUpdates(_0x474bee,_0x11fded){return function(_0x50b7c6){if(_0x50b7c6){return _0x50b7c6['update'](_0x474bee)['then'](function(_0x48d8a0){return _0x48d8a0;});}return null;};}function removeEntity(_0x2c67fc,_0x38fc90){return function(_0x59d91e){if(_0x59d91e){return _0x59d91e[_0x827d('0x21')]()[_0x827d('0x22')](function(){_0x2c67fc[_0x827d('0x16')](0xcc)[_0x827d('0x17')]();});}};}function handleEntityNotFound(_0x47c25d,_0x3681b3){return function(_0x5644aa){if(!_0x5644aa){_0x47c25d[_0x827d('0x15')](0x194);}return _0x5644aa;};}function handleError(_0x30f298,_0x4face0){_0x4face0=_0x4face0||0x1f4;return function(_0x191dfb){logger['error'](_0x191dfb[_0x827d('0x23')]);if(_0x191dfb['name']){delete _0x191dfb['name'];}_0x30f298[_0x827d('0x16')](_0x4face0)[_0x827d('0x24')](_0x191dfb);};}exports[_0x827d('0x25')]=function(_0x182fde,_0x54bd42){var _0x2a14e9={},_0x2772ee={},_0x186af8={'count':0x0,'rows':[]};var _0x5224b6=_['map'](db[_0x827d('0x26')][_0x827d('0x27')],function(_0x4c519c){return{'name':_0x4c519c[_0x827d('0x28')],'type':_0x4c519c['type'][_0x827d('0x29')]};});_0x2772ee[_0x827d('0x2a')]=_[_0x827d('0x2b')](_0x5224b6,_0x827d('0x2c'));_0x2772ee[_0x827d('0x2d')]=_[_0x827d('0x2e')](_0x182fde['query']);_0x2772ee[_0x827d('0x2f')]=_[_0x827d('0x30')](_0x2772ee['model'],_0x2772ee[_0x827d('0x2d')]);_0x2a14e9[_0x827d('0x31')]=_[_0x827d('0x30')](_0x2772ee['model'],qs['fields'](_0x182fde[_0x827d('0x2d')][_0x827d('0x32')]));_0x2a14e9[_0x827d('0x31')]=_0x2a14e9[_0x827d('0x31')][_0x827d('0x33')]?_0x2a14e9[_0x827d('0x31')]:_0x2772ee['model'];if(!_0x182fde[_0x827d('0x2d')][_0x827d('0x34')]('nolimit')){_0x2a14e9['limit']=qs[_0x827d('0x1b')](_0x182fde['query'][_0x827d('0x1b')]);_0x2a14e9[_0x827d('0x19')]=qs[_0x827d('0x19')](_0x182fde[_0x827d('0x2d')][_0x827d('0x19')]);}_0x2a14e9[_0x827d('0x35')]=qs[_0x827d('0x36')](_0x182fde[_0x827d('0x2d')]['sort']);_0x2a14e9[_0x827d('0x37')]=qs[_0x827d('0x2f')](_[_0x827d('0x38')](_0x182fde['query'],_0x2772ee[_0x827d('0x2f')]),_0x5224b6);if(_0x182fde[_0x827d('0x2d')]['filter']){_0x2a14e9[_0x827d('0x37')]=_[_0x827d('0x39')](_0x2a14e9[_0x827d('0x37')],{'$or':_[_0x827d('0x2b')](_0x5224b6,function(_0x4ca53e){if(_0x4ca53e[_0x827d('0x3a')]!=='VIRTUAL'){var _0x113a3d={};_0x113a3d[_0x4ca53e['name']]={'$like':'%'+_0x182fde[_0x827d('0x2d')][_0x827d('0x3b')]+'%'};return _0x113a3d;}})});}_0x2a14e9=_[_0x827d('0x39')]({},_0x2a14e9,_0x182fde[_0x827d('0x3c')]);var _0x527b46={'where':_0x2a14e9[_0x827d('0x37')]};return db[_0x827d('0x26')][_0x827d('0x1c')](_0x527b46)[_0x827d('0x22')](function(_0x3bca9a){_0x186af8[_0x827d('0x1c')]=_0x3bca9a;if(_0x182fde[_0x827d('0x2d')][_0x827d('0x3d')]){_0x2a14e9[_0x827d('0x3e')]=[{'all':!![]}];}return db[_0x827d('0x26')]['findAll'](_0x2a14e9);})[_0x827d('0x22')](function(_0x5ed997){_0x186af8[_0x827d('0x3f')]=_0x5ed997;return _0x186af8;})[_0x827d('0x22')](respondWithFilteredResult(_0x54bd42,_0x2a14e9))[_0x827d('0x40')](handleError(_0x54bd42,null));};exports['show']=function(_0x3a86a4,_0x3440aa){var _0x1fcab7={'raw':!![],'where':{'id':_0x3a86a4['params']['id']}},_0x31fc87={};_0x31fc87[_0x827d('0x2a')]=_[_0x827d('0x2e')](db[_0x827d('0x26')][_0x827d('0x27')]);_0x31fc87['query']=_['keys'](_0x3a86a4['query']);_0x31fc87['filters']=_[_0x827d('0x30')](_0x31fc87[_0x827d('0x2a')],_0x31fc87[_0x827d('0x2d')]);_0x1fcab7[_0x827d('0x31')]=_[_0x827d('0x30')](_0x31fc87['model'],qs[_0x827d('0x32')](_0x3a86a4['query']['fields']));_0x1fcab7['attributes']=_0x1fcab7[_0x827d('0x31')][_0x827d('0x33')]?_0x1fcab7[_0x827d('0x31')]:_0x31fc87[_0x827d('0x2a')];if(_0x3a86a4[_0x827d('0x2d')][_0x827d('0x3d')]){_0x1fcab7[_0x827d('0x3e')]=[{'all':!![]}];}_0x1fcab7=_[_0x827d('0x39')]({},_0x1fcab7,_0x3a86a4[_0x827d('0x3c')]);return db[_0x827d('0x26')]['find'](_0x1fcab7)['then'](handleEntityNotFound(_0x3440aa,null))[_0x827d('0x22')](respondWithResult(_0x3440aa,null))[_0x827d('0x40')](handleError(_0x3440aa,null));};exports[_0x827d('0x41')]=function(_0x337720,_0x5e1ddb){return db[_0x827d('0x26')][_0x827d('0x41')](_0x337720['body'],{})[_0x827d('0x22')](respondWithResult(_0x5e1ddb,0xc9))[_0x827d('0x40')](handleError(_0x5e1ddb,null));};exports[_0x827d('0x42')]=function(_0x50e4f8,_0x52ca8c){if(_0x50e4f8[_0x827d('0x43')]['id']){delete _0x50e4f8['body']['id'];}return db[_0x827d('0x26')][_0x827d('0x44')]({'where':{'id':_0x50e4f8['params']['id']}})[_0x827d('0x22')](handleEntityNotFound(_0x52ca8c,null))['then'](saveUpdates(_0x50e4f8[_0x827d('0x43')],null))[_0x827d('0x22')](respondWithResult(_0x52ca8c,null))[_0x827d('0x40')](handleError(_0x52ca8c,null));};exports['destroy']=function(_0x182294,_0x429b1f){return db[_0x827d('0x26')][_0x827d('0x44')]({'where':{'id':_0x182294[_0x827d('0x45')]['id']}})[_0x827d('0x22')](handleEntityNotFound(_0x429b1f,null))['then'](removeEntity(_0x429b1f,null))['catch'](handleError(_0x429b1f,null));};exports[_0x827d('0x46')]=function(_0x2de967,_0x34ec7d){return db['ChatTransferReport'][_0x827d('0x46')]()[_0x827d('0x22')](respondWithResult(_0x34ec7d,null))['catch'](handleError(_0x34ec7d,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index ea31b0b..1bed93f 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 _0x67b6=['exports','define','ChatTransferReport','uniqueid','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes'];(function(_0x375524,_0x51b2d8){var _0x4272b2=function(_0x549473){while(--_0x549473){_0x375524['push'](_0x375524['shift']());}};_0x4272b2(++_0x51b2d8);}(_0x67b6,0xe1));var _0x667b=function(_0x26f63d,_0x2bbf5e){_0x26f63d=_0x26f63d-0x0;var _0x404365=_0x67b6[_0x26f63d];return _0x404365;};'use strict';var _=require(_0x667b('0x0'));var util=require(_0x667b('0x1'));var logger=require(_0x667b('0x2'))('api');var moment=require(_0x667b('0x3'));var BPromise=require('bluebird');var rp=require(_0x667b('0x4'));var fs=require('fs');var path=require(_0x667b('0x5'));var rimraf=require(_0x667b('0x6'));var config=require(_0x667b('0x7'));var attributes=require(_0x667b('0x8'));module[_0x667b('0x9')]=function(_0xce5a75,_0x3ff8c1){return _0xce5a75[_0x667b('0xa')](_0x667b('0xb'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x667b('0xc'),'fields':[_0x667b('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xfb6a=['bluebird','path','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x476107,_0x5a96cf){var _0x26c057=function(_0x52419a){while(--_0x52419a){_0x476107['push'](_0x476107['shift']());}};_0x26c057(++_0x5a96cf);}(_0xfb6a,0xb1));var _0xafb6=function(_0x50d6d6,_0x189c68){_0x50d6d6=_0x50d6d6-0x0;var _0x5d9bb4=_0xfb6a[_0x50d6d6];return _0x5d9bb4;};'use strict';var _=require(_0xafb6('0x0'));var util=require(_0xafb6('0x1'));var logger=require(_0xafb6('0x2'))(_0xafb6('0x3'));var moment=require(_0xafb6('0x4'));var BPromise=require(_0xafb6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xafb6('0x6'));var rimraf=require('rimraf');var config=require(_0xafb6('0x7'));var attributes=require(_0xafb6('0x8'));module['exports']=function(_0x435e04,_0x298535){return _0x435e04[_0xafb6('0x9')](_0xafb6('0xa'),attributes,{'tableName':_0xafb6('0xb'),'paranoid':![],'indexes':[{'name':_0xafb6('0xc'),'fields':[_0xafb6('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index a3c6fa7..5f91795 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 _0x4b17=['request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4b17,0x18d));var _0x74b1=function(_0x39609a,_0x28a563){_0x39609a=_0x39609a-0x0;var _0xecd92=_0x4b17[_0x39609a];return _0xecd92;};'use strict';var _=require(_0x74b1('0x0'));var util=require(_0x74b1('0x1'));var moment=require('moment');var BPromise=require(_0x74b1('0x2'));var rs=require(_0x74b1('0x3'));var fs=require('fs');var Redis=require(_0x74b1('0x4'));var db=require(_0x74b1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x74b1('0x6'))('rpc');var config=require(_0x74b1('0x7'));var jayson=require(_0x74b1('0x8'));var client=jayson[_0x74b1('0x9')][_0x74b1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17b97a,_0x3fb22c,_0x19f893){return new BPromise(function(_0x343c90,_0x3d1701){return client[_0x74b1('0xb')](_0x17b97a,_0x19f893)[_0x74b1('0xc')](function(_0x41b5bd){logger[_0x74b1('0xd')](_0x74b1('0xe'),_0x3fb22c,_0x74b1('0xf'));logger[_0x74b1('0x10')](_0x74b1('0x11'),_0x3fb22c,_0x74b1('0xf'),JSON[_0x74b1('0x12')](_0x41b5bd));if(_0x41b5bd[_0x74b1('0x13')]){if(_0x41b5bd[_0x74b1('0x13')][_0x74b1('0x14')]===0x1f4){logger[_0x74b1('0x13')](_0x74b1('0xe'),_0x3fb22c,_0x41b5bd['error'][_0x74b1('0x15')]);return _0x3d1701(_0x41b5bd['error'][_0x74b1('0x15')]);}logger[_0x74b1('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x3fb22c,_0x41b5bd[_0x74b1('0x13')][_0x74b1('0x15')]);return _0x343c90(_0x41b5bd[_0x74b1('0x13')]['message']);}else{logger[_0x74b1('0xd')](_0x74b1('0xe'),_0x3fb22c,_0x74b1('0xf'));_0x343c90(_0x41b5bd[_0x74b1('0x16')]['message']);}})[_0x74b1('0x17')](function(_0x567208){logger[_0x74b1('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x3fb22c,_0x567208);_0x3d1701(_0x567208);});});}
\ No newline at end of file
+var _0xaa4c=['randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xaa4c,0x1b6));var _0xcaa4=function(_0x239b69,_0x50346e){_0x239b69=_0x239b69-0x0;var _0x20e29d=_0xaa4c[_0x239b69];return _0x20e29d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcaa4('0x0'));var BPromise=require(_0xcaa4('0x1'));var rs=require(_0xcaa4('0x2'));var fs=require('fs');var Redis=require(_0xcaa4('0x3'));var db=require(_0xcaa4('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcaa4('0x5'));var config=require(_0xcaa4('0x6'));var jayson=require(_0xcaa4('0x7'));var client=jayson[_0xcaa4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x427937,_0x5f3ea9,_0x26a489){return new BPromise(function(_0x55b28a,_0x30f775){return client[_0xcaa4('0x9')](_0x427937,_0x26a489)[_0xcaa4('0xa')](function(_0x51ea1c){logger[_0xcaa4('0xb')](_0xcaa4('0xc'),_0x5f3ea9,_0xcaa4('0xd'));logger[_0xcaa4('0xe')](_0xcaa4('0xf'),_0x5f3ea9,_0xcaa4('0xd'),JSON[_0xcaa4('0x10')](_0x51ea1c));if(_0x51ea1c[_0xcaa4('0x11')]){if(_0x51ea1c[_0xcaa4('0x11')][_0xcaa4('0x12')]===0x1f4){logger['error'](_0xcaa4('0xc'),_0x5f3ea9,_0x51ea1c[_0xcaa4('0x11')][_0xcaa4('0x13')]);return _0x30f775(_0x51ea1c[_0xcaa4('0x11')][_0xcaa4('0x13')]);}logger[_0xcaa4('0x11')](_0xcaa4('0xc'),_0x5f3ea9,_0x51ea1c['error'][_0xcaa4('0x13')]);return _0x55b28a(_0x51ea1c[_0xcaa4('0x11')][_0xcaa4('0x13')]);}else{logger[_0xcaa4('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x5f3ea9,'request\x20sent');_0x55b28a(_0x51ea1c[_0xcaa4('0x14')][_0xcaa4('0x13')]);}})[_0xcaa4('0x15')](function(_0x3c10b9){logger[_0xcaa4('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x5f3ea9,_0x3c10b9);_0x30f775(_0x3c10b9);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 9fdc971..b3f9d88 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 _0xfe85=['../../config/environment','get','index','isAuthenticated','/:id','post','create','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x50e308,_0x221dcb){var _0x2a23b1=function(_0x1743dd){while(--_0x1743dd){_0x50e308['push'](_0x50e308['shift']());}};_0x2a23b1(++_0x221dcb);}(_0xfe85,0x12a));var _0x5fe8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfe85[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x5fe8('0x0'));var util=require('util');var path=require(_0x5fe8('0x1'));var timeout=require(_0x5fe8('0x2'));var express=require(_0x5fe8('0x3'));var router=express['Router']();var fs_extra=require(_0x5fe8('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5fe8('0x5'));var config=require(_0x5fe8('0x6'));var controller=require('./chatTransferReport.controller');router[_0x5fe8('0x7')]('/',auth['isAuthenticated'](),controller[_0x5fe8('0x8')]);router[_0x5fe8('0x7')]('/describe',auth[_0x5fe8('0x9')](),controller['describe']);router[_0x5fe8('0x7')](_0x5fe8('0xa'),auth[_0x5fe8('0x9')](),controller['show']);router[_0x5fe8('0xb')]('/',auth[_0x5fe8('0x9')](),controller[_0x5fe8('0xc')]);router['put']('/:id',auth[_0x5fe8('0x9')](),controller['update']);router[_0x5fe8('0xd')](_0x5fe8('0xa'),auth['isAuthenticated'](),controller[_0x5fe8('0xe')]);module[_0x5fe8('0xf')]=router;
\ No newline at end of file
+var _0xf574=['get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x40412f,_0x22c4ee){var _0x47e5f8=function(_0x266e8d){while(--_0x266e8d){_0x40412f['push'](_0x40412f['shift']());}};_0x47e5f8(++_0x22c4ee);}(_0xf574,0x111));var _0x4f57=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf574[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x4f57('0x0'));var path=require(_0x4f57('0x1'));var timeout=require(_0x4f57('0x2'));var express=require(_0x4f57('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4f57('0x4'));var interaction=require(_0x4f57('0x5'));var config=require(_0x4f57('0x6'));var controller=require('./chatTransferReport.controller');router[_0x4f57('0x7')]('/',auth[_0x4f57('0x8')](),controller[_0x4f57('0x9')]);router['get'](_0x4f57('0xa'),auth[_0x4f57('0x8')](),controller[_0x4f57('0xb')]);router['get'](_0x4f57('0xc'),auth['isAuthenticated'](),controller[_0x4f57('0xd')]);router[_0x4f57('0xe')]('/',auth[_0x4f57('0x8')](),controller['create']);router[_0x4f57('0xf')](_0x4f57('0xc'),auth['isAuthenticated'](),controller[_0x4f57('0x10')]);router[_0x4f57('0x11')](_0x4f57('0xc'),auth[_0x4f57('0x8')](),controller[_0x4f57('0x12')]);module[_0x4f57('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 4a59ea4..6597095 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 _0xb43b=['setDataValue','stringify','textarea','Comments','Leave\x20your\x20comments','parse','offlineForm','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:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Send','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Type\x20a\x20message','Skip','Feedback','star','TEXT','input','name','getDataValue','onlineForm'];(function(_0x36a064,_0x2495a4){var _0x36eefe=function(_0x4c33d7){while(--_0x4c33d7){_0x36a064['push'](_0x36a064['shift']());}};_0x36eefe(++_0x2495a4);}(_0xb43b,0x1b2));var _0xbb43=function(_0x78b465,_0x43e204){_0x78b465=_0x78b465-0x0;var _0x2a2ad1=_0xb43b[_0x78b465];return _0x2a2ad1;};'use strict';var Sequelize=require(_0xbb43('0x0'));var rs=require(_0xbb43('0x1'));module['exports']={'name':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![],'unique':_0xbb43('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':_0xbb43('0x4')},'mapKeyOffline':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':_0xbb43('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xbb43('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![],'defaultValue':_0xbb43('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![],'defaultValue':_0xbb43('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![],'defaultValue':_0xbb43('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xbb43('0x2')]},'animation':{'type':Sequelize[_0xbb43('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xbb43('0x9')](_0xbb43('0xa'),_0xbb43('0xb')),'defaultValue':_0xbb43('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xbb43('0xc')},'start_chat_button':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xbb43('0xd')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0xbb43('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':_0xbb43('0xe')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xbb43('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbb43('0x10')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':_0xbb43('0x11')},'closingMessage':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':_0xbb43('0x12')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xbb43('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xbb43('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':_0xbb43('0x13')},'ratingType':{'type':Sequelize['ENUM'](_0xbb43('0x14'),'thumb'),'defaultValue':_0xbb43('0x14')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xbb43('0x15')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xbb43('0x16'),'variable':null,'config':{'placeholder':_0xbb43('0x17'),'type':'text','required':!![]},'props':{'title':_0xbb43('0x17'),'helpText':''}},{'type':'input','props':{'title':_0xbb43('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xbb43('0x4'),'type':_0xbb43('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON['parse'](this[_0xbb43('0x18')](_0xbb43('0x19'))):{};},'set':function(_0x5d8310){return this[_0xbb43('0x1a')](_0xbb43('0x19'),JSON[_0xbb43('0x1b')](_0x5d8310));}},'offlineForm':{'type':Sequelize[_0xbb43('0x15')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0xbb43('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xbb43('0x4'),'type':_0xbb43('0x4')},'variable':null},{'type':_0xbb43('0x1c'),'config':{'placeholder':_0xbb43('0x1d')},'props':{'title':_0xbb43('0x1d'),'helpText':_0xbb43('0x1e')}}],'fromKey':0x0});},'get':function(){return this[_0xbb43('0x18')]('offlineForm')?JSON[_0xbb43('0x1f')](this['getDataValue'](_0xbb43('0x20'))):{};},'set':function(_0x436fd5){return this[_0xbb43('0x1a')](_0xbb43('0x20'),JSON['stringify'](_0x436fd5));}},'token':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xbb43('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0xbb43('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xbb43('0x2')]},'waitingTitle':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':_0xbb43('0x21')},'offlineMessageSubject':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':_0xbb43('0x22')},'offlineMessageBody':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':_0xbb43('0x23')},'enableUnmanagedNote':{'type':Sequelize[_0xbb43('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':_0xbb43('0x12')},'sendUnmanaged':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':_0xbb43('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0xbb43('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xbb43('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xbb43('0x15')]},'showAgentAvatar':{'type':Sequelize[_0xbb43('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xbb43('0x2')]},'notificationTemplate':{'type':Sequelize[_0xbb43('0x15')],'defaultValue':function(){return _0xbb43('0x24');}},'notificationSound':{'type':Sequelize[_0xbb43('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbb43('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xbb43('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':_0xbb43('0x25')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':_0xbb43('0x26')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':_0xbb43('0x27')},'messagesAlignment':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xbb43('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xbb43('0x28')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xbb43('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbb43('0x28')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbb43('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbb43('0x28')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xbb43('0x15')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbb43('0x28')],'comment':_0xbb43('0x29')},'mandatoryDisposition':{'type':Sequelize[_0xbb43('0x8')],'defaultValue':![],'comment':_0xbb43('0x2a'),'set':function(_0x531d96){if(!_0x531d96)this[_0xbb43('0x1a')]('mandatoryDispositionPauseId',null);this[_0xbb43('0x1a')](_0xbb43('0x2b'),_0x531d96);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xbb43('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbb43('0x2c')},'vidaooNote':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':function(){return _0xbb43('0x2d');}},'vidaooMetadata':{'type':Sequelize[_0xbb43('0x15')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xbb43('0x15')]}};
\ No newline at end of file
+var _0x4ea3=['mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','BOOLEAN','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','thumb','star','input','name','text','getDataValue','onlineForm','parse','setDataValue','stringify','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x622035,_0x1a4b91){var _0x326cf2=function(_0x5c3002){while(--_0x5c3002){_0x622035['push'](_0x622035['shift']());}};_0x326cf2(++_0x1a4b91);}(_0x4ea3,0x70));var _0x34ea=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x4ea3[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x34ea('0x0'));var rs=require(_0x34ea('0x1'));module[_0x34ea('0x2')]={'name':{'type':Sequelize[_0x34ea('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x34ea('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x34ea('0x5')},'key':{'type':Sequelize[_0x34ea('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x6')},'customerAlias':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x34ea('0x3')],'allowNull':![],'defaultValue':_0x34ea('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x34ea('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x34ea('0x3')],'allowNull':![],'defaultValue':_0x34ea('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x34ea('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x34ea('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x34ea('0xa')](_0x34ea('0xb'),_0x34ea('0xc')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0xd')},'start_chat_button':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0xe')},'offline_chat_button':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0xf')},'header_offline':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x10')},'download_transcript':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x34ea('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x34ea('0x12')]},'closingQuestion':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x13')},'formSubmitSuccessMessage':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x14')},'noteTitle':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x15')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x34ea('0x16')},'closingMessage':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x17')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x34ea('0xf')},'skipMessageButton':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x18')},'conditionAgreement':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x19')},'ratingType':{'type':Sequelize['ENUM']('star',_0x34ea('0x1a')),'defaultValue':_0x34ea('0x1b')},'ratingStarsNumber':{'type':Sequelize[_0x34ea('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x34ea('0x1c'),'variable':null,'config':{'placeholder':_0x34ea('0x1d'),'type':_0x34ea('0x1e'),'required':!![]},'props':{'title':_0x34ea('0x1d'),'helpText':''}},{'type':_0x34ea('0x1c'),'props':{'title':_0x34ea('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x34ea('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x34ea('0x1f')](_0x34ea('0x20'))?JSON[_0x34ea('0x21')](this['getDataValue']('onlineForm')):{};},'set':function(_0x564d1b){return this[_0x34ea('0x22')](_0x34ea('0x20'),JSON[_0x34ea('0x23')](_0x564d1b));}},'offlineForm':{'type':Sequelize[_0x34ea('0x12')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x34ea('0x1c'),'props':{'title':_0x34ea('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x34ea('0x5'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0x34ea('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0x34ea('0x1f')](_0x34ea('0x25'))?JSON[_0x34ea('0x21')](this['getDataValue'](_0x34ea('0x25'))):{};},'set':function(_0x59b9f6){return this[_0x34ea('0x22')]('offlineForm',JSON[_0x34ea('0x23')](_0x59b9f6));}},'token':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':function(){return rs[_0x34ea('0x26')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x27')},'waitingMessage':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x34ea('0x28')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x34ea('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x34ea('0x2a')},'skipUnmanaged':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x18')},'sendUnmanaged':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x34ea('0x12')]},'showAgentAvatar':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x34ea('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x34ea('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x34ea('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x2c')},'verticalAlignment':{'type':Sequelize[_0x34ea('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x2d')},'defaultTitle':{'type':Sequelize[_0x34ea('0x3')]},'customerAvatar':{'type':Sequelize[_0x34ea('0x12')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x34ea('0x3')],'allowNull':![],'defaultValue':_0x34ea('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x34ea('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x2f')},'systemAvatar':{'type':Sequelize[_0x34ea('0x12')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x34ea('0x9')],'comment':_0x34ea('0x30')},'mandatoryDisposition':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![],'comment':_0x34ea('0x31'),'set':function(_0xa1ff39){if(!_0xa1ff39)this[_0x34ea('0x22')](_0x34ea('0x32'),null);this[_0x34ea('0x22')](_0x34ea('0x33'),_0xa1ff39);}},'vidaooEscalation':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x34ea('0x3')]},'vidaooTopic':{'type':Sequelize[_0x34ea('0x3')],'allowNull':![],'defaultValue':_0x34ea('0x34')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x34ea('0x35');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x34ea('0x12')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 59e23d7..dfb42b1 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 _0x294c=['server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','getResult','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','Contacts','DESC','Applications','applications','list','orderBy','priority','asc','account','defaults','ListId','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','unknown','format','device','vendor','%s\x20%s\x20%s','type','threadId','ChatInteraction','externalUrl','interaction','spread','contact','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','MailAccountId','originalname','mapValues','subjectOffline','offlineMessageSubject','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','includeAll','Contact','Owner','fullname','internal','Tag','Tags','color','tag','getSnippet','timezone','interval','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','virtual','License','chatLicenseExceeded','all','some','readFileSync','remote','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','labelText','textButtonColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','READ_COMMITTED','ChatApplication','findAndCountAll','stack','finally','json','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','fs-extra','lodash','../../components/parsers/qs','../../config/logger','../../config/environment','redis','localhost','./chatWebsite.socket','register','html-to-text','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','end','status','undefined','limit','count','offset','set','get','ChatWebsites','destroy','sendStatus','name','send','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','query','keys','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar'];(function(_0x3ad164,_0x512873){var _0x27f975=function(_0x368a72){while(--_0x368a72){_0x3ad164['push'](_0x3ad164['shift']());}};_0x27f975(++_0x512873);}(_0x294c,0x1dd));var _0xc294=function(_0x4b5f0e,_0x4a93e5){_0x4b5f0e=_0x4b5f0e-0x0;var _0xcfd20a=_0x294c[_0x4b5f0e];return _0xcfd20a;};'use strict';var BPromise=require(_0xc294('0x0'));var Mustache=require(_0xc294('0x1'));var util=require(_0xc294('0x2'));var path=require(_0xc294('0x3'));var ejs=require(_0xc294('0x4'));var fs=require('fs');var fs_extra=require(_0xc294('0x5'));var _=require(_0xc294('0x6'));var querystring=require('querystring');var Redis=require('ioredis');var qs=require(_0xc294('0x7'));var logger=require(_0xc294('0x8'))('api');var config=require(_0xc294('0x9'));var db=require('../../mysqldb')['db'];config[_0xc294('0xa')]=_['defaults'](config[_0xc294('0xa')],{'host':_0xc294('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc294('0xa')]));require(_0xc294('0xc'))[_0xc294('0xd')](socket);var htmlToText=require(_0xc294('0xe'));var jayson=require('jayson/promise');var client=jayson[_0xc294('0xf')]['http']({'port':0x232c});var client9002=jayson[_0xc294('0xf')]['http']({'port':0x232a});var client9003=jayson[_0xc294('0xf')][_0xc294('0x10')]({'port':0x232b});var client9001=jayson['client'][_0xc294('0x10')]({'port':0x2329});function respondWithRpcPromise(_0x48801f,_0x24e967,_0x2ccce3,_0x427ee9){return new BPromise(function(_0x481f49,_0x271ab2){var _0x3a7775=_0x427ee9||client;return _0x3a7775['request'](_0x48801f,_0x2ccce3)[_0xc294('0x11')](function(_0x3878c1){logger[_0xc294('0x12')](_0xc294('0x13'),_0x24e967,_0xc294('0x14'));logger[_0xc294('0x15')](_0xc294('0x16'),_0x24e967,_0xc294('0x14'),JSON[_0xc294('0x17')](_0x3878c1));if(_0x3878c1[_0xc294('0x18')]){if(_0x3878c1[_0xc294('0x18')][_0xc294('0x19')]===0x1f4){logger[_0xc294('0x18')](_0xc294('0x13'),_0x24e967,_0x3878c1[_0xc294('0x18')][_0xc294('0x1a')]);return _0x271ab2(_0x3878c1['error']['message']);}logger[_0xc294('0x18')](_0xc294('0x13'),_0x24e967,_0x3878c1[_0xc294('0x18')][_0xc294('0x1a')]);return _0x481f49(_0x3878c1[_0xc294('0x18')][_0xc294('0x1a')]);}else{logger[_0xc294('0x12')](_0xc294('0x13'),_0x24e967,_0xc294('0x14'));_0x481f49(_0x3878c1[_0xc294('0x1b')][_0xc294('0x1a')]);}})[_0xc294('0x1c')](function(_0x238371){logger['error'](_0xc294('0x13'),_0x24e967,_0x238371);_0x271ab2(_0x238371);});});}function respondWithStatusCode(_0x40e476,_0x372d7e){_0x372d7e=_0x372d7e||0xcc;return function(_0x2f4e5e){if(_0x2f4e5e){return _0x40e476['sendStatus'](_0x372d7e);}return _0x40e476['status'](_0x372d7e)[_0xc294('0x1d')]();};}function respondWithResult(_0x1d746b,_0x546253){_0x546253=_0x546253||0xc8;return function(_0x4416a7){if(_0x4416a7){return _0x1d746b[_0xc294('0x1e')](_0x546253)['json'](_0x4416a7);}};}function respondWithFilteredResult(_0x2bb109,_0x1f6ca1){return function(_0x1ec5cd){if(_0x1ec5cd){var _0x1f1bb0=typeof _0x1f6ca1['offset']===_0xc294('0x1f')&&typeof _0x1f6ca1[_0xc294('0x20')]===_0xc294('0x1f');var _0x2637dc=_0x1ec5cd[_0xc294('0x21')];var _0x289e6d=_0x1f1bb0?0x0:_0x1f6ca1[_0xc294('0x22')];var _0x314284=_0x1f1bb0?_0x1ec5cd[_0xc294('0x21')]:_0x1f6ca1['offset']+_0x1f6ca1[_0xc294('0x20')];var _0x54cbd3;if(_0x314284>=_0x2637dc){_0x314284=_0x2637dc;_0x54cbd3=0xc8;}else{_0x54cbd3=0xce;}_0x2bb109[_0xc294('0x1e')](_0x54cbd3);return _0x2bb109[_0xc294('0x23')]('Content-Range',_0x289e6d+'-'+_0x314284+'/'+_0x2637dc)['json'](_0x1ec5cd);}return null;};}function saveUpdates(_0x3fc01b){return function(_0xe6888){if(_0xe6888){return _0xe6888['update'](_0x3fc01b)[_0xc294('0x11')](function(_0x382f6d){return _0x382f6d;});}return null;};}function removeEntity(_0x5829c9){return function(_0x1282b2){if(_0x1282b2){return _0x1282b2['destroy']()[_0xc294('0x11')](function(){var _0x2fea31=_0x1282b2[_0xc294('0x24')]({'plain':!![]});var _0x2b85ed=_0xc294('0x25');return db['UserProfileResource'][_0xc294('0x26')]({'where':{'type':_0x2b85ed,'resourceId':_0x2fea31['id']}})[_0xc294('0x11')](function(){return _0x1282b2;});})[_0xc294('0x11')](function(){_0x5829c9[_0xc294('0x1e')](0xcc)[_0xc294('0x1d')]();});}};}function handleEntityNotFound(_0x55a612){return function(_0x3f6ff1){if(!_0x3f6ff1){_0x55a612[_0xc294('0x27')](0x194);}return _0x3f6ff1;};}function handleError(_0x516ab0,_0x354fae){_0x354fae=_0x354fae||0x1f4;return function(_0x25e0cc){logger[_0xc294('0x18')](_0x25e0cc['stack']);if(_0x25e0cc[_0xc294('0x28')]){delete _0x25e0cc[_0xc294('0x28')];}_0x516ab0[_0xc294('0x1e')](_0x354fae)[_0xc294('0x29')](_0x25e0cc);};}exports['index']=function(_0x1f361f,_0x242522){var _0x5e8090={'include':[{'model':db[_0xc294('0x2a')],'as':_0xc294('0x2b')}]},_0x75b709={},_0x8aac25={'count':0x0,'rows':[]};var _0xa3b736=_[_0xc294('0x2c')](db[_0xc294('0x2d')][_0xc294('0x2e')],function(_0x483143){return{'name':_0x483143[_0xc294('0x2f')],'type':_0x483143['type'][_0xc294('0x30')]};});_0x75b709['model']=_['map'](_0xa3b736,_0xc294('0x28'));_0x75b709[_0xc294('0x31')]=_[_0xc294('0x32')](_0x1f361f[_0xc294('0x31')]);_0x75b709['filters']=_['intersection'](_0x75b709[_0xc294('0x33')],_0x75b709[_0xc294('0x31')]);_0x5e8090['attributes']=_[_0xc294('0x34')](_0x75b709[_0xc294('0x33')],qs[_0xc294('0x35')](_0x1f361f[_0xc294('0x31')][_0xc294('0x35')]));_0x5e8090['attributes']=_0x5e8090[_0xc294('0x36')][_0xc294('0x37')]?_0x5e8090['attributes']:_0x75b709['model'];if(!_0x1f361f[_0xc294('0x31')][_0xc294('0x38')](_0xc294('0x39'))){_0x5e8090[_0xc294('0x20')]=qs[_0xc294('0x20')](_0x1f361f['query'][_0xc294('0x20')]);_0x5e8090[_0xc294('0x22')]=qs[_0xc294('0x22')](_0x1f361f[_0xc294('0x31')][_0xc294('0x22')]);}_0x5e8090[_0xc294('0x3a')]=qs[_0xc294('0x3b')](_0x1f361f[_0xc294('0x31')][_0xc294('0x3b')]);_0x5e8090[_0xc294('0x3c')]=qs[_0xc294('0x3d')](_[_0xc294('0x3e')](_0x1f361f[_0xc294('0x31')],_0x75b709['filters']),_0xa3b736);if(_0x1f361f[_0xc294('0x31')][_0xc294('0x3f')]){_0x5e8090['where']=_[_0xc294('0x40')](_0x5e8090[_0xc294('0x3c')],{'$or':_[_0xc294('0x2c')](_0xa3b736,function(_0x251126){if(_0x251126['type']!=='VIRTUAL'){var _0x3a1402={};_0x3a1402[_0x251126[_0xc294('0x28')]]={'$like':'%'+_0x1f361f[_0xc294('0x31')][_0xc294('0x3f')]+'%'};return _0x3a1402;}})});}_0x5e8090=_[_0xc294('0x40')]({},_0x5e8090,_0x1f361f[_0xc294('0x41')]);var _0x3050f6={'where':_0x5e8090[_0xc294('0x3c')]};return db[_0xc294('0x2d')][_0xc294('0x21')](_0x3050f6)[_0xc294('0x11')](function(_0x381278){_0x8aac25[_0xc294('0x21')]=_0x381278;if(_0x1f361f[_0xc294('0x31')]['includeAll']){_0x5e8090[_0xc294('0x42')]=[{'all':!![]}];}return db[_0xc294('0x2d')][_0xc294('0x43')](_0x5e8090);})['then'](function(_0x484e63){_0x8aac25[_0xc294('0x44')]=_0x484e63;return _0x8aac25;})[_0xc294('0x11')](respondWithFilteredResult(_0x242522,_0x5e8090))['catch'](handleError(_0x242522,null));};exports[_0xc294('0x45')]=function(_0x4beba6,_0x508a1d){var _0x395c15={'raw':![],'where':{'id':_0x4beba6[_0xc294('0x46')]['id']},'include':[{'model':db[_0xc294('0x2a')],'as':_0xc294('0x2b')}]},_0x4cdd3c={};_0x4cdd3c[_0xc294('0x33')]=_[_0xc294('0x32')](db[_0xc294('0x2d')][_0xc294('0x2e')]);_0x4cdd3c[_0xc294('0x31')]=_[_0xc294('0x32')](_0x4beba6[_0xc294('0x31')]);_0x4cdd3c[_0xc294('0x3d')]=_[_0xc294('0x34')](_0x4cdd3c['model'],_0x4cdd3c[_0xc294('0x31')]);_0x395c15[_0xc294('0x36')]=_[_0xc294('0x34')](_0x4cdd3c['model'],qs['fields'](_0x4beba6[_0xc294('0x31')][_0xc294('0x35')]));_0x395c15[_0xc294('0x36')]=_0x395c15[_0xc294('0x36')][_0xc294('0x37')]?_0x395c15[_0xc294('0x36')]:_0x4cdd3c[_0xc294('0x33')];if(_0x4beba6['query']['includeAll']){_0x395c15[_0xc294('0x42')]=[{'all':!![]}];}_0x395c15=_[_0xc294('0x40')]({},_0x395c15,_0x4beba6[_0xc294('0x41')]);return db[_0xc294('0x2d')][_0xc294('0x47')](_0x395c15)['then'](handleEntityNotFound(_0x508a1d,null))[_0xc294('0x11')](respondWithResult(_0x508a1d,null))[_0xc294('0x1c')](handleError(_0x508a1d,null));};exports['create']=function(_0x5db2ff,_0x27c34f){return db[_0xc294('0x2d')][_0xc294('0x48')](_0x5db2ff[_0xc294('0x49')],{})['then'](function(_0x433da0){var _0x34bea6=_0x5db2ff[_0xc294('0x4a')][_0xc294('0x24')]({'plain':!![]});if(!_0x34bea6)throw new Error(_0xc294('0x4b'));if(_0x34bea6['role']===_0xc294('0x4a')){var _0x3a65ac=_0x433da0[_0xc294('0x24')]({'plain':!![]});var _0x2b6140='ChatWebsites';return db[_0xc294('0x4c')][_0xc294('0x47')]({'where':{'name':_0x2b6140,'userProfileId':_0x34bea6['userProfileId']},'raw':!![]})['then'](function(_0x2795ae){if(_0x2795ae&&_0x2795ae[_0xc294('0x4d')]===0x0){return db[_0xc294('0x4e')][_0xc294('0x48')]({'name':_0x3a65ac['name'],'resourceId':_0x3a65ac['id'],'type':_0x2795ae[_0xc294('0x28')],'sectionId':_0x2795ae['id']},{})[_0xc294('0x11')](function(){return _0x433da0;});}else{return _0x433da0;}})[_0xc294('0x1c')](function(_0x373384){logger['error'](_0xc294('0x4f'),_0x373384);throw _0x373384;});}return _0x433da0;})[_0xc294('0x11')](respondWithResult(_0x27c34f,0xc9))['catch'](handleError(_0x27c34f,null));};exports[_0xc294('0x50')]=function(_0x25c9f0,_0x1dc773){if(_0x25c9f0['body']['id']){delete _0x25c9f0[_0xc294('0x49')]['id'];}return db[_0xc294('0x2d')][_0xc294('0x47')]({'where':{'id':_0x25c9f0['params']['id']},'include':[{'model':db['Pause'],'as':_0xc294('0x2b')}]})[_0xc294('0x11')](handleEntityNotFound(_0x1dc773,null))[_0xc294('0x11')](saveUpdates(_0x25c9f0[_0xc294('0x49')],null))['then'](respondWithResult(_0x1dc773,null))[_0xc294('0x1c')](handleError(_0x1dc773,null));};exports[_0xc294('0x26')]=function(_0x16b943,_0x254e49){return db[_0xc294('0x2d')]['find']({'where':{'id':_0x16b943[_0xc294('0x46')]['id']}})[_0xc294('0x11')](handleEntityNotFound(_0x254e49,null))[_0xc294('0x11')](removeEntity(_0x254e49,null))[_0xc294('0x1c')](handleError(_0x254e49,null));};exports[_0xc294('0x51')]=function(_0x13f29f,_0x5cc05e){return db[_0xc294('0x2d')][_0xc294('0x51')]()[_0xc294('0x11')](respondWithResult(_0x5cc05e,null))['catch'](handleError(_0x5cc05e,null));};exports[_0xc294('0x52')]=function(_0x411662,_0x20b951){if(_0x411662[_0xc294('0x49')]['id']){delete _0x411662[_0xc294('0x49')]['id'];}return db[_0xc294('0x2d')][_0xc294('0x47')]({'where':{'id':_0x411662[_0xc294('0x46')]['id']}})[_0xc294('0x11')](handleEntityNotFound(_0x20b951,null))[_0xc294('0x11')](function(_0x283d9c){if(_0x283d9c){_0x411662[_0xc294('0x49')][_0xc294('0x53')]=_0x283d9c['id'];return db[_0xc294('0x54')]['create'](_0x411662[_0xc294('0x49')]);}})['then'](respondWithResult(_0x20b951,null))[_0xc294('0x1c')](handleError(_0x20b951,null));};exports[_0xc294('0x55')]=function(_0x50173a,_0x1463ef){var _0x13a924={'raw':![],'where':{}};var _0x10c8c0={};var _0x5ad592={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xc294('0x56')]({'where':{'id':_0x50173a[_0xc294('0x46')]['id']}})[_0xc294('0x11')](handleEntityNotFound(_0x1463ef,null))['then'](function(_0x563e12){if(_0x563e12){_0x10c8c0['model']=_[_0xc294('0x32')](db[_0xc294('0x54')][_0xc294('0x2e')]);_0x10c8c0[_0xc294('0x31')]=_[_0xc294('0x32')](_0x50173a[_0xc294('0x31')]);_0x10c8c0['filters']=_[_0xc294('0x34')](_0x10c8c0['model'],_0x10c8c0['query']);_0x13a924['attributes']=_['intersection'](_0x10c8c0['model'],qs[_0xc294('0x35')](_0x50173a['query']['fields']));_0x13a924['attributes']=_0x13a924[_0xc294('0x36')]['length']?_0x13a924[_0xc294('0x36')]:_0x10c8c0[_0xc294('0x33')];if(!_0x50173a[_0xc294('0x31')][_0xc294('0x38')](_0xc294('0x39'))){_0x13a924[_0xc294('0x20')]=qs[_0xc294('0x20')](_0x50173a['query'][_0xc294('0x20')]);_0x13a924[_0xc294('0x22')]=qs[_0xc294('0x22')](_0x50173a[_0xc294('0x31')][_0xc294('0x22')]);}_0x13a924[_0xc294('0x3a')]=qs[_0xc294('0x3b')](_0x50173a[_0xc294('0x31')]['sort']);_0x13a924[_0xc294('0x3c')]=qs[_0xc294('0x3d')](_[_0xc294('0x3e')](_0x50173a[_0xc294('0x31')],_0x10c8c0['filters']));_0x13a924[_0xc294('0x3c')]['ChatWebsiteId']=_0x563e12['id'];if(_0x50173a[_0xc294('0x31')][_0xc294('0x3f')]){_0x13a924['where']=_[_0xc294('0x40')](_0x13a924[_0xc294('0x3c')],{'$or':_[_0xc294('0x2c')](_0x13a924[_0xc294('0x36')],function(_0x369a32){var _0x51dd7a={};_0x51dd7a[_0x369a32]={'$like':'%'+_0x50173a[_0xc294('0x31')][_0xc294('0x3f')]+'%'};return _0x51dd7a;})});}_0x13a924=_['merge']({},_0x13a924,_0x50173a['options']);return db[_0xc294('0x54')][_0xc294('0x21')]({'where':_0x13a924[_0xc294('0x3c')]})['then'](function(_0x56a8aa){_0x5ad592[_0xc294('0x21')]=_0x56a8aa;if(_0x50173a[_0xc294('0x31')]['includeAll']){_0x13a924['include']=[{'all':!![]}];}return db[_0xc294('0x54')][_0xc294('0x43')](_0x13a924);})[_0xc294('0x11')](function(_0x2ee621){_0x5ad592['rows']=_0x2ee621;return _0x5ad592;});}})[_0xc294('0x11')](respondWithFilteredResult(_0x1463ef,_0x13a924))[_0xc294('0x1c')](handleError(_0x1463ef,null));};exports['removeDispositions']=function(_0x4acdd5,_0x18881f){return db[_0xc294('0x2d')]['find']({'where':{'id':_0x4acdd5[_0xc294('0x46')]['id']}})['then'](handleEntityNotFound(_0x18881f,null))[_0xc294('0x11')](function(_0x2eadfe){if(_0x2eadfe){return _0x2eadfe[_0xc294('0x57')](_0x4acdd5[_0xc294('0x31')][_0xc294('0x58')]);}})[_0xc294('0x11')](respondWithStatusCode(_0x18881f,null))[_0xc294('0x1c')](handleError(_0x18881f,null));};exports[_0xc294('0x59')]=function(_0x22106d,_0x5db72b){if(_0x22106d[_0xc294('0x49')]['id']){delete _0x22106d[_0xc294('0x49')]['id'];}return db[_0xc294('0x2d')][_0xc294('0x47')]({'where':{'id':_0x22106d[_0xc294('0x46')]['id']}})[_0xc294('0x11')](handleEntityNotFound(_0x5db72b,null))['then'](function(_0x38e858){if(_0x38e858){_0x22106d['body'][_0xc294('0x53')]=_0x38e858['id'];return db[_0xc294('0x5a')]['create'](_0x22106d['body']);}})[_0xc294('0x11')](respondWithResult(_0x5db72b,null))[_0xc294('0x1c')](handleError(_0x5db72b,null));};exports['getAnswers']=function(_0x208b46,_0x4b94cb){var _0x2ae666={'raw':![],'where':{}};var _0x24de6d={};var _0x345e1e={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x208b46[_0xc294('0x46')]['id']}})[_0xc294('0x11')](handleEntityNotFound(_0x4b94cb,null))['then'](function(_0x16ec0b){if(_0x16ec0b){_0x24de6d[_0xc294('0x33')]=_['keys'](db[_0xc294('0x5a')]['rawAttributes']);_0x24de6d[_0xc294('0x31')]=_[_0xc294('0x32')](_0x208b46['query']);_0x24de6d['filters']=_[_0xc294('0x34')](_0x24de6d[_0xc294('0x33')],_0x24de6d[_0xc294('0x31')]);_0x2ae666['attributes']=_[_0xc294('0x34')](_0x24de6d[_0xc294('0x33')],qs[_0xc294('0x35')](_0x208b46['query'][_0xc294('0x35')]));_0x2ae666[_0xc294('0x36')]=_0x2ae666[_0xc294('0x36')][_0xc294('0x37')]?_0x2ae666[_0xc294('0x36')]:_0x24de6d[_0xc294('0x33')];if(!_0x208b46[_0xc294('0x31')][_0xc294('0x38')]('nolimit')){_0x2ae666['limit']=qs[_0xc294('0x20')](_0x208b46['query']['limit']);_0x2ae666['offset']=qs['offset'](_0x208b46[_0xc294('0x31')]['offset']);}_0x2ae666[_0xc294('0x3a')]=qs[_0xc294('0x3b')](_0x208b46[_0xc294('0x31')][_0xc294('0x3b')]);_0x2ae666[_0xc294('0x3c')]=qs[_0xc294('0x3d')](_[_0xc294('0x3e')](_0x208b46['query'],_0x24de6d['filters']));_0x2ae666[_0xc294('0x3c')][_0xc294('0x53')]=_0x16ec0b['id'];if(_0x208b46['query']['filter']){_0x2ae666[_0xc294('0x3c')]=_['merge'](_0x2ae666['where'],{'$or':_[_0xc294('0x2c')](_0x2ae666['attributes'],function(_0x33c688){var _0x243bae={};_0x243bae[_0x33c688]={'$like':'%'+_0x208b46['query'][_0xc294('0x3f')]+'%'};return _0x243bae;})});}_0x2ae666=_[_0xc294('0x40')]({},_0x2ae666,_0x208b46['options']);return db[_0xc294('0x5a')]['count']({'where':_0x2ae666['where']})[_0xc294('0x11')](function(_0x593898){_0x345e1e[_0xc294('0x21')]=_0x593898;if(_0x208b46[_0xc294('0x31')]['includeAll']){_0x2ae666['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x2ae666);})[_0xc294('0x11')](function(_0x5a16d0){_0x345e1e[_0xc294('0x44')]=_0x5a16d0;return _0x345e1e;});}})[_0xc294('0x11')](respondWithFilteredResult(_0x4b94cb,_0x2ae666))[_0xc294('0x1c')](handleError(_0x4b94cb,null));};exports[_0xc294('0x5b')]=function(_0x2fdf14,_0x2e9deb){return db[_0xc294('0x2d')]['find']({'where':{'id':_0x2fdf14['params']['id']}})['then'](handleEntityNotFound(_0x2e9deb,null))['then'](function(_0x5b2a16){if(_0x5b2a16){return _0x5b2a16[_0xc294('0x5b')](_0x2fdf14[_0xc294('0x31')][_0xc294('0x58')]);}})[_0xc294('0x11')](respondWithStatusCode(_0x2e9deb,null))[_0xc294('0x1c')](handleError(_0x2e9deb,null));};exports['addLogo']=function(_0x57e83c,_0x1a9bdb){_0x57e83c[_0xc294('0x49')][_0xc294('0x5c')]=_0x57e83c[_0xc294('0x5d')][_0xc294('0x5e')];return db[_0xc294('0x2d')]['find']({'where':{'id':_0x57e83c[_0xc294('0x46')]['id']}})[_0xc294('0x11')](handleEntityNotFound(_0x1a9bdb,null))['then'](saveUpdates(_0x57e83c['body'],null))[_0xc294('0x11')](respondWithResult(_0x1a9bdb,null))[_0xc294('0x1c')](handleError(_0x1a9bdb,null));};exports[_0xc294('0x5f')]=function(_0x51e4d2,_0x626218){_0x51e4d2['body'][_0xc294('0x60')]=_0x51e4d2['file'][_0xc294('0x5e')];return db[_0xc294('0x2d')]['find']({'where':{'id':_0x51e4d2[_0xc294('0x46')]['id']}})['then'](handleEntityNotFound(_0x626218,null))[_0xc294('0x11')](saveUpdates(_0x51e4d2[_0xc294('0x49')],null))['then'](respondWithResult(_0x626218,null))['catch'](handleError(_0x626218,null));};exports[_0xc294('0x61')]=function(_0xd8fb7d,_0x5efd26){_0xd8fb7d[_0xc294('0x49')]['customerAvatar']=_0xd8fb7d[_0xc294('0x5d')][_0xc294('0x5e')];return db[_0xc294('0x2d')][_0xc294('0x47')]({'where':{'id':_0xd8fb7d['params']['id']}})[_0xc294('0x11')](handleEntityNotFound(_0x5efd26,null))[_0xc294('0x11')](saveUpdates(_0xd8fb7d[_0xc294('0x49')],null))[_0xc294('0x11')](respondWithResult(_0x5efd26,null))[_0xc294('0x1c')](handleError(_0x5efd26,null));};exports[_0xc294('0x62')]=function(_0x5f1234,_0x31bcb9){_0x5f1234[_0xc294('0x49')][_0xc294('0x63')]=_0x5f1234[_0xc294('0x5d')][_0xc294('0x5e')];return db['ChatWebsite'][_0xc294('0x47')]({'where':{'id':_0x5f1234[_0xc294('0x46')]['id']}})[_0xc294('0x11')](handleEntityNotFound(_0x31bcb9,null))[_0xc294('0x11')](saveUpdates(_0x5f1234[_0xc294('0x49')],null))[_0xc294('0x11')](respondWithResult(_0x31bcb9,null))['catch'](handleError(_0x31bcb9,null));};exports[_0xc294('0x64')]=function(_0x5e8dd5,_0x536ee4){var _0x122904=path[_0xc294('0x65')](config[_0xc294('0x66')],_0xc294('0x67'));var _0x1269ea={'where':{'id':_0x5e8dd5[_0xc294('0x46')]['id']},'attributes':['id',_0xc294('0x5c')],'raw':!![]};var _0x28db51=![];return require(_0xc294('0x68'))[_0xc294('0x69')]()[_0xc294('0x11')](function(_0x1fbdce){if(_0x1fbdce){_0x28db51=_0x1fbdce[_0xc294('0x6a')];}})[_0xc294('0x11')](function(){return db[_0xc294('0x2d')]['find'](_0x1269ea);})[_0xc294('0x11')](handleEntityNotFound(_0x536ee4,null))[_0xc294('0x11')](function(_0x257961){if(_0x257961){if(!_[_0xc294('0x6b')](_0x257961[_0xc294('0x5c')])){if(fs[_0xc294('0x6c')](path[_0xc294('0x65')](config['root'],_0xc294('0x6d'),_0x257961['sitepic']))&&_0x28db51){_0x122904=path['join'](config['root'],_0xc294('0x6d'),_0x257961[_0xc294('0x5c')]);}}return _0x536ee4[_0xc294('0x6e')](_0x122904);}})[_0xc294('0x1c')](handleError(_0x536ee4,null));};exports['getAvatar']=function(_0x402d9e,_0x2e590b){var _0x197d31=path[_0xc294('0x65')](config['root'],'server/files/images/avatars/default_avatar.png');var _0x45e2a0={'where':{'id':_0x402d9e['params']['id']},'attributes':['id',_0xc294('0x60')],'raw':!![]};return db[_0xc294('0x2d')][_0xc294('0x47')](_0x45e2a0)[_0xc294('0x11')](handleEntityNotFound(_0x2e590b,null))[_0xc294('0x11')](function(_0x157ef0){if(_0x157ef0){if(!_[_0xc294('0x6b')](_0x157ef0[_0xc294('0x60')])){if(fs[_0xc294('0x6c')](path['join'](config[_0xc294('0x66')],_0xc294('0x6f'),_0x157ef0[_0xc294('0x60')]))){_0x197d31=path[_0xc294('0x65')](config[_0xc294('0x66')],'server/files/images/avatars/',_0x157ef0[_0xc294('0x60')]);}}return _0x2e590b['download'](_0x197d31);}})[_0xc294('0x1c')](handleError(_0x2e590b,null));};exports[_0xc294('0x70')]=function(_0x3077b7,_0x56c08f){var _0x2416ba=path[_0xc294('0x65')](config[_0xc294('0x66')],_0xc294('0x71'));var _0x3711ea={'where':{'id':_0x3077b7[_0xc294('0x46')]['id']},'attributes':['id',_0xc294('0x72'),'showCustomerAvatar'],'raw':!![]};return db[_0xc294('0x2d')]['find'](_0x3711ea)[_0xc294('0x11')](handleEntityNotFound(_0x56c08f,null))[_0xc294('0x11')](function(_0x4e9428){if(_0x4e9428){if(!_[_0xc294('0x6b')](_0x4e9428[_0xc294('0x72')])){if(fs[_0xc294('0x6c')](path[_0xc294('0x65')](config[_0xc294('0x66')],'server/files/images/avatars/',_0x4e9428[_0xc294('0x72')]))&&_0x4e9428[_0xc294('0x73')]){_0x2416ba=path['join'](config[_0xc294('0x66')],_0xc294('0x6f'),_0x4e9428['customerAvatar']);}}return _0x56c08f[_0xc294('0x6e')](_0x2416ba);}})[_0xc294('0x1c')](handleError(_0x56c08f,null));};exports[_0xc294('0x74')]=function(_0x2e8eeb,_0x55181c){var _0x1af7fd=path[_0xc294('0x65')](config[_0xc294('0x66')],_0xc294('0x75'));var _0x30af10={'where':{'id':_0x2e8eeb[_0xc294('0x46')]['id']},'attributes':['id',_0xc294('0x63')],'raw':!![]};return db[_0xc294('0x2d')][_0xc294('0x47')](_0x30af10)['then'](handleEntityNotFound(_0x55181c,null))[_0xc294('0x11')](function(_0x199c0a){if(_0x199c0a){if(!_['isNil'](_0x199c0a[_0xc294('0x63')])){if(fs[_0xc294('0x6c')](path[_0xc294('0x65')](config['root'],_0xc294('0x6f'),_0x199c0a['systemAvatar']))){_0x1af7fd=path[_0xc294('0x65')](config['root'],_0xc294('0x6f'),_0x199c0a[_0xc294('0x63')]);}}return _0x55181c[_0xc294('0x6e')](_0x1af7fd);}})[_0xc294('0x1c')](handleError(_0x55181c,null));};exports[_0xc294('0x76')]=function(_0x105a37,_0x555ba9){var _0x3219ce=require(_0xc294('0x77'));var _0xd95412=new _0x3219ce();var _0x46c1f5=_0xd95412[_0xc294('0x78')](_0x105a37[_0xc294('0x79')]['user-agent'])[_0xc294('0x7a')]();var _0x55b468={'body':_0x105a37[_0xc294('0x49')],'channel':'chat'};var _0x5a7609=[];var _0x4f38ea=[];var _0x5ab24a={};var _0x4a4204=![];return db[_0xc294('0x7b')]['describe']()[_0xc294('0x11')](function(_0x346761){if(!_0x346761){throw new db[(_0xc294('0x7c'))][(_0xc294('0x7d'))](_0xc294('0x7e'));}_0x5a7609=_[_0xc294('0x7f')](_[_0xc294('0x32')](_0x346761),[_0xc294('0x80'),_0xc294('0x81')]);_0x4f38ea=_[_0xc294('0x7f')](_[_0xc294('0x32')](_0x346761),[_0xc294('0x80'),_0xc294('0x81'),_0xc294('0x82'),'ListId']);if(_0x105a37[_0xc294('0x49')]['id']){delete _0x105a37[_0xc294('0x49')]['id'];}if(_[_0xc294('0x6b')](_0x105a37[_0xc294('0x49')][_0xc294('0x83')])){throw new db[(_0xc294('0x7c'))][(_0xc294('0x7d'))](_0xc294('0x84'));}if(_[_0xc294('0x6b')](_0x105a37['body'][_0xc294('0x49')])||_0x105a37[_0xc294('0x49')][_0xc294('0x49')]===''){throw new db[(_0xc294('0x7c'))][(_0xc294('0x7d'))](_0xc294('0x85'));}if(_[_0xc294('0x6b')](_0x105a37[_0xc294('0x49')][_0xc294('0x86')])){throw new db['Sequelize']['ValidationError'](_0xc294('0x87')+_0x4f38ea);}if(!_[_0xc294('0x88')](_0x4f38ea,_0x105a37[_0xc294('0x49')][_0xc294('0x86')])){throw new db['Sequelize'][(_0xc294('0x7d'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4f38ea);}_0x5ab24a[_0x105a37[_0xc294('0x49')][_0xc294('0x86')]]=_0x105a37['body'][_0xc294('0x83')];})['then'](function(){return db['ChatWebsite']['find']({'where':{'id':_0x105a37[_0xc294('0x46')]['id']},'include':[{'model':db[_0xc294('0x89')],'as':_0xc294('0x8a'),'include':[{'model':db['CmContact'],'as':_0xc294('0x8b'),'where':_0x5ab24a,'limit':0x1,'order':[[_0xc294('0x81'),_0xc294('0x8c')]]}]},{'model':db['ChatApplication'],'as':_0xc294('0x8d')}]});})[_0xc294('0x11')](handleEntityNotFound(_0x555ba9,null))['then'](function(_0x9eea3){if(_0x9eea3&&_0x9eea3[_0xc294('0x8a')]){_0x55b468['account']=_0x9eea3;_0x55b468[_0xc294('0x8e')]=_0x9eea3[_0xc294('0x8d')];_0x55b468[_0xc294('0x8f')]=_0x9eea3[_0xc294('0x8a')];_0x55b468[_0xc294('0x8e')]=_[_0xc294('0x90')](_0x55b468['applications'],[_0xc294('0x91')],[_0xc294('0x92')]);if(_0x55b468['account'][_0xc294('0x8d')]){delete _0x55b468['account'][_0xc294('0x8d')];}if(_0x55b468[_0xc294('0x93')]['List']&&_0x55b468[_0xc294('0x93')]['List']['Contacts'][_0xc294('0x37')]){return _0x55b468[_0xc294('0x93')][_0xc294('0x8a')]['Contacts'][0x0];}var _0x29eaf3=_[_0xc294('0x94')](_0x105a37[_0xc294('0x49')],{'firstName':_0x105a37[_0xc294('0x49')][_0xc294('0x83')],'ListId':_0x9eea3[_0xc294('0x95')]});_0x29eaf3[_0x105a37[_0xc294('0x49')][_0xc294('0x86')]]=_0x105a37[_0xc294('0x49')][_0xc294('0x83')];return db['CmContact'][_0xc294('0x48')](_0x29eaf3,{'fields':_0x5a7609,'raw':!![]});}})[_0xc294('0x11')](handleEntityNotFound(_0x555ba9,null))[_0xc294('0x11')](function(_0xfe6bfe){_0x55b468['contact']=_0xfe6bfe;var _0x1ce46=_0x105a37[_0xc294('0x49')][_0xc294('0x96')];if(_0x105a37['headers']['cf-connecting-ip']){_0x1ce46=_0x105a37['headers'][_0xc294('0x97')];}else if(_0x105a37['headers'][_0xc294('0x98')]){_0x1ce46=_[_0xc294('0x99')](_0x105a37[_0xc294('0x79')][_0xc294('0x98')][_0xc294('0x9a')](','));}if(_0xfe6bfe){var _0x244b7e={'ContactId':_0xfe6bfe['id'],'ChatWebsiteId':_0x105a37[_0xc294('0x46')]['id'],'from':(_0xfe6bfe[_0xc294('0x9b')]||'')+'\x20'+(_0xfe6bfe[_0xc294('0x9c')]||''),'customerIp':_0x1ce46,'customerPort':_0x105a37['headers'][_0xc294('0x9d')]?_0x105a37[_0xc294('0x79')][_0xc294('0x9d')]:null,'referer':_0x105a37[_0xc294('0x49')][_0xc294('0x9e')],'browserName':_0x46c1f5[_0xc294('0x9f')][_0xc294('0x28')]&&_0x46c1f5[_0xc294('0x9f')][_0xc294('0xa0')]?util['format']('%s\x20%s',_0x46c1f5['browser'][_0xc294('0x28')],_0x46c1f5[_0xc294('0x9f')][_0xc294('0xa0')]):'unknown','browserVersion':_0x46c1f5['browser'][_0xc294('0xa0')]||_0xc294('0xa1'),'osName':util[_0xc294('0xa2')]('%s\x20%s',_0x46c1f5['os'][_0xc294('0x28')],_0x46c1f5['os']['version']),'osVersion':_0x46c1f5['os']['version'],'deviceModel':_0x46c1f5[_0xc294('0xa3')][_0xc294('0x33')]&&_0x46c1f5[_0xc294('0xa3')][_0xc294('0xa4')]?util[_0xc294('0xa2')](_0xc294('0xa5'),_0x46c1f5[_0xc294('0xa3')][_0xc294('0x33')],_0x46c1f5[_0xc294('0xa3')][_0xc294('0xa4')],_0x46c1f5[_0xc294('0xa3')][_0xc294('0xa6')]):null,'deviceVendor':_0x46c1f5['device'][_0xc294('0xa4')],'deviceType':_0x46c1f5['device']['type'],'formData':JSON[_0xc294('0x17')](_0x105a37[_0xc294('0x49')])};var _0x12d0fc={'ChatWebsiteId':_0x105a37['params']['id'],'closed':![]};if(_0x105a37['body'][_0xc294('0xa7')]){_0x12d0fc[_0xc294('0xa7')]=_0x105a37[_0xc294('0x49')][_0xc294('0xa7')];return db[_0xc294('0xa8')][_0xc294('0x47')]({'where':_0x12d0fc})['then'](function(_0x529509){if(_0x529509){return[_0x529509,![]];}_0x244b7e[_0xc294('0xa7')]=_0x105a37[_0xc294('0x49')][_0xc294('0xa7')];_0x244b7e[_0xc294('0xa9')]=_0x105a37[_0xc294('0x49')][_0xc294('0xa9')];return db[_0xc294('0xa8')][_0xc294('0x48')](_0x244b7e)[_0xc294('0x11')](function(_0x74b876){return[_0x74b876,!![]];});});}_0x12d0fc['ContactId']=_0xfe6bfe['id'];if(_0x105a37['body'][_0xc294('0xaa')]&&_0x105a37['body'][_0xc294('0xaa')]['id']){_0x12d0fc['id']=_0x105a37[_0xc294('0x49')]['interaction']['id'];return db['ChatInteraction'][_0xc294('0x47')]({'where':_0x12d0fc})[_0xc294('0x11')](function(_0x1a0b88){if(_0x1a0b88){return[_0x1a0b88,![]];}return db['ChatInteraction'][_0xc294('0x48')](_0x244b7e)[_0xc294('0x11')](function(_0x34995b){return[_0x34995b,!![]];});});}return db[_0xc294('0xa8')][_0xc294('0x48')](_0x244b7e)[_0xc294('0x11')](function(_0x1e0148){return[_0x1e0148,!![]];});}})[_0xc294('0xab')](function(_0x5af200,_0x19e9f0){if(_0x5af200){_0x4a4204=_0x19e9f0;if(!_0x19e9f0){var _0x10a593={'from':(_0x55b468[_0xc294('0xac')][_0xc294('0x9b')]||'')+'\x20'+(_0x55b468[_0xc294('0xac')][_0xc294('0x9c')]||'')};if(_0x105a37[_0xc294('0x49')][_0xc294('0xa7')]&&_0x105a37[_0xc294('0x49')][_0xc294('0xad')]&&_0x105a37[_0xc294('0x49')][_0xc294('0xa7')]!=_0x105a37['body'][_0xc294('0xad')]){_0x10a593[_0xc294('0xa7')]=_0x105a37[_0xc294('0x49')][_0xc294('0xad')];}return _0x5af200[_0xc294('0x50')](_0x10a593);}else{return _0x5af200;}}})[_0xc294('0x11')](function(_0x1d3a29){_0x55b468[_0xc294('0xaa')]=_0x1d3a29['get']({'plain':!![]});_0x55b468[_0xc294('0xaa')]['created']=_0x4a4204;if(_0x55b468['interaction'][_0xc294('0xae')]){if(_0x55b468['account'][_0xc294('0xaf')]){_0x55b468[_0xc294('0x8e')][_0xc294('0xb0')]({'id':0x0,'priority':_0x55b468[_0xc294('0x8e')]['length']+0x1,'app':_0xc294('0xb1'),'appdata':_0xc294('0xb2'),'interval':_0xc294('0xb3')});}}return db[_0xc294('0xb4')][_0xc294('0x48')]({'body':_0x105a37[_0xc294('0x49')]['body'],'ChatWebsiteId':_0x105a37[_0xc294('0x46')]['id'],'ChatInteractionId':_0x1d3a29['id'],'direction':'in','ContactId':_0x55b468[_0xc294('0xac')]['id'],'AttachmentId':_0x105a37[_0xc294('0x49')][_0xc294('0xb5')]});})['then'](function(_0x9e4dd3){_0x55b468[_0xc294('0x1a')]=_0x9e4dd3;if(_0x55b468[_0xc294('0xaa')][_0xc294('0xb6')]){return db[_0xc294('0xb7')][_0xc294('0x47')]({'attributes':['id',_0xc294('0x28')],'where':{'id':_0x55b468['interaction'][_0xc294('0xb6')]}})[_0xc294('0x11')](function(_0x297739){if(_0x297739){_0x55b468[_0xc294('0x8e')][_0xc294('0xb8')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x297739['name']+','+(_0x55b468[_0xc294('0x93')][_0xc294('0xb9')]||0xa),'interval':_0xc294('0xb3')});_0x55b468[_0xc294('0xba')]=!![];}return respondWithRpcPromise(_0xc294('0xbb'),_0xc294('0xbc'),_0x55b468);});}return respondWithRpcPromise(_0xc294('0xbb'),_0xc294('0xbc'),_0x55b468);})[_0xc294('0x11')](function(_0x73e46e){respondWithRpcPromise(_0xc294('0xbd'),'EventManager',{'event':_0xc294('0x76'),'message':_0x73e46e},client9002);return _0x73e46e;})[_0xc294('0x11')](respondWithResult(_0x555ba9,null))[_0xc294('0x1c')](handleError(_0x555ba9,null));};exports[_0xc294('0xbe')]=function(_0x5de590,_0x2d5564){var _0xd3cc05,_0x40639e,_0x5b38b3;var _0x59c9b1=[];var _0x139e1b={};var _0x1874a1=_0x5de590[_0xc294('0xbf')]||[];var _0xe53db5=[];var _0x533169;return db['CmContact'][_0xc294('0x51')]()[_0xc294('0x11')](function(_0x2dffa1){if(!_0x2dffa1){throw new db[(_0xc294('0x7c'))][(_0xc294('0x7d'))](_0xc294('0x7e'));}_0x59c9b1=_[_0xc294('0x7f')](_['keys'](_0x2dffa1),[_0xc294('0x80'),_0xc294('0x81'),'CompanyId','ListId']);if(_0x5de590[_0xc294('0x49')]['id']){delete _0x5de590['body']['id'];}if(_['isNil'](_0x5de590[_0xc294('0x49')]['from'])){throw _0x2d5564[_0xc294('0x1e')](0x1f4)['send'](new db['Sequelize'][(_0xc294('0x7d'))](_0xc294('0x84')));}if(_['isNil'](_0x5de590[_0xc294('0x49')][_0xc294('0x49')])||_0x5de590[_0xc294('0x49')][_0xc294('0x49')]===''){throw _0x2d5564['status'](0x1f4)[_0xc294('0x29')](new db[(_0xc294('0x7c'))][(_0xc294('0x7d'))](_0xc294('0x85')));}if(_[_0xc294('0x6b')](_0x5de590[_0xc294('0x49')][_0xc294('0xc0')])){throw _0x2d5564[_0xc294('0x1e')](0x1f4)['send'](new db[(_0xc294('0x7c'))][(_0xc294('0x7d'))](_0xc294('0xc1')+_0x59c9b1));}if(!_[_0xc294('0x88')](_0x59c9b1,_0x5de590[_0xc294('0x49')][_0xc294('0xc0')])){throw _0x2d5564[_0xc294('0x1e')](0x1f4)[_0xc294('0x29')](new db[(_0xc294('0x7c'))][(_0xc294('0x7d'))](_0xc294('0xc2')+_0x59c9b1));}_0x139e1b[_0x5de590[_0xc294('0x49')][_0xc294('0xc0')]]=_0x5de590[_0xc294('0x49')][_0xc294('0x83')];})[_0xc294('0x11')](function(){return db[_0xc294('0x2d')][_0xc294('0x47')]({'where':{'id':_0x5de590[_0xc294('0x46')]['id']},'include':[{'model':db[_0xc294('0x89')],'as':_0xc294('0x8a')},{'model':db[_0xc294('0xc3')],'as':'MailAccount'}]});})[_0xc294('0x11')](handleEntityNotFound(_0x2d5564,null))[_0xc294('0x11')](function(_0x5ad9d8){if(_0x5ad9d8&&_0x5ad9d8[_0xc294('0x8a')]){_0x40639e=_0x5ad9d8;var _0x4ea485=_['defaults'](_0x5de590[_0xc294('0x49')],{'firstName':_0x5de590[_0xc294('0x49')][_0xc294('0x83')],'phone':_0x5de590[_0xc294('0x49')]['from'],'ListId':_0x5ad9d8[_0xc294('0x95')]});_0x4ea485[_0x5de590[_0xc294('0x49')][_0xc294('0xc0')]]=_0x5de590[_0xc294('0x49')][_0xc294('0x83')];return db['CmContact']['findOrCreate']({'where':_0x139e1b,'defaults':_0x4ea485});}})[_0xc294('0xab')](function(_0x277270){if(_0x277270){_0x5b38b3=_0x277270;var _0x37ed20=fs['readFileSync'](path['join'](config[_0xc294('0x66')],_0xc294('0xc4')),_0xc294('0xc5'));var _0x25e216=ejs[_0xc294('0xc6')](_0x37ed20,{'body':_[_0xc294('0xc7')](_0x5de590[_0xc294('0x49')][_0xc294('0x49')]),'bodyTitle':_0x40639e[_0xc294('0xc8')]});return db[_0xc294('0xc9')]['create']({'body':_0x25e216,'plainBody':htmlToText['fromString'](_0x25e216),'ContactId':_0x277270['id'],'ChatWebsiteId':_0x40639e['id']});}})[_0xc294('0x11')](function(_0x36c076){_0x533169=_0x36c076;if(_0x1874a1[_0xc294('0x37')]){var _0x36120b=_0x1874a1['map'](function(_0x39f897){return{'name':_0x39f897['originalname'],'basename':_0x39f897[_0xc294('0x5e')],'type':_0x39f897[_0xc294('0xca')],'ChatOfflineMessageId':_0x36c076['id']};});_0xe53db5=_0x36120b[_0xc294('0x2c')](_0x2e2422=>{var _0x511212={'filename':_0x2e2422['name'],'path':path[_0xc294('0x65')](config['root'],_0xc294('0xcb'),'files',_0xc294('0xcc'),_0xc294('0xcd'),_0x2e2422[_0xc294('0xce')])};return _0x511212;});if(!_0x40639e[_0xc294('0xcf')]){return db[_0xc294('0xd0')][_0xc294('0xd1')](function(_0x1424fc){return db[_0xc294('0xd2')][_0xc294('0xd3')](_0x36120b,{'transaction':_0x1424fc});});}}})['then'](function(){if(_0x533169){_0xd3cc05=_0x533169;return db['MailAccount'][_0xc294('0x56')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xc294('0xd4'),'raw':!![],'include':[{'model':db[_0xc294('0xd5')],'as':_0xc294('0xd5'),'raw':!![]}]}]});}})['then'](function(_0x2713f8){if(_0x2713f8&&_0x2713f8[_0xc294('0xd4')]&&_0x40639e[_0xc294('0xd6')]&&_0x40639e[_0xc294('0xd7')]){var _0xd5944b=_0x2713f8[_0xc294('0xd8')]();return respondWithRpcPromise(_0xc294('0xd9'),_0xc294('0xda'),{'account':_0xd5944b,'message':{'from':util[_0xc294('0xa2')](_0xc294('0xdb'),_0x2713f8[_0xc294('0x28')],_0x2713f8[_0xc294('0xdc')]||_0x2713f8[_0xc294('0xd4')][_0xc294('0x4a')]),'to':_0x40639e[_0xc294('0xd7')],'subject':_0x40639e['offlineMessageSubject'],'html':_0xd3cc05['body'],'attachments':_0xe53db5}},client9003)[_0xc294('0x11')](function(){return _0xd3cc05;})[_0xc294('0x1c')](function(_0x2be2b0){logger[_0xc294('0x18')](_0x2be2b0);});}})[_0xc294('0x11')](function(){if(_0x40639e&&_0x40639e[_0xc294('0xcf')]&&_0x40639e[_0xc294('0xdd')]){var _0x319c2d=[];if(_0x1874a1[_0xc294('0x37')]){_0x319c2d=_0x1874a1[_0xc294('0x2c')](function(_0x58dcb9){return{'name':_0x58dcb9[_0xc294('0xde')],'basename':_0x58dcb9[_0xc294('0x5e')],'type':_0x58dcb9[_0xc294('0xca')],'ChatOfflineMessageId':_0x533169['id']};});}var _0x3d14cb;if(!_[_0xc294('0x6b')](_0x40639e['subjectOffline'])){var _0x4bd03a=_[_0xc294('0x2c')](_0x5de590['body'],function(_0x3cf8a0){return _0x3cf8a0;});var _0x19d65b=_['toPairsIn'](_0x4bd03a)[0x0];var _0x4ef4f4=_[_0xc294('0xdf')](_0x19d65b,function(_0x44bdae){return _0x44bdae;});_0x3d14cb=_0x4ef4f4[0x1][_0x40639e[_0xc294('0xe0')]];}var _0x48e9b3={'from':_0x5b38b3[_0xc294('0xdc')],'firstName':_0x5b38b3[_0xc294('0x9b')],'lastName':_0x5b38b3[_0xc294('0x9c')],'mapKey':_0xc294('0xdc'),'message':{'from':_0x5b38b3[_0xc294('0xdc')],'to':_0x40639e[_0xc294('0xc3')][_0xc294('0xdc')],'cc':'','subject':_[_0xc294('0x6b')](_0x3d14cb)?_0x40639e[_0xc294('0xe1')]:_0x3d14cb,'messageId':'','sentAt':new Date(),'attach':_0x319c2d[_0xc294('0x37')],'attachments':_0x319c2d,'originChannel':'Chat','ChatWebsiteId':_0x40639e['id'],'ChatOfflineMessageId':_0xd3cc05['id'],'originTo':_0x40639e[_0xc294('0xc3')][_0xc294('0xdc')]},'body':_0xd3cc05[_0xc294('0x49')]};var _0x1e8f04={'account':{'id':_0x40639e[_0xc294('0xdd')]},'body':_0x48e9b3,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount',_0xc294('0xe2'),_0x1e8f04,client9001)['then'](function(){return _0xd3cc05;})[_0xc294('0x1c')](function(_0x2b0c65){logger[_0xc294('0x18')](_0x2b0c65);});}return;})[_0xc294('0x11')](function(){if(_0xd3cc05){return _0xd3cc05;}})[_0xc294('0x11')](respondWithResult(_0x2d5564,null))[_0xc294('0x1c')](function(_0xc6f6d8){logger['error'](_0xc294('0x1c'),_0xc6f6d8);for(var _0x59c65e of _0x1874a1){var _0x3c2a85=path['join'](config[_0xc294('0x66')],'server',_0xc294('0xbf'),_0xc294('0xcc'),'offline-chat',_0x59c65e[_0xc294('0x5e')]);fs_extra[_0xc294('0xe3')](_0x3c2a85)['catch'](function(_0x304c11){logger[_0xc294('0x18')](_0xc294('0xe4'),_0x3c2a85,_0x304c11);});}});};exports[_0xc294('0xe5')]=function(_0x1b3bf3,_0x3a1d00){return db['ChatInteraction'][_0xc294('0x47')]({'where':{'id':_0x1b3bf3[_0xc294('0x46')]['id']}})[_0xc294('0x11')](handleEntityNotFound(_0x3a1d00,null))[_0xc294('0x11')](function(_0x2103a7){if(_0x2103a7){return _0x2103a7[_0xc294('0xe5')](_0x1b3bf3[_0xc294('0x49')][_0xc294('0x58')],_[_0xc294('0xe6')](_0x1b3bf3[_0xc294('0x49')],[_0xc294('0x58'),'id'])||{});}})['then'](respondWithResult(_0x3a1d00,null))['catch'](handleError(_0x3a1d00,null));};exports[_0xc294('0xe7')]=function(_0x47f2ef,_0x3cfe68){var _0x38a69d={'raw':![],'where':{}};var _0x4e41d3={};var _0x5776db={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x47f2ef[_0xc294('0x46')]['id']}})[_0xc294('0x11')](handleEntityNotFound(_0x3cfe68,null))['then'](function(_0x28febe){if(_0x28febe){_0x4e41d3[_0xc294('0x33')]=_['keys'](db['ChatInteraction'][_0xc294('0x2e')]);_0x4e41d3[_0xc294('0x31')]=_[_0xc294('0x32')](_0x47f2ef[_0xc294('0x31')]);_0x4e41d3[_0xc294('0x3d')]=_[_0xc294('0x34')](_0x4e41d3['model'],_0x4e41d3[_0xc294('0x31')]);_0x38a69d[_0xc294('0x36')]=_[_0xc294('0x34')](_0x4e41d3[_0xc294('0x33')],qs[_0xc294('0x35')](_0x47f2ef[_0xc294('0x31')][_0xc294('0x35')]));_0x38a69d[_0xc294('0x36')]=_0x38a69d['attributes'][_0xc294('0x37')]?_0x38a69d[_0xc294('0x36')]:_0x4e41d3['model'];if(!_0x47f2ef['query']['hasOwnProperty']('nolimit')){_0x38a69d[_0xc294('0x20')]=qs[_0xc294('0x20')](_0x47f2ef[_0xc294('0x31')][_0xc294('0x20')]);_0x38a69d[_0xc294('0x22')]=qs['offset'](_0x47f2ef[_0xc294('0x31')][_0xc294('0x22')]);}_0x38a69d['order']=qs[_0xc294('0x3b')](_0x47f2ef[_0xc294('0x31')][_0xc294('0x3b')]);_0x38a69d[_0xc294('0x3c')]=qs[_0xc294('0x3d')](_[_0xc294('0x3e')](_0x47f2ef[_0xc294('0x31')],_0x4e41d3[_0xc294('0x3d')]));_0x38a69d[_0xc294('0x3c')][_0xc294('0x53')]=_0x28febe['id'];if(_0x47f2ef[_0xc294('0x31')][_0xc294('0x3f')]){_0x38a69d['where']=_[_0xc294('0x40')](_0x38a69d[_0xc294('0x3c')],{'$or':_[_0xc294('0x2c')](_0x38a69d['attributes'],function(_0x26f782){var _0xaafad5={};_0xaafad5[_0x26f782]={'$like':'%'+_0x47f2ef[_0xc294('0x31')][_0xc294('0x3f')]+'%'};return _0xaafad5;})});}_0x38a69d=_[_0xc294('0x40')]({},_0x38a69d,_0x47f2ef['options']);return db['ChatInteraction'][_0xc294('0x21')]({'where':_0x38a69d[_0xc294('0x3c')]})[_0xc294('0x11')](function(_0x1df591){_0x5776db[_0xc294('0x21')]=_0x1df591;if(_0x47f2ef[_0xc294('0x31')][_0xc294('0xe8')]){_0x38a69d[_0xc294('0x42')]=[{'model':db[_0xc294('0x7b')],'as':_0xc294('0xe9'),'required':![]},{'model':db[_0xc294('0xb7')],'as':_0xc294('0xea'),'attributes':[_0xc294('0x28'),_0xc294('0xeb'),_0xc294('0xec')],'required':![]},{'model':db[_0xc294('0xed')],'as':_0xc294('0xee'),'attributes':['id',_0xc294('0x28'),_0xc294('0xef')],'where':_0x47f2ef[_0xc294('0x31')][_0xc294('0xf0')]?{'id':_0x47f2ef[_0xc294('0x31')][_0xc294('0xf0')]}:undefined,'required':_0x47f2ef['query'][_0xc294('0xf0')]?!![]:![]}];}return db['ChatInteraction'][_0xc294('0x43')](_0x38a69d);})['then'](function(_0x1a2ab6){_0x5776db[_0xc294('0x44')]=_0x1a2ab6;return _0x5776db;});}})[_0xc294('0x11')](respondWithFilteredResult(_0x3cfe68,_0x38a69d))[_0xc294('0x1c')](handleError(_0x3cfe68,null));};function iftimePromise(_0x143bf6,_0x28b388){return respondWithRpcPromise('Command',_0xc294('0xf1'),{'command':_0x28b388[_0xc294('0xf2')]?util[_0xc294('0xa2')]('iftime\x20%s,%s',_0x143bf6[_0xc294('0xf3')],_0x28b388[_0xc294('0xf2')]):util['format'](_0xc294('0xf4'),_0x143bf6[_0xc294('0xf3')])},client9002)['then'](function(_0x4298a4){var _0x3a1f24=_0x4298a4&&_0x4298a4[_0xc294('0xf5')]('true')>=0x0?!![]:![];logger['info'](_0xc294('0xf6'),_0x28b388['id'],_0x143bf6['id'],_0x143bf6[_0xc294('0xf3')],_0x3a1f24?_0xc294('0xf7'):'OFFLINE',_0x28b388[_0xc294('0xf2')]?_0x28b388['timezone']:_0xc294('0xf8'));return _0x3a1f24;})['catch'](function(_0x5492c6){logger[_0xc294('0x18')](_0xc294('0xf6'),_0x28b388['id'],_0x143bf6['id'],_0x143bf6[_0xc294('0xf3')],util[_0xc294('0xf9')](_0x5492c6,{'showHidden':![],'depth':null}),_0x28b388['timezone']?_0x28b388[_0xc294('0xf2')]:_0xc294('0xf8'));return![];});}exports[_0xc294('0xf1')]=function(_0x4c1bdb,_0x1dbc94){var _0x53f39e=0x0;var _0x5b2b2a=0x0;var _0x5794ed=![];var _0x345ceb;var _0x16b007;return db[_0xc294('0x2d')]['find']({'where':{'id':_0x4c1bdb[_0xc294('0x46')]['id']},'include':[{'model':db[_0xc294('0xfa')],'as':_0xc294('0xfa'),'include':[{'model':db['Interval'],'as':_0xc294('0xfb'),'attributes':['id',_0xc294('0xf3')],'raw':!![]}]}]})[_0xc294('0x11')](handleEntityNotFound(_0x1dbc94,null))[_0xc294('0x11')](function(_0x2f3895){if(_0x2f3895){_0x345ceb=_0x2f3895;return _0x2f3895[_0xc294('0xfc')]({'raw':!![]});}})[_0xc294('0x11')](function(_0x38b28e){if(_0x345ceb){if(_0x38b28e){_0x16b007=_0x38b28e;}}return require(_0xc294('0x68'))['getLicense']();})['then'](function(_0x3ee545){if(_0x3ee545){_0x5b2b2a=_0x3ee545[_0xc294('0xfd')];_0x5794ed=_0x3ee545['custom'];}})[_0xc294('0x11')](function(){return db[_0xc294('0xa8')][_0xc294('0x21')]({'where':{'closed':![]}});})[_0xc294('0x11')](function(_0xd4a0e7){_0x53f39e=_0xd4a0e7;if(_0x5b2b2a&&_0xd4a0e7>_0x5b2b2a){return db[_0xc294('0xfe')]['findOne']({'where':{'id':0x1}})[_0xc294('0x11')](function(_0x148a4e){if(_0x148a4e){_0x148a4e['increment'](_0xc294('0xff'));}});}})['then'](function(){if(_0x345ceb['Interval']&&_0x345ceb[_0xc294('0xfa')][_0xc294('0xfb')]){var _0x542e4c=[];for(var _0x158361=0x0;_0x158361<_0x345ceb[_0xc294('0xfa')][_0xc294('0xfb')]['length'];_0x158361++){var _0x3fbfbc=_0x345ceb['Interval'][_0xc294('0xfb')][_0x158361][_0xc294('0x24')]({'plain':!![]});_0x542e4c['push'](iftimePromise(_0x3fbfbc,_0x345ceb));}return BPromise[_0xc294('0x100')](_0x542e4c)['then'](function(_0x1e243f){return _[_0xc294('0x101')](_0x1e243f);});}else{return!![];}})['then'](function(_0x4887ef){var _0x17bfb6=fs[_0xc294('0x102')](path[_0xc294('0x65')](config[_0xc294('0x66')],'server/files/chat/iframe.ejs'),_0xc294('0xc5'));var _0x2e6490={'remote':_0x345ceb[_0xc294('0x103')],'query':querystring[_0xc294('0x17')](_[_0xc294('0x40')](_0x345ceb[_0xc294('0x24')]({'plain':!![]}),{'customerIp':_0x4c1bdb[_0xc294('0x79')]['x-forwarded-for']||_0x4c1bdb[_0xc294('0x79')][_0xc294('0x104')]||_0x4c1bdb[_0xc294('0x105')][_0xc294('0x106')]||_0x4c1bdb['ip'],'referer':_0x4c1bdb[_0xc294('0x79')]['referer'],'openedInteractions':_0x53f39e,'maxInteractions':_0x5b2b2a,'virtual':_0x5794ed[_0xc294('0xfd')],'online':_0x4887ef,'custom':_0x5794ed}))[_0xc294('0x107')](/'/g,'\x5c\x27')};_0x1dbc94[_0xc294('0x29')](ejs[_0xc294('0xc6')](Mustache[_0xc294('0xc6')](_0x17bfb6,_0x2e6490),{'proactiveActions':_0x16b007,'alignment':_0x345ceb[_0xc294('0x108')],'verticalAlignment':_0x345ceb[_0xc294('0x109')],'div_color':_0x345ceb['color'],'labelText':_0x345ceb[_0xc294('0x10a')],'text_color':_0x345ceb['textColor'],'text_button_color':_0x345ceb[_0xc294('0x10b')],'button_color':_0x345ceb['color_button'],'background_color':_0x345ceb[_0xc294('0x10c')],'hideWhenOffline':_0x345ceb[_0xc294('0x10d')],'interval':_0x345ceb[_0xc294('0x10e')]}));})['catch'](handleError(_0x1dbc94,null));};exports[_0xc294('0x10f')]=function(_0x3ced78,_0xecfb28){var _0x2141cb=_0x3ced78[_0xc294('0x46')]['id'];var _0x54b563=_0x3ced78['body'];var _0x5ec1a0=0xc8;var _0x361e7a=null;return db[_0xc294('0xd0')]['transaction']({'isolationLevel':db[_0xc294('0xd0')][_0xc294('0x110')]['ISOLATION_LEVELS'][_0xc294('0x111')]},function(_0x1cacbd){return db['ChatWebsite'][_0xc294('0x56')]({'where':{'id':_0x2141cb},'transaction':_0x1cacbd})['then'](function(_0x242065){if(_0x242065){return db[_0xc294('0x112')][_0xc294('0x26')]({'where':{'ChatWebsiteId':_0x2141cb},'transaction':_0x1cacbd})[_0xc294('0x11')](function(){var _0x56a866=_[_0xc294('0x2c')](_0x54b563,function(_0x34f230){_0x34f230[_0xc294('0x53')]=_0x2141cb;return _0x34f230;});return db[_0xc294('0x112')][_0xc294('0xd3')](_0x56a866,{'transaction':_0x1cacbd});});}else{_0x5ec1a0=0x194;_0x361e7a=[];}});})[_0xc294('0x11')](function(){if(_0x5ec1a0!==0x194){return db[_0xc294('0x112')][_0xc294('0x113')]({'where':{'ChatWebsiteId':_0x2141cb},'order':_0xc294('0x91')})['then'](function(_0x34782d){_0x361e7a=_0x34782d;});}})[_0xc294('0x1c')](function(_0x5d46e3){_0x5ec1a0=0x1f4;logger['error'](_0x5d46e3[_0xc294('0x114')]);if(_0x5d46e3[_0xc294('0x28')]){delete _0x5d46e3['name'];}_0x361e7a=_0x5d46e3;})[_0xc294('0x115')](function(){if(_0x361e7a===null){_0xecfb28[_0xc294('0x27')](_0x5ec1a0);}else{if(_0x5ec1a0===0x1f4){_0xecfb28[_0xc294('0x1e')](_0x5ec1a0)[_0xc294('0x29')](_0x361e7a);}else{_0xecfb28['status'](_0x5ec1a0)[_0xc294('0x116')](_0x361e7a);}}});};exports[_0xc294('0x117')]=function(_0x4d269e,_0x1079bd){var _0x2b195d={};var _0x24b50e={};var _0x18efb6;var _0x1771bd;return db[_0xc294('0x2d')][_0xc294('0x56')]({'where':{'id':_0x4d269e[_0xc294('0x46')]['id']}})[_0xc294('0x11')](handleEntityNotFound(_0x1079bd,null))['then'](function(_0x108f7e){if(_0x108f7e){_0x18efb6=_0x108f7e;_0x24b50e[_0xc294('0x33')]=_[_0xc294('0x32')](db[_0xc294('0x112')][_0xc294('0x2e')]);_0x24b50e[_0xc294('0x31')]=_[_0xc294('0x32')](_0x4d269e[_0xc294('0x31')]);_0x24b50e[_0xc294('0x3d')]=_[_0xc294('0x34')](_0x24b50e[_0xc294('0x33')],_0x24b50e['query']);_0x2b195d[_0xc294('0x36')]=_[_0xc294('0x34')](_0x24b50e['model'],qs[_0xc294('0x35')](_0x4d269e[_0xc294('0x31')][_0xc294('0x35')]));_0x2b195d[_0xc294('0x36')]=_0x2b195d[_0xc294('0x36')][_0xc294('0x37')]?_0x2b195d['attributes']:_0x24b50e['model'];_0x2b195d[_0xc294('0x3a')]=qs[_0xc294('0x3b')](_0x4d269e['query'][_0xc294('0x3b')]);_0x2b195d[_0xc294('0x3c')]=qs['filters'](_['pick'](_0x4d269e[_0xc294('0x31')],_0x24b50e['filters']));if(_0x4d269e['query'][_0xc294('0x3f')]){_0x2b195d['where']=_[_0xc294('0x40')](_0x2b195d[_0xc294('0x3c')],{'$or':_[_0xc294('0x2c')](_0x2b195d[_0xc294('0x36')],function(_0x228b58){var _0x4291da={};_0x4291da[_0x228b58]={'$like':'%'+_0x4d269e[_0xc294('0x31')][_0xc294('0x3f')]+'%'};return _0x4291da;})});}_0x2b195d=_[_0xc294('0x40')]({},_0x2b195d,_0x4d269e['options']);return _0x18efb6[_0xc294('0x117')](_0x2b195d);}})[_0xc294('0x11')](function(_0x2be65b){if(_0x2be65b){_0x1771bd=_0x2be65b[_0xc294('0x37')];if(!_0x4d269e[_0xc294('0x31')][_0xc294('0x38')](_0xc294('0x39'))){_0x2b195d[_0xc294('0x20')]=qs[_0xc294('0x20')](_0x4d269e[_0xc294('0x31')][_0xc294('0x20')]);_0x2b195d[_0xc294('0x22')]=qs[_0xc294('0x22')](_0x4d269e[_0xc294('0x31')]['offset']);}return _0x18efb6[_0xc294('0x117')](_0x2b195d);}})[_0xc294('0x11')](function(_0x216d2e){if(_0x216d2e){return _0x216d2e?{'count':_0x1771bd,'rows':_0x216d2e}:null;}})[_0xc294('0x11')](respondWithResult(_0x1079bd,null))['catch'](handleError(_0x1079bd,null));};exports[_0xc294('0x118')]=function(_0x553164,_0x4fd031){return db[_0xc294('0x119')][_0xc294('0x47')]({'where':{'id':_0x553164[_0xc294('0x46')]['id']}})[_0xc294('0x11')](handleEntityNotFound(_0x4fd031,null))[_0xc294('0x11')](function(_0x324aa7){if(_0x324aa7){return _0x324aa7[_0xc294('0x118')](_0x553164[_0xc294('0x49')]['ids'],_['omit'](_0x553164[_0xc294('0x49')],['ids','id'])||{});}})[_0xc294('0x11')](respondWithResult(_0x4fd031,null))[_0xc294('0x1c')](handleError(_0x4fd031,null));};exports[_0xc294('0xfc')]=function(_0x53e6b7,_0x5390e2){var _0x3b5e23={};var _0xdc7fb9={};var _0x51a0ff;var _0x3ae088;return db[_0xc294('0x2d')][_0xc294('0x56')]({'where':{'id':_0x53e6b7[_0xc294('0x46')]['id']}})['then'](handleEntityNotFound(_0x5390e2,null))[_0xc294('0x11')](function(_0x1147c1){if(_0x1147c1){_0x51a0ff=_0x1147c1;_0xdc7fb9[_0xc294('0x33')]=_[_0xc294('0x32')](db[_0xc294('0x11a')][_0xc294('0x2e')]);_0xdc7fb9[_0xc294('0x31')]=_[_0xc294('0x32')](_0x53e6b7[_0xc294('0x31')]);_0xdc7fb9['filters']=_[_0xc294('0x34')](_0xdc7fb9[_0xc294('0x33')],_0xdc7fb9['query']);_0x3b5e23[_0xc294('0x36')]=_[_0xc294('0x34')](_0xdc7fb9['model'],qs[_0xc294('0x35')](_0x53e6b7['query'][_0xc294('0x35')]));_0x3b5e23[_0xc294('0x36')]=_0x3b5e23['attributes'][_0xc294('0x37')]?_0x3b5e23[_0xc294('0x36')]:_0xdc7fb9[_0xc294('0x33')];_0x3b5e23['order']=qs['sort'](_0x53e6b7['query'][_0xc294('0x3b')]);_0x3b5e23[_0xc294('0x3c')]=qs[_0xc294('0x3d')](_['pick'](_0x53e6b7['query'],_0xdc7fb9['filters']));if(_0x53e6b7[_0xc294('0x31')]['filter']){_0x3b5e23[_0xc294('0x3c')]=_['merge'](_0x3b5e23[_0xc294('0x3c')],{'$or':_[_0xc294('0x2c')](_0x3b5e23[_0xc294('0x36')],function(_0x327101){var _0x2d8d3b={};_0x2d8d3b[_0x327101]={'$like':'%'+_0x53e6b7[_0xc294('0x31')][_0xc294('0x3f')]+'%'};return _0x2d8d3b;})});}_0x3b5e23=_[_0xc294('0x40')]({},_0x3b5e23,_0x53e6b7[_0xc294('0x41')]);return _0x51a0ff[_0xc294('0xfc')](_0x3b5e23);}})['then'](function(_0x4c0b95){if(_0x4c0b95){_0x3ae088=_0x4c0b95['length'];if(!_0x53e6b7['query'][_0xc294('0x38')](_0xc294('0x39'))){_0x3b5e23[_0xc294('0x20')]=qs['limit'](_0x53e6b7[_0xc294('0x31')][_0xc294('0x20')]);_0x3b5e23[_0xc294('0x22')]=qs['offset'](_0x53e6b7[_0xc294('0x31')][_0xc294('0x22')]);}return _0x51a0ff[_0xc294('0xfc')](_0x3b5e23);}})[_0xc294('0x11')](function(_0x79fcfa){if(_0x79fcfa){return _0x79fcfa?{'count':_0x3ae088,'rows':_0x79fcfa}:null;}})[_0xc294('0x11')](respondWithResult(_0x5390e2,null))[_0xc294('0x1c')](handleError(_0x5390e2,null));};exports['getFields']=function(_0x5158d3,_0x20c70c){var _0x369eab=_0x5158d3['query'][_0xc294('0x11b')]===_0xc294('0x11c')?_0xc294('0x11d'):_0xc294('0x11e');return db[_0xc294('0x2d')][_0xc294('0x47')]({'attributes':['id',_0x369eab],'where':{'id':_0x5158d3[_0xc294('0x46')]['id']}})[_0xc294('0x11')](handleEntityNotFound(_0x20c70c,null))[_0xc294('0x11')](function(_0x3ee98c){if(_0x3ee98c){var _0x4d1ae6=_0x3ee98c[_0x369eab];var _0x26eed8=_0x4d1ae6&&_0x4d1ae6[_0xc294('0x11f')]?_0x4d1ae6[_0xc294('0x11f')]:[];_0x20c70c[_0xc294('0x29')]({'fromKey':_['isNil'](_0x4d1ae6[_0xc294('0x120')])?undefined:_0x4d1ae6[_0xc294('0x120')],'count':_0x26eed8['length'],'rows':_0x26eed8});}})['catch'](handleError(_0x20c70c,null));};exports[_0xc294('0x121')]=function(_0x33f499,_0x3691c7){var _0x140cdb={'raw':![],'where':{}};var _0x64286a={};var _0x91fd2a={'count':0x0,'rows':[]};return db[_0xc294('0x2d')][_0xc294('0x56')]({'where':{'id':_0x33f499[_0xc294('0x46')]['id']}})[_0xc294('0x11')](handleEntityNotFound(_0x3691c7,null))[_0xc294('0x11')](function(_0x4c9796){if(_0x4c9796){_0x64286a[_0xc294('0x33')]=_[_0xc294('0x32')](db[_0xc294('0xc9')][_0xc294('0x2e')]);_0x64286a[_0xc294('0x31')]=_['keys'](_0x33f499[_0xc294('0x31')]);_0x64286a[_0xc294('0x3d')]=_[_0xc294('0x34')](_0x64286a[_0xc294('0x33')],_0x64286a[_0xc294('0x31')]);_0x140cdb[_0xc294('0x36')]=_[_0xc294('0x34')](_0x64286a['model'],qs[_0xc294('0x35')](_0x33f499[_0xc294('0x31')]['fields']));_0x140cdb[_0xc294('0x36')]=_0x140cdb['attributes']['length']?_0x140cdb[_0xc294('0x36')]:_0x64286a['model'];if(!_0x33f499[_0xc294('0x31')][_0xc294('0x38')](_0xc294('0x39'))){_0x140cdb[_0xc294('0x20')]=qs[_0xc294('0x20')](_0x33f499[_0xc294('0x31')][_0xc294('0x20')]);_0x140cdb[_0xc294('0x22')]=qs[_0xc294('0x22')](_0x33f499[_0xc294('0x31')][_0xc294('0x22')]);}_0x140cdb[_0xc294('0x3a')]=qs[_0xc294('0x3b')](_0x33f499[_0xc294('0x31')][_0xc294('0x3b')]);_0x140cdb[_0xc294('0x3c')]=qs[_0xc294('0x3d')](_['pick'](_0x33f499[_0xc294('0x31')],_0x64286a[_0xc294('0x3d')]));_0x140cdb[_0xc294('0x3c')]['ChatWebsiteId']=_0x4c9796['id'];if(_0x33f499[_0xc294('0x31')][_0xc294('0x3f')]){_0x140cdb[_0xc294('0x3c')]=_['merge'](_0x140cdb[_0xc294('0x3c')],{'$or':_['map'](_0x140cdb['attributes'],function(_0x19fd75){var _0x30d503={};_0x30d503[_0x19fd75]={'$like':'%'+_0x33f499[_0xc294('0x31')]['filter']+'%'};return _0x30d503;})});}_0x140cdb=_['merge']({},_0x140cdb,_0x33f499[_0xc294('0x41')]);return db[_0xc294('0xc9')][_0xc294('0x21')]({'where':_0x140cdb['where']})['then'](function(_0x2be629){_0x91fd2a[_0xc294('0x21')]=_0x2be629;if(_0x33f499[_0xc294('0x31')][_0xc294('0xe8')]){_0x140cdb[_0xc294('0x42')]=[{'all':!![]}];}else{_0x140cdb[_0xc294('0x42')]=[{'model':db[_0xc294('0x7b')],'as':_0xc294('0xe9'),'required':![]},{'model':db['Attachment'],'as':_0xc294('0x122'),'required':![]}];}return db[_0xc294('0xc9')][_0xc294('0x43')](_0x140cdb);})[_0xc294('0x11')](function(_0x39b43f){_0x91fd2a['rows']=_0x39b43f;return _0x91fd2a;});}})['then'](respondWithFilteredResult(_0x3691c7,_0x140cdb))[_0xc294('0x1c')](handleError(_0x3691c7,null));};exports[_0xc294('0x123')]=function(_0x5f2a1f,_0x1e7821){return db[_0xc294('0x2d')][_0xc294('0x47')]({'where':{'id':_0x5f2a1f[_0xc294('0x46')]['id']}})[_0xc294('0x11')](handleEntityNotFound(_0x1e7821,null))[_0xc294('0x11')](function(_0x388801){if(_0x388801){return _0x388801[_0xc294('0x123')](_0x5f2a1f[_0xc294('0x49')][_0xc294('0x58')],_['omit'](_0x5f2a1f['body'],[_0xc294('0x58'),'id'])||{})[_0xc294('0xab')](function(_0x28a190){for(var _0x534308=0x0;_0x534308<_0x5f2a1f[_0xc294('0x49')][_0xc294('0x58')][_0xc294('0x37')];_0x534308+=0x1){socket[_0xc294('0x124')](_0xc294('0x125'),{'UserId':Number(_0x5f2a1f[_0xc294('0x49')][_0xc294('0x58')][_0x534308]),'ChatWebsiteId':Number(_0x5f2a1f['params']['id'])});}return _0x28a190;});}})[_0xc294('0x11')](respondWithResult(_0x1e7821,null))['catch'](handleError(_0x1e7821,null));};exports[_0xc294('0x126')]=function(_0x4a739d,_0x446f36){return db[_0xc294('0x2d')][_0xc294('0x47')]({'where':{'id':_0x4a739d[_0xc294('0x46')]['id']}})['then'](handleEntityNotFound(_0x446f36,null))[_0xc294('0x11')](function(_0x348afc){if(_0x348afc){return _0x348afc['removeAgents'](_0x4a739d['query']['ids'])[_0xc294('0x11')](function(){if(_['isArray'](_0x4a739d[_0xc294('0x31')][_0xc294('0x58')])){for(var _0x515e56=0x0;_0x515e56<_0x4a739d[_0xc294('0x31')][_0xc294('0x58')][_0xc294('0x37')];_0x515e56+=0x1){socket['emit'](_0xc294('0x127'),{'UserId':Number(_0x4a739d[_0xc294('0x31')][_0xc294('0x58')][_0x515e56]),'ChatWebsiteId':Number(_0x4a739d[_0xc294('0x46')]['id'])});}}else{socket[_0xc294('0x124')]('userChatWebsite:remove',{'UserId':Number(_0x4a739d[_0xc294('0x31')][_0xc294('0x58')]),'ChatWebsiteId':Number(_0x4a739d[_0xc294('0x46')]['id'])});}});}})[_0xc294('0x11')](respondWithStatusCode(_0x446f36,null))[_0xc294('0x1c')](handleError(_0x446f36,null));};exports[_0xc294('0x128')]=function(_0x59d22a,_0x231c63){var _0xe6853c={};var _0xefaec5={};var _0xc936d4;var _0x36d735;return db[_0xc294('0x2d')][_0xc294('0x56')]({'where':{'id':_0x59d22a[_0xc294('0x46')]['id']}})[_0xc294('0x11')](handleEntityNotFound(_0x231c63,null))[_0xc294('0x11')](function(_0x209aa7){if(_0x209aa7){_0xc936d4=_0x209aa7;_0xefaec5[_0xc294('0x33')]=_[_0xc294('0x32')](db[_0xc294('0xb7')]['rawAttributes']);_0xefaec5[_0xc294('0x31')]=_[_0xc294('0x32')](_0x59d22a[_0xc294('0x31')]);_0xefaec5[_0xc294('0x3d')]=_['intersection'](_0xefaec5[_0xc294('0x33')],_0xefaec5[_0xc294('0x31')]);_0xe6853c[_0xc294('0x36')]=_[_0xc294('0x34')](_0xefaec5[_0xc294('0x33')],qs[_0xc294('0x35')](_0x59d22a['query'][_0xc294('0x35')]));_0xe6853c[_0xc294('0x36')]=_0xe6853c[_0xc294('0x36')][_0xc294('0x37')]?_0xe6853c['attributes']:_0xefaec5['model'];_0xe6853c[_0xc294('0x3a')]=qs[_0xc294('0x3b')](_0x59d22a[_0xc294('0x31')][_0xc294('0x3b')]);_0xe6853c['where']=qs[_0xc294('0x3d')](_[_0xc294('0x3e')](_0x59d22a[_0xc294('0x31')],_0xefaec5[_0xc294('0x3d')]));if(_0x59d22a[_0xc294('0x31')]['filter']){_0xe6853c[_0xc294('0x3c')]=_['merge'](_0xe6853c[_0xc294('0x3c')],{'$or':_[_0xc294('0x2c')](_0xe6853c[_0xc294('0x36')],function(_0x57bff8){var _0x262bb4={};_0x262bb4[_0x57bff8]={'$like':'%'+_0x59d22a[_0xc294('0x31')][_0xc294('0x3f')]+'%'};return _0x262bb4;})});}_0xe6853c=_['merge']({},_0xe6853c,_0x59d22a[_0xc294('0x41')]);return _0xc936d4[_0xc294('0x128')](_0xe6853c);}})[_0xc294('0x11')](function(_0x15782b){if(_0x15782b){_0x36d735=_0x15782b[_0xc294('0x37')];if(!_0x59d22a[_0xc294('0x31')][_0xc294('0x38')](_0xc294('0x39'))){_0xe6853c[_0xc294('0x20')]=qs[_0xc294('0x20')](_0x59d22a[_0xc294('0x31')][_0xc294('0x20')]);_0xe6853c['offset']=qs[_0xc294('0x22')](_0x59d22a[_0xc294('0x31')][_0xc294('0x22')]);}return _0xc936d4[_0xc294('0x128')](_0xe6853c);}})[_0xc294('0x11')](function(_0x5e7fbe){if(_0x5e7fbe){return _0x5e7fbe?{'count':_0x36d735,'rows':_0x5e7fbe}:null;}})[_0xc294('0x11')](respondWithResult(_0x231c63,null))[_0xc294('0x1c')](handleError(_0x231c63,null));};
\ No newline at end of file
+var _0x125e=['virtual','replace','render','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','offlineForm','onlineForm','items','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','ChatWebsite,\x20%s,\x20%s','catch','sendStatus','status','json','undefined','limit','offset','count','set','update','get','ChatWebsites','UserProfileResource','destroy','stack','name','send','Pause','mandatoryDispositionPause','rawAttributes','type','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','ChatWebsite','findAll','rows','params','includeAll','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','pick','ChatWebsiteId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addLogo','sitepic','filename','addAvatar','agentAvatar','addCustomerAvatar','file','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','../../config/license/util','custom','root','download','getAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','isNil','existsSync','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent','getResult','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','Applications','account','applications','list','orderBy','priority','customerIp','headers','cf-connecting-ip','first','x-forwarded-for','split','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','interaction','ChatInteraction','spread','contact','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','EventManager','offline','files','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','defaults','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','mimetype','server','attachments','basename','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','Smtp','CloudProvider','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','firstName','email','Chat','NotifyMailAccount','notifyMail','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','hasOwnProperty','Contact','User','Owner','fullname','internal','Tag','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','inspect','No\x20timezone','Interval','Intervals','getProactiveActions','getLicense','increment','chatLicenseExceeded','some','server/files/chat/iframe.ejs','stringify','x-real-ip','connection'];(function(_0x9b900e,_0x4ea9bf){var _0xef1de6=function(_0x86c222){while(--_0x86c222){_0x9b900e['push'](_0x9b900e['shift']());}};_0xef1de6(++_0x4ea9bf);}(_0x125e,0x148));var _0xe125=function(_0x548627,_0x4ec392){_0x548627=_0x548627-0x0;var _0x844a84=_0x125e[_0x548627];return _0x844a84;};'use strict';var BPromise=require(_0xe125('0x0'));var Mustache=require(_0xe125('0x1'));var util=require(_0xe125('0x2'));var path=require(_0xe125('0x3'));var ejs=require(_0xe125('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var querystring=require(_0xe125('0x5'));var Redis=require(_0xe125('0x6'));var qs=require(_0xe125('0x7'));var logger=require(_0xe125('0x8'))(_0xe125('0x9'));var config=require(_0xe125('0xa'));var db=require(_0xe125('0xb'))['db'];config['redis']=_['defaults'](config[_0xe125('0xc')],{'host':_0xe125('0xd'),'port':0x18eb});var socket=require(_0xe125('0xe'))(new Redis(config['redis']));require(_0xe125('0xf'))[_0xe125('0x10')](socket);var htmlToText=require(_0xe125('0x11'));var jayson=require(_0xe125('0x12'));var client=jayson[_0xe125('0x13')]['http']({'port':0x232c});var client9002=jayson[_0xe125('0x13')]['http']({'port':0x232a});var client9003=jayson[_0xe125('0x13')]['http']({'port':0x232b});var client9001=jayson[_0xe125('0x13')][_0xe125('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x327edf,_0x1da5be,_0x56427a,_0x3d3571){return new BPromise(function(_0x3c592e,_0x16ff15){var _0x51d5df=_0x3d3571||client;return _0x51d5df[_0xe125('0x15')](_0x327edf,_0x56427a)[_0xe125('0x16')](function(_0x53c941){logger[_0xe125('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x1da5be,'request\x20sent');logger['debug'](_0xe125('0x18'),_0x1da5be,_0xe125('0x19'),JSON['stringify'](_0x53c941));if(_0x53c941[_0xe125('0x1a')]){if(_0x53c941[_0xe125('0x1a')][_0xe125('0x1b')]===0x1f4){logger[_0xe125('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0x1da5be,_0x53c941['error']['message']);return _0x16ff15(_0x53c941[_0xe125('0x1a')][_0xe125('0x1c')]);}logger[_0xe125('0x1a')](_0xe125('0x1d'),_0x1da5be,_0x53c941[_0xe125('0x1a')][_0xe125('0x1c')]);return _0x3c592e(_0x53c941[_0xe125('0x1a')][_0xe125('0x1c')]);}else{logger[_0xe125('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x1da5be,_0xe125('0x19'));_0x3c592e(_0x53c941['result']['message']);}})[_0xe125('0x1e')](function(_0xe2f99b){logger[_0xe125('0x1a')](_0xe125('0x1d'),_0x1da5be,_0xe2f99b);_0x16ff15(_0xe2f99b);});});}function respondWithStatusCode(_0x2a32d6,_0x4fa05b){_0x4fa05b=_0x4fa05b||0xcc;return function(_0x4f3637){if(_0x4f3637){return _0x2a32d6[_0xe125('0x1f')](_0x4fa05b);}return _0x2a32d6[_0xe125('0x20')](_0x4fa05b)['end']();};}function respondWithResult(_0x4de5cb,_0xf240c1){_0xf240c1=_0xf240c1||0xc8;return function(_0x3d22d8){if(_0x3d22d8){return _0x4de5cb['status'](_0xf240c1)[_0xe125('0x21')](_0x3d22d8);}};}function respondWithFilteredResult(_0x4c15b1,_0x191abc){return function(_0x15bb3a){if(_0x15bb3a){var _0xcf4bfc=typeof _0x191abc['offset']===_0xe125('0x22')&&typeof _0x191abc[_0xe125('0x23')]===_0xe125('0x22');var _0x1ad579=_0x15bb3a['count'];var _0x40c492=_0xcf4bfc?0x0:_0x191abc[_0xe125('0x24')];var _0x5432cf=_0xcf4bfc?_0x15bb3a[_0xe125('0x25')]:_0x191abc[_0xe125('0x24')]+_0x191abc[_0xe125('0x23')];var _0x315e06;if(_0x5432cf>=_0x1ad579){_0x5432cf=_0x1ad579;_0x315e06=0xc8;}else{_0x315e06=0xce;}_0x4c15b1[_0xe125('0x20')](_0x315e06);return _0x4c15b1[_0xe125('0x26')]('Content-Range',_0x40c492+'-'+_0x5432cf+'/'+_0x1ad579)[_0xe125('0x21')](_0x15bb3a);}return null;};}function saveUpdates(_0x511a35){return function(_0x239338){if(_0x239338){return _0x239338[_0xe125('0x27')](_0x511a35)[_0xe125('0x16')](function(_0x17faac){return _0x17faac;});}return null;};}function removeEntity(_0x11fbbc){return function(_0x5a70b0){if(_0x5a70b0){return _0x5a70b0['destroy']()[_0xe125('0x16')](function(){var _0x27f7ed=_0x5a70b0[_0xe125('0x28')]({'plain':!![]});var _0x413ed2=_0xe125('0x29');return db[_0xe125('0x2a')][_0xe125('0x2b')]({'where':{'type':_0x413ed2,'resourceId':_0x27f7ed['id']}})[_0xe125('0x16')](function(){return _0x5a70b0;});})[_0xe125('0x16')](function(){_0x11fbbc[_0xe125('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x124880){return function(_0x2cc1a3){if(!_0x2cc1a3){_0x124880[_0xe125('0x1f')](0x194);}return _0x2cc1a3;};}function handleError(_0x597324,_0x1ced0f){_0x1ced0f=_0x1ced0f||0x1f4;return function(_0x59ecc8){logger[_0xe125('0x1a')](_0x59ecc8[_0xe125('0x2c')]);if(_0x59ecc8[_0xe125('0x2d')]){delete _0x59ecc8['name'];}_0x597324[_0xe125('0x20')](_0x1ced0f)[_0xe125('0x2e')](_0x59ecc8);};}exports['index']=function(_0x4d5d33,_0x338636){var _0x5eaa9b={'include':[{'model':db[_0xe125('0x2f')],'as':_0xe125('0x30')}]},_0x433cc7={},_0x474305={'count':0x0,'rows':[]};var _0x3d4fe0=_['map'](db['ChatWebsite'][_0xe125('0x31')],function(_0x164b95){return{'name':_0x164b95['fieldName'],'type':_0x164b95[_0xe125('0x32')]['key']};});_0x433cc7['model']=_[_0xe125('0x33')](_0x3d4fe0,_0xe125('0x2d'));_0x433cc7[_0xe125('0x34')]=_[_0xe125('0x35')](_0x4d5d33[_0xe125('0x34')]);_0x433cc7[_0xe125('0x36')]=_[_0xe125('0x37')](_0x433cc7[_0xe125('0x38')],_0x433cc7[_0xe125('0x34')]);_0x5eaa9b[_0xe125('0x39')]=_[_0xe125('0x37')](_0x433cc7[_0xe125('0x38')],qs['fields'](_0x4d5d33['query'][_0xe125('0x3a')]));_0x5eaa9b[_0xe125('0x39')]=_0x5eaa9b['attributes'][_0xe125('0x3b')]?_0x5eaa9b[_0xe125('0x39')]:_0x433cc7[_0xe125('0x38')];if(!_0x4d5d33[_0xe125('0x34')]['hasOwnProperty'](_0xe125('0x3c'))){_0x5eaa9b[_0xe125('0x23')]=qs['limit'](_0x4d5d33[_0xe125('0x34')]['limit']);_0x5eaa9b[_0xe125('0x24')]=qs['offset'](_0x4d5d33[_0xe125('0x34')][_0xe125('0x24')]);}_0x5eaa9b[_0xe125('0x3d')]=qs[_0xe125('0x3e')](_0x4d5d33['query'][_0xe125('0x3e')]);_0x5eaa9b[_0xe125('0x3f')]=qs[_0xe125('0x36')](_['pick'](_0x4d5d33[_0xe125('0x34')],_0x433cc7['filters']),_0x3d4fe0);if(_0x4d5d33[_0xe125('0x34')][_0xe125('0x40')]){_0x5eaa9b['where']=_[_0xe125('0x41')](_0x5eaa9b[_0xe125('0x3f')],{'$or':_[_0xe125('0x33')](_0x3d4fe0,function(_0x41105b){if(_0x41105b[_0xe125('0x32')]!==_0xe125('0x42')){var _0x5a2d40={};_0x5a2d40[_0x41105b[_0xe125('0x2d')]]={'$like':'%'+_0x4d5d33[_0xe125('0x34')][_0xe125('0x40')]+'%'};return _0x5a2d40;}})});}_0x5eaa9b=_[_0xe125('0x41')]({},_0x5eaa9b,_0x4d5d33[_0xe125('0x43')]);var _0x5bc3ca={'where':_0x5eaa9b[_0xe125('0x3f')]};return db['ChatWebsite'][_0xe125('0x25')](_0x5bc3ca)[_0xe125('0x16')](function(_0x35a984){_0x474305[_0xe125('0x25')]=_0x35a984;if(_0x4d5d33[_0xe125('0x34')]['includeAll']){_0x5eaa9b['include']=[{'all':!![]}];}return db[_0xe125('0x44')][_0xe125('0x45')](_0x5eaa9b);})[_0xe125('0x16')](function(_0xd3ec8b){_0x474305[_0xe125('0x46')]=_0xd3ec8b;return _0x474305;})[_0xe125('0x16')](respondWithFilteredResult(_0x338636,_0x5eaa9b))[_0xe125('0x1e')](handleError(_0x338636,null));};exports['show']=function(_0x50c49b,_0x27f069){var _0x372af0={'raw':![],'where':{'id':_0x50c49b[_0xe125('0x47')]['id']},'include':[{'model':db['Pause'],'as':_0xe125('0x30')}]},_0x43f4e3={};_0x43f4e3[_0xe125('0x38')]=_[_0xe125('0x35')](db[_0xe125('0x44')][_0xe125('0x31')]);_0x43f4e3[_0xe125('0x34')]=_['keys'](_0x50c49b[_0xe125('0x34')]);_0x43f4e3['filters']=_[_0xe125('0x37')](_0x43f4e3['model'],_0x43f4e3[_0xe125('0x34')]);_0x372af0[_0xe125('0x39')]=_[_0xe125('0x37')](_0x43f4e3[_0xe125('0x38')],qs[_0xe125('0x3a')](_0x50c49b['query'][_0xe125('0x3a')]));_0x372af0['attributes']=_0x372af0[_0xe125('0x39')][_0xe125('0x3b')]?_0x372af0[_0xe125('0x39')]:_0x43f4e3[_0xe125('0x38')];if(_0x50c49b[_0xe125('0x34')][_0xe125('0x48')]){_0x372af0[_0xe125('0x49')]=[{'all':!![]}];}_0x372af0=_[_0xe125('0x41')]({},_0x372af0,_0x50c49b[_0xe125('0x43')]);return db[_0xe125('0x44')]['find'](_0x372af0)[_0xe125('0x16')](handleEntityNotFound(_0x27f069,null))['then'](respondWithResult(_0x27f069,null))['catch'](handleError(_0x27f069,null));};exports[_0xe125('0x4a')]=function(_0x4ad8e8,_0x3fdc6f){return db[_0xe125('0x44')]['create'](_0x4ad8e8[_0xe125('0x4b')],{})[_0xe125('0x16')](function(_0x10774c){var _0x3c2c18=_0x4ad8e8['user'][_0xe125('0x28')]({'plain':!![]});if(!_0x3c2c18)throw new Error(_0xe125('0x4c'));if(_0x3c2c18[_0xe125('0x4d')]===_0xe125('0x4e')){var _0xcae224=_0x10774c[_0xe125('0x28')]({'plain':!![]});var _0x4c2037=_0xe125('0x29');return db['UserProfileSection'][_0xe125('0x4f')]({'where':{'name':_0x4c2037,'userProfileId':_0x3c2c18['userProfileId']},'raw':!![]})[_0xe125('0x16')](function(_0x2d996f){if(_0x2d996f&&_0x2d996f[_0xe125('0x50')]===0x0){return db[_0xe125('0x2a')][_0xe125('0x4a')]({'name':_0xcae224[_0xe125('0x2d')],'resourceId':_0xcae224['id'],'type':_0x2d996f[_0xe125('0x2d')],'sectionId':_0x2d996f['id']},{})[_0xe125('0x16')](function(){return _0x10774c;});}else{return _0x10774c;}})[_0xe125('0x1e')](function(_0x25d162){logger['error'](_0xe125('0x51'),_0x25d162);throw _0x25d162;});}return _0x10774c;})[_0xe125('0x16')](respondWithResult(_0x3fdc6f,0xc9))[_0xe125('0x1e')](handleError(_0x3fdc6f,null));};exports['update']=function(_0x4276ee,_0x5812c7){if(_0x4276ee[_0xe125('0x4b')]['id']){delete _0x4276ee[_0xe125('0x4b')]['id'];}return db[_0xe125('0x44')][_0xe125('0x4f')]({'where':{'id':_0x4276ee[_0xe125('0x47')]['id']},'include':[{'model':db[_0xe125('0x2f')],'as':_0xe125('0x30')}]})[_0xe125('0x16')](handleEntityNotFound(_0x5812c7,null))[_0xe125('0x16')](saveUpdates(_0x4276ee[_0xe125('0x4b')],null))[_0xe125('0x16')](respondWithResult(_0x5812c7,null))[_0xe125('0x1e')](handleError(_0x5812c7,null));};exports['destroy']=function(_0x597f28,_0x2da802){return db[_0xe125('0x44')][_0xe125('0x4f')]({'where':{'id':_0x597f28[_0xe125('0x47')]['id']}})[_0xe125('0x16')](handleEntityNotFound(_0x2da802,null))['then'](removeEntity(_0x2da802,null))[_0xe125('0x1e')](handleError(_0x2da802,null));};exports['describe']=function(_0x5d5262,_0x25a449){return db['ChatWebsite'][_0xe125('0x52')]()[_0xe125('0x16')](respondWithResult(_0x25a449,null))[_0xe125('0x1e')](handleError(_0x25a449,null));};exports[_0xe125('0x53')]=function(_0x3ce0b1,_0x45b974){if(_0x3ce0b1['body']['id']){delete _0x3ce0b1[_0xe125('0x4b')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x3ce0b1[_0xe125('0x47')]['id']}})[_0xe125('0x16')](handleEntityNotFound(_0x45b974,null))[_0xe125('0x16')](function(_0x377cf4){if(_0x377cf4){_0x3ce0b1['body']['ChatWebsiteId']=_0x377cf4['id'];return db[_0xe125('0x54')][_0xe125('0x4a')](_0x3ce0b1[_0xe125('0x4b')]);}})['then'](respondWithResult(_0x45b974,null))[_0xe125('0x1e')](handleError(_0x45b974,null));};exports[_0xe125('0x55')]=function(_0x2fc413,_0x31eac8){var _0x3f9985={'raw':![],'where':{}};var _0x4357a0={};var _0x33cb3e={'count':0x0,'rows':[]};return db[_0xe125('0x44')]['findOne']({'where':{'id':_0x2fc413[_0xe125('0x47')]['id']}})[_0xe125('0x16')](handleEntityNotFound(_0x31eac8,null))[_0xe125('0x16')](function(_0x56ea1f){if(_0x56ea1f){_0x4357a0[_0xe125('0x38')]=_[_0xe125('0x35')](db[_0xe125('0x54')][_0xe125('0x31')]);_0x4357a0[_0xe125('0x34')]=_[_0xe125('0x35')](_0x2fc413['query']);_0x4357a0['filters']=_['intersection'](_0x4357a0[_0xe125('0x38')],_0x4357a0[_0xe125('0x34')]);_0x3f9985[_0xe125('0x39')]=_[_0xe125('0x37')](_0x4357a0[_0xe125('0x38')],qs[_0xe125('0x3a')](_0x2fc413[_0xe125('0x34')]['fields']));_0x3f9985[_0xe125('0x39')]=_0x3f9985[_0xe125('0x39')][_0xe125('0x3b')]?_0x3f9985[_0xe125('0x39')]:_0x4357a0['model'];if(!_0x2fc413[_0xe125('0x34')]['hasOwnProperty'](_0xe125('0x3c'))){_0x3f9985[_0xe125('0x23')]=qs[_0xe125('0x23')](_0x2fc413[_0xe125('0x34')][_0xe125('0x23')]);_0x3f9985[_0xe125('0x24')]=qs[_0xe125('0x24')](_0x2fc413['query'][_0xe125('0x24')]);}_0x3f9985['order']=qs[_0xe125('0x3e')](_0x2fc413['query'][_0xe125('0x3e')]);_0x3f9985[_0xe125('0x3f')]=qs[_0xe125('0x36')](_[_0xe125('0x56')](_0x2fc413[_0xe125('0x34')],_0x4357a0['filters']));_0x3f9985[_0xe125('0x3f')][_0xe125('0x57')]=_0x56ea1f['id'];if(_0x2fc413['query'][_0xe125('0x40')]){_0x3f9985[_0xe125('0x3f')]=_[_0xe125('0x41')](_0x3f9985[_0xe125('0x3f')],{'$or':_[_0xe125('0x33')](_0x3f9985[_0xe125('0x39')],function(_0x5073d3){var _0x5e2f88={};_0x5e2f88[_0x5073d3]={'$like':'%'+_0x2fc413[_0xe125('0x34')][_0xe125('0x40')]+'%'};return _0x5e2f88;})});}_0x3f9985=_['merge']({},_0x3f9985,_0x2fc413['options']);return db['Disposition'][_0xe125('0x25')]({'where':_0x3f9985[_0xe125('0x3f')]})[_0xe125('0x16')](function(_0x38ecd5){_0x33cb3e['count']=_0x38ecd5;if(_0x2fc413[_0xe125('0x34')][_0xe125('0x48')]){_0x3f9985['include']=[{'all':!![]}];}return db[_0xe125('0x54')][_0xe125('0x45')](_0x3f9985);})[_0xe125('0x16')](function(_0x53184c){_0x33cb3e[_0xe125('0x46')]=_0x53184c;return _0x33cb3e;});}})[_0xe125('0x16')](respondWithFilteredResult(_0x31eac8,_0x3f9985))[_0xe125('0x1e')](handleError(_0x31eac8,null));};exports[_0xe125('0x58')]=function(_0x1ec578,_0x5b333e){return db[_0xe125('0x44')]['find']({'where':{'id':_0x1ec578[_0xe125('0x47')]['id']}})[_0xe125('0x16')](handleEntityNotFound(_0x5b333e,null))['then'](function(_0x3eaf89){if(_0x3eaf89){return _0x3eaf89['removeDispositions'](_0x1ec578[_0xe125('0x34')][_0xe125('0x59')]);}})[_0xe125('0x16')](respondWithStatusCode(_0x5b333e,null))[_0xe125('0x1e')](handleError(_0x5b333e,null));};exports[_0xe125('0x5a')]=function(_0xdf7bdd,_0x1436b2){if(_0xdf7bdd['body']['id']){delete _0xdf7bdd[_0xe125('0x4b')]['id'];}return db[_0xe125('0x44')]['find']({'where':{'id':_0xdf7bdd['params']['id']}})[_0xe125('0x16')](handleEntityNotFound(_0x1436b2,null))['then'](function(_0x46ea6e){if(_0x46ea6e){_0xdf7bdd[_0xe125('0x4b')][_0xe125('0x57')]=_0x46ea6e['id'];return db[_0xe125('0x5b')][_0xe125('0x4a')](_0xdf7bdd[_0xe125('0x4b')]);}})[_0xe125('0x16')](respondWithResult(_0x1436b2,null))[_0xe125('0x1e')](handleError(_0x1436b2,null));};exports[_0xe125('0x5c')]=function(_0x154492,_0x2e4247){var _0x47aa44={'raw':![],'where':{}};var _0x4cabbb={};var _0x44494d={'count':0x0,'rows':[]};return db[_0xe125('0x44')][_0xe125('0x5d')]({'where':{'id':_0x154492[_0xe125('0x47')]['id']}})[_0xe125('0x16')](handleEntityNotFound(_0x2e4247,null))['then'](function(_0x32b97e){if(_0x32b97e){_0x4cabbb[_0xe125('0x38')]=_['keys'](db[_0xe125('0x5b')][_0xe125('0x31')]);_0x4cabbb['query']=_['keys'](_0x154492[_0xe125('0x34')]);_0x4cabbb[_0xe125('0x36')]=_[_0xe125('0x37')](_0x4cabbb['model'],_0x4cabbb[_0xe125('0x34')]);_0x47aa44['attributes']=_[_0xe125('0x37')](_0x4cabbb[_0xe125('0x38')],qs[_0xe125('0x3a')](_0x154492['query']['fields']));_0x47aa44[_0xe125('0x39')]=_0x47aa44[_0xe125('0x39')][_0xe125('0x3b')]?_0x47aa44['attributes']:_0x4cabbb[_0xe125('0x38')];if(!_0x154492[_0xe125('0x34')]['hasOwnProperty'](_0xe125('0x3c'))){_0x47aa44[_0xe125('0x23')]=qs[_0xe125('0x23')](_0x154492[_0xe125('0x34')][_0xe125('0x23')]);_0x47aa44['offset']=qs[_0xe125('0x24')](_0x154492[_0xe125('0x34')][_0xe125('0x24')]);}_0x47aa44[_0xe125('0x3d')]=qs[_0xe125('0x3e')](_0x154492[_0xe125('0x34')][_0xe125('0x3e')]);_0x47aa44[_0xe125('0x3f')]=qs[_0xe125('0x36')](_['pick'](_0x154492[_0xe125('0x34')],_0x4cabbb[_0xe125('0x36')]));_0x47aa44[_0xe125('0x3f')]['ChatWebsiteId']=_0x32b97e['id'];if(_0x154492[_0xe125('0x34')][_0xe125('0x40')]){_0x47aa44[_0xe125('0x3f')]=_[_0xe125('0x41')](_0x47aa44[_0xe125('0x3f')],{'$or':_['map'](_0x47aa44[_0xe125('0x39')],function(_0x3ef9af){var _0x46e476={};_0x46e476[_0x3ef9af]={'$like':'%'+_0x154492[_0xe125('0x34')][_0xe125('0x40')]+'%'};return _0x46e476;})});}_0x47aa44=_[_0xe125('0x41')]({},_0x47aa44,_0x154492[_0xe125('0x43')]);return db[_0xe125('0x5b')][_0xe125('0x25')]({'where':_0x47aa44[_0xe125('0x3f')]})['then'](function(_0x3c6d6a){_0x44494d[_0xe125('0x25')]=_0x3c6d6a;if(_0x154492['query']['includeAll']){_0x47aa44[_0xe125('0x49')]=[{'all':!![]}];}return db['CannedAnswer'][_0xe125('0x45')](_0x47aa44);})['then'](function(_0x3775bc){_0x44494d[_0xe125('0x46')]=_0x3775bc;return _0x44494d;});}})[_0xe125('0x16')](respondWithFilteredResult(_0x2e4247,_0x47aa44))[_0xe125('0x1e')](handleError(_0x2e4247,null));};exports[_0xe125('0x5e')]=function(_0x5142b7,_0x2d39a0){return db[_0xe125('0x44')]['find']({'where':{'id':_0x5142b7[_0xe125('0x47')]['id']}})['then'](handleEntityNotFound(_0x2d39a0,null))[_0xe125('0x16')](function(_0x3c83bd){if(_0x3c83bd){return _0x3c83bd['removeAnswers'](_0x5142b7[_0xe125('0x34')]['ids']);}})[_0xe125('0x16')](respondWithStatusCode(_0x2d39a0,null))[_0xe125('0x1e')](handleError(_0x2d39a0,null));};exports[_0xe125('0x5f')]=function(_0x1a3cca,_0x1dfce8){_0x1a3cca[_0xe125('0x4b')][_0xe125('0x60')]=_0x1a3cca['file'][_0xe125('0x61')];return db[_0xe125('0x44')]['find']({'where':{'id':_0x1a3cca['params']['id']}})[_0xe125('0x16')](handleEntityNotFound(_0x1dfce8,null))[_0xe125('0x16')](saveUpdates(_0x1a3cca[_0xe125('0x4b')],null))[_0xe125('0x16')](respondWithResult(_0x1dfce8,null))[_0xe125('0x1e')](handleError(_0x1dfce8,null));};exports[_0xe125('0x62')]=function(_0x1ce70c,_0x48792c){_0x1ce70c[_0xe125('0x4b')][_0xe125('0x63')]=_0x1ce70c['file'][_0xe125('0x61')];return db[_0xe125('0x44')]['find']({'where':{'id':_0x1ce70c[_0xe125('0x47')]['id']}})[_0xe125('0x16')](handleEntityNotFound(_0x48792c,null))['then'](saveUpdates(_0x1ce70c[_0xe125('0x4b')],null))['then'](respondWithResult(_0x48792c,null))['catch'](handleError(_0x48792c,null));};exports[_0xe125('0x64')]=function(_0x500af0,_0x1f2526){_0x500af0[_0xe125('0x4b')]['customerAvatar']=_0x500af0[_0xe125('0x65')][_0xe125('0x61')];return db['ChatWebsite']['find']({'where':{'id':_0x500af0[_0xe125('0x47')]['id']}})[_0xe125('0x16')](handleEntityNotFound(_0x1f2526,null))['then'](saveUpdates(_0x500af0[_0xe125('0x4b')],null))[_0xe125('0x16')](respondWithResult(_0x1f2526,null))[_0xe125('0x1e')](handleError(_0x1f2526,null));};exports[_0xe125('0x66')]=function(_0x4b110d,_0x4d8e36){_0x4b110d[_0xe125('0x4b')][_0xe125('0x67')]=_0x4b110d[_0xe125('0x65')][_0xe125('0x61')];return db['ChatWebsite'][_0xe125('0x4f')]({'where':{'id':_0x4b110d[_0xe125('0x47')]['id']}})[_0xe125('0x16')](handleEntityNotFound(_0x4d8e36,null))[_0xe125('0x16')](saveUpdates(_0x4b110d['body'],null))['then'](respondWithResult(_0x4d8e36,null))[_0xe125('0x1e')](handleError(_0x4d8e36,null));};exports[_0xe125('0x68')]=function(_0x20400e,_0x4b405a){var _0x8ff345=path[_0xe125('0x69')](config['root'],_0xe125('0x6a'));var _0x3fc99e={'where':{'id':_0x20400e[_0xe125('0x47')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x53f48f=![];return require(_0xe125('0x6b'))['getLicense']()[_0xe125('0x16')](function(_0x12efbc){if(_0x12efbc){_0x53f48f=_0x12efbc[_0xe125('0x6c')];}})[_0xe125('0x16')](function(){return db[_0xe125('0x44')][_0xe125('0x4f')](_0x3fc99e);})[_0xe125('0x16')](handleEntityNotFound(_0x4b405a,null))[_0xe125('0x16')](function(_0x86df70){if(_0x86df70){if(!_['isNil'](_0x86df70[_0xe125('0x60')])){if(fs['existsSync'](path[_0xe125('0x69')](config['root'],'server/files/images/logos/',_0x86df70[_0xe125('0x60')]))&&_0x53f48f){_0x8ff345=path[_0xe125('0x69')](config[_0xe125('0x6d')],'server/files/images/logos/',_0x86df70[_0xe125('0x60')]);}}return _0x4b405a[_0xe125('0x6e')](_0x8ff345);}})[_0xe125('0x1e')](handleError(_0x4b405a,null));};exports[_0xe125('0x6f')]=function(_0xa883a6,_0x5aecc6){var _0x4127d7=path[_0xe125('0x69')](config[_0xe125('0x6d')],'server/files/images/avatars/default_avatar.png');var _0x421a93={'where':{'id':_0xa883a6['params']['id']},'attributes':['id',_0xe125('0x63')],'raw':!![]};return db[_0xe125('0x44')][_0xe125('0x4f')](_0x421a93)[_0xe125('0x16')](handleEntityNotFound(_0x5aecc6,null))[_0xe125('0x16')](function(_0x1c10e2){if(_0x1c10e2){if(!_['isNil'](_0x1c10e2[_0xe125('0x63')])){if(fs['existsSync'](path[_0xe125('0x69')](config[_0xe125('0x6d')],_0xe125('0x70'),_0x1c10e2[_0xe125('0x63')]))){_0x4127d7=path['join'](config[_0xe125('0x6d')],'server/files/images/avatars/',_0x1c10e2[_0xe125('0x63')]);}}return _0x5aecc6[_0xe125('0x6e')](_0x4127d7);}})[_0xe125('0x1e')](handleError(_0x5aecc6,null));};exports[_0xe125('0x71')]=function(_0x4168fe,_0x309d6c){var _0x2ca2f3=path[_0xe125('0x69')](config['root'],_0xe125('0x72'));var _0x153c90={'where':{'id':_0x4168fe[_0xe125('0x47')]['id']},'attributes':['id',_0xe125('0x73'),_0xe125('0x74')],'raw':!![]};return db[_0xe125('0x44')]['find'](_0x153c90)[_0xe125('0x16')](handleEntityNotFound(_0x309d6c,null))[_0xe125('0x16')](function(_0x3a184f){if(_0x3a184f){if(!_[_0xe125('0x75')](_0x3a184f[_0xe125('0x73')])){if(fs[_0xe125('0x76')](path[_0xe125('0x69')](config[_0xe125('0x6d')],_0xe125('0x70'),_0x3a184f['customerAvatar']))&&_0x3a184f[_0xe125('0x74')]){_0x2ca2f3=path[_0xe125('0x69')](config[_0xe125('0x6d')],_0xe125('0x70'),_0x3a184f[_0xe125('0x73')]);}}return _0x309d6c[_0xe125('0x6e')](_0x2ca2f3);}})[_0xe125('0x1e')](handleError(_0x309d6c,null));};exports[_0xe125('0x77')]=function(_0x14c52c,_0x56ed31){var _0x12c4a0=path[_0xe125('0x69')](config[_0xe125('0x6d')],_0xe125('0x78'));var _0x1a4a69={'where':{'id':_0x14c52c[_0xe125('0x47')]['id']},'attributes':['id',_0xe125('0x67')],'raw':!![]};return db['ChatWebsite'][_0xe125('0x4f')](_0x1a4a69)[_0xe125('0x16')](handleEntityNotFound(_0x56ed31,null))[_0xe125('0x16')](function(_0x3cbf43){if(_0x3cbf43){if(!_[_0xe125('0x75')](_0x3cbf43[_0xe125('0x67')])){if(fs[_0xe125('0x76')](path['join'](config[_0xe125('0x6d')],_0xe125('0x70'),_0x3cbf43[_0xe125('0x67')]))){_0x12c4a0=path[_0xe125('0x69')](config['root'],_0xe125('0x70'),_0x3cbf43[_0xe125('0x67')]);}}return _0x56ed31[_0xe125('0x6e')](_0x12c4a0);}})[_0xe125('0x1e')](handleError(_0x56ed31,null));};exports['notify']=function(_0x53853f,_0x3ed63e){var _0x640602=require('user-agent-parser');var _0x59a3f9=new _0x640602();var _0x5839aa=_0x59a3f9['setUA'](_0x53853f['headers'][_0xe125('0x79')])[_0xe125('0x7a')]();var _0x5514a9={'body':_0x53853f[_0xe125('0x4b')],'channel':'chat'};var _0x5bc352=[];var _0x771e09=[];var _0x437ae5={};var _0x2cc6fc=![];return db[_0xe125('0x7b')]['describe']()[_0xe125('0x16')](function(_0x2deb16){if(!_0x2deb16){throw new db[(_0xe125('0x7c'))]['ValidationError'](_0xe125('0x7d'));}_0x5bc352=_[_0xe125('0x7e')](_['keys'](_0x2deb16),[_0xe125('0x7f'),_0xe125('0x80')]);_0x771e09=_[_0xe125('0x7e')](_[_0xe125('0x35')](_0x2deb16),['createdAt',_0xe125('0x80'),_0xe125('0x81'),_0xe125('0x82')]);if(_0x53853f['body']['id']){delete _0x53853f[_0xe125('0x4b')]['id'];}if(_[_0xe125('0x75')](_0x53853f['body'][_0xe125('0x83')])){throw new db[(_0xe125('0x7c'))][(_0xe125('0x84'))]('from\x20is\x20mandatory');}if(_[_0xe125('0x75')](_0x53853f['body'][_0xe125('0x4b')])||_0x53853f[_0xe125('0x4b')][_0xe125('0x4b')]===''){throw new db[(_0xe125('0x7c'))][(_0xe125('0x84'))](_0xe125('0x85'));}if(_[_0xe125('0x75')](_0x53853f[_0xe125('0x4b')][_0xe125('0x86')])){throw new db['Sequelize'][(_0xe125('0x84'))](_0xe125('0x87')+_0x771e09);}if(!_[_0xe125('0x88')](_0x771e09,_0x53853f[_0xe125('0x4b')][_0xe125('0x86')])){throw new db[(_0xe125('0x7c'))][(_0xe125('0x84'))](_0xe125('0x89')+_0x771e09);}_0x437ae5[_0x53853f['body'][_0xe125('0x86')]]=_0x53853f[_0xe125('0x4b')][_0xe125('0x83')];})['then'](function(){return db['ChatWebsite'][_0xe125('0x4f')]({'where':{'id':_0x53853f['params']['id']},'include':[{'model':db[_0xe125('0x8a')],'as':_0xe125('0x8b'),'include':[{'model':db[_0xe125('0x7b')],'as':_0xe125('0x8c'),'where':_0x437ae5,'limit':0x1,'order':[[_0xe125('0x80'),_0xe125('0x8d')]]}]},{'model':db['ChatApplication'],'as':_0xe125('0x8e')}]});})['then'](handleEntityNotFound(_0x3ed63e,null))[_0xe125('0x16')](function(_0x24b8ed){if(_0x24b8ed&&_0x24b8ed[_0xe125('0x8b')]){_0x5514a9[_0xe125('0x8f')]=_0x24b8ed;_0x5514a9[_0xe125('0x90')]=_0x24b8ed[_0xe125('0x8e')];_0x5514a9[_0xe125('0x91')]=_0x24b8ed[_0xe125('0x8b')];_0x5514a9[_0xe125('0x90')]=_[_0xe125('0x92')](_0x5514a9[_0xe125('0x90')],[_0xe125('0x93')],['asc']);if(_0x5514a9['account'][_0xe125('0x8e')]){delete _0x5514a9['account']['Applications'];}if(_0x5514a9['account']['List']&&_0x5514a9[_0xe125('0x8f')][_0xe125('0x8b')][_0xe125('0x8c')][_0xe125('0x3b')]){return _0x5514a9[_0xe125('0x8f')][_0xe125('0x8b')][_0xe125('0x8c')][0x0];}var _0x32ba14=_['defaults'](_0x53853f[_0xe125('0x4b')],{'firstName':_0x53853f['body'][_0xe125('0x83')],'ListId':_0x24b8ed[_0xe125('0x82')]});_0x32ba14[_0x53853f[_0xe125('0x4b')]['mapKey']]=_0x53853f[_0xe125('0x4b')][_0xe125('0x83')];return db[_0xe125('0x7b')][_0xe125('0x4a')](_0x32ba14,{'fields':_0x5bc352,'raw':!![]});}})[_0xe125('0x16')](handleEntityNotFound(_0x3ed63e,null))[_0xe125('0x16')](function(_0x3013fb){_0x5514a9['contact']=_0x3013fb;var _0x34bb0d=_0x53853f[_0xe125('0x4b')][_0xe125('0x94')];if(_0x53853f[_0xe125('0x95')][_0xe125('0x96')]){_0x34bb0d=_0x53853f['headers'][_0xe125('0x96')];}else if(_0x53853f[_0xe125('0x95')]['x-forwarded-for']){_0x34bb0d=_[_0xe125('0x97')](_0x53853f[_0xe125('0x95')][_0xe125('0x98')][_0xe125('0x99')](','));}if(_0x3013fb){var _0xde5aa6={'ContactId':_0x3013fb['id'],'ChatWebsiteId':_0x53853f[_0xe125('0x47')]['id'],'from':(_0x3013fb['firstName']||'')+'\x20'+(_0x3013fb[_0xe125('0x9a')]||''),'customerIp':_0x34bb0d,'customerPort':_0x53853f[_0xe125('0x95')][_0xe125('0x9b')]?_0x53853f[_0xe125('0x95')][_0xe125('0x9b')]:null,'referer':_0x53853f[_0xe125('0x4b')][_0xe125('0x9c')],'browserName':_0x5839aa[_0xe125('0x9d')][_0xe125('0x2d')]&&_0x5839aa[_0xe125('0x9d')][_0xe125('0x9e')]?util[_0xe125('0x9f')](_0xe125('0xa0'),_0x5839aa[_0xe125('0x9d')][_0xe125('0x2d')],_0x5839aa[_0xe125('0x9d')][_0xe125('0x9e')]):'unknown','browserVersion':_0x5839aa[_0xe125('0x9d')][_0xe125('0x9e')]||_0xe125('0xa1'),'osName':util[_0xe125('0x9f')](_0xe125('0xa0'),_0x5839aa['os'][_0xe125('0x2d')],_0x5839aa['os']['version']),'osVersion':_0x5839aa['os']['version'],'deviceModel':_0x5839aa[_0xe125('0xa2')][_0xe125('0x38')]&&_0x5839aa[_0xe125('0xa2')][_0xe125('0xa3')]?util[_0xe125('0x9f')](_0xe125('0xa4'),_0x5839aa['device'][_0xe125('0x38')],_0x5839aa[_0xe125('0xa2')][_0xe125('0xa3')],_0x5839aa[_0xe125('0xa2')]['type']):null,'deviceVendor':_0x5839aa[_0xe125('0xa2')][_0xe125('0xa3')],'deviceType':_0x5839aa[_0xe125('0xa2')][_0xe125('0x32')],'formData':JSON['stringify'](_0x53853f[_0xe125('0x4b')])};var _0x57e220={'ChatWebsiteId':_0x53853f[_0xe125('0x47')]['id'],'closed':![]};if(_0x53853f[_0xe125('0x4b')][_0xe125('0xa5')]){_0x57e220[_0xe125('0xa5')]=_0x53853f[_0xe125('0x4b')][_0xe125('0xa5')];return db['ChatInteraction']['find']({'where':_0x57e220})[_0xe125('0x16')](function(_0x469721){if(_0x469721){return[_0x469721,![]];}_0xde5aa6[_0xe125('0xa5')]=_0x53853f['body'][_0xe125('0xa5')];_0xde5aa6[_0xe125('0xa6')]=_0x53853f['body'][_0xe125('0xa6')];return db['ChatInteraction'][_0xe125('0x4a')](_0xde5aa6)[_0xe125('0x16')](function(_0x54719c){return[_0x54719c,!![]];});});}_0x57e220['ContactId']=_0x3013fb['id'];if(_0x53853f[_0xe125('0x4b')][_0xe125('0xa7')]&&_0x53853f[_0xe125('0x4b')][_0xe125('0xa7')]['id']){_0x57e220['id']=_0x53853f['body'][_0xe125('0xa7')]['id'];return db[_0xe125('0xa8')][_0xe125('0x4f')]({'where':_0x57e220})[_0xe125('0x16')](function(_0x966d8b){if(_0x966d8b){return[_0x966d8b,![]];}return db[_0xe125('0xa8')]['create'](_0xde5aa6)[_0xe125('0x16')](function(_0xdd4609){return[_0xdd4609,!![]];});});}return db[_0xe125('0xa8')]['create'](_0xde5aa6)[_0xe125('0x16')](function(_0x348a6a){return[_0x348a6a,!![]];});}})[_0xe125('0xa9')](function(_0x45ea89,_0x2022b1){if(_0x45ea89){_0x2cc6fc=_0x2022b1;if(!_0x2022b1){var _0x13d15b={'from':(_0x5514a9[_0xe125('0xaa')]['firstName']||'')+'\x20'+(_0x5514a9[_0xe125('0xaa')][_0xe125('0x9a')]||'')};if(_0x53853f['body']['threadId']&&_0x53853f['body']['messageId']&&_0x53853f[_0xe125('0x4b')][_0xe125('0xa5')]!=_0x53853f[_0xe125('0x4b')][_0xe125('0xab')]){_0x13d15b[_0xe125('0xa5')]=_0x53853f['body'][_0xe125('0xab')];}return _0x45ea89[_0xe125('0x27')](_0x13d15b);}else{return _0x45ea89;}}})[_0xe125('0x16')](function(_0x4f9145){_0x5514a9[_0xe125('0xa7')]=_0x4f9145[_0xe125('0x28')]({'plain':!![]});_0x5514a9[_0xe125('0xa7')][_0xe125('0xac')]=_0x2cc6fc;if(_0x5514a9[_0xe125('0xa7')][_0xe125('0xac')]){if(_0x5514a9[_0xe125('0x8f')][_0xe125('0xad')]){_0x5514a9[_0xe125('0x90')][_0xe125('0xae')]({'id':0x0,'priority':_0x5514a9['applications'][_0xe125('0x3b')]+0x1,'app':_0xe125('0xaf'),'appdata':_0xe125('0xb0'),'interval':_0xe125('0xb1')});}}return db[_0xe125('0xb2')][_0xe125('0x4a')]({'body':_0x53853f[_0xe125('0x4b')][_0xe125('0x4b')],'ChatWebsiteId':_0x53853f[_0xe125('0x47')]['id'],'ChatInteractionId':_0x4f9145['id'],'direction':'in','ContactId':_0x5514a9[_0xe125('0xaa')]['id'],'AttachmentId':_0x53853f['body'][_0xe125('0xb3')]});})[_0xe125('0x16')](function(_0x570d43){_0x5514a9[_0xe125('0x1c')]=_0x570d43;if(_0x5514a9[_0xe125('0xa7')][_0xe125('0xb4')]){return db['User'][_0xe125('0x4f')]({'attributes':['id',_0xe125('0x2d')],'where':{'id':_0x5514a9[_0xe125('0xa7')][_0xe125('0xb4')]}})[_0xe125('0x16')](function(_0x3d62ce){if(_0x3d62ce){_0x5514a9[_0xe125('0x90')][_0xe125('0xb5')]({'id':0x0,'priority':0x0,'app':_0xe125('0xb6'),'appdata':_0x3d62ce[_0xe125('0x2d')]+','+(_0x5514a9['account'][_0xe125('0xb7')]||0xa),'interval':_0xe125('0xb1')});_0x5514a9[_0xe125('0xb8')]=!![];}return respondWithRpcPromise('Start',_0xe125('0xb9'),_0x5514a9);});}return respondWithRpcPromise('Start',_0xe125('0xb9'),_0x5514a9);})[_0xe125('0x16')](function(_0xa4f69a){respondWithRpcPromise(_0xe125('0xba'),'EventManager',{'event':'notify','message':_0xa4f69a},client9002);return _0xa4f69a;})[_0xe125('0x16')](respondWithResult(_0x3ed63e,null))['catch'](handleError(_0x3ed63e,null));};exports[_0xe125('0xbb')]=function(_0x5895da,_0xe41037){var _0x57ea18,_0xf77f9b,_0x17eeb1;var _0x3e27b5=[];var _0x413387={};var _0x60d3e7=_0x5895da[_0xe125('0xbc')]||[];var _0x4be6ca=[];var _0x5db52c;return db[_0xe125('0x7b')][_0xe125('0x52')]()[_0xe125('0x16')](function(_0x3d49b9){if(!_0x3d49b9){throw new db[(_0xe125('0x7c'))][(_0xe125('0x84'))](_0xe125('0x7d'));}_0x3e27b5=_[_0xe125('0x7e')](_[_0xe125('0x35')](_0x3d49b9),[_0xe125('0x7f'),'updatedAt',_0xe125('0x81'),'ListId']);if(_0x5895da[_0xe125('0x4b')]['id']){delete _0x5895da[_0xe125('0x4b')]['id'];}if(_[_0xe125('0x75')](_0x5895da[_0xe125('0x4b')][_0xe125('0x83')])){throw _0xe41037[_0xe125('0x20')](0x1f4)[_0xe125('0x2e')](new db[(_0xe125('0x7c'))][(_0xe125('0x84'))](_0xe125('0xbd')));}if(_[_0xe125('0x75')](_0x5895da[_0xe125('0x4b')][_0xe125('0x4b')])||_0x5895da[_0xe125('0x4b')][_0xe125('0x4b')]===''){throw _0xe41037[_0xe125('0x20')](0x1f4)['send'](new db[(_0xe125('0x7c'))]['ValidationError'](_0xe125('0x85')));}if(_[_0xe125('0x75')](_0x5895da[_0xe125('0x4b')][_0xe125('0xbe')])){throw _0xe41037['status'](0x1f4)[_0xe125('0x2e')](new db['Sequelize'][(_0xe125('0x84'))](_0xe125('0xbf')+_0x3e27b5));}if(!_['includes'](_0x3e27b5,_0x5895da['body'][_0xe125('0xbe')])){throw _0xe41037[_0xe125('0x20')](0x1f4)['send'](new db[(_0xe125('0x7c'))][(_0xe125('0x84'))](_0xe125('0xc0')+_0x3e27b5));}_0x413387[_0x5895da['body']['mapKeyOffline']]=_0x5895da[_0xe125('0x4b')][_0xe125('0x83')];})[_0xe125('0x16')](function(){return db[_0xe125('0x44')]['find']({'where':{'id':_0x5895da[_0xe125('0x47')]['id']},'include':[{'model':db[_0xe125('0x8a')],'as':_0xe125('0x8b')},{'model':db['MailAccount'],'as':_0xe125('0xc1')}]});})['then'](handleEntityNotFound(_0xe41037,null))[_0xe125('0x16')](function(_0x390f57){if(_0x390f57&&_0x390f57[_0xe125('0x8b')]){_0xf77f9b=_0x390f57;var _0x526651=_[_0xe125('0xc2')](_0x5895da[_0xe125('0x4b')],{'firstName':_0x5895da[_0xe125('0x4b')]['from'],'phone':_0x5895da['body'][_0xe125('0x83')],'ListId':_0x390f57[_0xe125('0x82')]});_0x526651[_0x5895da[_0xe125('0x4b')][_0xe125('0xbe')]]=_0x5895da[_0xe125('0x4b')][_0xe125('0x83')];return db[_0xe125('0x7b')][_0xe125('0xc3')]({'where':_0x413387,'defaults':_0x526651});}})[_0xe125('0xa9')](function(_0x3d5924){if(_0x3d5924){_0x17eeb1=_0x3d5924;var _0x28358d=fs[_0xe125('0xc4')](path[_0xe125('0x69')](config[_0xe125('0x6d')],_0xe125('0xc5')),_0xe125('0xc6'));var _0x4ddf4e=ejs['render'](_0x28358d,{'body':_[_0xe125('0xc7')](_0x5895da[_0xe125('0x4b')]['body']),'bodyTitle':_0xf77f9b[_0xe125('0xc8')]});return db[_0xe125('0xc9')]['create']({'body':_0x4ddf4e,'plainBody':htmlToText[_0xe125('0xca')](_0x4ddf4e),'ContactId':_0x3d5924['id'],'ChatWebsiteId':_0xf77f9b['id']});}})[_0xe125('0x16')](function(_0x8b0115){_0x5db52c=_0x8b0115;if(_0x60d3e7[_0xe125('0x3b')]){var _0x4c3f77=_0x60d3e7[_0xe125('0x33')](function(_0x436737){return{'name':_0x436737['originalname'],'basename':_0x436737['filename'],'type':_0x436737[_0xe125('0xcb')],'ChatOfflineMessageId':_0x8b0115['id']};});_0x4be6ca=_0x4c3f77[_0xe125('0x33')](_0x35c7b1=>{var _0x2376bd={'filename':_0x35c7b1[_0xe125('0x2d')],'path':path['join'](config[_0xe125('0x6d')],_0xe125('0xcc'),'files',_0xe125('0xcd'),'offline-chat',_0x35c7b1[_0xe125('0xce')])};return _0x2376bd;});if(!_0xf77f9b[_0xe125('0xcf')]){return db[_0xe125('0xd0')][_0xe125('0xd1')](function(_0x4772ec){return db[_0xe125('0xd2')]['bulkCreate'](_0x4c3f77,{'transaction':_0x4772ec});});}}})[_0xe125('0x16')](function(){if(_0x5db52c){_0x57ea18=_0x5db52c;return db[_0xe125('0xc1')][_0xe125('0x5d')]({'where':{'service':!![]},'include':[{'model':db[_0xe125('0xd3')],'as':_0xe125('0xd4'),'raw':!![],'include':[{'model':db[_0xe125('0xd5')],'as':'CloudProvider','raw':!![]}]}]});}})[_0xe125('0x16')](function(_0xffcce9){if(_0xffcce9&&_0xffcce9[_0xe125('0xd4')]&&_0xf77f9b['forwardOffline']&&_0xf77f9b[_0xe125('0xd6')]){var _0x9550d5=_0xffcce9[_0xe125('0xd7')]();return respondWithRpcPromise(_0xe125('0xd8'),_0xe125('0xd9'),{'account':_0x9550d5,'message':{'from':util['format'](_0xe125('0xda'),_0xffcce9[_0xe125('0x2d')],_0xffcce9['email']||_0xffcce9[_0xe125('0xd4')]['user']),'to':_0xf77f9b[_0xe125('0xd6')],'subject':_0xf77f9b[_0xe125('0xdb')],'html':_0x57ea18[_0xe125('0x4b')],'attachments':_0x4be6ca}},client9003)['then'](function(){return _0x57ea18;})[_0xe125('0x1e')](function(_0x5292ac){logger[_0xe125('0x1a')](_0x5292ac);});}})[_0xe125('0x16')](function(){if(_0xf77f9b&&_0xf77f9b['openNewInteraction']&&_0xf77f9b[_0xe125('0xdc')]){var _0x5a5622=[];if(_0x60d3e7['length']){_0x5a5622=_0x60d3e7[_0xe125('0x33')](function(_0x22d1e8){return{'name':_0x22d1e8['originalname'],'basename':_0x22d1e8['filename'],'type':_0x22d1e8[_0xe125('0xcb')],'ChatOfflineMessageId':_0x5db52c['id']};});}var _0x1c9896;if(!_[_0xe125('0x75')](_0xf77f9b[_0xe125('0xdd')])){var _0x139c1e=_[_0xe125('0x33')](_0x5895da[_0xe125('0x4b')],function(_0x568d51){return _0x568d51;});var _0x297877=_[_0xe125('0xde')](_0x139c1e)[0x0];var _0x541a5c=_[_0xe125('0xdf')](_0x297877,function(_0x3a9ba0){return _0x3a9ba0;});_0x1c9896=_0x541a5c[0x1][_0xf77f9b[_0xe125('0xdd')]];}var _0x4e253c={'from':_0x17eeb1['email'],'firstName':_0x17eeb1[_0xe125('0xe0')],'lastName':_0x17eeb1[_0xe125('0x9a')],'mapKey':_0xe125('0xe1'),'message':{'from':_0x17eeb1['email'],'to':_0xf77f9b[_0xe125('0xc1')][_0xe125('0xe1')],'cc':'','subject':_[_0xe125('0x75')](_0x1c9896)?_0xf77f9b[_0xe125('0xdb')]:_0x1c9896,'messageId':'','sentAt':new Date(),'attach':_0x5a5622[_0xe125('0x3b')],'attachments':_0x5a5622,'originChannel':_0xe125('0xe2'),'ChatWebsiteId':_0xf77f9b['id'],'ChatOfflineMessageId':_0x57ea18['id'],'originTo':_0xf77f9b[_0xe125('0xc1')]['email']},'body':_0x57ea18[_0xe125('0x4b')]};var _0x190376={'account':{'id':_0xf77f9b['MailAccountId']},'body':_0x4e253c,'log':_0xe125('0xe3')};return respondWithRpcPromise(_0xe125('0xe3'),_0xe125('0xe4'),_0x190376,client9001)[_0xe125('0x16')](function(){return _0x57ea18;})['catch'](function(_0x23834e){logger[_0xe125('0x1a')](_0x23834e);});}return;})[_0xe125('0x16')](function(){if(_0x57ea18){return _0x57ea18;}})[_0xe125('0x16')](respondWithResult(_0xe41037,null))['catch'](function(_0x591337){logger[_0xe125('0x1a')]('catch',_0x591337);for(var _0x21f4a6 of _0x60d3e7){var _0x561ec7=path['join'](config[_0xe125('0x6d')],_0xe125('0xcc'),_0xe125('0xbc'),_0xe125('0xcd'),_0xe125('0xe5'),_0x21f4a6['filename']);fs_extra[_0xe125('0xe6')](_0x561ec7)[_0xe125('0x1e')](function(_0x9f9a7){logger[_0xe125('0x1a')](_0xe125('0xe7'),_0x561ec7,_0x9f9a7);});}});};exports[_0xe125('0xe8')]=function(_0x529cc9,_0x4431d7){return db[_0xe125('0xa8')][_0xe125('0x4f')]({'where':{'id':_0x529cc9[_0xe125('0x47')]['id']}})[_0xe125('0x16')](handleEntityNotFound(_0x4431d7,null))['then'](function(_0x44f873){if(_0x44f873){return _0x44f873[_0xe125('0xe8')](_0x529cc9[_0xe125('0x4b')][_0xe125('0x59')],_[_0xe125('0xe9')](_0x529cc9['body'],[_0xe125('0x59'),'id'])||{});}})[_0xe125('0x16')](respondWithResult(_0x4431d7,null))[_0xe125('0x1e')](handleError(_0x4431d7,null));};exports[_0xe125('0xea')]=function(_0x316189,_0x1adf3b){var _0x240d22={'raw':![],'where':{}};var _0x330a7c={};var _0x12f65a={'count':0x0,'rows':[]};return db[_0xe125('0x44')][_0xe125('0x5d')]({'where':{'id':_0x316189['params']['id']}})[_0xe125('0x16')](handleEntityNotFound(_0x1adf3b,null))[_0xe125('0x16')](function(_0x12db44){if(_0x12db44){_0x330a7c[_0xe125('0x38')]=_[_0xe125('0x35')](db[_0xe125('0xa8')][_0xe125('0x31')]);_0x330a7c[_0xe125('0x34')]=_[_0xe125('0x35')](_0x316189['query']);_0x330a7c[_0xe125('0x36')]=_['intersection'](_0x330a7c['model'],_0x330a7c[_0xe125('0x34')]);_0x240d22[_0xe125('0x39')]=_[_0xe125('0x37')](_0x330a7c[_0xe125('0x38')],qs[_0xe125('0x3a')](_0x316189[_0xe125('0x34')]['fields']));_0x240d22[_0xe125('0x39')]=_0x240d22[_0xe125('0x39')][_0xe125('0x3b')]?_0x240d22['attributes']:_0x330a7c[_0xe125('0x38')];if(!_0x316189[_0xe125('0x34')][_0xe125('0xeb')](_0xe125('0x3c'))){_0x240d22['limit']=qs['limit'](_0x316189[_0xe125('0x34')]['limit']);_0x240d22['offset']=qs[_0xe125('0x24')](_0x316189[_0xe125('0x34')]['offset']);}_0x240d22[_0xe125('0x3d')]=qs[_0xe125('0x3e')](_0x316189[_0xe125('0x34')]['sort']);_0x240d22['where']=qs['filters'](_['pick'](_0x316189[_0xe125('0x34')],_0x330a7c[_0xe125('0x36')]));_0x240d22[_0xe125('0x3f')][_0xe125('0x57')]=_0x12db44['id'];if(_0x316189['query']['filter']){_0x240d22[_0xe125('0x3f')]=_[_0xe125('0x41')](_0x240d22['where'],{'$or':_[_0xe125('0x33')](_0x240d22['attributes'],function(_0x4bfa20){var _0x36fd6d={};_0x36fd6d[_0x4bfa20]={'$like':'%'+_0x316189[_0xe125('0x34')][_0xe125('0x40')]+'%'};return _0x36fd6d;})});}_0x240d22=_[_0xe125('0x41')]({},_0x240d22,_0x316189[_0xe125('0x43')]);return db[_0xe125('0xa8')][_0xe125('0x25')]({'where':_0x240d22[_0xe125('0x3f')]})['then'](function(_0x555d53){_0x12f65a['count']=_0x555d53;if(_0x316189['query']['includeAll']){_0x240d22[_0xe125('0x49')]=[{'model':db[_0xe125('0x7b')],'as':_0xe125('0xec'),'required':![]},{'model':db[_0xe125('0xed')],'as':_0xe125('0xee'),'attributes':[_0xe125('0x2d'),_0xe125('0xef'),_0xe125('0xf0')],'required':![]},{'model':db[_0xe125('0xf1')],'as':'Tags','attributes':['id',_0xe125('0x2d'),'color'],'where':_0x316189[_0xe125('0x34')]['tag']?{'id':_0x316189[_0xe125('0x34')][_0xe125('0xf2')]}:undefined,'required':_0x316189[_0xe125('0x34')][_0xe125('0xf2')]?!![]:![]}];}return db['ChatInteraction'][_0xe125('0x45')](_0x240d22);})['then'](function(_0x3ff21c){_0x12f65a[_0xe125('0x46')]=_0x3ff21c;return _0x12f65a;});}})[_0xe125('0x16')](respondWithFilteredResult(_0x1adf3b,_0x240d22))[_0xe125('0x1e')](handleError(_0x1adf3b,null));};function iftimePromise(_0x26685e,_0x3d2217){return respondWithRpcPromise(_0xe125('0xf3'),_0xe125('0xf4'),{'command':_0x3d2217[_0xe125('0xf5')]?util[_0xe125('0x9f')](_0xe125('0xf6'),_0x26685e[_0xe125('0xf7')],_0x3d2217[_0xe125('0xf5')]):util[_0xe125('0x9f')](_0xe125('0xf8'),_0x26685e['interval'])},client9002)['then'](function(_0x1b3cbc){var _0x42928d=_0x1b3cbc&&_0x1b3cbc['indexOf']('true')>=0x0?!![]:![];logger['info'](_0xe125('0xf9'),_0x3d2217['id'],_0x26685e['id'],_0x26685e['interval'],_0x42928d?'ONLINE':_0xe125('0xfa'),_0x3d2217['timezone']?_0x3d2217['timezone']:'No\x20timezone');return _0x42928d;})[_0xe125('0x1e')](function(_0x1e5df5){logger['error'](_0xe125('0xf9'),_0x3d2217['id'],_0x26685e['id'],_0x26685e['interval'],util[_0xe125('0xfb')](_0x1e5df5,{'showHidden':![],'depth':null}),_0x3d2217['timezone']?_0x3d2217['timezone']:_0xe125('0xfc'));return![];});}exports[_0xe125('0xf4')]=function(_0x27eded,_0x5f1022){var _0x59c0ef=0x0;var _0x111468=0x0;var _0xc743b0=![];var _0x30bcfa;var _0x43cd3d;return db[_0xe125('0x44')][_0xe125('0x4f')]({'where':{'id':_0x27eded[_0xe125('0x47')]['id']},'include':[{'model':db[_0xe125('0xfd')],'as':'Interval','include':[{'model':db[_0xe125('0xfd')],'as':_0xe125('0xfe'),'attributes':['id',_0xe125('0xf7')],'raw':!![]}]}]})[_0xe125('0x16')](handleEntityNotFound(_0x5f1022,null))[_0xe125('0x16')](function(_0x4d380f){if(_0x4d380f){_0x30bcfa=_0x4d380f;return _0x4d380f[_0xe125('0xff')]({'raw':!![]});}})[_0xe125('0x16')](function(_0x168422){if(_0x30bcfa){if(_0x168422){_0x43cd3d=_0x168422;}}return require(_0xe125('0x6b'))[_0xe125('0x100')]();})[_0xe125('0x16')](function(_0xee893d){if(_0xee893d){_0x111468=_0xee893d['virtual'];_0xc743b0=_0xee893d[_0xe125('0x6c')];}})['then'](function(){return db[_0xe125('0xa8')][_0xe125('0x25')]({'where':{'closed':![]}});})[_0xe125('0x16')](function(_0x207d54){_0x59c0ef=_0x207d54;if(_0x111468&&_0x207d54>_0x111468){return db['License'][_0xe125('0x5d')]({'where':{'id':0x1}})[_0xe125('0x16')](function(_0x2eeb67){if(_0x2eeb67){_0x2eeb67[_0xe125('0x101')](_0xe125('0x102'));}});}})['then'](function(){if(_0x30bcfa['Interval']&&_0x30bcfa[_0xe125('0xfd')]['Intervals']){var _0x12738c=[];for(var _0xee37ac=0x0;_0xee37ac<_0x30bcfa['Interval'][_0xe125('0xfe')][_0xe125('0x3b')];_0xee37ac++){var _0x263cf5=_0x30bcfa[_0xe125('0xfd')]['Intervals'][_0xee37ac][_0xe125('0x28')]({'plain':!![]});_0x12738c[_0xe125('0xae')](iftimePromise(_0x263cf5,_0x30bcfa));}return BPromise['all'](_0x12738c)['then'](function(_0x43cdbe){return _[_0xe125('0x103')](_0x43cdbe);});}else{return!![];}})[_0xe125('0x16')](function(_0x368115){var _0x3a25c8=fs[_0xe125('0xc4')](path[_0xe125('0x69')](config['root'],_0xe125('0x104')),_0xe125('0xc6'));var _0x3197d3={'remote':_0x30bcfa['remote'],'query':querystring[_0xe125('0x105')](_[_0xe125('0x41')](_0x30bcfa[_0xe125('0x28')]({'plain':!![]}),{'customerIp':_0x27eded[_0xe125('0x95')][_0xe125('0x98')]||_0x27eded[_0xe125('0x95')][_0xe125('0x106')]||_0x27eded[_0xe125('0x107')]['remoteAddress']||_0x27eded['ip'],'referer':_0x27eded[_0xe125('0x95')][_0xe125('0x9c')],'openedInteractions':_0x59c0ef,'maxInteractions':_0x111468,'virtual':_0xc743b0[_0xe125('0x108')],'online':_0x368115,'custom':_0xc743b0}))[_0xe125('0x109')](/'/g,'\x5c\x27')};_0x5f1022[_0xe125('0x2e')](ejs[_0xe125('0x10a')](Mustache[_0xe125('0x10a')](_0x3a25c8,_0x3197d3),{'proactiveActions':_0x43cd3d,'alignment':_0x30bcfa['alignment'],'verticalAlignment':_0x30bcfa[_0xe125('0x10b')],'div_color':_0x30bcfa['color'],'labelText':_0x30bcfa[_0xe125('0x10c')],'text_color':_0x30bcfa[_0xe125('0x10d')],'text_button_color':_0x30bcfa[_0xe125('0x10e')],'button_color':_0x30bcfa[_0xe125('0x10f')],'background_color':_0x30bcfa[_0xe125('0x110')],'hideWhenOffline':_0x30bcfa['hideWhenOffline'],'interval':_0x30bcfa['IntervalId']}));})['catch'](handleError(_0x5f1022,null));};exports[_0xe125('0x111')]=function(_0x201dd3,_0x47703d){var _0x260b03=_0x201dd3[_0xe125('0x47')]['id'];var _0x1ef9a7=_0x201dd3['body'];var _0x2498fb=0xc8;var _0x3c1293=null;return db['sequelize'][_0xe125('0xd1')]({'isolationLevel':db['sequelize'][_0xe125('0x112')][_0xe125('0x113')][_0xe125('0x114')]},function(_0x52fbef){return db['ChatWebsite'][_0xe125('0x5d')]({'where':{'id':_0x260b03},'transaction':_0x52fbef})[_0xe125('0x16')](function(_0x320ad2){if(_0x320ad2){return db[_0xe125('0x115')][_0xe125('0x2b')]({'where':{'ChatWebsiteId':_0x260b03},'transaction':_0x52fbef})['then'](function(){var _0x3cc0ff=_['map'](_0x1ef9a7,function(_0x2648b2){_0x2648b2[_0xe125('0x57')]=_0x260b03;return _0x2648b2;});return db[_0xe125('0x115')][_0xe125('0x116')](_0x3cc0ff,{'transaction':_0x52fbef});});}else{_0x2498fb=0x194;_0x3c1293=[];}});})[_0xe125('0x16')](function(){if(_0x2498fb!==0x194){return db['ChatApplication'][_0xe125('0x117')]({'where':{'ChatWebsiteId':_0x260b03},'order':'priority'})[_0xe125('0x16')](function(_0x5d8f68){_0x3c1293=_0x5d8f68;});}})[_0xe125('0x1e')](function(_0x3bc7b9){_0x2498fb=0x1f4;logger['error'](_0x3bc7b9[_0xe125('0x2c')]);if(_0x3bc7b9['name']){delete _0x3bc7b9[_0xe125('0x2d')];}_0x3c1293=_0x3bc7b9;})['finally'](function(){if(_0x3c1293===null){_0x47703d[_0xe125('0x1f')](_0x2498fb);}else{if(_0x2498fb===0x1f4){_0x47703d[_0xe125('0x20')](_0x2498fb)['send'](_0x3c1293);}else{_0x47703d['status'](_0x2498fb)[_0xe125('0x21')](_0x3c1293);}}});};exports[_0xe125('0x118')]=function(_0x28fe53,_0x4f53c2){var _0x19d6db={};var _0x356b49={};var _0x3bedcb;var _0x206300;return db[_0xe125('0x44')][_0xe125('0x5d')]({'where':{'id':_0x28fe53[_0xe125('0x47')]['id']}})[_0xe125('0x16')](handleEntityNotFound(_0x4f53c2,null))[_0xe125('0x16')](function(_0x51f21b){if(_0x51f21b){_0x3bedcb=_0x51f21b;_0x356b49[_0xe125('0x38')]=_['keys'](db[_0xe125('0x115')][_0xe125('0x31')]);_0x356b49[_0xe125('0x34')]=_[_0xe125('0x35')](_0x28fe53[_0xe125('0x34')]);_0x356b49[_0xe125('0x36')]=_[_0xe125('0x37')](_0x356b49['model'],_0x356b49[_0xe125('0x34')]);_0x19d6db['attributes']=_[_0xe125('0x37')](_0x356b49[_0xe125('0x38')],qs['fields'](_0x28fe53['query']['fields']));_0x19d6db[_0xe125('0x39')]=_0x19d6db['attributes']['length']?_0x19d6db[_0xe125('0x39')]:_0x356b49[_0xe125('0x38')];_0x19d6db['order']=qs['sort'](_0x28fe53['query'][_0xe125('0x3e')]);_0x19d6db[_0xe125('0x3f')]=qs[_0xe125('0x36')](_[_0xe125('0x56')](_0x28fe53[_0xe125('0x34')],_0x356b49[_0xe125('0x36')]));if(_0x28fe53['query'][_0xe125('0x40')]){_0x19d6db['where']=_[_0xe125('0x41')](_0x19d6db['where'],{'$or':_['map'](_0x19d6db[_0xe125('0x39')],function(_0x20b6a4){var _0x468763={};_0x468763[_0x20b6a4]={'$like':'%'+_0x28fe53[_0xe125('0x34')][_0xe125('0x40')]+'%'};return _0x468763;})});}_0x19d6db=_[_0xe125('0x41')]({},_0x19d6db,_0x28fe53[_0xe125('0x43')]);return _0x3bedcb[_0xe125('0x118')](_0x19d6db);}})[_0xe125('0x16')](function(_0x52f0cc){if(_0x52f0cc){_0x206300=_0x52f0cc[_0xe125('0x3b')];if(!_0x28fe53[_0xe125('0x34')][_0xe125('0xeb')](_0xe125('0x3c'))){_0x19d6db['limit']=qs[_0xe125('0x23')](_0x28fe53[_0xe125('0x34')][_0xe125('0x23')]);_0x19d6db[_0xe125('0x24')]=qs['offset'](_0x28fe53[_0xe125('0x34')][_0xe125('0x24')]);}return _0x3bedcb['getApplications'](_0x19d6db);}})[_0xe125('0x16')](function(_0x126530){if(_0x126530){return _0x126530?{'count':_0x206300,'rows':_0x126530}:null;}})[_0xe125('0x16')](respondWithResult(_0x4f53c2,null))[_0xe125('0x1e')](handleError(_0x4f53c2,null));};exports[_0xe125('0x119')]=function(_0x4fcdd4,_0x558eed){return db[_0xe125('0x11a')][_0xe125('0x4f')]({'where':{'id':_0x4fcdd4[_0xe125('0x47')]['id']}})[_0xe125('0x16')](handleEntityNotFound(_0x558eed,null))[_0xe125('0x16')](function(_0x36df14){if(_0x36df14){return _0x36df14['addProactiveActions'](_0x4fcdd4[_0xe125('0x4b')][_0xe125('0x59')],_[_0xe125('0xe9')](_0x4fcdd4[_0xe125('0x4b')],[_0xe125('0x59'),'id'])||{});}})[_0xe125('0x16')](respondWithResult(_0x558eed,null))['catch'](handleError(_0x558eed,null));};exports[_0xe125('0xff')]=function(_0x361e73,_0xbb8495){var _0x487b1d={};var _0x1fad22={};var _0x5951f9;var _0x77b5d3;return db[_0xe125('0x44')][_0xe125('0x5d')]({'where':{'id':_0x361e73['params']['id']}})[_0xe125('0x16')](handleEntityNotFound(_0xbb8495,null))[_0xe125('0x16')](function(_0x26a0b5){if(_0x26a0b5){_0x5951f9=_0x26a0b5;_0x1fad22[_0xe125('0x38')]=_[_0xe125('0x35')](db[_0xe125('0x11b')]['rawAttributes']);_0x1fad22[_0xe125('0x34')]=_[_0xe125('0x35')](_0x361e73[_0xe125('0x34')]);_0x1fad22[_0xe125('0x36')]=_['intersection'](_0x1fad22[_0xe125('0x38')],_0x1fad22['query']);_0x487b1d['attributes']=_[_0xe125('0x37')](_0x1fad22[_0xe125('0x38')],qs[_0xe125('0x3a')](_0x361e73[_0xe125('0x34')][_0xe125('0x3a')]));_0x487b1d[_0xe125('0x39')]=_0x487b1d[_0xe125('0x39')][_0xe125('0x3b')]?_0x487b1d[_0xe125('0x39')]:_0x1fad22[_0xe125('0x38')];_0x487b1d[_0xe125('0x3d')]=qs['sort'](_0x361e73[_0xe125('0x34')]['sort']);_0x487b1d[_0xe125('0x3f')]=qs[_0xe125('0x36')](_[_0xe125('0x56')](_0x361e73[_0xe125('0x34')],_0x1fad22['filters']));if(_0x361e73[_0xe125('0x34')][_0xe125('0x40')]){_0x487b1d[_0xe125('0x3f')]=_[_0xe125('0x41')](_0x487b1d[_0xe125('0x3f')],{'$or':_[_0xe125('0x33')](_0x487b1d[_0xe125('0x39')],function(_0x12e06d){var _0x3d55c7={};_0x3d55c7[_0x12e06d]={'$like':'%'+_0x361e73[_0xe125('0x34')]['filter']+'%'};return _0x3d55c7;})});}_0x487b1d=_['merge']({},_0x487b1d,_0x361e73[_0xe125('0x43')]);return _0x5951f9['getProactiveActions'](_0x487b1d);}})[_0xe125('0x16')](function(_0x4fbb27){if(_0x4fbb27){_0x77b5d3=_0x4fbb27[_0xe125('0x3b')];if(!_0x361e73['query']['hasOwnProperty'](_0xe125('0x3c'))){_0x487b1d[_0xe125('0x23')]=qs[_0xe125('0x23')](_0x361e73[_0xe125('0x34')]['limit']);_0x487b1d[_0xe125('0x24')]=qs[_0xe125('0x24')](_0x361e73[_0xe125('0x34')][_0xe125('0x24')]);}return _0x5951f9['getProactiveActions'](_0x487b1d);}})[_0xe125('0x16')](function(_0x214113){if(_0x214113){return _0x214113?{'count':_0x77b5d3,'rows':_0x214113}:null;}})[_0xe125('0x16')](respondWithResult(_0xbb8495,null))[_0xe125('0x1e')](handleError(_0xbb8495,null));};exports['getFields']=function(_0x3aade1,_0x364883){var _0x5b6b82=_0x3aade1[_0xe125('0x34')]['online']==='false'?_0xe125('0x11c'):_0xe125('0x11d');return db[_0xe125('0x44')]['find']({'attributes':['id',_0x5b6b82],'where':{'id':_0x3aade1[_0xe125('0x47')]['id']}})[_0xe125('0x16')](handleEntityNotFound(_0x364883,null))[_0xe125('0x16')](function(_0x530930){if(_0x530930){var _0x207215=_0x530930[_0x5b6b82];var _0x1cdede=_0x207215&&_0x207215[_0xe125('0x11e')]?_0x207215[_0xe125('0x11e')]:[];_0x364883['send']({'fromKey':_[_0xe125('0x75')](_0x207215['fromKey'])?undefined:_0x207215['fromKey'],'count':_0x1cdede[_0xe125('0x3b')],'rows':_0x1cdede});}})['catch'](handleError(_0x364883,null));};exports[_0xe125('0x11f')]=function(_0xa044c0,_0x4b7df2){var _0x40cc08={'raw':![],'where':{}};var _0x1ebfc5={};var _0x4f0ec8={'count':0x0,'rows':[]};return db[_0xe125('0x44')][_0xe125('0x5d')]({'where':{'id':_0xa044c0['params']['id']}})[_0xe125('0x16')](handleEntityNotFound(_0x4b7df2,null))[_0xe125('0x16')](function(_0x2b90a3){if(_0x2b90a3){_0x1ebfc5[_0xe125('0x38')]=_[_0xe125('0x35')](db[_0xe125('0xc9')]['rawAttributes']);_0x1ebfc5[_0xe125('0x34')]=_[_0xe125('0x35')](_0xa044c0[_0xe125('0x34')]);_0x1ebfc5['filters']=_[_0xe125('0x37')](_0x1ebfc5[_0xe125('0x38')],_0x1ebfc5[_0xe125('0x34')]);_0x40cc08['attributes']=_[_0xe125('0x37')](_0x1ebfc5[_0xe125('0x38')],qs['fields'](_0xa044c0[_0xe125('0x34')][_0xe125('0x3a')]));_0x40cc08[_0xe125('0x39')]=_0x40cc08['attributes'][_0xe125('0x3b')]?_0x40cc08[_0xe125('0x39')]:_0x1ebfc5[_0xe125('0x38')];if(!_0xa044c0[_0xe125('0x34')]['hasOwnProperty'](_0xe125('0x3c'))){_0x40cc08['limit']=qs[_0xe125('0x23')](_0xa044c0[_0xe125('0x34')][_0xe125('0x23')]);_0x40cc08['offset']=qs['offset'](_0xa044c0['query']['offset']);}_0x40cc08[_0xe125('0x3d')]=qs[_0xe125('0x3e')](_0xa044c0[_0xe125('0x34')]['sort']);_0x40cc08[_0xe125('0x3f')]=qs[_0xe125('0x36')](_[_0xe125('0x56')](_0xa044c0[_0xe125('0x34')],_0x1ebfc5['filters']));_0x40cc08[_0xe125('0x3f')][_0xe125('0x57')]=_0x2b90a3['id'];if(_0xa044c0[_0xe125('0x34')][_0xe125('0x40')]){_0x40cc08[_0xe125('0x3f')]=_[_0xe125('0x41')](_0x40cc08[_0xe125('0x3f')],{'$or':_[_0xe125('0x33')](_0x40cc08[_0xe125('0x39')],function(_0x5e89ec){var _0x1636da={};_0x1636da[_0x5e89ec]={'$like':'%'+_0xa044c0[_0xe125('0x34')][_0xe125('0x40')]+'%'};return _0x1636da;})});}_0x40cc08=_[_0xe125('0x41')]({},_0x40cc08,_0xa044c0['options']);return db[_0xe125('0xc9')][_0xe125('0x25')]({'where':_0x40cc08[_0xe125('0x3f')]})[_0xe125('0x16')](function(_0x4a7524){_0x4f0ec8['count']=_0x4a7524;if(_0xa044c0[_0xe125('0x34')][_0xe125('0x48')]){_0x40cc08[_0xe125('0x49')]=[{'all':!![]}];}else{_0x40cc08['include']=[{'model':db[_0xe125('0x7b')],'as':_0xe125('0xec'),'required':![]},{'model':db['Attachment'],'as':_0xe125('0x120'),'required':![]}];}return db[_0xe125('0xc9')][_0xe125('0x45')](_0x40cc08);})[_0xe125('0x16')](function(_0x466ce8){_0x4f0ec8[_0xe125('0x46')]=_0x466ce8;return _0x4f0ec8;});}})['then'](respondWithFilteredResult(_0x4b7df2,_0x40cc08))['catch'](handleError(_0x4b7df2,null));};exports['addAgents']=function(_0x5804c0,_0x1d3960){return db['ChatWebsite'][_0xe125('0x4f')]({'where':{'id':_0x5804c0[_0xe125('0x47')]['id']}})[_0xe125('0x16')](handleEntityNotFound(_0x1d3960,null))['then'](function(_0x2758e1){if(_0x2758e1){return _0x2758e1[_0xe125('0x121')](_0x5804c0[_0xe125('0x4b')]['ids'],_[_0xe125('0xe9')](_0x5804c0['body'],[_0xe125('0x59'),'id'])||{})[_0xe125('0xa9')](function(_0x463555){for(var _0x57689b=0x0;_0x57689b<_0x5804c0[_0xe125('0x4b')]['ids']['length'];_0x57689b+=0x1){socket[_0xe125('0x122')](_0xe125('0x123'),{'UserId':Number(_0x5804c0[_0xe125('0x4b')][_0xe125('0x59')][_0x57689b]),'ChatWebsiteId':Number(_0x5804c0[_0xe125('0x47')]['id'])});}return _0x463555;});}})[_0xe125('0x16')](respondWithResult(_0x1d3960,null))[_0xe125('0x1e')](handleError(_0x1d3960,null));};exports[_0xe125('0x124')]=function(_0x57af13,_0x1166d0){return db[_0xe125('0x44')][_0xe125('0x4f')]({'where':{'id':_0x57af13['params']['id']}})[_0xe125('0x16')](handleEntityNotFound(_0x1166d0,null))[_0xe125('0x16')](function(_0x1db424){if(_0x1db424){return _0x1db424['removeAgents'](_0x57af13[_0xe125('0x34')][_0xe125('0x59')])['then'](function(){if(_[_0xe125('0x125')](_0x57af13[_0xe125('0x34')]['ids'])){for(var _0x194a28=0x0;_0x194a28<_0x57af13[_0xe125('0x34')]['ids'][_0xe125('0x3b')];_0x194a28+=0x1){socket[_0xe125('0x122')](_0xe125('0x126'),{'UserId':Number(_0x57af13[_0xe125('0x34')][_0xe125('0x59')][_0x194a28]),'ChatWebsiteId':Number(_0x57af13[_0xe125('0x47')]['id'])});}}else{socket[_0xe125('0x122')]('userChatWebsite:remove',{'UserId':Number(_0x57af13['query'][_0xe125('0x59')]),'ChatWebsiteId':Number(_0x57af13[_0xe125('0x47')]['id'])});}});}})[_0xe125('0x16')](respondWithStatusCode(_0x1166d0,null))[_0xe125('0x1e')](handleError(_0x1166d0,null));};exports[_0xe125('0x127')]=function(_0x1150db,_0x1a2808){var _0x21313e={};var _0x11f07f={};var _0x5d4d5c;var _0x2f1ff2;return db[_0xe125('0x44')][_0xe125('0x5d')]({'where':{'id':_0x1150db[_0xe125('0x47')]['id']}})['then'](handleEntityNotFound(_0x1a2808,null))[_0xe125('0x16')](function(_0x3d836c){if(_0x3d836c){_0x5d4d5c=_0x3d836c;_0x11f07f[_0xe125('0x38')]=_[_0xe125('0x35')](db['User'][_0xe125('0x31')]);_0x11f07f[_0xe125('0x34')]=_[_0xe125('0x35')](_0x1150db[_0xe125('0x34')]);_0x11f07f['filters']=_[_0xe125('0x37')](_0x11f07f[_0xe125('0x38')],_0x11f07f['query']);_0x21313e['attributes']=_[_0xe125('0x37')](_0x11f07f[_0xe125('0x38')],qs[_0xe125('0x3a')](_0x1150db['query'][_0xe125('0x3a')]));_0x21313e['attributes']=_0x21313e['attributes'][_0xe125('0x3b')]?_0x21313e[_0xe125('0x39')]:_0x11f07f[_0xe125('0x38')];_0x21313e['order']=qs[_0xe125('0x3e')](_0x1150db['query']['sort']);_0x21313e[_0xe125('0x3f')]=qs[_0xe125('0x36')](_[_0xe125('0x56')](_0x1150db[_0xe125('0x34')],_0x11f07f[_0xe125('0x36')]));if(_0x1150db['query'][_0xe125('0x40')]){_0x21313e[_0xe125('0x3f')]=_[_0xe125('0x41')](_0x21313e[_0xe125('0x3f')],{'$or':_[_0xe125('0x33')](_0x21313e[_0xe125('0x39')],function(_0x414910){var _0x397508={};_0x397508[_0x414910]={'$like':'%'+_0x1150db['query'][_0xe125('0x40')]+'%'};return _0x397508;})});}_0x21313e=_[_0xe125('0x41')]({},_0x21313e,_0x1150db[_0xe125('0x43')]);return _0x5d4d5c['getAgents'](_0x21313e);}})[_0xe125('0x16')](function(_0x104967){if(_0x104967){_0x2f1ff2=_0x104967[_0xe125('0x3b')];if(!_0x1150db['query'][_0xe125('0xeb')](_0xe125('0x3c'))){_0x21313e[_0xe125('0x23')]=qs[_0xe125('0x23')](_0x1150db[_0xe125('0x34')][_0xe125('0x23')]);_0x21313e[_0xe125('0x24')]=qs[_0xe125('0x24')](_0x1150db[_0xe125('0x34')][_0xe125('0x24')]);}return _0x5d4d5c['getAgents'](_0x21313e);}})[_0xe125('0x16')](function(_0x5652f2){if(_0x5652f2){return _0x5652f2?{'count':_0x2f1ff2,'rows':_0x5652f2}:null;}})[_0xe125('0x16')](respondWithResult(_0x1a2808,null))[_0xe125('0x1e')](handleError(_0x1a2808,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index b1102f9..eb521b1 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 _0xc01b=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save'];(function(_0xdaa9d9,_0x169b70){var _0x1d2b7f=function(_0x28f55b){while(--_0x28f55b){_0xdaa9d9['push'](_0xdaa9d9['shift']());}};_0x1d2b7f(++_0x169b70);}(_0xc01b,0x74));var _0xbc01=function(_0x33006f,_0x3ade2c){_0x33006f=_0x33006f-0x0;var _0x435d96=_0xc01b[_0x33006f];return _0x435d96;};'use strict';var EventEmitter=require(_0xbc01('0x0'));var ChatWebsite=require(_0xbc01('0x1'))['db'][_0xbc01('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xbc01('0x3')](0x0);var events={'afterCreate':_0xbc01('0x4'),'afterUpdate':_0xbc01('0x5'),'afterDestroy':_0xbc01('0x6')};function emitEvent(_0x5ede59){return function(_0x2c35d0,_0x133078,_0x222fa3){ChatWebsiteEvents[_0xbc01('0x7')](_0x5ede59+':'+_0x2c35d0['id'],_0x2c35d0);ChatWebsiteEvents[_0xbc01('0x7')](_0x5ede59,_0x2c35d0);_0x222fa3(null);};}for(var e in events){if(events[_0xbc01('0x8')](e)){var event=events[e];ChatWebsite[_0xbc01('0x9')](e,emitEvent(event));}}module[_0xbc01('0xa')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x4944=['ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x3e1028,_0x1d49b6){var _0x277987=function(_0x1ec399){while(--_0x1ec399){_0x3e1028['push'](_0x3e1028['shift']());}};_0x277987(++_0x1d49b6);}(_0x4944,0x6d));var _0x4494=function(_0x5b43be,_0x31529e){_0x5b43be=_0x5b43be-0x0;var _0x3e5d5d=_0x4944[_0x5b43be];return _0x3e5d5d;};'use strict';var EventEmitter=require(_0x4494('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x4494('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x4494('0x2')](0x0);var events={'afterCreate':_0x4494('0x3'),'afterUpdate':_0x4494('0x4'),'afterDestroy':_0x4494('0x5')};function emitEvent(_0x5074d9){return function(_0x187098,_0x5c7492,_0x370748){ChatWebsiteEvents[_0x4494('0x6')](_0x5074d9+':'+_0x187098['id'],_0x187098);ChatWebsiteEvents[_0x4494('0x6')](_0x5074d9,_0x187098);_0x370748(null);};}for(var e in events){if(events[_0x4494('0x7')](e)){var event=events[e];ChatWebsite[_0x4494('0x8')](e,emitEvent(event));}}module[_0x4494('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 96963bf..5b3a3b8 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 _0xc484=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash'];(function(_0x32db60,_0x180a5d){var _0x323891=function(_0x4b1fcd){while(--_0x4b1fcd){_0x32db60['push'](_0x32db60['shift']());}};_0x323891(++_0x180a5d);}(_0xc484,0xb5));var _0x4c48=function(_0x2b71e0,_0x313267){_0x2b71e0=_0x2b71e0-0x0;var _0x36ca99=_0xc484[_0x2b71e0];return _0x36ca99;};'use strict';var _=require(_0x4c48('0x0'));var util=require(_0x4c48('0x1'));var logger=require(_0x4c48('0x2'))(_0x4c48('0x3'));var moment=require('moment');var BPromise=require(_0x4c48('0x4'));var rp=require(_0x4c48('0x5'));var fs=require('fs');var path=require(_0x4c48('0x6'));var rimraf=require(_0x4c48('0x7'));var config=require(_0x4c48('0x8'));var attributes=require(_0x4c48('0x9'));module[_0x4c48('0xa')]=function(_0x56098e,_0x1286ad){return _0x56098e[_0x4c48('0xb')](_0x4c48('0xc'),attributes,{'tableName':_0x4c48('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf50f=['define','ChatWebsite','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0xf50f,0xde));var _0xff50=function(_0x35bbd3,_0x5080c0){_0x35bbd3=_0x35bbd3-0x0;var _0x1fb3cc=_0xf50f[_0x35bbd3];return _0x1fb3cc;};'use strict';var _=require(_0xff50('0x0'));var util=require(_0xff50('0x1'));var logger=require('../../config/logger')(_0xff50('0x2'));var moment=require(_0xff50('0x3'));var BPromise=require(_0xff50('0x4'));var rp=require(_0xff50('0x5'));var fs=require('fs');var path=require(_0xff50('0x6'));var rimraf=require('rimraf');var config=require(_0xff50('0x7'));var attributes=require('./chatWebsite.attributes');module[_0xff50('0x8')]=function(_0x45ebaf,_0x4da013){return _0x45ebaf[_0xff50('0x9')](_0xff50('0xa'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index bcb4c74..148dca1 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 _0x5f2f=['http','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','request','ChatWebsite,\x20%s,\x20%s','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x354a41,_0x30c98c){var _0x342e6e=function(_0x288c6b){while(--_0x288c6b){_0x354a41['push'](_0x354a41['shift']());}};_0x342e6e(++_0x30c98c);}(_0x5f2f,0x15f));var _0xf5f2=function(_0x534d8e,_0x5d9305){_0x534d8e=_0x534d8e-0x0;var _0x429379=_0x5f2f[_0x534d8e];return _0x429379;};'use strict';var _=require('lodash');var util=require(_0xf5f2('0x0'));var moment=require(_0xf5f2('0x1'));var BPromise=require(_0xf5f2('0x2'));var rs=require(_0xf5f2('0x3'));var fs=require('fs');var Redis=require(_0xf5f2('0x4'));var db=require(_0xf5f2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf5f2('0x6'))(_0xf5f2('0x7'));var config=require('../../config/environment');var jayson=require(_0xf5f2('0x8'));var client=jayson['client'][_0xf5f2('0x9')]({'port':0x232a});config[_0xf5f2('0xa')]=_[_0xf5f2('0xb')](config[_0xf5f2('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xf5f2('0xc'))(new Redis(config[_0xf5f2('0xa')]));require(_0xf5f2('0xd'))[_0xf5f2('0xe')](socket);function respondWithRpcPromise(_0x2132bb,_0x358a14,_0x2fd284){return new BPromise(function(_0x44c12d,_0x1f092f){return client[_0xf5f2('0xf')](_0x2132bb,_0x2fd284)['then'](function(_0x4a0b15){logger['info'](_0xf5f2('0x10'),_0x358a14,'request\x20sent');logger[_0xf5f2('0x11')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x358a14,'request\x20sent',JSON[_0xf5f2('0x12')](_0x4a0b15));if(_0x4a0b15[_0xf5f2('0x13')]){if(_0x4a0b15[_0xf5f2('0x13')][_0xf5f2('0x14')]===0x1f4){logger['error'](_0xf5f2('0x10'),_0x358a14,_0x4a0b15[_0xf5f2('0x13')]['message']);return _0x1f092f(_0x4a0b15[_0xf5f2('0x13')][_0xf5f2('0x15')]);}logger[_0xf5f2('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x358a14,_0x4a0b15[_0xf5f2('0x13')][_0xf5f2('0x15')]);return _0x44c12d(_0x4a0b15[_0xf5f2('0x13')][_0xf5f2('0x15')]);}else{logger['info'](_0xf5f2('0x10'),_0x358a14,'request\x20sent');_0x44c12d(_0x4a0b15[_0xf5f2('0x16')][_0xf5f2('0x15')]);}})[_0xf5f2('0x17')](function(_0x59cc3d){logger[_0xf5f2('0x13')](_0xf5f2('0x10'),_0x358a14,_0x59cc3d);_0x1f092f(_0x59cc3d);});});}
\ No newline at end of file
+var _0xb641=['error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatWebsite.socket','register','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1382ad,_0xb139b8){var _0x26d191=function(_0x3d35a5){while(--_0x3d35a5){_0x1382ad['push'](_0x1382ad['shift']());}};_0x26d191(++_0xb139b8);}(_0xb641,0x90));var _0x1b64=function(_0x50490d,_0x1839ab){_0x50490d=_0x50490d-0x0;var _0x523645=_0xb641[_0x50490d];return _0x523645;};'use strict';var _=require(_0x1b64('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1b64('0x1'));var fs=require('fs');var Redis=require(_0x1b64('0x2'));var db=require(_0x1b64('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1b64('0x4'));var jayson=require(_0x1b64('0x5'));var client=jayson['client'][_0x1b64('0x6')]({'port':0x232a});config[_0x1b64('0x7')]=_[_0x1b64('0x8')](config[_0x1b64('0x7')],{'host':_0x1b64('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1b64('0xa'))[_0x1b64('0xb')](socket);function respondWithRpcPromise(_0xb05960,_0x2fce2e,_0x5abdc2){return new BPromise(function(_0x137c4b,_0x59e06c){return client['request'](_0xb05960,_0x5abdc2)['then'](function(_0x31e748){logger[_0x1b64('0xc')]('ChatWebsite,\x20%s,\x20%s',_0x2fce2e,_0x1b64('0xd'));logger[_0x1b64('0xe')](_0x1b64('0xf'),_0x2fce2e,'request\x20sent',JSON[_0x1b64('0x10')](_0x31e748));if(_0x31e748[_0x1b64('0x11')]){if(_0x31e748[_0x1b64('0x11')][_0x1b64('0x12')]===0x1f4){logger[_0x1b64('0x11')](_0x1b64('0x13'),_0x2fce2e,_0x31e748[_0x1b64('0x11')][_0x1b64('0x14')]);return _0x59e06c(_0x31e748[_0x1b64('0x11')]['message']);}logger[_0x1b64('0x11')](_0x1b64('0x13'),_0x2fce2e,_0x31e748[_0x1b64('0x11')]['message']);return _0x137c4b(_0x31e748['error'][_0x1b64('0x14')]);}else{logger[_0x1b64('0xc')](_0x1b64('0x13'),_0x2fce2e,_0x1b64('0xd'));_0x137c4b(_0x31e748[_0x1b64('0x15')][_0x1b64('0x14')]);}})[_0x1b64('0x16')](function(_0x108bb9){logger[_0x1b64('0x11')](_0x1b64('0x13'),_0x2fce2e,_0x108bb9);_0x59e06c(_0x108bb9);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 43b5079..c7c793b 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 _0xeb19=['./chatWebsite.events','remove','emit','removeListener','register','length','chatWebsite:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeb19,0xa8));var _0x9eb1=function(_0x4e9b1e,_0x192e42){_0x4e9b1e=_0x4e9b1e-0x0;var _0x18132d=_0xeb19[_0x4e9b1e];return _0x18132d;};'use strict';var ChatWebsiteEvents=require(_0x9eb1('0x0'));var events=['save',_0x9eb1('0x1'),'update'];function createListener(_0x365167,_0x3dd221){return function(_0x327787){_0x3dd221[_0x9eb1('0x2')](_0x365167,_0x327787);};}function removeListener(_0x5b5796,_0xe6d0e8){return function(){ChatWebsiteEvents[_0x9eb1('0x3')](_0x5b5796,_0xe6d0e8);};}exports[_0x9eb1('0x4')]=function(_0x268ced){for(var _0x531d1b=0x0,_0x2d1001=events[_0x9eb1('0x5')];_0x531d1b<_0x2d1001;_0x531d1b++){var _0xcff1e=events[_0x531d1b];var _0x127b6a=createListener(_0x9eb1('0x6')+_0xcff1e,_0x268ced);ChatWebsiteEvents['on'](_0xcff1e,_0x127b6a);}};
\ No newline at end of file
+var _0x1aa8=['save','remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events'];(function(_0x14405c,_0x12b9b9){var _0x5d54ba=function(_0x5eaba7){while(--_0x5eaba7){_0x14405c['push'](_0x14405c['shift']());}};_0x5d54ba(++_0x12b9b9);}(_0x1aa8,0x6b));var _0x81aa=function(_0x3b5cdd,_0x33a124){_0x3b5cdd=_0x3b5cdd-0x0;var _0x4aa391=_0x1aa8[_0x3b5cdd];return _0x4aa391;};'use strict';var ChatWebsiteEvents=require(_0x81aa('0x0'));var events=[_0x81aa('0x1'),_0x81aa('0x2'),_0x81aa('0x3')];function createListener(_0x2f10fa,_0x3aeb4f){return function(_0x1bdfd7){_0x3aeb4f[_0x81aa('0x4')](_0x2f10fa,_0x1bdfd7);};}function removeListener(_0x20d91f,_0x442f9c){return function(){ChatWebsiteEvents[_0x81aa('0x5')](_0x20d91f,_0x442f9c);};}exports[_0x81aa('0x6')]=function(_0x5466a6){for(var _0x21e345=0x0,_0x2d8cd8=events[_0x81aa('0x7')];_0x21e345<_0x2d8cd8;_0x21e345++){var _0xa52302=events[_0x21e345];var _0x18a268=createListener(_0x81aa('0x8')+_0xa52302,_0x5466a6);ChatWebsiteEvents['on'](_0xa52302,_0x18a268);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index a5a960d..35ffe9b 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 _0x7c5c=['addAgents','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','isAuthenticated','get','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','now','single','file','addLogo','join','server/files/images/avatars/','addCustomerAvatar','originalname','notify','server/files','attachments','offline-chat','ensureDir','replace','any','addInteraction','addApplications'];(function(_0x4c034e,_0x3617bc){var _0x2a775c=function(_0x2634c7){while(--_0x2634c7){_0x4c034e['push'](_0x4c034e['shift']());}};_0x2a775c(++_0x3617bc);}(_0x7c5c,0x1ba));var _0xc7c5=function(_0x7e114d,_0x23be84){_0x7e114d=_0x7e114d-0x0;var _0x4c520e=_0x7c5c[_0x7e114d];return _0x4c520e;};'use strict';var multer=require(_0xc7c5('0x0'));var util=require(_0xc7c5('0x1'));var path=require(_0xc7c5('0x2'));var timeout=require(_0xc7c5('0x3'));var express=require(_0xc7c5('0x4'));var router=express[_0xc7c5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc7c5('0x6'));var interaction=require(_0xc7c5('0x7'));var config=require('../../config/environment');var controller=require(_0xc7c5('0x8'));router['get']('/',auth[_0xc7c5('0x9')](),controller['index']);router[_0xc7c5('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xc7c5('0xa')]('/:id',auth[_0xc7c5('0x9')](),controller[_0xc7c5('0xb')]);router[_0xc7c5('0xa')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xc7c5('0xc')]);router['get'](_0xc7c5('0xd'),auth[_0xc7c5('0x9')](),controller[_0xc7c5('0xe')]);router['get'](_0xc7c5('0xf'),controller[_0xc7c5('0x10')]);router[_0xc7c5('0xa')](_0xc7c5('0x11'),controller[_0xc7c5('0x12')]);router[_0xc7c5('0xa')](_0xc7c5('0x13'),controller[_0xc7c5('0x14')]);router[_0xc7c5('0xa')](_0xc7c5('0x15'),controller['getSystemAvatar']);router[_0xc7c5('0xa')](_0xc7c5('0x16'),auth[_0xc7c5('0x9')](),controller[_0xc7c5('0x17')]);router[_0xc7c5('0xa')](_0xc7c5('0x18'),controller[_0xc7c5('0x19')]);router[_0xc7c5('0xa')](_0xc7c5('0x1a'),auth[_0xc7c5('0x9')](),controller[_0xc7c5('0x1b')]);router['get'](_0xc7c5('0x1c'),auth['isAuthenticated'](),controller[_0xc7c5('0x1d')]);router[_0xc7c5('0xa')](_0xc7c5('0x1e'),controller['getFields']);router[_0xc7c5('0xa')](_0xc7c5('0x1f'),auth['isAuthenticated'](),controller[_0xc7c5('0x20')]);router[_0xc7c5('0xa')](_0xc7c5('0x21'),auth['isAuthenticated'](),controller[_0xc7c5('0x22')]);router[_0xc7c5('0x23')]('/',auth[_0xc7c5('0x9')](),controller[_0xc7c5('0x24')]);router[_0xc7c5('0x23')](_0xc7c5('0x25'),auth['isAuthenticated'](),controller[_0xc7c5('0x26')]);router[_0xc7c5('0x23')](_0xc7c5('0xd'),auth['isAuthenticated'](),controller[_0xc7c5('0x27')]);var upload=multer({'storage':multer[_0xc7c5('0x28')]({'destination':function(_0x3f27c6,_0x2a0067,_0xbad3f2){_0xbad3f2(null,path['join'](config[_0xc7c5('0x29')],_0xc7c5('0x2a')));},'filename':function(_0x2efc7d,_0x4f9626,_0x2d007a){_0x2d007a(null,util[_0xc7c5('0x2b')](_0xc7c5('0x2c'),Date[_0xc7c5('0x2d')](),_0x4f9626['originalname']));}})});router[_0xc7c5('0x23')](_0xc7c5('0xf'),upload[_0xc7c5('0x2e')](_0xc7c5('0x2f')),controller[_0xc7c5('0x30')]);var upload=multer({'storage':multer[_0xc7c5('0x28')]({'destination':function(_0x1ed323,_0x1d5edb,_0x154276){_0x154276(null,path[_0xc7c5('0x31')](config['root'],_0xc7c5('0x32')));},'filename':function(_0x3b875a,_0x517aaa,_0x44ca42){_0x44ca42(null,util[_0xc7c5('0x2b')](_0xc7c5('0x2c'),Date[_0xc7c5('0x2d')](),_0x517aaa['originalname']));}})});router[_0xc7c5('0x23')](_0xc7c5('0x11'),upload[_0xc7c5('0x2e')](_0xc7c5('0x2f')),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3efd27,_0xe7f3bf,_0x2d4ec5){_0x2d4ec5(null,path['join'](config['root'],'server/files/images/avatars/'));},'filename':function(_0x3193b3,_0x3ef416,_0x155bb8){_0x155bb8(null,util[_0xc7c5('0x2b')](_0xc7c5('0x2c'),Date[_0xc7c5('0x2d')](),_0x3ef416['originalname']));}})});router[_0xc7c5('0x23')](_0xc7c5('0x13'),upload[_0xc7c5('0x2e')](_0xc7c5('0x2f')),controller[_0xc7c5('0x33')]);var upload=multer({'storage':multer[_0xc7c5('0x28')]({'destination':function(_0x48e16f,_0x597cae,_0x295f30){_0x295f30(null,path['join'](config[_0xc7c5('0x29')],_0xc7c5('0x32')));},'filename':function(_0x1a41d7,_0x359319,_0x351ec2){_0x351ec2(null,util[_0xc7c5('0x2b')]('%s-%s',Date['now'](),_0x359319[_0xc7c5('0x34')]));}})});router['post'](_0xc7c5('0x15'),upload['single'](_0xc7c5('0x2f')),controller['addSystemAvatar']);router[_0xc7c5('0x23')]('/:id/notify',controller[_0xc7c5('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0xc7c5('0x28')]({'destination':function(_0x455ccd,_0x1bd42e,_0x4a0197){const _0x5267c=path['join'](config['root'],_0xc7c5('0x36'),_0xc7c5('0x37'),_0xc7c5('0x38'));fs_extra[_0xc7c5('0x39')](_0x5267c,function(){_0x4a0197(null,_0x5267c);});},'filename':function(_0x4e4978,_0x570bc9,_0x298431){const _0xa4ba3f=_0x570bc9['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x168638=path['extname'](_0xa4ba3f);const _0x178ce5=Date[_0xc7c5('0x2d')]()+'-'+_0xa4ba3f[_0xc7c5('0x3a')](_0x168638,'')+_0x168638;_0x298431(null,_0x178ce5);}})});router[_0xc7c5('0x23')]('/:id/offline',offlineUploadMulter[_0xc7c5('0x3b')](),controller['offline']);router[_0xc7c5('0x23')](_0xc7c5('0x16'),auth[_0xc7c5('0x9')](),controller[_0xc7c5('0x3c')]);router[_0xc7c5('0x23')](_0xc7c5('0x1a'),auth[_0xc7c5('0x9')](),controller[_0xc7c5('0x3d')]);router['post']('/:id/proactive_actions',auth[_0xc7c5('0x9')](),controller['addProactiveActions']);router[_0xc7c5('0x23')](_0xc7c5('0x21'),auth[_0xc7c5('0x9')](),controller[_0xc7c5('0x3e')]);router[_0xc7c5('0x3f')](_0xc7c5('0x40'),auth['isAuthenticated'](),controller[_0xc7c5('0x41')]);router[_0xc7c5('0x42')](_0xc7c5('0x40'),auth['isAuthenticated'](),controller[_0xc7c5('0x43')]);router[_0xc7c5('0x42')]('/:id/dispositions',auth[_0xc7c5('0x9')](),controller[_0xc7c5('0x44')]);router[_0xc7c5('0x42')](_0xc7c5('0xd'),auth[_0xc7c5('0x9')](),controller[_0xc7c5('0x45')]);router[_0xc7c5('0x42')](_0xc7c5('0x21'),auth[_0xc7c5('0x9')](),controller[_0xc7c5('0x46')]);module[_0xc7c5('0x47')]=router;
\ No newline at end of file
+var _0x8de3=['getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addAnswer','join','format','originalname','file','addLogo','diskStorage','root','server/files/images/avatars/','%s-%s','addAvatar','now','single','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','ensureDir','replace','extname','offline','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getCustomerAvatar','/:id/system_avatar'];(function(_0x235826,_0x514a22){var _0x4660ab=function(_0x420315){while(--_0x420315){_0x235826['push'](_0x235826['shift']());}};_0x4660ab(++_0x514a22);}(_0x8de3,0x107));var _0x38de=function(_0x1f4ddf,_0x4ef2f8){_0x1f4ddf=_0x1f4ddf-0x0;var _0x169fea=_0x8de3[_0x1f4ddf];return _0x169fea;};'use strict';var multer=require('multer');var util=require(_0x38de('0x0'));var path=require(_0x38de('0x1'));var timeout=require(_0x38de('0x2'));var express=require(_0x38de('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x38de('0x4'));var interaction=require(_0x38de('0x5'));var config=require(_0x38de('0x6'));var controller=require('./chatWebsite.controller');router[_0x38de('0x7')]('/',auth[_0x38de('0x8')](),controller[_0x38de('0x9')]);router['get'](_0x38de('0xa'),auth['isAuthenticated'](),controller[_0x38de('0xb')]);router[_0x38de('0x7')](_0x38de('0xc'),auth[_0x38de('0x8')](),controller[_0x38de('0xd')]);router[_0x38de('0x7')]('/:id/dispositions',auth[_0x38de('0x8')](),controller[_0x38de('0xe')]);router[_0x38de('0x7')](_0x38de('0xf'),auth['isAuthenticated'](),controller[_0x38de('0x10')]);router[_0x38de('0x7')](_0x38de('0x11'),controller[_0x38de('0x12')]);router[_0x38de('0x7')]('/:id/avatar',controller['getAvatar']);router[_0x38de('0x7')]('/:id/customer_avatar',controller[_0x38de('0x13')]);router[_0x38de('0x7')](_0x38de('0x14'),controller[_0x38de('0x15')]);router[_0x38de('0x7')](_0x38de('0x16'),auth[_0x38de('0x8')](),controller[_0x38de('0x17')]);router[_0x38de('0x7')](_0x38de('0x18'),controller[_0x38de('0x19')]);router['get'](_0x38de('0x1a'),auth[_0x38de('0x8')](),controller[_0x38de('0x1b')]);router[_0x38de('0x7')]('/:id/proactive_actions',auth[_0x38de('0x8')](),controller[_0x38de('0x1c')]);router[_0x38de('0x7')](_0x38de('0x1d'),controller[_0x38de('0x1e')]);router[_0x38de('0x7')](_0x38de('0x1f'),auth[_0x38de('0x8')](),controller[_0x38de('0x20')]);router['get'](_0x38de('0x21'),auth[_0x38de('0x8')](),controller[_0x38de('0x22')]);router[_0x38de('0x23')]('/',auth[_0x38de('0x8')](),controller[_0x38de('0x24')]);router['post']('/:id/dispositions',auth[_0x38de('0x8')](),controller['addDisposition']);router[_0x38de('0x23')](_0x38de('0xf'),auth['isAuthenticated'](),controller[_0x38de('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x516172,_0x440db9,_0x252226){_0x252226(null,path[_0x38de('0x26')](config['root'],'server/files/images/logos/'));},'filename':function(_0x5b1e9c,_0x54c151,_0x3ad54d){_0x3ad54d(null,util[_0x38de('0x27')]('%s-%s',Date['now'](),_0x54c151[_0x38de('0x28')]));}})});router[_0x38de('0x23')]('/:id/logo',upload['single'](_0x38de('0x29')),controller[_0x38de('0x2a')]);var upload=multer({'storage':multer[_0x38de('0x2b')]({'destination':function(_0xb0b969,_0x9d2f39,_0x978b81){_0x978b81(null,path[_0x38de('0x26')](config[_0x38de('0x2c')],_0x38de('0x2d')));},'filename':function(_0x4132ed,_0x2ca0ce,_0x1f9545){_0x1f9545(null,util[_0x38de('0x27')](_0x38de('0x2e'),Date['now'](),_0x2ca0ce[_0x38de('0x28')]));}})});router['post']('/:id/avatar',upload['single'](_0x38de('0x29')),controller[_0x38de('0x2f')]);var upload=multer({'storage':multer[_0x38de('0x2b')]({'destination':function(_0x3ff51c,_0x1ac19,_0x395d48){_0x395d48(null,path['join'](config[_0x38de('0x2c')],'server/files/images/avatars/'));},'filename':function(_0x1827ee,_0x23cb98,_0x372b30){_0x372b30(null,util[_0x38de('0x27')](_0x38de('0x2e'),Date[_0x38de('0x30')](),_0x23cb98[_0x38de('0x28')]));}})});router['post']('/:id/customer_avatar',upload[_0x38de('0x31')](_0x38de('0x29')),controller[_0x38de('0x32')]);var upload=multer({'storage':multer[_0x38de('0x2b')]({'destination':function(_0x3325a7,_0x5f221d,_0x5f3e0b){_0x5f3e0b(null,path[_0x38de('0x26')](config[_0x38de('0x2c')],_0x38de('0x2d')));},'filename':function(_0x3aca33,_0x113b0b,_0x206610){_0x206610(null,util[_0x38de('0x27')](_0x38de('0x2e'),Date[_0x38de('0x30')](),_0x113b0b[_0x38de('0x28')]));}})});router[_0x38de('0x23')]('/:id/system_avatar',upload[_0x38de('0x31')](_0x38de('0x29')),controller[_0x38de('0x33')]);router['post'](_0x38de('0x34'),controller[_0x38de('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0x38de('0x2b')]({'destination':function(_0x48c6b2,_0x78e342,_0x2a2563){const _0x1e0b06=path['join'](config['root'],_0x38de('0x36'),_0x38de('0x37'),'offline-chat');fs_extra[_0x38de('0x38')](_0x1e0b06,function(){_0x2a2563(null,_0x1e0b06);});},'filename':function(_0x257e0d,_0x35b007,_0x2ae320){const _0x240d89=_0x35b007[_0x38de('0x28')][_0x38de('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4962a3=path[_0x38de('0x3a')](_0x240d89);const _0x447f37=Date[_0x38de('0x30')]()+'-'+_0x240d89[_0x38de('0x39')](_0x4962a3,'')+_0x4962a3;_0x2ae320(null,_0x447f37);}})});router[_0x38de('0x23')]('/:id/offline',offlineUploadMulter['any'](),controller[_0x38de('0x3b')]);router[_0x38de('0x23')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x38de('0x3c')]);router[_0x38de('0x23')](_0x38de('0x1a'),auth[_0x38de('0x8')](),controller[_0x38de('0x3d')]);router[_0x38de('0x23')](_0x38de('0x3e'),auth[_0x38de('0x8')](),controller[_0x38de('0x3f')]);router[_0x38de('0x23')](_0x38de('0x21'),auth[_0x38de('0x8')](),controller[_0x38de('0x40')]);router[_0x38de('0x41')](_0x38de('0xc'),auth[_0x38de('0x8')](),controller[_0x38de('0x42')]);router[_0x38de('0x43')](_0x38de('0xc'),auth[_0x38de('0x8')](),controller[_0x38de('0x44')]);router[_0x38de('0x43')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x38de('0x45')]);router['delete']('/:id/canned_answers',auth[_0x38de('0x8')](),controller[_0x38de('0x46')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 8d15be2..5f2e248 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 _0xd18e=['isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','Router','env','production','app','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs'];(function(_0x1bdf81,_0x35a998){var _0xbb3ce4=function(_0x1b9526){while(--_0x1b9526){_0x1bdf81['push'](_0x1bdf81['shift']());}};_0xbb3ce4(++_0x35a998);}(_0xd18e,0x120));var _0xed18=function(_0x17822e,_0xd8ebd1){_0x17822e=_0x17822e-0x0;var _0x41864f=_0xd18e[_0x17822e];return _0x41864f;};var beaverLogger=require(_0xed18('0x0'));var express=require(_0xed18('0x1'));var auth=require(_0xed18('0x2'));var config=require('../config/environment');var router=express[_0xed18('0x3')]();var isProduction=config[_0xed18('0x4')]===_0xed18('0x5')||![];function clientSideLogs(_0x2d38c4,_0x43d27b,_0x2c3071){var _0x15a1d8=_0x2d38c4[_0xed18('0x6')]['get'](_0xed18('0x7'));if(!_0x15a1d8){throw new Error(_0xed18('0x8'));}return beaverLogger[_0xed18('0x9')]({'uri':_0xed18('0xa'),'logger':_0x15a1d8,'enableCors':!isProduction})(_0x2d38c4,_0x43d27b,_0x2c3071);}router['use'](auth[_0xed18('0xb')](),clientSideLogs);module[_0xed18('0xc')]=router;
\ No newline at end of file
+var _0x1226=['Router','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','/client-logs','use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service'];(function(_0x3a27e8,_0x37ea40){var _0x3adfec=function(_0x36245e){while(--_0x36245e){_0x3a27e8['push'](_0x3a27e8['shift']());}};_0x3adfec(++_0x37ea40);}(_0x1226,0x173));var _0x6122=function(_0x41c166,_0x4251b0){_0x41c166=_0x41c166-0x0;var _0x132478=_0x1226[_0x41c166];return _0x132478;};var beaverLogger=require(_0x6122('0x0'));var express=require(_0x6122('0x1'));var auth=require(_0x6122('0x2'));var config=require('../config/environment');var router=express[_0x6122('0x3')]();var isProduction=config['env']==='production'||![];function clientSideLogs(_0x3f229a,_0xf7f1cd,_0x4f3591){var _0x590c2d=_0x3f229a['app'][_0x6122('0x4')](_0x6122('0x5'));if(!_0x590c2d){throw new Error(_0x6122('0x6'));}return beaverLogger['expressEndpoint']({'uri':_0x6122('0x7'),'logger':_0x590c2d,'enableCors':!isProduction})(_0x3f229a,_0xf7f1cd,_0x4f3591);}router[_0x6122('0x8')](auth[_0x6122('0x9')](),clientSideLogs);module[_0x6122('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 7be014a..3e9715e 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 _0xd78a=['Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd78a,0x1b9));var _0xad78=function(_0x12a6c7,_0x253cd9){_0x12a6c7=_0x12a6c7-0x0;var _0x3fd321=_0xd78a[_0x12a6c7];return _0x3fd321;};'use strict';var Sequelize=require(_0xad78('0x0'));module[_0xad78('0x1')]={'name':{'type':Sequelize[_0xad78('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xad78('0x3')](_0xad78('0x4'),_0xad78('0x5'),_0xad78('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xad78('0x3')](_0xad78('0x7'),_0xad78('0x8'))},'data1':{'type':Sequelize['STRING'],'comment':_0xad78('0x9')},'data2':{'type':Sequelize['STRING'],'comment':_0xad78('0xa')},'data3':{'type':Sequelize[_0xad78('0x2')],'comment':_0xad78('0xb')},'data4':{'type':Sequelize[_0xad78('0x2')],'comment':_0xad78('0xc')},'data5':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0xad78('0xd')],'comment':_0xad78('0xe')},'data7':{'type':Sequelize[_0xad78('0xd')],'comment':_0xad78('0xf')}};
\ No newline at end of file
+var _0xb665=['MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','STRING','ENUM','AmazonAWS','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret'];(function(_0xe41af8,_0x269f78){var _0x3cd469=function(_0x2f0996){while(--_0x2f0996){_0xe41af8['push'](_0xe41af8['shift']());}};_0x3cd469(++_0x269f78);}(_0xb665,0x66));var _0x5b66=function(_0x569b53,_0x3279f6){_0x569b53=_0x569b53-0x0;var _0x467e46=_0xb665[_0x569b53];return _0x467e46;};'use strict';var Sequelize=require('sequelize');module[_0x5b66('0x0')]={'name':{'type':Sequelize[_0x5b66('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x5b66('0x2')](_0x5b66('0x3'),'Google',_0x5b66('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x5b66('0x2')](_0x5b66('0x5'),_0x5b66('0x6'))},'data1':{'type':Sequelize['STRING'],'comment':_0x5b66('0x7')},'data2':{'type':Sequelize[_0x5b66('0x1')],'comment':_0x5b66('0x8')},'data3':{'type':Sequelize[_0x5b66('0x1')],'comment':_0x5b66('0x9')},'data4':{'type':Sequelize[_0x5b66('0x1')],'comment':_0x5b66('0xa')},'data5':{'type':Sequelize[_0x5b66('0xb')],'comment':_0x5b66('0xc')},'data6':{'type':Sequelize[_0x5b66('0xb')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x5b66('0xb')],'comment':_0x5b66('0xd')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 06d45d4..6f8b416 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 _0x3b06=['merge','VIRTUAL','filter','options','CloudProvider','include','service','decryptString','data3','catch','params','fields','length','includeAll','find','MicrosoftAzure','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','get','state','Invalid\x20state\x20parameter','parse','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','code','data5','data6','refresh_token','update','emit','microsoftAuthorization:success','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','redis','defaults','localhost','status','end','offset','undefined','limit','count','Content-Range','json','then','destroy','sendStatus','error','name','send','padEnd','slice','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','hasOwnProperty','order','sort','where'];(function(_0x3f71a2,_0x5ac519){var _0x4433ec=function(_0x47d998){while(--_0x47d998){_0x3f71a2['push'](_0x3f71a2['shift']());}};_0x4433ec(++_0x5ac519);}(_0x3b06,0xe9));var _0x63b0=function(_0xbc2974,_0xec3342){_0xbc2974=_0xbc2974-0x0;var _0x3a5b4f=_0x3b06[_0xbc2974];return _0x3a5b4f;};'use strict';var _=require(_0x63b0('0x0'));var Redis=require(_0x63b0('0x1'));var qs=require(_0x63b0('0x2'));var encryptor=require(_0x63b0('0x3'));var config=require(_0x63b0('0x4'));var logger=require(_0x63b0('0x5'))(_0x63b0('0x6'));var db=require(_0x63b0('0x7'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x63b0('0x8')]=_[_0x63b0('0x9')](config[_0x63b0('0x8')],{'host':_0x63b0('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x63b0('0x8')]));var redis=new Redis(config[_0x63b0('0x8')]);function respondWithStatusCode(_0x2cdbad,_0x346efd){_0x346efd=_0x346efd||0xcc;return function(_0x513b10){if(_0x513b10){return _0x2cdbad['sendStatus'](_0x346efd);}return _0x2cdbad[_0x63b0('0xb')](_0x346efd)[_0x63b0('0xc')]();};}function respondWithResult(_0x24ab4b,_0x3c30c8){_0x3c30c8=_0x3c30c8||0xc8;return function(_0xcec65){if(_0xcec65){return _0x24ab4b[_0x63b0('0xb')](_0x3c30c8)['json'](_0xcec65);}};}function respondWithFilteredResult(_0x1ef038,_0x3d6015){return function(_0xc653ae){if(_0xc653ae){var _0x54732e=typeof _0x3d6015[_0x63b0('0xd')]===_0x63b0('0xe')&&typeof _0x3d6015[_0x63b0('0xf')]===_0x63b0('0xe');var _0x4c8c57=_0xc653ae[_0x63b0('0x10')];var _0x58890a=_0x54732e?0x0:_0x3d6015['offset'];var _0x5789ae=_0x54732e?_0xc653ae['count']:_0x3d6015[_0x63b0('0xd')]+_0x3d6015[_0x63b0('0xf')];var _0x4e36f5;if(_0x5789ae>=_0x4c8c57){_0x5789ae=_0x4c8c57;_0x4e36f5=0xc8;}else{_0x4e36f5=0xce;}_0x1ef038[_0x63b0('0xb')](_0x4e36f5);return _0x1ef038['set'](_0x63b0('0x11'),_0x58890a+'-'+_0x5789ae+'/'+_0x4c8c57)[_0x63b0('0x12')](_0xc653ae);}return null;};}function saveUpdates(_0x1662fa){return function(_0xd30e4b){if(_0xd30e4b){return _0xd30e4b['update'](_0x1662fa)[_0x63b0('0x13')](function(_0x1cea6b){return _0x1cea6b;});}return null;};}function removeEntity(_0x2bc1c7){return function(_0x326918){if(_0x326918){return _0x326918[_0x63b0('0x14')]()[_0x63b0('0x13')](function(){_0x2bc1c7['status'](0xcc)[_0x63b0('0xc')]();});}};}function handleEntityNotFound(_0x18f3fd){return function(_0x2ab72e){if(!_0x2ab72e){_0x18f3fd[_0x63b0('0x15')](0x194);}return _0x2ab72e;};}function handleError(_0x3f718d,_0x47f646){_0x47f646=_0x47f646||0x1f4;return function(_0x51ea84){logger[_0x63b0('0x16')](_0x51ea84['stack']);if(_0x51ea84[_0x63b0('0x17')]){delete _0x51ea84[_0x63b0('0x17')];}_0x3f718d[_0x63b0('0xb')](_0x47f646)[_0x63b0('0x18')](_0x51ea84);};}function maskClientSecret(_0x5938a6){return _[_0x63b0('0x19')](_0x5938a6[_0x63b0('0x1a')](0x0,0x3),0x14,'*');}exports[_0x63b0('0x1b')]=function(_0x5cbd7f,_0x271fea){var _0x8ae2fb={},_0x238654={},_0x279730={'count':0x0,'rows':[]};var _0x128b26=_[_0x63b0('0x1c')](db['CloudProvider'][_0x63b0('0x1d')],function(_0x312997){return{'name':_0x312997[_0x63b0('0x1e')],'type':_0x312997[_0x63b0('0x1f')][_0x63b0('0x20')]};});_0x238654[_0x63b0('0x21')]=_[_0x63b0('0x1c')](_0x128b26,_0x63b0('0x17'));_0x238654['query']=_[_0x63b0('0x22')](_0x5cbd7f[_0x63b0('0x23')]);_0x238654[_0x63b0('0x24')]=_[_0x63b0('0x25')](_0x238654['model'],_0x238654[_0x63b0('0x23')]);_0x8ae2fb['attributes']=_[_0x63b0('0x25')](_0x238654[_0x63b0('0x21')],qs['fields'](_0x5cbd7f[_0x63b0('0x23')]['fields']));_0x8ae2fb['attributes']=_0x8ae2fb[_0x63b0('0x26')]['length']?_0x8ae2fb[_0x63b0('0x26')]:_0x238654[_0x63b0('0x21')];if(!_0x5cbd7f['query'][_0x63b0('0x27')]('nolimit')){_0x8ae2fb[_0x63b0('0xf')]=qs[_0x63b0('0xf')](_0x5cbd7f['query'][_0x63b0('0xf')]);_0x8ae2fb[_0x63b0('0xd')]=qs[_0x63b0('0xd')](_0x5cbd7f[_0x63b0('0x23')][_0x63b0('0xd')]);}_0x8ae2fb[_0x63b0('0x28')]=qs['sort'](_0x5cbd7f[_0x63b0('0x23')][_0x63b0('0x29')]);_0x8ae2fb[_0x63b0('0x2a')]=qs[_0x63b0('0x24')](_['pick'](_0x5cbd7f[_0x63b0('0x23')],_0x238654['filters']),_0x128b26);if(_0x5cbd7f[_0x63b0('0x23')]['filter']){_0x8ae2fb[_0x63b0('0x2a')]=_[_0x63b0('0x2b')](_0x8ae2fb[_0x63b0('0x2a')],{'$or':_['map'](_0x128b26,function(_0x2006c1){if(_0x2006c1[_0x63b0('0x1f')]!==_0x63b0('0x2c')){var _0x98ba86={};_0x98ba86[_0x2006c1[_0x63b0('0x17')]]={'$like':'%'+_0x5cbd7f[_0x63b0('0x23')][_0x63b0('0x2d')]+'%'};return _0x98ba86;}})});}_0x8ae2fb=_[_0x63b0('0x2b')]({},_0x8ae2fb,_0x5cbd7f[_0x63b0('0x2e')]);var _0x4483d9={'where':_0x8ae2fb[_0x63b0('0x2a')]};return db[_0x63b0('0x2f')][_0x63b0('0x10')](_0x4483d9)[_0x63b0('0x13')](function(_0x45f3d8){_0x279730['count']=_0x45f3d8;if(_0x5cbd7f[_0x63b0('0x23')]['includeAll']){_0x8ae2fb[_0x63b0('0x30')]=[{'all':!![]}];}return db[_0x63b0('0x2f')]['findAll'](_0x8ae2fb);})[_0x63b0('0x13')](function(_0x173495){_0x279730['rows']=_['map'](_0x173495,function(_0x54b046){if(_0x54b046[_0x63b0('0x31')]==='MicrosoftAzure'){var _0x350036=encryptor[_0x63b0('0x32')](_0x54b046[_0x63b0('0x33')]);_0x54b046['data3']=maskClientSecret(_0x350036);}return _0x54b046;});return _0x279730;})[_0x63b0('0x13')](respondWithFilteredResult(_0x271fea,_0x8ae2fb))[_0x63b0('0x34')](handleError(_0x271fea,null));};exports['show']=function(_0x2dcf90,_0x11f208){var _0x35b3f7={'raw':!![],'where':{'id':_0x2dcf90[_0x63b0('0x35')]['id']}},_0x1186a8={};_0x1186a8[_0x63b0('0x21')]=_[_0x63b0('0x22')](db[_0x63b0('0x2f')][_0x63b0('0x1d')]);_0x1186a8[_0x63b0('0x23')]=_[_0x63b0('0x22')](_0x2dcf90[_0x63b0('0x23')]);_0x1186a8[_0x63b0('0x24')]=_[_0x63b0('0x25')](_0x1186a8[_0x63b0('0x21')],_0x1186a8[_0x63b0('0x23')]);_0x35b3f7['attributes']=_[_0x63b0('0x25')](_0x1186a8[_0x63b0('0x21')],qs[_0x63b0('0x36')](_0x2dcf90[_0x63b0('0x23')]['fields']));_0x35b3f7[_0x63b0('0x26')]=_0x35b3f7[_0x63b0('0x26')][_0x63b0('0x37')]?_0x35b3f7[_0x63b0('0x26')]:_0x1186a8[_0x63b0('0x21')];if(_0x2dcf90[_0x63b0('0x23')][_0x63b0('0x38')]){_0x35b3f7[_0x63b0('0x30')]=[{'all':!![]}];}_0x35b3f7=_['merge']({},_0x35b3f7,_0x2dcf90['options']);return db[_0x63b0('0x2f')][_0x63b0('0x39')](_0x35b3f7)['then'](handleEntityNotFound(_0x11f208,null))[_0x63b0('0x13')](function(_0x1a36fe){if(_0x1a36fe[_0x63b0('0x31')]===_0x63b0('0x3a')){var _0x1c0fe5=encryptor[_0x63b0('0x32')](_0x1a36fe['data3']);_0x1a36fe['data3']=maskClientSecret(_0x1c0fe5);}return _0x1a36fe;})[_0x63b0('0x13')](respondWithResult(_0x11f208,null))[_0x63b0('0x34')](handleError(_0x11f208,null));};exports[_0x63b0('0x3b')]=function(_0x1a9947,_0x1e5f90){if(!_0x1a9947[_0x63b0('0x3c')][_0x63b0('0x17')])throw new Error(_0x63b0('0x3d'));if(!_0x1a9947[_0x63b0('0x3c')][_0x63b0('0x31')])throw new Error(_0x63b0('0x3e'));var _0x399be3=db[_0x63b0('0x2f')][_0x63b0('0x1d')][_0x63b0('0x31')][_0x63b0('0x3f')];if(!_0x399be3[_0x63b0('0x40')](_0x1a9947[_0x63b0('0x3c')][_0x63b0('0x31')]))throw new Error(_0x63b0('0x41')+_0x399be3['join'](',\x20'));if(_0x1a9947[_0x63b0('0x3c')][_0x63b0('0x31')]===_0x63b0('0x3a')&&_0x1a9947['body'][_0x63b0('0x33')]){_0x1a9947[_0x63b0('0x3c')]['data3']=encryptor[_0x63b0('0x42')](_0x1a9947[_0x63b0('0x3c')][_0x63b0('0x33')]);}return db['CloudProvider'][_0x63b0('0x3b')](_0x1a9947[_0x63b0('0x3c')],{})[_0x63b0('0x13')](respondWithResult(_0x1e5f90,0xc9))[_0x63b0('0x34')](handleError(_0x1e5f90,null));};exports['update']=function(_0x89d336,_0x5db07e){if(_0x89d336[_0x63b0('0x3c')]['id']){delete _0x89d336[_0x63b0('0x3c')]['id'];}return db[_0x63b0('0x2f')][_0x63b0('0x39')]({'where':{'id':_0x89d336[_0x63b0('0x35')]['id']}})[_0x63b0('0x13')](handleEntityNotFound(_0x5db07e,null))[_0x63b0('0x13')](function(_0x18f802){if(_0x18f802['service']===_0x63b0('0x3a')&&_0x89d336[_0x63b0('0x3c')][_0x63b0('0x33')]){_0x89d336[_0x63b0('0x3c')][_0x63b0('0x33')]=encryptor[_0x63b0('0x42')](_0x89d336[_0x63b0('0x3c')][_0x63b0('0x33')]);}return _0x18f802;})[_0x63b0('0x13')](saveUpdates(_0x89d336[_0x63b0('0x3c')],null))['then'](respondWithResult(_0x5db07e,null))[_0x63b0('0x34')](handleError(_0x5db07e,null));};exports[_0x63b0('0x14')]=function(_0x564d77,_0x16928a){return db['CloudProvider'][_0x63b0('0x39')]({'where':{'id':_0x564d77[_0x63b0('0x35')]['id']}})[_0x63b0('0x13')](handleEntityNotFound(_0x16928a,null))['then'](removeEntity(_0x16928a,null))['catch'](handleError(_0x16928a,null));};exports[_0x63b0('0x43')]=function(_0x205dfc,_0xd4852f){return db['CloudProvider'][_0x63b0('0x44')]({'where':{'id':_0x205dfc['params']['id']},'raw':!![]})[_0x63b0('0x13')](function(_0x4ceeb3){if(!_0x4ceeb3)return _0xd4852f[_0x63b0('0x15')](0x194);return{'url':oauth[_0x63b0('0x45')](_0x4ceeb3,_0x205dfc['user']['id'])};})[_0x63b0('0x13')](respondWithResult(_0xd4852f,null))[_0x63b0('0x34')](handleError(_0xd4852f,null));};exports['oauth2MicrosoftCallback']=function(_0xc1e96,_0x2673c4){var _0x3aee4f=_0xc1e96[_0x63b0('0x3c')];var _0x2ea717;var _0x430795;if(_0x3aee4f['error'])throw _0x3aee4f;redis[_0x63b0('0x46')](_0x3aee4f[_0x63b0('0x47')])['then'](function(_0x27e9c5){if(!_0x27e9c5)throw new Error(_0x63b0('0x48'));_0x2ea717=JSON[_0x63b0('0x49')](_0x27e9c5);var _0x128fcf=Buffer['from'](_0x3aee4f[_0x63b0('0x47')],_0x63b0('0x4a'))[_0x63b0('0x4b')](_0x63b0('0x4c'));_0x430795=JSON['parse'](_0x128fcf);if(!oauth[_0x63b0('0x4d')](_0x3aee4f[_0x63b0('0x4e')],_0x2ea717[_0x63b0('0x4f')]))throw new Error(_0x63b0('0x50'));redis[_0x63b0('0x51')](_0x3aee4f[_0x63b0('0x47')]);return oauth['getOauth2MicrosoftAccessToken'](_0x3aee4f[_0x63b0('0x52')],_0x2ea717);})['then'](function(_0x58de71){_0x2ea717[_0x63b0('0x53')]=_0x58de71['access_token'];_0x2ea717[_0x63b0('0x54')]=_0x58de71[_0x63b0('0x55')];return db[_0x63b0('0x2f')][_0x63b0('0x56')]({'data5':_0x2ea717[_0x63b0('0x53')],'data6':_0x2ea717['data6']},{'where':{'id':_0x2ea717['id']}});})['then'](function(){oauth['startRefreshInterval'](_0x2ea717);socket[_0x63b0('0x57')](_0x63b0('0x58'),{'id':_0x430795['id']});return;})[_0x63b0('0x13')](respondWithStatusCode(_0x2673c4,null))[_0x63b0('0x34')](function(_0x57e56a){if(_0x430795){socket[_0x63b0('0x57')]('microsoftAuthorization:error',{'id':_0x430795['id']});}if(!_0x2ea717){logger[_0x63b0('0x16')]('Invalid\x20authentication\x20state\x20parameter',_0x57e56a);return _0x2673c4[_0x63b0('0xb')](0x1f4)['send'](_0x57e56a[_0x63b0('0x59')]);}logger[_0x63b0('0x16')](_0x63b0('0x5a'),_0x2ea717['id'],JSON[_0x63b0('0x5b')](_0x57e56a));});};
\ No newline at end of file
+var _0x091c=['Service\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','params','oauth2MicrosoftAuthorize','user','oauth2MicrosoftCallback','get','state','from','base64','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','ioredis','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','service','data3','catch','show','include','find','MicrosoftAzure','decryptString','create','Name\x20parameter\x20not\x20specified','body'];(function(_0x469218,_0x440d05){var _0x187b4a=function(_0x72ec86){while(--_0x72ec86){_0x469218['push'](_0x469218['shift']());}};_0x187b4a(++_0x440d05);}(_0x091c,0xd8));var _0xc091=function(_0x5719f9,_0x19b313){_0x5719f9=_0x5719f9-0x0;var _0x2330d3=_0x091c[_0x5719f9];return _0x2330d3;};'use strict';var _=require('lodash');var Redis=require(_0xc091('0x0'));var qs=require('../../components/parsers/qs');var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0xc091('0x1'))(_0xc091('0x2'));var db=require('../../mysqldb')['db'];var oauth=require('./cloudProvider.oauth');config[_0xc091('0x3')]=_[_0xc091('0x4')](config[_0xc091('0x3')],{'host':_0xc091('0x5'),'port':0x18eb});var socket=require(_0xc091('0x6'))(new Redis(config['redis']));var redis=new Redis(config[_0xc091('0x3')]);function respondWithStatusCode(_0x2ad463,_0x2ea1b1){_0x2ea1b1=_0x2ea1b1||0xcc;return function(_0x49f103){if(_0x49f103){return _0x2ad463[_0xc091('0x7')](_0x2ea1b1);}return _0x2ad463[_0xc091('0x8')](_0x2ea1b1)[_0xc091('0x9')]();};}function respondWithResult(_0x2c2722,_0x170fec){_0x170fec=_0x170fec||0xc8;return function(_0x34f537){if(_0x34f537){return _0x2c2722[_0xc091('0x8')](_0x170fec)[_0xc091('0xa')](_0x34f537);}};}function respondWithFilteredResult(_0x2f94c4,_0x425f03){return function(_0x4a5ba9){if(_0x4a5ba9){var _0x218905=typeof _0x425f03[_0xc091('0xb')]===_0xc091('0xc')&&typeof _0x425f03[_0xc091('0xd')]===_0xc091('0xc');var _0x7a783a=_0x4a5ba9[_0xc091('0xe')];var _0x211839=_0x218905?0x0:_0x425f03['offset'];var _0x39e4e6=_0x218905?_0x4a5ba9['count']:_0x425f03[_0xc091('0xb')]+_0x425f03['limit'];var _0x316918;if(_0x39e4e6>=_0x7a783a){_0x39e4e6=_0x7a783a;_0x316918=0xc8;}else{_0x316918=0xce;}_0x2f94c4[_0xc091('0x8')](_0x316918);return _0x2f94c4[_0xc091('0xf')](_0xc091('0x10'),_0x211839+'-'+_0x39e4e6+'/'+_0x7a783a)[_0xc091('0xa')](_0x4a5ba9);}return null;};}function saveUpdates(_0xb46b9d){return function(_0x5276a7){if(_0x5276a7){return _0x5276a7[_0xc091('0x11')](_0xb46b9d)[_0xc091('0x12')](function(_0x171fd3){return _0x171fd3;});}return null;};}function removeEntity(_0x11fadc){return function(_0x4989c3){if(_0x4989c3){return _0x4989c3[_0xc091('0x13')]()[_0xc091('0x12')](function(){_0x11fadc[_0xc091('0x8')](0xcc)[_0xc091('0x9')]();});}};}function handleEntityNotFound(_0x36b4f3){return function(_0x1afb6c){if(!_0x1afb6c){_0x36b4f3[_0xc091('0x7')](0x194);}return _0x1afb6c;};}function handleError(_0x35b392,_0x96a33f){_0x96a33f=_0x96a33f||0x1f4;return function(_0x572bb7){logger[_0xc091('0x14')](_0x572bb7['stack']);if(_0x572bb7[_0xc091('0x15')]){delete _0x572bb7[_0xc091('0x15')];}_0x35b392['status'](_0x96a33f)[_0xc091('0x16')](_0x572bb7);};}function maskClientSecret(_0x429590){return _[_0xc091('0x17')](_0x429590[_0xc091('0x18')](0x0,0x3),0x14,'*');}exports[_0xc091('0x19')]=function(_0x2a69a9,_0x198045){var _0x525341={},_0x4b0315={},_0x1d6f38={'count':0x0,'rows':[]};var _0x4f10e1=_[_0xc091('0x1a')](db[_0xc091('0x1b')][_0xc091('0x1c')],function(_0x3df9f3){return{'name':_0x3df9f3[_0xc091('0x1d')],'type':_0x3df9f3[_0xc091('0x1e')][_0xc091('0x1f')]};});_0x4b0315['model']=_[_0xc091('0x1a')](_0x4f10e1,_0xc091('0x15'));_0x4b0315[_0xc091('0x20')]=_[_0xc091('0x21')](_0x2a69a9[_0xc091('0x20')]);_0x4b0315[_0xc091('0x22')]=_[_0xc091('0x23')](_0x4b0315[_0xc091('0x24')],_0x4b0315[_0xc091('0x20')]);_0x525341[_0xc091('0x25')]=_[_0xc091('0x23')](_0x4b0315[_0xc091('0x24')],qs[_0xc091('0x26')](_0x2a69a9[_0xc091('0x20')][_0xc091('0x26')]));_0x525341[_0xc091('0x25')]=_0x525341[_0xc091('0x25')][_0xc091('0x27')]?_0x525341['attributes']:_0x4b0315[_0xc091('0x24')];if(!_0x2a69a9['query'][_0xc091('0x28')](_0xc091('0x29'))){_0x525341['limit']=qs[_0xc091('0xd')](_0x2a69a9[_0xc091('0x20')]['limit']);_0x525341[_0xc091('0xb')]=qs[_0xc091('0xb')](_0x2a69a9[_0xc091('0x20')]['offset']);}_0x525341[_0xc091('0x2a')]=qs[_0xc091('0x2b')](_0x2a69a9['query'][_0xc091('0x2b')]);_0x525341[_0xc091('0x2c')]=qs[_0xc091('0x22')](_[_0xc091('0x2d')](_0x2a69a9[_0xc091('0x20')],_0x4b0315[_0xc091('0x22')]),_0x4f10e1);if(_0x2a69a9[_0xc091('0x20')][_0xc091('0x2e')]){_0x525341[_0xc091('0x2c')]=_[_0xc091('0x2f')](_0x525341['where'],{'$or':_['map'](_0x4f10e1,function(_0x215fba){if(_0x215fba['type']!=='VIRTUAL'){var _0x19a6f4={};_0x19a6f4[_0x215fba[_0xc091('0x15')]]={'$like':'%'+_0x2a69a9['query'][_0xc091('0x2e')]+'%'};return _0x19a6f4;}})});}_0x525341=_[_0xc091('0x2f')]({},_0x525341,_0x2a69a9[_0xc091('0x30')]);var _0x5e1134={'where':_0x525341[_0xc091('0x2c')]};return db[_0xc091('0x1b')]['count'](_0x5e1134)[_0xc091('0x12')](function(_0x1f5829){_0x1d6f38[_0xc091('0xe')]=_0x1f5829;if(_0x2a69a9['query'][_0xc091('0x31')]){_0x525341['include']=[{'all':!![]}];}return db[_0xc091('0x1b')][_0xc091('0x32')](_0x525341);})[_0xc091('0x12')](function(_0x36fce6){_0x1d6f38[_0xc091('0x33')]=_[_0xc091('0x1a')](_0x36fce6,function(_0xc8398c){if(_0xc8398c[_0xc091('0x34')]==='MicrosoftAzure'){var _0xcc49a8=encryptor['decryptString'](_0xc8398c[_0xc091('0x35')]);_0xc8398c['data3']=maskClientSecret(_0xcc49a8);}return _0xc8398c;});return _0x1d6f38;})[_0xc091('0x12')](respondWithFilteredResult(_0x198045,_0x525341))[_0xc091('0x36')](handleError(_0x198045,null));};exports[_0xc091('0x37')]=function(_0x535f52,_0x538c93){var _0x4f7b5c={'raw':!![],'where':{'id':_0x535f52['params']['id']}},_0x471a70={};_0x471a70[_0xc091('0x24')]=_[_0xc091('0x21')](db[_0xc091('0x1b')][_0xc091('0x1c')]);_0x471a70[_0xc091('0x20')]=_['keys'](_0x535f52[_0xc091('0x20')]);_0x471a70[_0xc091('0x22')]=_[_0xc091('0x23')](_0x471a70[_0xc091('0x24')],_0x471a70['query']);_0x4f7b5c[_0xc091('0x25')]=_[_0xc091('0x23')](_0x471a70[_0xc091('0x24')],qs[_0xc091('0x26')](_0x535f52[_0xc091('0x20')]['fields']));_0x4f7b5c[_0xc091('0x25')]=_0x4f7b5c['attributes'][_0xc091('0x27')]?_0x4f7b5c[_0xc091('0x25')]:_0x471a70['model'];if(_0x535f52[_0xc091('0x20')][_0xc091('0x31')]){_0x4f7b5c[_0xc091('0x38')]=[{'all':!![]}];}_0x4f7b5c=_[_0xc091('0x2f')]({},_0x4f7b5c,_0x535f52[_0xc091('0x30')]);return db[_0xc091('0x1b')][_0xc091('0x39')](_0x4f7b5c)['then'](handleEntityNotFound(_0x538c93,null))['then'](function(_0x4dcc4a){if(_0x4dcc4a[_0xc091('0x34')]===_0xc091('0x3a')){var _0x4e25fd=encryptor[_0xc091('0x3b')](_0x4dcc4a[_0xc091('0x35')]);_0x4dcc4a[_0xc091('0x35')]=maskClientSecret(_0x4e25fd);}return _0x4dcc4a;})[_0xc091('0x12')](respondWithResult(_0x538c93,null))[_0xc091('0x36')](handleError(_0x538c93,null));};exports[_0xc091('0x3c')]=function(_0x1d3c46,_0xaeac55){if(!_0x1d3c46['body']['name'])throw new Error(_0xc091('0x3d'));if(!_0x1d3c46[_0xc091('0x3e')][_0xc091('0x34')])throw new Error(_0xc091('0x3f'));var _0x4ca0f8=db['CloudProvider'][_0xc091('0x1c')][_0xc091('0x34')]['values'];if(!_0x4ca0f8[_0xc091('0x40')](_0x1d3c46[_0xc091('0x3e')][_0xc091('0x34')]))throw new Error(_0xc091('0x41')+_0x4ca0f8['join'](',\x20'));if(_0x1d3c46[_0xc091('0x3e')][_0xc091('0x34')]===_0xc091('0x3a')&&_0x1d3c46[_0xc091('0x3e')][_0xc091('0x35')]){_0x1d3c46[_0xc091('0x3e')][_0xc091('0x35')]=encryptor[_0xc091('0x42')](_0x1d3c46[_0xc091('0x3e')][_0xc091('0x35')]);}return db[_0xc091('0x1b')][_0xc091('0x3c')](_0x1d3c46['body'],{})[_0xc091('0x12')](respondWithResult(_0xaeac55,0xc9))[_0xc091('0x36')](handleError(_0xaeac55,null));};exports['update']=function(_0x14fbcb,_0x515076){if(_0x14fbcb[_0xc091('0x3e')]['id']){delete _0x14fbcb[_0xc091('0x3e')]['id'];}return db['CloudProvider'][_0xc091('0x39')]({'where':{'id':_0x14fbcb[_0xc091('0x43')]['id']}})[_0xc091('0x12')](handleEntityNotFound(_0x515076,null))['then'](function(_0x3169b0){if(_0x3169b0[_0xc091('0x34')]===_0xc091('0x3a')&&_0x14fbcb[_0xc091('0x3e')]['data3']){_0x14fbcb[_0xc091('0x3e')][_0xc091('0x35')]=encryptor['encryptString'](_0x14fbcb[_0xc091('0x3e')][_0xc091('0x35')]);}return _0x3169b0;})[_0xc091('0x12')](saveUpdates(_0x14fbcb['body'],null))[_0xc091('0x12')](respondWithResult(_0x515076,null))[_0xc091('0x36')](handleError(_0x515076,null));};exports[_0xc091('0x13')]=function(_0x36d454,_0xac8e86){return db[_0xc091('0x1b')]['find']({'where':{'id':_0x36d454['params']['id']}})[_0xc091('0x12')](handleEntityNotFound(_0xac8e86,null))['then'](removeEntity(_0xac8e86,null))[_0xc091('0x36')](handleError(_0xac8e86,null));};exports[_0xc091('0x44')]=function(_0x482cc6,_0x2ee736){return db['CloudProvider']['findOne']({'where':{'id':_0x482cc6[_0xc091('0x43')]['id']},'raw':!![]})['then'](function(_0x4798d6){if(!_0x4798d6)return _0x2ee736[_0xc091('0x7')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x4798d6,_0x482cc6[_0xc091('0x45')]['id'])};})[_0xc091('0x12')](respondWithResult(_0x2ee736,null))['catch'](handleError(_0x2ee736,null));};exports[_0xc091('0x46')]=function(_0x57f610,_0x57176a){var _0x1d0f5e=_0x57f610['body'];var _0x25cbb0;var _0x35dd01;if(_0x1d0f5e[_0xc091('0x14')])throw _0x1d0f5e;redis[_0xc091('0x47')](_0x1d0f5e[_0xc091('0x48')])[_0xc091('0x12')](function(_0x47b94c){if(!_0x47b94c)throw new Error('Invalid\x20state\x20parameter');_0x25cbb0=JSON['parse'](_0x47b94c);var _0x27bdfc=Buffer[_0xc091('0x49')](_0x1d0f5e['state'],_0xc091('0x4a'))['toString'](_0xc091('0x4b'));_0x35dd01=JSON['parse'](_0x27bdfc);if(!oauth[_0xc091('0x4c')](_0x1d0f5e[_0xc091('0x4d')],_0x25cbb0[_0xc091('0x4e')]))throw new Error(_0xc091('0x4f'));redis[_0xc091('0x50')](_0x1d0f5e[_0xc091('0x48')]);return oauth[_0xc091('0x51')](_0x1d0f5e[_0xc091('0x52')],_0x25cbb0);})[_0xc091('0x12')](function(_0x1c50d8){_0x25cbb0[_0xc091('0x53')]=_0x1c50d8[_0xc091('0x54')];_0x25cbb0[_0xc091('0x55')]=_0x1c50d8[_0xc091('0x56')];return db[_0xc091('0x1b')][_0xc091('0x11')]({'data5':_0x25cbb0[_0xc091('0x53')],'data6':_0x25cbb0[_0xc091('0x55')]},{'where':{'id':_0x25cbb0['id']}});})['then'](function(){oauth[_0xc091('0x57')](_0x25cbb0);socket[_0xc091('0x58')](_0xc091('0x59'),{'id':_0x35dd01['id']});return;})[_0xc091('0x12')](respondWithStatusCode(_0x57176a,null))[_0xc091('0x36')](function(_0x35648b){if(_0x35dd01){socket[_0xc091('0x58')](_0xc091('0x5a'),{'id':_0x35dd01['id']});}if(!_0x25cbb0){logger[_0xc091('0x14')](_0xc091('0x5b'),_0x35648b);return _0x57176a[_0xc091('0x8')](0x1f4)[_0xc091('0x16')](_0x35648b[_0xc091('0x5c')]);}logger[_0xc091('0x14')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x25cbb0['id'],JSON['stringify'](_0x35648b));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 32928f6..264da9a 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 _0x8fe1=['api','moment','request-promise','rimraf','../../config/environment','exports','define','CloudProvider','cloud_providers','lodash'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x8fe1,0xbd));var _0x18fe=function(_0xaa6a4,_0x64b067){_0xaa6a4=_0xaa6a4-0x0;var _0xdc31a4=_0x8fe1[_0xaa6a4];return _0xdc31a4;};'use strict';var _=require(_0x18fe('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x18fe('0x1'));var moment=require(_0x18fe('0x2'));var BPromise=require('bluebird');var rp=require(_0x18fe('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x18fe('0x4'));var config=require(_0x18fe('0x5'));var attributes=require('./cloudProvider.attributes');module[_0x18fe('0x6')]=function(_0x52190b,_0x52a23e){return _0x52190b[_0x18fe('0x7')](_0x18fe('0x8'),attributes,{'tableName':_0x18fe('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4519=['moment','bluebird','request-promise','path','./cloudProvider.attributes','exports','define','cloud_providers','util','../../config/logger','api'];(function(_0x50e40b,_0x338d17){var _0x2608b7=function(_0x4ded5e){while(--_0x4ded5e){_0x50e40b['push'](_0x50e40b['shift']());}};_0x2608b7(++_0x338d17);}(_0x4519,0xad));var _0x9451=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x4519[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var util=require(_0x9451('0x0'));var logger=require(_0x9451('0x1'))(_0x9451('0x2'));var moment=require(_0x9451('0x3'));var BPromise=require(_0x9451('0x4'));var rp=require(_0x9451('0x5'));var fs=require('fs');var path=require(_0x9451('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9451('0x7'));module[_0x9451('0x8')]=function(_0x1bfadc,_0x3dfb83){return _0x1bfadc[_0x9451('0x9')]('CloudProvider',attributes,{'tableName':_0x9451('0xa'),'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 79c7bb3..2ab9eef 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 _0xd0af=['exp','resolve','data3','CloudProvider','findOne','then','refresh_token','data6','data5','access_token','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','decryptString','POST','data2','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','crypto','jsonwebtoken','moment','request-promise','../../config/environment','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','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','https://outlook.office.com/SMTP.Send','openid','/authorize','map','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','{TENANT_ID}','code','id_token','stringify','toString','randomBytes','client_id','data1','response_type','redirect_uri','data4','response_mode','form_post','scope','state','nonce','prompt','login','value','oauth2Claims','oauth2/','set','decode','payload','issuer','aud','audience','isAfter','unix'];(function(_0x513b33,_0x3b061e){var _0x43d3fb=function(_0x61a7bc){while(--_0x61a7bc){_0x513b33['push'](_0x513b33['shift']());}};_0x43d3fb(++_0x3b061e);}(_0xd0af,0x1ef));var _0xfd0a=function(_0x1559a3,_0x1e4f51){_0x1559a3=_0x1559a3-0x0;var _0x3a4b87=_0xd0af[_0x1559a3];return _0x3a4b87;};'use strict';var _=require(_0xfd0a('0x0'));var crypto=require(_0xfd0a('0x1'));var jwt=require(_0xfd0a('0x2'));var moment=require(_0xfd0a('0x3'));var Redis=require('ioredis');var rp=require(_0xfd0a('0x4'));var util=require('util');var encryptor=require('../../components/encryptor');var config=require(_0xfd0a('0x5'));var logger=require('../../config/logger')(_0xfd0a('0x6'));var schedule=require(_0xfd0a('0x7'));var db=require(_0xfd0a('0x8'))['db'];config[_0xfd0a('0x9')]=_[_0xfd0a('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0xfd0a('0x9')]);var MICROSOFT_AUTH_URL=_0xfd0a('0xb');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0xfd0a('0xc'),_0xfd0a('0xd'),_0xfd0a('0xe'),_0xfd0a('0xf'),_0xfd0a('0x10'),_0xfd0a('0x11')],'Dynamics365':[_0xfd0a('0x12'),_0xfd0a('0xe')]};var MICROSOFT_AUTH_ENDPOINT=_0xfd0a('0x13');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x520427){var _0x5822c7=_[_0xfd0a('0x14')](AZURE_AUTH_SCOPES[_0x520427[_0xfd0a('0x15')]]);if(_0x520427[_0xfd0a('0x15')]===_0xfd0a('0x16'))_0x5822c7[_0xfd0a('0x17')](_0x520427[_0xfd0a('0x18')]+_0xfd0a('0x19'));return _0x5822c7[_0xfd0a('0x1a')]('\x20');}function getAccessTokenScope(_0x30fd3f){if(_0x30fd3f['type']===_0xfd0a('0x1b'))return _0xfd0a('0xf');if(_0x30fd3f['type']===_0xfd0a('0x16'))return _0x30fd3f[_0xfd0a('0x18')]+_0xfd0a('0x19');}function generateMicrosoftAuthorizationUrl(_0x5c2b37,_0x29671c){var _0x3cc2bd=MICROSOFT_AUTH_URL[_0xfd0a('0x1c')](_0xfd0a('0x1d'),_0x5c2b37['data2']);var _0xf9e5de=[_0xfd0a('0x1e'),_0xfd0a('0x1f')];var _0x538dd2=Buffer['from'](JSON[_0xfd0a('0x20')]({'id':_0x29671c}))[_0xfd0a('0x21')]('base64');var _0x2b3df8=crypto[_0xfd0a('0x22')](0x10)[_0xfd0a('0x21')]('hex');var _0x3fe248=getAuthorizationScopes(_0x5c2b37);var _0x1e8be2=[{'key':_0xfd0a('0x23'),'value':_0x5c2b37[_0xfd0a('0x24')]},{'key':_0xfd0a('0x25'),'value':encodeURIComponent(_0xf9e5de[_0xfd0a('0x1a')]('\x20'))},{'key':_0xfd0a('0x26'),'value':_0x5c2b37[_0xfd0a('0x27')]},{'key':_0xfd0a('0x28'),'value':_0xfd0a('0x29')},{'key':_0xfd0a('0x2a'),'value':encodeURIComponent(_0x3fe248)},{'key':_0xfd0a('0x2b'),'value':_0x538dd2},{'key':_0xfd0a('0x2c'),'value':_0x2b3df8},{'key':_0xfd0a('0x2d'),'value':_0xfd0a('0x2e')}];var _0x32f934=_0x3cc2bd+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x1e8be2,function(_0x2eb573){return _0x2eb573['key']+'='+_0x2eb573[_0xfd0a('0x2f')];})[_0xfd0a('0x1a')]('&');_0x5c2b37[_0xfd0a('0x30')]={'issuer':_0x3cc2bd[_0xfd0a('0x1c')](_0xfd0a('0x31'),''),'audience':_0x5c2b37[_0xfd0a('0x24')],'state':_0x538dd2,'nonce':_0x2b3df8};redis[_0xfd0a('0x32')](_0x538dd2,JSON[_0xfd0a('0x20')](_0x5c2b37));return _0x32f934;}function isValidIdToken(_0x4791e4,_0x20366c){try{var _0x39a77f=jwt[_0xfd0a('0x33')](_0x4791e4,{'complete':!![]});var _0x3cffda=_0x39a77f[_0xfd0a('0x34')];if(_0x3cffda['iss']!==_0x20366c[_0xfd0a('0x35')])return![];if(_0x3cffda[_0xfd0a('0x36')]!==_0x20366c[_0xfd0a('0x37')])return![];if(_0x3cffda['nonce']!==_0x20366c[_0xfd0a('0x2c')])return![];if(moment()[_0xfd0a('0x38')](moment[_0xfd0a('0x39')](_0x3cffda[_0xfd0a('0x3a')])))return![];return!![];}catch(_0x5ceb78){throw _0x5ceb78;}}function refreshOauth2MicrosoftAccessToken(_0x595433){return Promise[_0xfd0a('0x3b')]()['then'](function(){if(_0x595433[_0xfd0a('0x3c')])return _0x595433;return db[_0xfd0a('0x3d')][_0xfd0a('0x3e')]({'where':{'id':_0x595433['id']},'raw':!![]});})[_0xfd0a('0x3f')](function(_0x4e6462){var _0x45b05d={'grant_type':_0xfd0a('0x40'),'refresh_token':_0x4e6462[_0xfd0a('0x41')],'scope':getAccessTokenScope(_0x4e6462),'redirect_uri':_0x4e6462['data4'],'client_id':_0x4e6462[_0xfd0a('0x24')],'client_secret':encryptor['decryptString'](_0x4e6462[_0xfd0a('0x3c')])};var _0x561825={'method':'POST','uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x4e6462['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x45b05d,'json':!![]};return rp(_0x561825);})[_0xfd0a('0x3f')](function(_0x5a0150){_0x595433[_0xfd0a('0x42')]=_0x5a0150[_0xfd0a('0x43')];_0x595433[_0xfd0a('0x41')]=_0x5a0150[_0xfd0a('0x40')];return db[_0xfd0a('0x3d')]['update']({'data5':_0x595433[_0xfd0a('0x42')],'data6':_0x595433[_0xfd0a('0x41')]},{'where':{'id':_0x595433['id']}});})[_0xfd0a('0x3f')](function(){return _0x595433;})[_0xfd0a('0x44')](function(_0x10a01b){logger[_0xfd0a('0x45')](_0xfd0a('0x46'),_0x595433['id'],_0x10a01b);});}function getOauth2MicrosoftAccessToken(_0x5fc438,_0x47ef98){var _0x2654ab={'grant_type':'authorization_code','code':_0x5fc438,'scope':getAccessTokenScope(_0x47ef98),'redirect_uri':_0x47ef98['data4'],'client_id':_0x47ef98[_0xfd0a('0x24')],'client_secret':encryptor[_0xfd0a('0x47')](_0x47ef98[_0xfd0a('0x3c')])};var _0x544ec3={'method':_0xfd0a('0x48'),'uri':MICROSOFT_AUTH_URL[_0xfd0a('0x1c')](_0xfd0a('0x1d'),_0x47ef98[_0xfd0a('0x49')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2654ab,'json':!![]};return rp(_0x544ec3);}function startRefreshInterval(_0x1305d3){var _0x3451bc=schedule['intervals'];if(_0x3451bc[_0x1305d3['id']])clearInterval(_0x3451bc[_0x1305d3['id']]);_0x3451bc[_0x1305d3['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xfd0a('0x4a')](this,{'id':_0x1305d3['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x3451bc;}function startAllRefreshIntervals(){return db[_0xfd0a('0x3d')][_0xfd0a('0x4b')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x3f27bc){var _0x598070=_0x3f27bc[_0xfd0a('0x14')](function(_0x5884d1){return refreshOauth2MicrosoftAccessToken(_0x5884d1)[_0xfd0a('0x3f')](function(_0x17caf4){startRefreshInterval(_0x17caf4);});});return Promise[_0xfd0a('0x4c')](_0x598070);})[_0xfd0a('0x44')](function(_0x39ae2e){var _0x2ce610=_0x39ae2e?util[_0xfd0a('0x4d')](_0x39ae2e,{'showHidden':![],'depth':null}):'';logger[_0xfd0a('0x45')](_0xfd0a('0x4e'),_0x2ce610);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xbfa8=['from','stringify','toString','randomBytes','hex','client_id','data1','redirect_uri','data4','response_mode','form_post','scope','state','nonce','login','key','value','oauth2Claims','oauth2/','set','payload','iss','issuer','aud','audience','isAfter','exp','resolve','then','findOne','refresh_token','data6','decryptString','POST','data5','access_token','CloudProvider','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','data3','{TENANT_ID}','data2','intervals','bind','findAll','map','all','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','/authorize','/token','type','Dynamics365','data7','join','Outlook365','/.default','replace','code','id_token'];(function(_0x56d970,_0x42c6e6){var _0x9180e6=function(_0x38b9d9){while(--_0x38b9d9){_0x56d970['push'](_0x56d970['shift']());}};_0x9180e6(++_0x42c6e6);}(_0xbfa8,0x1dd));var _0x8bfa=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xbfa8[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x8bfa('0x0'));var crypto=require(_0x8bfa('0x1'));var jwt=require(_0x8bfa('0x2'));var moment=require(_0x8bfa('0x3'));var Redis=require(_0x8bfa('0x4'));var rp=require(_0x8bfa('0x5'));var util=require(_0x8bfa('0x6'));var encryptor=require(_0x8bfa('0x7'));var config=require(_0x8bfa('0x8'));var logger=require(_0x8bfa('0x9'))(_0x8bfa('0xa'));var schedule=require(_0x8bfa('0xb'));var db=require(_0x8bfa('0xc'))['db'];config[_0x8bfa('0xd')]=_[_0x8bfa('0xe')](config[_0x8bfa('0xd')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x8bfa('0xd')]);var MICROSOFT_AUTH_URL=_0x8bfa('0xf');var AZURE_AUTH_SCOPES={'Outlook365':[_0x8bfa('0x10'),_0x8bfa('0x11'),_0x8bfa('0x12'),_0x8bfa('0x13'),_0x8bfa('0x14'),_0x8bfa('0x15'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x8bfa('0x10'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x8bfa('0x16');var MICROSOFT_TOKEN_ENDPOINT=_0x8bfa('0x17');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x44f3bb){var _0x3011d8=_['map'](AZURE_AUTH_SCOPES[_0x44f3bb[_0x8bfa('0x18')]]);if(_0x44f3bb[_0x8bfa('0x18')]===_0x8bfa('0x19'))_0x3011d8['push'](_0x44f3bb[_0x8bfa('0x1a')]+'/.default');return _0x3011d8[_0x8bfa('0x1b')]('\x20');}function getAccessTokenScope(_0x31152b){if(_0x31152b[_0x8bfa('0x18')]===_0x8bfa('0x1c'))return _0x8bfa('0x14');if(_0x31152b[_0x8bfa('0x18')]===_0x8bfa('0x19'))return _0x31152b[_0x8bfa('0x1a')]+_0x8bfa('0x1d');}function generateMicrosoftAuthorizationUrl(_0x4b204d,_0x5c4e66){var _0x207b62=MICROSOFT_AUTH_URL[_0x8bfa('0x1e')]('{TENANT_ID}',_0x4b204d['data2']);var _0x793951=[_0x8bfa('0x1f'),_0x8bfa('0x20')];var _0x23eeed=Buffer[_0x8bfa('0x21')](JSON[_0x8bfa('0x22')]({'id':_0x5c4e66}))[_0x8bfa('0x23')]('base64');var _0x408301=crypto[_0x8bfa('0x24')](0x10)[_0x8bfa('0x23')](_0x8bfa('0x25'));var _0x43458c=getAuthorizationScopes(_0x4b204d);var _0x2a3a7d=[{'key':_0x8bfa('0x26'),'value':_0x4b204d[_0x8bfa('0x27')]},{'key':'response_type','value':encodeURIComponent(_0x793951[_0x8bfa('0x1b')]('\x20'))},{'key':_0x8bfa('0x28'),'value':_0x4b204d[_0x8bfa('0x29')]},{'key':_0x8bfa('0x2a'),'value':_0x8bfa('0x2b')},{'key':_0x8bfa('0x2c'),'value':encodeURIComponent(_0x43458c)},{'key':_0x8bfa('0x2d'),'value':_0x23eeed},{'key':_0x8bfa('0x2e'),'value':_0x408301},{'key':'prompt','value':_0x8bfa('0x2f')}];var _0xa1c5a5=_0x207b62+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x2a3a7d,function(_0x593f58){return _0x593f58[_0x8bfa('0x30')]+'='+_0x593f58[_0x8bfa('0x31')];})[_0x8bfa('0x1b')]('&');_0x4b204d[_0x8bfa('0x32')]={'issuer':_0x207b62[_0x8bfa('0x1e')](_0x8bfa('0x33'),''),'audience':_0x4b204d['data1'],'state':_0x23eeed,'nonce':_0x408301};redis[_0x8bfa('0x34')](_0x23eeed,JSON[_0x8bfa('0x22')](_0x4b204d));return _0xa1c5a5;}function isValidIdToken(_0x4b3e6b,_0x167acd){try{var _0x47be07=jwt['decode'](_0x4b3e6b,{'complete':!![]});var _0x6c6ff1=_0x47be07[_0x8bfa('0x35')];if(_0x6c6ff1[_0x8bfa('0x36')]!==_0x167acd[_0x8bfa('0x37')])return![];if(_0x6c6ff1[_0x8bfa('0x38')]!==_0x167acd[_0x8bfa('0x39')])return![];if(_0x6c6ff1[_0x8bfa('0x2e')]!==_0x167acd[_0x8bfa('0x2e')])return![];if(moment()[_0x8bfa('0x3a')](moment['unix'](_0x6c6ff1[_0x8bfa('0x3b')])))return![];return!![];}catch(_0x275789){throw _0x275789;}}function refreshOauth2MicrosoftAccessToken(_0x47f8b3){return Promise[_0x8bfa('0x3c')]()[_0x8bfa('0x3d')](function(){if(_0x47f8b3['data3'])return _0x47f8b3;return db['CloudProvider'][_0x8bfa('0x3e')]({'where':{'id':_0x47f8b3['id']},'raw':!![]});})[_0x8bfa('0x3d')](function(_0x9e4381){var _0x18707a={'grant_type':_0x8bfa('0x3f'),'refresh_token':_0x9e4381[_0x8bfa('0x40')],'scope':getAccessTokenScope(_0x9e4381),'redirect_uri':_0x9e4381[_0x8bfa('0x29')],'client_id':_0x9e4381['data1'],'client_secret':encryptor[_0x8bfa('0x41')](_0x9e4381['data3'])};var _0x21f830={'method':_0x8bfa('0x42'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x9e4381['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x18707a,'json':!![]};return rp(_0x21f830);})[_0x8bfa('0x3d')](function(_0x341a86){_0x47f8b3[_0x8bfa('0x43')]=_0x341a86[_0x8bfa('0x44')];_0x47f8b3[_0x8bfa('0x40')]=_0x341a86[_0x8bfa('0x3f')];return db[_0x8bfa('0x45')][_0x8bfa('0x46')]({'data5':_0x47f8b3[_0x8bfa('0x43')],'data6':_0x47f8b3[_0x8bfa('0x40')]},{'where':{'id':_0x47f8b3['id']}});})[_0x8bfa('0x3d')](function(){return _0x47f8b3;})[_0x8bfa('0x47')](function(_0xc3db0d){logger['error'](_0x8bfa('0x48'),_0x47f8b3['id'],_0xc3db0d);});}function getOauth2MicrosoftAccessToken(_0x4e3e00,_0x3dad44){var _0x106849={'grant_type':'authorization_code','code':_0x4e3e00,'scope':getAccessTokenScope(_0x3dad44),'redirect_uri':_0x3dad44['data4'],'client_id':_0x3dad44[_0x8bfa('0x27')],'client_secret':encryptor[_0x8bfa('0x41')](_0x3dad44[_0x8bfa('0x49')])};var _0x470f8e={'method':_0x8bfa('0x42'),'uri':MICROSOFT_AUTH_URL[_0x8bfa('0x1e')](_0x8bfa('0x4a'),_0x3dad44[_0x8bfa('0x4b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x106849,'json':!![]};return rp(_0x470f8e);}function startRefreshInterval(_0x45c17c){var _0x123a0b=schedule[_0x8bfa('0x4c')];if(_0x123a0b[_0x45c17c['id']])clearInterval(_0x123a0b[_0x45c17c['id']]);_0x123a0b[_0x45c17c['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x8bfa('0x4d')](this,{'id':_0x45c17c['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x123a0b;}function startAllRefreshIntervals(){return db[_0x8bfa('0x45')][_0x8bfa('0x4e')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x55a52d){var _0x2b2266=_0x55a52d[_0x8bfa('0x4f')](function(_0x2de7ec){return refreshOauth2MicrosoftAccessToken(_0x2de7ec)[_0x8bfa('0x3d')](function(_0x5c4583){startRefreshInterval(_0x5c4583);});});return Promise[_0x8bfa('0x50')](_0x2b2266);})[_0x8bfa('0x47')](function(_0x31be30){var _0x5ea21d=_0x31be30?util[_0x8bfa('0x51')](_0x31be30,{'showHidden':![],'depth':null}):'';logger[_0x8bfa('0x52')](_0x8bfa('0x53'),_0x5ea21d);});}module[_0x8bfa('0x54')]={'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 3d0600b..7c3e380 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 _0x96f2=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','moment','bluebird','randomstring'];(function(_0x2efe3d,_0x1f5e3e){var _0x52117c=function(_0x7b6e52){while(--_0x7b6e52){_0x2efe3d['push'](_0x2efe3d['shift']());}};_0x52117c(++_0x1f5e3e);}(_0x96f2,0xb0));var _0x296f=function(_0x44a39f,_0x3c6f4a){_0x44a39f=_0x44a39f-0x0;var _0x10efdc=_0x96f2[_0x44a39f];return _0x10efdc;};'use strict';var _=require(_0x296f('0x0'));var util=require('util');var moment=require(_0x296f('0x1'));var BPromise=require(_0x296f('0x2'));var rs=require(_0x296f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x296f('0x4'))['db'];var utils=require(_0x296f('0x5'));var logger=require(_0x296f('0x6'))('rpc');var config=require(_0x296f('0x7'));var jayson=require(_0x296f('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x164031,_0x1d019f,_0x2dc0ca){return new BPromise(function(_0x28f708,_0x30ed43){return client[_0x296f('0x9')](_0x164031,_0x2dc0ca)[_0x296f('0xa')](function(_0x3ea699){logger[_0x296f('0xb')](_0x296f('0xc'),_0x1d019f,'request\x20sent');logger[_0x296f('0xd')](_0x296f('0xe'),_0x1d019f,_0x296f('0xf'),JSON['stringify'](_0x3ea699));if(_0x3ea699[_0x296f('0x10')]){if(_0x3ea699[_0x296f('0x10')][_0x296f('0x11')]===0x1f4){logger[_0x296f('0x10')]('CloudProvider,\x20%s,\x20%s',_0x1d019f,_0x3ea699['error']['message']);return _0x30ed43(_0x3ea699[_0x296f('0x10')][_0x296f('0x12')]);}logger[_0x296f('0x10')](_0x296f('0xc'),_0x1d019f,_0x3ea699['error'][_0x296f('0x12')]);return _0x28f708(_0x3ea699['error']['message']);}else{logger[_0x296f('0xb')](_0x296f('0xc'),_0x1d019f,_0x296f('0xf'));_0x28f708(_0x3ea699[_0x296f('0x13')]['message']);}})['catch'](function(_0x3e3860){logger['error'](_0x296f('0xc'),_0x1d019f,_0x3e3860);_0x30ed43(_0x3e3860);});});}
\ No newline at end of file
+var _0x0598=['../../config/utils','jayson/promise','client','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util','bluebird','../../mysqldb'];(function(_0x389a65,_0x5ed8e8){var _0x360e61=function(_0x195028){while(--_0x195028){_0x389a65['push'](_0x389a65['shift']());}};_0x360e61(++_0x5ed8e8);}(_0x0598,0x92));var _0x8059=function(_0x473997,_0x35b0b4){_0x473997=_0x473997-0x0;var _0x3293c9=_0x0598[_0x473997];return _0x3293c9;};'use strict';var _=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var moment=require('moment');var BPromise=require(_0x8059('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8059('0x3'))['db'];var utils=require(_0x8059('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8059('0x5'));var client=jayson[_0x8059('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5996d7,_0x248273,_0x347f1b){return new BPromise(function(_0x4610d2,_0x116946){return client['request'](_0x5996d7,_0x347f1b)['then'](function(_0x89dda1){logger[_0x8059('0x7')](_0x8059('0x8'),_0x248273,_0x8059('0x9'));logger[_0x8059('0xa')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x248273,'request\x20sent',JSON[_0x8059('0xb')](_0x89dda1));if(_0x89dda1[_0x8059('0xc')]){if(_0x89dda1['error']['code']===0x1f4){logger['error'](_0x8059('0x8'),_0x248273,_0x89dda1[_0x8059('0xc')][_0x8059('0xd')]);return _0x116946(_0x89dda1[_0x8059('0xc')][_0x8059('0xd')]);}logger['error'](_0x8059('0x8'),_0x248273,_0x89dda1['error'][_0x8059('0xd')]);return _0x4610d2(_0x89dda1['error'][_0x8059('0xd')]);}else{logger[_0x8059('0x7')](_0x8059('0x8'),_0x248273,'request\x20sent');_0x4610d2(_0x89dda1['result']['message']);}})[_0x8059('0xe')](function(_0x239195){logger[_0x8059('0xc')](_0x8059('0x8'),_0x248273,_0x239195);_0x116946(_0x239195);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 540d27d..35b9018 100644
--- a/server/api/cloudProvider/index.js
+++ b/server/api/cloudProvider/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x13be3a,_0x9e14ec){var _0x41d6e2=function(_0x3e25a4){while(--_0x3e25a4){_0x13be3a['push'](_0x13be3a['shift']());}};_0x41d6e2(++_0x9e14ec);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xc4aa[_0x5a776b];return _0xbbef59;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router;
\ No newline at end of file
+var _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x1c7eff,_0x18a2fa){var _0x27bd7a=function(_0x53b6db){while(--_0x53b6db){_0x1c7eff['push'](_0x1c7eff['shift']());}};_0x27bd7a(++_0x18a2fa);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc4aa[_0x3ab51d];return _0x29a04e;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 564b52c..66ee5c8 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 _0x299d=['STRING','name'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0x299d,0x168));var _0xd299=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x299d[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd299('0x0')],'unique':_0xd299('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xd299('0x0')]},'companyId':{'type':Sequelize[_0xd299('0x0')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xd299('0x0')]},'postalCode':{'type':Sequelize[_0xd299('0x0')]},'city':{'type':Sequelize[_0xd299('0x0')]},'country':{'type':Sequelize[_0xd299('0x0')]},'email':{'type':Sequelize[_0xd299('0x0')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xd299('0x0')]},'sStreet':{'type':Sequelize[_0xd299('0x0')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xd299('0x0')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd299('0x0')]}};
\ No newline at end of file
+var _0x81c2=['exports','name','STRING','sequelize'];(function(_0x4d3851,_0xb854ef){var _0x1b659f=function(_0x4973b0){while(--_0x4973b0){_0x4d3851['push'](_0x4d3851['shift']());}};_0x1b659f(++_0xb854ef);}(_0x81c2,0xdf));var _0x281c=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x81c2[_0x1b6186];return _0x186121;};'use strict';var Sequelize=require(_0x281c('0x0'));module[_0x281c('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x281c('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x281c('0x3')]},'companyId':{'type':Sequelize[_0x281c('0x3')]},'website':{'type':Sequelize[_0x281c('0x3')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x281c('0x3')]},'type':{'type':Sequelize[_0x281c('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x281c('0x3')]},'city':{'type':Sequelize[_0x281c('0x3')]},'country':{'type':Sequelize[_0x281c('0x3')]},'email':{'type':Sequelize[_0x281c('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x281c('0x3')]},'sStreet':{'type':Sequelize[_0x281c('0x3')]},'sPostalCode':{'type':Sequelize[_0x281c('0x3')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x281c('0x3')]},'description':{'type':Sequelize[_0x281c('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 324d1bc..32fe028 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 _0x2f34=['role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','CmContact','addContacts','ids','getContacts','findOne','map','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','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/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','get','then','end','sendStatus','error','stack','name','send','index','CmCompany','describe','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x30e279,_0x53c1b6){var _0x1f2b79=function(_0x1e0e1f){while(--_0x1e0e1f){_0x30e279['push'](_0x30e279['shift']());}};_0x1f2b79(++_0x53c1b6);}(_0x2f34,0x1ca));var _0x42f3=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0x2f34[_0x24259d];return _0x5a701;};'use strict';var emlformat=require(_0x42f3('0x0'));var rimraf=require(_0x42f3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x42f3('0x2'));var rp=require(_0x42f3('0x3'));var moment=require(_0x42f3('0x4'));var BPromise=require(_0x42f3('0x5'));var Mustache=require(_0x42f3('0x6'));var util=require('util');var path=require(_0x42f3('0x7'));var sox=require('sox');var csv=require(_0x42f3('0x8'));var ejs=require(_0x42f3('0x9'));var fs=require('fs');var fs_extra=require(_0x42f3('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x42f3('0xb'));var jsforce=require(_0x42f3('0xc'));var deskjs=require(_0x42f3('0xd'));var toCsv=require('to-csv');var querystring=require(_0x42f3('0xe'));var Papa=require(_0x42f3('0xf'));var Redis=require(_0x42f3('0x10'));var authService=require(_0x42f3('0x11'));var qs=require(_0x42f3('0x12'));var as=require(_0x42f3('0x13'));var hardwareService=require(_0x42f3('0x14'));var logger=require(_0x42f3('0x15'))(_0x42f3('0x16'));var utils=require(_0x42f3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x42f3('0x18'));var db=require(_0x42f3('0x19'))['db'];function respondWithStatusCode(_0x2b1908,_0x269987){_0x269987=_0x269987||0xcc;return function(_0x24b44b){if(_0x24b44b){return _0x2b1908['sendStatus'](_0x269987);}return _0x2b1908[_0x42f3('0x1a')](_0x269987)['end']();};}function respondWithResult(_0x12cde3,_0x2cc004){_0x2cc004=_0x2cc004||0xc8;return function(_0xd48011){if(_0xd48011){return _0x12cde3[_0x42f3('0x1a')](_0x2cc004)[_0x42f3('0x1b')](_0xd48011);}};}function respondWithFilteredResult(_0x54a976,_0x4f84c2){return function(_0x103856){if(_0x103856){var _0x401596=typeof _0x4f84c2[_0x42f3('0x1c')]===_0x42f3('0x1d')&&typeof _0x4f84c2[_0x42f3('0x1e')]==='undefined';var _0x2f2a3b=_0x103856[_0x42f3('0x1f')];var _0x1de961=_0x401596?0x0:_0x4f84c2[_0x42f3('0x1c')];var _0x355a5e=_0x401596?_0x103856['count']:_0x4f84c2[_0x42f3('0x1c')]+_0x4f84c2[_0x42f3('0x1e')];var _0x18735b;if(_0x355a5e>=_0x2f2a3b){_0x355a5e=_0x2f2a3b;_0x18735b=0xc8;}else{_0x18735b=0xce;}_0x54a976[_0x42f3('0x1a')](_0x18735b);return _0x54a976[_0x42f3('0x20')](_0x42f3('0x21'),_0x1de961+'-'+_0x355a5e+'/'+_0x2f2a3b)[_0x42f3('0x1b')](_0x103856);}return null;};}function patchUpdates(_0x58f298){return function(_0x1997b9){try{jsonpatch[_0x42f3('0x22')](_0x1997b9,_0x58f298,!![]);}catch(_0xc935af){return BPromise['reject'](_0xc935af);}return _0x1997b9[_0x42f3('0x23')]();};}function saveUpdates(_0x1dc3c7,_0x37cd43){return function(_0x49e99f){if(_0x49e99f){return _0x49e99f['update'](_0x1dc3c7)['then'](function(_0x38af7e){return _0x38af7e;});}return null;};}function removeEntity(_0x3b1309,_0x12bf8b){return function(_0x4d4295){if(_0x4d4295){return _0x4d4295[_0x42f3('0x24')]()['then'](function(){var _0x195d86=_0x4d4295[_0x42f3('0x25')]({'plain':!![]});var _0xec08f4='Companies';return db['UserProfileResource']['destroy']({'where':{'type':_0xec08f4,'resourceId':_0x195d86['id']}})[_0x42f3('0x26')](function(){return _0x4d4295;});})[_0x42f3('0x26')](function(){_0x3b1309[_0x42f3('0x1a')](0xcc)[_0x42f3('0x27')]();});}};}function handleEntityNotFound(_0x1e0b53,_0x4b6f03){return function(_0x14a994){if(!_0x14a994){_0x1e0b53[_0x42f3('0x28')](0x194);}return _0x14a994;};}function handleError(_0x54b62d,_0x361456){_0x361456=_0x361456||0x1f4;return function(_0x57579e){logger[_0x42f3('0x29')](_0x57579e[_0x42f3('0x2a')]);if(_0x57579e[_0x42f3('0x2b')]){delete _0x57579e[_0x42f3('0x2b')];}_0x54b62d[_0x42f3('0x1a')](_0x361456)[_0x42f3('0x2c')](_0x57579e);};}exports[_0x42f3('0x2d')]=function(_0x5023da,_0x27fa07){var _0x3d7044={},_0x54e81f={},_0x51e3e1={'count':0x0,'rows':[]};return db[_0x42f3('0x2e')][_0x42f3('0x2f')]()[_0x42f3('0x26')](function(_0x2b9686){_0x54e81f['model']=_['keys'](_0x2b9686);_0x54e81f[_0x42f3('0x30')]=_[_0x42f3('0x31')](_0x5023da[_0x42f3('0x30')]);_0x54e81f[_0x42f3('0x32')]=_[_0x42f3('0x33')](_0x54e81f[_0x42f3('0x34')],_0x54e81f[_0x42f3('0x30')]);_0x3d7044['attributes']=_['intersection'](_0x54e81f[_0x42f3('0x34')],qs[_0x42f3('0x35')](_0x5023da[_0x42f3('0x30')][_0x42f3('0x35')]));_0x3d7044[_0x42f3('0x36')]=_0x3d7044['attributes']['length']?_0x3d7044[_0x42f3('0x36')]:_0x54e81f['model'];if(!_0x5023da[_0x42f3('0x30')][_0x42f3('0x37')](_0x42f3('0x38'))){_0x3d7044[_0x42f3('0x1e')]=qs[_0x42f3('0x1e')](_0x5023da[_0x42f3('0x30')][_0x42f3('0x1e')]);_0x3d7044[_0x42f3('0x1c')]=qs[_0x42f3('0x1c')](_0x5023da[_0x42f3('0x30')][_0x42f3('0x1c')]);}_0x3d7044[_0x42f3('0x39')]=qs[_0x42f3('0x3a')](_0x5023da['query'][_0x42f3('0x3a')]);_0x3d7044[_0x42f3('0x3b')]=qs[_0x42f3('0x32')](_[_0x42f3('0x3c')](_0x5023da['query'],_0x54e81f[_0x42f3('0x32')]),_0x2b9686);if(_0x5023da[_0x42f3('0x30')][_0x42f3('0x3d')]){_0x3d7044[_0x42f3('0x3b')]=_[_0x42f3('0x3e')](_0x3d7044[_0x42f3('0x3b')],{'$or':_['map'](_0x3d7044['attributes'],function(_0x137883){var _0x248f79={};_0x248f79[_0x137883]={'$like':'%'+_0x5023da[_0x42f3('0x30')]['filter']+'%'};return _0x248f79;})});}_0x3d7044=_[_0x42f3('0x3e')]({},_0x3d7044,_0x5023da[_0x42f3('0x3f')]);var _0x385f5f={'where':_0x3d7044[_0x42f3('0x3b')]};return db['CmCompany'][_0x42f3('0x1f')](_0x385f5f)['then'](function(_0x535ba1){_0x51e3e1[_0x42f3('0x1f')]=_0x535ba1;if(_0x5023da[_0x42f3('0x30')][_0x42f3('0x40')]){_0x3d7044[_0x42f3('0x41')]=[{'all':!![]}];}return db[_0x42f3('0x2e')]['findAll'](_0x3d7044);})[_0x42f3('0x26')](function(_0x199fb8){_0x51e3e1[_0x42f3('0x42')]=_0x199fb8;return _0x51e3e1;})[_0x42f3('0x26')](respondWithFilteredResult(_0x27fa07,_0x3d7044))[_0x42f3('0x43')](handleError(_0x27fa07,null));})[_0x42f3('0x43')](handleError(_0x27fa07,null));};exports[_0x42f3('0x44')]=function(_0x376cd6,_0x39f29e){var _0x28e994={'raw':![],'where':{'id':_0x376cd6[_0x42f3('0x45')]['id']}},_0x1dc84a={};_0x1dc84a[_0x42f3('0x34')]=_[_0x42f3('0x31')](db[_0x42f3('0x2e')][_0x42f3('0x46')]);_0x1dc84a['query']=_[_0x42f3('0x31')](_0x376cd6['query']);_0x1dc84a[_0x42f3('0x32')]=_[_0x42f3('0x33')](_0x1dc84a[_0x42f3('0x34')],_0x1dc84a[_0x42f3('0x30')]);_0x28e994[_0x42f3('0x36')]=_[_0x42f3('0x33')](_0x1dc84a['model'],qs[_0x42f3('0x35')](_0x376cd6['query'][_0x42f3('0x35')]));_0x28e994[_0x42f3('0x36')]=_0x28e994[_0x42f3('0x36')][_0x42f3('0x47')]?_0x28e994['attributes']:_0x1dc84a[_0x42f3('0x34')];if(_0x376cd6[_0x42f3('0x30')][_0x42f3('0x40')]){_0x28e994[_0x42f3('0x41')]=[{'all':!![]}];}_0x28e994=_['merge']({},_0x28e994,_0x376cd6[_0x42f3('0x3f')]);return db[_0x42f3('0x2e')][_0x42f3('0x48')](_0x28e994)[_0x42f3('0x26')](handleEntityNotFound(_0x39f29e,null))['then'](respondWithResult(_0x39f29e,null))[_0x42f3('0x43')](handleError(_0x39f29e,null));};exports[_0x42f3('0x49')]=function(_0x1c5c55,_0x4a99b7){return db['CmCompany'][_0x42f3('0x49')](_0x1c5c55[_0x42f3('0x4a')],{})[_0x42f3('0x26')](function(_0x4d36ef){var _0x4f0fe5=_0x1c5c55['user'][_0x42f3('0x25')]({'plain':!![]});if(!_0x4f0fe5)throw new Error(_0x42f3('0x4b'));if(_0x4f0fe5[_0x42f3('0x4c')]==='user'){var _0x2aa0cc=_0x4d36ef['get']({'plain':!![]});var _0x51e406='Companies';return db[_0x42f3('0x4d')][_0x42f3('0x48')]({'where':{'name':_0x51e406,'userProfileId':_0x4f0fe5[_0x42f3('0x4e')]},'raw':!![]})[_0x42f3('0x26')](function(_0x2222b4){if(_0x2222b4&&_0x2222b4[_0x42f3('0x4f')]===0x0){return db[_0x42f3('0x50')][_0x42f3('0x49')]({'name':_0x2aa0cc[_0x42f3('0x2b')],'resourceId':_0x2aa0cc['id'],'type':_0x2222b4['name'],'sectionId':_0x2222b4['id']},{})[_0x42f3('0x26')](function(){return _0x4d36ef;});}else{return _0x4d36ef;}})[_0x42f3('0x43')](function(_0x56a39f){logger[_0x42f3('0x29')](_0x42f3('0x51'),_0x56a39f);throw _0x56a39f;});}return _0x4d36ef;})[_0x42f3('0x26')](respondWithResult(_0x4a99b7,0xc9))[_0x42f3('0x43')](handleError(_0x4a99b7,null));};exports[_0x42f3('0x52')]=function(_0x1bb288,_0x168ce4){if(_0x1bb288['body']['id']){delete _0x1bb288['body']['id'];}return db['CmCompany'][_0x42f3('0x48')]({'where':{'id':_0x1bb288['params']['id']}})[_0x42f3('0x26')](handleEntityNotFound(_0x168ce4,null))[_0x42f3('0x26')](saveUpdates(_0x1bb288['body'],null))['then'](respondWithResult(_0x168ce4,null))[_0x42f3('0x43')](handleError(_0x168ce4,null));};exports[_0x42f3('0x24')]=function(_0x257b6b,_0x54c9d3){return db[_0x42f3('0x2e')][_0x42f3('0x48')]({'where':{'id':_0x257b6b[_0x42f3('0x45')]['id']}})['then'](handleEntityNotFound(_0x54c9d3,null))[_0x42f3('0x26')](removeEntity(_0x54c9d3,null))[_0x42f3('0x43')](handleError(_0x54c9d3,null));};exports[_0x42f3('0x2f')]=function(_0x5ae7ea,_0x35f7be){return db[_0x42f3('0x2e')][_0x42f3('0x2f')]()['then'](respondWithResult(_0x35f7be,null))[_0x42f3('0x43')](handleError(_0x35f7be,null));};exports['addContacts']=function(_0x1f8f79,_0x45c2db,_0x7c42a1){return db[_0x42f3('0x53')][_0x42f3('0x48')]({'where':{'id':_0x1f8f79['params']['id']}})[_0x42f3('0x26')](handleEntityNotFound(_0x45c2db,null))[_0x42f3('0x26')](function(_0x101929){if(_0x101929){return _0x101929[_0x42f3('0x54')](_0x1f8f79['body'][_0x42f3('0x55')],_['omit'](_0x1f8f79['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x45c2db,null))['catch'](handleError(_0x45c2db,null));};exports[_0x42f3('0x56')]=function(_0x51e0ea,_0x22bff3,_0x3412e3){var _0x5447d0={};var _0x15d6e6={};var _0x559270;var _0x49a34a;return db[_0x42f3('0x2e')][_0x42f3('0x57')]({'where':{'id':_0x51e0ea[_0x42f3('0x45')]['id']}})[_0x42f3('0x26')](handleEntityNotFound(_0x22bff3,null))[_0x42f3('0x26')](function(_0xdb8fd1){if(_0xdb8fd1){_0x559270=_0xdb8fd1;_0x15d6e6['model']=_[_0x42f3('0x31')](db['CmContact'][_0x42f3('0x46')]);_0x15d6e6[_0x42f3('0x30')]=_['keys'](_0x51e0ea[_0x42f3('0x30')]);_0x15d6e6[_0x42f3('0x32')]=_['intersection'](_0x15d6e6[_0x42f3('0x34')],_0x15d6e6[_0x42f3('0x30')]);_0x5447d0[_0x42f3('0x36')]=_[_0x42f3('0x33')](_0x15d6e6['model'],qs[_0x42f3('0x35')](_0x51e0ea['query'][_0x42f3('0x35')]));_0x5447d0[_0x42f3('0x36')]=_0x5447d0[_0x42f3('0x36')][_0x42f3('0x47')]?_0x5447d0[_0x42f3('0x36')]:_0x15d6e6[_0x42f3('0x34')];_0x5447d0[_0x42f3('0x39')]=qs[_0x42f3('0x3a')](_0x51e0ea[_0x42f3('0x30')][_0x42f3('0x3a')]);_0x5447d0['where']=qs[_0x42f3('0x32')](_[_0x42f3('0x3c')](_0x51e0ea['query'],_0x15d6e6[_0x42f3('0x32')]));if(_0x51e0ea[_0x42f3('0x30')][_0x42f3('0x3d')]){_0x5447d0[_0x42f3('0x3b')]=_['merge'](_0x5447d0[_0x42f3('0x3b')],{'$or':_[_0x42f3('0x58')](_0x5447d0[_0x42f3('0x36')],function(_0x3de1ad){var _0x5c7a42={};_0x5c7a42[_0x3de1ad]={'$like':'%'+_0x51e0ea[_0x42f3('0x30')][_0x42f3('0x3d')]+'%'};return _0x5c7a42;})});}_0x5447d0=_[_0x42f3('0x3e')]({},_0x5447d0,_0x51e0ea[_0x42f3('0x3f')]);return _0x559270[_0x42f3('0x56')](_0x5447d0);}})['then'](function(_0x33867e){if(_0x33867e){_0x49a34a=_0x33867e[_0x42f3('0x47')];if(!_0x51e0ea[_0x42f3('0x30')][_0x42f3('0x37')]('nolimit')){_0x5447d0[_0x42f3('0x1e')]=qs[_0x42f3('0x1e')](_0x51e0ea[_0x42f3('0x30')][_0x42f3('0x1e')]);_0x5447d0['offset']=qs['offset'](_0x51e0ea['query'][_0x42f3('0x1c')]);}return _0x559270[_0x42f3('0x56')](_0x5447d0);}})[_0x42f3('0x26')](function(_0x59ea8a){if(_0x59ea8a){return _0x59ea8a?{'count':_0x49a34a,'rows':_0x59ea8a}:null;}})[_0x42f3('0x26')](respondWithResult(_0x22bff3,null))[_0x42f3('0x43')](handleError(_0x22bff3,null));};
\ No newline at end of file
+var _0xddcb=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','CmCompany','describe','model','keys','filters','intersection','fields','query','attributes','length','hasOwnProperty','sort','where','filter','merge','map','options','includeAll','include','findAll','rows','show','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','catch','params','addContacts','ids','omit','getContacts','findOne','CmContact','pick','nolimit','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','papaparse','../../components/parsers/qs'];(function(_0x173978,_0x39bffb){var _0x1d35e1=function(_0x552648){while(--_0x552648){_0x173978['push'](_0x173978['shift']());}};_0x1d35e1(++_0x39bffb);}(_0xddcb,0x138));var _0xbddc=function(_0x2fbcd4,_0x11334e){_0x2fbcd4=_0x2fbcd4-0x0;var _0x54ac81=_0xddcb[_0x2fbcd4];return _0x54ac81;};'use strict';var emlformat=require(_0xbddc('0x0'));var rimraf=require(_0xbddc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbddc('0x2'));var rp=require(_0xbddc('0x3'));var moment=require('moment');var BPromise=require(_0xbddc('0x4'));var Mustache=require(_0xbddc('0x5'));var util=require(_0xbddc('0x6'));var path=require(_0xbddc('0x7'));var sox=require(_0xbddc('0x8'));var csv=require('to-csv');var ejs=require(_0xbddc('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbddc('0xa'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbddc('0xb'));var as=require(_0xbddc('0xc'));var hardwareService=require(_0xbddc('0xd'));var logger=require(_0xbddc('0xe'))(_0xbddc('0xf'));var utils=require(_0xbddc('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0xbddc('0x11'));var db=require(_0xbddc('0x12'))['db'];function respondWithStatusCode(_0x3a4255,_0x5d7f34){_0x5d7f34=_0x5d7f34||0xcc;return function(_0x47c9d7){if(_0x47c9d7){return _0x3a4255[_0xbddc('0x13')](_0x5d7f34);}return _0x3a4255[_0xbddc('0x14')](_0x5d7f34)[_0xbddc('0x15')]();};}function respondWithResult(_0x3338f1,_0x131826){_0x131826=_0x131826||0xc8;return function(_0x14507e){if(_0x14507e){return _0x3338f1[_0xbddc('0x14')](_0x131826)[_0xbddc('0x16')](_0x14507e);}};}function respondWithFilteredResult(_0x469b51,_0x5e4f5e){return function(_0x546630){if(_0x546630){var _0x8fcb08=typeof _0x5e4f5e[_0xbddc('0x17')]===_0xbddc('0x18')&&typeof _0x5e4f5e[_0xbddc('0x19')]==='undefined';var _0x2d9fec=_0x546630[_0xbddc('0x1a')];var _0x59ff22=_0x8fcb08?0x0:_0x5e4f5e[_0xbddc('0x17')];var _0x38a088=_0x8fcb08?_0x546630[_0xbddc('0x1a')]:_0x5e4f5e['offset']+_0x5e4f5e[_0xbddc('0x19')];var _0x1cc01c;if(_0x38a088>=_0x2d9fec){_0x38a088=_0x2d9fec;_0x1cc01c=0xc8;}else{_0x1cc01c=0xce;}_0x469b51[_0xbddc('0x14')](_0x1cc01c);return _0x469b51[_0xbddc('0x1b')](_0xbddc('0x1c'),_0x59ff22+'-'+_0x38a088+'/'+_0x2d9fec)['json'](_0x546630);}return null;};}function patchUpdates(_0x2e18bd){return function(_0xbcf531){try{jsonpatch[_0xbddc('0x1d')](_0xbcf531,_0x2e18bd,!![]);}catch(_0x5b2b08){return BPromise[_0xbddc('0x1e')](_0x5b2b08);}return _0xbcf531[_0xbddc('0x1f')]();};}function saveUpdates(_0x2702e0,_0x35c6e3){return function(_0x2ed843){if(_0x2ed843){return _0x2ed843[_0xbddc('0x20')](_0x2702e0)[_0xbddc('0x21')](function(_0x2b8293){return _0x2b8293;});}return null;};}function removeEntity(_0x1d1dd2,_0x3ea8c5){return function(_0x49f0de){if(_0x49f0de){return _0x49f0de[_0xbddc('0x22')]()[_0xbddc('0x21')](function(){var _0x593408=_0x49f0de[_0xbddc('0x23')]({'plain':!![]});var _0x51b898=_0xbddc('0x24');return db[_0xbddc('0x25')]['destroy']({'where':{'type':_0x51b898,'resourceId':_0x593408['id']}})[_0xbddc('0x21')](function(){return _0x49f0de;});})[_0xbddc('0x21')](function(){_0x1d1dd2[_0xbddc('0x14')](0xcc)[_0xbddc('0x15')]();});}};}function handleEntityNotFound(_0x5c996a,_0x40ec80){return function(_0x22365e){if(!_0x22365e){_0x5c996a[_0xbddc('0x13')](0x194);}return _0x22365e;};}function handleError(_0x5252af,_0x724aa6){_0x724aa6=_0x724aa6||0x1f4;return function(_0x197446){logger[_0xbddc('0x26')](_0x197446[_0xbddc('0x27')]);if(_0x197446['name']){delete _0x197446[_0xbddc('0x28')];}_0x5252af['status'](_0x724aa6)[_0xbddc('0x29')](_0x197446);};}exports['index']=function(_0x159da1,_0x548fc0){var _0x2d6dcc={},_0x4ef6aa={},_0x2da56b={'count':0x0,'rows':[]};return db[_0xbddc('0x2a')][_0xbddc('0x2b')]()['then'](function(_0x239e50){_0x4ef6aa[_0xbddc('0x2c')]=_['keys'](_0x239e50);_0x4ef6aa['query']=_[_0xbddc('0x2d')](_0x159da1['query']);_0x4ef6aa[_0xbddc('0x2e')]=_[_0xbddc('0x2f')](_0x4ef6aa[_0xbddc('0x2c')],_0x4ef6aa['query']);_0x2d6dcc['attributes']=_[_0xbddc('0x2f')](_0x4ef6aa[_0xbddc('0x2c')],qs[_0xbddc('0x30')](_0x159da1[_0xbddc('0x31')][_0xbddc('0x30')]));_0x2d6dcc[_0xbddc('0x32')]=_0x2d6dcc[_0xbddc('0x32')][_0xbddc('0x33')]?_0x2d6dcc[_0xbddc('0x32')]:_0x4ef6aa[_0xbddc('0x2c')];if(!_0x159da1[_0xbddc('0x31')][_0xbddc('0x34')]('nolimit')){_0x2d6dcc[_0xbddc('0x19')]=qs[_0xbddc('0x19')](_0x159da1['query'][_0xbddc('0x19')]);_0x2d6dcc['offset']=qs[_0xbddc('0x17')](_0x159da1[_0xbddc('0x31')]['offset']);}_0x2d6dcc['order']=qs[_0xbddc('0x35')](_0x159da1[_0xbddc('0x31')][_0xbddc('0x35')]);_0x2d6dcc[_0xbddc('0x36')]=qs[_0xbddc('0x2e')](_['pick'](_0x159da1[_0xbddc('0x31')],_0x4ef6aa[_0xbddc('0x2e')]),_0x239e50);if(_0x159da1[_0xbddc('0x31')][_0xbddc('0x37')]){_0x2d6dcc[_0xbddc('0x36')]=_[_0xbddc('0x38')](_0x2d6dcc[_0xbddc('0x36')],{'$or':_[_0xbddc('0x39')](_0x2d6dcc[_0xbddc('0x32')],function(_0x33dbca){var _0x24861c={};_0x24861c[_0x33dbca]={'$like':'%'+_0x159da1[_0xbddc('0x31')][_0xbddc('0x37')]+'%'};return _0x24861c;})});}_0x2d6dcc=_[_0xbddc('0x38')]({},_0x2d6dcc,_0x159da1[_0xbddc('0x3a')]);var _0x7683df={'where':_0x2d6dcc['where']};return db[_0xbddc('0x2a')][_0xbddc('0x1a')](_0x7683df)[_0xbddc('0x21')](function(_0x11d6ff){_0x2da56b[_0xbddc('0x1a')]=_0x11d6ff;if(_0x159da1['query'][_0xbddc('0x3b')]){_0x2d6dcc[_0xbddc('0x3c')]=[{'all':!![]}];}return db[_0xbddc('0x2a')][_0xbddc('0x3d')](_0x2d6dcc);})['then'](function(_0xe5388e){_0x2da56b[_0xbddc('0x3e')]=_0xe5388e;return _0x2da56b;})[_0xbddc('0x21')](respondWithFilteredResult(_0x548fc0,_0x2d6dcc))['catch'](handleError(_0x548fc0,null));})['catch'](handleError(_0x548fc0,null));};exports[_0xbddc('0x3f')]=function(_0x3b2354,_0x37daee){var _0x5be62d={'raw':![],'where':{'id':_0x3b2354['params']['id']}},_0x2f81f3={};_0x2f81f3[_0xbddc('0x2c')]=_['keys'](db[_0xbddc('0x2a')]['rawAttributes']);_0x2f81f3[_0xbddc('0x31')]=_['keys'](_0x3b2354[_0xbddc('0x31')]);_0x2f81f3['filters']=_[_0xbddc('0x2f')](_0x2f81f3['model'],_0x2f81f3[_0xbddc('0x31')]);_0x5be62d[_0xbddc('0x32')]=_['intersection'](_0x2f81f3[_0xbddc('0x2c')],qs[_0xbddc('0x30')](_0x3b2354[_0xbddc('0x31')][_0xbddc('0x30')]));_0x5be62d[_0xbddc('0x32')]=_0x5be62d[_0xbddc('0x32')]['length']?_0x5be62d[_0xbddc('0x32')]:_0x2f81f3[_0xbddc('0x2c')];if(_0x3b2354[_0xbddc('0x31')][_0xbddc('0x3b')]){_0x5be62d[_0xbddc('0x3c')]=[{'all':!![]}];}_0x5be62d=_['merge']({},_0x5be62d,_0x3b2354[_0xbddc('0x3a')]);return db[_0xbddc('0x2a')]['find'](_0x5be62d)[_0xbddc('0x21')](handleEntityNotFound(_0x37daee,null))[_0xbddc('0x21')](respondWithResult(_0x37daee,null))['catch'](handleError(_0x37daee,null));};exports[_0xbddc('0x40')]=function(_0x2d51cb,_0xa73ad){return db[_0xbddc('0x2a')][_0xbddc('0x40')](_0x2d51cb[_0xbddc('0x41')],{})['then'](function(_0x38fe7d){var _0x3d027d=_0x2d51cb[_0xbddc('0x42')][_0xbddc('0x23')]({'plain':!![]});if(!_0x3d027d)throw new Error(_0xbddc('0x43'));if(_0x3d027d['role']===_0xbddc('0x42')){var _0xe66ead=_0x38fe7d[_0xbddc('0x23')]({'plain':!![]});var _0x69b430=_0xbddc('0x24');return db['UserProfileSection'][_0xbddc('0x44')]({'where':{'name':_0x69b430,'userProfileId':_0x3d027d[_0xbddc('0x45')]},'raw':!![]})[_0xbddc('0x21')](function(_0x59ec0d){if(_0x59ec0d&&_0x59ec0d[_0xbddc('0x46')]===0x0){return db[_0xbddc('0x25')][_0xbddc('0x40')]({'name':_0xe66ead[_0xbddc('0x28')],'resourceId':_0xe66ead['id'],'type':_0x59ec0d['name'],'sectionId':_0x59ec0d['id']},{})[_0xbddc('0x21')](function(){return _0x38fe7d;});}else{return _0x38fe7d;}})[_0xbddc('0x47')](function(_0x3b5e66){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b5e66);throw _0x3b5e66;});}return _0x38fe7d;})[_0xbddc('0x21')](respondWithResult(_0xa73ad,0xc9))[_0xbddc('0x47')](handleError(_0xa73ad,null));};exports[_0xbddc('0x20')]=function(_0x51b1f5,_0xa40a9b){if(_0x51b1f5[_0xbddc('0x41')]['id']){delete _0x51b1f5['body']['id'];}return db[_0xbddc('0x2a')][_0xbddc('0x44')]({'where':{'id':_0x51b1f5[_0xbddc('0x48')]['id']}})[_0xbddc('0x21')](handleEntityNotFound(_0xa40a9b,null))['then'](saveUpdates(_0x51b1f5['body'],null))[_0xbddc('0x21')](respondWithResult(_0xa40a9b,null))[_0xbddc('0x47')](handleError(_0xa40a9b,null));};exports[_0xbddc('0x22')]=function(_0xb7ed3f,_0x4e5ad4){return db[_0xbddc('0x2a')][_0xbddc('0x44')]({'where':{'id':_0xb7ed3f['params']['id']}})[_0xbddc('0x21')](handleEntityNotFound(_0x4e5ad4,null))[_0xbddc('0x21')](removeEntity(_0x4e5ad4,null))[_0xbddc('0x47')](handleError(_0x4e5ad4,null));};exports[_0xbddc('0x2b')]=function(_0x24efbd,_0xd7e0b4){return db[_0xbddc('0x2a')][_0xbddc('0x2b')]()[_0xbddc('0x21')](respondWithResult(_0xd7e0b4,null))[_0xbddc('0x47')](handleError(_0xd7e0b4,null));};exports[_0xbddc('0x49')]=function(_0x5ae3d6,_0x492e69,_0x1da3e7){return db['CmContact']['find']({'where':{'id':_0x5ae3d6[_0xbddc('0x48')]['id']}})[_0xbddc('0x21')](handleEntityNotFound(_0x492e69,null))[_0xbddc('0x21')](function(_0x493ab0){if(_0x493ab0){return _0x493ab0[_0xbddc('0x49')](_0x5ae3d6[_0xbddc('0x41')][_0xbddc('0x4a')],_[_0xbddc('0x4b')](_0x5ae3d6[_0xbddc('0x41')],[_0xbddc('0x4a'),'id'])||{});}})['then'](respondWithResult(_0x492e69,null))[_0xbddc('0x47')](handleError(_0x492e69,null));};exports[_0xbddc('0x4c')]=function(_0x29da64,_0x582e34,_0x540b6e){var _0x114879={};var _0x2942ad={};var _0x20f701;var _0x3aa33e;return db[_0xbddc('0x2a')][_0xbddc('0x4d')]({'where':{'id':_0x29da64['params']['id']}})[_0xbddc('0x21')](handleEntityNotFound(_0x582e34,null))[_0xbddc('0x21')](function(_0x2a71f0){if(_0x2a71f0){_0x20f701=_0x2a71f0;_0x2942ad[_0xbddc('0x2c')]=_[_0xbddc('0x2d')](db[_0xbddc('0x4e')]['rawAttributes']);_0x2942ad[_0xbddc('0x31')]=_['keys'](_0x29da64[_0xbddc('0x31')]);_0x2942ad[_0xbddc('0x2e')]=_['intersection'](_0x2942ad[_0xbddc('0x2c')],_0x2942ad['query']);_0x114879[_0xbddc('0x32')]=_[_0xbddc('0x2f')](_0x2942ad[_0xbddc('0x2c')],qs[_0xbddc('0x30')](_0x29da64[_0xbddc('0x31')][_0xbddc('0x30')]));_0x114879[_0xbddc('0x32')]=_0x114879[_0xbddc('0x32')]['length']?_0x114879[_0xbddc('0x32')]:_0x2942ad['model'];_0x114879['order']=qs['sort'](_0x29da64[_0xbddc('0x31')][_0xbddc('0x35')]);_0x114879[_0xbddc('0x36')]=qs[_0xbddc('0x2e')](_[_0xbddc('0x4f')](_0x29da64[_0xbddc('0x31')],_0x2942ad[_0xbddc('0x2e')]));if(_0x29da64['query'][_0xbddc('0x37')]){_0x114879['where']=_[_0xbddc('0x38')](_0x114879[_0xbddc('0x36')],{'$or':_[_0xbddc('0x39')](_0x114879[_0xbddc('0x32')],function(_0x539981){var _0x5d8920={};_0x5d8920[_0x539981]={'$like':'%'+_0x29da64[_0xbddc('0x31')]['filter']+'%'};return _0x5d8920;})});}_0x114879=_[_0xbddc('0x38')]({},_0x114879,_0x29da64['options']);return _0x20f701[_0xbddc('0x4c')](_0x114879);}})['then'](function(_0x51a1af){if(_0x51a1af){_0x3aa33e=_0x51a1af[_0xbddc('0x33')];if(!_0x29da64[_0xbddc('0x31')][_0xbddc('0x34')](_0xbddc('0x50'))){_0x114879['limit']=qs[_0xbddc('0x19')](_0x29da64[_0xbddc('0x31')][_0xbddc('0x19')]);_0x114879['offset']=qs['offset'](_0x29da64['query'][_0xbddc('0x17')]);}return _0x20f701[_0xbddc('0x4c')](_0x114879);}})[_0xbddc('0x21')](function(_0x126807){if(_0x126807){return _0x126807?{'count':_0x3aa33e,'rows':_0x126807}:null;}})[_0xbddc('0x21')](respondWithResult(_0x582e34,null))[_0xbddc('0x47')](handleError(_0x582e34,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 8115ca7..131b6ba 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 _0x1f6a=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define','CmCompany','lodash'];(function(_0x387213,_0x2bc468){var _0x2b7616=function(_0x3b8880){while(--_0x3b8880){_0x387213['push'](_0x387213['shift']());}};_0x2b7616(++_0x2bc468);}(_0x1f6a,0x1ee));var _0xa1f6=function(_0x47c89e,_0x18692c){_0x47c89e=_0x47c89e-0x0;var _0x1de51e=_0x1f6a[_0x47c89e];return _0x1de51e;};'use strict';var _=require(_0xa1f6('0x0'));var util=require(_0xa1f6('0x1'));var logger=require(_0xa1f6('0x2'))(_0xa1f6('0x3'));var moment=require('moment');var BPromise=require(_0xa1f6('0x4'));var rp=require(_0xa1f6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa1f6('0x6'));var config=require(_0xa1f6('0x7'));var attributes=require('./cmCompany.attributes');module[_0xa1f6('0x8')]=function(_0x9ca98d,_0x3ea2bd){return _0x9ca98d[_0xa1f6('0x9')](_0xa1f6('0xa'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1d77=['moment','request-promise','rimraf','../../config/environment','./cmCompany.attributes','exports','CmCompany','cm_companies','util','../../config/logger','api'];(function(_0x483c43,_0x205dd2){var _0x22b502=function(_0x1fea8b){while(--_0x1fea8b){_0x483c43['push'](_0x483c43['shift']());}};_0x22b502(++_0x205dd2);}(_0x1d77,0x147));var _0x71d7=function(_0x37ae26,_0x2ecd70){_0x37ae26=_0x37ae26-0x0;var _0x1b1902=_0x1d77[_0x37ae26];return _0x1b1902;};'use strict';var _=require('lodash');var util=require(_0x71d7('0x0'));var logger=require(_0x71d7('0x1'))(_0x71d7('0x2'));var moment=require(_0x71d7('0x3'));var BPromise=require('bluebird');var rp=require(_0x71d7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x71d7('0x5'));var config=require(_0x71d7('0x6'));var attributes=require(_0x71d7('0x7'));module[_0x71d7('0x8')]=function(_0xefc1d9,_0x1176b5){return _0xefc1d9['define'](_0x71d7('0x9'),attributes,{'tableName':_0x71d7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index 785c235..4a95cb2 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 _0x22d8=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result'];(function(_0x45ad56,_0x4472f0){var _0x5f2f45=function(_0x8dfdda){while(--_0x8dfdda){_0x45ad56['push'](_0x45ad56['shift']());}};_0x5f2f45(++_0x4472f0);}(_0x22d8,0x91));var _0x822d=function(_0x1e4d45,_0x1f9e37){_0x1e4d45=_0x1e4d45-0x0;var _0x130016=_0x22d8[_0x1e4d45];return _0x130016;};'use strict';var _=require(_0x822d('0x0'));var util=require(_0x822d('0x1'));var moment=require('moment');var BPromise=require(_0x822d('0x2'));var rs=require(_0x822d('0x3'));var fs=require('fs');var Redis=require(_0x822d('0x4'));var db=require(_0x822d('0x5'))['db'];var utils=require(_0x822d('0x6'));var logger=require(_0x822d('0x7'))(_0x822d('0x8'));var config=require(_0x822d('0x9'));var jayson=require(_0x822d('0xa'));var client=jayson[_0x822d('0xb')][_0x822d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x40a82c,_0x5b0f3a,_0x5a1fae){return new BPromise(function(_0x26d196,_0xcb2b75){return client['request'](_0x40a82c,_0x5a1fae)[_0x822d('0xd')](function(_0xa2c4dc){logger[_0x822d('0xe')]('CmCompany,\x20%s,\x20%s',_0x5b0f3a,'request\x20sent');logger['debug'](_0x822d('0xf'),_0x5b0f3a,_0x822d('0x10'),JSON[_0x822d('0x11')](_0xa2c4dc));if(_0xa2c4dc['error']){if(_0xa2c4dc[_0x822d('0x12')][_0x822d('0x13')]===0x1f4){logger[_0x822d('0x12')](_0x822d('0x14'),_0x5b0f3a,_0xa2c4dc[_0x822d('0x12')][_0x822d('0x15')]);return _0xcb2b75(_0xa2c4dc[_0x822d('0x12')]['message']);}logger[_0x822d('0x12')](_0x822d('0x14'),_0x5b0f3a,_0xa2c4dc['error'][_0x822d('0x15')]);return _0x26d196(_0xa2c4dc[_0x822d('0x12')][_0x822d('0x15')]);}else{logger['info'](_0x822d('0x14'),_0x5b0f3a,_0x822d('0x10'));_0x26d196(_0xa2c4dc[_0x822d('0x16')][_0x822d('0x15')]);}})[_0x822d('0x17')](function(_0x244467){logger[_0x822d('0x12')]('CmCompany,\x20%s,\x20%s',_0x5b0f3a,_0x244467);_0xcb2b75(_0x244467);});});}
\ No newline at end of file
+var _0xa6ac=['debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','CmCompany,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info'];(function(_0x365045,_0x3de6c4){var _0x1028cb=function(_0x4428fa){while(--_0x4428fa){_0x365045['push'](_0x365045['shift']());}};_0x1028cb(++_0x3de6c4);}(_0xa6ac,0x1eb));var _0xca6a=function(_0x3232ea,_0x46753a){_0x3232ea=_0x3232ea-0x0;var _0x1851eb=_0xa6ac[_0x3232ea];return _0x1851eb;};'use strict';var _=require(_0xca6a('0x0'));var util=require(_0xca6a('0x1'));var moment=require(_0xca6a('0x2'));var BPromise=require('bluebird');var rs=require(_0xca6a('0x3'));var fs=require('fs');var Redis=require(_0xca6a('0x4'));var db=require(_0xca6a('0x5'))['db'];var utils=require(_0xca6a('0x6'));var logger=require(_0xca6a('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xca6a('0x8'));var client=jayson['client'][_0xca6a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32383b,_0x161a2f,_0x18debc){return new BPromise(function(_0x3afd7d,_0x5af947){return client[_0xca6a('0xa')](_0x32383b,_0x18debc)[_0xca6a('0xb')](function(_0x14abd7){logger[_0xca6a('0xc')]('CmCompany,\x20%s,\x20%s',_0x161a2f,'request\x20sent');logger[_0xca6a('0xd')](_0xca6a('0xe'),_0x161a2f,_0xca6a('0xf'),JSON[_0xca6a('0x10')](_0x14abd7));if(_0x14abd7[_0xca6a('0x11')]){if(_0x14abd7[_0xca6a('0x11')]['code']===0x1f4){logger['error'](_0xca6a('0x12'),_0x161a2f,_0x14abd7[_0xca6a('0x11')][_0xca6a('0x13')]);return _0x5af947(_0x14abd7[_0xca6a('0x11')][_0xca6a('0x13')]);}logger[_0xca6a('0x11')](_0xca6a('0x12'),_0x161a2f,_0x14abd7[_0xca6a('0x11')][_0xca6a('0x13')]);return _0x3afd7d(_0x14abd7['error'][_0xca6a('0x13')]);}else{logger[_0xca6a('0xc')]('CmCompany,\x20%s,\x20%s',_0x161a2f,_0xca6a('0xf'));_0x3afd7d(_0x14abd7['result'][_0xca6a('0x13')]);}})[_0xca6a('0x14')](function(_0xdb5801){logger['error']('CmCompany,\x20%s,\x20%s',_0x161a2f,_0xdb5801);_0x5af947(_0xdb5801);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index f949ab0..fed2e3e 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 _0x19ba=['multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/contacts','getContacts','post','create','update','destroy','exports'];(function(_0x4e4198,_0x14bf80){var _0x118dc4=function(_0x541604){while(--_0x541604){_0x4e4198['push'](_0x4e4198['shift']());}};_0x118dc4(++_0x14bf80);}(_0x19ba,0x150));var _0xa19b=function(_0x3b8ed6,_0x3b5bb6){_0x3b8ed6=_0x3b8ed6-0x0;var _0x2e6223=_0x19ba[_0x3b8ed6];return _0x2e6223;};'use strict';var multer=require(_0xa19b('0x0'));var util=require(_0xa19b('0x1'));var path=require(_0xa19b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa19b('0x3')]();var fs_extra=require(_0xa19b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa19b('0x5'));var config=require(_0xa19b('0x6'));var controller=require(_0xa19b('0x7'));router[_0xa19b('0x8')]('/',auth[_0xa19b('0x9')](),controller[_0xa19b('0xa')]);router[_0xa19b('0x8')](_0xa19b('0xb'),auth[_0xa19b('0x9')](),controller['describe']);router[_0xa19b('0x8')](_0xa19b('0xc'),auth[_0xa19b('0x9')](),controller[_0xa19b('0xd')]);router[_0xa19b('0x8')](_0xa19b('0xe'),auth['isAuthenticated'](),controller[_0xa19b('0xf')]);router[_0xa19b('0x10')]('/',auth[_0xa19b('0x9')](),controller[_0xa19b('0x11')]);router[_0xa19b('0x10')]('/:id/contacts',auth[_0xa19b('0x9')](),controller['addContacts']);router['put'](_0xa19b('0xc'),auth[_0xa19b('0x9')](),controller[_0xa19b('0x12')]);router['delete'](_0xa19b('0xc'),auth['isAuthenticated'](),controller[_0xa19b('0x13')]);module[_0xa19b('0x14')]=router;
\ No newline at end of file
+var _0xb547=['show','/:id/contacts','getContacts','post','create','/:id','delete','exports','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x9eaec5,_0x2e8c12){var _0x4b3002=function(_0x19e92b){while(--_0x19e92b){_0x9eaec5['push'](_0x9eaec5['shift']());}};_0x4b3002(++_0x2e8c12);}(_0xb547,0x74));var _0x7b54=function(_0x4169d8,_0x3d7cd4){_0x4169d8=_0x4169d8-0x0;var _0x32084a=_0xb547[_0x4169d8];return _0x32084a;};'use strict';var multer=require('multer');var util=require(_0x7b54('0x0'));var path=require(_0x7b54('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b54('0x2'));var router=express[_0x7b54('0x3')]();var fs_extra=require(_0x7b54('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7b54('0x5'));var config=require(_0x7b54('0x6'));var controller=require('./cmCompany.controller');router[_0x7b54('0x7')]('/',auth[_0x7b54('0x8')](),controller[_0x7b54('0x9')]);router['get']('/describe',auth[_0x7b54('0x8')](),controller['describe']);router[_0x7b54('0x7')]('/:id',auth[_0x7b54('0x8')](),controller[_0x7b54('0xa')]);router['get'](_0x7b54('0xb'),auth[_0x7b54('0x8')](),controller[_0x7b54('0xc')]);router[_0x7b54('0xd')]('/',auth[_0x7b54('0x8')](),controller[_0x7b54('0xe')]);router[_0x7b54('0xd')]('/:id/contacts',auth[_0x7b54('0x8')](),controller['addContacts']);router['put'](_0x7b54('0xf'),auth[_0x7b54('0x8')](),controller['update']);router[_0x7b54('0x10')]('/:id',auth[_0x7b54('0x8')](),controller['destroy']);module[_0x7b54('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 6a7dcfb..afbc49c 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 _0x722d=['lodash','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW'];(function(_0x346248,_0x37e2b7){var _0x131fc3=function(_0x3bd063){while(--_0x3bd063){_0x346248['push'](_0x346248['shift']());}};_0x131fc3(++_0x37e2b7);}(_0x722d,0xe8));var _0xd722=function(_0x283fe6,_0x12604c){_0x283fe6=_0x283fe6-0x0;var _0xd8998=_0x722d[_0x283fe6];return _0xd8998;};'use strict';var _=require(_0xd722('0x0'));var Sequelize=require('sequelize');module[_0xd722('0x1')]={'firstName':{'type':Sequelize[_0xd722('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xd722('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xd722('0x2')]},'city':{'type':Sequelize[_0xd722('0x2')]},'country':{'type':Sequelize[_0xd722('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd722('0x3')]},'phone':{'type':Sequelize[_0xd722('0x2')]},'mobile':{'type':Sequelize[_0xd722('0x2')]},'fax':{'type':Sequelize[_0xd722('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xd722('0x2')]},'fb_data':{'type':Sequelize[_0xd722('0x2')]},'twitter':{'type':Sequelize[_0xd722('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xd722('0x2')]},'viber':{'type':Sequelize[_0xd722('0x2')]},'line':{'type':Sequelize[_0xd722('0x2')]},'wechat':{'type':Sequelize[_0xd722('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xd722('0x4')]},'AdditionalPhones':{'type':Sequelize[_0xd722('0x2')]},'priority':{'type':Sequelize[_0xd722('0x4')](0x2)[_0xd722('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xd722('0x6')],'defaultValue':Sequelize[_0xd722('0x7')]},'dialTimezone':{'type':Sequelize[_0xd722('0x2')]},'utcOffset':{'type':Sequelize[_0xd722('0x4')]}};
\ No newline at end of file
+var _0x1ea1=['TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','exports','STRING'];(function(_0x53d0db,_0x2accaf){var _0x128b2a=function(_0x238c16){while(--_0x238c16){_0x53d0db['push'](_0x53d0db['shift']());}};_0x128b2a(++_0x2accaf);}(_0x1ea1,0x12e));var _0x11ea=function(_0x1221e8,_0x2e7229){_0x1221e8=_0x1221e8-0x0;var _0x3f3041=_0x1ea1[_0x1221e8];return _0x3f3041;};'use strict';var _=require(_0x11ea('0x0'));var Sequelize=require(_0x11ea('0x1'));module[_0x11ea('0x2')]={'firstName':{'type':Sequelize[_0x11ea('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x11ea('0x3')]},'street':{'type':Sequelize[_0x11ea('0x3')]},'postalCode':{'type':Sequelize[_0x11ea('0x3')]},'city':{'type':Sequelize[_0x11ea('0x3')]},'country':{'type':Sequelize[_0x11ea('0x3')]},'dateOfBirth':{'type':Sequelize[_0x11ea('0x3')]},'description':{'type':Sequelize[_0x11ea('0x4')]},'phone':{'type':Sequelize[_0x11ea('0x3')]},'mobile':{'type':Sequelize[_0x11ea('0x3')]},'fax':{'type':Sequelize[_0x11ea('0x3')]},'email':{'type':Sequelize[_0x11ea('0x3')]},'url':{'type':Sequelize[_0x11ea('0x3')]},'facebook':{'type':Sequelize[_0x11ea('0x3')]},'fb_data':{'type':Sequelize[_0x11ea('0x3')]},'twitter':{'type':Sequelize[_0x11ea('0x3')]},'skype':{'type':Sequelize[_0x11ea('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x11ea('0x3')]},'wechat':{'type':Sequelize[_0x11ea('0x3')]},'telegram':{'type':Sequelize[_0x11ea('0x3')]},'UserId':{'type':Sequelize[_0x11ea('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x11ea('0x3')]},'priority':{'type':Sequelize[_0x11ea('0x5')](0x2)[_0x11ea('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x11ea('0x7')],'defaultValue':Sequelize[_0x11ea('0x8')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x11ea('0x5')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index e08c1aa..a4ace8d 100644
--- a/server/api/cmContact/cmContact.controller.js
+++ b/server/api/cmContact/cmContact.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0xd7b0a4,_0x53c7d3){var _0x184e9e=function(_0x325bbd){while(--_0x325bbd){_0xd7b0a4['push'](_0xd7b0a4['shift']());}};_0x184e9e(++_0x53c7d3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b6
','Attachments','Data','generateXOAuth2Token','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger'];(function(_0x561ebb,_0x3dd13b){var _0xb00496=function(_0x1d40c9){while(--_0x1d40c9){_0x561ebb['push'](_0x561ebb['shift']());}};_0xb00496(++_0x3dd13b);}(_0x1494,0x119));var _0x4149=function(_0x555c25,_0x5ece39){_0x555c25=_0x555c25-0x0;var _0x60105d=_0x1494[_0x555c25];return _0x60105d;};'use strict';var _=require(_0x4149('0x0'));var moment=require(_0x4149('0x1'));var random=require(_0x4149('0x2'));var fs=require('fs');var path=require(_0x4149('0x3'));var util=require(_0x4149('0x4'));var tnef=require(_0x4149('0x5'));var logger=require(_0x4149('0x6'))(_0x4149('0x7'));var config=require(_0x4149('0x8'));function getAddress(_0x25f5be){var _0x48c737=_['head'](_0x25f5be[_0x4149('0x9')]);return _0x48c737&&_0x48c737[_0x4149('0xa')]?_0x48c737[_0x4149('0xa')]:_0x4149('0xb')+random[_0x4149('0xc')](0x6)+'@xcally.com';}function getFirstName(_0x40827f){var _0x2a8b7f=_['head'](_0x40827f[_0x4149('0x9')]);if(_0x2a8b7f&&_0x2a8b7f[_0x4149('0xd')]){if(_0x2a8b7f[_0x4149('0xd')]==_0x2a8b7f[_0x4149('0xa')]){return _0x2a8b7f[_0x4149('0xd')]['substring'](0x0,_0x2a8b7f[_0x4149('0xd')]['indexOf']('@'));}var _0x4dea7c=_0x2a8b7f[_0x4149('0xd')][_0x4149('0xe')](/\s+/);return _0x4dea7c['length']>0x1?_0x4dea7c[_0x4149('0xf')](0x0,-0x1)[_0x4149('0x10')]('\x20'):_0x2a8b7f[_0x4149('0xd')];}return _0x4149('0x11');}function getLastName(_0x330506){var _0x372168=_[_0x4149('0x12')](_0x330506[_0x4149('0x9')]);if(_0x372168&&_0x372168['name']){var _0x320e5c=_0x372168[_0x4149('0xd')][_0x4149('0xe')](/\s+/);return _0x320e5c[_0x4149('0x13')]>0x1?_0x320e5c['pop']():'';}return'';}function getMails(_0x5c0e09,_0x159a94){var _0xef305b='';for(var _0x55d4f2=0x0;_0x55d4f2<_0x159a94['value'][_0x4149('0x13')];_0x55d4f2+=0x1){if(_0x159a94[_0x4149('0x9')][_0x55d4f2][_0x4149('0xa')]!==_0x5c0e09){if(!_['isEmpty'](_0xef305b)){_0xef305b+=',';}_0xef305b+=_0x159a94[_0x4149('0x9')][_0x55d4f2][_0x4149('0xd')]||_0x159a94['value'][_0x55d4f2][_0x4149('0xa')]||'';_0xef305b+='\x20<';_0xef305b+=_0x159a94['value'][_0x55d4f2][_0x4149('0xa')]?_0x159a94[_0x4149('0x9')][_0x55d4f2]['address']:_0x4149('0xb')+random[_0x4149('0xc')](0x6)+_0x4149('0x14');_0xef305b+='>';}}return _0xef305b;}function parseEmail(_0x41fcba,_0x4c67f1,_0x589148){if(_0x4c67f1[_0x4149('0x15')]){var _0x592e2a=/