From e08d4e18be95402971d8224fc198a0a41ac0cff8 Mon Sep 17 00:00:00 2001
From: support
Date: Tue, 6 Dec 2022 07:54:41 +0000
Subject: [PATCH] Built motion from commit 839dd6ea.|2.6.25
---
apidoc/api_project.js | 2 +-
apidoc/api_project.json | 2 +-
server/api/action/action.attributes.js | 2 +-
server/api/action/action.controller.js | 2 +-
server/api/action/action.model.js | 2 +-
server/api/action/action.rpc.js | 2 +-
server/api/action/index.js | 2 +-
.../analyticCustomReport.attributes.js | 2 +-
.../analyticCustomReport.controller.js | 2 +-
.../analyticCustomReport.model.js | 2 +-
.../analyticCustomReport.rpc.js | 2 +-
server/api/analyticCustomReport/index.js | 2 +-
.../analyticDefaultReport.attributes.js | 2 +-
.../analyticDefaultReport.controller.js | 2 +-
.../analyticDefaultReport.model.js | 2 +-
.../analyticDefaultReport.rpc.js | 2 +-
server/api/analyticDefaultReport/index.js | 2 +-
.../analyticExtractedReport.attributes.js | 2 +-
.../analyticExtractedReport.controller.js | 2 +-
.../analyticExtractedReport.model.js | 2 +-
.../analyticExtractedReport.rpc.js | 2 +-
server/api/analyticExtractedReport/index.js | 2 +-
.../analyticFieldReport.attributes.js | 2 +-
.../analyticFieldReport.controller.js | 2 +-
.../analyticFieldReport.model.js | 2 +-
.../analyticFieldReport/analyticFieldReport.rpc.js | 2 +-
server/api/analyticFieldReport/index.js | 2 +-
.../analyticMetric/analyticMetric.attributes.js | 2 +-
.../analyticMetric/analyticMetric.controller.js | 2 +-
server/api/analyticMetric/analyticMetric.model.js | 2 +-
server/api/analyticMetric/analyticMetric.rpc.js | 2 +-
server/api/analyticMetric/index.js | 2 +-
.../analyticTreeReport.attributes.js | 2 +-
.../analyticTreeReport.controller.js | 2 +-
.../analyticTreeReport/analyticTreeReport.model.js | 2 +-
.../analyticTreeReport/analyticTreeReport.rpc.js | 2 +-
server/api/analyticTreeReport/index.js | 2 +-
server/api/attachment/attachment.attributes.js | 2 +-
server/api/attachment/attachment.controller.js | 2 +-
server/api/attachment/attachment.model.js | 2 +-
server/api/attachment/attachment.rpc.js | 2 +-
server/api/attachment/index.js | 2 +-
.../authActiveDirectory.controller.js | 2 +-
server/api/authActiveDirectory/index.js | 2 +-
server/api/authGoogle/authGoogle.controller.js | 2 +-
server/api/authGoogle/index.js | 2 +-
server/api/authLocal/authLocal.controller.js | 2 +-
server/api/authLocal/index.js | 2 +-
server/api/automation/automation.attributes.js | 2 +-
server/api/automation/automation.controller.js | 2 +-
server/api/automation/automation.model.js | 2 +-
server/api/automation/automation.rpc.js | 2 +-
server/api/automation/index.js | 2 +-
server/api/campaign/campaign.attributes.js | 2 +-
server/api/campaign/campaign.controller.js | 2 +-
server/api/campaign/campaign.model.js | 2 +-
server/api/campaign/campaign.rpc.js | 2 +-
server/api/campaign/index.js | 2 +-
server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +-
server/api/cannedAnswer/cannedAnswer.controller.js | 2 +-
server/api/cannedAnswer/cannedAnswer.model.js | 2 +-
server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +-
server/api/cannedAnswer/index.js | 2 +-
server/api/cdr/cdr.attributes.js | 2 +-
server/api/cdr/cdr.controller.js | 2 +-
server/api/cdr/cdr.model.js | 2 +-
server/api/cdr/cdr.rpc.js | 2 +-
server/api/cdr/index.js | 2 +-
.../chatApplication/chatApplication.attributes.js | 2 +-
.../chatApplication/chatApplication.controller.js | 2 +-
.../api/chatApplication/chatApplication.model.js | 2 +-
server/api/chatApplication/chatApplication.rpc.js | 2 +-
server/api/chatApplication/index.js | 2 +-
server/api/chatGroup/chatGroup.attributes.js | 2 +-
server/api/chatGroup/chatGroup.controller.js | 2 +-
server/api/chatGroup/chatGroup.events.js | 2 +-
server/api/chatGroup/chatGroup.model.js | 2 +-
server/api/chatGroup/chatGroup.rpc.js | 2 +-
server/api/chatGroup/chatGroup.socket.js | 2 +-
server/api/chatGroup/index.js | 2 +-
.../chatInteraction/chatInteraction.attributes.js | 2 +-
.../chatInteraction/chatInteraction.controller.js | 2 +-
.../api/chatInteraction/chatInteraction.events.js | 2 +-
.../api/chatInteraction/chatInteraction.model.js | 2 +-
server/api/chatInteraction/chatInteraction.rpc.js | 2 +-
.../api/chatInteraction/chatInteraction.socket.js | 2 +-
server/api/chatInteraction/index.js | 2 +-
.../chatInternalMessage.attributes.js | 2 +-
.../chatInternalMessage.controller.js | 2 +-
.../chatInternalMessage.events.js | 2 +-
.../chatInternalMessage.model.js | 2 +-
.../chatInternalMessage/chatInternalMessage.rpc.js | 2 +-
.../chatInternalMessage.socket.js | 2 +-
server/api/chatInternalMessage/index.js | 2 +-
server/api/chatMessage/chatMessage.attributes.js | 2 +-
server/api/chatMessage/chatMessage.controller.js | 2 +-
server/api/chatMessage/chatMessage.events.js | 2 +-
server/api/chatMessage/chatMessage.model.js | 2 +-
server/api/chatMessage/chatMessage.rpc.js | 2 +-
server/api/chatMessage/chatMessage.socket.js | 2 +-
server/api/chatMessage/index.js | 2 +-
.../chatOfflineMessage.attributes.js | 2 +-
.../chatOfflineMessage.controller.js | 2 +-
.../chatOfflineMessage.events.js | 2 +-
.../chatOfflineMessage/chatOfflineMessage.model.js | 2 +-
.../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +-
server/api/chatOfflineMessage/index.js | 2 +-
.../chatProactiveAction.attributes.js | 2 +-
.../chatProactiveAction.controller.js | 2 +-
.../chatProactiveAction.model.js | 2 +-
.../chatProactiveAction/chatProactiveAction.rpc.js | 2 +-
server/api/chatProactiveAction/index.js | 2 +-
server/api/chatQueue/chatQueue.attributes.js | 2 +-
server/api/chatQueue/chatQueue.controller.js | 2 +-
server/api/chatQueue/chatQueue.events.js | 2 +-
server/api/chatQueue/chatQueue.model.js | 2 +-
server/api/chatQueue/chatQueue.rpc.js | 2 +-
server/api/chatQueue/chatQueue.socket.js | 2 +-
server/api/chatQueue/index.js | 2 +-
.../chatQueueReport/chatQueueReport.attributes.js | 2 +-
.../chatQueueReport/chatQueueReport.controller.js | 2 +-
.../api/chatQueueReport/chatQueueReport.model.js | 2 +-
server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +-
server/api/chatQueueReport/index.js | 2 +-
.../chatTransferReport.attributes.js | 2 +-
.../chatTransferReport.controller.js | 2 +-
.../chatTransferReport/chatTransferReport.model.js | 2 +-
.../chatTransferReport/chatTransferReport.rpc.js | 2 +-
server/api/chatTransferReport/index.js | 2 +-
server/api/chatWebsite/chatWebsite.attributes.js | 2 +-
server/api/chatWebsite/chatWebsite.controller.js | 2 +-
server/api/chatWebsite/chatWebsite.events.js | 2 +-
server/api/chatWebsite/chatWebsite.model.js | 2 +-
server/api/chatWebsite/chatWebsite.rpc.js | 2 +-
server/api/chatWebsite/chatWebsite.socket.js | 2 +-
server/api/chatWebsite/index.js | 2 +-
server/api/client-side-logs.js | 2 +-
.../api/cloudProvider/cloudProvider.attributes.js | 2 +-
.../api/cloudProvider/cloudProvider.controller.js | 2 +-
server/api/cloudProvider/cloudProvider.model.js | 2 +-
server/api/cloudProvider/cloudProvider.oauth.js | 2 +-
server/api/cloudProvider/cloudProvider.rpc.js | 2 +-
server/api/cloudProvider/index.js | 2 +-
server/api/cmCompany/cmCompany.attributes.js | 2 +-
server/api/cmCompany/cmCompany.controller.js | 2 +-
server/api/cmCompany/cmCompany.model.js | 2 +-
server/api/cmCompany/cmCompany.rpc.js | 2 +-
server/api/cmCompany/index.js | 2 +-
server/api/cmContact/cmContact.attributes.js | 2 +-
server/api/cmContact/cmContact.controller.js | 2 +-
server/api/cmContact/cmContact.events.js | 2 +-
server/api/cmContact/cmContact.model.js | 2 +-
server/api/cmContact/cmContact.rpc.js | 2 +-
server/api/cmContact/cmContact.socket.js | 2 +-
server/api/cmContact/index.js | 2 +-
.../cmContactHasItem.attributes.js | 2 +-
.../cmContactHasItem.controller.js | 2 +-
.../api/cmContactHasItem/cmContactHasItem.model.js | 2 +-
.../api/cmContactHasItem/cmContactHasItem.rpc.js | 2 +-
server/api/cmContactHasItem/index.js | 2 +-
.../api/cmCustomField/cmCustomField.attributes.js | 2 +-
.../api/cmCustomField/cmCustomField.controller.js | 2 +-
server/api/cmCustomField/cmCustomField.model.js | 2 +-
server/api/cmCustomField/cmCustomField.rpc.js | 2 +-
server/api/cmCustomField/index.js | 2 +-
server/api/cmHopper/cmHopper.attributes.js | 2 +-
server/api/cmHopper/cmHopper.controller.js | 2 +-
server/api/cmHopper/cmHopper.model.js | 2 +-
server/api/cmHopper/cmHopper.rpc.js | 2 +-
server/api/cmHopper/index.js | 2 +-
.../cmHopperAdditionalPhone.attributes.js | 2 +-
.../cmHopperAdditionalPhone.controller.js | 2 +-
.../cmHopperAdditionalPhone.model.js | 2 +-
.../cmHopperAdditionalPhone.rpc.js | 2 +-
server/api/cmHopperAdditionalPhone/index.js | 2 +-
.../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +-
.../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +-
server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +-
server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +-
server/api/cmHopperBlack/index.js | 2 +-
.../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +-
.../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +-
server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +-
server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +-
server/api/cmHopperFinal/index.js | 2 +-
.../cmHopperHistory/cmHopperHistory.attributes.js | 2 +-
.../cmHopperHistory/cmHopperHistory.controller.js | 2 +-
.../api/cmHopperHistory/cmHopperHistory.model.js | 2 +-
server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +-
server/api/cmHopperHistory/index.js | 2 +-
server/api/cmList/cmList.attributes.js | 2 +-
server/api/cmList/cmList.controller.js | 2 +-
server/api/cmList/cmList.events.js | 2 +-
server/api/cmList/cmList.model.js | 2 +-
server/api/cmList/cmList.rpc.js | 2 +-
server/api/cmList/cmList.socket.js | 2 +-
server/api/cmList/index.js | 2 +-
server/api/condition/condition.attributes.js | 2 +-
server/api/condition/condition.controller.js | 2 +-
server/api/condition/condition.model.js | 2 +-
server/api/condition/condition.rpc.js | 2 +-
server/api/condition/index.js | 2 +-
.../contactItemType/contactItemType.attributes.js | 2 +-
.../contactItemType/contactItemType.controller.js | 2 +-
.../api/contactItemType/contactItemType.model.js | 2 +-
server/api/contactItemType/contactItemType.rpc.js | 2 +-
server/api/contactItemType/index.js | 2 +-
server/api/dashboard/dashboard.attributes.js | 2 +-
server/api/dashboard/dashboard.controller.js | 2 +-
server/api/dashboard/dashboard.events.js | 2 +-
server/api/dashboard/dashboard.model.js | 2 +-
server/api/dashboard/dashboard.rpc.js | 2 +-
server/api/dashboard/dashboard.socket.js | 2 +-
server/api/dashboard/index.js | 2 +-
.../api/dashboardItem/dashboardItem.attributes.js | 2 +-
.../api/dashboardItem/dashboardItem.controller.js | 2 +-
server/api/dashboardItem/dashboardItem.events.js | 2 +-
server/api/dashboardItem/dashboardItem.model.js | 2 +-
server/api/dashboardItem/dashboardItem.rpc.js | 2 +-
server/api/dashboardItem/dashboardItem.socket.js | 2 +-
server/api/dashboardItem/index.js | 2 +-
server/api/disposition/disposition.attributes.js | 2 +-
server/api/disposition/disposition.controller.js | 2 +-
server/api/disposition/disposition.model.js | 2 +-
server/api/disposition/disposition.rpc.js | 2 +-
server/api/disposition/index.js | 2 +-
server/api/faxAccount/faxAccount.attributes.js | 2 +-
server/api/faxAccount/faxAccount.controller.js | 2 +-
server/api/faxAccount/faxAccount.events.js | 2 +-
server/api/faxAccount/faxAccount.model.js | 2 +-
server/api/faxAccount/faxAccount.rpc.js | 2 +-
server/api/faxAccount/faxAccount.socket.js | 2 +-
server/api/faxAccount/index.js | 2 +-
.../faxApplication/faxApplication.attributes.js | 2 +-
.../faxApplication/faxApplication.controller.js | 2 +-
server/api/faxApplication/faxApplication.model.js | 2 +-
server/api/faxApplication/faxApplication.rpc.js | 2 +-
server/api/faxApplication/index.js | 2 +-
.../faxInteraction/faxInteraction.attributes.js | 2 +-
.../faxInteraction/faxInteraction.controller.js | 2 +-
server/api/faxInteraction/faxInteraction.events.js | 2 +-
server/api/faxInteraction/faxInteraction.model.js | 2 +-
server/api/faxInteraction/faxInteraction.rpc.js | 2 +-
server/api/faxInteraction/faxInteraction.socket.js | 2 +-
server/api/faxInteraction/index.js | 2 +-
server/api/faxMessage/faxMessage.attributes.js | 2 +-
server/api/faxMessage/faxMessage.controller.js | 2 +-
server/api/faxMessage/faxMessage.events.js | 2 +-
server/api/faxMessage/faxMessage.model.js | 2 +-
server/api/faxMessage/faxMessage.rpc.js | 2 +-
server/api/faxMessage/faxMessage.socket.js | 2 +-
server/api/faxMessage/index.js | 2 +-
server/api/faxQueue/faxQueue.attributes.js | 2 +-
server/api/faxQueue/faxQueue.controller.js | 2 +-
server/api/faxQueue/faxQueue.events.js | 2 +-
server/api/faxQueue/faxQueue.model.js | 2 +-
server/api/faxQueue/faxQueue.rpc.js | 2 +-
server/api/faxQueue/faxQueue.socket.js | 2 +-
server/api/faxQueue/index.js | 2 +-
.../faxQueueReport/faxQueueReport.attributes.js | 2 +-
.../faxQueueReport/faxQueueReport.controller.js | 2 +-
server/api/faxQueueReport/faxQueueReport.model.js | 2 +-
server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +-
server/api/faxQueueReport/index.js | 2 +-
.../faxTransferReport.attributes.js | 2 +-
.../faxTransferReport.controller.js | 2 +-
.../faxTransferReport/faxTransferReport.model.js | 2 +-
.../api/faxTransferReport/faxTransferReport.rpc.js | 2 +-
server/api/faxTransferReport/index.js | 2 +-
server/api/intDeskAccount/index.js | 2 +-
.../intDeskAccount/intDeskAccount.attributes.js | 2 +-
.../intDeskAccount/intDeskAccount.controller.js | 2 +-
server/api/intDeskAccount/intDeskAccount.model.js | 2 +-
server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +-
server/api/intDeskConfiguration/index.js | 2 +-
.../intDeskConfiguration.attributes.js | 2 +-
.../intDeskConfiguration.controller.js | 2 +-
.../intDeskConfiguration.model.js | 2 +-
.../intDeskConfiguration.rpc.js | 2 +-
server/api/intDeskField/index.js | 2 +-
server/api/intDeskField/intDeskField.attributes.js | 2 +-
server/api/intDeskField/intDeskField.controller.js | 2 +-
server/api/intDeskField/intDeskField.model.js | 2 +-
server/api/intDeskField/intDeskField.rpc.js | 2 +-
server/api/intDynamics365Account/index.js | 2 +-
.../intDynamics365Account.attributes.js | 2 +-
.../intDynamics365Account.controller.js | 2 +-
.../intDynamics365Account.model.js | 2 +-
.../intDynamics365Account.rpc.js | 2 +-
server/api/intDynamics365Configuration/index.js | 2 +-
.../intDynamics365Configuration.attributes.js | 2 +-
.../intDynamics365Configuration.controller.js | 2 +-
.../intDynamics365Configuration.model.js | 2 +-
.../intDynamics365Configuration.rpc.js | 2 +-
server/api/intDynamics365Field/index.js | 2 +-
.../intDynamics365Field.attributes.js | 2 +-
.../intDynamics365Field.controller.js | 2 +-
.../intDynamics365Field.model.js | 2 +-
.../intDynamics365Field/intDynamics365Field.rpc.js | 2 +-
server/api/intFreshdeskAccount/index.js | 2 +-
.../intFreshdeskAccount.attributes.js | 2 +-
.../intFreshdeskAccount.controller.js | 2 +-
.../intFreshdeskAccount.model.js | 2 +-
.../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +-
server/api/intFreshdeskConfiguration/index.js | 2 +-
.../intFreshdeskConfiguration.attributes.js | 2 +-
.../intFreshdeskConfiguration.controller.js | 2 +-
.../intFreshdeskConfiguration.model.js | 2 +-
.../intFreshdeskConfiguration.rpc.js | 2 +-
server/api/intFreshdeskField/index.js | 2 +-
.../intFreshdeskField.attributes.js | 2 +-
.../intFreshdeskField.controller.js | 2 +-
.../intFreshdeskField/intFreshdeskField.model.js | 2 +-
.../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +-
server/api/intFreshsalesAccount/index.js | 2 +-
.../intFreshsalesAccount.attributes.js | 2 +-
.../intFreshsalesAccount.controller.js | 2 +-
.../intFreshsalesAccount.model.js | 2 +-
.../intFreshsalesAccount.rpc.js | 2 +-
server/api/intFreshsalesConfiguration/index.js | 2 +-
.../intFreshsalesConfiguration.attributes.js | 2 +-
.../intFreshsalesConfiguration.controller.js | 2 +-
.../intFreshsalesConfiguration.model.js | 2 +-
.../intFreshsalesConfiguration.rpc.js | 2 +-
server/api/intFreshsalesField/index.js | 2 +-
.../intFreshsalesField.attributes.js | 2 +-
.../intFreshsalesField.controller.js | 2 +-
.../intFreshsalesField/intFreshsalesField.model.js | 2 +-
.../intFreshsalesField/intFreshsalesField.rpc.js | 2 +-
server/api/intSalesforceAccount/index.js | 2 +-
.../intSalesforceAccount.attributes.js | 2 +-
.../intSalesforceAccount.controller.js | 2 +-
.../intSalesforceAccount.model.js | 2 +-
.../intSalesforceAccount.rpc.js | 2 +-
server/api/intSalesforceConfiguration/index.js | 2 +-
.../intSalesforceConfiguration.attributes.js | 2 +-
.../intSalesforceConfiguration.controller.js | 2 +-
.../intSalesforceConfiguration.model.js | 2 +-
.../intSalesforceConfiguration.rpc.js | 2 +-
server/api/intSalesforceField/index.js | 2 +-
.../intSalesforceField.attributes.js | 2 +-
.../intSalesforceField.controller.js | 2 +-
.../intSalesforceField/intSalesforceField.model.js | 2 +-
.../intSalesforceField/intSalesforceField.rpc.js | 2 +-
server/api/intServicenowAccount/index.js | 2 +-
.../intServicenowAccount.attributes.js | 2 +-
.../intServicenowAccount.controller.js | 2 +-
.../intServicenowAccount.model.js | 2 +-
.../intServicenowAccount.rpc.js | 2 +-
server/api/intServicenowConfiguration/index.js | 2 +-
.../intServicenowConfiguration.attributes.js | 2 +-
.../intServicenowConfiguration.controller.js | 2 +-
.../intServicenowConfiguration.model.js | 2 +-
.../intServicenowConfiguration.rpc.js | 2 +-
server/api/intServicenowField/index.js | 2 +-
.../intServicenowField.attributes.js | 2 +-
.../intServicenowField.controller.js | 2 +-
.../intServicenowField/intServicenowField.model.js | 2 +-
.../intServicenowField/intServicenowField.rpc.js | 2 +-
server/api/intSugarcrmAccount/index.js | 2 +-
.../intSugarcrmAccount.attributes.js | 2 +-
.../intSugarcrmAccount.controller.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +-
server/api/intSugarcrmConfiguration/index.js | 2 +-
.../intSugarcrmConfiguration.attributes.js | 2 +-
.../intSugarcrmConfiguration.controller.js | 2 +-
.../intSugarcrmConfiguration.model.js | 2 +-
.../intSugarcrmConfiguration.rpc.js | 2 +-
server/api/intSugarcrmField/index.js | 2 +-
.../intSugarcrmField.attributes.js | 2 +-
.../intSugarcrmField.controller.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.model.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +-
server/api/intVtigerAccount/index.js | 2 +-
.../intVtigerAccount.attributes.js | 2 +-
.../intVtigerAccount.controller.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.model.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +-
server/api/intVtigerConfiguration/index.js | 2 +-
.../intVtigerConfiguration.attributes.js | 2 +-
.../intVtigerConfiguration.controller.js | 2 +-
.../intVtigerConfiguration.model.js | 2 +-
.../intVtigerConfiguration.rpc.js | 2 +-
server/api/intVtigerField/index.js | 2 +-
.../intVtigerField/intVtigerField.attributes.js | 2 +-
.../intVtigerField/intVtigerField.controller.js | 2 +-
server/api/intVtigerField/intVtigerField.model.js | 2 +-
server/api/intVtigerField/intVtigerField.rpc.js | 2 +-
server/api/intZendeskAccount/index.js | 2 +-
.../intZendeskAccount.attributes.js | 2 +-
.../intZendeskAccount.controller.js | 2 +-
.../intZendeskAccount/intZendeskAccount.model.js | 2 +-
.../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +-
server/api/intZendeskConfiguration/index.js | 2 +-
.../intZendeskConfiguration.attributes.js | 2 +-
.../intZendeskConfiguration.controller.js | 2 +-
.../intZendeskConfiguration.model.js | 2 +-
.../intZendeskConfiguration.rpc.js | 2 +-
server/api/intZendeskField/index.js | 2 +-
.../intZendeskField/intZendeskField.attributes.js | 2 +-
.../intZendeskField/intZendeskField.controller.js | 2 +-
.../api/intZendeskField/intZendeskField.model.js | 2 +-
server/api/intZendeskField/intZendeskField.rpc.js | 2 +-
server/api/intZohoAccount/index.js | 2 +-
.../intZohoAccount/intZohoAccount.attributes.js | 2 +-
.../intZohoAccount/intZohoAccount.controller.js | 2 +-
server/api/intZohoAccount/intZohoAccount.model.js | 2 +-
server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +-
server/api/intZohoConfiguration/index.js | 2 +-
.../intZohoConfiguration.attributes.js | 2 +-
.../intZohoConfiguration.controller.js | 2 +-
.../intZohoConfiguration.model.js | 2 +-
.../intZohoConfiguration.rpc.js | 2 +-
server/api/intZohoField/index.js | 2 +-
server/api/intZohoField/intZohoField.attributes.js | 2 +-
server/api/intZohoField/intZohoField.controller.js | 2 +-
server/api/intZohoField/intZohoField.model.js | 2 +-
server/api/intZohoField/intZohoField.rpc.js | 2 +-
server/api/integration/index.js | 2 +-
server/api/integration/integration.attributes.js | 2 +-
server/api/integration/integration.controller.js | 2 +-
server/api/integration/integration.model.js | 2 +-
server/api/integration/integration.rpc.js | 2 +-
server/api/integrationReport/index.js | 2 +-
.../integrationReport.attributes.js | 2 +-
.../integrationReport.controller.js | 2 +-
.../integrationReport/integrationReport.model.js | 2 +-
.../api/integrationReport/integrationReport.rpc.js | 2 +-
server/api/interval/index.js | 2 +-
server/api/interval/interval.attributes.js | 2 +-
server/api/interval/interval.controller.js | 2 +-
server/api/interval/interval.model.js | 2 +-
server/api/interval/interval.rpc.js | 2 +-
server/api/jira/index.js | 2 +-
server/api/jira/jira.controller.js | 2 +-
server/api/jscriptyAnswerReport/index.js | 2 +-
.../jscriptyAnswerReport.attributes.js | 2 +-
.../jscriptyAnswerReport.controller.js | 2 +-
.../jscriptyAnswerReport.model.js | 2 +-
.../jscriptyAnswerReport.rpc.js | 2 +-
server/api/jscriptyProject/index.js | 2 +-
.../jscriptyProject/jscriptyProject.attributes.js | 2 +-
.../jscriptyProject/jscriptyProject.controller.js | 2 +-
.../api/jscriptyProject/jscriptyProject.model.js | 2 +-
server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +-
server/api/jscriptyQuestionReport/index.js | 2 +-
.../jscriptyQuestionReport.attributes.js | 2 +-
.../jscriptyQuestionReport.controller.js | 2 +-
.../jscriptyQuestionReport.model.js | 2 +-
.../jscriptyQuestionReport.rpc.js | 2 +-
server/api/jscriptySessionReport/index.js | 2 +-
.../jscriptySessionReport.attributes.js | 2 +-
.../jscriptySessionReport.controller.js | 2 +-
.../jscriptySessionReport.model.js | 2 +-
.../jscriptySessionReport.rpc.js | 2 +-
server/api/license/index.js | 2 +-
server/api/license/license.attributes.js | 2 +-
server/api/license/license.controller.js | 2 +-
server/api/license/license.model.js | 2 +-
server/api/license/license.rpc.js | 2 +-
server/api/mailAccount/index.js | 2 +-
server/api/mailAccount/mailAccount.attributes.js | 2 +-
server/api/mailAccount/mailAccount.controller.js | 2 +-
server/api/mailAccount/mailAccount.events.js | 2 +-
server/api/mailAccount/mailAccount.model.js | 2 +-
server/api/mailAccount/mailAccount.rpc.js | 2 +-
server/api/mailAccount/mailAccount.socket.js | 2 +-
server/api/mailApplication/index.js | 2 +-
.../mailApplication/mailApplication.attributes.js | 2 +-
.../mailApplication/mailApplication.controller.js | 2 +-
.../api/mailApplication/mailApplication.model.js | 2 +-
server/api/mailApplication/mailApplication.rpc.js | 2 +-
server/api/mailInteraction/index.js | 2 +-
.../mailInteraction/mailInteraction.attributes.js | 2 +-
.../mailInteraction/mailInteraction.controller.js | 2 +-
.../api/mailInteraction/mailInteraction.events.js | 2 +-
.../api/mailInteraction/mailInteraction.model.js | 2 +-
server/api/mailInteraction/mailInteraction.rpc.js | 2 +-
.../api/mailInteraction/mailInteraction.socket.js | 2 +-
server/api/mailMessage/index.js | 2 +-
server/api/mailMessage/mailMessage.attributes.js | 2 +-
server/api/mailMessage/mailMessage.controller.js | 2 +-
server/api/mailMessage/mailMessage.events.js | 2 +-
server/api/mailMessage/mailMessage.model.js | 2 +-
server/api/mailMessage/mailMessage.rpc.js | 2 +-
server/api/mailMessage/mailMessage.socket.js | 2 +-
server/api/mailQueue/index.js | 2 +-
server/api/mailQueue/mailQueue.attributes.js | 2 +-
server/api/mailQueue/mailQueue.controller.js | 2 +-
server/api/mailQueue/mailQueue.events.js | 2 +-
server/api/mailQueue/mailQueue.model.js | 2 +-
server/api/mailQueue/mailQueue.rpc.js | 2 +-
server/api/mailQueue/mailQueue.socket.js | 2 +-
server/api/mailQueueReport/index.js | 2 +-
.../mailQueueReport/mailQueueReport.attributes.js | 2 +-
.../mailQueueReport/mailQueueReport.controller.js | 2 +-
.../api/mailQueueReport/mailQueueReport.model.js | 2 +-
server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +-
server/api/mailServerIn/index.js | 2 +-
server/api/mailServerIn/mailServerIn.attributes.js | 2 +-
server/api/mailServerIn/mailServerIn.model.js | 2 +-
server/api/mailServerIn/mailServerIn.rpc.js | 2 +-
server/api/mailServerOut/index.js | 2 +-
.../api/mailServerOut/mailServerOut.attributes.js | 2 +-
.../api/mailServerOut/mailServerOut.controller.js | 2 +-
server/api/mailServerOut/mailServerOut.model.js | 2 +-
server/api/mailServerOut/mailServerOut.rpc.js | 2 +-
server/api/mailSubstatus/index.js | 2 +-
.../api/mailSubstatus/mailSubstatus.attributes.js | 2 +-
.../api/mailSubstatus/mailSubstatus.controller.js | 2 +-
server/api/mailSubstatus/mailSubstatus.events.js | 2 +-
server/api/mailSubstatus/mailSubstatus.model.js | 2 +-
server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +-
server/api/mailTransferReport/index.js | 2 +-
.../mailTransferReport.attributes.js | 2 +-
.../mailTransferReport.controller.js | 2 +-
.../mailTransferReport/mailTransferReport.model.js | 2 +-
.../mailTransferReport/mailTransferReport.rpc.js | 2 +-
server/api/memberReport/index.js | 2 +-
server/api/memberReport/memberReport.attributes.js | 2 +-
server/api/memberReport/memberReport.controller.js | 2 +-
server/api/memberReport/memberReport.model.js | 2 +-
server/api/memberReport/memberReport.rpc.js | 2 +-
server/api/migration/index.js | 2 +-
server/api/migration/migration.attributes.js | 2 +-
server/api/migration/migration.controller.js | 2 +-
server/api/migration/migration.model.js | 2 +-
server/api/migration/migration.rpc.js | 2 +-
server/api/network/index.js | 2 +-
server/api/network/network.attributes.js | 2 +-
server/api/network/network.controller.js | 2 +-
server/api/network/network.model.js | 2 +-
server/api/network/network.rpc.js | 2 +-
server/api/openchannelAccount/index.js | 2 +-
.../openchannelAccount.attributes.js | 2 +-
.../openchannelAccount.controller.js | 2 +-
.../openchannelAccount.events.js | 2 +-
.../openchannelAccount/openchannelAccount.model.js | 2 +-
.../openchannelAccount/openchannelAccount.rpc.js | 2 +-
.../openchannelAccount.socket.js | 2 +-
server/api/openchannelApplication/index.js | 2 +-
.../openchannelApplication.attributes.js | 2 +-
.../openchannelApplication.controller.js | 2 +-
.../openchannelApplication.model.js | 2 +-
.../openchannelApplication.rpc.js | 2 +-
server/api/openchannelInteraction/index.js | 2 +-
.../openchannelInteraction.attributes.js | 2 +-
.../openchannelInteraction.controller.js | 2 +-
.../openchannelInteraction.events.js | 2 +-
.../openchannelInteraction.model.js | 2 +-
.../openchannelInteraction.rpc.js | 2 +-
.../openchannelInteraction.socket.js | 2 +-
server/api/openchannelMessage/index.js | 2 +-
.../openchannelMessage.attributes.js | 2 +-
.../openchannelMessage.controller.js | 2 +-
.../openchannelMessage.events.js | 2 +-
.../openchannelMessage/openchannelMessage.model.js | 2 +-
.../openchannelMessage/openchannelMessage.rpc.js | 2 +-
.../openchannelMessage.socket.js | 2 +-
server/api/openchannelQueue/index.js | 2 +-
.../openchannelQueue.attributes.js | 2 +-
.../openchannelQueue.controller.js | 2 +-
.../openchannelQueue/openchannelQueue.events.js | 2 +-
.../api/openchannelQueue/openchannelQueue.model.js | 2 +-
.../api/openchannelQueue/openchannelQueue.rpc.js | 2 +-
.../openchannelQueue/openchannelQueue.socket.js | 2 +-
server/api/openchannelQueueReport/index.js | 2 +-
.../openchannelQueueReport.attributes.js | 2 +-
.../openchannelQueueReport.controller.js | 2 +-
.../openchannelQueueReport.model.js | 2 +-
.../openchannelQueueReport.rpc.js | 2 +-
server/api/openchannelTransferReport/index.js | 2 +-
.../openchannelTransferReport.attributes.js | 2 +-
.../openchannelTransferReport.controller.js | 2 +-
.../openchannelTransferReport.model.js | 2 +-
.../openchannelTransferReport.rpc.js | 2 +-
server/api/pause/index.js | 2 +-
server/api/pause/pause.attributes.js | 2 +-
server/api/pause/pause.controller.js | 2 +-
server/api/pause/pause.model.js | 2 +-
server/api/pause/pause.rpc.js | 2 +-
server/api/plugin/index.js | 2 +-
server/api/plugin/plugin.attributes.js | 2 +-
server/api/plugin/plugin.controller.js | 2 +-
server/api/plugin/plugin.events.js | 2 +-
server/api/plugin/plugin.model.js | 2 +-
server/api/plugin/plugin.rpc.js | 2 +-
server/api/plugin/plugin.socket.js | 2 +-
server/api/pm2/index.js | 2 +-
server/api/pm2/pm2.controller.js | 2 +-
server/api/realtime/index.js | 2 +-
server/api/realtime/realtime.controller.js | 2 +-
server/api/reportAgentPreview/index.js | 2 +-
.../reportAgentPreview.attributes.js | 2 +-
.../reportAgentPreview/reportAgentPreview.model.js | 2 +-
.../reportAgentPreview/reportAgentPreview.rpc.js | 2 +-
server/api/rpc/index.js | 2 +-
server/api/rpc/rpc.controller.js | 2 +-
server/api/schedule/index.js | 2 +-
server/api/schedule/schedule.attributes.js | 2 +-
server/api/schedule/schedule.controller.js | 2 +-
server/api/schedule/schedule.model.js | 2 +-
server/api/schedule/schedule.rpc.js | 2 +-
server/api/screenRecording/index.js | 2 +-
.../screenRecording/screenRecording.attributes.js | 2 +-
.../screenRecording/screenRecording.controller.js | 2 +-
.../api/screenRecording/screenRecording.model.js | 2 +-
server/api/screenRecording/screenRecording.rpc.js | 2 +-
server/api/setting/index.js | 2 +-
server/api/setting/setting.attributes.js | 2 +-
server/api/setting/setting.controller.js | 2 +-
server/api/setting/setting.model.js | 2 +-
server/api/setting/setting.rpc.js | 2 +-
server/api/smsAccount/index.js | 2 +-
server/api/smsAccount/smsAccount.attributes.js | 2 +-
server/api/smsAccount/smsAccount.controller.js | 2 +-
server/api/smsAccount/smsAccount.events.js | 2 +-
server/api/smsAccount/smsAccount.model.js | 2 +-
server/api/smsAccount/smsAccount.rpc.js | 2 +-
server/api/smsAccount/smsAccount.socket.js | 2 +-
server/api/smsApplication/index.js | 2 +-
.../smsApplication/smsApplication.attributes.js | 2 +-
.../smsApplication/smsApplication.controller.js | 2 +-
server/api/smsApplication/smsApplication.model.js | 2 +-
server/api/smsApplication/smsApplication.rpc.js | 2 +-
server/api/smsInteraction/index.js | 2 +-
.../smsInteraction/smsInteraction.attributes.js | 2 +-
.../smsInteraction/smsInteraction.controller.js | 2 +-
server/api/smsInteraction/smsInteraction.events.js | 2 +-
server/api/smsInteraction/smsInteraction.model.js | 2 +-
server/api/smsInteraction/smsInteraction.rpc.js | 2 +-
server/api/smsInteraction/smsInteraction.socket.js | 2 +-
server/api/smsMessage/index.js | 2 +-
server/api/smsMessage/smsMessage.attributes.js | 2 +-
server/api/smsMessage/smsMessage.controller.js | 2 +-
server/api/smsMessage/smsMessage.events.js | 2 +-
server/api/smsMessage/smsMessage.model.js | 2 +-
server/api/smsMessage/smsMessage.rpc.js | 2 +-
server/api/smsMessage/smsMessage.socket.js | 2 +-
server/api/smsQueue/index.js | 2 +-
server/api/smsQueue/smsQueue.attributes.js | 2 +-
server/api/smsQueue/smsQueue.controller.js | 2 +-
server/api/smsQueue/smsQueue.events.js | 2 +-
server/api/smsQueue/smsQueue.model.js | 2 +-
server/api/smsQueue/smsQueue.rpc.js | 2 +-
server/api/smsQueue/smsQueue.socket.js | 2 +-
server/api/smsQueueReport/index.js | 2 +-
.../smsQueueReport/smsQueueReport.attributes.js | 2 +-
.../smsQueueReport/smsQueueReport.controller.js | 2 +-
server/api/smsQueueReport/smsQueueReport.model.js | 2 +-
server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +-
server/api/smsTransferReport/index.js | 2 +-
.../smsTransferReport.attributes.js | 2 +-
.../smsTransferReport.controller.js | 2 +-
.../smsTransferReport/smsTransferReport.model.js | 2 +-
.../api/smsTransferReport/smsTransferReport.rpc.js | 2 +-
server/api/sound/index.js | 2 +-
server/api/sound/sound.attributes.js | 2 +-
server/api/sound/sound.controller.js | 2 +-
server/api/sound/sound.model.js | 2 +-
server/api/sound/sound.rpc.js | 2 +-
server/api/squareMessage/index.js | 2 +-
.../api/squareMessage/squareMessage.attributes.js | 2 +-
.../api/squareMessage/squareMessage.controller.js | 2 +-
server/api/squareMessage/squareMessage.model.js | 2 +-
server/api/squareMessage/squareMessage.rpc.js | 2 +-
server/api/squareOdbc/index.js | 2 +-
server/api/squareOdbc/squareOdbc.attributes.js | 2 +-
server/api/squareOdbc/squareOdbc.controller.js | 2 +-
server/api/squareOdbc/squareOdbc.model.js | 2 +-
server/api/squareOdbc/squareOdbc.rpc.js | 2 +-
server/api/squareProject/index.js | 2 +-
.../api/squareProject/squareProject.attributes.js | 2 +-
.../api/squareProject/squareProject.controller.js | 2 +-
server/api/squareProject/squareProject.events.js | 2 +-
server/api/squareProject/squareProject.model.js | 2 +-
server/api/squareProject/squareProject.rpc.js | 2 +-
server/api/squareProject/squareProject.socket.js | 2 +-
server/api/squareRecording/index.js | 2 +-
.../squareRecording/squareRecording.attributes.js | 2 +-
.../squareRecording/squareRecording.controller.js | 2 +-
.../api/squareRecording/squareRecording.model.js | 2 +-
server/api/squareRecording/squareRecording.rpc.js | 2 +-
server/api/squareReport/index.js | 2 +-
server/api/squareReport/squareReport.attributes.js | 2 +-
server/api/squareReport/squareReport.controller.js | 2 +-
server/api/squareReport/squareReport.model.js | 2 +-
server/api/squareReport/squareReport.rpc.js | 2 +-
server/api/squareReportDetail/index.js | 2 +-
.../squareReportDetail.attributes.js | 2 +-
.../squareReportDetail.controller.js | 2 +-
.../squareReportDetail/squareReportDetail.model.js | 2 +-
.../squareReportDetail/squareReportDetail.rpc.js | 2 +-
server/api/system/index.js | 2 +-
server/api/system/system.controller.js | 2 +-
server/api/tag/index.js | 2 +-
server/api/tag/tag.attributes.js | 2 +-
server/api/tag/tag.controller.js | 2 +-
server/api/tag/tag.model.js | 2 +-
server/api/tag/tag.rpc.js | 2 +-
server/api/team/index.js | 2 +-
server/api/team/team.attributes.js | 2 +-
server/api/team/team.controller.js | 2 +-
server/api/team/team.events.js | 2 +-
server/api/team/team.model.js | 2 +-
server/api/team/team.rpc.js | 2 +-
server/api/team/team.socket.js | 2 +-
.../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +-
.../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +-
server/api/teamVoiceQueue/index.js | 2 +-
.../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +-
server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +-
server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +-
server/api/template/index.js | 2 +-
server/api/template/template.attributes.js | 2 +-
server/api/template/template.controller.js | 2 +-
server/api/template/template.model.js | 2 +-
server/api/template/template.rpc.js | 2 +-
server/api/trigger/index.js | 2 +-
server/api/trigger/trigger.attributes.js | 2 +-
server/api/trigger/trigger.controller.js | 2 +-
server/api/trigger/trigger.model.js | 2 +-
server/api/trigger/trigger.rpc.js | 2 +-
server/api/trunk/index.js | 2 +-
server/api/trunk/trunk.attributes.js | 2 +-
server/api/trunk/trunk.controller.js | 2 +-
server/api/trunk/trunk.model.js | 2 +-
server/api/trunk/trunk.rpc.js | 2 +-
server/api/user-setting/index.js | 2 +-
server/api/user-setting/user-setting.attributes.js | 2 +-
server/api/user-setting/user-setting.controller.js | 2 +-
server/api/user-setting/user-setting.events.js | 2 +-
server/api/user-setting/user-setting.model.js | 2 +-
server/api/user-setting/user-setting.socket.js | 2 +-
server/api/user/index.js | 2 +-
server/api/user/user.attributes.js | 2 +-
server/api/user/user.controller.js | 2 +-
server/api/user/user.events.js | 2 +-
server/api/user/user.model.js | 2 +-
server/api/user/user.rpc.js | 2 +-
server/api/user/user.socket.js | 2 +-
server/api/userChatQueue/index.js | 2 +-
.../api/userChatQueue/userChatQueue.attributes.js | 2 +-
server/api/userChatQueue/userChatQueue.model.js | 2 +-
server/api/userChatQueue/userChatQueue.rpc.js | 2 +-
server/api/userFaxQueue/index.js | 2 +-
server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +-
server/api/userFaxQueue/userFaxQueue.model.js | 2 +-
server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +-
server/api/userMailQueue/index.js | 2 +-
.../api/userMailQueue/userMailQueue.attributes.js | 2 +-
server/api/userMailQueue/userMailQueue.model.js | 2 +-
server/api/userMailQueue/userMailQueue.rpc.js | 2 +-
server/api/userNotification/index.js | 2 +-
.../userNotification.attributes.js | 2 +-
.../userNotification.controller.js | 2 +-
.../userNotification/userNotification.events.js | 2 +-
.../api/userNotification/userNotification.model.js | 2 +-
.../api/userNotification/userNotification.rpc.js | 2 +-
.../userNotification/userNotification.socket.js | 2 +-
server/api/userOpenchannelQueue/index.js | 2 +-
.../userOpenchannelQueue.attributes.js | 2 +-
.../userOpenchannelQueue.model.js | 2 +-
.../userOpenchannelQueue.rpc.js | 2 +-
server/api/userProfile/index.js | 2 +-
server/api/userProfile/userProfile.attributes.js | 2 +-
server/api/userProfile/userProfile.controller.js | 2 +-
server/api/userProfile/userProfile.events.js | 2 +-
server/api/userProfile/userProfile.model.js | 2 +-
server/api/userProfile/userProfile.rpc.js | 2 +-
server/api/userProfile/userProfile.socket.js | 2 +-
server/api/userProfileResource/index.js | 2 +-
.../userProfileResource.attributes.js | 2 +-
.../userProfileResource.controller.js | 2 +-
.../userProfileResource.model.js | 2 +-
.../userProfileResource/userProfileResource.rpc.js | 2 +-
server/api/userProfileSection/index.js | 2 +-
.../userProfileSection.attributes.js | 2 +-
.../userProfileSection.controller.js | 2 +-
.../userProfileSection/userProfileSection.model.js | 2 +-
.../userProfileSection/userProfileSection.rpc.js | 2 +-
server/api/userSmsQueue/index.js | 2 +-
server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +-
server/api/userSmsQueue/userSmsQueue.model.js | 2 +-
server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +-
.../userVoicePrefix/userVoicePrefix.attributes.js | 2 +-
.../api/userVoicePrefix/userVoicePrefix.model.js | 2 +-
server/api/userVoiceQueue/index.js | 2 +-
.../userVoiceQueue/userVoiceQueue.attributes.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +-
server/api/userVoiceQueueRt/index.js | 2 +-
.../userVoiceQueueRt.attributes.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +-
server/api/userWhatsappQueue/index.js | 2 +-
.../userWhatsappQueue.attributes.js | 2 +-
.../userWhatsappQueue/userWhatsappQueue.model.js | 2 +-
.../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +-
server/api/variable/index.js | 2 +-
server/api/variable/variable.attributes.js | 2 +-
server/api/variable/variable.controller.js | 2 +-
server/api/variable/variable.model.js | 2 +-
server/api/variable/variable.rpc.js | 2 +-
server/api/version/index.js | 2 +-
server/api/version/version.controller.js | 2 +-
server/api/voiceAgentReport/index.js | 2 +-
.../voiceAgentReport.attributes.js | 2 +-
.../voiceAgentReport.controller.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.model.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +-
server/api/voiceCallReport/index.js | 2 +-
.../voiceCallReport/voiceCallReport.attributes.js | 2 +-
.../voiceCallReport/voiceCallReport.controller.js | 2 +-
.../api/voiceCallReport/voiceCallReport.model.js | 2 +-
server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +-
server/api/voiceChanSpy/index.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +-
server/api/voiceContext/index.js | 2 +-
server/api/voiceContext/voiceContext.attributes.js | 2 +-
server/api/voiceContext/voiceContext.controller.js | 2 +-
server/api/voiceContext/voiceContext.model.js | 2 +-
server/api/voiceContext/voiceContext.rpc.js | 2 +-
server/api/voiceDialReport/index.js | 2 +-
.../voiceDialReport/voiceDialReport.attributes.js | 2 +-
.../voiceDialReport/voiceDialReport.controller.js | 2 +-
.../api/voiceDialReport/voiceDialReport.model.js | 2 +-
server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +-
server/api/voiceExtension/index.js | 2 +-
.../voiceExtension/voiceExtension.attributes.js | 2 +-
.../voiceExtension/voiceExtension.controller.js | 2 +-
server/api/voiceExtension/voiceExtension.events.js | 2 +-
server/api/voiceExtension/voiceExtension.model.js | 2 +-
server/api/voiceExtension/voiceExtension.rpc.js | 2 +-
server/api/voiceExtension/voiceExtension.socket.js | 2 +-
server/api/voiceMail/index.js | 2 +-
server/api/voiceMail/voiceMail.attributes.js | 2 +-
server/api/voiceMail/voiceMail.controller.js | 2 +-
server/api/voiceMail/voiceMail.model.js | 2 +-
server/api/voiceMail/voiceMail.rpc.js | 2 +-
server/api/voiceMailMessage/index.js | 2 +-
.../voiceMailMessage.attributes.js | 2 +-
.../voiceMailMessage.controller.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.model.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +-
server/api/voiceMusicOnHold/index.js | 2 +-
.../voiceMusicOnHold.attributes.js | 2 +-
.../voiceMusicOnHold.controller.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +-
server/api/voicePrefix/index.js | 2 +-
server/api/voicePrefix/voicePrefix.attributes.js | 2 +-
server/api/voicePrefix/voicePrefix.controller.js | 2 +-
server/api/voicePrefix/voicePrefix.events.js | 2 +-
server/api/voicePrefix/voicePrefix.model.js | 2 +-
server/api/voicePrefix/voicePrefix.rpc.js | 2 +-
server/api/voicePrefix/voicePrefix.socket.js | 2 +-
server/api/voiceQueue/index.js | 2 +-
server/api/voiceQueue/voiceQueue.attributes.js | 2 +-
server/api/voiceQueue/voiceQueue.controller.js | 2 +-
server/api/voiceQueue/voiceQueue.events.js | 2 +-
server/api/voiceQueue/voiceQueue.model.js | 2 +-
server/api/voiceQueue/voiceQueue.rpc.js | 2 +-
server/api/voiceQueue/voiceQueue.socket.js | 2 +-
server/api/voiceQueueReport/index.js | 2 +-
.../voiceQueueReport.attributes.js | 2 +-
.../voiceQueueReport.controller.js | 2 +-
.../voiceQueueReport/voiceQueueReport.events.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.model.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +-
.../voiceQueueReport/voiceQueueReport.socket.js | 2 +-
server/api/voiceQueuesLog/index.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +-
server/api/voiceRecording/index.js | 2 +-
.../voiceRecording/voiceRecording.attributes.js | 2 +-
.../voiceRecording/voiceRecording.controller.js | 2 +-
server/api/voiceRecording/voiceRecording.model.js | 2 +-
server/api/voiceRecording/voiceRecording.rpc.js | 2 +-
server/api/voiceTransferReport/index.js | 2 +-
.../voiceTransferReport.attributes.js | 2 +-
.../voiceTransferReport.controller.js | 2 +-
.../voiceTransferReport.model.js | 2 +-
.../voiceTransferReport/voiceTransferReport.rpc.js | 2 +-
server/api/webbar/index.js | 2 +-
server/api/webbar/webbar.controller.js | 2 +-
server/api/whatsappAccount/index.js | 2 +-
.../whatsappAccount/whatsappAccount.attributes.js | 2 +-
.../whatsappAccount/whatsappAccount.controller.js | 2 +-
.../api/whatsappAccount/whatsappAccount.events.js | 2 +-
.../api/whatsappAccount/whatsappAccount.model.js | 2 +-
server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +-
.../api/whatsappAccount/whatsappAccount.socket.js | 2 +-
server/api/whatsappApplication/index.js | 2 +-
.../whatsappApplication.attributes.js | 2 +-
.../whatsappApplication.controller.js | 2 +-
.../whatsappApplication.model.js | 2 +-
.../whatsappApplication/whatsappApplication.rpc.js | 2 +-
server/api/whatsappInteraction/index.js | 2 +-
.../whatsappInteraction.attributes.js | 2 +-
.../whatsappInteraction.controller.js | 2 +-
.../whatsappInteraction.events.js | 2 +-
.../whatsappInteraction.model.js | 2 +-
.../whatsappInteraction/whatsappInteraction.rpc.js | 2 +-
.../whatsappInteraction.socket.js | 2 +-
server/api/whatsappMessage/index.js | 2 +-
.../whatsappMessage/whatsappMessage.attributes.js | 2 +-
.../whatsappMessage/whatsappMessage.controller.js | 2 +-
.../api/whatsappMessage/whatsappMessage.events.js | 2 +-
.../api/whatsappMessage/whatsappMessage.model.js | 2 +-
server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +-
.../api/whatsappMessage/whatsappMessage.socket.js | 2 +-
server/api/whatsappQueue/index.js | 2 +-
.../api/whatsappQueue/whatsappQueue.attributes.js | 2 +-
.../api/whatsappQueue/whatsappQueue.controller.js | 2 +-
server/api/whatsappQueue/whatsappQueue.events.js | 2 +-
server/api/whatsappQueue/whatsappQueue.model.js | 2 +-
server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +-
server/api/whatsappQueue/whatsappQueue.socket.js | 2 +-
server/api/whatsappQueueReport/index.js | 2 +-
.../whatsappQueueReport.attributes.js | 2 +-
.../whatsappQueueReport.controller.js | 2 +-
.../whatsappQueueReport.model.js | 2 +-
.../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +-
server/api/whatsappTransferReport/index.js | 2 +-
.../whatsappTransferReport.attributes.js | 2 +-
.../whatsappTransferReport.controller.js | 2 +-
.../whatsappTransferReport.model.js | 2 +-
.../whatsappTransferReport.rpc.js | 2 +-
server/app.js | 2 +-
server/components/auth/service.js | 2 +-
server/components/contacts/index.js | 2 +-
server/components/contacts/sql-utils.js | 2 +-
server/components/encryptor/index.js | 2 +-
server/components/export/csv.js | 2 +-
server/components/export/pdf.js | 2 +-
server/components/export/xlsx.js | 2 +-
server/components/extensions/rewrite.js | 2 +-
server/components/import/cm/csv.js | 2 +-
server/components/import/cm/csv2.js | 2 +-
server/components/import/cm/csvUpdates.js | 2 +-
server/components/integrations/configuration.js | 2 +-
server/components/interaction/service.js | 2 +-
server/components/interaction/sql-utils.js | 2 +-
.../components/interaction/update-interaction.js | 2 +-
server/components/interaction/utils.js | 2 +-
server/components/license/service.js | 2 +-
server/components/parsers/advancedSearch.js | 2 +-
server/components/parsers/qs.js | 2 +-
server/components/realtime/agents.js | 2 +-
server/components/realtime/queues.js | 2 +-
server/config/express.js | 2 +-
server/config/license/hardware.js | 2 +-
server/config/license/index.js | 2 +-
server/config/license/util.js | 2 +-
server/config/local.env.js | 2 +-
server/config/logger.js | 2 +-
server/config/pm2/config.js | 2 +-
server/config/pm2/index.js | 2 +-
server/config/schedule/chat.js | 2 +-
server/config/schedule/cloud-provider.js | 2 +-
server/config/schedule/index.js | 2 +-
server/config/schedule/transcribe.js | 2 +-
server/config/schedule/whatsapp.js | 2 +-
server/config/seedContact.js | 2 +-
server/config/seedUsers.js | 2 +-
server/config/socketio.js | 2 +-
server/config/triggers/index.js | 2 +-
server/config/utils.js | 2 +-
server/errors/api.js | 2 +-
server/errors/index.js | 2 +-
server/mysqldb/index.js | 2 +-
server/routes.js | 2 +-
server/rpc/index.js | 2 +-
server/services/agi/channel.js | 2 +-
server/services/agi/error.js | 2 +-
server/services/agi/events.js | 2 +-
server/services/agi/graph/index.js | 2 +-
server/services/agi/index.js | 2 +-
server/services/agi/mailRpc/index.js | 2 +-
server/services/agi/project.js | 2 +-
server/services/agi/reply.js | 2 +-
server/services/agi/rpc/index.js | 2 +-
server/services/agi/scripts/aws/index.js | 2 +-
server/services/agi/scripts/aws/lex/index.js | 2 +-
server/services/agi/scripts/aws/lex/lib/api.js | 2 +-
server/services/agi/scripts/aws/polly/index.js | 2 +-
server/services/agi/scripts/aws/polly/lib/api.js | 2 +-
server/services/agi/scripts/google/asr/index.js | 2 +-
server/services/agi/scripts/google/asr/lib/api.js | 2 +-
server/services/agi/scripts/google/index.js | 2 +-
server/services/agi/scripts/index.js | 2 +-
server/services/agi/scripts/sestek/index.js | 2 +-
server/services/agi/scripts/sestek/nda/index.js | 2 +-
server/services/agi/scripts/tilde/asr/index.js | 2 +-
server/services/agi/scripts/tilde/asr/lib/api.js | 2 +-
server/services/agi/scripts/tilde/index.js | 2 +-
server/services/agi/server.js | 2 +-
server/services/agi/vertices.js | 2 +-
server/services/ami/acw/index.js | 2 +-
server/services/ami/ami.js | 2 +-
server/services/ami/client.js | 2 +-
server/services/ami/dialer/index.js | 2 +-
server/services/ami/dialer/models/action.js | 2 +-
server/services/ami/dialer/models/agentComplete.js | 2 +-
server/services/ami/dialer/models/final.js | 2 +-
server/services/ami/dialer/models/hangup.js | 2 +-
server/services/ami/dialer/models/history.js | 2 +-
.../ami/dialer/models/queueCallerAbandon.js | 2 +-
server/services/ami/dialer/utils/hopper.js | 2 +-
server/services/ami/dialer/utils/index.js | 2 +-
server/services/ami/fax/action.js | 2 +-
server/services/ami/fax/index.js | 2 +-
server/services/ami/fax/rpcDb.js | 2 +-
server/services/ami/fax/util/gs.js | 2 +-
server/services/ami/fax/util/util.js | 2 +-
server/services/ami/index.js | 2 +-
server/services/ami/model/agent.js | 2 +-
server/services/ami/model/campaign.js | 2 +-
server/services/ami/model/channel.js | 2 +-
server/services/ami/model/deskAccount.js | 2 +-
server/services/ami/model/dynamics365Account.js | 2 +-
server/services/ami/model/faxAccount.js | 2 +-
server/services/ami/model/freshdeskAccount.js | 2 +-
server/services/ami/model/freshsalesAccount.js | 2 +-
server/services/ami/model/queueReport.js | 2 +-
server/services/ami/model/salesforceAccount.js | 2 +-
server/services/ami/model/servicenowAccount.js | 2 +-
server/services/ami/model/sugarcrmAccount.js | 2 +-
server/services/ami/model/telephone.js | 2 +-
server/services/ami/model/template.js | 2 +-
server/services/ami/model/trigger.js | 2 +-
server/services/ami/model/trunk.js | 2 +-
server/services/ami/model/voiceExtension.js | 2 +-
server/services/ami/model/voiceQueue.js | 2 +-
server/services/ami/model/voiceQueueSummary.js | 2 +-
server/services/ami/model/vtigerAccount.js | 2 +-
server/services/ami/model/zendeskAccount.js | 2 +-
server/services/ami/model/zohoAccount.js | 2 +-
server/services/ami/preview/action.js | 2 +-
server/services/ami/preview/index.js | 2 +-
server/services/ami/preview/rpcDb.js | 2 +-
server/services/ami/preview/util/util.js | 2 +-
server/services/ami/properties.js | 2 +-
server/services/ami/realtime/index.js | 2 +-
server/services/ami/realtime/utils.js | 2 +-
server/services/ami/report/index.js | 2 +-
server/services/ami/report/userReport.js | 2 +-
server/services/ami/report/voiceAgentReport.js | 2 +-
server/services/ami/report/voiceCallReport.js | 2 +-
server/services/ami/report/voiceDialReport.js | 2 +-
server/services/ami/report/voiceQueueReport.js | 2 +-
server/services/ami/rpc/agentReportPreview.js | 2 +-
server/services/ami/rpc/attachment.js | 2 +-
server/services/ami/rpc/campaign.js | 2 +-
server/services/ami/rpc/cmContact.js | 2 +-
server/services/ami/rpc/cmHopper.js | 2 +-
server/services/ami/rpc/cmHopperAdditionalPhone.js | 2 +-
server/services/ami/rpc/cmHopperBlack.js | 2 +-
server/services/ami/rpc/cmHopperFinal.js | 2 +-
server/services/ami/rpc/cmHopperHistory.js | 2 +-
server/services/ami/rpc/faxAccount.js | 2 +-
server/services/ami/rpc/faxMessage.js | 2 +-
server/services/ami/rpc/integrations/desk.js | 2 +-
.../services/ami/rpc/integrations/dynamics365.js | 2 +-
server/services/ami/rpc/integrations/freshdesk.js | 2 +-
server/services/ami/rpc/integrations/freshsales.js | 2 +-
server/services/ami/rpc/integrations/salesforce.js | 2 +-
server/services/ami/rpc/integrations/servicenow.js | 2 +-
server/services/ami/rpc/integrations/sugarcrm.js | 2 +-
server/services/ami/rpc/integrations/vtiger.js | 2 +-
server/services/ami/rpc/integrations/zendesk.js | 2 +-
server/services/ami/rpc/integrations/zoho.js | 2 +-
server/services/ami/rpc/interval.js | 2 +-
server/services/ami/rpc/memberReport.js | 2 +-
server/services/ami/rpc/setting.js | 2 +-
server/services/ami/rpc/template.js | 2 +-
server/services/ami/rpc/trigger.js | 2 +-
server/services/ami/rpc/trunk.js | 2 +-
server/services/ami/rpc/user.js | 2 +-
server/services/ami/rpc/voiceAgentReport.js | 2 +-
server/services/ami/rpc/voiceCallReport.js | 2 +-
server/services/ami/rpc/voiceDialReport.js | 2 +-
server/services/ami/rpc/voiceExtension.js | 2 +-
server/services/ami/rpc/voiceQueue.js | 2 +-
server/services/ami/rpc/voiceQueueReport.js | 2 +-
server/services/ami/rpc/voiceQueueRt.js | 2 +-
server/services/ami/rpc/voiceRecording.js | 2 +-
server/services/ami/rpc/voiceTransferReport.js | 2 +-
server/services/ami/server/index.js | 2 +-
server/services/ami/trigger/cmContact/index.js | 2 +-
server/services/ami/trigger/index.js | 2 +-
server/services/ami/trigger/integration/desk.js | 2 +-
.../ami/trigger/integration/dynamics365.js | 2 +-
.../services/ami/trigger/integration/freshdesk.js | 2 +-
.../services/ami/trigger/integration/freshsales.js | 2 +-
server/services/ami/trigger/integration/index.js | 2 +-
.../services/ami/trigger/integration/salesforce.js | 2 +-
.../services/ami/trigger/integration/servicenow.js | 2 +-
.../services/ami/trigger/integration/sugarcrm.js | 2 +-
server/services/ami/trigger/integration/util.js | 2 +-
server/services/ami/trigger/integration/vtiger.js | 2 +-
server/services/ami/trigger/integration/zendesk.js | 2 +-
server/services/ami/trigger/integration/zoho.js | 2 +-
server/services/ami/trigger/script/index.js | 2 +-
server/services/ami/trigger/urlforward/index.js | 2 +-
server/services/email/client.js | 2 +-
server/services/email/index.js | 2 +-
server/services/email/lib/email.js | 2 +-
server/services/email/lib/imap.js | 2 +-
server/services/email/lib/smtp.js | 2 +-
server/services/email/lib/utils.js | 2 +-
server/services/email/model/mailAccount.js | 2 +-
server/services/email/realtime/index.js | 2 +-
server/services/email/rpc/mailAccount.js | 2 +-
server/services/email/rpc/setting.js | 2 +-
server/services/email/server/index.js | 2 +-
server/services/express/index.js | 2 +-
server/services/routing/client.js | 2 +-
server/services/routing/index.js | 2 +-
server/services/routing/lib/rule-engine.js | 2 +-
server/services/routing/mailRpc/index.js | 2 +-
server/services/routing/model/agent.js | 2 +-
server/services/routing/model/chatQueue.js | 2 +-
server/services/routing/model/faxQueue.js | 2 +-
server/services/routing/model/interval.js | 2 +-
server/services/routing/model/mailQueue.js | 2 +-
server/services/routing/model/openchannelQueue.js | 2 +-
server/services/routing/model/smsQueue.js | 2 +-
server/services/routing/model/whatsappQueue.js | 2 +-
server/services/routing/realtime/index.js | 2 +-
server/services/routing/rpc/chatInteraction.js | 2 +-
server/services/routing/rpc/chatMessage.js | 2 +-
server/services/routing/rpc/chatQueue.js | 2 +-
server/services/routing/rpc/chatQueueReport.js | 2 +-
server/services/routing/rpc/faxInteraction.js | 2 +-
server/services/routing/rpc/faxMessage.js | 2 +-
server/services/routing/rpc/faxQueue.js | 2 +-
server/services/routing/rpc/faxQueueReport.js | 2 +-
server/services/routing/rpc/interval.js | 2 +-
server/services/routing/rpc/mailInteraction.js | 2 +-
server/services/routing/rpc/mailMessage.js | 2 +-
server/services/routing/rpc/mailQueue.js | 2 +-
server/services/routing/rpc/mailQueueReport.js | 2 +-
.../services/routing/rpc/openchannelInteraction.js | 2 +-
server/services/routing/rpc/openchannelMessage.js | 2 +-
server/services/routing/rpc/openchannelQueue.js | 2 +-
.../services/routing/rpc/openchannelQueueReport.js | 2 +-
server/services/routing/rpc/smsInteraction.js | 2 +-
server/services/routing/rpc/smsMessage.js | 2 +-
server/services/routing/rpc/smsQueue.js | 2 +-
server/services/routing/rpc/smsQueueReport.js | 2 +-
server/services/routing/rpc/user.js | 2 +-
server/services/routing/rpc/whatsappInteraction.js | 2 +-
server/services/routing/rpc/whatsappMessage.js | 2 +-
server/services/routing/rpc/whatsappQueue.js | 2 +-
server/services/routing/rpc/whatsappQueueReport.js | 2 +-
.../services/routing/server/applications/agent.js | 2 +-
.../routing/server/applications/amazonlex.js | 2 +-
.../routing/server/applications/autoreply.js | 2 +-
.../services/routing/server/applications/close.js | 2 +-
.../routing/server/applications/dialogflow.js | 2 +-
.../routing/server/applications/dialogflowV2.js | 2 +-
.../services/routing/server/applications/gotoif.js | 2 +-
.../services/routing/server/applications/gotop.js | 2 +-
.../routing/server/applications/message.js | 2 +-
.../services/routing/server/applications/noop.js | 2 +-
.../services/routing/server/applications/queue.js | 2 +-
.../routing/server/applications/strategy/agent.js | 2 +-
.../server/applications/strategy/beepall.js | 2 +-
.../routing/server/applications/strategy/index.js | 2 +-
.../server/applications/strategy/rrmemory.js | 2 +-
.../routing/server/applications/strategy/util.js | 2 +-
.../services/routing/server/applications/system.js | 2 +-
server/services/routing/server/applications/tag.js | 2 +-
.../services/routing/server/applications/tvox.js | 2 +-
.../services/routing/server/applications/utils.js | 2 +-
server/services/routing/server/index.js | 2 +-
server/services/routing/server/interval.js | 2 +-
server/services/xdr/agents.controller.js | 2 +-
server/services/xdr/calls.controller.js | 2 +-
server/services/xdr/core.controller.js | 2 +-
server/services/xdr/dials.controller.js | 2 +-
server/services/xdr/index.js | 2 +-
server/services/xdr/members.controller.js | 2 +-
server/services/xdr/queues.controller.js | 2 +-
server/services/xdr/recordings.controller.js | 2 +-
server/services/xdr/transfers.controller.js | 2 +-
server/services/xdr/utils.js | 2 +-
server/utils/client-side-logger.js | 2 +-
server/utils/iftime.js | 2 +-
server/utils/loggers.js | 2 +-
server/utils/mask-sensitive-data.js | 2 +-
server/utils/safe-template.js | 2 +-
server/utils/update-app-config.js | 2 +-
1203 files changed, 1203 insertions(+), 1203 deletions(-)
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index f7d16de..b78ecc1 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-12-05T16:11:31.266Z",
+ "time": "2022-12-06T07:45:43.590Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 01a99c2..e023275 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-12-05T16:11:31.266Z",
+ "time": "2022-12-06T07:45:43.590Z",
"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 5895a46..6c7715e 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 _0xeb76=['bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','sequelize','exports','VIRTUAL','action','STRING','contactManager','integration','motionbar','jscripty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeb76,0x171));var _0x6eb7=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0xeb76[_0x3826ad];return _0x17b900;};'use strict';var Sequelize=require(_0x6eb7('0x0'));module[_0x6eb7('0x1')]={'name':{'type':Sequelize[_0x6eb7('0x2')],'get':function(_0x1e5c45){return this['getDataValue'](_0x6eb7('0x3'));}},'action':{'type':Sequelize[_0x6eb7('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x6eb7('0x5'),_0x6eb7('0x6'),_0x6eb7('0x7'),_0x6eb7('0x8'),'urlForward','browser',_0x6eb7('0x9'),_0x6eb7('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x6eb7('0xb')},'data1':{'type':Sequelize[_0x6eb7('0x4')](0x1000),'comment':_0x6eb7('0xc')},'data2':{'type':Sequelize[_0x6eb7('0x4')](0x1000),'comment':_0x6eb7('0xd')},'data3':{'type':Sequelize[_0x6eb7('0x4')](0x1000),'comment':_0x6eb7('0xe')},'data4':{'type':Sequelize[_0x6eb7('0x4')](0x1000),'comments':_0x6eb7('0xf')},'data5':{'type':Sequelize[_0x6eb7('0x4')](0x1000),'comments':_0x6eb7('0x10')},'data6':{'type':Sequelize[_0x6eb7('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x6eb7('0x11')],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0xc57c=['jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','getDataValue','contactManager','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING'];(function(_0x40995b,_0x29964d){var _0x537b3d=function(_0x33b7be){while(--_0x33b7be){_0x40995b['push'](_0x40995b['shift']());}};_0x537b3d(++_0x29964d);}(_0xc57c,0x149));var _0xcc57=function(_0x3dbe53,_0x57d1de){_0x3dbe53=_0x3dbe53-0x0;var _0x2c6d34=_0xc57c[_0x3dbe53];return _0x2c6d34;};'use strict';var Sequelize=require(_0xcc57('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x597b64){return this[_0xcc57('0x1')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xcc57('0x2'),'integration',_0xcc57('0x3'),_0xcc57('0x4'),_0xcc57('0x5'),_0xcc57('0x6'),_0xcc57('0x7'),_0xcc57('0x8')]],'msg':_0xcc57('0x9')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0xcc57('0xa')](0x1000),'comment':_0xcc57('0xb')},'data2':{'type':Sequelize[_0xcc57('0xa')](0x1000),'comment':_0xcc57('0xc')},'data3':{'type':Sequelize[_0xcc57('0xa')](0x1000),'comment':_0xcc57('0xd')},'data4':{'type':Sequelize[_0xcc57('0xa')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0xcc57('0xa')],'comments':_0xcc57('0xe')},'data7':{'type':Sequelize[_0xcc57('0xf')],'comments':_0xcc57('0x10')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 908b70e..96c3e40 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 _0x4b30=['jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','destroy','then','error','stack','name','send','update','body','find','params','catch','Action','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x543769,_0x8da6aa){var _0x1be8be=function(_0x5eed72){while(--_0x5eed72){_0x543769['push'](_0x543769['shift']());}};_0x1be8be(++_0x8da6aa);}(_0x4b30,0x102));var _0x04b3=function(_0x123e6f,_0x3a0ccb){_0x123e6f=_0x123e6f-0x0;var _0x2e0627=_0x4b30[_0x123e6f];return _0x2e0627;};'use strict';var emlformat=require(_0x04b3('0x0'));var rimraf=require(_0x04b3('0x1'));var zipdir=require(_0x04b3('0x2'));var jsonpatch=require(_0x04b3('0x3'));var rp=require('request-promise');var moment=require(_0x04b3('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x04b3('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x04b3('0x6'));var ejs=require(_0x04b3('0x7'));var fs=require('fs');var fs_extra=require(_0x04b3('0x8'));var _=require(_0x04b3('0x9'));var squel=require(_0x04b3('0xa'));var crypto=require(_0x04b3('0xb'));var jsforce=require(_0x04b3('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x04b3('0x6'));var querystring=require('querystring');var Papa=require(_0x04b3('0xd'));var Redis=require(_0x04b3('0xe'));var authService=require(_0x04b3('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x04b3('0x10'));var hardwareService=require(_0x04b3('0x11'));var logger=require('../../config/logger')(_0x04b3('0x12'));var utils=require(_0x04b3('0x13'));var config=require(_0x04b3('0x14'));var licenseUtil=require(_0x04b3('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1eb8aa,_0x4d217e){_0x4d217e=_0x4d217e||0xcc;return function(_0x25d199){if(_0x25d199){return _0x1eb8aa[_0x04b3('0x16')](_0x4d217e);}return _0x1eb8aa[_0x04b3('0x17')](_0x4d217e)[_0x04b3('0x18')]();};}function respondWithResult(_0x3f2f62,_0x891a2e){_0x891a2e=_0x891a2e||0xc8;return function(_0x386095){if(_0x386095){return _0x3f2f62[_0x04b3('0x17')](_0x891a2e)[_0x04b3('0x19')](_0x386095);}};}function respondWithFilteredResult(_0xe75106,_0x4c2c67){return function(_0x3b716b){if(_0x3b716b){var _0x459909=typeof _0x4c2c67[_0x04b3('0x1a')]===_0x04b3('0x1b')&&typeof _0x4c2c67['limit']===_0x04b3('0x1b');var _0xaa02e2=_0x3b716b[_0x04b3('0x1c')];var _0x2e8fca=_0x459909?0x0:_0x4c2c67['offset'];var _0x494b89=_0x459909?_0x3b716b[_0x04b3('0x1c')]:_0x4c2c67['offset']+_0x4c2c67[_0x04b3('0x1d')];var _0x111cd9;if(_0x494b89>=_0xaa02e2){_0x494b89=_0xaa02e2;_0x111cd9=0xc8;}else{_0x111cd9=0xce;}_0xe75106[_0x04b3('0x17')](_0x111cd9);return _0xe75106[_0x04b3('0x1e')](_0x04b3('0x1f'),_0x2e8fca+'-'+_0x494b89+'/'+_0xaa02e2)[_0x04b3('0x19')](_0x3b716b);}return null;};}function patchUpdates(_0x226189){return function(_0x136fa2){try{jsonpatch[_0x04b3('0x20')](_0x136fa2,_0x226189,!![]);}catch(_0x37d451){return BPromise['reject'](_0x37d451);}return _0x136fa2['save']();};}function saveUpdates(_0x45f1fc,_0xa6d0c1){return function(_0xea1273){if(_0xea1273){return _0xea1273['update'](_0x45f1fc)['then'](function(_0x3799c4){return _0x3799c4;});}return null;};}function removeEntity(_0x199f33,_0x2e4613){return function(_0x32d30d){if(_0x32d30d){return _0x32d30d[_0x04b3('0x21')]()[_0x04b3('0x22')](function(){_0x199f33[_0x04b3('0x17')](0xcc)[_0x04b3('0x18')]();});}};}function handleEntityNotFound(_0x5be1e6,_0x2a33fd){return function(_0x267a62){if(!_0x267a62){_0x5be1e6['sendStatus'](0x194);}return _0x267a62;};}function handleError(_0xdeaef2,_0x2b72d6){_0x2b72d6=_0x2b72d6||0x1f4;return function(_0x19edf6){logger[_0x04b3('0x23')](_0x19edf6[_0x04b3('0x24')]);if(_0x19edf6[_0x04b3('0x25')]){delete _0x19edf6[_0x04b3('0x25')];}_0xdeaef2[_0x04b3('0x17')](_0x2b72d6)[_0x04b3('0x26')](_0x19edf6);};}exports[_0x04b3('0x27')]=function(_0x1f286a,_0x470905){if(_0x1f286a[_0x04b3('0x28')]['id']){delete _0x1f286a[_0x04b3('0x28')]['id'];}return db['Action'][_0x04b3('0x29')]({'where':{'id':_0x1f286a[_0x04b3('0x2a')]['id']}})['then'](handleEntityNotFound(_0x470905,null))[_0x04b3('0x22')](saveUpdates(_0x1f286a['body'],null))[_0x04b3('0x22')](respondWithResult(_0x470905,null))[_0x04b3('0x2b')](handleError(_0x470905,null));};exports[_0x04b3('0x21')]=function(_0x396f8e,_0x529036){return db[_0x04b3('0x2c')][_0x04b3('0x29')]({'where':{'id':_0x396f8e[_0x04b3('0x2a')]['id']}})[_0x04b3('0x22')](handleEntityNotFound(_0x529036,null))['then'](removeEntity(_0x529036,null))[_0x04b3('0x2b')](handleError(_0x529036,null));};
\ No newline at end of file
+var _0x652c=['squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','Content-Range','reject','save','then','destroy','error','stack','name','send','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash'];(function(_0x55e099,_0x9fa64a){var _0x551a58=function(_0x2e2fe9){while(--_0x2e2fe9){_0x55e099['push'](_0x55e099['shift']());}};_0x551a58(++_0x9fa64a);}(_0x652c,0x15c));var _0xc652=function(_0x51a238,_0x3f451e){_0x51a238=_0x51a238-0x0;var _0xb427bf=_0x652c[_0x51a238];return _0xb427bf;};'use strict';var emlformat=require(_0xc652('0x0'));var rimraf=require(_0xc652('0x1'));var zipdir=require(_0xc652('0x2'));var jsonpatch=require(_0xc652('0x3'));var rp=require(_0xc652('0x4'));var moment=require(_0xc652('0x5'));var BPromise=require(_0xc652('0x6'));var Mustache=require(_0xc652('0x7'));var util=require('util');var path=require(_0xc652('0x8'));var sox=require(_0xc652('0x9'));var csv=require(_0xc652('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc652('0xb'));var squel=require(_0xc652('0xc'));var crypto=require('crypto');var jsforce=require(_0xc652('0xd'));var deskjs=require(_0xc652('0xe'));var toCsv=require(_0xc652('0xa'));var querystring=require('querystring');var Papa=require(_0xc652('0xf'));var Redis=require('ioredis');var authService=require(_0xc652('0x10'));var qs=require(_0xc652('0x11'));var as=require(_0xc652('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc652('0x13'))(_0xc652('0x14'));var utils=require('../../config/utils');var config=require(_0xc652('0x15'));var licenseUtil=require(_0xc652('0x16'));var db=require(_0xc652('0x17'))['db'];function respondWithStatusCode(_0x25accb,_0x48959f){_0x48959f=_0x48959f||0xcc;return function(_0x5726d5){if(_0x5726d5){return _0x25accb[_0xc652('0x18')](_0x48959f);}return _0x25accb[_0xc652('0x19')](_0x48959f)[_0xc652('0x1a')]();};}function respondWithResult(_0xea6aac,_0x1d562b){_0x1d562b=_0x1d562b||0xc8;return function(_0x5ae05d){if(_0x5ae05d){return _0xea6aac['status'](_0x1d562b)[_0xc652('0x1b')](_0x5ae05d);}};}function respondWithFilteredResult(_0x1d8c95,_0x1be3d2){return function(_0x211d20){if(_0x211d20){var _0x192233=typeof _0x1be3d2['offset']===_0xc652('0x1c')&&typeof _0x1be3d2['limit']===_0xc652('0x1c');var _0x560a18=_0x211d20['count'];var _0x95a8a5=_0x192233?0x0:_0x1be3d2['offset'];var _0x4ae5e2=_0x192233?_0x211d20[_0xc652('0x1d')]:_0x1be3d2[_0xc652('0x1e')]+_0x1be3d2['limit'];var _0x256244;if(_0x4ae5e2>=_0x560a18){_0x4ae5e2=_0x560a18;_0x256244=0xc8;}else{_0x256244=0xce;}_0x1d8c95[_0xc652('0x19')](_0x256244);return _0x1d8c95['set'](_0xc652('0x1f'),_0x95a8a5+'-'+_0x4ae5e2+'/'+_0x560a18)[_0xc652('0x1b')](_0x211d20);}return null;};}function patchUpdates(_0x3c7547){return function(_0x51a9ca){try{jsonpatch['apply'](_0x51a9ca,_0x3c7547,!![]);}catch(_0x32c558){return BPromise[_0xc652('0x20')](_0x32c558);}return _0x51a9ca[_0xc652('0x21')]();};}function saveUpdates(_0x125101,_0x5a829e){return function(_0x391d0b){if(_0x391d0b){return _0x391d0b['update'](_0x125101)[_0xc652('0x22')](function(_0x4548bc){return _0x4548bc;});}return null;};}function removeEntity(_0x3737d6,_0x3d0c6d){return function(_0x32c90e){if(_0x32c90e){return _0x32c90e[_0xc652('0x23')]()[_0xc652('0x22')](function(){_0x3737d6[_0xc652('0x19')](0xcc)[_0xc652('0x1a')]();});}};}function handleEntityNotFound(_0x36812c,_0x310628){return function(_0x2e2ffe){if(!_0x2e2ffe){_0x36812c[_0xc652('0x18')](0x194);}return _0x2e2ffe;};}function handleError(_0x42ae24,_0x2185d7){_0x2185d7=_0x2185d7||0x1f4;return function(_0x3f815b){logger[_0xc652('0x24')](_0x3f815b[_0xc652('0x25')]);if(_0x3f815b[_0xc652('0x26')]){delete _0x3f815b[_0xc652('0x26')];}_0x42ae24[_0xc652('0x19')](_0x2185d7)[_0xc652('0x27')](_0x3f815b);};}exports['update']=function(_0x2c8b86,_0x51ef17){if(_0x2c8b86[_0xc652('0x28')]['id']){delete _0x2c8b86[_0xc652('0x28')]['id'];}return db[_0xc652('0x29')][_0xc652('0x2a')]({'where':{'id':_0x2c8b86[_0xc652('0x2b')]['id']}})[_0xc652('0x22')](handleEntityNotFound(_0x51ef17,null))[_0xc652('0x22')](saveUpdates(_0x2c8b86[_0xc652('0x28')],null))[_0xc652('0x22')](respondWithResult(_0x51ef17,null))[_0xc652('0x2c')](handleError(_0x51ef17,null));};exports[_0xc652('0x23')]=function(_0x19d445,_0x576126){return db[_0xc652('0x29')]['find']({'where':{'id':_0x19d445['params']['id']}})[_0xc652('0x22')](handleEntityNotFound(_0x576126,null))['then'](removeEntity(_0x576126,null))[_0xc652('0x2c')](handleError(_0x576126,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index fcf4ce9..0cb8071 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 _0xe205=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./action.attributes','exports','define'];(function(_0x363562,_0x416a2c){var _0x56d17b=function(_0x3ffcdb){while(--_0x3ffcdb){_0x363562['push'](_0x363562['shift']());}};_0x56d17b(++_0x416a2c);}(_0xe205,0x1ec));var _0x5e20=function(_0x26277b,_0x3b474d){_0x26277b=_0x26277b-0x0;var _0x4f2fc3=_0xe205[_0x26277b];return _0x4f2fc3;};'use strict';var _=require(_0x5e20('0x0'));var util=require(_0x5e20('0x1'));var logger=require(_0x5e20('0x2'))(_0x5e20('0x3'));var moment=require(_0x5e20('0x4'));var BPromise=require(_0x5e20('0x5'));var rp=require(_0x5e20('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5e20('0x7'));var config=require(_0x5e20('0x8'));var attributes=require(_0x5e20('0x9'));module[_0x5e20('0xa')]=function(_0x4554b5,_0x2e68e6){return _0x4554b5[_0x5e20('0xb')]('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x29b1=['rimraf','../../config/environment','./action.attributes','exports','Action','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x3291c0,_0x147635){var _0x559165=function(_0x11624f){while(--_0x11624f){_0x3291c0['push'](_0x3291c0['shift']());}};_0x559165(++_0x147635);}(_0x29b1,0x16d));var _0x129b=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x29b1[_0xac151d];return _0x111dba;};'use strict';var _=require(_0x129b('0x0'));var util=require(_0x129b('0x1'));var logger=require(_0x129b('0x2'))(_0x129b('0x3'));var moment=require(_0x129b('0x4'));var BPromise=require('bluebird');var rp=require(_0x129b('0x5'));var fs=require('fs');var path=require(_0x129b('0x6'));var rimraf=require(_0x129b('0x7'));var config=require(_0x129b('0x8'));var attributes=require(_0x129b('0x9'));module[_0x129b('0xa')]=function(_0x31e428,_0xe27ed4){return _0x31e428['define'](_0x129b('0xb'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index d8db7a4..9c844e8 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x53ec,0x192));var _0xc53e=function(_0x44ab9d,_0x3d060c){_0x44ab9d=_0x44ab9d-0x0;var _0x279648=_0x53ec[_0x44ab9d];return _0x279648;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});}
\ No newline at end of file
+var _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x5827aa,_0xa68f2a){var _0xd8dfc4=function(_0x32bcf2){while(--_0x32bcf2){_0x5827aa['push'](_0x5827aa['shift']());}};_0xd8dfc4(++_0xa68f2a);}(_0x1261,0x144));var _0x1126=function(_0x2a67fe,_0x295c09){_0x2a67fe=_0x2a67fe-0x0;var _0x57e726=_0x1261[_0x2a67fe];return _0x57e726;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 8031971..ff4c278 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 _0x133a=['destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','/:id','isAuthenticated','update'];(function(_0x46d441,_0x392c98){var _0x419105=function(_0x5b95c4){while(--_0x5b95c4){_0x46d441['push'](_0x46d441['shift']());}};_0x419105(++_0x392c98);}(_0x133a,0x1e3));var _0xa133=function(_0x548657,_0x479937){_0x548657=_0x548657-0x0;var _0x8e3ae5=_0x133a[_0x548657];return _0x8e3ae5;};'use strict';var multer=require(_0xa133('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa133('0x1'));var express=require(_0xa133('0x2'));var router=express[_0xa133('0x3')]();var fs_extra=require(_0xa133('0x4'));var auth=require(_0xa133('0x5'));var interaction=require(_0xa133('0x6'));var config=require('../../config/environment');var controller=require(_0xa133('0x7'));router['put'](_0xa133('0x8'),auth[_0xa133('0x9')](),controller[_0xa133('0xa')]);router['delete'](_0xa133('0x8'),auth[_0xa133('0x9')](),controller[_0xa133('0xb')]);module[_0xa133('0xc')]=router;
\ No newline at end of file
+var _0x7d8e=['exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','update','delete','destroy'];(function(_0x2f870e,_0x5af455){var _0x39fef1=function(_0x27b3b6){while(--_0x27b3b6){_0x2f870e['push'](_0x2f870e['shift']());}};_0x39fef1(++_0x5af455);}(_0x7d8e,0x79));var _0xe7d8=function(_0x347471,_0x1c9a02){_0x347471=_0x347471-0x0;var _0x422b6a=_0x7d8e[_0x347471];return _0x422b6a;};'use strict';var multer=require('multer');var util=require(_0xe7d8('0x0'));var path=require('path');var timeout=require(_0xe7d8('0x1'));var express=require('express');var router=express[_0xe7d8('0x2')]();var fs_extra=require(_0xe7d8('0x3'));var auth=require(_0xe7d8('0x4'));var interaction=require(_0xe7d8('0x5'));var config=require(_0xe7d8('0x6'));var controller=require('./action.controller');router['put'](_0xe7d8('0x7'),auth['isAuthenticated'](),controller[_0xe7d8('0x8')]);router[_0xe7d8('0x9')](_0xe7d8('0x7'),auth['isAuthenticated'](),controller[_0xe7d8('0xa')]);module[_0xe7d8('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 8b87c19..c7498c2 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 _0x5fab=['exports','STRING','TEXT','sequelize'];(function(_0x44d28c,_0x3a197b){var _0x754673=function(_0x5a5773){while(--_0x5a5773){_0x44d28c['push'](_0x44d28c['shift']());}};_0x754673(++_0x3a197b);}(_0x5fab,0x177));var _0xb5fa=function(_0x587dd0,_0x273922){_0x587dd0=_0x587dd0-0x0;var _0x56f153=_0x5fab[_0x587dd0];return _0x56f153;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb5fa('0x2')]},'parent':{'type':Sequelize[_0xb5fa('0x2')]},'table':{'type':Sequelize[_0xb5fa('0x2')]},'conditions':{'type':Sequelize[_0xb5fa('0x3')]},'joins':{'type':Sequelize[_0xb5fa('0x3')]}};
\ No newline at end of file
+var _0x3eea=['STRING','TEXT','sequelize'];(function(_0x32e002,_0x2f8a42){var _0x3c03f9=function(_0x192dd3){while(--_0x192dd3){_0x32e002['push'](_0x32e002['shift']());}};_0x3c03f9(++_0x2f8a42);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x26e622,_0x132c7c){_0x26e622=_0x26e622-0x0;var _0x2c00c7=_0x3eea[_0x26e622];return _0x2c00c7;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3ee('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa3ee('0x1')]},'parent':{'type':Sequelize[_0xa3ee('0x1')]},'table':{'type':Sequelize[_0xa3ee('0x1')]},'conditions':{'type':Sequelize[_0xa3ee('0x2')]},'joins':{'type':Sequelize[_0xa3ee('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index b30a01d..dd6c434 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 _0x009e=['type','key','query','filters','intersection','model','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticCustomReport','count','includeAll','include','findAll','rows','catch','show','keys','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Reports','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','table','MetricId','metric','field','function','replace','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20EMPTY','keyBy','from','groupBy','clone','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','../../components/export/','select','countTable','COUNT(*)','run','HOUR(%s)','operator','%s.%s\x20=\x20%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','get','CustomReports','UserProfileResource','then','stack','name','send','index','map','rawAttributes','fieldName'];(function(_0x1524a4,_0x33f93e){var _0x388207=function(_0x4d2db6){while(--_0x4d2db6){_0x1524a4['push'](_0x1524a4['shift']());}};_0x388207(++_0x33f93e);}(_0x009e,0x11c));var _0xe009=function(_0x4663f7,_0x41b7b8){_0x4663f7=_0x4663f7-0x0;var _0x5f450b=_0x009e[_0x4663f7];return _0x5f450b;};'use strict';var emlformat=require(_0xe009('0x0'));var rimraf=require(_0xe009('0x1'));var zipdir=require(_0xe009('0x2'));var jsonpatch=require(_0xe009('0x3'));var rp=require(_0xe009('0x4'));var moment=require('moment');var BPromise=require(_0xe009('0x5'));var Mustache=require('mustache');var util=require(_0xe009('0x6'));var path=require('path');var sox=require(_0xe009('0x7'));var csv=require(_0xe009('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe009('0x9'));var _=require('lodash');var squel=require(_0xe009('0xa'));var crypto=require(_0xe009('0xb'));var jsforce=require(_0xe009('0xc'));var deskjs=require(_0xe009('0xd'));var toCsv=require(_0xe009('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe009('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe009('0xf'));var as=require(_0xe009('0x10'));var hardwareService=require(_0xe009('0x11'));var logger=require(_0xe009('0x12'))(_0xe009('0x13'));var utils=require(_0xe009('0x14'));var config=require(_0xe009('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe009('0x16'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x3c6791,_0x2f411a){_0x2f411a=_0x2f411a||0xcc;return function(_0x3fb2a8){if(_0x3fb2a8){return _0x3c6791[_0xe009('0x17')](_0x2f411a);}return _0x3c6791[_0xe009('0x18')](_0x2f411a)[_0xe009('0x19')]();};}function respondWithResult(_0x198d15,_0x3737d6){_0x3737d6=_0x3737d6||0xc8;return function(_0x1ffa85){if(_0x1ffa85){return _0x198d15[_0xe009('0x18')](_0x3737d6)[_0xe009('0x1a')](_0x1ffa85);}};}function respondWithFilteredResult(_0x22e5ad,_0xfdbbe8){return function(_0x4494c3){if(_0x4494c3){var _0xa007b9=typeof _0xfdbbe8[_0xe009('0x1b')]===_0xe009('0x1c')&&typeof _0xfdbbe8[_0xe009('0x1d')]===_0xe009('0x1c');var _0x4eefa4=_0x4494c3['count'];var _0x570741=_0xa007b9?0x0:_0xfdbbe8[_0xe009('0x1b')];var _0x1611e2=_0xa007b9?_0x4494c3['count']:_0xfdbbe8['offset']+_0xfdbbe8[_0xe009('0x1d')];var _0xd0ed82;if(_0x1611e2>=_0x4eefa4){_0x1611e2=_0x4eefa4;_0xd0ed82=0xc8;}else{_0xd0ed82=0xce;}_0x22e5ad[_0xe009('0x18')](_0xd0ed82);return _0x22e5ad[_0xe009('0x1e')](_0xe009('0x1f'),_0x570741+'-'+_0x1611e2+'/'+_0x4eefa4)[_0xe009('0x1a')](_0x4494c3);}return null;};}function patchUpdates(_0x19686c){return function(_0x2aec0c){try{jsonpatch[_0xe009('0x20')](_0x2aec0c,_0x19686c,!![]);}catch(_0x5c8653){return BPromise['reject'](_0x5c8653);}return _0x2aec0c[_0xe009('0x21')]();};}function saveUpdates(_0x2b4120,_0x53dab6){return function(_0x26ba88){if(_0x26ba88){return _0x26ba88[_0xe009('0x22')](_0x2b4120)['then'](function(_0x80156c){return _0x80156c;});}return null;};}function removeEntity(_0x37a881,_0x14eef6){return function(_0x475d92){if(_0x475d92){return _0x475d92['destroy']()['then'](function(){var _0x417dac=_0x475d92[_0xe009('0x23')]({'plain':!![]});var _0x517f72=_0xe009('0x24');return db[_0xe009('0x25')]['destroy']({'where':{'type':_0x517f72,'resourceId':_0x417dac['id']}})['then'](function(){return _0x475d92;});})[_0xe009('0x26')](function(){_0x37a881[_0xe009('0x18')](0xcc)[_0xe009('0x19')]();});}};}function handleEntityNotFound(_0x3ebefb,_0x503646){return function(_0x25ff53){if(!_0x25ff53){_0x3ebefb[_0xe009('0x17')](0x194);}return _0x25ff53;};}function handleError(_0x51c2f1,_0x5567c2){_0x5567c2=_0x5567c2||0x1f4;return function(_0x4769e6){logger['error'](_0x4769e6[_0xe009('0x27')]);if(_0x4769e6[_0xe009('0x28')]){delete _0x4769e6[_0xe009('0x28')];}_0x51c2f1[_0xe009('0x18')](_0x5567c2)[_0xe009('0x29')](_0x4769e6);};}exports[_0xe009('0x2a')]=function(_0x4fe786,_0x137bdd){var _0x117d7e={},_0x3bb962={},_0x29d0e8={'count':0x0,'rows':[]};var _0x90a38d=_[_0xe009('0x2b')](db['AnalyticCustomReport'][_0xe009('0x2c')],function(_0x1f5d94){return{'name':_0x1f5d94[_0xe009('0x2d')],'type':_0x1f5d94[_0xe009('0x2e')][_0xe009('0x2f')]};});_0x3bb962['model']=_['map'](_0x90a38d,_0xe009('0x28'));_0x3bb962[_0xe009('0x30')]=_['keys'](_0x4fe786['query']);_0x3bb962[_0xe009('0x31')]=_['intersection'](_0x3bb962['model'],_0x3bb962[_0xe009('0x30')]);_0x117d7e['attributes']=_[_0xe009('0x32')](_0x3bb962[_0xe009('0x33')],qs[_0xe009('0x34')](_0x4fe786[_0xe009('0x30')][_0xe009('0x34')]));_0x117d7e[_0xe009('0x35')]=_0x117d7e[_0xe009('0x35')]['length']?_0x117d7e['attributes']:_0x3bb962[_0xe009('0x33')];if(!_0x4fe786[_0xe009('0x30')]['hasOwnProperty'](_0xe009('0x36'))){_0x117d7e[_0xe009('0x1d')]=qs['limit'](_0x4fe786[_0xe009('0x30')][_0xe009('0x1d')]);_0x117d7e[_0xe009('0x1b')]=qs[_0xe009('0x1b')](_0x4fe786[_0xe009('0x30')]['offset']);}_0x117d7e[_0xe009('0x37')]=qs[_0xe009('0x38')](_0x4fe786[_0xe009('0x30')][_0xe009('0x38')]);_0x117d7e[_0xe009('0x39')]=qs[_0xe009('0x31')](_[_0xe009('0x3a')](_0x4fe786[_0xe009('0x30')],_0x3bb962[_0xe009('0x31')]),_0x90a38d);if(_0x4fe786[_0xe009('0x30')][_0xe009('0x3b')]){_0x117d7e[_0xe009('0x39')]=_[_0xe009('0x3c')](_0x117d7e[_0xe009('0x39')],{'$or':_[_0xe009('0x2b')](_0x90a38d,function(_0xbf0d51){if(_0xbf0d51[_0xe009('0x2e')]!==_0xe009('0x3d')){var _0x52450d={};_0x52450d[_0xbf0d51['name']]={'$like':'%'+_0x4fe786[_0xe009('0x30')][_0xe009('0x3b')]+'%'};return _0x52450d;}})});}_0x117d7e=_['merge']({},_0x117d7e,_0x4fe786[_0xe009('0x3e')]);var _0x29cac0={'where':_0x117d7e[_0xe009('0x39')]};return db[_0xe009('0x3f')][_0xe009('0x40')](_0x29cac0)[_0xe009('0x26')](function(_0x15f515){_0x29d0e8[_0xe009('0x40')]=_0x15f515;if(_0x4fe786[_0xe009('0x30')][_0xe009('0x41')]){_0x117d7e[_0xe009('0x42')]=[{'all':!![]}];}return db[_0xe009('0x3f')][_0xe009('0x43')](_0x117d7e);})[_0xe009('0x26')](function(_0x5b2fa4){_0x29d0e8[_0xe009('0x44')]=_0x5b2fa4;return _0x29d0e8;})[_0xe009('0x26')](respondWithFilteredResult(_0x137bdd,_0x117d7e))[_0xe009('0x45')](handleError(_0x137bdd,null));};exports[_0xe009('0x46')]=function(_0x491105,_0x2e2055){var _0x2b205d={'raw':![],'where':{'id':_0x491105['params']['id']}},_0x4da5c6={};_0x4da5c6[_0xe009('0x33')]=_[_0xe009('0x47')](db['AnalyticCustomReport'][_0xe009('0x2c')]);_0x4da5c6['query']=_[_0xe009('0x47')](_0x491105[_0xe009('0x30')]);_0x4da5c6[_0xe009('0x31')]=_[_0xe009('0x32')](_0x4da5c6['model'],_0x4da5c6[_0xe009('0x30')]);_0x2b205d[_0xe009('0x35')]=_[_0xe009('0x32')](_0x4da5c6[_0xe009('0x33')],qs['fields'](_0x491105[_0xe009('0x30')][_0xe009('0x34')]));_0x2b205d[_0xe009('0x35')]=_0x2b205d['attributes'][_0xe009('0x48')]?_0x2b205d[_0xe009('0x35')]:_0x4da5c6[_0xe009('0x33')];if(_0x491105[_0xe009('0x30')]['includeAll']){_0x2b205d[_0xe009('0x42')]=[{'all':!![]}];}_0x2b205d=_[_0xe009('0x3c')]({},_0x2b205d,_0x491105[_0xe009('0x3e')]);return db['AnalyticCustomReport'][_0xe009('0x49')](_0x2b205d)[_0xe009('0x26')](handleEntityNotFound(_0x2e2055,null))[_0xe009('0x26')](respondWithResult(_0x2e2055,null))[_0xe009('0x45')](handleError(_0x2e2055,null));};exports[_0xe009('0x4a')]=function(_0x55a736,_0x219b3f){return db['AnalyticCustomReport'][_0xe009('0x4a')](_0x55a736[_0xe009('0x4b')],{})[_0xe009('0x26')](function(_0x4b4f50){var _0x3f587a=_0x55a736['user'][_0xe009('0x23')]({'plain':!![]});if(!_0x3f587a)throw new Error(_0xe009('0x4c'));if(_0x3f587a['role']===_0xe009('0x4d')){var _0x1068b0=_0x4b4f50[_0xe009('0x23')]({'plain':!![]});var _0x17a2cc=_0xe009('0x4e');return db[_0xe009('0x4f')][_0xe009('0x49')]({'where':{'name':_0x17a2cc,'userProfileId':_0x3f587a[_0xe009('0x50')]},'raw':!![]})['then'](function(_0x27f3ae){if(_0x27f3ae&&_0x27f3ae[_0xe009('0x51')]===0x0){return db[_0xe009('0x25')][_0xe009('0x4a')]({'name':_0x1068b0[_0xe009('0x28')],'resourceId':_0x1068b0['id'],'type':_0xe009('0x24'),'sectionId':_0x27f3ae['id']},{})[_0xe009('0x26')](function(){return _0x4b4f50;});}else{return _0x4b4f50;}})[_0xe009('0x45')](function(_0x82af5){logger[_0xe009('0x52')](_0xe009('0x53'),_0x82af5);throw _0x82af5;});}return _0x4b4f50;})[_0xe009('0x26')](respondWithResult(_0x219b3f,0xc9))['catch'](handleError(_0x219b3f,null));};exports[_0xe009('0x22')]=function(_0x3f1829,_0x27e66b){if(_0x3f1829['body']['id']){delete _0x3f1829[_0xe009('0x4b')]['id'];}return db[_0xe009('0x3f')][_0xe009('0x49')]({'where':{'id':_0x3f1829[_0xe009('0x54')]['id']}})[_0xe009('0x26')](handleEntityNotFound(_0x27e66b,null))[_0xe009('0x26')](saveUpdates(_0x3f1829[_0xe009('0x4b')],null))[_0xe009('0x26')](respondWithResult(_0x27e66b,null))[_0xe009('0x45')](handleError(_0x27e66b,null));};exports[_0xe009('0x55')]=function(_0x16c7a8,_0x2ab008){return db[_0xe009('0x3f')][_0xe009('0x49')]({'where':{'id':_0x16c7a8['params']['id']}})[_0xe009('0x26')](handleEntityNotFound(_0x2ab008,null))['then'](removeEntity(_0x2ab008,null))[_0xe009('0x45')](handleError(_0x2ab008,null));};exports['preview']=function(_0x243dde,_0x44b93c){var _0x2d1446=0xa;var _0xb23c79=[_0xe009('0x56'),_0xe009('0x57'),_0xe009('0x58'),_0xe009('0x59')];var _0x171b44={'SUM':_0xe009('0x5a'),'COUNT':_0xe009('0x5b'),'COUNT DISTINCT':_0xe009('0x5c'),'MAX':_0xe009('0x5d'),'MIN':'MIN(%s)','AVG':_0xe009('0x5e'),'GROUP_CONCAT':_0xe009('0x5f'),'GROUP_CONCAT ASC':_0xe009('0x60'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x19a162={'SEC_TO_TIME':_0xe009('0x61'),'DATE':_0xe009('0x62'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1bff70=function(_0x5da0ca){return!_[_0xe009('0x63')]([_0xe009('0x64'),_0xe009('0x65'),_0xe009('0x66'),'IS\x20NOT\x20EMPTY'],_0x5da0ca);};var _0xc859bf=function(_0x611770){if(!_0x611770||!_0x611770[_0xe009('0x67')]['length']){return'';}for(var _0x4790a6='(',_0x56d9c5=0x0;_0x56d9c5<_0x611770[_0xe009('0x67')][_0xe009('0x48')];_0x56d9c5+=0x1){_0x56d9c5>0x0&&(_0x4790a6+='\x20'+_0x611770['operator']+'\x20');_0x4790a6+=_0x611770[_0xe009('0x67')][_0x56d9c5][_0xe009('0x68')]?_0xc859bf(_0x611770[_0xe009('0x67')][_0x56d9c5]['group']):_0x611770[_0xe009('0x67')][_0x56d9c5]['field']+'\x20'+_0x611770[_0xe009('0x67')][_0x56d9c5][_0xe009('0x69')]+(_0x1bff70(_0x611770[_0xe009('0x67')][_0x56d9c5][_0xe009('0x69')])?'\x20'+_0x611770[_0xe009('0x67')][_0x56d9c5][_0xe009('0x6a')]:'');}return _0x4790a6+')';};var _0x914923={'where':{'id':_0x243dde['params']['id']}},_0x4cb72c,_0x4360ab,_0x1f0902,_0x2bd865,_0x486a8a;_0x914923=_[_0xe009('0x3c')]({},_0x914923,_0x243dde[_0xe009('0x3e')]);return db[_0xe009('0x3f')][_0xe009('0x49')](_0x914923)['then'](function(_0x32c909){if(_0x32c909){_0x4cb72c=_0x32c909;return _0x32c909[_0xe009('0x6b')]();}return null;})[_0xe009('0x26')](function(_0x1ad80a){if(_0x1ad80a){if(!_0x1ad80a['length']){throw new db[(_0xe009('0x6c'))][(_0xe009('0x6d'))](_0xe009('0x6e'),0x193);}_0x4360ab=_0x1ad80a;return db[_0xe009('0x6f')]['findAll']({'raw':!![]});}return null;})[_0xe009('0x26')](function(_0x2da7f7){if(_0x2da7f7){_0x1f0902=_['keyBy'](_0x2da7f7,'id');var _0x4597e2;var _0x5a3678=squel['select']();_0x5a3678['from'](_0x4cb72c[_0xe009('0x70')]);for(var _0x4f480b=0x0;_0x4f480b<_0x4360ab[_0xe009('0x48')];_0x4f480b+=0x1){_0x4597e2=_0x4360ab[_0x4f480b][_0xe009('0x71')]?_0x1f0902[_0x4360ab[_0x4f480b][_0xe009('0x71')]][_0xe009('0x72')]:_0x4360ab[_0x4f480b][_0xe009('0x73')];_0x4597e2=_0x4360ab[_0x4f480b][_0xe009('0x74')]?_[_0xe009('0x75')](_0x171b44[_0x4360ab[_0x4f480b][_0xe009('0x74')]],'%s',_0x4597e2):_0x4597e2;_0x4597e2=_0x4360ab[_0x4f480b][_0xe009('0x76')]?_[_0xe009('0x75')](_0x19a162[_0x4360ab[_0x4f480b][_0xe009('0x76')]],'%s',_0x4597e2):_0x4597e2;if(_0x4360ab[_0x4f480b]['groupBy']){_0x5a3678[_0xe009('0x68')](_0x4597e2);}_0x4360ab[_0x4f480b][_0xe009('0x77')]&&_0x5a3678[_0xe009('0x37')](_0x4597e2,_0x4360ab[_0x4f480b][_0xe009('0x77')]===_0xe009('0x78')?![]:!![]);_0x5a3678[_0xe009('0x73')](_0x4597e2,_0x4360ab[_0x4f480b][_0xe009('0x79')]||_0x4597e2);}if(_0x4cb72c[_0xe009('0x7a')]){_0x4cb72c[_0xe009('0x7a')]=JSON[_0xe009('0x7b')](_0x4cb72c[_0xe009('0x7a')]);for(var _0x3efed0=0x0;_0x3efed0<_0x4cb72c[_0xe009('0x7a')][_0xe009('0x48')];_0x3efed0+=0x1){if(_0x4cb72c[_0xe009('0x7a')][_0x3efed0]['type']&&_[_0xe009('0x63')](_0xb23c79,_0x4cb72c[_0xe009('0x7a')][_0x3efed0][_0xe009('0x2e')])&&_0x4cb72c[_0xe009('0x7a')][_0x3efed0][_0xe009('0x7c')]&&_0x4cb72c[_0xe009('0x7a')][_0x3efed0][_0xe009('0x7d')]&&_0x4cb72c[_0xe009('0x7a')][_0x3efed0][_0xe009('0x7e')]){_0x5a3678[_0x4cb72c[_0xe009('0x7a')][_0x3efed0][_0xe009('0x2e')]](_0x4cb72c[_0xe009('0x7a')][_0x3efed0][_0xe009('0x7d')],null,util[_0xe009('0x76')]('%s.%s\x20=\x20%s.%s',_0x4cb72c['table'],_0x4cb72c[_0xe009('0x7a')][_0x3efed0]['parentKey'],_0x4cb72c['joins'][_0x3efed0][_0xe009('0x7d')],_0x4cb72c[_0xe009('0x7a')][_0x3efed0][_0xe009('0x7e')]));}}}if(_0x4cb72c[_0xe009('0x7f')]){_0x4cb72c[_0xe009('0x7f')]=JSON[_0xe009('0x7b')](_0x4cb72c['conditions']);_0x5a3678[_0xe009('0x39')](_0xc859bf(_0x4cb72c[_0xe009('0x7f')]['group']));}_0x486a8a=_0x5a3678['clone']();_0x5a3678[_0xe009('0x1d')](_0x2d1446);_0x5a3678[_0xe009('0x1b')](0x0);logger[_0xe009('0x80')](_0xe009('0x81'),_0x5a3678['toString']());return dbH[_0xe009('0x82')][_0xe009('0x30')](_0x5a3678[_0xe009('0x83')](),{'type':dbH['sequelize'][_0xe009('0x84')][_0xe009('0x85')]});}})[_0xe009('0x26')](respondWithResult(_0x44b93c,null))[_0xe009('0x45')](handleError(_0x44b93c,null));};function runReport(_0x3264d9,_0x47467c,_0x5cda68){var _0x87b397=_0x47467c[_0xe009('0x28')];var _0xa7777=0xa;var _0x31f028=[_0xe009('0x56'),_0xe009('0x57'),'right_join','cross_join'];var _0x5a5242={'SUM':_0xe009('0x5a'),'COUNT':_0xe009('0x5b'),'COUNT DISTINCT':_0xe009('0x5c'),'MAX':_0xe009('0x5d'),'MIN':_0xe009('0x86'),'AVG':_0xe009('0x5e'),'GROUP_CONCAT':_0xe009('0x5f'),'GROUP_CONCAT ASC':_0xe009('0x60'),'GROUP_CONCAT DESC':_0xe009('0x87')};var _0x430c14={'SEC_TO_TIME':_0xe009('0x61'),'DATE':_0xe009('0x62'),'HOUR':'HOUR(%s)','ROUND':_0xe009('0x88'),'UNIX_TIMESTAMP':_0xe009('0x89')};var _0x297144=function(_0x502224){return!_['includes']([_0xe009('0x64'),'IS\x20NOT\x20NULL',_0xe009('0x66'),_0xe009('0x8a')],_0x502224);};var _0x45a9c8=function(_0x1903ff){if(!_0x1903ff||!_0x1903ff[_0xe009('0x67')][_0xe009('0x48')]){return'';}for(var _0x276ff8='(',_0x2d833d=0x0;_0x2d833d<_0x1903ff['rules']['length'];_0x2d833d+=0x1){_0x2d833d>0x0&&(_0x276ff8+='\x20'+_0x1903ff['operator']+'\x20');_0x276ff8+=_0x1903ff['rules'][_0x2d833d][_0xe009('0x68')]?_0x45a9c8(_0x1903ff[_0xe009('0x67')][_0x2d833d][_0xe009('0x68')]):_0x1903ff[_0xe009('0x67')][_0x2d833d]['field']+'\x20'+_0x1903ff[_0xe009('0x67')][_0x2d833d][_0xe009('0x69')]+(_0x297144(_0x1903ff[_0xe009('0x67')][_0x2d833d]['condition'])?'\x20'+_0x1903ff[_0xe009('0x67')][_0x2d833d][_0xe009('0x6a')]:'');}return _0x276ff8+')';};var _0x1615ca={'where':{'id':_0x3264d9['id']}},_0x3cd004,_0x4905bf,_0x4a3db2,_0x10b2db,_0x4bc02b;_0x1615ca=_[_0xe009('0x3c')]({},_0x1615ca,_0x5cda68);return db['AnalyticCustomReport'][_0xe009('0x49')](_0x1615ca)[_0xe009('0x26')](function(_0x386046){if(_0x386046){_0x3cd004=_0x386046;return _0x386046[_0xe009('0x6b')]();}return null;})[_0xe009('0x26')](function(_0x3f7954){if(_0x3f7954){if(!_0x3f7954[_0xe009('0x48')]){throw new db[(_0xe009('0x6c'))][(_0xe009('0x6d'))](_0xe009('0x6e'),0x193);}_0x4905bf=_0x3f7954;return db[_0xe009('0x6f')][_0xe009('0x43')]({'raw':!![]});}return null;})[_0xe009('0x26')](function(_0x4b1c51){if(_0x4b1c51){_0x4a3db2=_[_0xe009('0x8b')](_0x4b1c51,'id');var _0xcf40e0;var _0x2e1534=squel['select']();_0x2e1534[_0xe009('0x8c')](_0x3cd004[_0xe009('0x70')]);for(var _0xcb65fa=0x0;_0xcb65fa<_0x4905bf['length'];_0xcb65fa+=0x1){_0xcf40e0=_0x4905bf[_0xcb65fa][_0xe009('0x71')]?_0x4a3db2[_0x4905bf[_0xcb65fa][_0xe009('0x71')]]['metric']:_0x4905bf[_0xcb65fa][_0xe009('0x73')];_0xcf40e0=_0x4905bf[_0xcb65fa][_0xe009('0x74')]?_[_0xe009('0x75')](_0x5a5242[_0x4905bf[_0xcb65fa]['function']],'%s',_0xcf40e0):_0xcf40e0;_0xcf40e0=_0x4905bf[_0xcb65fa][_0xe009('0x76')]?_[_0xe009('0x75')](_0x430c14[_0x4905bf[_0xcb65fa]['format']],'%s',_0xcf40e0):_0xcf40e0;if(_0x4905bf[_0xcb65fa][_0xe009('0x8d')]){_0x2e1534[_0xe009('0x68')](_0xcf40e0);}_0x4905bf[_0xcb65fa]['orderBy']&&_0x2e1534[_0xe009('0x37')](_0xcf40e0,_0x4905bf[_0xcb65fa][_0xe009('0x77')]===_0xe009('0x78')?![]:!![]);_0x2e1534[_0xe009('0x73')](_0xcf40e0,_0x4905bf[_0xcb65fa]['alias']||_0xcf40e0);}if(_0x3cd004['joins']){_0x3cd004['joins']=JSON[_0xe009('0x7b')](_0x3cd004['joins']);for(var _0x2495ed=0x0;_0x2495ed<_0x3cd004[_0xe009('0x7a')][_0xe009('0x48')];_0x2495ed+=0x1){if(_0x3cd004[_0xe009('0x7a')][_0x2495ed][_0xe009('0x2e')]&&_[_0xe009('0x63')](_0x31f028,_0x3cd004['joins'][_0x2495ed][_0xe009('0x2e')])&&_0x3cd004[_0xe009('0x7a')][_0x2495ed][_0xe009('0x7c')]&&_0x3cd004[_0xe009('0x7a')][_0x2495ed][_0xe009('0x7d')]&&_0x3cd004[_0xe009('0x7a')][_0x2495ed][_0xe009('0x7e')]){_0x2e1534[_0x3cd004[_0xe009('0x7a')][_0x2495ed][_0xe009('0x2e')]](_0x3cd004['joins'][_0x2495ed][_0xe009('0x7d')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3cd004[_0xe009('0x70')],_0x3cd004[_0xe009('0x7a')][_0x2495ed][_0xe009('0x7c')],_0x3cd004[_0xe009('0x7a')][_0x2495ed]['foreignTable'],_0x3cd004[_0xe009('0x7a')][_0x2495ed][_0xe009('0x7e')]));}}}if(_0x3cd004['conditions']){_0x3cd004['conditions']=JSON[_0xe009('0x7b')](_0x3cd004[_0xe009('0x7f')]);_0x2e1534[_0xe009('0x39')](_0x45a9c8(_0x3cd004[_0xe009('0x7f')][_0xe009('0x68')]));}_0x4bc02b=_0x2e1534[_0xe009('0x8e')]();_0x2e1534[_0xe009('0x1d')](_0xa7777);_0x2e1534['offset'](0x0);return;}})[_0xe009('0x26')](function(){if(_0x47467c[_0xe009('0x8f')]===_0xe009('0x90')){return null;}var _0x39c42e=_[_0xe009('0x3c')](_0x47467c,{'name':_0x47467c[_0xe009('0x91')]||_0x47467c[_0xe009('0x28')]||_0x3cd004['name'],'basename':_0x87b397,'savename':util[_0xe009('0x76')](_0xe009('0x92'),_0x47467c[_0xe009('0x28')]||_0x3cd004[_0xe009('0x28')],require(_0xe009('0x93'))[_0xe009('0x94')](0x4),_0x47467c[_0xe009('0x8f')]||_0xe009('0x95')),'reportId':_0x3cd004['id'],'reportType':'custom'});return db['AnalyticExtractedReport']['create'](_0x39c42e,{'raw':!![]});})[_0xe009('0x26')](function(_0x2ba59b){if(_0x3cd004[_0xe009('0x70')]===_0xe009('0x96')){_0x4bc02b[_0xe009('0x39')](_0x3cd004['table']+_0xe009('0x97'),_0x47467c[_0xe009('0x98')],_0x47467c[_0xe009('0x99')]);}else{_0x4bc02b[_0xe009('0x39')](_0x3cd004[_0xe009('0x70')]+_0xe009('0x9a'),_0x47467c[_0xe009('0x98')],_0x47467c[_0xe009('0x99')]);}if(_0x2ba59b){logger['info'](_0xe009('0x9b'),_0x4bc02b[_0xe009('0x83')]());require(_0xe009('0x9c'))['fork'](path[_0xe009('0x56')](__dirname,_0xe009('0x9d'),_0x2ba59b['output']),[_0x2ba59b['id'],_0x4bc02b[_0xe009('0x83')](),path[_0xe009('0x56')](__dirname,'../../files/reports',_0x2ba59b['savename']),_0x87b397]);return _0x2ba59b;}else{var _0x3a7357=squel[_0xe009('0x9e')]();_0x3a7357[_0xe009('0x8c')]('('+_0x4bc02b[_0xe009('0x83')]()+')',_0xe009('0x9f'));_0x3a7357[_0xe009('0x73')](_0xe009('0xa0'),_0xe009('0x40'));_0x4bc02b[_0xe009('0x1d')](_0x47467c[_0xe009('0x1d')]||_0xa7777);_0x4bc02b[_0xe009('0x1b')](_0x47467c['offset']||0x0);return dbH[_0xe009('0x82')][_0xe009('0x30')](_0x3a7357[_0xe009('0x83')](),{'type':dbH[_0xe009('0x82')][_0xe009('0x84')][_0xe009('0x85')]})['then'](function(_0x58963d){if(!_0x58963d[_0xe009('0x48')]){_0x10b2db=0x0;}else{_0x10b2db=_0x58963d[0x0][_0xe009('0x40')]||0x0;}return dbH['sequelize'][_0xe009('0x30')](_0x4bc02b['toString'](),{'type':dbH[_0xe009('0x82')][_0xe009('0x84')]['SELECT']});})[_0xe009('0x26')](function(_0x5461c9){return{'rows':_0x5461c9||[],'count':_0x10b2db};});}});}exports[_0xe009('0xa1')]=function(_0x4c9cac,_0x6c288a){return runReport(_0x4c9cac[_0xe009('0x54')],_0x4c9cac['query'],_0x4c9cac[_0xe009('0x3e')])[_0xe009('0x26')](respondWithResult(_0x6c288a,null))[_0xe009('0x45')](handleError(_0x6c288a,null));};exports['runReport']=runReport;exports['query']=function(_0x32f555,_0xe0613d){var _0x42270a=0xa;var _0x184891=['join',_0xe009('0x57'),_0xe009('0x58'),'cross_join'];var _0x1c3d3c={'SUM':_0xe009('0x5a'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xe009('0x5c'),'MAX':_0xe009('0x5d'),'MIN':_0xe009('0x86'),'AVG':_0xe009('0x5e'),'GROUP_CONCAT':_0xe009('0x5f'),'GROUP_CONCAT ASC':_0xe009('0x60'),'GROUP_CONCAT DESC':_0xe009('0x87')};var _0x46b91d={'SEC_TO_TIME':_0xe009('0x61'),'DATE':_0xe009('0x62'),'HOUR':_0xe009('0xa2'),'ROUND':_0xe009('0x88'),'UNIX_TIMESTAMP':_0xe009('0x89')};var _0x15d2d5=function(_0x2c8ed9){return!_[_0xe009('0x63')]([_0xe009('0x64'),'IS\x20NOT\x20NULL',_0xe009('0x66'),_0xe009('0x8a')],_0x2c8ed9);};var _0x5e90ba=function(_0x5076dc){if(!_0x5076dc||!_0x5076dc['rules'][_0xe009('0x48')]){return'';}for(var _0x3035a5='(',_0x106186=0x0;_0x106186<_0x5076dc[_0xe009('0x67')][_0xe009('0x48')];_0x106186+=0x1){_0x106186>0x0&&(_0x3035a5+='\x20'+_0x5076dc[_0xe009('0xa3')]+'\x20');_0x3035a5+=_0x5076dc[_0xe009('0x67')][_0x106186][_0xe009('0x68')]?_0x5e90ba(_0x5076dc['rules'][_0x106186][_0xe009('0x68')]):_0x5076dc['rules'][_0x106186][_0xe009('0x73')]+'\x20'+_0x5076dc[_0xe009('0x67')][_0x106186]['condition']+(_0x15d2d5(_0x5076dc[_0xe009('0x67')][_0x106186][_0xe009('0x69')])?'\x20'+_0x5076dc['rules'][_0x106186]['value']:'');}return _0x3035a5+')';};var _0x5d351c={'where':{'id':_0x32f555[_0xe009('0x54')]['id']}},_0x36cd39,_0x26cfca,_0x4e81d1,_0x46bcab,_0x1e9374;_0x5d351c=_[_0xe009('0x3c')]({},_0x5d351c,_0x32f555[_0xe009('0x3e')]);return db[_0xe009('0x3f')][_0xe009('0x49')](_0x5d351c)['then'](function(_0x410809){if(_0x410809){_0x36cd39=_0x410809;return _0x410809['getFields']();}return null;})[_0xe009('0x26')](function(_0x3c5e61){if(_0x3c5e61){if(!_0x3c5e61[_0xe009('0x48')]){throw new db[(_0xe009('0x6c'))][(_0xe009('0x6d'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x26cfca=_0x3c5e61;return db[_0xe009('0x6f')][_0xe009('0x43')]({'raw':!![]});}return null;})['then'](function(_0x3ea34f){if(_0x3ea34f){_0x4e81d1=_[_0xe009('0x8b')](_0x3ea34f,'id');var _0x5dba23;var _0x2aebe4=squel[_0xe009('0x9e')]();_0x2aebe4[_0xe009('0x8c')](_0x36cd39['table']);for(var _0x1f5db5=0x0;_0x1f5db5<_0x26cfca[_0xe009('0x48')];_0x1f5db5+=0x1){_0x5dba23=_0x26cfca[_0x1f5db5][_0xe009('0x71')]?_0x4e81d1[_0x26cfca[_0x1f5db5][_0xe009('0x71')]][_0xe009('0x72')]:_0x26cfca[_0x1f5db5][_0xe009('0x73')];_0x5dba23=_0x26cfca[_0x1f5db5][_0xe009('0x74')]?_[_0xe009('0x75')](_0x1c3d3c[_0x26cfca[_0x1f5db5][_0xe009('0x74')]],'%s',_0x5dba23):_0x5dba23;_0x5dba23=_0x26cfca[_0x1f5db5][_0xe009('0x76')]?_['replace'](_0x46b91d[_0x26cfca[_0x1f5db5]['format']],'%s',_0x5dba23):_0x5dba23;if(_0x26cfca[_0x1f5db5][_0xe009('0x8d')]){_0x2aebe4[_0xe009('0x68')](_0x5dba23);}_0x26cfca[_0x1f5db5]['orderBy']&&_0x2aebe4[_0xe009('0x37')](_0x5dba23,_0x26cfca[_0x1f5db5][_0xe009('0x77')]===_0xe009('0x78')?![]:!![]);_0x2aebe4[_0xe009('0x73')](_0x5dba23,_0x26cfca[_0x1f5db5][_0xe009('0x79')]||_0x5dba23);}if(_0x36cd39[_0xe009('0x7a')]){_0x36cd39[_0xe009('0x7a')]=JSON['parse'](_0x36cd39['joins']);for(var _0x213211=0x0;_0x213211<_0x36cd39['joins'][_0xe009('0x48')];_0x213211+=0x1){if(_0x36cd39[_0xe009('0x7a')][_0x213211]['type']&&_[_0xe009('0x63')](_0x184891,_0x36cd39[_0xe009('0x7a')][_0x213211]['type'])&&_0x36cd39[_0xe009('0x7a')][_0x213211]['parentKey']&&_0x36cd39[_0xe009('0x7a')][_0x213211]['foreignTable']&&_0x36cd39[_0xe009('0x7a')][_0x213211][_0xe009('0x7e')]){_0x2aebe4[_0x36cd39[_0xe009('0x7a')][_0x213211]['type']](_0x36cd39[_0xe009('0x7a')][_0x213211][_0xe009('0x7d')],null,util['format'](_0xe009('0xa4'),_0x36cd39['table'],_0x36cd39['joins'][_0x213211][_0xe009('0x7c')],_0x36cd39[_0xe009('0x7a')][_0x213211][_0xe009('0x7d')],_0x36cd39[_0xe009('0x7a')][_0x213211][_0xe009('0x7e')]));}}}if(_0x36cd39[_0xe009('0x7f')]){_0x36cd39[_0xe009('0x7f')]=JSON[_0xe009('0x7b')](_0x36cd39[_0xe009('0x7f')]);_0x2aebe4['where'](_0x5e90ba(_0x36cd39[_0xe009('0x7f')][_0xe009('0x68')]));}_0x1e9374=_0x2aebe4[_0xe009('0x8e')]();_0x2aebe4[_0xe009('0x1d')](_0x42270a);_0x2aebe4['offset'](0x0);logger[_0xe009('0x80')]('Limited\x20Query:',_0x2aebe4[_0xe009('0x83')]());return dbH[_0xe009('0x82')][_0xe009('0x30')](_0x2aebe4['toString'](),{'type':dbH['sequelize'][_0xe009('0x84')][_0xe009('0x85')]});}})[_0xe009('0x26')](function(){return{'sql':_0x1e9374[_0xe009('0x83')]()};})[_0xe009('0x26')](respondWithResult(_0xe0613d,null))[_0xe009('0x45')](handleError(_0xe0613d,null));};
\ No newline at end of file
+var _0x1724=['conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','HOUR(%s)','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','select','metric','output','web','fullPath','%s-%s.%s','randomstring','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','Run\x20Query:','../../components/export/','../../files/reports','savename','COUNT(*)','getFields','debug','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','json','undefined','limit','count','offset','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','sendStatus','error','stack','name','index','map','type','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','AnalyticCustomReport','includeAll','include','findAll','params','rawAttributes','fields','catch','create','body','user','role','Reports','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','right_join','SUM(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','ValidationErrorItem','AnalyticMetric','keyBy','from','MetricId','function','replace','format','groupBy','orderBy','DESC','alias','parse','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','table'];(function(_0x315df3,_0x5e1513){var _0x3f1014=function(_0x18b73a){while(--_0x18b73a){_0x315df3['push'](_0x315df3['shift']());}};_0x3f1014(++_0x5e1513);}(_0x1724,0xca));var _0x4172=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0x1724[_0x34021d];return _0x16597b;};'use strict';var emlformat=require(_0x4172('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4172('0x1'));var jsonpatch=require(_0x4172('0x2'));var rp=require(_0x4172('0x3'));var moment=require('moment');var BPromise=require(_0x4172('0x4'));var Mustache=require('mustache');var util=require(_0x4172('0x5'));var path=require(_0x4172('0x6'));var sox=require(_0x4172('0x7'));var csv=require(_0x4172('0x8'));var ejs=require(_0x4172('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4172('0xa'));var squel=require(_0x4172('0xb'));var crypto=require('crypto');var jsforce=require(_0x4172('0xc'));var deskjs=require(_0x4172('0xd'));var toCsv=require(_0x4172('0x8'));var querystring=require(_0x4172('0xe'));var Papa=require(_0x4172('0xf'));var Redis=require(_0x4172('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4172('0x11'));var as=require(_0x4172('0x12'));var hardwareService=require(_0x4172('0x13'));var logger=require(_0x4172('0x14'))(_0x4172('0x15'));var utils=require(_0x4172('0x16'));var config=require(_0x4172('0x17'));var licenseUtil=require(_0x4172('0x18'));var db=require(_0x4172('0x19'))['db'];var dbH=require(_0x4172('0x19'))[_0x4172('0x1a')];function respondWithStatusCode(_0xdac044,_0x54cd1e){_0x54cd1e=_0x54cd1e||0xcc;return function(_0x4b573b){if(_0x4b573b){return _0xdac044['sendStatus'](_0x54cd1e);}return _0xdac044[_0x4172('0x1b')](_0x54cd1e)[_0x4172('0x1c')]();};}function respondWithResult(_0x5c83de,_0x742dae){_0x742dae=_0x742dae||0xc8;return function(_0x2a66a8){if(_0x2a66a8){return _0x5c83de[_0x4172('0x1b')](_0x742dae)[_0x4172('0x1d')](_0x2a66a8);}};}function respondWithFilteredResult(_0xf7f7df,_0x4a0b4e){return function(_0x250bc7){if(_0x250bc7){var _0x3aa3f4=typeof _0x4a0b4e['offset']===_0x4172('0x1e')&&typeof _0x4a0b4e[_0x4172('0x1f')]===_0x4172('0x1e');var _0x594a77=_0x250bc7['count'];var _0x3840c3=_0x3aa3f4?0x0:_0x4a0b4e['offset'];var _0x16d50e=_0x3aa3f4?_0x250bc7[_0x4172('0x20')]:_0x4a0b4e[_0x4172('0x21')]+_0x4a0b4e[_0x4172('0x1f')];var _0x36e7c2;if(_0x16d50e>=_0x594a77){_0x16d50e=_0x594a77;_0x36e7c2=0xc8;}else{_0x36e7c2=0xce;}_0xf7f7df[_0x4172('0x1b')](_0x36e7c2);return _0xf7f7df['set']('Content-Range',_0x3840c3+'-'+_0x16d50e+'/'+_0x594a77)['json'](_0x250bc7);}return null;};}function patchUpdates(_0x24cb11){return function(_0xb6f7f2){try{jsonpatch['apply'](_0xb6f7f2,_0x24cb11,!![]);}catch(_0x54f6fa){return BPromise[_0x4172('0x22')](_0x54f6fa);}return _0xb6f7f2[_0x4172('0x23')]();};}function saveUpdates(_0x1a5667,_0x1ade23){return function(_0x2b214e){if(_0x2b214e){return _0x2b214e[_0x4172('0x24')](_0x1a5667)[_0x4172('0x25')](function(_0x2c393f){return _0x2c393f;});}return null;};}function removeEntity(_0x5e90a4,_0x304804){return function(_0x461e59){if(_0x461e59){return _0x461e59[_0x4172('0x26')]()['then'](function(){var _0x33b36b=_0x461e59[_0x4172('0x27')]({'plain':!![]});var _0x3f7bf5=_0x4172('0x28');return db[_0x4172('0x29')][_0x4172('0x26')]({'where':{'type':_0x3f7bf5,'resourceId':_0x33b36b['id']}})[_0x4172('0x25')](function(){return _0x461e59;});})[_0x4172('0x25')](function(){_0x5e90a4[_0x4172('0x1b')](0xcc)[_0x4172('0x1c')]();});}};}function handleEntityNotFound(_0x21b175,_0x1c1fe4){return function(_0x455ec6){if(!_0x455ec6){_0x21b175[_0x4172('0x2a')](0x194);}return _0x455ec6;};}function handleError(_0x5f090d,_0x94bcf5){_0x94bcf5=_0x94bcf5||0x1f4;return function(_0x37b580){logger[_0x4172('0x2b')](_0x37b580[_0x4172('0x2c')]);if(_0x37b580[_0x4172('0x2d')]){delete _0x37b580[_0x4172('0x2d')];}_0x5f090d[_0x4172('0x1b')](_0x94bcf5)['send'](_0x37b580);};}exports[_0x4172('0x2e')]=function(_0x2f6ece,_0x43c40b){var _0x32929a={},_0x5cbd60={},_0x913caa={'count':0x0,'rows':[]};var _0x258918=_[_0x4172('0x2f')](db['AnalyticCustomReport']['rawAttributes'],function(_0xfb45e){return{'name':_0xfb45e['fieldName'],'type':_0xfb45e[_0x4172('0x30')]['key']};});_0x5cbd60[_0x4172('0x31')]=_[_0x4172('0x2f')](_0x258918,_0x4172('0x2d'));_0x5cbd60[_0x4172('0x32')]=_[_0x4172('0x33')](_0x2f6ece[_0x4172('0x32')]);_0x5cbd60[_0x4172('0x34')]=_['intersection'](_0x5cbd60['model'],_0x5cbd60[_0x4172('0x32')]);_0x32929a[_0x4172('0x35')]=_[_0x4172('0x36')](_0x5cbd60[_0x4172('0x31')],qs['fields'](_0x2f6ece[_0x4172('0x32')]['fields']));_0x32929a[_0x4172('0x35')]=_0x32929a[_0x4172('0x35')][_0x4172('0x37')]?_0x32929a[_0x4172('0x35')]:_0x5cbd60[_0x4172('0x31')];if(!_0x2f6ece['query'][_0x4172('0x38')](_0x4172('0x39'))){_0x32929a[_0x4172('0x1f')]=qs['limit'](_0x2f6ece['query'][_0x4172('0x1f')]);_0x32929a[_0x4172('0x21')]=qs['offset'](_0x2f6ece[_0x4172('0x32')][_0x4172('0x21')]);}_0x32929a[_0x4172('0x3a')]=qs['sort'](_0x2f6ece[_0x4172('0x32')][_0x4172('0x3b')]);_0x32929a[_0x4172('0x3c')]=qs['filters'](_[_0x4172('0x3d')](_0x2f6ece[_0x4172('0x32')],_0x5cbd60[_0x4172('0x34')]),_0x258918);if(_0x2f6ece[_0x4172('0x32')]['filter']){_0x32929a['where']=_[_0x4172('0x3e')](_0x32929a[_0x4172('0x3c')],{'$or':_[_0x4172('0x2f')](_0x258918,function(_0x5192d7){if(_0x5192d7[_0x4172('0x30')]!==_0x4172('0x3f')){var _0x1a23ad={};_0x1a23ad[_0x5192d7[_0x4172('0x2d')]]={'$like':'%'+_0x2f6ece[_0x4172('0x32')][_0x4172('0x40')]+'%'};return _0x1a23ad;}})});}_0x32929a=_[_0x4172('0x3e')]({},_0x32929a,_0x2f6ece[_0x4172('0x41')]);var _0x1624de={'where':_0x32929a[_0x4172('0x3c')]};return db[_0x4172('0x42')][_0x4172('0x20')](_0x1624de)[_0x4172('0x25')](function(_0x2774b3){_0x913caa[_0x4172('0x20')]=_0x2774b3;if(_0x2f6ece[_0x4172('0x32')][_0x4172('0x43')]){_0x32929a[_0x4172('0x44')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x4172('0x45')](_0x32929a);})[_0x4172('0x25')](function(_0x284902){_0x913caa['rows']=_0x284902;return _0x913caa;})['then'](respondWithFilteredResult(_0x43c40b,_0x32929a))['catch'](handleError(_0x43c40b,null));};exports['show']=function(_0x2290b5,_0x17f62e){var _0x392962={'raw':![],'where':{'id':_0x2290b5[_0x4172('0x46')]['id']}},_0x4851ba={};_0x4851ba[_0x4172('0x31')]=_[_0x4172('0x33')](db[_0x4172('0x42')][_0x4172('0x47')]);_0x4851ba[_0x4172('0x32')]=_[_0x4172('0x33')](_0x2290b5['query']);_0x4851ba['filters']=_[_0x4172('0x36')](_0x4851ba['model'],_0x4851ba[_0x4172('0x32')]);_0x392962[_0x4172('0x35')]=_['intersection'](_0x4851ba[_0x4172('0x31')],qs[_0x4172('0x48')](_0x2290b5['query'][_0x4172('0x48')]));_0x392962[_0x4172('0x35')]=_0x392962[_0x4172('0x35')][_0x4172('0x37')]?_0x392962[_0x4172('0x35')]:_0x4851ba['model'];if(_0x2290b5[_0x4172('0x32')][_0x4172('0x43')]){_0x392962[_0x4172('0x44')]=[{'all':!![]}];}_0x392962=_[_0x4172('0x3e')]({},_0x392962,_0x2290b5[_0x4172('0x41')]);return db[_0x4172('0x42')]['find'](_0x392962)['then'](handleEntityNotFound(_0x17f62e,null))['then'](respondWithResult(_0x17f62e,null))[_0x4172('0x49')](handleError(_0x17f62e,null));};exports[_0x4172('0x4a')]=function(_0x1e87b0,_0x4e1e5b){return db['AnalyticCustomReport']['create'](_0x1e87b0[_0x4172('0x4b')],{})['then'](function(_0x4a5105){var _0xcf1b6c=_0x1e87b0[_0x4172('0x4c')]['get']({'plain':!![]});if(!_0xcf1b6c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xcf1b6c[_0x4172('0x4d')]==='user'){var _0x25aece=_0x4a5105[_0x4172('0x27')]({'plain':!![]});var _0x52fe07=_0x4172('0x4e');return db['UserProfileSection'][_0x4172('0x4f')]({'where':{'name':_0x52fe07,'userProfileId':_0xcf1b6c[_0x4172('0x50')]},'raw':!![]})[_0x4172('0x25')](function(_0x542450){if(_0x542450&&_0x542450[_0x4172('0x51')]===0x0){return db[_0x4172('0x29')][_0x4172('0x4a')]({'name':_0x25aece['name'],'resourceId':_0x25aece['id'],'type':'CustomReports','sectionId':_0x542450['id']},{})[_0x4172('0x25')](function(){return _0x4a5105;});}else{return _0x4a5105;}})[_0x4172('0x49')](function(_0x23b7dc){logger[_0x4172('0x2b')](_0x4172('0x52'),_0x23b7dc);throw _0x23b7dc;});}return _0x4a5105;})[_0x4172('0x25')](respondWithResult(_0x4e1e5b,0xc9))[_0x4172('0x49')](handleError(_0x4e1e5b,null));};exports[_0x4172('0x24')]=function(_0xd7568,_0xf25cd4){if(_0xd7568[_0x4172('0x4b')]['id']){delete _0xd7568['body']['id'];}return db[_0x4172('0x42')]['find']({'where':{'id':_0xd7568[_0x4172('0x46')]['id']}})[_0x4172('0x25')](handleEntityNotFound(_0xf25cd4,null))[_0x4172('0x25')](saveUpdates(_0xd7568[_0x4172('0x4b')],null))[_0x4172('0x25')](respondWithResult(_0xf25cd4,null))[_0x4172('0x49')](handleError(_0xf25cd4,null));};exports[_0x4172('0x26')]=function(_0x6b4e9b,_0x2cfad0){return db[_0x4172('0x42')][_0x4172('0x4f')]({'where':{'id':_0x6b4e9b[_0x4172('0x46')]['id']}})[_0x4172('0x25')](handleEntityNotFound(_0x2cfad0,null))[_0x4172('0x25')](removeEntity(_0x2cfad0,null))[_0x4172('0x49')](handleError(_0x2cfad0,null));};exports[_0x4172('0x53')]=function(_0x2af08e,_0x2d3c14){var _0x43e310=0xa;var _0x123859=[_0x4172('0x54'),'left_join',_0x4172('0x55'),'cross_join'];var _0x5a1f3e={'SUM':_0x4172('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x4172('0x57'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4172('0x58'),'GROUP_CONCAT ASC':_0x4172('0x59'),'GROUP_CONCAT DESC':_0x4172('0x5a')};var _0x547730={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4172('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0x4172('0x5c'),'UNIX_TIMESTAMP':_0x4172('0x5d')};var _0x5d085c=function(_0x3b8edb){return!_[_0x4172('0x5e')]([_0x4172('0x5f'),_0x4172('0x60'),_0x4172('0x61'),_0x4172('0x62')],_0x3b8edb);};var _0x5bf8ed=function(_0x2a9a9c){if(!_0x2a9a9c||!_0x2a9a9c[_0x4172('0x63')][_0x4172('0x37')]){return'';}for(var _0x26a4a9='(',_0x685ecd=0x0;_0x685ecd<_0x2a9a9c[_0x4172('0x63')]['length'];_0x685ecd+=0x1){_0x685ecd>0x0&&(_0x26a4a9+='\x20'+_0x2a9a9c[_0x4172('0x64')]+'\x20');_0x26a4a9+=_0x2a9a9c['rules'][_0x685ecd][_0x4172('0x65')]?_0x5bf8ed(_0x2a9a9c['rules'][_0x685ecd][_0x4172('0x65')]):_0x2a9a9c[_0x4172('0x63')][_0x685ecd][_0x4172('0x66')]+'\x20'+_0x2a9a9c[_0x4172('0x63')][_0x685ecd][_0x4172('0x67')]+(_0x5d085c(_0x2a9a9c[_0x4172('0x63')][_0x685ecd][_0x4172('0x67')])?'\x20'+_0x2a9a9c['rules'][_0x685ecd][_0x4172('0x68')]:'');}return _0x26a4a9+')';};var _0x2f055f={'where':{'id':_0x2af08e['params']['id']}},_0xbe4ae4,_0x580ed1,_0x187a34,_0x50d33c,_0x577eac;_0x2f055f=_[_0x4172('0x3e')]({},_0x2f055f,_0x2af08e[_0x4172('0x41')]);return db[_0x4172('0x42')][_0x4172('0x4f')](_0x2f055f)[_0x4172('0x25')](function(_0x1dae4b){if(_0x1dae4b){_0xbe4ae4=_0x1dae4b;return _0x1dae4b['getFields']();}return null;})[_0x4172('0x25')](function(_0x2ee003){if(_0x2ee003){if(!_0x2ee003[_0x4172('0x37')]){throw new db['Sequelize'][(_0x4172('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x580ed1=_0x2ee003;return db[_0x4172('0x6a')][_0x4172('0x45')]({'raw':!![]});}return null;})[_0x4172('0x25')](function(_0xf4ed1b){if(_0xf4ed1b){_0x187a34=_[_0x4172('0x6b')](_0xf4ed1b,'id');var _0x5a459e;var _0x11fa24=squel['select']();_0x11fa24[_0x4172('0x6c')](_0xbe4ae4['table']);for(var _0x558d23=0x0;_0x558d23<_0x580ed1[_0x4172('0x37')];_0x558d23+=0x1){_0x5a459e=_0x580ed1[_0x558d23][_0x4172('0x6d')]?_0x187a34[_0x580ed1[_0x558d23][_0x4172('0x6d')]]['metric']:_0x580ed1[_0x558d23][_0x4172('0x66')];_0x5a459e=_0x580ed1[_0x558d23][_0x4172('0x6e')]?_[_0x4172('0x6f')](_0x5a1f3e[_0x580ed1[_0x558d23]['function']],'%s',_0x5a459e):_0x5a459e;_0x5a459e=_0x580ed1[_0x558d23][_0x4172('0x70')]?_[_0x4172('0x6f')](_0x547730[_0x580ed1[_0x558d23][_0x4172('0x70')]],'%s',_0x5a459e):_0x5a459e;if(_0x580ed1[_0x558d23][_0x4172('0x71')]){_0x11fa24[_0x4172('0x65')](_0x5a459e);}_0x580ed1[_0x558d23][_0x4172('0x72')]&&_0x11fa24['order'](_0x5a459e,_0x580ed1[_0x558d23][_0x4172('0x72')]===_0x4172('0x73')?![]:!![]);_0x11fa24['field'](_0x5a459e,_0x580ed1[_0x558d23][_0x4172('0x74')]||_0x5a459e);}if(_0xbe4ae4['joins']){_0xbe4ae4['joins']=JSON[_0x4172('0x75')](_0xbe4ae4[_0x4172('0x76')]);for(var _0x78bd55=0x0;_0x78bd55<_0xbe4ae4['joins']['length'];_0x78bd55+=0x1){if(_0xbe4ae4[_0x4172('0x76')][_0x78bd55]['type']&&_['includes'](_0x123859,_0xbe4ae4[_0x4172('0x76')][_0x78bd55][_0x4172('0x30')])&&_0xbe4ae4[_0x4172('0x76')][_0x78bd55][_0x4172('0x77')]&&_0xbe4ae4[_0x4172('0x76')][_0x78bd55]['foreignTable']&&_0xbe4ae4[_0x4172('0x76')][_0x78bd55][_0x4172('0x78')]){_0x11fa24[_0xbe4ae4[_0x4172('0x76')][_0x78bd55][_0x4172('0x30')]](_0xbe4ae4['joins'][_0x78bd55][_0x4172('0x79')],null,util[_0x4172('0x70')](_0x4172('0x7a'),_0xbe4ae4[_0x4172('0x7b')],_0xbe4ae4[_0x4172('0x76')][_0x78bd55][_0x4172('0x77')],_0xbe4ae4[_0x4172('0x76')][_0x78bd55][_0x4172('0x79')],_0xbe4ae4['joins'][_0x78bd55][_0x4172('0x78')]));}}}if(_0xbe4ae4[_0x4172('0x7c')]){_0xbe4ae4['conditions']=JSON[_0x4172('0x75')](_0xbe4ae4[_0x4172('0x7c')]);_0x11fa24[_0x4172('0x3c')](_0x5bf8ed(_0xbe4ae4['conditions'][_0x4172('0x65')]));}_0x577eac=_0x11fa24[_0x4172('0x7d')]();_0x11fa24[_0x4172('0x1f')](_0x43e310);_0x11fa24[_0x4172('0x21')](0x0);logger['debug'](_0x4172('0x7e'),_0x11fa24[_0x4172('0x7f')]());return dbH['sequelize']['query'](_0x11fa24[_0x4172('0x7f')](),{'type':dbH[_0x4172('0x80')][_0x4172('0x81')][_0x4172('0x82')]});}})['then'](respondWithResult(_0x2d3c14,null))[_0x4172('0x49')](handleError(_0x2d3c14,null));};function runReport(_0x26f11a,_0x5ca8b5,_0x5a596c){var _0x570484=_0x5ca8b5[_0x4172('0x2d')];var _0x5f4a0b=0xa;var _0xd3010b=[_0x4172('0x54'),_0x4172('0x83'),_0x4172('0x55'),_0x4172('0x84')];var _0x1b8355={'SUM':'SUM(%s)','COUNT':_0x4172('0x85'),'COUNT DISTINCT':_0x4172('0x86'),'MAX':_0x4172('0x87'),'MIN':_0x4172('0x57'),'AVG':_0x4172('0x88'),'GROUP_CONCAT':_0x4172('0x58'),'GROUP_CONCAT ASC':_0x4172('0x59'),'GROUP_CONCAT DESC':_0x4172('0x5a')};var _0x1a4289={'SEC_TO_TIME':_0x4172('0x89'),'DATE':_0x4172('0x5b'),'HOUR':_0x4172('0x8a'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4172('0x5d')};var _0x1f974e=function(_0x552d39){return!_[_0x4172('0x5e')](['IS\x20NULL',_0x4172('0x60'),_0x4172('0x61'),_0x4172('0x62')],_0x552d39);};var _0x163ace=function(_0x39de52){if(!_0x39de52||!_0x39de52['rules'][_0x4172('0x37')]){return'';}for(var _0x4d61c2='(',_0x444c63=0x0;_0x444c63<_0x39de52[_0x4172('0x63')][_0x4172('0x37')];_0x444c63+=0x1){_0x444c63>0x0&&(_0x4d61c2+='\x20'+_0x39de52[_0x4172('0x64')]+'\x20');_0x4d61c2+=_0x39de52[_0x4172('0x63')][_0x444c63][_0x4172('0x65')]?_0x163ace(_0x39de52[_0x4172('0x63')][_0x444c63][_0x4172('0x65')]):_0x39de52[_0x4172('0x63')][_0x444c63][_0x4172('0x66')]+'\x20'+_0x39de52[_0x4172('0x63')][_0x444c63][_0x4172('0x67')]+(_0x1f974e(_0x39de52[_0x4172('0x63')][_0x444c63][_0x4172('0x67')])?'\x20'+_0x39de52[_0x4172('0x63')][_0x444c63][_0x4172('0x68')]:'');}return _0x4d61c2+')';};var _0x59f033={'where':{'id':_0x26f11a['id']}},_0x42a59d,_0x3fbbae,_0x14df14,_0x80e2fc,_0x4d0505;_0x59f033=_['merge']({},_0x59f033,_0x5a596c);return db['AnalyticCustomReport'][_0x4172('0x4f')](_0x59f033)[_0x4172('0x25')](function(_0x201eb6){if(_0x201eb6){_0x42a59d=_0x201eb6;return _0x201eb6['getFields']();}return null;})[_0x4172('0x25')](function(_0x7f8624){if(_0x7f8624){if(!_0x7f8624['length']){throw new db[(_0x4172('0x8b'))]['ValidationErrorItem'](_0x4172('0x8c'),0x193);}_0x3fbbae=_0x7f8624;return db[_0x4172('0x6a')][_0x4172('0x45')]({'raw':!![]});}return null;})['then'](function(_0x3a7264){if(_0x3a7264){_0x14df14=_[_0x4172('0x6b')](_0x3a7264,'id');var _0x2b57e9;var _0x47b6df=squel[_0x4172('0x8d')]();_0x47b6df['from'](_0x42a59d[_0x4172('0x7b')]);for(var _0x2a1e7f=0x0;_0x2a1e7f<_0x3fbbae[_0x4172('0x37')];_0x2a1e7f+=0x1){_0x2b57e9=_0x3fbbae[_0x2a1e7f][_0x4172('0x6d')]?_0x14df14[_0x3fbbae[_0x2a1e7f][_0x4172('0x6d')]][_0x4172('0x8e')]:_0x3fbbae[_0x2a1e7f]['field'];_0x2b57e9=_0x3fbbae[_0x2a1e7f][_0x4172('0x6e')]?_['replace'](_0x1b8355[_0x3fbbae[_0x2a1e7f]['function']],'%s',_0x2b57e9):_0x2b57e9;_0x2b57e9=_0x3fbbae[_0x2a1e7f]['format']?_[_0x4172('0x6f')](_0x1a4289[_0x3fbbae[_0x2a1e7f][_0x4172('0x70')]],'%s',_0x2b57e9):_0x2b57e9;if(_0x3fbbae[_0x2a1e7f][_0x4172('0x71')]){_0x47b6df['group'](_0x2b57e9);}_0x3fbbae[_0x2a1e7f][_0x4172('0x72')]&&_0x47b6df[_0x4172('0x3a')](_0x2b57e9,_0x3fbbae[_0x2a1e7f][_0x4172('0x72')]===_0x4172('0x73')?![]:!![]);_0x47b6df[_0x4172('0x66')](_0x2b57e9,_0x3fbbae[_0x2a1e7f][_0x4172('0x74')]||_0x2b57e9);}if(_0x42a59d[_0x4172('0x76')]){_0x42a59d[_0x4172('0x76')]=JSON[_0x4172('0x75')](_0x42a59d[_0x4172('0x76')]);for(var _0xde2803=0x0;_0xde2803<_0x42a59d[_0x4172('0x76')][_0x4172('0x37')];_0xde2803+=0x1){if(_0x42a59d[_0x4172('0x76')][_0xde2803][_0x4172('0x30')]&&_['includes'](_0xd3010b,_0x42a59d[_0x4172('0x76')][_0xde2803][_0x4172('0x30')])&&_0x42a59d[_0x4172('0x76')][_0xde2803][_0x4172('0x77')]&&_0x42a59d['joins'][_0xde2803][_0x4172('0x79')]&&_0x42a59d[_0x4172('0x76')][_0xde2803][_0x4172('0x78')]){_0x47b6df[_0x42a59d['joins'][_0xde2803][_0x4172('0x30')]](_0x42a59d[_0x4172('0x76')][_0xde2803][_0x4172('0x79')],null,util[_0x4172('0x70')]('%s.%s\x20=\x20%s.%s',_0x42a59d[_0x4172('0x7b')],_0x42a59d[_0x4172('0x76')][_0xde2803]['parentKey'],_0x42a59d[_0x4172('0x76')][_0xde2803]['foreignTable'],_0x42a59d[_0x4172('0x76')][_0xde2803]['foreignKey']));}}}if(_0x42a59d['conditions']){_0x42a59d['conditions']=JSON[_0x4172('0x75')](_0x42a59d['conditions']);_0x47b6df[_0x4172('0x3c')](_0x163ace(_0x42a59d['conditions']['group']));}_0x4d0505=_0x47b6df['clone']();_0x47b6df['limit'](_0x5f4a0b);_0x47b6df[_0x4172('0x21')](0x0);return;}})[_0x4172('0x25')](function(){if(_0x5ca8b5[_0x4172('0x8f')]===_0x4172('0x90')){return null;}var _0x317859=_[_0x4172('0x3e')](_0x5ca8b5,{'name':_0x5ca8b5[_0x4172('0x91')]||_0x5ca8b5[_0x4172('0x2d')]||_0x42a59d[_0x4172('0x2d')],'basename':_0x570484,'savename':util[_0x4172('0x70')](_0x4172('0x92'),_0x5ca8b5['name']||_0x42a59d[_0x4172('0x2d')],require(_0x4172('0x93'))['generate'](0x4),_0x5ca8b5[_0x4172('0x8f')]||_0x4172('0x94')),'reportId':_0x42a59d['id'],'reportType':_0x4172('0x95')});return db[_0x4172('0x96')][_0x4172('0x4a')](_0x317859,{'raw':!![]});})[_0x4172('0x25')](function(_0x4c9273){if(_0x42a59d[_0x4172('0x7b')]===_0x4172('0x97')){_0x4d0505[_0x4172('0x3c')](_0x42a59d['table']+_0x4172('0x98'),_0x5ca8b5['startDate'],_0x5ca8b5[_0x4172('0x99')]);}else{_0x4d0505['where'](_0x42a59d['table']+_0x4172('0x9a'),_0x5ca8b5[_0x4172('0x9b')],_0x5ca8b5[_0x4172('0x99')]);}if(_0x4c9273){logger['info'](_0x4172('0x9c'),_0x4d0505['toString']());require('child_process')['fork'](path[_0x4172('0x54')](__dirname,_0x4172('0x9d'),_0x4c9273[_0x4172('0x8f')]),[_0x4c9273['id'],_0x4d0505['toString'](),path['join'](__dirname,_0x4172('0x9e'),_0x4c9273[_0x4172('0x9f')]),_0x570484]);return _0x4c9273;}else{var _0x2f6173=squel[_0x4172('0x8d')]();_0x2f6173[_0x4172('0x6c')]('('+_0x4d0505['toString']()+')','countTable');_0x2f6173[_0x4172('0x66')](_0x4172('0xa0'),_0x4172('0x20'));_0x4d0505[_0x4172('0x1f')](_0x5ca8b5[_0x4172('0x1f')]||_0x5f4a0b);_0x4d0505[_0x4172('0x21')](_0x5ca8b5[_0x4172('0x21')]||0x0);return dbH['sequelize'][_0x4172('0x32')](_0x2f6173[_0x4172('0x7f')](),{'type':dbH[_0x4172('0x80')][_0x4172('0x81')][_0x4172('0x82')]})[_0x4172('0x25')](function(_0x405438){if(!_0x405438[_0x4172('0x37')]){_0x80e2fc=0x0;}else{_0x80e2fc=_0x405438[0x0]['count']||0x0;}return dbH[_0x4172('0x80')][_0x4172('0x32')](_0x4d0505[_0x4172('0x7f')](),{'type':dbH[_0x4172('0x80')][_0x4172('0x81')][_0x4172('0x82')]});})[_0x4172('0x25')](function(_0x19bf7b){return{'rows':_0x19bf7b||[],'count':_0x80e2fc};});}});}exports['run']=function(_0x5c30ac,_0x13ce1a){return runReport(_0x5c30ac[_0x4172('0x46')],_0x5c30ac[_0x4172('0x32')],_0x5c30ac[_0x4172('0x41')])[_0x4172('0x25')](respondWithResult(_0x13ce1a,null))[_0x4172('0x49')](handleError(_0x13ce1a,null));};exports['runReport']=runReport;exports['query']=function(_0x1c3236,_0x2dba19){var _0x1d4e30=0xa;var _0x42039d=[_0x4172('0x54'),_0x4172('0x83'),_0x4172('0x55'),_0x4172('0x84')];var _0x1a6172={'SUM':_0x4172('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x4172('0x87'),'MIN':_0x4172('0x57'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4172('0x58'),'GROUP_CONCAT ASC':_0x4172('0x59'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x9b9012={'SEC_TO_TIME':_0x4172('0x89'),'DATE':_0x4172('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0x4172('0x5c'),'UNIX_TIMESTAMP':_0x4172('0x5d')};var _0x33173e=function(_0x790af4){return!_[_0x4172('0x5e')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x4172('0x61'),_0x4172('0x62')],_0x790af4);};var _0x401456=function(_0x465ac7){if(!_0x465ac7||!_0x465ac7[_0x4172('0x63')]['length']){return'';}for(var _0x2aa463='(',_0x4f286a=0x0;_0x4f286a<_0x465ac7[_0x4172('0x63')][_0x4172('0x37')];_0x4f286a+=0x1){_0x4f286a>0x0&&(_0x2aa463+='\x20'+_0x465ac7[_0x4172('0x64')]+'\x20');_0x2aa463+=_0x465ac7['rules'][_0x4f286a][_0x4172('0x65')]?_0x401456(_0x465ac7[_0x4172('0x63')][_0x4f286a]['group']):_0x465ac7[_0x4172('0x63')][_0x4f286a]['field']+'\x20'+_0x465ac7[_0x4172('0x63')][_0x4f286a][_0x4172('0x67')]+(_0x33173e(_0x465ac7[_0x4172('0x63')][_0x4f286a][_0x4172('0x67')])?'\x20'+_0x465ac7[_0x4172('0x63')][_0x4f286a][_0x4172('0x68')]:'');}return _0x2aa463+')';};var _0x448196={'where':{'id':_0x1c3236['params']['id']}},_0x30547d,_0x56d99c,_0x43ea70,_0xef1cd4,_0x729cd7;_0x448196=_[_0x4172('0x3e')]({},_0x448196,_0x1c3236[_0x4172('0x41')]);return db[_0x4172('0x42')][_0x4172('0x4f')](_0x448196)[_0x4172('0x25')](function(_0x1ef1b9){if(_0x1ef1b9){_0x30547d=_0x1ef1b9;return _0x1ef1b9[_0x4172('0xa1')]();}return null;})[_0x4172('0x25')](function(_0x5b03e8){if(_0x5b03e8){if(!_0x5b03e8[_0x4172('0x37')]){throw new db[(_0x4172('0x8b'))][(_0x4172('0x69'))](_0x4172('0x8c'),0x193);}_0x56d99c=_0x5b03e8;return db[_0x4172('0x6a')][_0x4172('0x45')]({'raw':!![]});}return null;})[_0x4172('0x25')](function(_0x3fdcba){if(_0x3fdcba){_0x43ea70=_['keyBy'](_0x3fdcba,'id');var _0x44c1b7;var _0x47e9bd=squel['select']();_0x47e9bd[_0x4172('0x6c')](_0x30547d[_0x4172('0x7b')]);for(var _0x16aaaf=0x0;_0x16aaaf<_0x56d99c[_0x4172('0x37')];_0x16aaaf+=0x1){_0x44c1b7=_0x56d99c[_0x16aaaf][_0x4172('0x6d')]?_0x43ea70[_0x56d99c[_0x16aaaf][_0x4172('0x6d')]][_0x4172('0x8e')]:_0x56d99c[_0x16aaaf][_0x4172('0x66')];_0x44c1b7=_0x56d99c[_0x16aaaf]['function']?_['replace'](_0x1a6172[_0x56d99c[_0x16aaaf][_0x4172('0x6e')]],'%s',_0x44c1b7):_0x44c1b7;_0x44c1b7=_0x56d99c[_0x16aaaf][_0x4172('0x70')]?_[_0x4172('0x6f')](_0x9b9012[_0x56d99c[_0x16aaaf][_0x4172('0x70')]],'%s',_0x44c1b7):_0x44c1b7;if(_0x56d99c[_0x16aaaf]['groupBy']){_0x47e9bd['group'](_0x44c1b7);}_0x56d99c[_0x16aaaf]['orderBy']&&_0x47e9bd[_0x4172('0x3a')](_0x44c1b7,_0x56d99c[_0x16aaaf][_0x4172('0x72')]===_0x4172('0x73')?![]:!![]);_0x47e9bd[_0x4172('0x66')](_0x44c1b7,_0x56d99c[_0x16aaaf][_0x4172('0x74')]||_0x44c1b7);}if(_0x30547d['joins']){_0x30547d['joins']=JSON[_0x4172('0x75')](_0x30547d[_0x4172('0x76')]);for(var _0x22d006=0x0;_0x22d006<_0x30547d[_0x4172('0x76')][_0x4172('0x37')];_0x22d006+=0x1){if(_0x30547d[_0x4172('0x76')][_0x22d006][_0x4172('0x30')]&&_[_0x4172('0x5e')](_0x42039d,_0x30547d[_0x4172('0x76')][_0x22d006][_0x4172('0x30')])&&_0x30547d[_0x4172('0x76')][_0x22d006][_0x4172('0x77')]&&_0x30547d[_0x4172('0x76')][_0x22d006]['foreignTable']&&_0x30547d[_0x4172('0x76')][_0x22d006][_0x4172('0x78')]){_0x47e9bd[_0x30547d['joins'][_0x22d006][_0x4172('0x30')]](_0x30547d[_0x4172('0x76')][_0x22d006][_0x4172('0x79')],null,util['format'](_0x4172('0x7a'),_0x30547d[_0x4172('0x7b')],_0x30547d[_0x4172('0x76')][_0x22d006][_0x4172('0x77')],_0x30547d[_0x4172('0x76')][_0x22d006][_0x4172('0x79')],_0x30547d[_0x4172('0x76')][_0x22d006][_0x4172('0x78')]));}}}if(_0x30547d['conditions']){_0x30547d[_0x4172('0x7c')]=JSON[_0x4172('0x75')](_0x30547d[_0x4172('0x7c')]);_0x47e9bd[_0x4172('0x3c')](_0x401456(_0x30547d['conditions']['group']));}_0x729cd7=_0x47e9bd[_0x4172('0x7d')]();_0x47e9bd[_0x4172('0x1f')](_0x1d4e30);_0x47e9bd[_0x4172('0x21')](0x0);logger[_0x4172('0xa2')]('Limited\x20Query:',_0x47e9bd[_0x4172('0x7f')]());return dbH[_0x4172('0x80')][_0x4172('0x32')](_0x47e9bd[_0x4172('0x7f')](),{'type':dbH[_0x4172('0x80')][_0x4172('0x81')][_0x4172('0x82')]});}})['then'](function(){return{'sql':_0x729cd7[_0x4172('0x7f')]()};})['then'](respondWithResult(_0x2dba19,null))[_0x4172('0x49')](handleError(_0x2dba19,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 28c51f3..4a4eaf4 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 _0xbeab=['../../config/logger','api','bluebird','path','../../config/environment','exports','define','analytics_custom_reports','lodash','util'];(function(_0x23d521,_0x5aaab6){var _0x13ed95=function(_0x5d6874){while(--_0x5d6874){_0x23d521['push'](_0x23d521['shift']());}};_0x13ed95(++_0x5aaab6);}(_0xbeab,0x198));var _0xbbea=function(_0x3dad23,_0x2a41b5){_0x3dad23=_0x3dad23-0x0;var _0x24b0cb=_0xbeab[_0x3dad23];return _0x24b0cb;};'use strict';var _=require(_0xbbea('0x0'));var util=require(_0xbbea('0x1'));var logger=require(_0xbbea('0x2'))(_0xbbea('0x3'));var moment=require('moment');var BPromise=require(_0xbbea('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbbea('0x5'));var rimraf=require('rimraf');var config=require(_0xbbea('0x6'));var attributes=require('./analyticCustomReport.attributes');module[_0xbbea('0x7')]=function(_0x1d302b,_0x54c899){return _0x1d302b[_0xbbea('0x8')]('AnalyticCustomReport',attributes,{'tableName':_0xbbea('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2800=['request-promise','rimraf','exports','define','AnalyticCustomReport','analytics_custom_reports','util','../../config/logger','moment','bluebird'];(function(_0x267446,_0x12abbb){var _0x19a3dc=function(_0x308966){while(--_0x308966){_0x267446['push'](_0x267446['shift']());}};_0x19a3dc(++_0x12abbb);}(_0x2800,0xba));var _0x0280=function(_0x531822,_0x15c292){_0x531822=_0x531822-0x0;var _0x455533=_0x2800[_0x531822];return _0x455533;};'use strict';var _=require('lodash');var util=require(_0x0280('0x0'));var logger=require(_0x0280('0x1'))('api');var moment=require(_0x0280('0x2'));var BPromise=require(_0x0280('0x3'));var rp=require(_0x0280('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0280('0x5'));var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module[_0x0280('0x6')]=function(_0x75a1ec,_0x3c05b9){return _0x75a1ec[_0x0280('0x7')](_0x0280('0x8'),attributes,{'tableName':_0x0280('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 19f07aa..408065a 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 _0x56db=['stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s'];(function(_0x36e0ef,_0x310e21){var _0x35d366=function(_0x461cbf){while(--_0x461cbf){_0x36e0ef['push'](_0x36e0ef['shift']());}};_0x35d366(++_0x310e21);}(_0x56db,0xed));var _0xb56d=function(_0x2d873a,_0x4656a0){_0x2d873a=_0x2d873a-0x0;var _0x4e45b9=_0x56db[_0x2d873a];return _0x4e45b9;};'use strict';var _=require(_0xb56d('0x0'));var util=require(_0xb56d('0x1'));var moment=require(_0xb56d('0x2'));var BPromise=require(_0xb56d('0x3'));var rs=require(_0xb56d('0x4'));var fs=require('fs');var Redis=require(_0xb56d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb56d('0x6'));var logger=require('../../config/logger')(_0xb56d('0x7'));var config=require(_0xb56d('0x8'));var jayson=require(_0xb56d('0x9'));var client=jayson['client'][_0xb56d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ebcca,_0x2b29e3,_0x1f665b){return new BPromise(function(_0x4fd914,_0x3a5491){return client['request'](_0x5ebcca,_0x1f665b)[_0xb56d('0xb')](function(_0x205623){logger['info'](_0xb56d('0xc'),_0x2b29e3,_0xb56d('0xd'));logger[_0xb56d('0xe')](_0xb56d('0xf'),_0x2b29e3,_0xb56d('0xd'),JSON[_0xb56d('0x10')](_0x205623));if(_0x205623[_0xb56d('0x11')]){if(_0x205623['error'][_0xb56d('0x12')]===0x1f4){logger[_0xb56d('0x11')](_0xb56d('0xc'),_0x2b29e3,_0x205623[_0xb56d('0x11')][_0xb56d('0x13')]);return _0x3a5491(_0x205623['error'][_0xb56d('0x13')]);}logger[_0xb56d('0x11')](_0xb56d('0xc'),_0x2b29e3,_0x205623[_0xb56d('0x11')][_0xb56d('0x13')]);return _0x4fd914(_0x205623[_0xb56d('0x11')][_0xb56d('0x13')]);}else{logger[_0xb56d('0x14')](_0xb56d('0xc'),_0x2b29e3,_0xb56d('0xd'));_0x4fd914(_0x205623[_0xb56d('0x15')][_0xb56d('0x13')]);}})[_0xb56d('0x16')](function(_0x477dd7){logger[_0xb56d('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2b29e3,_0x477dd7);_0x3a5491(_0x477dd7);});});}
\ No newline at end of file
+var _0xed89=['jayson/promise','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x3a1dec,_0x1f943f){var _0x60ede0=function(_0x285fd5){while(--_0x285fd5){_0x3a1dec['push'](_0x3a1dec['shift']());}};_0x60ede0(++_0x1f943f);}(_0xed89,0x140));var _0x9ed8=function(_0x5b0f9c,_0x11b8a5){_0x5b0f9c=_0x5b0f9c-0x0;var _0x265bc3=_0xed89[_0x5b0f9c];return _0x265bc3;};'use strict';var _=require(_0x9ed8('0x0'));var util=require(_0x9ed8('0x1'));var moment=require(_0x9ed8('0x2'));var BPromise=require(_0x9ed8('0x3'));var rs=require(_0x9ed8('0x4'));var fs=require('fs');var Redis=require(_0x9ed8('0x5'));var db=require(_0x9ed8('0x6'))['db'];var utils=require(_0x9ed8('0x7'));var logger=require('../../config/logger')(_0x9ed8('0x8'));var config=require(_0x9ed8('0x9'));var jayson=require(_0x9ed8('0xa'));var client=jayson['client'][_0x9ed8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c0ead,_0x51b64a,_0x336ed0){return new BPromise(function(_0x19a7d7,_0x3df7dd){return client[_0x9ed8('0xc')](_0x1c0ead,_0x336ed0)[_0x9ed8('0xd')](function(_0x539420){logger['info'](_0x9ed8('0xe'),_0x51b64a,_0x9ed8('0xf'));logger[_0x9ed8('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x51b64a,_0x9ed8('0xf'),JSON['stringify'](_0x539420));if(_0x539420[_0x9ed8('0x11')]){if(_0x539420['error'][_0x9ed8('0x12')]===0x1f4){logger[_0x9ed8('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x51b64a,_0x539420[_0x9ed8('0x11')][_0x9ed8('0x13')]);return _0x3df7dd(_0x539420['error'][_0x9ed8('0x13')]);}logger[_0x9ed8('0x11')](_0x9ed8('0xe'),_0x51b64a,_0x539420[_0x9ed8('0x11')]['message']);return _0x19a7d7(_0x539420[_0x9ed8('0x11')][_0x9ed8('0x13')]);}else{logger[_0x9ed8('0x14')](_0x9ed8('0xe'),_0x51b64a,_0x9ed8('0xf'));_0x19a7d7(_0x539420[_0x9ed8('0x15')]['message']);}})['catch'](function(_0x577b13){logger[_0x9ed8('0x11')](_0x9ed8('0xe'),_0x51b64a,_0x577b13);_0x3df7dd(_0x577b13);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 7406e45..5af133d 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 _0xa64e=['../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','create','put','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x26b1ff,_0x4dea7c){var _0x502074=function(_0x54731a){while(--_0x54731a){_0x26b1ff['push'](_0x26b1ff['shift']());}};_0x502074(++_0x4dea7c);}(_0xa64e,0x131));var _0xea64=function(_0x211b80,_0x5cb5fa){_0x211b80=_0x211b80-0x0;var _0x1c3037=_0xa64e[_0x211b80];return _0x1c3037;};'use strict';var multer=require('multer');var util=require(_0xea64('0x0'));var path=require(_0xea64('0x1'));var timeout=require(_0xea64('0x2'));var express=require(_0xea64('0x3'));var router=express[_0xea64('0x4')]();var fs_extra=require(_0xea64('0x5'));var auth=require(_0xea64('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xea64('0x7'));var controller=require(_0xea64('0x8'));router[_0xea64('0x9')]('/',auth[_0xea64('0xa')](),controller[_0xea64('0xb')]);router[_0xea64('0x9')](_0xea64('0xc'),auth[_0xea64('0xa')](),controller[_0xea64('0xd')]);router['get'](_0xea64('0xe'),auth['isAuthenticated'](),controller[_0xea64('0xf')]);router[_0xea64('0x9')](_0xea64('0x10'),auth[_0xea64('0xa')](),controller[_0xea64('0x11')]);router[_0xea64('0x9')](_0xea64('0x12'),auth['isAuthenticated'](),controller[_0xea64('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0xea64('0x14')]);router[_0xea64('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xea64('0x16')]);router['delete'](_0xea64('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xea64('0x17')]=router;
\ No newline at end of file
+var _0x2923=['update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','/:id'];(function(_0x78c164,_0x559f15){var _0x5c51e9=function(_0x5de669){while(--_0x5de669){_0x78c164['push'](_0x78c164['shift']());}};_0x5c51e9(++_0x559f15);}(_0x2923,0x19b));var _0x3292=function(_0x1be67a,_0x35bf66){_0x1be67a=_0x1be67a-0x0;var _0x42d454=_0x2923[_0x1be67a];return _0x42d454;};'use strict';var multer=require('multer');var util=require(_0x3292('0x0'));var path=require(_0x3292('0x1'));var timeout=require(_0x3292('0x2'));var express=require(_0x3292('0x3'));var router=express[_0x3292('0x4')]();var fs_extra=require(_0x3292('0x5'));var auth=require(_0x3292('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3292('0x7'));var controller=require(_0x3292('0x8'));router[_0x3292('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x3292('0xa')](),controller[_0x3292('0xb')]);router[_0x3292('0x9')](_0x3292('0xc'),auth[_0x3292('0xa')](),controller[_0x3292('0xd')]);router[_0x3292('0x9')](_0x3292('0xe'),auth['isAuthenticated'](),controller[_0x3292('0xf')]);router[_0x3292('0x9')](_0x3292('0x10'),auth[_0x3292('0xa')](),controller[_0x3292('0x11')]);router[_0x3292('0x12')]('/',auth['isAuthenticated'](),controller[_0x3292('0x13')]);router['put'](_0x3292('0x14'),auth[_0x3292('0xa')](),controller[_0x3292('0x15')]);router[_0x3292('0x16')](_0x3292('0x14'),auth[_0x3292('0xa')](),controller[_0x3292('0x17')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index e70bf2b..b66c64f 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 _0x7217=['sequelize','STRING','TEXT'];(function(_0x505457,_0x183165){var _0x596444=function(_0x1f7238){while(--_0x1f7238){_0x505457['push'](_0x505457['shift']());}};_0x596444(++_0x183165);}(_0x7217,0x19e));var _0x7721=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x7217[_0x92c450];return _0x2a9599;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'name':{'type':Sequelize[_0x7721('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7721('0x1')]},'parent':{'type':Sequelize[_0x7721('0x1')]},'table':{'type':Sequelize[_0x7721('0x1')]},'conditions':{'type':Sequelize[_0x7721('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x9c5a=['exports','STRING','TEXT','sequelize'];(function(_0x3d1246,_0x23fef1){var _0x5b5f3d=function(_0x423c74){while(--_0x423c74){_0x3d1246['push'](_0x3d1246['shift']());}};_0x5b5f3d(++_0x23fef1);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x49e536,_0x2c04e6){_0x49e536=_0x49e536-0x0;var _0x57638a=_0x9c5a[_0x49e536];return _0x57638a;};'use strict';var Sequelize=require(_0xa9c5('0x0'));module[_0xa9c5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa9c5('0x2')]},'parent':{'type':Sequelize[_0xa9c5('0x2')]},'table':{'type':Sequelize[_0xa9c5('0x2')]},'conditions':{'type':Sequelize[_0xa9c5('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index f933401..e0bec2d 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 _0x2675=['AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','VIRTUAL','merge','options','includeAll','include','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','select','table','MetricId','metric','field','function','replace','format','groupBy','order','orderBy','DESC','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','IS\x20EMPTY','Sequelize','keyBy','from','alias','output','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','COUNT(*)','SELECT','run','runReport','MIN(%s)','debug','eml-format','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','get','DefaultReports','name','map'];(function(_0x7f537e,_0x2757d3){var _0x386a50=function(_0x535748){while(--_0x535748){_0x7f537e['push'](_0x7f537e['shift']());}};_0x386a50(++_0x2757d3);}(_0x2675,0x75));var _0x5267=function(_0xebaa92,_0x5bacb2){_0xebaa92=_0xebaa92-0x0;var _0x1f2153=_0x2675[_0xebaa92];return _0x1f2153;};'use strict';var emlformat=require(_0x5267('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5267('0x1'));var moment=require(_0x5267('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5267('0x3'));var util=require(_0x5267('0x4'));var path=require('path');var sox=require(_0x5267('0x5'));var csv=require(_0x5267('0x6'));var ejs=require(_0x5267('0x7'));var fs=require('fs');var fs_extra=require(_0x5267('0x8'));var _=require(_0x5267('0x9'));var squel=require(_0x5267('0xa'));var crypto=require('crypto');var jsforce=require(_0x5267('0xb'));var deskjs=require(_0x5267('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5267('0xd'));var Papa=require('papaparse');var Redis=require(_0x5267('0xe'));var authService=require(_0x5267('0xf'));var qs=require(_0x5267('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5267('0x11'));var logger=require('../../config/logger')(_0x5267('0x12'));var utils=require('../../config/utils');var config=require(_0x5267('0x13'));var licenseUtil=require(_0x5267('0x14'));var db=require(_0x5267('0x15'))['db'];var dbH=require(_0x5267('0x15'))[_0x5267('0x16')];function respondWithStatusCode(_0x1171b9,_0x20785c){_0x20785c=_0x20785c||0xcc;return function(_0x36dc17){if(_0x36dc17){return _0x1171b9[_0x5267('0x17')](_0x20785c);}return _0x1171b9[_0x5267('0x18')](_0x20785c)[_0x5267('0x19')]();};}function respondWithResult(_0x29349a,_0x3e2bab){_0x3e2bab=_0x3e2bab||0xc8;return function(_0x548040){if(_0x548040){return _0x29349a['status'](_0x3e2bab)[_0x5267('0x1a')](_0x548040);}};}function respondWithFilteredResult(_0x40d897,_0x38a147){return function(_0x3f5344){if(_0x3f5344){var _0x46b2c2=typeof _0x38a147[_0x5267('0x1b')]===_0x5267('0x1c')&&typeof _0x38a147[_0x5267('0x1d')]===_0x5267('0x1c');var _0xb1c97a=_0x3f5344[_0x5267('0x1e')];var _0x1ab03=_0x46b2c2?0x0:_0x38a147['offset'];var _0x18f32e=_0x46b2c2?_0x3f5344[_0x5267('0x1e')]:_0x38a147['offset']+_0x38a147[_0x5267('0x1d')];var _0x56733e;if(_0x18f32e>=_0xb1c97a){_0x18f32e=_0xb1c97a;_0x56733e=0xc8;}else{_0x56733e=0xce;}_0x40d897[_0x5267('0x18')](_0x56733e);return _0x40d897[_0x5267('0x1f')](_0x5267('0x20'),_0x1ab03+'-'+_0x18f32e+'/'+_0xb1c97a)[_0x5267('0x1a')](_0x3f5344);}return null;};}function patchUpdates(_0x5ca9c6){return function(_0x4dd637){try{jsonpatch[_0x5267('0x21')](_0x4dd637,_0x5ca9c6,!![]);}catch(_0x5aebdd){return BPromise[_0x5267('0x22')](_0x5aebdd);}return _0x4dd637[_0x5267('0x23')]();};}function saveUpdates(_0x3b53ac,_0x56dd95){return function(_0x499f19){if(_0x499f19){return _0x499f19['update'](_0x3b53ac)['then'](function(_0x5ea6a6){return _0x5ea6a6;});}return null;};}function removeEntity(_0x26c7f8,_0x399e64){return function(_0x2d761d){if(_0x2d761d){return _0x2d761d[_0x5267('0x24')]()[_0x5267('0x25')](function(){var _0x40d1be=_0x2d761d[_0x5267('0x26')]({'plain':!![]});var _0x220e03=_0x5267('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x220e03,'resourceId':_0x40d1be['id']}})[_0x5267('0x25')](function(){return _0x2d761d;});})[_0x5267('0x25')](function(){_0x26c7f8['status'](0xcc)[_0x5267('0x19')]();});}};}function handleEntityNotFound(_0x52504e,_0x4d7c2a){return function(_0x43e7e7){if(!_0x43e7e7){_0x52504e[_0x5267('0x17')](0x194);}return _0x43e7e7;};}function handleError(_0x1f33b7,_0x2d2ace){_0x2d2ace=_0x2d2ace||0x1f4;return function(_0x33c431){logger['error'](_0x33c431['stack']);if(_0x33c431[_0x5267('0x28')]){delete _0x33c431[_0x5267('0x28')];}_0x1f33b7[_0x5267('0x18')](_0x2d2ace)['send'](_0x33c431);};}exports['index']=function(_0xbe7922,_0x3ef2a8){var _0x1fa725={},_0x5bec7e={},_0x59b091={'count':0x0,'rows':[]};var _0x2249a1=_[_0x5267('0x29')](db[_0x5267('0x2a')][_0x5267('0x2b')],function(_0x5bbb83){return{'name':_0x5bbb83[_0x5267('0x2c')],'type':_0x5bbb83[_0x5267('0x2d')][_0x5267('0x2e')]};});_0x5bec7e[_0x5267('0x2f')]=_[_0x5267('0x29')](_0x2249a1,_0x5267('0x28'));_0x5bec7e[_0x5267('0x30')]=_[_0x5267('0x31')](_0xbe7922['query']);_0x5bec7e['filters']=_[_0x5267('0x32')](_0x5bec7e['model'],_0x5bec7e[_0x5267('0x30')]);_0x1fa725[_0x5267('0x33')]=_[_0x5267('0x32')](_0x5bec7e[_0x5267('0x2f')],qs['fields'](_0xbe7922[_0x5267('0x30')][_0x5267('0x34')]));_0x1fa725[_0x5267('0x33')]=_0x1fa725[_0x5267('0x33')][_0x5267('0x35')]?_0x1fa725[_0x5267('0x33')]:_0x5bec7e[_0x5267('0x2f')];if(!_0xbe7922[_0x5267('0x30')]['hasOwnProperty'](_0x5267('0x36'))){_0x1fa725['limit']=qs[_0x5267('0x1d')](_0xbe7922[_0x5267('0x30')][_0x5267('0x1d')]);_0x1fa725[_0x5267('0x1b')]=qs[_0x5267('0x1b')](_0xbe7922[_0x5267('0x30')][_0x5267('0x1b')]);}_0x1fa725['order']=qs[_0x5267('0x37')](_0xbe7922[_0x5267('0x30')][_0x5267('0x37')]);_0x1fa725[_0x5267('0x38')]=qs[_0x5267('0x39')](_[_0x5267('0x3a')](_0xbe7922[_0x5267('0x30')],_0x5bec7e['filters']),_0x2249a1);if(_0xbe7922[_0x5267('0x30')]['filter']){_0x1fa725[_0x5267('0x38')]=_['merge'](_0x1fa725['where'],{'$or':_['map'](_0x2249a1,function(_0x46bfcc){if(_0x46bfcc['type']!==_0x5267('0x3b')){var _0x146476={};_0x146476[_0x46bfcc[_0x5267('0x28')]]={'$like':'%'+_0xbe7922[_0x5267('0x30')]['filter']+'%'};return _0x146476;}})});}_0x1fa725=_[_0x5267('0x3c')]({},_0x1fa725,_0xbe7922[_0x5267('0x3d')]);var _0x588edf={'where':_0x1fa725['where']};return db[_0x5267('0x2a')]['count'](_0x588edf)[_0x5267('0x25')](function(_0x1cf94a){_0x59b091[_0x5267('0x1e')]=_0x1cf94a;if(_0xbe7922[_0x5267('0x30')][_0x5267('0x3e')]){_0x1fa725[_0x5267('0x3f')]=[{'all':!![]}];}return db[_0x5267('0x2a')]['findAll'](_0x1fa725);})['then'](function(_0x28ea4a){_0x59b091['rows']=_0x28ea4a;return _0x59b091;})[_0x5267('0x25')](respondWithFilteredResult(_0x3ef2a8,_0x1fa725))[_0x5267('0x40')](handleError(_0x3ef2a8,null));};exports['show']=function(_0x1fa925,_0xc764cd){var _0x299a13={'raw':!![],'where':{'id':_0x1fa925[_0x5267('0x41')]['id']}},_0x161fed={};_0x161fed[_0x5267('0x2f')]=_[_0x5267('0x31')](db[_0x5267('0x2a')][_0x5267('0x2b')]);_0x161fed['query']=_[_0x5267('0x31')](_0x1fa925[_0x5267('0x30')]);_0x161fed[_0x5267('0x39')]=_[_0x5267('0x32')](_0x161fed[_0x5267('0x2f')],_0x161fed['query']);_0x299a13[_0x5267('0x33')]=_['intersection'](_0x161fed[_0x5267('0x2f')],qs['fields'](_0x1fa925['query'][_0x5267('0x34')]));_0x299a13['attributes']=_0x299a13[_0x5267('0x33')][_0x5267('0x35')]?_0x299a13[_0x5267('0x33')]:_0x161fed[_0x5267('0x2f')];if(_0x1fa925['query'][_0x5267('0x3e')]){_0x299a13['include']=[{'all':!![]}];}_0x299a13=_['merge']({},_0x299a13,_0x1fa925[_0x5267('0x3d')]);return db[_0x5267('0x2a')]['find'](_0x299a13)['then'](handleEntityNotFound(_0xc764cd,null))[_0x5267('0x25')](respondWithResult(_0xc764cd,null))[_0x5267('0x40')](handleError(_0xc764cd,null));};exports[_0x5267('0x42')]=function(_0x1b5a7e,_0x1c2803){return db[_0x5267('0x2a')][_0x5267('0x42')](_0x1b5a7e[_0x5267('0x43')],{})[_0x5267('0x25')](function(_0x2cfe09){var _0x21b040=_0x1b5a7e[_0x5267('0x44')][_0x5267('0x26')]({'plain':!![]});if(!_0x21b040)throw new Error(_0x5267('0x45'));if(_0x21b040['role']===_0x5267('0x44')){var _0x466d46=_0x2cfe09[_0x5267('0x26')]({'plain':!![]});var _0x4f0148=_0x5267('0x46');return db[_0x5267('0x47')][_0x5267('0x48')]({'where':{'name':_0x4f0148,'userProfileId':_0x21b040[_0x5267('0x49')]},'raw':!![]})[_0x5267('0x25')](function(_0x1457cf){if(_0x1457cf&&_0x1457cf['autoAssociation']===0x0){return db[_0x5267('0x4a')]['create']({'name':_0x466d46[_0x5267('0x28')],'resourceId':_0x466d46['id'],'type':_0x5267('0x27'),'sectionId':_0x1457cf['id']},{})[_0x5267('0x25')](function(){return _0x2cfe09;});}else{return _0x2cfe09;}})[_0x5267('0x40')](function(_0x91b932){logger[_0x5267('0x4b')](_0x5267('0x4c'),_0x91b932);throw _0x91b932;});}return _0x2cfe09;})['then'](respondWithResult(_0x1c2803,0xc9))['catch'](handleError(_0x1c2803,null));};exports[_0x5267('0x4d')]=function(_0x15b5c9,_0x566b6f){if(_0x15b5c9[_0x5267('0x43')]['id']){delete _0x15b5c9['body']['id'];}return db['AnalyticDefaultReport'][_0x5267('0x48')]({'where':{'id':_0x15b5c9[_0x5267('0x41')]['id']}})[_0x5267('0x25')](handleEntityNotFound(_0x566b6f,null))[_0x5267('0x25')](saveUpdates(_0x15b5c9[_0x5267('0x43')],null))[_0x5267('0x25')](respondWithResult(_0x566b6f,null))[_0x5267('0x40')](handleError(_0x566b6f,null));};exports[_0x5267('0x24')]=function(_0xf0b5a9,_0x43d254){return db['AnalyticDefaultReport'][_0x5267('0x48')]({'where':{'id':_0xf0b5a9[_0x5267('0x41')]['id']}})[_0x5267('0x25')](handleEntityNotFound(_0x43d254,null))[_0x5267('0x25')](removeEntity(_0x43d254,null))[_0x5267('0x40')](handleError(_0x43d254,null));};exports[_0x5267('0x4e')]=function(_0x552211,_0x195575){var _0x5ad1ce=0xa;var _0x1522d6=[_0x5267('0x4f'),_0x5267('0x50'),'right_join',_0x5267('0x51')];var _0x161dab={'SUM':_0x5267('0x52'),'COUNT':_0x5267('0x53'),'COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':'MIN(%s)','AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0x51220c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5267('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x4e3771=function(_0x489780){return!_[_0x5267('0x5d')]([_0x5267('0x5e'),_0x5267('0x5f'),'IS\x20EMPTY',_0x5267('0x60')],_0x489780);};var _0xc88193=function(_0x293e61){if(!_0x293e61||!_0x293e61[_0x5267('0x61')]['length']){return'';}for(var _0x5a87b5='(',_0x540ab8=0x0;_0x540ab8<_0x293e61[_0x5267('0x61')][_0x5267('0x35')];_0x540ab8+=0x1){_0x540ab8>0x0&&(_0x5a87b5+='\x20'+_0x293e61[_0x5267('0x62')]+'\x20');_0x5a87b5+=_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x63')]?_0xc88193(_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x63')]):_0x293e61[_0x5267('0x61')][_0x540ab8]['field']+'\x20'+_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x64')]+(_0x4e3771(_0x293e61['rules'][_0x540ab8][_0x5267('0x64')])?'\x20'+_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x65')]:'');}return _0x5a87b5+')';};var _0x1b6dd7={'where':{'id':_0x552211[_0x5267('0x41')]['id']}},_0x19adf5,_0xde1ecd,_0x4915f4,_0x2ca259,_0x726410;_0x1b6dd7=_[_0x5267('0x3c')]({},_0x1b6dd7,_0x552211[_0x5267('0x3d')]);return db[_0x5267('0x2a')]['find'](_0x1b6dd7)[_0x5267('0x25')](function(_0x87465){if(_0x87465){_0x19adf5=_0x87465;return _0x87465[_0x5267('0x66')]();}return null;})[_0x5267('0x25')](function(_0x1a4016){if(_0x1a4016){if(!_0x1a4016[_0x5267('0x35')]){throw new db['Sequelize'][(_0x5267('0x67'))](_0x5267('0x68'),0x193);}_0xde1ecd=_0x1a4016;return db[_0x5267('0x69')][_0x5267('0x6a')]({'raw':!![]});}return null;})['then'](function(_0x516e6e){if(_0x516e6e){_0x4915f4=_['keyBy'](_0x516e6e,'id');var _0x910f97;var _0x5cca85=squel[_0x5267('0x6b')]();_0x5cca85['from'](_0x19adf5[_0x5267('0x6c')]);for(var _0x1150ba=0x0;_0x1150ba<_0xde1ecd[_0x5267('0x35')];_0x1150ba+=0x1){_0x910f97=_0xde1ecd[_0x1150ba][_0x5267('0x6d')]?_0x4915f4[_0xde1ecd[_0x1150ba][_0x5267('0x6d')]][_0x5267('0x6e')]:_0xde1ecd[_0x1150ba][_0x5267('0x6f')];_0x910f97=_0xde1ecd[_0x1150ba][_0x5267('0x70')]?_['replace'](_0x161dab[_0xde1ecd[_0x1150ba]['function']],'%s',_0x910f97):_0x910f97;_0x910f97=_0xde1ecd[_0x1150ba]['format']?_[_0x5267('0x71')](_0x51220c[_0xde1ecd[_0x1150ba][_0x5267('0x72')]],'%s',_0x910f97):_0x910f97;if(_0xde1ecd[_0x1150ba][_0x5267('0x73')]){_0x5cca85[_0x5267('0x63')](_0x910f97);}_0xde1ecd[_0x1150ba]['orderBy']&&_0x5cca85[_0x5267('0x74')](_0x910f97,_0xde1ecd[_0x1150ba][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x5cca85[_0x5267('0x6f')](_0x910f97,_0xde1ecd[_0x1150ba]['alias']||_0x910f97);}if(_0x19adf5[_0x5267('0x77')]){_0x19adf5[_0x5267('0x77')]=JSON['parse'](_0x19adf5[_0x5267('0x77')]);for(var _0x268805=0x0;_0x268805<_0x19adf5['joins']['length'];_0x268805+=0x1){if(_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x2d')]&&_['includes'](_0x1522d6,_0x19adf5['joins'][_0x268805][_0x5267('0x2d')])&&_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x78')]&&_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x79')]&&_0x19adf5['joins'][_0x268805][_0x5267('0x7a')]){_0x5cca85[_0x19adf5[_0x5267('0x77')][_0x268805]['type']](_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x79')],null,util[_0x5267('0x72')](_0x5267('0x7b'),_0x19adf5[_0x5267('0x6c')],_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x78')],_0x19adf5[_0x5267('0x77')][_0x268805]['foreignTable'],_0x19adf5['joins'][_0x268805][_0x5267('0x7a')]));}}}if(_0x19adf5[_0x5267('0x7c')]){_0x19adf5[_0x5267('0x7c')]=JSON[_0x5267('0x7d')](_0x19adf5['conditions']);_0x5cca85[_0x5267('0x38')](_0xc88193(_0x19adf5['conditions'][_0x5267('0x63')]));}_0x726410=_0x5cca85[_0x5267('0x7e')]();_0x5cca85[_0x5267('0x1d')](_0x5ad1ce);_0x5cca85[_0x5267('0x1b')](0x0);logger['debug']('Limited\x20Query:',_0x5cca85[_0x5267('0x7f')]());return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x5cca85[_0x5267('0x7f')](),{'type':dbH[_0x5267('0x80')][_0x5267('0x81')]['SELECT']});}})[_0x5267('0x25')](respondWithResult(_0x195575,null))['catch'](handleError(_0x195575,null));};function runReport(_0x418a03,_0x5b8026,_0x2c2b95){var _0x20888d=_0x5b8026[_0x5267('0x28')];var _0x87aa90=0xa;var _0x164cc1=[_0x5267('0x4f'),_0x5267('0x50'),_0x5267('0x82'),_0x5267('0x51')];var _0x28e4b6={'SUM':_0x5267('0x52'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':'MIN(%s)','AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0xd18795={'SEC_TO_TIME':_0x5267('0x83'),'DATE':_0x5267('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x2543a4=function(_0x2feea8){return!_[_0x5267('0x5d')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5267('0x84'),_0x5267('0x60')],_0x2feea8);};var _0x199ff6=function(_0xbf36fb){if(!_0xbf36fb||!_0xbf36fb['rules'][_0x5267('0x35')]){return'';}for(var _0x3cc775='(',_0x2630f2=0x0;_0x2630f2<_0xbf36fb[_0x5267('0x61')][_0x5267('0x35')];_0x2630f2+=0x1){_0x2630f2>0x0&&(_0x3cc775+='\x20'+_0xbf36fb[_0x5267('0x62')]+'\x20');_0x3cc775+=_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x63')]?_0x199ff6(_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x63')]):_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x6f')]+'\x20'+_0xbf36fb[_0x5267('0x61')][_0x2630f2]['condition']+(_0x2543a4(_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x64')])?'\x20'+_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x65')]:'');}return _0x3cc775+')';};var _0x447b5f={'where':{'id':_0x418a03['id']}},_0x25ce90,_0x257c69,_0x160c9c,_0x42694a,_0x11a2f4;_0x447b5f=_[_0x5267('0x3c')]({},_0x447b5f,_0x2c2b95);return db[_0x5267('0x2a')][_0x5267('0x48')](_0x447b5f)[_0x5267('0x25')](function(_0x35c3b7){if(_0x35c3b7){_0x25ce90=_0x35c3b7;return _0x35c3b7[_0x5267('0x66')]();}return null;})[_0x5267('0x25')](function(_0x35a4a3){if(_0x35a4a3){if(!_0x35a4a3[_0x5267('0x35')]){throw new db[(_0x5267('0x85'))][(_0x5267('0x67'))](_0x5267('0x68'),0x193);}_0x257c69=_0x35a4a3;return db[_0x5267('0x69')]['findAll']({'raw':!![]});}return null;})[_0x5267('0x25')](function(_0x318393){if(_0x318393){_0x160c9c=_[_0x5267('0x86')](_0x318393,'id');var _0x405eb4;var _0x38f5b7=squel['select']();_0x38f5b7[_0x5267('0x87')](_0x25ce90[_0x5267('0x6c')]);for(var _0x4c68cd=0x0;_0x4c68cd<_0x257c69['length'];_0x4c68cd+=0x1){_0x405eb4=_0x257c69[_0x4c68cd]['MetricId']?_0x160c9c[_0x257c69[_0x4c68cd][_0x5267('0x6d')]]['metric']:_0x257c69[_0x4c68cd][_0x5267('0x6f')];_0x405eb4=_0x257c69[_0x4c68cd]['function']?_['replace'](_0x28e4b6[_0x257c69[_0x4c68cd][_0x5267('0x70')]],'%s',_0x405eb4):_0x405eb4;_0x405eb4=_0x257c69[_0x4c68cd][_0x5267('0x72')]?_[_0x5267('0x71')](_0xd18795[_0x257c69[_0x4c68cd][_0x5267('0x72')]],'%s',_0x405eb4):_0x405eb4;if(_0x257c69[_0x4c68cd][_0x5267('0x73')]){_0x38f5b7['group'](_0x405eb4);}_0x257c69[_0x4c68cd]['orderBy']&&_0x38f5b7[_0x5267('0x74')](_0x405eb4,_0x257c69[_0x4c68cd][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x38f5b7[_0x5267('0x6f')](_0x405eb4,_0x257c69[_0x4c68cd][_0x5267('0x88')]||_0x405eb4);}if(_0x25ce90['joins']){_0x25ce90[_0x5267('0x77')]=JSON['parse'](_0x25ce90['joins']);for(var _0x3dfd8d=0x0;_0x3dfd8d<_0x25ce90['joins']['length'];_0x3dfd8d+=0x1){if(_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x2d')]&&_['includes'](_0x164cc1,_0x25ce90['joins'][_0x3dfd8d]['type'])&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['parentKey']&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['foreignTable']&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x7a')]){_0x38f5b7[_0x25ce90['joins'][_0x3dfd8d][_0x5267('0x2d')]](_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x79')],null,util[_0x5267('0x72')](_0x5267('0x7b'),_0x25ce90[_0x5267('0x6c')],_0x25ce90['joins'][_0x3dfd8d]['parentKey'],_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['foreignTable'],_0x25ce90['joins'][_0x3dfd8d][_0x5267('0x7a')]));}}}if(_0x25ce90['conditions']){_0x25ce90[_0x5267('0x7c')]=JSON['parse'](_0x25ce90[_0x5267('0x7c')]);_0x38f5b7['where'](_0x199ff6(_0x25ce90[_0x5267('0x7c')][_0x5267('0x63')]));}_0x11a2f4=_0x38f5b7[_0x5267('0x7e')]();_0x38f5b7[_0x5267('0x1d')](_0x87aa90);_0x38f5b7[_0x5267('0x1b')](0x0);return;}})[_0x5267('0x25')](function(){if(_0x5b8026[_0x5267('0x89')]==='web'){return null;}var _0x4df99f=_[_0x5267('0x3c')](_0x5b8026,{'name':_0x5b8026['fullPath']||_0x5b8026['name']||_0x25ce90['name'],'basename':_0x20888d,'savename':util['format']('%s-%s.%s',_0x5b8026['name']||_0x25ce90[_0x5267('0x28')],require(_0x5267('0x8a'))[_0x5267('0x8b')](0x4),_0x5b8026[_0x5267('0x89')]||_0x5267('0x8c')),'reportId':_0x25ce90['id'],'reportType':_0x5267('0x8d')});return db[_0x5267('0x8e')][_0x5267('0x42')](_0x4df99f,{'raw':!![]});})['then'](function(_0x5df23d){if(_0x25ce90['table']===_0x5267('0x8f')){_0x11a2f4[_0x5267('0x38')](_0x25ce90['table']+_0x5267('0x90'),_0x5b8026[_0x5267('0x91')],_0x5b8026[_0x5267('0x92')]);}else{_0x11a2f4[_0x5267('0x38')](_0x25ce90['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b8026[_0x5267('0x91')],_0x5b8026[_0x5267('0x92')]);}if(_0x5df23d){logger[_0x5267('0x93')](_0x5267('0x94'),_0x11a2f4[_0x5267('0x7f')]());require(_0x5267('0x95'))[_0x5267('0x96')](path['join'](__dirname,'../../components/export/',_0x5df23d['output']),[_0x5df23d['id'],_0x11a2f4[_0x5267('0x7f')](),path[_0x5267('0x4f')](__dirname,_0x5267('0x97'),_0x5df23d[_0x5267('0x98')]),_0x20888d]);return _0x5df23d;}else{var _0x190ef4=squel[_0x5267('0x6b')]();_0x190ef4['from']('('+_0x11a2f4[_0x5267('0x7f')]()+')','countTable');_0x190ef4[_0x5267('0x6f')](_0x5267('0x99'),_0x5267('0x1e'));_0x11a2f4[_0x5267('0x1d')](_0x5b8026[_0x5267('0x1d')]||_0x87aa90);_0x11a2f4['offset'](_0x5b8026[_0x5267('0x1b')]||0x0);return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x190ef4['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5267('0x9a')]})[_0x5267('0x25')](function(_0x1be763){if(!_0x1be763[_0x5267('0x35')]){_0x42694a=0x0;}else{_0x42694a=_0x1be763[0x0]['count']||0x0;}return dbH['sequelize'][_0x5267('0x30')](_0x11a2f4[_0x5267('0x7f')](),{'type':dbH['sequelize'][_0x5267('0x81')][_0x5267('0x9a')]});})['then'](function(_0x5005b3){return{'rows':_0x5005b3||[],'count':_0x42694a};});}});}exports[_0x5267('0x9b')]=function(_0x11a6f4,_0x5a16ee){return runReport(_0x11a6f4[_0x5267('0x41')],_0x11a6f4[_0x5267('0x30')],_0x11a6f4[_0x5267('0x3d')])[_0x5267('0x25')](respondWithResult(_0x5a16ee,null))[_0x5267('0x40')](handleError(_0x5a16ee,null));};exports[_0x5267('0x9c')]=runReport;exports[_0x5267('0x30')]=function(_0x1e9651,_0x66da7a){var _0x54b582=0xa;var _0x4e4724=[_0x5267('0x4f'),'left_join',_0x5267('0x82'),_0x5267('0x51')];var _0x2722f9={'SUM':_0x5267('0x52'),'COUNT':_0x5267('0x53'),'COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':_0x5267('0x9d'),'AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0x5909b3={'SEC_TO_TIME':_0x5267('0x83'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x1d7987=function(_0x59efe1){return!_[_0x5267('0x5d')]([_0x5267('0x5e'),_0x5267('0x5f'),_0x5267('0x84'),_0x5267('0x60')],_0x59efe1);};var _0x46c79e=function(_0xcfba51){if(!_0xcfba51||!_0xcfba51[_0x5267('0x61')][_0x5267('0x35')]){return'';}for(var _0x3c5516='(',_0x1e8367=0x0;_0x1e8367<_0xcfba51[_0x5267('0x61')]['length'];_0x1e8367+=0x1){_0x1e8367>0x0&&(_0x3c5516+='\x20'+_0xcfba51[_0x5267('0x62')]+'\x20');_0x3c5516+=_0xcfba51[_0x5267('0x61')][_0x1e8367]['group']?_0x46c79e(_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x63')]):_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x6f')]+'\x20'+_0xcfba51['rules'][_0x1e8367][_0x5267('0x64')]+(_0x1d7987(_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x64')])?'\x20'+_0xcfba51['rules'][_0x1e8367][_0x5267('0x65')]:'');}return _0x3c5516+')';};var _0x19935d={'where':{'id':_0x1e9651[_0x5267('0x41')]['id']}},_0x3102e0,_0x2d215e,_0xc0af94,_0x178080,_0x3485ab;_0x19935d=_[_0x5267('0x3c')]({},_0x19935d,_0x1e9651['options']);return db[_0x5267('0x2a')][_0x5267('0x48')](_0x19935d)['then'](function(_0x17d2d4){if(_0x17d2d4){_0x3102e0=_0x17d2d4;return _0x17d2d4['getFields']();}return null;})[_0x5267('0x25')](function(_0x4c5a26){if(_0x4c5a26){if(!_0x4c5a26[_0x5267('0x35')]){throw new db[(_0x5267('0x85'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d215e=_0x4c5a26;return db[_0x5267('0x69')][_0x5267('0x6a')]({'raw':!![]});}return null;})[_0x5267('0x25')](function(_0x1a0883){if(_0x1a0883){_0xc0af94=_[_0x5267('0x86')](_0x1a0883,'id');var _0x501da6;var _0x3dcf73=squel['select']();_0x3dcf73['from'](_0x3102e0['table']);for(var _0x1ded05=0x0;_0x1ded05<_0x2d215e[_0x5267('0x35')];_0x1ded05+=0x1){_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x6d')]?_0xc0af94[_0x2d215e[_0x1ded05][_0x5267('0x6d')]][_0x5267('0x6e')]:_0x2d215e[_0x1ded05][_0x5267('0x6f')];_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x70')]?_['replace'](_0x2722f9[_0x2d215e[_0x1ded05]['function']],'%s',_0x501da6):_0x501da6;_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x72')]?_[_0x5267('0x71')](_0x5909b3[_0x2d215e[_0x1ded05][_0x5267('0x72')]],'%s',_0x501da6):_0x501da6;if(_0x2d215e[_0x1ded05][_0x5267('0x73')]){_0x3dcf73[_0x5267('0x63')](_0x501da6);}_0x2d215e[_0x1ded05]['orderBy']&&_0x3dcf73[_0x5267('0x74')](_0x501da6,_0x2d215e[_0x1ded05][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x3dcf73[_0x5267('0x6f')](_0x501da6,_0x2d215e[_0x1ded05][_0x5267('0x88')]||_0x501da6);}if(_0x3102e0['joins']){_0x3102e0[_0x5267('0x77')]=JSON[_0x5267('0x7d')](_0x3102e0[_0x5267('0x77')]);for(var _0x4bfafd=0x0;_0x4bfafd<_0x3102e0[_0x5267('0x77')]['length'];_0x4bfafd+=0x1){if(_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x2d')]&&_['includes'](_0x4e4724,_0x3102e0[_0x5267('0x77')][_0x4bfafd]['type'])&&_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x78')]&&_0x3102e0['joins'][_0x4bfafd][_0x5267('0x79')]&&_0x3102e0[_0x5267('0x77')][_0x4bfafd]['foreignKey']){_0x3dcf73[_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x2d')]](_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x79')],null,util[_0x5267('0x72')]('%s.%s\x20=\x20%s.%s',_0x3102e0['table'],_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x78')],_0x3102e0['joins'][_0x4bfafd][_0x5267('0x79')],_0x3102e0['joins'][_0x4bfafd][_0x5267('0x7a')]));}}}if(_0x3102e0[_0x5267('0x7c')]){_0x3102e0[_0x5267('0x7c')]=JSON[_0x5267('0x7d')](_0x3102e0[_0x5267('0x7c')]);_0x3dcf73[_0x5267('0x38')](_0x46c79e(_0x3102e0[_0x5267('0x7c')][_0x5267('0x63')]));}_0x3485ab=_0x3dcf73[_0x5267('0x7e')]();_0x3dcf73[_0x5267('0x1d')](_0x54b582);_0x3dcf73[_0x5267('0x1b')](0x0);logger[_0x5267('0x9e')]('Limited\x20Query:',_0x3dcf73[_0x5267('0x7f')]());return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x3dcf73[_0x5267('0x7f')](),{'type':dbH[_0x5267('0x80')][_0x5267('0x81')][_0x5267('0x9a')]});}})[_0x5267('0x25')](function(){return{'sql':_0x3485ab[_0x5267('0x7f')]()};})[_0x5267('0x25')](respondWithResult(_0x66da7a,null))[_0x5267('0x40')](handleError(_0x66da7a,null));};
\ No newline at end of file
+var _0xda19=['ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','field','function','replace','groupBy','orderBy','order','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20EMPTY','operator','Sequelize','metric','format','DESC','parse','parentKey','web','output','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','run','runReport','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','dbH','status','json','offset','undefined','limit','count','set','apply','update','then','DefaultReports','destroy','end','error','stack','name','send','map','AnalyticDefaultReport','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','merge','includeAll','include','findAll','show','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','condition','value','options','find','getFields'];(function(_0x46eff4,_0xeca82e){var _0x230734=function(_0xbed990){while(--_0xbed990){_0x46eff4['push'](_0x46eff4['shift']());}};_0x230734(++_0xeca82e);}(_0xda19,0xd5));var _0x9da1=function(_0x1e32c3,_0x4aec3c){_0x1e32c3=_0x1e32c3-0x0;var _0x4d295e=_0xda19[_0x1e32c3];return _0x4d295e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9da1('0x0'));var zipdir=require(_0x9da1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9da1('0x2'));var moment=require('moment');var BPromise=require(_0x9da1('0x3'));var Mustache=require('mustache');var util=require(_0x9da1('0x4'));var path=require(_0x9da1('0x5'));var sox=require(_0x9da1('0x6'));var csv=require(_0x9da1('0x7'));var ejs=require(_0x9da1('0x8'));var fs=require('fs');var fs_extra=require(_0x9da1('0x9'));var _=require(_0x9da1('0xa'));var squel=require(_0x9da1('0xb'));var crypto=require(_0x9da1('0xc'));var jsforce=require(_0x9da1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9da1('0xe'));var Redis=require('ioredis');var authService=require(_0x9da1('0xf'));var qs=require(_0x9da1('0x10'));var as=require(_0x9da1('0x11'));var hardwareService=require(_0x9da1('0x12'));var logger=require(_0x9da1('0x13'))(_0x9da1('0x14'));var utils=require(_0x9da1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9da1('0x16'))['db'];var dbH=require('../../mysqldb')[_0x9da1('0x17')];function respondWithStatusCode(_0x1d93f8,_0xd2d225){_0xd2d225=_0xd2d225||0xcc;return function(_0x1ffa2a){if(_0x1ffa2a){return _0x1d93f8['sendStatus'](_0xd2d225);}return _0x1d93f8[_0x9da1('0x18')](_0xd2d225)['end']();};}function respondWithResult(_0x4d17e1,_0x40ba9d){_0x40ba9d=_0x40ba9d||0xc8;return function(_0x479ccd){if(_0x479ccd){return _0x4d17e1[_0x9da1('0x18')](_0x40ba9d)[_0x9da1('0x19')](_0x479ccd);}};}function respondWithFilteredResult(_0x37653d,_0x1a1a6b){return function(_0x7f1a64){if(_0x7f1a64){var _0x514d8e=typeof _0x1a1a6b[_0x9da1('0x1a')]===_0x9da1('0x1b')&&typeof _0x1a1a6b[_0x9da1('0x1c')]===_0x9da1('0x1b');var _0xfb278d=_0x7f1a64[_0x9da1('0x1d')];var _0x497676=_0x514d8e?0x0:_0x1a1a6b['offset'];var _0x17205d=_0x514d8e?_0x7f1a64[_0x9da1('0x1d')]:_0x1a1a6b[_0x9da1('0x1a')]+_0x1a1a6b[_0x9da1('0x1c')];var _0x40a967;if(_0x17205d>=_0xfb278d){_0x17205d=_0xfb278d;_0x40a967=0xc8;}else{_0x40a967=0xce;}_0x37653d[_0x9da1('0x18')](_0x40a967);return _0x37653d[_0x9da1('0x1e')]('Content-Range',_0x497676+'-'+_0x17205d+'/'+_0xfb278d)[_0x9da1('0x19')](_0x7f1a64);}return null;};}function patchUpdates(_0x554845){return function(_0x9c3b37){try{jsonpatch[_0x9da1('0x1f')](_0x9c3b37,_0x554845,!![]);}catch(_0x1fc065){return BPromise['reject'](_0x1fc065);}return _0x9c3b37['save']();};}function saveUpdates(_0x14793b,_0x3e6f85){return function(_0x16ee0c){if(_0x16ee0c){return _0x16ee0c[_0x9da1('0x20')](_0x14793b)[_0x9da1('0x21')](function(_0x165b73){return _0x165b73;});}return null;};}function removeEntity(_0x4c60aa,_0x2413fe){return function(_0x3bfa40){if(_0x3bfa40){return _0x3bfa40['destroy']()[_0x9da1('0x21')](function(){var _0x3f5680=_0x3bfa40['get']({'plain':!![]});var _0x2fd49c=_0x9da1('0x22');return db['UserProfileResource'][_0x9da1('0x23')]({'where':{'type':_0x2fd49c,'resourceId':_0x3f5680['id']}})[_0x9da1('0x21')](function(){return _0x3bfa40;});})['then'](function(){_0x4c60aa['status'](0xcc)[_0x9da1('0x24')]();});}};}function handleEntityNotFound(_0x47055e,_0x5eca5b){return function(_0x27c6e2){if(!_0x27c6e2){_0x47055e['sendStatus'](0x194);}return _0x27c6e2;};}function handleError(_0x5a6f2d,_0x5a59c2){_0x5a59c2=_0x5a59c2||0x1f4;return function(_0x31b826){logger[_0x9da1('0x25')](_0x31b826[_0x9da1('0x26')]);if(_0x31b826[_0x9da1('0x27')]){delete _0x31b826[_0x9da1('0x27')];}_0x5a6f2d['status'](_0x5a59c2)[_0x9da1('0x28')](_0x31b826);};}exports['index']=function(_0x1feae0,_0x235ced){var _0x5b38b3={},_0xc29ba8={},_0x2eb48f={'count':0x0,'rows':[]};var _0x4f318b=_[_0x9da1('0x29')](db[_0x9da1('0x2a')][_0x9da1('0x2b')],function(_0x2b2b48){return{'name':_0x2b2b48['fieldName'],'type':_0x2b2b48['type'][_0x9da1('0x2c')]};});_0xc29ba8[_0x9da1('0x2d')]=_[_0x9da1('0x29')](_0x4f318b,_0x9da1('0x27'));_0xc29ba8[_0x9da1('0x2e')]=_['keys'](_0x1feae0[_0x9da1('0x2e')]);_0xc29ba8[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xc29ba8[_0x9da1('0x2d')],_0xc29ba8[_0x9da1('0x2e')]);_0x5b38b3[_0x9da1('0x31')]=_['intersection'](_0xc29ba8[_0x9da1('0x2d')],qs['fields'](_0x1feae0['query'][_0x9da1('0x32')]));_0x5b38b3['attributes']=_0x5b38b3[_0x9da1('0x31')][_0x9da1('0x33')]?_0x5b38b3[_0x9da1('0x31')]:_0xc29ba8[_0x9da1('0x2d')];if(!_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x34')](_0x9da1('0x35'))){_0x5b38b3[_0x9da1('0x1c')]=qs['limit'](_0x1feae0[_0x9da1('0x2e')]['limit']);_0x5b38b3[_0x9da1('0x1a')]=qs['offset'](_0x1feae0['query'][_0x9da1('0x1a')]);}_0x5b38b3['order']=qs[_0x9da1('0x36')](_0x1feae0[_0x9da1('0x2e')]['sort']);_0x5b38b3[_0x9da1('0x37')]=qs[_0x9da1('0x2f')](_[_0x9da1('0x38')](_0x1feae0[_0x9da1('0x2e')],_0xc29ba8['filters']),_0x4f318b);if(_0x1feae0[_0x9da1('0x2e')]['filter']){_0x5b38b3[_0x9da1('0x37')]=_['merge'](_0x5b38b3[_0x9da1('0x37')],{'$or':_[_0x9da1('0x29')](_0x4f318b,function(_0x58e165){if(_0x58e165[_0x9da1('0x39')]!==_0x9da1('0x3a')){var _0x394acf={};_0x394acf[_0x58e165['name']]={'$like':'%'+_0x1feae0['query']['filter']+'%'};return _0x394acf;}})});}_0x5b38b3=_[_0x9da1('0x3b')]({},_0x5b38b3,_0x1feae0['options']);var _0x5b215c={'where':_0x5b38b3[_0x9da1('0x37')]};return db[_0x9da1('0x2a')][_0x9da1('0x1d')](_0x5b215c)['then'](function(_0x42dbd8){_0x2eb48f[_0x9da1('0x1d')]=_0x42dbd8;if(_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x3c')]){_0x5b38b3[_0x9da1('0x3d')]=[{'all':!![]}];}return db[_0x9da1('0x2a')][_0x9da1('0x3e')](_0x5b38b3);})['then'](function(_0x467350){_0x2eb48f['rows']=_0x467350;return _0x2eb48f;})[_0x9da1('0x21')](respondWithFilteredResult(_0x235ced,_0x5b38b3))['catch'](handleError(_0x235ced,null));};exports[_0x9da1('0x3f')]=function(_0x40d848,_0x599211){var _0x265366={'raw':!![],'where':{'id':_0x40d848['params']['id']}},_0xfeec5f={};_0xfeec5f[_0x9da1('0x2d')]=_['keys'](db[_0x9da1('0x2a')][_0x9da1('0x2b')]);_0xfeec5f['query']=_['keys'](_0x40d848[_0x9da1('0x2e')]);_0xfeec5f[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],_0xfeec5f[_0x9da1('0x2e')]);_0x265366[_0x9da1('0x31')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],qs['fields'](_0x40d848[_0x9da1('0x2e')][_0x9da1('0x32')]));_0x265366[_0x9da1('0x31')]=_0x265366['attributes'][_0x9da1('0x33')]?_0x265366[_0x9da1('0x31')]:_0xfeec5f[_0x9da1('0x2d')];if(_0x40d848['query'][_0x9da1('0x3c')]){_0x265366[_0x9da1('0x3d')]=[{'all':!![]}];}_0x265366=_[_0x9da1('0x3b')]({},_0x265366,_0x40d848['options']);return db[_0x9da1('0x2a')]['find'](_0x265366)['then'](handleEntityNotFound(_0x599211,null))[_0x9da1('0x21')](respondWithResult(_0x599211,null))[_0x9da1('0x40')](handleError(_0x599211,null));};exports['create']=function(_0x712d10,_0x2066d2){return db['AnalyticDefaultReport'][_0x9da1('0x41')](_0x712d10[_0x9da1('0x42')],{})[_0x9da1('0x21')](function(_0x3a529d){var _0x4780ca=_0x712d10[_0x9da1('0x43')][_0x9da1('0x44')]({'plain':!![]});if(!_0x4780ca)throw new Error(_0x9da1('0x45'));if(_0x4780ca[_0x9da1('0x46')]==='user'){var _0x147c65=_0x3a529d[_0x9da1('0x44')]({'plain':!![]});var _0x34a203=_0x9da1('0x47');return db['UserProfileSection']['find']({'where':{'name':_0x34a203,'userProfileId':_0x4780ca[_0x9da1('0x48')]},'raw':!![]})[_0x9da1('0x21')](function(_0x3870dd){if(_0x3870dd&&_0x3870dd[_0x9da1('0x49')]===0x0){return db[_0x9da1('0x4a')][_0x9da1('0x41')]({'name':_0x147c65[_0x9da1('0x27')],'resourceId':_0x147c65['id'],'type':_0x9da1('0x22'),'sectionId':_0x3870dd['id']},{})[_0x9da1('0x21')](function(){return _0x3a529d;});}else{return _0x3a529d;}})[_0x9da1('0x40')](function(_0x868167){logger[_0x9da1('0x25')](_0x9da1('0x4b'),_0x868167);throw _0x868167;});}return _0x3a529d;})[_0x9da1('0x21')](respondWithResult(_0x2066d2,0xc9))['catch'](handleError(_0x2066d2,null));};exports[_0x9da1('0x20')]=function(_0x1fbb5d,_0x4d241a){if(_0x1fbb5d[_0x9da1('0x42')]['id']){delete _0x1fbb5d['body']['id'];}return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x1fbb5d[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x4d241a,null))[_0x9da1('0x21')](saveUpdates(_0x1fbb5d[_0x9da1('0x42')],null))[_0x9da1('0x21')](respondWithResult(_0x4d241a,null))[_0x9da1('0x40')](handleError(_0x4d241a,null));};exports[_0x9da1('0x23')]=function(_0x343b05,_0x170351){return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x343b05[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x170351,null))[_0x9da1('0x21')](removeEntity(_0x170351,null))[_0x9da1('0x40')](handleError(_0x170351,null));};exports[_0x9da1('0x4d')]=function(_0x4607a9,_0x2020d0){var _0x3c01c3=0xa;var _0xfa8d3f=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),_0x9da1('0x50')];var _0x5bda2a={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0xc27b00={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x27ac84=function(_0x10ebc9){return!_[_0x9da1('0x5c')]([_0x9da1('0x5d'),_0x9da1('0x5e'),_0x9da1('0x5f'),'IS\x20NOT\x20EMPTY'],_0x10ebc9);};var _0x5f5dc2=function(_0x454a68){if(!_0x454a68||!_0x454a68['rules']['length']){return'';}for(var _0x5b4a05='(',_0x6f86c3=0x0;_0x6f86c3<_0x454a68['rules'][_0x9da1('0x33')];_0x6f86c3+=0x1){_0x6f86c3>0x0&&(_0x5b4a05+='\x20'+_0x454a68['operator']+'\x20');_0x5b4a05+=_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x61')]?_0x5f5dc2(_0x454a68['rules'][_0x6f86c3][_0x9da1('0x61')]):_0x454a68[_0x9da1('0x60')][_0x6f86c3]['field']+'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x62')]+(_0x27ac84(_0x454a68['rules'][_0x6f86c3]['condition'])?'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x63')]:'');}return _0x5b4a05+')';};var _0x21d00c={'where':{'id':_0x4607a9['params']['id']}},_0x3ca531,_0x236b01,_0x44d7fe,_0x5cb102,_0x3d2c25;_0x21d00c=_['merge']({},_0x21d00c,_0x4607a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0x21d00c)[_0x9da1('0x21')](function(_0x3382b1){if(_0x3382b1){_0x3ca531=_0x3382b1;return _0x3382b1[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x1f2a4b){if(_0x1f2a4b){if(!_0x1f2a4b[_0x9da1('0x33')]){throw new db['Sequelize'][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x236b01=_0x1f2a4b;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x491fcb){if(_0x491fcb){_0x44d7fe=_[_0x9da1('0x6a')](_0x491fcb,'id');var _0x13fadd;var _0x419f78=squel[_0x9da1('0x6b')]();_0x419f78[_0x9da1('0x6c')](_0x3ca531[_0x9da1('0x6d')]);for(var _0x55a6d2=0x0;_0x55a6d2<_0x236b01[_0x9da1('0x33')];_0x55a6d2+=0x1){_0x13fadd=_0x236b01[_0x55a6d2]['MetricId']?_0x44d7fe[_0x236b01[_0x55a6d2][_0x9da1('0x6e')]]['metric']:_0x236b01[_0x55a6d2][_0x9da1('0x6f')];_0x13fadd=_0x236b01[_0x55a6d2][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x5bda2a[_0x236b01[_0x55a6d2][_0x9da1('0x70')]],'%s',_0x13fadd):_0x13fadd;_0x13fadd=_0x236b01[_0x55a6d2]['format']?_['replace'](_0xc27b00[_0x236b01[_0x55a6d2]['format']],'%s',_0x13fadd):_0x13fadd;if(_0x236b01[_0x55a6d2][_0x9da1('0x72')]){_0x419f78[_0x9da1('0x61')](_0x13fadd);}_0x236b01[_0x55a6d2][_0x9da1('0x73')]&&_0x419f78[_0x9da1('0x74')](_0x13fadd,_0x236b01[_0x55a6d2]['orderBy']==='DESC'?![]:!![]);_0x419f78[_0x9da1('0x6f')](_0x13fadd,_0x236b01[_0x55a6d2][_0x9da1('0x75')]||_0x13fadd);}if(_0x3ca531[_0x9da1('0x76')]){_0x3ca531['joins']=JSON['parse'](_0x3ca531[_0x9da1('0x76')]);for(var _0x1deb93=0x0;_0x1deb93<_0x3ca531[_0x9da1('0x76')]['length'];_0x1deb93+=0x1){if(_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0xfa8d3f,_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x39')])&&_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey']&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')]&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x78')]){_0x419f78[_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]](_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0x3ca531[_0x9da1('0x6d')],_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey'],_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],_0x3ca531['joins'][_0x1deb93][_0x9da1('0x78')]));}}}if(_0x3ca531['conditions']){_0x3ca531[_0x9da1('0x7a')]=JSON['parse'](_0x3ca531[_0x9da1('0x7a')]);_0x419f78[_0x9da1('0x37')](_0x5f5dc2(_0x3ca531[_0x9da1('0x7a')][_0x9da1('0x61')]));}_0x3d2c25=_0x419f78[_0x9da1('0x7b')]();_0x419f78[_0x9da1('0x1c')](_0x3c01c3);_0x419f78[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x419f78[_0x9da1('0x7e')]());return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x419f78[_0x9da1('0x7e')](),{'type':dbH['sequelize'][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](respondWithResult(_0x2020d0,null))[_0x9da1('0x40')](handleError(_0x2020d0,null));};function runReport(_0x162597,_0x4f39bc,_0x1ca102){var _0x2eb5e6=_0x4f39bc['name'];var _0x4a4cda=0xa;var _0x84f8d8=[_0x9da1('0x4e'),_0x9da1('0x82'),_0x9da1('0x4f'),_0x9da1('0x50')];var _0x4701b3={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x3a0a84={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':_0x9da1('0x83'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9da1('0x84')};var _0x354c5a=function(_0x53ab6a){return!_[_0x9da1('0x5c')](['IS\x20NULL',_0x9da1('0x5e'),'IS\x20EMPTY',_0x9da1('0x85')],_0x53ab6a);};var _0x106bd9=function(_0x347cb8){if(!_0x347cb8||!_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x3e331a='(',_0x1f785c=0x0;_0x1f785c<_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')];_0x1f785c+=0x1){_0x1f785c>0x0&&(_0x3e331a+='\x20'+_0x347cb8[_0x9da1('0x86')]+'\x20');_0x3e331a+=_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x61')]?_0x106bd9(_0x347cb8['rules'][_0x1f785c][_0x9da1('0x61')]):_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x6f')]+'\x20'+_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x62')]+(_0x354c5a(_0x347cb8[_0x9da1('0x60')][_0x1f785c]['condition'])?'\x20'+_0x347cb8['rules'][_0x1f785c][_0x9da1('0x63')]:'');}return _0x3e331a+')';};var _0xdecc82={'where':{'id':_0x162597['id']}},_0xe12dd7,_0x4cd85f,_0x4bf74c,_0x28335d,_0x175b4b;_0xdecc82=_[_0x9da1('0x3b')]({},_0xdecc82,_0x1ca102);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xdecc82)[_0x9da1('0x21')](function(_0x5561f0){if(_0x5561f0){_0xe12dd7=_0x5561f0;return _0x5561f0[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x5a64fd){if(_0x5a64fd){if(!_0x5a64fd['length']){throw new db[(_0x9da1('0x87'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4cd85f=_0x5a64fd;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x18ae08){if(_0x18ae08){_0x4bf74c=_[_0x9da1('0x6a')](_0x18ae08,'id');var _0x30065d;var _0x40a2ef=squel[_0x9da1('0x6b')]();_0x40a2ef['from'](_0xe12dd7['table']);for(var _0xd10ba4=0x0;_0xd10ba4<_0x4cd85f[_0x9da1('0x33')];_0xd10ba4+=0x1){_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]?_0x4bf74c[_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]][_0x9da1('0x88')]:_0x4cd85f[_0xd10ba4][_0x9da1('0x6f')];_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x4701b3[_0x4cd85f[_0xd10ba4]['function']],'%s',_0x30065d):_0x30065d;_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]?_['replace'](_0x3a0a84[_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]],'%s',_0x30065d):_0x30065d;if(_0x4cd85f[_0xd10ba4][_0x9da1('0x72')]){_0x40a2ef[_0x9da1('0x61')](_0x30065d);}_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]&&_0x40a2ef[_0x9da1('0x74')](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]===_0x9da1('0x8a')?![]:!![]);_0x40a2ef['field'](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x75')]||_0x30065d);}if(_0xe12dd7['joins']){_0xe12dd7[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0xe12dd7[_0x9da1('0x76')]);for(var _0x22b679=0x0;_0x22b679<_0xe12dd7['joins'][_0x9da1('0x33')];_0x22b679+=0x1){if(_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0x84f8d8,_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')])&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]){_0x40a2ef[_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]](_0xe12dd7['joins'][_0x22b679][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0xe12dd7['table'],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]));}}}if(_0xe12dd7[_0x9da1('0x7a')]){_0xe12dd7[_0x9da1('0x7a')]=JSON['parse'](_0xe12dd7[_0x9da1('0x7a')]);_0x40a2ef[_0x9da1('0x37')](_0x106bd9(_0xe12dd7['conditions'][_0x9da1('0x61')]));}_0x175b4b=_0x40a2ef[_0x9da1('0x7b')]();_0x40a2ef[_0x9da1('0x1c')](_0x4a4cda);_0x40a2ef['offset'](0x0);return;}})['then'](function(){if(_0x4f39bc['output']===_0x9da1('0x8d')){return null;}var _0x3b17aa=_[_0x9da1('0x3b')](_0x4f39bc,{'name':_0x4f39bc['fullPath']||_0x4f39bc['name']||_0xe12dd7[_0x9da1('0x27')],'basename':_0x2eb5e6,'savename':util[_0x9da1('0x89')]('%s-%s.%s',_0x4f39bc[_0x9da1('0x27')]||_0xe12dd7['name'],require('randomstring')['generate'](0x4),_0x4f39bc[_0x9da1('0x8e')]||_0x9da1('0x8f')),'reportId':_0xe12dd7['id'],'reportType':_0x9da1('0x90')});return db[_0x9da1('0x91')][_0x9da1('0x41')](_0x3b17aa,{'raw':!![]});})[_0x9da1('0x21')](function(_0x2aac99){if(_0xe12dd7[_0x9da1('0x6d')]===_0x9da1('0x92')){_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc['startDate'],_0x4f39bc['endDate']);}else{_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc[_0x9da1('0x93')],_0x4f39bc[_0x9da1('0x94')]);}if(_0x2aac99){logger[_0x9da1('0x95')](_0x9da1('0x96'),_0x175b4b[_0x9da1('0x7e')]());require(_0x9da1('0x97'))[_0x9da1('0x98')](path[_0x9da1('0x4e')](__dirname,'../../components/export/',_0x2aac99[_0x9da1('0x8e')]),[_0x2aac99['id'],_0x175b4b[_0x9da1('0x7e')](),path[_0x9da1('0x4e')](__dirname,_0x9da1('0x99'),_0x2aac99[_0x9da1('0x9a')]),_0x2eb5e6]);return _0x2aac99;}else{var _0x5ad3f8=squel[_0x9da1('0x6b')]();_0x5ad3f8['from']('('+_0x175b4b[_0x9da1('0x7e')]()+')',_0x9da1('0x9b'));_0x5ad3f8[_0x9da1('0x6f')]('COUNT(*)','count');_0x175b4b[_0x9da1('0x1c')](_0x4f39bc[_0x9da1('0x1c')]||_0x4a4cda);_0x175b4b[_0x9da1('0x1a')](_0x4f39bc['offset']||0x0);return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x5ad3f8['toString'](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')]['SELECT']})['then'](function(_0x489b3f){if(!_0x489b3f[_0x9da1('0x33')]){_0x28335d=0x0;}else{_0x28335d=_0x489b3f[0x0]['count']||0x0;}return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x175b4b[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});})['then'](function(_0x355a71){return{'rows':_0x355a71||[],'count':_0x28335d};});}});}exports[_0x9da1('0x9c')]=function(_0x492e1a,_0x449a17){return runReport(_0x492e1a[_0x9da1('0x4c')],_0x492e1a[_0x9da1('0x2e')],_0x492e1a[_0x9da1('0x64')])['then'](respondWithResult(_0x449a17,null))[_0x9da1('0x40')](handleError(_0x449a17,null));};exports[_0x9da1('0x9d')]=runReport;exports[_0x9da1('0x2e')]=function(_0x8280a9,_0x374754){var _0x1e466a=0xa;var _0x3f9133=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),'cross_join'];var _0x3dd3e0={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x52e4a6={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4aa903=function(_0x55d7f2){return!_['includes'](['IS\x20NULL',_0x9da1('0x5e'),_0x9da1('0x5f'),_0x9da1('0x85')],_0x55d7f2);};var _0x3212ad=function(_0x5ac65b){if(!_0x5ac65b||!_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x21a99d='(',_0xd19a7c=0x0;_0xd19a7c<_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')];_0xd19a7c+=0x1){_0xd19a7c>0x0&&(_0x21a99d+='\x20'+_0x5ac65b[_0x9da1('0x86')]+'\x20');_0x21a99d+=_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]?_0x3212ad(_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]):_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x6f')]+'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c]['condition']+(_0x4aa903(_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x62')])?'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x63')]:'');}return _0x21a99d+')';};var _0xb14af1={'where':{'id':_0x8280a9[_0x9da1('0x4c')]['id']}},_0x245566,_0x5b2591,_0x3c51e3,_0x54b83d,_0x23bf86;_0xb14af1=_['merge']({},_0xb14af1,_0x8280a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xb14af1)[_0x9da1('0x21')](function(_0x4bb140){if(_0x4bb140){_0x245566=_0x4bb140;return _0x4bb140[_0x9da1('0x66')]();}return null;})['then'](function(_0x47cbdd){if(_0x47cbdd){if(!_0x47cbdd['length']){throw new db[(_0x9da1('0x87'))][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x5b2591=_0x47cbdd;return db['AnalyticMetric'][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x5e1e24){if(_0x5e1e24){_0x3c51e3=_[_0x9da1('0x6a')](_0x5e1e24,'id');var _0x49ddec;var _0x407218=squel['select']();_0x407218['from'](_0x245566['table']);for(var _0x316fee=0x0;_0x316fee<_0x5b2591['length'];_0x316fee+=0x1){_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x6e')]?_0x3c51e3[_0x5b2591[_0x316fee][_0x9da1('0x6e')]]['metric']:_0x5b2591[_0x316fee]['field'];_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x70')]?_['replace'](_0x3dd3e0[_0x5b2591[_0x316fee][_0x9da1('0x70')]],'%s',_0x49ddec):_0x49ddec;_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x89')]?_['replace'](_0x52e4a6[_0x5b2591[_0x316fee]['format']],'%s',_0x49ddec):_0x49ddec;if(_0x5b2591[_0x316fee][_0x9da1('0x72')]){_0x407218[_0x9da1('0x61')](_0x49ddec);}_0x5b2591[_0x316fee][_0x9da1('0x73')]&&_0x407218[_0x9da1('0x74')](_0x49ddec,_0x5b2591[_0x316fee]['orderBy']==='DESC'?![]:!![]);_0x407218[_0x9da1('0x6f')](_0x49ddec,_0x5b2591[_0x316fee][_0x9da1('0x75')]||_0x49ddec);}if(_0x245566[_0x9da1('0x76')]){_0x245566[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0x245566['joins']);for(var _0x56ec7d=0x0;_0x56ec7d<_0x245566[_0x9da1('0x76')][_0x9da1('0x33')];_0x56ec7d+=0x1){if(_0x245566['joins'][_0x56ec7d][_0x9da1('0x39')]&&_['includes'](_0x3f9133,_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')])&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x8c')]&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')]&&_0x245566['joins'][_0x56ec7d][_0x9da1('0x78')]){_0x407218[_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')]](_0x245566[_0x9da1('0x76')][_0x56ec7d]['foreignTable'],null,util[_0x9da1('0x89')](_0x9da1('0x79'),_0x245566[_0x9da1('0x6d')],_0x245566['joins'][_0x56ec7d]['parentKey'],_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')],_0x245566['joins'][_0x56ec7d]['foreignKey']));}}}if(_0x245566[_0x9da1('0x7a')]){_0x245566[_0x9da1('0x7a')]=JSON[_0x9da1('0x8b')](_0x245566[_0x9da1('0x7a')]);_0x407218[_0x9da1('0x37')](_0x3212ad(_0x245566['conditions'][_0x9da1('0x61')]));}_0x23bf86=_0x407218['clone']();_0x407218[_0x9da1('0x1c')](_0x1e466a);_0x407218[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x407218['toString']());return dbH['sequelize'][_0x9da1('0x2e')](_0x407218[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](function(){return{'sql':_0x23bf86['toString']()};})[_0x9da1('0x21')](respondWithResult(_0x374754,null))[_0x9da1('0x40')](handleError(_0x374754,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 2317794..b945bf0 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 _0xeaf3=['./analyticDefaultReport.attributes','exports','define','analytics_default_reports','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x47e669,_0x14922f){var _0x148310=function(_0xa0718f){while(--_0xa0718f){_0x47e669['push'](_0x47e669['shift']());}};_0x148310(++_0x14922f);}(_0xeaf3,0x1e5));var _0x3eaf=function(_0xd59766,_0x8d1df1){_0xd59766=_0xd59766-0x0;var _0x5e850e=_0xeaf3[_0xd59766];return _0x5e850e;};'use strict';var _=require(_0x3eaf('0x0'));var util=require(_0x3eaf('0x1'));var logger=require(_0x3eaf('0x2'))(_0x3eaf('0x3'));var moment=require(_0x3eaf('0x4'));var BPromise=require('bluebird');var rp=require(_0x3eaf('0x5'));var fs=require('fs');var path=require(_0x3eaf('0x6'));var rimraf=require(_0x3eaf('0x7'));var config=require(_0x3eaf('0x8'));var attributes=require(_0x3eaf('0x9'));module[_0x3eaf('0xa')]=function(_0x282054,_0x3dc4dc){return _0x282054[_0x3eaf('0xb')]('AnalyticDefaultReport',attributes,{'tableName':_0x3eaf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x435a=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticDefaultReport.attributes'];(function(_0x5759aa,_0x5d8639){var _0x434a4d=function(_0x4006fc){while(--_0x4006fc){_0x5759aa['push'](_0x5759aa['shift']());}};_0x434a4d(++_0x5d8639);}(_0x435a,0x1a6));var _0xa435=function(_0x3e5a76,_0x1e2316){_0x3e5a76=_0x3e5a76-0x0;var _0x2b9bc6=_0x435a[_0x3e5a76];return _0x2b9bc6;};'use strict';var _=require(_0xa435('0x0'));var util=require(_0xa435('0x1'));var logger=require(_0xa435('0x2'))(_0xa435('0x3'));var moment=require(_0xa435('0x4'));var BPromise=require(_0xa435('0x5'));var rp=require(_0xa435('0x6'));var fs=require('fs');var path=require(_0xa435('0x7'));var rimraf=require(_0xa435('0x8'));var config=require('../../config/environment');var attributes=require(_0xa435('0x9'));module[_0xa435('0xa')]=function(_0x200873,_0x3a75a4){return _0x200873[_0xa435('0xb')]('AnalyticDefaultReport',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 049cedb..62d9c16 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 _0x2afb=['AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3cb530,_0x170e8c){var _0x4168ea=function(_0x83990a){while(--_0x83990a){_0x3cb530['push'](_0x3cb530['shift']());}};_0x4168ea(++_0x170e8c);}(_0x2afb,0x6b));var _0xb2af=function(_0x4492af,_0x47e25d){_0x4492af=_0x4492af-0x0;var _0x216729=_0x2afb[_0x4492af];return _0x216729;};'use strict';var _=require(_0xb2af('0x0'));var util=require(_0xb2af('0x1'));var moment=require(_0xb2af('0x2'));var BPromise=require(_0xb2af('0x3'));var rs=require(_0xb2af('0x4'));var fs=require('fs');var Redis=require(_0xb2af('0x5'));var db=require(_0xb2af('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb2af('0x7'))(_0xb2af('0x8'));var config=require(_0xb2af('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb2af('0xa')][_0xb2af('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5cc19f,_0x385f35,_0x556dda){return new BPromise(function(_0x127df0,_0x4e6b4b){return client[_0xb2af('0xc')](_0x5cc19f,_0x556dda)[_0xb2af('0xd')](function(_0xa6f42f){logger[_0xb2af('0xe')](_0xb2af('0xf'),_0x385f35,_0xb2af('0x10'));logger[_0xb2af('0x11')](_0xb2af('0x12'),_0x385f35,'request\x20sent',JSON[_0xb2af('0x13')](_0xa6f42f));if(_0xa6f42f[_0xb2af('0x14')]){if(_0xa6f42f[_0xb2af('0x14')][_0xb2af('0x15')]===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x385f35,_0xa6f42f[_0xb2af('0x14')][_0xb2af('0x16')]);return _0x4e6b4b(_0xa6f42f['error'][_0xb2af('0x16')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x385f35,_0xa6f42f['error'][_0xb2af('0x16')]);return _0x127df0(_0xa6f42f['error']['message']);}else{logger[_0xb2af('0xe')](_0xb2af('0xf'),_0x385f35,'request\x20sent');_0x127df0(_0xa6f42f[_0xb2af('0x17')]['message']);}})[_0xb2af('0x18')](function(_0x66577b){logger[_0xb2af('0x14')](_0xb2af('0xf'),_0x385f35,_0x66577b);_0x4e6b4b(_0x66577b);});});}
\ No newline at end of file
+var _0x02b8=['request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x02b8,0xad));var _0x802b=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x02b8[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x802b('0x0'));var util=require(_0x802b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x802b('0x2'));var fs=require('fs');var Redis=require(_0x802b('0x3'));var db=require(_0x802b('0x4'))['db'];var utils=require(_0x802b('0x5'));var logger=require('../../config/logger')(_0x802b('0x6'));var config=require(_0x802b('0x7'));var jayson=require(_0x802b('0x8'));var client=jayson[_0x802b('0x9')][_0x802b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f9eea,_0xf46384,_0x240f35){return new BPromise(function(_0x3ab2ad,_0x9e5358){return client[_0x802b('0xb')](_0x2f9eea,_0x240f35)[_0x802b('0xc')](function(_0x42f8de){logger[_0x802b('0xd')](_0x802b('0xe'),_0xf46384,_0x802b('0xf'));logger[_0x802b('0x10')](_0x802b('0x11'),_0xf46384,_0x802b('0xf'),JSON[_0x802b('0x12')](_0x42f8de));if(_0x42f8de[_0x802b('0x13')]){if(_0x42f8de['error'][_0x802b('0x14')]===0x1f4){logger[_0x802b('0x13')](_0x802b('0xe'),_0xf46384,_0x42f8de[_0x802b('0x13')][_0x802b('0x15')]);return _0x9e5358(_0x42f8de[_0x802b('0x13')][_0x802b('0x15')]);}logger[_0x802b('0x13')](_0x802b('0xe'),_0xf46384,_0x42f8de[_0x802b('0x13')]['message']);return _0x3ab2ad(_0x42f8de[_0x802b('0x13')]['message']);}else{logger[_0x802b('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xf46384,_0x802b('0xf'));_0x3ab2ad(_0x42f8de['result']['message']);}})[_0x802b('0x16')](function(_0x355750){logger['error'](_0x802b('0xe'),_0xf46384,_0x355750);_0x9e5358(_0x355750);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 380897c..0d8238a 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 _0xb334=['../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','/:id','show','get','/:id/preview','/:id/run','run','/:id/query','query','post','create','put','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2ede49,_0x56bd37){var _0x699234=function(_0x27e2d9){while(--_0x27e2d9){_0x2ede49['push'](_0x2ede49['shift']());}};_0x699234(++_0x56bd37);}(_0xb334,0x101));var _0x4b33=function(_0x42c437,_0x4cf128){_0x42c437=_0x42c437-0x0;var _0x57640a=_0xb334[_0x42c437];return _0x57640a;};'use strict';var multer=require('multer');var util=require(_0x4b33('0x0'));var path=require(_0x4b33('0x1'));var timeout=require(_0x4b33('0x2'));var express=require(_0x4b33('0x3'));var router=express[_0x4b33('0x4')]();var fs_extra=require(_0x4b33('0x5'));var auth=require(_0x4b33('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4b33('0x7'));var controller=require(_0x4b33('0x8'));router['get']('/',auth[_0x4b33('0x9')](),controller[_0x4b33('0xa')]);router['get'](_0x4b33('0xb'),auth[_0x4b33('0x9')](),controller[_0x4b33('0xc')]);router[_0x4b33('0xd')](_0x4b33('0xe'),auth[_0x4b33('0x9')](),controller['preview']);router['get'](_0x4b33('0xf'),auth[_0x4b33('0x9')](),controller[_0x4b33('0x10')]);router[_0x4b33('0xd')](_0x4b33('0x11'),auth[_0x4b33('0x9')](),controller[_0x4b33('0x12')]);router[_0x4b33('0x13')]('/',auth[_0x4b33('0x9')](),controller[_0x4b33('0x14')]);router[_0x4b33('0x15')](_0x4b33('0xb'),auth[_0x4b33('0x9')](),controller[_0x4b33('0x16')]);router['delete']('/:id',auth[_0x4b33('0x9')](),controller['destroy']);module[_0x4b33('0x17')]=router;
\ No newline at end of file
+var _0xf1d6=['post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','query'];(function(_0x12d17f,_0x5d9692){var _0x469779=function(_0xdaa74e){while(--_0xdaa74e){_0x12d17f['push'](_0x12d17f['shift']());}};_0x469779(++_0x5d9692);}(_0xf1d6,0x195));var _0x6f1d=function(_0x47c69b,_0x4a2d92){_0x47c69b=_0x47c69b-0x0;var _0x1ba395=_0xf1d6[_0x47c69b];return _0x1ba395;};'use strict';var multer=require(_0x6f1d('0x0'));var util=require(_0x6f1d('0x1'));var path=require(_0x6f1d('0x2'));var timeout=require(_0x6f1d('0x3'));var express=require(_0x6f1d('0x4'));var router=express['Router']();var fs_extra=require(_0x6f1d('0x5'));var auth=require(_0x6f1d('0x6'));var interaction=require(_0x6f1d('0x7'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router['get']('/',auth[_0x6f1d('0x8')](),controller[_0x6f1d('0x9')]);router[_0x6f1d('0xa')](_0x6f1d('0xb'),auth[_0x6f1d('0x8')](),controller['show']);router['get']('/:id/preview',auth[_0x6f1d('0x8')](),controller['preview']);router['get']('/:id/run',auth['isAuthenticated'](),controller['run']);router[_0x6f1d('0xa')]('/:id/query',auth[_0x6f1d('0x8')](),controller[_0x6f1d('0xc')]);router[_0x6f1d('0xd')]('/',auth[_0x6f1d('0x8')](),controller['create']);router[_0x6f1d('0xe')](_0x6f1d('0xb'),auth[_0x6f1d('0x8')](),controller[_0x6f1d('0xf')]);router[_0x6f1d('0x10')](_0x6f1d('0xb'),auth[_0x6f1d('0x8')](),controller[_0x6f1d('0x11')]);module[_0x6f1d('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index d0154bb..6d78645 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 _0x82bb=['exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','INTEGER','UNSIGNED','sequelize','moment'];(function(_0x43fb15,_0x4b3f5b){var _0x42d47a=function(_0x27859b){while(--_0x27859b){_0x43fb15['push'](_0x43fb15['shift']());}};_0x42d47a(++_0x4b3f5b);}(_0x82bb,0x1ec));var _0xb82b=function(_0x588afd,_0x3e0d6e){_0x588afd=_0x588afd-0x0;var _0x2a4b57=_0x82bb[_0x588afd];return _0x2a4b57;};'use strict';var Sequelize=require(_0xb82b('0x0'));var moment=require(_0xb82b('0x1'));module[_0xb82b('0x2')]={'name':{'type':Sequelize[_0xb82b('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xb82b('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xb82b('0x4')](_0xb82b('0x5'),_0xb82b('0x6'),_0xb82b('0x7')),'allowNull':![],'defaultValue':_0xb82b('0x5')},'savename':{'type':Sequelize[_0xb82b('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xb82b('0x8')]},'endDate':{'type':Sequelize[_0xb82b('0x8')]},'status':{'type':Sequelize[_0xb82b('0x3')],'defaultValue':_0xb82b('0x9')},'type':{'type':Sequelize[_0xb82b('0x4')](_0xb82b('0xa'),'scheduled'),'allowNull':![],'defaultValue':_0xb82b('0xa')},'reportId':{'type':Sequelize[_0xb82b('0xb')](0xb)[_0xb82b('0xc')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x3919=['ENUM','csv','pdf','xlsx','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING'];(function(_0x1e4b80,_0x11cc64){var _0x303865=function(_0x5b9121){while(--_0x5b9121){_0x1e4b80['push'](_0x1e4b80['shift']());}};_0x303865(++_0x11cc64);}(_0x3919,0x1f4));var _0x9391=function(_0x1313f0,_0x2b2750){_0x1313f0=_0x1313f0-0x0;var _0xc3fad0=_0x3919[_0x1313f0];return _0xc3fad0;};'use strict';var Sequelize=require(_0x9391('0x0'));var moment=require(_0x9391('0x1'));module[_0x9391('0x2')]={'name':{'type':Sequelize[_0x9391('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x9391('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x9391('0x4')](_0x9391('0x5'),_0x9391('0x6'),_0x9391('0x7')),'allowNull':![],'defaultValue':_0x9391('0x5')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x9391('0x8')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':_0x9391('0x9')},'type':{'type':Sequelize[_0x9391('0x4')](_0x9391('0xa'),_0x9391('0xb')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x9391('0xc')](0xb)[_0x9391('0xd')]},'reportType':{'type':Sequelize[_0x9391('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 76d7ce6..038eaee 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 _0xb08f=['reject','save','update','then','destroy','get','UserProfileResource','error','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','offset','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','count','include','findAll','rows','catch','show','params','includeAll','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','UserProfileSection','find','autoAssociation','body','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','download','format','%s.%s','rimraf','zip-dir','fast-json-patch','moment','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/license/util','sendStatus','status','end','json','undefined','limit','set','apply'];(function(_0x18f152,_0x41585a){var _0xa10b34=function(_0x1e9798){while(--_0x1e9798){_0x18f152['push'](_0x18f152['shift']());}};_0xa10b34(++_0x41585a);}(_0xb08f,0xa1));var _0xfb08=function(_0x534e94,_0x7c755e){_0x534e94=_0x534e94-0x0;var _0x4e1d5c=_0xb08f[_0x534e94];return _0x4e1d5c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfb08('0x0'));var zipdir=require(_0xfb08('0x1'));var jsonpatch=require(_0xfb08('0x2'));var rp=require('request-promise');var moment=require(_0xfb08('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfb08('0x4'));var path=require('path');var sox=require(_0xfb08('0x5'));var csv=require('to-csv');var ejs=require(_0xfb08('0x6'));var fs=require('fs');var fs_extra=require(_0xfb08('0x7'));var _=require(_0xfb08('0x8'));var squel=require(_0xfb08('0x9'));var crypto=require(_0xfb08('0xa'));var jsforce=require(_0xfb08('0xb'));var deskjs=require(_0xfb08('0xc'));var toCsv=require(_0xfb08('0xd'));var querystring=require('querystring');var Papa=require(_0xfb08('0xe'));var Redis=require(_0xfb08('0xf'));var authService=require(_0xfb08('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xfb08('0x11'));var hardwareService=require(_0xfb08('0x12'));var logger=require(_0xfb08('0x13'))(_0xfb08('0x14'));var utils=require(_0xfb08('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xfb08('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24feb8,_0x20dd55){_0x20dd55=_0x20dd55||0xcc;return function(_0x3ce01f){if(_0x3ce01f){return _0x24feb8[_0xfb08('0x17')](_0x20dd55);}return _0x24feb8[_0xfb08('0x18')](_0x20dd55)[_0xfb08('0x19')]();};}function respondWithResult(_0x427991,_0x3f60aa){_0x3f60aa=_0x3f60aa||0xc8;return function(_0x1ea9d0){if(_0x1ea9d0){return _0x427991['status'](_0x3f60aa)[_0xfb08('0x1a')](_0x1ea9d0);}};}function respondWithFilteredResult(_0x2eeea5,_0x505597){return function(_0x1177ce){if(_0x1177ce){var _0x308be2=typeof _0x505597['offset']===_0xfb08('0x1b')&&typeof _0x505597[_0xfb08('0x1c')]==='undefined';var _0x2af683=_0x1177ce['count'];var _0xd8822e=_0x308be2?0x0:_0x505597['offset'];var _0x32c3d6=_0x308be2?_0x1177ce['count']:_0x505597['offset']+_0x505597['limit'];var _0x3df52e;if(_0x32c3d6>=_0x2af683){_0x32c3d6=_0x2af683;_0x3df52e=0xc8;}else{_0x3df52e=0xce;}_0x2eeea5[_0xfb08('0x18')](_0x3df52e);return _0x2eeea5[_0xfb08('0x1d')]('Content-Range',_0xd8822e+'-'+_0x32c3d6+'/'+_0x2af683)[_0xfb08('0x1a')](_0x1177ce);}return null;};}function patchUpdates(_0x2648c1){return function(_0x3cb358){try{jsonpatch[_0xfb08('0x1e')](_0x3cb358,_0x2648c1,!![]);}catch(_0x2f743d){return BPromise[_0xfb08('0x1f')](_0x2f743d);}return _0x3cb358[_0xfb08('0x20')]();};}function saveUpdates(_0x65f73d,_0x5ed8bc){return function(_0x21cef7){if(_0x21cef7){return _0x21cef7[_0xfb08('0x21')](_0x65f73d)[_0xfb08('0x22')](function(_0x419c03){return _0x419c03;});}return null;};}function removeEntity(_0xd61689,_0x3d8ba5){return function(_0x10ccab){if(_0x10ccab){return _0x10ccab[_0xfb08('0x23')]()['then'](function(){var _0x13db13=_0x10ccab[_0xfb08('0x24')]({'plain':!![]});var _0x48f398='ExtractedReports';return db[_0xfb08('0x25')][_0xfb08('0x23')]({'where':{'type':_0x48f398,'resourceId':_0x13db13['id']}})[_0xfb08('0x22')](function(){return _0x10ccab;});})['then'](function(){_0xd61689[_0xfb08('0x18')](0xcc)[_0xfb08('0x19')]();});}};}function handleEntityNotFound(_0xfa7eeb,_0x2c9424){return function(_0x3086af){if(!_0x3086af){_0xfa7eeb['sendStatus'](0x194);}return _0x3086af;};}function handleError(_0x3407d9,_0x54d6a4){_0x54d6a4=_0x54d6a4||0x1f4;return function(_0x156763){logger[_0xfb08('0x26')](_0x156763['stack']);if(_0x156763[_0xfb08('0x27')]){delete _0x156763[_0xfb08('0x27')];}_0x3407d9[_0xfb08('0x18')](_0x54d6a4)[_0xfb08('0x28')](_0x156763);};}exports[_0xfb08('0x29')]=function(_0x39647c,_0x4cf3e1){var _0x1d1983={},_0x2317b9={},_0x554b6f={'count':0x0,'rows':[]};var _0x4e868a=_[_0xfb08('0x2a')](db[_0xfb08('0x2b')][_0xfb08('0x2c')],function(_0x27ac12){return{'name':_0x27ac12[_0xfb08('0x2d')],'type':_0x27ac12[_0xfb08('0x2e')][_0xfb08('0x2f')]};});_0x2317b9['model']=_['map'](_0x4e868a,_0xfb08('0x27'));_0x2317b9[_0xfb08('0x30')]=_[_0xfb08('0x31')](_0x39647c[_0xfb08('0x30')]);_0x2317b9['filters']=_[_0xfb08('0x32')](_0x2317b9[_0xfb08('0x33')],_0x2317b9['query']);_0x1d1983[_0xfb08('0x34')]=_[_0xfb08('0x32')](_0x2317b9[_0xfb08('0x33')],qs[_0xfb08('0x35')](_0x39647c[_0xfb08('0x30')][_0xfb08('0x35')]));_0x1d1983[_0xfb08('0x34')]=_0x1d1983[_0xfb08('0x34')][_0xfb08('0x36')]?_0x1d1983[_0xfb08('0x34')]:_0x2317b9[_0xfb08('0x33')];if(!_0x39647c[_0xfb08('0x30')]['hasOwnProperty'](_0xfb08('0x37'))){_0x1d1983[_0xfb08('0x1c')]=qs[_0xfb08('0x1c')](_0x39647c[_0xfb08('0x30')]['limit']);_0x1d1983['offset']=qs[_0xfb08('0x38')](_0x39647c[_0xfb08('0x30')][_0xfb08('0x38')]);}_0x1d1983[_0xfb08('0x39')]=qs[_0xfb08('0x3a')](_0x39647c[_0xfb08('0x30')][_0xfb08('0x3a')]);_0x1d1983[_0xfb08('0x3b')]=qs[_0xfb08('0x3c')](_[_0xfb08('0x3d')](_0x39647c[_0xfb08('0x30')],_0x2317b9['filters']),_0x4e868a);if(_0x39647c[_0xfb08('0x30')][_0xfb08('0x3e')]){_0x1d1983[_0xfb08('0x3b')]=_['merge'](_0x1d1983[_0xfb08('0x3b')],{'$or':_[_0xfb08('0x2a')](_0x4e868a,function(_0x539d71){if(_0x539d71[_0xfb08('0x2e')]!==_0xfb08('0x3f')){var _0x2f85be={};_0x2f85be[_0x539d71['name']]={'$like':'%'+_0x39647c[_0xfb08('0x30')][_0xfb08('0x3e')]+'%'};return _0x2f85be;}})});}_0x1d1983=_[_0xfb08('0x40')]({},_0x1d1983,_0x39647c[_0xfb08('0x41')]);var _0x5dc08b={'where':_0x1d1983['where']};return db[_0xfb08('0x2b')][_0xfb08('0x42')](_0x5dc08b)[_0xfb08('0x22')](function(_0x92b1d7){_0x554b6f['count']=_0x92b1d7;if(_0x39647c[_0xfb08('0x30')]['includeAll']){_0x1d1983[_0xfb08('0x43')]=[{'all':!![]}];}return db[_0xfb08('0x2b')][_0xfb08('0x44')](_0x1d1983);})[_0xfb08('0x22')](function(_0x4a078d){_0x554b6f[_0xfb08('0x45')]=_0x4a078d;return _0x554b6f;})['then'](respondWithFilteredResult(_0x4cf3e1,_0x1d1983))[_0xfb08('0x46')](handleError(_0x4cf3e1,null));};exports[_0xfb08('0x47')]=function(_0x13965a,_0x148c25){var _0x3a3095={'raw':!![],'where':{'id':_0x13965a[_0xfb08('0x48')]['id']}},_0x2c69f8={};_0x2c69f8[_0xfb08('0x33')]=_[_0xfb08('0x31')](db[_0xfb08('0x2b')][_0xfb08('0x2c')]);_0x2c69f8[_0xfb08('0x30')]=_[_0xfb08('0x31')](_0x13965a['query']);_0x2c69f8[_0xfb08('0x3c')]=_[_0xfb08('0x32')](_0x2c69f8[_0xfb08('0x33')],_0x2c69f8[_0xfb08('0x30')]);_0x3a3095[_0xfb08('0x34')]=_[_0xfb08('0x32')](_0x2c69f8[_0xfb08('0x33')],qs[_0xfb08('0x35')](_0x13965a[_0xfb08('0x30')]['fields']));_0x3a3095[_0xfb08('0x34')]=_0x3a3095['attributes'][_0xfb08('0x36')]?_0x3a3095[_0xfb08('0x34')]:_0x2c69f8['model'];if(_0x13965a['query'][_0xfb08('0x49')]){_0x3a3095[_0xfb08('0x43')]=[{'all':!![]}];}_0x3a3095=_[_0xfb08('0x40')]({},_0x3a3095,_0x13965a[_0xfb08('0x41')]);return db['AnalyticExtractedReport']['find'](_0x3a3095)[_0xfb08('0x22')](handleEntityNotFound(_0x148c25,null))[_0xfb08('0x22')](respondWithResult(_0x148c25,null))['catch'](handleError(_0x148c25,null));};exports[_0xfb08('0x4a')]=function(_0x34157f,_0x3fd503){return db['AnalyticExtractedReport'][_0xfb08('0x4a')](_0x34157f['body'],{})[_0xfb08('0x22')](function(_0x3227a1){var _0x35253a=_0x34157f[_0xfb08('0x4b')][_0xfb08('0x24')]({'plain':!![]});if(!_0x35253a)throw new Error(_0xfb08('0x4c'));if(_0x35253a[_0xfb08('0x4d')]===_0xfb08('0x4b')){var _0x48ceaa=_0x3227a1['get']({'plain':!![]});var _0x955c0d=_0xfb08('0x4e');return db[_0xfb08('0x4f')][_0xfb08('0x50')]({'where':{'name':_0x955c0d,'userProfileId':_0x35253a['userProfileId']},'raw':!![]})[_0xfb08('0x22')](function(_0x42ba5d){if(_0x42ba5d&&_0x42ba5d[_0xfb08('0x51')]===0x0){return db[_0xfb08('0x25')][_0xfb08('0x4a')]({'name':_0x48ceaa['name'],'resourceId':_0x48ceaa['id'],'type':_0x42ba5d[_0xfb08('0x27')],'sectionId':_0x42ba5d['id']},{})[_0xfb08('0x22')](function(){return _0x3227a1;});}else{return _0x3227a1;}})[_0xfb08('0x46')](function(_0x179d62){logger[_0xfb08('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x179d62);throw _0x179d62;});}return _0x3227a1;})[_0xfb08('0x22')](respondWithResult(_0x3fd503,0xc9))[_0xfb08('0x46')](handleError(_0x3fd503,null));};exports[_0xfb08('0x21')]=function(_0x4d1c7e,_0x5e2fc0){if(_0x4d1c7e['body']['id']){delete _0x4d1c7e[_0xfb08('0x52')]['id'];}return db[_0xfb08('0x2b')]['find']({'where':{'id':_0x4d1c7e[_0xfb08('0x48')]['id']}})[_0xfb08('0x22')](handleEntityNotFound(_0x5e2fc0,null))[_0xfb08('0x22')](saveUpdates(_0x4d1c7e[_0xfb08('0x52')],null))[_0xfb08('0x22')](respondWithResult(_0x5e2fc0,null))['catch'](handleError(_0x5e2fc0,null));};exports[_0xfb08('0x23')]=function(_0x2eba31,_0x122337){return db[_0xfb08('0x2b')][_0xfb08('0x50')]({'where':{'id':_0x2eba31[_0xfb08('0x48')]['id']}})[_0xfb08('0x22')](handleEntityNotFound(_0x122337,null))[_0xfb08('0x22')](removeEntity(_0x122337,null))[_0xfb08('0x46')](handleError(_0x122337,null));};exports['download']=function(_0x3e2837,_0x18d2e1,_0x3d789d){return db[_0xfb08('0x2b')][_0xfb08('0x50')]({'where':{'id':_0x3e2837['params']['id']},'attributes':[_0xfb08('0x27'),_0xfb08('0x53'),_0xfb08('0x54'),_0xfb08('0x55')],'raw':!![]})[_0xfb08('0x22')](handleEntityNotFound(_0x18d2e1,null))[_0xfb08('0x22')](function(_0x4b6628){if(_0x4b6628){if(!fs[_0xfb08('0x56')](path[_0xfb08('0x57')](config[_0xfb08('0x58')],_0xfb08('0x59'),_0x4b6628[_0xfb08('0x54')]))){throw new db[(_0xfb08('0x5a'))]['ValidationError'](_0xfb08('0x5b'));}if(_0x3e2837[_0xfb08('0x30')][_0xfb08('0x5c')]){return _0x18d2e1['sendStatus'](0xc8);}return _0x18d2e1[_0xfb08('0x5d')](path['join'](config['root'],_0xfb08('0x59'),_0x4b6628['savename']),util[_0xfb08('0x5e')](_0xfb08('0x5f'),_0x4b6628[_0xfb08('0x53')]||_0x4b6628['name'],_0x4b6628[_0xfb08('0x55')]['toLowerCase']()));}})['catch'](handleError(_0x18d2e1,null));};
\ No newline at end of file
+var _0x234a=['merge','VIRTUAL','filter','options','AnalyticExtractedReport','includeAll','include','show','params','rawAttributes','find','catch','create','user','role','ExtractedReports','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','basename','savename','output','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','then','get','error','stack','name','send','index','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','order','where'];(function(_0x6e6098,_0x5fa384){var _0xcf2c19=function(_0x218eb3){while(--_0x218eb3){_0x6e6098['push'](_0x6e6098['shift']());}};_0xcf2c19(++_0x5fa384);}(_0x234a,0x18e));var _0xa234=function(_0x2f23c6,_0x8eacbc){_0x2f23c6=_0x2f23c6-0x0;var _0x12e26a=_0x234a[_0x2f23c6];return _0x12e26a;};'use strict';var emlformat=require(_0xa234('0x0'));var rimraf=require(_0xa234('0x1'));var zipdir=require(_0xa234('0x2'));var jsonpatch=require(_0xa234('0x3'));var rp=require(_0xa234('0x4'));var moment=require(_0xa234('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa234('0x6'));var util=require(_0xa234('0x7'));var path=require(_0xa234('0x8'));var sox=require(_0xa234('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa234('0xa'));var crypto=require(_0xa234('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa234('0xc'));var toCsv=require(_0xa234('0xd'));var querystring=require('querystring');var Papa=require(_0xa234('0xe'));var Redis=require(_0xa234('0xf'));var authService=require(_0xa234('0x10'));var qs=require(_0xa234('0x11'));var as=require(_0xa234('0x12'));var hardwareService=require(_0xa234('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xa234('0x14'));var config=require(_0xa234('0x15'));var licenseUtil=require(_0xa234('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d7bd5,_0x398d34){_0x398d34=_0x398d34||0xcc;return function(_0x1c1dfd){if(_0x1c1dfd){return _0x2d7bd5[_0xa234('0x17')](_0x398d34);}return _0x2d7bd5[_0xa234('0x18')](_0x398d34)[_0xa234('0x19')]();};}function respondWithResult(_0x2cc849,_0x2ab4d8){_0x2ab4d8=_0x2ab4d8||0xc8;return function(_0x28227c){if(_0x28227c){return _0x2cc849['status'](_0x2ab4d8)['json'](_0x28227c);}};}function respondWithFilteredResult(_0x4d3245,_0x1b3ffb){return function(_0x119ccb){if(_0x119ccb){var _0x52d960=typeof _0x1b3ffb[_0xa234('0x1a')]===_0xa234('0x1b')&&typeof _0x1b3ffb[_0xa234('0x1c')]==='undefined';var _0x380741=_0x119ccb[_0xa234('0x1d')];var _0x25887e=_0x52d960?0x0:_0x1b3ffb[_0xa234('0x1a')];var _0x1d8cfb=_0x52d960?_0x119ccb[_0xa234('0x1d')]:_0x1b3ffb[_0xa234('0x1a')]+_0x1b3ffb[_0xa234('0x1c')];var _0x2d72ad;if(_0x1d8cfb>=_0x380741){_0x1d8cfb=_0x380741;_0x2d72ad=0xc8;}else{_0x2d72ad=0xce;}_0x4d3245[_0xa234('0x18')](_0x2d72ad);return _0x4d3245['set'](_0xa234('0x1e'),_0x25887e+'-'+_0x1d8cfb+'/'+_0x380741)[_0xa234('0x1f')](_0x119ccb);}return null;};}function patchUpdates(_0x4fb519){return function(_0x341530){try{jsonpatch[_0xa234('0x20')](_0x341530,_0x4fb519,!![]);}catch(_0x5ef0c7){return BPromise[_0xa234('0x21')](_0x5ef0c7);}return _0x341530[_0xa234('0x22')]();};}function saveUpdates(_0x40e972,_0x23a23e){return function(_0x4630e1){if(_0x4630e1){return _0x4630e1[_0xa234('0x23')](_0x40e972)['then'](function(_0x46c4e7){return _0x46c4e7;});}return null;};}function removeEntity(_0x560750,_0x242447){return function(_0x18f476){if(_0x18f476){return _0x18f476[_0xa234('0x24')]()[_0xa234('0x25')](function(){var _0x5047ac=_0x18f476[_0xa234('0x26')]({'plain':!![]});var _0x19ed6d='ExtractedReports';return db['UserProfileResource'][_0xa234('0x24')]({'where':{'type':_0x19ed6d,'resourceId':_0x5047ac['id']}})[_0xa234('0x25')](function(){return _0x18f476;});})['then'](function(){_0x560750[_0xa234('0x18')](0xcc)[_0xa234('0x19')]();});}};}function handleEntityNotFound(_0x12050c,_0x496283){return function(_0x2cf348){if(!_0x2cf348){_0x12050c[_0xa234('0x17')](0x194);}return _0x2cf348;};}function handleError(_0x15025d,_0x3fe62a){_0x3fe62a=_0x3fe62a||0x1f4;return function(_0x2a2594){logger[_0xa234('0x27')](_0x2a2594[_0xa234('0x28')]);if(_0x2a2594[_0xa234('0x29')]){delete _0x2a2594['name'];}_0x15025d['status'](_0x3fe62a)[_0xa234('0x2a')](_0x2a2594);};}exports[_0xa234('0x2b')]=function(_0x3de3d2,_0x351515){var _0x3bb6a6={},_0xec2031={},_0x371aa6={'count':0x0,'rows':[]};var _0x6b2ecb=_['map'](db['AnalyticExtractedReport']['rawAttributes'],function(_0x1ddb5f){return{'name':_0x1ddb5f['fieldName'],'type':_0x1ddb5f[_0xa234('0x2c')][_0xa234('0x2d')]};});_0xec2031[_0xa234('0x2e')]=_[_0xa234('0x2f')](_0x6b2ecb,'name');_0xec2031[_0xa234('0x30')]=_[_0xa234('0x31')](_0x3de3d2[_0xa234('0x30')]);_0xec2031[_0xa234('0x32')]=_['intersection'](_0xec2031[_0xa234('0x2e')],_0xec2031[_0xa234('0x30')]);_0x3bb6a6[_0xa234('0x33')]=_[_0xa234('0x34')](_0xec2031[_0xa234('0x2e')],qs[_0xa234('0x35')](_0x3de3d2[_0xa234('0x30')]['fields']));_0x3bb6a6[_0xa234('0x33')]=_0x3bb6a6[_0xa234('0x33')][_0xa234('0x36')]?_0x3bb6a6[_0xa234('0x33')]:_0xec2031[_0xa234('0x2e')];if(!_0x3de3d2[_0xa234('0x30')]['hasOwnProperty']('nolimit')){_0x3bb6a6[_0xa234('0x1c')]=qs[_0xa234('0x1c')](_0x3de3d2[_0xa234('0x30')][_0xa234('0x1c')]);_0x3bb6a6[_0xa234('0x1a')]=qs['offset'](_0x3de3d2[_0xa234('0x30')][_0xa234('0x1a')]);}_0x3bb6a6[_0xa234('0x37')]=qs['sort'](_0x3de3d2[_0xa234('0x30')]['sort']);_0x3bb6a6[_0xa234('0x38')]=qs[_0xa234('0x32')](_['pick'](_0x3de3d2[_0xa234('0x30')],_0xec2031[_0xa234('0x32')]),_0x6b2ecb);if(_0x3de3d2[_0xa234('0x30')]['filter']){_0x3bb6a6[_0xa234('0x38')]=_[_0xa234('0x39')](_0x3bb6a6[_0xa234('0x38')],{'$or':_[_0xa234('0x2f')](_0x6b2ecb,function(_0x3e900a){if(_0x3e900a[_0xa234('0x2c')]!==_0xa234('0x3a')){var _0x3da3ce={};_0x3da3ce[_0x3e900a[_0xa234('0x29')]]={'$like':'%'+_0x3de3d2[_0xa234('0x30')][_0xa234('0x3b')]+'%'};return _0x3da3ce;}})});}_0x3bb6a6=_[_0xa234('0x39')]({},_0x3bb6a6,_0x3de3d2[_0xa234('0x3c')]);var _0xe53329={'where':_0x3bb6a6[_0xa234('0x38')]};return db[_0xa234('0x3d')][_0xa234('0x1d')](_0xe53329)['then'](function(_0x3c96db){_0x371aa6[_0xa234('0x1d')]=_0x3c96db;if(_0x3de3d2[_0xa234('0x30')][_0xa234('0x3e')]){_0x3bb6a6[_0xa234('0x3f')]=[{'all':!![]}];}return db[_0xa234('0x3d')]['findAll'](_0x3bb6a6);})[_0xa234('0x25')](function(_0x5b8992){_0x371aa6['rows']=_0x5b8992;return _0x371aa6;})[_0xa234('0x25')](respondWithFilteredResult(_0x351515,_0x3bb6a6))['catch'](handleError(_0x351515,null));};exports[_0xa234('0x40')]=function(_0xa149ef,_0x3c0d2d){var _0x28b332={'raw':!![],'where':{'id':_0xa149ef[_0xa234('0x41')]['id']}},_0x1e84d9={};_0x1e84d9['model']=_['keys'](db[_0xa234('0x3d')][_0xa234('0x42')]);_0x1e84d9['query']=_[_0xa234('0x31')](_0xa149ef['query']);_0x1e84d9[_0xa234('0x32')]=_[_0xa234('0x34')](_0x1e84d9[_0xa234('0x2e')],_0x1e84d9[_0xa234('0x30')]);_0x28b332['attributes']=_[_0xa234('0x34')](_0x1e84d9['model'],qs[_0xa234('0x35')](_0xa149ef[_0xa234('0x30')][_0xa234('0x35')]));_0x28b332[_0xa234('0x33')]=_0x28b332[_0xa234('0x33')][_0xa234('0x36')]?_0x28b332[_0xa234('0x33')]:_0x1e84d9[_0xa234('0x2e')];if(_0xa149ef[_0xa234('0x30')][_0xa234('0x3e')]){_0x28b332[_0xa234('0x3f')]=[{'all':!![]}];}_0x28b332=_['merge']({},_0x28b332,_0xa149ef[_0xa234('0x3c')]);return db[_0xa234('0x3d')][_0xa234('0x43')](_0x28b332)[_0xa234('0x25')](handleEntityNotFound(_0x3c0d2d,null))[_0xa234('0x25')](respondWithResult(_0x3c0d2d,null))[_0xa234('0x44')](handleError(_0x3c0d2d,null));};exports[_0xa234('0x45')]=function(_0x3f3985,_0x2571e7){return db[_0xa234('0x3d')][_0xa234('0x45')](_0x3f3985['body'],{})[_0xa234('0x25')](function(_0x1b8150){var _0xe666a7=_0x3f3985[_0xa234('0x46')][_0xa234('0x26')]({'plain':!![]});if(!_0xe666a7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe666a7[_0xa234('0x47')]==='user'){var _0x4db157=_0x1b8150[_0xa234('0x26')]({'plain':!![]});var _0x3aff61=_0xa234('0x48');return db[_0xa234('0x49')][_0xa234('0x43')]({'where':{'name':_0x3aff61,'userProfileId':_0xe666a7['userProfileId']},'raw':!![]})['then'](function(_0x21ae74){if(_0x21ae74&&_0x21ae74[_0xa234('0x4a')]===0x0){return db['UserProfileResource'][_0xa234('0x45')]({'name':_0x4db157[_0xa234('0x29')],'resourceId':_0x4db157['id'],'type':_0x21ae74[_0xa234('0x29')],'sectionId':_0x21ae74['id']},{})[_0xa234('0x25')](function(){return _0x1b8150;});}else{return _0x1b8150;}})[_0xa234('0x44')](function(_0x34205b){logger[_0xa234('0x27')](_0xa234('0x4b'),_0x34205b);throw _0x34205b;});}return _0x1b8150;})[_0xa234('0x25')](respondWithResult(_0x2571e7,0xc9))[_0xa234('0x44')](handleError(_0x2571e7,null));};exports['update']=function(_0x5318c1,_0x7b4374){if(_0x5318c1[_0xa234('0x4c')]['id']){delete _0x5318c1['body']['id'];}return db[_0xa234('0x3d')]['find']({'where':{'id':_0x5318c1[_0xa234('0x41')]['id']}})[_0xa234('0x25')](handleEntityNotFound(_0x7b4374,null))[_0xa234('0x25')](saveUpdates(_0x5318c1[_0xa234('0x4c')],null))['then'](respondWithResult(_0x7b4374,null))[_0xa234('0x44')](handleError(_0x7b4374,null));};exports[_0xa234('0x24')]=function(_0x11d98a,_0x1ade36){return db['AnalyticExtractedReport'][_0xa234('0x43')]({'where':{'id':_0x11d98a['params']['id']}})[_0xa234('0x25')](handleEntityNotFound(_0x1ade36,null))[_0xa234('0x25')](removeEntity(_0x1ade36,null))[_0xa234('0x44')](handleError(_0x1ade36,null));};exports[_0xa234('0x4d')]=function(_0x21dd86,_0x459103,_0x27c743){return db['AnalyticExtractedReport'][_0xa234('0x43')]({'where':{'id':_0x21dd86[_0xa234('0x41')]['id']},'attributes':[_0xa234('0x29'),_0xa234('0x4e'),_0xa234('0x4f'),_0xa234('0x50')],'raw':!![]})[_0xa234('0x25')](handleEntityNotFound(_0x459103,null))['then'](function(_0x5da9a1){if(_0x5da9a1){if(!fs['existsSync'](path[_0xa234('0x51')](config[_0xa234('0x52')],_0xa234('0x53'),_0x5da9a1['savename']))){throw new db[(_0xa234('0x54'))][(_0xa234('0x55'))](_0xa234('0x56'));}if(_0x21dd86[_0xa234('0x30')][_0xa234('0x57')]){return _0x459103['sendStatus'](0xc8);}return _0x459103['download'](path['join'](config[_0xa234('0x52')],'server/files/reports',_0x5da9a1['savename']),util[_0xa234('0x58')](_0xa234('0x59'),_0x5da9a1[_0xa234('0x4e')]||_0x5da9a1[_0xa234('0x29')],_0x5da9a1[_0xa234('0x50')][_0xa234('0x5a')]()));}})[_0xa234('0x44')](handleError(_0x459103,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index b6e0e7d..84d3c2b 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 _0xcbbc=['path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','api','moment','request-promise'];(function(_0x2b9e6c,_0x39e705){var _0x4ed3da=function(_0x240c88){while(--_0x240c88){_0x2b9e6c['push'](_0x2b9e6c['shift']());}};_0x4ed3da(++_0x39e705);}(_0xcbbc,0xeb));var _0xccbb=function(_0x57db49,_0x288094){_0x57db49=_0x57db49-0x0;var _0xd0636f=_0xcbbc[_0x57db49];return _0xd0636f;};'use strict';var _=require('lodash');var util=require(_0xccbb('0x0'));var logger=require(_0xccbb('0x1'))(_0xccbb('0x2'));var moment=require(_0xccbb('0x3'));var BPromise=require('bluebird');var rp=require(_0xccbb('0x4'));var fs=require('fs');var path=require(_0xccbb('0x5'));var rimraf=require(_0xccbb('0x6'));var config=require(_0xccbb('0x7'));var attributes=require(_0xccbb('0x8'));module[_0xccbb('0x9')]=function(_0x23fcfe,_0x52dc6f){return _0x23fcfe['define'](_0xccbb('0xa'),attributes,{'tableName':_0xccbb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6681=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util'];(function(_0x4b0581,_0x2e47f7){var _0x5a8f4d=function(_0x418603){while(--_0x418603){_0x4b0581['push'](_0x4b0581['shift']());}};_0x5a8f4d(++_0x2e47f7);}(_0x6681,0xb4));var _0x1668=function(_0x2927a6,_0x4c6c2f){_0x2927a6=_0x2927a6-0x0;var _0x3c7a6f=_0x6681[_0x2927a6];return _0x3c7a6f;};'use strict';var _=require(_0x1668('0x0'));var util=require(_0x1668('0x1'));var logger=require(_0x1668('0x2'))('api');var moment=require(_0x1668('0x3'));var BPromise=require(_0x1668('0x4'));var rp=require(_0x1668('0x5'));var fs=require('fs');var path=require(_0x1668('0x6'));var rimraf=require(_0x1668('0x7'));var config=require(_0x1668('0x8'));var attributes=require(_0x1668('0x9'));module[_0x1668('0xa')]=function(_0x3e0b54,_0x3572f3){return _0x3e0b54[_0x1668('0xb')](_0x1668('0xc'),attributes,{'tableName':_0x1668('0xd'),'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 1c29572..3cf385c 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 _0xfa88=['code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfa88,0x1a7));var _0x8fa8=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xfa88[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x8fa8('0x0'));var util=require(_0x8fa8('0x1'));var moment=require('moment');var BPromise=require(_0x8fa8('0x2'));var rs=require(_0x8fa8('0x3'));var fs=require('fs');var Redis=require(_0x8fa8('0x4'));var db=require(_0x8fa8('0x5'))['db'];var utils=require(_0x8fa8('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8fa8('0x7'));var client=jayson[_0x8fa8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c40d8,_0x5dcb2a,_0x5f54b4){return new BPromise(function(_0x3f08be,_0x31a69a){return client[_0x8fa8('0x9')](_0x5c40d8,_0x5f54b4)['then'](function(_0x5d29ef){logger[_0x8fa8('0xa')](_0x8fa8('0xb'),_0x5dcb2a,_0x8fa8('0xc'));logger[_0x8fa8('0xd')](_0x8fa8('0xe'),_0x5dcb2a,_0x8fa8('0xc'),JSON[_0x8fa8('0xf')](_0x5d29ef));if(_0x5d29ef[_0x8fa8('0x10')]){if(_0x5d29ef['error'][_0x8fa8('0x11')]===0x1f4){logger[_0x8fa8('0x10')](_0x8fa8('0xb'),_0x5dcb2a,_0x5d29ef[_0x8fa8('0x10')][_0x8fa8('0x12')]);return _0x31a69a(_0x5d29ef[_0x8fa8('0x10')][_0x8fa8('0x12')]);}logger[_0x8fa8('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5dcb2a,_0x5d29ef[_0x8fa8('0x10')][_0x8fa8('0x12')]);return _0x3f08be(_0x5d29ef['error']['message']);}else{logger[_0x8fa8('0xa')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5dcb2a,'request\x20sent');_0x3f08be(_0x5d29ef['result']['message']);}})[_0x8fa8('0x13')](function(_0x1c106f){logger[_0x8fa8('0x10')](_0x8fa8('0xb'),_0x5dcb2a,_0x1c106f);_0x31a69a(_0x1c106f);});});}
\ No newline at end of file
+var _0xad35=['../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x30c649,_0x2ebbac){var _0x3edfb9=function(_0xab82f5){while(--_0xab82f5){_0x30c649['push'](_0x30c649['shift']());}};_0x3edfb9(++_0x2ebbac);}(_0xad35,0xd0));var _0x5ad3=function(_0x5a5e22,_0x224fe5){_0x5a5e22=_0x5a5e22-0x0;var _0x39eb18=_0xad35[_0x5a5e22];return _0x39eb18;};'use strict';var _=require(_0x5ad3('0x0'));var util=require(_0x5ad3('0x1'));var moment=require(_0x5ad3('0x2'));var BPromise=require(_0x5ad3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ad3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5ad3('0x5'));var logger=require(_0x5ad3('0x6'))(_0x5ad3('0x7'));var config=require(_0x5ad3('0x8'));var jayson=require(_0x5ad3('0x9'));var client=jayson[_0x5ad3('0xa')][_0x5ad3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f64a7,_0x50fa7a,_0x1f0d8f){return new BPromise(function(_0x3fef0e,_0x4b3e6b){return client[_0x5ad3('0xc')](_0x1f64a7,_0x1f0d8f)[_0x5ad3('0xd')](function(_0x56d0c7){logger[_0x5ad3('0xe')](_0x5ad3('0xf'),_0x50fa7a,'request\x20sent');logger[_0x5ad3('0x10')](_0x5ad3('0x11'),_0x50fa7a,_0x5ad3('0x12'),JSON['stringify'](_0x56d0c7));if(_0x56d0c7['error']){if(_0x56d0c7['error'][_0x5ad3('0x13')]===0x1f4){logger[_0x5ad3('0x14')](_0x5ad3('0xf'),_0x50fa7a,_0x56d0c7[_0x5ad3('0x14')][_0x5ad3('0x15')]);return _0x4b3e6b(_0x56d0c7[_0x5ad3('0x14')][_0x5ad3('0x15')]);}logger[_0x5ad3('0x14')](_0x5ad3('0xf'),_0x50fa7a,_0x56d0c7[_0x5ad3('0x14')][_0x5ad3('0x15')]);return _0x3fef0e(_0x56d0c7[_0x5ad3('0x14')][_0x5ad3('0x15')]);}else{logger[_0x5ad3('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x50fa7a,'request\x20sent');_0x3fef0e(_0x56d0c7[_0x5ad3('0x16')][_0x5ad3('0x15')]);}})[_0x5ad3('0x17')](function(_0x1259da){logger[_0x5ad3('0x14')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x50fa7a,_0x1259da);_0x4b3e6b(_0x1259da);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 3a470d0..8aaf557 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 _0x452f=['express','Router','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','create','put','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x22660a,_0x32955a){var _0x10785a=function(_0x126cf5){while(--_0x126cf5){_0x22660a['push'](_0x22660a['shift']());}};_0x10785a(++_0x32955a);}(_0x452f,0x138));var _0xf452=function(_0x1562a2,_0x2e4655){_0x1562a2=_0x1562a2-0x0;var _0x39a636=_0x452f[_0x1562a2];return _0x39a636;};'use strict';var multer=require(_0xf452('0x0'));var util=require('util');var path=require(_0xf452('0x1'));var timeout=require(_0xf452('0x2'));var express=require(_0xf452('0x3'));var router=express[_0xf452('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf452('0x5'));var config=require(_0xf452('0x6'));var controller=require(_0xf452('0x7'));router[_0xf452('0x8')]('/',auth[_0xf452('0x9')](),controller[_0xf452('0xa')]);router[_0xf452('0x8')](_0xf452('0xb'),auth['isAuthenticated'](),controller[_0xf452('0xc')]);router['get'](_0xf452('0xd'),auth[_0xf452('0x9')](),controller[_0xf452('0xe')]);router['post']('/',auth[_0xf452('0x9')](),controller[_0xf452('0xf')]);router[_0xf452('0x10')](_0xf452('0xb'),auth[_0xf452('0x9')](),controller[_0xf452('0x11')]);router[_0xf452('0x12')](_0xf452('0xb'),auth['isAuthenticated'](),controller[_0xf452('0x13')]);module[_0xf452('0x14')]=router;
\ No newline at end of file
+var _0x1d2e=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','/:id','show','get','/:id/download','post','create','update','delete','exports','multer','util','path'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x1d2e,0x19f));var _0xe1d2=function(_0x3f7dfc,_0x8f0dad){_0x3f7dfc=_0x3f7dfc-0x0;var _0x499d09=_0x1d2e[_0x3f7dfc];return _0x499d09;};'use strict';var multer=require(_0xe1d2('0x0'));var util=require(_0xe1d2('0x1'));var path=require(_0xe1d2('0x2'));var timeout=require(_0xe1d2('0x3'));var express=require(_0xe1d2('0x4'));var router=express[_0xe1d2('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe1d2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe1d2('0x7'));var controller=require('./analyticExtractedReport.controller');router['get']('/',auth[_0xe1d2('0x8')](),controller[_0xe1d2('0x9')]);router['get'](_0xe1d2('0xa'),auth[_0xe1d2('0x8')](),controller[_0xe1d2('0xb')]);router[_0xe1d2('0xc')](_0xe1d2('0xd'),auth[_0xe1d2('0x8')](),controller['download']);router[_0xe1d2('0xe')]('/',auth[_0xe1d2('0x8')](),controller[_0xe1d2('0xf')]);router['put'](_0xe1d2('0xa'),auth['isAuthenticated'](),controller[_0xe1d2('0x10')]);router[_0xe1d2('0x11')](_0xe1d2('0xa'),auth[_0xe1d2('0x8')](),controller['destroy']);module[_0xe1d2('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 5806bd9..fceaba5 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 _0x7f14=['STRING','BOOLEAN','exports','TEXT'];(function(_0xf0ec6e,_0xa183d3){var _0x8bbc27=function(_0x39822b){while(--_0x39822b){_0xf0ec6e['push'](_0xf0ec6e['shift']());}};_0x8bbc27(++_0xa183d3);}(_0x7f14,0x1ba));var _0x47f1=function(_0x273c4e,_0x42074a){_0x273c4e=_0x273c4e-0x0;var _0x13feda=_0x7f14[_0x273c4e];return _0x13feda;};'use strict';var Sequelize=require('sequelize');module[_0x47f1('0x0')]={'field':{'type':Sequelize[_0x47f1('0x1')]},'alias':{'type':Sequelize[_0x47f1('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x47f1('0x2')]},'groupBy':{'type':Sequelize[_0x47f1('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x7651=['exports','TEXT','STRING','BOOLEAN'];(function(_0x5678d2,_0x46ae41){var _0x40a15a=function(_0x2be971){while(--_0x2be971){_0x5678d2['push'](_0x5678d2['shift']());}};_0x40a15a(++_0x46ae41);}(_0x7651,0xa0));var _0x1765=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7651[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x1765('0x0')]={'field':{'type':Sequelize[_0x1765('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x1765('0x2')]},'format':{'type':Sequelize[_0x1765('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x1765('0x2')]},'custom':{'type':Sequelize[_0x1765('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 1bedae4..124f99a 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 _0x0b99=['index','map','AnalyticFieldReport','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','options','include','findAll','params','includeAll','find','catch','create','body','destroy','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','bulkCreate','eml-format','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','error','name','send'];(function(_0x243bba,_0x1ea69f){var _0x12e696=function(_0x5d3ab5){while(--_0x5d3ab5){_0x243bba['push'](_0x243bba['shift']());}};_0x12e696(++_0x1ea69f);}(_0x0b99,0x1bc));var _0x90b9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0b99[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x90b9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x90b9('0x1'));var BPromise=require(_0x90b9('0x2'));var Mustache=require(_0x90b9('0x3'));var util=require(_0x90b9('0x4'));var path=require(_0x90b9('0x5'));var sox=require(_0x90b9('0x6'));var csv=require(_0x90b9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x90b9('0x8'));var _=require(_0x90b9('0x9'));var squel=require(_0x90b9('0xa'));var crypto=require('crypto');var jsforce=require(_0x90b9('0xb'));var deskjs=require(_0x90b9('0xc'));var toCsv=require(_0x90b9('0x7'));var querystring=require(_0x90b9('0xd'));var Papa=require('papaparse');var Redis=require(_0x90b9('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x90b9('0xf'));var as=require(_0x90b9('0x10'));var hardwareService=require(_0x90b9('0x11'));var logger=require(_0x90b9('0x12'))(_0x90b9('0x13'));var utils=require(_0x90b9('0x14'));var config=require(_0x90b9('0x15'));var licenseUtil=require(_0x90b9('0x16'));var db=require(_0x90b9('0x17'))['db'];function respondWithStatusCode(_0x55d111,_0x235580){_0x235580=_0x235580||0xcc;return function(_0x7521b){if(_0x7521b){return _0x55d111[_0x90b9('0x18')](_0x235580);}return _0x55d111['status'](_0x235580)[_0x90b9('0x19')]();};}function respondWithResult(_0x11f325,_0x1b254b){_0x1b254b=_0x1b254b||0xc8;return function(_0x2f31f6){if(_0x2f31f6){return _0x11f325['status'](_0x1b254b)[_0x90b9('0x1a')](_0x2f31f6);}};}function respondWithFilteredResult(_0x42c3b1,_0x4fcc49){return function(_0x417049){if(_0x417049){var _0x23a32a=typeof _0x4fcc49[_0x90b9('0x1b')]===_0x90b9('0x1c')&&typeof _0x4fcc49[_0x90b9('0x1d')]==='undefined';var _0x1bce2a=_0x417049[_0x90b9('0x1e')];var _0x5d921a=_0x23a32a?0x0:_0x4fcc49[_0x90b9('0x1b')];var _0x3a5e3d=_0x23a32a?_0x417049['count']:_0x4fcc49['offset']+_0x4fcc49['limit'];var _0x570ff4;if(_0x3a5e3d>=_0x1bce2a){_0x3a5e3d=_0x1bce2a;_0x570ff4=0xc8;}else{_0x570ff4=0xce;}_0x42c3b1[_0x90b9('0x1f')](_0x570ff4);return _0x42c3b1[_0x90b9('0x20')](_0x90b9('0x21'),_0x5d921a+'-'+_0x3a5e3d+'/'+_0x1bce2a)['json'](_0x417049);}return null;};}function patchUpdates(_0x4628da){return function(_0x2c1ad8){try{jsonpatch[_0x90b9('0x22')](_0x2c1ad8,_0x4628da,!![]);}catch(_0x3ac16a){return BPromise[_0x90b9('0x23')](_0x3ac16a);}return _0x2c1ad8[_0x90b9('0x24')]();};}function saveUpdates(_0x35b43b,_0x5dae0b){return function(_0x3ec4fa){if(_0x3ec4fa){return _0x3ec4fa[_0x90b9('0x25')](_0x35b43b)[_0x90b9('0x26')](function(_0x266a39){return _0x266a39;});}return null;};}function removeEntity(_0x388684,_0x2a75a9){return function(_0x4ccddf){if(_0x4ccddf){return _0x4ccddf['destroy']()['then'](function(){_0x388684[_0x90b9('0x1f')](0xcc)[_0x90b9('0x19')]();});}};}function handleEntityNotFound(_0x28b56a,_0xb47df7){return function(_0x4179eb){if(!_0x4179eb){_0x28b56a['sendStatus'](0x194);}return _0x4179eb;};}function handleError(_0x3d7490,_0x820186){_0x820186=_0x820186||0x1f4;return function(_0x47c2e1){logger[_0x90b9('0x27')](_0x47c2e1['stack']);if(_0x47c2e1['name']){delete _0x47c2e1[_0x90b9('0x28')];}_0x3d7490[_0x90b9('0x1f')](_0x820186)[_0x90b9('0x29')](_0x47c2e1);};}exports[_0x90b9('0x2a')]=function(_0x1ab4f6,_0x160729){var _0x4ed665={},_0x1350b2={},_0x8432ac={'count':0x0,'rows':[]};var _0x4c3f15=_[_0x90b9('0x2b')](db[_0x90b9('0x2c')]['rawAttributes'],function(_0x5a1a58){return{'name':_0x5a1a58[_0x90b9('0x2d')],'type':_0x5a1a58[_0x90b9('0x2e')][_0x90b9('0x2f')]};});_0x1350b2[_0x90b9('0x30')]=_['map'](_0x4c3f15,_0x90b9('0x28'));_0x1350b2[_0x90b9('0x31')]=_[_0x90b9('0x32')](_0x1ab4f6['query']);_0x1350b2['filters']=_[_0x90b9('0x33')](_0x1350b2[_0x90b9('0x30')],_0x1350b2[_0x90b9('0x31')]);_0x4ed665['attributes']=_[_0x90b9('0x33')](_0x1350b2[_0x90b9('0x30')],qs[_0x90b9('0x34')](_0x1ab4f6[_0x90b9('0x31')][_0x90b9('0x34')]));_0x4ed665[_0x90b9('0x35')]=_0x4ed665['attributes'][_0x90b9('0x36')]?_0x4ed665[_0x90b9('0x35')]:_0x1350b2[_0x90b9('0x30')];if(!_0x1ab4f6[_0x90b9('0x31')][_0x90b9('0x37')](_0x90b9('0x38'))){_0x4ed665[_0x90b9('0x1d')]=qs[_0x90b9('0x1d')](_0x1ab4f6[_0x90b9('0x31')][_0x90b9('0x1d')]);_0x4ed665[_0x90b9('0x1b')]=qs[_0x90b9('0x1b')](_0x1ab4f6[_0x90b9('0x31')]['offset']);}_0x4ed665[_0x90b9('0x39')]=qs[_0x90b9('0x3a')](_0x1ab4f6[_0x90b9('0x31')][_0x90b9('0x3a')]);_0x4ed665['where']=qs[_0x90b9('0x3b')](_['pick'](_0x1ab4f6['query'],_0x1350b2[_0x90b9('0x3b')]),_0x4c3f15);if(_0x1ab4f6[_0x90b9('0x31')][_0x90b9('0x3c')]){_0x4ed665[_0x90b9('0x3d')]=_[_0x90b9('0x3e')](_0x4ed665[_0x90b9('0x3d')],{'$or':_[_0x90b9('0x2b')](_0x4c3f15,function(_0x755dcf){if(_0x755dcf[_0x90b9('0x2e')]!=='VIRTUAL'){var _0x179475={};_0x179475[_0x755dcf[_0x90b9('0x28')]]={'$like':'%'+_0x1ab4f6['query']['filter']+'%'};return _0x179475;}})});}_0x4ed665=_[_0x90b9('0x3e')]({},_0x4ed665,_0x1ab4f6[_0x90b9('0x3f')]);var _0x3c620d={'where':_0x4ed665[_0x90b9('0x3d')]};return db['AnalyticFieldReport'][_0x90b9('0x1e')](_0x3c620d)[_0x90b9('0x26')](function(_0x5a8aff){_0x8432ac[_0x90b9('0x1e')]=_0x5a8aff;if(_0x1ab4f6['query']['includeAll']){_0x4ed665[_0x90b9('0x40')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x90b9('0x41')](_0x4ed665);})['then'](function(_0x132202){_0x8432ac['rows']=_0x132202;return _0x8432ac;})[_0x90b9('0x26')](respondWithFilteredResult(_0x160729,_0x4ed665))['catch'](handleError(_0x160729,null));};exports['show']=function(_0x385a80,_0x45780b){var _0x9fb2d3={'raw':![],'where':{'id':_0x385a80[_0x90b9('0x42')]['id']}},_0x3eaff2={};_0x3eaff2[_0x90b9('0x30')]=_[_0x90b9('0x32')](db[_0x90b9('0x2c')]['rawAttributes']);_0x3eaff2['query']=_['keys'](_0x385a80['query']);_0x3eaff2[_0x90b9('0x3b')]=_[_0x90b9('0x33')](_0x3eaff2[_0x90b9('0x30')],_0x3eaff2[_0x90b9('0x31')]);_0x9fb2d3['attributes']=_[_0x90b9('0x33')](_0x3eaff2[_0x90b9('0x30')],qs[_0x90b9('0x34')](_0x385a80['query'][_0x90b9('0x34')]));_0x9fb2d3['attributes']=_0x9fb2d3[_0x90b9('0x35')][_0x90b9('0x36')]?_0x9fb2d3['attributes']:_0x3eaff2[_0x90b9('0x30')];if(_0x385a80[_0x90b9('0x31')][_0x90b9('0x43')]){_0x9fb2d3['include']=[{'all':!![]}];}_0x9fb2d3=_[_0x90b9('0x3e')]({},_0x9fb2d3,_0x385a80['options']);return db['AnalyticFieldReport'][_0x90b9('0x44')](_0x9fb2d3)['then'](handleEntityNotFound(_0x45780b,null))[_0x90b9('0x26')](respondWithResult(_0x45780b,null))[_0x90b9('0x45')](handleError(_0x45780b,null));};exports['create']=function(_0x11593b,_0x44849d){return db['AnalyticFieldReport'][_0x90b9('0x46')](_0x11593b[_0x90b9('0x47')],{})[_0x90b9('0x26')](respondWithResult(_0x44849d,0xc9))[_0x90b9('0x45')](handleError(_0x44849d,null));};exports['bulkCreate']=function(_0x57e514,_0x5ae415){return db[_0x90b9('0x2c')]['bulkCreate'](_0x57e514[_0x90b9('0x47')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x5ae415,0xc9))[_0x90b9('0x45')](handleError(_0x5ae415,null));};exports[_0x90b9('0x25')]=function(_0x5b88cf,_0x3da282){if(_0x5b88cf[_0x90b9('0x47')]['id']){delete _0x5b88cf['body']['id'];}return db['AnalyticFieldReport'][_0x90b9('0x44')]({'where':{'id':_0x5b88cf[_0x90b9('0x42')]['id']}})['then'](handleEntityNotFound(_0x3da282,null))['then'](saveUpdates(_0x5b88cf[_0x90b9('0x47')],null))[_0x90b9('0x26')](respondWithResult(_0x3da282,null))[_0x90b9('0x45')](handleError(_0x3da282,null));};exports[_0x90b9('0x48')]=function(_0x47095a,_0x4e8ebe){return db[_0x90b9('0x2c')][_0x90b9('0x44')]({'where':{'id':_0x47095a[_0x90b9('0x42')]['id']}})[_0x90b9('0x26')](handleEntityNotFound(_0x4e8ebe,null))[_0x90b9('0x26')](removeEntity(_0x4e8ebe,null))['catch'](handleError(_0x4e8ebe,null));};exports[_0x90b9('0x49')]=function(_0xf59833,_0x3d7ef0){return db[_0x90b9('0x2c')][_0x90b9('0x48')]({'where':{'id':_0xf59833['query'][_0x90b9('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x90b9('0x26')](respondWithResult(_0x3d7ef0,0xcc))[_0x90b9('0x45')](handleError(_0x3d7ef0,null));};exports[_0x90b9('0x4b')]=function(_0x258671,_0x2e2e9b,_0x5d8b68){return db[_0x90b9('0x4c')][_0x90b9('0x4d')]({'where':{'id':_0x258671[_0x90b9('0x42')]['id']}})[_0x90b9('0x26')](handleEntityNotFound(_0x2e2e9b,null))[_0x90b9('0x26')](function(_0x1b9d42){if(_0x1b9d42){return db[_0x90b9('0x4e')]['transaction'](function(_0x1d4705){return db[_0x90b9('0x2c')][_0x90b9('0x48')]({'where':{'CustomReportId':_0x258671[_0x90b9('0x42')]['id']},'transaction':_0x1d4705})[_0x90b9('0x26')](function(_0x56d8aa){var _0xf6dc85=_[_0x90b9('0x2b')](_0x258671[_0x90b9('0x47')],function(_0x5af3f6){delete _0x5af3f6['id'];_0x5af3f6[_0x90b9('0x4f')]=_0x258671[_0x90b9('0x42')]['id'];return _0x5af3f6;});return db[_0x90b9('0x2c')][_0x90b9('0x50')](_0xf6dc85,{'transaction':_0x1d4705});});})[_0x90b9('0x26')](function(){return db[_0x90b9('0x2c')][_0x90b9('0x41')]({'where':{'CustomReportId':_0x258671[_0x90b9('0x42')]['id']}});});}})['then'](respondWithResult(_0x2e2e9b,null))[_0x90b9('0x45')](handleError(_0x2e2e9b,null));};
\ No newline at end of file
+var _0x3b78=['end','offset','undefined','limit','count','json','apply','save','update','destroy','then','error','stack','name','send','index','AnalyticFieldReport','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','VIRTUAL','where','includeAll','include','rows','show','options','find','catch','create','bulkCreate','body','params','bulkDestroy','ids','findOne','sequelize','transaction','findAll','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status'];(function(_0x19832a,_0x30b1a5){var _0x287da5=function(_0x437e36){while(--_0x437e36){_0x19832a['push'](_0x19832a['shift']());}};_0x287da5(++_0x30b1a5);}(_0x3b78,0x1cb));var _0x83b7=function(_0x51f764,_0x4c5c26){_0x51f764=_0x51f764-0x0;var _0x40eee9=_0x3b78[_0x51f764];return _0x40eee9;};'use strict';var emlformat=require(_0x83b7('0x0'));var rimraf=require(_0x83b7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x83b7('0x2'));var moment=require(_0x83b7('0x3'));var BPromise=require(_0x83b7('0x4'));var Mustache=require('mustache');var util=require(_0x83b7('0x5'));var path=require(_0x83b7('0x6'));var sox=require(_0x83b7('0x7'));var csv=require(_0x83b7('0x8'));var ejs=require(_0x83b7('0x9'));var fs=require('fs');var fs_extra=require(_0x83b7('0xa'));var _=require(_0x83b7('0xb'));var squel=require(_0x83b7('0xc'));var crypto=require('crypto');var jsforce=require(_0x83b7('0xd'));var deskjs=require(_0x83b7('0xe'));var toCsv=require(_0x83b7('0x8'));var querystring=require(_0x83b7('0xf'));var Papa=require('papaparse');var Redis=require(_0x83b7('0x10'));var authService=require(_0x83b7('0x11'));var qs=require(_0x83b7('0x12'));var as=require(_0x83b7('0x13'));var hardwareService=require(_0x83b7('0x14'));var logger=require(_0x83b7('0x15'))(_0x83b7('0x16'));var utils=require(_0x83b7('0x17'));var config=require(_0x83b7('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x83b7('0x19'))['db'];function respondWithStatusCode(_0x43522d,_0x33340f){_0x33340f=_0x33340f||0xcc;return function(_0xbee060){if(_0xbee060){return _0x43522d['sendStatus'](_0x33340f);}return _0x43522d[_0x83b7('0x1a')](_0x33340f)[_0x83b7('0x1b')]();};}function respondWithResult(_0x513891,_0x17d5a1){_0x17d5a1=_0x17d5a1||0xc8;return function(_0x405c97){if(_0x405c97){return _0x513891[_0x83b7('0x1a')](_0x17d5a1)['json'](_0x405c97);}};}function respondWithFilteredResult(_0x2289a5,_0x147e1e){return function(_0xf4ccad){if(_0xf4ccad){var _0x47a7e3=typeof _0x147e1e[_0x83b7('0x1c')]===_0x83b7('0x1d')&&typeof _0x147e1e[_0x83b7('0x1e')]===_0x83b7('0x1d');var _0x529e4c=_0xf4ccad[_0x83b7('0x1f')];var _0x21fe9f=_0x47a7e3?0x0:_0x147e1e[_0x83b7('0x1c')];var _0x4ba517=_0x47a7e3?_0xf4ccad[_0x83b7('0x1f')]:_0x147e1e[_0x83b7('0x1c')]+_0x147e1e[_0x83b7('0x1e')];var _0x1775a5;if(_0x4ba517>=_0x529e4c){_0x4ba517=_0x529e4c;_0x1775a5=0xc8;}else{_0x1775a5=0xce;}_0x2289a5[_0x83b7('0x1a')](_0x1775a5);return _0x2289a5['set']('Content-Range',_0x21fe9f+'-'+_0x4ba517+'/'+_0x529e4c)[_0x83b7('0x20')](_0xf4ccad);}return null;};}function patchUpdates(_0x5e8a73){return function(_0x31252){try{jsonpatch[_0x83b7('0x21')](_0x31252,_0x5e8a73,!![]);}catch(_0x4f5643){return BPromise['reject'](_0x4f5643);}return _0x31252[_0x83b7('0x22')]();};}function saveUpdates(_0x488ef7,_0x596a03){return function(_0x28b4a5){if(_0x28b4a5){return _0x28b4a5[_0x83b7('0x23')](_0x488ef7)['then'](function(_0x7a42ef){return _0x7a42ef;});}return null;};}function removeEntity(_0x1f8106,_0x13fdc6){return function(_0xb71792){if(_0xb71792){return _0xb71792[_0x83b7('0x24')]()[_0x83b7('0x25')](function(){_0x1f8106[_0x83b7('0x1a')](0xcc)[_0x83b7('0x1b')]();});}};}function handleEntityNotFound(_0x1075d8,_0x10fcfa){return function(_0x1acb0c){if(!_0x1acb0c){_0x1075d8['sendStatus'](0x194);}return _0x1acb0c;};}function handleError(_0x10ff43,_0x5e0da8){_0x5e0da8=_0x5e0da8||0x1f4;return function(_0xe7d4d){logger[_0x83b7('0x26')](_0xe7d4d[_0x83b7('0x27')]);if(_0xe7d4d['name']){delete _0xe7d4d[_0x83b7('0x28')];}_0x10ff43[_0x83b7('0x1a')](_0x5e0da8)[_0x83b7('0x29')](_0xe7d4d);};}exports[_0x83b7('0x2a')]=function(_0x2c6d01,_0x45b123){var _0x2c5275={},_0x332edf={},_0x5d8c16={'count':0x0,'rows':[]};var _0x1997c8=_['map'](db[_0x83b7('0x2b')][_0x83b7('0x2c')],function(_0x47819a){return{'name':_0x47819a[_0x83b7('0x2d')],'type':_0x47819a[_0x83b7('0x2e')]['key']};});_0x332edf[_0x83b7('0x2f')]=_[_0x83b7('0x30')](_0x1997c8,_0x83b7('0x28'));_0x332edf[_0x83b7('0x31')]=_[_0x83b7('0x32')](_0x2c6d01[_0x83b7('0x31')]);_0x332edf[_0x83b7('0x33')]=_[_0x83b7('0x34')](_0x332edf[_0x83b7('0x2f')],_0x332edf[_0x83b7('0x31')]);_0x2c5275[_0x83b7('0x35')]=_[_0x83b7('0x34')](_0x332edf[_0x83b7('0x2f')],qs['fields'](_0x2c6d01[_0x83b7('0x31')][_0x83b7('0x36')]));_0x2c5275[_0x83b7('0x35')]=_0x2c5275[_0x83b7('0x35')][_0x83b7('0x37')]?_0x2c5275[_0x83b7('0x35')]:_0x332edf['model'];if(!_0x2c6d01['query']['hasOwnProperty'](_0x83b7('0x38'))){_0x2c5275[_0x83b7('0x1e')]=qs[_0x83b7('0x1e')](_0x2c6d01[_0x83b7('0x31')]['limit']);_0x2c5275[_0x83b7('0x1c')]=qs[_0x83b7('0x1c')](_0x2c6d01['query'][_0x83b7('0x1c')]);}_0x2c5275[_0x83b7('0x39')]=qs[_0x83b7('0x3a')](_0x2c6d01[_0x83b7('0x31')][_0x83b7('0x3a')]);_0x2c5275['where']=qs[_0x83b7('0x33')](_[_0x83b7('0x3b')](_0x2c6d01[_0x83b7('0x31')],_0x332edf[_0x83b7('0x33')]),_0x1997c8);if(_0x2c6d01[_0x83b7('0x31')][_0x83b7('0x3c')]){_0x2c5275['where']=_[_0x83b7('0x3d')](_0x2c5275['where'],{'$or':_['map'](_0x1997c8,function(_0xd9787){if(_0xd9787[_0x83b7('0x2e')]!==_0x83b7('0x3e')){var _0x3d57f0={};_0x3d57f0[_0xd9787[_0x83b7('0x28')]]={'$like':'%'+_0x2c6d01['query']['filter']+'%'};return _0x3d57f0;}})});}_0x2c5275=_['merge']({},_0x2c5275,_0x2c6d01['options']);var _0x43bdf9={'where':_0x2c5275[_0x83b7('0x3f')]};return db[_0x83b7('0x2b')][_0x83b7('0x1f')](_0x43bdf9)[_0x83b7('0x25')](function(_0x2b0bb3){_0x5d8c16['count']=_0x2b0bb3;if(_0x2c6d01[_0x83b7('0x31')][_0x83b7('0x40')]){_0x2c5275[_0x83b7('0x41')]=[{'all':!![]}];}return db[_0x83b7('0x2b')]['findAll'](_0x2c5275);})[_0x83b7('0x25')](function(_0x32054b){_0x5d8c16[_0x83b7('0x42')]=_0x32054b;return _0x5d8c16;})[_0x83b7('0x25')](respondWithFilteredResult(_0x45b123,_0x2c5275))['catch'](handleError(_0x45b123,null));};exports[_0x83b7('0x43')]=function(_0x5fcc14,_0x17fd48){var _0x496988={'raw':![],'where':{'id':_0x5fcc14['params']['id']}},_0x527644={};_0x527644[_0x83b7('0x2f')]=_[_0x83b7('0x32')](db[_0x83b7('0x2b')][_0x83b7('0x2c')]);_0x527644[_0x83b7('0x31')]=_['keys'](_0x5fcc14[_0x83b7('0x31')]);_0x527644[_0x83b7('0x33')]=_['intersection'](_0x527644[_0x83b7('0x2f')],_0x527644[_0x83b7('0x31')]);_0x496988['attributes']=_[_0x83b7('0x34')](_0x527644[_0x83b7('0x2f')],qs['fields'](_0x5fcc14[_0x83b7('0x31')][_0x83b7('0x36')]));_0x496988[_0x83b7('0x35')]=_0x496988['attributes'][_0x83b7('0x37')]?_0x496988[_0x83b7('0x35')]:_0x527644[_0x83b7('0x2f')];if(_0x5fcc14[_0x83b7('0x31')][_0x83b7('0x40')]){_0x496988[_0x83b7('0x41')]=[{'all':!![]}];}_0x496988=_['merge']({},_0x496988,_0x5fcc14[_0x83b7('0x44')]);return db[_0x83b7('0x2b')][_0x83b7('0x45')](_0x496988)[_0x83b7('0x25')](handleEntityNotFound(_0x17fd48,null))[_0x83b7('0x25')](respondWithResult(_0x17fd48,null))[_0x83b7('0x46')](handleError(_0x17fd48,null));};exports[_0x83b7('0x47')]=function(_0x3910d1,_0x278a22){return db[_0x83b7('0x2b')][_0x83b7('0x47')](_0x3910d1['body'],{})['then'](respondWithResult(_0x278a22,0xc9))[_0x83b7('0x46')](handleError(_0x278a22,null));};exports[_0x83b7('0x48')]=function(_0x2c68a8,_0x95414c){return db['AnalyticFieldReport']['bulkCreate'](_0x2c68a8[_0x83b7('0x49')],{'raw':![],'individualHooks':!![]})[_0x83b7('0x25')](respondWithResult(_0x95414c,0xc9))[_0x83b7('0x46')](handleError(_0x95414c,null));};exports[_0x83b7('0x23')]=function(_0x1422f7,_0x484aa9){if(_0x1422f7[_0x83b7('0x49')]['id']){delete _0x1422f7['body']['id'];}return db[_0x83b7('0x2b')][_0x83b7('0x45')]({'where':{'id':_0x1422f7['params']['id']}})['then'](handleEntityNotFound(_0x484aa9,null))[_0x83b7('0x25')](saveUpdates(_0x1422f7[_0x83b7('0x49')],null))[_0x83b7('0x25')](respondWithResult(_0x484aa9,null))[_0x83b7('0x46')](handleError(_0x484aa9,null));};exports[_0x83b7('0x24')]=function(_0x214ceb,_0x36057c){return db['AnalyticFieldReport']['find']({'where':{'id':_0x214ceb[_0x83b7('0x4a')]['id']}})[_0x83b7('0x25')](handleEntityNotFound(_0x36057c,null))[_0x83b7('0x25')](removeEntity(_0x36057c,null))[_0x83b7('0x46')](handleError(_0x36057c,null));};exports[_0x83b7('0x4b')]=function(_0x5ae60d,_0x389860){return db[_0x83b7('0x2b')][_0x83b7('0x24')]({'where':{'id':_0x5ae60d['query'][_0x83b7('0x4c')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x389860,0xcc))[_0x83b7('0x46')](handleError(_0x389860,null));};exports['addFields']=function(_0x9fc8db,_0x32cebe,_0x2fbb47){return db['AnalyticCustomReport'][_0x83b7('0x4d')]({'where':{'id':_0x9fc8db[_0x83b7('0x4a')]['id']}})[_0x83b7('0x25')](handleEntityNotFound(_0x32cebe,null))['then'](function(_0x55c55a){if(_0x55c55a){return db[_0x83b7('0x4e')][_0x83b7('0x4f')](function(_0x123fe8){return db[_0x83b7('0x2b')]['destroy']({'where':{'CustomReportId':_0x9fc8db['params']['id']},'transaction':_0x123fe8})['then'](function(_0x23c93f){var _0x2ca7cd=_['map'](_0x9fc8db[_0x83b7('0x49')],function(_0x53fea5){delete _0x53fea5['id'];_0x53fea5['CustomReportId']=_0x9fc8db[_0x83b7('0x4a')]['id'];return _0x53fea5;});return db[_0x83b7('0x2b')]['bulkCreate'](_0x2ca7cd,{'transaction':_0x123fe8});});})[_0x83b7('0x25')](function(){return db[_0x83b7('0x2b')][_0x83b7('0x50')]({'where':{'CustomReportId':_0x9fc8db['params']['id']}});});}})['then'](respondWithResult(_0x32cebe,null))[_0x83b7('0x46')](handleError(_0x32cebe,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index c1e4118..6f78e84 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 _0x3cd2=['request-promise','path','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','lodash','util','../../config/logger','moment'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x3cd2,0x18c));var _0x23cd=function(_0x3644f9,_0x501c12){_0x3644f9=_0x3644f9-0x0;var _0x5aaa15=_0x3cd2[_0x3644f9];return _0x5aaa15;};'use strict';var _=require(_0x23cd('0x0'));var util=require(_0x23cd('0x1'));var logger=require(_0x23cd('0x2'))('api');var moment=require(_0x23cd('0x3'));var BPromise=require('bluebird');var rp=require(_0x23cd('0x4'));var fs=require('fs');var path=require(_0x23cd('0x5'));var rimraf=require('rimraf');var config=require(_0x23cd('0x6'));var attributes=require(_0x23cd('0x7'));module[_0x23cd('0x8')]=function(_0x257f43,_0x1b4222){return _0x257f43['define'](_0x23cd('0x9'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa407=['../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','api','moment','path','rimraf'];(function(_0x330414,_0x4f3207){var _0x99dbff=function(_0x166f85){while(--_0x166f85){_0x330414['push'](_0x330414['shift']());}};_0x99dbff(++_0x4f3207);}(_0xa407,0x16e));var _0x7a40=function(_0x37c3bd,_0x51bf68){_0x37c3bd=_0x37c3bd-0x0;var _0x51147d=_0xa407[_0x37c3bd];return _0x51147d;};'use strict';var _=require(_0x7a40('0x0'));var util=require('util');var logger=require(_0x7a40('0x1'))(_0x7a40('0x2'));var moment=require(_0x7a40('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7a40('0x4'));var rimraf=require(_0x7a40('0x5'));var config=require(_0x7a40('0x6'));var attributes=require(_0x7a40('0x7'));module[_0x7a40('0x8')]=function(_0x224d1,_0x4363ca){return _0x224d1[_0x7a40('0x9')](_0x7a40('0xa'),attributes,{'tableName':_0x7a40('0xb'),'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 2d7a442..31a3eaf 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 _0x5cfd=['client','http','request','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0xf2dad0,_0x499aa9){var _0x447e18=function(_0x5df4ca){while(--_0x5df4ca){_0xf2dad0['push'](_0xf2dad0['shift']());}};_0x447e18(++_0x499aa9);}(_0x5cfd,0xdd));var _0xd5cf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5cfd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd5cf('0x0'));var util=require(_0xd5cf('0x1'));var moment=require(_0xd5cf('0x2'));var BPromise=require('bluebird');var rs=require(_0xd5cf('0x3'));var fs=require('fs');var Redis=require(_0xd5cf('0x4'));var db=require(_0xd5cf('0x5'))['db'];var utils=require(_0xd5cf('0x6'));var logger=require(_0xd5cf('0x7'))('rpc');var config=require(_0xd5cf('0x8'));var jayson=require(_0xd5cf('0x9'));var client=jayson[_0xd5cf('0xa')][_0xd5cf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4924f3,_0x22f7a3,_0x264443){return new BPromise(function(_0x20e01d,_0x5b221a){return client[_0xd5cf('0xc')](_0x4924f3,_0x264443)['then'](function(_0x456632){logger['info'](_0xd5cf('0xd'),_0x22f7a3,_0xd5cf('0xe'));logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x22f7a3,_0xd5cf('0xe'),JSON[_0xd5cf('0xf')](_0x456632));if(_0x456632[_0xd5cf('0x10')]){if(_0x456632[_0xd5cf('0x10')]['code']===0x1f4){logger[_0xd5cf('0x10')](_0xd5cf('0xd'),_0x22f7a3,_0x456632[_0xd5cf('0x10')][_0xd5cf('0x11')]);return _0x5b221a(_0x456632[_0xd5cf('0x10')]['message']);}logger[_0xd5cf('0x10')](_0xd5cf('0xd'),_0x22f7a3,_0x456632[_0xd5cf('0x10')][_0xd5cf('0x11')]);return _0x20e01d(_0x456632[_0xd5cf('0x10')][_0xd5cf('0x11')]);}else{logger[_0xd5cf('0x12')](_0xd5cf('0xd'),_0x22f7a3,_0xd5cf('0xe'));_0x20e01d(_0x456632[_0xd5cf('0x13')]['message']);}})[_0xd5cf('0x14')](function(_0x14c467){logger[_0xd5cf('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x22f7a3,_0x14c467);_0x5b221a(_0x14c467);});});}
\ No newline at end of file
+var _0x7737=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','bluebird','randomstring'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7737,0x178));var _0x7773=function(_0x9c1f48,_0x25da55){_0x9c1f48=_0x9c1f48-0x0;var _0x52ecd4=_0x7737[_0x9c1f48];return _0x52ecd4;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x7773('0x0'));var rs=require(_0x7773('0x1'));var fs=require('fs');var Redis=require(_0x7773('0x2'));var db=require(_0x7773('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7773('0x4'));var config=require(_0x7773('0x5'));var jayson=require(_0x7773('0x6'));var client=jayson['client'][_0x7773('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x27f538,_0x5c5e0d,_0x5a2221){return new BPromise(function(_0x3d350d,_0x3e393f){return client[_0x7773('0x8')](_0x27f538,_0x5a2221)[_0x7773('0x9')](function(_0x30102a){logger[_0x7773('0xa')](_0x7773('0xb'),_0x5c5e0d,_0x7773('0xc'));logger[_0x7773('0xd')](_0x7773('0xe'),_0x5c5e0d,'request\x20sent',JSON[_0x7773('0xf')](_0x30102a));if(_0x30102a['error']){if(_0x30102a['error'][_0x7773('0x10')]===0x1f4){logger['error'](_0x7773('0xb'),_0x5c5e0d,_0x30102a[_0x7773('0x11')][_0x7773('0x12')]);return _0x3e393f(_0x30102a[_0x7773('0x11')]['message']);}logger['error'](_0x7773('0xb'),_0x5c5e0d,_0x30102a[_0x7773('0x11')]['message']);return _0x3d350d(_0x30102a[_0x7773('0x11')][_0x7773('0x12')]);}else{logger[_0x7773('0xa')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5c5e0d,_0x7773('0xc'));_0x3d350d(_0x30102a[_0x7773('0x13')][_0x7773('0x12')]);}})[_0x7773('0x14')](function(_0x1163f5){logger[_0x7773('0x11')](_0x7773('0xb'),_0x5c5e0d,_0x1163f5);_0x3e393f(_0x1163f5);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 6162445..af66b0c 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(_0x63ef97,_0x457ea8){var _0x1d7e21=function(_0xda9eae){while(--_0xda9eae){_0x63ef97['push'](_0x63ef97['shift']());}};_0x1d7e21(++_0x457ea8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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(_0x4885b0,_0x3db942){var _0x3604b5=function(_0xeb63f3){while(--_0xeb63f3){_0x4885b0['push'](_0x4885b0['shift']());}};_0x3604b5(++_0x3db942);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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 ea323fe..9540f78 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 _0xbee0=['STRING','name','TEXT','exports'];(function(_0x564f68,_0x4da1ff){var _0x4330f5=function(_0x3c546d){while(--_0x3c546d){_0x564f68['push'](_0x564f68['shift']());}};_0x4330f5(++_0x4da1ff);}(_0xbee0,0x147));var _0x0bee=function(_0x162707,_0x4059d7){_0x162707=_0x162707-0x0;var _0x4e2fd5=_0xbee0[_0x162707];return _0x4e2fd5;};'use strict';var Sequelize=require('sequelize');module[_0x0bee('0x0')]={'name':{'type':Sequelize[_0x0bee('0x1')],'allowNull':![],'unique':_0x0bee('0x2')},'table':{'type':Sequelize[_0x0bee('0x1')]},'metric':{'type':Sequelize[_0x0bee('0x3')]},'description':{'type':Sequelize[_0x0bee('0x1')]}};
\ No newline at end of file
+var _0x3ee7=['exports','STRING'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x3ee7,0x98));var _0x73ee=function(_0x23bd05,_0x409ba8){_0x23bd05=_0x23bd05-0x0;var _0x2ea842=_0x3ee7[_0x23bd05];return _0x2ea842;};'use strict';var Sequelize=require('sequelize');module[_0x73ee('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x73ee('0x1')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x73ee('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 31aaa47..55dde0e 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 _0x8ef6=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','index','map','fieldName','key','model','keys','query','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','type','VIRTUAL','options','AnalyticMetric','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x22a112,_0x4ef65c){var _0x83d8c7=function(_0x39a793){while(--_0x39a793){_0x22a112['push'](_0x22a112['shift']());}};_0x83d8c7(++_0x4ef65c);}(_0x8ef6,0xf2));var _0x68ef=function(_0x2c6a9d,_0x8479bc){_0x2c6a9d=_0x2c6a9d-0x0;var _0x22181e=_0x8ef6[_0x2c6a9d];return _0x22181e;};'use strict';var emlformat=require(_0x68ef('0x0'));var rimraf=require(_0x68ef('0x1'));var zipdir=require(_0x68ef('0x2'));var jsonpatch=require(_0x68ef('0x3'));var rp=require(_0x68ef('0x4'));var moment=require(_0x68ef('0x5'));var BPromise=require(_0x68ef('0x6'));var Mustache=require('mustache');var util=require(_0x68ef('0x7'));var path=require(_0x68ef('0x8'));var sox=require(_0x68ef('0x9'));var csv=require(_0x68ef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68ef('0xb'));var squel=require(_0x68ef('0xc'));var crypto=require(_0x68ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x68ef('0xe'));var toCsv=require(_0x68ef('0xa'));var querystring=require(_0x68ef('0xf'));var Papa=require(_0x68ef('0x10'));var Redis=require(_0x68ef('0x11'));var authService=require(_0x68ef('0x12'));var qs=require(_0x68ef('0x13'));var as=require(_0x68ef('0x14'));var hardwareService=require(_0x68ef('0x15'));var logger=require(_0x68ef('0x16'))(_0x68ef('0x17'));var utils=require(_0x68ef('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x68ef('0x19'));var db=require(_0x68ef('0x1a'))['db'];function respondWithStatusCode(_0x1e117a,_0x454ef4){_0x454ef4=_0x454ef4||0xcc;return function(_0x40f253){if(_0x40f253){return _0x1e117a[_0x68ef('0x1b')](_0x454ef4);}return _0x1e117a['status'](_0x454ef4)[_0x68ef('0x1c')]();};}function respondWithResult(_0xc50cce,_0x2657c5){_0x2657c5=_0x2657c5||0xc8;return function(_0x47fbb5){if(_0x47fbb5){return _0xc50cce[_0x68ef('0x1d')](_0x2657c5)[_0x68ef('0x1e')](_0x47fbb5);}};}function respondWithFilteredResult(_0x24682d,_0x5005ba){return function(_0x35493d){if(_0x35493d){var _0x37c4cc=typeof _0x5005ba[_0x68ef('0x1f')]===_0x68ef('0x20')&&typeof _0x5005ba['limit']===_0x68ef('0x20');var _0x54139e=_0x35493d['count'];var _0x2633c1=_0x37c4cc?0x0:_0x5005ba[_0x68ef('0x1f')];var _0x4ade0d=_0x37c4cc?_0x35493d['count']:_0x5005ba[_0x68ef('0x1f')]+_0x5005ba[_0x68ef('0x21')];var _0x318514;if(_0x4ade0d>=_0x54139e){_0x4ade0d=_0x54139e;_0x318514=0xc8;}else{_0x318514=0xce;}_0x24682d['status'](_0x318514);return _0x24682d[_0x68ef('0x22')](_0x68ef('0x23'),_0x2633c1+'-'+_0x4ade0d+'/'+_0x54139e)[_0x68ef('0x1e')](_0x35493d);}return null;};}function patchUpdates(_0x5b246b){return function(_0x3c46d4){try{jsonpatch[_0x68ef('0x24')](_0x3c46d4,_0x5b246b,!![]);}catch(_0x5af19f){return BPromise[_0x68ef('0x25')](_0x5af19f);}return _0x3c46d4[_0x68ef('0x26')]();};}function saveUpdates(_0x19aa3d,_0x5ddec7){return function(_0x59723c){if(_0x59723c){return _0x59723c['update'](_0x19aa3d)[_0x68ef('0x27')](function(_0x2023f2){return _0x2023f2;});}return null;};}function removeEntity(_0x312cc9,_0x2e6e39){return function(_0x438b4c){if(_0x438b4c){return _0x438b4c[_0x68ef('0x28')]()[_0x68ef('0x27')](function(){var _0x49374f=_0x438b4c[_0x68ef('0x29')]({'plain':!![]});var _0x13280b='Metrics';return db[_0x68ef('0x2a')]['destroy']({'where':{'type':_0x13280b,'resourceId':_0x49374f['id']}})['then'](function(){return _0x438b4c;});})['then'](function(){_0x312cc9[_0x68ef('0x1d')](0xcc)[_0x68ef('0x1c')]();});}};}function handleEntityNotFound(_0x123041,_0x29518e){return function(_0x52e67e){if(!_0x52e67e){_0x123041['sendStatus'](0x194);}return _0x52e67e;};}function handleError(_0x1cbe4f,_0x28907a){_0x28907a=_0x28907a||0x1f4;return function(_0x7bf96){logger[_0x68ef('0x2b')](_0x7bf96[_0x68ef('0x2c')]);if(_0x7bf96[_0x68ef('0x2d')]){delete _0x7bf96[_0x68ef('0x2d')];}_0x1cbe4f[_0x68ef('0x1d')](_0x28907a)['send'](_0x7bf96);};}exports[_0x68ef('0x2e')]=function(_0x4314bd,_0x132d9e){var _0x4c25aa={},_0x370a8f={},_0x523120={'count':0x0,'rows':[]};var _0x133788=_[_0x68ef('0x2f')](db['AnalyticMetric']['rawAttributes'],function(_0x159395){return{'name':_0x159395[_0x68ef('0x30')],'type':_0x159395['type'][_0x68ef('0x31')]};});_0x370a8f[_0x68ef('0x32')]=_[_0x68ef('0x2f')](_0x133788,_0x68ef('0x2d'));_0x370a8f['query']=_[_0x68ef('0x33')](_0x4314bd[_0x68ef('0x34')]);_0x370a8f['filters']=_[_0x68ef('0x35')](_0x370a8f['model'],_0x370a8f[_0x68ef('0x34')]);_0x4c25aa[_0x68ef('0x36')]=_['intersection'](_0x370a8f[_0x68ef('0x32')],qs['fields'](_0x4314bd[_0x68ef('0x34')]['fields']));_0x4c25aa[_0x68ef('0x36')]=_0x4c25aa[_0x68ef('0x36')][_0x68ef('0x37')]?_0x4c25aa['attributes']:_0x370a8f[_0x68ef('0x32')];if(!_0x4314bd['query'][_0x68ef('0x38')]('nolimit')){_0x4c25aa[_0x68ef('0x21')]=qs[_0x68ef('0x21')](_0x4314bd[_0x68ef('0x34')][_0x68ef('0x21')]);_0x4c25aa[_0x68ef('0x1f')]=qs[_0x68ef('0x1f')](_0x4314bd['query'][_0x68ef('0x1f')]);}_0x4c25aa[_0x68ef('0x39')]=qs[_0x68ef('0x3a')](_0x4314bd['query'][_0x68ef('0x3a')]);_0x4c25aa[_0x68ef('0x3b')]=qs[_0x68ef('0x3c')](_['pick'](_0x4314bd['query'],_0x370a8f[_0x68ef('0x3c')]),_0x133788);if(_0x4314bd[_0x68ef('0x34')][_0x68ef('0x3d')]){_0x4c25aa[_0x68ef('0x3b')]=_[_0x68ef('0x3e')](_0x4c25aa[_0x68ef('0x3b')],{'$or':_[_0x68ef('0x2f')](_0x133788,function(_0x5b1246){if(_0x5b1246[_0x68ef('0x3f')]!==_0x68ef('0x40')){var _0x2f6ee0={};_0x2f6ee0[_0x5b1246[_0x68ef('0x2d')]]={'$like':'%'+_0x4314bd['query'][_0x68ef('0x3d')]+'%'};return _0x2f6ee0;}})});}_0x4c25aa=_[_0x68ef('0x3e')]({},_0x4c25aa,_0x4314bd[_0x68ef('0x41')]);var _0x410c10={'where':_0x4c25aa[_0x68ef('0x3b')]};return db[_0x68ef('0x42')]['count'](_0x410c10)[_0x68ef('0x27')](function(_0x3f7699){_0x523120[_0x68ef('0x43')]=_0x3f7699;if(_0x4314bd[_0x68ef('0x34')][_0x68ef('0x44')]){_0x4c25aa[_0x68ef('0x45')]=[{'all':!![]}];}return db[_0x68ef('0x42')][_0x68ef('0x46')](_0x4c25aa);})[_0x68ef('0x27')](function(_0x531096){_0x523120[_0x68ef('0x47')]=_0x531096;return _0x523120;})[_0x68ef('0x27')](respondWithFilteredResult(_0x132d9e,_0x4c25aa))[_0x68ef('0x48')](handleError(_0x132d9e,null));};exports[_0x68ef('0x49')]=function(_0xdeacf2,_0x183377){var _0xcac58f={'raw':!![],'where':{'id':_0xdeacf2[_0x68ef('0x4a')]['id']}},_0x576767={};_0x576767['model']=_[_0x68ef('0x33')](db[_0x68ef('0x42')][_0x68ef('0x4b')]);_0x576767[_0x68ef('0x34')]=_['keys'](_0xdeacf2[_0x68ef('0x34')]);_0x576767['filters']=_[_0x68ef('0x35')](_0x576767['model'],_0x576767[_0x68ef('0x34')]);_0xcac58f[_0x68ef('0x36')]=_[_0x68ef('0x35')](_0x576767['model'],qs['fields'](_0xdeacf2[_0x68ef('0x34')][_0x68ef('0x4c')]));_0xcac58f['attributes']=_0xcac58f['attributes']['length']?_0xcac58f[_0x68ef('0x36')]:_0x576767[_0x68ef('0x32')];if(_0xdeacf2[_0x68ef('0x34')][_0x68ef('0x44')]){_0xcac58f[_0x68ef('0x45')]=[{'all':!![]}];}_0xcac58f=_['merge']({},_0xcac58f,_0xdeacf2['options']);return db[_0x68ef('0x42')][_0x68ef('0x4d')](_0xcac58f)[_0x68ef('0x27')](handleEntityNotFound(_0x183377,null))[_0x68ef('0x27')](respondWithResult(_0x183377,null))['catch'](handleError(_0x183377,null));};exports[_0x68ef('0x4e')]=function(_0x474e5a,_0x1c9b6f){return db[_0x68ef('0x42')]['create'](_0x474e5a['body'],{})[_0x68ef('0x27')](function(_0x3c3074){var _0x566e7c=_0x474e5a[_0x68ef('0x4f')][_0x68ef('0x29')]({'plain':!![]});if(!_0x566e7c)throw new Error(_0x68ef('0x50'));if(_0x566e7c[_0x68ef('0x51')]===_0x68ef('0x4f')){var _0x4f0f77=_0x3c3074[_0x68ef('0x29')]({'plain':!![]});var _0x3984ca=_0x68ef('0x52');return db['UserProfileSection'][_0x68ef('0x4d')]({'where':{'name':_0x3984ca,'userProfileId':_0x566e7c[_0x68ef('0x53')]},'raw':!![]})[_0x68ef('0x27')](function(_0x50ef1f){if(_0x50ef1f&&_0x50ef1f[_0x68ef('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x4f0f77[_0x68ef('0x2d')],'resourceId':_0x4f0f77['id'],'type':_0x50ef1f['name'],'sectionId':_0x50ef1f['id']},{})[_0x68ef('0x27')](function(){return _0x3c3074;});}else{return _0x3c3074;}})[_0x68ef('0x48')](function(_0x53ebd){logger[_0x68ef('0x2b')](_0x68ef('0x55'),_0x53ebd);throw _0x53ebd;});}return _0x3c3074;})[_0x68ef('0x27')](respondWithResult(_0x1c9b6f,0xc9))[_0x68ef('0x48')](handleError(_0x1c9b6f,null));};exports[_0x68ef('0x56')]=function(_0x2b35f4,_0x247915){if(_0x2b35f4['body']['id']){delete _0x2b35f4['body']['id'];}return db[_0x68ef('0x42')][_0x68ef('0x4d')]({'where':{'id':_0x2b35f4[_0x68ef('0x4a')]['id']}})[_0x68ef('0x27')](handleEntityNotFound(_0x247915,null))[_0x68ef('0x27')](saveUpdates(_0x2b35f4[_0x68ef('0x57')],null))[_0x68ef('0x27')](respondWithResult(_0x247915,null))[_0x68ef('0x48')](handleError(_0x247915,null));};exports[_0x68ef('0x28')]=function(_0x4c2e9c,_0x5685bb){return db[_0x68ef('0x42')]['find']({'where':{'id':_0x4c2e9c[_0x68ef('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5685bb,null))[_0x68ef('0x27')](removeEntity(_0x5685bb,null))[_0x68ef('0x48')](handleError(_0x5685bb,null));};
\ No newline at end of file
+var _0x55ca=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','get','Metrics','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','AnalyticMetric','findAll','catch','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x46ad10,_0x55f736){var _0x3ff9ea=function(_0x3e347a){while(--_0x3e347a){_0x46ad10['push'](_0x46ad10['shift']());}};_0x3ff9ea(++_0x55f736);}(_0x55ca,0x126));var _0xa55c=function(_0x1defb2,_0x429099){_0x1defb2=_0x1defb2-0x0;var _0xad8973=_0x55ca[_0x1defb2];return _0xad8973;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){var _0x54b038=_0x5ba836[_0xa55c('0x21')]({'plain':!![]});var _0x190757=_0xa55c('0x22');return db[_0xa55c('0x23')][_0xa55c('0x24')]({'where':{'type':_0x190757,'resourceId':_0x54b038['id']}})[_0xa55c('0x20')](function(){return _0x5ba836;});})[_0xa55c('0x20')](function(){_0x1fc828[_0xa55c('0x18')](0xcc)[_0xa55c('0x25')]();});}};}function handleEntityNotFound(_0x3cd152,_0x1273d7){return function(_0x57f271){if(!_0x57f271){_0x3cd152[_0xa55c('0x26')](0x194);}return _0x57f271;};}function handleError(_0x28814f,_0x1c9f6b){_0x1c9f6b=_0x1c9f6b||0x1f4;return function(_0x906caa){logger['error'](_0x906caa[_0xa55c('0x27')]);if(_0x906caa[_0xa55c('0x28')]){delete _0x906caa[_0xa55c('0x28')];}_0x28814f[_0xa55c('0x18')](_0x1c9f6b)[_0xa55c('0x29')](_0x906caa);};}exports[_0xa55c('0x2a')]=function(_0x52d37f,_0x23e698){var _0x490b7d={},_0x35c9c2={},_0x1d730b={'count':0x0,'rows':[]};var _0x1cc53e=_[_0xa55c('0x2b')](db['AnalyticMetric'][_0xa55c('0x2c')],function(_0x2096ae){return{'name':_0x2096ae[_0xa55c('0x2d')],'type':_0x2096ae[_0xa55c('0x2e')][_0xa55c('0x2f')]};});_0x35c9c2[_0xa55c('0x30')]=_[_0xa55c('0x2b')](_0x1cc53e,_0xa55c('0x28'));_0x35c9c2[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x52d37f[_0xa55c('0x31')]);_0x35c9c2['filters']=_['intersection'](_0x35c9c2[_0xa55c('0x30')],_0x35c9c2[_0xa55c('0x31')]);_0x490b7d['attributes']=_[_0xa55c('0x33')](_0x35c9c2[_0xa55c('0x30')],qs[_0xa55c('0x34')](_0x52d37f[_0xa55c('0x31')][_0xa55c('0x34')]));_0x490b7d[_0xa55c('0x35')]=_0x490b7d[_0xa55c('0x35')][_0xa55c('0x36')]?_0x490b7d[_0xa55c('0x35')]:_0x35c9c2['model'];if(!_0x52d37f['query']['hasOwnProperty'](_0xa55c('0x37'))){_0x490b7d[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x52d37f['query'][_0xa55c('0x1c')]);_0x490b7d['offset']=qs[_0xa55c('0x1a')](_0x52d37f['query'][_0xa55c('0x1a')]);}_0x490b7d[_0xa55c('0x38')]=qs[_0xa55c('0x39')](_0x52d37f['query'][_0xa55c('0x39')]);_0x490b7d[_0xa55c('0x3a')]=qs['filters'](_[_0xa55c('0x3b')](_0x52d37f[_0xa55c('0x31')],_0x35c9c2['filters']),_0x1cc53e);if(_0x52d37f['query'][_0xa55c('0x3c')]){_0x490b7d['where']=_[_0xa55c('0x3d')](_0x490b7d[_0xa55c('0x3a')],{'$or':_['map'](_0x1cc53e,function(_0x542d76){if(_0x542d76['type']!=='VIRTUAL'){var _0x3b3308={};_0x3b3308[_0x542d76[_0xa55c('0x28')]]={'$like':'%'+_0x52d37f[_0xa55c('0x31')][_0xa55c('0x3c')]+'%'};return _0x3b3308;}})});}_0x490b7d=_[_0xa55c('0x3d')]({},_0x490b7d,_0x52d37f['options']);var _0x3d52d8={'where':_0x490b7d[_0xa55c('0x3a')]};return db[_0xa55c('0x3e')][_0xa55c('0x1d')](_0x3d52d8)[_0xa55c('0x20')](function(_0x23cef5){_0x1d730b['count']=_0x23cef5;if(_0x52d37f[_0xa55c('0x31')]['includeAll']){_0x490b7d['include']=[{'all':!![]}];}return db[_0xa55c('0x3e')][_0xa55c('0x3f')](_0x490b7d);})['then'](function(_0x2bd98b){_0x1d730b['rows']=_0x2bd98b;return _0x1d730b;})['then'](respondWithFilteredResult(_0x23e698,_0x490b7d))[_0xa55c('0x40')](handleError(_0x23e698,null));};exports[_0xa55c('0x41')]=function(_0x1630ac,_0x540337){var _0x1b2708={'raw':!![],'where':{'id':_0x1630ac['params']['id']}},_0xd5a006={};_0xd5a006[_0xa55c('0x30')]=_['keys'](db[_0xa55c('0x3e')][_0xa55c('0x2c')]);_0xd5a006['query']=_[_0xa55c('0x32')](_0x1630ac[_0xa55c('0x31')]);_0xd5a006['filters']=_[_0xa55c('0x33')](_0xd5a006[_0xa55c('0x30')],_0xd5a006[_0xa55c('0x31')]);_0x1b2708['attributes']=_[_0xa55c('0x33')](_0xd5a006['model'],qs[_0xa55c('0x34')](_0x1630ac[_0xa55c('0x31')][_0xa55c('0x34')]));_0x1b2708['attributes']=_0x1b2708[_0xa55c('0x35')][_0xa55c('0x36')]?_0x1b2708['attributes']:_0xd5a006[_0xa55c('0x30')];if(_0x1630ac[_0xa55c('0x31')]['includeAll']){_0x1b2708[_0xa55c('0x42')]=[{'all':!![]}];}_0x1b2708=_[_0xa55c('0x3d')]({},_0x1b2708,_0x1630ac['options']);return db[_0xa55c('0x3e')][_0xa55c('0x43')](_0x1b2708)[_0xa55c('0x20')](handleEntityNotFound(_0x540337,null))[_0xa55c('0x20')](respondWithResult(_0x540337,null))['catch'](handleError(_0x540337,null));};exports[_0xa55c('0x44')]=function(_0x58a7ea,_0x2157d6){return db[_0xa55c('0x3e')][_0xa55c('0x44')](_0x58a7ea['body'],{})[_0xa55c('0x20')](function(_0x250b00){var _0x574fe9=_0x58a7ea[_0xa55c('0x45')][_0xa55c('0x21')]({'plain':!![]});if(!_0x574fe9)throw new Error(_0xa55c('0x46'));if(_0x574fe9[_0xa55c('0x47')]===_0xa55c('0x45')){var _0x1c84d9=_0x250b00[_0xa55c('0x21')]({'plain':!![]});var _0x129626=_0xa55c('0x22');return db[_0xa55c('0x48')]['find']({'where':{'name':_0x129626,'userProfileId':_0x574fe9[_0xa55c('0x49')]},'raw':!![]})[_0xa55c('0x20')](function(_0x216de8){if(_0x216de8&&_0x216de8['autoAssociation']===0x0){return db[_0xa55c('0x23')][_0xa55c('0x44')]({'name':_0x1c84d9['name'],'resourceId':_0x1c84d9['id'],'type':_0x216de8[_0xa55c('0x28')],'sectionId':_0x216de8['id']},{})['then'](function(){return _0x250b00;});}else{return _0x250b00;}})[_0xa55c('0x40')](function(_0x228df4){logger[_0xa55c('0x4a')](_0xa55c('0x4b'),_0x228df4);throw _0x228df4;});}return _0x250b00;})[_0xa55c('0x20')](respondWithResult(_0x2157d6,0xc9))['catch'](handleError(_0x2157d6,null));};exports[_0xa55c('0x1f')]=function(_0x4607ca,_0x4b85cc){if(_0x4607ca[_0xa55c('0x4c')]['id']){delete _0x4607ca[_0xa55c('0x4c')]['id'];}return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x4607ca['params']['id']}})['then'](handleEntityNotFound(_0x4b85cc,null))[_0xa55c('0x20')](saveUpdates(_0x4607ca[_0xa55c('0x4c')],null))[_0xa55c('0x20')](respondWithResult(_0x4b85cc,null))[_0xa55c('0x40')](handleError(_0x4b85cc,null));};exports['destroy']=function(_0x30c0c9,_0x5ce463){return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x30c0c9[_0xa55c('0x4d')]['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x5ce463,null))[_0xa55c('0x20')](removeEntity(_0x5ce463,null))['catch'](handleError(_0x5ce463,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index be2f4bb..bade044 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 _0x5c91=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticMetric','lodash','util','../../config/logger'];(function(_0x281a8d,_0x447bde){var _0x136e85=function(_0x5752dd){while(--_0x5752dd){_0x281a8d['push'](_0x281a8d['shift']());}};_0x136e85(++_0x447bde);}(_0x5c91,0x1e9));var _0x15c9=function(_0x22216a,_0xecb681){_0x22216a=_0x22216a-0x0;var _0x1195e9=_0x5c91[_0x22216a];return _0x1195e9;};'use strict';var _=require(_0x15c9('0x0'));var util=require(_0x15c9('0x1'));var logger=require(_0x15c9('0x2'))('api');var moment=require(_0x15c9('0x3'));var BPromise=require(_0x15c9('0x4'));var rp=require(_0x15c9('0x5'));var fs=require('fs');var path=require(_0x15c9('0x6'));var rimraf=require(_0x15c9('0x7'));var config=require(_0x15c9('0x8'));var attributes=require('./analyticMetric.attributes');module[_0x15c9('0x9')]=function(_0x216469,_0x1ce11a){return _0x216469[_0x15c9('0xa')](_0x15c9('0xb'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5bd7=['analytics_metrics','util','../../config/logger','api','bluebird','path','rimraf','./analyticMetric.attributes','exports','define','AnalyticMetric'];(function(_0x37c142,_0x361d66){var _0x5e088e=function(_0x2b9345){while(--_0x2b9345){_0x37c142['push'](_0x37c142['shift']());}};_0x5e088e(++_0x361d66);}(_0x5bd7,0x12a));var _0x75bd=function(_0x4216bf,_0x4efdde){_0x4216bf=_0x4216bf-0x0;var _0x3b4806=_0x5bd7[_0x4216bf];return _0x3b4806;};'use strict';var _=require('lodash');var util=require(_0x75bd('0x0'));var logger=require(_0x75bd('0x1'))(_0x75bd('0x2'));var moment=require('moment');var BPromise=require(_0x75bd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x75bd('0x4'));var rimraf=require(_0x75bd('0x5'));var config=require('../../config/environment');var attributes=require(_0x75bd('0x6'));module[_0x75bd('0x7')]=function(_0x2aaa6a,_0x47c9c7){return _0x2aaa6a[_0x75bd('0x8')](_0x75bd('0x9'),attributes,{'tableName':_0x75bd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 68ce495..bc92305 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 _0x0f6d=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1777d3,_0x35d883){var _0x3a87e8=function(_0x2e57b8){while(--_0x2e57b8){_0x1777d3['push'](_0x1777d3['shift']());}};_0x3a87e8(++_0x35d883);}(_0x0f6d,0x182));var _0xd0f6=function(_0x107f10,_0x5529f2){_0x107f10=_0x107f10-0x0;var _0x811cab=_0x0f6d[_0x107f10];return _0x811cab;};'use strict';var _=require(_0xd0f6('0x0'));var util=require('util');var moment=require(_0xd0f6('0x1'));var BPromise=require(_0xd0f6('0x2'));var rs=require(_0xd0f6('0x3'));var fs=require('fs');var Redis=require(_0xd0f6('0x4'));var db=require(_0xd0f6('0x5'))['db'];var utils=require(_0xd0f6('0x6'));var logger=require(_0xd0f6('0x7'))(_0xd0f6('0x8'));var config=require('../../config/environment');var jayson=require(_0xd0f6('0x9'));var client=jayson['client'][_0xd0f6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5234ff,_0xc983a8,_0x4c17eb){return new BPromise(function(_0x3c9489,_0x5e2aa4){return client[_0xd0f6('0xb')](_0x5234ff,_0x4c17eb)[_0xd0f6('0xc')](function(_0x429fbc){logger[_0xd0f6('0xd')](_0xd0f6('0xe'),_0xc983a8,_0xd0f6('0xf'));logger[_0xd0f6('0x10')](_0xd0f6('0x11'),_0xc983a8,'request\x20sent',JSON[_0xd0f6('0x12')](_0x429fbc));if(_0x429fbc['error']){if(_0x429fbc[_0xd0f6('0x13')][_0xd0f6('0x14')]===0x1f4){logger[_0xd0f6('0x13')](_0xd0f6('0xe'),_0xc983a8,_0x429fbc[_0xd0f6('0x13')]['message']);return _0x5e2aa4(_0x429fbc[_0xd0f6('0x13')][_0xd0f6('0x15')]);}logger[_0xd0f6('0x13')](_0xd0f6('0xe'),_0xc983a8,_0x429fbc[_0xd0f6('0x13')][_0xd0f6('0x15')]);return _0x3c9489(_0x429fbc['error'][_0xd0f6('0x15')]);}else{logger[_0xd0f6('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0xc983a8,_0xd0f6('0xf'));_0x3c9489(_0x429fbc[_0xd0f6('0x16')][_0xd0f6('0x15')]);}})[_0xd0f6('0x17')](function(_0x1ce546){logger['error'](_0xd0f6('0xe'),_0xc983a8,_0x1ce546);_0x5e2aa4(_0x1ce546);});});}
\ No newline at end of file
+var _0x30ef=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x54d24b,_0x42d95e){var _0x295740=function(_0x1fa805){while(--_0x1fa805){_0x54d24b['push'](_0x54d24b['shift']());}};_0x295740(++_0x42d95e);}(_0x30ef,0x79));var _0xf30e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x30ef[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf30e('0x0'));var util=require('util');var moment=require(_0xf30e('0x1'));var BPromise=require(_0xf30e('0x2'));var rs=require(_0xf30e('0x3'));var fs=require('fs');var Redis=require(_0xf30e('0x4'));var db=require(_0xf30e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf30e('0x6'))(_0xf30e('0x7'));var config=require(_0xf30e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf30e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x131fb0,_0x5709bf,_0x53d4ab){return new BPromise(function(_0xa36fb3,_0x49c438){return client[_0xf30e('0xa')](_0x131fb0,_0x53d4ab)['then'](function(_0x12fc8f){logger[_0xf30e('0xb')](_0xf30e('0xc'),_0x5709bf,_0xf30e('0xd'));logger[_0xf30e('0xe')](_0xf30e('0xf'),_0x5709bf,_0xf30e('0xd'),JSON[_0xf30e('0x10')](_0x12fc8f));if(_0x12fc8f[_0xf30e('0x11')]){if(_0x12fc8f[_0xf30e('0x11')]['code']===0x1f4){logger[_0xf30e('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x5709bf,_0x12fc8f['error'][_0xf30e('0x12')]);return _0x49c438(_0x12fc8f[_0xf30e('0x11')]['message']);}logger[_0xf30e('0x11')](_0xf30e('0xc'),_0x5709bf,_0x12fc8f[_0xf30e('0x11')]['message']);return _0xa36fb3(_0x12fc8f[_0xf30e('0x11')]['message']);}else{logger['info'](_0xf30e('0xc'),_0x5709bf,_0xf30e('0xd'));_0xa36fb3(_0x12fc8f['result'][_0xf30e('0x12')]);}})[_0xf30e('0x13')](function(_0x4366d3){logger[_0xf30e('0x11')](_0xf30e('0xc'),_0x5709bf,_0x4366d3);_0x49c438(_0x4366d3);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 588b7cb..df46150 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 _0x7f3f=['Router','fs-extra','../../components/auth/service','../../config/environment','./analyticMetric.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7f3f,0x1c8));var _0xf7f3=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0x7f3f[_0x40a825];return _0x273a54;};'use strict';var multer=require(_0xf7f3('0x0'));var util=require(_0xf7f3('0x1'));var path=require('path');var timeout=require(_0xf7f3('0x2'));var express=require(_0xf7f3('0x3'));var router=express[_0xf7f3('0x4')]();var fs_extra=require(_0xf7f3('0x5'));var auth=require(_0xf7f3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf7f3('0x7'));var controller=require(_0xf7f3('0x8'));router['get']('/',auth[_0xf7f3('0x9')](),controller[_0xf7f3('0xa')]);router[_0xf7f3('0xb')](_0xf7f3('0xc'),auth[_0xf7f3('0x9')](),controller[_0xf7f3('0xd')]);router[_0xf7f3('0xe')]('/',auth['isAuthenticated'](),controller[_0xf7f3('0xf')]);router[_0xf7f3('0x10')](_0xf7f3('0xc'),auth[_0xf7f3('0x9')](),controller[_0xf7f3('0x11')]);router[_0xf7f3('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xf7f3('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x1d7e=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','create','update','exports','util','path','connect-timeout'];(function(_0x6527e0,_0x35e367){var _0x1a8d1b=function(_0x41d7b6){while(--_0x41d7b6){_0x6527e0['push'](_0x6527e0['shift']());}};_0x1a8d1b(++_0x35e367);}(_0x1d7e,0x7d));var _0xe1d7=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x1d7e[_0x9df060];return _0x338dfe;};'use strict';var multer=require('multer');var util=require(_0xe1d7('0x0'));var path=require(_0xe1d7('0x1'));var timeout=require(_0xe1d7('0x2'));var express=require('express');var router=express[_0xe1d7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe1d7('0x4'));var interaction=require(_0xe1d7('0x5'));var config=require(_0xe1d7('0x6'));var controller=require(_0xe1d7('0x7'));router[_0xe1d7('0x8')]('/',auth[_0xe1d7('0x9')](),controller[_0xe1d7('0xa')]);router[_0xe1d7('0x8')](_0xe1d7('0xb'),auth[_0xe1d7('0x9')](),controller[_0xe1d7('0xc')]);router['post']('/',auth[_0xe1d7('0x9')](),controller[_0xe1d7('0xd')]);router['put'](_0xe1d7('0xb'),auth['isAuthenticated'](),controller[_0xe1d7('0xe')]);router['delete'](_0xe1d7('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xe1d7('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 4dae772..7f7ec5d 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 _0x2b44=['TEXT','sequelize'];(function(_0x4a2555,_0x3df257){var _0x13c557=function(_0x762348){while(--_0x762348){_0x4a2555['push'](_0x4a2555['shift']());}};_0x13c557(++_0x3df257);}(_0x2b44,0x1d7));var _0x42b4=function(_0x4cae6a,_0x41fe19){_0x4cae6a=_0x4cae6a-0x0;var _0x2fe2b8=_0x2b44[_0x4cae6a];return _0x2fe2b8;};'use strict';var Sequelize=require(_0x42b4('0x0'));module['exports']={'tree':{'type':Sequelize[_0x42b4('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0xe02d=['exports','TEXT','sequelize'];(function(_0x1e953a,_0x4878d4){var _0x10498d=function(_0x51980f){while(--_0x51980f){_0x1e953a['push'](_0x1e953a['shift']());}};_0x10498d(++_0x4878d4);}(_0xe02d,0x8f));var _0xde02=function(_0x5aea3e,_0x20d237){_0x5aea3e=_0x5aea3e-0x0;var _0x558b7b=_0xe02d[_0x5aea3e];return _0x558b7b;};'use strict';var Sequelize=require(_0xde02('0x0'));module[_0xde02('0x1')]={'tree':{'type':Sequelize[_0xde02('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 c5e3ab3..5dd083a 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 _0xa13b=['moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','AnalyticTreeReport','keys','find','create','body','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x4ee813,_0x59f32b){var _0xa254ec=function(_0x34c3dd){while(--_0x34c3dd){_0x4ee813['push'](_0x4ee813['shift']());}};_0xa254ec(++_0x59f32b);}(_0xa13b,0x94));var _0xba13=function(_0x3ff07a,_0x1c4e69){_0x3ff07a=_0x3ff07a-0x0;var _0x2e5ce4=_0xa13b[_0x3ff07a];return _0x2e5ce4;};'use strict';var emlformat=require(_0xba13('0x0'));var rimraf=require(_0xba13('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xba13('0x2'));var rp=require(_0xba13('0x3'));var moment=require(_0xba13('0x4'));var BPromise=require(_0xba13('0x5'));var Mustache=require(_0xba13('0x6'));var util=require('util');var path=require(_0xba13('0x7'));var sox=require(_0xba13('0x8'));var csv=require(_0xba13('0x9'));var ejs=require(_0xba13('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xba13('0xb'));var squel=require(_0xba13('0xc'));var crypto=require(_0xba13('0xd'));var jsforce=require(_0xba13('0xe'));var deskjs=require(_0xba13('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xba13('0x10'));var Redis=require(_0xba13('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xba13('0x12'));var as=require(_0xba13('0x13'));var hardwareService=require(_0xba13('0x14'));var logger=require(_0xba13('0x15'))(_0xba13('0x16'));var utils=require(_0xba13('0x17'));var config=require(_0xba13('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xba13('0x19'))['db'];function respondWithStatusCode(_0x1d4824,_0x4f6d4c){_0x4f6d4c=_0x4f6d4c||0xcc;return function(_0x3ec76a){if(_0x3ec76a){return _0x1d4824[_0xba13('0x1a')](_0x4f6d4c);}return _0x1d4824[_0xba13('0x1b')](_0x4f6d4c)[_0xba13('0x1c')]();};}function respondWithResult(_0x27b18f,_0x2bc677){_0x2bc677=_0x2bc677||0xc8;return function(_0x5c98b7){if(_0x5c98b7){return _0x27b18f['status'](_0x2bc677)['json'](_0x5c98b7);}};}function respondWithFilteredResult(_0x22d975,_0x338fe3){return function(_0x13fe79){if(_0x13fe79){var _0x2c3434=typeof _0x338fe3[_0xba13('0x1d')]===_0xba13('0x1e')&&typeof _0x338fe3[_0xba13('0x1f')]===_0xba13('0x1e');var _0x5ce355=_0x13fe79[_0xba13('0x20')];var _0x4f353b=_0x2c3434?0x0:_0x338fe3['offset'];var _0x4e2209=_0x2c3434?_0x13fe79[_0xba13('0x20')]:_0x338fe3[_0xba13('0x1d')]+_0x338fe3[_0xba13('0x1f')];var _0x32b069;if(_0x4e2209>=_0x5ce355){_0x4e2209=_0x5ce355;_0x32b069=0xc8;}else{_0x32b069=0xce;}_0x22d975[_0xba13('0x1b')](_0x32b069);return _0x22d975[_0xba13('0x21')](_0xba13('0x22'),_0x4f353b+'-'+_0x4e2209+'/'+_0x5ce355)['json'](_0x13fe79);}return null;};}function patchUpdates(_0x156229){return function(_0x4e1cb2){try{jsonpatch[_0xba13('0x23')](_0x4e1cb2,_0x156229,!![]);}catch(_0x3b8883){return BPromise[_0xba13('0x24')](_0x3b8883);}return _0x4e1cb2[_0xba13('0x25')]();};}function saveUpdates(_0x54641d,_0x340b10){return function(_0x1e5942){if(_0x1e5942){return _0x1e5942[_0xba13('0x26')](_0x54641d)[_0xba13('0x27')](function(_0xd7c4a){return _0xd7c4a;});}return null;};}function removeEntity(_0x3a38f,_0x57c077){return function(_0x1a33bb){if(_0x1a33bb){return _0x1a33bb[_0xba13('0x28')]()[_0xba13('0x27')](function(){_0x3a38f[_0xba13('0x1b')](0xcc)[_0xba13('0x1c')]();});}};}function handleEntityNotFound(_0x261569,_0x4fd47f){return function(_0x414b5e){if(!_0x414b5e){_0x261569[_0xba13('0x1a')](0x194);}return _0x414b5e;};}function handleError(_0x76787b,_0x30edf3){_0x30edf3=_0x30edf3||0x1f4;return function(_0x454cbc){logger[_0xba13('0x29')](_0x454cbc[_0xba13('0x2a')]);if(_0x454cbc['name']){delete _0x454cbc[_0xba13('0x2b')];}_0x76787b[_0xba13('0x1b')](_0x30edf3)[_0xba13('0x2c')](_0x454cbc);};}exports[_0xba13('0x2d')]=function(_0x5d4848,_0x23e0f9){var _0x4f000c={},_0x413e58={},_0x1adf15={'count':0x0,'rows':[]};var _0x34a104=_['map'](db['AnalyticTreeReport'][_0xba13('0x2e')],function(_0x42a165){return{'name':_0x42a165[_0xba13('0x2f')],'type':_0x42a165[_0xba13('0x30')]['key']};});_0x413e58['model']=_[_0xba13('0x31')](_0x34a104,_0xba13('0x2b'));_0x413e58['query']=_['keys'](_0x5d4848[_0xba13('0x32')]);_0x413e58[_0xba13('0x33')]=_[_0xba13('0x34')](_0x413e58[_0xba13('0x35')],_0x413e58['query']);_0x4f000c[_0xba13('0x36')]=_[_0xba13('0x34')](_0x413e58[_0xba13('0x35')],qs[_0xba13('0x37')](_0x5d4848[_0xba13('0x32')]['fields']));_0x4f000c[_0xba13('0x36')]=_0x4f000c[_0xba13('0x36')]['length']?_0x4f000c[_0xba13('0x36')]:_0x413e58[_0xba13('0x35')];if(!_0x5d4848[_0xba13('0x32')]['hasOwnProperty'](_0xba13('0x38'))){_0x4f000c[_0xba13('0x1f')]=qs['limit'](_0x5d4848[_0xba13('0x32')][_0xba13('0x1f')]);_0x4f000c['offset']=qs[_0xba13('0x1d')](_0x5d4848[_0xba13('0x32')][_0xba13('0x1d')]);}_0x4f000c[_0xba13('0x39')]=qs[_0xba13('0x3a')](_0x5d4848[_0xba13('0x32')]['sort']);_0x4f000c[_0xba13('0x3b')]=qs[_0xba13('0x33')](_[_0xba13('0x3c')](_0x5d4848['query'],_0x413e58['filters']),_0x34a104);if(_0x5d4848[_0xba13('0x32')][_0xba13('0x3d')]){_0x4f000c[_0xba13('0x3b')]=_[_0xba13('0x3e')](_0x4f000c[_0xba13('0x3b')],{'$or':_[_0xba13('0x31')](_0x34a104,function(_0x525711){if(_0x525711[_0xba13('0x30')]!==_0xba13('0x3f')){var _0x107a8c={};_0x107a8c[_0x525711['name']]={'$like':'%'+_0x5d4848[_0xba13('0x32')][_0xba13('0x3d')]+'%'};return _0x107a8c;}})});}_0x4f000c=_['merge']({},_0x4f000c,_0x5d4848[_0xba13('0x40')]);var _0x526dc4={'where':_0x4f000c[_0xba13('0x3b')]};return db['AnalyticTreeReport'][_0xba13('0x20')](_0x526dc4)[_0xba13('0x27')](function(_0x399147){_0x1adf15[_0xba13('0x20')]=_0x399147;if(_0x5d4848[_0xba13('0x32')][_0xba13('0x41')]){_0x4f000c[_0xba13('0x42')]=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x4f000c);})[_0xba13('0x27')](function(_0x19e7f4){_0x1adf15[_0xba13('0x43')]=_0x19e7f4;return _0x1adf15;})[_0xba13('0x27')](respondWithFilteredResult(_0x23e0f9,_0x4f000c))[_0xba13('0x44')](handleError(_0x23e0f9,null));};exports[_0xba13('0x45')]=function(_0x37f5e6,_0x251cfe){var _0x574911={'raw':!![],'where':{'id':_0x37f5e6[_0xba13('0x46')]['id']}},_0x12a667={};_0x12a667['model']=_['keys'](db[_0xba13('0x47')][_0xba13('0x2e')]);_0x12a667[_0xba13('0x32')]=_[_0xba13('0x48')](_0x37f5e6['query']);_0x12a667[_0xba13('0x33')]=_[_0xba13('0x34')](_0x12a667['model'],_0x12a667[_0xba13('0x32')]);_0x574911['attributes']=_[_0xba13('0x34')](_0x12a667[_0xba13('0x35')],qs[_0xba13('0x37')](_0x37f5e6[_0xba13('0x32')][_0xba13('0x37')]));_0x574911[_0xba13('0x36')]=_0x574911[_0xba13('0x36')]['length']?_0x574911[_0xba13('0x36')]:_0x12a667[_0xba13('0x35')];if(_0x37f5e6[_0xba13('0x32')][_0xba13('0x41')]){_0x574911['include']=[{'all':!![]}];}_0x574911=_[_0xba13('0x3e')]({},_0x574911,_0x37f5e6[_0xba13('0x40')]);return db['AnalyticTreeReport'][_0xba13('0x49')](_0x574911)[_0xba13('0x27')](handleEntityNotFound(_0x251cfe,null))['then'](respondWithResult(_0x251cfe,null))[_0xba13('0x44')](handleError(_0x251cfe,null));};exports[_0xba13('0x4a')]=function(_0x74039d,_0x387730){return db[_0xba13('0x47')][_0xba13('0x4a')](_0x74039d[_0xba13('0x4b')],{})[_0xba13('0x27')](respondWithResult(_0x387730,0xc9))[_0xba13('0x44')](handleError(_0x387730,null));};exports[_0xba13('0x26')]=function(_0x3a17f8,_0x375a60){if(_0x3a17f8[_0xba13('0x4b')]['id']){delete _0x3a17f8[_0xba13('0x4b')]['id'];}return db[_0xba13('0x47')][_0xba13('0x49')]({'where':{'id':_0x3a17f8['params']['id']}})['then'](handleEntityNotFound(_0x375a60,null))[_0xba13('0x27')](saveUpdates(_0x3a17f8[_0xba13('0x4b')],null))['then'](respondWithResult(_0x375a60,null))[_0xba13('0x44')](handleError(_0x375a60,null));};exports[_0xba13('0x28')]=function(_0x10e707,_0x229d0f){return db[_0xba13('0x47')][_0xba13('0x49')]({'where':{'id':_0x10e707[_0xba13('0x46')]['id']}})['then'](handleEntityNotFound(_0x229d0f,null))['then'](removeEntity(_0x229d0f,null))['catch'](handleError(_0x229d0f,null));};
\ No newline at end of file
+var _0xf40f=['order','sort','where','merge','type','VIRTUAL','filter','include','findAll','catch','params','includeAll','options','find','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xf40f,0xa5));var _0xff40=function(_0x531aa0,_0x3dfce1){_0x531aa0=_0x531aa0-0x0;var _0x450cce=_0xf40f[_0x531aa0];return _0x450cce;};'use strict';var emlformat=require(_0xff40('0x0'));var rimraf=require(_0xff40('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xff40('0x2'));var rp=require(_0xff40('0x3'));var moment=require('moment');var BPromise=require(_0xff40('0x4'));var Mustache=require('mustache');var util=require(_0xff40('0x5'));var path=require(_0xff40('0x6'));var sox=require(_0xff40('0x7'));var csv=require(_0xff40('0x8'));var ejs=require(_0xff40('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xff40('0xa'));var squel=require(_0xff40('0xb'));var crypto=require(_0xff40('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xff40('0x8'));var querystring=require(_0xff40('0xd'));var Papa=require(_0xff40('0xe'));var Redis=require(_0xff40('0xf'));var authService=require(_0xff40('0x10'));var qs=require(_0xff40('0x11'));var as=require(_0xff40('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xff40('0x13'))('api');var utils=require(_0xff40('0x14'));var config=require(_0xff40('0x15'));var licenseUtil=require(_0xff40('0x16'));var db=require(_0xff40('0x17'))['db'];function respondWithStatusCode(_0x36c091,_0xcce1bd){_0xcce1bd=_0xcce1bd||0xcc;return function(_0x1a111e){if(_0x1a111e){return _0x36c091[_0xff40('0x18')](_0xcce1bd);}return _0x36c091[_0xff40('0x19')](_0xcce1bd)['end']();};}function respondWithResult(_0x287b60,_0x275efb){_0x275efb=_0x275efb||0xc8;return function(_0x3651ee){if(_0x3651ee){return _0x287b60[_0xff40('0x19')](_0x275efb)[_0xff40('0x1a')](_0x3651ee);}};}function respondWithFilteredResult(_0x4893a6,_0x521a0b){return function(_0x4813ac){if(_0x4813ac){var _0x1635b8=typeof _0x521a0b[_0xff40('0x1b')]===_0xff40('0x1c')&&typeof _0x521a0b[_0xff40('0x1d')]===_0xff40('0x1c');var _0x477a04=_0x4813ac[_0xff40('0x1e')];var _0x1136ac=_0x1635b8?0x0:_0x521a0b[_0xff40('0x1b')];var _0x5a1562=_0x1635b8?_0x4813ac['count']:_0x521a0b['offset']+_0x521a0b[_0xff40('0x1d')];var _0x236ae4;if(_0x5a1562>=_0x477a04){_0x5a1562=_0x477a04;_0x236ae4=0xc8;}else{_0x236ae4=0xce;}_0x4893a6['status'](_0x236ae4);return _0x4893a6[_0xff40('0x1f')](_0xff40('0x20'),_0x1136ac+'-'+_0x5a1562+'/'+_0x477a04)[_0xff40('0x1a')](_0x4813ac);}return null;};}function patchUpdates(_0x5a25f8){return function(_0x501720){try{jsonpatch[_0xff40('0x21')](_0x501720,_0x5a25f8,!![]);}catch(_0x880842){return BPromise[_0xff40('0x22')](_0x880842);}return _0x501720[_0xff40('0x23')]();};}function saveUpdates(_0x503b41,_0x5e9bfd){return function(_0x5739a0){if(_0x5739a0){return _0x5739a0['update'](_0x503b41)[_0xff40('0x24')](function(_0x271928){return _0x271928;});}return null;};}function removeEntity(_0x3c00b8,_0x5b07c5){return function(_0x47858e){if(_0x47858e){return _0x47858e[_0xff40('0x25')]()['then'](function(){_0x3c00b8[_0xff40('0x19')](0xcc)[_0xff40('0x26')]();});}};}function handleEntityNotFound(_0x310258,_0xa5e543){return function(_0x595b72){if(!_0x595b72){_0x310258[_0xff40('0x18')](0x194);}return _0x595b72;};}function handleError(_0x8fe2c3,_0x586b2b){_0x586b2b=_0x586b2b||0x1f4;return function(_0x5e5448){logger['error'](_0x5e5448['stack']);if(_0x5e5448[_0xff40('0x27')]){delete _0x5e5448['name'];}_0x8fe2c3[_0xff40('0x19')](_0x586b2b)[_0xff40('0x28')](_0x5e5448);};}exports[_0xff40('0x29')]=function(_0x38b57f,_0x77b79){var _0x521109={},_0x321242={},_0x448277={'count':0x0,'rows':[]};var _0x86fab7=_[_0xff40('0x2a')](db[_0xff40('0x2b')][_0xff40('0x2c')],function(_0x2039f5){return{'name':_0x2039f5[_0xff40('0x2d')],'type':_0x2039f5['type'][_0xff40('0x2e')]};});_0x321242['model']=_[_0xff40('0x2a')](_0x86fab7,_0xff40('0x27'));_0x321242[_0xff40('0x2f')]=_[_0xff40('0x30')](_0x38b57f['query']);_0x321242[_0xff40('0x31')]=_[_0xff40('0x32')](_0x321242['model'],_0x321242[_0xff40('0x2f')]);_0x521109[_0xff40('0x33')]=_['intersection'](_0x321242[_0xff40('0x34')],qs[_0xff40('0x35')](_0x38b57f[_0xff40('0x2f')][_0xff40('0x35')]));_0x521109[_0xff40('0x33')]=_0x521109[_0xff40('0x33')][_0xff40('0x36')]?_0x521109['attributes']:_0x321242['model'];if(!_0x38b57f[_0xff40('0x2f')][_0xff40('0x37')](_0xff40('0x38'))){_0x521109[_0xff40('0x1d')]=qs[_0xff40('0x1d')](_0x38b57f[_0xff40('0x2f')][_0xff40('0x1d')]);_0x521109['offset']=qs[_0xff40('0x1b')](_0x38b57f['query'][_0xff40('0x1b')]);}_0x521109[_0xff40('0x39')]=qs[_0xff40('0x3a')](_0x38b57f[_0xff40('0x2f')][_0xff40('0x3a')]);_0x521109[_0xff40('0x3b')]=qs[_0xff40('0x31')](_['pick'](_0x38b57f[_0xff40('0x2f')],_0x321242[_0xff40('0x31')]),_0x86fab7);if(_0x38b57f['query']['filter']){_0x521109['where']=_[_0xff40('0x3c')](_0x521109[_0xff40('0x3b')],{'$or':_[_0xff40('0x2a')](_0x86fab7,function(_0x387013){if(_0x387013[_0xff40('0x3d')]!==_0xff40('0x3e')){var _0x21453f={};_0x21453f[_0x387013[_0xff40('0x27')]]={'$like':'%'+_0x38b57f[_0xff40('0x2f')][_0xff40('0x3f')]+'%'};return _0x21453f;}})});}_0x521109=_[_0xff40('0x3c')]({},_0x521109,_0x38b57f['options']);var _0x5a198e={'where':_0x521109[_0xff40('0x3b')]};return db[_0xff40('0x2b')][_0xff40('0x1e')](_0x5a198e)[_0xff40('0x24')](function(_0x5e5307){_0x448277[_0xff40('0x1e')]=_0x5e5307;if(_0x38b57f['query']['includeAll']){_0x521109[_0xff40('0x40')]=[{'all':!![]}];}return db[_0xff40('0x2b')][_0xff40('0x41')](_0x521109);})[_0xff40('0x24')](function(_0x41ed7f){_0x448277['rows']=_0x41ed7f;return _0x448277;})[_0xff40('0x24')](respondWithFilteredResult(_0x77b79,_0x521109))[_0xff40('0x42')](handleError(_0x77b79,null));};exports['show']=function(_0x5d7a7e,_0x5bdac8){var _0xf5cab9={'raw':!![],'where':{'id':_0x5d7a7e[_0xff40('0x43')]['id']}},_0x12b56f={};_0x12b56f[_0xff40('0x34')]=_['keys'](db['AnalyticTreeReport'][_0xff40('0x2c')]);_0x12b56f[_0xff40('0x2f')]=_[_0xff40('0x30')](_0x5d7a7e['query']);_0x12b56f[_0xff40('0x31')]=_[_0xff40('0x32')](_0x12b56f[_0xff40('0x34')],_0x12b56f[_0xff40('0x2f')]);_0xf5cab9[_0xff40('0x33')]=_[_0xff40('0x32')](_0x12b56f[_0xff40('0x34')],qs[_0xff40('0x35')](_0x5d7a7e['query'][_0xff40('0x35')]));_0xf5cab9[_0xff40('0x33')]=_0xf5cab9[_0xff40('0x33')][_0xff40('0x36')]?_0xf5cab9['attributes']:_0x12b56f[_0xff40('0x34')];if(_0x5d7a7e[_0xff40('0x2f')][_0xff40('0x44')]){_0xf5cab9[_0xff40('0x40')]=[{'all':!![]}];}_0xf5cab9=_[_0xff40('0x3c')]({},_0xf5cab9,_0x5d7a7e[_0xff40('0x45')]);return db[_0xff40('0x2b')][_0xff40('0x46')](_0xf5cab9)[_0xff40('0x24')](handleEntityNotFound(_0x5bdac8,null))[_0xff40('0x24')](respondWithResult(_0x5bdac8,null))['catch'](handleError(_0x5bdac8,null));};exports[_0xff40('0x47')]=function(_0x233d1b,_0x26590f){return db['AnalyticTreeReport'][_0xff40('0x47')](_0x233d1b[_0xff40('0x48')],{})[_0xff40('0x24')](respondWithResult(_0x26590f,0xc9))['catch'](handleError(_0x26590f,null));};exports[_0xff40('0x49')]=function(_0x5cb9fd,_0x4f92e1){if(_0x5cb9fd['body']['id']){delete _0x5cb9fd['body']['id'];}return db[_0xff40('0x2b')][_0xff40('0x46')]({'where':{'id':_0x5cb9fd[_0xff40('0x43')]['id']}})['then'](handleEntityNotFound(_0x4f92e1,null))[_0xff40('0x24')](saveUpdates(_0x5cb9fd[_0xff40('0x48')],null))[_0xff40('0x24')](respondWithResult(_0x4f92e1,null))[_0xff40('0x42')](handleError(_0x4f92e1,null));};exports['destroy']=function(_0x10374d,_0x48489b){return db[_0xff40('0x2b')][_0xff40('0x46')]({'where':{'id':_0x10374d[_0xff40('0x43')]['id']}})['then'](handleEntityNotFound(_0x48489b,null))['then'](removeEntity(_0x48489b,null))['catch'](handleError(_0x48489b,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 223caa8..5bc7a1f 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 _0x2f79=['util','../../config/logger','api','request-promise','path','rimraf','exports','define','lodash'];(function(_0x2241f6,_0xb1cce9){var _0x199d95=function(_0x134215){while(--_0x134215){_0x2241f6['push'](_0x2241f6['shift']());}};_0x199d95(++_0xb1cce9);}(_0x2f79,0x194));var _0x92f7=function(_0x1c5ae6,_0x30f2bd){_0x1c5ae6=_0x1c5ae6-0x0;var _0x4623f3=_0x2f79[_0x1c5ae6];return _0x4623f3;};'use strict';var _=require(_0x92f7('0x0'));var util=require(_0x92f7('0x1'));var logger=require(_0x92f7('0x2'))(_0x92f7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x92f7('0x4'));var fs=require('fs');var path=require(_0x92f7('0x5'));var rimraf=require(_0x92f7('0x6'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module[_0x92f7('0x7')]=function(_0x4583da,_0x2475e6){return _0x4583da[_0x92f7('0x8')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfec8=['path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','analytics_report_trees','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xfec8,0x72));var _0x8fec=function(_0x34232c,_0x18e61d){_0x34232c=_0x34232c-0x0;var _0x4d4f4e=_0xfec8[_0x34232c];return _0x4d4f4e;};'use strict';var _=require(_0x8fec('0x0'));var util=require(_0x8fec('0x1'));var logger=require(_0x8fec('0x2'))('api');var moment=require(_0x8fec('0x3'));var BPromise=require(_0x8fec('0x4'));var rp=require(_0x8fec('0x5'));var fs=require('fs');var path=require(_0x8fec('0x6'));var rimraf=require(_0x8fec('0x7'));var config=require(_0x8fec('0x8'));var attributes=require(_0x8fec('0x9'));module[_0x8fec('0xa')]=function(_0x409059,_0x751863){return _0x409059['define']('AnalyticTreeReport',attributes,{'tableName':_0x8fec('0xb'),'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 67ee857..f92b188 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(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x533439,_0x218a06){_0x533439=_0x533439-0x0;var _0xf75563=_0x7a54[_0x533439];return _0xf75563;};'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 _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(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0x32babe,_0x4e4839){_0x32babe=_0x32babe-0x0;var _0x42a401=_0x7a54[_0x32babe];return _0x42a401;};'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
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 0a396c5..69926af 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 _0xc01c=['put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','post'];(function(_0x1b70e3,_0x3a15b1){var _0x1452ab=function(_0x692883){while(--_0x692883){_0x1b70e3['push'](_0x1b70e3['shift']());}};_0x1452ab(++_0x3a15b1);}(_0xc01c,0xd4));var _0xcc01=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc01c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xcc01('0x0'));var util=require(_0xcc01('0x1'));var path=require(_0xcc01('0x2'));var timeout=require(_0xcc01('0x3'));var express=require(_0xcc01('0x4'));var router=express['Router']();var fs_extra=require(_0xcc01('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcc01('0x6'));var config=require(_0xcc01('0x7'));var controller=require('./analyticTreeReport.controller');router[_0xcc01('0x8')]('/',auth[_0xcc01('0x9')](),controller['index']);router['get'](_0xcc01('0xa'),auth[_0xcc01('0x9')](),controller['show']);router[_0xcc01('0xb')]('/',auth[_0xcc01('0x9')](),controller['create']);router[_0xcc01('0xc')]('/:id',auth[_0xcc01('0x9')](),controller[_0xcc01('0xd')]);router[_0xcc01('0xe')](_0xcc01('0xa'),auth[_0xcc01('0x9')](),controller[_0xcc01('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x5e0c=['../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x33af76,_0x3ebd88){var _0x3969c1=function(_0x440686){while(--_0x440686){_0x33af76['push'](_0x33af76['shift']());}};_0x3969c1(++_0x3ebd88);}(_0x5e0c,0x8c));var _0xc5e0=function(_0xcc69c5,_0x5b35b2){_0xcc69c5=_0xcc69c5-0x0;var _0x14ec59=_0x5e0c[_0xcc69c5];return _0x14ec59;};'use strict';var multer=require(_0xc5e0('0x0'));var util=require(_0xc5e0('0x1'));var path=require(_0xc5e0('0x2'));var timeout=require(_0xc5e0('0x3'));var express=require(_0xc5e0('0x4'));var router=express['Router']();var fs_extra=require(_0xc5e0('0x5'));var auth=require(_0xc5e0('0x6'));var interaction=require(_0xc5e0('0x7'));var config=require(_0xc5e0('0x8'));var controller=require(_0xc5e0('0x9'));router[_0xc5e0('0xa')]('/',auth[_0xc5e0('0xb')](),controller[_0xc5e0('0xc')]);router[_0xc5e0('0xa')](_0xc5e0('0xd'),auth[_0xc5e0('0xb')](),controller[_0xc5e0('0xe')]);router[_0xc5e0('0xf')]('/',auth['isAuthenticated'](),controller[_0xc5e0('0x10')]);router[_0xc5e0('0x11')](_0xc5e0('0xd'),auth[_0xc5e0('0xb')](),controller[_0xc5e0('0x12')]);router[_0xc5e0('0x13')](_0xc5e0('0xd'),auth[_0xc5e0('0xb')](),controller['destroy']);module[_0xc5e0('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 7cde43d..9cc8c4e 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 _0xc831=['STRING','exports'];(function(_0x2bdd8d,_0xec359a){var _0x20f57e=function(_0x1af017){while(--_0x1af017){_0x2bdd8d['push'](_0x2bdd8d['shift']());}};_0x20f57e(++_0xec359a);}(_0xc831,0x103));var _0x1c83=function(_0x4cae1e,_0x3447fb){_0x4cae1e=_0x4cae1e-0x0;var _0x17210e=_0xc831[_0x4cae1e];return _0x17210e;};'use strict';var Sequelize=require('sequelize');module[_0x1c83('0x0')]={'name':{'type':Sequelize[_0x1c83('0x1')]},'basename':{'type':Sequelize[_0x1c83('0x1')]},'type':{'type':Sequelize[_0x1c83('0x1')]}};
\ No newline at end of file
+var _0xec56=['STRING','sequelize'];(function(_0x802a40,_0x1d3a52){var _0x25cec0=function(_0x4f2530){while(--_0x4f2530){_0x802a40['push'](_0x802a40['shift']());}};_0x25cec0(++_0x1d3a52);}(_0xec56,0x1bd));var _0x6ec5=function(_0x284f93,_0x2539ce){_0x284f93=_0x284f93-0x0;var _0x3e0a59=_0xec56[_0x284f93];return _0x3e0a59;};'use strict';var Sequelize=require(_0x6ec5('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x6ec5('0x1')]},'type':{'type':Sequelize[_0x6ec5('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index e46aad8..6f0994f 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 _0x6ba7=['rimraf','zip-dir','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','map','Attachment','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','clone','omit','updatedAt','body','create','file','originalname','basename','type','mimetype','download','ChatOfflineMessageId','join','server/files/attachments/','eml-format'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6ba7,0x104));var _0x76ba=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6ba7[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x76ba('0x0'));var rimraf=require(_0x76ba('0x1'));var zipdir=require(_0x76ba('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x76ba('0x3'));var moment=require(_0x76ba('0x4'));var BPromise=require(_0x76ba('0x5'));var Mustache=require('mustache');var util=require(_0x76ba('0x6'));var path=require('path');var sox=require(_0x76ba('0x7'));var csv=require('to-csv');var ejs=require(_0x76ba('0x8'));var fs=require('fs');var fs_extra=require(_0x76ba('0x9'));var _=require(_0x76ba('0xa'));var squel=require(_0x76ba('0xb'));var crypto=require(_0x76ba('0xc'));var jsforce=require(_0x76ba('0xd'));var deskjs=require(_0x76ba('0xe'));var toCsv=require(_0x76ba('0xf'));var querystring=require(_0x76ba('0x10'));var Papa=require('papaparse');var Redis=require(_0x76ba('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x76ba('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x76ba('0x13'));var logger=require(_0x76ba('0x14'))(_0x76ba('0x15'));var utils=require('../../config/utils');var config=require(_0x76ba('0x16'));var licenseUtil=require(_0x76ba('0x17'));var db=require(_0x76ba('0x18'))['db'];function respondWithStatusCode(_0x25b458,_0x32527e){_0x32527e=_0x32527e||0xcc;return function(_0xa76d59){if(_0xa76d59){return _0x25b458[_0x76ba('0x19')](_0x32527e);}return _0x25b458[_0x76ba('0x1a')](_0x32527e)[_0x76ba('0x1b')]();};}function respondWithResult(_0x50fcac,_0x37e39e){_0x37e39e=_0x37e39e||0xc8;return function(_0x50b759){if(_0x50b759){return _0x50fcac['status'](_0x37e39e)[_0x76ba('0x1c')](_0x50b759);}};}function respondWithFilteredResult(_0x4d2bbf,_0x2d7674){return function(_0x50263f){if(_0x50263f){var _0x2367ce=typeof _0x2d7674[_0x76ba('0x1d')]==='undefined'&&typeof _0x2d7674[_0x76ba('0x1e')]===_0x76ba('0x1f');var _0x5a61b0=_0x50263f['count'];var _0x447c8e=_0x2367ce?0x0:_0x2d7674[_0x76ba('0x1d')];var _0xab4a06=_0x2367ce?_0x50263f[_0x76ba('0x20')]:_0x2d7674[_0x76ba('0x1d')]+_0x2d7674['limit'];var _0x158510;if(_0xab4a06>=_0x5a61b0){_0xab4a06=_0x5a61b0;_0x158510=0xc8;}else{_0x158510=0xce;}_0x4d2bbf[_0x76ba('0x1a')](_0x158510);return _0x4d2bbf[_0x76ba('0x21')](_0x76ba('0x22'),_0x447c8e+'-'+_0xab4a06+'/'+_0x5a61b0)[_0x76ba('0x1c')](_0x50263f);}return null;};}function patchUpdates(_0x302c02){return function(_0x577816){try{jsonpatch[_0x76ba('0x23')](_0x577816,_0x302c02,!![]);}catch(_0x8b8cf7){return BPromise[_0x76ba('0x24')](_0x8b8cf7);}return _0x577816[_0x76ba('0x25')]();};}function saveUpdates(_0x7086e7,_0x3eb00f){return function(_0x25cd14){if(_0x25cd14){return _0x25cd14[_0x76ba('0x26')](_0x7086e7)['then'](function(_0x4614f5){return _0x4614f5;});}return null;};}function removeEntity(_0x4656a0,_0x3c92d7){return function(_0x544321){if(_0x544321){return _0x544321[_0x76ba('0x27')]()[_0x76ba('0x28')](function(){_0x4656a0[_0x76ba('0x1a')](0xcc)[_0x76ba('0x1b')]();});}};}function handleEntityNotFound(_0x1da710,_0x510a5e){return function(_0x256449){if(!_0x256449){_0x1da710[_0x76ba('0x19')](0x194);}return _0x256449;};}function handleError(_0x9022d7,_0x539be1){_0x539be1=_0x539be1||0x1f4;return function(_0x35f426){logger[_0x76ba('0x29')](_0x35f426['stack']);if(_0x35f426[_0x76ba('0x2a')]){delete _0x35f426[_0x76ba('0x2a')];}_0x9022d7[_0x76ba('0x1a')](_0x539be1)[_0x76ba('0x2b')](_0x35f426);};}exports[_0x76ba('0x2c')]=function(_0x282a98,_0x2354c5){var _0x1ec408={},_0x59c6bc={},_0x5af678={'count':0x0,'rows':[]};var _0xf5dd30=_[_0x76ba('0x2d')](db[_0x76ba('0x2e')][_0x76ba('0x2f')],function(_0x156576){return{'name':_0x156576[_0x76ba('0x30')],'type':_0x156576['type']['key']};});_0x59c6bc[_0x76ba('0x31')]=_[_0x76ba('0x2d')](_0xf5dd30,'name');_0x59c6bc[_0x76ba('0x32')]=_[_0x76ba('0x33')](_0x282a98[_0x76ba('0x32')]);_0x59c6bc[_0x76ba('0x34')]=_[_0x76ba('0x35')](_0x59c6bc[_0x76ba('0x31')],_0x59c6bc[_0x76ba('0x32')]);_0x1ec408[_0x76ba('0x36')]=_['intersection'](_0x59c6bc['model'],qs[_0x76ba('0x37')](_0x282a98['query'][_0x76ba('0x37')]));_0x1ec408[_0x76ba('0x36')]=_0x1ec408['attributes']['length']?_0x1ec408['attributes']:_0x59c6bc[_0x76ba('0x31')];if(!_0x282a98[_0x76ba('0x32')][_0x76ba('0x38')](_0x76ba('0x39'))){_0x1ec408[_0x76ba('0x1e')]=qs[_0x76ba('0x1e')](_0x282a98[_0x76ba('0x32')][_0x76ba('0x1e')]);_0x1ec408[_0x76ba('0x1d')]=qs[_0x76ba('0x1d')](_0x282a98[_0x76ba('0x32')]['offset']);}_0x1ec408['order']=qs[_0x76ba('0x3a')](_0x282a98['query'][_0x76ba('0x3a')]);_0x1ec408[_0x76ba('0x3b')]=qs[_0x76ba('0x34')](_[_0x76ba('0x3c')](_0x282a98[_0x76ba('0x32')],_0x59c6bc['filters']),_0xf5dd30);if(_0x282a98[_0x76ba('0x32')][_0x76ba('0x3d')]){_0x1ec408[_0x76ba('0x3b')]=_[_0x76ba('0x3e')](_0x1ec408[_0x76ba('0x3b')],{'$or':_[_0x76ba('0x2d')](_0xf5dd30,function(_0x81f828){if(_0x81f828['type']!=='VIRTUAL'){var _0x1bf4d1={};_0x1bf4d1[_0x81f828[_0x76ba('0x2a')]]={'$like':'%'+_0x282a98[_0x76ba('0x32')]['filter']+'%'};return _0x1bf4d1;}})});}_0x1ec408=_['merge']({},_0x1ec408,_0x282a98['options']);var _0x31e43e={'where':_0x1ec408[_0x76ba('0x3b')]};return db[_0x76ba('0x2e')]['count'](_0x31e43e)[_0x76ba('0x28')](function(_0x369a40){_0x5af678[_0x76ba('0x20')]=_0x369a40;if(_0x282a98[_0x76ba('0x32')][_0x76ba('0x3f')]){_0x1ec408[_0x76ba('0x40')]=[{'all':!![]}];}return db[_0x76ba('0x2e')][_0x76ba('0x41')](_0x1ec408);})['then'](function(_0x2f6cfa){_0x5af678[_0x76ba('0x42')]=_0x2f6cfa;return _0x5af678;})[_0x76ba('0x28')](respondWithFilteredResult(_0x2354c5,_0x1ec408))[_0x76ba('0x43')](handleError(_0x2354c5,null));};exports[_0x76ba('0x44')]=function(_0x1879d1,_0x44c8be){var _0x364eab={'raw':!![],'where':{'id':_0x1879d1[_0x76ba('0x45')]['id']}},_0x5d4092={};_0x5d4092[_0x76ba('0x31')]=_['keys'](db[_0x76ba('0x2e')][_0x76ba('0x2f')]);_0x5d4092[_0x76ba('0x32')]=_[_0x76ba('0x33')](_0x1879d1[_0x76ba('0x32')]);_0x5d4092['filters']=_['intersection'](_0x5d4092[_0x76ba('0x31')],_0x5d4092[_0x76ba('0x32')]);_0x364eab[_0x76ba('0x36')]=_['intersection'](_0x5d4092['model'],qs[_0x76ba('0x37')](_0x1879d1[_0x76ba('0x32')][_0x76ba('0x37')]));_0x364eab['attributes']=_0x364eab[_0x76ba('0x36')][_0x76ba('0x46')]?_0x364eab[_0x76ba('0x36')]:_0x5d4092['model'];if(_0x1879d1[_0x76ba('0x32')]['includeAll']){_0x364eab['include']=[{'all':!![]}];}_0x364eab=_[_0x76ba('0x3e')]({},_0x364eab,_0x1879d1[_0x76ba('0x47')]);return db[_0x76ba('0x2e')][_0x76ba('0x48')](_0x364eab)[_0x76ba('0x28')](handleEntityNotFound(_0x44c8be,null))[_0x76ba('0x28')](respondWithResult(_0x44c8be,null))[_0x76ba('0x43')](handleError(_0x44c8be,null));};exports[_0x76ba('0x49')]=function(_0x413a40,_0x3d2a1f){var _0x1b20a3={'where':{'id':_0x413a40[_0x76ba('0x45')]['id']}},_0x53ecd8={};_0x53ecd8[_0x76ba('0x31')]=_[_0x76ba('0x33')](db[_0x76ba('0x2e')][_0x76ba('0x2f')]);_0x1b20a3['attributes']=_['intersection'](_0x53ecd8['model'],qs[_0x76ba('0x37')](_0x413a40[_0x76ba('0x32')][_0x76ba('0x37')]));_0x1b20a3[_0x76ba('0x36')]=_0x1b20a3['attributes'][_0x76ba('0x46')]?_0x1b20a3[_0x76ba('0x36')]:_0x53ecd8['model'];if(_0x413a40[_0x76ba('0x32')][_0x76ba('0x3f')]){_0x1b20a3[_0x76ba('0x40')]=[{'all':!![]}];}_0x1b20a3=_[_0x76ba('0x3e')]({},_0x1b20a3,_0x413a40[_0x76ba('0x47')]);return db[_0x76ba('0x2e')][_0x76ba('0x48')](_0x1b20a3)[_0x76ba('0x28')](handleEntityNotFound(_0x3d2a1f,null))[_0x76ba('0x28')](function(_0x1fc6fd){if(_0x1fc6fd){var _0x3fc834=_0x1fc6fd['get']({'plain':!![]});_0x3fc834=qs[_0x76ba('0x4a')](_0x3fc834,['id','createdAt',_0x76ba('0x4b')]);_0x413a40['body']=_[_0x76ba('0x4a')](_0x413a40[_0x76ba('0x4c')],['id','createdAt',_0x76ba('0x4b')]);return db['Attachment'][_0x76ba('0x4d')](_[_0x76ba('0x3e')](_0x3fc834,_0x413a40[_0x76ba('0x4c')]),{'include':_0x413a40[_0x76ba('0x32')][_0x76ba('0x3f')]?[{'all':!![]}]:undefined});}})[_0x76ba('0x28')](respondWithResult(_0x3d2a1f,0xc9))[_0x76ba('0x43')](handleError(_0x3d2a1f,null));};exports[_0x76ba('0x26')]=function(_0x30f34b,_0x50fdf1){if(_0x30f34b[_0x76ba('0x4c')]['id']){delete _0x30f34b[_0x76ba('0x4c')]['id'];}return db[_0x76ba('0x2e')][_0x76ba('0x48')]({'where':{'id':_0x30f34b[_0x76ba('0x45')]['id']}})['then'](handleEntityNotFound(_0x50fdf1,null))[_0x76ba('0x28')](saveUpdates(_0x30f34b[_0x76ba('0x4c')],null))[_0x76ba('0x28')](respondWithResult(_0x50fdf1,null))[_0x76ba('0x43')](handleError(_0x50fdf1,null));};exports[_0x76ba('0x27')]=function(_0x2fbaeb,_0x18ec07){return db[_0x76ba('0x2e')][_0x76ba('0x48')]({'where':{'id':_0x2fbaeb[_0x76ba('0x45')]['id']}})[_0x76ba('0x28')](handleEntityNotFound(_0x18ec07,null))[_0x76ba('0x28')](removeEntity(_0x18ec07,null))[_0x76ba('0x43')](handleError(_0x18ec07,null));};exports[_0x76ba('0x4d')]=function(_0xf439a3,_0xb996eb,_0x344ea7){_0xf439a3[_0x76ba('0x4c')][_0x76ba('0x2a')]=_0xf439a3[_0x76ba('0x4e')][_0x76ba('0x4f')];_0xf439a3[_0x76ba('0x4c')][_0x76ba('0x50')]=_0xf439a3[_0x76ba('0x4e')]['filename'];_0xf439a3[_0x76ba('0x4c')][_0x76ba('0x51')]=_0xf439a3[_0x76ba('0x4e')][_0x76ba('0x52')];return db[_0x76ba('0x2e')][_0x76ba('0x4d')](_0xf439a3[_0x76ba('0x4c')])['then'](respondWithResult(_0xb996eb,0xc9))[_0x76ba('0x43')](handleError(_0xb996eb,null));};exports[_0x76ba('0x53')]=function(_0x19bd7b,_0x4cecd3,_0x60a5b1){return db[_0x76ba('0x2e')]['findOne']({'where':{'id':_0x19bd7b['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x4cecd3,null))[_0x76ba('0x28')](function(_0x5d1993){if(_0x5d1993){var _0x13e70f=_0x5d1993[_0x76ba('0x54')]!==null;var _0x1b3a1c=path[_0x76ba('0x55')](config['root'],_0x76ba('0x56'));if(_0x13e70f){_0x1b3a1c=path[_0x76ba('0x55')](_0x1b3a1c,'offline-chat/');}var _0x2c093d=path['join'](_0x1b3a1c,_0x5d1993['basename']);return _0x4cecd3['download'](_0x2c093d);}})[_0x76ba('0x43')](handleError(_0x4cecd3,null));};
\ No newline at end of file
+var _0xef51=['create','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Attachment','type','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','VIRTUAL','options','where','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','createdAt','updatedAt','body','omit'];(function(_0x5c83b3,_0x256f06){var _0x3dc918=function(_0x34bebd){while(--_0x34bebd){_0x5c83b3['push'](_0x5c83b3['shift']());}};_0x3dc918(++_0x256f06);}(_0xef51,0x6a));var _0x1ef5=function(_0x3a90b6,_0x782086){_0x3a90b6=_0x3a90b6-0x0;var _0x56f71a=_0xef51[_0x3a90b6];return _0x56f71a;};'use strict';var emlformat=require(_0x1ef5('0x0'));var rimraf=require(_0x1ef5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1ef5('0x2'));var rp=require(_0x1ef5('0x3'));var moment=require(_0x1ef5('0x4'));var BPromise=require(_0x1ef5('0x5'));var Mustache=require(_0x1ef5('0x6'));var util=require(_0x1ef5('0x7'));var path=require(_0x1ef5('0x8'));var sox=require('sox');var csv=require(_0x1ef5('0x9'));var ejs=require(_0x1ef5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1ef5('0xb'));var squel=require(_0x1ef5('0xc'));var crypto=require(_0x1ef5('0xd'));var jsforce=require(_0x1ef5('0xe'));var deskjs=require(_0x1ef5('0xf'));var toCsv=require(_0x1ef5('0x9'));var querystring=require('querystring');var Papa=require(_0x1ef5('0x10'));var Redis=require(_0x1ef5('0x11'));var authService=require(_0x1ef5('0x12'));var qs=require(_0x1ef5('0x13'));var as=require(_0x1ef5('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1ef5('0x15'))(_0x1ef5('0x16'));var utils=require(_0x1ef5('0x17'));var config=require(_0x1ef5('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x1ef5('0x19'))['db'];function respondWithStatusCode(_0x1cd278,_0x22f2b7){_0x22f2b7=_0x22f2b7||0xcc;return function(_0x132516){if(_0x132516){return _0x1cd278[_0x1ef5('0x1a')](_0x22f2b7);}return _0x1cd278[_0x1ef5('0x1b')](_0x22f2b7)[_0x1ef5('0x1c')]();};}function respondWithResult(_0x1a887a,_0xf7aa1b){_0xf7aa1b=_0xf7aa1b||0xc8;return function(_0x9ee04c){if(_0x9ee04c){return _0x1a887a['status'](_0xf7aa1b)[_0x1ef5('0x1d')](_0x9ee04c);}};}function respondWithFilteredResult(_0x2c6905,_0x474a54){return function(_0x557419){if(_0x557419){var _0x3dd1f6=typeof _0x474a54['offset']==='undefined'&&typeof _0x474a54['limit']===_0x1ef5('0x1e');var _0x261cc7=_0x557419['count'];var _0x258717=_0x3dd1f6?0x0:_0x474a54[_0x1ef5('0x1f')];var _0xe4c4b9=_0x3dd1f6?_0x557419['count']:_0x474a54[_0x1ef5('0x1f')]+_0x474a54[_0x1ef5('0x20')];var _0x1eb16c;if(_0xe4c4b9>=_0x261cc7){_0xe4c4b9=_0x261cc7;_0x1eb16c=0xc8;}else{_0x1eb16c=0xce;}_0x2c6905[_0x1ef5('0x1b')](_0x1eb16c);return _0x2c6905[_0x1ef5('0x21')](_0x1ef5('0x22'),_0x258717+'-'+_0xe4c4b9+'/'+_0x261cc7)[_0x1ef5('0x1d')](_0x557419);}return null;};}function patchUpdates(_0x44e667){return function(_0x3b3741){try{jsonpatch[_0x1ef5('0x23')](_0x3b3741,_0x44e667,!![]);}catch(_0x36b78b){return BPromise[_0x1ef5('0x24')](_0x36b78b);}return _0x3b3741[_0x1ef5('0x25')]();};}function saveUpdates(_0x5c0d92,_0x424892){return function(_0x19b640){if(_0x19b640){return _0x19b640[_0x1ef5('0x26')](_0x5c0d92)[_0x1ef5('0x27')](function(_0x3b488f){return _0x3b488f;});}return null;};}function removeEntity(_0x3f35f1,_0x5b9aec){return function(_0x5740b9){if(_0x5740b9){return _0x5740b9[_0x1ef5('0x28')]()[_0x1ef5('0x27')](function(){_0x3f35f1[_0x1ef5('0x1b')](0xcc)[_0x1ef5('0x1c')]();});}};}function handleEntityNotFound(_0x4d8d20,_0x460fc4){return function(_0x2eb94a){if(!_0x2eb94a){_0x4d8d20[_0x1ef5('0x1a')](0x194);}return _0x2eb94a;};}function handleError(_0x4222f7,_0x629333){_0x629333=_0x629333||0x1f4;return function(_0x1f11da){logger[_0x1ef5('0x29')](_0x1f11da[_0x1ef5('0x2a')]);if(_0x1f11da[_0x1ef5('0x2b')]){delete _0x1f11da['name'];}_0x4222f7[_0x1ef5('0x1b')](_0x629333)[_0x1ef5('0x2c')](_0x1f11da);};}exports[_0x1ef5('0x2d')]=function(_0x34a538,_0x4491ab){var _0x3681e5={},_0x39fe48={},_0xd64a4={'count':0x0,'rows':[]};var _0x53220d=_[_0x1ef5('0x2e')](db[_0x1ef5('0x2f')]['rawAttributes'],function(_0x53f56d){return{'name':_0x53f56d['fieldName'],'type':_0x53f56d[_0x1ef5('0x30')]['key']};});_0x39fe48['model']=_[_0x1ef5('0x2e')](_0x53220d,_0x1ef5('0x2b'));_0x39fe48[_0x1ef5('0x31')]=_[_0x1ef5('0x32')](_0x34a538[_0x1ef5('0x31')]);_0x39fe48[_0x1ef5('0x33')]=_['intersection'](_0x39fe48[_0x1ef5('0x34')],_0x39fe48[_0x1ef5('0x31')]);_0x3681e5['attributes']=_[_0x1ef5('0x35')](_0x39fe48[_0x1ef5('0x34')],qs[_0x1ef5('0x36')](_0x34a538[_0x1ef5('0x31')]['fields']));_0x3681e5[_0x1ef5('0x37')]=_0x3681e5['attributes'][_0x1ef5('0x38')]?_0x3681e5['attributes']:_0x39fe48[_0x1ef5('0x34')];if(!_0x34a538['query'][_0x1ef5('0x39')](_0x1ef5('0x3a'))){_0x3681e5['limit']=qs[_0x1ef5('0x20')](_0x34a538[_0x1ef5('0x31')]['limit']);_0x3681e5['offset']=qs['offset'](_0x34a538[_0x1ef5('0x31')][_0x1ef5('0x1f')]);}_0x3681e5[_0x1ef5('0x3b')]=qs[_0x1ef5('0x3c')](_0x34a538[_0x1ef5('0x31')]['sort']);_0x3681e5['where']=qs['filters'](_['pick'](_0x34a538[_0x1ef5('0x31')],_0x39fe48[_0x1ef5('0x33')]),_0x53220d);if(_0x34a538[_0x1ef5('0x31')][_0x1ef5('0x3d')]){_0x3681e5['where']=_[_0x1ef5('0x3e')](_0x3681e5['where'],{'$or':_[_0x1ef5('0x2e')](_0x53220d,function(_0x17300b){if(_0x17300b[_0x1ef5('0x30')]!==_0x1ef5('0x3f')){var _0x3080a3={};_0x3080a3[_0x17300b[_0x1ef5('0x2b')]]={'$like':'%'+_0x34a538[_0x1ef5('0x31')][_0x1ef5('0x3d')]+'%'};return _0x3080a3;}})});}_0x3681e5=_[_0x1ef5('0x3e')]({},_0x3681e5,_0x34a538[_0x1ef5('0x40')]);var _0x428bd1={'where':_0x3681e5[_0x1ef5('0x41')]};return db[_0x1ef5('0x2f')][_0x1ef5('0x42')](_0x428bd1)[_0x1ef5('0x27')](function(_0x4a2a81){_0xd64a4[_0x1ef5('0x42')]=_0x4a2a81;if(_0x34a538[_0x1ef5('0x31')][_0x1ef5('0x43')]){_0x3681e5[_0x1ef5('0x44')]=[{'all':!![]}];}return db[_0x1ef5('0x2f')][_0x1ef5('0x45')](_0x3681e5);})[_0x1ef5('0x27')](function(_0x581695){_0xd64a4[_0x1ef5('0x46')]=_0x581695;return _0xd64a4;})['then'](respondWithFilteredResult(_0x4491ab,_0x3681e5))[_0x1ef5('0x47')](handleError(_0x4491ab,null));};exports[_0x1ef5('0x48')]=function(_0x53fb28,_0xb8f13f){var _0x466054={'raw':!![],'where':{'id':_0x53fb28[_0x1ef5('0x49')]['id']}},_0x382109={};_0x382109[_0x1ef5('0x34')]=_[_0x1ef5('0x32')](db['Attachment'][_0x1ef5('0x4a')]);_0x382109['query']=_[_0x1ef5('0x32')](_0x53fb28[_0x1ef5('0x31')]);_0x382109['filters']=_[_0x1ef5('0x35')](_0x382109[_0x1ef5('0x34')],_0x382109['query']);_0x466054[_0x1ef5('0x37')]=_['intersection'](_0x382109[_0x1ef5('0x34')],qs[_0x1ef5('0x36')](_0x53fb28['query'][_0x1ef5('0x36')]));_0x466054[_0x1ef5('0x37')]=_0x466054['attributes']['length']?_0x466054[_0x1ef5('0x37')]:_0x382109['model'];if(_0x53fb28['query']['includeAll']){_0x466054[_0x1ef5('0x44')]=[{'all':!![]}];}_0x466054=_[_0x1ef5('0x3e')]({},_0x466054,_0x53fb28[_0x1ef5('0x40')]);return db[_0x1ef5('0x2f')][_0x1ef5('0x4b')](_0x466054)['then'](handleEntityNotFound(_0xb8f13f,null))[_0x1ef5('0x27')](respondWithResult(_0xb8f13f,null))[_0x1ef5('0x47')](handleError(_0xb8f13f,null));};exports['clone']=function(_0x287e1b,_0x4055df){var _0x305308={'where':{'id':_0x287e1b[_0x1ef5('0x49')]['id']}},_0x548e9d={};_0x548e9d[_0x1ef5('0x34')]=_[_0x1ef5('0x32')](db[_0x1ef5('0x2f')][_0x1ef5('0x4a')]);_0x305308[_0x1ef5('0x37')]=_[_0x1ef5('0x35')](_0x548e9d['model'],qs[_0x1ef5('0x36')](_0x287e1b['query'][_0x1ef5('0x36')]));_0x305308['attributes']=_0x305308['attributes'][_0x1ef5('0x38')]?_0x305308[_0x1ef5('0x37')]:_0x548e9d[_0x1ef5('0x34')];if(_0x287e1b[_0x1ef5('0x31')]['includeAll']){_0x305308[_0x1ef5('0x44')]=[{'all':!![]}];}_0x305308=_[_0x1ef5('0x3e')]({},_0x305308,_0x287e1b['options']);return db['Attachment'][_0x1ef5('0x4b')](_0x305308)[_0x1ef5('0x27')](handleEntityNotFound(_0x4055df,null))[_0x1ef5('0x27')](function(_0xce1c3){if(_0xce1c3){var _0x3f3271=_0xce1c3['get']({'plain':!![]});_0x3f3271=qs['omit'](_0x3f3271,['id',_0x1ef5('0x4c'),_0x1ef5('0x4d')]);_0x287e1b[_0x1ef5('0x4e')]=_[_0x1ef5('0x4f')](_0x287e1b[_0x1ef5('0x4e')],['id',_0x1ef5('0x4c'),_0x1ef5('0x4d')]);return db['Attachment'][_0x1ef5('0x50')](_[_0x1ef5('0x3e')](_0x3f3271,_0x287e1b[_0x1ef5('0x4e')]),{'include':_0x287e1b['query'][_0x1ef5('0x43')]?[{'all':!![]}]:undefined});}})[_0x1ef5('0x27')](respondWithResult(_0x4055df,0xc9))[_0x1ef5('0x47')](handleError(_0x4055df,null));};exports['update']=function(_0x2a2d3d,_0x545f8e){if(_0x2a2d3d[_0x1ef5('0x4e')]['id']){delete _0x2a2d3d[_0x1ef5('0x4e')]['id'];}return db[_0x1ef5('0x2f')]['find']({'where':{'id':_0x2a2d3d['params']['id']}})[_0x1ef5('0x27')](handleEntityNotFound(_0x545f8e,null))[_0x1ef5('0x27')](saveUpdates(_0x2a2d3d[_0x1ef5('0x4e')],null))[_0x1ef5('0x27')](respondWithResult(_0x545f8e,null))[_0x1ef5('0x47')](handleError(_0x545f8e,null));};exports['destroy']=function(_0x159a81,_0x288d4a){return db[_0x1ef5('0x2f')][_0x1ef5('0x4b')]({'where':{'id':_0x159a81['params']['id']}})[_0x1ef5('0x27')](handleEntityNotFound(_0x288d4a,null))['then'](removeEntity(_0x288d4a,null))[_0x1ef5('0x47')](handleError(_0x288d4a,null));};exports[_0x1ef5('0x50')]=function(_0x521804,_0x535e54,_0x2cdba9){_0x521804[_0x1ef5('0x4e')][_0x1ef5('0x2b')]=_0x521804[_0x1ef5('0x51')][_0x1ef5('0x52')];_0x521804[_0x1ef5('0x4e')][_0x1ef5('0x53')]=_0x521804[_0x1ef5('0x51')][_0x1ef5('0x54')];_0x521804[_0x1ef5('0x4e')]['type']=_0x521804[_0x1ef5('0x51')][_0x1ef5('0x55')];return db[_0x1ef5('0x2f')][_0x1ef5('0x50')](_0x521804['body'])['then'](respondWithResult(_0x535e54,0xc9))[_0x1ef5('0x47')](handleError(_0x535e54,null));};exports[_0x1ef5('0x56')]=function(_0x1cba08,_0x12de90,_0x2fa176){return db['Attachment'][_0x1ef5('0x57')]({'where':{'id':_0x1cba08[_0x1ef5('0x49')]['id']},'raw':!![]})[_0x1ef5('0x27')](handleEntityNotFound(_0x12de90,null))[_0x1ef5('0x27')](function(_0x561c0d){if(_0x561c0d){var _0x57a5f9=_0x561c0d[_0x1ef5('0x58')]!==null;var _0xbf8120=path[_0x1ef5('0x59')](config[_0x1ef5('0x5a')],_0x1ef5('0x5b'));if(_0x57a5f9){_0xbf8120=path[_0x1ef5('0x59')](_0xbf8120,_0x1ef5('0x5c'));}var _0x541a3e=path[_0x1ef5('0x59')](_0xbf8120,_0x561c0d[_0x1ef5('0x53')]);return _0x12de90[_0x1ef5('0x56')](_0x541a3e);}})[_0x1ef5('0x47')](handleError(_0x12de90,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index bcf6cc9..6846ad4 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 _0x48d7=['api','moment','bluebird','request-promise','../../config/environment','define','Attachment','util'];(function(_0x538f18,_0x3f3236){var _0x1d72d4=function(_0x177255){while(--_0x177255){_0x538f18['push'](_0x538f18['shift']());}};_0x1d72d4(++_0x3f3236);}(_0x48d7,0x1a7));var _0x748d=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x48d7[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require('lodash');var util=require(_0x748d('0x0'));var logger=require('../../config/logger')(_0x748d('0x1'));var moment=require(_0x748d('0x2'));var BPromise=require(_0x748d('0x3'));var rp=require(_0x748d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x748d('0x5'));var attributes=require('./attachment.attributes');module['exports']=function(_0x47e22a,_0x1eca71){return _0x47e22a[_0x748d('0x6')](_0x748d('0x7'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7611=['request-promise','path','../../config/environment','./attachment.attributes','exports','define','Attachment','lodash','../../config/logger','api','moment','bluebird'];(function(_0x274638,_0x578968){var _0x5755df=function(_0x3227d5){while(--_0x3227d5){_0x274638['push'](_0x274638['shift']());}};_0x5755df(++_0x578968);}(_0x7611,0xd3));var _0x1761=function(_0x30392d,_0x4d1354){_0x30392d=_0x30392d-0x0;var _0x16819d=_0x7611[_0x30392d];return _0x16819d;};'use strict';var _=require(_0x1761('0x0'));var util=require('util');var logger=require(_0x1761('0x1'))(_0x1761('0x2'));var moment=require(_0x1761('0x3'));var BPromise=require(_0x1761('0x4'));var rp=require(_0x1761('0x5'));var fs=require('fs');var path=require(_0x1761('0x6'));var rimraf=require('rimraf');var config=require(_0x1761('0x7'));var attributes=require(_0x1761('0x8'));module[_0x1761('0x9')]=function(_0x4e7386,_0x4497e0){return _0x4e7386[_0x1761('0xa')](_0x1761('0xb'),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 b9a6f7d..376cef2 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 _0xfd2f=['rpc','../../config/environment','then','info','Attachment,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','CreateAttachment','Attachment','create','body','raw','stringify','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x31d91a,_0x3fa4bb){var _0xf9398c=function(_0x3e6149){while(--_0x3e6149){_0x31d91a['push'](_0x31d91a['shift']());}};_0xf9398c(++_0x3fa4bb);}(_0xfd2f,0x14a));var _0xffd2=function(_0x4bf20d,_0x188fa2){_0x4bf20d=_0x4bf20d-0x0;var _0x5ffdca=_0xfd2f[_0x4bf20d];return _0x5ffdca;};'use strict';var _=require(_0xffd2('0x0'));var util=require(_0xffd2('0x1'));var moment=require(_0xffd2('0x2'));var BPromise=require('bluebird');var rs=require(_0xffd2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xffd2('0x4'))['db'];var utils=require(_0xffd2('0x5'));var logger=require('../../config/logger')(_0xffd2('0x6'));var config=require(_0xffd2('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xd5e752,_0x2074e0,_0x56a1e2){return new BPromise(function(_0x35d327,_0x5b24ca){return client['request'](_0xd5e752,_0x56a1e2)[_0xffd2('0x8')](function(_0x15e33f){logger[_0xffd2('0x9')](_0xffd2('0xa'),_0x2074e0,'request\x20sent');logger[_0xffd2('0xb')]('Attachment,\x20%s,\x20%s,\x20%s',_0x2074e0,'request\x20sent',JSON['stringify'](_0x15e33f));if(_0x15e33f[_0xffd2('0xc')]){if(_0x15e33f[_0xffd2('0xc')][_0xffd2('0xd')]===0x1f4){logger[_0xffd2('0xc')](_0xffd2('0xa'),_0x2074e0,_0x15e33f[_0xffd2('0xc')][_0xffd2('0xe')]);return _0x5b24ca(_0x15e33f['error']['message']);}logger['error']('Attachment,\x20%s,\x20%s',_0x2074e0,_0x15e33f[_0xffd2('0xc')][_0xffd2('0xe')]);return _0x35d327(_0x15e33f['error'][_0xffd2('0xe')]);}else{logger[_0xffd2('0x9')](_0xffd2('0xa'),_0x2074e0,_0xffd2('0xf'));_0x35d327(_0x15e33f[_0xffd2('0x10')][_0xffd2('0xe')]);}})[_0xffd2('0x11')](function(_0x132d38){logger[_0xffd2('0xc')]('Attachment,\x20%s,\x20%s',_0x2074e0,_0x132d38);_0x5b24ca(_0x132d38);});});}exports[_0xffd2('0x12')]=function(_0x1f3c23){var _0x214737=this;return new Promise(function(_0x53f6e6,_0x2b2f71){return db[_0xffd2('0x13')][_0xffd2('0x14')](_0x1f3c23[_0xffd2('0x15')],{'raw':_0x1f3c23['options']?_0x1f3c23['options'][_0xffd2('0x16')]===undefined?!![]:![]:!![]})[_0xffd2('0x8')](function(_0x40a88c){logger['info'](_0xffd2('0x12'),_0x1f3c23);logger['debug'](_0xffd2('0x12'),_0x1f3c23,JSON[_0xffd2('0x17')](_0x40a88c));_0x53f6e6(_0x40a88c);})['catch'](function(_0x3ed47f){logger[_0xffd2('0xc')](_0xffd2('0x12'),_0x3ed47f[_0xffd2('0xe')],_0x1f3c23);_0x2b2f71(_0x214737[_0xffd2('0xc')](0x1f4,_0x3ed47f[_0xffd2('0xe')]));});});};
\ No newline at end of file
+var _0x3685=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateAttachment','Attachment','options','raw','catch','lodash','moment','bluebird','randomstring'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0x3685,0xf8));var _0x5368=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3685[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x5368('0x0'));var util=require('util');var moment=require(_0x5368('0x1'));var BPromise=require(_0x5368('0x2'));var rs=require(_0x5368('0x3'));var fs=require('fs');var Redis=require(_0x5368('0x4'));var db=require(_0x5368('0x5'))['db'];var utils=require(_0x5368('0x6'));var logger=require(_0x5368('0x7'))(_0x5368('0x8'));var config=require(_0x5368('0x9'));var jayson=require(_0x5368('0xa'));var client=jayson['client'][_0x5368('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2529a2,_0x39223d,_0xaf4549){return new BPromise(function(_0x55fb7d,_0x14e621){return client[_0x5368('0xc')](_0x2529a2,_0xaf4549)[_0x5368('0xd')](function(_0x2a6ce8){logger[_0x5368('0xe')](_0x5368('0xf'),_0x39223d,_0x5368('0x10'));logger[_0x5368('0x11')]('Attachment,\x20%s,\x20%s,\x20%s',_0x39223d,_0x5368('0x10'),JSON[_0x5368('0x12')](_0x2a6ce8));if(_0x2a6ce8[_0x5368('0x13')]){if(_0x2a6ce8['error'][_0x5368('0x14')]===0x1f4){logger[_0x5368('0x13')]('Attachment,\x20%s,\x20%s',_0x39223d,_0x2a6ce8['error']['message']);return _0x14e621(_0x2a6ce8[_0x5368('0x13')][_0x5368('0x15')]);}logger[_0x5368('0x13')](_0x5368('0xf'),_0x39223d,_0x2a6ce8[_0x5368('0x13')][_0x5368('0x15')]);return _0x55fb7d(_0x2a6ce8[_0x5368('0x13')][_0x5368('0x15')]);}else{logger[_0x5368('0xe')](_0x5368('0xf'),_0x39223d,'request\x20sent');_0x55fb7d(_0x2a6ce8[_0x5368('0x16')][_0x5368('0x15')]);}})['catch'](function(_0x19790d){logger[_0x5368('0x13')](_0x5368('0xf'),_0x39223d,_0x19790d);_0x14e621(_0x19790d);});});}exports[_0x5368('0x17')]=function(_0x5b10e9){var _0x3fcae0=this;return new Promise(function(_0x56ac4d,_0x4baaa9){return db[_0x5368('0x18')]['create'](_0x5b10e9['body'],{'raw':_0x5b10e9['options']?_0x5b10e9[_0x5368('0x19')][_0x5368('0x1a')]===undefined?!![]:![]:!![]})[_0x5368('0xd')](function(_0x5cef40){logger['info'](_0x5368('0x17'),_0x5b10e9);logger[_0x5368('0x11')](_0x5368('0x17'),_0x5b10e9,JSON[_0x5368('0x12')](_0x5cef40));_0x56ac4d(_0x5cef40);})[_0x5368('0x1b')](function(_0x1093e2){logger[_0x5368('0x13')](_0x5368('0x17'),_0x1093e2[_0x5368('0x15')],_0x5b10e9);_0x4baaa9(_0x3fcae0[_0x5368('0x13')](0x1f4,_0x1093e2['message']));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index ae0a703..45cbb68 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(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0x0b0e,0x187));var _0xe0b0=function(_0x547e20,_0x284545){_0x547e20=_0x547e20-0x0;var _0x359171=_0x0b0e[_0x547e20];return _0x359171;};'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 _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x5cb57c,_0x8be2d6){_0x5cb57c=_0x5cb57c-0x0;var _0x316318=_0xdb28[_0x5cb57c];return _0x316318;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index f20b19d..b276894 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 _0xf7ec=['password','salt','blocked','blockedAt','admin','user','agent','name','disabled','minutes','clearBlockUser','getLicense','catch','status','send','message','login','ad-login','online','User','passport-local','Strategy','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/logger','api','activedirectory','url','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','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled'];(function(_0x40b66c,_0x5c1d58){var _0x159671=function(_0x17a129){while(--_0x17a129){_0x40b66c['push'](_0x40b66c['shift']());}};_0x159671(++_0x5c1d58);}(_0xf7ec,0x1cc));var _0xcf7e=function(_0x19a61d,_0x55d5da){_0x19a61d=_0x19a61d-0x0;var _0xe7b18a=_0xf7ec[_0x19a61d];return _0xe7b18a;};'use strict';var passport=require('passport');var LocalStrategy=require(_0xcf7e('0x0'))[_0xcf7e('0x1')];var moment=require('moment');var ActiveDirectory=require(_0xcf7e('0x2'));var BPromise=require(_0xcf7e('0x3'));var util=require(_0xcf7e('0x4'));var db=require(_0xcf7e('0x5'))['db'];var authService=require(_0xcf7e('0x6'));var utils=require('../../config/utils');var config=require('../../config/environment');var logger=require(_0xcf7e('0x7'))(_0xcf7e('0x8'));function isActiveDirectoryConfigured(_0x145528){var _0x447bd5=![];if(typeof _0x145528[_0xcf7e('0x9')]!=='undefined'){_0x447bd5=_0x145528[_0xcf7e('0x9')]['baseDN']&&_0x145528[_0xcf7e('0x9')][_0xcf7e('0xa')]&&_0x145528[_0xcf7e('0x9')][_0xcf7e('0xb')];}return _0x447bd5;}function adAuthenticate(_0x49456c,_0x432008,_0x4507f2){return new BPromise(function(_0x32da64,_0x177833){try{var _0xa00508=new ActiveDirectory(_0x49456c);_0xa00508[_0xcf7e('0xc')](_0x432008,_0x4507f2,function(_0x101aca,_0x313f2c){if(_0x101aca){logger[_0xcf7e('0xd')](_0xcf7e('0xe'),_0x432008,util['inspect'](_0x101aca,{'showHidden':![],'depth':null}));_0x177833(_0xcf7e('0xf'));}else if(!_0x313f2c){logger['error'](_0xcf7e('0x10'),_0x432008);_0x177833(_0xcf7e('0xf'));}else{_0x32da64(_0x313f2c);}});}catch(_0x3d583e){_0x177833(_0x3d583e);}});}function ActiveDirectoryAuthenticate(_0x2368e4,_0x17bdc5,_0xe3b2fc,_0x51e391){var _0x243f54,_0x37872f;if(!isActiveDirectoryConfigured(config)){logger[_0xcf7e('0xd')](_0xcf7e('0x11'),_0x17bdc5);return _0x51e391(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0xcf7e('0x12')][_0xcf7e('0x13')]({'where':{'id':0x1},'attributes':[_0xcf7e('0x14'),_0xcf7e('0x15')],'raw':!![]})[_0xcf7e('0x16')](function(_0xbae394){_0x243f54=_0xbae394;if(!_0x243f54[_0xcf7e('0x14')]){logger['error'](_0xcf7e('0x17'),_0x17bdc5);throw new Error(_0xcf7e('0xf'));}return _0x2368e4[_0xcf7e('0x13')]({'attributes':['id','name',_0xcf7e('0x18'),_0xcf7e('0x19'),'role','disabled',_0xcf7e('0x1a'),_0xcf7e('0x1b'),'online'],'where':{'name':_0x17bdc5,'role':{'$or':[_0xcf7e('0x1c'),_0xcf7e('0x1d'),_0xcf7e('0x1e')]},'adSsoEnabled':!![]}});})[_0xcf7e('0x16')](function(_0x1dfd02){if(!_0x1dfd02||_0x1dfd02&&_0x1dfd02['name']!==_0x17bdc5){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x37872f=_0x1dfd02;var _0x2563e4=_0x37872f[_0xcf7e('0x1f')]+'@'+config['activedirectory'][_0xcf7e('0xb')];return adAuthenticate(config[_0xcf7e('0x9')],_0x2563e4,_0xe3b2fc);})[_0xcf7e('0x16')](function(_0x35e888){if(_0x37872f[_0xcf7e('0x20')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x243f54[_0xcf7e('0x15')]>0x0){if(_0x37872f[_0xcf7e('0x1a')]){if(moment(_0x37872f[_0xcf7e('0x1b')])['add'](_0x243f54[_0xcf7e('0x15')],_0xcf7e('0x21'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0xcf7e('0x22')](_0x37872f,0x0,![],null)[_0xcf7e('0x16')](function(){return utils['getLicense'](_0x37872f);})[_0xcf7e('0x16')](function(){return _0x51e391(null,_0x37872f);});}else{return utils['getLicense'](_0x37872f)['then'](function(){return _0x51e391(null,_0x37872f);});}}else{return utils[_0xcf7e('0x23')](_0x37872f)['then'](function(){return _0x51e391(null,_0x37872f);});}})[_0xcf7e('0x24')](function(_0x35769f){return _0x51e391(null,![],_0x35769f);});}function handleError(_0x3d6725,_0x5143be,_0x2157ba){return _0x3d6725[_0xcf7e('0x25')](_0x5143be||0x1f4)[_0xcf7e('0x26')]({'message':_0x2157ba?_0x2157ba[_0xcf7e('0x27')]||_0x2157ba:''});}exports[_0xcf7e('0x28')]=function(_0x17acb8,_0x5de987,_0x26c19f){passport[_0xcf7e('0xc')](_0xcf7e('0x29'),function(_0x38df72,_0x16dcbd,_0x198c07){var _0x40bf62=_0x38df72||_0x198c07;if(_0x40bf62){return handleError(_0x5de987,0x191,_0x40bf62);}if(!_0x16dcbd){return handleError(_0x5de987,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x11994e={'payload':{'id':_0x16dcbd['id'],'role':_0x16dcbd['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x11994e)[_0xcf7e('0x16')](function(_0x45a38a){_0x5de987['json']({'id':_0x16dcbd['id'],'token':_0x45a38a,'statusCall':'','isAlreadyLogged':_0x16dcbd[_0xcf7e('0x2a')]});});}})(_0x17acb8,_0x5de987,_0x26c19f);};passport['use'](_0xcf7e('0x29'),new LocalStrategy({'usernameField':_0xcf7e('0x1f'),'passwordField':_0xcf7e('0x18')},function(_0x43881f,_0x4dcca9,_0x2725d6){return ActiveDirectoryAuthenticate(db[_0xcf7e('0x2b')],_0x43881f,_0x4dcca9,_0x2725d6);}));
\ No newline at end of file
+var _0x397a=['Setting','adSsoEnabled','blockDuration','then','findOne','name','password','salt','role','disabled','blocked','blockedAt','online','admin','user','agent','domain','add','minutes','getLicense','catch','message','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','passport-local','Strategy','moment','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','url','authenticate','error','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x6bb814,_0x17196b){var _0x3c4bf6=function(_0x5bf6b9){while(--_0x5bf6b9){_0x6bb814['push'](_0x6bb814['shift']());}};_0x3c4bf6(++_0x17196b);}(_0x397a,0x130));var _0xa397=function(_0x4873df,_0x1f09e6){_0x4873df=_0x4873df-0x0;var _0x1906b1=_0x397a[_0x4873df];return _0x1906b1;};'use strict';var passport=require(_0xa397('0x0'));var LocalStrategy=require(_0xa397('0x1'))[_0xa397('0x2')];var moment=require(_0xa397('0x3'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xa397('0x4'));var util=require(_0xa397('0x5'));var db=require(_0xa397('0x6'))['db'];var authService=require(_0xa397('0x7'));var utils=require(_0xa397('0x8'));var config=require(_0xa397('0x9'));var logger=require(_0xa397('0xa'))(_0xa397('0xb'));function isActiveDirectoryConfigured(_0x8ec4ea){var _0x46c389=![];if(typeof _0x8ec4ea[_0xa397('0xc')]!==_0xa397('0xd')){_0x46c389=_0x8ec4ea[_0xa397('0xc')]['baseDN']&&_0x8ec4ea[_0xa397('0xc')][_0xa397('0xe')]&&_0x8ec4ea[_0xa397('0xc')]['domain'];}return _0x46c389;}function adAuthenticate(_0x28d07e,_0x5ee2c3,_0x5dcb31){return new BPromise(function(_0x4caa69,_0x26df94){try{var _0xf59a07=new ActiveDirectory(_0x28d07e);_0xf59a07[_0xa397('0xf')](_0x5ee2c3,_0x5dcb31,function(_0x317176,_0x13cf9c){if(_0x317176){logger[_0xa397('0x10')]('Error\x20authenticate\x20%s:\x20%s',_0x5ee2c3,util['inspect'](_0x317176,{'showHidden':![],'depth':null}));_0x26df94('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x13cf9c){logger[_0xa397('0x10')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x5ee2c3);_0x26df94(_0xa397('0x11'));}else{_0x4caa69(_0x13cf9c);}});}catch(_0x4e9ad3){_0x26df94(_0x4e9ad3);}});}function ActiveDirectoryAuthenticate(_0x2b83a5,_0x435203,_0x5a4932,_0x3bb50f){var _0x43d2e5,_0x24c092;if(!isActiveDirectoryConfigured(config)){logger[_0xa397('0x10')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x435203);return _0x3bb50f(null,![],{'message':_0xa397('0x11')});}return db[_0xa397('0x12')]['findOne']({'where':{'id':0x1},'attributes':[_0xa397('0x13'),_0xa397('0x14')],'raw':!![]})[_0xa397('0x15')](function(_0x1be661){_0x43d2e5=_0x1be661;if(!_0x43d2e5['adSsoEnabled']){logger[_0xa397('0x10')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x435203);throw new Error(_0xa397('0x11'));}return _0x2b83a5[_0xa397('0x16')]({'attributes':['id',_0xa397('0x17'),_0xa397('0x18'),_0xa397('0x19'),_0xa397('0x1a'),_0xa397('0x1b'),_0xa397('0x1c'),_0xa397('0x1d'),_0xa397('0x1e')],'where':{'name':_0x435203,'role':{'$or':[_0xa397('0x1f'),_0xa397('0x20'),_0xa397('0x21')]},'adSsoEnabled':!![]}});})['then'](function(_0x375727){if(!_0x375727||_0x375727&&_0x375727[_0xa397('0x17')]!==_0x435203){throw new Error(_0xa397('0x11'));}_0x24c092=_0x375727;var _0x39cea5=_0x24c092[_0xa397('0x17')]+'@'+config['activedirectory'][_0xa397('0x22')];return adAuthenticate(config[_0xa397('0xc')],_0x39cea5,_0x5a4932);})[_0xa397('0x15')](function(_0xf7b69e){if(_0x24c092[_0xa397('0x1b')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x43d2e5[_0xa397('0x14')]>0x0){if(_0x24c092[_0xa397('0x1c')]){if(moment(_0x24c092[_0xa397('0x1d')])[_0xa397('0x23')](_0x43d2e5[_0xa397('0x14')],_0xa397('0x24'))>moment()){throw new Error(_0xa397('0x11'));}return utils['clearBlockUser'](_0x24c092,0x0,![],null)[_0xa397('0x15')](function(){return utils[_0xa397('0x25')](_0x24c092);})[_0xa397('0x15')](function(){return _0x3bb50f(null,_0x24c092);});}else{return utils[_0xa397('0x25')](_0x24c092)['then'](function(){return _0x3bb50f(null,_0x24c092);});}}else{return utils[_0xa397('0x25')](_0x24c092)[_0xa397('0x15')](function(){return _0x3bb50f(null,_0x24c092);});}})[_0xa397('0x26')](function(_0x29a288){return _0x3bb50f(null,![],_0x29a288);});}function handleError(_0x2f44fc,_0x545b59,_0x2e93fb){return _0x2f44fc['status'](_0x545b59||0x1f4)['send']({'message':_0x2e93fb?_0x2e93fb[_0xa397('0x27')]||_0x2e93fb:''});}exports['login']=function(_0x18f556,_0x247b3d,_0x1c886b){passport[_0xa397('0xf')](_0xa397('0x28'),function(_0x24de30,_0x367f31,_0x4be86f){var _0x45bd44=_0x24de30||_0x4be86f;if(_0x45bd44){return handleError(_0x247b3d,0x191,_0x45bd44);}if(!_0x367f31){return handleError(_0x247b3d,0x194,{'message':_0xa397('0x29')});}else{var _0x823110={'payload':{'id':_0x367f31['id'],'role':_0x367f31[_0xa397('0x1a')]},'options':{'expiresIn':0x15180}};return authService[_0xa397('0x2a')](_0x823110)[_0xa397('0x15')](function(_0x439a59){_0x247b3d[_0xa397('0x2b')]({'id':_0x367f31['id'],'token':_0x439a59,'statusCall':'','isAlreadyLogged':_0x367f31['online']});});}})(_0x18f556,_0x247b3d,_0x1c886b);};passport[_0xa397('0x2c')](_0xa397('0x28'),new LocalStrategy({'usernameField':_0xa397('0x17'),'passwordField':_0xa397('0x18')},function(_0x233f8b,_0x92b643,_0x41814e){return ActiveDirectoryAuthenticate(db[_0xa397('0x2d')],_0x233f8b,_0x92b643,_0x41814e);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index e89869f..f89d039 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 _0x272f=['post','login','exports','express'];(function(_0x305c31,_0x466b17){var _0x17f39f=function(_0x53ae03){while(--_0x53ae03){_0x305c31['push'](_0x305c31['shift']());}};_0x17f39f(++_0x466b17);}(_0x272f,0xbb));var _0xf272=function(_0x372922,_0x42883c){_0x372922=_0x372922-0x0;var _0x4e20d6=_0x272f[_0x372922];return _0x4e20d6;};'use strict';var express=require(_0xf272('0x0'));var router=express['Router']();var controller=require('./authActiveDirectory.controller');router[_0xf272('0x1')]('/',controller[_0xf272('0x2')]);module[_0xf272('0x3')]=router;
\ No newline at end of file
+var _0xf573=['./authActiveDirectory.controller','login','Router'];(function(_0x181195,_0x1de6da){var _0x455281=function(_0x1ddb93){while(--_0x1ddb93){_0x181195['push'](_0x181195['shift']());}};_0x455281(++_0x1de6da);}(_0xf573,0x179));var _0x3f57=function(_0x251257,_0x1f4c50){_0x251257=_0x251257-0x0;var _0x16d42f=_0xf573[_0x251257];return _0x16d42f;};'use strict';var express=require('express');var router=express[_0x3f57('0x0')]();var controller=require(_0x3f57('0x1'));router['post']('/',controller[_0x3f57('0x2')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 3d34b11..f9eec4b 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x30d166,_0x5ed9d7){var _0x3a7284=function(_0x1e6e10){while(--_0x1e6e10){_0x30d166['push'](_0x30d166['shift']());}};_0x3a7284(++_0x5ed9d7);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
+var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x14634f,_0x5ed190){var _0x5021f9=function(_0x1f4a14){while(--_0x1f4a14){_0x14634f['push'](_0x14634f['shift']());}};_0x5021f9(++_0x5ed190);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 80b51af..0321116 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 _0x2c58=['./authGoogle.controller','../../components/auth/service','get','/callback','callback','isMiddleware','login','setTokenCookie','exports','passport','Router'];(function(_0x1ec684,_0xee510d){var _0x4477ed=function(_0x13777d){while(--_0x13777d){_0x1ec684['push'](_0x1ec684['shift']());}};_0x4477ed(++_0xee510d);}(_0x2c58,0x1ab));var _0x82c5=function(_0x17380d,_0x1ad894){_0x17380d=_0x17380d-0x0;var _0x522f70=_0x2c58[_0x17380d];return _0x522f70;};'use strict';var express=require('express');var passport=require(_0x82c5('0x0'));var router=express[_0x82c5('0x1')]();var controller=require(_0x82c5('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0x82c5('0x3'));router[_0x82c5('0x4')]('/',controller['login']);router['get'](_0x82c5('0x5'),controller[_0x82c5('0x6')],authService[_0x82c5('0x7')],userController[_0x82c5('0x8')],authService[_0x82c5('0x9')]);module[_0x82c5('0xa')]=router;
\ No newline at end of file
+var _0xb4f5=['exports','express','passport','../../components/auth/service','get','login','callback','isMiddleware','setTokenCookie'];(function(_0x17ebe2,_0x1072c9){var _0x2694d7=function(_0x5ef0f0){while(--_0x5ef0f0){_0x17ebe2['push'](_0x17ebe2['shift']());}};_0x2694d7(++_0x1072c9);}(_0xb4f5,0x145));var _0x5b4f=function(_0x5c78d9,_0x2736c7){_0x5c78d9=_0x5c78d9-0x0;var _0x69ae1f=_0xb4f5[_0x5c78d9];return _0x69ae1f;};'use strict';var express=require(_0x5b4f('0x0'));var passport=require(_0x5b4f('0x1'));var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require(_0x5b4f('0x2'));router[_0x5b4f('0x3')]('/',controller[_0x5b4f('0x4')]);router['get']('/callback',controller[_0x5b4f('0x5')],authService[_0x5b4f('0x6')],userController[_0x5b4f('0x4')],authService[_0x5b4f('0x7')]);module[_0x5b4f('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 902bd70..c678b92 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 _0x278a=['enforcePasswordHistory','passwordHistoryLimit','securePassword','previousPasswords','validatePasswordHistory','local-login','util','passport','passport-local','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','password','salt','role','blockedAt','loginAttempts','admin','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','minutes','clearBlockUser','disabled','catch','getLicense','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','send','login','authenticate','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x278a,0x162));var _0xa278=function(_0x427220,_0x1a15d0){_0x427220=_0x427220-0x0;var _0x243f59=_0x278a[_0x427220];return _0x243f59;};'use strict';var util=require(_0xa278('0x0'));var passport=require(_0xa278('0x1'));var LocalStrategy=require(_0xa278('0x2'))['Strategy'];var jayson=require(_0xa278('0x3'));var _=require('lodash');var rs=require(_0xa278('0x4'));var moment=require(_0xa278('0x5'));var db=require(_0xa278('0x6'))['db'];var authService=require(_0xa278('0x7'));var utils=require(_0xa278('0x8'));var client=jayson[_0xa278('0x9')][_0xa278('0xa')]({'port':0x232b});function localAuthenticate(_0x43a541,_0x6c0b4,_0x359903,_0x25903e){var _0x22aa0d,_0x2ec401;return db[_0xa278('0xb')][_0xa278('0xc')]({'where':{'id':0x1},'attributes':[_0xa278('0xd'),_0xa278('0xe')],'raw':!![]})[_0xa278('0xf')](function(_0x2bd547){_0x22aa0d=_0x2bd547;return _0x43a541[_0xa278('0xc')]({'attributes':['id','name',_0xa278('0x10'),_0xa278('0x11'),_0xa278('0x12'),'disabled','blocked',_0xa278('0x13'),_0xa278('0x14')],'where':{'name':_0x6c0b4,'role':{'$or':[_0xa278('0x15'),_0xa278('0x16'),_0xa278('0x17')]}}});})[_0xa278('0xf')](function(_0x5200c1){if(!_0x5200c1||_0x5200c1&&_0x5200c1[_0xa278('0x18')]!==_0x6c0b4){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x2ec401=_0x5200c1;return _0x2ec401;}})[_0xa278('0xf')](function(){_0x2ec401['authenticate'](_0x359903,function(_0x821598,_0x1642c7){var _0x46f4dd=_0x2ec401[_0xa278('0x14')]+0x1;if(_0x821598){return _0x25903e(_0x821598);}else if(!_0x1642c7){if(_0x2ec401['disabled']){return _0x25903e(null,![],{'message':_0xa278('0x19')});}else if(_0x22aa0d[_0xa278('0xd')]>0x0){if(_0x2ec401[_0xa278('0x1a')]){if(_0x22aa0d[_0xa278('0xe')]>0x0){if(moment(_0x2ec401[_0xa278('0x13')])[_0xa278('0x1b')](_0x22aa0d[_0xa278('0xe')],_0xa278('0x1c'))>moment()){return _0x25903e(null,![],{'message':_0xa278('0x19')});}else{return utils['clearBlockUser'](_0x2ec401,_0x46f4dd,![],null)[_0xa278('0xf')](function(){return _0x25903e(null,![],{'message':_0xa278('0x19')});});}}else{return _0x25903e(null,![],{'message':_0xa278('0x19')});}}else{if(_0x46f4dd>=_0x22aa0d[_0xa278('0xd')]){return utils[_0xa278('0x1d')](_0x2ec401,0x0,!![],moment())['then'](function(){return _0x25903e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0x2ec401,_0x46f4dd,![],null)['then'](function(){return _0x25903e(null,![],{'message':_0xa278('0x19')});});}}}else{return _0x25903e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x2ec401[_0xa278('0x1e')]){return _0x25903e(null,![],{'message':_0xa278('0x19')});}else if(_0x22aa0d[_0xa278('0xd')]>0x0){if(_0x2ec401[_0xa278('0x1a')]){if(_0x22aa0d[_0xa278('0xe')]>0x0){if(moment(_0x2ec401[_0xa278('0x13')])[_0xa278('0x1b')](_0x22aa0d[_0xa278('0xe')],'minutes')>moment()){return _0x25903e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xa278('0x1d')](_0x2ec401,0x0,![],null)[_0xa278('0xf')](function(){return utils['getLicense'](_0x2ec401);})[_0xa278('0xf')](function(){return _0x25903e(null,_0x2ec401);});}}else{return _0x25903e(null,![],{'message':_0xa278('0x19')});}}else{return utils[_0xa278('0x1d')](_0x2ec401,0x0,![],null)['then'](function(){return utils['getLicense'](_0x2ec401);})[_0xa278('0xf')](function(){return _0x25903e(null,_0x2ec401);})[_0xa278('0x1f')](function(_0x25bef2){return _0x25903e(null,![],_0x25bef2);});}}else{if(_0x2ec401[_0xa278('0x1a')]){return _0x25903e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xa278('0x20')](_0x2ec401)[_0xa278('0xf')](function(){return _0x25903e(null,_0x2ec401);});}}}});})[_0xa278('0x1f')](function(_0x3c6adb){return _0x25903e(null,![],_0x3c6adb);});}function sendServiceMail(_0x3feae2){return db[_0xa278('0x21')][_0xa278('0x22')]({'where':{'service':!![]},'attributes':['id',_0xa278('0x18'),_0xa278('0x23')],'include':[{'model':db[_0xa278('0x24')],'as':_0xa278('0x25'),'include':[{'model':db[_0xa278('0x26')],'as':_0xa278('0x26')}]}]})[_0xa278('0xf')](function(_0x573abd){if(!_0x573abd){throw new Error(_0xa278('0x27'));}var _0x1d6427=_0x573abd[_0xa278('0x28')]();var _0x5e5307={'account':_0x1d6427,'message':_[_0xa278('0x29')]({'from':util[_0xa278('0x2a')](_0xa278('0x2b'),_0x573abd[_0xa278('0x18')],_0x573abd['email']||_0x573abd[_0xa278('0x25')]['user'])},_0x3feae2)};return client[_0xa278('0x2c')](_0xa278('0x2d'),_0x5e5307);})['then'](function(_0x47c2b2){if(_0x47c2b2[_0xa278('0x2e')]){throw new Error(util[_0xa278('0x2a')](_0xa278('0x2f'),_0x47c2b2[_0xa278('0x2e')][_0xa278('0x30')]||JSON['stringify'](_0x47c2b2[_0xa278('0x2e')])));}return!![];});}function handleError(_0xb62b73,_0x36bc70,_0x25bdb9){return _0xb62b73[_0xa278('0x31')](_0x36bc70||0x1f4)[_0xa278('0x32')]({'message':_0x25bdb9?_0x25bdb9[_0xa278('0x30')]||_0x25bdb9:''});}exports[_0xa278('0x33')]=function(_0x71c14f,_0x4d0246,_0x11f7a2){passport[_0xa278('0x34')]('local-login',function(_0x5a80bd,_0x4faa7a,_0x50fd64){var _0x52d55d=_0x5a80bd||_0x50fd64;if(_0x52d55d){return handleError(_0x4d0246,0x191,_0x52d55d);}if(!_0x4faa7a){return handleError(_0x4d0246,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x579cea={'payload':{'id':_0x4faa7a['id'],'role':_0x4faa7a[_0xa278('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0xa278('0x35')](_0x579cea)[_0xa278('0xf')](function(_0x3ed078){_0x4d0246[_0xa278('0x36')]({'id':_0x4faa7a['id'],'token':_0x3ed078,'statusCall':'','isAlreadyLogged':_0x4faa7a[_0xa278('0x37')]});});}})(_0x71c14f,_0x4d0246,_0x11f7a2);};exports[_0xa278('0x38')]=function(_0xcadb1,_0x1e345e){if(!_0xcadb1[_0xa278('0x39')][_0xa278('0x23')]){return handleError(_0x1e345e,0x1f4,{'message':_0xa278('0x3a')});}var _0x4b517b=rs[_0xa278('0x3b')]();_0xcadb1['body'][_0xa278('0x23')]=_0xcadb1['body'][_0xa278('0x23')][_0xa278('0x3c')]()[_0xa278('0x3d')]();var _0x1747d7;return db[_0xa278('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0xa278('0xd'),_0xa278('0xe')],'raw':!![]})[_0xa278('0xf')](function(_0x10ca05){_0x1747d7=_0x10ca05;return db[_0xa278('0x3e')][_0xa278('0x22')]({'where':{'email':_0xcadb1[_0xa278('0x39')][_0xa278('0x23')]}});})['then'](function(_0x27645a){if(!_0x27645a){throw new Error(_0xa278('0x3f'));}if(_0x27645a['disabled']){throw new Error(_0xa278('0x40'));}if(_0x27645a['blocked']){if(moment(_0x27645a[_0xa278('0x13')])[_0xa278('0x1b')](_0x1747d7[_0xa278('0xe')],_0xa278('0x1c'))>moment()){throw new Error(_0xa278('0x41'));}else{_0x27645a[_0xa278('0x1a')]=![];_0x27645a[_0xa278('0x13')]=null;}}_0x27645a[_0xa278('0x42')]=_0x4b517b;_0x27645a[_0xa278('0x43')]=Date[_0xa278('0x44')]()+0x36ee80;return _0x27645a[_0xa278('0x45')]();})[_0xa278('0xf')](function(){return sendServiceMail({'to':_0xcadb1[_0xa278('0x39')]['email'],'subject':_0xa278('0x46'),'text':_0xa278('0x47')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xa278('0x48')+_0xcadb1['headers'][_0xa278('0x49')]+_0xa278('0x4a')+_0x4b517b+'\x0a\x0a'+_0xa278('0x4b')});})[_0xa278('0xf')](function(){_0x1e345e['status'](0xc8)[_0xa278('0x32')]({'message':_0xa278('0x4c')});})[_0xa278('0x1f')](function(_0x5192b0){return handleError(_0x1e345e,0x1f4,_0x5192b0);});};exports[_0xa278('0x4d')]=function(_0x10c827,_0xc4cfe5){return db[_0xa278('0x3e')][_0xa278('0x22')]({'where':{'resetPasswordToken':_0x10c827[_0xa278('0x4e')][_0xa278('0x4f')],'resetPasswordExpires':{'$gt':Date[_0xa278('0x44')]()}}})['then'](function(_0x4e5bfd){if(!_0x4e5bfd){throw new Error(_0xa278('0x50'));}return db['Setting'][_0xa278('0xc')]({'attributes':['id','securePassword',_0xa278('0x51'),_0xa278('0x52')]})[_0xa278('0xf')](function(_0x5c955e){if(_0x5c955e[_0xa278('0x53')])authService['validatePasswordPattern'](_0x10c827[_0xa278('0x39')][_0xa278('0x10')]);if(!_0x5c955e[_0xa278('0x51')]||!_0x4e5bfd[_0xa278('0x54')])return _0x4e5bfd;authService[_0xa278('0x55')](_0x10c827['body'][_0xa278('0x10')],_0x4e5bfd['previousPasswords'],_0x5c955e['passwordHistoryLimit']);return _0x4e5bfd;})[_0xa278('0xf')](function(){_0x4e5bfd[_0xa278('0x10')]=_0x10c827[_0xa278('0x39')][_0xa278('0x10')];_0x4e5bfd[_0xa278('0x42')]=null;_0x4e5bfd[_0xa278('0x43')]=null;return _0x4e5bfd['save']();});})[_0xa278('0xf')](function(){_0xc4cfe5['status'](0xc8)[_0xa278('0x32')]({'message':'Password\x20reset!'});})['catch'](function(_0x573e05){return handleError(_0xc4cfe5,0x1f4,_0x573e05);});};passport['use'](_0xa278('0x56'),new LocalStrategy({'usernameField':'name','passwordField':_0xa278('0x10')},function(_0x2264fb,_0x434f42,_0x422cda){return localAuthenticate(db[_0xa278('0x3e')],_0x2264fb,_0x434f42,_0x422cda);}));
\ No newline at end of file
+var _0x7b0c=['resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','Setting','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','save','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../config/utils','client','http','findOne','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','add','clearBlockUser','minutes','getLicense','catch','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','format','\x22%s\x22\x20<%s>','email','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','send','message','local-login','forgot','body','generate','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken'];(function(_0x221fd1,_0x12be62){var _0x3e158e=function(_0x2a7c71){while(--_0x2a7c71){_0x221fd1['push'](_0x221fd1['shift']());}};_0x3e158e(++_0x12be62);}(_0x7b0c,0x158));var _0xc7b0=function(_0x4ff5cc,_0x3aa73f){_0x4ff5cc=_0x4ff5cc-0x0;var _0x5115f4=_0x7b0c[_0x4ff5cc];return _0x5115f4;};'use strict';var util=require(_0xc7b0('0x0'));var passport=require(_0xc7b0('0x1'));var LocalStrategy=require(_0xc7b0('0x2'))[_0xc7b0('0x3')];var jayson=require(_0xc7b0('0x4'));var _=require(_0xc7b0('0x5'));var rs=require(_0xc7b0('0x6'));var moment=require(_0xc7b0('0x7'));var db=require(_0xc7b0('0x8'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xc7b0('0x9'));var client=jayson[_0xc7b0('0xa')][_0xc7b0('0xb')]({'port':0x232b});function localAuthenticate(_0x3f0157,_0x44b242,_0x19c74c,_0x4bc876){var _0x25c093,_0x88cf48;return db['Setting'][_0xc7b0('0xc')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xc7b0('0xd')],'raw':!![]})[_0xc7b0('0xe')](function(_0xa95787){_0x25c093=_0xa95787;return _0x3f0157[_0xc7b0('0xc')]({'attributes':['id',_0xc7b0('0xf'),_0xc7b0('0x10'),_0xc7b0('0x11'),_0xc7b0('0x12'),_0xc7b0('0x13'),_0xc7b0('0x14'),_0xc7b0('0x15'),'loginAttempts'],'where':{'name':_0x44b242,'role':{'$or':[_0xc7b0('0x16'),_0xc7b0('0x17'),_0xc7b0('0x18')]}}});})[_0xc7b0('0xe')](function(_0x3c534d){if(!_0x3c534d||_0x3c534d&&_0x3c534d['name']!==_0x44b242){throw new Error(_0xc7b0('0x19'));}else{_0x88cf48=_0x3c534d;return _0x88cf48;}})[_0xc7b0('0xe')](function(){_0x88cf48[_0xc7b0('0x1a')](_0x19c74c,function(_0x5e6fc8,_0x4d52f1){var _0x305e96=_0x88cf48['loginAttempts']+0x1;if(_0x5e6fc8){return _0x4bc876(_0x5e6fc8);}else if(!_0x4d52f1){if(_0x88cf48['disabled']){return _0x4bc876(null,![],{'message':_0xc7b0('0x19')});}else if(_0x25c093[_0xc7b0('0x1b')]>0x0){if(_0x88cf48[_0xc7b0('0x14')]){if(_0x25c093['blockDuration']>0x0){if(moment(_0x88cf48[_0xc7b0('0x15')])[_0xc7b0('0x1c')](_0x25c093[_0xc7b0('0xd')],'minutes')>moment()){return _0x4bc876(null,![],{'message':_0xc7b0('0x19')});}else{return utils[_0xc7b0('0x1d')](_0x88cf48,_0x305e96,![],null)[_0xc7b0('0xe')](function(){return _0x4bc876(null,![],{'message':_0xc7b0('0x19')});});}}else{return _0x4bc876(null,![],{'message':_0xc7b0('0x19')});}}else{if(_0x305e96>=_0x25c093[_0xc7b0('0x1b')]){return utils['clearBlockUser'](_0x88cf48,0x0,!![],moment())[_0xc7b0('0xe')](function(){return _0x4bc876(null,![],{'message':_0xc7b0('0x19')});});}else{return utils['clearBlockUser'](_0x88cf48,_0x305e96,![],null)['then'](function(){return _0x4bc876(null,![],{'message':_0xc7b0('0x19')});});}}}else{return _0x4bc876(null,![],{'message':_0xc7b0('0x19')});}}else{if(_0x88cf48[_0xc7b0('0x13')]){return _0x4bc876(null,![],{'message':_0xc7b0('0x19')});}else if(_0x25c093[_0xc7b0('0x1b')]>0x0){if(_0x88cf48[_0xc7b0('0x14')]){if(_0x25c093[_0xc7b0('0xd')]>0x0){if(moment(_0x88cf48[_0xc7b0('0x15')])[_0xc7b0('0x1c')](_0x25c093['blockDuration'],_0xc7b0('0x1e'))>moment()){return _0x4bc876(null,![],{'message':_0xc7b0('0x19')});}else{return utils[_0xc7b0('0x1d')](_0x88cf48,0x0,![],null)[_0xc7b0('0xe')](function(){return utils[_0xc7b0('0x1f')](_0x88cf48);})[_0xc7b0('0xe')](function(){return _0x4bc876(null,_0x88cf48);});}}else{return _0x4bc876(null,![],{'message':_0xc7b0('0x19')});}}else{return utils['clearBlockUser'](_0x88cf48,0x0,![],null)['then'](function(){return utils[_0xc7b0('0x1f')](_0x88cf48);})['then'](function(){return _0x4bc876(null,_0x88cf48);})[_0xc7b0('0x20')](function(_0x3b1251){return _0x4bc876(null,![],_0x3b1251);});}}else{if(_0x88cf48[_0xc7b0('0x14')]){return _0x4bc876(null,![],{'message':_0xc7b0('0x19')});}else{return utils[_0xc7b0('0x1f')](_0x88cf48)['then'](function(){return _0x4bc876(null,_0x88cf48);});}}}});})[_0xc7b0('0x20')](function(_0x5dff8c){return _0x4bc876(null,![],_0x5dff8c);});}function sendServiceMail(_0x340340){return db[_0xc7b0('0x21')]['find']({'where':{'service':!![]},'attributes':['id',_0xc7b0('0xf'),'email'],'include':[{'model':db[_0xc7b0('0x22')],'as':_0xc7b0('0x23'),'include':[{'model':db['CloudProvider'],'as':_0xc7b0('0x24')}]}]})['then'](function(_0x32db1d){if(!_0x32db1d){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x35d6c3=_0x32db1d[_0xc7b0('0x25')]();var _0x36ae6e={'account':_0x35d6c3,'message':_['merge']({'from':util[_0xc7b0('0x26')](_0xc7b0('0x27'),_0x32db1d[_0xc7b0('0xf')],_0x32db1d[_0xc7b0('0x28')]||_0x32db1d[_0xc7b0('0x23')]['user'])},_0x340340)};return client['request'](_0xc7b0('0x29'),_0x36ae6e);})[_0xc7b0('0xe')](function(_0x183cdf){if(_0x183cdf[_0xc7b0('0x2a')]){throw new Error(util[_0xc7b0('0x26')](_0xc7b0('0x2b'),_0x183cdf[_0xc7b0('0x2a')]['message']||JSON[_0xc7b0('0x2c')](_0x183cdf[_0xc7b0('0x2a')])));}return!![];});}function handleError(_0xffd8e9,_0x274cfb,_0x19147b){return _0xffd8e9['status'](_0x274cfb||0x1f4)[_0xc7b0('0x2d')]({'message':_0x19147b?_0x19147b[_0xc7b0('0x2e')]||_0x19147b:''});}exports['login']=function(_0x41e300,_0x3c9dec,_0x18b924){passport['authenticate'](_0xc7b0('0x2f'),function(_0x344953,_0x130946,_0x150848){var _0x2b6905=_0x344953||_0x150848;if(_0x2b6905){return handleError(_0x3c9dec,0x191,_0x2b6905);}if(!_0x130946){return handleError(_0x3c9dec,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x264f64={'payload':{'id':_0x130946['id'],'role':_0x130946[_0xc7b0('0x12')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x264f64)[_0xc7b0('0xe')](function(_0x2c9e6a){_0x3c9dec['json']({'id':_0x130946['id'],'token':_0x2c9e6a,'statusCall':'','isAlreadyLogged':_0x130946['online']});});}})(_0x41e300,_0x3c9dec,_0x18b924);};exports[_0xc7b0('0x30')]=function(_0x3db59d,_0x4e1d77){if(!_0x3db59d[_0xc7b0('0x31')][_0xc7b0('0x28')]){return handleError(_0x4e1d77,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x5e8053=rs[_0xc7b0('0x32')]();_0x3db59d['body'][_0xc7b0('0x28')]=_0x3db59d[_0xc7b0('0x31')][_0xc7b0('0x28')]['trim']()['toLowerCase']();var _0x3c3468;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xc7b0('0x1b'),_0xc7b0('0xd')],'raw':!![]})[_0xc7b0('0xe')](function(_0x36cf16){_0x3c3468=_0x36cf16;return db[_0xc7b0('0x33')][_0xc7b0('0x34')]({'where':{'email':_0x3db59d[_0xc7b0('0x31')][_0xc7b0('0x28')]}});})['then'](function(_0x55b1ed){if(!_0x55b1ed){throw new Error(_0xc7b0('0x35'));}if(_0x55b1ed[_0xc7b0('0x13')]){throw new Error(_0xc7b0('0x36'));}if(_0x55b1ed['blocked']){if(moment(_0x55b1ed[_0xc7b0('0x15')])[_0xc7b0('0x1c')](_0x3c3468[_0xc7b0('0xd')],_0xc7b0('0x1e'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x55b1ed[_0xc7b0('0x14')]=![];_0x55b1ed[_0xc7b0('0x15')]=null;}}_0x55b1ed[_0xc7b0('0x37')]=_0x5e8053;_0x55b1ed[_0xc7b0('0x38')]=Date[_0xc7b0('0x39')]()+0x36ee80;return _0x55b1ed['save']();})[_0xc7b0('0xe')](function(){return sendServiceMail({'to':_0x3db59d['body'][_0xc7b0('0x28')],'subject':_0xc7b0('0x3a'),'text':_0xc7b0('0x3b')+_0xc7b0('0x3c')+_0xc7b0('0x3d')+_0x3db59d[_0xc7b0('0x3e')][_0xc7b0('0x3f')]+'/reset/'+_0x5e8053+'\x0a\x0a'+_0xc7b0('0x40')});})[_0xc7b0('0xe')](function(){_0x4e1d77[_0xc7b0('0x41')](0xc8)[_0xc7b0('0x2d')]({'message':_0xc7b0('0x42')});})[_0xc7b0('0x20')](function(_0x68200c){return handleError(_0x4e1d77,0x1f4,_0x68200c);});};exports[_0xc7b0('0x43')]=function(_0x5691a0,_0x5f3b7f){return db[_0xc7b0('0x33')]['find']({'where':{'resetPasswordToken':_0x5691a0[_0xc7b0('0x44')][_0xc7b0('0x45')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0xc7b0('0xe')](function(_0x22015e){if(!_0x22015e){throw new Error(_0xc7b0('0x46'));}return db[_0xc7b0('0x47')][_0xc7b0('0xc')]({'attributes':['id',_0xc7b0('0x48'),_0xc7b0('0x49'),_0xc7b0('0x4a')]})[_0xc7b0('0xe')](function(_0x23004f){if(_0x23004f[_0xc7b0('0x48')])authService['validatePasswordPattern'](_0x5691a0['body'][_0xc7b0('0x10')]);if(!_0x23004f[_0xc7b0('0x49')]||!_0x22015e[_0xc7b0('0x4b')])return _0x22015e;authService[_0xc7b0('0x4c')](_0x5691a0['body'][_0xc7b0('0x10')],_0x22015e['previousPasswords'],_0x23004f[_0xc7b0('0x4a')]);return _0x22015e;})[_0xc7b0('0xe')](function(){_0x22015e[_0xc7b0('0x10')]=_0x5691a0[_0xc7b0('0x31')]['password'];_0x22015e['resetPasswordToken']=null;_0x22015e[_0xc7b0('0x38')]=null;return _0x22015e[_0xc7b0('0x4d')]();});})[_0xc7b0('0xe')](function(){_0x5f3b7f[_0xc7b0('0x41')](0xc8)[_0xc7b0('0x2d')]({'message':_0xc7b0('0x4e')});})[_0xc7b0('0x20')](function(_0x14e0e8){return handleError(_0x5f3b7f,0x1f4,_0x14e0e8);});};passport[_0xc7b0('0x4f')](_0xc7b0('0x2f'),new LocalStrategy({'usernameField':'name','passwordField':_0xc7b0('0x10')},function(_0x3df58a,_0x5d54f9,_0x2fc59d){return localAuthenticate(db[_0xc7b0('0x33')],_0x3df58a,_0x5d54f9,_0x2fc59d);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 551ef8c..b659b51 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 _0xcfd7=['./authLocal.controller','post','login','/forgot','reset','exports','express','Router'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0xcfd7,0x1c6));var _0x7cfd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcfd7[_0x321bb2];return _0x9c12ed;};'use strict';var express=require(_0x7cfd('0x0'));var router=express[_0x7cfd('0x1')]();var controller=require(_0x7cfd('0x2'));router[_0x7cfd('0x3')]('/',controller[_0x7cfd('0x4')]);router['post'](_0x7cfd('0x5'),controller['forgot']);router[_0x7cfd('0x3')]('/reset/:token',controller[_0x7cfd('0x6')]);module[_0x7cfd('0x7')]=router;
\ No newline at end of file
+var _0x025f=['login','/forgot','forgot','/reset/:token','reset','exports','express','Router','./authLocal.controller','post'];(function(_0x4f81dd,_0x49b9f9){var _0x33ec2f=function(_0x1940e7){while(--_0x1940e7){_0x4f81dd['push'](_0x4f81dd['shift']());}};_0x33ec2f(++_0x49b9f9);}(_0x025f,0xc4));var _0xf025=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x025f[_0x2c91e9];return _0x13f0ff;};'use strict';var express=require(_0xf025('0x0'));var router=express[_0xf025('0x1')]();var controller=require(_0xf025('0x2'));router[_0xf025('0x3')]('/',controller[_0xf025('0x4')]);router[_0xf025('0x3')](_0xf025('0x5'),controller[_0xf025('0x6')]);router[_0xf025('0x3')](_0xf025('0x7'),controller[_0xf025('0x8')]);module[_0xf025('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index debea07..621887e 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 _0x92f0=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x463b0c,_0x385dd4){var _0x386455=function(_0x53781d){while(--_0x53781d){_0x463b0c['push'](_0x463b0c['shift']());}};_0x386455(++_0x385dd4);}(_0x92f0,0x191));var _0x092f=function(_0x1a4a06,_0x36a5c2){_0x1a4a06=_0x1a4a06-0x0;var _0x49ec08=_0x92f0[_0x1a4a06];return _0x49ec08;};'use strict';var Sequelize=require(_0x092f('0x0'));module[_0x092f('0x1')]={'name':{'type':Sequelize[_0x092f('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x092f('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x092f('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x6715=['sequelize','STRING','BOOLEAN','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6715,0x128));var _0x5671=function(_0x40b891,_0x41d70e){_0x40b891=_0x40b891-0x0;var _0x367ce7=_0x6715[_0x40b891];return _0x367ce7;};'use strict';var Sequelize=require(_0x5671('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5671('0x1')]},'status':{'type':Sequelize[_0x5671('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x5671('0x3')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 6746bd6..ae3a145 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 _0xc79b=['addActions','Action','ids','getActions','hasOwnProperty','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','index','map','Automation','rawAttributes','fieldName','type','key','model','name','keys','intersection','query','attributes','fields','length','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','create','update','body','find','params','addConditions','omit','findOne','Condition','order','getConditions','nolimit'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xc79b,0x104));var _0xbc79=function(_0x45f8c0,_0x60b02){_0x45f8c0=_0x45f8c0-0x0;var _0x188b09=_0xc79b[_0x45f8c0];return _0x188b09;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbc79('0x0'));var jsonpatch=require(_0xbc79('0x1'));var rp=require('request-promise');var moment=require(_0xbc79('0x2'));var BPromise=require(_0xbc79('0x3'));var Mustache=require(_0xbc79('0x4'));var util=require('util');var path=require(_0xbc79('0x5'));var sox=require(_0xbc79('0x6'));var csv=require(_0xbc79('0x7'));var ejs=require(_0xbc79('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbc79('0x9'));var crypto=require(_0xbc79('0xa'));var jsforce=require(_0xbc79('0xb'));var deskjs=require(_0xbc79('0xc'));var toCsv=require('to-csv');var querystring=require(_0xbc79('0xd'));var Papa=require(_0xbc79('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbc79('0xf'));var as=require(_0xbc79('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbc79('0x11'))(_0xbc79('0x12'));var utils=require(_0xbc79('0x13'));var config=require(_0xbc79('0x14'));var licenseUtil=require(_0xbc79('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f1a46,_0x3ef3b9){_0x3ef3b9=_0x3ef3b9||0xcc;return function(_0x34a83d){if(_0x34a83d){return _0x3f1a46[_0xbc79('0x16')](_0x3ef3b9);}return _0x3f1a46[_0xbc79('0x17')](_0x3ef3b9)['end']();};}function respondWithResult(_0x57d82f,_0x232173){_0x232173=_0x232173||0xc8;return function(_0xa8ab12){if(_0xa8ab12){return _0x57d82f[_0xbc79('0x17')](_0x232173)[_0xbc79('0x18')](_0xa8ab12);}};}function respondWithFilteredResult(_0x3e942d,_0x302040){return function(_0x2d8455){if(_0x2d8455){var _0x57dd49=typeof _0x302040['offset']===_0xbc79('0x19')&&typeof _0x302040[_0xbc79('0x1a')]===_0xbc79('0x19');var _0x3fbecb=_0x2d8455['count'];var _0x7e867f=_0x57dd49?0x0:_0x302040[_0xbc79('0x1b')];var _0x52b5f1=_0x57dd49?_0x2d8455[_0xbc79('0x1c')]:_0x302040[_0xbc79('0x1b')]+_0x302040[_0xbc79('0x1a')];var _0x1ee684;if(_0x52b5f1>=_0x3fbecb){_0x52b5f1=_0x3fbecb;_0x1ee684=0xc8;}else{_0x1ee684=0xce;}_0x3e942d[_0xbc79('0x17')](_0x1ee684);return _0x3e942d[_0xbc79('0x1d')](_0xbc79('0x1e'),_0x7e867f+'-'+_0x52b5f1+'/'+_0x3fbecb)[_0xbc79('0x18')](_0x2d8455);}return null;};}function patchUpdates(_0x6918f7){return function(_0xff4bf6){try{jsonpatch[_0xbc79('0x1f')](_0xff4bf6,_0x6918f7,!![]);}catch(_0x83e20d){return BPromise[_0xbc79('0x20')](_0x83e20d);}return _0xff4bf6[_0xbc79('0x21')]();};}function saveUpdates(_0x13bb31,_0x16f38d){return function(_0x3de33c){if(_0x3de33c){return _0x3de33c['update'](_0x13bb31)[_0xbc79('0x22')](function(_0x5d7152){return _0x5d7152;});}return null;};}function removeEntity(_0x185ccc,_0x3e176b){return function(_0x43755c){if(_0x43755c){return _0x43755c[_0xbc79('0x23')]()[_0xbc79('0x22')](function(){_0x185ccc['status'](0xcc)[_0xbc79('0x24')]();});}};}function handleEntityNotFound(_0x506453,_0x1b95b8){return function(_0x7ceca9){if(!_0x7ceca9){_0x506453[_0xbc79('0x16')](0x194);}return _0x7ceca9;};}function handleError(_0x1654c2,_0x49fbc9){_0x49fbc9=_0x49fbc9||0x1f4;return function(_0x338e79){logger[_0xbc79('0x25')](_0x338e79[_0xbc79('0x26')]);if(_0x338e79['name']){delete _0x338e79['name'];}_0x1654c2[_0xbc79('0x17')](_0x49fbc9)['send'](_0x338e79);};}exports[_0xbc79('0x27')]=function(_0x28792b,_0x51822c){var _0xdfaab0={},_0x25f2e3={},_0x6e91b6={'count':0x0,'rows':[]};var _0x19d789=_[_0xbc79('0x28')](db[_0xbc79('0x29')][_0xbc79('0x2a')],function(_0x4ffcad){return{'name':_0x4ffcad[_0xbc79('0x2b')],'type':_0x4ffcad[_0xbc79('0x2c')][_0xbc79('0x2d')]};});_0x25f2e3[_0xbc79('0x2e')]=_[_0xbc79('0x28')](_0x19d789,_0xbc79('0x2f'));_0x25f2e3['query']=_[_0xbc79('0x30')](_0x28792b['query']);_0x25f2e3['filters']=_[_0xbc79('0x31')](_0x25f2e3['model'],_0x25f2e3[_0xbc79('0x32')]);_0xdfaab0[_0xbc79('0x33')]=_[_0xbc79('0x31')](_0x25f2e3[_0xbc79('0x2e')],qs[_0xbc79('0x34')](_0x28792b[_0xbc79('0x32')][_0xbc79('0x34')]));_0xdfaab0[_0xbc79('0x33')]=_0xdfaab0[_0xbc79('0x33')][_0xbc79('0x35')]?_0xdfaab0[_0xbc79('0x33')]:_0x25f2e3[_0xbc79('0x2e')];if(!_0x28792b['query']['hasOwnProperty']('nolimit')){_0xdfaab0['limit']=qs[_0xbc79('0x1a')](_0x28792b[_0xbc79('0x32')]['limit']);_0xdfaab0[_0xbc79('0x1b')]=qs[_0xbc79('0x1b')](_0x28792b[_0xbc79('0x32')][_0xbc79('0x1b')]);}_0xdfaab0['order']=qs[_0xbc79('0x36')](_0x28792b[_0xbc79('0x32')]['sort']);_0xdfaab0['where']=qs[_0xbc79('0x37')](_[_0xbc79('0x38')](_0x28792b[_0xbc79('0x32')],_0x25f2e3[_0xbc79('0x37')]),_0x19d789);if(_0x28792b[_0xbc79('0x32')][_0xbc79('0x39')]){_0xdfaab0[_0xbc79('0x3a')]=_[_0xbc79('0x3b')](_0xdfaab0[_0xbc79('0x3a')],{'$or':_[_0xbc79('0x28')](_0x19d789,function(_0x2d3893){if(_0x2d3893['type']!==_0xbc79('0x3c')){var _0x8eae2a={};_0x8eae2a[_0x2d3893[_0xbc79('0x2f')]]={'$like':'%'+_0x28792b['query'][_0xbc79('0x39')]+'%'};return _0x8eae2a;}})});}_0xdfaab0=_['merge']({},_0xdfaab0,_0x28792b[_0xbc79('0x3d')]);var _0x21ee80={'where':_0xdfaab0[_0xbc79('0x3a')]};return db['Automation'][_0xbc79('0x1c')](_0x21ee80)[_0xbc79('0x22')](function(_0x57f266){_0x6e91b6[_0xbc79('0x1c')]=_0x57f266;if(_0x28792b[_0xbc79('0x32')][_0xbc79('0x3e')]){_0xdfaab0[_0xbc79('0x3f')]=[{'all':!![]}];}return db['Automation'][_0xbc79('0x40')](_0xdfaab0);})[_0xbc79('0x22')](function(_0x387d31){_0x6e91b6[_0xbc79('0x41')]=_0x387d31;return _0x6e91b6;})[_0xbc79('0x22')](respondWithFilteredResult(_0x51822c,_0xdfaab0))[_0xbc79('0x42')](handleError(_0x51822c,null));};exports[_0xbc79('0x43')]=function(_0x261e1d,_0x41fc88){var _0xf3dac4={'raw':![],'where':{'id':_0x261e1d['params']['id']}},_0xd0c0d2={};_0xd0c0d2[_0xbc79('0x2e')]=_[_0xbc79('0x30')](db[_0xbc79('0x29')]['rawAttributes']);_0xd0c0d2[_0xbc79('0x32')]=_['keys'](_0x261e1d[_0xbc79('0x32')]);_0xd0c0d2['filters']=_['intersection'](_0xd0c0d2['model'],_0xd0c0d2[_0xbc79('0x32')]);_0xf3dac4['attributes']=_[_0xbc79('0x31')](_0xd0c0d2[_0xbc79('0x2e')],qs[_0xbc79('0x34')](_0x261e1d[_0xbc79('0x32')][_0xbc79('0x34')]));_0xf3dac4[_0xbc79('0x33')]=_0xf3dac4['attributes'][_0xbc79('0x35')]?_0xf3dac4[_0xbc79('0x33')]:_0xd0c0d2[_0xbc79('0x2e')];if(_0x261e1d[_0xbc79('0x32')][_0xbc79('0x3e')]){_0xf3dac4['include']=[{'all':!![]}];}_0xf3dac4=_[_0xbc79('0x3b')]({},_0xf3dac4,_0x261e1d[_0xbc79('0x3d')]);return db[_0xbc79('0x29')]['find'](_0xf3dac4)[_0xbc79('0x22')](handleEntityNotFound(_0x41fc88,null))[_0xbc79('0x22')](respondWithResult(_0x41fc88,null))[_0xbc79('0x42')](handleError(_0x41fc88,null));};exports[_0xbc79('0x44')]=function(_0x556f50,_0x43c7e7){return db[_0xbc79('0x29')][_0xbc79('0x44')](_0x556f50['body'],{})[_0xbc79('0x22')](respondWithResult(_0x43c7e7,0xc9))[_0xbc79('0x42')](handleError(_0x43c7e7,null));};exports[_0xbc79('0x45')]=function(_0x1ec8f0,_0x431a85){if(_0x1ec8f0[_0xbc79('0x46')]['id']){delete _0x1ec8f0[_0xbc79('0x46')]['id'];}return db[_0xbc79('0x29')][_0xbc79('0x47')]({'where':{'id':_0x1ec8f0[_0xbc79('0x48')]['id']}})[_0xbc79('0x22')](handleEntityNotFound(_0x431a85,null))[_0xbc79('0x22')](saveUpdates(_0x1ec8f0[_0xbc79('0x46')],null))[_0xbc79('0x22')](respondWithResult(_0x431a85,null))[_0xbc79('0x42')](handleError(_0x431a85,null));};exports[_0xbc79('0x23')]=function(_0x198f1d,_0x190f6f){return db[_0xbc79('0x29')][_0xbc79('0x47')]({'where':{'id':_0x198f1d[_0xbc79('0x48')]['id']}})[_0xbc79('0x22')](handleEntityNotFound(_0x190f6f,null))[_0xbc79('0x22')](removeEntity(_0x190f6f,null))[_0xbc79('0x42')](handleError(_0x190f6f,null));};exports[_0xbc79('0x49')]=function(_0x3d949d,_0x3e9652,_0x3dfd15){return db['Condition'][_0xbc79('0x47')]({'where':{'id':_0x3d949d[_0xbc79('0x48')]['id']}})[_0xbc79('0x22')](handleEntityNotFound(_0x3e9652,null))[_0xbc79('0x22')](function(_0x252bad){if(_0x252bad){return _0x252bad[_0xbc79('0x49')](_0x3d949d[_0xbc79('0x46')]['ids'],_[_0xbc79('0x4a')](_0x3d949d[_0xbc79('0x46')],['ids','id'])||{});}})[_0xbc79('0x22')](respondWithResult(_0x3e9652,null))[_0xbc79('0x42')](handleError(_0x3e9652,null));};exports['getConditions']=function(_0x4441ae,_0x41da6d,_0x2a879a){var _0x932394={};var _0x8d6c9d={};var _0x14a2ee;var _0x3b3129;return db[_0xbc79('0x29')][_0xbc79('0x4b')]({'where':{'id':_0x4441ae[_0xbc79('0x48')]['id']}})[_0xbc79('0x22')](handleEntityNotFound(_0x41da6d,null))['then'](function(_0x34bc3f){if(_0x34bc3f){_0x14a2ee=_0x34bc3f;_0x8d6c9d[_0xbc79('0x2e')]=_[_0xbc79('0x30')](db[_0xbc79('0x4c')][_0xbc79('0x2a')]);_0x8d6c9d[_0xbc79('0x32')]=_[_0xbc79('0x30')](_0x4441ae[_0xbc79('0x32')]);_0x8d6c9d[_0xbc79('0x37')]=_[_0xbc79('0x31')](_0x8d6c9d[_0xbc79('0x2e')],_0x8d6c9d[_0xbc79('0x32')]);_0x932394[_0xbc79('0x33')]=_[_0xbc79('0x31')](_0x8d6c9d[_0xbc79('0x2e')],qs[_0xbc79('0x34')](_0x4441ae[_0xbc79('0x32')][_0xbc79('0x34')]));_0x932394[_0xbc79('0x33')]=_0x932394['attributes'][_0xbc79('0x35')]?_0x932394[_0xbc79('0x33')]:_0x8d6c9d[_0xbc79('0x2e')];_0x932394[_0xbc79('0x4d')]=qs['sort'](_0x4441ae[_0xbc79('0x32')][_0xbc79('0x36')]);_0x932394['where']=qs[_0xbc79('0x37')](_[_0xbc79('0x38')](_0x4441ae[_0xbc79('0x32')],_0x8d6c9d[_0xbc79('0x37')]));if(_0x4441ae['query']['filter']){_0x932394[_0xbc79('0x3a')]=_[_0xbc79('0x3b')](_0x932394[_0xbc79('0x3a')],{'$or':_['map'](_0x932394[_0xbc79('0x33')],function(_0x2861a2){var _0x3b8c9a={};_0x3b8c9a[_0x2861a2]={'$like':'%'+_0x4441ae[_0xbc79('0x32')][_0xbc79('0x39')]+'%'};return _0x3b8c9a;})});}_0x932394=_[_0xbc79('0x3b')]({},_0x932394,_0x4441ae[_0xbc79('0x3d')]);return _0x14a2ee[_0xbc79('0x4e')](_0x932394);}})[_0xbc79('0x22')](function(_0x477e9b){if(_0x477e9b){_0x3b3129=_0x477e9b[_0xbc79('0x35')];if(!_0x4441ae[_0xbc79('0x32')]['hasOwnProperty'](_0xbc79('0x4f'))){_0x932394[_0xbc79('0x1a')]=qs[_0xbc79('0x1a')](_0x4441ae[_0xbc79('0x32')]['limit']);_0x932394[_0xbc79('0x1b')]=qs[_0xbc79('0x1b')](_0x4441ae[_0xbc79('0x32')][_0xbc79('0x1b')]);}return _0x14a2ee[_0xbc79('0x4e')](_0x932394);}})['then'](function(_0xc7a506){if(_0xc7a506){return _0xc7a506?{'count':_0x3b3129,'rows':_0xc7a506}:null;}})[_0xbc79('0x22')](respondWithResult(_0x41da6d,null))['catch'](handleError(_0x41da6d,null));};exports[_0xbc79('0x50')]=function(_0x2aeb95,_0x3b51e2,_0x3321a2){return db[_0xbc79('0x51')]['find']({'where':{'id':_0x2aeb95[_0xbc79('0x48')]['id']}})['then'](handleEntityNotFound(_0x3b51e2,null))['then'](function(_0x32d38c){if(_0x32d38c){return _0x32d38c['addActions'](_0x2aeb95['body'][_0xbc79('0x52')],_[_0xbc79('0x4a')](_0x2aeb95[_0xbc79('0x46')],['ids','id'])||{});}})[_0xbc79('0x22')](respondWithResult(_0x3b51e2,null))[_0xbc79('0x42')](handleError(_0x3b51e2,null));};exports[_0xbc79('0x53')]=function(_0x4b485d,_0x139d70,_0x2181e0){var _0x233e6e={};var _0x4b47b3={};var _0xd0edf4;var _0x4ddeef;return db[_0xbc79('0x29')]['findOne']({'where':{'id':_0x4b485d['params']['id']}})['then'](handleEntityNotFound(_0x139d70,null))[_0xbc79('0x22')](function(_0x2657fc){if(_0x2657fc){_0xd0edf4=_0x2657fc;_0x4b47b3[_0xbc79('0x2e')]=_[_0xbc79('0x30')](db[_0xbc79('0x51')]['rawAttributes']);_0x4b47b3[_0xbc79('0x32')]=_[_0xbc79('0x30')](_0x4b485d[_0xbc79('0x32')]);_0x4b47b3[_0xbc79('0x37')]=_['intersection'](_0x4b47b3['model'],_0x4b47b3[_0xbc79('0x32')]);_0x233e6e[_0xbc79('0x33')]=_['intersection'](_0x4b47b3['model'],qs[_0xbc79('0x34')](_0x4b485d[_0xbc79('0x32')][_0xbc79('0x34')]));_0x233e6e[_0xbc79('0x33')]=_0x233e6e[_0xbc79('0x33')][_0xbc79('0x35')]?_0x233e6e[_0xbc79('0x33')]:_0x4b47b3['model'];_0x233e6e[_0xbc79('0x4d')]=qs['sort'](_0x4b485d[_0xbc79('0x32')]['sort']);_0x233e6e['where']=qs[_0xbc79('0x37')](_['pick'](_0x4b485d[_0xbc79('0x32')],_0x4b47b3['filters']));if(_0x4b485d[_0xbc79('0x32')]['filter']){_0x233e6e[_0xbc79('0x3a')]=_[_0xbc79('0x3b')](_0x233e6e['where'],{'$or':_[_0xbc79('0x28')](_0x233e6e[_0xbc79('0x33')],function(_0x3eaa47){var _0x55e7b7={};_0x55e7b7[_0x3eaa47]={'$like':'%'+_0x4b485d[_0xbc79('0x32')]['filter']+'%'};return _0x55e7b7;})});}_0x233e6e=_['merge']({},_0x233e6e,_0x4b485d[_0xbc79('0x3d')]);return _0xd0edf4[_0xbc79('0x53')](_0x233e6e);}})['then'](function(_0x16dfb2){if(_0x16dfb2){_0x4ddeef=_0x16dfb2[_0xbc79('0x35')];if(!_0x4b485d['query'][_0xbc79('0x54')](_0xbc79('0x4f'))){_0x233e6e['limit']=qs[_0xbc79('0x1a')](_0x4b485d['query'][_0xbc79('0x1a')]);_0x233e6e[_0xbc79('0x1b')]=qs['offset'](_0x4b485d['query'][_0xbc79('0x1b')]);}return _0xd0edf4[_0xbc79('0x53')](_0x233e6e);}})['then'](function(_0x377ab7){if(_0x377ab7){return _0x377ab7?{'count':_0x4ddeef,'rows':_0x377ab7}:null;}})['then'](respondWithResult(_0x139d70,null))['catch'](handleError(_0x139d70,null));};
\ No newline at end of file
+var _0xcdc8=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','rows','catch','show','includeAll','find','create','update','body','params','addConditions','Condition','omit','ids','getConditions','findOne','addActions','Action','getActions','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','apply','reject','save','then','destroy','sendStatus','error','name','send','index','map','Automation','rawAttributes','fieldName','type'];(function(_0x5ddc07,_0x2157e2){var _0x132a73=function(_0x22a099){while(--_0x22a099){_0x5ddc07['push'](_0x5ddc07['shift']());}};_0x132a73(++_0x2157e2);}(_0xcdc8,0x7a));var _0x8cdc=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xcdc8[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8cdc('0x0'));var zipdir=require(_0x8cdc('0x1'));var jsonpatch=require(_0x8cdc('0x2'));var rp=require(_0x8cdc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8cdc('0x4'));var util=require(_0x8cdc('0x5'));var path=require(_0x8cdc('0x6'));var sox=require(_0x8cdc('0x7'));var csv=require(_0x8cdc('0x8'));var ejs=require(_0x8cdc('0x9'));var fs=require('fs');var fs_extra=require(_0x8cdc('0xa'));var _=require(_0x8cdc('0xb'));var squel=require('squel');var crypto=require(_0x8cdc('0xc'));var jsforce=require(_0x8cdc('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8cdc('0x8'));var querystring=require(_0x8cdc('0xe'));var Papa=require(_0x8cdc('0xf'));var Redis=require('ioredis');var authService=require(_0x8cdc('0x10'));var qs=require(_0x8cdc('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x8cdc('0x12'));var config=require(_0x8cdc('0x13'));var licenseUtil=require(_0x8cdc('0x14'));var db=require(_0x8cdc('0x15'))['db'];function respondWithStatusCode(_0x249615,_0x3b8305){_0x3b8305=_0x3b8305||0xcc;return function(_0x102bdb){if(_0x102bdb){return _0x249615['sendStatus'](_0x3b8305);}return _0x249615[_0x8cdc('0x16')](_0x3b8305)[_0x8cdc('0x17')]();};}function respondWithResult(_0x3261b5,_0x318d51){_0x318d51=_0x318d51||0xc8;return function(_0xfa270b){if(_0xfa270b){return _0x3261b5[_0x8cdc('0x16')](_0x318d51)[_0x8cdc('0x18')](_0xfa270b);}};}function respondWithFilteredResult(_0x2bb01f,_0x51138a){return function(_0x51f9eb){if(_0x51f9eb){var _0x4f1ccd=typeof _0x51138a[_0x8cdc('0x19')]===_0x8cdc('0x1a')&&typeof _0x51138a[_0x8cdc('0x1b')]===_0x8cdc('0x1a');var _0x49ead5=_0x51f9eb['count'];var _0x5bd9d7=_0x4f1ccd?0x0:_0x51138a[_0x8cdc('0x19')];var _0x7ae949=_0x4f1ccd?_0x51f9eb['count']:_0x51138a[_0x8cdc('0x19')]+_0x51138a[_0x8cdc('0x1b')];var _0x52d0f7;if(_0x7ae949>=_0x49ead5){_0x7ae949=_0x49ead5;_0x52d0f7=0xc8;}else{_0x52d0f7=0xce;}_0x2bb01f[_0x8cdc('0x16')](_0x52d0f7);return _0x2bb01f[_0x8cdc('0x1c')]('Content-Range',_0x5bd9d7+'-'+_0x7ae949+'/'+_0x49ead5)['json'](_0x51f9eb);}return null;};}function patchUpdates(_0x5a701c){return function(_0x1c9be8){try{jsonpatch[_0x8cdc('0x1d')](_0x1c9be8,_0x5a701c,!![]);}catch(_0x3f22b5){return BPromise[_0x8cdc('0x1e')](_0x3f22b5);}return _0x1c9be8[_0x8cdc('0x1f')]();};}function saveUpdates(_0x588adb,_0x159ea8){return function(_0x3af7d2){if(_0x3af7d2){return _0x3af7d2['update'](_0x588adb)[_0x8cdc('0x20')](function(_0x4e8426){return _0x4e8426;});}return null;};}function removeEntity(_0x18b64b,_0x2ce1de){return function(_0x520d28){if(_0x520d28){return _0x520d28[_0x8cdc('0x21')]()[_0x8cdc('0x20')](function(){_0x18b64b['status'](0xcc)[_0x8cdc('0x17')]();});}};}function handleEntityNotFound(_0x107407,_0x3a481c){return function(_0x49867f){if(!_0x49867f){_0x107407[_0x8cdc('0x22')](0x194);}return _0x49867f;};}function handleError(_0x3da074,_0x164ea3){_0x164ea3=_0x164ea3||0x1f4;return function(_0xbdadeb){logger[_0x8cdc('0x23')](_0xbdadeb['stack']);if(_0xbdadeb[_0x8cdc('0x24')]){delete _0xbdadeb[_0x8cdc('0x24')];}_0x3da074[_0x8cdc('0x16')](_0x164ea3)[_0x8cdc('0x25')](_0xbdadeb);};}exports[_0x8cdc('0x26')]=function(_0x11539c,_0x84185e){var _0x29a8d5={},_0xc7cce={},_0x5ddf7c={'count':0x0,'rows':[]};var _0x2477e7=_[_0x8cdc('0x27')](db[_0x8cdc('0x28')][_0x8cdc('0x29')],function(_0x51c834){return{'name':_0x51c834[_0x8cdc('0x2a')],'type':_0x51c834[_0x8cdc('0x2b')][_0x8cdc('0x2c')]};});_0xc7cce[_0x8cdc('0x2d')]=_[_0x8cdc('0x27')](_0x2477e7,_0x8cdc('0x24'));_0xc7cce[_0x8cdc('0x2e')]=_[_0x8cdc('0x2f')](_0x11539c['query']);_0xc7cce[_0x8cdc('0x30')]=_[_0x8cdc('0x31')](_0xc7cce['model'],_0xc7cce[_0x8cdc('0x2e')]);_0x29a8d5[_0x8cdc('0x32')]=_[_0x8cdc('0x31')](_0xc7cce[_0x8cdc('0x2d')],qs['fields'](_0x11539c[_0x8cdc('0x2e')][_0x8cdc('0x33')]));_0x29a8d5['attributes']=_0x29a8d5[_0x8cdc('0x32')][_0x8cdc('0x34')]?_0x29a8d5[_0x8cdc('0x32')]:_0xc7cce[_0x8cdc('0x2d')];if(!_0x11539c[_0x8cdc('0x2e')][_0x8cdc('0x35')](_0x8cdc('0x36'))){_0x29a8d5['limit']=qs[_0x8cdc('0x1b')](_0x11539c[_0x8cdc('0x2e')][_0x8cdc('0x1b')]);_0x29a8d5['offset']=qs['offset'](_0x11539c[_0x8cdc('0x2e')][_0x8cdc('0x19')]);}_0x29a8d5[_0x8cdc('0x37')]=qs[_0x8cdc('0x38')](_0x11539c['query'][_0x8cdc('0x38')]);_0x29a8d5[_0x8cdc('0x39')]=qs[_0x8cdc('0x30')](_[_0x8cdc('0x3a')](_0x11539c['query'],_0xc7cce[_0x8cdc('0x30')]),_0x2477e7);if(_0x11539c['query'][_0x8cdc('0x3b')]){_0x29a8d5[_0x8cdc('0x39')]=_[_0x8cdc('0x3c')](_0x29a8d5[_0x8cdc('0x39')],{'$or':_['map'](_0x2477e7,function(_0x52395c){if(_0x52395c['type']!==_0x8cdc('0x3d')){var _0x938e7e={};_0x938e7e[_0x52395c[_0x8cdc('0x24')]]={'$like':'%'+_0x11539c['query'][_0x8cdc('0x3b')]+'%'};return _0x938e7e;}})});}_0x29a8d5=_['merge']({},_0x29a8d5,_0x11539c[_0x8cdc('0x3e')]);var _0x413a47={'where':_0x29a8d5[_0x8cdc('0x39')]};return db[_0x8cdc('0x28')][_0x8cdc('0x3f')](_0x413a47)['then'](function(_0x2f1eb6){_0x5ddf7c[_0x8cdc('0x3f')]=_0x2f1eb6;if(_0x11539c[_0x8cdc('0x2e')]['includeAll']){_0x29a8d5[_0x8cdc('0x40')]=[{'all':!![]}];}return db[_0x8cdc('0x28')]['findAll'](_0x29a8d5);})[_0x8cdc('0x20')](function(_0x19932d){_0x5ddf7c[_0x8cdc('0x41')]=_0x19932d;return _0x5ddf7c;})['then'](respondWithFilteredResult(_0x84185e,_0x29a8d5))[_0x8cdc('0x42')](handleError(_0x84185e,null));};exports[_0x8cdc('0x43')]=function(_0x536806,_0x36cc22){var _0x4a9b4c={'raw':![],'where':{'id':_0x536806['params']['id']}},_0x5a8089={};_0x5a8089[_0x8cdc('0x2d')]=_[_0x8cdc('0x2f')](db[_0x8cdc('0x28')][_0x8cdc('0x29')]);_0x5a8089[_0x8cdc('0x2e')]=_[_0x8cdc('0x2f')](_0x536806[_0x8cdc('0x2e')]);_0x5a8089[_0x8cdc('0x30')]=_[_0x8cdc('0x31')](_0x5a8089[_0x8cdc('0x2d')],_0x5a8089[_0x8cdc('0x2e')]);_0x4a9b4c[_0x8cdc('0x32')]=_[_0x8cdc('0x31')](_0x5a8089['model'],qs[_0x8cdc('0x33')](_0x536806['query'][_0x8cdc('0x33')]));_0x4a9b4c[_0x8cdc('0x32')]=_0x4a9b4c['attributes']['length']?_0x4a9b4c['attributes']:_0x5a8089[_0x8cdc('0x2d')];if(_0x536806[_0x8cdc('0x2e')][_0x8cdc('0x44')]){_0x4a9b4c[_0x8cdc('0x40')]=[{'all':!![]}];}_0x4a9b4c=_[_0x8cdc('0x3c')]({},_0x4a9b4c,_0x536806[_0x8cdc('0x3e')]);return db[_0x8cdc('0x28')][_0x8cdc('0x45')](_0x4a9b4c)['then'](handleEntityNotFound(_0x36cc22,null))[_0x8cdc('0x20')](respondWithResult(_0x36cc22,null))[_0x8cdc('0x42')](handleError(_0x36cc22,null));};exports[_0x8cdc('0x46')]=function(_0x4a6aeb,_0x238584){return db[_0x8cdc('0x28')][_0x8cdc('0x46')](_0x4a6aeb['body'],{})[_0x8cdc('0x20')](respondWithResult(_0x238584,0xc9))[_0x8cdc('0x42')](handleError(_0x238584,null));};exports[_0x8cdc('0x47')]=function(_0x25b919,_0x47af38){if(_0x25b919[_0x8cdc('0x48')]['id']){delete _0x25b919[_0x8cdc('0x48')]['id'];}return db[_0x8cdc('0x28')]['find']({'where':{'id':_0x25b919[_0x8cdc('0x49')]['id']}})['then'](handleEntityNotFound(_0x47af38,null))[_0x8cdc('0x20')](saveUpdates(_0x25b919[_0x8cdc('0x48')],null))['then'](respondWithResult(_0x47af38,null))[_0x8cdc('0x42')](handleError(_0x47af38,null));};exports['destroy']=function(_0x4156b0,_0x2d41eb){return db[_0x8cdc('0x28')][_0x8cdc('0x45')]({'where':{'id':_0x4156b0[_0x8cdc('0x49')]['id']}})[_0x8cdc('0x20')](handleEntityNotFound(_0x2d41eb,null))[_0x8cdc('0x20')](removeEntity(_0x2d41eb,null))[_0x8cdc('0x42')](handleError(_0x2d41eb,null));};exports[_0x8cdc('0x4a')]=function(_0x481030,_0x320023,_0x3bbe0a){return db[_0x8cdc('0x4b')][_0x8cdc('0x45')]({'where':{'id':_0x481030[_0x8cdc('0x49')]['id']}})[_0x8cdc('0x20')](handleEntityNotFound(_0x320023,null))[_0x8cdc('0x20')](function(_0x481df4){if(_0x481df4){return _0x481df4['addConditions'](_0x481030['body']['ids'],_[_0x8cdc('0x4c')](_0x481030[_0x8cdc('0x48')],[_0x8cdc('0x4d'),'id'])||{});}})[_0x8cdc('0x20')](respondWithResult(_0x320023,null))['catch'](handleError(_0x320023,null));};exports[_0x8cdc('0x4e')]=function(_0x1a95f8,_0x27d399,_0x841659){var _0x4bc03d={};var _0x10bac6={};var _0x3c7829;var _0x3b39d2;return db['Automation'][_0x8cdc('0x4f')]({'where':{'id':_0x1a95f8[_0x8cdc('0x49')]['id']}})['then'](handleEntityNotFound(_0x27d399,null))[_0x8cdc('0x20')](function(_0x357a04){if(_0x357a04){_0x3c7829=_0x357a04;_0x10bac6[_0x8cdc('0x2d')]=_[_0x8cdc('0x2f')](db[_0x8cdc('0x4b')][_0x8cdc('0x29')]);_0x10bac6['query']=_[_0x8cdc('0x2f')](_0x1a95f8['query']);_0x10bac6[_0x8cdc('0x30')]=_[_0x8cdc('0x31')](_0x10bac6['model'],_0x10bac6[_0x8cdc('0x2e')]);_0x4bc03d[_0x8cdc('0x32')]=_['intersection'](_0x10bac6[_0x8cdc('0x2d')],qs[_0x8cdc('0x33')](_0x1a95f8[_0x8cdc('0x2e')][_0x8cdc('0x33')]));_0x4bc03d[_0x8cdc('0x32')]=_0x4bc03d['attributes'][_0x8cdc('0x34')]?_0x4bc03d[_0x8cdc('0x32')]:_0x10bac6['model'];_0x4bc03d[_0x8cdc('0x37')]=qs['sort'](_0x1a95f8[_0x8cdc('0x2e')][_0x8cdc('0x38')]);_0x4bc03d['where']=qs[_0x8cdc('0x30')](_[_0x8cdc('0x3a')](_0x1a95f8[_0x8cdc('0x2e')],_0x10bac6[_0x8cdc('0x30')]));if(_0x1a95f8[_0x8cdc('0x2e')][_0x8cdc('0x3b')]){_0x4bc03d[_0x8cdc('0x39')]=_[_0x8cdc('0x3c')](_0x4bc03d[_0x8cdc('0x39')],{'$or':_[_0x8cdc('0x27')](_0x4bc03d[_0x8cdc('0x32')],function(_0x3a15cf){var _0x5e835a={};_0x5e835a[_0x3a15cf]={'$like':'%'+_0x1a95f8['query'][_0x8cdc('0x3b')]+'%'};return _0x5e835a;})});}_0x4bc03d=_['merge']({},_0x4bc03d,_0x1a95f8['options']);return _0x3c7829[_0x8cdc('0x4e')](_0x4bc03d);}})[_0x8cdc('0x20')](function(_0x1dee2e){if(_0x1dee2e){_0x3b39d2=_0x1dee2e[_0x8cdc('0x34')];if(!_0x1a95f8[_0x8cdc('0x2e')][_0x8cdc('0x35')]('nolimit')){_0x4bc03d[_0x8cdc('0x1b')]=qs['limit'](_0x1a95f8[_0x8cdc('0x2e')][_0x8cdc('0x1b')]);_0x4bc03d[_0x8cdc('0x19')]=qs['offset'](_0x1a95f8[_0x8cdc('0x2e')][_0x8cdc('0x19')]);}return _0x3c7829['getConditions'](_0x4bc03d);}})[_0x8cdc('0x20')](function(_0x3a624b){if(_0x3a624b){return _0x3a624b?{'count':_0x3b39d2,'rows':_0x3a624b}:null;}})['then'](respondWithResult(_0x27d399,null))[_0x8cdc('0x42')](handleError(_0x27d399,null));};exports[_0x8cdc('0x50')]=function(_0x1d4f34,_0x10b531,_0x343e5d){return db['Action']['find']({'where':{'id':_0x1d4f34[_0x8cdc('0x49')]['id']}})[_0x8cdc('0x20')](handleEntityNotFound(_0x10b531,null))[_0x8cdc('0x20')](function(_0x55ec3a){if(_0x55ec3a){return _0x55ec3a[_0x8cdc('0x50')](_0x1d4f34[_0x8cdc('0x48')][_0x8cdc('0x4d')],_[_0x8cdc('0x4c')](_0x1d4f34[_0x8cdc('0x48')],[_0x8cdc('0x4d'),'id'])||{});}})[_0x8cdc('0x20')](respondWithResult(_0x10b531,null))[_0x8cdc('0x42')](handleError(_0x10b531,null));};exports['getActions']=function(_0x480d95,_0x13d5c2,_0x227dac){var _0x38c1f2={};var _0x48fdbf={};var _0x53979f;var _0x42f6ba;return db['Automation']['findOne']({'where':{'id':_0x480d95[_0x8cdc('0x49')]['id']}})['then'](handleEntityNotFound(_0x13d5c2,null))['then'](function(_0x12c81c){if(_0x12c81c){_0x53979f=_0x12c81c;_0x48fdbf[_0x8cdc('0x2d')]=_[_0x8cdc('0x2f')](db[_0x8cdc('0x51')][_0x8cdc('0x29')]);_0x48fdbf[_0x8cdc('0x2e')]=_[_0x8cdc('0x2f')](_0x480d95[_0x8cdc('0x2e')]);_0x48fdbf[_0x8cdc('0x30')]=_[_0x8cdc('0x31')](_0x48fdbf[_0x8cdc('0x2d')],_0x48fdbf[_0x8cdc('0x2e')]);_0x38c1f2[_0x8cdc('0x32')]=_[_0x8cdc('0x31')](_0x48fdbf['model'],qs[_0x8cdc('0x33')](_0x480d95[_0x8cdc('0x2e')][_0x8cdc('0x33')]));_0x38c1f2[_0x8cdc('0x32')]=_0x38c1f2[_0x8cdc('0x32')][_0x8cdc('0x34')]?_0x38c1f2[_0x8cdc('0x32')]:_0x48fdbf[_0x8cdc('0x2d')];_0x38c1f2[_0x8cdc('0x37')]=qs['sort'](_0x480d95['query'][_0x8cdc('0x38')]);_0x38c1f2[_0x8cdc('0x39')]=qs['filters'](_[_0x8cdc('0x3a')](_0x480d95[_0x8cdc('0x2e')],_0x48fdbf[_0x8cdc('0x30')]));if(_0x480d95['query'][_0x8cdc('0x3b')]){_0x38c1f2[_0x8cdc('0x39')]=_[_0x8cdc('0x3c')](_0x38c1f2[_0x8cdc('0x39')],{'$or':_['map'](_0x38c1f2[_0x8cdc('0x32')],function(_0x1f8ffd){var _0x24cb38={};_0x24cb38[_0x1f8ffd]={'$like':'%'+_0x480d95['query'][_0x8cdc('0x3b')]+'%'};return _0x24cb38;})});}_0x38c1f2=_[_0x8cdc('0x3c')]({},_0x38c1f2,_0x480d95['options']);return _0x53979f[_0x8cdc('0x52')](_0x38c1f2);}})[_0x8cdc('0x20')](function(_0x484ea4){if(_0x484ea4){_0x42f6ba=_0x484ea4[_0x8cdc('0x34')];if(!_0x480d95[_0x8cdc('0x2e')]['hasOwnProperty'](_0x8cdc('0x36'))){_0x38c1f2[_0x8cdc('0x1b')]=qs[_0x8cdc('0x1b')](_0x480d95[_0x8cdc('0x2e')]['limit']);_0x38c1f2[_0x8cdc('0x19')]=qs[_0x8cdc('0x19')](_0x480d95[_0x8cdc('0x2e')][_0x8cdc('0x19')]);}return _0x53979f[_0x8cdc('0x52')](_0x38c1f2);}})[_0x8cdc('0x20')](function(_0x48479a){if(_0x48479a){return _0x48479a?{'count':_0x42f6ba,'rows':_0x48479a}:null;}})[_0x8cdc('0x20')](respondWithResult(_0x13d5c2,null))[_0x8cdc('0x42')](handleError(_0x13d5c2,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 29497d4..f5fdcd8 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 _0xea5e=['define','Automation','tools_automations','api','moment','bluebird','request-promise','path','rimraf','./automation.attributes','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xea5e,0x1a5));var _0xeea5=function(_0xb3546a,_0x716a9d){_0xb3546a=_0xb3546a-0x0;var _0x170e67=_0xea5e[_0xb3546a];return _0x170e67;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xeea5('0x0'));var moment=require(_0xeea5('0x1'));var BPromise=require(_0xeea5('0x2'));var rp=require(_0xeea5('0x3'));var fs=require('fs');var path=require(_0xeea5('0x4'));var rimraf=require(_0xeea5('0x5'));var config=require('../../config/environment');var attributes=require(_0xeea5('0x6'));module[_0xeea5('0x7')]=function(_0x514fb4,_0x5c3af5){return _0x514fb4[_0xeea5('0x8')](_0xeea5('0x9'),attributes,{'tableName':_0xeea5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5af7=['request-promise','rimraf','./automation.attributes','exports','define','Automation','tools_automations','lodash','util','../../config/logger','moment','bluebird'];(function(_0x4d14bb,_0xe9dbb5){var _0x1aaa75=function(_0x2c397d){while(--_0x2c397d){_0x4d14bb['push'](_0x4d14bb['shift']());}};_0x1aaa75(++_0xe9dbb5);}(_0x5af7,0x193));var _0x75af=function(_0x1c06f4,_0x2feba6){_0x1c06f4=_0x1c06f4-0x0;var _0x1a727e=_0x5af7[_0x1c06f4];return _0x1a727e;};'use strict';var _=require(_0x75af('0x0'));var util=require(_0x75af('0x1'));var logger=require(_0x75af('0x2'))('api');var moment=require(_0x75af('0x3'));var BPromise=require(_0x75af('0x4'));var rp=require(_0x75af('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x75af('0x6'));var config=require('../../config/environment');var attributes=require(_0x75af('0x7'));module[_0x75af('0x8')]=function(_0x22d5eb,_0x53c39e){return _0x22d5eb[_0x75af('0x9')](_0x75af('0xa'),attributes,{'tableName':_0x75af('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 16d4741..d650fd4 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 _0x9458=['moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x9458,0x1b8));var _0x8945=function(_0xf1a8a6,_0x270451){_0xf1a8a6=_0xf1a8a6-0x0;var _0x49d0cc=_0x9458[_0xf1a8a6];return _0x49d0cc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8945('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8945('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x8945('0x2'));var logger=require(_0x8945('0x3'))(_0x8945('0x4'));var config=require(_0x8945('0x5'));var jayson=require(_0x8945('0x6'));var client=jayson[_0x8945('0x7')][_0x8945('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x12187d,_0x928802,_0x1a2b8f){return new BPromise(function(_0x4aec0b,_0x29eaed){return client[_0x8945('0x9')](_0x12187d,_0x1a2b8f)[_0x8945('0xa')](function(_0x307b9e){logger[_0x8945('0xb')](_0x8945('0xc'),_0x928802,'request\x20sent');logger[_0x8945('0xd')](_0x8945('0xe'),_0x928802,'request\x20sent',JSON['stringify'](_0x307b9e));if(_0x307b9e[_0x8945('0xf')]){if(_0x307b9e['error'][_0x8945('0x10')]===0x1f4){logger[_0x8945('0xf')](_0x8945('0xc'),_0x928802,_0x307b9e[_0x8945('0xf')][_0x8945('0x11')]);return _0x29eaed(_0x307b9e[_0x8945('0xf')]['message']);}logger[_0x8945('0xf')](_0x8945('0xc'),_0x928802,_0x307b9e['error'][_0x8945('0x11')]);return _0x4aec0b(_0x307b9e[_0x8945('0xf')][_0x8945('0x11')]);}else{logger[_0x8945('0xb')](_0x8945('0xc'),_0x928802,_0x8945('0x12'));_0x4aec0b(_0x307b9e['result']['message']);}})[_0x8945('0x13')](function(_0x4c0b8f){logger['error'](_0x8945('0xc'),_0x928802,_0x4c0b8f);_0x29eaed(_0x4c0b8f);});});}
\ No newline at end of file
+var _0x7e22=['jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0xcfbd05,_0x66cfe3){var _0x62e825=function(_0x4b95c0){while(--_0x4b95c0){_0xcfbd05['push'](_0xcfbd05['shift']());}};_0x62e825(++_0x66cfe3);}(_0x7e22,0x1d8));var _0x27e2=function(_0x3f3002,_0x4f2ead){_0x3f3002=_0x3f3002-0x0;var _0x673f4d=_0x7e22[_0x3f3002];return _0x673f4d;};'use strict';var _=require(_0x27e2('0x0'));var util=require('util');var moment=require(_0x27e2('0x1'));var BPromise=require(_0x27e2('0x2'));var rs=require(_0x27e2('0x3'));var fs=require('fs');var Redis=require(_0x27e2('0x4'));var db=require(_0x27e2('0x5'))['db'];var utils=require(_0x27e2('0x6'));var logger=require('../../config/logger')(_0x27e2('0x7'));var config=require('../../config/environment');var jayson=require(_0x27e2('0x8'));var client=jayson[_0x27e2('0x9')][_0x27e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8ec259,_0x54c99e,_0x207ab6){return new BPromise(function(_0x419985,_0x44cf2e){return client[_0x27e2('0xb')](_0x8ec259,_0x207ab6)[_0x27e2('0xc')](function(_0xadcc3e){logger[_0x27e2('0xd')](_0x27e2('0xe'),_0x54c99e,'request\x20sent');logger[_0x27e2('0xf')](_0x27e2('0x10'),_0x54c99e,'request\x20sent',JSON[_0x27e2('0x11')](_0xadcc3e));if(_0xadcc3e[_0x27e2('0x12')]){if(_0xadcc3e[_0x27e2('0x12')][_0x27e2('0x13')]===0x1f4){logger['error'](_0x27e2('0xe'),_0x54c99e,_0xadcc3e['error'][_0x27e2('0x14')]);return _0x44cf2e(_0xadcc3e[_0x27e2('0x12')][_0x27e2('0x14')]);}logger[_0x27e2('0x12')](_0x27e2('0xe'),_0x54c99e,_0xadcc3e['error'][_0x27e2('0x14')]);return _0x419985(_0xadcc3e['error'][_0x27e2('0x14')]);}else{logger[_0x27e2('0xd')](_0x27e2('0xe'),_0x54c99e,_0x27e2('0x15'));_0x419985(_0xadcc3e[_0x27e2('0x16')][_0x27e2('0x14')]);}})[_0x27e2('0x17')](function(_0x18a838){logger['error']('Automation,\x20%s,\x20%s',_0x54c99e,_0x18a838);_0x44cf2e(_0x18a838);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 69977ee..ab15c11 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 _0x35aa=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','getActions','post','addConditions','/:id/actions','addActions','put','update','exports','util','path'];(function(_0x4c15f9,_0xcf53db){var _0xfd429b=function(_0x28213b){while(--_0x28213b){_0x4c15f9['push'](_0x4c15f9['shift']());}};_0xfd429b(++_0xcf53db);}(_0x35aa,0xbe));var _0xa35a=function(_0xc6879,_0x84a966){_0xc6879=_0xc6879-0x0;var _0x54f7a4=_0x35aa[_0xc6879];return _0x54f7a4;};'use strict';var multer=require('multer');var util=require(_0xa35a('0x0'));var path=require(_0xa35a('0x1'));var timeout=require(_0xa35a('0x2'));var express=require(_0xa35a('0x3'));var router=express['Router']();var fs_extra=require(_0xa35a('0x4'));var auth=require(_0xa35a('0x5'));var interaction=require(_0xa35a('0x6'));var config=require(_0xa35a('0x7'));var controller=require(_0xa35a('0x8'));router[_0xa35a('0x9')]('/',auth[_0xa35a('0xa')](),controller[_0xa35a('0xb')]);router['get'](_0xa35a('0xc'),auth['isAuthenticated'](),controller[_0xa35a('0xd')]);router[_0xa35a('0x9')](_0xa35a('0xe'),auth[_0xa35a('0xa')](),controller[_0xa35a('0xf')]);router[_0xa35a('0x9')]('/:id/actions',auth[_0xa35a('0xa')](),controller[_0xa35a('0x10')]);router[_0xa35a('0x11')]('/',auth[_0xa35a('0xa')](),controller['create']);router[_0xa35a('0x11')](_0xa35a('0xe'),auth['isAuthenticated'](),controller[_0xa35a('0x12')]);router[_0xa35a('0x11')](_0xa35a('0x13'),auth[_0xa35a('0xa')](),controller[_0xa35a('0x14')]);router[_0xa35a('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xa35a('0x16')]);router['delete'](_0xa35a('0xc'),auth[_0xa35a('0xa')](),controller['destroy']);module[_0xa35a('0x17')]=router;
\ No newline at end of file
+var _0x487d=['update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/conditions','getConditions','getActions','post','create','addConditions','/:id/actions','put'];(function(_0x1e01bf,_0x488c10){var _0x43ad02=function(_0x14866b){while(--_0x14866b){_0x1e01bf['push'](_0x1e01bf['shift']());}};_0x43ad02(++_0x488c10);}(_0x487d,0x1b4));var _0xd487=function(_0x29ac6b,_0x184514){_0x29ac6b=_0x29ac6b-0x0;var _0x44a29b=_0x487d[_0x29ac6b];return _0x44a29b;};'use strict';var multer=require(_0xd487('0x0'));var util=require(_0xd487('0x1'));var path=require(_0xd487('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd487('0x3')]();var fs_extra=require(_0xd487('0x4'));var auth=require(_0xd487('0x5'));var interaction=require(_0xd487('0x6'));var config=require(_0xd487('0x7'));var controller=require('./automation.controller');router[_0xd487('0x8')]('/',auth[_0xd487('0x9')](),controller['index']);router[_0xd487('0x8')](_0xd487('0xa'),auth[_0xd487('0x9')](),controller[_0xd487('0xb')]);router['get'](_0xd487('0xc'),auth[_0xd487('0x9')](),controller[_0xd487('0xd')]);router['get']('/:id/actions',auth['isAuthenticated'](),controller[_0xd487('0xe')]);router[_0xd487('0xf')]('/',auth['isAuthenticated'](),controller[_0xd487('0x10')]);router[_0xd487('0xf')](_0xd487('0xc'),auth[_0xd487('0x9')](),controller[_0xd487('0x11')]);router[_0xd487('0xf')](_0xd487('0x12'),auth[_0xd487('0x9')](),controller['addActions']);router[_0xd487('0x13')](_0xd487('0xa'),auth[_0xd487('0x9')](),controller[_0xd487('0x14')]);router[_0xd487('0x15')](_0xd487('0xa'),auth[_0xd487('0x9')](),controller[_0xd487('0x16')]);module[_0xd487('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 9486825..4736328 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 _0x866a=['never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','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)','always'];(function(_0x39285d,_0x4e7c32){var _0x5b809b=function(_0x1c0b21){while(--_0x1c0b21){_0x39285d['push'](_0x39285d['shift']());}};_0x5b809b(++_0x4e7c32);}(_0x866a,0x156));var _0xa866=function(_0x14909f,_0xe25f2e){_0x14909f=_0x14909f-0x0;var _0x19698c=_0x866a[_0x14909f];return _0x19698c;};'use strict';var Sequelize=require('sequelize');module[_0xa866('0x0')]={'name':{'type':Sequelize[_0xa866('0x1')],'unique':_0xa866('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xa866('0x3')](_0xa866('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xa866('0x1')]},'active':{'type':Sequelize[_0xa866('0x5')],'defaultValue':0x0,'comment':_0xa866('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xa866('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xa866('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xa866('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xa866('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xa866('0x9')](0x3)[_0xa866('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa866('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0xa866('0x9')](0x3)[_0xa866('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa866('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa866('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa866('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0xa866('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa866('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0xa866('0x9')](0x5)[_0xa866('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa866('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xa866('0x9')](0x3)[_0xa866('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xa866('0x9')](0x5)[_0xa866('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa866('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0xa866('0x9')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xa866('0x10')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xa866('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xa866('0x3')](_0xa866('0x11'),_0xa866('0x12'),'onlyIfOpen'),'defaultValue':_0xa866('0x11')},'dialAMDActive':{'type':Sequelize[_0xa866('0x5')],'defaultValue':0x0,'comment':_0xa866('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xa866('0x9')](0x9)[_0xa866('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xa866('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xa866('0x9')](0x9)[_0xa866('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xa866('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xa866('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xa866('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xa866('0x9')](0x9)[_0xa866('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa866('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xa866('0x9')](0x9)[_0xa866('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xa866('0x9')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xa866('0x9')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xa866('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xa866('0x9')](0x5)[_0xa866('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xa866('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa866('0x19')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xa866('0x1a'),_0xa866('0x1b')),'defaultValue':_0xa866('0x1a')},'dialPrefix':{'type':Sequelize[_0xa866('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xa866('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa866('0x1c')},'dialCutDigit':{'type':Sequelize[_0xa866('0x9')](0x3)[_0xa866('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa866('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xa866('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa866('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xa866('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xa866('0x9')](0x3)[_0xa866('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa866('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa866('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa866('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa866('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xa866('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa866('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0xa866('0x9')](0x3)[_0xa866('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa866('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0xa866('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xa866('0x9')](0x3)[_0xa866('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa866('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xa866('0x9')](0x5)[_0xa866('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0x589b=['name','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','STRING','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x589b,0x97));var _0xb589=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x589b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb589('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xb589('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xb589('0x2')](_0xb589('0x3')),'allowNull':![],'defaultValue':_0xb589('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xb589('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xb589('0x5')](0x4)[_0xb589('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xb589('0x7')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xb589('0x8')]},'dialOriginateTimeout':{'type':Sequelize[_0xb589('0x5')](0x3)[_0xb589('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb589('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xb589('0x5')](0x3)[_0xb589('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb589('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xb589('0x5')](0x5)[_0xb589('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb589('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xb589('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb589('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xb589('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb589('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xb589('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xb589('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb589('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0xb589('0x5')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xb589('0x8')],'defaultValue':_0xb589('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xb589('0x11'),_0xb589('0x12'),_0xb589('0x13')),'defaultValue':_0xb589('0x11')},'dialAMDActive':{'type':Sequelize[_0xb589('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xb589('0x5')](0x9)[_0xb589('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xb589('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xb589('0x5')](0x9)[_0xb589('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xb589('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xb589('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xb589('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xb589('0x5')](0x9)[_0xb589('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xb589('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xb589('0x5')](0x9)[_0xb589('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xb589('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xb589('0x5')](0x9)[_0xb589('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xb589('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xb589('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xb589('0x5')](0x9)[_0xb589('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb589('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xb589('0x2')](_0xb589('0x1b'),_0xb589('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xb589('0x8')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xb589('0x5')](0x3)[_0xb589('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb589('0x1d')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xb589('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb589('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xb589('0x5')](0x3)[_0xb589('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb589('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xb589('0x5')](0x5)[_0xb589('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb589('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0xb589('0x5')](0x3)[_0xb589('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xb589('0x5')](0x3)[_0xb589('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb589('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xb589('0x5')](0x5)[_0xb589('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb589('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0xb589('0x5')](0x3)[_0xb589('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb589('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0xb589('0x5')](0x5)[_0xb589('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb589('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xb589('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb589('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xb589('0x5')](0x5)[_0xb589('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index e90fcbf..f93ddd2 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 _0x48b2=['include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','body','omit','createdAt','UserProfileSection','getHoppers','findOne','CmHopper','findAll','rows','getHopperHistories','CampaignId','CmHopperHistory','getHopperFinals','pick','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','ContactId','select','field','toString','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','fromQuery','NOW()','CmListId','cm_hopper_additional_phones','cmHopperId','h.id','ci.item','ci.OrderBY','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','sequelize','push','all','removeLists','CmList','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','then','destroy','get','IvrCampaigns','stack','name','send','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','catch','show','params','filters'];(function(_0x1325a0,_0x241c6e){var _0x511d7c=function(_0xd686d2){while(--_0xd686d2){_0x1325a0['push'](_0x1325a0['shift']());}};_0x511d7c(++_0x241c6e);}(_0x48b2,0x176));var _0x248b=function(_0x11c702,_0x50d44a){_0x11c702=_0x11c702-0x0;var _0x425081=_0x48b2[_0x11c702];return _0x425081;};'use strict';var emlformat=require(_0x248b('0x0'));var rimraf=require(_0x248b('0x1'));var zipdir=require(_0x248b('0x2'));var jsonpatch=require(_0x248b('0x3'));var rp=require(_0x248b('0x4'));var moment=require(_0x248b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x248b('0x6'));var util=require('util');var path=require(_0x248b('0x7'));var sox=require(_0x248b('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x248b('0x9'));var _=require('lodash');var squel=require(_0x248b('0xa'));var crypto=require(_0x248b('0xb'));var jsforce=require(_0x248b('0xc'));var deskjs=require(_0x248b('0xd'));var toCsv=require(_0x248b('0xe'));var querystring=require(_0x248b('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x248b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x248b('0x11'));var hardwareService=require(_0x248b('0x12'));var logger=require('../../config/logger')(_0x248b('0x13'));var utils=require(_0x248b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x248b('0x15'));var db=require(_0x248b('0x16'))['db'];function respondWithStatusCode(_0x6f87d6,_0x5ecea6){_0x5ecea6=_0x5ecea6||0xcc;return function(_0x49a44a){if(_0x49a44a){return _0x6f87d6[_0x248b('0x17')](_0x5ecea6);}return _0x6f87d6[_0x248b('0x18')](_0x5ecea6)[_0x248b('0x19')]();};}function respondWithResult(_0x253f02,_0x358b7b){_0x358b7b=_0x358b7b||0xc8;return function(_0x6cd69c){if(_0x6cd69c){return _0x253f02[_0x248b('0x18')](_0x358b7b)['json'](_0x6cd69c);}};}function respondWithFilteredResult(_0x4e6d6c,_0x157aca){return function(_0x3d0a94){if(_0x3d0a94){var _0x4ed6c2=typeof _0x157aca[_0x248b('0x1a')]===_0x248b('0x1b')&&typeof _0x157aca[_0x248b('0x1c')]===_0x248b('0x1b');var _0x4de747=_0x3d0a94[_0x248b('0x1d')];var _0x146300=_0x4ed6c2?0x0:_0x157aca[_0x248b('0x1a')];var _0x3bb21f=_0x4ed6c2?_0x3d0a94['count']:_0x157aca[_0x248b('0x1a')]+_0x157aca['limit'];var _0x1a8e3f;if(_0x3bb21f>=_0x4de747){_0x3bb21f=_0x4de747;_0x1a8e3f=0xc8;}else{_0x1a8e3f=0xce;}_0x4e6d6c[_0x248b('0x18')](_0x1a8e3f);return _0x4e6d6c[_0x248b('0x1e')]('Content-Range',_0x146300+'-'+_0x3bb21f+'/'+_0x4de747)[_0x248b('0x1f')](_0x3d0a94);}return null;};}function patchUpdates(_0x40a6b7){return function(_0x3bd633){try{jsonpatch[_0x248b('0x20')](_0x3bd633,_0x40a6b7,!![]);}catch(_0x3c87d0){return BPromise[_0x248b('0x21')](_0x3c87d0);}return _0x3bd633['save']();};}function saveUpdates(_0x3b4814,_0x1cb2a7){return function(_0x175f51){if(_0x175f51){return _0x175f51['update'](_0x3b4814)[_0x248b('0x22')](function(_0x2cb0a8){return _0x2cb0a8;});}return null;};}function removeEntity(_0x5389ce,_0x5abc94){return function(_0x20123f){if(_0x20123f){return _0x20123f[_0x248b('0x23')]()[_0x248b('0x22')](function(){var _0x4980b4=_0x20123f[_0x248b('0x24')]({'plain':!![]});var _0x3b6ce9=_0x248b('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x3b6ce9,'resourceId':_0x4980b4['id']}})['then'](function(){return _0x20123f;});})['then'](function(){_0x5389ce[_0x248b('0x18')](0xcc)[_0x248b('0x19')]();});}};}function handleEntityNotFound(_0x4262c9,_0x4b1a25){return function(_0x299db2){if(!_0x299db2){_0x4262c9[_0x248b('0x17')](0x194);}return _0x299db2;};}function handleError(_0x55a230,_0x581246){_0x581246=_0x581246||0x1f4;return function(_0xec0d4a){logger['error'](_0xec0d4a[_0x248b('0x26')]);if(_0xec0d4a[_0x248b('0x27')]){delete _0xec0d4a['name'];}_0x55a230[_0x248b('0x18')](_0x581246)[_0x248b('0x28')](_0xec0d4a);};}exports['index']=function(_0x5e8fe7,_0x5eebd8){var _0x3f602f={},_0x7d2d09={},_0x17d7b8={'count':0x0,'rows':[]};var _0x38daee=_[_0x248b('0x29')](db[_0x248b('0x2a')][_0x248b('0x2b')],function(_0x5dd1c1){return{'name':_0x5dd1c1[_0x248b('0x2c')],'type':_0x5dd1c1[_0x248b('0x2d')][_0x248b('0x2e')]};});_0x7d2d09[_0x248b('0x2f')]=_[_0x248b('0x29')](_0x38daee,_0x248b('0x27'));_0x7d2d09[_0x248b('0x30')]=_[_0x248b('0x31')](_0x5e8fe7[_0x248b('0x30')]);_0x7d2d09['filters']=_[_0x248b('0x32')](_0x7d2d09[_0x248b('0x2f')],_0x7d2d09[_0x248b('0x30')]);_0x3f602f[_0x248b('0x33')]=_[_0x248b('0x32')](_0x7d2d09[_0x248b('0x2f')],qs[_0x248b('0x34')](_0x5e8fe7[_0x248b('0x30')]['fields']));_0x3f602f[_0x248b('0x33')]=_0x3f602f[_0x248b('0x33')][_0x248b('0x35')]?_0x3f602f['attributes']:_0x7d2d09[_0x248b('0x2f')];if(!_0x5e8fe7['query'][_0x248b('0x36')](_0x248b('0x37'))){_0x3f602f[_0x248b('0x1c')]=qs[_0x248b('0x1c')](_0x5e8fe7[_0x248b('0x30')][_0x248b('0x1c')]);_0x3f602f[_0x248b('0x1a')]=qs[_0x248b('0x1a')](_0x5e8fe7['query'][_0x248b('0x1a')]);}_0x3f602f[_0x248b('0x38')]=qs[_0x248b('0x39')](_0x5e8fe7['query']['sort']);_0x3f602f['where']=qs['filters'](_['pick'](_0x5e8fe7[_0x248b('0x30')],_0x7d2d09['filters']),_0x38daee);if(_0x5e8fe7[_0x248b('0x30')][_0x248b('0x3a')]){_0x3f602f[_0x248b('0x3b')]=_[_0x248b('0x3c')](_0x3f602f[_0x248b('0x3b')],{'$or':_[_0x248b('0x29')](_0x38daee,function(_0x439dfa){if(_0x439dfa[_0x248b('0x2d')]!=='VIRTUAL'){var _0x4f9e74={};_0x4f9e74[_0x439dfa[_0x248b('0x27')]]={'$like':'%'+_0x5e8fe7[_0x248b('0x30')][_0x248b('0x3a')]+'%'};return _0x4f9e74;}})});}_0x3f602f=_[_0x248b('0x3c')]({},_0x3f602f,_0x5e8fe7[_0x248b('0x3d')]);var _0x5dce08={'where':_0x3f602f['where']};return db[_0x248b('0x2a')][_0x248b('0x1d')](_0x5dce08)[_0x248b('0x22')](function(_0x52e335){_0x17d7b8['count']=_0x52e335;if(_0x5e8fe7[_0x248b('0x30')][_0x248b('0x3e')]){_0x3f602f['include']=[{'all':!![]}];}return db[_0x248b('0x2a')]['findAll'](_0x3f602f);})[_0x248b('0x22')](function(_0x4c47df){_0x17d7b8['rows']=_0x4c47df;return _0x17d7b8;})[_0x248b('0x22')](respondWithFilteredResult(_0x5eebd8,_0x3f602f))[_0x248b('0x3f')](handleError(_0x5eebd8,null));};exports[_0x248b('0x40')]=function(_0x4b6d75,_0x31234b){var _0x2f1d41={'raw':![],'where':{'id':_0x4b6d75[_0x248b('0x41')]['id']}},_0x3f2bf8={};_0x3f2bf8[_0x248b('0x2f')]=_['keys'](db[_0x248b('0x2a')]['rawAttributes']);_0x3f2bf8[_0x248b('0x30')]=_[_0x248b('0x31')](_0x4b6d75[_0x248b('0x30')]);_0x3f2bf8[_0x248b('0x42')]=_[_0x248b('0x32')](_0x3f2bf8[_0x248b('0x2f')],_0x3f2bf8[_0x248b('0x30')]);_0x2f1d41[_0x248b('0x33')]=_[_0x248b('0x32')](_0x3f2bf8[_0x248b('0x2f')],qs['fields'](_0x4b6d75[_0x248b('0x30')][_0x248b('0x34')]));_0x2f1d41[_0x248b('0x33')]=_0x2f1d41[_0x248b('0x33')][_0x248b('0x35')]?_0x2f1d41[_0x248b('0x33')]:_0x3f2bf8['model'];if(_0x4b6d75[_0x248b('0x30')][_0x248b('0x3e')]){_0x2f1d41[_0x248b('0x43')]=[{'all':!![]}];}_0x2f1d41=_[_0x248b('0x3c')]({},_0x2f1d41,_0x4b6d75[_0x248b('0x3d')]);return db['Campaign'][_0x248b('0x44')](_0x2f1d41)['then'](handleEntityNotFound(_0x31234b,null))[_0x248b('0x22')](respondWithResult(_0x31234b,null))[_0x248b('0x3f')](handleError(_0x31234b,null));};exports[_0x248b('0x45')]=function(_0x4fade1,_0x2c54ae){return db['Campaign'][_0x248b('0x45')](_0x4fade1['body'],{})[_0x248b('0x22')](function(_0x1e7ee8){var _0x4fc28c=_0x4fade1[_0x248b('0x46')]['get']({'plain':!![]});if(!_0x4fc28c)throw new Error(_0x248b('0x47'));if(_0x4fc28c[_0x248b('0x48')]===_0x248b('0x46')){var _0x1363cd=_0x1e7ee8[_0x248b('0x24')]({'plain':!![]});var _0x42907b=_0x248b('0x25');return db['UserProfileSection'][_0x248b('0x44')]({'where':{'name':_0x42907b,'userProfileId':_0x4fc28c[_0x248b('0x49')]},'raw':!![]})[_0x248b('0x22')](function(_0x57c6b4){if(_0x57c6b4&&_0x57c6b4[_0x248b('0x4a')]===0x0){return db[_0x248b('0x4b')][_0x248b('0x45')]({'name':_0x1363cd[_0x248b('0x27')],'resourceId':_0x1363cd['id'],'type':_0x57c6b4[_0x248b('0x27')],'sectionId':_0x57c6b4['id']},{})[_0x248b('0x22')](function(){return _0x1e7ee8;});}else{return _0x1e7ee8;}})[_0x248b('0x3f')](function(_0x39c0b5){logger[_0x248b('0x4c')](_0x248b('0x4d'),_0x39c0b5);throw _0x39c0b5;});}return _0x1e7ee8;})['then'](respondWithResult(_0x2c54ae,0xc9))[_0x248b('0x3f')](handleError(_0x2c54ae,null));};exports[_0x248b('0x4e')]=function(_0x395ce2,_0x4adba8){var _0x522c16={'where':{'id':_0x395ce2[_0x248b('0x41')]['id']}},_0x316f08={};_0x316f08[_0x248b('0x2f')]=_[_0x248b('0x31')](db[_0x248b('0x2a')][_0x248b('0x2b')]);_0x522c16['attributes']=_[_0x248b('0x32')](_0x316f08[_0x248b('0x2f')],qs[_0x248b('0x34')](_0x395ce2[_0x248b('0x30')]['fields']));_0x522c16[_0x248b('0x33')]=_0x522c16['attributes']['length']?_0x522c16[_0x248b('0x33')]:_0x316f08[_0x248b('0x2f')];if(_0x395ce2['query'][_0x248b('0x3e')]){_0x522c16[_0x248b('0x43')]=[{'all':!![]}];}_0x522c16=_[_0x248b('0x3c')]({},_0x522c16,_0x395ce2['options']);return db[_0x248b('0x2a')][_0x248b('0x44')](_0x522c16)[_0x248b('0x22')](handleEntityNotFound(_0x4adba8,null))['then'](function(_0x59b950){if(_0x59b950){var _0x3e05ba=_0x59b950['get']({'plain':!![]});_0x3e05ba=qs['omit'](_0x3e05ba,['id','createdAt',_0x248b('0x4f')]);_0x395ce2[_0x248b('0x50')]=_[_0x248b('0x51')](_0x395ce2[_0x248b('0x50')],['id',_0x248b('0x52'),_0x248b('0x4f')]);return db[_0x248b('0x2a')][_0x248b('0x45')](_[_0x248b('0x3c')](_0x3e05ba,_0x395ce2[_0x248b('0x50')]),{'include':_0x395ce2[_0x248b('0x30')][_0x248b('0x3e')]?[{'all':!![]}]:undefined})[_0x248b('0x22')](function(_0x7879cd){var _0x4ea1a4=_0x395ce2[_0x248b('0x46')]['get']({'plain':!![]});if(!_0x4ea1a4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ea1a4['role']==='user'){var _0x1fcaab=_0x7879cd[_0x248b('0x24')]({'plain':!![]});var _0x367cca=_0x248b('0x25');return db[_0x248b('0x53')]['find']({'where':{'name':_0x367cca,'userProfileId':_0x4ea1a4[_0x248b('0x49')]},'raw':!![]})['then'](function(_0x429732){if(_0x429732&&_0x429732[_0x248b('0x4a')]===0x0){return db[_0x248b('0x4b')][_0x248b('0x45')]({'name':_0x1fcaab[_0x248b('0x27')],'resourceId':_0x1fcaab['id'],'type':_0x429732[_0x248b('0x27')],'sectionId':_0x429732['id']},{})[_0x248b('0x22')](function(){return _0x7879cd;});}else{return _0x7879cd;}})[_0x248b('0x3f')](function(_0x41b35a){logger[_0x248b('0x4c')](_0x248b('0x4d'),_0x41b35a);throw _0x41b35a;});}return _0x7879cd;});}})['then'](respondWithResult(_0x4adba8,0xc9))[_0x248b('0x3f')](handleError(_0x4adba8,null));};exports['update']=function(_0x1389da,_0x2e919b){if(_0x1389da[_0x248b('0x50')]['id']){delete _0x1389da['body']['id'];}return db[_0x248b('0x2a')]['find']({'where':{'id':_0x1389da[_0x248b('0x41')]['id']}})[_0x248b('0x22')](handleEntityNotFound(_0x2e919b,null))['then'](saveUpdates(_0x1389da['body'],null))[_0x248b('0x22')](respondWithResult(_0x2e919b,null))[_0x248b('0x3f')](handleError(_0x2e919b,null));};exports[_0x248b('0x23')]=function(_0x4bb190,_0x45459f){return db[_0x248b('0x2a')][_0x248b('0x44')]({'where':{'id':_0x4bb190[_0x248b('0x41')]['id']}})[_0x248b('0x22')](handleEntityNotFound(_0x45459f,null))['then'](removeEntity(_0x45459f,null))[_0x248b('0x3f')](handleError(_0x45459f,null));};exports[_0x248b('0x54')]=function(_0x3eb6f1,_0xf76394,_0x49a74a){var _0x542d96={'raw':!![],'where':{}};var _0x2e425b={};var _0x566786={'count':0x0,'rows':[]};return db[_0x248b('0x2a')][_0x248b('0x55')]({'where':{'id':_0x3eb6f1[_0x248b('0x41')]['id']}})['then'](handleEntityNotFound(_0xf76394,null))[_0x248b('0x22')](function(_0x1c4518){if(_0x1c4518){_0x2e425b[_0x248b('0x2f')]=_['keys'](db[_0x248b('0x56')][_0x248b('0x2b')]);_0x2e425b['query']=_['keys'](_0x3eb6f1['query']);_0x2e425b['filters']=_[_0x248b('0x32')](_0x2e425b[_0x248b('0x2f')],_0x2e425b[_0x248b('0x30')]);_0x542d96[_0x248b('0x33')]=_['intersection'](_0x2e425b[_0x248b('0x2f')],qs[_0x248b('0x34')](_0x3eb6f1['query'][_0x248b('0x34')]));_0x542d96['attributes']=_0x542d96[_0x248b('0x33')][_0x248b('0x35')]?_0x542d96['attributes']:_0x2e425b[_0x248b('0x2f')];if(!_0x3eb6f1['query']['hasOwnProperty'](_0x248b('0x37'))){_0x542d96[_0x248b('0x1c')]=qs['limit'](_0x3eb6f1['query']['limit']);_0x542d96[_0x248b('0x1a')]=qs[_0x248b('0x1a')](_0x3eb6f1[_0x248b('0x30')][_0x248b('0x1a')]);}_0x542d96[_0x248b('0x38')]=qs[_0x248b('0x39')](_0x3eb6f1[_0x248b('0x30')][_0x248b('0x39')]);_0x542d96[_0x248b('0x3b')]=qs['filters'](_['pick'](_0x3eb6f1[_0x248b('0x30')],_0x2e425b[_0x248b('0x42')]));_0x542d96[_0x248b('0x3b')]['CampaignId']=_0x1c4518['id'];if(_0x3eb6f1['query'][_0x248b('0x3a')]){_0x542d96[_0x248b('0x3b')]=_[_0x248b('0x3c')](_0x542d96[_0x248b('0x3b')],{'$or':_['map'](_0x542d96[_0x248b('0x33')],function(_0x37dd2c){var _0x717572={};_0x717572[_0x37dd2c]={'$like':'%'+_0x3eb6f1[_0x248b('0x30')][_0x248b('0x3a')]+'%'};return _0x717572;})});}_0x542d96=_['merge']({},_0x542d96,_0x3eb6f1[_0x248b('0x3d')]);return db[_0x248b('0x56')]['count']({'where':_0x542d96['where']})['then'](function(_0x49dd50){_0x566786[_0x248b('0x1d')]=_0x49dd50;if(_0x3eb6f1['query'][_0x248b('0x3e')]){_0x542d96[_0x248b('0x43')]=[{'all':!![]}];}return db[_0x248b('0x56')][_0x248b('0x57')](_0x542d96);})[_0x248b('0x22')](function(_0x41eee5){_0x566786[_0x248b('0x58')]=_0x41eee5;return _0x566786;});}})[_0x248b('0x22')](respondWithFilteredResult(_0xf76394,_0x542d96))[_0x248b('0x3f')](handleError(_0xf76394,null));};exports[_0x248b('0x59')]=function(_0x508b78,_0x45bdae,_0x3e8ea4){var _0x257ff0={'raw':!![],'where':{}};var _0x265d8f={};var _0x5dbca3={'count':0x0,'rows':[]};return db[_0x248b('0x2a')][_0x248b('0x55')]({'where':{'id':_0x508b78[_0x248b('0x41')]['id']}})[_0x248b('0x22')](handleEntityNotFound(_0x45bdae,null))[_0x248b('0x22')](function(_0x42f4d7){if(_0x42f4d7){_0x265d8f['model']=_['keys'](db['CmHopperHistory'][_0x248b('0x2b')]);_0x265d8f[_0x248b('0x30')]=_['keys'](_0x508b78[_0x248b('0x30')]);_0x265d8f[_0x248b('0x42')]=_['intersection'](_0x265d8f[_0x248b('0x2f')],_0x265d8f['query']);_0x257ff0[_0x248b('0x33')]=_[_0x248b('0x32')](_0x265d8f['model'],qs[_0x248b('0x34')](_0x508b78[_0x248b('0x30')][_0x248b('0x34')]));_0x257ff0[_0x248b('0x33')]=_0x257ff0[_0x248b('0x33')][_0x248b('0x35')]?_0x257ff0[_0x248b('0x33')]:_0x265d8f[_0x248b('0x2f')];if(!_0x508b78['query'][_0x248b('0x36')](_0x248b('0x37'))){_0x257ff0[_0x248b('0x1c')]=qs[_0x248b('0x1c')](_0x508b78['query']['limit']);_0x257ff0[_0x248b('0x1a')]=qs[_0x248b('0x1a')](_0x508b78[_0x248b('0x30')][_0x248b('0x1a')]);}_0x257ff0['order']=qs[_0x248b('0x39')](_0x508b78[_0x248b('0x30')][_0x248b('0x39')]);_0x257ff0[_0x248b('0x3b')]=qs[_0x248b('0x42')](_['pick'](_0x508b78[_0x248b('0x30')],_0x265d8f[_0x248b('0x42')]));_0x257ff0[_0x248b('0x3b')][_0x248b('0x5a')]=_0x42f4d7['id'];if(_0x508b78[_0x248b('0x30')][_0x248b('0x3a')]){_0x257ff0[_0x248b('0x3b')]=_[_0x248b('0x3c')](_0x257ff0['where'],{'$or':_['map'](_0x257ff0[_0x248b('0x33')],function(_0x4e8e85){var _0x5d896c={};_0x5d896c[_0x4e8e85]={'$like':'%'+_0x508b78[_0x248b('0x30')]['filter']+'%'};return _0x5d896c;})});}_0x257ff0=_[_0x248b('0x3c')]({},_0x257ff0,_0x508b78[_0x248b('0x3d')]);return db[_0x248b('0x5b')][_0x248b('0x1d')]({'where':_0x257ff0[_0x248b('0x3b')]})['then'](function(_0x2080f6){_0x5dbca3[_0x248b('0x1d')]=_0x2080f6;if(_0x508b78[_0x248b('0x30')][_0x248b('0x3e')]){_0x257ff0[_0x248b('0x43')]=[{'all':!![]}];}return db[_0x248b('0x5b')]['findAll'](_0x257ff0);})[_0x248b('0x22')](function(_0x4c330a){_0x5dbca3[_0x248b('0x58')]=_0x4c330a;return _0x5dbca3;});}})['then'](respondWithFilteredResult(_0x45bdae,_0x257ff0))[_0x248b('0x3f')](handleError(_0x45bdae,null));};exports[_0x248b('0x5c')]=function(_0x32ed1b,_0x2eb30f,_0x1f0b8e){var _0x4c651f={'raw':!![],'where':{}};var _0x36251e={};var _0x257ce8={'count':0x0,'rows':[]};return db['Campaign'][_0x248b('0x55')]({'where':{'id':_0x32ed1b[_0x248b('0x41')]['id']}})[_0x248b('0x22')](handleEntityNotFound(_0x2eb30f,null))[_0x248b('0x22')](function(_0x30151c){if(_0x30151c){_0x36251e[_0x248b('0x2f')]=_[_0x248b('0x31')](db['CmHopperFinal']['rawAttributes']);_0x36251e[_0x248b('0x30')]=_[_0x248b('0x31')](_0x32ed1b[_0x248b('0x30')]);_0x36251e[_0x248b('0x42')]=_[_0x248b('0x32')](_0x36251e[_0x248b('0x2f')],_0x36251e['query']);_0x4c651f[_0x248b('0x33')]=_[_0x248b('0x32')](_0x36251e[_0x248b('0x2f')],qs[_0x248b('0x34')](_0x32ed1b['query'][_0x248b('0x34')]));_0x4c651f[_0x248b('0x33')]=_0x4c651f[_0x248b('0x33')][_0x248b('0x35')]?_0x4c651f[_0x248b('0x33')]:_0x36251e[_0x248b('0x2f')];if(!_0x32ed1b[_0x248b('0x30')][_0x248b('0x36')]('nolimit')){_0x4c651f[_0x248b('0x1c')]=qs[_0x248b('0x1c')](_0x32ed1b[_0x248b('0x30')][_0x248b('0x1c')]);_0x4c651f[_0x248b('0x1a')]=qs[_0x248b('0x1a')](_0x32ed1b[_0x248b('0x30')][_0x248b('0x1a')]);}_0x4c651f[_0x248b('0x38')]=qs['sort'](_0x32ed1b[_0x248b('0x30')]['sort']);_0x4c651f['where']=qs['filters'](_[_0x248b('0x5d')](_0x32ed1b[_0x248b('0x30')],_0x36251e[_0x248b('0x42')]));_0x4c651f[_0x248b('0x3b')][_0x248b('0x5a')]=_0x30151c['id'];if(_0x32ed1b[_0x248b('0x30')]['filter']){_0x4c651f['where']=_[_0x248b('0x3c')](_0x4c651f[_0x248b('0x3b')],{'$or':_['map'](_0x4c651f['attributes'],function(_0x483b6d){var _0x33e6a1={};_0x33e6a1[_0x483b6d]={'$like':'%'+_0x32ed1b['query'][_0x248b('0x3a')]+'%'};return _0x33e6a1;})});}_0x4c651f=_[_0x248b('0x3c')]({},_0x4c651f,_0x32ed1b[_0x248b('0x3d')]);return db[_0x248b('0x5e')]['count']({'where':_0x4c651f['where']})[_0x248b('0x22')](function(_0xacf001){_0x257ce8['count']=_0xacf001;if(_0x32ed1b['query']['includeAll']){_0x4c651f['include']=[{'all':!![]}];}return db[_0x248b('0x5e')]['findAll'](_0x4c651f);})[_0x248b('0x22')](function(_0x5dc8ce){_0x257ce8['rows']=_0x5dc8ce;return _0x257ce8;});}})[_0x248b('0x22')](respondWithFilteredResult(_0x2eb30f,_0x4c651f))[_0x248b('0x3f')](handleError(_0x2eb30f,null));};exports[_0x248b('0x5f')]=function(_0x469075,_0x5887f2,_0x751634){var _0x1ee45b={'raw':!![],'where':{}};var _0x118541={};var _0x372799={'count':0x0,'rows':[]};return db[_0x248b('0x2a')]['findOne']({'where':{'id':_0x469075[_0x248b('0x41')]['id']}})[_0x248b('0x22')](handleEntityNotFound(_0x5887f2,null))['then'](function(_0x47e3ea){if(_0x47e3ea){_0x118541[_0x248b('0x2f')]=_[_0x248b('0x31')](db[_0x248b('0x60')][_0x248b('0x2b')]);_0x118541['query']=_['keys'](_0x469075['query']);_0x118541[_0x248b('0x42')]=_['intersection'](_0x118541['model'],_0x118541[_0x248b('0x30')]);_0x1ee45b['attributes']=_[_0x248b('0x32')](_0x118541[_0x248b('0x2f')],qs[_0x248b('0x34')](_0x469075[_0x248b('0x30')][_0x248b('0x34')]));_0x1ee45b[_0x248b('0x33')]=_0x1ee45b[_0x248b('0x33')][_0x248b('0x35')]?_0x1ee45b[_0x248b('0x33')]:_0x118541[_0x248b('0x2f')];if(!_0x469075['query'][_0x248b('0x36')](_0x248b('0x37'))){_0x1ee45b['limit']=qs[_0x248b('0x1c')](_0x469075[_0x248b('0x30')][_0x248b('0x1c')]);_0x1ee45b[_0x248b('0x1a')]=qs[_0x248b('0x1a')](_0x469075['query'][_0x248b('0x1a')]);}_0x1ee45b[_0x248b('0x38')]=qs[_0x248b('0x39')](_0x469075['query']['sort']);_0x1ee45b[_0x248b('0x3b')]=qs['filters'](_[_0x248b('0x5d')](_0x469075[_0x248b('0x30')],_0x118541[_0x248b('0x42')]));_0x1ee45b[_0x248b('0x3b')][_0x248b('0x5a')]=_0x47e3ea['id'];if(_0x469075['query'][_0x248b('0x3a')]){_0x1ee45b[_0x248b('0x3b')]=_[_0x248b('0x3c')](_0x1ee45b['where'],{'$or':_[_0x248b('0x29')](_0x1ee45b[_0x248b('0x33')],function(_0x4ff03a){var _0x147a94={};_0x147a94[_0x4ff03a]={'$like':'%'+_0x469075[_0x248b('0x30')][_0x248b('0x3a')]+'%'};return _0x147a94;})});}_0x1ee45b=_['merge']({},_0x1ee45b,_0x469075['options']);return db[_0x248b('0x60')]['count']({'where':_0x1ee45b[_0x248b('0x3b')]})['then'](function(_0x7c3452){_0x372799['count']=_0x7c3452;if(_0x469075['query'][_0x248b('0x3e')]){_0x1ee45b[_0x248b('0x43')]=[{'all':!![]}];}return db[_0x248b('0x60')][_0x248b('0x57')](_0x1ee45b);})[_0x248b('0x22')](function(_0x44232a){_0x372799['rows']=_0x44232a;return _0x372799;});}})[_0x248b('0x22')](respondWithFilteredResult(_0x5887f2,_0x1ee45b))[_0x248b('0x3f')](handleError(_0x5887f2,null));};exports[_0x248b('0x61')]=function(_0xe6bbb1,_0x2e5faa,_0x4bd4b3){var _0x56e5c1={};var _0x658a09={};var _0x261b19;var _0x2caa49;return db['Campaign'][_0x248b('0x55')]({'where':{'id':_0xe6bbb1[_0x248b('0x41')]['id']}})['then'](handleEntityNotFound(_0x2e5faa,null))[_0x248b('0x22')](function(_0x2763c9){if(_0x2763c9){_0x261b19=_0x2763c9;_0x658a09['model']=_[_0x248b('0x31')](db['CmList'][_0x248b('0x2b')]);_0x658a09[_0x248b('0x30')]=_[_0x248b('0x31')](_0xe6bbb1[_0x248b('0x30')]);_0x658a09[_0x248b('0x42')]=_[_0x248b('0x32')](_0x658a09[_0x248b('0x2f')],_0x658a09['query']);_0x56e5c1[_0x248b('0x33')]=_['intersection'](_0x658a09[_0x248b('0x2f')],qs[_0x248b('0x34')](_0xe6bbb1[_0x248b('0x30')][_0x248b('0x34')]));_0x56e5c1['attributes']=_0x56e5c1[_0x248b('0x33')][_0x248b('0x35')]?_0x56e5c1[_0x248b('0x33')]:_0x658a09[_0x248b('0x2f')];_0x56e5c1[_0x248b('0x38')]=qs[_0x248b('0x39')](_0xe6bbb1[_0x248b('0x30')]['sort']);_0x56e5c1[_0x248b('0x3b')]=qs[_0x248b('0x42')](_[_0x248b('0x5d')](_0xe6bbb1[_0x248b('0x30')],_0x658a09[_0x248b('0x42')]));if(_0xe6bbb1[_0x248b('0x30')][_0x248b('0x3a')]){_0x56e5c1[_0x248b('0x3b')]=_[_0x248b('0x3c')](_0x56e5c1[_0x248b('0x3b')],{'$or':_[_0x248b('0x29')](_0x56e5c1['attributes'],function(_0x3e3eed){var _0x22f76a={};_0x22f76a[_0x3e3eed]={'$like':'%'+_0xe6bbb1[_0x248b('0x30')]['filter']+'%'};return _0x22f76a;})});}_0x56e5c1=_[_0x248b('0x3c')]({},_0x56e5c1,_0xe6bbb1[_0x248b('0x3d')]);return _0x261b19['getLists'](_0x56e5c1);}})[_0x248b('0x22')](function(_0x52b201){if(_0x52b201){_0x2caa49=_0x52b201[_0x248b('0x35')];if(!_0xe6bbb1[_0x248b('0x30')][_0x248b('0x36')](_0x248b('0x37'))){_0x56e5c1[_0x248b('0x1c')]=qs[_0x248b('0x1c')](_0xe6bbb1[_0x248b('0x30')]['limit']);_0x56e5c1[_0x248b('0x1a')]=qs[_0x248b('0x1a')](_0xe6bbb1[_0x248b('0x30')]['offset']);}return _0x261b19[_0x248b('0x61')](_0x56e5c1);}})[_0x248b('0x22')](function(_0x428fb0){if(_0x428fb0){return _0x428fb0?{'count':_0x2caa49,'rows':_0x428fb0}:null;}})['then'](respondWithResult(_0x2e5faa,null))[_0x248b('0x3f')](handleError(_0x2e5faa,null));};exports[_0x248b('0x62')]=function(_0x1899da,_0x456d59,_0x5376ca){var _0x50f565,_0x3f1001;var _0x4899df=[];var _0x35005c=moment()[_0x248b('0x63')](_0x248b('0x64'));return db[_0x248b('0x2a')][_0x248b('0x44')]({'where':{'id':_0x1899da[_0x248b('0x41')]['id']}})[_0x248b('0x22')](handleEntityNotFound(_0x456d59,null))[_0x248b('0x22')](function(_0x3f7028){if(_0x3f7028){_0x3f1001=_0x3f7028;return _0x3f7028[_0x248b('0x62')](_0x1899da[_0x248b('0x50')][_0x248b('0x65')],_['omit'](_0x1899da[_0x248b('0x50')],[_0x248b('0x65'),'id'])||{});}return null;})[_0x248b('0x66')](function(_0x3f1459){var _0x243e39;var _0x50da42;_0x50f565=_0x3f1459||[];var _0x2a5feb=[];if(_0x3f1459){for(var _0x55be0c=0x0;_0x55be0c<_0x3f1459['length'];_0x55be0c+=0x1){var _0x341a45=_0x3f1459[_0x55be0c][_0x248b('0x24')]({'plain':!![]});_0x3f1001[_0x248b('0x67')]=_0x1899da[_0x248b('0x50')][_0x248b('0x67')]?_0x1899da[_0x248b('0x50')]['dialCheckDuplicateType']:_0x3f1001['dialCheckDuplicateType'];switch(_0x3f1001[_0x248b('0x67')]){case _0x248b('0x68'):_0x243e39=squel[_0x248b('0x69')]()[_0x248b('0x6a')](_0x248b('0x6b'))['fromQuery']([_0x248b('0x6c'),_0x248b('0x6d'),_0x248b('0x6e'),'ListId',_0x248b('0x5a'),'createdAt',_0x248b('0x4f')],squel[_0x248b('0x6f')]()['field'](_0x248b('0x6c'),'phone')['field']('NOW()',_0x248b('0x6d'))[_0x248b('0x70')]('id',_0x248b('0x6e'))[_0x248b('0x70')](_0x341a45['CmListId'][_0x248b('0x71')](),_0x248b('0x72'))[_0x248b('0x70')](_0x1899da[_0x248b('0x41')]['id'][_0x248b('0x71')](),_0x248b('0x5a'))[_0x248b('0x70')]('\x27'+_0x35005c+'\x27',_0x248b('0x52'))['field']('\x27'+_0x35005c+'\x27',_0x248b('0x4f'))[_0x248b('0x73')](_0x248b('0x74'))[_0x248b('0x3b')](_0x248b('0x75'))[_0x248b('0x3b')](_0x248b('0x76'),_0x341a45['CmListId'][_0x248b('0x71')]())[_0x248b('0x3b')](_0x248b('0x77'))['where'](_0x248b('0x78'),squel['select']()['field'](_0x248b('0x79'))[_0x248b('0x73')](_0x248b('0x7a'))['where'](_0x248b('0x7b'),_0x1899da['params']['id'][_0x248b('0x71')]()))[_0x248b('0x3b')](_0x248b('0x78'),squel['select']()[_0x248b('0x70')]('COALESCE(phone,\x27\x27)')[_0x248b('0x73')]('cm_hopper')[_0x248b('0x3b')]('CampaignId\x20=\x20?',_0x1899da[_0x248b('0x41')]['id'][_0x248b('0x71')]())))[_0x248b('0x71')]();break;case _0x248b('0x7c'):_0x243e39=squel[_0x248b('0x69')]()[_0x248b('0x6a')](_0x248b('0x6b'))[_0x248b('0x7d')]([_0x248b('0x6c'),_0x248b('0x6d'),_0x248b('0x6e'),_0x248b('0x72'),_0x248b('0x5a'),_0x248b('0x52'),_0x248b('0x4f')],squel[_0x248b('0x6f')]()[_0x248b('0x70')]('phone',_0x248b('0x6c'))[_0x248b('0x70')](_0x248b('0x7e'),'scheduledAt')['field']('id',_0x248b('0x6e'))['field'](_0x341a45['CmListId'][_0x248b('0x71')](),'ListId')[_0x248b('0x70')](_0x1899da[_0x248b('0x41')]['id'][_0x248b('0x71')](),_0x248b('0x5a'))[_0x248b('0x70')]('\x27'+_0x35005c+'\x27',_0x248b('0x52'))[_0x248b('0x70')]('\x27'+_0x35005c+'\x27',_0x248b('0x4f'))['from'](_0x248b('0x74'))[_0x248b('0x3b')](_0x248b('0x75'))[_0x248b('0x3b')](_0x248b('0x76'),_0x341a45[_0x248b('0x7f')]['toString']())[_0x248b('0x3b')](_0x248b('0x77'))[_0x248b('0x3b')](_0x248b('0x78'),squel['select']()[_0x248b('0x70')]('COALESCE(phone,\x27\x27)')[_0x248b('0x73')](_0x248b('0x6b'))[_0x248b('0x3b')](_0x248b('0x7b'),_0x1899da[_0x248b('0x41')]['id'][_0x248b('0x71')]())))['toString']();break;default:_0x243e39=squel[_0x248b('0x69')]()[_0x248b('0x6a')](_0x248b('0x6b'))[_0x248b('0x7d')]([_0x248b('0x6c'),_0x248b('0x6d'),_0x248b('0x6e'),_0x248b('0x72'),_0x248b('0x5a'),_0x248b('0x52'),'updatedAt'],squel[_0x248b('0x6f')]()[_0x248b('0x70')]('phone',_0x248b('0x6c'))[_0x248b('0x70')]('NOW()',_0x248b('0x6d'))[_0x248b('0x70')]('id',_0x248b('0x6e'))[_0x248b('0x70')](_0x341a45[_0x248b('0x7f')]['toString'](),_0x248b('0x72'))[_0x248b('0x70')](_0x1899da['params']['id'][_0x248b('0x71')](),_0x248b('0x5a'))[_0x248b('0x70')]('\x27'+_0x35005c+'\x27',_0x248b('0x52'))[_0x248b('0x70')]('\x27'+_0x35005c+'\x27',_0x248b('0x4f'))[_0x248b('0x73')](_0x248b('0x74'))[_0x248b('0x3b')]('deletedAt\x20IS\x20NULL')[_0x248b('0x3b')]('ListId\x20=\x20?',_0x341a45[_0x248b('0x7f')][_0x248b('0x71')]())[_0x248b('0x3b')](_0x248b('0x77')))[_0x248b('0x71')]();}_0x50da42=squel['insert']()[_0x248b('0x6a')](_0x248b('0x80'))[_0x248b('0x7d')]([_0x248b('0x81'),_0x248b('0x6d'),_0x248b('0x6c'),'OrderBy',_0x248b('0x52'),_0x248b('0x4f')],squel['select']()['field'](_0x248b('0x82'),'id')['field'](_0x248b('0x7e'),_0x248b('0x6d'))[_0x248b('0x70')](_0x248b('0x83'),_0x248b('0x6c'))[_0x248b('0x70')](_0x248b('0x84'),'OrderBy')['field']('\x27'+_0x35005c+'\x27',_0x248b('0x52'))['field']('\x27'+_0x35005c+'\x27',_0x248b('0x4f'))[_0x248b('0x73')](_0x248b('0x85'),'ci')['join'](_0x248b('0x6b'),'h',_0x248b('0x86'))[_0x248b('0x3b')](_0x248b('0x87'),_0x341a45[_0x248b('0x7f')][_0x248b('0x71')]())[_0x248b('0x3b')](_0x248b('0x88'),_0x1899da[_0x248b('0x41')]['id']['toString']())[_0x248b('0x3b')](_0x248b('0x89'),_0x35005c))[_0x248b('0x71')]();_0x2a5feb['push'](db[_0x248b('0x8a')][_0x248b('0x30')](_0x243e39));_0x4899df[_0x248b('0x8b')](db['sequelize'][_0x248b('0x30')](_0x50da42));}return BPromise[_0x248b('0x8c')](_0x2a5feb);}})[_0x248b('0x22')](function(){return BPromise[_0x248b('0x8c')](_0x4899df);})[_0x248b('0x22')](function(){return _0x50f565;})['then'](respondWithResult(_0x456d59,null))[_0x248b('0x3f')](handleError(_0x456d59,null));};exports['removeLists']=function(_0x28eebc,_0x20f103,_0x170366){return db[_0x248b('0x2a')][_0x248b('0x44')]({'where':{'id':_0x28eebc[_0x248b('0x41')]['id']}})[_0x248b('0x22')](handleEntityNotFound(_0x20f103,null))[_0x248b('0x22')](function(_0x5eaf00){if(_0x5eaf00){return _0x5eaf00[_0x248b('0x8d')](_0x28eebc['query'][_0x248b('0x65')]);}})[_0x248b('0x22')](function(_0x247352){if(_0x247352){return db[_0x248b('0x56')][_0x248b('0x23')]({'where':{'ListId':_0x28eebc[_0x248b('0x30')][_0x248b('0x65')],'CampaignId':_0x28eebc[_0x248b('0x41')]['id']}})[_0x248b('0x22')](function(){return _0x247352;});}})[_0x248b('0x22')](respondWithStatusCode(_0x20f103,null))[_0x248b('0x3f')](handleError(_0x20f103,null));};exports['getBlackLists']=function(_0x4785bd,_0x3355f5,_0x48c797){var _0xce6365={};var _0x27e83c={};var _0x5ef087;var _0x2fe048;return db[_0x248b('0x2a')][_0x248b('0x55')]({'where':{'id':_0x4785bd[_0x248b('0x41')]['id']}})['then'](handleEntityNotFound(_0x3355f5,null))[_0x248b('0x22')](function(_0x201216){if(_0x201216){_0x5ef087=_0x201216;_0x27e83c[_0x248b('0x2f')]=_[_0x248b('0x31')](db[_0x248b('0x8e')][_0x248b('0x2b')]);_0x27e83c[_0x248b('0x30')]=_['keys'](_0x4785bd[_0x248b('0x30')]);_0x27e83c['filters']=_[_0x248b('0x32')](_0x27e83c[_0x248b('0x2f')],_0x27e83c[_0x248b('0x30')]);_0xce6365['attributes']=_[_0x248b('0x32')](_0x27e83c[_0x248b('0x2f')],qs[_0x248b('0x34')](_0x4785bd['query'][_0x248b('0x34')]));_0xce6365[_0x248b('0x33')]=_0xce6365[_0x248b('0x33')][_0x248b('0x35')]?_0xce6365['attributes']:_0x27e83c['model'];_0xce6365[_0x248b('0x38')]=qs['sort'](_0x4785bd[_0x248b('0x30')][_0x248b('0x39')]);_0xce6365['where']=qs[_0x248b('0x42')](_[_0x248b('0x5d')](_0x4785bd[_0x248b('0x30')],_0x27e83c['filters']));if(_0x4785bd[_0x248b('0x30')]['filter']){_0xce6365['where']=_[_0x248b('0x3c')](_0xce6365['where'],{'$or':_[_0x248b('0x29')](_0xce6365[_0x248b('0x33')],function(_0x257eb8){var _0x481ac8={};_0x481ac8[_0x257eb8]={'$like':'%'+_0x4785bd[_0x248b('0x30')][_0x248b('0x3a')]+'%'};return _0x481ac8;})});}_0xce6365=_[_0x248b('0x3c')]({},_0xce6365,_0x4785bd[_0x248b('0x3d')]);return _0x5ef087[_0x248b('0x8f')](_0xce6365);}})[_0x248b('0x22')](function(_0x66960b){if(_0x66960b){_0x2fe048=_0x66960b[_0x248b('0x35')];if(!_0x4785bd['query'][_0x248b('0x36')](_0x248b('0x37'))){_0xce6365['limit']=qs[_0x248b('0x1c')](_0x4785bd[_0x248b('0x30')][_0x248b('0x1c')]);_0xce6365[_0x248b('0x1a')]=qs['offset'](_0x4785bd[_0x248b('0x30')][_0x248b('0x1a')]);}return _0x5ef087[_0x248b('0x8f')](_0xce6365);}})['then'](function(_0x43f1c5){if(_0x43f1c5){return _0x43f1c5?{'count':_0x2fe048,'rows':_0x43f1c5}:null;}})['then'](respondWithResult(_0x3355f5,null))[_0x248b('0x3f')](handleError(_0x3355f5,null));};exports[_0x248b('0x90')]=function(_0x597dd2,_0x4c3580,_0x574586){var _0x1a33a7,_0x49d1e3;var _0x4d650c=[];var _0x3be4bb=moment()[_0x248b('0x63')](_0x248b('0x64'));return db[_0x248b('0x2a')]['find']({'where':{'id':_0x597dd2['params']['id']}})[_0x248b('0x22')](handleEntityNotFound(_0x4c3580,null))[_0x248b('0x22')](function(_0x4e1181){if(_0x4e1181){_0x49d1e3=_0x4e1181;return _0x4e1181['addBlackLists'](_0x597dd2[_0x248b('0x50')][_0x248b('0x65')],_['omit'](_0x597dd2['body'],[_0x248b('0x65'),'id'])||{});}return null;})[_0x248b('0x66')](function(_0x576176){var _0x314d1d;var _0x13ffc5;_0x1a33a7=_0x576176||[];var _0x4dd6ea=[];if(_0x576176){for(var _0x36ecdc=0x0;_0x36ecdc<_0x576176[_0x248b('0x35')];_0x36ecdc+=0x1){var _0x2b08bc=_0x576176[_0x36ecdc][_0x248b('0x24')]({'plain':!![]});_0x314d1d=squel[_0x248b('0x69')]()[_0x248b('0x6a')](_0x248b('0x91'))[_0x248b('0x7d')](['phone',_0x248b('0x6e'),_0x248b('0x72'),_0x248b('0x5a'),_0x248b('0x52'),_0x248b('0x4f')],squel['select']()[_0x248b('0x70')](_0x248b('0x6c'),_0x248b('0x6c'))[_0x248b('0x70')]('id',_0x248b('0x6e'))[_0x248b('0x70')](_0x2b08bc[_0x248b('0x7f')][_0x248b('0x71')](),_0x248b('0x72'))[_0x248b('0x70')](_0x597dd2['params']['id'][_0x248b('0x71')](),'CampaignId')[_0x248b('0x70')](_0x248b('0x7e'),'createdAt')[_0x248b('0x70')]('NOW()',_0x248b('0x4f'))['from'](_0x248b('0x74'))[_0x248b('0x3b')](_0x248b('0x75'))[_0x248b('0x3b')]('ListId\x20=\x20?',_0x2b08bc['CmListId'][_0x248b('0x71')]())[_0x248b('0x3b')]('phone\x20IS\x20NOT\x20NULL'))[_0x248b('0x71')]();_0x4dd6ea['push'](db[_0x248b('0x8a')][_0x248b('0x30')](_0x314d1d));}return BPromise[_0x248b('0x8c')](_0x4dd6ea);}})[_0x248b('0x22')](function(){return _0x1a33a7;})[_0x248b('0x22')](respondWithResult(_0x4c3580,null))['catch'](handleError(_0x4c3580,null));};exports['removeBlackLists']=function(_0x2727ab,_0x3d51e3,_0x542ee2){return db[_0x248b('0x2a')][_0x248b('0x44')]({'where':{'id':_0x2727ab['params']['id']}})[_0x248b('0x22')](handleEntityNotFound(_0x3d51e3,null))[_0x248b('0x22')](function(_0x84d86){if(_0x84d86){return _0x84d86[_0x248b('0x92')](_0x2727ab[_0x248b('0x30')][_0x248b('0x65')]);}})[_0x248b('0x22')](function(_0x22ebb2){if(_0x22ebb2){return db[_0x248b('0x60')][_0x248b('0x23')]({'where':{'ListId':_0x2727ab['query'][_0x248b('0x65')],'CampaignId':_0x2727ab[_0x248b('0x41')]['id']}})[_0x248b('0x22')](function(){return _0x22ebb2;});}})[_0x248b('0x22')](respondWithStatusCode(_0x3d51e3,null))[_0x248b('0x3f')](handleError(_0x3d51e3,null));};
\ No newline at end of file
+var _0xe486=['UserProfileResource','sendStatus','name','send','map','rawAttributes','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','Campaign','include','findAll','catch','show','keys','intersection','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','options','createdAt','updatedAt','update','params','getHoppers','findOne','CmHopper','pick','CampaignId','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','YYYY-MM-DD\x20HH:mm:ss','omit','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','select','field','toString','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','ListId','NOW()','cm_contacts','CmListId','cm_hopper_additional_phones','OrderBy','ci.item','ci.OrderBY','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','sequelize','push','all','removeLists','getBlackLists','addBlackLists','format','spread','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','destroy','then','get','IvrCampaigns'];(function(_0x15b380,_0x1a3c5f){var _0x232c5c=function(_0x12f8e0){while(--_0x12f8e0){_0x15b380['push'](_0x15b380['shift']());}};_0x232c5c(++_0x1a3c5f);}(_0xe486,0x6a));var _0x6e48=function(_0xa5bd9b,_0x425710){_0xa5bd9b=_0xa5bd9b-0x0;var _0x4a68e0=_0xe486[_0xa5bd9b];return _0x4a68e0;};'use strict';var emlformat=require(_0x6e48('0x0'));var rimraf=require(_0x6e48('0x1'));var zipdir=require(_0x6e48('0x2'));var jsonpatch=require(_0x6e48('0x3'));var rp=require(_0x6e48('0x4'));var moment=require(_0x6e48('0x5'));var BPromise=require(_0x6e48('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6e48('0x7'));var sox=require(_0x6e48('0x8'));var csv=require(_0x6e48('0x9'));var ejs=require(_0x6e48('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6e48('0xb'));var squel=require(_0x6e48('0xc'));var crypto=require(_0x6e48('0xd'));var jsforce=require(_0x6e48('0xe'));var deskjs=require(_0x6e48('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6e48('0x10'));var Papa=require('papaparse');var Redis=require(_0x6e48('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6e48('0x12'));var as=require(_0x6e48('0x13'));var hardwareService=require(_0x6e48('0x14'));var logger=require(_0x6e48('0x15'))('api');var utils=require(_0x6e48('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6e48('0x17'))['db'];function respondWithStatusCode(_0x1f1ff4,_0x1bfa97){_0x1bfa97=_0x1bfa97||0xcc;return function(_0x199cbe){if(_0x199cbe){return _0x1f1ff4['sendStatus'](_0x1bfa97);}return _0x1f1ff4[_0x6e48('0x18')](_0x1bfa97)[_0x6e48('0x19')]();};}function respondWithResult(_0xa66f97,_0x45268d){_0x45268d=_0x45268d||0xc8;return function(_0x272a24){if(_0x272a24){return _0xa66f97[_0x6e48('0x18')](_0x45268d)[_0x6e48('0x1a')](_0x272a24);}};}function respondWithFilteredResult(_0x307d4c,_0x1687b7){return function(_0x48c10c){if(_0x48c10c){var _0x437f65=typeof _0x1687b7[_0x6e48('0x1b')]===_0x6e48('0x1c')&&typeof _0x1687b7[_0x6e48('0x1d')]==='undefined';var _0x45e94b=_0x48c10c[_0x6e48('0x1e')];var _0x4d3927=_0x437f65?0x0:_0x1687b7[_0x6e48('0x1b')];var _0x1c89f1=_0x437f65?_0x48c10c[_0x6e48('0x1e')]:_0x1687b7[_0x6e48('0x1b')]+_0x1687b7[_0x6e48('0x1d')];var _0x419fd8;if(_0x1c89f1>=_0x45e94b){_0x1c89f1=_0x45e94b;_0x419fd8=0xc8;}else{_0x419fd8=0xce;}_0x307d4c[_0x6e48('0x18')](_0x419fd8);return _0x307d4c[_0x6e48('0x1f')]('Content-Range',_0x4d3927+'-'+_0x1c89f1+'/'+_0x45e94b)[_0x6e48('0x1a')](_0x48c10c);}return null;};}function patchUpdates(_0x383ecb){return function(_0x84322b){try{jsonpatch[_0x6e48('0x20')](_0x84322b,_0x383ecb,!![]);}catch(_0x25f7d3){return BPromise[_0x6e48('0x21')](_0x25f7d3);}return _0x84322b['save']();};}function saveUpdates(_0x4518a7,_0x4cdded){return function(_0x371147){if(_0x371147){return _0x371147['update'](_0x4518a7)['then'](function(_0x52bbef){return _0x52bbef;});}return null;};}function removeEntity(_0x3d492f,_0xe57bbf){return function(_0x406611){if(_0x406611){return _0x406611[_0x6e48('0x22')]()[_0x6e48('0x23')](function(){var _0x5dcd9a=_0x406611[_0x6e48('0x24')]({'plain':!![]});var _0x195761=_0x6e48('0x25');return db[_0x6e48('0x26')][_0x6e48('0x22')]({'where':{'type':_0x195761,'resourceId':_0x5dcd9a['id']}})[_0x6e48('0x23')](function(){return _0x406611;});})[_0x6e48('0x23')](function(){_0x3d492f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x380eb5,_0x4147bd){return function(_0x50d01f){if(!_0x50d01f){_0x380eb5[_0x6e48('0x27')](0x194);}return _0x50d01f;};}function handleError(_0x484bb3,_0x13d1bb){_0x13d1bb=_0x13d1bb||0x1f4;return function(_0x502b67){logger['error'](_0x502b67['stack']);if(_0x502b67[_0x6e48('0x28')]){delete _0x502b67[_0x6e48('0x28')];}_0x484bb3[_0x6e48('0x18')](_0x13d1bb)[_0x6e48('0x29')](_0x502b67);};}exports['index']=function(_0xdc841a,_0x271769){var _0x4b5b4b={},_0x1e7f00={},_0x2ac4de={'count':0x0,'rows':[]};var _0x545bdc=_[_0x6e48('0x2a')](db['Campaign'][_0x6e48('0x2b')],function(_0x2c4a72){return{'name':_0x2c4a72['fieldName'],'type':_0x2c4a72[_0x6e48('0x2c')][_0x6e48('0x2d')]};});_0x1e7f00[_0x6e48('0x2e')]=_['map'](_0x545bdc,_0x6e48('0x28'));_0x1e7f00[_0x6e48('0x2f')]=_['keys'](_0xdc841a[_0x6e48('0x2f')]);_0x1e7f00[_0x6e48('0x30')]=_['intersection'](_0x1e7f00['model'],_0x1e7f00['query']);_0x4b5b4b[_0x6e48('0x31')]=_['intersection'](_0x1e7f00[_0x6e48('0x2e')],qs[_0x6e48('0x32')](_0xdc841a[_0x6e48('0x2f')]['fields']));_0x4b5b4b['attributes']=_0x4b5b4b[_0x6e48('0x31')][_0x6e48('0x33')]?_0x4b5b4b['attributes']:_0x1e7f00['model'];if(!_0xdc841a[_0x6e48('0x2f')][_0x6e48('0x34')](_0x6e48('0x35'))){_0x4b5b4b[_0x6e48('0x1d')]=qs[_0x6e48('0x1d')](_0xdc841a[_0x6e48('0x2f')][_0x6e48('0x1d')]);_0x4b5b4b['offset']=qs['offset'](_0xdc841a[_0x6e48('0x2f')][_0x6e48('0x1b')]);}_0x4b5b4b[_0x6e48('0x36')]=qs[_0x6e48('0x37')](_0xdc841a['query'][_0x6e48('0x37')]);_0x4b5b4b[_0x6e48('0x38')]=qs['filters'](_['pick'](_0xdc841a[_0x6e48('0x2f')],_0x1e7f00[_0x6e48('0x30')]),_0x545bdc);if(_0xdc841a['query'][_0x6e48('0x39')]){_0x4b5b4b['where']=_[_0x6e48('0x3a')](_0x4b5b4b['where'],{'$or':_[_0x6e48('0x2a')](_0x545bdc,function(_0x5de5e7){if(_0x5de5e7['type']!==_0x6e48('0x3b')){var _0x808f99={};_0x808f99[_0x5de5e7[_0x6e48('0x28')]]={'$like':'%'+_0xdc841a['query'][_0x6e48('0x39')]+'%'};return _0x808f99;}})});}_0x4b5b4b=_[_0x6e48('0x3a')]({},_0x4b5b4b,_0xdc841a['options']);var _0x3b7c8d={'where':_0x4b5b4b[_0x6e48('0x38')]};return db[_0x6e48('0x3c')][_0x6e48('0x1e')](_0x3b7c8d)[_0x6e48('0x23')](function(_0x2fc08a){_0x2ac4de[_0x6e48('0x1e')]=_0x2fc08a;if(_0xdc841a[_0x6e48('0x2f')]['includeAll']){_0x4b5b4b[_0x6e48('0x3d')]=[{'all':!![]}];}return db[_0x6e48('0x3c')][_0x6e48('0x3e')](_0x4b5b4b);})['then'](function(_0x16a056){_0x2ac4de['rows']=_0x16a056;return _0x2ac4de;})[_0x6e48('0x23')](respondWithFilteredResult(_0x271769,_0x4b5b4b))[_0x6e48('0x3f')](handleError(_0x271769,null));};exports[_0x6e48('0x40')]=function(_0x1575a0,_0x198550){var _0x1ba239={'raw':![],'where':{'id':_0x1575a0['params']['id']}},_0x1173fd={};_0x1173fd[_0x6e48('0x2e')]=_['keys'](db['Campaign'][_0x6e48('0x2b')]);_0x1173fd[_0x6e48('0x2f')]=_[_0x6e48('0x41')](_0x1575a0['query']);_0x1173fd['filters']=_[_0x6e48('0x42')](_0x1173fd[_0x6e48('0x2e')],_0x1173fd['query']);_0x1ba239[_0x6e48('0x31')]=_[_0x6e48('0x42')](_0x1173fd['model'],qs[_0x6e48('0x32')](_0x1575a0[_0x6e48('0x2f')][_0x6e48('0x32')]));_0x1ba239[_0x6e48('0x31')]=_0x1ba239[_0x6e48('0x31')]['length']?_0x1ba239['attributes']:_0x1173fd[_0x6e48('0x2e')];if(_0x1575a0['query'][_0x6e48('0x43')]){_0x1ba239[_0x6e48('0x3d')]=[{'all':!![]}];}_0x1ba239=_[_0x6e48('0x3a')]({},_0x1ba239,_0x1575a0['options']);return db['Campaign']['find'](_0x1ba239)['then'](handleEntityNotFound(_0x198550,null))[_0x6e48('0x23')](respondWithResult(_0x198550,null))['catch'](handleError(_0x198550,null));};exports[_0x6e48('0x44')]=function(_0x25c5a6,_0x1801ca){return db[_0x6e48('0x3c')][_0x6e48('0x44')](_0x25c5a6[_0x6e48('0x45')],{})['then'](function(_0x16a44e){var _0x569266=_0x25c5a6[_0x6e48('0x46')][_0x6e48('0x24')]({'plain':!![]});if(!_0x569266)throw new Error(_0x6e48('0x47'));if(_0x569266[_0x6e48('0x48')]===_0x6e48('0x46')){var _0x20a520=_0x16a44e[_0x6e48('0x24')]({'plain':!![]});var _0x8af8de=_0x6e48('0x25');return db[_0x6e48('0x49')][_0x6e48('0x4a')]({'where':{'name':_0x8af8de,'userProfileId':_0x569266[_0x6e48('0x4b')]},'raw':!![]})[_0x6e48('0x23')](function(_0x46c1f9){if(_0x46c1f9&&_0x46c1f9[_0x6e48('0x4c')]===0x0){return db[_0x6e48('0x26')]['create']({'name':_0x20a520[_0x6e48('0x28')],'resourceId':_0x20a520['id'],'type':_0x46c1f9[_0x6e48('0x28')],'sectionId':_0x46c1f9['id']},{})['then'](function(){return _0x16a44e;});}else{return _0x16a44e;}})[_0x6e48('0x3f')](function(_0x364f31){logger[_0x6e48('0x4d')](_0x6e48('0x4e'),_0x364f31);throw _0x364f31;});}return _0x16a44e;})['then'](respondWithResult(_0x1801ca,0xc9))[_0x6e48('0x3f')](handleError(_0x1801ca,null));};exports[_0x6e48('0x4f')]=function(_0x1970fb,_0x3bfa9d){var _0x3c63c9={'where':{'id':_0x1970fb['params']['id']}},_0x1acd37={};_0x1acd37['model']=_[_0x6e48('0x41')](db[_0x6e48('0x3c')][_0x6e48('0x2b')]);_0x3c63c9[_0x6e48('0x31')]=_[_0x6e48('0x42')](_0x1acd37['model'],qs[_0x6e48('0x32')](_0x1970fb['query'][_0x6e48('0x32')]));_0x3c63c9[_0x6e48('0x31')]=_0x3c63c9[_0x6e48('0x31')][_0x6e48('0x33')]?_0x3c63c9[_0x6e48('0x31')]:_0x1acd37[_0x6e48('0x2e')];if(_0x1970fb[_0x6e48('0x2f')]['includeAll']){_0x3c63c9['include']=[{'all':!![]}];}_0x3c63c9=_[_0x6e48('0x3a')]({},_0x3c63c9,_0x1970fb[_0x6e48('0x50')]);return db[_0x6e48('0x3c')][_0x6e48('0x4a')](_0x3c63c9)['then'](handleEntityNotFound(_0x3bfa9d,null))[_0x6e48('0x23')](function(_0x2ee495){if(_0x2ee495){var _0x2a3d5d=_0x2ee495['get']({'plain':!![]});_0x2a3d5d=qs['omit'](_0x2a3d5d,['id',_0x6e48('0x51'),_0x6e48('0x52')]);_0x1970fb['body']=_['omit'](_0x1970fb[_0x6e48('0x45')],['id',_0x6e48('0x51'),_0x6e48('0x52')]);return db[_0x6e48('0x3c')][_0x6e48('0x44')](_[_0x6e48('0x3a')](_0x2a3d5d,_0x1970fb[_0x6e48('0x45')]),{'include':_0x1970fb[_0x6e48('0x2f')][_0x6e48('0x43')]?[{'all':!![]}]:undefined})[_0x6e48('0x23')](function(_0x2a4f31){var _0x2739eb=_0x1970fb[_0x6e48('0x46')][_0x6e48('0x24')]({'plain':!![]});if(!_0x2739eb)throw new Error(_0x6e48('0x47'));if(_0x2739eb[_0x6e48('0x48')]===_0x6e48('0x46')){var _0x5ab110=_0x2a4f31[_0x6e48('0x24')]({'plain':!![]});var _0x2f192c=_0x6e48('0x25');return db[_0x6e48('0x49')][_0x6e48('0x4a')]({'where':{'name':_0x2f192c,'userProfileId':_0x2739eb[_0x6e48('0x4b')]},'raw':!![]})[_0x6e48('0x23')](function(_0x2d8b6f){if(_0x2d8b6f&&_0x2d8b6f['autoAssociation']===0x0){return db[_0x6e48('0x26')][_0x6e48('0x44')]({'name':_0x5ab110['name'],'resourceId':_0x5ab110['id'],'type':_0x2d8b6f['name'],'sectionId':_0x2d8b6f['id']},{})['then'](function(){return _0x2a4f31;});}else{return _0x2a4f31;}})[_0x6e48('0x3f')](function(_0x362f48){logger['error'](_0x6e48('0x4e'),_0x362f48);throw _0x362f48;});}return _0x2a4f31;});}})[_0x6e48('0x23')](respondWithResult(_0x3bfa9d,0xc9))[_0x6e48('0x3f')](handleError(_0x3bfa9d,null));};exports[_0x6e48('0x53')]=function(_0x45588b,_0x4c6055){if(_0x45588b[_0x6e48('0x45')]['id']){delete _0x45588b[_0x6e48('0x45')]['id'];}return db['Campaign']['find']({'where':{'id':_0x45588b[_0x6e48('0x54')]['id']}})['then'](handleEntityNotFound(_0x4c6055,null))[_0x6e48('0x23')](saveUpdates(_0x45588b[_0x6e48('0x45')],null))[_0x6e48('0x23')](respondWithResult(_0x4c6055,null))[_0x6e48('0x3f')](handleError(_0x4c6055,null));};exports[_0x6e48('0x22')]=function(_0x45dfb1,_0xef219e){return db[_0x6e48('0x3c')][_0x6e48('0x4a')]({'where':{'id':_0x45dfb1['params']['id']}})[_0x6e48('0x23')](handleEntityNotFound(_0xef219e,null))[_0x6e48('0x23')](removeEntity(_0xef219e,null))[_0x6e48('0x3f')](handleError(_0xef219e,null));};exports[_0x6e48('0x55')]=function(_0x9c17d7,_0x39d8be,_0x32ee86){var _0x16a412={'raw':!![],'where':{}};var _0x5ed0d9={};var _0x9c5d37={'count':0x0,'rows':[]};return db[_0x6e48('0x3c')][_0x6e48('0x56')]({'where':{'id':_0x9c17d7[_0x6e48('0x54')]['id']}})[_0x6e48('0x23')](handleEntityNotFound(_0x39d8be,null))[_0x6e48('0x23')](function(_0x4b6a12){if(_0x4b6a12){_0x5ed0d9[_0x6e48('0x2e')]=_[_0x6e48('0x41')](db[_0x6e48('0x57')][_0x6e48('0x2b')]);_0x5ed0d9[_0x6e48('0x2f')]=_[_0x6e48('0x41')](_0x9c17d7['query']);_0x5ed0d9[_0x6e48('0x30')]=_[_0x6e48('0x42')](_0x5ed0d9['model'],_0x5ed0d9[_0x6e48('0x2f')]);_0x16a412['attributes']=_[_0x6e48('0x42')](_0x5ed0d9[_0x6e48('0x2e')],qs[_0x6e48('0x32')](_0x9c17d7[_0x6e48('0x2f')][_0x6e48('0x32')]));_0x16a412['attributes']=_0x16a412[_0x6e48('0x31')]['length']?_0x16a412[_0x6e48('0x31')]:_0x5ed0d9[_0x6e48('0x2e')];if(!_0x9c17d7[_0x6e48('0x2f')]['hasOwnProperty'](_0x6e48('0x35'))){_0x16a412[_0x6e48('0x1d')]=qs[_0x6e48('0x1d')](_0x9c17d7[_0x6e48('0x2f')][_0x6e48('0x1d')]);_0x16a412[_0x6e48('0x1b')]=qs['offset'](_0x9c17d7[_0x6e48('0x2f')][_0x6e48('0x1b')]);}_0x16a412[_0x6e48('0x36')]=qs['sort'](_0x9c17d7[_0x6e48('0x2f')][_0x6e48('0x37')]);_0x16a412['where']=qs[_0x6e48('0x30')](_[_0x6e48('0x58')](_0x9c17d7[_0x6e48('0x2f')],_0x5ed0d9[_0x6e48('0x30')]));_0x16a412[_0x6e48('0x38')][_0x6e48('0x59')]=_0x4b6a12['id'];if(_0x9c17d7[_0x6e48('0x2f')][_0x6e48('0x39')]){_0x16a412['where']=_[_0x6e48('0x3a')](_0x16a412['where'],{'$or':_[_0x6e48('0x2a')](_0x16a412[_0x6e48('0x31')],function(_0x50e381){var _0x4b9b49={};_0x4b9b49[_0x50e381]={'$like':'%'+_0x9c17d7['query'][_0x6e48('0x39')]+'%'};return _0x4b9b49;})});}_0x16a412=_[_0x6e48('0x3a')]({},_0x16a412,_0x9c17d7[_0x6e48('0x50')]);return db[_0x6e48('0x57')][_0x6e48('0x1e')]({'where':_0x16a412[_0x6e48('0x38')]})[_0x6e48('0x23')](function(_0x432d4b){_0x9c5d37[_0x6e48('0x1e')]=_0x432d4b;if(_0x9c17d7[_0x6e48('0x2f')][_0x6e48('0x43')]){_0x16a412[_0x6e48('0x3d')]=[{'all':!![]}];}return db[_0x6e48('0x57')][_0x6e48('0x3e')](_0x16a412);})[_0x6e48('0x23')](function(_0x414719){_0x9c5d37[_0x6e48('0x5a')]=_0x414719;return _0x9c5d37;});}})[_0x6e48('0x23')](respondWithFilteredResult(_0x39d8be,_0x16a412))[_0x6e48('0x3f')](handleError(_0x39d8be,null));};exports[_0x6e48('0x5b')]=function(_0x252d0e,_0x2a4c6f,_0x5e4d0a){var _0x452a3a={'raw':!![],'where':{}};var _0x267015={};var _0x3a5f56={'count':0x0,'rows':[]};return db[_0x6e48('0x3c')][_0x6e48('0x56')]({'where':{'id':_0x252d0e[_0x6e48('0x54')]['id']}})[_0x6e48('0x23')](handleEntityNotFound(_0x2a4c6f,null))[_0x6e48('0x23')](function(_0x40543d){if(_0x40543d){_0x267015[_0x6e48('0x2e')]=_[_0x6e48('0x41')](db[_0x6e48('0x5c')][_0x6e48('0x2b')]);_0x267015[_0x6e48('0x2f')]=_[_0x6e48('0x41')](_0x252d0e[_0x6e48('0x2f')]);_0x267015[_0x6e48('0x30')]=_['intersection'](_0x267015[_0x6e48('0x2e')],_0x267015[_0x6e48('0x2f')]);_0x452a3a[_0x6e48('0x31')]=_[_0x6e48('0x42')](_0x267015['model'],qs[_0x6e48('0x32')](_0x252d0e[_0x6e48('0x2f')][_0x6e48('0x32')]));_0x452a3a[_0x6e48('0x31')]=_0x452a3a['attributes'][_0x6e48('0x33')]?_0x452a3a[_0x6e48('0x31')]:_0x267015[_0x6e48('0x2e')];if(!_0x252d0e['query']['hasOwnProperty'](_0x6e48('0x35'))){_0x452a3a[_0x6e48('0x1d')]=qs[_0x6e48('0x1d')](_0x252d0e[_0x6e48('0x2f')][_0x6e48('0x1d')]);_0x452a3a['offset']=qs[_0x6e48('0x1b')](_0x252d0e['query'][_0x6e48('0x1b')]);}_0x452a3a[_0x6e48('0x36')]=qs[_0x6e48('0x37')](_0x252d0e['query']['sort']);_0x452a3a[_0x6e48('0x38')]=qs[_0x6e48('0x30')](_[_0x6e48('0x58')](_0x252d0e[_0x6e48('0x2f')],_0x267015[_0x6e48('0x30')]));_0x452a3a[_0x6e48('0x38')]['CampaignId']=_0x40543d['id'];if(_0x252d0e[_0x6e48('0x2f')][_0x6e48('0x39')]){_0x452a3a['where']=_[_0x6e48('0x3a')](_0x452a3a['where'],{'$or':_[_0x6e48('0x2a')](_0x452a3a['attributes'],function(_0x4d3488){var _0x26f74c={};_0x26f74c[_0x4d3488]={'$like':'%'+_0x252d0e[_0x6e48('0x2f')][_0x6e48('0x39')]+'%'};return _0x26f74c;})});}_0x452a3a=_[_0x6e48('0x3a')]({},_0x452a3a,_0x252d0e['options']);return db[_0x6e48('0x5c')]['count']({'where':_0x452a3a[_0x6e48('0x38')]})['then'](function(_0x3b7acb){_0x3a5f56[_0x6e48('0x1e')]=_0x3b7acb;if(_0x252d0e[_0x6e48('0x2f')][_0x6e48('0x43')]){_0x452a3a[_0x6e48('0x3d')]=[{'all':!![]}];}return db[_0x6e48('0x5c')][_0x6e48('0x3e')](_0x452a3a);})['then'](function(_0x44dd0c){_0x3a5f56['rows']=_0x44dd0c;return _0x3a5f56;});}})[_0x6e48('0x23')](respondWithFilteredResult(_0x2a4c6f,_0x452a3a))[_0x6e48('0x3f')](handleError(_0x2a4c6f,null));};exports[_0x6e48('0x5d')]=function(_0x2b490d,_0xdb68fe,_0x3123df){var _0xc953cb={'raw':!![],'where':{}};var _0xa9991={};var _0x6417f7={'count':0x0,'rows':[]};return db[_0x6e48('0x3c')][_0x6e48('0x56')]({'where':{'id':_0x2b490d[_0x6e48('0x54')]['id']}})[_0x6e48('0x23')](handleEntityNotFound(_0xdb68fe,null))['then'](function(_0xebdb){if(_0xebdb){_0xa9991[_0x6e48('0x2e')]=_[_0x6e48('0x41')](db[_0x6e48('0x5e')]['rawAttributes']);_0xa9991[_0x6e48('0x2f')]=_['keys'](_0x2b490d['query']);_0xa9991[_0x6e48('0x30')]=_[_0x6e48('0x42')](_0xa9991[_0x6e48('0x2e')],_0xa9991[_0x6e48('0x2f')]);_0xc953cb[_0x6e48('0x31')]=_[_0x6e48('0x42')](_0xa9991[_0x6e48('0x2e')],qs[_0x6e48('0x32')](_0x2b490d[_0x6e48('0x2f')][_0x6e48('0x32')]));_0xc953cb[_0x6e48('0x31')]=_0xc953cb['attributes']['length']?_0xc953cb[_0x6e48('0x31')]:_0xa9991[_0x6e48('0x2e')];if(!_0x2b490d[_0x6e48('0x2f')]['hasOwnProperty'](_0x6e48('0x35'))){_0xc953cb[_0x6e48('0x1d')]=qs[_0x6e48('0x1d')](_0x2b490d[_0x6e48('0x2f')][_0x6e48('0x1d')]);_0xc953cb[_0x6e48('0x1b')]=qs[_0x6e48('0x1b')](_0x2b490d['query'][_0x6e48('0x1b')]);}_0xc953cb[_0x6e48('0x36')]=qs[_0x6e48('0x37')](_0x2b490d[_0x6e48('0x2f')][_0x6e48('0x37')]);_0xc953cb[_0x6e48('0x38')]=qs[_0x6e48('0x30')](_[_0x6e48('0x58')](_0x2b490d[_0x6e48('0x2f')],_0xa9991[_0x6e48('0x30')]));_0xc953cb[_0x6e48('0x38')]['CampaignId']=_0xebdb['id'];if(_0x2b490d['query'][_0x6e48('0x39')]){_0xc953cb[_0x6e48('0x38')]=_[_0x6e48('0x3a')](_0xc953cb['where'],{'$or':_[_0x6e48('0x2a')](_0xc953cb[_0x6e48('0x31')],function(_0x3b49c4){var _0x2bb51e={};_0x2bb51e[_0x3b49c4]={'$like':'%'+_0x2b490d[_0x6e48('0x2f')]['filter']+'%'};return _0x2bb51e;})});}_0xc953cb=_[_0x6e48('0x3a')]({},_0xc953cb,_0x2b490d['options']);return db['CmHopperFinal']['count']({'where':_0xc953cb[_0x6e48('0x38')]})[_0x6e48('0x23')](function(_0x3f6006){_0x6417f7[_0x6e48('0x1e')]=_0x3f6006;if(_0x2b490d[_0x6e48('0x2f')][_0x6e48('0x43')]){_0xc953cb[_0x6e48('0x3d')]=[{'all':!![]}];}return db[_0x6e48('0x5e')][_0x6e48('0x3e')](_0xc953cb);})[_0x6e48('0x23')](function(_0x5def28){_0x6417f7['rows']=_0x5def28;return _0x6417f7;});}})['then'](respondWithFilteredResult(_0xdb68fe,_0xc953cb))[_0x6e48('0x3f')](handleError(_0xdb68fe,null));};exports[_0x6e48('0x5f')]=function(_0x4cec6b,_0xe7c81d,_0x40f291){var _0x1302c5={'raw':!![],'where':{}};var _0x29fb10={};var _0x4524a8={'count':0x0,'rows':[]};return db[_0x6e48('0x3c')][_0x6e48('0x56')]({'where':{'id':_0x4cec6b[_0x6e48('0x54')]['id']}})[_0x6e48('0x23')](handleEntityNotFound(_0xe7c81d,null))['then'](function(_0x15daa4){if(_0x15daa4){_0x29fb10[_0x6e48('0x2e')]=_[_0x6e48('0x41')](db[_0x6e48('0x60')]['rawAttributes']);_0x29fb10['query']=_[_0x6e48('0x41')](_0x4cec6b[_0x6e48('0x2f')]);_0x29fb10[_0x6e48('0x30')]=_[_0x6e48('0x42')](_0x29fb10[_0x6e48('0x2e')],_0x29fb10[_0x6e48('0x2f')]);_0x1302c5[_0x6e48('0x31')]=_[_0x6e48('0x42')](_0x29fb10[_0x6e48('0x2e')],qs[_0x6e48('0x32')](_0x4cec6b[_0x6e48('0x2f')][_0x6e48('0x32')]));_0x1302c5[_0x6e48('0x31')]=_0x1302c5['attributes']['length']?_0x1302c5[_0x6e48('0x31')]:_0x29fb10[_0x6e48('0x2e')];if(!_0x4cec6b[_0x6e48('0x2f')][_0x6e48('0x34')]('nolimit')){_0x1302c5['limit']=qs['limit'](_0x4cec6b[_0x6e48('0x2f')]['limit']);_0x1302c5['offset']=qs[_0x6e48('0x1b')](_0x4cec6b['query']['offset']);}_0x1302c5[_0x6e48('0x36')]=qs[_0x6e48('0x37')](_0x4cec6b['query'][_0x6e48('0x37')]);_0x1302c5[_0x6e48('0x38')]=qs[_0x6e48('0x30')](_['pick'](_0x4cec6b[_0x6e48('0x2f')],_0x29fb10['filters']));_0x1302c5[_0x6e48('0x38')][_0x6e48('0x59')]=_0x15daa4['id'];if(_0x4cec6b[_0x6e48('0x2f')][_0x6e48('0x39')]){_0x1302c5[_0x6e48('0x38')]=_[_0x6e48('0x3a')](_0x1302c5[_0x6e48('0x38')],{'$or':_['map'](_0x1302c5[_0x6e48('0x31')],function(_0x4cc014){var _0x26720d={};_0x26720d[_0x4cc014]={'$like':'%'+_0x4cec6b[_0x6e48('0x2f')]['filter']+'%'};return _0x26720d;})});}_0x1302c5=_[_0x6e48('0x3a')]({},_0x1302c5,_0x4cec6b['options']);return db[_0x6e48('0x60')]['count']({'where':_0x1302c5[_0x6e48('0x38')]})[_0x6e48('0x23')](function(_0x69451c){_0x4524a8['count']=_0x69451c;if(_0x4cec6b[_0x6e48('0x2f')]['includeAll']){_0x1302c5[_0x6e48('0x3d')]=[{'all':!![]}];}return db[_0x6e48('0x60')][_0x6e48('0x3e')](_0x1302c5);})[_0x6e48('0x23')](function(_0x2093e7){_0x4524a8['rows']=_0x2093e7;return _0x4524a8;});}})[_0x6e48('0x23')](respondWithFilteredResult(_0xe7c81d,_0x1302c5))[_0x6e48('0x3f')](handleError(_0xe7c81d,null));};exports['getLists']=function(_0x375a75,_0x1e8914,_0x1c2b9e){var _0x3029f4={};var _0x5ca396={};var _0x3f967b;var _0x361337;return db[_0x6e48('0x3c')][_0x6e48('0x56')]({'where':{'id':_0x375a75[_0x6e48('0x54')]['id']}})[_0x6e48('0x23')](handleEntityNotFound(_0x1e8914,null))[_0x6e48('0x23')](function(_0x3da8a9){if(_0x3da8a9){_0x3f967b=_0x3da8a9;_0x5ca396[_0x6e48('0x2e')]=_[_0x6e48('0x41')](db[_0x6e48('0x61')]['rawAttributes']);_0x5ca396[_0x6e48('0x2f')]=_['keys'](_0x375a75[_0x6e48('0x2f')]);_0x5ca396[_0x6e48('0x30')]=_[_0x6e48('0x42')](_0x5ca396['model'],_0x5ca396['query']);_0x3029f4['attributes']=_[_0x6e48('0x42')](_0x5ca396['model'],qs[_0x6e48('0x32')](_0x375a75['query']['fields']));_0x3029f4[_0x6e48('0x31')]=_0x3029f4['attributes'][_0x6e48('0x33')]?_0x3029f4[_0x6e48('0x31')]:_0x5ca396[_0x6e48('0x2e')];_0x3029f4[_0x6e48('0x36')]=qs[_0x6e48('0x37')](_0x375a75[_0x6e48('0x2f')][_0x6e48('0x37')]);_0x3029f4[_0x6e48('0x38')]=qs[_0x6e48('0x30')](_['pick'](_0x375a75[_0x6e48('0x2f')],_0x5ca396[_0x6e48('0x30')]));if(_0x375a75['query']['filter']){_0x3029f4[_0x6e48('0x38')]=_[_0x6e48('0x3a')](_0x3029f4[_0x6e48('0x38')],{'$or':_['map'](_0x3029f4[_0x6e48('0x31')],function(_0x389d43){var _0x23b8ee={};_0x23b8ee[_0x389d43]={'$like':'%'+_0x375a75['query'][_0x6e48('0x39')]+'%'};return _0x23b8ee;})});}_0x3029f4=_['merge']({},_0x3029f4,_0x375a75['options']);return _0x3f967b[_0x6e48('0x62')](_0x3029f4);}})[_0x6e48('0x23')](function(_0x2e22a0){if(_0x2e22a0){_0x361337=_0x2e22a0[_0x6e48('0x33')];if(!_0x375a75[_0x6e48('0x2f')][_0x6e48('0x34')]('nolimit')){_0x3029f4[_0x6e48('0x1d')]=qs['limit'](_0x375a75['query']['limit']);_0x3029f4[_0x6e48('0x1b')]=qs[_0x6e48('0x1b')](_0x375a75[_0x6e48('0x2f')]['offset']);}return _0x3f967b[_0x6e48('0x62')](_0x3029f4);}})['then'](function(_0x5243bc){if(_0x5243bc){return _0x5243bc?{'count':_0x361337,'rows':_0x5243bc}:null;}})[_0x6e48('0x23')](respondWithResult(_0x1e8914,null))[_0x6e48('0x3f')](handleError(_0x1e8914,null));};exports['addLists']=function(_0x45507e,_0x7e2923,_0x290571){var _0x2616e5,_0x438277;var _0x3313a5=[];var _0x22bfac=moment()['format'](_0x6e48('0x63'));return db[_0x6e48('0x3c')]['find']({'where':{'id':_0x45507e[_0x6e48('0x54')]['id']}})[_0x6e48('0x23')](handleEntityNotFound(_0x7e2923,null))[_0x6e48('0x23')](function(_0x602e8e){if(_0x602e8e){_0x438277=_0x602e8e;return _0x602e8e['addLists'](_0x45507e[_0x6e48('0x45')]['ids'],_[_0x6e48('0x64')](_0x45507e[_0x6e48('0x45')],[_0x6e48('0x65'),'id'])||{});}return null;})['spread'](function(_0x1be003){var _0xa2d90e;var _0x3dc756;_0x2616e5=_0x1be003||[];var _0x259261=[];if(_0x1be003){for(var _0x1f54b2=0x0;_0x1f54b2<_0x1be003['length'];_0x1f54b2+=0x1){var _0x3490da=_0x1be003[_0x1f54b2][_0x6e48('0x24')]({'plain':!![]});_0x438277[_0x6e48('0x66')]=_0x45507e[_0x6e48('0x45')][_0x6e48('0x66')]?_0x45507e[_0x6e48('0x45')][_0x6e48('0x66')]:_0x438277['dialCheckDuplicateType'];switch(_0x438277[_0x6e48('0x66')]){case _0x6e48('0x67'):_0xa2d90e=squel[_0x6e48('0x68')]()[_0x6e48('0x69')](_0x6e48('0x6a'))[_0x6e48('0x6b')]([_0x6e48('0x6c'),_0x6e48('0x6d'),_0x6e48('0x6e'),'ListId','CampaignId',_0x6e48('0x51'),_0x6e48('0x52')],squel[_0x6e48('0x6f')]()[_0x6e48('0x70')](_0x6e48('0x6c'),_0x6e48('0x6c'))[_0x6e48('0x70')]('NOW()',_0x6e48('0x6d'))[_0x6e48('0x70')]('id',_0x6e48('0x6e'))[_0x6e48('0x70')](_0x3490da['CmListId'][_0x6e48('0x71')](),'ListId')[_0x6e48('0x70')](_0x45507e[_0x6e48('0x54')]['id'][_0x6e48('0x71')](),_0x6e48('0x59'))[_0x6e48('0x70')]('\x27'+_0x22bfac+'\x27',_0x6e48('0x51'))[_0x6e48('0x70')]('\x27'+_0x22bfac+'\x27',_0x6e48('0x52'))['from']('cm_contacts')['where'](_0x6e48('0x72'))[_0x6e48('0x38')](_0x6e48('0x73'),_0x3490da['CmListId'][_0x6e48('0x71')]())[_0x6e48('0x38')](_0x6e48('0x74'))[_0x6e48('0x38')](_0x6e48('0x75'),squel[_0x6e48('0x6f')]()[_0x6e48('0x70')]('COALESCE(calleridnum,\x27\x27)')[_0x6e48('0x76')](_0x6e48('0x77'))[_0x6e48('0x38')]('CampaignId\x20=\x20?',_0x45507e['params']['id'][_0x6e48('0x71')]()))[_0x6e48('0x38')]('phone\x20NOT\x20IN\x20(?)',squel[_0x6e48('0x6f')]()[_0x6e48('0x70')](_0x6e48('0x78'))['from'](_0x6e48('0x6a'))[_0x6e48('0x38')]('CampaignId\x20=\x20?',_0x45507e[_0x6e48('0x54')]['id'][_0x6e48('0x71')]())))[_0x6e48('0x71')]();break;case _0x6e48('0x79'):_0xa2d90e=squel[_0x6e48('0x68')]()[_0x6e48('0x69')]('cm_hopper')[_0x6e48('0x6b')]([_0x6e48('0x6c'),_0x6e48('0x6d'),_0x6e48('0x6e'),_0x6e48('0x7a'),'CampaignId',_0x6e48('0x51'),_0x6e48('0x52')],squel[_0x6e48('0x6f')]()[_0x6e48('0x70')]('phone',_0x6e48('0x6c'))[_0x6e48('0x70')](_0x6e48('0x7b'),_0x6e48('0x6d'))[_0x6e48('0x70')]('id','ContactId')[_0x6e48('0x70')](_0x3490da['CmListId'][_0x6e48('0x71')](),_0x6e48('0x7a'))[_0x6e48('0x70')](_0x45507e[_0x6e48('0x54')]['id'][_0x6e48('0x71')](),_0x6e48('0x59'))[_0x6e48('0x70')]('\x27'+_0x22bfac+'\x27',_0x6e48('0x51'))[_0x6e48('0x70')]('\x27'+_0x22bfac+'\x27',_0x6e48('0x52'))[_0x6e48('0x76')](_0x6e48('0x7c'))[_0x6e48('0x38')](_0x6e48('0x72'))[_0x6e48('0x38')](_0x6e48('0x73'),_0x3490da[_0x6e48('0x7d')][_0x6e48('0x71')]())[_0x6e48('0x38')]('phone\x20IS\x20NOT\x20NULL')[_0x6e48('0x38')]('phone\x20NOT\x20IN\x20(?)',squel[_0x6e48('0x6f')]()[_0x6e48('0x70')](_0x6e48('0x78'))['from']('cm_hopper')[_0x6e48('0x38')]('CampaignId\x20=\x20?',_0x45507e[_0x6e48('0x54')]['id'][_0x6e48('0x71')]())))[_0x6e48('0x71')]();break;default:_0xa2d90e=squel[_0x6e48('0x68')]()[_0x6e48('0x69')](_0x6e48('0x6a'))[_0x6e48('0x6b')]([_0x6e48('0x6c'),_0x6e48('0x6d'),'ContactId',_0x6e48('0x7a'),'CampaignId',_0x6e48('0x51'),_0x6e48('0x52')],squel[_0x6e48('0x6f')]()[_0x6e48('0x70')]('phone',_0x6e48('0x6c'))[_0x6e48('0x70')](_0x6e48('0x7b'),'scheduledAt')[_0x6e48('0x70')]('id',_0x6e48('0x6e'))[_0x6e48('0x70')](_0x3490da[_0x6e48('0x7d')]['toString'](),'ListId')['field'](_0x45507e['params']['id']['toString'](),'CampaignId')[_0x6e48('0x70')]('\x27'+_0x22bfac+'\x27',_0x6e48('0x51'))[_0x6e48('0x70')]('\x27'+_0x22bfac+'\x27','updatedAt')[_0x6e48('0x76')](_0x6e48('0x7c'))[_0x6e48('0x38')](_0x6e48('0x72'))[_0x6e48('0x38')](_0x6e48('0x73'),_0x3490da[_0x6e48('0x7d')]['toString']())[_0x6e48('0x38')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x3dc756=squel[_0x6e48('0x68')]()[_0x6e48('0x69')](_0x6e48('0x7e'))[_0x6e48('0x6b')](['cmHopperId',_0x6e48('0x6d'),_0x6e48('0x6c'),_0x6e48('0x7f'),_0x6e48('0x51'),'updatedAt'],squel[_0x6e48('0x6f')]()[_0x6e48('0x70')]('h.id','id')[_0x6e48('0x70')](_0x6e48('0x7b'),_0x6e48('0x6d'))['field'](_0x6e48('0x80'),'phone')[_0x6e48('0x70')](_0x6e48('0x81'),_0x6e48('0x7f'))[_0x6e48('0x70')]('\x27'+_0x22bfac+'\x27',_0x6e48('0x51'))[_0x6e48('0x70')]('\x27'+_0x22bfac+'\x27',_0x6e48('0x52'))['from'](_0x6e48('0x82'),'ci')['join'](_0x6e48('0x6a'),'h',_0x6e48('0x83'))['where'](_0x6e48('0x84'),_0x3490da[_0x6e48('0x7d')][_0x6e48('0x71')]())['where'](_0x6e48('0x85'),_0x45507e[_0x6e48('0x54')]['id']['toString']())[_0x6e48('0x38')](_0x6e48('0x86'),_0x22bfac))['toString']();_0x259261['push'](db[_0x6e48('0x87')]['query'](_0xa2d90e));_0x3313a5[_0x6e48('0x88')](db['sequelize'][_0x6e48('0x2f')](_0x3dc756));}return BPromise['all'](_0x259261);}})['then'](function(){return BPromise[_0x6e48('0x89')](_0x3313a5);})[_0x6e48('0x23')](function(){return _0x2616e5;})['then'](respondWithResult(_0x7e2923,null))[_0x6e48('0x3f')](handleError(_0x7e2923,null));};exports['removeLists']=function(_0x279414,_0x4a8b76,_0x1c44d0){return db[_0x6e48('0x3c')][_0x6e48('0x4a')]({'where':{'id':_0x279414[_0x6e48('0x54')]['id']}})[_0x6e48('0x23')](handleEntityNotFound(_0x4a8b76,null))[_0x6e48('0x23')](function(_0x36c8b6){if(_0x36c8b6){return _0x36c8b6[_0x6e48('0x8a')](_0x279414[_0x6e48('0x2f')]['ids']);}})[_0x6e48('0x23')](function(_0x14f8d4){if(_0x14f8d4){return db[_0x6e48('0x57')][_0x6e48('0x22')]({'where':{'ListId':_0x279414[_0x6e48('0x2f')][_0x6e48('0x65')],'CampaignId':_0x279414['params']['id']}})[_0x6e48('0x23')](function(){return _0x14f8d4;});}})[_0x6e48('0x23')](respondWithStatusCode(_0x4a8b76,null))['catch'](handleError(_0x4a8b76,null));};exports[_0x6e48('0x8b')]=function(_0x9707ba,_0x170e0f,_0x3a728e){var _0x1f5bef={};var _0x174734={};var _0x4530e3;var _0x2d278d;return db[_0x6e48('0x3c')]['findOne']({'where':{'id':_0x9707ba['params']['id']}})[_0x6e48('0x23')](handleEntityNotFound(_0x170e0f,null))[_0x6e48('0x23')](function(_0xb2b390){if(_0xb2b390){_0x4530e3=_0xb2b390;_0x174734[_0x6e48('0x2e')]=_[_0x6e48('0x41')](db['CmList'][_0x6e48('0x2b')]);_0x174734[_0x6e48('0x2f')]=_[_0x6e48('0x41')](_0x9707ba['query']);_0x174734[_0x6e48('0x30')]=_[_0x6e48('0x42')](_0x174734[_0x6e48('0x2e')],_0x174734[_0x6e48('0x2f')]);_0x1f5bef[_0x6e48('0x31')]=_[_0x6e48('0x42')](_0x174734[_0x6e48('0x2e')],qs['fields'](_0x9707ba[_0x6e48('0x2f')][_0x6e48('0x32')]));_0x1f5bef[_0x6e48('0x31')]=_0x1f5bef[_0x6e48('0x31')][_0x6e48('0x33')]?_0x1f5bef[_0x6e48('0x31')]:_0x174734[_0x6e48('0x2e')];_0x1f5bef['order']=qs[_0x6e48('0x37')](_0x9707ba['query'][_0x6e48('0x37')]);_0x1f5bef[_0x6e48('0x38')]=qs[_0x6e48('0x30')](_['pick'](_0x9707ba[_0x6e48('0x2f')],_0x174734['filters']));if(_0x9707ba['query'][_0x6e48('0x39')]){_0x1f5bef['where']=_[_0x6e48('0x3a')](_0x1f5bef[_0x6e48('0x38')],{'$or':_[_0x6e48('0x2a')](_0x1f5bef['attributes'],function(_0x294cf7){var _0x1fa5fe={};_0x1fa5fe[_0x294cf7]={'$like':'%'+_0x9707ba[_0x6e48('0x2f')][_0x6e48('0x39')]+'%'};return _0x1fa5fe;})});}_0x1f5bef=_['merge']({},_0x1f5bef,_0x9707ba[_0x6e48('0x50')]);return _0x4530e3[_0x6e48('0x8b')](_0x1f5bef);}})[_0x6e48('0x23')](function(_0x2878d0){if(_0x2878d0){_0x2d278d=_0x2878d0[_0x6e48('0x33')];if(!_0x9707ba['query']['hasOwnProperty'](_0x6e48('0x35'))){_0x1f5bef['limit']=qs['limit'](_0x9707ba[_0x6e48('0x2f')]['limit']);_0x1f5bef[_0x6e48('0x1b')]=qs[_0x6e48('0x1b')](_0x9707ba['query'][_0x6e48('0x1b')]);}return _0x4530e3['getBlackLists'](_0x1f5bef);}})[_0x6e48('0x23')](function(_0x393d36){if(_0x393d36){return _0x393d36?{'count':_0x2d278d,'rows':_0x393d36}:null;}})[_0x6e48('0x23')](respondWithResult(_0x170e0f,null))[_0x6e48('0x3f')](handleError(_0x170e0f,null));};exports[_0x6e48('0x8c')]=function(_0x472c6a,_0x188fc6,_0x3484d2){var _0x5110dc,_0x4cb295;var _0x33ff2a=[];var _0xf6f5b7=moment()[_0x6e48('0x8d')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x6e48('0x3c')][_0x6e48('0x4a')]({'where':{'id':_0x472c6a[_0x6e48('0x54')]['id']}})[_0x6e48('0x23')](handleEntityNotFound(_0x188fc6,null))[_0x6e48('0x23')](function(_0x18baa9){if(_0x18baa9){_0x4cb295=_0x18baa9;return _0x18baa9['addBlackLists'](_0x472c6a[_0x6e48('0x45')][_0x6e48('0x65')],_['omit'](_0x472c6a['body'],[_0x6e48('0x65'),'id'])||{});}return null;})[_0x6e48('0x8e')](function(_0x1bd026){var _0xb618eb;var _0x28e790;_0x5110dc=_0x1bd026||[];var _0x38b987=[];if(_0x1bd026){for(var _0xa376bb=0x0;_0xa376bb<_0x1bd026[_0x6e48('0x33')];_0xa376bb+=0x1){var _0x13eace=_0x1bd026[_0xa376bb]['get']({'plain':!![]});_0xb618eb=squel[_0x6e48('0x68')]()[_0x6e48('0x69')]('cm_hopper_black')[_0x6e48('0x6b')](['phone',_0x6e48('0x6e'),_0x6e48('0x7a'),_0x6e48('0x59'),'createdAt',_0x6e48('0x52')],squel[_0x6e48('0x6f')]()[_0x6e48('0x70')](_0x6e48('0x6c'),'phone')[_0x6e48('0x70')]('id',_0x6e48('0x6e'))[_0x6e48('0x70')](_0x13eace[_0x6e48('0x7d')][_0x6e48('0x71')](),_0x6e48('0x7a'))[_0x6e48('0x70')](_0x472c6a[_0x6e48('0x54')]['id'][_0x6e48('0x71')](),_0x6e48('0x59'))[_0x6e48('0x70')](_0x6e48('0x7b'),_0x6e48('0x51'))[_0x6e48('0x70')](_0x6e48('0x7b'),_0x6e48('0x52'))['from'](_0x6e48('0x7c'))[_0x6e48('0x38')](_0x6e48('0x72'))[_0x6e48('0x38')]('ListId\x20=\x20?',_0x13eace[_0x6e48('0x7d')][_0x6e48('0x71')]())[_0x6e48('0x38')](_0x6e48('0x74')))[_0x6e48('0x71')]();_0x38b987[_0x6e48('0x88')](db['sequelize'][_0x6e48('0x2f')](_0xb618eb));}return BPromise[_0x6e48('0x89')](_0x38b987);}})['then'](function(){return _0x5110dc;})[_0x6e48('0x23')](respondWithResult(_0x188fc6,null))[_0x6e48('0x3f')](handleError(_0x188fc6,null));};exports['removeBlackLists']=function(_0x2fe913,_0x336ea4,_0x5b4734){return db[_0x6e48('0x3c')][_0x6e48('0x4a')]({'where':{'id':_0x2fe913[_0x6e48('0x54')]['id']}})[_0x6e48('0x23')](handleEntityNotFound(_0x336ea4,null))[_0x6e48('0x23')](function(_0x276fbf){if(_0x276fbf){return _0x276fbf[_0x6e48('0x8f')](_0x2fe913[_0x6e48('0x2f')][_0x6e48('0x65')]);}})[_0x6e48('0x23')](function(_0x2d4b32){if(_0x2d4b32){return db['CmHopperBlack'][_0x6e48('0x22')]({'where':{'ListId':_0x2fe913['query'][_0x6e48('0x65')],'CampaignId':_0x2fe913[_0x6e48('0x54')]['id']}})['then'](function(){return _0x2d4b32;});}})[_0x6e48('0x23')](respondWithStatusCode(_0x336ea4,null))[_0x6e48('0x3f')](handleError(_0x336ea4,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 7de4975..5d5ccdd 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x45d809,_0x379b71){var _0x1fdd72=function(_0x57c7c5){while(--_0x57c7c5){_0x45d809['push'](_0x45d809['shift']());}};_0x1fdd72(++_0x379b71);}(_0x7a54,0x106));var _0x47a5=function(_0x5d2b94,_0x1f0128){_0x5d2b94=_0x5d2b94-0x0;var _0x1925a0=_0x7a54[_0x5d2b94];return _0x1925a0;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x3be1a7,_0x4bb8fe){var _0x4a6085=function(_0x3d97c6){while(--_0x3d97c6){_0x3be1a7['push'](_0x3be1a7['shift']());}};_0x4a6085(++_0x4bb8fe);}(_0x7a54,0x106));var _0x47a5=function(_0x261280,_0x2fe4cc){_0x261280=_0x261280-0x0;var _0x588b0=_0x7a54[_0x261280];return _0x588b0;};'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 ec9baad..e5b983d 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 _0xf9f7=['../../config/environment','jayson/promise','client','http','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetCampaign','Campaign','findAll','options','where','attributes','limit','include','map','model','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x5ab190,_0x444ff4){var _0x3097a2=function(_0x579a87){while(--_0x579a87){_0x5ab190['push'](_0x5ab190['shift']());}};_0x3097a2(++_0x444ff4);}(_0xf9f7,0xdf));var _0x7f9f=function(_0x39780c,_0x5782c9){_0x39780c=_0x39780c-0x0;var _0x53c19b=_0xf9f7[_0x39780c];return _0x53c19b;};'use strict';var _=require(_0x7f9f('0x0'));var util=require(_0x7f9f('0x1'));var moment=require(_0x7f9f('0x2'));var BPromise=require(_0x7f9f('0x3'));var rs=require(_0x7f9f('0x4'));var fs=require('fs');var Redis=require(_0x7f9f('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7f9f('0x6'))(_0x7f9f('0x7'));var config=require(_0x7f9f('0x8'));var jayson=require(_0x7f9f('0x9'));var client=jayson[_0x7f9f('0xa')][_0x7f9f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b5819,_0x37e39f,_0x3da87e){return new BPromise(function(_0x181328,_0x3e9e75){return client[_0x7f9f('0xc')](_0x5b5819,_0x3da87e)['then'](function(_0x3fda85){logger[_0x7f9f('0xd')](_0x7f9f('0xe'),_0x37e39f,_0x7f9f('0xf'));logger[_0x7f9f('0x10')](_0x7f9f('0x11'),_0x37e39f,_0x7f9f('0xf'),JSON['stringify'](_0x3fda85));if(_0x3fda85[_0x7f9f('0x12')]){if(_0x3fda85[_0x7f9f('0x12')]['code']===0x1f4){logger['error'](_0x7f9f('0xe'),_0x37e39f,_0x3fda85['error'][_0x7f9f('0x13')]);return _0x3e9e75(_0x3fda85[_0x7f9f('0x12')]['message']);}logger[_0x7f9f('0x12')]('Campaign,\x20%s,\x20%s',_0x37e39f,_0x3fda85[_0x7f9f('0x12')][_0x7f9f('0x13')]);return _0x181328(_0x3fda85[_0x7f9f('0x12')][_0x7f9f('0x13')]);}else{logger[_0x7f9f('0xd')]('Campaign,\x20%s,\x20%s',_0x37e39f,_0x7f9f('0xf'));_0x181328(_0x3fda85[_0x7f9f('0x14')]['message']);}})[_0x7f9f('0x15')](function(_0x4a36c8){logger[_0x7f9f('0x12')](_0x7f9f('0xe'),_0x37e39f,_0x4a36c8);_0x3e9e75(_0x4a36c8);});});}exports[_0x7f9f('0x16')]=function(_0x35f6b1){var _0x2d663e=this;return new Promise(function(_0x11e263,_0x47ae52){return db[_0x7f9f('0x17')][_0x7f9f('0x18')]({'raw':_0x35f6b1['options']?_0x35f6b1[_0x7f9f('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x35f6b1[_0x7f9f('0x19')]?_0x35f6b1[_0x7f9f('0x19')][_0x7f9f('0x1a')]||null:null,'attributes':_0x35f6b1[_0x7f9f('0x19')]?_0x35f6b1['options'][_0x7f9f('0x1b')]||null:null,'limit':_0x35f6b1['options']?_0x35f6b1['options'][_0x7f9f('0x1c')]||null:null,'include':_0x35f6b1[_0x7f9f('0x19')]?_0x35f6b1[_0x7f9f('0x19')][_0x7f9f('0x1d')]?_[_0x7f9f('0x1e')](_0x35f6b1['options']['include'],function(_0x3ec242){return{'model':db[_0x3ec242['model']],'as':_0x3ec242['as'],'attributes':_0x3ec242[_0x7f9f('0x1b')],'include':_0x3ec242[_0x7f9f('0x1d')]?_[_0x7f9f('0x1e')](_0x3ec242[_0x7f9f('0x1d')],function(_0x1a49a9){return{'model':db[_0x1a49a9[_0x7f9f('0x1f')]],'as':_0x1a49a9['as'],'attributes':_0x1a49a9['attributes'],'include':_0x1a49a9[_0x7f9f('0x1d')]?_['map'](_0x1a49a9[_0x7f9f('0x1d')],function(_0x3464f2){return{'model':db[_0x3464f2[_0x7f9f('0x1f')]],'as':_0x3464f2['as'],'attributes':_0x3464f2['attributes']};}):[]};}):[]};}):[]:[]})[_0x7f9f('0x20')](function(_0x3380d7){logger[_0x7f9f('0xd')]('GetCampaign',_0x35f6b1);logger[_0x7f9f('0x10')](_0x7f9f('0x16'),_0x35f6b1,JSON['stringify'](_0x3380d7));_0x11e263(_0x3380d7);})['catch'](function(_0x5e2428){logger[_0x7f9f('0x12')]('GetCampaign',_0x5e2428[_0x7f9f('0x13')],_0x35f6b1);_0x47ae52(_0x2d663e[_0x7f9f('0x12')](0x1f4,_0x5e2428['message']));});});};
\ No newline at end of file
+var _0x65f4=['raw','where','attributes','limit','include','map','model','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetCampaign','Campaign','options'];(function(_0x450fb7,_0x4b44c0){var _0x4f39c4=function(_0x3ecef6){while(--_0x3ecef6){_0x450fb7['push'](_0x450fb7['shift']());}};_0x4f39c4(++_0x4b44c0);}(_0x65f4,0x19a));var _0x465f=function(_0x106b7f,_0x28495a){_0x106b7f=_0x106b7f-0x0;var _0x5e722a=_0x65f4[_0x106b7f];return _0x5e722a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x465f('0x0'));var BPromise=require(_0x465f('0x1'));var rs=require(_0x465f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x465f('0x3'));var logger=require(_0x465f('0x4'))(_0x465f('0x5'));var config=require('../../config/environment');var jayson=require(_0x465f('0x6'));var client=jayson[_0x465f('0x7')][_0x465f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x553ce9,_0x1d4267,_0x5e26ea){return new BPromise(function(_0x523ca1,_0x41b261){return client[_0x465f('0x9')](_0x553ce9,_0x5e26ea)[_0x465f('0xa')](function(_0xc3d49d){logger[_0x465f('0xb')](_0x465f('0xc'),_0x1d4267,_0x465f('0xd'));logger[_0x465f('0xe')]('Campaign,\x20%s,\x20%s,\x20%s',_0x1d4267,_0x465f('0xd'),JSON[_0x465f('0xf')](_0xc3d49d));if(_0xc3d49d[_0x465f('0x10')]){if(_0xc3d49d[_0x465f('0x10')][_0x465f('0x11')]===0x1f4){logger[_0x465f('0x10')](_0x465f('0xc'),_0x1d4267,_0xc3d49d[_0x465f('0x10')][_0x465f('0x12')]);return _0x41b261(_0xc3d49d['error']['message']);}logger[_0x465f('0x10')](_0x465f('0xc'),_0x1d4267,_0xc3d49d[_0x465f('0x10')][_0x465f('0x12')]);return _0x523ca1(_0xc3d49d['error'][_0x465f('0x12')]);}else{logger[_0x465f('0xb')]('Campaign,\x20%s,\x20%s',_0x1d4267,'request\x20sent');_0x523ca1(_0xc3d49d[_0x465f('0x13')][_0x465f('0x12')]);}})[_0x465f('0x14')](function(_0xf38782){logger[_0x465f('0x10')]('Campaign,\x20%s,\x20%s',_0x1d4267,_0xf38782);_0x41b261(_0xf38782);});});}exports[_0x465f('0x15')]=function(_0x99845e){var _0x331e45=this;return new Promise(function(_0x5d469c,_0x119227){return db[_0x465f('0x16')]['findAll']({'raw':_0x99845e[_0x465f('0x17')]?_0x99845e['options'][_0x465f('0x18')]===undefined?!![]:![]:!![],'where':_0x99845e[_0x465f('0x17')]?_0x99845e[_0x465f('0x17')][_0x465f('0x19')]||null:null,'attributes':_0x99845e[_0x465f('0x17')]?_0x99845e[_0x465f('0x17')][_0x465f('0x1a')]||null:null,'limit':_0x99845e[_0x465f('0x17')]?_0x99845e[_0x465f('0x17')][_0x465f('0x1b')]||null:null,'include':_0x99845e[_0x465f('0x17')]?_0x99845e['options'][_0x465f('0x1c')]?_[_0x465f('0x1d')](_0x99845e[_0x465f('0x17')][_0x465f('0x1c')],function(_0x1d6677){return{'model':db[_0x1d6677[_0x465f('0x1e')]],'as':_0x1d6677['as'],'attributes':_0x1d6677[_0x465f('0x1a')],'include':_0x1d6677[_0x465f('0x1c')]?_[_0x465f('0x1d')](_0x1d6677[_0x465f('0x1c')],function(_0x59ace5){return{'model':db[_0x59ace5[_0x465f('0x1e')]],'as':_0x59ace5['as'],'attributes':_0x59ace5[_0x465f('0x1a')],'include':_0x59ace5['include']?_['map'](_0x59ace5[_0x465f('0x1c')],function(_0x3cd248){return{'model':db[_0x3cd248[_0x465f('0x1e')]],'as':_0x3cd248['as'],'attributes':_0x3cd248[_0x465f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x465f('0xa')](function(_0x191ada){logger[_0x465f('0xb')](_0x465f('0x15'),_0x99845e);logger[_0x465f('0xe')](_0x465f('0x15'),_0x99845e,JSON['stringify'](_0x191ada));_0x5d469c(_0x191ada);})[_0x465f('0x14')](function(_0x3ad80e){logger['error'](_0x465f('0x15'),_0x3ad80e['message'],_0x99845e);_0x119227(_0x331e45[_0x465f('0x10')](0x1f4,_0x3ad80e['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 365e4bf..d6a017d 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 _0x5156=['put','/:id','update','delete','destroy','removeLists','removeBlackLists','util','path','../../config/environment','./campaign.controller','get','isAuthenticated','show','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/lists','getLists','/:id/blacklists','create','post','clone','addLists','addBlackLists'];(function(_0x2a0a76,_0x465cd3){var _0x1cd3d6=function(_0x2ea610){while(--_0x2ea610){_0x2a0a76['push'](_0x2a0a76['shift']());}};_0x1cd3d6(++_0x465cd3);}(_0x5156,0xf1));var _0x6515=function(_0x54c9dd,_0x233a86){_0x54c9dd=_0x54c9dd-0x0;var _0x855156=_0x5156[_0x54c9dd];return _0x855156;};'use strict';var multer=require('multer');var util=require(_0x6515('0x0'));var path=require(_0x6515('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6515('0x2'));var controller=require(_0x6515('0x3'));router[_0x6515('0x4')]('/',auth[_0x6515('0x5')](),controller['index']);router[_0x6515('0x4')]('/:id',auth[_0x6515('0x5')](),controller[_0x6515('0x6')]);router['get']('/:id/hoppers',auth['isAuthenticated'](),controller[_0x6515('0x7')]);router[_0x6515('0x4')]('/:id/hopper_histories',auth[_0x6515('0x5')](),controller[_0x6515('0x8')]);router[_0x6515('0x4')](_0x6515('0x9'),auth[_0x6515('0x5')](),controller[_0x6515('0xa')]);router[_0x6515('0x4')]('/:id/hopper_black',auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0x6515('0x4')](_0x6515('0xb'),auth[_0x6515('0x5')](),controller[_0x6515('0xc')]);router['get'](_0x6515('0xd'),auth['isAuthenticated'](),controller['getBlackLists']);router['post']('/',auth[_0x6515('0x5')](),controller[_0x6515('0xe')]);router[_0x6515('0xf')]('/:id/clone',auth['isAuthenticated'](),controller[_0x6515('0x10')]);router[_0x6515('0xf')](_0x6515('0xb'),auth[_0x6515('0x5')](),controller[_0x6515('0x11')]);router['post'](_0x6515('0xd'),auth[_0x6515('0x5')](),controller[_0x6515('0x12')]);router[_0x6515('0x13')](_0x6515('0x14'),auth[_0x6515('0x5')](),controller[_0x6515('0x15')]);router[_0x6515('0x16')](_0x6515('0x14'),auth[_0x6515('0x5')](),controller[_0x6515('0x17')]);router[_0x6515('0x16')](_0x6515('0xb'),auth[_0x6515('0x5')](),controller[_0x6515('0x18')]);router['delete'](_0x6515('0xd'),auth[_0x6515('0x5')](),controller[_0x6515('0x19')]);module['exports']=router;
\ No newline at end of file
+var _0xa98d=['addBlackLists','update','delete','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','index','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists'];(function(_0x2ece30,_0x32344a){var _0xe29a92=function(_0x14dd75){while(--_0x14dd75){_0x2ece30['push'](_0x2ece30['shift']());}};_0xe29a92(++_0x32344a);}(_0xa98d,0x171));var _0xda98=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa98d[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xda98('0x0'));var util=require(_0xda98('0x1'));var path=require(_0xda98('0x2'));var timeout=require(_0xda98('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xda98('0x4'));var auth=require(_0xda98('0x5'));var interaction=require(_0xda98('0x6'));var config=require('../../config/environment');var controller=require(_0xda98('0x7'));router[_0xda98('0x8')]('/',auth['isAuthenticated'](),controller[_0xda98('0x9')]);router[_0xda98('0x8')](_0xda98('0xa'),auth[_0xda98('0xb')](),controller[_0xda98('0xc')]);router['get'](_0xda98('0xd'),auth[_0xda98('0xb')](),controller[_0xda98('0xe')]);router['get'](_0xda98('0xf'),auth['isAuthenticated'](),controller[_0xda98('0x10')]);router[_0xda98('0x8')](_0xda98('0x11'),auth[_0xda98('0xb')](),controller['getHopperFinals']);router[_0xda98('0x8')](_0xda98('0x12'),auth[_0xda98('0xb')](),controller['getHopperBlacks']);router[_0xda98('0x8')](_0xda98('0x13'),auth[_0xda98('0xb')](),controller['getLists']);router[_0xda98('0x8')](_0xda98('0x14'),auth[_0xda98('0xb')](),controller[_0xda98('0x15')]);router[_0xda98('0x16')]('/',auth[_0xda98('0xb')](),controller[_0xda98('0x17')]);router[_0xda98('0x16')](_0xda98('0x18'),auth[_0xda98('0xb')](),controller[_0xda98('0x19')]);router[_0xda98('0x16')]('/:id/lists',auth[_0xda98('0xb')](),controller[_0xda98('0x1a')]);router[_0xda98('0x16')](_0xda98('0x14'),auth['isAuthenticated'](),controller[_0xda98('0x1b')]);router['put']('/:id',auth[_0xda98('0xb')](),controller[_0xda98('0x1c')]);router[_0xda98('0x1d')]('/:id',auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xda98('0x13'),auth[_0xda98('0xb')](),controller[_0xda98('0x1e')]);router[_0xda98('0x1d')](_0xda98('0x14'),auth[_0xda98('0xb')](),controller[_0xda98('0x1f')]);module[_0xda98('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 4da711b..e6fa4d1 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 _0x214a=['VIRTUAL','getDataValue','key','sequelize','TEXT','medium','STRING'];(function(_0x254c4e,_0x50c941){var _0x327c37=function(_0x406fcb){while(--_0x406fcb){_0x254c4e['push'](_0x254c4e['shift']());}};_0x327c37(++_0x50c941);}(_0x214a,0xff));var _0xa214=function(_0x408755,_0x44dc8d){_0x408755=_0x408755-0x0;var _0x48baf4=_0x214a[_0x408755];return _0x48baf4;};'use strict';var Sequelize=require(_0xa214('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xa214('0x1')],'length':_0xa214('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xa214('0x3')]},'name':{'type':Sequelize[_0xa214('0x4')],'get':function(){return this[_0xa214('0x5')](_0xa214('0x6'));}}};
\ No newline at end of file
+var _0x21f4=['TEXT','getDataValue','key','sequelize','STRING'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x21f4,0x148));var _0x421f=function(_0x3904e5,_0x2199f1){_0x3904e5=_0x3904e5-0x0;var _0x47f175=_0x21f4[_0x3904e5];return _0x47f175;};'use strict';var Sequelize=require(_0x421f('0x0'));module['exports']={'key':{'type':Sequelize[_0x421f('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x421f('0x2')],'length':'medium','allowNull':![]},'description':{'type':Sequelize[_0x421f('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x421f('0x3')](_0x421f('0x4'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 6523905..097f192 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 _0x084f=['jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','undefined','count','set','json','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','keys','update','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x44caf4,_0x238750){var _0x117cad=function(_0x3e64c8){while(--_0x3e64c8){_0x44caf4['push'](_0x44caf4['shift']());}};_0x117cad(++_0x238750);}(_0x084f,0x158));var _0xf084=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x084f[_0x484e36];return _0xafc85d;};'use strict';var emlformat=require(_0xf084('0x0'));var rimraf=require(_0xf084('0x1'));var zipdir=require(_0xf084('0x2'));var jsonpatch=require(_0xf084('0x3'));var rp=require(_0xf084('0x4'));var moment=require(_0xf084('0x5'));var BPromise=require(_0xf084('0x6'));var Mustache=require(_0xf084('0x7'));var util=require(_0xf084('0x8'));var path=require('path');var sox=require(_0xf084('0x9'));var csv=require(_0xf084('0xa'));var ejs=require(_0xf084('0xb'));var fs=require('fs');var fs_extra=require(_0xf084('0xc'));var _=require(_0xf084('0xd'));var squel=require(_0xf084('0xe'));var crypto=require(_0xf084('0xf'));var jsforce=require(_0xf084('0x10'));var deskjs=require(_0xf084('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf084('0x12'));var Redis=require(_0xf084('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xf084('0x14'));var as=require(_0xf084('0x15'));var hardwareService=require(_0xf084('0x16'));var logger=require(_0xf084('0x17'))(_0xf084('0x18'));var utils=require(_0xf084('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xf084('0x1a'));var db=require(_0xf084('0x1b'))['db'];function respondWithStatusCode(_0x11b1fc,_0x5e5e8e){_0x5e5e8e=_0x5e5e8e||0xcc;return function(_0x2f8db0){if(_0x2f8db0){return _0x11b1fc['sendStatus'](_0x5e5e8e);}return _0x11b1fc[_0xf084('0x1c')](_0x5e5e8e)[_0xf084('0x1d')]();};}function respondWithResult(_0x4d7148,_0x4597f0){_0x4597f0=_0x4597f0||0xc8;return function(_0x4f7b2d){if(_0x4f7b2d){return _0x4d7148[_0xf084('0x1c')](_0x4597f0)['json'](_0x4f7b2d);}};}function respondWithFilteredResult(_0x5a227f,_0x5bc27b){return function(_0x42706e){if(_0x42706e){var _0x21143f=typeof _0x5bc27b['offset']===_0xf084('0x1e')&&typeof _0x5bc27b['limit']==='undefined';var _0x5f2cd6=_0x42706e['count'];var _0x65e268=_0x21143f?0x0:_0x5bc27b['offset'];var _0x15180a=_0x21143f?_0x42706e[_0xf084('0x1f')]:_0x5bc27b['offset']+_0x5bc27b['limit'];var _0x2cff16;if(_0x15180a>=_0x5f2cd6){_0x15180a=_0x5f2cd6;_0x2cff16=0xc8;}else{_0x2cff16=0xce;}_0x5a227f[_0xf084('0x1c')](_0x2cff16);return _0x5a227f[_0xf084('0x20')]('Content-Range',_0x65e268+'-'+_0x15180a+'/'+_0x5f2cd6)[_0xf084('0x21')](_0x42706e);}return null;};}function patchUpdates(_0x7415b5){return function(_0x161713){try{jsonpatch['apply'](_0x161713,_0x7415b5,!![]);}catch(_0xfa6df0){return BPromise[_0xf084('0x22')](_0xfa6df0);}return _0x161713[_0xf084('0x23')]();};}function saveUpdates(_0x39b57e,_0x591fa8){return function(_0x49ad1a){if(_0x49ad1a){return _0x49ad1a['update'](_0x39b57e)[_0xf084('0x24')](function(_0x39efd9){return _0x39efd9;});}return null;};}function removeEntity(_0x164872,_0x45b9e9){return function(_0x1ef2dc){if(_0x1ef2dc){return _0x1ef2dc[_0xf084('0x25')]()[_0xf084('0x24')](function(){var _0x395068=_0x1ef2dc[_0xf084('0x26')]({'plain':!![]});var _0xe6d8bc=_0xf084('0x27');return db[_0xf084('0x28')]['destroy']({'where':{'type':_0xe6d8bc,'resourceId':_0x395068['id']}})[_0xf084('0x24')](function(){return _0x1ef2dc;});})['then'](function(){_0x164872['status'](0xcc)[_0xf084('0x1d')]();});}};}function handleEntityNotFound(_0x4fdd33,_0x3e6a68){return function(_0x2d5a44){if(!_0x2d5a44){_0x4fdd33['sendStatus'](0x194);}return _0x2d5a44;};}function handleError(_0x3ff3a3,_0xc9ae19){_0xc9ae19=_0xc9ae19||0x1f4;return function(_0xef56b2){logger['error'](_0xef56b2[_0xf084('0x29')]);if(_0xef56b2[_0xf084('0x2a')]){delete _0xef56b2['name'];}_0x3ff3a3[_0xf084('0x1c')](_0xc9ae19)[_0xf084('0x2b')](_0xef56b2);};}exports[_0xf084('0x2c')]=function(_0x42d1c5,_0x39209c){var _0x5f2acd={},_0x30885c={},_0x395331={'count':0x0,'rows':[]};var _0x2da5d9=_[_0xf084('0x2d')](db[_0xf084('0x2e')][_0xf084('0x2f')],function(_0x51501f){return{'name':_0x51501f[_0xf084('0x30')],'type':_0x51501f[_0xf084('0x31')][_0xf084('0x32')]};});_0x30885c[_0xf084('0x33')]=_[_0xf084('0x2d')](_0x2da5d9,_0xf084('0x2a'));_0x30885c[_0xf084('0x34')]=_['keys'](_0x42d1c5['query']);_0x30885c[_0xf084('0x35')]=_['intersection'](_0x30885c[_0xf084('0x33')],_0x30885c[_0xf084('0x34')]);_0x5f2acd[_0xf084('0x36')]=_[_0xf084('0x37')](_0x30885c[_0xf084('0x33')],qs[_0xf084('0x38')](_0x42d1c5[_0xf084('0x34')]['fields']));_0x5f2acd[_0xf084('0x36')]=_0x5f2acd['attributes']['length']?_0x5f2acd[_0xf084('0x36')]:_0x30885c[_0xf084('0x33')];if(!_0x42d1c5[_0xf084('0x34')][_0xf084('0x39')](_0xf084('0x3a'))){_0x5f2acd[_0xf084('0x3b')]=qs[_0xf084('0x3b')](_0x42d1c5['query'][_0xf084('0x3b')]);_0x5f2acd[_0xf084('0x3c')]=qs[_0xf084('0x3c')](_0x42d1c5[_0xf084('0x34')][_0xf084('0x3c')]);}_0x5f2acd[_0xf084('0x3d')]=qs[_0xf084('0x3e')](_0x42d1c5[_0xf084('0x34')][_0xf084('0x3e')]);_0x5f2acd[_0xf084('0x3f')]=qs[_0xf084('0x35')](_[_0xf084('0x40')](_0x42d1c5['query'],_0x30885c[_0xf084('0x35')]),_0x2da5d9);if(_0x42d1c5['query'][_0xf084('0x41')]){_0x5f2acd[_0xf084('0x3f')]=_[_0xf084('0x42')](_0x5f2acd[_0xf084('0x3f')],{'$or':[{'key':{'$like':'%'+_0x42d1c5[_0xf084('0x34')][_0xf084('0x41')]+'%'}},{'value':{'$like':'%'+_0x42d1c5[_0xf084('0x34')][_0xf084('0x41')]+'%'}}]});}_0x5f2acd=_['merge']({},_0x5f2acd,_0x42d1c5[_0xf084('0x43')]);var _0x2508da={'where':_0x5f2acd[_0xf084('0x3f')]};return db[_0xf084('0x2e')][_0xf084('0x1f')](_0x2508da)[_0xf084('0x24')](function(_0x2a3bf8){_0x395331[_0xf084('0x1f')]=_0x2a3bf8;if(_0x42d1c5['query'][_0xf084('0x44')]){_0x5f2acd[_0xf084('0x45')]=[{'all':!![]}];}return db[_0xf084('0x2e')][_0xf084('0x46')](_0x5f2acd);})[_0xf084('0x24')](function(_0x2e7c7f){_0x395331['rows']=_0x2e7c7f;return _0x395331;})[_0xf084('0x24')](respondWithFilteredResult(_0x39209c,_0x5f2acd))[_0xf084('0x47')](handleError(_0x39209c,null));};exports[_0xf084('0x48')]=function(_0x316c06,_0x223e8d){var _0x3e0590={'raw':!![],'where':{'id':_0x316c06[_0xf084('0x49')]['id']}},_0x3eafa4={};_0x3eafa4[_0xf084('0x33')]=_[_0xf084('0x4a')](db[_0xf084('0x2e')][_0xf084('0x2f')]);_0x3eafa4[_0xf084('0x34')]=_['keys'](_0x316c06[_0xf084('0x34')]);_0x3eafa4['filters']=_['intersection'](_0x3eafa4[_0xf084('0x33')],_0x3eafa4[_0xf084('0x34')]);_0x3e0590[_0xf084('0x36')]=_['intersection'](_0x3eafa4[_0xf084('0x33')],qs['fields'](_0x316c06[_0xf084('0x34')][_0xf084('0x38')]));_0x3e0590[_0xf084('0x36')]=_0x3e0590['attributes']['length']?_0x3e0590[_0xf084('0x36')]:_0x3eafa4['model'];if(_0x316c06[_0xf084('0x34')][_0xf084('0x44')]){_0x3e0590[_0xf084('0x45')]=[{'all':!![]}];}_0x3e0590=_['merge']({},_0x3e0590,_0x316c06[_0xf084('0x43')]);return db[_0xf084('0x2e')]['find'](_0x3e0590)[_0xf084('0x24')](handleEntityNotFound(_0x223e8d,null))[_0xf084('0x24')](respondWithResult(_0x223e8d,null))[_0xf084('0x47')](handleError(_0x223e8d,null));};exports[_0xf084('0x4b')]=function(_0x5c6109,_0x4e82c9){if(_0x5c6109[_0xf084('0x4c')]['id']){delete _0x5c6109[_0xf084('0x4c')]['id'];}return db[_0xf084('0x2e')][_0xf084('0x4d')]({'where':{'id':_0x5c6109['params']['id']}})[_0xf084('0x24')](handleEntityNotFound(_0x4e82c9,null))[_0xf084('0x24')](saveUpdates(_0x5c6109[_0xf084('0x4c')],null))['then'](respondWithResult(_0x4e82c9,null))[_0xf084('0x47')](handleError(_0x4e82c9,null));};exports[_0xf084('0x25')]=function(_0x100282,_0x1a177e){return db[_0xf084('0x2e')][_0xf084('0x4d')]({'where':{'id':_0x100282['params']['id']}})['then'](handleEntityNotFound(_0x1a177e,null))[_0xf084('0x24')](removeEntity(_0x1a177e,null))[_0xf084('0x47')](handleError(_0x1a177e,null));};exports[_0xf084('0x4e')]=function(_0x292904,_0x5716ed){var _0x5001ca={'key':_0x292904[_0xf084('0x4c')]['key']};if(_0x292904[_0xf084('0x4c')][_0xf084('0x4f')]){_0x5001ca[_0xf084('0x4f')]=_0x292904['body'][_0xf084('0x4f')];}else if(_0x292904['body'][_0xf084('0x50')]){_0x5001ca[_0xf084('0x50')]=_0x292904[_0xf084('0x4c')][_0xf084('0x50')];}else if(_0x292904['body'][_0xf084('0x51')]){_0x5001ca[_0xf084('0x51')]=_0x292904[_0xf084('0x4c')][_0xf084('0x51')];}else if(_0x292904['body'][_0xf084('0x52')]){_0x5001ca[_0xf084('0x52')]=_0x292904[_0xf084('0x4c')][_0xf084('0x52')];}return db[_0xf084('0x2e')][_0xf084('0x4d')]({'where':_0x5001ca})['then'](function(_0x3e259a){if(_0x3e259a){throw new db[(_0xf084('0x53'))]['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xf084('0x2e')]['create'](_0x292904[_0xf084('0x4c')]);})[_0xf084('0x24')](function(_0x429a4b){var _0x5135e0=_0x292904[_0xf084('0x54')][_0xf084('0x26')]({'plain':!![]});if(!_0x5135e0)throw new Error(_0xf084('0x55'));if(_0x5135e0['role']==='user'){var _0x16d30d=_0x429a4b[_0xf084('0x26')]({'plain':!![]});return db['UserProfileSection'][_0xf084('0x4d')]({'where':{'name':'CannedAnswers','userProfileId':_0x5135e0[_0xf084('0x56')]},'raw':!![]})[_0xf084('0x24')](function(_0xa26e6e){if(_0xa26e6e&&_0xa26e6e[_0xf084('0x57')]===0x0){return db[_0xf084('0x28')]['create']({'name':_0x16d30d[_0xf084('0x2a')],'resourceId':_0x16d30d['id'],'type':_0xa26e6e[_0xf084('0x2a')],'sectionId':_0xa26e6e['id']},{})[_0xf084('0x24')](function(){return _0x429a4b;});}else{return _0x429a4b;}})['catch'](function(_0x59c51e){logger[_0xf084('0x58')](_0xf084('0x59'),_0x59c51e);throw _0x59c51e;});}return _0x429a4b;})[_0xf084('0x24')](respondWithResult(_0x5716ed,0xc9))[_0xf084('0x47')](handleError(_0x5716ed,null));};
\ No newline at end of file
+var _0x9ff9=['Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','then','destroy','get','CannedAnswers','UserProfileResource','end','error','stack','name','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','keys','query','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','options','includeAll','include','findAll','rows','catch','show','params','intersection','merge','find','update','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x9ff9,0x1cc));var _0x99ff=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x9ff9[_0x4fc9e6];return _0x551d28;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x99ff('0x0'));var zipdir=require(_0x99ff('0x1'));var jsonpatch=require(_0x99ff('0x2'));var rp=require(_0x99ff('0x3'));var moment=require(_0x99ff('0x4'));var BPromise=require(_0x99ff('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x99ff('0x6'));var sox=require(_0x99ff('0x7'));var csv=require(_0x99ff('0x8'));var ejs=require(_0x99ff('0x9'));var fs=require('fs');var fs_extra=require(_0x99ff('0xa'));var _=require('lodash');var squel=require(_0x99ff('0xb'));var crypto=require(_0x99ff('0xc'));var jsforce=require(_0x99ff('0xd'));var deskjs=require(_0x99ff('0xe'));var toCsv=require(_0x99ff('0x8'));var querystring=require(_0x99ff('0xf'));var Papa=require(_0x99ff('0x10'));var Redis=require('ioredis');var authService=require(_0x99ff('0x11'));var qs=require(_0x99ff('0x12'));var as=require(_0x99ff('0x13'));var hardwareService=require(_0x99ff('0x14'));var logger=require(_0x99ff('0x15'))(_0x99ff('0x16'));var utils=require(_0x99ff('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x99ff('0x18'))['db'];function respondWithStatusCode(_0x32469d,_0x5294ad){_0x5294ad=_0x5294ad||0xcc;return function(_0x1c4ceb){if(_0x1c4ceb){return _0x32469d[_0x99ff('0x19')](_0x5294ad);}return _0x32469d[_0x99ff('0x1a')](_0x5294ad)['end']();};}function respondWithResult(_0x42f596,_0x59e9ac){_0x59e9ac=_0x59e9ac||0xc8;return function(_0x4c6724){if(_0x4c6724){return _0x42f596['status'](_0x59e9ac)[_0x99ff('0x1b')](_0x4c6724);}};}function respondWithFilteredResult(_0x4d5302,_0x27ba9f){return function(_0x12c277){if(_0x12c277){var _0x6b4d9c=typeof _0x27ba9f[_0x99ff('0x1c')]===_0x99ff('0x1d')&&typeof _0x27ba9f[_0x99ff('0x1e')]===_0x99ff('0x1d');var _0x3f4afa=_0x12c277[_0x99ff('0x1f')];var _0x20548f=_0x6b4d9c?0x0:_0x27ba9f['offset'];var _0x1b500b=_0x6b4d9c?_0x12c277[_0x99ff('0x1f')]:_0x27ba9f[_0x99ff('0x1c')]+_0x27ba9f[_0x99ff('0x1e')];var _0x48d91f;if(_0x1b500b>=_0x3f4afa){_0x1b500b=_0x3f4afa;_0x48d91f=0xc8;}else{_0x48d91f=0xce;}_0x4d5302['status'](_0x48d91f);return _0x4d5302['set'](_0x99ff('0x20'),_0x20548f+'-'+_0x1b500b+'/'+_0x3f4afa)[_0x99ff('0x1b')](_0x12c277);}return null;};}function patchUpdates(_0x4aeb06){return function(_0x25066a){try{jsonpatch['apply'](_0x25066a,_0x4aeb06,!![]);}catch(_0x38fcb4){return BPromise[_0x99ff('0x21')](_0x38fcb4);}return _0x25066a['save']();};}function saveUpdates(_0x3dd662,_0x4ab7d0){return function(_0x4bc276){if(_0x4bc276){return _0x4bc276['update'](_0x3dd662)[_0x99ff('0x22')](function(_0x533c26){return _0x533c26;});}return null;};}function removeEntity(_0x56ed97,_0x54fe72){return function(_0x1ea5c9){if(_0x1ea5c9){return _0x1ea5c9[_0x99ff('0x23')]()['then'](function(){var _0x114f5d=_0x1ea5c9[_0x99ff('0x24')]({'plain':!![]});var _0x541162=_0x99ff('0x25');return db[_0x99ff('0x26')][_0x99ff('0x23')]({'where':{'type':_0x541162,'resourceId':_0x114f5d['id']}})[_0x99ff('0x22')](function(){return _0x1ea5c9;});})[_0x99ff('0x22')](function(){_0x56ed97['status'](0xcc)[_0x99ff('0x27')]();});}};}function handleEntityNotFound(_0x5b0963,_0x6cf44b){return function(_0x147d5e){if(!_0x147d5e){_0x5b0963[_0x99ff('0x19')](0x194);}return _0x147d5e;};}function handleError(_0x419710,_0x4e6e4d){_0x4e6e4d=_0x4e6e4d||0x1f4;return function(_0x453c7b){logger[_0x99ff('0x28')](_0x453c7b[_0x99ff('0x29')]);if(_0x453c7b[_0x99ff('0x2a')]){delete _0x453c7b[_0x99ff('0x2a')];}_0x419710[_0x99ff('0x1a')](_0x4e6e4d)['send'](_0x453c7b);};}exports[_0x99ff('0x2b')]=function(_0x2ba7cb,_0x2869bd){var _0x1b95c3={},_0x22c368={},_0x25478a={'count':0x0,'rows':[]};var _0x18e19a=_[_0x99ff('0x2c')](db[_0x99ff('0x2d')][_0x99ff('0x2e')],function(_0x9a298c){return{'name':_0x9a298c[_0x99ff('0x2f')],'type':_0x9a298c[_0x99ff('0x30')][_0x99ff('0x31')]};});_0x22c368[_0x99ff('0x32')]=_['map'](_0x18e19a,'name');_0x22c368['query']=_[_0x99ff('0x33')](_0x2ba7cb['query']);_0x22c368['filters']=_['intersection'](_0x22c368[_0x99ff('0x32')],_0x22c368[_0x99ff('0x34')]);_0x1b95c3['attributes']=_['intersection'](_0x22c368[_0x99ff('0x32')],qs[_0x99ff('0x35')](_0x2ba7cb[_0x99ff('0x34')][_0x99ff('0x35')]));_0x1b95c3[_0x99ff('0x36')]=_0x1b95c3[_0x99ff('0x36')]['length']?_0x1b95c3['attributes']:_0x22c368[_0x99ff('0x32')];if(!_0x2ba7cb[_0x99ff('0x34')][_0x99ff('0x37')](_0x99ff('0x38'))){_0x1b95c3['limit']=qs[_0x99ff('0x1e')](_0x2ba7cb['query'][_0x99ff('0x1e')]);_0x1b95c3['offset']=qs[_0x99ff('0x1c')](_0x2ba7cb[_0x99ff('0x34')]['offset']);}_0x1b95c3[_0x99ff('0x39')]=qs['sort'](_0x2ba7cb['query'][_0x99ff('0x3a')]);_0x1b95c3[_0x99ff('0x3b')]=qs['filters'](_[_0x99ff('0x3c')](_0x2ba7cb[_0x99ff('0x34')],_0x22c368[_0x99ff('0x3d')]),_0x18e19a);if(_0x2ba7cb['query'][_0x99ff('0x3e')]){_0x1b95c3[_0x99ff('0x3b')]=_['merge'](_0x1b95c3[_0x99ff('0x3b')],{'$or':[{'key':{'$like':'%'+_0x2ba7cb['query'][_0x99ff('0x3e')]+'%'}},{'value':{'$like':'%'+_0x2ba7cb[_0x99ff('0x34')][_0x99ff('0x3e')]+'%'}}]});}_0x1b95c3=_['merge']({},_0x1b95c3,_0x2ba7cb[_0x99ff('0x3f')]);var _0x3dc211={'where':_0x1b95c3[_0x99ff('0x3b')]};return db[_0x99ff('0x2d')][_0x99ff('0x1f')](_0x3dc211)['then'](function(_0x2cec03){_0x25478a[_0x99ff('0x1f')]=_0x2cec03;if(_0x2ba7cb['query'][_0x99ff('0x40')]){_0x1b95c3[_0x99ff('0x41')]=[{'all':!![]}];}return db['CannedAnswer'][_0x99ff('0x42')](_0x1b95c3);})[_0x99ff('0x22')](function(_0x42a3c5){_0x25478a[_0x99ff('0x43')]=_0x42a3c5;return _0x25478a;})[_0x99ff('0x22')](respondWithFilteredResult(_0x2869bd,_0x1b95c3))[_0x99ff('0x44')](handleError(_0x2869bd,null));};exports[_0x99ff('0x45')]=function(_0x3a1e99,_0x3cabdc){var _0x3329ea={'raw':!![],'where':{'id':_0x3a1e99[_0x99ff('0x46')]['id']}},_0x2ff833={};_0x2ff833[_0x99ff('0x32')]=_[_0x99ff('0x33')](db[_0x99ff('0x2d')]['rawAttributes']);_0x2ff833[_0x99ff('0x34')]=_[_0x99ff('0x33')](_0x3a1e99[_0x99ff('0x34')]);_0x2ff833[_0x99ff('0x3d')]=_['intersection'](_0x2ff833['model'],_0x2ff833[_0x99ff('0x34')]);_0x3329ea[_0x99ff('0x36')]=_[_0x99ff('0x47')](_0x2ff833['model'],qs[_0x99ff('0x35')](_0x3a1e99[_0x99ff('0x34')][_0x99ff('0x35')]));_0x3329ea['attributes']=_0x3329ea[_0x99ff('0x36')]['length']?_0x3329ea[_0x99ff('0x36')]:_0x2ff833[_0x99ff('0x32')];if(_0x3a1e99[_0x99ff('0x34')][_0x99ff('0x40')]){_0x3329ea[_0x99ff('0x41')]=[{'all':!![]}];}_0x3329ea=_[_0x99ff('0x48')]({},_0x3329ea,_0x3a1e99[_0x99ff('0x3f')]);return db['CannedAnswer'][_0x99ff('0x49')](_0x3329ea)[_0x99ff('0x22')](handleEntityNotFound(_0x3cabdc,null))['then'](respondWithResult(_0x3cabdc,null))['catch'](handleError(_0x3cabdc,null));};exports[_0x99ff('0x4a')]=function(_0x1ba00b,_0xa59f01){if(_0x1ba00b['body']['id']){delete _0x1ba00b[_0x99ff('0x4b')]['id'];}return db[_0x99ff('0x2d')]['find']({'where':{'id':_0x1ba00b[_0x99ff('0x46')]['id']}})[_0x99ff('0x22')](handleEntityNotFound(_0xa59f01,null))['then'](saveUpdates(_0x1ba00b[_0x99ff('0x4b')],null))[_0x99ff('0x22')](respondWithResult(_0xa59f01,null))[_0x99ff('0x44')](handleError(_0xa59f01,null));};exports[_0x99ff('0x23')]=function(_0x53e23c,_0x84ea3e){return db[_0x99ff('0x2d')][_0x99ff('0x49')]({'where':{'id':_0x53e23c['params']['id']}})[_0x99ff('0x22')](handleEntityNotFound(_0x84ea3e,null))['then'](removeEntity(_0x84ea3e,null))[_0x99ff('0x44')](handleError(_0x84ea3e,null));};exports['create']=function(_0x5a581,_0x154b69){var _0x14f23a={'key':_0x5a581[_0x99ff('0x4b')]['key']};if(_0x5a581[_0x99ff('0x4b')][_0x99ff('0x4c')]){_0x14f23a['MailAccountId']=_0x5a581['body'][_0x99ff('0x4c')];}else if(_0x5a581[_0x99ff('0x4b')]['SmsAccountId']){_0x14f23a[_0x99ff('0x4d')]=_0x5a581[_0x99ff('0x4b')]['SmsAccountId'];}else if(_0x5a581[_0x99ff('0x4b')][_0x99ff('0x4e')]){_0x14f23a[_0x99ff('0x4e')]=_0x5a581['body']['OpenchannelAccountId'];}else if(_0x5a581[_0x99ff('0x4b')]['ChatWebsiteId']){_0x14f23a[_0x99ff('0x4f')]=_0x5a581[_0x99ff('0x4b')]['ChatWebsiteId'];}return db['CannedAnswer'][_0x99ff('0x49')]({'where':_0x14f23a})[_0x99ff('0x22')](function(_0x370ea5){if(_0x370ea5){throw new db[(_0x99ff('0x50'))][(_0x99ff('0x51'))](_0x99ff('0x52'));}return db[_0x99ff('0x2d')][_0x99ff('0x53')](_0x5a581[_0x99ff('0x4b')]);})[_0x99ff('0x22')](function(_0x89e4ee){var _0x312342=_0x5a581[_0x99ff('0x54')][_0x99ff('0x24')]({'plain':!![]});if(!_0x312342)throw new Error(_0x99ff('0x55'));if(_0x312342[_0x99ff('0x56')]===_0x99ff('0x54')){var _0x71fabe=_0x89e4ee[_0x99ff('0x24')]({'plain':!![]});return db[_0x99ff('0x57')]['find']({'where':{'name':_0x99ff('0x25'),'userProfileId':_0x312342['userProfileId']},'raw':!![]})[_0x99ff('0x22')](function(_0x2c2781){if(_0x2c2781&&_0x2c2781[_0x99ff('0x58')]===0x0){return db['UserProfileResource'][_0x99ff('0x53')]({'name':_0x71fabe[_0x99ff('0x2a')],'resourceId':_0x71fabe['id'],'type':_0x2c2781['name'],'sectionId':_0x2c2781['id']},{})[_0x99ff('0x22')](function(){return _0x89e4ee;});}else{return _0x89e4ee;}})[_0x99ff('0x44')](function(_0x32616e){logger['error'](_0x99ff('0x59'),_0x32616e);throw _0x32616e;});}return _0x89e4ee;})[_0x99ff('0x22')](respondWithResult(_0x154b69,0xc9))[_0x99ff('0x44')](handleError(_0x154b69,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 4d61ddc..79c93d9 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 _0x17f8=['rimraf','../../config/environment','exports','define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise'];(function(_0x4802ca,_0x433d6b){var _0x372e8c=function(_0x261d69){while(--_0x261d69){_0x4802ca['push'](_0x4802ca['shift']());}};_0x372e8c(++_0x433d6b);}(_0x17f8,0x11b));var _0x817f=function(_0xd81295,_0x326a39){_0xd81295=_0xd81295-0x0;var _0x5db80e=_0x17f8[_0xd81295];return _0x5db80e;};'use strict';var _=require('lodash');var util=require(_0x817f('0x0'));var logger=require(_0x817f('0x1'))(_0x817f('0x2'));var moment=require(_0x817f('0x3'));var BPromise=require('bluebird');var rp=require(_0x817f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x817f('0x5'));var config=require(_0x817f('0x6'));var attributes=require('./cannedAnswer.attributes');module[_0x817f('0x7')]=function(_0x4e29a1,_0x5e52c4){return _0x4e29a1[_0x817f('0x8')](_0x817f('0x9'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x817f('0xa'),'collate':_0x817f('0xb')});};
\ No newline at end of file
+var _0x5b00=['util','bluebird','request-promise','path','../../config/environment','exports','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x3f4120,_0x28de12){var _0x2ccfa8=function(_0xcbaceb){while(--_0xcbaceb){_0x3f4120['push'](_0x3f4120['shift']());}};_0x2ccfa8(++_0x28de12);}(_0x5b00,0x1e3));var _0x05b0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5b00[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x05b0('0x0'));var util=require(_0x05b0('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x05b0('0x2'));var rp=require(_0x05b0('0x3'));var fs=require('fs');var path=require(_0x05b0('0x4'));var rimraf=require('rimraf');var config=require(_0x05b0('0x5'));var attributes=require('./cannedAnswer.attributes');module[_0x05b0('0x6')]=function(_0xb1f7f,_0x374d44){return _0xb1f7f['define'](_0x05b0('0x7'),attributes,{'tableName':_0x05b0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x05b0('0x9'),'collate':_0x05b0('0xa')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 9267750..215241a 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(_0xb42993,_0x3c222f){var _0x40f778=function(_0x4dd745){while(--_0x4dd745){_0xb42993['push'](_0xb42993['shift']());}};_0x40f778(++_0x3c222f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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(_0x5a4162,_0x37934b){var _0x179903=function(_0x1c0d36){while(--_0x1c0d36){_0x5a4162['push'](_0x5a4162['shift']());}};_0x179903(++_0x37934b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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 3dd698e..5348f8f 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 _0x1128=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','/:id','isAuthenticated','create','put','update','delete','exports','multer','util','path','connect-timeout','Router'];(function(_0x543670,_0x4d26b5){var _0x1e1c2d=function(_0x1dc07c){while(--_0x1dc07c){_0x543670['push'](_0x543670['shift']());}};_0x1e1c2d(++_0x4d26b5);}(_0x1128,0x151));var _0x8112=function(_0x479131,_0x2828f4){_0x479131=_0x479131-0x0;var _0x28e996=_0x1128[_0x479131];return _0x28e996;};'use strict';var multer=require(_0x8112('0x0'));var util=require(_0x8112('0x1'));var path=require(_0x8112('0x2'));var timeout=require(_0x8112('0x3'));var express=require('express');var router=express[_0x8112('0x4')]();var fs_extra=require(_0x8112('0x5'));var auth=require(_0x8112('0x6'));var interaction=require(_0x8112('0x7'));var config=require(_0x8112('0x8'));var controller=require(_0x8112('0x9'));router[_0x8112('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8112('0xa')](_0x8112('0xb'),auth[_0x8112('0xc')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x8112('0xd')]);router[_0x8112('0xe')](_0x8112('0xb'),auth[_0x8112('0xc')](),controller[_0x8112('0xf')]);router[_0x8112('0x10')](_0x8112('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x8112('0x11')]=router;
\ No newline at end of file
+var _0xb12c=['delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','/:id','isAuthenticated','show','create','update'];(function(_0x1e2588,_0x429ba9){var _0x116573=function(_0x14667c){while(--_0x14667c){_0x1e2588['push'](_0x1e2588['shift']());}};_0x116573(++_0x429ba9);}(_0xb12c,0x1f2));var _0xcb12=function(_0x2cf2a7,_0x2a7a00){_0x2cf2a7=_0x2cf2a7-0x0;var _0x5c779f=_0xb12c[_0x2cf2a7];return _0x5c779f;};'use strict';var multer=require(_0xcb12('0x0'));var util=require(_0xcb12('0x1'));var path=require('path');var timeout=require(_0xcb12('0x2'));var express=require(_0xcb12('0x3'));var router=express['Router']();var fs_extra=require(_0xcb12('0x4'));var auth=require(_0xcb12('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xcb12('0x6'));var controller=require(_0xcb12('0x7'));router[_0xcb12('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xcb12('0x8')](_0xcb12('0x9'),auth[_0xcb12('0xa')](),controller[_0xcb12('0xb')]);router['post']('/',auth[_0xcb12('0xa')](),controller[_0xcb12('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xcb12('0xd')]);router[_0xcb12('0xe')]('/:id',auth[_0xcb12('0xa')](),controller['destroy']);module[_0xcb12('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 18e6fe6..5ee8a85 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 _0xc73e=['exports','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x3c7880,_0x432f25){var _0x479b3b=function(_0x5385c3){while(--_0x5385c3){_0x3c7880['push'](_0x3c7880['shift']());}};_0x479b3b(++_0x432f25);}(_0xc73e,0x1e9));var _0xec73=function(_0x4adc0e,_0x5b2c31){_0x4adc0e=_0x4adc0e-0x0;var _0x4fbb5f=_0xc73e[_0x4adc0e];return _0x4fbb5f;};'use strict';var Sequelize=require(_0xec73('0x0'));module[_0xec73('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xec73('0x2')},'clid':{'type':Sequelize[_0xec73('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xec73('0x3')]},'dstchannel':{'type':Sequelize[_0xec73('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xec73('0x3')]},'duration':{'type':Sequelize[_0xec73('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xec73('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xec73('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xec73('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xec73('0x3')]},'linkedid':{'type':Sequelize[_0xec73('0x3')]},'sequence':{'type':Sequelize[_0xec73('0x3')]},'peeraccount':{'type':Sequelize[_0xec73('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x220b=['1970-01-01\x2000:00:01','STRING','INTEGER','exports','DATE'];(function(_0x9bb134,_0x41a445){var _0x1c3f8d=function(_0x256c45){while(--_0x256c45){_0x9bb134['push'](_0x9bb134['shift']());}};_0x1c3f8d(++_0x41a445);}(_0x220b,0x1a2));var _0xb220=function(_0x1f8053,_0x111077){_0x1f8053=_0x1f8053-0x0;var _0x174fd8=_0x220b[_0x1f8053];return _0x174fd8;};'use strict';var Sequelize=require('sequelize');module[_0xb220('0x0')]={'calldate':{'type':Sequelize[_0xb220('0x1')],'allowNull':![],'defaultValue':_0xb220('0x2')},'clid':{'type':Sequelize[_0xb220('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xb220('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xb220('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0xb220('0x3')]},'lastdata':{'type':Sequelize[_0xb220('0x3')]},'duration':{'type':Sequelize[_0xb220('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xb220('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xb220('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xb220('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xb220('0x3')]},'linkedid':{'type':Sequelize[_0xb220('0x3')]},'sequence':{'type':Sequelize[_0xb220('0x3')]},'peeraccount':{'type':Sequelize[_0xb220('0x3')]},'type':{'type':Sequelize[_0xb220('0x3')]},'tag':{'type':Sequelize[_0xb220('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 9411c87..5d3936a 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 _0x723e=['request-promise','moment','bluebird','mustache','util','path','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','end','sendStatus','error','name','send','index','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','Cdr','findAll','params','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch'];(function(_0x1ba9a4,_0x51aa43){var _0x28cb3b=function(_0x38e74a){while(--_0x38e74a){_0x1ba9a4['push'](_0x1ba9a4['shift']());}};_0x28cb3b(++_0x51aa43);}(_0x723e,0x179));var _0xe723=function(_0x362278,_0x4b766e){_0x362278=_0x362278-0x0;var _0xafd897=_0x723e[_0x362278];return _0xafd897;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe723('0x0'));var zipdir=require(_0xe723('0x1'));var jsonpatch=require(_0xe723('0x2'));var rp=require(_0xe723('0x3'));var moment=require(_0xe723('0x4'));var BPromise=require(_0xe723('0x5'));var Mustache=require(_0xe723('0x6'));var util=require(_0xe723('0x7'));var path=require(_0xe723('0x8'));var sox=require(_0xe723('0x9'));var csv=require('to-csv');var ejs=require(_0xe723('0xa'));var fs=require('fs');var fs_extra=require(_0xe723('0xb'));var _=require(_0xe723('0xc'));var squel=require(_0xe723('0xd'));var crypto=require(_0xe723('0xe'));var jsforce=require(_0xe723('0xf'));var deskjs=require(_0xe723('0x10'));var toCsv=require(_0xe723('0x11'));var querystring=require('querystring');var Papa=require(_0xe723('0x12'));var Redis=require(_0xe723('0x13'));var authService=require(_0xe723('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xe723('0x15'));var hardwareService=require(_0xe723('0x16'));var logger=require(_0xe723('0x17'))('api');var utils=require(_0xe723('0x18'));var config=require(_0xe723('0x19'));var licenseUtil=require(_0xe723('0x1a'));var db=require(_0xe723('0x1b'))['db'];function respondWithStatusCode(_0x236b69,_0x5c066c){_0x5c066c=_0x5c066c||0xcc;return function(_0x29a1e){if(_0x29a1e){return _0x236b69['sendStatus'](_0x5c066c);}return _0x236b69['status'](_0x5c066c)['end']();};}function respondWithResult(_0x57bc0e,_0x75c12c){_0x75c12c=_0x75c12c||0xc8;return function(_0x30b2ba){if(_0x30b2ba){return _0x57bc0e[_0xe723('0x1c')](_0x75c12c)[_0xe723('0x1d')](_0x30b2ba);}};}function respondWithFilteredResult(_0xf29a39,_0x5aec97){return function(_0x23d0b2){if(_0x23d0b2){var _0xbf5ca3=typeof _0x5aec97[_0xe723('0x1e')]===_0xe723('0x1f')&&typeof _0x5aec97[_0xe723('0x20')]===_0xe723('0x1f');var _0x2cd7ca=_0x23d0b2[_0xe723('0x21')];var _0x17e2c1=_0xbf5ca3?0x0:_0x5aec97[_0xe723('0x1e')];var _0x2057d7=_0xbf5ca3?_0x23d0b2[_0xe723('0x21')]:_0x5aec97[_0xe723('0x1e')]+_0x5aec97[_0xe723('0x20')];var _0x5e8a90;if(_0x2057d7>=_0x2cd7ca){_0x2057d7=_0x2cd7ca;_0x5e8a90=0xc8;}else{_0x5e8a90=0xce;}_0xf29a39['status'](_0x5e8a90);return _0xf29a39[_0xe723('0x22')](_0xe723('0x23'),_0x17e2c1+'-'+_0x2057d7+'/'+_0x2cd7ca)['json'](_0x23d0b2);}return null;};}function patchUpdates(_0x28caca){return function(_0x2762e2){try{jsonpatch['apply'](_0x2762e2,_0x28caca,!![]);}catch(_0x472502){return BPromise['reject'](_0x472502);}return _0x2762e2[_0xe723('0x24')]();};}function saveUpdates(_0x43ccfc,_0x3b82b2){return function(_0x1fe43d){if(_0x1fe43d){return _0x1fe43d[_0xe723('0x25')](_0x43ccfc)[_0xe723('0x26')](function(_0x25f7d2){return _0x25f7d2;});}return null;};}function removeEntity(_0x15196c,_0x1228f2){return function(_0x19bd0c){if(_0x19bd0c){return _0x19bd0c[_0xe723('0x27')]()[_0xe723('0x26')](function(){_0x15196c['status'](0xcc)[_0xe723('0x28')]();});}};}function handleEntityNotFound(_0x59f095,_0xa258f3){return function(_0x3ffa15){if(!_0x3ffa15){_0x59f095[_0xe723('0x29')](0x194);}return _0x3ffa15;};}function handleError(_0xe7e271,_0x1f81ec){_0x1f81ec=_0x1f81ec||0x1f4;return function(_0x598f15){logger[_0xe723('0x2a')](_0x598f15['stack']);if(_0x598f15['name']){delete _0x598f15[_0xe723('0x2b')];}_0xe7e271['status'](_0x1f81ec)[_0xe723('0x2c')](_0x598f15);};}exports[_0xe723('0x2d')]=function(_0x335c66,_0x4d55cc){var _0x1edbb2={},_0x45e162={},_0x48a97a={'count':0x0,'rows':[]};var _0x3c8c56=_['map'](db['Cdr'][_0xe723('0x2e')],function(_0x2c2240){return{'name':_0x2c2240[_0xe723('0x2f')],'type':_0x2c2240[_0xe723('0x30')]['key']};});_0x45e162['model']=_[_0xe723('0x31')](_0x3c8c56,'name');_0x45e162[_0xe723('0x32')]=_[_0xe723('0x33')](_0x335c66[_0xe723('0x32')]);_0x45e162[_0xe723('0x34')]=_[_0xe723('0x35')](_0x45e162[_0xe723('0x36')],_0x45e162[_0xe723('0x32')]);_0x1edbb2[_0xe723('0x37')]=_[_0xe723('0x35')](_0x45e162[_0xe723('0x36')],qs[_0xe723('0x38')](_0x335c66[_0xe723('0x32')][_0xe723('0x38')]));_0x1edbb2[_0xe723('0x37')]=_0x1edbb2['attributes'][_0xe723('0x39')]?_0x1edbb2['attributes']:_0x45e162[_0xe723('0x36')];if(!_0x335c66[_0xe723('0x32')]['hasOwnProperty']('nolimit')){_0x1edbb2[_0xe723('0x20')]=qs[_0xe723('0x20')](_0x335c66[_0xe723('0x32')][_0xe723('0x20')]);_0x1edbb2[_0xe723('0x1e')]=qs[_0xe723('0x1e')](_0x335c66['query'][_0xe723('0x1e')]);}_0x1edbb2[_0xe723('0x3a')]=qs[_0xe723('0x3b')](_0x335c66[_0xe723('0x32')][_0xe723('0x3b')]);_0x1edbb2[_0xe723('0x3c')]=qs[_0xe723('0x34')](_[_0xe723('0x3d')](_0x335c66[_0xe723('0x32')],_0x45e162[_0xe723('0x34')]),_0x3c8c56);if(_0x335c66[_0xe723('0x32')][_0xe723('0x3e')]){_0x1edbb2[_0xe723('0x3c')]=_[_0xe723('0x3f')](_0x1edbb2[_0xe723('0x3c')],{'$or':_[_0xe723('0x31')](_0x3c8c56,function(_0x5c5027){if(_0x5c5027[_0xe723('0x30')]!==_0xe723('0x40')){var _0x68eda5={};_0x68eda5[_0x5c5027[_0xe723('0x2b')]]={'$like':'%'+_0x335c66['query']['filter']+'%'};return _0x68eda5;}})});}_0x1edbb2=_[_0xe723('0x3f')]({},_0x1edbb2,_0x335c66[_0xe723('0x41')]);var _0xc0c2c7={'where':_0x1edbb2[_0xe723('0x3c')]};return db['Cdr']['count'](_0xc0c2c7)[_0xe723('0x26')](function(_0x2f1618){_0x48a97a[_0xe723('0x21')]=_0x2f1618;if(_0x335c66[_0xe723('0x32')][_0xe723('0x42')]){_0x1edbb2[_0xe723('0x43')]=[{'all':!![]}];}return db[_0xe723('0x44')][_0xe723('0x45')](_0x1edbb2);})[_0xe723('0x26')](function(_0x5b0c89){_0x48a97a['rows']=_0x5b0c89;return _0x48a97a;})[_0xe723('0x26')](respondWithFilteredResult(_0x4d55cc,_0x1edbb2))['catch'](handleError(_0x4d55cc,null));};exports['show']=function(_0x18f4a1,_0x55530b){var _0x36272={'raw':!![],'where':{'id':_0x18f4a1[_0xe723('0x46')]['id']}},_0x42bd2f={};_0x42bd2f[_0xe723('0x36')]=_[_0xe723('0x33')](db[_0xe723('0x44')][_0xe723('0x2e')]);_0x42bd2f['query']=_['keys'](_0x18f4a1[_0xe723('0x32')]);_0x42bd2f['filters']=_[_0xe723('0x35')](_0x42bd2f['model'],_0x42bd2f[_0xe723('0x32')]);_0x36272[_0xe723('0x37')]=_[_0xe723('0x35')](_0x42bd2f[_0xe723('0x36')],qs[_0xe723('0x38')](_0x18f4a1[_0xe723('0x32')][_0xe723('0x38')]));_0x36272[_0xe723('0x37')]=_0x36272[_0xe723('0x37')]['length']?_0x36272['attributes']:_0x42bd2f[_0xe723('0x36')];if(_0x18f4a1[_0xe723('0x32')][_0xe723('0x42')]){_0x36272['include']=[{'all':!![]}];}_0x36272=_['merge']({},_0x36272,_0x18f4a1['options']);return db[_0xe723('0x44')][_0xe723('0x47')](_0x36272)[_0xe723('0x26')](handleEntityNotFound(_0x55530b,null))['then'](respondWithResult(_0x55530b,null))[_0xe723('0x48')](handleError(_0x55530b,null));};exports[_0xe723('0x49')]=function(_0x1cb2b2,_0x38bd1a){return db[_0xe723('0x44')]['create'](_0x1cb2b2[_0xe723('0x4a')],{})['then'](respondWithResult(_0x38bd1a,0xc9))[_0xe723('0x48')](handleError(_0x38bd1a,null));};exports['update']=function(_0x52f42e,_0x1590fe){if(_0x52f42e[_0xe723('0x4a')]['id']){delete _0x52f42e[_0xe723('0x4a')]['id'];}return db['Cdr'][_0xe723('0x47')]({'where':{'id':_0x52f42e['params']['id']}})[_0xe723('0x26')](handleEntityNotFound(_0x1590fe,null))[_0xe723('0x26')](saveUpdates(_0x52f42e[_0xe723('0x4a')],null))[_0xe723('0x26')](respondWithResult(_0x1590fe,null))[_0xe723('0x48')](handleError(_0x1590fe,null));};exports[_0xe723('0x27')]=function(_0x41e1c4,_0x16cb50){return db[_0xe723('0x44')]['find']({'where':{'id':_0x41e1c4[_0xe723('0x46')]['id']}})[_0xe723('0x26')](handleEntityNotFound(_0x16cb50,null))['then'](removeEntity(_0x16cb50,null))[_0xe723('0x48')](handleError(_0x16cb50,null));};exports[_0xe723('0x4b')]=function(_0x56e92a,_0x126ca5){return db['Cdr']['describe']()[_0xe723('0x26')](respondWithResult(_0x126ca5,null))[_0xe723('0x48')](handleError(_0x126ca5,null));};
\ No newline at end of file
+var _0xf3be=['then','error','stack','name','send','index','map','Cdr','fieldName','type','key','query','keys','intersection','attributes','fields','model','nolimit','order','sort','where','filters','pick','filter','merge','options','include','rows','catch','rawAttributes','length','includeAll','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy'];(function(_0x3985f1,_0x493e84){var _0x405d4d=function(_0x46c787){while(--_0x46c787){_0x3985f1['push'](_0x3985f1['shift']());}};_0x405d4d(++_0x493e84);}(_0xf3be,0x1e1));var _0xef3b=function(_0x1b6e61,_0x40fab9){_0x1b6e61=_0x1b6e61-0x0;var _0x52d153=_0xf3be[_0x1b6e61];return _0x52d153;};'use strict';var emlformat=require(_0xef3b('0x0'));var rimraf=require(_0xef3b('0x1'));var zipdir=require(_0xef3b('0x2'));var jsonpatch=require(_0xef3b('0x3'));var rp=require('request-promise');var moment=require(_0xef3b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xef3b('0x5'));var csv=require(_0xef3b('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xef3b('0x7'));var _=require(_0xef3b('0x8'));var squel=require(_0xef3b('0x9'));var crypto=require(_0xef3b('0xa'));var jsforce=require(_0xef3b('0xb'));var deskjs=require(_0xef3b('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xef3b('0xd'));var Redis=require('ioredis');var authService=require(_0xef3b('0xe'));var qs=require(_0xef3b('0xf'));var as=require(_0xef3b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xef3b('0x11'))('api');var utils=require(_0xef3b('0x12'));var config=require(_0xef3b('0x13'));var licenseUtil=require(_0xef3b('0x14'));var db=require(_0xef3b('0x15'))['db'];function respondWithStatusCode(_0x2a2a27,_0x3aef79){_0x3aef79=_0x3aef79||0xcc;return function(_0x169b2c){if(_0x169b2c){return _0x2a2a27[_0xef3b('0x16')](_0x3aef79);}return _0x2a2a27[_0xef3b('0x17')](_0x3aef79)[_0xef3b('0x18')]();};}function respondWithResult(_0x510cc3,_0x5a53b9){_0x5a53b9=_0x5a53b9||0xc8;return function(_0x138ea5){if(_0x138ea5){return _0x510cc3[_0xef3b('0x17')](_0x5a53b9)[_0xef3b('0x19')](_0x138ea5);}};}function respondWithFilteredResult(_0x118a31,_0x416801){return function(_0x529e89){if(_0x529e89){var _0x169803=typeof _0x416801[_0xef3b('0x1a')]===_0xef3b('0x1b')&&typeof _0x416801[_0xef3b('0x1c')]===_0xef3b('0x1b');var _0x5908cb=_0x529e89[_0xef3b('0x1d')];var _0x406eb7=_0x169803?0x0:_0x416801['offset'];var _0x280ccf=_0x169803?_0x529e89['count']:_0x416801[_0xef3b('0x1a')]+_0x416801['limit'];var _0x278de3;if(_0x280ccf>=_0x5908cb){_0x280ccf=_0x5908cb;_0x278de3=0xc8;}else{_0x278de3=0xce;}_0x118a31[_0xef3b('0x17')](_0x278de3);return _0x118a31[_0xef3b('0x1e')](_0xef3b('0x1f'),_0x406eb7+'-'+_0x280ccf+'/'+_0x5908cb)[_0xef3b('0x19')](_0x529e89);}return null;};}function patchUpdates(_0x3d18ef){return function(_0x19d4b5){try{jsonpatch[_0xef3b('0x20')](_0x19d4b5,_0x3d18ef,!![]);}catch(_0x4a3fbf){return BPromise[_0xef3b('0x21')](_0x4a3fbf);}return _0x19d4b5[_0xef3b('0x22')]();};}function saveUpdates(_0x214b53,_0xfe39a4){return function(_0x93a080){if(_0x93a080){return _0x93a080[_0xef3b('0x23')](_0x214b53)['then'](function(_0x27cc47){return _0x27cc47;});}return null;};}function removeEntity(_0x574042,_0x57b14a){return function(_0xc68cb2){if(_0xc68cb2){return _0xc68cb2[_0xef3b('0x24')]()[_0xef3b('0x25')](function(){_0x574042[_0xef3b('0x17')](0xcc)[_0xef3b('0x18')]();});}};}function handleEntityNotFound(_0x179338,_0x4ecb5e){return function(_0x487ae6){if(!_0x487ae6){_0x179338[_0xef3b('0x16')](0x194);}return _0x487ae6;};}function handleError(_0x4b6ee7,_0x4d5449){_0x4d5449=_0x4d5449||0x1f4;return function(_0x13dd47){logger[_0xef3b('0x26')](_0x13dd47[_0xef3b('0x27')]);if(_0x13dd47[_0xef3b('0x28')]){delete _0x13dd47[_0xef3b('0x28')];}_0x4b6ee7[_0xef3b('0x17')](_0x4d5449)[_0xef3b('0x29')](_0x13dd47);};}exports[_0xef3b('0x2a')]=function(_0x556c5c,_0xded00b){var _0x2b073b={},_0x634a45={},_0x187d1b={'count':0x0,'rows':[]};var _0x27ab13=_[_0xef3b('0x2b')](db[_0xef3b('0x2c')]['rawAttributes'],function(_0x4c9a84){return{'name':_0x4c9a84[_0xef3b('0x2d')],'type':_0x4c9a84[_0xef3b('0x2e')][_0xef3b('0x2f')]};});_0x634a45['model']=_[_0xef3b('0x2b')](_0x27ab13,_0xef3b('0x28'));_0x634a45[_0xef3b('0x30')]=_[_0xef3b('0x31')](_0x556c5c[_0xef3b('0x30')]);_0x634a45['filters']=_[_0xef3b('0x32')](_0x634a45['model'],_0x634a45[_0xef3b('0x30')]);_0x2b073b[_0xef3b('0x33')]=_[_0xef3b('0x32')](_0x634a45['model'],qs[_0xef3b('0x34')](_0x556c5c[_0xef3b('0x30')][_0xef3b('0x34')]));_0x2b073b['attributes']=_0x2b073b[_0xef3b('0x33')]['length']?_0x2b073b[_0xef3b('0x33')]:_0x634a45[_0xef3b('0x35')];if(!_0x556c5c['query']['hasOwnProperty'](_0xef3b('0x36'))){_0x2b073b[_0xef3b('0x1c')]=qs[_0xef3b('0x1c')](_0x556c5c['query'][_0xef3b('0x1c')]);_0x2b073b[_0xef3b('0x1a')]=qs[_0xef3b('0x1a')](_0x556c5c[_0xef3b('0x30')][_0xef3b('0x1a')]);}_0x2b073b[_0xef3b('0x37')]=qs['sort'](_0x556c5c['query'][_0xef3b('0x38')]);_0x2b073b[_0xef3b('0x39')]=qs[_0xef3b('0x3a')](_[_0xef3b('0x3b')](_0x556c5c[_0xef3b('0x30')],_0x634a45[_0xef3b('0x3a')]),_0x27ab13);if(_0x556c5c['query'][_0xef3b('0x3c')]){_0x2b073b[_0xef3b('0x39')]=_[_0xef3b('0x3d')](_0x2b073b['where'],{'$or':_[_0xef3b('0x2b')](_0x27ab13,function(_0x5ab5eb){if(_0x5ab5eb[_0xef3b('0x2e')]!=='VIRTUAL'){var _0x3a361f={};_0x3a361f[_0x5ab5eb['name']]={'$like':'%'+_0x556c5c[_0xef3b('0x30')]['filter']+'%'};return _0x3a361f;}})});}_0x2b073b=_[_0xef3b('0x3d')]({},_0x2b073b,_0x556c5c[_0xef3b('0x3e')]);var _0x1108e1={'where':_0x2b073b[_0xef3b('0x39')]};return db[_0xef3b('0x2c')][_0xef3b('0x1d')](_0x1108e1)[_0xef3b('0x25')](function(_0x219cfc){_0x187d1b['count']=_0x219cfc;if(_0x556c5c[_0xef3b('0x30')]['includeAll']){_0x2b073b[_0xef3b('0x3f')]=[{'all':!![]}];}return db[_0xef3b('0x2c')]['findAll'](_0x2b073b);})['then'](function(_0x51fb51){_0x187d1b[_0xef3b('0x40')]=_0x51fb51;return _0x187d1b;})['then'](respondWithFilteredResult(_0xded00b,_0x2b073b))[_0xef3b('0x41')](handleError(_0xded00b,null));};exports['show']=function(_0x4b2230,_0x516d08){var _0x5cec25={'raw':!![],'where':{'id':_0x4b2230['params']['id']}},_0x48699a={};_0x48699a['model']=_[_0xef3b('0x31')](db[_0xef3b('0x2c')][_0xef3b('0x42')]);_0x48699a['query']=_['keys'](_0x4b2230[_0xef3b('0x30')]);_0x48699a[_0xef3b('0x3a')]=_[_0xef3b('0x32')](_0x48699a[_0xef3b('0x35')],_0x48699a['query']);_0x5cec25[_0xef3b('0x33')]=_['intersection'](_0x48699a[_0xef3b('0x35')],qs[_0xef3b('0x34')](_0x4b2230[_0xef3b('0x30')][_0xef3b('0x34')]));_0x5cec25[_0xef3b('0x33')]=_0x5cec25['attributes'][_0xef3b('0x43')]?_0x5cec25[_0xef3b('0x33')]:_0x48699a[_0xef3b('0x35')];if(_0x4b2230[_0xef3b('0x30')][_0xef3b('0x44')]){_0x5cec25[_0xef3b('0x3f')]=[{'all':!![]}];}_0x5cec25=_[_0xef3b('0x3d')]({},_0x5cec25,_0x4b2230[_0xef3b('0x3e')]);return db[_0xef3b('0x2c')]['find'](_0x5cec25)[_0xef3b('0x25')](handleEntityNotFound(_0x516d08,null))[_0xef3b('0x25')](respondWithResult(_0x516d08,null))[_0xef3b('0x41')](handleError(_0x516d08,null));};exports['create']=function(_0x3f3e8b,_0x5d48c8){return db[_0xef3b('0x2c')][_0xef3b('0x45')](_0x3f3e8b[_0xef3b('0x46')],{})['then'](respondWithResult(_0x5d48c8,0xc9))['catch'](handleError(_0x5d48c8,null));};exports[_0xef3b('0x23')]=function(_0x38ee41,_0x4b368c){if(_0x38ee41[_0xef3b('0x46')]['id']){delete _0x38ee41[_0xef3b('0x46')]['id'];}return db[_0xef3b('0x2c')][_0xef3b('0x47')]({'where':{'id':_0x38ee41['params']['id']}})[_0xef3b('0x25')](handleEntityNotFound(_0x4b368c,null))[_0xef3b('0x25')](saveUpdates(_0x38ee41[_0xef3b('0x46')],null))[_0xef3b('0x25')](respondWithResult(_0x4b368c,null))[_0xef3b('0x41')](handleError(_0x4b368c,null));};exports[_0xef3b('0x24')]=function(_0x5e66fe,_0x2f45b1){return db[_0xef3b('0x2c')][_0xef3b('0x47')]({'where':{'id':_0x5e66fe[_0xef3b('0x48')]['id']}})[_0xef3b('0x25')](handleEntityNotFound(_0x2f45b1,null))[_0xef3b('0x25')](removeEntity(_0x2f45b1,null))[_0xef3b('0x41')](handleError(_0x2f45b1,null));};exports[_0xef3b('0x49')]=function(_0x3995b9,_0xf30f16){return db[_0xef3b('0x2c')][_0xef3b('0x49')]()[_0xef3b('0x25')](respondWithResult(_0xf30f16,null))['catch'](handleError(_0xf30f16,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 02444a1..dafbec1 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(_0x6056a2,_0x156835){var _0x39b066=function(_0x37fe47){while(--_0x37fe47){_0x6056a2['push'](_0x6056a2['shift']());}};_0x39b066(++_0x156835);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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 _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x545e7c,_0x7cee70){var _0x5c9897=function(_0x130e8a){while(--_0x130e8a){_0x545e7c['push'](_0x545e7c['shift']());}};_0x5c9897(++_0x7cee70);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index fcdc35b..c774bcc 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 _0x7263=['request','then','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x1ad7d3,_0x187a4c){var _0x490430=function(_0x50dc2b){while(--_0x50dc2b){_0x1ad7d3['push'](_0x1ad7d3['shift']());}};_0x490430(++_0x187a4c);}(_0x7263,0x15b));var _0x3726=function(_0xd02eac,_0x1e2933){_0xd02eac=_0xd02eac-0x0;var _0x113bfe=_0x7263[_0xd02eac];return _0x113bfe;};'use strict';var _=require(_0x3726('0x0'));var util=require(_0x3726('0x1'));var moment=require(_0x3726('0x2'));var BPromise=require(_0x3726('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3726('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3726('0x5'));var logger=require(_0x3726('0x6'))('rpc');var config=require(_0x3726('0x7'));var jayson=require(_0x3726('0x8'));var client=jayson['client'][_0x3726('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x369f0b,_0x2aedfd,_0x32cd7e){return new BPromise(function(_0x377407,_0x45e0f2){return client[_0x3726('0xa')](_0x369f0b,_0x32cd7e)[_0x3726('0xb')](function(_0x460685){logger['info'](_0x3726('0xc'),_0x2aedfd,_0x3726('0xd'));logger['debug'](_0x3726('0xe'),_0x2aedfd,_0x3726('0xd'),JSON[_0x3726('0xf')](_0x460685));if(_0x460685[_0x3726('0x10')]){if(_0x460685[_0x3726('0x10')][_0x3726('0x11')]===0x1f4){logger[_0x3726('0x10')]('Cdr,\x20%s,\x20%s',_0x2aedfd,_0x460685[_0x3726('0x10')][_0x3726('0x12')]);return _0x45e0f2(_0x460685['error'][_0x3726('0x12')]);}logger['error'](_0x3726('0xc'),_0x2aedfd,_0x460685[_0x3726('0x10')]['message']);return _0x377407(_0x460685[_0x3726('0x10')][_0x3726('0x12')]);}else{logger[_0x3726('0x13')](_0x3726('0xc'),_0x2aedfd,'request\x20sent');_0x377407(_0x460685[_0x3726('0x14')][_0x3726('0x12')]);}})['catch'](function(_0x3b2a2f){logger[_0x3726('0x10')](_0x3726('0xc'),_0x2aedfd,_0x3b2a2f);_0x45e0f2(_0x3b2a2f);});});}
\ No newline at end of file
+var _0xf391=['debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','Cdr,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x719da8,_0x44d1dd){var _0x335b47=function(_0x35f856){while(--_0x35f856){_0x719da8['push'](_0x719da8['shift']());}};_0x335b47(++_0x44d1dd);}(_0xf391,0x1bf));var _0x1f39=function(_0x555682,_0x3b6190){_0x555682=_0x555682-0x0;var _0x355cf3=_0xf391[_0x555682];return _0x355cf3;};'use strict';var _=require(_0x1f39('0x0'));var util=require('util');var moment=require(_0x1f39('0x1'));var BPromise=require(_0x1f39('0x2'));var rs=require(_0x1f39('0x3'));var fs=require('fs');var Redis=require(_0x1f39('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1f39('0x5'));var logger=require(_0x1f39('0x6'))('rpc');var config=require(_0x1f39('0x7'));var jayson=require(_0x1f39('0x8'));var client=jayson[_0x1f39('0x9')][_0x1f39('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2324a2,_0x64d7ad,_0x11f84f){return new BPromise(function(_0x529e74,_0x5997ae){return client[_0x1f39('0xb')](_0x2324a2,_0x11f84f)[_0x1f39('0xc')](function(_0xbaa8c){logger[_0x1f39('0xd')]('Cdr,\x20%s,\x20%s',_0x64d7ad,_0x1f39('0xe'));logger[_0x1f39('0xf')](_0x1f39('0x10'),_0x64d7ad,_0x1f39('0xe'),JSON['stringify'](_0xbaa8c));if(_0xbaa8c[_0x1f39('0x11')]){if(_0xbaa8c[_0x1f39('0x11')][_0x1f39('0x12')]===0x1f4){logger[_0x1f39('0x11')](_0x1f39('0x13'),_0x64d7ad,_0xbaa8c[_0x1f39('0x11')][_0x1f39('0x14')]);return _0x5997ae(_0xbaa8c[_0x1f39('0x11')][_0x1f39('0x14')]);}logger[_0x1f39('0x11')](_0x1f39('0x13'),_0x64d7ad,_0xbaa8c[_0x1f39('0x11')][_0x1f39('0x14')]);return _0x529e74(_0xbaa8c[_0x1f39('0x11')][_0x1f39('0x14')]);}else{logger[_0x1f39('0xd')](_0x1f39('0x13'),_0x64d7ad,_0x1f39('0xe'));_0x529e74(_0xbaa8c['result'][_0x1f39('0x14')]);}})[_0x1f39('0x15')](function(_0x5db20b){logger['error']('Cdr,\x20%s,\x20%s',_0x64d7ad,_0x5db20b);_0x5997ae(_0x5db20b);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 64ebdf5..8b01979 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x2e10e4,_0x262e36){var _0x4bdb80=function(_0x2ddcd9){while(--_0x2ddcd9){_0x2e10e4['push'](_0x2e10e4['shift']());}};_0x4bdb80(++_0x262e36);}(_0xb10b,0x12a));var _0xbb10=function(_0x42f3a6,_0x45285c){_0x42f3a6=_0x42f3a6-0x0;var _0xdf3c33=_0xb10b[_0x42f3a6];return _0xdf3c33;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
+var _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(_0x1a0600,_0x41feef){var _0x734670=function(_0x2da4e4){while(--_0x2da4e4){_0x1a0600['push'](_0x1a0600['shift']());}};_0x734670(++_0x41feef);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 3cce970..e195ab0 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 _0x724e=['TEXT','*,*,*,*','sequelize','INTEGER','STRING','noop'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x724e,0x8c));var _0xe724=function(_0x28bbb9,_0x319419){_0x28bbb9=_0x28bbb9-0x0;var _0x104c01=_0x724e[_0x28bbb9];return _0x104c01;};'use strict';var Sequelize=require(_0xe724('0x0'));module['exports']={'priority':{'type':Sequelize[_0xe724('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xe724('0x2')],'allowNull':![],'defaultValue':_0xe724('0x3')},'appdata':{'type':Sequelize[_0xe724('0x4')]()},'description':{'type':Sequelize[_0xe724('0x2')]},'interval':{'type':Sequelize[_0xe724('0x2')],'defaultValue':_0xe724('0x5')}};
\ No newline at end of file
+var _0x3c76=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x3121de,_0x1d7c25){var _0x1f6ca0=function(_0x147a59){while(--_0x147a59){_0x3121de['push'](_0x3121de['shift']());}};_0x1f6ca0(++_0x1d7c25);}(_0x3c76,0x93));var _0x63c7=function(_0x5c34d0,_0x992e48){_0x5c34d0=_0x5c34d0-0x0;var _0x1066d5=_0x3c76[_0x5c34d0];return _0x1066d5;};'use strict';var Sequelize=require(_0x63c7('0x0'));module[_0x63c7('0x1')]={'priority':{'type':Sequelize[_0x63c7('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x63c7('0x3')],'allowNull':![],'defaultValue':_0x63c7('0x4')},'appdata':{'type':Sequelize[_0x63c7('0x5')]()},'description':{'type':Sequelize[_0x63c7('0x3')]},'interval':{'type':Sequelize[_0x63c7('0x3')],'defaultValue':_0x63c7('0x6')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 130772e..346142e 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 _0xc577=['../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','then','destroy','end','sendStatus','error','name','send','params','model','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','find','catch','update','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0xc577,0x172));var _0x7c57=function(_0x67f95e,_0x3ca797){_0x67f95e=_0x67f95e-0x0;var _0x538f5a=_0xc577[_0x67f95e];return _0x538f5a;};'use strict';var emlformat=require(_0x7c57('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7c57('0x1'));var rp=require(_0x7c57('0x2'));var moment=require(_0x7c57('0x3'));var BPromise=require(_0x7c57('0x4'));var Mustache=require(_0x7c57('0x5'));var util=require(_0x7c57('0x6'));var path=require(_0x7c57('0x7'));var sox=require('sox');var csv=require(_0x7c57('0x8'));var ejs=require(_0x7c57('0x9'));var fs=require('fs');var fs_extra=require(_0x7c57('0xa'));var _=require(_0x7c57('0xb'));var squel=require(_0x7c57('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7c57('0x8'));var querystring=require('querystring');var Papa=require(_0x7c57('0xd'));var Redis=require(_0x7c57('0xe'));var authService=require(_0x7c57('0xf'));var qs=require(_0x7c57('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7c57('0x11'));var logger=require(_0x7c57('0x12'))('api');var utils=require(_0x7c57('0x13'));var config=require(_0x7c57('0x14'));var licenseUtil=require(_0x7c57('0x15'));var db=require(_0x7c57('0x16'))['db'];function respondWithStatusCode(_0xbd2172,_0x10a675){_0x10a675=_0x10a675||0xcc;return function(_0x296cef){if(_0x296cef){return _0xbd2172['sendStatus'](_0x10a675);}return _0xbd2172['status'](_0x10a675)['end']();};}function respondWithResult(_0x46cae6,_0x373a4b){_0x373a4b=_0x373a4b||0xc8;return function(_0x4c5af2){if(_0x4c5af2){return _0x46cae6[_0x7c57('0x17')](_0x373a4b)[_0x7c57('0x18')](_0x4c5af2);}};}function respondWithFilteredResult(_0x11903b,_0x1ba2d0){return function(_0x14ce67){if(_0x14ce67){var _0x517d8a=typeof _0x1ba2d0['offset']===_0x7c57('0x19')&&typeof _0x1ba2d0[_0x7c57('0x1a')]===_0x7c57('0x19');var _0x3c40d3=_0x14ce67[_0x7c57('0x1b')];var _0x48cf4f=_0x517d8a?0x0:_0x1ba2d0[_0x7c57('0x1c')];var _0x30f5b1=_0x517d8a?_0x14ce67[_0x7c57('0x1b')]:_0x1ba2d0[_0x7c57('0x1c')]+_0x1ba2d0[_0x7c57('0x1a')];var _0x3e2dc0;if(_0x30f5b1>=_0x3c40d3){_0x30f5b1=_0x3c40d3;_0x3e2dc0=0xc8;}else{_0x3e2dc0=0xce;}_0x11903b[_0x7c57('0x17')](_0x3e2dc0);return _0x11903b[_0x7c57('0x1d')](_0x7c57('0x1e'),_0x48cf4f+'-'+_0x30f5b1+'/'+_0x3c40d3)['json'](_0x14ce67);}return null;};}function patchUpdates(_0x45221e){return function(_0x3472b8){try{jsonpatch[_0x7c57('0x1f')](_0x3472b8,_0x45221e,!![]);}catch(_0x373b5b){return BPromise['reject'](_0x373b5b);}return _0x3472b8['save']();};}function saveUpdates(_0x4c4140,_0x140376){return function(_0x368bb6){if(_0x368bb6){return _0x368bb6['update'](_0x4c4140)[_0x7c57('0x20')](function(_0x13f696){return _0x13f696;});}return null;};}function removeEntity(_0x260d58,_0xfb0f2e){return function(_0x4734de){if(_0x4734de){return _0x4734de[_0x7c57('0x21')]()[_0x7c57('0x20')](function(){_0x260d58['status'](0xcc)[_0x7c57('0x22')]();});}};}function handleEntityNotFound(_0x3232f8,_0x16a517){return function(_0x1641f1){if(!_0x1641f1){_0x3232f8[_0x7c57('0x23')](0x194);}return _0x1641f1;};}function handleError(_0x984924,_0x41125b){_0x41125b=_0x41125b||0x1f4;return function(_0x1219f2){logger[_0x7c57('0x24')](_0x1219f2['stack']);if(_0x1219f2['name']){delete _0x1219f2[_0x7c57('0x25')];}_0x984924[_0x7c57('0x17')](_0x41125b)[_0x7c57('0x26')](_0x1219f2);};}exports['show']=function(_0x9b9d1f,_0x59ae2f){var _0x5acc20={'raw':!![],'where':{'id':_0x9b9d1f[_0x7c57('0x27')]['id']}},_0x5ad979={};_0x5ad979[_0x7c57('0x28')]=_['keys'](db[_0x7c57('0x29')][_0x7c57('0x2a')]);_0x5ad979[_0x7c57('0x2b')]=_['keys'](_0x9b9d1f[_0x7c57('0x2b')]);_0x5ad979[_0x7c57('0x2c')]=_[_0x7c57('0x2d')](_0x5ad979['model'],_0x5ad979[_0x7c57('0x2b')]);_0x5acc20[_0x7c57('0x2e')]=_[_0x7c57('0x2d')](_0x5ad979[_0x7c57('0x28')],qs[_0x7c57('0x2f')](_0x9b9d1f[_0x7c57('0x2b')][_0x7c57('0x2f')]));_0x5acc20[_0x7c57('0x2e')]=_0x5acc20[_0x7c57('0x2e')][_0x7c57('0x30')]?_0x5acc20['attributes']:_0x5ad979[_0x7c57('0x28')];if(_0x9b9d1f[_0x7c57('0x2b')]['includeAll']){_0x5acc20[_0x7c57('0x31')]=[{'all':!![]}];}_0x5acc20=_[_0x7c57('0x32')]({},_0x5acc20,_0x9b9d1f[_0x7c57('0x33')]);return db['ChatApplication'][_0x7c57('0x34')](_0x5acc20)[_0x7c57('0x20')](handleEntityNotFound(_0x59ae2f,null))['then'](respondWithResult(_0x59ae2f,null))[_0x7c57('0x35')](handleError(_0x59ae2f,null));};exports[_0x7c57('0x36')]=function(_0x5e8068,_0x170d19){if(_0x5e8068[_0x7c57('0x37')]['id']){delete _0x5e8068[_0x7c57('0x37')]['id'];}return db[_0x7c57('0x29')]['find']({'where':{'id':_0x5e8068[_0x7c57('0x27')]['id']}})['then'](handleEntityNotFound(_0x170d19,null))['then'](saveUpdates(_0x5e8068[_0x7c57('0x37')],null))[_0x7c57('0x20')](respondWithResult(_0x170d19,null))[_0x7c57('0x35')](handleError(_0x170d19,null));};exports[_0x7c57('0x21')]=function(_0x493381,_0x2aebec){return db[_0x7c57('0x29')][_0x7c57('0x34')]({'where':{'id':_0x493381[_0x7c57('0x27')]['id']}})[_0x7c57('0x20')](handleEntityNotFound(_0x2aebec,null))[_0x7c57('0x20')](removeEntity(_0x2aebec,null))[_0x7c57('0x35')](handleError(_0x2aebec,null));};
\ No newline at end of file
+var _0x5d70=['then','destroy','error','stack','name','show','params','model','keys','ChatApplication','query','filters','intersection','attributes','fields','includeAll','include','options','find','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','save','update'];(function(_0x16bb0e,_0x343132){var _0x102b8b=function(_0x17a62b){while(--_0x17a62b){_0x16bb0e['push'](_0x16bb0e['shift']());}};_0x102b8b(++_0x343132);}(_0x5d70,0x8d));var _0x05d7=function(_0x179220,_0x507eb2){_0x179220=_0x179220-0x0;var _0x5d1d84=_0x5d70[_0x179220];return _0x5d1d84;};'use strict';var emlformat=require(_0x05d7('0x0'));var rimraf=require(_0x05d7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x05d7('0x2'));var rp=require(_0x05d7('0x3'));var moment=require(_0x05d7('0x4'));var BPromise=require(_0x05d7('0x5'));var Mustache=require(_0x05d7('0x6'));var util=require(_0x05d7('0x7'));var path=require('path');var sox=require(_0x05d7('0x8'));var csv=require(_0x05d7('0x9'));var ejs=require(_0x05d7('0xa'));var fs=require('fs');var fs_extra=require(_0x05d7('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x05d7('0xc'));var jsforce=require(_0x05d7('0xd'));var deskjs=require(_0x05d7('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x05d7('0xf'));var Redis=require(_0x05d7('0x10'));var authService=require(_0x05d7('0x11'));var qs=require(_0x05d7('0x12'));var as=require(_0x05d7('0x13'));var hardwareService=require(_0x05d7('0x14'));var logger=require(_0x05d7('0x15'))(_0x05d7('0x16'));var utils=require(_0x05d7('0x17'));var config=require(_0x05d7('0x18'));var licenseUtil=require(_0x05d7('0x19'));var db=require(_0x05d7('0x1a'))['db'];function respondWithStatusCode(_0x3d4825,_0x2e2bab){_0x2e2bab=_0x2e2bab||0xcc;return function(_0x1f0ccb){if(_0x1f0ccb){return _0x3d4825[_0x05d7('0x1b')](_0x2e2bab);}return _0x3d4825[_0x05d7('0x1c')](_0x2e2bab)[_0x05d7('0x1d')]();};}function respondWithResult(_0x171746,_0x34cd5b){_0x34cd5b=_0x34cd5b||0xc8;return function(_0x231f62){if(_0x231f62){return _0x171746[_0x05d7('0x1c')](_0x34cd5b)[_0x05d7('0x1e')](_0x231f62);}};}function respondWithFilteredResult(_0x586306,_0x38b3c7){return function(_0x5ba163){if(_0x5ba163){var _0x42c95f=typeof _0x38b3c7[_0x05d7('0x1f')]==='undefined'&&typeof _0x38b3c7['limit']==='undefined';var _0x55b9d3=_0x5ba163['count'];var _0x3e364b=_0x42c95f?0x0:_0x38b3c7[_0x05d7('0x1f')];var _0x292d48=_0x42c95f?_0x5ba163[_0x05d7('0x20')]:_0x38b3c7[_0x05d7('0x1f')]+_0x38b3c7[_0x05d7('0x21')];var _0xad9c4;if(_0x292d48>=_0x55b9d3){_0x292d48=_0x55b9d3;_0xad9c4=0xc8;}else{_0xad9c4=0xce;}_0x586306[_0x05d7('0x1c')](_0xad9c4);return _0x586306[_0x05d7('0x22')](_0x05d7('0x23'),_0x3e364b+'-'+_0x292d48+'/'+_0x55b9d3)[_0x05d7('0x1e')](_0x5ba163);}return null;};}function patchUpdates(_0x31199b){return function(_0x4e182f){try{jsonpatch[_0x05d7('0x24')](_0x4e182f,_0x31199b,!![]);}catch(_0x47d3ca){return BPromise['reject'](_0x47d3ca);}return _0x4e182f[_0x05d7('0x25')]();};}function saveUpdates(_0x356fe7,_0xd1e51b){return function(_0x10fde1){if(_0x10fde1){return _0x10fde1[_0x05d7('0x26')](_0x356fe7)[_0x05d7('0x27')](function(_0x34aaad){return _0x34aaad;});}return null;};}function removeEntity(_0x1d0bee,_0x31081f){return function(_0x81dab7){if(_0x81dab7){return _0x81dab7[_0x05d7('0x28')]()[_0x05d7('0x27')](function(){_0x1d0bee[_0x05d7('0x1c')](0xcc)[_0x05d7('0x1d')]();});}};}function handleEntityNotFound(_0x32e802,_0x2083d5){return function(_0x4e33bb){if(!_0x4e33bb){_0x32e802['sendStatus'](0x194);}return _0x4e33bb;};}function handleError(_0x5d3bad,_0xefd156){_0xefd156=_0xefd156||0x1f4;return function(_0x2b2e93){logger[_0x05d7('0x29')](_0x2b2e93[_0x05d7('0x2a')]);if(_0x2b2e93[_0x05d7('0x2b')]){delete _0x2b2e93[_0x05d7('0x2b')];}_0x5d3bad[_0x05d7('0x1c')](_0xefd156)['send'](_0x2b2e93);};}exports[_0x05d7('0x2c')]=function(_0x355d2b,_0x24c125){var _0x232238={'raw':!![],'where':{'id':_0x355d2b[_0x05d7('0x2d')]['id']}},_0x3cf995={};_0x3cf995[_0x05d7('0x2e')]=_[_0x05d7('0x2f')](db[_0x05d7('0x30')]['rawAttributes']);_0x3cf995[_0x05d7('0x31')]=_[_0x05d7('0x2f')](_0x355d2b[_0x05d7('0x31')]);_0x3cf995[_0x05d7('0x32')]=_[_0x05d7('0x33')](_0x3cf995[_0x05d7('0x2e')],_0x3cf995['query']);_0x232238[_0x05d7('0x34')]=_[_0x05d7('0x33')](_0x3cf995[_0x05d7('0x2e')],qs['fields'](_0x355d2b[_0x05d7('0x31')][_0x05d7('0x35')]));_0x232238[_0x05d7('0x34')]=_0x232238['attributes']['length']?_0x232238[_0x05d7('0x34')]:_0x3cf995[_0x05d7('0x2e')];if(_0x355d2b[_0x05d7('0x31')][_0x05d7('0x36')]){_0x232238[_0x05d7('0x37')]=[{'all':!![]}];}_0x232238=_['merge']({},_0x232238,_0x355d2b[_0x05d7('0x38')]);return db['ChatApplication'][_0x05d7('0x39')](_0x232238)[_0x05d7('0x27')](handleEntityNotFound(_0x24c125,null))[_0x05d7('0x27')](respondWithResult(_0x24c125,null))[_0x05d7('0x3a')](handleError(_0x24c125,null));};exports[_0x05d7('0x26')]=function(_0x821d1f,_0x57667e){if(_0x821d1f['body']['id']){delete _0x821d1f[_0x05d7('0x3b')]['id'];}return db['ChatApplication'][_0x05d7('0x39')]({'where':{'id':_0x821d1f[_0x05d7('0x2d')]['id']}})[_0x05d7('0x27')](handleEntityNotFound(_0x57667e,null))[_0x05d7('0x27')](saveUpdates(_0x821d1f[_0x05d7('0x3b')],null))[_0x05d7('0x27')](respondWithResult(_0x57667e,null))[_0x05d7('0x3a')](handleError(_0x57667e,null));};exports['destroy']=function(_0x256f0c,_0x5259fa){return db[_0x05d7('0x30')][_0x05d7('0x39')]({'where':{'id':_0x256f0c[_0x05d7('0x2d')]['id']}})['then'](handleEntityNotFound(_0x5259fa,null))[_0x05d7('0x27')](removeEntity(_0x5259fa,null))[_0x05d7('0x3a')](handleError(_0x5259fa,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index c531097..505a800 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 _0x4ddd=['path','rimraf','../../config/environment','exports','define','ChatApplication','chat_applications','utf8mb4','lodash'];(function(_0x2fd743,_0x4f01ad){var _0x3eebfc=function(_0x40b500){while(--_0x40b500){_0x2fd743['push'](_0x2fd743['shift']());}};_0x3eebfc(++_0x4f01ad);}(_0x4ddd,0x18b));var _0xd4dd=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x4ddd[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0xd4dd('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd4dd('0x1'));var rimraf=require(_0xd4dd('0x2'));var config=require(_0xd4dd('0x3'));var attributes=require('./chatApplication.attributes');module[_0xd4dd('0x4')]=function(_0x207f91,_0x2796e1){return _0x207f91[_0xd4dd('0x5')](_0xd4dd('0x6'),attributes,{'tableName':_0xd4dd('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd4dd('0x8'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x046b=['moment','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0x4aba6d,_0x57944b){var _0x737743=function(_0x17eb72){while(--_0x17eb72){_0x4aba6d['push'](_0x4aba6d['shift']());}};_0x737743(++_0x57944b);}(_0x046b,0x147));var _0xb046=function(_0x413150,_0x593369){_0x413150=_0x413150-0x0;var _0x25a161=_0x046b[_0x413150];return _0x25a161;};'use strict';var _=require('lodash');var util=require(_0xb046('0x0'));var logger=require(_0xb046('0x1'))(_0xb046('0x2'));var moment=require(_0xb046('0x3'));var BPromise=require(_0xb046('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb046('0x5'));var rimraf=require(_0xb046('0x6'));var config=require(_0xb046('0x7'));var attributes=require(_0xb046('0x8'));module[_0xb046('0x9')]=function(_0x5511db,_0x5c06b5){return _0x5511db[_0xb046('0xa')](_0xb046('0xb'),attributes,{'tableName':_0xb046('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb046('0xd'),'collate':_0xb046('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index d3db3eb..deab2b9 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 _0x3508=['../../config/logger','rpc','jayson/promise','client','request','then','ChatApplication,\x20%s,\x20%s','error','code','message','request\x20sent','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x55d260,_0x339f31){var _0x1ec8b4=function(_0x54c556){while(--_0x54c556){_0x55d260['push'](_0x55d260['shift']());}};_0x1ec8b4(++_0x339f31);}(_0x3508,0x1ce));var _0x8350=function(_0x294a4f,_0x2f1d1f){_0x294a4f=_0x294a4f-0x0;var _0x7da50f=_0x3508[_0x294a4f];return _0x7da50f;};'use strict';var _=require(_0x8350('0x0'));var util=require(_0x8350('0x1'));var moment=require('moment');var BPromise=require(_0x8350('0x2'));var rs=require(_0x8350('0x3'));var fs=require('fs');var Redis=require(_0x8350('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8350('0x5'));var logger=require(_0x8350('0x6'))(_0x8350('0x7'));var config=require('../../config/environment');var jayson=require(_0x8350('0x8'));var client=jayson[_0x8350('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f1d0a,_0x16cea4,_0x529fd3){return new BPromise(function(_0x5aec5c,_0x184d0d){return client[_0x8350('0xa')](_0x1f1d0a,_0x529fd3)[_0x8350('0xb')](function(_0x51896a){logger['info'](_0x8350('0xc'),_0x16cea4,'request\x20sent');logger['debug']('ChatApplication,\x20%s,\x20%s,\x20%s',_0x16cea4,'request\x20sent',JSON['stringify'](_0x51896a));if(_0x51896a[_0x8350('0xd')]){if(_0x51896a[_0x8350('0xd')][_0x8350('0xe')]===0x1f4){logger['error'](_0x8350('0xc'),_0x16cea4,_0x51896a[_0x8350('0xd')][_0x8350('0xf')]);return _0x184d0d(_0x51896a[_0x8350('0xd')][_0x8350('0xf')]);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x16cea4,_0x51896a[_0x8350('0xd')][_0x8350('0xf')]);return _0x5aec5c(_0x51896a[_0x8350('0xd')][_0x8350('0xf')]);}else{logger['info'](_0x8350('0xc'),_0x16cea4,_0x8350('0x10'));_0x5aec5c(_0x51896a[_0x8350('0x11')][_0x8350('0xf')]);}})['catch'](function(_0x557a44){logger[_0x8350('0xd')](_0x8350('0xc'),_0x16cea4,_0x557a44);_0x184d0d(_0x557a44);});});}
\ No newline at end of file
+var _0x7f2a=['then','info','request\x20sent','debug','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','result','lodash','moment','../../config/utils','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x11be52,_0x2ef4f4){var _0x5b0bf8=function(_0x3659b6){while(--_0x3659b6){_0x11be52['push'](_0x11be52['shift']());}};_0x5b0bf8(++_0x2ef4f4);}(_0x7f2a,0x88));var _0xa7f2=function(_0x4567c7,_0x43a4cb){_0x4567c7=_0x4567c7-0x0;var _0x490218=_0x7f2a[_0x4567c7];return _0x490218;};'use strict';var _=require(_0xa7f2('0x0'));var util=require('util');var moment=require(_0xa7f2('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa7f2('0x2'));var logger=require('../../config/logger')(_0xa7f2('0x3'));var config=require(_0xa7f2('0x4'));var jayson=require(_0xa7f2('0x5'));var client=jayson[_0xa7f2('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a64ed,_0x409747,_0x5f00a5){return new BPromise(function(_0x32f3f4,_0x5eb166){return client[_0xa7f2('0x7')](_0x3a64ed,_0x5f00a5)[_0xa7f2('0x8')](function(_0x38c028){logger[_0xa7f2('0x9')]('ChatApplication,\x20%s,\x20%s',_0x409747,_0xa7f2('0xa'));logger[_0xa7f2('0xb')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x409747,_0xa7f2('0xa'),JSON[_0xa7f2('0xc')](_0x38c028));if(_0x38c028[_0xa7f2('0xd')]){if(_0x38c028[_0xa7f2('0xd')][_0xa7f2('0xe')]===0x1f4){logger[_0xa7f2('0xd')](_0xa7f2('0xf'),_0x409747,_0x38c028[_0xa7f2('0xd')][_0xa7f2('0x10')]);return _0x5eb166(_0x38c028[_0xa7f2('0xd')]['message']);}logger[_0xa7f2('0xd')](_0xa7f2('0xf'),_0x409747,_0x38c028[_0xa7f2('0xd')][_0xa7f2('0x10')]);return _0x32f3f4(_0x38c028['error']['message']);}else{logger[_0xa7f2('0x9')](_0xa7f2('0xf'),_0x409747,'request\x20sent');_0x32f3f4(_0x38c028[_0xa7f2('0x11')][_0xa7f2('0x10')]);}})['catch'](function(_0x180467){logger['error']('ChatApplication,\x20%s,\x20%s',_0x409747,_0x180467);_0x5eb166(_0x180467);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 68c701d..dc408be 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 _0xa710=['delete','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','update'];(function(_0x25b4cb,_0x45ad64){var _0x4e1e24=function(_0x25576a){while(--_0x25576a){_0x25b4cb['push'](_0x25b4cb['shift']());}};_0x4e1e24(++_0x45ad64);}(_0xa710,0x1f0));var _0x0a71=function(_0x36587e,_0x4fdd5e){_0x36587e=_0x36587e-0x0;var _0x73e98d=_0xa710[_0x36587e];return _0x73e98d;};'use strict';var multer=require(_0x0a71('0x0'));var util=require(_0x0a71('0x1'));var path=require('path');var timeout=require(_0x0a71('0x2'));var express=require(_0x0a71('0x3'));var router=express['Router']();var fs_extra=require(_0x0a71('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0a71('0x5'));var config=require(_0x0a71('0x6'));var controller=require('./chatApplication.controller');router['get'](_0x0a71('0x7'),auth[_0x0a71('0x8')](),controller['show']);router['put'](_0x0a71('0x7'),auth[_0x0a71('0x8')](),controller[_0x0a71('0x9')]);router[_0x0a71('0xa')]('/:id',auth[_0x0a71('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x5be1=['./chatApplication.controller','get','/:id','show','isAuthenticated','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x4f7a8b,_0x513475){var _0xe2057f=function(_0x2b3660){while(--_0x2b3660){_0x4f7a8b['push'](_0x4f7a8b['shift']());}};_0xe2057f(++_0x513475);}(_0x5be1,0x1d7));var _0x15be=function(_0x5b6eb0,_0x11fe92){_0x5b6eb0=_0x5b6eb0-0x0;var _0x44e043=_0x5be1[_0x5b6eb0];return _0x44e043;};'use strict';var multer=require(_0x15be('0x0'));var util=require(_0x15be('0x1'));var path=require(_0x15be('0x2'));var timeout=require(_0x15be('0x3'));var express=require(_0x15be('0x4'));var router=express[_0x15be('0x5')]();var fs_extra=require(_0x15be('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x15be('0x7'));var config=require(_0x15be('0x8'));var controller=require(_0x15be('0x9'));router[_0x15be('0xa')](_0x15be('0xb'),auth['isAuthenticated'](),controller[_0x15be('0xc')]);router['put'](_0x15be('0xb'),auth[_0x15be('0xd')](),controller[_0x15be('0xe')]);router['delete']('/:id',auth[_0x15be('0xd')](),controller[_0x15be('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 730f4e5..002fce5 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 _0xb43c=['STRING','BOOLEAN','sequelize','exports'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0xb43c,0x1ea));var _0xcb43=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb43c[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xcb43('0x0'));module[_0xcb43('0x1')]={'name':{'type':Sequelize[_0xcb43('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xcb43('0x2')]},'write':{'type':Sequelize[_0xcb43('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xecb2=['sequelize','STRING'];(function(_0x182ecd,_0x2f2fe1){var _0x5d3275=function(_0x51d51d){while(--_0x51d51d){_0x182ecd['push'](_0x182ecd['shift']());}};_0x5d3275(++_0x2f2fe1);}(_0xecb2,0xf6));var _0x2ecb=function(_0x3d811c,_0x28a057){_0x3d811c=_0x3d811c-0x0;var _0x2c7e17=_0xecb2[_0x3d811c];return _0x2c7e17;};'use strict';var Sequelize=require(_0x2ecb('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x2ecb('0x1')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 004e9a4..76b7859 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 _0xbb70=['split','getMessages','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','defaults','redis','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','merge','VIRTUAL','filter','options','ChatGroup','includeAll','include','rows','catch','show','params','length','find','create','body','describe','getUnread','user','toInteger','addMembers','ids','getMembers','User','where','removeMembers','addMessage','ChatGroupId','findOne','ChatInternalMessage','$gte'];(function(_0x2c8374,_0x5814ab){var _0x6c87d9=function(_0x175add){while(--_0x175add){_0x2c8374['push'](_0x2c8374['shift']());}};_0x6c87d9(++_0x5814ab);}(_0xbb70,0x11f));var _0x0bb7=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0xbb70[_0x39d544];return _0x5a5ff2;};'use strict';var emlformat=require(_0x0bb7('0x0'));var rimraf=require(_0x0bb7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0bb7('0x2'));var rp=require('request-promise');var moment=require(_0x0bb7('0x3'));var BPromise=require(_0x0bb7('0x4'));var Mustache=require(_0x0bb7('0x5'));var util=require(_0x0bb7('0x6'));var path=require(_0x0bb7('0x7'));var sox=require(_0x0bb7('0x8'));var csv=require(_0x0bb7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0bb7('0xa'));var _=require(_0x0bb7('0xb'));var squel=require('squel');var crypto=require(_0x0bb7('0xc'));var jsforce=require(_0x0bb7('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0bb7('0x9'));var querystring=require(_0x0bb7('0xe'));var Papa=require(_0x0bb7('0xf'));var Redis=require('ioredis');var authService=require(_0x0bb7('0x10'));var qs=require(_0x0bb7('0x11'));var as=require(_0x0bb7('0x12'));var hardwareService=require(_0x0bb7('0x13'));var logger=require(_0x0bb7('0x14'))(_0x0bb7('0x15'));var utils=require(_0x0bb7('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0bb7('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0bb7('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0bb7('0x19')]));require('./chatGroup.socket')[_0x0bb7('0x1a')](socket);function respondWithStatusCode(_0x52940d,_0x2e8862){_0x2e8862=_0x2e8862||0xcc;return function(_0x35f754){if(_0x35f754){return _0x52940d[_0x0bb7('0x1b')](_0x2e8862);}return _0x52940d[_0x0bb7('0x1c')](_0x2e8862)[_0x0bb7('0x1d')]();};}function respondWithResult(_0x1230fd,_0x3c6b5e){_0x3c6b5e=_0x3c6b5e||0xc8;return function(_0x50a6f9){if(_0x50a6f9){return _0x1230fd[_0x0bb7('0x1c')](_0x3c6b5e)[_0x0bb7('0x1e')](_0x50a6f9);}};}function respondWithFilteredResult(_0x14f29c,_0x56751d){return function(_0x2a5a04){if(_0x2a5a04){var _0x52e091=typeof _0x56751d[_0x0bb7('0x1f')]===_0x0bb7('0x20')&&typeof _0x56751d[_0x0bb7('0x21')]===_0x0bb7('0x20');var _0x3a49d0=_0x2a5a04[_0x0bb7('0x22')];var _0x4c7944=_0x52e091?0x0:_0x56751d[_0x0bb7('0x1f')];var _0x49009b=_0x52e091?_0x2a5a04[_0x0bb7('0x22')]:_0x56751d[_0x0bb7('0x1f')]+_0x56751d[_0x0bb7('0x21')];var _0x24f8c1;if(_0x49009b>=_0x3a49d0){_0x49009b=_0x3a49d0;_0x24f8c1=0xc8;}else{_0x24f8c1=0xce;}_0x14f29c[_0x0bb7('0x1c')](_0x24f8c1);return _0x14f29c[_0x0bb7('0x23')](_0x0bb7('0x24'),_0x4c7944+'-'+_0x49009b+'/'+_0x3a49d0)[_0x0bb7('0x1e')](_0x2a5a04);}return null;};}function patchUpdates(_0x4f2499){return function(_0x3e774b){try{jsonpatch[_0x0bb7('0x25')](_0x3e774b,_0x4f2499,!![]);}catch(_0x13ca13){return BPromise[_0x0bb7('0x26')](_0x13ca13);}return _0x3e774b['save']();};}function saveUpdates(_0xe1c7eb,_0x1f4f60){return function(_0x1f1f0f){if(_0x1f1f0f){return _0x1f1f0f[_0x0bb7('0x27')](_0xe1c7eb)[_0x0bb7('0x28')](function(_0x47f6e8){return _0x47f6e8;});}return null;};}function removeEntity(_0x27ee27,_0x555d67){return function(_0x5c6b43){if(_0x5c6b43){return _0x5c6b43[_0x0bb7('0x29')]()['then'](function(){_0x27ee27[_0x0bb7('0x1c')](0xcc)[_0x0bb7('0x1d')]();});}};}function handleEntityNotFound(_0x2a360b,_0x4e2a41){return function(_0x2adc29){if(!_0x2adc29){_0x2a360b[_0x0bb7('0x1b')](0x194);}return _0x2adc29;};}function handleError(_0x2b4df8,_0x5a07e0){_0x5a07e0=_0x5a07e0||0x1f4;return function(_0x2db53f){logger[_0x0bb7('0x2a')](_0x2db53f[_0x0bb7('0x2b')]);if(_0x2db53f[_0x0bb7('0x2c')]){delete _0x2db53f[_0x0bb7('0x2c')];}_0x2b4df8[_0x0bb7('0x1c')](_0x5a07e0)[_0x0bb7('0x2d')](_0x2db53f);};}exports['index']=function(_0x4e5615,_0x451ca7){var _0x25aa56={},_0x42f319={},_0x11726a={'count':0x0,'rows':[]};var _0x7e8b7=_[_0x0bb7('0x2e')](db['ChatGroup'][_0x0bb7('0x2f')],function(_0x4b2332){return{'name':_0x4b2332[_0x0bb7('0x30')],'type':_0x4b2332[_0x0bb7('0x31')][_0x0bb7('0x32')]};});_0x42f319['model']=_[_0x0bb7('0x2e')](_0x7e8b7,_0x0bb7('0x2c'));_0x42f319['query']=_[_0x0bb7('0x33')](_0x4e5615[_0x0bb7('0x34')]);_0x42f319[_0x0bb7('0x35')]=_[_0x0bb7('0x36')](_0x42f319[_0x0bb7('0x37')],_0x42f319[_0x0bb7('0x34')]);_0x25aa56[_0x0bb7('0x38')]=_[_0x0bb7('0x36')](_0x42f319[_0x0bb7('0x37')],qs[_0x0bb7('0x39')](_0x4e5615[_0x0bb7('0x34')][_0x0bb7('0x39')]));_0x25aa56[_0x0bb7('0x38')]=_0x25aa56['attributes']['length']?_0x25aa56['attributes']:_0x42f319['model'];if(!_0x4e5615['query'][_0x0bb7('0x3a')](_0x0bb7('0x3b'))){_0x25aa56[_0x0bb7('0x21')]=qs[_0x0bb7('0x21')](_0x4e5615[_0x0bb7('0x34')]['limit']);_0x25aa56[_0x0bb7('0x1f')]=qs[_0x0bb7('0x1f')](_0x4e5615[_0x0bb7('0x34')][_0x0bb7('0x1f')]);}_0x25aa56[_0x0bb7('0x3c')]=qs[_0x0bb7('0x3d')](_0x4e5615[_0x0bb7('0x34')][_0x0bb7('0x3d')]);_0x25aa56['where']=qs[_0x0bb7('0x35')](_[_0x0bb7('0x3e')](_0x4e5615[_0x0bb7('0x34')],_0x42f319[_0x0bb7('0x35')]),_0x7e8b7);if(_0x4e5615[_0x0bb7('0x34')]['filter']){_0x25aa56['where']=_[_0x0bb7('0x3f')](_0x25aa56['where'],{'$or':_[_0x0bb7('0x2e')](_0x7e8b7,function(_0x489e83){if(_0x489e83[_0x0bb7('0x31')]!==_0x0bb7('0x40')){var _0x2eaf61={};_0x2eaf61[_0x489e83['name']]={'$like':'%'+_0x4e5615[_0x0bb7('0x34')][_0x0bb7('0x41')]+'%'};return _0x2eaf61;}})});}_0x25aa56=_[_0x0bb7('0x3f')]({},_0x25aa56,_0x4e5615[_0x0bb7('0x42')]);var _0x474987={'where':_0x25aa56['where']};return db[_0x0bb7('0x43')][_0x0bb7('0x22')](_0x474987)[_0x0bb7('0x28')](function(_0x5a230b){_0x11726a[_0x0bb7('0x22')]=_0x5a230b;if(_0x4e5615[_0x0bb7('0x34')][_0x0bb7('0x44')]){_0x25aa56[_0x0bb7('0x45')]=[{'all':!![]}];}return db[_0x0bb7('0x43')]['findAll'](_0x25aa56);})[_0x0bb7('0x28')](function(_0x117699){_0x11726a[_0x0bb7('0x46')]=_0x117699;return _0x11726a;})[_0x0bb7('0x28')](respondWithFilteredResult(_0x451ca7,_0x25aa56))[_0x0bb7('0x47')](handleError(_0x451ca7,null));};exports[_0x0bb7('0x48')]=function(_0x550354,_0x23723c){var _0x373821={'raw':!![],'where':{'id':_0x550354[_0x0bb7('0x49')]['id']}},_0x4e3a13={};_0x4e3a13['model']=_['keys'](db['ChatGroup']['rawAttributes']);_0x4e3a13[_0x0bb7('0x34')]=_[_0x0bb7('0x33')](_0x550354[_0x0bb7('0x34')]);_0x4e3a13[_0x0bb7('0x35')]=_[_0x0bb7('0x36')](_0x4e3a13['model'],_0x4e3a13[_0x0bb7('0x34')]);_0x373821['attributes']=_[_0x0bb7('0x36')](_0x4e3a13[_0x0bb7('0x37')],qs[_0x0bb7('0x39')](_0x550354['query']['fields']));_0x373821[_0x0bb7('0x38')]=_0x373821[_0x0bb7('0x38')][_0x0bb7('0x4a')]?_0x373821['attributes']:_0x4e3a13[_0x0bb7('0x37')];if(_0x550354['query'][_0x0bb7('0x44')]){_0x373821[_0x0bb7('0x45')]=[{'all':!![]}];}_0x373821=_[_0x0bb7('0x3f')]({},_0x373821,_0x550354[_0x0bb7('0x42')]);return db[_0x0bb7('0x43')][_0x0bb7('0x4b')](_0x373821)[_0x0bb7('0x28')](handleEntityNotFound(_0x23723c,null))[_0x0bb7('0x28')](respondWithResult(_0x23723c,null))[_0x0bb7('0x47')](handleError(_0x23723c,null));};exports[_0x0bb7('0x4c')]=function(_0x376d49,_0x3d7011){return db[_0x0bb7('0x43')][_0x0bb7('0x4c')](_0x376d49[_0x0bb7('0x4d')],{})[_0x0bb7('0x28')](respondWithResult(_0x3d7011,0xc9))[_0x0bb7('0x47')](handleError(_0x3d7011,null));};exports['update']=function(_0x4bf793,_0x3d983e){if(_0x4bf793['body']['id']){delete _0x4bf793[_0x0bb7('0x4d')]['id'];}return db['ChatGroup'][_0x0bb7('0x4b')]({'where':{'id':_0x4bf793[_0x0bb7('0x49')]['id']}})[_0x0bb7('0x28')](handleEntityNotFound(_0x3d983e,null))['then'](saveUpdates(_0x4bf793[_0x0bb7('0x4d')],null))[_0x0bb7('0x28')](respondWithResult(_0x3d983e,null))[_0x0bb7('0x47')](handleError(_0x3d983e,null));};exports[_0x0bb7('0x29')]=function(_0x1ad481,_0x1487db){return db[_0x0bb7('0x43')]['find']({'where':{'id':_0x1ad481[_0x0bb7('0x49')]['id']}})[_0x0bb7('0x28')](handleEntityNotFound(_0x1487db,null))[_0x0bb7('0x28')](removeEntity(_0x1487db,null))[_0x0bb7('0x47')](handleError(_0x1487db,null));};exports[_0x0bb7('0x4e')]=function(_0x328983,_0x4d1110){return db[_0x0bb7('0x43')][_0x0bb7('0x4e')]()[_0x0bb7('0x28')](respondWithResult(_0x4d1110,null))[_0x0bb7('0x47')](handleError(_0x4d1110,null));};exports[_0x0bb7('0x4f')]=function(_0x43adb8,_0x55f5e3,_0xa406ce){return db['ChatInternalMessage'][_0x0bb7('0x22')]({'where':{'ChatGroupId':_0x43adb8[_0x0bb7('0x49')]['id'],'ToId':_0x43adb8[_0x0bb7('0x50')]['id'],'read':![]}})[_0x0bb7('0x28')](function(_0x11d0db){return{'id':_[_0x0bb7('0x51')](_0x43adb8[_0x0bb7('0x49')]['id']),'count':_0x11d0db};})['then'](respondWithResult(_0x55f5e3,null))[_0x0bb7('0x47')](handleError(_0x55f5e3,null));};exports[_0x0bb7('0x52')]=function(_0x3b6180,_0x312160,_0x38bdf0){return db['ChatGroup'][_0x0bb7('0x4b')]({'where':{'id':_0x3b6180[_0x0bb7('0x49')]['id']}})['then'](handleEntityNotFound(_0x312160,null))[_0x0bb7('0x28')](function(_0x5e2b1e){if(_0x5e2b1e){return _0x5e2b1e[_0x0bb7('0x52')](_0x3b6180[_0x0bb7('0x4d')][_0x0bb7('0x53')],_['omit'](_0x3b6180[_0x0bb7('0x4d')],['ids','id'])||{});}})[_0x0bb7('0x28')](respondWithResult(_0x312160,null))['catch'](handleError(_0x312160,null));};exports[_0x0bb7('0x54')]=function(_0x57a06b,_0x4aef79,_0x519f15){var _0x475c4c={};var _0x2d6902={};var _0x59952c;var _0x29b9e8;return db['ChatGroup']['findOne']({'where':{'id':_0x57a06b[_0x0bb7('0x49')]['id']}})[_0x0bb7('0x28')](handleEntityNotFound(_0x4aef79,null))[_0x0bb7('0x28')](function(_0x5823fd){if(_0x5823fd){_0x59952c=_0x5823fd;_0x2d6902[_0x0bb7('0x37')]=_[_0x0bb7('0x33')](db[_0x0bb7('0x55')][_0x0bb7('0x2f')]);_0x2d6902[_0x0bb7('0x34')]=_[_0x0bb7('0x33')](_0x57a06b[_0x0bb7('0x34')]);_0x2d6902[_0x0bb7('0x35')]=_[_0x0bb7('0x36')](_0x2d6902['model'],_0x2d6902[_0x0bb7('0x34')]);_0x475c4c[_0x0bb7('0x38')]=_[_0x0bb7('0x36')](_0x2d6902['model'],qs[_0x0bb7('0x39')](_0x57a06b['query'][_0x0bb7('0x39')]));_0x475c4c['attributes']=_0x475c4c[_0x0bb7('0x38')][_0x0bb7('0x4a')]?_0x475c4c[_0x0bb7('0x38')]:_0x2d6902[_0x0bb7('0x37')];_0x475c4c[_0x0bb7('0x3c')]=qs[_0x0bb7('0x3d')](_0x57a06b[_0x0bb7('0x34')][_0x0bb7('0x3d')]);_0x475c4c[_0x0bb7('0x56')]=qs[_0x0bb7('0x35')](_[_0x0bb7('0x3e')](_0x57a06b[_0x0bb7('0x34')],_0x2d6902[_0x0bb7('0x35')]));if(_0x57a06b['query'][_0x0bb7('0x41')]){_0x475c4c[_0x0bb7('0x56')]=_[_0x0bb7('0x3f')](_0x475c4c[_0x0bb7('0x56')],{'$or':_['map'](_0x475c4c['attributes'],function(_0x56d94b){var _0x5cda63={};_0x5cda63[_0x56d94b]={'$like':'%'+_0x57a06b[_0x0bb7('0x34')][_0x0bb7('0x41')]+'%'};return _0x5cda63;})});}_0x475c4c=_[_0x0bb7('0x3f')]({},_0x475c4c,_0x57a06b[_0x0bb7('0x42')]);return _0x59952c[_0x0bb7('0x54')](_0x475c4c);}})[_0x0bb7('0x28')](function(_0x4e9fa7){if(_0x4e9fa7){_0x29b9e8=_0x4e9fa7['length'];if(!_0x57a06b['query'][_0x0bb7('0x3a')]('nolimit')){_0x475c4c['limit']=qs[_0x0bb7('0x21')](_0x57a06b['query'][_0x0bb7('0x21')]);_0x475c4c[_0x0bb7('0x1f')]=qs[_0x0bb7('0x1f')](_0x57a06b[_0x0bb7('0x34')][_0x0bb7('0x1f')]);}return _0x59952c[_0x0bb7('0x54')](_0x475c4c);}})[_0x0bb7('0x28')](function(_0x15ae95){if(_0x15ae95){return _0x15ae95?{'count':_0x29b9e8,'rows':_0x15ae95}:null;}})[_0x0bb7('0x28')](respondWithResult(_0x4aef79,null))[_0x0bb7('0x47')](handleError(_0x4aef79,null));};exports[_0x0bb7('0x57')]=function(_0x3375e1,_0x44affe,_0x5032a1){return db[_0x0bb7('0x43')][_0x0bb7('0x4b')]({'where':{'id':_0x3375e1[_0x0bb7('0x49')]['id']}})[_0x0bb7('0x28')](handleEntityNotFound(_0x44affe,null))[_0x0bb7('0x28')](function(_0x517d29){if(_0x517d29){return _0x517d29[_0x0bb7('0x57')](_0x3375e1[_0x0bb7('0x34')][_0x0bb7('0x53')]);}})[_0x0bb7('0x28')](respondWithStatusCode(_0x44affe,null))[_0x0bb7('0x47')](handleError(_0x44affe,null));};exports[_0x0bb7('0x58')]=function(_0x14202e,_0x30377d,_0x5e5516){if(_0x14202e[_0x0bb7('0x4d')]['id']){delete _0x14202e[_0x0bb7('0x4d')]['id'];}return db[_0x0bb7('0x43')][_0x0bb7('0x4b')]({'where':{'id':_0x14202e[_0x0bb7('0x49')]['id']}})[_0x0bb7('0x28')](handleEntityNotFound(_0x30377d,null))[_0x0bb7('0x28')](function(_0x585e06){if(_0x585e06){_0x14202e[_0x0bb7('0x4d')][_0x0bb7('0x59')]=_0x585e06['id'];return db['ChatInternalMessage']['create'](_0x14202e[_0x0bb7('0x4d')]);}})[_0x0bb7('0x28')](respondWithResult(_0x30377d,null))[_0x0bb7('0x47')](handleError(_0x30377d,null));};exports['getMessages']=function(_0x1d66a8,_0x1e5df4,_0x3e116c){var _0x3d3e7f={};var _0x55bcf6={};var _0x4476ca;var _0xf06108;return db[_0x0bb7('0x43')][_0x0bb7('0x5a')]({'where':{'id':_0x1d66a8[_0x0bb7('0x49')]['id']}})['then'](handleEntityNotFound(_0x1e5df4,null))[_0x0bb7('0x28')](function(_0x5c3f3e){if(_0x5c3f3e){_0x4476ca=_0x5c3f3e;_0x55bcf6['model']=_[_0x0bb7('0x33')](db[_0x0bb7('0x5b')][_0x0bb7('0x2f')]);_0x55bcf6[_0x0bb7('0x34')]=_[_0x0bb7('0x33')](_0x1d66a8[_0x0bb7('0x34')]);_0x55bcf6['filters']=_['intersection'](_0x55bcf6['model'],_0x55bcf6[_0x0bb7('0x34')]);_0x3d3e7f[_0x0bb7('0x38')]=_[_0x0bb7('0x36')](_0x55bcf6[_0x0bb7('0x37')],qs['fields'](_0x1d66a8[_0x0bb7('0x34')]['fields']));_0x3d3e7f[_0x0bb7('0x38')]=_0x3d3e7f[_0x0bb7('0x38')][_0x0bb7('0x4a')]?_0x3d3e7f[_0x0bb7('0x38')]:_0x55bcf6[_0x0bb7('0x37')];_0x3d3e7f['order']=qs[_0x0bb7('0x3d')](_0x1d66a8[_0x0bb7('0x34')][_0x0bb7('0x3d')]);_0x3d3e7f[_0x0bb7('0x56')]=qs[_0x0bb7('0x35')](_['pick'](_0x1d66a8['query'],_0x55bcf6['filters']));if(_0x1d66a8[_0x0bb7('0x34')][_0x0bb7('0x41')]){_0x3d3e7f['where']=_['merge'](_0x3d3e7f['where'],{'$or':_['map'](_0x3d3e7f[_0x0bb7('0x38')],function(_0xe05b2d){var _0x5c2f52={};_0x5c2f52[_0xe05b2d]={'$like':'%'+_0x1d66a8['query'][_0x0bb7('0x41')]+'%'};return _0x5c2f52;})});}if(_0x1d66a8['query'][_0x0bb7('0x5c')]){var _0x7acec9=_0x1d66a8['query'][_0x0bb7('0x5c')][_0x0bb7('0x5d')](',');var _0x101501={};_0x101501[_0x7acec9[0x0]]={'$gte':moment(_0x7acec9[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x3d3e7f[_0x0bb7('0x56')]=_[_0x0bb7('0x3f')](_0x3d3e7f[_0x0bb7('0x56')],_0x101501);}_0x3d3e7f=_[_0x0bb7('0x3f')]({},_0x3d3e7f,_0x1d66a8[_0x0bb7('0x42')]);return _0x4476ca[_0x0bb7('0x5e')](_0x3d3e7f);}})[_0x0bb7('0x28')](function(_0x3ff5d3){if(_0x3ff5d3){_0xf06108=_0x3ff5d3[_0x0bb7('0x4a')];if(!_0x1d66a8[_0x0bb7('0x34')][_0x0bb7('0x3a')](_0x0bb7('0x3b'))){_0x3d3e7f[_0x0bb7('0x21')]=qs[_0x0bb7('0x21')](_0x1d66a8[_0x0bb7('0x34')][_0x0bb7('0x21')]);_0x3d3e7f[_0x0bb7('0x1f')]=qs[_0x0bb7('0x1f')](_0x1d66a8[_0x0bb7('0x34')][_0x0bb7('0x1f')]);}return _0x4476ca['getMessages'](_0x3d3e7f);}})['then'](function(_0x81df0b){if(_0x81df0b){return _0x81df0b?{'count':_0xf06108,'rows':_0x81df0b}:null;}})[_0x0bb7('0x28')](respondWithResult(_0x1e5df4,null))[_0x0bb7('0x47')](handleError(_0x1e5df4,null));};
\ No newline at end of file
+var _0x8036=['getMembers','findOne','User','rawAttributes','order','removeMembers','addMessage','ChatGroupId','getMessages','pick','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','destroy','then','error','stack','send','map','ChatGroup','fieldName','type','key','name','keys','query','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','findAll','rows','catch','show','params','intersection','includeAll','include','options','create','body','update','find','describe','ChatInternalMessage','user','toInteger','addMembers','ids','omit'];(function(_0xa41073,_0x4a013c){var _0x5295f2=function(_0x5536b7){while(--_0x5536b7){_0xa41073['push'](_0xa41073['shift']());}};_0x5295f2(++_0x4a013c);}(_0x8036,0xd2));var _0x6803=function(_0x515a49,_0x42be5e){_0x515a49=_0x515a49-0x0;var _0x5e51a3=_0x8036[_0x515a49];return _0x5e51a3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6803('0x0'));var rp=require(_0x6803('0x1'));var moment=require(_0x6803('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x6803('0x3'));var util=require(_0x6803('0x4'));var path=require(_0x6803('0x5'));var sox=require(_0x6803('0x6'));var csv=require(_0x6803('0x7'));var ejs=require(_0x6803('0x8'));var fs=require('fs');var fs_extra=require(_0x6803('0x9'));var _=require(_0x6803('0xa'));var squel=require(_0x6803('0xb'));var crypto=require('crypto');var jsforce=require(_0x6803('0xc'));var deskjs=require(_0x6803('0xd'));var toCsv=require(_0x6803('0x7'));var querystring=require('querystring');var Papa=require(_0x6803('0xe'));var Redis=require(_0x6803('0xf'));var authService=require(_0x6803('0x10'));var qs=require(_0x6803('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6803('0x12'));var logger=require(_0x6803('0x13'))('api');var utils=require(_0x6803('0x14'));var config=require(_0x6803('0x15'));var licenseUtil=require(_0x6803('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x6803('0x17')](config[_0x6803('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6803('0x19'))[_0x6803('0x1a')](socket);function respondWithStatusCode(_0xdbde20,_0x126ebc){_0x126ebc=_0x126ebc||0xcc;return function(_0x35131e){if(_0x35131e){return _0xdbde20[_0x6803('0x1b')](_0x126ebc);}return _0xdbde20[_0x6803('0x1c')](_0x126ebc)[_0x6803('0x1d')]();};}function respondWithResult(_0x4f6468,_0x41cc04){_0x41cc04=_0x41cc04||0xc8;return function(_0x3b0970){if(_0x3b0970){return _0x4f6468[_0x6803('0x1c')](_0x41cc04)[_0x6803('0x1e')](_0x3b0970);}};}function respondWithFilteredResult(_0x27fe36,_0x3a8f99){return function(_0x4dc66d){if(_0x4dc66d){var _0x296dd1=typeof _0x3a8f99[_0x6803('0x1f')]==='undefined'&&typeof _0x3a8f99['limit']===_0x6803('0x20');var _0x30b9ae=_0x4dc66d[_0x6803('0x21')];var _0x352c02=_0x296dd1?0x0:_0x3a8f99['offset'];var _0x51e558=_0x296dd1?_0x4dc66d[_0x6803('0x21')]:_0x3a8f99[_0x6803('0x1f')]+_0x3a8f99[_0x6803('0x22')];var _0x4829cc;if(_0x51e558>=_0x30b9ae){_0x51e558=_0x30b9ae;_0x4829cc=0xc8;}else{_0x4829cc=0xce;}_0x27fe36[_0x6803('0x1c')](_0x4829cc);return _0x27fe36[_0x6803('0x23')](_0x6803('0x24'),_0x352c02+'-'+_0x51e558+'/'+_0x30b9ae)[_0x6803('0x1e')](_0x4dc66d);}return null;};}function patchUpdates(_0x33878e){return function(_0x2a75fe){try{jsonpatch['apply'](_0x2a75fe,_0x33878e,!![]);}catch(_0x11708c){return BPromise[_0x6803('0x25')](_0x11708c);}return _0x2a75fe[_0x6803('0x26')]();};}function saveUpdates(_0x1aebfd,_0x1074ad){return function(_0x398ee5){if(_0x398ee5){return _0x398ee5['update'](_0x1aebfd)['then'](function(_0x347c62){return _0x347c62;});}return null;};}function removeEntity(_0x270e95,_0x4f8eb9){return function(_0x1beb87){if(_0x1beb87){return _0x1beb87[_0x6803('0x27')]()[_0x6803('0x28')](function(){_0x270e95[_0x6803('0x1c')](0xcc)[_0x6803('0x1d')]();});}};}function handleEntityNotFound(_0x4a9bbe,_0x5e8f6a){return function(_0x1d76d4){if(!_0x1d76d4){_0x4a9bbe[_0x6803('0x1b')](0x194);}return _0x1d76d4;};}function handleError(_0x39f4d7,_0x5943a0){_0x5943a0=_0x5943a0||0x1f4;return function(_0x186165){logger[_0x6803('0x29')](_0x186165[_0x6803('0x2a')]);if(_0x186165['name']){delete _0x186165['name'];}_0x39f4d7[_0x6803('0x1c')](_0x5943a0)[_0x6803('0x2b')](_0x186165);};}exports['index']=function(_0x5b59ae,_0x56d4f9){var _0x239a72={},_0x551057={},_0x202af9={'count':0x0,'rows':[]};var _0x4f8a7d=_[_0x6803('0x2c')](db[_0x6803('0x2d')]['rawAttributes'],function(_0x351f81){return{'name':_0x351f81[_0x6803('0x2e')],'type':_0x351f81[_0x6803('0x2f')][_0x6803('0x30')]};});_0x551057['model']=_[_0x6803('0x2c')](_0x4f8a7d,_0x6803('0x31'));_0x551057['query']=_[_0x6803('0x32')](_0x5b59ae[_0x6803('0x33')]);_0x551057['filters']=_['intersection'](_0x551057[_0x6803('0x34')],_0x551057[_0x6803('0x33')]);_0x239a72[_0x6803('0x35')]=_['intersection'](_0x551057['model'],qs[_0x6803('0x36')](_0x5b59ae[_0x6803('0x33')]['fields']));_0x239a72['attributes']=_0x239a72[_0x6803('0x35')][_0x6803('0x37')]?_0x239a72[_0x6803('0x35')]:_0x551057[_0x6803('0x34')];if(!_0x5b59ae[_0x6803('0x33')][_0x6803('0x38')](_0x6803('0x39'))){_0x239a72[_0x6803('0x22')]=qs['limit'](_0x5b59ae[_0x6803('0x33')]['limit']);_0x239a72[_0x6803('0x1f')]=qs[_0x6803('0x1f')](_0x5b59ae['query'][_0x6803('0x1f')]);}_0x239a72['order']=qs['sort'](_0x5b59ae[_0x6803('0x33')][_0x6803('0x3a')]);_0x239a72[_0x6803('0x3b')]=qs['filters'](_['pick'](_0x5b59ae[_0x6803('0x33')],_0x551057[_0x6803('0x3c')]),_0x4f8a7d);if(_0x5b59ae['query'][_0x6803('0x3d')]){_0x239a72[_0x6803('0x3b')]=_[_0x6803('0x3e')](_0x239a72[_0x6803('0x3b')],{'$or':_[_0x6803('0x2c')](_0x4f8a7d,function(_0xbd8354){if(_0xbd8354[_0x6803('0x2f')]!==_0x6803('0x3f')){var _0x38eadf={};_0x38eadf[_0xbd8354[_0x6803('0x31')]]={'$like':'%'+_0x5b59ae[_0x6803('0x33')][_0x6803('0x3d')]+'%'};return _0x38eadf;}})});}_0x239a72=_['merge']({},_0x239a72,_0x5b59ae['options']);var _0x31549c={'where':_0x239a72[_0x6803('0x3b')]};return db[_0x6803('0x2d')][_0x6803('0x21')](_0x31549c)[_0x6803('0x28')](function(_0x4281f5){_0x202af9['count']=_0x4281f5;if(_0x5b59ae[_0x6803('0x33')]['includeAll']){_0x239a72['include']=[{'all':!![]}];}return db[_0x6803('0x2d')][_0x6803('0x40')](_0x239a72);})[_0x6803('0x28')](function(_0x588ac3){_0x202af9[_0x6803('0x41')]=_0x588ac3;return _0x202af9;})[_0x6803('0x28')](respondWithFilteredResult(_0x56d4f9,_0x239a72))[_0x6803('0x42')](handleError(_0x56d4f9,null));};exports[_0x6803('0x43')]=function(_0x51a08e,_0x624a9){var _0x50ef0f={'raw':!![],'where':{'id':_0x51a08e[_0x6803('0x44')]['id']}},_0x531896={};_0x531896[_0x6803('0x34')]=_['keys'](db[_0x6803('0x2d')]['rawAttributes']);_0x531896[_0x6803('0x33')]=_[_0x6803('0x32')](_0x51a08e[_0x6803('0x33')]);_0x531896['filters']=_[_0x6803('0x45')](_0x531896['model'],_0x531896[_0x6803('0x33')]);_0x50ef0f[_0x6803('0x35')]=_[_0x6803('0x45')](_0x531896[_0x6803('0x34')],qs[_0x6803('0x36')](_0x51a08e['query']['fields']));_0x50ef0f[_0x6803('0x35')]=_0x50ef0f[_0x6803('0x35')]['length']?_0x50ef0f[_0x6803('0x35')]:_0x531896[_0x6803('0x34')];if(_0x51a08e[_0x6803('0x33')][_0x6803('0x46')]){_0x50ef0f[_0x6803('0x47')]=[{'all':!![]}];}_0x50ef0f=_[_0x6803('0x3e')]({},_0x50ef0f,_0x51a08e[_0x6803('0x48')]);return db['ChatGroup']['find'](_0x50ef0f)[_0x6803('0x28')](handleEntityNotFound(_0x624a9,null))[_0x6803('0x28')](respondWithResult(_0x624a9,null))['catch'](handleError(_0x624a9,null));};exports[_0x6803('0x49')]=function(_0x1e9abe,_0x298db1){return db['ChatGroup'][_0x6803('0x49')](_0x1e9abe[_0x6803('0x4a')],{})[_0x6803('0x28')](respondWithResult(_0x298db1,0xc9))[_0x6803('0x42')](handleError(_0x298db1,null));};exports[_0x6803('0x4b')]=function(_0x438d61,_0x528990){if(_0x438d61[_0x6803('0x4a')]['id']){delete _0x438d61[_0x6803('0x4a')]['id'];}return db[_0x6803('0x2d')][_0x6803('0x4c')]({'where':{'id':_0x438d61['params']['id']}})[_0x6803('0x28')](handleEntityNotFound(_0x528990,null))[_0x6803('0x28')](saveUpdates(_0x438d61[_0x6803('0x4a')],null))[_0x6803('0x28')](respondWithResult(_0x528990,null))[_0x6803('0x42')](handleError(_0x528990,null));};exports['destroy']=function(_0x1c1ee5,_0x2cce8e){return db[_0x6803('0x2d')][_0x6803('0x4c')]({'where':{'id':_0x1c1ee5['params']['id']}})[_0x6803('0x28')](handleEntityNotFound(_0x2cce8e,null))[_0x6803('0x28')](removeEntity(_0x2cce8e,null))[_0x6803('0x42')](handleError(_0x2cce8e,null));};exports['describe']=function(_0x53d3e3,_0x54d921){return db[_0x6803('0x2d')][_0x6803('0x4d')]()[_0x6803('0x28')](respondWithResult(_0x54d921,null))[_0x6803('0x42')](handleError(_0x54d921,null));};exports['getUnread']=function(_0x4e9ba4,_0x9714d0,_0x5cdc95){return db[_0x6803('0x4e')][_0x6803('0x21')]({'where':{'ChatGroupId':_0x4e9ba4['params']['id'],'ToId':_0x4e9ba4[_0x6803('0x4f')]['id'],'read':![]}})[_0x6803('0x28')](function(_0x42880c){return{'id':_[_0x6803('0x50')](_0x4e9ba4[_0x6803('0x44')]['id']),'count':_0x42880c};})['then'](respondWithResult(_0x9714d0,null))[_0x6803('0x42')](handleError(_0x9714d0,null));};exports[_0x6803('0x51')]=function(_0x2a0c23,_0x463452,_0xc9522a){return db[_0x6803('0x2d')][_0x6803('0x4c')]({'where':{'id':_0x2a0c23['params']['id']}})[_0x6803('0x28')](handleEntityNotFound(_0x463452,null))[_0x6803('0x28')](function(_0x1c4555){if(_0x1c4555){return _0x1c4555[_0x6803('0x51')](_0x2a0c23[_0x6803('0x4a')][_0x6803('0x52')],_[_0x6803('0x53')](_0x2a0c23[_0x6803('0x4a')],[_0x6803('0x52'),'id'])||{});}})[_0x6803('0x28')](respondWithResult(_0x463452,null))[_0x6803('0x42')](handleError(_0x463452,null));};exports[_0x6803('0x54')]=function(_0x41b2bf,_0x478dd7,_0x352299){var _0x21ff86={};var _0xba9d0a={};var _0x1afcb3;var _0x59717e;return db[_0x6803('0x2d')][_0x6803('0x55')]({'where':{'id':_0x41b2bf['params']['id']}})[_0x6803('0x28')](handleEntityNotFound(_0x478dd7,null))[_0x6803('0x28')](function(_0xd90b06){if(_0xd90b06){_0x1afcb3=_0xd90b06;_0xba9d0a[_0x6803('0x34')]=_[_0x6803('0x32')](db[_0x6803('0x56')][_0x6803('0x57')]);_0xba9d0a['query']=_[_0x6803('0x32')](_0x41b2bf['query']);_0xba9d0a[_0x6803('0x3c')]=_['intersection'](_0xba9d0a['model'],_0xba9d0a[_0x6803('0x33')]);_0x21ff86[_0x6803('0x35')]=_[_0x6803('0x45')](_0xba9d0a[_0x6803('0x34')],qs[_0x6803('0x36')](_0x41b2bf[_0x6803('0x33')]['fields']));_0x21ff86[_0x6803('0x35')]=_0x21ff86[_0x6803('0x35')][_0x6803('0x37')]?_0x21ff86[_0x6803('0x35')]:_0xba9d0a['model'];_0x21ff86[_0x6803('0x58')]=qs[_0x6803('0x3a')](_0x41b2bf[_0x6803('0x33')][_0x6803('0x3a')]);_0x21ff86[_0x6803('0x3b')]=qs['filters'](_['pick'](_0x41b2bf[_0x6803('0x33')],_0xba9d0a[_0x6803('0x3c')]));if(_0x41b2bf[_0x6803('0x33')][_0x6803('0x3d')]){_0x21ff86[_0x6803('0x3b')]=_['merge'](_0x21ff86[_0x6803('0x3b')],{'$or':_[_0x6803('0x2c')](_0x21ff86[_0x6803('0x35')],function(_0x6bec8a){var _0x36ece1={};_0x36ece1[_0x6bec8a]={'$like':'%'+_0x41b2bf[_0x6803('0x33')][_0x6803('0x3d')]+'%'};return _0x36ece1;})});}_0x21ff86=_[_0x6803('0x3e')]({},_0x21ff86,_0x41b2bf[_0x6803('0x48')]);return _0x1afcb3[_0x6803('0x54')](_0x21ff86);}})[_0x6803('0x28')](function(_0x3e86e8){if(_0x3e86e8){_0x59717e=_0x3e86e8[_0x6803('0x37')];if(!_0x41b2bf[_0x6803('0x33')]['hasOwnProperty'](_0x6803('0x39'))){_0x21ff86[_0x6803('0x22')]=qs[_0x6803('0x22')](_0x41b2bf[_0x6803('0x33')][_0x6803('0x22')]);_0x21ff86[_0x6803('0x1f')]=qs['offset'](_0x41b2bf['query']['offset']);}return _0x1afcb3[_0x6803('0x54')](_0x21ff86);}})[_0x6803('0x28')](function(_0x1b4cb1){if(_0x1b4cb1){return _0x1b4cb1?{'count':_0x59717e,'rows':_0x1b4cb1}:null;}})[_0x6803('0x28')](respondWithResult(_0x478dd7,null))[_0x6803('0x42')](handleError(_0x478dd7,null));};exports['removeMembers']=function(_0x5ab881,_0x492cb9,_0x2979e6){return db[_0x6803('0x2d')]['find']({'where':{'id':_0x5ab881[_0x6803('0x44')]['id']}})[_0x6803('0x28')](handleEntityNotFound(_0x492cb9,null))[_0x6803('0x28')](function(_0x166e38){if(_0x166e38){return _0x166e38[_0x6803('0x59')](_0x5ab881[_0x6803('0x33')][_0x6803('0x52')]);}})[_0x6803('0x28')](respondWithStatusCode(_0x492cb9,null))[_0x6803('0x42')](handleError(_0x492cb9,null));};exports[_0x6803('0x5a')]=function(_0xfd5df2,_0x5c4150,_0x4cb808){if(_0xfd5df2[_0x6803('0x4a')]['id']){delete _0xfd5df2[_0x6803('0x4a')]['id'];}return db[_0x6803('0x2d')][_0x6803('0x4c')]({'where':{'id':_0xfd5df2['params']['id']}})['then'](handleEntityNotFound(_0x5c4150,null))[_0x6803('0x28')](function(_0x500f52){if(_0x500f52){_0xfd5df2['body'][_0x6803('0x5b')]=_0x500f52['id'];return db[_0x6803('0x4e')][_0x6803('0x49')](_0xfd5df2[_0x6803('0x4a')]);}})[_0x6803('0x28')](respondWithResult(_0x5c4150,null))['catch'](handleError(_0x5c4150,null));};exports[_0x6803('0x5c')]=function(_0x2b21f5,_0x27dc40,_0xcb06e1){var _0x378841={};var _0x311abf={};var _0x4bd9a8;var _0x3a8fee;return db[_0x6803('0x2d')][_0x6803('0x55')]({'where':{'id':_0x2b21f5[_0x6803('0x44')]['id']}})[_0x6803('0x28')](handleEntityNotFound(_0x27dc40,null))[_0x6803('0x28')](function(_0x3d8e7e){if(_0x3d8e7e){_0x4bd9a8=_0x3d8e7e;_0x311abf[_0x6803('0x34')]=_[_0x6803('0x32')](db[_0x6803('0x4e')][_0x6803('0x57')]);_0x311abf[_0x6803('0x33')]=_[_0x6803('0x32')](_0x2b21f5['query']);_0x311abf[_0x6803('0x3c')]=_[_0x6803('0x45')](_0x311abf[_0x6803('0x34')],_0x311abf[_0x6803('0x33')]);_0x378841[_0x6803('0x35')]=_[_0x6803('0x45')](_0x311abf[_0x6803('0x34')],qs[_0x6803('0x36')](_0x2b21f5[_0x6803('0x33')][_0x6803('0x36')]));_0x378841[_0x6803('0x35')]=_0x378841['attributes'][_0x6803('0x37')]?_0x378841[_0x6803('0x35')]:_0x311abf[_0x6803('0x34')];_0x378841['order']=qs[_0x6803('0x3a')](_0x2b21f5[_0x6803('0x33')][_0x6803('0x3a')]);_0x378841[_0x6803('0x3b')]=qs[_0x6803('0x3c')](_[_0x6803('0x5d')](_0x2b21f5[_0x6803('0x33')],_0x311abf[_0x6803('0x3c')]));if(_0x2b21f5['query'][_0x6803('0x3d')]){_0x378841[_0x6803('0x3b')]=_[_0x6803('0x3e')](_0x378841['where'],{'$or':_[_0x6803('0x2c')](_0x378841[_0x6803('0x35')],function(_0x143ea4){var _0x2a4c5d={};_0x2a4c5d[_0x143ea4]={'$like':'%'+_0x2b21f5[_0x6803('0x33')][_0x6803('0x3d')]+'%'};return _0x2a4c5d;})});}if(_0x2b21f5['query'][_0x6803('0x5e')]){var _0x3cf2b5=_0x2b21f5[_0x6803('0x33')]['$gte'][_0x6803('0x5f')](',');var _0xd9d282={};_0xd9d282[_0x3cf2b5[0x0]]={'$gte':moment(_0x3cf2b5[0x1])[_0x6803('0x60')](_0x6803('0x61'))};_0x378841[_0x6803('0x3b')]=_[_0x6803('0x3e')](_0x378841[_0x6803('0x3b')],_0xd9d282);}_0x378841=_['merge']({},_0x378841,_0x2b21f5[_0x6803('0x48')]);return _0x4bd9a8[_0x6803('0x5c')](_0x378841);}})['then'](function(_0xc2da6d){if(_0xc2da6d){_0x3a8fee=_0xc2da6d[_0x6803('0x37')];if(!_0x2b21f5[_0x6803('0x33')][_0x6803('0x38')]('nolimit')){_0x378841[_0x6803('0x22')]=qs[_0x6803('0x22')](_0x2b21f5[_0x6803('0x33')][_0x6803('0x22')]);_0x378841['offset']=qs[_0x6803('0x1f')](_0x2b21f5['query'][_0x6803('0x1f')]);}return _0x4bd9a8[_0x6803('0x5c')](_0x378841);}})[_0x6803('0x28')](function(_0x597fd0){if(_0x597fd0){return _0x597fd0?{'count':_0x3a8fee,'rows':_0x597fd0}:null;}})[_0x6803('0x28')](respondWithResult(_0x27dc40,null))[_0x6803('0x42')](handleError(_0x27dc40,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index edeb105..733736f 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 _0x120e=['ChatGroup','setMaxListeners','update','remove','emit','hook'];(function(_0x2313e8,_0x415c7f){var _0x405d3f=function(_0x48f4a1){while(--_0x48f4a1){_0x2313e8['push'](_0x2313e8['shift']());}};_0x405d3f(++_0x415c7f);}(_0x120e,0x17a));var _0xe120=function(_0x141006,_0x36cb84){_0x141006=_0x141006-0x0;var _0x417cc8=_0x120e[_0x141006];return _0x417cc8;};'use strict';var EventEmitter=require('events');var ChatGroup=require('../../mysqldb')['db'][_0xe120('0x0')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xe120('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe120('0x2'),'afterDestroy':_0xe120('0x3')};function emitEvent(_0x1822ca){return function(_0x4446a0,_0x32cce3,_0x2c38d7){ChatGroupEvents[_0xe120('0x4')](_0x1822ca+':'+_0x4446a0['id'],_0x4446a0);ChatGroupEvents[_0xe120('0x4')](_0x1822ca,_0x4446a0);_0x2c38d7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xe120('0x5')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0x47db=['../../mysqldb','ChatGroup','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x10264b,_0x34c5e7){var _0x2b63da=function(_0x38ca45){while(--_0x38ca45){_0x10264b['push'](_0x10264b['shift']());}};_0x2b63da(++_0x34c5e7);}(_0x47db,0xbd));var _0xb47d=function(_0x3c8c67,_0x2c9247){_0x3c8c67=_0x3c8c67-0x0;var _0x146027=_0x47db[_0x3c8c67];return _0x146027;};'use strict';var EventEmitter=require(_0xb47d('0x0'));var ChatGroup=require(_0xb47d('0x1'))['db'][_0xb47d('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb47d('0x3'),'afterUpdate':_0xb47d('0x4'),'afterDestroy':_0xb47d('0x5')};function emitEvent(_0x177b1c){return function(_0x24b6e8,_0x585116,_0x2b31be){ChatGroupEvents[_0xb47d('0x6')](_0x177b1c+':'+_0x24b6e8['id'],_0x24b6e8);ChatGroupEvents['emit'](_0x177b1c,_0x24b6e8);_0x2b31be(null);};}for(var e in events){if(events[_0xb47d('0x7')](e)){var event=events[e];ChatGroup[_0xb47d('0x8')](e,emitEvent(event));}}module[_0xb47d('0x9')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index cf92b75..91cac68 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 _0x0235=['define','chat_groups','lodash','../../config/logger','moment','bluebird','path','rimraf','./chatGroup.attributes'];(function(_0x383b0a,_0x4aadd8){var _0xa64dee=function(_0x1a894f){while(--_0x1a894f){_0x383b0a['push'](_0x383b0a['shift']());}};_0xa64dee(++_0x4aadd8);}(_0x0235,0x1d6));var _0x5023=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x0235[_0x4d8ed9];return _0x1e2140;};'use strict';var _=require(_0x5023('0x0'));var util=require('util');var logger=require(_0x5023('0x1'))('api');var moment=require(_0x5023('0x2'));var BPromise=require(_0x5023('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5023('0x4'));var rimraf=require(_0x5023('0x5'));var config=require('../../config/environment');var attributes=require(_0x5023('0x6'));module['exports']=function(_0x4e267d,_0x38c370){return _0x4e267d[_0x5023('0x7')]('ChatGroup',attributes,{'tableName':_0x5023('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3dc8=['../../config/environment','./chatGroup.attributes','exports','ChatGroup','chat_groups','lodash','util','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x491efc,_0x41ee74){var _0x496964=function(_0x6cbc63){while(--_0x6cbc63){_0x491efc['push'](_0x491efc['shift']());}};_0x496964(++_0x41ee74);}(_0x3dc8,0x1e9));var _0x83dc=function(_0x241ce5,_0x5b81d7){_0x241ce5=_0x241ce5-0x0;var _0x39e971=_0x3dc8[_0x241ce5];return _0x39e971;};'use strict';var _=require(_0x83dc('0x0'));var util=require(_0x83dc('0x1'));var logger=require(_0x83dc('0x2'))('api');var moment=require('moment');var BPromise=require(_0x83dc('0x3'));var rp=require(_0x83dc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x83dc('0x5'));var config=require(_0x83dc('0x6'));var attributes=require(_0x83dc('0x7'));module[_0x83dc('0x8')]=function(_0x95dd74,_0x36c8a8){return _0x95dd74['define'](_0x83dc('0x9'),attributes,{'tableName':_0x83dc('0xa'),'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 5c64ae0..b55dca7 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 _0x46f4=['localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x46f4,0x115));var _0x446f=function(_0x537530,_0x5c5740){_0x537530=_0x537530-0x0;var _0x237ab5=_0x46f4[_0x537530];return _0x237ab5;};'use strict';var _=require(_0x446f('0x0'));var util=require(_0x446f('0x1'));var moment=require(_0x446f('0x2'));var BPromise=require(_0x446f('0x3'));var rs=require(_0x446f('0x4'));var fs=require('fs');var Redis=require(_0x446f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x446f('0x6'));var logger=require(_0x446f('0x7'))('rpc');var config=require(_0x446f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x446f('0x9')][_0x446f('0xa')]({'port':0x232a});config[_0x446f('0xb')]=_[_0x446f('0xc')](config[_0x446f('0xb')],{'host':_0x446f('0xd'),'port':0x18eb});var socket=require(_0x446f('0xe'))(new Redis(config[_0x446f('0xb')]));require(_0x446f('0xf'))[_0x446f('0x10')](socket);function respondWithRpcPromise(_0x1c4dc9,_0x3f541e,_0x4d7eda){return new BPromise(function(_0x12354b,_0x1818cb){return client[_0x446f('0x11')](_0x1c4dc9,_0x4d7eda)[_0x446f('0x12')](function(_0x4695d6){logger[_0x446f('0x13')]('ChatGroup,\x20%s,\x20%s',_0x3f541e,_0x446f('0x14'));logger[_0x446f('0x15')](_0x446f('0x16'),_0x3f541e,_0x446f('0x14'),JSON[_0x446f('0x17')](_0x4695d6));if(_0x4695d6[_0x446f('0x18')]){if(_0x4695d6[_0x446f('0x18')][_0x446f('0x19')]===0x1f4){logger[_0x446f('0x18')](_0x446f('0x1a'),_0x3f541e,_0x4695d6['error'][_0x446f('0x1b')]);return _0x1818cb(_0x4695d6[_0x446f('0x18')][_0x446f('0x1b')]);}logger[_0x446f('0x18')](_0x446f('0x1a'),_0x3f541e,_0x4695d6[_0x446f('0x18')][_0x446f('0x1b')]);return _0x12354b(_0x4695d6[_0x446f('0x18')][_0x446f('0x1b')]);}else{logger[_0x446f('0x13')](_0x446f('0x1a'),_0x3f541e,_0x446f('0x14'));_0x12354b(_0x4695d6[_0x446f('0x1c')][_0x446f('0x1b')]);}})['catch'](function(_0x4c0df5){logger[_0x446f('0x18')](_0x446f('0x1a'),_0x3f541e,_0x4c0df5);_0x1818cb(_0x4c0df5);});});}
\ No newline at end of file
+var _0xbbcb=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x40fbc2,_0x19eefd){var _0x337e80=function(_0x2066b4){while(--_0x2066b4){_0x40fbc2['push'](_0x40fbc2['shift']());}};_0x337e80(++_0x19eefd);}(_0xbbcb,0x16e));var _0xbbbc=function(_0x4b3f19,_0x1aced1){_0x4b3f19=_0x4b3f19-0x0;var _0x4b5b93=_0xbbcb[_0x4b3f19];return _0x4b5b93;};'use strict';var _=require(_0xbbbc('0x0'));var util=require(_0xbbbc('0x1'));var moment=require(_0xbbbc('0x2'));var BPromise=require(_0xbbbc('0x3'));var rs=require(_0xbbbc('0x4'));var fs=require('fs');var Redis=require(_0xbbbc('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbbbc('0x6'));var logger=require(_0xbbbc('0x7'))(_0xbbbc('0x8'));var config=require(_0xbbbc('0x9'));var jayson=require(_0xbbbc('0xa'));var client=jayson[_0xbbbc('0xb')][_0xbbbc('0xc')]({'port':0x232a});config[_0xbbbc('0xd')]=_[_0xbbbc('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xbbbc('0xf'))(new Redis(config['redis']));require('./chatGroup.socket')[_0xbbbc('0x10')](socket);function respondWithRpcPromise(_0x234074,_0x168960,_0x439002){return new BPromise(function(_0x30a349,_0x170c28){return client['request'](_0x234074,_0x439002)[_0xbbbc('0x11')](function(_0x34dadf){logger['info'](_0xbbbc('0x12'),_0x168960,_0xbbbc('0x13'));logger[_0xbbbc('0x14')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x168960,_0xbbbc('0x13'),JSON[_0xbbbc('0x15')](_0x34dadf));if(_0x34dadf['error']){if(_0x34dadf[_0xbbbc('0x16')][_0xbbbc('0x17')]===0x1f4){logger[_0xbbbc('0x16')](_0xbbbc('0x12'),_0x168960,_0x34dadf['error']['message']);return _0x170c28(_0x34dadf[_0xbbbc('0x16')]['message']);}logger[_0xbbbc('0x16')](_0xbbbc('0x12'),_0x168960,_0x34dadf[_0xbbbc('0x16')]['message']);return _0x30a349(_0x34dadf[_0xbbbc('0x16')][_0xbbbc('0x18')]);}else{logger[_0xbbbc('0x19')](_0xbbbc('0x12'),_0x168960,_0xbbbc('0x13'));_0x30a349(_0x34dadf[_0xbbbc('0x1a')][_0xbbbc('0x18')]);}})[_0xbbbc('0x1b')](function(_0x362f62){logger[_0xbbbc('0x16')](_0xbbbc('0x12'),_0x168960,_0x362f62);_0x170c28(_0x362f62);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 9a05731..23d627c 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 _0x5f2a=['removeListener','register','length','./chatGroup.events','remove','emit'];(function(_0x466014,_0x10fba4){var _0x35769f=function(_0x5edccb){while(--_0x5edccb){_0x466014['push'](_0x466014['shift']());}};_0x35769f(++_0x10fba4);}(_0x5f2a,0x123));var _0xa5f2=function(_0x4a2fde,_0x3a2d4a){_0x4a2fde=_0x4a2fde-0x0;var _0x224d77=_0x5f2a[_0x4a2fde];return _0x224d77;};'use strict';var ChatGroupEvents=require(_0xa5f2('0x0'));var events=['save',_0xa5f2('0x1'),'update'];function createListener(_0x5204e0,_0x2f9ffd){return function(_0x49689b){_0x2f9ffd[_0xa5f2('0x2')](_0x5204e0,_0x49689b);};}function removeListener(_0x285a6d,_0x50e560){return function(){ChatGroupEvents[_0xa5f2('0x3')](_0x285a6d,_0x50e560);};}exports[_0xa5f2('0x4')]=function(_0xdcdd2a){for(var _0x318f6c=0x0,_0x144554=events[_0xa5f2('0x5')];_0x318f6c<_0x144554;_0x318f6c++){var _0xb4669f=events[_0x318f6c];var _0x4be2f=createListener('chatGroup:'+_0xb4669f,_0xdcdd2a);ChatGroupEvents['on'](_0xb4669f,_0x4be2f);}};
\ No newline at end of file
+var _0xfbbb=['length','chatGroup:','./chatGroup.events','save','update','emit','removeListener','register'];(function(_0x4e2806,_0x29bddf){var _0xd5a5a1=function(_0x44ea94){while(--_0x44ea94){_0x4e2806['push'](_0x4e2806['shift']());}};_0xd5a5a1(++_0x29bddf);}(_0xfbbb,0x1a2));var _0xbfbb=function(_0x160ade,_0x1aef25){_0x160ade=_0x160ade-0x0;var _0x598eb4=_0xfbbb[_0x160ade];return _0x598eb4;};'use strict';var ChatGroupEvents=require(_0xbfbb('0x0'));var events=[_0xbfbb('0x1'),'remove',_0xbfbb('0x2')];function createListener(_0x2c81a1,_0x6ccd5a){return function(_0x304214){_0x6ccd5a[_0xbfbb('0x3')](_0x2c81a1,_0x304214);};}function removeListener(_0x123d3e,_0x508877){return function(){ChatGroupEvents[_0xbfbb('0x4')](_0x123d3e,_0x508877);};}exports[_0xbfbb('0x5')]=function(_0x46cfb3){for(var _0x1235db=0x0,_0x59e07e=events[_0xbfbb('0x6')];_0x1235db<_0x59e07e;_0x1235db++){var _0x2de2f4=events[_0x1235db];var _0x8f27c2=createListener(_0xbfbb('0x7')+_0x2de2f4,_0x46cfb3);ChatGroupEvents['on'](_0x2de2f4,_0x8f27c2);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 418ef49..cc63057 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 _0xaae7=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./chatGroup.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','post','create','addMembers','addMessage','put','update','delete','destroy','/:id/members','removeMembers'];(function(_0xc63cf,_0x4ba8e6){var _0x5a805c=function(_0x34fcc6){while(--_0x34fcc6){_0xc63cf['push'](_0xc63cf['shift']());}};_0x5a805c(++_0x4ba8e6);}(_0xaae7,0xe1));var _0x7aae=function(_0x25990c,_0x3412fb){_0x25990c=_0x25990c-0x0;var _0x56fea2=_0xaae7[_0x25990c];return _0x56fea2;};'use strict';var multer=require(_0x7aae('0x0'));var util=require(_0x7aae('0x1'));var path=require(_0x7aae('0x2'));var timeout=require(_0x7aae('0x3'));var express=require(_0x7aae('0x4'));var router=express[_0x7aae('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7aae('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7aae('0x7'));router[_0x7aae('0x8')]('/',auth['isAuthenticated'](),controller[_0x7aae('0x9')]);router[_0x7aae('0x8')](_0x7aae('0xa'),auth[_0x7aae('0xb')](),controller[_0x7aae('0xc')]);router[_0x7aae('0x8')](_0x7aae('0xd'),auth[_0x7aae('0xb')](),controller[_0x7aae('0xe')]);router[_0x7aae('0x8')]('/:id/unread',auth[_0x7aae('0xb')](),controller['getUnread']);router[_0x7aae('0x8')]('/:id/members',auth[_0x7aae('0xb')](),controller['getMembers']);router[_0x7aae('0x8')](_0x7aae('0xf'),auth[_0x7aae('0xb')](),controller[_0x7aae('0x10')]);router[_0x7aae('0x11')]('/',auth[_0x7aae('0xb')](),controller[_0x7aae('0x12')]);router[_0x7aae('0x11')]('/:id/members',auth['isAuthenticated'](),controller[_0x7aae('0x13')]);router[_0x7aae('0x11')](_0x7aae('0xf'),auth[_0x7aae('0xb')](),controller[_0x7aae('0x14')]);router[_0x7aae('0x15')](_0x7aae('0xd'),auth[_0x7aae('0xb')](),controller[_0x7aae('0x16')]);router[_0x7aae('0x17')](_0x7aae('0xd'),auth[_0x7aae('0xb')](),controller[_0x7aae('0x18')]);router[_0x7aae('0x17')](_0x7aae('0x19'),auth[_0x7aae('0xb')](),controller[_0x7aae('0x1a')]);module[_0x7aae('0x1b')]=router;
\ No newline at end of file
+var _0x41d7=['getUnread','getMembers','/:id/messages','getMessages','create','post','addMembers','put','update','delete','destroy','/:id/members','removeMembers','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x41d7,0xe7));var _0x741d=function(_0x446551,_0xfef38c){_0x446551=_0x446551-0x0;var _0x50bc2d=_0x41d7[_0x446551];return _0x50bc2d;};'use strict';var multer=require('multer');var util=require(_0x741d('0x0'));var path=require(_0x741d('0x1'));var timeout=require(_0x741d('0x2'));var express=require(_0x741d('0x3'));var router=express[_0x741d('0x4')]();var fs_extra=require(_0x741d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x741d('0x6'));var config=require(_0x741d('0x7'));var controller=require(_0x741d('0x8'));router[_0x741d('0x9')]('/',auth[_0x741d('0xa')](),controller[_0x741d('0xb')]);router[_0x741d('0x9')](_0x741d('0xc'),auth['isAuthenticated'](),controller[_0x741d('0xd')]);router[_0x741d('0x9')](_0x741d('0xe'),auth[_0x741d('0xa')](),controller[_0x741d('0xf')]);router[_0x741d('0x9')](_0x741d('0x10'),auth[_0x741d('0xa')](),controller[_0x741d('0x11')]);router[_0x741d('0x9')]('/:id/members',auth[_0x741d('0xa')](),controller[_0x741d('0x12')]);router[_0x741d('0x9')](_0x741d('0x13'),auth['isAuthenticated'](),controller[_0x741d('0x14')]);router['post']('/',auth[_0x741d('0xa')](),controller[_0x741d('0x15')]);router[_0x741d('0x16')]('/:id/members',auth['isAuthenticated'](),controller[_0x741d('0x17')]);router[_0x741d('0x16')]('/:id/messages',auth[_0x741d('0xa')](),controller['addMessage']);router[_0x741d('0x18')](_0x741d('0xe'),auth['isAuthenticated'](),controller[_0x741d('0x19')]);router[_0x741d('0x1a')](_0x741d('0xe'),auth[_0x741d('0xa')](),controller[_0x741d('0x1b')]);router[_0x741d('0x1a')](_0x741d('0x1c'),auth[_0x741d('0xa')](),controller[_0x741d('0x1d')]);module[_0x741d('0x1e')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 266427d..9e4c148 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 _0x12bc=['STRING','long','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','DATE'];(function(_0x30cd33,_0x1d5b60){var _0x2f34b3=function(_0x17026d){while(--_0x17026d){_0x30cd33['push'](_0x30cd33['shift']());}};_0x2f34b3(++_0x1d5b60);}(_0x12bc,0x7b));var _0xc12b=function(_0x52ba6e,_0x4a1513){_0x52ba6e=_0x52ba6e-0x0;var _0x51668d=_0x12bc[_0x52ba6e];return _0x51668d;};'use strict';var Sequelize=require(_0xc12b('0x0'));module[_0xc12b('0x1')]={'closed':{'type':Sequelize[_0xc12b('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xc12b('0x3')]},'ratingType':{'type':Sequelize[_0xc12b('0x4')](_0xc12b('0x5'),_0xc12b('0x6')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xc12b('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xc12b('0x8')]},'disposition':{'type':Sequelize[_0xc12b('0x9')]},'secondDisposition':{'type':Sequelize[_0xc12b('0x9')]},'thirdDisposition':{'type':Sequelize[_0xc12b('0x9')]},'note':{'type':Sequelize[_0xc12b('0x9')]},'browserName':{'type':Sequelize[_0xc12b('0x9')]},'browserVersion':{'type':Sequelize[_0xc12b('0x9')]},'osName':{'type':Sequelize[_0xc12b('0x9')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xc12b('0x9')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xc12b('0x7')]},'customerIp':{'type':Sequelize[_0xc12b('0x9')]},'formData':{'type':Sequelize[_0xc12b('0x7')](_0xc12b('0xa'))},'read1stAt':{'type':Sequelize[_0xc12b('0x8')]},'lastMsgAt':{'type':Sequelize[_0xc12b('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xc12b('0x4')]('in',_0xc12b('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xc12b('0x9')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xc12b('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0xc12b('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x428c=['INTEGER','star','TEXT','DATE','STRING','long','out','BOOLEAN','sequelize','exports'];(function(_0x25efdf,_0x521462){var _0x22c495=function(_0x184469){while(--_0x184469){_0x25efdf['push'](_0x25efdf['shift']());}};_0x22c495(++_0x521462);}(_0x428c,0x17a));var _0xc428=function(_0x3a6583,_0x485874){_0x3a6583=_0x3a6583-0x0;var _0x490075=_0x428c[_0x3a6583];return _0x490075;};'use strict';var Sequelize=require(_0xc428('0x0'));module[_0xc428('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xc428('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0xc428('0x3'),'thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xc428('0x4')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xc428('0x5')]},'disposition':{'type':Sequelize[_0xc428('0x6')]},'secondDisposition':{'type':Sequelize[_0xc428('0x6')]},'thirdDisposition':{'type':Sequelize[_0xc428('0x6')]},'note':{'type':Sequelize[_0xc428('0x6')]},'browserName':{'type':Sequelize[_0xc428('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xc428('0x6')]},'osVersion':{'type':Sequelize[_0xc428('0x6')]},'deviceModel':{'type':Sequelize[_0xc428('0x6')]},'deviceVendor':{'type':Sequelize[_0xc428('0x6')]},'deviceType':{'type':Sequelize[_0xc428('0x6')]},'referer':{'type':Sequelize[_0xc428('0x4')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xc428('0x4')](_0xc428('0x7'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0xc428('0x5')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xc428('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xc428('0x6')]},'customerPort':{'type':Sequelize[_0xc428('0x6')]},'vidaooSessionId':{'type':Sequelize[_0xc428('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xc428('0x9')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xc428('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 4deea52..db08c86 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 _0xd3fc=['ContactId','Messages','length','agentAlias','customer','Visitor','agentIdentifier','website_alias','System','alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','sendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','ids','omit','filters','hasOwnProperty','pick','where','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','nolimit','order','sort','includeAgent','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','push','firstName','lastName','get','Chat','Account','Owner','N.A.','toString','browserName','osName','referer','customerIp','customerPort','tail','existsSync','pipe','out','value','renderFile','views','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','destroy','stack','name','send','render','merge','body','agent','interaction','account','index','map','ChatInteraction','fieldName','key','getOptions','findAll','chat','query','user','params','model','rawAttributes','keys','intersection','attributes','fields','includeAll','include','options','find','create','describe','findOne','ChatWebsite','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooNote','vidaooApiKey','fullname','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooMetadata','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','Contact','abandon','UserId','closed','AbandonInteraction','attachmentUpload','type','mimetype','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','join','offline-chat/','basename','download','close','mailTranscript','root','server/files/chat/upload/','format','transcript-%s.txt','User'];(function(_0x18129d,_0x391a94){var _0x2ad7c6=function(_0x2a95fe){while(--_0x2a95fe){_0x18129d['push'](_0x18129d['shift']());}};_0x2ad7c6(++_0x391a94);}(_0xd3fc,0x11f));var _0xcd3f=function(_0x3652a0,_0x51d3a0){_0x3652a0=_0x3652a0-0x0;var _0x964faa=_0xd3fc[_0x3652a0];return _0x964faa;};'use strict';var rimraf=require(_0xcd3f('0x0'));var zipdir=require(_0xcd3f('0x1'));var rp=require(_0xcd3f('0x2'));var moment=require(_0xcd3f('0x3'));var BPromise=require(_0xcd3f('0x4'));var Mustache=require(_0xcd3f('0x5'));var util=require(_0xcd3f('0x6'));var path=require(_0xcd3f('0x7'));var ejs=require(_0xcd3f('0x8'));var fs=require('fs');var _=require(_0xcd3f('0x9'));var Redis=require(_0xcd3f('0xa'));var interaction=require(_0xcd3f('0xb'));var qs=require(_0xcd3f('0xc'));var pdf=require(_0xcd3f('0xd'));var logger=require('../../config/logger')(_0xcd3f('0xe'));var config=require(_0xcd3f('0xf'));var db=require(_0xcd3f('0x10'))['db'];config[_0xcd3f('0x11')]=_[_0xcd3f('0x12')](config['redis'],{'host':_0xcd3f('0x13'),'port':0x18eb});var socket=require(_0xcd3f('0x14'))(new Redis(config[_0xcd3f('0x11')]));require('./chatInteraction.socket')[_0xcd3f('0x15')](socket);var jayson=require(_0xcd3f('0x16'));var client=jayson[_0xcd3f('0x17')][_0xcd3f('0x18')]({'port':0x232b});var client9004=jayson[_0xcd3f('0x17')][_0xcd3f('0x18')]({'port':0x232c});function respondWithRpcPromise(_0x2032b7,_0x352f58,_0x18bffd,_0x557cc2){return new BPromise(function(_0x58b23a,_0x5e8dca){var _0x4dcb73=_0x557cc2||client;return _0x4dcb73[_0xcd3f('0x19')](_0x2032b7,_0x18bffd)[_0xcd3f('0x1a')](function(_0x17691d){logger['info'](_0xcd3f('0x1b'),_0x352f58,_0xcd3f('0x1c'));logger[_0xcd3f('0x1d')](_0xcd3f('0x1e'),_0x352f58,_0xcd3f('0x1c'),JSON[_0xcd3f('0x1f')](_0x17691d));if(_0x17691d[_0xcd3f('0x20')]){if(_0x17691d[_0xcd3f('0x20')]['code']===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x352f58,_0x17691d[_0xcd3f('0x20')][_0xcd3f('0x21')]);return _0x5e8dca(_0x17691d[_0xcd3f('0x20')]['message']);}logger[_0xcd3f('0x20')](_0xcd3f('0x1b'),_0x352f58,_0x17691d['error']['message']);return _0x58b23a(_0x17691d[_0xcd3f('0x20')][_0xcd3f('0x21')]);}else{logger[_0xcd3f('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x352f58,_0xcd3f('0x1c'));_0x58b23a(_0x17691d[_0xcd3f('0x23')][_0xcd3f('0x21')]);}})[_0xcd3f('0x24')](function(_0x3b21ad){logger[_0xcd3f('0x20')](_0xcd3f('0x1b'),_0x352f58,_0x3b21ad);_0x5e8dca(_0x3b21ad);});});}function respondWithStatusCode(_0x51e5d6,_0xd03b51){_0xd03b51=_0xd03b51||0xcc;return function(_0x213696){if(_0x213696){return _0x51e5d6[_0xcd3f('0x25')](_0xd03b51);}return _0x51e5d6[_0xcd3f('0x26')](_0xd03b51)[_0xcd3f('0x27')]();};}function respondWithResult(_0x25b6c9,_0x22e7b8){_0x22e7b8=_0x22e7b8||0xc8;return function(_0xd8b536){if(_0xd8b536){return _0x25b6c9[_0xcd3f('0x26')](_0x22e7b8)['json'](_0xd8b536);}};}function respondWithFilteredResult(_0x255104,_0x170be2){return function(_0x1cfa59){if(_0x1cfa59){var _0x39b0ab=typeof _0x170be2[_0xcd3f('0x28')]===_0xcd3f('0x29')&&typeof _0x170be2[_0xcd3f('0x2a')]===_0xcd3f('0x29');var _0x39f93c=_0x1cfa59[_0xcd3f('0x2b')];var _0x27f4ee=_0x39b0ab?0x0:_0x170be2[_0xcd3f('0x28')];var _0x3ff859=_0x39b0ab?_0x1cfa59[_0xcd3f('0x2b')]:_0x170be2['offset']+_0x170be2[_0xcd3f('0x2a')];var _0xf8a9c7;if(_0x3ff859>=_0x39f93c){_0x3ff859=_0x39f93c;_0xf8a9c7=0xc8;}else{_0xf8a9c7=0xce;}_0x255104[_0xcd3f('0x26')](_0xf8a9c7);return _0x255104[_0xcd3f('0x2c')](_0xcd3f('0x2d'),_0x27f4ee+'-'+_0x3ff859+'/'+_0x39f93c)[_0xcd3f('0x2e')](_0x1cfa59);}return null;};}function saveUpdates(_0x42219e){return function(_0x224fe9){if(_0x224fe9){return _0x224fe9[_0xcd3f('0x2f')](_0x42219e)['then'](function(_0x1f818f){return _0x1f818f;});}return null;};}function removeEntity(_0x35ed0a){return function(_0x27f162){if(_0x27f162){return _0x27f162[_0xcd3f('0x30')]()[_0xcd3f('0x1a')](function(){_0x35ed0a[_0xcd3f('0x26')](0xcc)[_0xcd3f('0x27')]();});}};}function handleEntityNotFound(_0x3ed28b){return function(_0x5ba247){if(!_0x5ba247){_0x3ed28b['sendStatus'](0x194);}return _0x5ba247;};}function handleError(_0x27968d,_0x13fb88){_0x13fb88=_0x13fb88||0x1f4;return function(_0x163026){logger[_0xcd3f('0x20')](_0x163026[_0xcd3f('0x31')]);if(_0x163026[_0xcd3f('0x32')]){delete _0x163026[_0xcd3f('0x32')];}_0x27968d[_0xcd3f('0x26')](_0x13fb88)[_0xcd3f('0x33')](_0x163026);};}function getMustacheRender(_0x4408e9,_0x14949d){return Mustache[_0xcd3f('0x34')](_0x4408e9,_[_0xcd3f('0x35')](_0x14949d[_0xcd3f('0x36')],{'contact':_0x14949d['contact'],'message':_0x14949d[_0xcd3f('0x21')],'agent':_0x14949d[_0xcd3f('0x37')],'interaction':_0x14949d[_0xcd3f('0x38')],'account':_0x14949d[_0xcd3f('0x39')]}))||'';}exports[_0xcd3f('0x3a')]=function(_0x5dbe98,_0x2dace2){var _0x7f54a0={};var _0x2b4bc9=_[_0xcd3f('0x3b')](db[_0xcd3f('0x3c')]['rawAttributes'],function(_0xe07084){return{'name':_0xe07084[_0xcd3f('0x3d')],'type':_0xe07084['type'][_0xcd3f('0x3e')]};});_0x7f54a0=qs[_0xcd3f('0x3f')](_0x2b4bc9,_0x5dbe98);return interaction[_0xcd3f('0x40')](_0xcd3f('0x41'),_0x5dbe98[_0xcd3f('0x42')],_0x5dbe98[_0xcd3f('0x43')],_0x7f54a0,_0x2b4bc9)[_0xcd3f('0x1a')](respondWithFilteredResult(_0x2dace2,_0x7f54a0))[_0xcd3f('0x24')](handleError(_0x2dace2,null));};exports['show']=function(_0x5c2327,_0x44a908){var _0x1456e1={'raw':![],'where':{'id':_0x5c2327[_0xcd3f('0x44')]['id']}},_0x5e96cc={};_0x5e96cc[_0xcd3f('0x45')]=_['keys'](db[_0xcd3f('0x3c')][_0xcd3f('0x46')]);_0x5e96cc[_0xcd3f('0x42')]=_[_0xcd3f('0x47')](_0x5c2327[_0xcd3f('0x42')]);_0x5e96cc['filters']=_[_0xcd3f('0x48')](_0x5e96cc['model'],_0x5e96cc[_0xcd3f('0x42')]);_0x1456e1[_0xcd3f('0x49')]=_['intersection'](_0x5e96cc[_0xcd3f('0x45')],qs[_0xcd3f('0x4a')](_0x5c2327[_0xcd3f('0x42')]['fields']));_0x1456e1[_0xcd3f('0x49')]=_0x1456e1[_0xcd3f('0x49')]['length']?_0x1456e1[_0xcd3f('0x49')]:_0x5e96cc['model'];if(_0x5c2327[_0xcd3f('0x42')][_0xcd3f('0x4b')]){_0x1456e1[_0xcd3f('0x4c')]=[{'all':!![]}];}_0x1456e1=_['merge']({},_0x1456e1,_0x5c2327[_0xcd3f('0x4d')]);return db['ChatInteraction'][_0xcd3f('0x4e')](_0x1456e1)['then'](handleEntityNotFound(_0x44a908,null))[_0xcd3f('0x1a')](respondWithResult(_0x44a908,null))['catch'](handleError(_0x44a908,null));};exports[_0xcd3f('0x4f')]=function(_0x17d6c1,_0x5c6e98){return db[_0xcd3f('0x3c')][_0xcd3f('0x4f')](_0x17d6c1[_0xcd3f('0x36')],{})[_0xcd3f('0x1a')](respondWithResult(_0x5c6e98,0xc9))['catch'](handleError(_0x5c6e98,null));};exports[_0xcd3f('0x2f')]=function(_0x1cc871,_0x1142ec){if(_0x1cc871[_0xcd3f('0x36')]['id']){delete _0x1cc871['body']['id'];}return db['ChatInteraction'][_0xcd3f('0x4e')]({'where':{'id':_0x1cc871[_0xcd3f('0x44')]['id']}})['then'](handleEntityNotFound(_0x1142ec,null))[_0xcd3f('0x1a')](saveUpdates(_0x1cc871[_0xcd3f('0x36')],null))[_0xcd3f('0x1a')](respondWithResult(_0x1142ec,null))[_0xcd3f('0x24')](handleError(_0x1142ec,null));};exports['destroy']=function(_0xa1bcbd,_0x38fb9a){return db['ChatInteraction']['find']({'where':{'id':_0xa1bcbd[_0xcd3f('0x44')]['id']}})[_0xcd3f('0x1a')](handleEntityNotFound(_0x38fb9a,null))[_0xcd3f('0x1a')](removeEntity(_0x38fb9a,null))[_0xcd3f('0x24')](handleError(_0x38fb9a,null));};exports[_0xcd3f('0x50')]=function(_0x17d946,_0x24e3c8){return db[_0xcd3f('0x3c')][_0xcd3f('0x50')]()['then'](respondWithResult(_0x24e3c8,null))[_0xcd3f('0x24')](handleError(_0x24e3c8,null));};exports['createVidaooSession']=function(_0x2367eb,_0x48099a){var _0x332746=_0x2367eb[_0xcd3f('0x44')]['id'];var _0x987c0c;var _0x2cd10d;var _0x3a6942;return db['ChatInteraction'][_0xcd3f('0x51')]({'where':{'id':_0x332746}})[_0xcd3f('0x1a')](function(_0x42a445){_0x987c0c=_0x42a445;return db[_0xcd3f('0x52')]['findOne']({'where':{'id':_0x42a445[_0xcd3f('0x53')]},'attributes':['id','vidaooApiKey',_0xcd3f('0x54'),_0xcd3f('0x55'),_0xcd3f('0x56'),'vidaooMetadata'],'raw':!![]});})[_0xcd3f('0x1a')](function(_0x54dff5){if(_0x54dff5&&_0x54dff5[_0xcd3f('0x57')]&&_0x54dff5[_0xcd3f('0x54')]){_0x2cd10d=_0x54dff5;var _0x1a4f46={'interaction':{'id':_0x332746},'agent':{'id':_0x2367eb['user']['id'],'name':_0x2367eb['user'][_0xcd3f('0x32')],'fullname':_0x2367eb[_0xcd3f('0x43')][_0xcd3f('0x58')],'email':_0x2367eb['user'][_0xcd3f('0x59')]},'contact':_0x2367eb[_0xcd3f('0x36')][_0xcd3f('0x5a')],'account':_0x2367eb['body']['account']};var _0x2500e2={'rejectUnauthorized':![],'method':_0xcd3f('0x5b'),'url':_0xcd3f('0x5c'),'headers':{'X-APIKEY':_0x54dff5[_0xcd3f('0x57')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2367eb['user']['email']],'buttons':null,'topic':_0x2cd10d[_0xcd3f('0x55')],'note':_[_0xcd3f('0x5d')](_0x2cd10d['vidaooNote'])?null:getMustacheRender(_0x2cd10d[_0xcd3f('0x56')],_0x1a4f46),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0xcd3f('0x5d')](_0x2cd10d['vidaooMetadata'])){var _0x244ecf=getMustacheRender(_0x2cd10d[_0xcd3f('0x5e')],_0x1a4f46);var _0x586fdb=JSON[_0xcd3f('0x5f')](_0x244ecf);_0x2500e2[_0xcd3f('0x36')][_0xcd3f('0x60')]=_0x586fdb;}}catch(_0x71afb){throw new db[(_0xcd3f('0x61'))][(_0xcd3f('0x62'))](_0xcd3f('0x63'));}return rp(_0x2500e2);}else{throw new db[(_0xcd3f('0x61'))][(_0xcd3f('0x62'))]('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x179db2){_0x3a6942=_0x179db2;if(_0x3a6942['id']){var _0x1e96cf={'body':_0x3a6942['join_url'],'ChatWebsiteId':_0x2cd10d['id'],'ChatInteractionId':_0x987c0c['id'],'direction':'out','UserId':_0x2367eb[_0xcd3f('0x43')]['id']};return db[_0xcd3f('0x64')]['create'](_0x1e96cf,{});}else{throw new db[(_0xcd3f('0x61'))][(_0xcd3f('0x62'))](_0xcd3f('0x65'));}})[_0xcd3f('0x1a')](function(){return _0x987c0c['updateAttributes']({'vidaooSessionId':_0x3a6942['id']});})[_0xcd3f('0x1a')](respondWithResult(_0x48099a,null))['catch'](handleError(_0x48099a,null));};exports[_0xcd3f('0x66')]=function(_0x4c2ed5,_0x43ffd1){if(_0x4c2ed5['body']['id']){delete _0x4c2ed5[_0xcd3f('0x36')]['id'];}return db[_0xcd3f('0x3c')][_0xcd3f('0x4e')]({'where':{'id':_0x4c2ed5[_0xcd3f('0x44')]['id']},'include':[{'model':db[_0xcd3f('0x67')],'as':_0xcd3f('0x68')}]})['then'](handleEntityNotFound(_0x43ffd1,null))[_0xcd3f('0x1a')](saveUpdates(_0x4c2ed5[_0xcd3f('0x36')],null))[_0xcd3f('0x1a')](respondWithResult(_0x43ffd1,null))['catch'](handleError(_0x43ffd1,null));};exports[_0xcd3f('0x69')]=function(_0xfcf300,_0x210beb){if(_0xfcf300[_0xcd3f('0x36')]['id']){delete _0xfcf300[_0xcd3f('0x36')]['id'];}return db[_0xcd3f('0x3c')][_0xcd3f('0x4e')]({'where':{'id':_0xfcf300['params']['id']}})[_0xcd3f('0x1a')](function(_0x2a57b3){if(!_0x2a57b3){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xcd3f('0x69'),0x194,'entity\x20not\x20found');_0x210beb[_0xcd3f('0x25')](0x194);}else{if(_0x2a57b3[_0xcd3f('0x6a')]){throw new db['Sequelize'][(_0xcd3f('0x62'))]('Interaction\x20already\x20assigned');}}return _0x2a57b3;})[_0xcd3f('0x1a')](function(_0x1040fa){if(_0x1040fa){return _0x1040fa[_0xcd3f('0x2f')]({'closed':_0xfcf300[_0xcd3f('0x36')][_0xcd3f('0x6b')],'disposition':_0xfcf300[_0xcd3f('0x36')]['disposition']})['then'](function(_0xcf720){return _0xcf720;});}})['then'](function(){return respondWithRpcPromise(_0xcd3f('0x6c'),_0xcd3f('0x69'),_0xfcf300[_0xcd3f('0x36')],client9004);})[_0xcd3f('0x1a')](respondWithResult(_0x210beb,null))[_0xcd3f('0x24')](handleError(_0x210beb,null));};exports[_0xcd3f('0x6d')]=function(_0x3baa5f,_0x5c31c0){_0x3baa5f['body'][_0xcd3f('0x32')]=_0x3baa5f['file']['originalname'];_0x3baa5f[_0xcd3f('0x36')]['basename']=_0x3baa5f['file']['filename'];_0x3baa5f['body'][_0xcd3f('0x6e')]=_0x3baa5f['file'][_0xcd3f('0x6f')];return db[_0xcd3f('0x70')][_0xcd3f('0x4f')](_0x3baa5f[_0xcd3f('0x36')])['then'](respondWithResult(_0x5c31c0,0xc9))[_0xcd3f('0x24')](handleError(_0x5c31c0,null));};exports[_0xcd3f('0x71')]=function(_0x45838a,_0x10070d){return db[_0xcd3f('0x3c')][_0xcd3f('0x51')]({'where':{'id':_0x45838a[_0xcd3f('0x44')]['id']},'raw':!![]})[_0xcd3f('0x1a')](handleEntityNotFound(_0x10070d,null))[_0xcd3f('0x1a')](function(_0x4d7eaa){if(_0x4d7eaa){if(_0x4d7eaa['closed']){return _0x10070d[_0xcd3f('0x26')](0x193)[_0xcd3f('0x2e')]({'status':0x193,'message':_0xcd3f('0x72')});}return db['Attachment'][_0xcd3f('0x51')]({'where':{'id':_0x45838a[_0xcd3f('0x42')]['attachId']},'raw':!![]})[_0xcd3f('0x1a')](handleEntityNotFound(_0x10070d,null));}})[_0xcd3f('0x1a')](function(_0x56c16a){if(_0x56c16a){var _0x1c028d=_0x56c16a[_0xcd3f('0x73')]!==null;var _0x555bd7=path['join'](config['root'],'server/files/attachments/');if(_0x1c028d){_0x555bd7=path[_0xcd3f('0x74')](_0x555bd7,_0xcd3f('0x75'));}var _0xf7a566=path['join'](_0x555bd7,_0x56c16a[_0xcd3f('0x76')]);return _0x10070d[_0xcd3f('0x77')](_0xf7a566);}})['catch'](handleError(_0x10070d,null));};exports[_0xcd3f('0x78')]=function(_0x2600fd,_0x518d26){var _0x125d77=null;var _0x1e413d=null;var _0x250813=null;if(_0x2600fd[_0xcd3f('0x36')]['id']){delete _0x2600fd['body']['id'];}if(_0x2600fd['body'][_0xcd3f('0x79')]){_0x250813=path['join'](config[_0xcd3f('0x7a')],_0xcd3f('0x7b'),util[_0xcd3f('0x7c')](_0xcd3f('0x7d'),Date['now']()));_0x2600fd[_0xcd3f('0x36')]['pathTranscript']=_0x250813;}return db[_0xcd3f('0x3c')][_0xcd3f('0x4e')]({'where':{'id':_0x2600fd[_0xcd3f('0x44')]['id']},'include':[{'model':db[_0xcd3f('0x64')],'as':'Messages','include':[{'model':db[_0xcd3f('0x7e')],'as':_0xcd3f('0x7e')}]}]})[_0xcd3f('0x1a')](handleEntityNotFound(_0x518d26,null))[_0xcd3f('0x1a')](saveUpdates(_0x2600fd[_0xcd3f('0x36')],null))[_0xcd3f('0x1a')](function(_0x258482){if(_0x258482){_0x125d77=_0x258482;return db['ChatWebsite']['find']({'where':{'id':_0x125d77[_0xcd3f('0x53')]}});}})['then'](function(_0x32a08f){if(_0x32a08f){_0x1e413d=_0x32a08f;return db[_0xcd3f('0x67')][_0xcd3f('0x4e')]({'where':{'id':_0x125d77[_0xcd3f('0x7f')]}});}})[_0xcd3f('0x1a')](function(_0x5a35f0){if(_0x5a35f0){if(_0x250813){var _0x59b774=null;for(var _0x882505=0x1;_0x882505<_0x125d77[_0xcd3f('0x80')][_0xcd3f('0x81')];++_0x882505){_0x59b774=_0x125d77[_0xcd3f('0x80')][_0x882505];var _0x1d2ca3=_0x59b774['UserId']?util[_0xcd3f('0x7c')]('%s%d',_0x1e413d[_0xcd3f('0x82')],_0x59b774['UserId']):'System';var _0x264233=_0x2600fd['body'][_0xcd3f('0x83')]||util[_0xcd3f('0x7c')]('%s%d',_0xcd3f('0x84'),_0x59b774['ContactId']);switch(_0x1e413d[_0xcd3f('0x85')]){case _0xcd3f('0x86'):_0x1d2ca3=_0x59b774[_0xcd3f('0x6a')]?util['format']('%s%d',_0x1e413d[_0xcd3f('0x82')],_0x59b774[_0xcd3f('0x6a')]):_0xcd3f('0x87');break;case'agent_alias':_0x1d2ca3=_0x59b774[_0xcd3f('0x6a')]?_0x59b774[_0xcd3f('0x7e')][_0xcd3f('0x88')]||_0x59b774[_0xcd3f('0x7e')][_0xcd3f('0x58')]:_0xcd3f('0x87');break;case'agent_fullname':_0x1d2ca3=_0x59b774[_0xcd3f('0x6a')]?_0x59b774[_0xcd3f('0x7e')][_0xcd3f('0x58')]:_0xcd3f('0x87');break;default:_0x1d2ca3=_0x59b774[_0xcd3f('0x6a')]?util['format']('%s%d',_0x1e413d[_0xcd3f('0x82')],_0x59b774[_0xcd3f('0x6a')]):_0xcd3f('0x87');}var _0x3a1eb6=util[_0xcd3f('0x7c')](_0xcd3f('0x89'),moment(_0x59b774[_0xcd3f('0x8a')])['format'](_0xcd3f('0x8b')),_0x59b774[_0xcd3f('0x8c')]==='in'?_0x264233:_0x1d2ca3,_0x59b774['body']);if(!_0x59b774[_0xcd3f('0x8d')]){fs[_0xcd3f('0x8e')](_0x250813,_0x3a1eb6);}}return db[_0xcd3f('0x8f')][_0xcd3f('0x51')]({'where':{'service':!![]},'include':[{'model':db[_0xcd3f('0x90')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xcd3f('0x91'),'raw':!![]}]}]});}}})[_0xcd3f('0x1a')](function(_0x455ef7){if(!_0x455ef7||!_0x455ef7[_0xcd3f('0x92')]||!_0x2600fd['body'])return _0x125d77;var _0x23009c=_0x455ef7[_0xcd3f('0x93')]();return respondWithRpcPromise(_0xcd3f('0x94'),_0xcd3f('0x95'),{'account':_0x23009c,'message':{'from':util[_0xcd3f('0x7c')]('\x22%s\x22\x20<%s>',_0x455ef7[_0xcd3f('0x32')],_0x455ef7[_0xcd3f('0x59')]||_0x455ef7[_0xcd3f('0x92')][_0xcd3f('0x43')]),'to':_0x2600fd[_0xcd3f('0x36')]['mailTranscript'],'subject':_0xcd3f('0x96'),'text':util['format'](_0xcd3f('0x97'),_0x2600fd['body']['mailTranscript']),'attachments':[{'path':_0x250813}]}})[_0xcd3f('0x1a')](function(){return _0x125d77;})['catch'](function(_0x14fd83){logger['error'](_0x14fd83);});})['then'](respondWithStatusCode(_0x518d26,0xc8))[_0xcd3f('0x24')](handleError(_0x518d26,null));};exports['addMessage']=function(_0x3cbbff,_0x5ec781){return db['ChatMessage'][_0xcd3f('0x4e')]({'where':{'id':_0x3cbbff['params']['id']}})[_0xcd3f('0x1a')](handleEntityNotFound(_0x5ec781,null))[_0xcd3f('0x1a')](function(_0x5f1c06){if(_0x5f1c06){return _0x5f1c06['addMessage'](_0x3cbbff[_0xcd3f('0x36')][_0xcd3f('0x98')],_[_0xcd3f('0x99')](_0x3cbbff[_0xcd3f('0x36')],[_0xcd3f('0x98'),'id'])||{});}})[_0xcd3f('0x1a')](respondWithResult(_0x5ec781,null))[_0xcd3f('0x24')](handleError(_0x5ec781,null));};exports['getMessages']=function(_0x155b74,_0x4790dd){var _0x15b844={'raw':![],'where':{}};var _0x2735f8={};var _0x23178a={'count':0x0,'rows':[]};return db[_0xcd3f('0x3c')][_0xcd3f('0x51')]({'where':{'id':_0x155b74[_0xcd3f('0x44')]['id']}})[_0xcd3f('0x1a')](handleEntityNotFound(_0x4790dd,null))[_0xcd3f('0x1a')](function(_0x52efbf){if(_0x52efbf){_0x2735f8[_0xcd3f('0x45')]=_[_0xcd3f('0x47')](db[_0xcd3f('0x64')][_0xcd3f('0x46')]);_0x2735f8[_0xcd3f('0x42')]=_[_0xcd3f('0x47')](_0x155b74[_0xcd3f('0x42')]);_0x2735f8[_0xcd3f('0x9a')]=_[_0xcd3f('0x48')](_0x2735f8[_0xcd3f('0x45')],_0x2735f8['query']);_0x15b844[_0xcd3f('0x49')]=_[_0xcd3f('0x48')](_0x2735f8['model'],qs['fields'](_0x155b74['query']['fields']));_0x15b844[_0xcd3f('0x49')]=_0x15b844[_0xcd3f('0x49')][_0xcd3f('0x81')]?_0x15b844[_0xcd3f('0x49')]:_0x2735f8['model'];if(!_0x155b74['query'][_0xcd3f('0x9b')]('nolimit')){_0x15b844['limit']=qs['limit'](_0x155b74[_0xcd3f('0x42')][_0xcd3f('0x2a')]);_0x15b844[_0xcd3f('0x28')]=qs[_0xcd3f('0x28')](_0x155b74[_0xcd3f('0x42')][_0xcd3f('0x28')]);}_0x15b844['order']=qs['sort'](_0x155b74[_0xcd3f('0x42')]['sort']);_0x15b844['where']=qs[_0xcd3f('0x9a')](_[_0xcd3f('0x9c')](_0x155b74[_0xcd3f('0x42')],_0x2735f8['filters']));_0x15b844[_0xcd3f('0x9d')][_0xcd3f('0x9e')]=_0x52efbf['id'];if(_0x155b74[_0xcd3f('0x42')][_0xcd3f('0x9f')]){_0x15b844[_0xcd3f('0x9d')]=_[_0xcd3f('0x35')](_0x15b844[_0xcd3f('0x9d')],{'$or':_['map'](_0x15b844[_0xcd3f('0x49')],function(_0x1499b8){var _0x468a4a={};_0x468a4a[_0x1499b8]={'$like':'%'+_0x155b74[_0xcd3f('0x42')][_0xcd3f('0x9f')]+'%'};return _0x468a4a;})});}if(_0x155b74[_0xcd3f('0x42')][_0xcd3f('0xa0')]){var _0x17f775=_0x155b74[_0xcd3f('0x42')]['$gte'][_0xcd3f('0xa1')](',');var _0xaee661={};_0xaee661[_0x17f775[0x0]]={'$gte':moment(_0x17f775[0x1])['format'](_0xcd3f('0xa2'))};_0x15b844[_0xcd3f('0x9d')]=_[_0xcd3f('0x35')](_0x15b844[_0xcd3f('0x9d')],_0xaee661);}_0x15b844=_['merge']({},_0x15b844,_0x155b74[_0xcd3f('0x4d')]);return db[_0xcd3f('0x64')][_0xcd3f('0x2b')]({'where':_0x15b844['where']})['then'](function(_0x53c459){_0x23178a[_0xcd3f('0x2b')]=_0x53c459;if(_0x155b74['query'][_0xcd3f('0x4b')]){_0x15b844[_0xcd3f('0x4c')]=[{'all':!![]}];}return db[_0xcd3f('0x64')]['findAll'](_0x15b844);})[_0xcd3f('0x1a')](function(_0x55897f){_0x23178a[_0xcd3f('0xa3')]=_0x55897f;return _0x23178a;});}})[_0xcd3f('0x1a')](respondWithFilteredResult(_0x4790dd,_0x15b844))[_0xcd3f('0x24')](handleError(_0x4790dd,null));};exports[_0xcd3f('0xa4')]=function(_0x24c24b,_0x1a5ae2){var _0x2df4c5={'where':{}},_0xf2910={},_0x39e47b={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x24c24b[_0xcd3f('0x44')]['id']}})[_0xcd3f('0x1a')](handleEntityNotFound(_0x1a5ae2,null))[_0xcd3f('0x1a')](function(_0x1cc02e){if(_0x1cc02e){_0xf2910['model']=_['keys'](db['ChatMessage'][_0xcd3f('0x46')]);_0xf2910[_0xcd3f('0x42')]=_[_0xcd3f('0x47')](_0x24c24b[_0xcd3f('0x42')]);_0xf2910['filters']=_['intersection'](_0xf2910[_0xcd3f('0x45')],_0xf2910[_0xcd3f('0x42')]);_0x2df4c5[_0xcd3f('0x49')]=_['intersection'](_0xf2910[_0xcd3f('0x45')],qs[_0xcd3f('0x4a')](_0x24c24b[_0xcd3f('0x42')][_0xcd3f('0x4a')]));_0x2df4c5[_0xcd3f('0x49')]=_0x2df4c5[_0xcd3f('0x49')][_0xcd3f('0x81')]?_0x2df4c5[_0xcd3f('0x49')]:_0xf2910[_0xcd3f('0x45')];if(!_0x24c24b[_0xcd3f('0x42')][_0xcd3f('0x9b')](_0xcd3f('0xa5'))){_0x2df4c5['limit']=qs[_0xcd3f('0x2a')](_0x24c24b['query'][_0xcd3f('0x2a')]);_0x2df4c5[_0xcd3f('0x28')]=qs['offset'](_0x24c24b[_0xcd3f('0x42')][_0xcd3f('0x28')]);}_0x2df4c5[_0xcd3f('0xa6')]=qs[_0xcd3f('0xa7')](_0x24c24b[_0xcd3f('0x42')][_0xcd3f('0xa7')]);_0x2df4c5['where']=qs[_0xcd3f('0x9a')](_[_0xcd3f('0x9c')](_0x24c24b[_0xcd3f('0x42')],_0xf2910[_0xcd3f('0x9a')]));_0x2df4c5[_0xcd3f('0x9d')][_0xcd3f('0x9e')]=_0x1cc02e['id'];if(_0x24c24b[_0xcd3f('0x42')]['filter']){_0x2df4c5[_0xcd3f('0x9d')]=_[_0xcd3f('0x35')](_0x2df4c5[_0xcd3f('0x9d')],{'$or':_['map'](_0x2df4c5['attributes'],function(_0x209ed0){var _0x1dc965={};_0x1dc965[_0x209ed0]={'$like':'%'+_0x24c24b[_0xcd3f('0x42')][_0xcd3f('0x9f')]+'%'};return _0x1dc965;})});}_0x2df4c5[_0xcd3f('0x9d')][_0xcd3f('0x8d')]=![];if(_0x24c24b[_0xcd3f('0x42')]['id']){_0x2df4c5[_0xcd3f('0x9d')]['id']={'$gt':_0x24c24b['query']['id']};}_0x2df4c5=_[_0xcd3f('0x35')]({},_0x2df4c5,_0x24c24b[_0xcd3f('0x4d')]);return db['ChatMessage'][_0xcd3f('0x2b')]({'where':_0x2df4c5[_0xcd3f('0x9d')]})[_0xcd3f('0x1a')](function(_0x191ed8){_0x39e47b[_0xcd3f('0x2b')]=_0x191ed8;_0x2df4c5[_0xcd3f('0x4c')]=[];if(_0x24c24b['query'][_0xcd3f('0xa8')]){_0x2df4c5[_0xcd3f('0x4c')]['push']({'model':db[_0xcd3f('0x7e')],'as':'User','attributes':['id','fullname','alias']});}if(_0x24c24b[_0xcd3f('0x42')][_0xcd3f('0x4b')]){_0x2df4c5[_0xcd3f('0x4c')]=[{'all':!![]}];}return db[_0xcd3f('0x64')]['findAll'](_0x2df4c5);})['then'](function(_0x4c96d0){_0x39e47b[_0xcd3f('0xa3')]=_0x4c96d0;return _0x39e47b;});}})[_0xcd3f('0x1a')](respondWithFilteredResult(_0x1a5ae2,_0x2df4c5))[_0xcd3f('0x24')](handleError(_0x1a5ae2,null));};exports['addTags']=function(_0xb987d6,_0x3940a5){return db['ChatInteraction'][_0xcd3f('0x4e')]({'where':{'id':_0xb987d6['params']['id']}})[_0xcd3f('0x1a')](handleEntityNotFound(_0x3940a5,null))[_0xcd3f('0x1a')](function(_0x30534e){if(_0x30534e){return _0x30534e[_0xcd3f('0xa9')](_0xb987d6[_0xcd3f('0x36')]['ids'],_[_0xcd3f('0x99')](_0xb987d6[_0xcd3f('0x36')],['ids','id'])||{})[_0xcd3f('0xaa')](function(){return db[_0xcd3f('0xab')][_0xcd3f('0x40')]({'attributes':['id',_0xcd3f('0x32'),_0xcd3f('0xac')],'where':{'id':_0xb987d6[_0xcd3f('0x36')][_0xcd3f('0x98')]}});})[_0xcd3f('0x1a')](function(_0x5195c3){socket[_0xcd3f('0xad')](_0xcd3f('0xae'),{'id':Number(_0xb987d6[_0xcd3f('0x44')]['id']),'tags':_0x5195c3||[]});return{'id':Number(_0xb987d6[_0xcd3f('0x44')]['id']),'tags':_0x5195c3||[]};});}})['then'](respondWithResult(_0x3940a5,null))[_0xcd3f('0x24')](handleError(_0x3940a5,null));};exports[_0xcd3f('0xaf')]=function(_0x73dc5d,_0x399d6e){return db[_0xcd3f('0x3c')][_0xcd3f('0x4e')]({'where':{'id':_0x73dc5d[_0xcd3f('0x44')]['id']}})[_0xcd3f('0x1a')](handleEntityNotFound(_0x399d6e,null))[_0xcd3f('0x1a')](function(_0x18fd51){if(_0x18fd51){return _0x18fd51[_0xcd3f('0xaf')](_0x73dc5d[_0xcd3f('0x42')][_0xcd3f('0x98')]);}})[_0xcd3f('0x1a')](respondWithStatusCode(_0x399d6e,null))[_0xcd3f('0x24')](handleError(_0x399d6e,null));};exports[_0xcd3f('0x77')]=function(_0x219140,_0x5139c3){var _0x5ac838=moment()[_0xcd3f('0xb0')]()['toString']();var _0x5997af=path[_0xcd3f('0x74')](config['root'],_0xcd3f('0xb1'),_0xcd3f('0xb2'),_0xcd3f('0xb3'));var _0xff4cd6=path[_0xcd3f('0x74')](config['root'],'server',_0xcd3f('0xb2'),_0xcd3f('0xb4'));var _0x1f4c04=path['join'](_0x5997af,_0x5ac838);var _0x12d719=util['format'](_0xcd3f('0xb5'),_0x219140[_0xcd3f('0x44')]['id'],_0x5ac838);var _0x28e59b=path['join'](_0x5997af,_0x12d719);var _0x3e455b=[];_0x3e455b[_0xcd3f('0xb6')]({'model':db['User'],'as':_0xcd3f('0x7e'),'attributes':['id',_0xcd3f('0x58')],'raw':!![]});_0x3e455b[_0xcd3f('0xb6')]({'model':db[_0xcd3f('0x67')],'as':_0xcd3f('0x68'),'attributes':['id',_0xcd3f('0xb7'),_0xcd3f('0xb8')],'raw':!![]});if(_0x219140[_0xcd3f('0x42')][_0xcd3f('0xb4')]){_0x3e455b[_0xcd3f('0xb6')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x234cfd=[{'model':db[_0xcd3f('0x64')],'as':_0xcd3f('0x80'),'attributes':['id',_0xcd3f('0x36'),_0xcd3f('0x8a'),_0xcd3f('0x8c'),_0xcd3f('0x8d'),'read'],'include':_0x3e455b}];_0x234cfd[_0xcd3f('0xb6')]({'model':db[_0xcd3f('0x52')],'as':'Account','attributes':['id',_0xcd3f('0x32')]});_0x234cfd[_0xcd3f('0xb6')]({'model':db['User'],'as':'Owner','attributes':['id',_0xcd3f('0x58')]});return db[_0xcd3f('0x3c')][_0xcd3f('0x4e')]({'where':{'id':_0x219140[_0xcd3f('0x44')]['id']},'include':_0x234cfd})[_0xcd3f('0x1a')](handleEntityNotFound(_0x5139c3,null))['then'](function(_0x22d82c){if(_0x22d82c){var _0x3c75a0=_0x22d82c[_0xcd3f('0xb9')]({'plain':!![]});fs['mkdirSync'](_0x1f4c04);var _0x3be1af={'channel':_0xcd3f('0xba'),'account':_0x3c75a0[_0xcd3f('0xbb')]['name'],'agent':_0x3c75a0['Owner']?_0x3c75a0[_0xcd3f('0xbc')][_0xcd3f('0x58')]:_0xcd3f('0xbd'),'createdAt':moment(_0x3c75a0[_0xcd3f('0x8a')])['format'](_0xcd3f('0xa2'))[_0xcd3f('0xbe')](),'closedAt':_0x3c75a0[_0xcd3f('0x6b')]?moment(_0x3c75a0['closedAt'])[_0xcd3f('0x7c')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x3c75a0['disposition'],'chatInfo':{'browser':_0x3c75a0[_0xcd3f('0xbf')],'os':_0x3c75a0[_0xcd3f('0xc0')],'referer':_0x3c75a0[_0xcd3f('0xc1')],'customerIp':_0x3c75a0[_0xcd3f('0xc2')],'customerPort':_0x3c75a0[_0xcd3f('0xc3')]?_0x3c75a0[_0xcd3f('0xc3')]:'N.A.'},'messages':_(_0x3c75a0[_0xcd3f('0x80')])[_0xcd3f('0xc4')]()[_0xcd3f('0x9f')]({'secret':![]})[_0xcd3f('0x3b')](function(_0x5c3607){if(_0x5c3607['Attachment']){var _0x85a93a=path[_0xcd3f('0x74')](_0xff4cd6,_0x5c3607[_0xcd3f('0x70')][_0xcd3f('0x76')]);if(fs[_0xcd3f('0xc5')](_0x85a93a)){fs['createReadStream'](_0x85a93a)[_0xcd3f('0xc6')](fs['createWriteStream'](path[_0xcd3f('0x74')](_0x1f4c04,_0x5c3607[_0xcd3f('0x70')]['basename'])));}}return{'date':moment(_0x5c3607['createdAt'])['format'](_0xcd3f('0xa2'))[_0xcd3f('0xbe')](),'sender':_0x5c3607[_0xcd3f('0x8c')]===_0xcd3f('0xc7')?_0x5c3607['User']?_0x5c3607[_0xcd3f('0x7e')][_0xcd3f('0x58')]:_0xcd3f('0x87'):_0x5c3607[_0xcd3f('0x68')]['firstName']+(_0x5c3607[_0xcd3f('0x68')][_0xcd3f('0xb8')]?'\x20'+_0x5c3607[_0xcd3f('0x68')][_0xcd3f('0xb8')]:''),'body':_0x5c3607[_0xcd3f('0x70')]?_0x5c3607[_0xcd3f('0x70')][_0xcd3f('0x76')]:_0x5c3607['body'],'direction':_0x5c3607[_0xcd3f('0x8c')]===_0xcd3f('0xc7')?'A':'C','secret':_0x5c3607['secret'],'read':_0x5c3607['read'],'attachment':_0x5c3607['Attachment']};})[_0xcd3f('0xc8')]()};return ejs[_0xcd3f('0xc9')](path[_0xcd3f('0x74')](config[_0xcd3f('0x7a')],'server',_0xcd3f('0xca'),'downloadInteraction.ejs'),{'interaction':_0x3be1af})['then'](function(_0x16aded){var _0x7e6cb7=path['join'](_0x1f4c04,'transcript-'+_0x3c75a0['id']+'-'+_0x5ac838+_0xcd3f('0xcb'));var _0xeabbe0={'path':_0x7e6cb7,'channel':'Chat','interactionId':_0x3c75a0['id']};return pdf[_0xcd3f('0xcc')](_0x16aded,_0xeabbe0);})['then'](function(){return new Promise(function(_0x1f2604,_0x192efe){zipdir(_0x1f4c04,{'saveTo':_0x28e59b},function(_0x44a322,_0x2dd749){if(_0x44a322)return _0x192efe(_0x44a322);return _0x1f2604(_0x2dd749);});})[_0xcd3f('0x1a')](function(){return new BPromise(function(_0x5e6a8a,_0x44699b){rimraf(_0x1f4c04,function(_0x5bf34e){if(_0x5bf34e)_0x44699b(_0x5bf34e);return _0x5e6a8a();});});})[_0xcd3f('0x1a')](function(){return _0x5139c3['download'](_0x28e59b,_0x12d719,function(_0x3cff09){if(_0x3cff09){logger[_0xcd3f('0x20')](_0xcd3f('0xcd'),_0x3cff09);}else{fs[_0xcd3f('0xce')](_0x28e59b);}});});});}else{return _0x5139c3[_0xcd3f('0x25')](0xc8);}})[_0xcd3f('0x24')](handleError(_0x5139c3,null));};
\ No newline at end of file
+var _0x4805=['request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','undefined','limit','count','offset','Content-Range','update','destroy','sendStatus','stack','name','send','render','merge','contact','agent','interaction','account','index','map','fieldName','key','getOptions','findAll','chat','query','user','show','params','model','ChatInteraction','keys','filters','intersection','attributes','fields','length','includeAll','options','find','create','body','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','follow','isNull','parse','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','Messages','User','ContactId','format','%s%d','System','customer','Visitor','website_alias','agentAlias','agent_alias','alias','fullname','agent_fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','MailAccount','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','rawAttributes','hasOwnProperty','order','sort','pick','where','ChatInteractionId','filter','$gte','include','nolimit','includeAgent','rows','setTags','omit','spread','Tag','color','emit','chatInteractionTags:save','removeTags','unix','toString','files','server','attachments','transcript-%d-%s.zip','push','firstName','lastName','direction','read','Account','Owner','get','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','browserName','osName','referer','customerIp','tail','existsSync','value','views','downloadInteraction.ejs','transcript-','.pdf','err','unlinkSync','request-promise','bluebird','mustache','util','path','ejs','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','then','info','ChatInteraction,\x20%s,\x20%s'];(function(_0x4254fa,_0x5cc31c){var _0x22efe9=function(_0x5c19dd){while(--_0x5c19dd){_0x4254fa['push'](_0x4254fa['shift']());}};_0x22efe9(++_0x5cc31c);}(_0x4805,0xbe));var _0x5480=function(_0xb5fe5c,_0xc4acc7){_0xb5fe5c=_0xb5fe5c-0x0;var _0x5c4ca4=_0x4805[_0xb5fe5c];return _0x5c4ca4;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var rp=require(_0x5480('0x0'));var moment=require('moment');var BPromise=require(_0x5480('0x1'));var Mustache=require(_0x5480('0x2'));var util=require(_0x5480('0x3'));var path=require(_0x5480('0x4'));var ejs=require(_0x5480('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require(_0x5480('0x6'));var pdf=require(_0x5480('0x7'));var logger=require(_0x5480('0x8'))('api');var config=require(_0x5480('0x9'));var db=require(_0x5480('0xa'))['db'];config[_0x5480('0xb')]=_[_0x5480('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5480('0xd'))(new Redis(config['redis']));require(_0x5480('0xe'))[_0x5480('0xf')](socket);var jayson=require(_0x5480('0x10'));var client=jayson[_0x5480('0x11')][_0x5480('0x12')]({'port':0x232b});var client9004=jayson['client'][_0x5480('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x3fe85a,_0x4d27d5,_0x216ab1,_0x5d80d4){return new BPromise(function(_0x5bb327,_0xfb833c){var _0x4d5633=_0x5d80d4||client;return _0x4d5633['request'](_0x3fe85a,_0x216ab1)[_0x5480('0x13')](function(_0x18b5a1){logger[_0x5480('0x14')](_0x5480('0x15'),_0x4d27d5,_0x5480('0x16'));logger[_0x5480('0x17')](_0x5480('0x18'),_0x4d27d5,'request\x20sent',JSON[_0x5480('0x19')](_0x18b5a1));if(_0x18b5a1['error']){if(_0x18b5a1[_0x5480('0x1a')][_0x5480('0x1b')]===0x1f4){logger['error'](_0x5480('0x15'),_0x4d27d5,_0x18b5a1[_0x5480('0x1a')][_0x5480('0x1c')]);return _0xfb833c(_0x18b5a1[_0x5480('0x1a')][_0x5480('0x1c')]);}logger[_0x5480('0x1a')](_0x5480('0x15'),_0x4d27d5,_0x18b5a1[_0x5480('0x1a')][_0x5480('0x1c')]);return _0x5bb327(_0x18b5a1[_0x5480('0x1a')][_0x5480('0x1c')]);}else{logger[_0x5480('0x14')](_0x5480('0x15'),_0x4d27d5,_0x5480('0x16'));_0x5bb327(_0x18b5a1[_0x5480('0x1d')][_0x5480('0x1c')]);}})[_0x5480('0x1e')](function(_0x4606d2){logger[_0x5480('0x1a')](_0x5480('0x15'),_0x4d27d5,_0x4606d2);_0xfb833c(_0x4606d2);});});}function respondWithStatusCode(_0x2e6398,_0x45e12d){_0x45e12d=_0x45e12d||0xcc;return function(_0x1aede0){if(_0x1aede0){return _0x2e6398['sendStatus'](_0x45e12d);}return _0x2e6398[_0x5480('0x1f')](_0x45e12d)[_0x5480('0x20')]();};}function respondWithResult(_0x585b17,_0x3c661a){_0x3c661a=_0x3c661a||0xc8;return function(_0x54cea7){if(_0x54cea7){return _0x585b17[_0x5480('0x1f')](_0x3c661a)[_0x5480('0x21')](_0x54cea7);}};}function respondWithFilteredResult(_0x4d5a24,_0x174bd3){return function(_0x305839){if(_0x305839){var _0x31d845=typeof _0x174bd3['offset']===_0x5480('0x22')&&typeof _0x174bd3[_0x5480('0x23')]===_0x5480('0x22');var _0x3e382a=_0x305839[_0x5480('0x24')];var _0xa517b=_0x31d845?0x0:_0x174bd3[_0x5480('0x25')];var _0x53d331=_0x31d845?_0x305839[_0x5480('0x24')]:_0x174bd3[_0x5480('0x25')]+_0x174bd3[_0x5480('0x23')];var _0x52003c;if(_0x53d331>=_0x3e382a){_0x53d331=_0x3e382a;_0x52003c=0xc8;}else{_0x52003c=0xce;}_0x4d5a24[_0x5480('0x1f')](_0x52003c);return _0x4d5a24['set'](_0x5480('0x26'),_0xa517b+'-'+_0x53d331+'/'+_0x3e382a)[_0x5480('0x21')](_0x305839);}return null;};}function saveUpdates(_0x2ee917){return function(_0x3ddbf1){if(_0x3ddbf1){return _0x3ddbf1[_0x5480('0x27')](_0x2ee917)[_0x5480('0x13')](function(_0x534c11){return _0x534c11;});}return null;};}function removeEntity(_0x1066f8){return function(_0xab9fdf){if(_0xab9fdf){return _0xab9fdf[_0x5480('0x28')]()['then'](function(){_0x1066f8[_0x5480('0x1f')](0xcc)[_0x5480('0x20')]();});}};}function handleEntityNotFound(_0x34958f){return function(_0x39d622){if(!_0x39d622){_0x34958f[_0x5480('0x29')](0x194);}return _0x39d622;};}function handleError(_0x120007,_0x2c4c35){_0x2c4c35=_0x2c4c35||0x1f4;return function(_0x8c4c9){logger[_0x5480('0x1a')](_0x8c4c9[_0x5480('0x2a')]);if(_0x8c4c9[_0x5480('0x2b')]){delete _0x8c4c9['name'];}_0x120007[_0x5480('0x1f')](_0x2c4c35)[_0x5480('0x2c')](_0x8c4c9);};}function getMustacheRender(_0x5f06c0,_0x248fe9){return Mustache[_0x5480('0x2d')](_0x5f06c0,_[_0x5480('0x2e')](_0x248fe9['body'],{'contact':_0x248fe9[_0x5480('0x2f')],'message':_0x248fe9['message'],'agent':_0x248fe9[_0x5480('0x30')],'interaction':_0x248fe9[_0x5480('0x31')],'account':_0x248fe9[_0x5480('0x32')]}))||'';}exports[_0x5480('0x33')]=function(_0x1b6412,_0x20c809){var _0x5b06ee={};var _0x56a6d7=_[_0x5480('0x34')](db['ChatInteraction']['rawAttributes'],function(_0x578c71){return{'name':_0x578c71[_0x5480('0x35')],'type':_0x578c71['type'][_0x5480('0x36')]};});_0x5b06ee=qs[_0x5480('0x37')](_0x56a6d7,_0x1b6412);return interaction[_0x5480('0x38')](_0x5480('0x39'),_0x1b6412[_0x5480('0x3a')],_0x1b6412[_0x5480('0x3b')],_0x5b06ee,_0x56a6d7)[_0x5480('0x13')](respondWithFilteredResult(_0x20c809,_0x5b06ee))['catch'](handleError(_0x20c809,null));};exports[_0x5480('0x3c')]=function(_0x562ad6,_0x321632){var _0x19acb8={'raw':![],'where':{'id':_0x562ad6[_0x5480('0x3d')]['id']}},_0x156b94={};_0x156b94[_0x5480('0x3e')]=_['keys'](db[_0x5480('0x3f')]['rawAttributes']);_0x156b94[_0x5480('0x3a')]=_[_0x5480('0x40')](_0x562ad6[_0x5480('0x3a')]);_0x156b94[_0x5480('0x41')]=_[_0x5480('0x42')](_0x156b94[_0x5480('0x3e')],_0x156b94['query']);_0x19acb8[_0x5480('0x43')]=_[_0x5480('0x42')](_0x156b94['model'],qs['fields'](_0x562ad6[_0x5480('0x3a')][_0x5480('0x44')]));_0x19acb8['attributes']=_0x19acb8[_0x5480('0x43')][_0x5480('0x45')]?_0x19acb8[_0x5480('0x43')]:_0x156b94[_0x5480('0x3e')];if(_0x562ad6['query'][_0x5480('0x46')]){_0x19acb8['include']=[{'all':!![]}];}_0x19acb8=_['merge']({},_0x19acb8,_0x562ad6[_0x5480('0x47')]);return db[_0x5480('0x3f')][_0x5480('0x48')](_0x19acb8)['then'](handleEntityNotFound(_0x321632,null))[_0x5480('0x13')](respondWithResult(_0x321632,null))[_0x5480('0x1e')](handleError(_0x321632,null));};exports[_0x5480('0x49')]=function(_0x422ba0,_0xb11cd2){return db[_0x5480('0x3f')][_0x5480('0x49')](_0x422ba0['body'],{})[_0x5480('0x13')](respondWithResult(_0xb11cd2,0xc9))[_0x5480('0x1e')](handleError(_0xb11cd2,null));};exports['update']=function(_0xaabf1a,_0x2e8a6a){if(_0xaabf1a[_0x5480('0x4a')]['id']){delete _0xaabf1a[_0x5480('0x4a')]['id'];}return db['ChatInteraction'][_0x5480('0x48')]({'where':{'id':_0xaabf1a[_0x5480('0x3d')]['id']}})[_0x5480('0x13')](handleEntityNotFound(_0x2e8a6a,null))[_0x5480('0x13')](saveUpdates(_0xaabf1a[_0x5480('0x4a')],null))[_0x5480('0x13')](respondWithResult(_0x2e8a6a,null))['catch'](handleError(_0x2e8a6a,null));};exports['destroy']=function(_0x392e7e,_0x31c16e){return db[_0x5480('0x3f')][_0x5480('0x48')]({'where':{'id':_0x392e7e[_0x5480('0x3d')]['id']}})['then'](handleEntityNotFound(_0x31c16e,null))['then'](removeEntity(_0x31c16e,null))[_0x5480('0x1e')](handleError(_0x31c16e,null));};exports[_0x5480('0x4b')]=function(_0x1de156,_0x1bd7d1){return db['ChatInteraction'][_0x5480('0x4b')]()[_0x5480('0x13')](respondWithResult(_0x1bd7d1,null))[_0x5480('0x1e')](handleError(_0x1bd7d1,null));};exports[_0x5480('0x4c')]=function(_0x1ed01d,_0x1728fd){var _0x1b4bb0=_0x1ed01d[_0x5480('0x3d')]['id'];var _0x3d4db0;var _0x4f71e6;var _0x367a38;return db[_0x5480('0x3f')][_0x5480('0x4d')]({'where':{'id':_0x1b4bb0}})[_0x5480('0x13')](function(_0x3c3ce7){_0x3d4db0=_0x3c3ce7;return db[_0x5480('0x4e')][_0x5480('0x4d')]({'where':{'id':_0x3c3ce7[_0x5480('0x4f')]},'attributes':['id',_0x5480('0x50'),_0x5480('0x51'),'vidaooTopic',_0x5480('0x52'),_0x5480('0x53')],'raw':!![]});})[_0x5480('0x13')](function(_0x4c2764){if(_0x4c2764&&_0x4c2764[_0x5480('0x50')]&&_0x4c2764[_0x5480('0x51')]){_0x4f71e6=_0x4c2764;var _0x277aff={'interaction':{'id':_0x1b4bb0},'agent':{'id':_0x1ed01d[_0x5480('0x3b')]['id'],'name':_0x1ed01d['user'][_0x5480('0x2b')],'fullname':_0x1ed01d[_0x5480('0x3b')]['fullname'],'email':_0x1ed01d[_0x5480('0x3b')][_0x5480('0x54')]},'contact':_0x1ed01d['body']['contact'],'account':_0x1ed01d[_0x5480('0x4a')][_0x5480('0x32')]};var _0x37fb55={'rejectUnauthorized':![],'method':_0x5480('0x55'),'url':_0x5480('0x56'),'headers':{'X-APIKEY':_0x4c2764[_0x5480('0x50')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1ed01d['user'][_0x5480('0x54')]],'buttons':null,'topic':_0x4f71e6[_0x5480('0x57')],'note':_['isNull'](_0x4f71e6[_0x5480('0x52')])?null:getMustacheRender(_0x4f71e6[_0x5480('0x52')],_0x277aff),'metadata':null},'redirect':_0x5480('0x58'),'json':!![]};try{if(!_[_0x5480('0x59')](_0x4f71e6[_0x5480('0x53')])){var _0x3077af=getMustacheRender(_0x4f71e6[_0x5480('0x53')],_0x277aff);var _0x59630f=JSON[_0x5480('0x5a')](_0x3077af);_0x37fb55['body'][_0x5480('0x5b')]=_0x59630f;}}catch(_0x59df5b){throw new db[(_0x5480('0x5c'))][(_0x5480('0x5d'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x37fb55);}else{throw new db[(_0x5480('0x5c'))][(_0x5480('0x5d'))](_0x5480('0x5e'));}})[_0x5480('0x13')](function(_0x566d5d){_0x367a38=_0x566d5d;if(_0x367a38['id']){var _0x1fb930={'body':_0x367a38[_0x5480('0x5f')],'ChatWebsiteId':_0x4f71e6['id'],'ChatInteractionId':_0x3d4db0['id'],'direction':_0x5480('0x60'),'UserId':_0x1ed01d['user']['id']};return db[_0x5480('0x61')][_0x5480('0x49')](_0x1fb930,{});}else{throw new db['Sequelize'][(_0x5480('0x5d'))](_0x5480('0x62'));}})[_0x5480('0x13')](function(){return _0x3d4db0[_0x5480('0x63')]({'vidaooSessionId':_0x367a38['id']});})['then'](respondWithResult(_0x1728fd,null))[_0x5480('0x1e')](handleError(_0x1728fd,null));};exports[_0x5480('0x64')]=function(_0x378804,_0x35c4e0){if(_0x378804[_0x5480('0x4a')]['id']){delete _0x378804['body']['id'];}return db[_0x5480('0x3f')]['find']({'where':{'id':_0x378804['params']['id']},'include':[{'model':db[_0x5480('0x65')],'as':_0x5480('0x66')}]})['then'](handleEntityNotFound(_0x35c4e0,null))[_0x5480('0x13')](saveUpdates(_0x378804[_0x5480('0x4a')],null))[_0x5480('0x13')](respondWithResult(_0x35c4e0,null))[_0x5480('0x1e')](handleError(_0x35c4e0,null));};exports[_0x5480('0x67')]=function(_0x588a54,_0x2a8a9c){if(_0x588a54[_0x5480('0x4a')]['id']){delete _0x588a54[_0x5480('0x4a')]['id'];}return db[_0x5480('0x3f')][_0x5480('0x48')]({'where':{'id':_0x588a54['params']['id']}})[_0x5480('0x13')](function(_0x4d8ed4){if(!_0x4d8ed4){logger[_0x5480('0x1a')](_0x5480('0x68'),_0x5480('0x67'),0x194,_0x5480('0x69'));_0x2a8a9c['sendStatus'](0x194);}else{if(_0x4d8ed4[_0x5480('0x6a')]){throw new db[(_0x5480('0x5c'))][(_0x5480('0x5d'))](_0x5480('0x6b'));}}return _0x4d8ed4;})['then'](function(_0x91031a){if(_0x91031a){return _0x91031a[_0x5480('0x27')]({'closed':_0x588a54['body'][_0x5480('0x6c')],'disposition':_0x588a54['body']['disposition']})[_0x5480('0x13')](function(_0x54adf4){return _0x54adf4;});}})[_0x5480('0x13')](function(){return respondWithRpcPromise(_0x5480('0x6d'),'abandon',_0x588a54[_0x5480('0x4a')],client9004);})[_0x5480('0x13')](respondWithResult(_0x2a8a9c,null))[_0x5480('0x1e')](handleError(_0x2a8a9c,null));};exports[_0x5480('0x6e')]=function(_0x3cc6b4,_0x4ffe49){_0x3cc6b4[_0x5480('0x4a')]['name']=_0x3cc6b4[_0x5480('0x6f')][_0x5480('0x70')];_0x3cc6b4[_0x5480('0x4a')][_0x5480('0x71')]=_0x3cc6b4['file'][_0x5480('0x72')];_0x3cc6b4['body']['type']=_0x3cc6b4[_0x5480('0x6f')]['mimetype'];return db[_0x5480('0x73')]['create'](_0x3cc6b4[_0x5480('0x4a')])[_0x5480('0x13')](respondWithResult(_0x4ffe49,0xc9))[_0x5480('0x1e')](handleError(_0x4ffe49,null));};exports[_0x5480('0x74')]=function(_0x4104e8,_0x5efc9e){return db[_0x5480('0x3f')][_0x5480('0x4d')]({'where':{'id':_0x4104e8[_0x5480('0x3d')]['id']},'raw':!![]})[_0x5480('0x13')](handleEntityNotFound(_0x5efc9e,null))['then'](function(_0x39685f){if(_0x39685f){if(_0x39685f[_0x5480('0x6c')]){return _0x5efc9e[_0x5480('0x1f')](0x193)[_0x5480('0x21')]({'status':0x193,'message':_0x5480('0x75')});}return db['Attachment'][_0x5480('0x4d')]({'where':{'id':_0x4104e8[_0x5480('0x3a')][_0x5480('0x76')]},'raw':!![]})[_0x5480('0x13')](handleEntityNotFound(_0x5efc9e,null));}})[_0x5480('0x13')](function(_0x33bda4){if(_0x33bda4){var _0x5ca488=_0x33bda4[_0x5480('0x77')]!==null;var _0x5eb346=path[_0x5480('0x78')](config[_0x5480('0x79')],_0x5480('0x7a'));if(_0x5ca488){_0x5eb346=path[_0x5480('0x78')](_0x5eb346,_0x5480('0x7b'));}var _0x4bc58b=path[_0x5480('0x78')](_0x5eb346,_0x33bda4[_0x5480('0x71')]);return _0x5efc9e[_0x5480('0x7c')](_0x4bc58b);}})[_0x5480('0x1e')](handleError(_0x5efc9e,null));};exports[_0x5480('0x7d')]=function(_0x106b8a,_0x2d9969){var _0x38f71b=null;var _0x356e4d=null;var _0x15e74b=null;if(_0x106b8a[_0x5480('0x4a')]['id']){delete _0x106b8a[_0x5480('0x4a')]['id'];}if(_0x106b8a[_0x5480('0x4a')][_0x5480('0x7e')]){_0x15e74b=path['join'](config['root'],_0x5480('0x7f'),util['format'](_0x5480('0x80'),Date[_0x5480('0x81')]()));_0x106b8a['body'][_0x5480('0x82')]=_0x15e74b;}return db['ChatInteraction'][_0x5480('0x48')]({'where':{'id':_0x106b8a['params']['id']},'include':[{'model':db['ChatMessage'],'as':_0x5480('0x83'),'include':[{'model':db[_0x5480('0x84')],'as':'User'}]}]})['then'](handleEntityNotFound(_0x2d9969,null))[_0x5480('0x13')](saveUpdates(_0x106b8a['body'],null))[_0x5480('0x13')](function(_0x4c2e15){if(_0x4c2e15){_0x38f71b=_0x4c2e15;return db[_0x5480('0x4e')][_0x5480('0x48')]({'where':{'id':_0x38f71b[_0x5480('0x4f')]}});}})[_0x5480('0x13')](function(_0x33c672){if(_0x33c672){_0x356e4d=_0x33c672;return db[_0x5480('0x65')][_0x5480('0x48')]({'where':{'id':_0x38f71b[_0x5480('0x85')]}});}})[_0x5480('0x13')](function(_0x36e1b9){if(_0x36e1b9){if(_0x15e74b){var _0xd46285=null;for(var _0x1af9f1=0x1;_0x1af9f1<_0x38f71b[_0x5480('0x83')][_0x5480('0x45')];++_0x1af9f1){_0xd46285=_0x38f71b['Messages'][_0x1af9f1];var _0x55b644=_0xd46285['UserId']?util[_0x5480('0x86')](_0x5480('0x87'),_0x356e4d['agentAlias'],_0xd46285[_0x5480('0x6a')]):_0x5480('0x88');var _0x35fe01=_0x106b8a['body'][_0x5480('0x89')]||util[_0x5480('0x86')](_0x5480('0x87'),_0x5480('0x8a'),_0xd46285[_0x5480('0x85')]);switch(_0x356e4d['agentIdentifier']){case _0x5480('0x8b'):_0x55b644=_0xd46285[_0x5480('0x6a')]?util[_0x5480('0x86')](_0x5480('0x87'),_0x356e4d[_0x5480('0x8c')],_0xd46285[_0x5480('0x6a')]):'System';break;case _0x5480('0x8d'):_0x55b644=_0xd46285[_0x5480('0x6a')]?_0xd46285[_0x5480('0x84')][_0x5480('0x8e')]||_0xd46285[_0x5480('0x84')][_0x5480('0x8f')]:_0x5480('0x88');break;case _0x5480('0x90'):_0x55b644=_0xd46285[_0x5480('0x6a')]?_0xd46285[_0x5480('0x84')]['fullname']:_0x5480('0x88');break;default:_0x55b644=_0xd46285['UserId']?util[_0x5480('0x86')]('%s%d',_0x356e4d[_0x5480('0x8c')],_0xd46285[_0x5480('0x6a')]):'System';}var _0x333fa7=util[_0x5480('0x86')]('[%s]\x20%s:\x20%s\x0a',moment(_0xd46285[_0x5480('0x91')])[_0x5480('0x86')](_0x5480('0x92')),_0xd46285['direction']==='in'?_0x35fe01:_0x55b644,_0xd46285[_0x5480('0x4a')]);if(!_0xd46285[_0x5480('0x93')]){fs['appendFileSync'](_0x15e74b,_0x333fa7);}}return db[_0x5480('0x94')][_0x5480('0x4d')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x5480('0x95'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x5480('0x96'),'raw':!![]}]}]});}}})[_0x5480('0x13')](function(_0xca2b43){if(!_0xca2b43||!_0xca2b43[_0x5480('0x95')]||!_0x106b8a[_0x5480('0x4a')])return _0x38f71b;var _0x1a7670=_0xca2b43[_0x5480('0x97')]();return respondWithRpcPromise(_0x5480('0x98'),_0x5480('0x99'),{'account':_0x1a7670,'message':{'from':util[_0x5480('0x86')](_0x5480('0x9a'),_0xca2b43['name'],_0xca2b43[_0x5480('0x54')]||_0xca2b43[_0x5480('0x95')][_0x5480('0x3b')]),'to':_0x106b8a[_0x5480('0x4a')]['mailTranscript'],'subject':_0x5480('0x9b'),'text':util[_0x5480('0x86')](_0x5480('0x9c'),_0x106b8a[_0x5480('0x4a')][_0x5480('0x7e')]),'attachments':[{'path':_0x15e74b}]}})['then'](function(){return _0x38f71b;})[_0x5480('0x1e')](function(_0x4a3ffc){logger[_0x5480('0x1a')](_0x4a3ffc);});})['then'](respondWithStatusCode(_0x2d9969,0xc8))['catch'](handleError(_0x2d9969,null));};exports[_0x5480('0x9d')]=function(_0x484035,_0x466bae){return db[_0x5480('0x61')][_0x5480('0x48')]({'where':{'id':_0x484035[_0x5480('0x3d')]['id']}})[_0x5480('0x13')](handleEntityNotFound(_0x466bae,null))['then'](function(_0x545e60){if(_0x545e60){return _0x545e60[_0x5480('0x9d')](_0x484035[_0x5480('0x4a')][_0x5480('0x9e')],_['omit'](_0x484035[_0x5480('0x4a')],[_0x5480('0x9e'),'id'])||{});}})[_0x5480('0x13')](respondWithResult(_0x466bae,null))[_0x5480('0x1e')](handleError(_0x466bae,null));};exports[_0x5480('0x9f')]=function(_0x3bca71,_0x5f1db4){var _0x568fd0={'raw':![],'where':{}};var _0x21aba4={};var _0x25f212={'count':0x0,'rows':[]};return db[_0x5480('0x3f')]['findOne']({'where':{'id':_0x3bca71['params']['id']}})[_0x5480('0x13')](handleEntityNotFound(_0x5f1db4,null))[_0x5480('0x13')](function(_0x39500e){if(_0x39500e){_0x21aba4['model']=_[_0x5480('0x40')](db[_0x5480('0x61')][_0x5480('0xa0')]);_0x21aba4[_0x5480('0x3a')]=_[_0x5480('0x40')](_0x3bca71['query']);_0x21aba4[_0x5480('0x41')]=_[_0x5480('0x42')](_0x21aba4['model'],_0x21aba4[_0x5480('0x3a')]);_0x568fd0['attributes']=_[_0x5480('0x42')](_0x21aba4['model'],qs[_0x5480('0x44')](_0x3bca71['query'][_0x5480('0x44')]));_0x568fd0['attributes']=_0x568fd0[_0x5480('0x43')][_0x5480('0x45')]?_0x568fd0[_0x5480('0x43')]:_0x21aba4[_0x5480('0x3e')];if(!_0x3bca71[_0x5480('0x3a')][_0x5480('0xa1')]('nolimit')){_0x568fd0[_0x5480('0x23')]=qs['limit'](_0x3bca71[_0x5480('0x3a')]['limit']);_0x568fd0[_0x5480('0x25')]=qs['offset'](_0x3bca71[_0x5480('0x3a')][_0x5480('0x25')]);}_0x568fd0[_0x5480('0xa2')]=qs[_0x5480('0xa3')](_0x3bca71[_0x5480('0x3a')][_0x5480('0xa3')]);_0x568fd0['where']=qs[_0x5480('0x41')](_[_0x5480('0xa4')](_0x3bca71['query'],_0x21aba4[_0x5480('0x41')]));_0x568fd0[_0x5480('0xa5')][_0x5480('0xa6')]=_0x39500e['id'];if(_0x3bca71[_0x5480('0x3a')][_0x5480('0xa7')]){_0x568fd0['where']=_[_0x5480('0x2e')](_0x568fd0[_0x5480('0xa5')],{'$or':_[_0x5480('0x34')](_0x568fd0['attributes'],function(_0x439bdb){var _0x4260d9={};_0x4260d9[_0x439bdb]={'$like':'%'+_0x3bca71['query'][_0x5480('0xa7')]+'%'};return _0x4260d9;})});}if(_0x3bca71[_0x5480('0x3a')]['$gte']){var _0x1afcd2=_0x3bca71['query'][_0x5480('0xa8')]['split'](',');var _0x4eac2a={};_0x4eac2a[_0x1afcd2[0x0]]={'$gte':moment(_0x1afcd2[0x1])[_0x5480('0x86')]('YYYY-MM-DD\x20HH:mm:ss')};_0x568fd0[_0x5480('0xa5')]=_[_0x5480('0x2e')](_0x568fd0[_0x5480('0xa5')],_0x4eac2a);}_0x568fd0=_[_0x5480('0x2e')]({},_0x568fd0,_0x3bca71['options']);return db['ChatMessage'][_0x5480('0x24')]({'where':_0x568fd0[_0x5480('0xa5')]})[_0x5480('0x13')](function(_0x170395){_0x25f212[_0x5480('0x24')]=_0x170395;if(_0x3bca71[_0x5480('0x3a')][_0x5480('0x46')]){_0x568fd0[_0x5480('0xa9')]=[{'all':!![]}];}return db[_0x5480('0x61')][_0x5480('0x38')](_0x568fd0);})[_0x5480('0x13')](function(_0x4803c6){_0x25f212['rows']=_0x4803c6;return _0x25f212;});}})['then'](respondWithFilteredResult(_0x5f1db4,_0x568fd0))['catch'](handleError(_0x5f1db4,null));};exports['getMyMessages']=function(_0x220366,_0x3123c6){var _0x80bd53={'where':{}},_0x3ae20c={},_0x115202={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x5480('0x4d')]({'where':{'id':_0x220366[_0x5480('0x3d')]['id']}})[_0x5480('0x13')](handleEntityNotFound(_0x3123c6,null))[_0x5480('0x13')](function(_0x204f4c){if(_0x204f4c){_0x3ae20c['model']=_[_0x5480('0x40')](db[_0x5480('0x61')][_0x5480('0xa0')]);_0x3ae20c['query']=_[_0x5480('0x40')](_0x220366[_0x5480('0x3a')]);_0x3ae20c[_0x5480('0x41')]=_[_0x5480('0x42')](_0x3ae20c[_0x5480('0x3e')],_0x3ae20c['query']);_0x80bd53['attributes']=_[_0x5480('0x42')](_0x3ae20c[_0x5480('0x3e')],qs[_0x5480('0x44')](_0x220366['query'][_0x5480('0x44')]));_0x80bd53[_0x5480('0x43')]=_0x80bd53[_0x5480('0x43')][_0x5480('0x45')]?_0x80bd53[_0x5480('0x43')]:_0x3ae20c['model'];if(!_0x220366[_0x5480('0x3a')]['hasOwnProperty'](_0x5480('0xaa'))){_0x80bd53[_0x5480('0x23')]=qs[_0x5480('0x23')](_0x220366[_0x5480('0x3a')][_0x5480('0x23')]);_0x80bd53[_0x5480('0x25')]=qs[_0x5480('0x25')](_0x220366[_0x5480('0x3a')][_0x5480('0x25')]);}_0x80bd53[_0x5480('0xa2')]=qs[_0x5480('0xa3')](_0x220366[_0x5480('0x3a')][_0x5480('0xa3')]);_0x80bd53[_0x5480('0xa5')]=qs[_0x5480('0x41')](_[_0x5480('0xa4')](_0x220366[_0x5480('0x3a')],_0x3ae20c[_0x5480('0x41')]));_0x80bd53[_0x5480('0xa5')][_0x5480('0xa6')]=_0x204f4c['id'];if(_0x220366[_0x5480('0x3a')]['filter']){_0x80bd53[_0x5480('0xa5')]=_[_0x5480('0x2e')](_0x80bd53['where'],{'$or':_[_0x5480('0x34')](_0x80bd53[_0x5480('0x43')],function(_0x1227f0){var _0x40a0e0={};_0x40a0e0[_0x1227f0]={'$like':'%'+_0x220366['query'][_0x5480('0xa7')]+'%'};return _0x40a0e0;})});}_0x80bd53[_0x5480('0xa5')]['secret']=![];if(_0x220366[_0x5480('0x3a')]['id']){_0x80bd53['where']['id']={'$gt':_0x220366[_0x5480('0x3a')]['id']};}_0x80bd53=_[_0x5480('0x2e')]({},_0x80bd53,_0x220366[_0x5480('0x47')]);return db[_0x5480('0x61')][_0x5480('0x24')]({'where':_0x80bd53[_0x5480('0xa5')]})['then'](function(_0x37278d){_0x115202['count']=_0x37278d;_0x80bd53[_0x5480('0xa9')]=[];if(_0x220366[_0x5480('0x3a')][_0x5480('0xab')]){_0x80bd53[_0x5480('0xa9')]['push']({'model':db[_0x5480('0x84')],'as':'User','attributes':['id',_0x5480('0x8f'),_0x5480('0x8e')]});}if(_0x220366[_0x5480('0x3a')][_0x5480('0x46')]){_0x80bd53[_0x5480('0xa9')]=[{'all':!![]}];}return db[_0x5480('0x61')][_0x5480('0x38')](_0x80bd53);})[_0x5480('0x13')](function(_0x2515fd){_0x115202[_0x5480('0xac')]=_0x2515fd;return _0x115202;});}})['then'](respondWithFilteredResult(_0x3123c6,_0x80bd53))[_0x5480('0x1e')](handleError(_0x3123c6,null));};exports['addTags']=function(_0x1cc7a1,_0x171297){return db[_0x5480('0x3f')][_0x5480('0x48')]({'where':{'id':_0x1cc7a1[_0x5480('0x3d')]['id']}})[_0x5480('0x13')](handleEntityNotFound(_0x171297,null))[_0x5480('0x13')](function(_0x57b9b5){if(_0x57b9b5){return _0x57b9b5[_0x5480('0xad')](_0x1cc7a1['body']['ids'],_[_0x5480('0xae')](_0x1cc7a1[_0x5480('0x4a')],[_0x5480('0x9e'),'id'])||{})[_0x5480('0xaf')](function(){return db[_0x5480('0xb0')][_0x5480('0x38')]({'attributes':['id',_0x5480('0x2b'),_0x5480('0xb1')],'where':{'id':_0x1cc7a1[_0x5480('0x4a')][_0x5480('0x9e')]}});})['then'](function(_0x544528){socket[_0x5480('0xb2')](_0x5480('0xb3'),{'id':Number(_0x1cc7a1[_0x5480('0x3d')]['id']),'tags':_0x544528||[]});return{'id':Number(_0x1cc7a1[_0x5480('0x3d')]['id']),'tags':_0x544528||[]};});}})[_0x5480('0x13')](respondWithResult(_0x171297,null))['catch'](handleError(_0x171297,null));};exports['removeTags']=function(_0x13750b,_0x42cde7){return db['ChatInteraction']['find']({'where':{'id':_0x13750b['params']['id']}})[_0x5480('0x13')](handleEntityNotFound(_0x42cde7,null))[_0x5480('0x13')](function(_0x270b83){if(_0x270b83){return _0x270b83[_0x5480('0xb4')](_0x13750b['query']['ids']);}})[_0x5480('0x13')](respondWithStatusCode(_0x42cde7,null))['catch'](handleError(_0x42cde7,null));};exports['download']=function(_0x31eb40,_0xa00510){var _0x2d70c3=moment()[_0x5480('0xb5')]()[_0x5480('0xb6')]();var _0x55185b=path[_0x5480('0x78')](config[_0x5480('0x79')],'server',_0x5480('0xb7'),'tmp');var _0x19c5d0=path['join'](config[_0x5480('0x79')],_0x5480('0xb8'),_0x5480('0xb7'),_0x5480('0xb9'));var _0x5eef5e=path[_0x5480('0x78')](_0x55185b,_0x2d70c3);var _0x334319=util[_0x5480('0x86')](_0x5480('0xba'),_0x31eb40[_0x5480('0x3d')]['id'],_0x2d70c3);var _0x2385c6=path[_0x5480('0x78')](_0x55185b,_0x334319);var _0x47ea3d=[];_0x47ea3d[_0x5480('0xbb')]({'model':db[_0x5480('0x84')],'as':_0x5480('0x84'),'attributes':['id',_0x5480('0x8f')],'raw':!![]});_0x47ea3d['push']({'model':db['CmContact'],'as':_0x5480('0x66'),'attributes':['id',_0x5480('0xbc'),_0x5480('0xbd')],'raw':!![]});if(_0x31eb40['query'][_0x5480('0xb9')]){_0x47ea3d['push']({'model':db['Attachment'],'as':_0x5480('0x73'),'raw':!![]});}var _0x1ba50b=[{'model':db[_0x5480('0x61')],'as':_0x5480('0x83'),'attributes':['id',_0x5480('0x4a'),_0x5480('0x91'),_0x5480('0xbe'),'secret',_0x5480('0xbf')],'include':_0x47ea3d}];_0x1ba50b[_0x5480('0xbb')]({'model':db[_0x5480('0x4e')],'as':_0x5480('0xc0'),'attributes':['id','name']});_0x1ba50b[_0x5480('0xbb')]({'model':db[_0x5480('0x84')],'as':_0x5480('0xc1'),'attributes':['id','fullname']});return db['ChatInteraction']['find']({'where':{'id':_0x31eb40[_0x5480('0x3d')]['id']},'include':_0x1ba50b})[_0x5480('0x13')](handleEntityNotFound(_0xa00510,null))[_0x5480('0x13')](function(_0x18de9c){if(_0x18de9c){var _0x3b0bd8=_0x18de9c[_0x5480('0xc2')]({'plain':!![]});fs['mkdirSync'](_0x5eef5e);var _0x5d6953={'channel':'Chat','account':_0x3b0bd8[_0x5480('0xc0')][_0x5480('0x2b')],'agent':_0x3b0bd8[_0x5480('0xc1')]?_0x3b0bd8[_0x5480('0xc1')][_0x5480('0x8f')]:_0x5480('0xc3'),'createdAt':moment(_0x3b0bd8['createdAt'])[_0x5480('0x86')](_0x5480('0xc4'))[_0x5480('0xb6')](),'closedAt':_0x3b0bd8['closed']?moment(_0x3b0bd8[_0x5480('0xc5')])[_0x5480('0x86')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x3b0bd8[_0x5480('0xc6')],'chatInfo':{'browser':_0x3b0bd8[_0x5480('0xc7')],'os':_0x3b0bd8[_0x5480('0xc8')],'referer':_0x3b0bd8[_0x5480('0xc9')],'customerIp':_0x3b0bd8[_0x5480('0xca')],'customerPort':_0x3b0bd8['customerPort']?_0x3b0bd8['customerPort']:_0x5480('0xc3')},'messages':_(_0x3b0bd8[_0x5480('0x83')])[_0x5480('0xcb')]()[_0x5480('0xa7')]({'secret':![]})[_0x5480('0x34')](function(_0x50e195){if(_0x50e195[_0x5480('0x73')]){var _0x5effb5=path[_0x5480('0x78')](_0x19c5d0,_0x50e195[_0x5480('0x73')][_0x5480('0x71')]);if(fs[_0x5480('0xcc')](_0x5effb5)){fs['createReadStream'](_0x5effb5)['pipe'](fs['createWriteStream'](path[_0x5480('0x78')](_0x5eef5e,_0x50e195[_0x5480('0x73')][_0x5480('0x71')])));}}return{'date':moment(_0x50e195[_0x5480('0x91')])[_0x5480('0x86')](_0x5480('0xc4'))[_0x5480('0xb6')](),'sender':_0x50e195[_0x5480('0xbe')]===_0x5480('0x60')?_0x50e195[_0x5480('0x84')]?_0x50e195[_0x5480('0x84')][_0x5480('0x8f')]:_0x5480('0x88'):_0x50e195[_0x5480('0x66')]['firstName']+(_0x50e195[_0x5480('0x66')]['lastName']?'\x20'+_0x50e195['Contact'][_0x5480('0xbd')]:''),'body':_0x50e195['Attachment']?_0x50e195[_0x5480('0x73')][_0x5480('0x71')]:_0x50e195[_0x5480('0x4a')],'direction':_0x50e195['direction']==='out'?'A':'C','secret':_0x50e195[_0x5480('0x93')],'read':_0x50e195[_0x5480('0xbf')],'attachment':_0x50e195[_0x5480('0x73')]};})[_0x5480('0xcd')]()};return ejs['renderFile'](path[_0x5480('0x78')](config[_0x5480('0x79')],_0x5480('0xb8'),_0x5480('0xce'),_0x5480('0xcf')),{'interaction':_0x5d6953})[_0x5480('0x13')](function(_0x4258a2){var _0x308e42=path[_0x5480('0x78')](_0x5eef5e,_0x5480('0xd0')+_0x3b0bd8['id']+'-'+_0x2d70c3+_0x5480('0xd1'));var _0x160047={'path':_0x308e42,'channel':'Chat','interactionId':_0x3b0bd8['id']};return pdf['createPdfFromHTML'](_0x4258a2,_0x160047);})[_0x5480('0x13')](function(){return new Promise(function(_0x54efd4,_0x321828){zipdir(_0x5eef5e,{'saveTo':_0x2385c6},function(_0x390a32,_0x2db5a7){if(_0x390a32)return _0x321828(_0x390a32);return _0x54efd4(_0x2db5a7);});})[_0x5480('0x13')](function(){return new BPromise(function(_0x8a4319,_0x11c440){rimraf(_0x5eef5e,function(_0x135cb6){if(_0x135cb6)_0x11c440(_0x135cb6);return _0x8a4319();});});})[_0x5480('0x13')](function(){return _0xa00510[_0x5480('0x7c')](_0x2385c6,_0x334319,function(_0x23d87a){if(_0x23d87a){logger[_0x5480('0x1a')](_0x5480('0xd2'),_0x23d87a);}else{fs[_0x5480('0xd3')](_0x2385c6);}});});});}else{return _0xa00510[_0x5480('0x29')](0xc8);}})['catch'](handleError(_0xa00510,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 6cc75b0..2c55a66 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 _0x0180=['catch','hasOwnProperty','hook','exports','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','getUsers','setDataValue','findAll','then','length','emit'];(function(_0x553a87,_0x1d621f){var _0x12d1e6=function(_0x41ae48){while(--_0x41ae48){_0x553a87['push'](_0x553a87['shift']());}};_0x12d1e6(++_0x1d621f);}(_0x0180,0x14e));var _0x0018=function(_0x1b8d44,_0x5d7628){_0x1b8d44=_0x1b8d44-0x0;var _0x2b4056=_0x0180[_0x1b8d44];return _0x2b4056;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x0018('0x0'))['db'][_0x0018('0x1')];var ChatMessage=require(_0x0018('0x0'))['db'][_0x0018('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x0018('0x3')](0x0);var events={'afterCreate':_0x0018('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4f06c4){return function(_0x456555,_0x7eecd1,_0x1e3209){_0x456555[_0x0018('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x21a49a){_0x456555[_0x0018('0x6')]('Users',_0x21a49a['map'](function(_0x1b5e34){return{'id':_0x1b5e34['id']};}));return ChatMessage[_0x0018('0x7')]({'where':{'ChatInteractionId':_0x456555['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0018('0x8')](function(_0x1f5478){_0x456555[_0x0018('0x6')]('unreadMessages',_0x1f5478[_0x0018('0x9')]);ChatInteractionEvents[_0x0018('0xa')](_0x4f06c4+':'+_0x456555['id'],_0x456555);ChatInteractionEvents[_0x0018('0xa')](_0x4f06c4,_0x456555);_0x1e3209(null);})[_0x0018('0xb')](_0x1e3209(null));};}for(var e in events){if(events[_0x0018('0xc')](e)){var event=events[e];ChatInteraction[_0x0018('0xd')](e,emitEvent(event));}}module[_0x0018('0xe')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x793e=['findAll','length','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','update','then','setDataValue','map'];(function(_0x3ebf3e,_0x469d9f){var _0x20fc5=function(_0x547601){while(--_0x547601){_0x3ebf3e['push'](_0x3ebf3e['shift']());}};_0x20fc5(++_0x469d9f);}(_0x793e,0x1f0));var _0xe793=function(_0xcd3806,_0x3182ad){_0xcd3806=_0xcd3806-0x0;var _0x5e3594=_0x793e[_0xcd3806];return _0x5e3594;};'use strict';var EventEmitter=require(_0xe793('0x0'));var ChatInteraction=require(_0xe793('0x1'))['db'][_0xe793('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0xe793('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe793('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5421b9){return function(_0x2e6b90,_0x58cd3b,_0x1dfcfb){_0x2e6b90['getUsers']({'attributes':['id'],'raw':!![]})[_0xe793('0x5')](function(_0x27a3a3){_0x2e6b90[_0xe793('0x6')]('Users',_0x27a3a3[_0xe793('0x7')](function(_0xadf7b1){return{'id':_0xadf7b1['id']};}));return ChatMessage[_0xe793('0x8')]({'where':{'ChatInteractionId':_0x2e6b90['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe793('0x5')](function(_0x3431aa){_0x2e6b90['setDataValue']('unreadMessages',_0x3431aa[_0xe793('0x9')]);ChatInteractionEvents['emit'](_0x5421b9+':'+_0x2e6b90['id'],_0x2e6b90);ChatInteractionEvents['emit'](_0x5421b9,_0x2e6b90);_0x1dfcfb(null);})[_0xe793('0xa')](_0x1dfcfb(null));};}for(var e in events){if(events[_0xe793('0xb')](e)){var event=events[e];ChatInteraction[_0xe793('0xc')](e,emitEvent(event));}}module[_0xe793('0xd')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index b72c945..7d5d8cd 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 _0x309c=['util','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci'];(function(_0x42fe1c,_0x12e98f){var _0x12d352=function(_0xfe48eb){while(--_0xfe48eb){_0x42fe1c['push'](_0x42fe1c['shift']());}};_0x12d352(++_0x12e98f);}(_0x309c,0xc6));var _0xc309=function(_0x4d458c,_0x572215){_0x4d458c=_0x4d458c-0x0;var _0x59d69b=_0x309c[_0x4d458c];return _0x59d69b;};'use strict';var _=require('lodash');var util=require(_0xc309('0x0'));var logger=require('../../config/logger')(_0xc309('0x1'));var moment=require('moment');var BPromise=require(_0xc309('0x2'));var rp=require(_0xc309('0x3'));var fs=require('fs');var path=require(_0xc309('0x4'));var rimraf=require(_0xc309('0x5'));var config=require(_0xc309('0x6'));var attributes=require(_0xc309('0x7'));module[_0xc309('0x8')]=function(_0x510590,_0x4d3900){return _0x510590[_0xc309('0x9')]('ChatInteraction',attributes,{'tableName':_0xc309('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2c8e1b,_0x5e11e6,_0x2675cc){if(_0x2c8e1b[_0xc309('0xb')](_0xc309('0xc'))){_0x2c8e1b[_0xc309('0xd')]=moment()[_0xc309('0xe')](_0xc309('0xf'));}_0x2675cc(null,_0x2c8e1b);}},'charset':_0xc309('0x10'),'collate':_0xc309('0x11')});};
\ No newline at end of file
+var _0x5d32=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','request-promise','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x49748c,_0x3d2005){var _0xedf6b6=function(_0x11628d){while(--_0x11628d){_0x49748c['push'](_0x49748c['shift']());}};_0xedf6b6(++_0x3d2005);}(_0x5d32,0x8e));var _0x25d3=function(_0x52666e,_0x5b3776){_0x52666e=_0x52666e-0x0;var _0x515330=_0x5d32[_0x52666e];return _0x515330;};'use strict';var _=require(_0x25d3('0x0'));var util=require(_0x25d3('0x1'));var logger=require(_0x25d3('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x25d3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module['exports']=function(_0x504374,_0x3e42ca){return _0x504374[_0x25d3('0x4')](_0x25d3('0x5'),attributes,{'tableName':_0x25d3('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x945629,_0x3d1e16,_0x268a9e){if(_0x945629[_0x25d3('0x7')](_0x25d3('0x8'))){_0x945629[_0x25d3('0x9')]=moment()[_0x25d3('0xa')](_0x25d3('0xb'));}_0x268a9e(null,_0x945629);}},'charset':_0x25d3('0xc'),'collate':_0x25d3('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 29f21f1..b1abecc 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 _0x1f66=['ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','update','body','raw','options','attributes','AddTagsToChatInteraction','ChatInteraction','where','ids','omit','spread','AddTags','lodash','util','moment','randomstring','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3e9fba,_0x442564){var _0x32d982=function(_0x298a91){while(--_0x298a91){_0x3e9fba['push'](_0x3e9fba['shift']());}};_0x32d982(++_0x442564);}(_0x1f66,0x1e5));var _0x61f6=function(_0x38beee,_0x5bd600){_0x38beee=_0x38beee-0x0;var _0x67bb2f=_0x1f66[_0x38beee];return _0x67bb2f;};'use strict';var _=require(_0x61f6('0x0'));var util=require(_0x61f6('0x1'));var moment=require(_0x61f6('0x2'));var BPromise=require('bluebird');var rs=require(_0x61f6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x61f6('0x4'))(_0x61f6('0x5'));var config=require(_0x61f6('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x61f6('0x7')][_0x61f6('0x8')]({'port':0x232a});config[_0x61f6('0x9')]=_[_0x61f6('0xa')](config[_0x61f6('0x9')],{'host':_0x61f6('0xb'),'port':0x18eb});var socket=require(_0x61f6('0xc'))(new Redis(config[_0x61f6('0x9')]));require('./chatInteraction.socket')[_0x61f6('0xd')](socket);function respondWithRpcPromise(_0x4fd20e,_0x24fdfd,_0x53b6e2){return new BPromise(function(_0x3c1bc5,_0x303d4d){return client['request'](_0x4fd20e,_0x53b6e2)[_0x61f6('0xe')](function(_0x2768de){logger[_0x61f6('0xf')]('ChatInteraction,\x20%s,\x20%s',_0x24fdfd,_0x61f6('0x10'));logger[_0x61f6('0x11')](_0x61f6('0x12'),_0x24fdfd,_0x61f6('0x10'),JSON[_0x61f6('0x13')](_0x2768de));if(_0x2768de[_0x61f6('0x14')]){if(_0x2768de[_0x61f6('0x14')][_0x61f6('0x15')]===0x1f4){logger[_0x61f6('0x14')](_0x61f6('0x16'),_0x24fdfd,_0x2768de['error'][_0x61f6('0x17')]);return _0x303d4d(_0x2768de[_0x61f6('0x14')][_0x61f6('0x17')]);}logger[_0x61f6('0x14')](_0x61f6('0x16'),_0x24fdfd,_0x2768de[_0x61f6('0x14')][_0x61f6('0x17')]);return _0x3c1bc5(_0x2768de[_0x61f6('0x14')][_0x61f6('0x17')]);}else{logger['info'](_0x61f6('0x16'),_0x24fdfd,'request\x20sent');_0x3c1bc5(_0x2768de[_0x61f6('0x18')]['message']);}})[_0x61f6('0x19')](function(_0x5f2a21){logger['error'](_0x61f6('0x16'),_0x24fdfd,_0x5f2a21);_0x303d4d(_0x5f2a21);});});}exports[_0x61f6('0x1a')]=function(_0x16ba05){var _0x246a30=this;return new Promise(function(_0x300fd3,_0x5d331f){return db['ChatInteraction'][_0x61f6('0x1b')](_0x16ba05[_0x61f6('0x1c')],{'raw':_0x16ba05['options']?_0x16ba05['options'][_0x61f6('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16ba05[_0x61f6('0x1e')]?_0x16ba05['options']['where']||null:null,'attributes':_0x16ba05['options']?_0x16ba05[_0x61f6('0x1e')][_0x61f6('0x1f')]||null:null,'limit':_0x16ba05[_0x61f6('0x1e')]?_0x16ba05[_0x61f6('0x1e')]['limit']||null:null})[_0x61f6('0xe')](function(_0x4ff692){logger['info'](_0x61f6('0x1a'),_0x16ba05);logger['debug'](_0x61f6('0x1a'),_0x16ba05,JSON[_0x61f6('0x13')](_0x4ff692));_0x300fd3(_0x4ff692);})[_0x61f6('0x19')](function(_0x2897a0){logger[_0x61f6('0x14')]('UpdateChatInteraction',_0x2897a0[_0x61f6('0x17')],_0x16ba05);_0x5d331f(_0x246a30[_0x61f6('0x14')](0x1f4,_0x2897a0[_0x61f6('0x17')]));});});};exports[_0x61f6('0x20')]=function(_0x17f40d){return new Promise(function(_0x43672c,_0x39aa52){return db[_0x61f6('0x21')]['find']({'where':_0x17f40d[_0x61f6('0x1e')]?_0x17f40d['options'][_0x61f6('0x22')]||null:null})[_0x61f6('0xe')](function(_0x5dd3f1){if(_0x5dd3f1){return _0x5dd3f1['addTags'](_0x17f40d[_0x61f6('0x1c')][_0x61f6('0x23')],_[_0x61f6('0x24')](_0x17f40d[_0x61f6('0x1c')],[_0x61f6('0x23'),'id'])||{});}})[_0x61f6('0x25')](function(_0x2e89c3){logger[_0x61f6('0xf')](_0x61f6('0x26'),_0x17f40d);logger[_0x61f6('0x11')](_0x61f6('0x26'),_0x17f40d,JSON[_0x61f6('0x13')](_0x2e89c3));_0x43672c(_0x2e89c3);})[_0x61f6('0x19')](function(_0x19e75c){logger[_0x61f6('0x14')](_0x61f6('0x26'),_0x19e75c['message'],_0x17f40d);_0x39aa52(_this[_0x61f6('0x14')](0x1f4,_0x19e75c[_0x61f6('0x17')]));});});};
\ No newline at end of file
+var _0xdca8=['./chatInteraction.socket','register','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','UpdateChatInteraction','ChatInteraction','body','options','raw','where','attributes','limit','then','AddTagsToChatInteraction','find','addTags','ids','omit','catch','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter'];(function(_0x338f94,_0x3f44dd){var _0x50adbb=function(_0x5da095){while(--_0x5da095){_0x338f94['push'](_0x338f94['shift']());}};_0x50adbb(++_0x3f44dd);}(_0xdca8,0x17c));var _0x8dca=function(_0x29902b,_0x1c4333){_0x29902b=_0x29902b-0x0;var _0x41f2b4=_0xdca8[_0x29902b];return _0x41f2b4;};'use strict';var _=require(_0x8dca('0x0'));var util=require('util');var moment=require(_0x8dca('0x1'));var BPromise=require(_0x8dca('0x2'));var rs=require(_0x8dca('0x3'));var fs=require('fs');var Redis=require(_0x8dca('0x4'));var db=require(_0x8dca('0x5'))['db'];var utils=require(_0x8dca('0x6'));var logger=require(_0x8dca('0x7'))(_0x8dca('0x8'));var config=require(_0x8dca('0x9'));var jayson=require(_0x8dca('0xa'));var client=jayson[_0x8dca('0xb')][_0x8dca('0xc')]({'port':0x232a});config['redis']=_[_0x8dca('0xd')](config[_0x8dca('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x8dca('0xf'))(new Redis(config['redis']));require(_0x8dca('0x10'))[_0x8dca('0x11')](socket);function respondWithRpcPromise(_0x1b3e08,_0x1b5175,_0xcf1b67){return new BPromise(function(_0x4f042b,_0x13edd7){return client['request'](_0x1b3e08,_0xcf1b67)['then'](function(_0x3e2761){logger['info'](_0x8dca('0x12'),_0x1b5175,_0x8dca('0x13'));logger[_0x8dca('0x14')](_0x8dca('0x15'),_0x1b5175,_0x8dca('0x13'),JSON[_0x8dca('0x16')](_0x3e2761));if(_0x3e2761[_0x8dca('0x17')]){if(_0x3e2761[_0x8dca('0x17')][_0x8dca('0x18')]===0x1f4){logger['error'](_0x8dca('0x12'),_0x1b5175,_0x3e2761[_0x8dca('0x17')][_0x8dca('0x19')]);return _0x13edd7(_0x3e2761[_0x8dca('0x17')]['message']);}logger[_0x8dca('0x17')](_0x8dca('0x12'),_0x1b5175,_0x3e2761[_0x8dca('0x17')][_0x8dca('0x19')]);return _0x4f042b(_0x3e2761['error']['message']);}else{logger[_0x8dca('0x1a')](_0x8dca('0x12'),_0x1b5175,_0x8dca('0x13'));_0x4f042b(_0x3e2761[_0x8dca('0x1b')][_0x8dca('0x19')]);}})['catch'](function(_0x52bf2d){logger[_0x8dca('0x17')](_0x8dca('0x12'),_0x1b5175,_0x52bf2d);_0x13edd7(_0x52bf2d);});});}exports[_0x8dca('0x1c')]=function(_0x41fd2b){var _0x440f96=this;return new Promise(function(_0x2eb31c,_0x5127eb){return db[_0x8dca('0x1d')]['update'](_0x41fd2b[_0x8dca('0x1e')],{'raw':_0x41fd2b[_0x8dca('0x1f')]?_0x41fd2b[_0x8dca('0x1f')][_0x8dca('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41fd2b[_0x8dca('0x1f')]?_0x41fd2b[_0x8dca('0x1f')][_0x8dca('0x21')]||null:null,'attributes':_0x41fd2b[_0x8dca('0x1f')]?_0x41fd2b[_0x8dca('0x1f')][_0x8dca('0x22')]||null:null,'limit':_0x41fd2b[_0x8dca('0x1f')]?_0x41fd2b[_0x8dca('0x1f')][_0x8dca('0x23')]||null:null})[_0x8dca('0x24')](function(_0x2cd993){logger[_0x8dca('0x1a')](_0x8dca('0x1c'),_0x41fd2b);logger[_0x8dca('0x14')](_0x8dca('0x1c'),_0x41fd2b,JSON[_0x8dca('0x16')](_0x2cd993));_0x2eb31c(_0x2cd993);})['catch'](function(_0xda8735){logger[_0x8dca('0x17')]('UpdateChatInteraction',_0xda8735[_0x8dca('0x19')],_0x41fd2b);_0x5127eb(_0x440f96[_0x8dca('0x17')](0x1f4,_0xda8735[_0x8dca('0x19')]));});});};exports[_0x8dca('0x25')]=function(_0x5c2dc2){return new Promise(function(_0x381af0,_0x3731e2){return db[_0x8dca('0x1d')][_0x8dca('0x26')]({'where':_0x5c2dc2['options']?_0x5c2dc2[_0x8dca('0x1f')]['where']||null:null})[_0x8dca('0x24')](function(_0x253480){if(_0x253480){return _0x253480[_0x8dca('0x27')](_0x5c2dc2[_0x8dca('0x1e')][_0x8dca('0x28')],_[_0x8dca('0x29')](_0x5c2dc2[_0x8dca('0x1e')],['ids','id'])||{});}})['spread'](function(_0x74cb58){logger[_0x8dca('0x1a')]('AddTags',_0x5c2dc2);logger[_0x8dca('0x14')]('AddTags',_0x5c2dc2,JSON[_0x8dca('0x16')](_0x74cb58));_0x381af0(_0x74cb58);})[_0x8dca('0x2a')](function(_0x2d9f86){logger['error'](_0x8dca('0x2b'),_0x2d9f86[_0x8dca('0x19')],_0x5c2dc2);_0x3731e2(_this[_0x8dca('0x17')](0x1f4,_0x2d9f86[_0x8dca('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 3c91916..98d995c 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 _0x3ba1=['update','emit','removeListener','chatInteraction:','save','remove'];(function(_0x502b00,_0x5d8366){var _0x57bba2=function(_0x1dca99){while(--_0x1dca99){_0x502b00['push'](_0x502b00['shift']());}};_0x57bba2(++_0x5d8366);}(_0x3ba1,0x1ae));var _0x13ba=function(_0xf2b54c,_0xed0f68){_0xf2b54c=_0xf2b54c-0x0;var _0x558c5a=_0x3ba1[_0xf2b54c];return _0x558c5a;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x13ba('0x0'),_0x13ba('0x1'),_0x13ba('0x2')];function createListener(_0x25ce9b,_0x4de222){return function(_0x2c8865){_0x4de222[_0x13ba('0x3')](_0x25ce9b,_0x2c8865);};}function removeListener(_0x810ef0,_0x44687b){return function(){ChatInteractionEvents[_0x13ba('0x4')](_0x810ef0,_0x44687b);};}exports['register']=function(_0x112247){for(var _0x3201f7=0x0,_0x472d2e=events['length'];_0x3201f7<_0x472d2e;_0x3201f7++){var _0x5877b1=events[_0x3201f7];var _0x397430=createListener(_0x13ba('0x5')+_0x5877b1,_0x112247);ChatInteractionEvents['on'](_0x5877b1,_0x397430);}};
\ No newline at end of file
+var _0x077a=['update','emit','register','./chatInteraction.events','remove'];(function(_0x549f94,_0x56f8d5){var _0x354990=function(_0x4e8fa0){while(--_0x4e8fa0){_0x549f94['push'](_0x549f94['shift']());}};_0x354990(++_0x56f8d5);}(_0x077a,0x1f2));var _0xa077=function(_0x102376,_0x16c6a2){_0x102376=_0x102376-0x0;var _0x29bc9c=_0x077a[_0x102376];return _0x29bc9c;};'use strict';var ChatInteractionEvents=require(_0xa077('0x0'));var events=['save',_0xa077('0x1'),_0xa077('0x2')];function createListener(_0x3fcbec,_0x2423b4){return function(_0x11b877){_0x2423b4[_0xa077('0x3')](_0x3fcbec,_0x11b877);};}function removeListener(_0x1d58f0,_0x2f7c19){return function(){ChatInteractionEvents['removeListener'](_0x1d58f0,_0x2f7c19);};}exports[_0xa077('0x4')]=function(_0x4077d2){for(var _0x5bba3a=0x0,_0x50c21a=events['length'];_0x5bba3a<_0x50c21a;_0x5bba3a++){var _0x3473bd=events[_0x5bba3a];var _0x1cb8fc=createListener('chatInteraction:'+_0x3473bd,_0x4077d2);ChatInteractionEvents['on'](_0x3473bd,_0x1cb8fc);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 1e27998..a1cd96a 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 _0xb52b=['download','post','isAuthenticated','create','/:id/vidaoo','diskStorage','root','server/files/attachments/','format','%s-%s','now','originalname','/:id/attachment_upload','file','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','index','/describe','describe','/:id','show','isChatInteractionAuthorized','/:id/messages','/:id/my_messages','getMyMessages','/:id/download'];(function(_0x5e618e,_0x377107){var _0x3a7aaa=function(_0x2eacf5){while(--_0x2eacf5){_0x5e618e['push'](_0x5e618e['shift']());}};_0x3a7aaa(++_0x377107);}(_0xb52b,0x11e));var _0xbb52=function(_0x3dfc05,_0x5d7f06){_0x3dfc05=_0x3dfc05-0x0;var _0x3d9973=_0xb52b[_0x3dfc05];return _0x3d9973;};'use strict';var multer=require(_0xbb52('0x0'));var util=require(_0xbb52('0x1'));var path=require(_0xbb52('0x2'));var timeout=require(_0xbb52('0x3'));var express=require(_0xbb52('0x4'));var router=express['Router']();var fs_extra=require(_0xbb52('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbb52('0x6'));var config=require(_0xbb52('0x7'));var controller=require(_0xbb52('0x8'));router[_0xbb52('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb52('0xa')]);router[_0xbb52('0x9')](_0xbb52('0xb'),auth['isAuthenticated'](),controller[_0xbb52('0xc')]);router[_0xbb52('0x9')](_0xbb52('0xd'),auth['isChatInteractionAuthorized'](),controller[_0xbb52('0xe')]);router['get']('/:id/attachment_download',auth[_0xbb52('0xf')](),controller['attachmentDownload']);router[_0xbb52('0x9')](_0xbb52('0x10'),auth['isAuthenticated'](),controller['getMessages']);router[_0xbb52('0x9')](_0xbb52('0x11'),auth[_0xbb52('0xf')](),controller[_0xbb52('0x12')]);router['get'](_0xbb52('0x13'),auth['isAuthenticated'](),controller[_0xbb52('0x14')]);router[_0xbb52('0x15')]('/',auth[_0xbb52('0x16')](),controller[_0xbb52('0x17')]);router[_0xbb52('0x15')](_0xbb52('0x18'),auth['isAuthenticated'](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xbb52('0x19')]({'destination':function(_0x27bcdf,_0x5e6992,_0x4913db){_0x4913db(null,path['join'](config[_0xbb52('0x1a')],_0xbb52('0x1b')));},'filename':function(_0x4f6bba,_0x4d5376,_0x22a254){_0x22a254(null,util[_0xbb52('0x1c')](_0xbb52('0x1d'),Date[_0xbb52('0x1e')](),_0x4d5376[_0xbb52('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb52('0x15')](_0xbb52('0x20'),upload['single'](_0xbb52('0x21')),controller[_0xbb52('0x22')]);router[_0xbb52('0x15')](_0xbb52('0x10'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0xbb52('0x15')](_0xbb52('0x23'),auth['isAuthenticated'](),interaction[_0xbb52('0x24')](_0xbb52('0x25'),_0xbb52('0x26')),controller[_0xbb52('0x27')]);router[_0xbb52('0x28')](_0xbb52('0xd'),auth[_0xbb52('0x16')](),interaction['tracked'](_0xbb52('0x25'),_0xbb52('0x29')),controller[_0xbb52('0x2a')]);router[_0xbb52('0x28')]('/:id/custom_update',controller[_0xbb52('0x2b')]);router[_0xbb52('0x28')](_0xbb52('0x2c'),auth[_0xbb52('0xf')](),controller[_0xbb52('0x2d')]);router[_0xbb52('0x28')](_0xbb52('0x2e'),controller['close']);router[_0xbb52('0x2f')](_0xbb52('0xd'),auth[_0xbb52('0x16')](),interaction[_0xbb52('0x24')]('chat',_0xbb52('0x30')),controller[_0xbb52('0x31')]);router[_0xbb52('0x2f')](_0xbb52('0x23'),auth[_0xbb52('0x16')](),controller[_0xbb52('0x32')]);module['exports']=router;
\ No newline at end of file
+var _0x9a66=['attachmentUpload','addMessage','/:id/tags','chat','addTags','put','/:id','tracked','update','/:id/custom_update','customUpdate','/:id/close','close','delete','chatinteraction:destroy','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','show','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','isChatInteractionAuthorized','getMyMessages','/:id/download','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','%s-%s','now','originalname','single','file'];(function(_0x41e723,_0x5e6494){var _0x5cf973=function(_0x4ce435){while(--_0x4ce435){_0x41e723['push'](_0x41e723['shift']());}};_0x5cf973(++_0x5e6494);}(_0x9a66,0xa4));var _0x69a6=function(_0x5af1d9,_0x28353c){_0x5af1d9=_0x5af1d9-0x0;var _0x73f63d=_0x9a66[_0x5af1d9];return _0x73f63d;};'use strict';var multer=require(_0x69a6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x69a6('0x1'));var express=require(_0x69a6('0x2'));var router=express[_0x69a6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x69a6('0x4'));var interaction=require(_0x69a6('0x5'));var config=require(_0x69a6('0x6'));var controller=require('./chatInteraction.controller');router['get']('/',auth[_0x69a6('0x7')](),controller[_0x69a6('0x8')]);router['get'](_0x69a6('0x9'),auth[_0x69a6('0x7')](),controller[_0x69a6('0xa')]);router[_0x69a6('0xb')]('/:id',auth['isChatInteractionAuthorized'](),controller[_0x69a6('0xc')]);router[_0x69a6('0xb')](_0x69a6('0xd'),auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router[_0x69a6('0xb')](_0x69a6('0xe'),auth[_0x69a6('0x7')](),controller[_0x69a6('0xf')]);router[_0x69a6('0xb')](_0x69a6('0x10'),auth[_0x69a6('0x11')](),controller[_0x69a6('0x12')]);router[_0x69a6('0xb')](_0x69a6('0x13'),auth['isAuthenticated'](),controller['download']);router[_0x69a6('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x69a6('0x14')](_0x69a6('0x15'),auth[_0x69a6('0x7')](),controller[_0x69a6('0x16')]);var upload=multer({'storage':multer[_0x69a6('0x17')]({'destination':function(_0x5675e6,_0x37bac8,_0x5da3b8){_0x5da3b8(null,path[_0x69a6('0x18')](config[_0x69a6('0x19')],_0x69a6('0x1a')));},'filename':function(_0x4192fc,_0x59e3bf,_0x56a56f){_0x56a56f(null,util['format'](_0x69a6('0x1b'),Date[_0x69a6('0x1c')](),_0x59e3bf[_0x69a6('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x69a6('0x14')]('/:id/attachment_upload',upload[_0x69a6('0x1e')](_0x69a6('0x1f')),controller[_0x69a6('0x20')]);router[_0x69a6('0x14')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0x69a6('0x21')]);router[_0x69a6('0x14')](_0x69a6('0x22'),auth['isAuthenticated'](),interaction['tracked'](_0x69a6('0x23'),'chatinteraction:addtags'),controller[_0x69a6('0x24')]);router[_0x69a6('0x25')](_0x69a6('0x26'),auth['isAuthenticated'](),interaction[_0x69a6('0x27')](_0x69a6('0x23'),'chatinteraction:update'),controller[_0x69a6('0x28')]);router['put'](_0x69a6('0x29'),controller[_0x69a6('0x2a')]);router[_0x69a6('0x25')]('/:id/abandon',auth[_0x69a6('0x11')](),controller['abandon']);router[_0x69a6('0x25')](_0x69a6('0x2b'),controller[_0x69a6('0x2c')]);router[_0x69a6('0x2d')](_0x69a6('0x26'),auth[_0x69a6('0x7')](),interaction[_0x69a6('0x27')](_0x69a6('0x23'),_0x69a6('0x2e')),controller[_0x69a6('0x2f')]);router[_0x69a6('0x2d')](_0x69a6('0x22'),auth['isAuthenticated'](),controller['removeTags']);module[_0x69a6('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 50c6cc7..aa70b8b 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 _0x184e=['exports','TEXT','BOOLEAN','INTEGER','sequelize'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0x184e,0x10d));var _0xe184=function(_0x4bb593,_0x272ed0){_0x4bb593=_0x4bb593-0x0;var _0x2da2d8=_0x184e[_0x4bb593];return _0x2da2d8;};'use strict';var Sequelize=require(_0xe184('0x0'));module[_0xe184('0x1')]={'body':{'type':Sequelize[_0xe184('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xe184('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xe184('0x4')]}};
\ No newline at end of file
+var _0x9c4c=['BOOLEAN','INTEGER','exports','medium'];(function(_0x362b6d,_0x20e7e9){var _0x11f9f1=function(_0x256f23){while(--_0x256f23){_0x362b6d['push'](_0x362b6d['shift']());}};_0x11f9f1(++_0x20e7e9);}(_0x9c4c,0x11a));var _0xc9c4=function(_0x245afc,_0x4ef6b2){_0x245afc=_0x245afc-0x0;var _0x4f8010=_0x9c4c[_0x245afc];return _0x4f8010;};'use strict';var Sequelize=require('sequelize');module[_0xc9c4('0x0')]={'body':{'type':Sequelize['TEXT'](_0xc9c4('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xc9c4('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xc9c4('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 222877c..e144387 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 _0x745d=['-createdAt','all','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./chatInternalMessage.socket','register','status','end','json','undefined','limit','offset','set','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','ChatInternalMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','show','params','catch','create','body','destroy','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','role','userpic','online','allowmessenger','showWebBar','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','Agents','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','read'];(function(_0x2bea6d,_0x441d1c){var _0x39ee0b=function(_0x1b8aa6){while(--_0x1b8aa6){_0x2bea6d['push'](_0x2bea6d['shift']());}};_0x39ee0b(++_0x441d1c);}(_0x745d,0xe0));var _0xd745=function(_0x585447,_0x7cae27){_0x585447=_0x585447-0x0;var _0x3653ad=_0x745d[_0x585447];return _0x3653ad;};'use strict';var emlformat=require(_0xd745('0x0'));var rimraf=require(_0xd745('0x1'));var zipdir=require(_0xd745('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd745('0x3'));var moment=require(_0xd745('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd745('0x5'));var path=require(_0xd745('0x6'));var sox=require(_0xd745('0x7'));var csv=require('to-csv');var ejs=require(_0xd745('0x8'));var fs=require('fs');var fs_extra=require(_0xd745('0x9'));var _=require(_0xd745('0xa'));var squel=require('squel');var crypto=require(_0xd745('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd745('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd745('0xd'));var Papa=require(_0xd745('0xe'));var Redis=require('ioredis');var authService=require(_0xd745('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd745('0x10'));var hardwareService=require(_0xd745('0x11'));var logger=require(_0xd745('0x12'))('api');var utils=require(_0xd745('0x13'));var config=require(_0xd745('0x14'));var licenseUtil=require(_0xd745('0x15'));var db=require(_0xd745('0x16'))['db'];config[_0xd745('0x17')]=_['defaults'](config['redis'],{'host':_0xd745('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd745('0x17')]));require(_0xd745('0x19'))[_0xd745('0x1a')](socket);function respondWithStatusCode(_0x18e783,_0x5ca73a){_0x5ca73a=_0x5ca73a||0xcc;return function(_0x48dc39){if(_0x48dc39){return _0x18e783['sendStatus'](_0x5ca73a);}return _0x18e783[_0xd745('0x1b')](_0x5ca73a)[_0xd745('0x1c')]();};}function respondWithResult(_0xa6dcbc,_0x583cb4){_0x583cb4=_0x583cb4||0xc8;return function(_0x4dd07b){if(_0x4dd07b){return _0xa6dcbc['status'](_0x583cb4)[_0xd745('0x1d')](_0x4dd07b);}};}function respondWithFilteredResult(_0xad01a0,_0x4e46a7){return function(_0x3cd39e){if(_0x3cd39e){var _0xa6303d=typeof _0x4e46a7['offset']===_0xd745('0x1e')&&typeof _0x4e46a7[_0xd745('0x1f')]===_0xd745('0x1e');var _0x4788bf=_0x3cd39e['count'];var _0x2d3655=_0xa6303d?0x0:_0x4e46a7[_0xd745('0x20')];var _0x3e3fd6=_0xa6303d?_0x3cd39e['count']:_0x4e46a7['offset']+_0x4e46a7['limit'];var _0x54fd12;if(_0x3e3fd6>=_0x4788bf){_0x3e3fd6=_0x4788bf;_0x54fd12=0xc8;}else{_0x54fd12=0xce;}_0xad01a0[_0xd745('0x1b')](_0x54fd12);return _0xad01a0[_0xd745('0x21')]('Content-Range',_0x2d3655+'-'+_0x3e3fd6+'/'+_0x4788bf)[_0xd745('0x1d')](_0x3cd39e);}return null;};}function patchUpdates(_0x21c9f0){return function(_0x5f0ea4){try{jsonpatch[_0xd745('0x22')](_0x5f0ea4,_0x21c9f0,!![]);}catch(_0x2bb149){return BPromise[_0xd745('0x23')](_0x2bb149);}return _0x5f0ea4[_0xd745('0x24')]();};}function saveUpdates(_0x17ede3,_0x3bf473){return function(_0x197883){if(_0x197883){return _0x197883[_0xd745('0x25')](_0x17ede3)[_0xd745('0x26')](function(_0x35eb37){return _0x35eb37;});}return null;};}function removeEntity(_0x43d81d,_0x1ea6ed){return function(_0xf52454){if(_0xf52454){return _0xf52454['destroy']()['then'](function(){_0x43d81d[_0xd745('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ced98,_0x5e8a7f){return function(_0x3391ac){if(!_0x3391ac){_0x3ced98[_0xd745('0x27')](0x194);}return _0x3391ac;};}function handleError(_0x4f5cdd,_0xbc4a5b){_0xbc4a5b=_0xbc4a5b||0x1f4;return function(_0x484fa4){logger[_0xd745('0x28')](_0x484fa4[_0xd745('0x29')]);if(_0x484fa4[_0xd745('0x2a')]){delete _0x484fa4[_0xd745('0x2a')];}_0x4f5cdd[_0xd745('0x1b')](_0xbc4a5b)[_0xd745('0x2b')](_0x484fa4);};}exports[_0xd745('0x2c')]=function(_0x33beec,_0xf5e5f0){var _0x2831e6={},_0x4130b9={},_0xea85a1={'count':0x0,'rows':[]};var _0x25949c=_['map'](db[_0xd745('0x2d')][_0xd745('0x2e')],function(_0x2c0da5){return{'name':_0x2c0da5[_0xd745('0x2f')],'type':_0x2c0da5[_0xd745('0x30')][_0xd745('0x31')]};});_0x4130b9[_0xd745('0x32')]=_[_0xd745('0x33')](_0x25949c,_0xd745('0x2a'));_0x4130b9[_0xd745('0x34')]=_[_0xd745('0x35')](_0x33beec['query']);_0x4130b9[_0xd745('0x36')]=_[_0xd745('0x37')](_0x4130b9['model'],_0x4130b9['query']);_0x2831e6[_0xd745('0x38')]=_[_0xd745('0x37')](_0x4130b9[_0xd745('0x32')],qs[_0xd745('0x39')](_0x33beec[_0xd745('0x34')][_0xd745('0x39')]));_0x2831e6[_0xd745('0x38')]=_0x2831e6['attributes'][_0xd745('0x3a')]?_0x2831e6[_0xd745('0x38')]:_0x4130b9['model'];if(!_0x33beec[_0xd745('0x34')]['hasOwnProperty'](_0xd745('0x3b'))){_0x2831e6[_0xd745('0x1f')]=qs[_0xd745('0x1f')](_0x33beec[_0xd745('0x34')]['limit']);_0x2831e6['offset']=qs['offset'](_0x33beec[_0xd745('0x34')][_0xd745('0x20')]);}_0x2831e6[_0xd745('0x3c')]=qs['sort'](_0x33beec['query'][_0xd745('0x3d')]);_0x2831e6[_0xd745('0x3e')]=qs[_0xd745('0x36')](_[_0xd745('0x3f')](_0x33beec[_0xd745('0x34')],_0x4130b9[_0xd745('0x36')]),_0x25949c);if(_0x33beec[_0xd745('0x34')]['filter']){_0x2831e6[_0xd745('0x3e')]=_[_0xd745('0x40')](_0x2831e6[_0xd745('0x3e')],{'$or':_[_0xd745('0x33')](_0x25949c,function(_0xb18c47){if(_0xb18c47[_0xd745('0x30')]!==_0xd745('0x41')){var _0x2755ab={};_0x2755ab[_0xb18c47[_0xd745('0x2a')]]={'$like':'%'+_0x33beec[_0xd745('0x34')][_0xd745('0x42')]+'%'};return _0x2755ab;}})});}_0x2831e6=_[_0xd745('0x40')]({},_0x2831e6,_0x33beec[_0xd745('0x43')]);var _0x587a08={'where':_0x2831e6['where']};return db[_0xd745('0x2d')][_0xd745('0x44')](_0x587a08)['then'](function(_0x487787){_0xea85a1[_0xd745('0x44')]=_0x487787;if(_0x33beec[_0xd745('0x34')][_0xd745('0x45')]){_0x2831e6[_0xd745('0x46')]=[{'all':!![]}];}return db[_0xd745('0x2d')][_0xd745('0x47')](_0x2831e6);})[_0xd745('0x26')](function(_0xff05a0){_0xea85a1[_0xd745('0x48')]=_0xff05a0;return _0xea85a1;})[_0xd745('0x26')](respondWithFilteredResult(_0xf5e5f0,_0x2831e6))['catch'](handleError(_0xf5e5f0,null));};exports[_0xd745('0x49')]=function(_0x508c21,_0xff088e){var _0x543d38={'raw':!![],'where':{'id':_0x508c21[_0xd745('0x4a')]['id']}},_0x351fed={};_0x351fed[_0xd745('0x32')]=_[_0xd745('0x35')](db[_0xd745('0x2d')][_0xd745('0x2e')]);_0x351fed[_0xd745('0x34')]=_['keys'](_0x508c21[_0xd745('0x34')]);_0x351fed[_0xd745('0x36')]=_[_0xd745('0x37')](_0x351fed[_0xd745('0x32')],_0x351fed[_0xd745('0x34')]);_0x543d38[_0xd745('0x38')]=_[_0xd745('0x37')](_0x351fed[_0xd745('0x32')],qs[_0xd745('0x39')](_0x508c21[_0xd745('0x34')][_0xd745('0x39')]));_0x543d38['attributes']=_0x543d38['attributes'][_0xd745('0x3a')]?_0x543d38[_0xd745('0x38')]:_0x351fed['model'];if(_0x508c21[_0xd745('0x34')][_0xd745('0x45')]){_0x543d38[_0xd745('0x46')]=[{'all':!![]}];}_0x543d38=_[_0xd745('0x40')]({},_0x543d38,_0x508c21[_0xd745('0x43')]);return db[_0xd745('0x2d')]['find'](_0x543d38)[_0xd745('0x26')](handleEntityNotFound(_0xff088e,null))[_0xd745('0x26')](respondWithResult(_0xff088e,null))[_0xd745('0x4b')](handleError(_0xff088e,null));};exports[_0xd745('0x4c')]=function(_0x37862d,_0x4e268b){return db[_0xd745('0x2d')][_0xd745('0x4c')](_0x37862d['body'],{})[_0xd745('0x26')](respondWithResult(_0x4e268b,0xc9))['catch'](handleError(_0x4e268b,null));};exports[_0xd745('0x25')]=function(_0x626fff,_0x14521e){if(_0x626fff[_0xd745('0x4d')]['id']){delete _0x626fff[_0xd745('0x4d')]['id'];}return db[_0xd745('0x2d')]['find']({'where':{'id':_0x626fff[_0xd745('0x4a')]['id']}})[_0xd745('0x26')](handleEntityNotFound(_0x14521e,null))[_0xd745('0x26')](saveUpdates(_0x626fff[_0xd745('0x4d')],null))[_0xd745('0x26')](respondWithResult(_0x14521e,null))[_0xd745('0x4b')](handleError(_0x14521e,null));};exports[_0xd745('0x4e')]=function(_0x2b3caa,_0x5da907){return db[_0xd745('0x2d')]['find']({'where':{'id':_0x2b3caa[_0xd745('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5da907,null))['then'](removeEntity(_0x5da907,null))[_0xd745('0x4b')](handleError(_0x5da907,null));};exports['describe']=function(_0x4d425b,_0x5a8613){return db[_0xd745('0x2d')][_0xd745('0x4f')]()[_0xd745('0x26')](respondWithResult(_0x5a8613,null))[_0xd745('0x4b')](handleError(_0x5a8613,null));};function wrapUser(_0x293918){return function(_0x3f8261){var _0x7e8d5a=_0x293918[_0xd745('0x50')]({'plain':!![]});_0x7e8d5a[_0xd745('0x51')]=[];if(_0x3f8261){_0x7e8d5a[_0xd745('0x52')]=_0x3f8261[_0xd745('0x53')];_0x7e8d5a[_0xd745('0x54')]=_0x3f8261;}else{_0x7e8d5a[_0xd745('0x52')]=moment(0x0)[_0xd745('0x55')](_0xd745('0x56'));_0x7e8d5a['lastMessage']={};}return _0x7e8d5a;};}exports[_0xd745('0x57')]=function(_0x444fa2,_0x1d29c1,_0x435e3e){var _0x480300=[];return db[_0xd745('0x58')][_0xd745('0x47')]({'where':{'role':[_0xd745('0x59'),_0xd745('0x5a'),_0xd745('0x5b')]},'attributes':['id','fullname',_0xd745('0x2a'),_0xd745('0x5c'),_0xd745('0x5d'),'internal',_0xd745('0x5e'),'lastLoginAt',_0xd745('0x5f'),_0xd745('0x60')],'order':qs[_0xd745('0x3d')]('-online'),'include':[{'model':db['VoiceQueue'],'as':_0xd745('0x61'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0xd745('0x26')](function(_0x495552){if(_0x495552){var _0x4f6e52=_0x444fa2['user'][_0xd745('0x50')]({'plain':!![]});if(!_0x4f6e52)throw new Error(_0xd745('0x62'));if(_0x4f6e52[_0xd745('0x5c')]==='user'){return db[_0xd745('0x63')][_0xd745('0x64')]({'where':{'name':_0xd745('0x65'),'userProfileId':_0x4f6e52['userProfileId']},'raw':!![]})[_0xd745('0x26')](function(_0x2f3b52){if(_0x2f3b52){if(_0x2f3b52[_0xd745('0x66')]===0x0){return db[_0xd745('0x67')]['findAll']({'where':{'sectionId':_0x2f3b52['id']},'raw':!![]})['then'](function(_0x12521f){var _0x45a991=[];if(_[_0xd745('0x68')](_0x12521f)){_0x45a991=_[_0xd745('0x42')](_0x495552,function(_0x549025){if(_0x549025['role']!==_0xd745('0x59')){return _0x549025;}});return _0x45a991;}else{for(var _0x49baae=0x0;_0x49baae<_0x495552[_0xd745('0x3a')];_0x49baae++){var _0x2a4db1=_0x495552[_0x49baae];if(_0x2a4db1[_0xd745('0x5c')]===_0xd745('0x59')){var _0x2a8765=_[_0xd745('0x64')](_0x12521f,function(_0x16bf78){return _0x16bf78[_0xd745('0x69')]===_0x2a4db1['id'];});if(_0x2a8765)_0x45a991[_0xd745('0x6a')](_0x2a4db1);}else{_0x45a991['push'](_0x2a4db1);}}return _0x45a991;}});}else{return _0x495552;}}else{var _0x3d214c=_[_0xd745('0x42')](_0x495552,function(_0x2f3624){if(_0x2f3624['role']!==_0xd745('0x59')){return _0x2f3624;}});return _0x3d214c;}});}else{return _0x495552;}}})[_0xd745('0x26')](function(_0x3afdd9){var _0x40ccab=[];if(_0x3afdd9){_0x480300=_0x3afdd9;for(var _0x441e67=0x0;_0x441e67<_0x3afdd9['length'];_0x441e67+=0x1){_0x480300[_0x441e67][_0xd745('0x51')]=[];_0x40ccab['push'](db[_0xd745('0x2d')]['find']({'where':{'FromId':[_0x444fa2[_0xd745('0x5b')]['id'],_0x3afdd9[_0x441e67]['id']],'ToId':[_0x444fa2[_0xd745('0x5b')]['id'],_0x3afdd9[_0x441e67]['id']],'ChatGroupId':null},'attributes':['id',_0xd745('0x53'),_0xd745('0x6b'),'ToId',_0xd745('0x6c'),'body'],'order':qs[_0xd745('0x3d')](_0xd745('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xd745('0x26')](wrapUser(_0x3afdd9[_0x441e67])));}return BPromise[_0xd745('0x6e')](_0x40ccab);}return[];})[_0xd745('0x26')](function(_0xc0a8aa){return{'rows':_0xc0a8aa,'count':_0xc0a8aa[_0xd745('0x3a')]};})['then'](respondWithResult(_0x1d29c1,null))['catch'](handleError(_0x1d29c1,null));};
\ No newline at end of file
+var _0xae0e=['papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','sendStatus','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','keys','include','find','create','body','describe','get','lastMessageAt','createdAt','lastMessage','getUsers','User','findAll','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','isEmpty','resourceId','push','messages','FromId','read','-createdAt','all','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xae0e,0x1bc));var _0xeae0=function(_0x142ca4,_0x5de646){_0x142ca4=_0x142ca4-0x0;var _0x13a91c=_0xae0e[_0x142ca4];return _0x13a91c;};'use strict';var emlformat=require(_0xeae0('0x0'));var rimraf=require(_0xeae0('0x1'));var zipdir=require(_0xeae0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeae0('0x3'));var moment=require(_0xeae0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xeae0('0x5'));var util=require(_0xeae0('0x6'));var path=require('path');var sox=require(_0xeae0('0x7'));var csv=require(_0xeae0('0x8'));var ejs=require(_0xeae0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeae0('0xa'));var squel=require(_0xeae0('0xb'));var crypto=require(_0xeae0('0xc'));var jsforce=require(_0xeae0('0xd'));var deskjs=require(_0xeae0('0xe'));var toCsv=require('to-csv');var querystring=require(_0xeae0('0xf'));var Papa=require(_0xeae0('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xeae0('0x11'));var as=require(_0xeae0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xeae0('0x13'));var utils=require(_0xeae0('0x14'));var config=require(_0xeae0('0x15'));var licenseUtil=require(_0xeae0('0x16'));var db=require(_0xeae0('0x17'))['db'];config[_0xeae0('0x18')]=_[_0xeae0('0x19')](config['redis'],{'host':_0xeae0('0x1a'),'port':0x18eb});var socket=require(_0xeae0('0x1b'))(new Redis(config['redis']));require(_0xeae0('0x1c'))[_0xeae0('0x1d')](socket);function respondWithStatusCode(_0x17c98d,_0x3c5b01){_0x3c5b01=_0x3c5b01||0xcc;return function(_0x4143ca){if(_0x4143ca){return _0x17c98d['sendStatus'](_0x3c5b01);}return _0x17c98d['status'](_0x3c5b01)[_0xeae0('0x1e')]();};}function respondWithResult(_0x1f40c0,_0x31ef8a){_0x31ef8a=_0x31ef8a||0xc8;return function(_0xa4d864){if(_0xa4d864){return _0x1f40c0[_0xeae0('0x1f')](_0x31ef8a)[_0xeae0('0x20')](_0xa4d864);}};}function respondWithFilteredResult(_0x1e3437,_0x299760){return function(_0x36133d){if(_0x36133d){var _0x5a3236=typeof _0x299760[_0xeae0('0x21')]===_0xeae0('0x22')&&typeof _0x299760[_0xeae0('0x23')]===_0xeae0('0x22');var _0x17f80a=_0x36133d[_0xeae0('0x24')];var _0x53c9d8=_0x5a3236?0x0:_0x299760[_0xeae0('0x21')];var _0x46184a=_0x5a3236?_0x36133d['count']:_0x299760[_0xeae0('0x21')]+_0x299760[_0xeae0('0x23')];var _0x546d47;if(_0x46184a>=_0x17f80a){_0x46184a=_0x17f80a;_0x546d47=0xc8;}else{_0x546d47=0xce;}_0x1e3437[_0xeae0('0x1f')](_0x546d47);return _0x1e3437[_0xeae0('0x25')](_0xeae0('0x26'),_0x53c9d8+'-'+_0x46184a+'/'+_0x17f80a)[_0xeae0('0x20')](_0x36133d);}return null;};}function patchUpdates(_0x543be9){return function(_0x27d7d6){try{jsonpatch[_0xeae0('0x27')](_0x27d7d6,_0x543be9,!![]);}catch(_0x1faa26){return BPromise[_0xeae0('0x28')](_0x1faa26);}return _0x27d7d6['save']();};}function saveUpdates(_0x6cf65e,_0x5a3b53){return function(_0x2846ae){if(_0x2846ae){return _0x2846ae[_0xeae0('0x29')](_0x6cf65e)['then'](function(_0x593302){return _0x593302;});}return null;};}function removeEntity(_0x258dae,_0x1a888d){return function(_0x58b1e3){if(_0x58b1e3){return _0x58b1e3[_0xeae0('0x2a')]()[_0xeae0('0x2b')](function(){_0x258dae[_0xeae0('0x1f')](0xcc)[_0xeae0('0x1e')]();});}};}function handleEntityNotFound(_0x4d585e,_0x5b19bf){return function(_0x4ac148){if(!_0x4ac148){_0x4d585e[_0xeae0('0x2c')](0x194);}return _0x4ac148;};}function handleError(_0xca4f9d,_0x233bff){_0x233bff=_0x233bff||0x1f4;return function(_0x4c72a9){logger[_0xeae0('0x2d')](_0x4c72a9[_0xeae0('0x2e')]);if(_0x4c72a9[_0xeae0('0x2f')]){delete _0x4c72a9[_0xeae0('0x2f')];}_0xca4f9d[_0xeae0('0x1f')](_0x233bff)[_0xeae0('0x30')](_0x4c72a9);};}exports[_0xeae0('0x31')]=function(_0x37bb11,_0x43d18c){var _0x2a8f66={},_0x17f882={},_0x2c4978={'count':0x0,'rows':[]};var _0x4bd9de=_[_0xeae0('0x32')](db[_0xeae0('0x33')][_0xeae0('0x34')],function(_0x1704c6){return{'name':_0x1704c6[_0xeae0('0x35')],'type':_0x1704c6[_0xeae0('0x36')][_0xeae0('0x37')]};});_0x17f882[_0xeae0('0x38')]=_[_0xeae0('0x32')](_0x4bd9de,_0xeae0('0x2f'));_0x17f882[_0xeae0('0x39')]=_['keys'](_0x37bb11[_0xeae0('0x39')]);_0x17f882['filters']=_[_0xeae0('0x3a')](_0x17f882[_0xeae0('0x38')],_0x17f882['query']);_0x2a8f66['attributes']=_[_0xeae0('0x3a')](_0x17f882['model'],qs[_0xeae0('0x3b')](_0x37bb11[_0xeae0('0x39')]['fields']));_0x2a8f66[_0xeae0('0x3c')]=_0x2a8f66[_0xeae0('0x3c')][_0xeae0('0x3d')]?_0x2a8f66['attributes']:_0x17f882[_0xeae0('0x38')];if(!_0x37bb11['query'][_0xeae0('0x3e')](_0xeae0('0x3f'))){_0x2a8f66[_0xeae0('0x23')]=qs[_0xeae0('0x23')](_0x37bb11[_0xeae0('0x39')]['limit']);_0x2a8f66[_0xeae0('0x21')]=qs[_0xeae0('0x21')](_0x37bb11[_0xeae0('0x39')][_0xeae0('0x21')]);}_0x2a8f66[_0xeae0('0x40')]=qs['sort'](_0x37bb11['query'][_0xeae0('0x41')]);_0x2a8f66[_0xeae0('0x42')]=qs[_0xeae0('0x43')](_['pick'](_0x37bb11[_0xeae0('0x39')],_0x17f882[_0xeae0('0x43')]),_0x4bd9de);if(_0x37bb11['query'][_0xeae0('0x44')]){_0x2a8f66[_0xeae0('0x42')]=_[_0xeae0('0x45')](_0x2a8f66[_0xeae0('0x42')],{'$or':_[_0xeae0('0x32')](_0x4bd9de,function(_0x3b2925){if(_0x3b2925[_0xeae0('0x36')]!==_0xeae0('0x46')){var _0x1478ef={};_0x1478ef[_0x3b2925[_0xeae0('0x2f')]]={'$like':'%'+_0x37bb11[_0xeae0('0x39')][_0xeae0('0x44')]+'%'};return _0x1478ef;}})});}_0x2a8f66=_['merge']({},_0x2a8f66,_0x37bb11[_0xeae0('0x47')]);var _0x195e18={'where':_0x2a8f66[_0xeae0('0x42')]};return db['ChatInternalMessage'][_0xeae0('0x24')](_0x195e18)['then'](function(_0x1278a5){_0x2c4978[_0xeae0('0x24')]=_0x1278a5;if(_0x37bb11[_0xeae0('0x39')][_0xeae0('0x48')]){_0x2a8f66['include']=[{'all':!![]}];}return db[_0xeae0('0x33')]['findAll'](_0x2a8f66);})[_0xeae0('0x2b')](function(_0x53cc65){_0x2c4978[_0xeae0('0x49')]=_0x53cc65;return _0x2c4978;})['then'](respondWithFilteredResult(_0x43d18c,_0x2a8f66))[_0xeae0('0x4a')](handleError(_0x43d18c,null));};exports[_0xeae0('0x4b')]=function(_0x21eac5,_0x56c9aa){var _0xdd35f5={'raw':!![],'where':{'id':_0x21eac5[_0xeae0('0x4c')]['id']}},_0x2a0926={};_0x2a0926['model']=_[_0xeae0('0x4d')](db['ChatInternalMessage'][_0xeae0('0x34')]);_0x2a0926[_0xeae0('0x39')]=_[_0xeae0('0x4d')](_0x21eac5[_0xeae0('0x39')]);_0x2a0926[_0xeae0('0x43')]=_['intersection'](_0x2a0926['model'],_0x2a0926['query']);_0xdd35f5[_0xeae0('0x3c')]=_[_0xeae0('0x3a')](_0x2a0926[_0xeae0('0x38')],qs[_0xeae0('0x3b')](_0x21eac5[_0xeae0('0x39')][_0xeae0('0x3b')]));_0xdd35f5['attributes']=_0xdd35f5['attributes'][_0xeae0('0x3d')]?_0xdd35f5['attributes']:_0x2a0926[_0xeae0('0x38')];if(_0x21eac5[_0xeae0('0x39')][_0xeae0('0x48')]){_0xdd35f5[_0xeae0('0x4e')]=[{'all':!![]}];}_0xdd35f5=_[_0xeae0('0x45')]({},_0xdd35f5,_0x21eac5[_0xeae0('0x47')]);return db['ChatInternalMessage'][_0xeae0('0x4f')](_0xdd35f5)[_0xeae0('0x2b')](handleEntityNotFound(_0x56c9aa,null))[_0xeae0('0x2b')](respondWithResult(_0x56c9aa,null))[_0xeae0('0x4a')](handleError(_0x56c9aa,null));};exports[_0xeae0('0x50')]=function(_0x4b8ffa,_0x55e3f2){return db[_0xeae0('0x33')][_0xeae0('0x50')](_0x4b8ffa[_0xeae0('0x51')],{})[_0xeae0('0x2b')](respondWithResult(_0x55e3f2,0xc9))[_0xeae0('0x4a')](handleError(_0x55e3f2,null));};exports[_0xeae0('0x29')]=function(_0x40abd1,_0x96fe0d){if(_0x40abd1[_0xeae0('0x51')]['id']){delete _0x40abd1[_0xeae0('0x51')]['id'];}return db[_0xeae0('0x33')][_0xeae0('0x4f')]({'where':{'id':_0x40abd1[_0xeae0('0x4c')]['id']}})[_0xeae0('0x2b')](handleEntityNotFound(_0x96fe0d,null))[_0xeae0('0x2b')](saveUpdates(_0x40abd1['body'],null))[_0xeae0('0x2b')](respondWithResult(_0x96fe0d,null))[_0xeae0('0x4a')](handleError(_0x96fe0d,null));};exports['destroy']=function(_0x464bb1,_0x249601){return db[_0xeae0('0x33')][_0xeae0('0x4f')]({'where':{'id':_0x464bb1[_0xeae0('0x4c')]['id']}})[_0xeae0('0x2b')](handleEntityNotFound(_0x249601,null))['then'](removeEntity(_0x249601,null))['catch'](handleError(_0x249601,null));};exports[_0xeae0('0x52')]=function(_0x3f55de,_0x1c21d3){return db[_0xeae0('0x33')][_0xeae0('0x52')]()[_0xeae0('0x2b')](respondWithResult(_0x1c21d3,null))[_0xeae0('0x4a')](handleError(_0x1c21d3,null));};function wrapUser(_0x51c721){return function(_0x13ba8d){var _0x25b426=_0x51c721[_0xeae0('0x53')]({'plain':!![]});_0x25b426['messages']=[];if(_0x13ba8d){_0x25b426[_0xeae0('0x54')]=_0x13ba8d[_0xeae0('0x55')];_0x25b426[_0xeae0('0x56')]=_0x13ba8d;}else{_0x25b426[_0xeae0('0x54')]=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x25b426[_0xeae0('0x56')]={};}return _0x25b426;};}exports[_0xeae0('0x57')]=function(_0x5afb53,_0x35a2c8,_0x1a3a7){var _0x2521ed=[];return db[_0xeae0('0x58')][_0xeae0('0x59')]({'where':{'role':[_0xeae0('0x5a'),_0xeae0('0x5b'),_0xeae0('0x5c')]},'attributes':['id',_0xeae0('0x5d'),_0xeae0('0x2f'),_0xeae0('0x5e'),_0xeae0('0x5f'),_0xeae0('0x60'),_0xeae0('0x61'),_0xeae0('0x62'),_0xeae0('0x63'),'showWebBar'],'order':qs[_0xeae0('0x41')]('-online'),'include':[{'model':db[_0xeae0('0x64')],'as':_0xeae0('0x65'),'attributes':['id',_0xeae0('0x2f'),'type'],'through':{'attributes':[]}}]})['then'](function(_0x2af3f0){if(_0x2af3f0){var _0x42f26c=_0x5afb53[_0xeae0('0x5c')][_0xeae0('0x53')]({'plain':!![]});if(!_0x42f26c)throw new Error(_0xeae0('0x66'));if(_0x42f26c[_0xeae0('0x5e')]===_0xeae0('0x5c')){return db[_0xeae0('0x67')][_0xeae0('0x4f')]({'where':{'name':_0xeae0('0x68'),'userProfileId':_0x42f26c[_0xeae0('0x69')]},'raw':!![]})[_0xeae0('0x2b')](function(_0x5638c7){if(_0x5638c7){if(_0x5638c7[_0xeae0('0x6a')]===0x0){return db['UserProfileResource'][_0xeae0('0x59')]({'where':{'sectionId':_0x5638c7['id']},'raw':!![]})['then'](function(_0x1e9df2){var _0x2aa7f9=[];if(_[_0xeae0('0x6b')](_0x1e9df2)){_0x2aa7f9=_['filter'](_0x2af3f0,function(_0x39d946){if(_0x39d946['role']!==_0xeae0('0x5a')){return _0x39d946;}});return _0x2aa7f9;}else{for(var _0x5b6a84=0x0;_0x5b6a84<_0x2af3f0[_0xeae0('0x3d')];_0x5b6a84++){var _0x3061fb=_0x2af3f0[_0x5b6a84];if(_0x3061fb['role']==='agent'){var _0x1dcf94=_[_0xeae0('0x4f')](_0x1e9df2,function(_0x12059e){return _0x12059e[_0xeae0('0x6c')]===_0x3061fb['id'];});if(_0x1dcf94)_0x2aa7f9['push'](_0x3061fb);}else{_0x2aa7f9[_0xeae0('0x6d')](_0x3061fb);}}return _0x2aa7f9;}});}else{return _0x2af3f0;}}else{var _0x264b65=_[_0xeae0('0x44')](_0x2af3f0,function(_0x5aa670){if(_0x5aa670[_0xeae0('0x5e')]!==_0xeae0('0x5a')){return _0x5aa670;}});return _0x264b65;}});}else{return _0x2af3f0;}}})[_0xeae0('0x2b')](function(_0x3aa84e){var _0x488070=[];if(_0x3aa84e){_0x2521ed=_0x3aa84e;for(var _0x295267=0x0;_0x295267<_0x3aa84e[_0xeae0('0x3d')];_0x295267+=0x1){_0x2521ed[_0x295267][_0xeae0('0x6e')]=[];_0x488070[_0xeae0('0x6d')](db[_0xeae0('0x33')][_0xeae0('0x4f')]({'where':{'FromId':[_0x5afb53[_0xeae0('0x5c')]['id'],_0x3aa84e[_0x295267]['id']],'ToId':[_0x5afb53[_0xeae0('0x5c')]['id'],_0x3aa84e[_0x295267]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xeae0('0x6f'),'ToId',_0xeae0('0x70'),_0xeae0('0x51')],'order':qs[_0xeae0('0x41')](_0xeae0('0x71')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xeae0('0x2b')](wrapUser(_0x3aa84e[_0x295267])));}return BPromise[_0xeae0('0x72')](_0x488070);}return[];})[_0xeae0('0x2b')](function(_0x144bec){return{'rows':_0x144bec,'count':_0x144bec[_0xeae0('0x3d')]};})['then'](respondWithResult(_0x35a2c8,null))[_0xeae0('0x4a')](handleError(_0x35a2c8,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index da33791..a11190d 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 _0xa3cb=['hasOwnProperty','hook','exports','events','ChatInternalMessage','setMaxListeners','save','update','emit'];(function(_0xc26a48,_0x42ff7f){var _0x495bc0=function(_0x549479){while(--_0x549479){_0xc26a48['push'](_0xc26a48['shift']());}};_0x495bc0(++_0x42ff7f);}(_0xa3cb,0x1e0));var _0xba3c=function(_0x4aba15,_0x4e90aa){_0x4aba15=_0x4aba15-0x0;var _0x1c8122=_0xa3cb[_0x4aba15];return _0x1c8122;};'use strict';var EventEmitter=require(_0xba3c('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xba3c('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xba3c('0x2')](0x0);var events={'afterCreate':_0xba3c('0x3'),'afterUpdate':_0xba3c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1f8ff1){return function(_0x43b872,_0x478322,_0x10ea36){ChatInternalMessageEvents[_0xba3c('0x5')](_0x1f8ff1+':'+_0x43b872['id'],_0x43b872);ChatInternalMessageEvents[_0xba3c('0x5')](_0x1f8ff1,_0x43b872);_0x10ea36(null);};}for(var e in events){if(events[_0xba3c('0x6')](e)){var event=events[e];ChatInternalMessage[_0xba3c('0x7')](e,emitEvent(event));}}module[_0xba3c('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x105a=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update'];(function(_0x27c24e,_0x5db1c7){var _0x39004a=function(_0x44286d){while(--_0x44286d){_0x27c24e['push'](_0x27c24e['shift']());}};_0x39004a(++_0x5db1c7);}(_0x105a,0xd7));var _0xa105=function(_0x31b92e,_0x3df7cc){_0x31b92e=_0x31b92e-0x0;var _0x5c076e=_0x105a[_0x31b92e];return _0x5c076e;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xa105('0x0'))['db'][_0xa105('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xa105('0x2')](0x0);var events={'afterCreate':_0xa105('0x3'),'afterUpdate':_0xa105('0x4'),'afterDestroy':_0xa105('0x5')};function emitEvent(_0x4f4b89){return function(_0x16610a,_0x3a1850,_0x1aac8b){ChatInternalMessageEvents[_0xa105('0x6')](_0x4f4b89+':'+_0x16610a['id'],_0x16610a);ChatInternalMessageEvents[_0xa105('0x6')](_0x4f4b89,_0x16610a);_0x1aac8b(null);};}for(var e in events){if(events[_0xa105('0x7')](e)){var event=events[e];ChatInternalMessage[_0xa105('0x8')](e,emitEvent(event));}}module[_0xa105('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 0619ac1..733ef1d 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 _0x4d24=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci'];(function(_0x5a764c,_0x12d5e4){var _0x15567b=function(_0x519ac5){while(--_0x519ac5){_0x5a764c['push'](_0x5a764c['shift']());}};_0x15567b(++_0x12d5e4);}(_0x4d24,0x16c));var _0x44d2=function(_0x46e3bd,_0x1b7b0d){_0x46e3bd=_0x46e3bd-0x0;var _0x38a907=_0x4d24[_0x46e3bd];return _0x38a907;};'use strict';var _=require(_0x44d2('0x0'));var util=require(_0x44d2('0x1'));var logger=require(_0x44d2('0x2'))(_0x44d2('0x3'));var moment=require(_0x44d2('0x4'));var BPromise=require(_0x44d2('0x5'));var rp=require(_0x44d2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x44d2('0x7'));var config=require(_0x44d2('0x8'));var attributes=require(_0x44d2('0x9'));module['exports']=function(_0x2d36d7,_0x25f0ac){return _0x2d36d7['define'](_0x44d2('0xa'),attributes,{'tableName':_0x44d2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x44d2('0xc')});};
\ No newline at end of file
+var _0x758d=['utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4'];(function(_0x379d94,_0x1ebc1e){var _0xf3b9d2=function(_0x4fc56a){while(--_0x4fc56a){_0x379d94['push'](_0x379d94['shift']());}};_0xf3b9d2(++_0x1ebc1e);}(_0x758d,0xef));var _0xd758=function(_0x29d8c5,_0x465dcb){_0x29d8c5=_0x29d8c5-0x0;var _0x1fafc5=_0x758d[_0x29d8c5];return _0x1fafc5;};'use strict';var _=require('lodash');var util=require(_0xd758('0x0'));var logger=require(_0xd758('0x1'))(_0xd758('0x2'));var moment=require(_0xd758('0x3'));var BPromise=require('bluebird');var rp=require(_0xd758('0x4'));var fs=require('fs');var path=require(_0xd758('0x5'));var rimraf=require(_0xd758('0x6'));var config=require(_0xd758('0x7'));var attributes=require(_0xd758('0x8'));module[_0xd758('0x9')]=function(_0x10f5d2,_0x290160){return _0x10f5d2[_0xd758('0xa')](_0xd758('0xb'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd758('0xc'),'collate':_0xd758('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index da05caf..827ccd4 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 _0x80ce=['ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','socket.io-emitter','register','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x302aad,_0x5b5ad7){var _0x4274e4=function(_0xdf5496){while(--_0xdf5496){_0x302aad['push'](_0x302aad['shift']());}};_0x4274e4(++_0x5b5ad7);}(_0x80ce,0xae));var _0xe80c=function(_0x56c381,_0x30c0f2){_0x56c381=_0x56c381-0x0;var _0x54d4fc=_0x80ce[_0x56c381];return _0x54d4fc;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xe80c('0x0'));var rs=require(_0xe80c('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe80c('0x2'))['db'];var utils=require(_0xe80c('0x3'));var logger=require(_0xe80c('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe80c('0x5')][_0xe80c('0x6')]({'port':0x232a});config[_0xe80c('0x7')]=_[_0xe80c('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe80c('0x9'))(new Redis(config[_0xe80c('0x7')]));require('./chatInternalMessage.socket')[_0xe80c('0xa')](socket);function respondWithRpcPromise(_0x21f32c,_0x1338af,_0x3cfbeb){return new BPromise(function(_0x75b98f,_0x4881f9){return client['request'](_0x21f32c,_0x3cfbeb)['then'](function(_0xa08bf1){logger[_0xe80c('0xb')](_0xe80c('0xc'),_0x1338af,_0xe80c('0xd'));logger[_0xe80c('0xe')](_0xe80c('0xf'),_0x1338af,_0xe80c('0xd'),JSON[_0xe80c('0x10')](_0xa08bf1));if(_0xa08bf1[_0xe80c('0x11')]){if(_0xa08bf1[_0xe80c('0x11')][_0xe80c('0x12')]===0x1f4){logger[_0xe80c('0x11')](_0xe80c('0xc'),_0x1338af,_0xa08bf1['error'][_0xe80c('0x13')]);return _0x4881f9(_0xa08bf1['error'][_0xe80c('0x13')]);}logger[_0xe80c('0x11')](_0xe80c('0xc'),_0x1338af,_0xa08bf1['error'][_0xe80c('0x13')]);return _0x75b98f(_0xa08bf1[_0xe80c('0x11')]['message']);}else{logger[_0xe80c('0xb')](_0xe80c('0xc'),_0x1338af,'request\x20sent');_0x75b98f(_0xa08bf1[_0xe80c('0x14')][_0xe80c('0x13')]);}})['catch'](function(_0x4c431c){logger[_0xe80c('0x11')](_0xe80c('0xc'),_0x1338af,_0x4c431c);_0x4881f9(_0x4c431c);});});}
\ No newline at end of file
+var _0xbf44=['ChatInternalMessage,\x20%s,\x20%s','message','result','catch','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./chatInternalMessage.socket','register','request','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2c976f,_0x4bd2c4){var _0x1a1227=function(_0x24597e){while(--_0x24597e){_0x2c976f['push'](_0x2c976f['shift']());}};_0x1a1227(++_0x4bd2c4);}(_0xbf44,0xdc));var _0x4bf4=function(_0x461c2e,_0x4015e2){_0x461c2e=_0x461c2e-0x0;var _0x524f15=_0xbf44[_0x461c2e];return _0x524f15;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4bf4('0x0'));var BPromise=require('bluebird');var rs=require(_0x4bf4('0x1'));var fs=require('fs');var Redis=require(_0x4bf4('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x4bf4('0x3'));var logger=require(_0x4bf4('0x4'))(_0x4bf4('0x5'));var config=require('../../config/environment');var jayson=require(_0x4bf4('0x6'));var client=jayson[_0x4bf4('0x7')]['http']({'port':0x232a});config['redis']=_[_0x4bf4('0x8')](config['redis'],{'host':_0x4bf4('0x9'),'port':0x18eb});var socket=require(_0x4bf4('0xa'))(new Redis(config[_0x4bf4('0xb')]));require(_0x4bf4('0xc'))[_0x4bf4('0xd')](socket);function respondWithRpcPromise(_0x489bb1,_0x5c066f,_0x19b660){return new BPromise(function(_0x10a9e2,_0x25f9b3){return client[_0x4bf4('0xe')](_0x489bb1,_0x19b660)[_0x4bf4('0xf')](function(_0x5c2d5a){logger[_0x4bf4('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x5c066f,_0x4bf4('0x11'));logger[_0x4bf4('0x12')](_0x4bf4('0x13'),_0x5c066f,_0x4bf4('0x11'),JSON[_0x4bf4('0x14')](_0x5c2d5a));if(_0x5c2d5a[_0x4bf4('0x15')]){if(_0x5c2d5a[_0x4bf4('0x15')][_0x4bf4('0x16')]===0x1f4){logger[_0x4bf4('0x15')](_0x4bf4('0x17'),_0x5c066f,_0x5c2d5a[_0x4bf4('0x15')][_0x4bf4('0x18')]);return _0x25f9b3(_0x5c2d5a[_0x4bf4('0x15')][_0x4bf4('0x18')]);}logger['error'](_0x4bf4('0x17'),_0x5c066f,_0x5c2d5a[_0x4bf4('0x15')][_0x4bf4('0x18')]);return _0x10a9e2(_0x5c2d5a[_0x4bf4('0x15')][_0x4bf4('0x18')]);}else{logger['info'](_0x4bf4('0x17'),_0x5c066f,_0x4bf4('0x11'));_0x10a9e2(_0x5c2d5a[_0x4bf4('0x19')][_0x4bf4('0x18')]);}})[_0x4bf4('0x1a')](function(_0x59dcb7){logger[_0x4bf4('0x15')](_0x4bf4('0x17'),_0x5c066f,_0x59dcb7);_0x25f9b3(_0x59dcb7);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index a0d858f..ec48c6c 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 _0xd1db=['update','removeListener','chatInternalMessage:','./chatInternalMessage.events','save','remove'];(function(_0x2b9ba5,_0x26f594){var _0x5cd927=function(_0x159963){while(--_0x159963){_0x2b9ba5['push'](_0x2b9ba5['shift']());}};_0x5cd927(++_0x26f594);}(_0xd1db,0x117));var _0xbd1d=function(_0x179b74,_0x5dc97d){_0x179b74=_0x179b74-0x0;var _0x268f76=_0xd1db[_0x179b74];return _0x268f76;};'use strict';var ChatInternalMessageEvents=require(_0xbd1d('0x0'));var events=[_0xbd1d('0x1'),_0xbd1d('0x2'),_0xbd1d('0x3')];function createListener(_0x3eb6e9,_0x37c592){return function(_0x534e23){_0x37c592['emit'](_0x3eb6e9,_0x534e23);};}function removeListener(_0x3c45b6,_0x4a1986){return function(){ChatInternalMessageEvents[_0xbd1d('0x4')](_0x3c45b6,_0x4a1986);};}exports['register']=function(_0x21173b){for(var _0x5dadf7=0x0,_0x44b791=events['length'];_0x5dadf7<_0x44b791;_0x5dadf7++){var _0x5cf508=events[_0x5dadf7];var _0x2e5527=createListener(_0xbd1d('0x5')+_0x5cf508,_0x21173b);ChatInternalMessageEvents['on'](_0x5cf508,_0x2e5527);}};
\ No newline at end of file
+var _0x716a=['remove','update','register','length','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x571c89,_0x579586){var _0x52e8eb=function(_0x3db26c){while(--_0x3db26c){_0x571c89['push'](_0x571c89['shift']());}};_0x52e8eb(++_0x579586);}(_0x716a,0x91));var _0xa716=function(_0xd0a847,_0x72562b){_0xd0a847=_0xd0a847-0x0;var _0x2536ec=_0x716a[_0xd0a847];return _0x2536ec;};'use strict';var ChatInternalMessageEvents=require(_0xa716('0x0'));var events=[_0xa716('0x1'),_0xa716('0x2'),_0xa716('0x3')];function createListener(_0x525c95,_0x4f6892){return function(_0x297c53){_0x4f6892['emit'](_0x525c95,_0x297c53);};}function removeListener(_0x3ba5cd,_0x14ea82){return function(){ChatInternalMessageEvents['removeListener'](_0x3ba5cd,_0x14ea82);};}exports[_0xa716('0x4')]=function(_0x2fbfbb){for(var _0x54e6cc=0x0,_0x1296ba=events[_0xa716('0x5')];_0x54e6cc<_0x1296ba;_0x54e6cc++){var _0x20d370=events[_0x54e6cc];var _0x54d7ef=createListener(_0xa716('0x6')+_0x20d370,_0x2fbfbb);ChatInternalMessageEvents['on'](_0x20d370,_0x54d7ef);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 9612ce1..db34f5b 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 _0x28a7=['exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','show','post','/:id','update'];(function(_0x5dd017,_0x28e6db){var _0x571094=function(_0x4a7e1f){while(--_0x4a7e1f){_0x5dd017['push'](_0x5dd017['shift']());}};_0x571094(++_0x28e6db);}(_0x28a7,0x1e1));var _0x728a=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x28a7[_0x484e36];return _0xafc85d;};'use strict';var multer=require(_0x728a('0x0'));var util=require(_0x728a('0x1'));var path=require('path');var timeout=require(_0x728a('0x2'));var express=require(_0x728a('0x3'));var router=express['Router']();var fs_extra=require(_0x728a('0x4'));var auth=require(_0x728a('0x5'));var interaction=require(_0x728a('0x6'));var config=require(_0x728a('0x7'));var controller=require(_0x728a('0x8'));router[_0x728a('0x9')]('/',auth[_0x728a('0xa')](),controller[_0x728a('0xb')]);router[_0x728a('0x9')](_0x728a('0xc'),auth[_0x728a('0xa')](),controller[_0x728a('0xd')]);router[_0x728a('0x9')](_0x728a('0xe'),auth[_0x728a('0xa')](),controller['getUsers']);router[_0x728a('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x728a('0xf')]);router[_0x728a('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x728a('0x11'),controller[_0x728a('0x12')]);router['delete'](_0x728a('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x728a('0x13')]=router;
\ No newline at end of file
+var _0x10d8=['isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0x3245af,_0x4e12ad){var _0x55d99d=function(_0x59931a){while(--_0x59931a){_0x3245af['push'](_0x3245af['shift']());}};_0x55d99d(++_0x4e12ad);}(_0x10d8,0xee));var _0x810d=function(_0x293557,_0x6812df){_0x293557=_0x293557-0x0;var _0x366e5b=_0x10d8[_0x293557];return _0x366e5b;};'use strict';var multer=require(_0x810d('0x0'));var util=require(_0x810d('0x1'));var path=require(_0x810d('0x2'));var timeout=require('connect-timeout');var express=require(_0x810d('0x3'));var router=express[_0x810d('0x4')]();var fs_extra=require(_0x810d('0x5'));var auth=require(_0x810d('0x6'));var interaction=require(_0x810d('0x7'));var config=require('../../config/environment');var controller=require('./chatInternalMessage.controller');router[_0x810d('0x8')]('/',auth[_0x810d('0x9')](),controller[_0x810d('0xa')]);router[_0x810d('0x8')](_0x810d('0xb'),auth[_0x810d('0x9')](),controller[_0x810d('0xc')]);router['get']('/users',auth['isAuthenticated'](),controller['getUsers']);router[_0x810d('0x8')](_0x810d('0xd'),auth[_0x810d('0x9')](),controller[_0x810d('0xe')]);router['post']('/',auth[_0x810d('0x9')](),controller[_0x810d('0xf')]);router[_0x810d('0x10')](_0x810d('0xd'),controller['update']);router[_0x810d('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x810d('0x12')]);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 3bdab27..c09d53f 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 _0x536f=['out','STRING','sequelize','BOOLEAN','ENUM'];(function(_0x548cf2,_0x26f00a){var _0x27ecba=function(_0x2fa99f){while(--_0x2fa99f){_0x548cf2['push'](_0x548cf2['shift']());}};_0x27ecba(++_0x26f00a);}(_0x536f,0x70));var _0xf536=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x536f[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xf536('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xf536('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf536('0x2')]('in',_0xf536('0x3')),'defaultValue':_0xf536('0x3'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xf536('0x4')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xee4e=['DATE','STRING','sequelize','exports','TEXT','BOOLEAN','ENUM','out'];(function(_0x1f94a0,_0xddea50){var _0x5cb0ba=function(_0xf9139e){while(--_0xf9139e){_0x1f94a0['push'](_0x1f94a0['shift']());}};_0x5cb0ba(++_0xddea50);}(_0xee4e,0x122));var _0xeee4=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xee4e[_0xbd08b4];return _0x314f1e;};'use strict';var Sequelize=require(_0xeee4('0x0'));module[_0xeee4('0x1')]={'body':{'type':Sequelize[_0xeee4('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xeee4('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xeee4('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xeee4('0x4')]('in',_0xeee4('0x5')),'defaultValue':_0xeee4('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xeee4('0x6')]},'providerName':{'type':Sequelize[_0xeee4('0x7')]},'providerResponse':{'type':Sequelize[_0xeee4('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index bcf3909..5891006 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 _0xf493=['acceptMessage','sequelize','QueryTypes','SELECT','contact','fullname','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','ContactId','User','internal','format','rejectmessage','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatMessage.socket','register','client','http','request','then','request\x20sent','debug','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','info','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','stack','name','send','index','map','ChatMessage','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','options','find','create','body','describe','chat-interactions','accept','chat','YYYY-MM-DD\x20HH:mm:ss','user','agent','UserId','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage'];(function(_0x67754c,_0x4ee2c1){var _0x1f09ec=function(_0x255080){while(--_0x255080){_0x67754c['push'](_0x67754c['shift']());}};_0x1f09ec(++_0x4ee2c1);}(_0xf493,0x116));var _0x3f49=function(_0xabdfcd,_0x4ea11d){_0xabdfcd=_0xabdfcd-0x0;var _0x18172b=_0xf493[_0xabdfcd];return _0x18172b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3f49('0x0'));var zipdir=require(_0x3f49('0x1'));var jsonpatch=require(_0x3f49('0x2'));var rp=require('request-promise');var moment=require(_0x3f49('0x3'));var BPromise=require(_0x3f49('0x4'));var Mustache=require(_0x3f49('0x5'));var util=require(_0x3f49('0x6'));var path=require(_0x3f49('0x7'));var sox=require(_0x3f49('0x8'));var csv=require('to-csv');var ejs=require(_0x3f49('0x9'));var fs=require('fs');var fs_extra=require(_0x3f49('0xa'));var _=require('lodash');var squel=require(_0x3f49('0xb'));var crypto=require(_0x3f49('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3f49('0xd'));var toCsv=require(_0x3f49('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3f49('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3f49('0x10'));var as=require(_0x3f49('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3f49('0x12'))(_0x3f49('0x13'));var utils=require(_0x3f49('0x14'));var config=require(_0x3f49('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3f49('0x16'))['db'];config[_0x3f49('0x17')]=_[_0x3f49('0x18')](config[_0x3f49('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x3f49('0x19'))(new Redis(config['redis']));require(_0x3f49('0x1a'))[_0x3f49('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3f49('0x1c')][_0x3f49('0x1d')]({'port':0x232c});var client9002=jayson[_0x3f49('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33effe,_0x3aa104,_0x44d15c,_0xab7269){return new BPromise(function(_0x4ba304,_0x41d6e6){var _0x29f894=_0xab7269||client;return _0x29f894[_0x3f49('0x1e')](_0x33effe,_0x44d15c)[_0x3f49('0x1f')](function(_0x4c4b30){logger['info']('ChatMessage,\x20%s,\x20%s',_0x3aa104,_0x3f49('0x20'));logger[_0x3f49('0x21')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3aa104,_0x3f49('0x20'),JSON[_0x3f49('0x22')](_0x4c4b30));if(_0x4c4b30['error']){if(_0x4c4b30[_0x3f49('0x23')][_0x3f49('0x24')]===0x1f4){logger[_0x3f49('0x23')](_0x3f49('0x25'),_0x3aa104,_0x4c4b30['error'][_0x3f49('0x26')]);return _0x41d6e6(_0x4c4b30['error']['message']);}logger[_0x3f49('0x23')](_0x3f49('0x25'),_0x3aa104,_0x4c4b30[_0x3f49('0x23')][_0x3f49('0x26')]);return _0x4ba304(_0x4c4b30['error'][_0x3f49('0x26')]);}else{logger[_0x3f49('0x27')](_0x3f49('0x25'),_0x3aa104,_0x3f49('0x20'));_0x4ba304(_0x4c4b30[_0x3f49('0x28')][_0x3f49('0x26')]);}})['catch'](function(_0x207818){logger[_0x3f49('0x23')](_0x3f49('0x25'),_0x3aa104,_0x207818);_0x41d6e6(_0x207818);});});}function respondWithStatusCode(_0x8a9d96,_0xdb0a3e){_0xdb0a3e=_0xdb0a3e||0xcc;return function(_0x5ec906){if(_0x5ec906){return _0x8a9d96[_0x3f49('0x29')](_0xdb0a3e);}return _0x8a9d96[_0x3f49('0x2a')](_0xdb0a3e)[_0x3f49('0x2b')]();};}function respondWithResult(_0x30a899,_0x2dac1a){_0x2dac1a=_0x2dac1a||0xc8;return function(_0x2079df){if(_0x2079df){return _0x30a899[_0x3f49('0x2a')](_0x2dac1a)[_0x3f49('0x2c')](_0x2079df);}};}function respondWithFilteredResult(_0x866e9a,_0x22ab02){return function(_0x4ab3c5){if(_0x4ab3c5){var _0x14e1e4=typeof _0x22ab02[_0x3f49('0x2d')]===_0x3f49('0x2e')&&typeof _0x22ab02[_0x3f49('0x2f')]==='undefined';var _0x4b17f4=_0x4ab3c5[_0x3f49('0x30')];var _0x15d0c3=_0x14e1e4?0x0:_0x22ab02[_0x3f49('0x2d')];var _0x36ff3a=_0x14e1e4?_0x4ab3c5[_0x3f49('0x30')]:_0x22ab02[_0x3f49('0x2d')]+_0x22ab02[_0x3f49('0x2f')];var _0x23f8b3;if(_0x36ff3a>=_0x4b17f4){_0x36ff3a=_0x4b17f4;_0x23f8b3=0xc8;}else{_0x23f8b3=0xce;}_0x866e9a[_0x3f49('0x2a')](_0x23f8b3);return _0x866e9a[_0x3f49('0x31')](_0x3f49('0x32'),_0x15d0c3+'-'+_0x36ff3a+'/'+_0x4b17f4)[_0x3f49('0x2c')](_0x4ab3c5);}return null;};}function patchUpdates(_0x3ae041){return function(_0x234f21){try{jsonpatch['apply'](_0x234f21,_0x3ae041,!![]);}catch(_0x5a8573){return BPromise[_0x3f49('0x33')](_0x5a8573);}return _0x234f21['save']();};}function saveUpdates(_0x1050bc,_0x375652){return function(_0x1989b9){if(_0x1989b9){return _0x1989b9[_0x3f49('0x34')](_0x1050bc)[_0x3f49('0x1f')](function(_0x48372a){return _0x48372a;});}return null;};}function removeEntity(_0x2daf56,_0x158617){return function(_0x22a2da){if(_0x22a2da){return _0x22a2da[_0x3f49('0x35')]()[_0x3f49('0x1f')](function(){_0x2daf56[_0x3f49('0x2a')](0xcc)[_0x3f49('0x2b')]();});}};}function handleEntityNotFound(_0x4593ba,_0x261516){return function(_0x315f48){if(!_0x315f48){_0x4593ba[_0x3f49('0x29')](0x194);}return _0x315f48;};}function handleError(_0x406a9d,_0xba088c){_0xba088c=_0xba088c||0x1f4;return function(_0x573bef){logger[_0x3f49('0x23')](_0x573bef[_0x3f49('0x36')]);if(_0x573bef[_0x3f49('0x37')]){delete _0x573bef['name'];}_0x406a9d[_0x3f49('0x2a')](_0xba088c)[_0x3f49('0x38')](_0x573bef);};}exports[_0x3f49('0x39')]=function(_0x7fe4df,_0x23c454){var _0x33abd9={},_0x5b6c35={},_0x59aae6={'count':0x0,'rows':[]};var _0x47ea41=_[_0x3f49('0x3a')](db[_0x3f49('0x3b')]['rawAttributes'],function(_0x4c547e){return{'name':_0x4c547e['fieldName'],'type':_0x4c547e[_0x3f49('0x3c')]['key']};});_0x5b6c35[_0x3f49('0x3d')]=_[_0x3f49('0x3a')](_0x47ea41,'name');_0x5b6c35[_0x3f49('0x3e')]=_['keys'](_0x7fe4df[_0x3f49('0x3e')]);_0x5b6c35[_0x3f49('0x3f')]=_[_0x3f49('0x40')](_0x5b6c35['model'],_0x5b6c35['query']);_0x33abd9['attributes']=_[_0x3f49('0x40')](_0x5b6c35['model'],qs[_0x3f49('0x41')](_0x7fe4df[_0x3f49('0x3e')]['fields']));_0x33abd9[_0x3f49('0x42')]=_0x33abd9[_0x3f49('0x42')][_0x3f49('0x43')]?_0x33abd9[_0x3f49('0x42')]:_0x5b6c35['model'];if(!_0x7fe4df[_0x3f49('0x3e')][_0x3f49('0x44')](_0x3f49('0x45'))){_0x33abd9[_0x3f49('0x2f')]=qs['limit'](_0x7fe4df[_0x3f49('0x3e')]['limit']);_0x33abd9[_0x3f49('0x2d')]=qs[_0x3f49('0x2d')](_0x7fe4df[_0x3f49('0x3e')][_0x3f49('0x2d')]);}_0x33abd9[_0x3f49('0x46')]=qs[_0x3f49('0x47')](_0x7fe4df[_0x3f49('0x3e')][_0x3f49('0x47')]);_0x33abd9['where']=qs['filters'](_[_0x3f49('0x48')](_0x7fe4df[_0x3f49('0x3e')],_0x5b6c35[_0x3f49('0x3f')]),_0x47ea41);if(_0x7fe4df[_0x3f49('0x3e')][_0x3f49('0x49')]){_0x33abd9[_0x3f49('0x4a')]=_[_0x3f49('0x4b')](_0x33abd9[_0x3f49('0x4a')],{'$or':_[_0x3f49('0x3a')](_0x47ea41,function(_0x20e112){if(_0x20e112[_0x3f49('0x3c')]!==_0x3f49('0x4c')){var _0x1201f5={};_0x1201f5[_0x20e112[_0x3f49('0x37')]]={'$like':'%'+_0x7fe4df['query'][_0x3f49('0x49')]+'%'};return _0x1201f5;}})});}_0x33abd9=_['merge']({},_0x33abd9,_0x7fe4df['options']);var _0x252f31={'where':_0x33abd9[_0x3f49('0x4a')]};return db[_0x3f49('0x3b')]['count'](_0x252f31)[_0x3f49('0x1f')](function(_0x513a15){_0x59aae6[_0x3f49('0x30')]=_0x513a15;if(_0x7fe4df[_0x3f49('0x3e')][_0x3f49('0x4d')]){_0x33abd9[_0x3f49('0x4e')]=[{'all':!![]}];}return db['ChatMessage'][_0x3f49('0x4f')](_0x33abd9);})[_0x3f49('0x1f')](function(_0x51232f){_0x59aae6[_0x3f49('0x50')]=_0x51232f;return _0x59aae6;})[_0x3f49('0x1f')](respondWithFilteredResult(_0x23c454,_0x33abd9))[_0x3f49('0x51')](handleError(_0x23c454,null));};exports['show']=function(_0x53d850,_0x389586){var _0x4b1555={'raw':!![],'where':{'id':_0x53d850[_0x3f49('0x52')]['id']}},_0x566820={};_0x566820[_0x3f49('0x3d')]=_[_0x3f49('0x53')](db[_0x3f49('0x3b')]['rawAttributes']);_0x566820['query']=_[_0x3f49('0x53')](_0x53d850['query']);_0x566820[_0x3f49('0x3f')]=_[_0x3f49('0x40')](_0x566820[_0x3f49('0x3d')],_0x566820[_0x3f49('0x3e')]);_0x4b1555[_0x3f49('0x42')]=_[_0x3f49('0x40')](_0x566820[_0x3f49('0x3d')],qs[_0x3f49('0x41')](_0x53d850[_0x3f49('0x3e')][_0x3f49('0x41')]));_0x4b1555[_0x3f49('0x42')]=_0x4b1555['attributes'][_0x3f49('0x43')]?_0x4b1555[_0x3f49('0x42')]:_0x566820[_0x3f49('0x3d')];if(_0x53d850['query'][_0x3f49('0x4d')]){_0x4b1555[_0x3f49('0x4e')]=[{'all':!![]}];}_0x4b1555=_[_0x3f49('0x4b')]({},_0x4b1555,_0x53d850[_0x3f49('0x54')]);return db[_0x3f49('0x3b')][_0x3f49('0x55')](_0x4b1555)[_0x3f49('0x1f')](handleEntityNotFound(_0x389586,null))[_0x3f49('0x1f')](respondWithResult(_0x389586,null))[_0x3f49('0x51')](handleError(_0x389586,null));};exports[_0x3f49('0x56')]=function(_0x1c8008,_0x36fc90){return db[_0x3f49('0x3b')][_0x3f49('0x56')](_0x1c8008[_0x3f49('0x57')],{})[_0x3f49('0x1f')](respondWithResult(_0x36fc90,0xc9))[_0x3f49('0x51')](handleError(_0x36fc90,null));};exports[_0x3f49('0x34')]=function(_0x2ee7f6,_0x48a9f7){if(_0x2ee7f6[_0x3f49('0x57')]['id']){delete _0x2ee7f6[_0x3f49('0x57')]['id'];}return db[_0x3f49('0x3b')][_0x3f49('0x55')]({'where':{'id':_0x2ee7f6[_0x3f49('0x52')]['id']}})['then'](handleEntityNotFound(_0x48a9f7,null))[_0x3f49('0x1f')](saveUpdates(_0x2ee7f6[_0x3f49('0x57')],null))['then'](respondWithResult(_0x48a9f7,null))[_0x3f49('0x51')](handleError(_0x48a9f7,null));};exports[_0x3f49('0x35')]=function(_0x4820b0,_0x3d3bd2){return db['ChatMessage'][_0x3f49('0x55')]({'where':{'id':_0x4820b0[_0x3f49('0x52')]['id']}})['then'](handleEntityNotFound(_0x3d3bd2,null))[_0x3f49('0x1f')](removeEntity(_0x3d3bd2,null))[_0x3f49('0x51')](handleError(_0x3d3bd2,null));};exports[_0x3f49('0x58')]=function(_0x3e5beb,_0x454590){return db[_0x3f49('0x3b')][_0x3f49('0x58')]()[_0x3f49('0x1f')](respondWithResult(_0x454590,null))['catch'](handleError(_0x454590,null));};var interaction_log=require(_0x3f49('0x12'))(_0x3f49('0x59'));exports[_0x3f49('0x5a')]=function(_0x555363,_0x2e6057,_0x1e0d51){var _0x1e65e8={'agent':{},'channel':_0x3f49('0x5b')};if(_0x555363[_0x3f49('0x57')]['id']){delete _0x555363[_0x3f49('0x57')]['id'];}_0x555363['body']['read']=!![];_0x555363['body']['readAt']=moment()['format'](_0x3f49('0x5c'));_0x555363['body']['UserId']=_0x555363[_0x3f49('0x57')]['UserId']||_0x555363[_0x3f49('0x5d')]['id'];_0x1e65e8[_0x3f49('0x5e')]['id']=_0x555363[_0x3f49('0x57')][_0x3f49('0x5f')];return db['ChatMessage'][_0x3f49('0x55')]({'where':{'id':_0x555363['params']['id'],'UserId':null}})[_0x3f49('0x1f')](handleEntityNotFound(_0x2e6057,null))[_0x3f49('0x1f')](saveUpdates(_0x555363[_0x3f49('0x57')],null))[_0x3f49('0x1f')](function(_0x3a9477){if(_0x3a9477){_0x1e65e8[_0x3f49('0x26')]=_0x3a9477['get']({'plain':!![]});return db[_0x3f49('0x60')]['find']({'where':{'id':_0x3a9477[_0x3f49('0x61')]}});}return null;})[_0x3f49('0x1f')](handleEntityNotFound(_0x2e6057,null))[_0x3f49('0x1f')](function(_0x473802){if(_0x473802){return _0x473802['update']({'UserId':_0x555363['body']['UserId'],'read1stAt':_[_0x3f49('0x62')](_0x473802[_0x3f49('0x63')])?moment()['format'](_0x3f49('0x5c')):undefined});}return null;})['then'](function(_0x39ead){if(_0x39ead){_0x1e65e8[_0x3f49('0x64')]=_0x39ead[_0x3f49('0x65')]({'plain':!![]});interaction_log[_0x3f49('0x27')](_0x3f49('0x66'),_0x555363[_0x3f49('0x5d')]['id'],_0x555363['user']['name'],_0x555363[_0x3f49('0x5d')][_0x3f49('0x67')],_0x1e65e8[_0x3f49('0x64')]['id'],_0x555363[_0x3f49('0x57')]?JSON[_0x3f49('0x22')](_0x555363['body']):_0x3f49('0x68'));return respondWithRpcPromise(_0x3f49('0x69'),_0x3f49('0x6a'),_0x1e65e8);}return null;})['then'](function(_0x2c1bf2){var _0x51a950='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2c1bf2[_0x3f49('0x26')]['ContactId'];return db[_0x3f49('0x6b')][_0x3f49('0x3e')](_0x51a950,{'type':db['Sequelize'][_0x3f49('0x6c')][_0x3f49('0x6d')],'raw':!![]})['then'](function(_0x3b9f1e){return _0x3b9f1e;});})['then'](function(_0x712ea4){if(_0x712ea4){_0x1e65e8[_0x3f49('0x26')][_0x3f49('0x6e')]=_0x712ea4[0x0];if(!_0x555363[_0x3f49('0x57')][_0x3f49('0x5f')])return;return db['User'][_0x3f49('0x55')]({'where':{'id':_0x555363['body'][_0x3f49('0x5f')],'role':_0x3f49('0x5e')},'attributes':['id','name',_0x3f49('0x6f'),'email','internal'],'raw':!![]});}return null;})[_0x3f49('0x1f')](function(_0x53586b){if(!_0x53586b)return null;_0x1e65e8[_0x3f49('0x26')][_0x3f49('0x5e')]=_0x53586b;return _0x1e65e8;})['then'](function(_0x3115d0){if(_0x3115d0){if(_0x555363['body'][_0x3f49('0x70')]){_0x1e65e8[_0x3f49('0x26')][_0x3f49('0x71')]=util['format'](_0x3f49('0x72'),_0x555363[_0x3f49('0x5d')][_0x3f49('0x37')]);_0x1e65e8[_0x3f49('0x26')]['channel']=_0x1e65e8[_0x3f49('0x73')];_0x1e65e8[_0x3f49('0x26')][_0x3f49('0x74')]=_0x1e65e8[_0x3f49('0x73')];_0x1e65e8[_0x3f49('0x26')][_0x3f49('0x75')]='accept';return respondWithRpcPromise('EventManager',_0x3f49('0x76'),{'event':'acceptmessage','message':_[_0x3f49('0x4b')](_0x1e65e8[_0x3f49('0x26')],JSON[_0x3f49('0x77')](_0x1e65e8[_0x3f49('0x64')][_0x3f49('0x78')]))},client9002)[_0x3f49('0x1f')](function(){return _0x1e65e8;});}return _0x1e65e8;}return null;})['then'](respondWithResult(_0x2e6057,null))[_0x3f49('0x51')](handleError(_0x2e6057,null));};var interaction_log=require('../../config/logger')(_0x3f49('0x59'));exports[_0x3f49('0x33')]=function(_0x3cbaca,_0x4cd3ac,_0x5693fa){var _0x4063e6={'agent':{},'channel':_0x3f49('0x5b')};if(_0x3cbaca[_0x3f49('0x57')]['id']){delete _0x3cbaca[_0x3f49('0x57')]['id'];}_0x3cbaca[_0x3f49('0x57')][_0x3f49('0x5f')]=_0x3cbaca[_0x3f49('0x57')][_0x3f49('0x5f')]||_0x3cbaca[_0x3f49('0x5d')]['id'];_0x4063e6[_0x3f49('0x5e')]['id']=_0x3cbaca[_0x3f49('0x57')][_0x3f49('0x5f')];return db[_0x3f49('0x3b')][_0x3f49('0x55')]({'where':{'id':_0x3cbaca[_0x3f49('0x52')]['id'],'UserId':null}})[_0x3f49('0x1f')](handleEntityNotFound(_0x4cd3ac,null))[_0x3f49('0x1f')](function(_0x17ff76){if(_0x17ff76){_0x4063e6[_0x3f49('0x26')]=_0x17ff76[_0x3f49('0x65')]({'plain':!![]});return db[_0x3f49('0x60')]['find']({'where':{'id':_0x17ff76[_0x3f49('0x61')]}});}return null;})[_0x3f49('0x1f')](handleEntityNotFound(_0x4cd3ac,null))[_0x3f49('0x1f')](function(_0x3fc341){if(_0x3fc341){_0x4063e6[_0x3f49('0x64')]=_0x3fc341['get']({'plain':!![]});interaction_log[_0x3f49('0x27')](_0x3f49('0x79'),_0x3cbaca[_0x3f49('0x5d')]['id'],_0x3cbaca['user'][_0x3f49('0x37')],_0x3cbaca['user'][_0x3f49('0x67')],_0x4063e6[_0x3f49('0x64')]['id'],_0x3cbaca[_0x3f49('0x57')]?JSON[_0x3f49('0x22')](_0x3cbaca[_0x3f49('0x57')]):_0x3f49('0x68'));return respondWithRpcPromise('RejectMessage',_0x3f49('0x7a'),_0x4063e6);}return null;})[_0x3f49('0x1f')](function(_0x593eca){var _0xbf5a1a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x593eca['message'][_0x3f49('0x7b')];return db[_0x3f49('0x6b')][_0x3f49('0x3e')](_0xbf5a1a,{'type':db['Sequelize'][_0x3f49('0x6c')][_0x3f49('0x6d')],'raw':!![]})[_0x3f49('0x1f')](function(_0x33472a){return _0x33472a;});})[_0x3f49('0x1f')](function(_0x2f4c5d){if(_0x2f4c5d){_0x4063e6['message'][_0x3f49('0x6e')]=_0x2f4c5d[0x0];if(!_0x3cbaca[_0x3f49('0x57')][_0x3f49('0x5f')])return;return db[_0x3f49('0x7c')][_0x3f49('0x55')]({'where':{'id':_0x3cbaca['body']['UserId'],'role':_0x3f49('0x5e')},'attributes':['id','name',_0x3f49('0x6f'),'email',_0x3f49('0x7d')],'raw':!![]});}return null;})[_0x3f49('0x1f')](function(_0x3b6338){if(!_0x3b6338)return null;_0x4063e6[_0x3f49('0x26')][_0x3f49('0x5e')]=_0x3b6338;return _0x4063e6;})[_0x3f49('0x1f')](function(_0x54f5d7){if(_0x54f5d7){_0x54f5d7[_0x3f49('0x26')][_0x3f49('0x71')]=util[_0x3f49('0x7e')]('SIP/%s',_0x3cbaca[_0x3f49('0x5d')][_0x3f49('0x37')]);_0x54f5d7['message']['channel']=_0x4063e6[_0x3f49('0x73')];_0x54f5d7[_0x3f49('0x26')][_0x3f49('0x74')]=_0x4063e6['channel'];_0x54f5d7[_0x3f49('0x26')][_0x3f49('0x75')]=_0x3f49('0x33');respondWithRpcPromise(_0x3f49('0x76'),_0x3f49('0x76'),{'event':_0x3f49('0x7f'),'message':_[_0x3f49('0x4b')](_0x4063e6[_0x3f49('0x26')],JSON[_0x3f49('0x77')](_0x4063e6['interaction'][_0x3f49('0x78')]))},client9002);return _0x4063e6;}return null;})['then'](respondWithResult(_0x4cd3ac,null))[_0x3f49('0x51')](handleError(_0x4cd3ac,null));};
\ No newline at end of file
+var _0x71f0=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','client','http','request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','index','map','rawAttributes','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','pick','filters','filter','merge','type','options','ChatMessage','includeAll','findAll','rows','length','include','find','create','body','params','describe','chat-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','interface','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv'];(function(_0x47e714,_0x1d3db4){var _0x45215f=function(_0x32789d){while(--_0x32789d){_0x47e714['push'](_0x47e714['shift']());}};_0x45215f(++_0x1d3db4);}(_0x71f0,0x108));var _0x071f=function(_0x3ba69c,_0x3e370c){_0x3ba69c=_0x3ba69c-0x0;var _0x1c722b=_0x71f0[_0x3ba69c];return _0x1c722b;};'use strict';var emlformat=require(_0x071f('0x0'));var rimraf=require(_0x071f('0x1'));var zipdir=require(_0x071f('0x2'));var jsonpatch=require(_0x071f('0x3'));var rp=require('request-promise');var moment=require(_0x071f('0x4'));var BPromise=require(_0x071f('0x5'));var Mustache=require(_0x071f('0x6'));var util=require('util');var path=require(_0x071f('0x7'));var sox=require(_0x071f('0x8'));var csv=require(_0x071f('0x9'));var ejs=require(_0x071f('0xa'));var fs=require('fs');var fs_extra=require(_0x071f('0xb'));var _=require(_0x071f('0xc'));var squel=require(_0x071f('0xd'));var crypto=require(_0x071f('0xe'));var jsforce=require(_0x071f('0xf'));var deskjs=require(_0x071f('0x10'));var toCsv=require(_0x071f('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x071f('0x11'));var authService=require(_0x071f('0x12'));var qs=require(_0x071f('0x13'));var as=require(_0x071f('0x14'));var hardwareService=require(_0x071f('0x15'));var logger=require(_0x071f('0x16'))(_0x071f('0x17'));var utils=require(_0x071f('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x071f('0x19'));var db=require(_0x071f('0x1a'))['db'];config[_0x071f('0x1b')]=_[_0x071f('0x1c')](config[_0x071f('0x1b')],{'host':_0x071f('0x1d'),'port':0x18eb});var socket=require(_0x071f('0x1e'))(new Redis(config[_0x071f('0x1b')]));require(_0x071f('0x1f'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x071f('0x20')][_0x071f('0x21')]({'port':0x232c});var client9002=jayson[_0x071f('0x20')][_0x071f('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x17b774,_0x22d6b3,_0x5e1e46,_0x316bb3){return new BPromise(function(_0xd9666e,_0x243cfd){var _0x2c5ae0=_0x316bb3||client;return _0x2c5ae0[_0x071f('0x22')](_0x17b774,_0x5e1e46)['then'](function(_0x2ea2e5){logger[_0x071f('0x23')]('ChatMessage,\x20%s,\x20%s',_0x22d6b3,_0x071f('0x24'));logger[_0x071f('0x25')](_0x071f('0x26'),_0x22d6b3,_0x071f('0x24'),JSON[_0x071f('0x27')](_0x2ea2e5));if(_0x2ea2e5[_0x071f('0x28')]){if(_0x2ea2e5[_0x071f('0x28')][_0x071f('0x29')]===0x1f4){logger[_0x071f('0x28')](_0x071f('0x2a'),_0x22d6b3,_0x2ea2e5[_0x071f('0x28')][_0x071f('0x2b')]);return _0x243cfd(_0x2ea2e5[_0x071f('0x28')][_0x071f('0x2b')]);}logger['error'](_0x071f('0x2a'),_0x22d6b3,_0x2ea2e5[_0x071f('0x28')][_0x071f('0x2b')]);return _0xd9666e(_0x2ea2e5[_0x071f('0x28')][_0x071f('0x2b')]);}else{logger[_0x071f('0x23')](_0x071f('0x2a'),_0x22d6b3,_0x071f('0x24'));_0xd9666e(_0x2ea2e5[_0x071f('0x2c')][_0x071f('0x2b')]);}})[_0x071f('0x2d')](function(_0x1e3c7a){logger[_0x071f('0x28')](_0x071f('0x2a'),_0x22d6b3,_0x1e3c7a);_0x243cfd(_0x1e3c7a);});});}function respondWithStatusCode(_0x4ccd32,_0xcbfa50){_0xcbfa50=_0xcbfa50||0xcc;return function(_0x80f249){if(_0x80f249){return _0x4ccd32[_0x071f('0x2e')](_0xcbfa50);}return _0x4ccd32['status'](_0xcbfa50)[_0x071f('0x2f')]();};}function respondWithResult(_0x4a87cb,_0x3de5d4){_0x3de5d4=_0x3de5d4||0xc8;return function(_0x13e1ff){if(_0x13e1ff){return _0x4a87cb[_0x071f('0x30')](_0x3de5d4)[_0x071f('0x31')](_0x13e1ff);}};}function respondWithFilteredResult(_0x3b9b20,_0x3a5002){return function(_0x1fb8f0){if(_0x1fb8f0){var _0x26fd6a=typeof _0x3a5002['offset']==='undefined'&&typeof _0x3a5002['limit']===_0x071f('0x32');var _0x2cdf90=_0x1fb8f0['count'];var _0x194186=_0x26fd6a?0x0:_0x3a5002['offset'];var _0x55bc65=_0x26fd6a?_0x1fb8f0[_0x071f('0x33')]:_0x3a5002['offset']+_0x3a5002[_0x071f('0x34')];var _0x55e6a3;if(_0x55bc65>=_0x2cdf90){_0x55bc65=_0x2cdf90;_0x55e6a3=0xc8;}else{_0x55e6a3=0xce;}_0x3b9b20['status'](_0x55e6a3);return _0x3b9b20[_0x071f('0x35')](_0x071f('0x36'),_0x194186+'-'+_0x55bc65+'/'+_0x2cdf90)['json'](_0x1fb8f0);}return null;};}function patchUpdates(_0x518b31){return function(_0x396af0){try{jsonpatch[_0x071f('0x37')](_0x396af0,_0x518b31,!![]);}catch(_0x2b08c0){return BPromise[_0x071f('0x38')](_0x2b08c0);}return _0x396af0['save']();};}function saveUpdates(_0x5282d0,_0x95220c){return function(_0x142942){if(_0x142942){return _0x142942[_0x071f('0x39')](_0x5282d0)[_0x071f('0x3a')](function(_0x2d9b1e){return _0x2d9b1e;});}return null;};}function removeEntity(_0x45e64a,_0x343731){return function(_0x49d205){if(_0x49d205){return _0x49d205[_0x071f('0x3b')]()[_0x071f('0x3a')](function(){_0x45e64a[_0x071f('0x30')](0xcc)[_0x071f('0x2f')]();});}};}function handleEntityNotFound(_0x1836a5,_0x4aab95){return function(_0x4ede58){if(!_0x4ede58){_0x1836a5['sendStatus'](0x194);}return _0x4ede58;};}function handleError(_0x454862,_0x1ecc6d){_0x1ecc6d=_0x1ecc6d||0x1f4;return function(_0x5d83ac){logger[_0x071f('0x28')](_0x5d83ac[_0x071f('0x3c')]);if(_0x5d83ac[_0x071f('0x3d')]){delete _0x5d83ac[_0x071f('0x3d')];}_0x454862[_0x071f('0x30')](_0x1ecc6d)['send'](_0x5d83ac);};}exports[_0x071f('0x3e')]=function(_0x1e0a0c,_0x4f8af6){var _0x226b32={},_0x49e778={},_0x4b32fa={'count':0x0,'rows':[]};var _0x98a675=_[_0x071f('0x3f')](db['ChatMessage'][_0x071f('0x40')],function(_0x203407){return{'name':_0x203407['fieldName'],'type':_0x203407['type'][_0x071f('0x41')]};});_0x49e778[_0x071f('0x42')]=_['map'](_0x98a675,_0x071f('0x3d'));_0x49e778[_0x071f('0x43')]=_[_0x071f('0x44')](_0x1e0a0c[_0x071f('0x43')]);_0x49e778['filters']=_[_0x071f('0x45')](_0x49e778[_0x071f('0x42')],_0x49e778['query']);_0x226b32[_0x071f('0x46')]=_['intersection'](_0x49e778[_0x071f('0x42')],qs['fields'](_0x1e0a0c['query'][_0x071f('0x47')]));_0x226b32[_0x071f('0x46')]=_0x226b32[_0x071f('0x46')]['length']?_0x226b32[_0x071f('0x46')]:_0x49e778['model'];if(!_0x1e0a0c[_0x071f('0x43')][_0x071f('0x48')](_0x071f('0x49'))){_0x226b32[_0x071f('0x34')]=qs[_0x071f('0x34')](_0x1e0a0c[_0x071f('0x43')][_0x071f('0x34')]);_0x226b32[_0x071f('0x4a')]=qs['offset'](_0x1e0a0c[_0x071f('0x43')][_0x071f('0x4a')]);}_0x226b32[_0x071f('0x4b')]=qs[_0x071f('0x4c')](_0x1e0a0c['query']['sort']);_0x226b32[_0x071f('0x4d')]=qs['filters'](_[_0x071f('0x4e')](_0x1e0a0c[_0x071f('0x43')],_0x49e778[_0x071f('0x4f')]),_0x98a675);if(_0x1e0a0c[_0x071f('0x43')][_0x071f('0x50')]){_0x226b32[_0x071f('0x4d')]=_[_0x071f('0x51')](_0x226b32[_0x071f('0x4d')],{'$or':_[_0x071f('0x3f')](_0x98a675,function(_0x44fcf2){if(_0x44fcf2[_0x071f('0x52')]!=='VIRTUAL'){var _0x352170={};_0x352170[_0x44fcf2[_0x071f('0x3d')]]={'$like':'%'+_0x1e0a0c[_0x071f('0x43')][_0x071f('0x50')]+'%'};return _0x352170;}})});}_0x226b32=_['merge']({},_0x226b32,_0x1e0a0c[_0x071f('0x53')]);var _0x3510fe={'where':_0x226b32[_0x071f('0x4d')]};return db[_0x071f('0x54')][_0x071f('0x33')](_0x3510fe)[_0x071f('0x3a')](function(_0x27498d){_0x4b32fa[_0x071f('0x33')]=_0x27498d;if(_0x1e0a0c[_0x071f('0x43')][_0x071f('0x55')]){_0x226b32['include']=[{'all':!![]}];}return db[_0x071f('0x54')][_0x071f('0x56')](_0x226b32);})[_0x071f('0x3a')](function(_0x5510d3){_0x4b32fa[_0x071f('0x57')]=_0x5510d3;return _0x4b32fa;})[_0x071f('0x3a')](respondWithFilteredResult(_0x4f8af6,_0x226b32))[_0x071f('0x2d')](handleError(_0x4f8af6,null));};exports['show']=function(_0x4eb554,_0x455d21){var _0x5cb3de={'raw':!![],'where':{'id':_0x4eb554['params']['id']}},_0x6b8300={};_0x6b8300[_0x071f('0x42')]=_[_0x071f('0x44')](db[_0x071f('0x54')][_0x071f('0x40')]);_0x6b8300[_0x071f('0x43')]=_[_0x071f('0x44')](_0x4eb554[_0x071f('0x43')]);_0x6b8300['filters']=_['intersection'](_0x6b8300[_0x071f('0x42')],_0x6b8300[_0x071f('0x43')]);_0x5cb3de[_0x071f('0x46')]=_[_0x071f('0x45')](_0x6b8300['model'],qs[_0x071f('0x47')](_0x4eb554['query'][_0x071f('0x47')]));_0x5cb3de[_0x071f('0x46')]=_0x5cb3de[_0x071f('0x46')][_0x071f('0x58')]?_0x5cb3de[_0x071f('0x46')]:_0x6b8300[_0x071f('0x42')];if(_0x4eb554[_0x071f('0x43')][_0x071f('0x55')]){_0x5cb3de[_0x071f('0x59')]=[{'all':!![]}];}_0x5cb3de=_[_0x071f('0x51')]({},_0x5cb3de,_0x4eb554[_0x071f('0x53')]);return db[_0x071f('0x54')][_0x071f('0x5a')](_0x5cb3de)['then'](handleEntityNotFound(_0x455d21,null))[_0x071f('0x3a')](respondWithResult(_0x455d21,null))['catch'](handleError(_0x455d21,null));};exports[_0x071f('0x5b')]=function(_0x2a577f,_0x2ef480){return db[_0x071f('0x54')][_0x071f('0x5b')](_0x2a577f[_0x071f('0x5c')],{})[_0x071f('0x3a')](respondWithResult(_0x2ef480,0xc9))[_0x071f('0x2d')](handleError(_0x2ef480,null));};exports[_0x071f('0x39')]=function(_0x3af541,_0x318396){if(_0x3af541[_0x071f('0x5c')]['id']){delete _0x3af541['body']['id'];}return db[_0x071f('0x54')][_0x071f('0x5a')]({'where':{'id':_0x3af541[_0x071f('0x5d')]['id']}})[_0x071f('0x3a')](handleEntityNotFound(_0x318396,null))['then'](saveUpdates(_0x3af541[_0x071f('0x5c')],null))[_0x071f('0x3a')](respondWithResult(_0x318396,null))[_0x071f('0x2d')](handleError(_0x318396,null));};exports[_0x071f('0x3b')]=function(_0x5b010c,_0x3a9b36){return db[_0x071f('0x54')]['find']({'where':{'id':_0x5b010c['params']['id']}})['then'](handleEntityNotFound(_0x3a9b36,null))[_0x071f('0x3a')](removeEntity(_0x3a9b36,null))['catch'](handleError(_0x3a9b36,null));};exports[_0x071f('0x5e')]=function(_0x33357c,_0x4cfd9e){return db[_0x071f('0x54')][_0x071f('0x5e')]()[_0x071f('0x3a')](respondWithResult(_0x4cfd9e,null))[_0x071f('0x2d')](handleError(_0x4cfd9e,null));};var interaction_log=require(_0x071f('0x16'))(_0x071f('0x5f'));exports[_0x071f('0x60')]=function(_0x1c29fe,_0x2a3f59,_0x4f16b7){var _0x47a668={'agent':{},'channel':'chat'};if(_0x1c29fe[_0x071f('0x5c')]['id']){delete _0x1c29fe['body']['id'];}_0x1c29fe['body']['read']=!![];_0x1c29fe[_0x071f('0x5c')][_0x071f('0x61')]=moment()[_0x071f('0x62')](_0x071f('0x63'));_0x1c29fe[_0x071f('0x5c')][_0x071f('0x64')]=_0x1c29fe[_0x071f('0x5c')][_0x071f('0x64')]||_0x1c29fe[_0x071f('0x65')]['id'];_0x47a668[_0x071f('0x66')]['id']=_0x1c29fe[_0x071f('0x5c')][_0x071f('0x64')];return db[_0x071f('0x54')][_0x071f('0x5a')]({'where':{'id':_0x1c29fe['params']['id'],'UserId':null}})[_0x071f('0x3a')](handleEntityNotFound(_0x2a3f59,null))[_0x071f('0x3a')](saveUpdates(_0x1c29fe[_0x071f('0x5c')],null))[_0x071f('0x3a')](function(_0x1a85c2){if(_0x1a85c2){_0x47a668['message']=_0x1a85c2[_0x071f('0x67')]({'plain':!![]});return db[_0x071f('0x68')][_0x071f('0x5a')]({'where':{'id':_0x1a85c2[_0x071f('0x69')]}});}return null;})[_0x071f('0x3a')](handleEntityNotFound(_0x2a3f59,null))['then'](function(_0x12c46c){if(_0x12c46c){return _0x12c46c['update']({'UserId':_0x1c29fe[_0x071f('0x5c')][_0x071f('0x64')],'read1stAt':_[_0x071f('0x6a')](_0x12c46c['read1stAt'])?moment()[_0x071f('0x62')](_0x071f('0x63')):undefined});}return null;})[_0x071f('0x3a')](function(_0x18146b){if(_0x18146b){_0x47a668[_0x071f('0x6b')]=_0x18146b[_0x071f('0x67')]({'plain':!![]});interaction_log['info'](_0x071f('0x6c'),_0x1c29fe['user']['id'],_0x1c29fe[_0x071f('0x65')][_0x071f('0x3d')],_0x1c29fe['user'][_0x071f('0x6d')],_0x47a668['interaction']['id'],_0x1c29fe[_0x071f('0x5c')]?JSON[_0x071f('0x27')](_0x1c29fe[_0x071f('0x5c')]):'null');return respondWithRpcPromise(_0x071f('0x6e'),_0x071f('0x6f'),_0x47a668);}return null;})['then'](function(_0x1f9f46){var _0x320cb6=_0x071f('0x70')+_0x1f9f46[_0x071f('0x2b')][_0x071f('0x71')];return db[_0x071f('0x72')]['query'](_0x320cb6,{'type':db[_0x071f('0x73')][_0x071f('0x74')][_0x071f('0x75')],'raw':!![]})[_0x071f('0x3a')](function(_0x172fdc){return _0x172fdc;});})['then'](function(_0x5517f3){if(_0x5517f3){_0x47a668[_0x071f('0x2b')][_0x071f('0x76')]=_0x5517f3[0x0];if(!_0x1c29fe['body'][_0x071f('0x64')])return;return db[_0x071f('0x77')][_0x071f('0x5a')]({'where':{'id':_0x1c29fe['body']['UserId'],'role':_0x071f('0x66')},'attributes':['id',_0x071f('0x3d'),_0x071f('0x78'),_0x071f('0x79'),_0x071f('0x7a')],'raw':!![]});}return null;})['then'](function(_0x2eff39){if(!_0x2eff39)return null;_0x47a668[_0x071f('0x2b')][_0x071f('0x66')]=_0x2eff39;return _0x47a668;})[_0x071f('0x3a')](function(_0x3dcc88){if(_0x3dcc88){if(_0x1c29fe['body']['manual']){_0x47a668[_0x071f('0x2b')]['interface']=util[_0x071f('0x62')](_0x071f('0x7b'),_0x1c29fe[_0x071f('0x65')][_0x071f('0x3d')]);_0x47a668[_0x071f('0x2b')][_0x071f('0x7c')]=_0x47a668['channel'];_0x47a668[_0x071f('0x2b')][_0x071f('0x7d')]=_0x47a668[_0x071f('0x7c')];_0x47a668[_0x071f('0x2b')][_0x071f('0x7e')]='accept';return respondWithRpcPromise(_0x071f('0x7f'),_0x071f('0x7f'),{'event':_0x071f('0x80'),'message':_[_0x071f('0x51')](_0x47a668[_0x071f('0x2b')],JSON[_0x071f('0x81')](_0x47a668[_0x071f('0x6b')][_0x071f('0x82')]))},client9002)[_0x071f('0x3a')](function(){return _0x47a668;});}return _0x47a668;}return null;})[_0x071f('0x3a')](respondWithResult(_0x2a3f59,null))[_0x071f('0x2d')](handleError(_0x2a3f59,null));};var interaction_log=require(_0x071f('0x16'))('chat-interactions');exports['reject']=function(_0x58c14e,_0x564455,_0x2b31c0){var _0x19b86e={'agent':{},'channel':'chat'};if(_0x58c14e['body']['id']){delete _0x58c14e[_0x071f('0x5c')]['id'];}_0x58c14e[_0x071f('0x5c')][_0x071f('0x64')]=_0x58c14e[_0x071f('0x5c')][_0x071f('0x64')]||_0x58c14e[_0x071f('0x65')]['id'];_0x19b86e[_0x071f('0x66')]['id']=_0x58c14e[_0x071f('0x5c')][_0x071f('0x64')];return db[_0x071f('0x54')][_0x071f('0x5a')]({'where':{'id':_0x58c14e[_0x071f('0x5d')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x564455,null))[_0x071f('0x3a')](function(_0x378d06){if(_0x378d06){_0x19b86e['message']=_0x378d06['get']({'plain':!![]});return db['ChatInteraction'][_0x071f('0x5a')]({'where':{'id':_0x378d06[_0x071f('0x69')]}});}return null;})['then'](handleEntityNotFound(_0x564455,null))['then'](function(_0x2e5eaa){if(_0x2e5eaa){_0x19b86e[_0x071f('0x6b')]=_0x2e5eaa[_0x071f('0x67')]({'plain':!![]});interaction_log[_0x071f('0x23')](_0x071f('0x83'),_0x58c14e[_0x071f('0x65')]['id'],_0x58c14e[_0x071f('0x65')]['name'],_0x58c14e[_0x071f('0x65')][_0x071f('0x6d')],_0x19b86e['interaction']['id'],_0x58c14e[_0x071f('0x5c')]?JSON[_0x071f('0x27')](_0x58c14e['body']):_0x071f('0x84'));return respondWithRpcPromise(_0x071f('0x85'),_0x071f('0x86'),_0x19b86e);}return null;})['then'](function(_0x1d828f){var _0x1a7978=_0x071f('0x70')+_0x1d828f[_0x071f('0x2b')][_0x071f('0x71')];return db[_0x071f('0x72')][_0x071f('0x43')](_0x1a7978,{'type':db[_0x071f('0x73')][_0x071f('0x74')][_0x071f('0x75')],'raw':!![]})[_0x071f('0x3a')](function(_0x2bf083){return _0x2bf083;});})[_0x071f('0x3a')](function(_0x23bdb1){if(_0x23bdb1){_0x19b86e[_0x071f('0x2b')][_0x071f('0x76')]=_0x23bdb1[0x0];if(!_0x58c14e['body'][_0x071f('0x64')])return;return db[_0x071f('0x77')]['find']({'where':{'id':_0x58c14e['body'][_0x071f('0x64')],'role':_0x071f('0x66')},'attributes':['id',_0x071f('0x3d'),_0x071f('0x78'),_0x071f('0x79'),_0x071f('0x7a')],'raw':!![]});}return null;})[_0x071f('0x3a')](function(_0x46e38b){if(!_0x46e38b)return null;_0x19b86e[_0x071f('0x2b')]['agent']=_0x46e38b;return _0x19b86e;})[_0x071f('0x3a')](function(_0x61eb){if(_0x61eb){_0x61eb[_0x071f('0x2b')][_0x071f('0x87')]=util['format'](_0x071f('0x7b'),_0x58c14e['user']['name']);_0x61eb[_0x071f('0x2b')][_0x071f('0x7c')]=_0x19b86e['channel'];_0x61eb[_0x071f('0x2b')][_0x071f('0x7d')]=_0x19b86e[_0x071f('0x7c')];_0x61eb[_0x071f('0x2b')][_0x071f('0x7e')]=_0x071f('0x38');respondWithRpcPromise('EventManager',_0x071f('0x7f'),{'event':_0x071f('0x88'),'message':_[_0x071f('0x51')](_0x19b86e[_0x071f('0x2b')],JSON[_0x071f('0x81')](_0x19b86e['interaction']['formData']))},client9002);return _0x19b86e;}return null;})[_0x071f('0x3a')](respondWithResult(_0x564455,null))[_0x071f('0x2d')](handleError(_0x564455,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 2a7d3fd..acbd25d 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 _0x9a8a=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','update','remove','emit'];(function(_0x59659b,_0x38a9a7){var _0x5db166=function(_0x2f6c4c){while(--_0x2f6c4c){_0x59659b['push'](_0x59659b['shift']());}};_0x5db166(++_0x38a9a7);}(_0x9a8a,0x161));var _0xa9a8=function(_0x509fa6,_0x47a80d){_0x509fa6=_0x509fa6-0x0;var _0x42b0aa=_0x9a8a[_0x509fa6];return _0x42b0aa;};'use strict';var EventEmitter=require(_0xa9a8('0x0'));var ChatMessage=require(_0xa9a8('0x1'))['db'][_0xa9a8('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xa9a8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa9a8('0x4'),'afterDestroy':_0xa9a8('0x5')};function emitEvent(_0x353be4){return function(_0x141aa5,_0x21acea,_0x41aab3){ChatMessageEvents[_0xa9a8('0x6')](_0x353be4+':'+_0x141aa5['id'],_0x141aa5);ChatMessageEvents['emit'](_0x353be4,_0x141aa5);_0x41aab3(null);};}for(var e in events){if(events[_0xa9a8('0x7')](e)){var event=events[e];ChatMessage[_0xa9a8('0x8')](e,emitEvent(event));}}module[_0xa9a8('0x9')]=ChatMessageEvents;
\ No newline at end of file
+var _0xdc7c=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','ChatMessage'];(function(_0x179316,_0x300ac9){var _0x5f2c95=function(_0x190e96){while(--_0x190e96){_0x179316['push'](_0x179316['shift']());}};_0x5f2c95(++_0x300ac9);}(_0xdc7c,0x1ef));var _0xcdc7=function(_0x5ab00a,_0x507b0c){_0x5ab00a=_0x5ab00a-0x0;var _0x3fa341=_0xdc7c[_0x5ab00a];return _0x3fa341;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xcdc7('0x0'))['db'][_0xcdc7('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xcdc7('0x2'),'afterDestroy':_0xcdc7('0x3')};function emitEvent(_0x2f5d83){return function(_0x2113bc,_0x562c2d,_0x98525b){ChatMessageEvents[_0xcdc7('0x4')](_0x2f5d83+':'+_0x2113bc['id'],_0x2113bc);ChatMessageEvents[_0xcdc7('0x4')](_0x2f5d83,_0x2113bc);_0x98525b(null);};}for(var e in events){if(events[_0xcdc7('0x5')](e)){var event=events[e];ChatMessage[_0xcdc7('0x6')](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 32743ec..9702d31 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 _0x3116=['exports','define','chat_messages','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','ChatInteractionId','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./chatMessage.attributes'];(function(_0xec034,_0x16c358){var _0x2c5a19=function(_0xec401c){while(--_0xec401c){_0xec034['push'](_0xec034['shift']());}};_0x2c5a19(++_0x16c358);}(_0x3116,0x165));var _0x6311=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x3116[_0x1d9aa0];return _0x226868;};'use strict';var _=require('lodash');var util=require(_0x6311('0x0'));var logger=require(_0x6311('0x1'))('api');var moment=require(_0x6311('0x2'));var BPromise=require(_0x6311('0x3'));var rp=require(_0x6311('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6311('0x5'));var attributes=require(_0x6311('0x6'));module[_0x6311('0x7')]=function(_0x507964,_0xa3dbdf){return _0x507964[_0x6311('0x8')]('ChatMessage',attributes,{'tableName':_0x6311('0x9'),'paranoid':![],'indexes':[{'name':_0x6311('0xa'),'fields':[_0x6311('0xb')],'type':_0x6311('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xb43df3,_0x4fa064,_0x2614f1){var _0x149d4a=_0x507964[_0x6311('0xd')];var _0x2ad612=_0xb43df3['get']({'plain':!![]});if(_0x2ad612[_0x6311('0xe')][_0x6311('0xf')]()==='in'||_0x2ad612[_0x6311('0xe')][_0x6311('0xf')]()==='out'&&!_0x2ad612[_0x6311('0x10')]&&!_[_0x6311('0x11')](_0x2ad612[_0x6311('0x12')])){_0x149d4a[_0x6311('0x13')]['findOne']({'where':{'id':_0x2ad612[_0x6311('0x14')]}})['then'](function(_0x161bd5){if(_0x161bd5){_0x161bd5['update']({'lastMsgAt':_0x2ad612[_0x6311('0x15')],'lastMsgDirection':_0x2ad612[_0x6311('0xe')][_0x6311('0xf')]()});}})[_0x6311('0x16')](function(_0x428a05){console[_0x6311('0x17')](_0x428a05);});}_0x2614f1();}},'charset':_0x6311('0x18'),'collate':_0x6311('0x19')});};
\ No newline at end of file
+var _0xfd4f=['secret','isNil','UserId','findOne','ChatInteractionId','then','update','createdAt','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','body','models','get','direction','toLowerCase','out'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0xfd4f,0x133));var _0xffd4=function(_0x44c0eb,_0x5998da){_0x44c0eb=_0x44c0eb-0x0;var _0x47350b=_0xfd4f[_0x44c0eb];return _0x47350b;};'use strict';var _=require(_0xffd4('0x0'));var util=require(_0xffd4('0x1'));var logger=require(_0xffd4('0x2'))('api');var moment=require('moment');var BPromise=require(_0xffd4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xffd4('0x4'));var rimraf=require(_0xffd4('0x5'));var config=require(_0xffd4('0x6'));var attributes=require(_0xffd4('0x7'));module['exports']=function(_0x4c35e1,_0x677b40){return _0x4c35e1[_0xffd4('0x8')](_0xffd4('0x9'),attributes,{'tableName':_0xffd4('0xa'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xffd4('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4c4341,_0x5c0463,_0x22f5a7){var _0xdd8ae0=_0x4c35e1[_0xffd4('0xc')];var _0xe7d6d4=_0x4c4341[_0xffd4('0xd')]({'plain':!![]});if(_0xe7d6d4[_0xffd4('0xe')][_0xffd4('0xf')]()==='in'||_0xe7d6d4[_0xffd4('0xe')][_0xffd4('0xf')]()===_0xffd4('0x10')&&!_0xe7d6d4[_0xffd4('0x11')]&&!_[_0xffd4('0x12')](_0xe7d6d4[_0xffd4('0x13')])){_0xdd8ae0['ChatInteraction'][_0xffd4('0x14')]({'where':{'id':_0xe7d6d4[_0xffd4('0x15')]}})[_0xffd4('0x16')](function(_0x92b7cd){if(_0x92b7cd){_0x92b7cd[_0xffd4('0x17')]({'lastMsgAt':_0xe7d6d4[_0xffd4('0x18')],'lastMsgDirection':_0xe7d6d4[_0xffd4('0xe')][_0xffd4('0xf')]()});}})['catch'](function(_0x9863da){console[_0xffd4('0x19')](_0x9863da);});}_0x22f5a7();}},'charset':'utf8mb4','collate':_0xffd4('0x1a')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index a328558..d04ca87 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 _0x2071=['CreateChatMessage','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ChatMessage','create','body','options','raw'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x2071,0xb1));var _0x1207=function(_0x45ac0c,_0x2f8a58){_0x45ac0c=_0x45ac0c-0x0;var _0x4b4074=_0x2071[_0x45ac0c];return _0x4b4074;};'use strict';var _=require(_0x1207('0x0'));var util=require(_0x1207('0x1'));var moment=require(_0x1207('0x2'));var BPromise=require('bluebird');var rs=require(_0x1207('0x3'));var fs=require('fs');var Redis=require(_0x1207('0x4'));var db=require(_0x1207('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1207('0x6'))(_0x1207('0x7'));var config=require(_0x1207('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1207('0x9')][_0x1207('0xa')]({'port':0x232a});config[_0x1207('0xb')]=_['defaults'](config[_0x1207('0xb')],{'host':_0x1207('0xc'),'port':0x18eb});var socket=require(_0x1207('0xd'))(new Redis(config[_0x1207('0xb')]));require(_0x1207('0xe'))[_0x1207('0xf')](socket);function respondWithRpcPromise(_0x5ceb02,_0x31e4e6,_0x1c6b7d){return new BPromise(function(_0x77196f,_0x57465e){return client[_0x1207('0x10')](_0x5ceb02,_0x1c6b7d)[_0x1207('0x11')](function(_0x1923fc){logger[_0x1207('0x12')](_0x1207('0x13'),_0x31e4e6,_0x1207('0x14'));logger[_0x1207('0x15')](_0x1207('0x16'),_0x31e4e6,_0x1207('0x14'),JSON[_0x1207('0x17')](_0x1923fc));if(_0x1923fc[_0x1207('0x18')]){if(_0x1923fc[_0x1207('0x18')][_0x1207('0x19')]===0x1f4){logger[_0x1207('0x18')](_0x1207('0x13'),_0x31e4e6,_0x1923fc['error'][_0x1207('0x1a')]);return _0x57465e(_0x1923fc['error'][_0x1207('0x1a')]);}logger['error'](_0x1207('0x13'),_0x31e4e6,_0x1923fc['error'][_0x1207('0x1a')]);return _0x77196f(_0x1923fc['error'][_0x1207('0x1a')]);}else{logger[_0x1207('0x12')]('ChatMessage,\x20%s,\x20%s',_0x31e4e6,_0x1207('0x14'));_0x77196f(_0x1923fc[_0x1207('0x1b')][_0x1207('0x1a')]);}})['catch'](function(_0x307222){logger[_0x1207('0x18')]('ChatMessage,\x20%s,\x20%s',_0x31e4e6,_0x307222);_0x57465e(_0x307222);});});}exports['CreateChatMessage']=function(_0xf18695){var _0x3866fd=this;return new Promise(function(_0x30b32a,_0x4f5fcf){return db[_0x1207('0x1c')][_0x1207('0x1d')](_0xf18695[_0x1207('0x1e')],{'raw':_0xf18695[_0x1207('0x1f')]?_0xf18695[_0x1207('0x1f')][_0x1207('0x20')]===undefined?!![]:![]:!![]})[_0x1207('0x11')](function(_0x372c36){logger[_0x1207('0x12')](_0x1207('0x21'),_0xf18695);logger[_0x1207('0x15')]('CreateChatMessage',_0xf18695,JSON[_0x1207('0x17')](_0x372c36));_0x30b32a(_0x372c36);})[_0x1207('0x22')](function(_0x503f08){logger[_0x1207('0x18')](_0x1207('0x21'),_0x503f08['message'],_0xf18695);_0x4f5fcf(_0x3866fd[_0x1207('0x18')](0x1f4,_0x503f08[_0x1207('0x1a')]));});});};
\ No newline at end of file
+var _0xd26a=['error','code','message','CreateChatMessage','ChatMessage','options','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x48381d,_0x4ee067){var _0x1431d3=function(_0x492d96){while(--_0x492d96){_0x48381d['push'](_0x48381d['shift']());}};_0x1431d3(++_0x4ee067);}(_0xd26a,0x17b));var _0xad26=function(_0x21f475,_0x3597aa){_0x21f475=_0x21f475-0x0;var _0x543e1a=_0xd26a[_0x21f475];return _0x543e1a;};'use strict';var _=require(_0xad26('0x0'));var util=require(_0xad26('0x1'));var moment=require(_0xad26('0x2'));var BPromise=require('bluebird');var rs=require(_0xad26('0x3'));var fs=require('fs');var Redis=require(_0xad26('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xad26('0x5'));var logger=require(_0xad26('0x6'))('rpc');var config=require(_0xad26('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xad26('0x8')][_0xad26('0x9')]({'port':0x232a});config[_0xad26('0xa')]=_[_0xad26('0xb')](config[_0xad26('0xa')],{'host':_0xad26('0xc'),'port':0x18eb});var socket=require(_0xad26('0xd'))(new Redis(config[_0xad26('0xa')]));require(_0xad26('0xe'))[_0xad26('0xf')](socket);function respondWithRpcPromise(_0x2d2b6a,_0x35deeb,_0x387f73){return new BPromise(function(_0x5b18f9,_0x541b7e){return client[_0xad26('0x10')](_0x2d2b6a,_0x387f73)[_0xad26('0x11')](function(_0x4cc39d){logger[_0xad26('0x12')](_0xad26('0x13'),_0x35deeb,_0xad26('0x14'));logger[_0xad26('0x15')](_0xad26('0x16'),_0x35deeb,_0xad26('0x14'),JSON[_0xad26('0x17')](_0x4cc39d));if(_0x4cc39d[_0xad26('0x18')]){if(_0x4cc39d[_0xad26('0x18')][_0xad26('0x19')]===0x1f4){logger[_0xad26('0x18')](_0xad26('0x13'),_0x35deeb,_0x4cc39d[_0xad26('0x18')][_0xad26('0x1a')]);return _0x541b7e(_0x4cc39d['error']['message']);}logger['error'](_0xad26('0x13'),_0x35deeb,_0x4cc39d[_0xad26('0x18')][_0xad26('0x1a')]);return _0x5b18f9(_0x4cc39d[_0xad26('0x18')][_0xad26('0x1a')]);}else{logger['info'](_0xad26('0x13'),_0x35deeb,_0xad26('0x14'));_0x5b18f9(_0x4cc39d['result'][_0xad26('0x1a')]);}})['catch'](function(_0x1e3796){logger[_0xad26('0x18')]('ChatMessage,\x20%s,\x20%s',_0x35deeb,_0x1e3796);_0x541b7e(_0x1e3796);});});}exports[_0xad26('0x1b')]=function(_0x987a66){var _0x22a4ea=this;return new Promise(function(_0x25cbbc,_0x1e4e76){return db[_0xad26('0x1c')]['create'](_0x987a66['body'],{'raw':_0x987a66[_0xad26('0x1d')]?_0x987a66[_0xad26('0x1d')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x550191){logger[_0xad26('0x12')](_0xad26('0x1b'),_0x987a66);logger[_0xad26('0x15')](_0xad26('0x1b'),_0x987a66,JSON[_0xad26('0x17')](_0x550191));_0x25cbbc(_0x550191);})[_0xad26('0x1e')](function(_0x5461e4){logger['error'](_0xad26('0x1b'),_0x5461e4[_0xad26('0x1a')],_0x987a66);_0x1e4e76(_0x22a4ea[_0xad26('0x18')](0x1f4,_0x5461e4['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 4873d2a..83523bb 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 _0x26d1=['update','removeListener','register','chatMessage:','./chatMessage.events','remove'];(function(_0x2cdd2f,_0xbd47c1){var _0x42c66b=function(_0x722080){while(--_0x722080){_0x2cdd2f['push'](_0x2cdd2f['shift']());}};_0x42c66b(++_0xbd47c1);}(_0x26d1,0x8e));var _0x126d=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x26d1[_0x3e5086];return _0xfeb102;};'use strict';var ChatMessageEvents=require(_0x126d('0x0'));var events=['save',_0x126d('0x1'),_0x126d('0x2')];function createListener(_0x37ff4c,_0x2a20fc){return function(_0x59d0a0){_0x2a20fc['emit'](_0x37ff4c,_0x59d0a0);};}function removeListener(_0x3a3fb4,_0x48016e){return function(){ChatMessageEvents[_0x126d('0x3')](_0x3a3fb4,_0x48016e);};}exports[_0x126d('0x4')]=function(_0x442e04){for(var _0x449ed0=0x0,_0x2b4dfc=events['length'];_0x449ed0<_0x2b4dfc;_0x449ed0++){var _0x2e668c=events[_0x449ed0];var _0x25ccc2=createListener(_0x126d('0x5')+_0x2e668c,_0x442e04);ChatMessageEvents['on'](_0x2e668c,_0x25ccc2);}};
\ No newline at end of file
+var _0x0e17=['remove','update','emit','removeListener','register','length','chatMessage:','./chatMessage.events','save'];(function(_0xfdddcf,_0x2dbc28){var _0x140ca1=function(_0x3e23a8){while(--_0x3e23a8){_0xfdddcf['push'](_0xfdddcf['shift']());}};_0x140ca1(++_0x2dbc28);}(_0x0e17,0xd6));var _0x70e1=function(_0x34f8cd,_0x105631){_0x34f8cd=_0x34f8cd-0x0;var _0x254197=_0x0e17[_0x34f8cd];return _0x254197;};'use strict';var ChatMessageEvents=require(_0x70e1('0x0'));var events=[_0x70e1('0x1'),_0x70e1('0x2'),_0x70e1('0x3')];function createListener(_0x35862c,_0x45b94b){return function(_0x9289d7){_0x45b94b[_0x70e1('0x4')](_0x35862c,_0x9289d7);};}function removeListener(_0x406801,_0x2c62b8){return function(){ChatMessageEvents[_0x70e1('0x5')](_0x406801,_0x2c62b8);};}exports[_0x70e1('0x6')]=function(_0x4cb0b1){for(var _0xc64213=0x0,_0x16a2ad=events[_0x70e1('0x7')];_0xc64213<_0x16a2ad;_0xc64213++){var _0x27f310=events[_0xc64213];var _0x26218a=createListener(_0x70e1('0x8')+_0x27f310,_0x4cb0b1);ChatMessageEvents['on'](_0x27f310,_0x26218a);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 990413d..fd0efe4 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 _0x1f7c=['show','post','chat','chatmessage:create','create','put','accept','/:id/reject','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id'];(function(_0x48adc5,_0x248aa0){var _0x4e758d=function(_0x4f7075){while(--_0x4f7075){_0x48adc5['push'](_0x48adc5['shift']());}};_0x4e758d(++_0x248aa0);}(_0x1f7c,0x94));var _0xc1f7=function(_0x4eafed,_0x26e2bc){_0x4eafed=_0x4eafed-0x0;var _0x159c85=_0x1f7c[_0x4eafed];return _0x159c85;};'use strict';var multer=require(_0xc1f7('0x0'));var util=require(_0xc1f7('0x1'));var path=require(_0xc1f7('0x2'));var timeout=require(_0xc1f7('0x3'));var express=require('express');var router=express[_0xc1f7('0x4')]();var fs_extra=require(_0xc1f7('0x5'));var auth=require(_0xc1f7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc1f7('0x7'));var controller=require('./chatMessage.controller');router[_0xc1f7('0x8')]('/',auth[_0xc1f7('0x9')](),controller[_0xc1f7('0xa')]);router[_0xc1f7('0x8')](_0xc1f7('0xb'),auth[_0xc1f7('0x9')](),controller['describe']);router[_0xc1f7('0x8')](_0xc1f7('0xc'),auth[_0xc1f7('0x9')](),controller[_0xc1f7('0xd')]);router[_0xc1f7('0xe')]('/',auth['isAuthenticated'](),interaction['tracked'](_0xc1f7('0xf'),_0xc1f7('0x10')),controller[_0xc1f7('0x11')]);router[_0xc1f7('0x12')](_0xc1f7('0xc'),controller['update']);router[_0xc1f7('0x12')]('/:id/accept',auth[_0xc1f7('0x9')](),controller[_0xc1f7('0x13')]);router[_0xc1f7('0x12')](_0xc1f7('0x14'),auth[_0xc1f7('0x9')](),controller['reject']);router[_0xc1f7('0x15')](_0xc1f7('0xc'),auth[_0xc1f7('0x9')](),controller[_0xc1f7('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0xa85a=['destroy','exports','multer','path','fs-extra','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete'];(function(_0x5cf058,_0x1a53f2){var _0x2dd6a0=function(_0x19a60d){while(--_0x19a60d){_0x5cf058['push'](_0x5cf058['shift']());}};_0x2dd6a0(++_0x1a53f2);}(_0xa85a,0x106));var _0xaa85=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xa85a[_0x5f1391];return _0x50ebe3;};'use strict';var multer=require(_0xaa85('0x0'));var util=require('util');var path=require(_0xaa85('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xaa85('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xaa85('0x3'));var config=require('../../config/environment');var controller=require(_0xaa85('0x4'));router[_0xaa85('0x5')]('/',auth[_0xaa85('0x6')](),controller[_0xaa85('0x7')]);router[_0xaa85('0x5')](_0xaa85('0x8'),auth['isAuthenticated'](),controller[_0xaa85('0x9')]);router[_0xaa85('0x5')](_0xaa85('0xa'),auth['isAuthenticated'](),controller[_0xaa85('0xb')]);router[_0xaa85('0xc')]('/',auth['isAuthenticated'](),interaction[_0xaa85('0xd')](_0xaa85('0xe'),_0xaa85('0xf')),controller[_0xaa85('0x10')]);router[_0xaa85('0x11')](_0xaa85('0xa'),controller[_0xaa85('0x12')]);router['put'](_0xaa85('0x13'),auth[_0xaa85('0x6')](),controller[_0xaa85('0x14')]);router[_0xaa85('0x11')](_0xaa85('0x15'),auth[_0xaa85('0x6')](),controller[_0xaa85('0x16')]);router[_0xaa85('0x17')](_0xaa85('0xa'),auth[_0xaa85('0x6')](),controller[_0xaa85('0x18')]);module[_0xaa85('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 95f3829..ce3d0be 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f66=['medium','TEXT','exports'];(function(_0x2dbb34,_0x242ce4){var _0x27af07=function(_0x4f2d42){while(--_0x4f2d42){_0x2dbb34['push'](_0x2dbb34['shift']());}};_0x27af07(++_0x242ce4);}(_0x5f66,0x1a0));var _0x65f6=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x5f66[_0xefd519];return _0x4bb882;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}};
\ No newline at end of file
+var _0xb10b=['medium','sequelize','TEXT'];(function(_0x35ea98,_0x190031){var _0x397916=function(_0x1857a8){while(--_0x1857a8){_0x35ea98['push'](_0x35ea98['shift']());}};_0x397916(++_0x190031);}(_0xb10b,0x12a));var _0xbb10=function(_0x27fedb,_0x31c693){_0x27fedb=_0x27fedb-0x0;var _0x58ab78=_0xb10b[_0x27fedb];return _0x58ab78;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index ce76243..c5bb9c3 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(_0x5020e5,_0x2a7658){var _0x531ea0=function(_0x43890d){while(--_0x43890d){_0x5020e5['push'](_0x5020e5['shift']());}};_0x531ea0(++_0x2a7658);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x7a54,0x106));var _0x47a5=function(_0x23c580,_0x1bc18f){_0x23c580=_0x23c580-0x0;var _0x41ea88=_0x7a54[_0x23c580];return _0x41ea88;};'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 2db56fa..cb7d7ae 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 _0x7484=['save','remove','emit','hasOwnProperty','../../mysqldb','ChatOfflineMessage','setMaxListeners'];(function(_0x4e4af2,_0x2ba40f){var _0x138886=function(_0x1b7c9c){while(--_0x1b7c9c){_0x4e4af2['push'](_0x4e4af2['shift']());}};_0x138886(++_0x2ba40f);}(_0x7484,0x90));var _0x4748=function(_0x30fc71,_0x4ecc37){_0x30fc71=_0x30fc71-0x0;var _0x343efa=_0x7484[_0x30fc71];return _0x343efa;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x4748('0x0'))['db'][_0x4748('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x4748('0x2')](0x0);var events={'afterCreate':_0x4748('0x3'),'afterUpdate':'update','afterDestroy':_0x4748('0x4')};function emitEvent(_0x20966b){return function(_0x2014d9,_0x2da04d,_0x2aecae){ChatOfflineMessageEvents[_0x4748('0x5')](_0x20966b+':'+_0x2014d9['id'],_0x2014d9);ChatOfflineMessageEvents['emit'](_0x20966b,_0x2014d9);_0x2aecae(null);};}for(var e in events){if(events[_0x4748('0x6')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xca4a=['update','remove','emit','hasOwnProperty','hook','exports','events','ChatOfflineMessage','setMaxListeners','save'];(function(_0x55f0e4,_0x1cc25d){var _0x294646=function(_0x1560ce){while(--_0x1560ce){_0x55f0e4['push'](_0x55f0e4['shift']());}};_0x294646(++_0x1cc25d);}(_0xca4a,0xa6));var _0xaca4=function(_0x1feaff,_0x2be57f){_0x1feaff=_0x1feaff-0x0;var _0x4f4187=_0xca4a[_0x1feaff];return _0x4f4187;};'use strict';var EventEmitter=require(_0xaca4('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0xaca4('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xaca4('0x2')](0x0);var events={'afterCreate':_0xaca4('0x3'),'afterUpdate':_0xaca4('0x4'),'afterDestroy':_0xaca4('0x5')};function emitEvent(_0x65db10){return function(_0x2b9ccf,_0x2b2690,_0x5deac2){ChatOfflineMessageEvents['emit'](_0x65db10+':'+_0x2b9ccf['id'],_0x2b9ccf);ChatOfflineMessageEvents[_0xaca4('0x6')](_0x65db10,_0x2b9ccf);_0x5deac2(null);};}for(var e in events){if(events[_0xaca4('0x7')](e)){var event=events[e];ChatOfflineMessage[_0xaca4('0x8')](e,emitEvent(event));}}module[_0xaca4('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 1f78278..66467f0 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 _0xd954=['ChatOfflineMessage','chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes','exports','define'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xd954,0x1e3));var _0x4d95=function(_0x482913,_0x38462a){_0x482913=_0x482913-0x0;var _0x49f170=_0xd954[_0x482913];return _0x49f170;};'use strict';var attributes=require(_0x4d95('0x0'));module[_0x4d95('0x1')]=function(_0x1efc99){return _0x1efc99[_0x4d95('0x2')](_0x4d95('0x3'),attributes,{'tableName':_0x4d95('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4d95('0x5'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xca2d=['utf8mb4','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xca2d,0x65));var _0xdca2=function(_0x1aa049,_0x9ae13c){_0x1aa049=_0x1aa049-0x0;var _0x357f29=_0xca2d[_0x1aa049];return _0x357f29;};'use strict';var attributes=require(_0xdca2('0x0'));module[_0xdca2('0x1')]=function(_0x210c76){return _0x210c76[_0xdca2('0x2')](_0xdca2('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdca2('0x4'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 31e77b4..bb39e8b 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 _0xcd1b=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','request','then','request\x20sent','debug','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','info','result','catch','lodash'];(function(_0x1a2552,_0xc7af2b){var _0x3304d7=function(_0x56a48b){while(--_0x56a48b){_0x1a2552['push'](_0x1a2552['shift']());}};_0x3304d7(++_0xc7af2b);}(_0xcd1b,0x18e));var _0xbcd1=function(_0x374563,_0x37ac1f){_0x374563=_0x374563-0x0;var _0x7b151b=_0xcd1b[_0x374563];return _0x7b151b;};'use strict';var _=require(_0xbcd1('0x0'));var util=require(_0xbcd1('0x1'));var moment=require('moment');var BPromise=require(_0xbcd1('0x2'));var rs=require(_0xbcd1('0x3'));var fs=require('fs');var Redis=require(_0xbcd1('0x4'));var db=require(_0xbcd1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbcd1('0x6'))(_0xbcd1('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbcd1('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x187ec1,_0x46d5f8,_0x26f7e5){return new BPromise(function(_0x19d0da,_0x76c75c){return client[_0xbcd1('0x9')](_0x187ec1,_0x26f7e5)[_0xbcd1('0xa')](function(_0x579920){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x46d5f8,_0xbcd1('0xb'));logger[_0xbcd1('0xc')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x46d5f8,_0xbcd1('0xb'),JSON[_0xbcd1('0xd')](_0x579920));if(_0x579920[_0xbcd1('0xe')]){if(_0x579920[_0xbcd1('0xe')][_0xbcd1('0xf')]===0x1f4){logger['error'](_0xbcd1('0x10'),_0x46d5f8,_0x579920[_0xbcd1('0xe')][_0xbcd1('0x11')]);return _0x76c75c(_0x579920[_0xbcd1('0xe')]['message']);}logger[_0xbcd1('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x46d5f8,_0x579920[_0xbcd1('0xe')][_0xbcd1('0x11')]);return _0x19d0da(_0x579920[_0xbcd1('0xe')]['message']);}else{logger[_0xbcd1('0x12')](_0xbcd1('0x10'),_0x46d5f8,'request\x20sent');_0x19d0da(_0x579920[_0xbcd1('0x13')][_0xbcd1('0x11')]);}})[_0xbcd1('0x14')](function(_0x5411c2){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x46d5f8,_0x5411c2);_0x76c75c(_0x5411c2);});});}
\ No newline at end of file
+var _0xea31=['stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s'];(function(_0x29fcf7,_0x1c511d){var _0x2d2510=function(_0xa45e3c){while(--_0xa45e3c){_0x29fcf7['push'](_0x29fcf7['shift']());}};_0x2d2510(++_0x1c511d);}(_0xea31,0x6b));var _0x1ea3=function(_0x3eb931,_0x759a03){_0x3eb931=_0x3eb931-0x0;var _0x5770d0=_0xea31[_0x3eb931];return _0x5770d0;};'use strict';var _=require(_0x1ea3('0x0'));var util=require('util');var moment=require(_0x1ea3('0x1'));var BPromise=require(_0x1ea3('0x2'));var rs=require(_0x1ea3('0x3'));var fs=require('fs');var Redis=require(_0x1ea3('0x4'));var db=require(_0x1ea3('0x5'))['db'];var utils=require(_0x1ea3('0x6'));var logger=require(_0x1ea3('0x7'))('rpc');var config=require(_0x1ea3('0x8'));var jayson=require(_0x1ea3('0x9'));var client=jayson[_0x1ea3('0xa')][_0x1ea3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13e6fb,_0x4c8f83,_0x1fa3a8){return new BPromise(function(_0x1b578e,_0x30a6db){return client[_0x1ea3('0xc')](_0x13e6fb,_0x1fa3a8)[_0x1ea3('0xd')](function(_0x2ff19a){logger['info'](_0x1ea3('0xe'),_0x4c8f83,_0x1ea3('0xf'));logger[_0x1ea3('0x10')](_0x1ea3('0x11'),_0x4c8f83,_0x1ea3('0xf'),JSON[_0x1ea3('0x12')](_0x2ff19a));if(_0x2ff19a[_0x1ea3('0x13')]){if(_0x2ff19a['error'][_0x1ea3('0x14')]===0x1f4){logger['error'](_0x1ea3('0xe'),_0x4c8f83,_0x2ff19a[_0x1ea3('0x13')][_0x1ea3('0x15')]);return _0x30a6db(_0x2ff19a['error'][_0x1ea3('0x15')]);}logger[_0x1ea3('0x13')](_0x1ea3('0xe'),_0x4c8f83,_0x2ff19a['error'][_0x1ea3('0x15')]);return _0x1b578e(_0x2ff19a[_0x1ea3('0x13')][_0x1ea3('0x15')]);}else{logger[_0x1ea3('0x16')](_0x1ea3('0xe'),_0x4c8f83,_0x1ea3('0xf'));_0x1b578e(_0x2ff19a[_0x1ea3('0x17')]['message']);}})[_0x1ea3('0x18')](function(_0x199728){logger[_0x1ea3('0x13')](_0x1ea3('0xe'),_0x4c8f83,_0x199728);_0x30a6db(_0x199728);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 525dc5f..4728182 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 _0xc634=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get'];(function(_0xecdc9,_0x1bd008){var _0x2a91c1=function(_0x3036dd){while(--_0x3036dd){_0xecdc9['push'](_0xecdc9['shift']());}};_0x2a91c1(++_0x1bd008);}(_0xc634,0x171));var _0x4c63=function(_0x14022a,_0x4ca101){_0x14022a=_0x14022a-0x0;var _0x12b439=_0xc634[_0x14022a];return _0x12b439;};'use strict';var multer=require(_0x4c63('0x0'));var util=require(_0x4c63('0x1'));var path=require(_0x4c63('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x4c63('0x3'));var auth=require(_0x4c63('0x4'));var interaction=require(_0x4c63('0x5'));var config=require(_0x4c63('0x6'));var controller=require(_0x4c63('0x7'));router[_0x4c63('0x8')]('/',auth[_0x4c63('0x9')](),controller[_0x4c63('0xa')]);router[_0x4c63('0x8')](_0x4c63('0xb'),auth[_0x4c63('0x9')](),controller[_0x4c63('0xc')]);router[_0x4c63('0x8')](_0x4c63('0xd'),auth[_0x4c63('0x9')](),controller[_0x4c63('0xe')]);router[_0x4c63('0xf')]('/',auth[_0x4c63('0x9')](),controller[_0x4c63('0x10')]);router[_0x4c63('0x11')](_0x4c63('0xd'),auth[_0x4c63('0x9')](),controller[_0x4c63('0x12')]);router[_0x4c63('0x13')](_0x4c63('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x4c63('0x14')]=router;
\ No newline at end of file
+var _0x7781=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x2ebd8a,_0x124a3d){var _0x2a7bdf=function(_0x2c96ac){while(--_0x2c96ac){_0x2ebd8a['push'](_0x2ebd8a['shift']());}};_0x2a7bdf(++_0x124a3d);}(_0x7781,0x10f));var _0x1778=function(_0x42ecef,_0x1712cc){_0x42ecef=_0x42ecef-0x0;var _0x5cd8e2=_0x7781[_0x42ecef];return _0x5cd8e2;};'use strict';var multer=require('multer');var util=require(_0x1778('0x0'));var path=require(_0x1778('0x1'));var timeout=require(_0x1778('0x2'));var express=require(_0x1778('0x3'));var router=express[_0x1778('0x4')]();var fs_extra=require(_0x1778('0x5'));var auth=require(_0x1778('0x6'));var interaction=require(_0x1778('0x7'));var config=require(_0x1778('0x8'));var controller=require(_0x1778('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x1778('0xa')](_0x1778('0xb'),auth[_0x1778('0xc')](),controller[_0x1778('0xd')]);router[_0x1778('0xa')](_0x1778('0xe'),auth[_0x1778('0xc')](),controller[_0x1778('0xf')]);router[_0x1778('0x10')]('/',auth[_0x1778('0xc')](),controller[_0x1778('0x11')]);router[_0x1778('0x12')](_0x1778('0xe'),auth[_0x1778('0xc')](),controller[_0x1778('0x13')]);router[_0x1778('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x1778('0x15')]);module[_0x1778('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index c4a5461..f7e01a9 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 _0x5848=['exports','STRING','ENUM','mouseOver','timeout','INTEGER','sequelize'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x5848,0x1cd));var _0x8584=function(_0x59010d,_0x2ef76a){_0x59010d=_0x59010d-0x0;var _0x5b9bf8=_0x5848[_0x59010d];return _0x5b9bf8;};'use strict';var Sequelize=require(_0x8584('0x0'));module[_0x8584('0x1')]={'name':{'type':Sequelize[_0x8584('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x8584('0x3')](_0x8584('0x4'),_0x8584('0x5')),'defaultValue':_0x8584('0x4')},'selector':{'type':Sequelize[_0x8584('0x2')]},'timeout':{'type':Sequelize[_0x8584('0x6')]}};
\ No newline at end of file
+var _0x0f0f=['sequelize','exports','ENUM','mouseOver','timeout'];(function(_0x5ab4d6,_0x33a6db){var _0x4e2695=function(_0xaabb7){while(--_0xaabb7){_0x5ab4d6['push'](_0x5ab4d6['shift']());}};_0x4e2695(++_0x33a6db);}(_0x0f0f,0x73));var _0xf0f0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0f0f[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xf0f0('0x0'));module[_0xf0f0('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf0f0('0x2')](_0xf0f0('0x3'),_0xf0f0('0x4')),'defaultValue':_0xf0f0('0x3')},'selector':{'type':Sequelize['STRING']},'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 74f9fce..f9e36d5 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 _0x8bc3=['model','rawAttributes','query','filters','intersection','fields','length','attributes','includeAll','include','merge','ChatProactiveAction','find','catch','create','update','body','destroy','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','end','status','json','offset','undefined','count','Content-Range','apply','reject','then','sendStatus','error','stack','name','params'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0x8bc3,0x82));var _0x38bc=function(_0x5aef75,_0x39228e){_0x5aef75=_0x5aef75-0x0;var _0x1bb942=_0x8bc3[_0x5aef75];return _0x1bb942;};'use strict';var emlformat=require(_0x38bc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x38bc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x38bc('0x2'));var moment=require(_0x38bc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x38bc('0x4'));var util=require(_0x38bc('0x5'));var path=require(_0x38bc('0x6'));var sox=require(_0x38bc('0x7'));var csv=require('to-csv');var ejs=require(_0x38bc('0x8'));var fs=require('fs');var fs_extra=require(_0x38bc('0x9'));var _=require(_0x38bc('0xa'));var squel=require(_0x38bc('0xb'));var crypto=require(_0x38bc('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x38bc('0xd'));var querystring=require(_0x38bc('0xe'));var Papa=require(_0x38bc('0xf'));var Redis=require(_0x38bc('0x10'));var authService=require(_0x38bc('0x11'));var qs=require(_0x38bc('0x12'));var as=require(_0x38bc('0x13'));var hardwareService=require(_0x38bc('0x14'));var logger=require(_0x38bc('0x15'))(_0x38bc('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5f4b,_0x56fdcf){_0x56fdcf=_0x56fdcf||0xcc;return function(_0x486c59){if(_0x486c59){return _0x1a5f4b['sendStatus'](_0x56fdcf);}return _0x1a5f4b['status'](_0x56fdcf)[_0x38bc('0x17')]();};}function respondWithResult(_0x1a7903,_0x454eac){_0x454eac=_0x454eac||0xc8;return function(_0x5d4997){if(_0x5d4997){return _0x1a7903[_0x38bc('0x18')](_0x454eac)[_0x38bc('0x19')](_0x5d4997);}};}function respondWithFilteredResult(_0x1ff95d,_0x322c4e){return function(_0x2c223e){if(_0x2c223e){var _0x1c0cd2=typeof _0x322c4e[_0x38bc('0x1a')]===_0x38bc('0x1b')&&typeof _0x322c4e['limit']===_0x38bc('0x1b');var _0x55940b=_0x2c223e[_0x38bc('0x1c')];var _0x1f0e08=_0x1c0cd2?0x0:_0x322c4e[_0x38bc('0x1a')];var _0x30b309=_0x1c0cd2?_0x2c223e[_0x38bc('0x1c')]:_0x322c4e[_0x38bc('0x1a')]+_0x322c4e['limit'];var _0x36ccda;if(_0x30b309>=_0x55940b){_0x30b309=_0x55940b;_0x36ccda=0xc8;}else{_0x36ccda=0xce;}_0x1ff95d['status'](_0x36ccda);return _0x1ff95d['set'](_0x38bc('0x1d'),_0x1f0e08+'-'+_0x30b309+'/'+_0x55940b)[_0x38bc('0x19')](_0x2c223e);}return null;};}function patchUpdates(_0x325b14){return function(_0x19f3af){try{jsonpatch[_0x38bc('0x1e')](_0x19f3af,_0x325b14,!![]);}catch(_0x40e3b6){return BPromise[_0x38bc('0x1f')](_0x40e3b6);}return _0x19f3af['save']();};}function saveUpdates(_0x4a43c7,_0x2999b0){return function(_0x46b863){if(_0x46b863){return _0x46b863['update'](_0x4a43c7)[_0x38bc('0x20')](function(_0x5f4026){return _0x5f4026;});}return null;};}function removeEntity(_0x897a6b,_0x4251ee){return function(_0x434007){if(_0x434007){return _0x434007['destroy']()[_0x38bc('0x20')](function(){_0x897a6b[_0x38bc('0x18')](0xcc)[_0x38bc('0x17')]();});}};}function handleEntityNotFound(_0x49c92d,_0x349731){return function(_0x3daed5){if(!_0x3daed5){_0x49c92d[_0x38bc('0x21')](0x194);}return _0x3daed5;};}function handleError(_0x3a5b7f,_0x53cb1a){_0x53cb1a=_0x53cb1a||0x1f4;return function(_0x487679){logger[_0x38bc('0x22')](_0x487679[_0x38bc('0x23')]);if(_0x487679[_0x38bc('0x24')]){delete _0x487679[_0x38bc('0x24')];}_0x3a5b7f['status'](_0x53cb1a)['send'](_0x487679);};}exports['show']=function(_0x456a78,_0x43ab9f){var _0x404759={'raw':!![],'where':{'id':_0x456a78[_0x38bc('0x25')]['id']}},_0x539b3b={};_0x539b3b[_0x38bc('0x26')]=_['keys'](db['ChatProactiveAction'][_0x38bc('0x27')]);_0x539b3b['query']=_['keys'](_0x456a78[_0x38bc('0x28')]);_0x539b3b[_0x38bc('0x29')]=_[_0x38bc('0x2a')](_0x539b3b[_0x38bc('0x26')],_0x539b3b[_0x38bc('0x28')]);_0x404759['attributes']=_[_0x38bc('0x2a')](_0x539b3b[_0x38bc('0x26')],qs[_0x38bc('0x2b')](_0x456a78[_0x38bc('0x28')][_0x38bc('0x2b')]));_0x404759['attributes']=_0x404759['attributes'][_0x38bc('0x2c')]?_0x404759[_0x38bc('0x2d')]:_0x539b3b[_0x38bc('0x26')];if(_0x456a78[_0x38bc('0x28')][_0x38bc('0x2e')]){_0x404759[_0x38bc('0x2f')]=[{'all':!![]}];}_0x404759=_[_0x38bc('0x30')]({},_0x404759,_0x456a78['options']);return db[_0x38bc('0x31')][_0x38bc('0x32')](_0x404759)['then'](handleEntityNotFound(_0x43ab9f,null))[_0x38bc('0x20')](respondWithResult(_0x43ab9f,null))[_0x38bc('0x33')](handleError(_0x43ab9f,null));};exports[_0x38bc('0x34')]=function(_0x17031c,_0x477411){return db['ChatProactiveAction'][_0x38bc('0x34')](_0x17031c['body'],{})[_0x38bc('0x20')](respondWithResult(_0x477411,0xc9))[_0x38bc('0x33')](handleError(_0x477411,null));};exports[_0x38bc('0x35')]=function(_0x14d8cf,_0x109af1){if(_0x14d8cf[_0x38bc('0x36')]['id']){delete _0x14d8cf[_0x38bc('0x36')]['id'];}return db[_0x38bc('0x31')]['find']({'where':{'id':_0x14d8cf[_0x38bc('0x25')]['id']}})[_0x38bc('0x20')](handleEntityNotFound(_0x109af1,null))[_0x38bc('0x20')](saveUpdates(_0x14d8cf['body'],null))['then'](respondWithResult(_0x109af1,null))[_0x38bc('0x33')](handleError(_0x109af1,null));};exports[_0x38bc('0x37')]=function(_0xdba6c5,_0x43cfbf){return db[_0x38bc('0x31')][_0x38bc('0x32')]({'where':{'id':_0xdba6c5[_0x38bc('0x25')]['id']}})[_0x38bc('0x20')](handleEntityNotFound(_0x43cfbf,null))['then'](removeEntity(_0x43cfbf,null))[_0x38bc('0x33')](handleError(_0x43cfbf,null));};
\ No newline at end of file
+var _0xbdb9=['destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','show','model','keys','ChatProactiveAction','rawAttributes','query','intersection','attributes','fields','length','include','options','find','catch','create','body','params'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xbdb9,0xac));var _0x9bdb=function(_0x38f296,_0x426399){_0x38f296=_0x38f296-0x0;var _0xb3c4d1=_0xbdb9[_0x38f296];return _0xb3c4d1;};'use strict';var emlformat=require(_0x9bdb('0x0'));var rimraf=require(_0x9bdb('0x1'));var zipdir=require(_0x9bdb('0x2'));var jsonpatch=require(_0x9bdb('0x3'));var rp=require(_0x9bdb('0x4'));var moment=require('moment');var BPromise=require(_0x9bdb('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x9bdb('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9bdb('0x7'));var _=require('lodash');var squel=require(_0x9bdb('0x8'));var crypto=require(_0x9bdb('0x9'));var jsforce=require(_0x9bdb('0xa'));var deskjs=require(_0x9bdb('0xb'));var toCsv=require(_0x9bdb('0x6'));var querystring=require(_0x9bdb('0xc'));var Papa=require(_0x9bdb('0xd'));var Redis=require('ioredis');var authService=require(_0x9bdb('0xe'));var qs=require(_0x9bdb('0xf'));var as=require(_0x9bdb('0x10'));var hardwareService=require(_0x9bdb('0x11'));var logger=require(_0x9bdb('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x9bdb('0x13'));var licenseUtil=require(_0x9bdb('0x14'));var db=require(_0x9bdb('0x15'))['db'];function respondWithStatusCode(_0x2bd93f,_0x223475){_0x223475=_0x223475||0xcc;return function(_0x14fb0c){if(_0x14fb0c){return _0x2bd93f['sendStatus'](_0x223475);}return _0x2bd93f[_0x9bdb('0x16')](_0x223475)[_0x9bdb('0x17')]();};}function respondWithResult(_0x470c67,_0x2bde6b){_0x2bde6b=_0x2bde6b||0xc8;return function(_0x17b647){if(_0x17b647){return _0x470c67['status'](_0x2bde6b)[_0x9bdb('0x18')](_0x17b647);}};}function respondWithFilteredResult(_0x2a3150,_0x1b4286){return function(_0x4d1aa7){if(_0x4d1aa7){var _0x3d759e=typeof _0x1b4286[_0x9bdb('0x19')]===_0x9bdb('0x1a')&&typeof _0x1b4286[_0x9bdb('0x1b')]===_0x9bdb('0x1a');var _0x13c07b=_0x4d1aa7[_0x9bdb('0x1c')];var _0x112d0f=_0x3d759e?0x0:_0x1b4286[_0x9bdb('0x19')];var _0x38b812=_0x3d759e?_0x4d1aa7['count']:_0x1b4286[_0x9bdb('0x19')]+_0x1b4286[_0x9bdb('0x1b')];var _0x5204ba;if(_0x38b812>=_0x13c07b){_0x38b812=_0x13c07b;_0x5204ba=0xc8;}else{_0x5204ba=0xce;}_0x2a3150[_0x9bdb('0x16')](_0x5204ba);return _0x2a3150[_0x9bdb('0x1d')](_0x9bdb('0x1e'),_0x112d0f+'-'+_0x38b812+'/'+_0x13c07b)['json'](_0x4d1aa7);}return null;};}function patchUpdates(_0xdaab91){return function(_0x991191){try{jsonpatch[_0x9bdb('0x1f')](_0x991191,_0xdaab91,!![]);}catch(_0x4da7a5){return BPromise[_0x9bdb('0x20')](_0x4da7a5);}return _0x991191[_0x9bdb('0x21')]();};}function saveUpdates(_0xa2084c,_0x2150da){return function(_0x41a213){if(_0x41a213){return _0x41a213[_0x9bdb('0x22')](_0xa2084c)['then'](function(_0x5b5262){return _0x5b5262;});}return null;};}function removeEntity(_0x2c4a44,_0xc1dff7){return function(_0x1bba44){if(_0x1bba44){return _0x1bba44['destroy']()[_0x9bdb('0x23')](function(){_0x2c4a44[_0x9bdb('0x16')](0xcc)[_0x9bdb('0x17')]();});}};}function handleEntityNotFound(_0x1725aa,_0x561f9f){return function(_0x37a02a){if(!_0x37a02a){_0x1725aa['sendStatus'](0x194);}return _0x37a02a;};}function handleError(_0x18aabd,_0x3c2ad6){_0x3c2ad6=_0x3c2ad6||0x1f4;return function(_0x369bb3){logger['error'](_0x369bb3[_0x9bdb('0x24')]);if(_0x369bb3[_0x9bdb('0x25')]){delete _0x369bb3[_0x9bdb('0x25')];}_0x18aabd[_0x9bdb('0x16')](_0x3c2ad6)[_0x9bdb('0x26')](_0x369bb3);};}exports[_0x9bdb('0x27')]=function(_0x426390,_0x820d2e){var _0x250cfb={'raw':!![],'where':{'id':_0x426390['params']['id']}},_0x3f01d2={};_0x3f01d2[_0x9bdb('0x28')]=_[_0x9bdb('0x29')](db[_0x9bdb('0x2a')][_0x9bdb('0x2b')]);_0x3f01d2[_0x9bdb('0x2c')]=_[_0x9bdb('0x29')](_0x426390[_0x9bdb('0x2c')]);_0x3f01d2['filters']=_[_0x9bdb('0x2d')](_0x3f01d2['model'],_0x3f01d2[_0x9bdb('0x2c')]);_0x250cfb[_0x9bdb('0x2e')]=_[_0x9bdb('0x2d')](_0x3f01d2[_0x9bdb('0x28')],qs[_0x9bdb('0x2f')](_0x426390[_0x9bdb('0x2c')][_0x9bdb('0x2f')]));_0x250cfb['attributes']=_0x250cfb[_0x9bdb('0x2e')][_0x9bdb('0x30')]?_0x250cfb[_0x9bdb('0x2e')]:_0x3f01d2['model'];if(_0x426390['query']['includeAll']){_0x250cfb[_0x9bdb('0x31')]=[{'all':!![]}];}_0x250cfb=_['merge']({},_0x250cfb,_0x426390[_0x9bdb('0x32')]);return db[_0x9bdb('0x2a')][_0x9bdb('0x33')](_0x250cfb)[_0x9bdb('0x23')](handleEntityNotFound(_0x820d2e,null))[_0x9bdb('0x23')](respondWithResult(_0x820d2e,null))[_0x9bdb('0x34')](handleError(_0x820d2e,null));};exports[_0x9bdb('0x35')]=function(_0x542e20,_0x39c716){return db[_0x9bdb('0x2a')][_0x9bdb('0x35')](_0x542e20[_0x9bdb('0x36')],{})[_0x9bdb('0x23')](respondWithResult(_0x39c716,0xc9))['catch'](handleError(_0x39c716,null));};exports[_0x9bdb('0x22')]=function(_0x35e567,_0x232043){if(_0x35e567['body']['id']){delete _0x35e567[_0x9bdb('0x36')]['id'];}return db['ChatProactiveAction'][_0x9bdb('0x33')]({'where':{'id':_0x35e567[_0x9bdb('0x37')]['id']}})[_0x9bdb('0x23')](handleEntityNotFound(_0x232043,null))['then'](saveUpdates(_0x35e567['body'],null))['then'](respondWithResult(_0x232043,null))[_0x9bdb('0x34')](handleError(_0x232043,null));};exports[_0x9bdb('0x38')]=function(_0x51b5a6,_0x31b71b){return db['ChatProactiveAction'][_0x9bdb('0x33')]({'where':{'id':_0x51b5a6['params']['id']}})[_0x9bdb('0x23')](handleEntityNotFound(_0x31b71b,null))[_0x9bdb('0x23')](removeEntity(_0x31b71b,null))[_0x9bdb('0x34')](handleError(_0x31b71b,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index e64faca..dbdce14 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 _0x7839=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes','define','chat_proactive_actions'];(function(_0x198e29,_0x3b8474){var _0x10ccb3=function(_0xef1127){while(--_0xef1127){_0x198e29['push'](_0x198e29['shift']());}};_0x10ccb3(++_0x3b8474);}(_0x7839,0x118));var _0x9783=function(_0x4f9318,_0x18bde6){_0x4f9318=_0x4f9318-0x0;var _0x2f093a=_0x7839[_0x4f9318];return _0x2f093a;};'use strict';var _=require('lodash');var util=require(_0x9783('0x0'));var logger=require(_0x9783('0x1'))(_0x9783('0x2'));var moment=require(_0x9783('0x3'));var BPromise=require('bluebird');var rp=require(_0x9783('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9783('0x5'));var config=require(_0x9783('0x6'));var attributes=require(_0x9783('0x7'));module['exports']=function(_0x5493f9,_0x1270e3){return _0x5493f9[_0x9783('0x8')]('ChatProactiveAction',attributes,{'tableName':_0x9783('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe17d=['ChatProactiveAction','api','moment','bluebird','path','./chatProactiveAction.attributes','exports','define'];(function(_0x269ee8,_0x477226){var _0x4d98bd=function(_0x20d4c4){while(--_0x20d4c4){_0x269ee8['push'](_0x269ee8['shift']());}};_0x4d98bd(++_0x477226);}(_0xe17d,0x121));var _0xde17=function(_0x2f43fe,_0x3e7880){_0x2f43fe=_0x2f43fe-0x0;var _0x3a754a=_0xe17d[_0x2f43fe];return _0x3a754a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xde17('0x0'));var moment=require(_0xde17('0x1'));var BPromise=require(_0xde17('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xde17('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xde17('0x4'));module[_0xde17('0x5')]=function(_0xd4f401,_0x2eee6e){return _0xd4f401[_0xde17('0x6')](_0xde17('0x7'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index d5dce6f..cec6c8c 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 _0x21f4=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x1d9956,_0x3cfad7){var _0xaa6dc=function(_0x4530eb){while(--_0x4530eb){_0x1d9956['push'](_0x1d9956['shift']());}};_0xaa6dc(++_0x3cfad7);}(_0x21f4,0x1ee));var _0x421f=function(_0x49cf5f,_0x182bd9){_0x49cf5f=_0x49cf5f-0x0;var _0x16deb8=_0x21f4[_0x49cf5f];return _0x16deb8;};'use strict';var _=require(_0x421f('0x0'));var util=require(_0x421f('0x1'));var moment=require(_0x421f('0x2'));var BPromise=require(_0x421f('0x3'));var rs=require(_0x421f('0x4'));var fs=require('fs');var Redis=require(_0x421f('0x5'));var db=require(_0x421f('0x6'))['db'];var utils=require(_0x421f('0x7'));var logger=require(_0x421f('0x8'))(_0x421f('0x9'));var config=require(_0x421f('0xa'));var jayson=require(_0x421f('0xb'));var client=jayson[_0x421f('0xc')][_0x421f('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x53a84a,_0x1bbb14,_0x237cfe){return new BPromise(function(_0x5c475a,_0x5cf822){return client[_0x421f('0xe')](_0x53a84a,_0x237cfe)['then'](function(_0x417061){logger['info'](_0x421f('0xf'),_0x1bbb14,_0x421f('0x10'));logger[_0x421f('0x11')](_0x421f('0x12'),_0x1bbb14,_0x421f('0x10'),JSON['stringify'](_0x417061));if(_0x417061['error']){if(_0x417061[_0x421f('0x13')][_0x421f('0x14')]===0x1f4){logger[_0x421f('0x13')](_0x421f('0xf'),_0x1bbb14,_0x417061[_0x421f('0x13')]['message']);return _0x5cf822(_0x417061[_0x421f('0x13')][_0x421f('0x15')]);}logger['error'](_0x421f('0xf'),_0x1bbb14,_0x417061['error'][_0x421f('0x15')]);return _0x5c475a(_0x417061[_0x421f('0x13')][_0x421f('0x15')]);}else{logger[_0x421f('0x16')](_0x421f('0xf'),_0x1bbb14,'request\x20sent');_0x5c475a(_0x417061[_0x421f('0x17')]['message']);}})[_0x421f('0x18')](function(_0xd76c8d){logger['error'](_0x421f('0xf'),_0x1bbb14,_0xd76c8d);_0x5cf822(_0xd76c8d);});});}
\ No newline at end of file
+var _0xcdd1=['request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s'];(function(_0x34e8f1,_0x4769c0){var _0x4bed53=function(_0x2aaef7){while(--_0x2aaef7){_0x34e8f1['push'](_0x34e8f1['shift']());}};_0x4bed53(++_0x4769c0);}(_0xcdd1,0x1e3));var _0x1cdd=function(_0x483e3a,_0x568361){_0x483e3a=_0x483e3a-0x0;var _0x43fca9=_0xcdd1[_0x483e3a];return _0x43fca9;};'use strict';var _=require(_0x1cdd('0x0'));var util=require(_0x1cdd('0x1'));var moment=require(_0x1cdd('0x2'));var BPromise=require(_0x1cdd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1cdd('0x4'));var db=require(_0x1cdd('0x5'))['db'];var utils=require(_0x1cdd('0x6'));var logger=require(_0x1cdd('0x7'))(_0x1cdd('0x8'));var config=require(_0x1cdd('0x9'));var jayson=require(_0x1cdd('0xa'));var client=jayson[_0x1cdd('0xb')][_0x1cdd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xc0c168,_0x49d7a9,_0x5c76b4){return new BPromise(function(_0xe588c1,_0x1447d1){return client[_0x1cdd('0xd')](_0xc0c168,_0x5c76b4)[_0x1cdd('0xe')](function(_0x5c7ae7){logger[_0x1cdd('0xf')](_0x1cdd('0x10'),_0x49d7a9,_0x1cdd('0x11'));logger[_0x1cdd('0x12')](_0x1cdd('0x13'),_0x49d7a9,_0x1cdd('0x11'),JSON['stringify'](_0x5c7ae7));if(_0x5c7ae7[_0x1cdd('0x14')]){if(_0x5c7ae7[_0x1cdd('0x14')][_0x1cdd('0x15')]===0x1f4){logger[_0x1cdd('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x49d7a9,_0x5c7ae7[_0x1cdd('0x14')][_0x1cdd('0x16')]);return _0x1447d1(_0x5c7ae7[_0x1cdd('0x14')][_0x1cdd('0x16')]);}logger[_0x1cdd('0x14')](_0x1cdd('0x10'),_0x49d7a9,_0x5c7ae7[_0x1cdd('0x14')][_0x1cdd('0x16')]);return _0xe588c1(_0x5c7ae7['error'][_0x1cdd('0x16')]);}else{logger[_0x1cdd('0xf')](_0x1cdd('0x10'),_0x49d7a9,_0x1cdd('0x11'));_0xe588c1(_0x5c7ae7[_0x1cdd('0x17')]['message']);}})[_0x1cdd('0x18')](function(_0x5960c6){logger[_0x1cdd('0x14')](_0x1cdd('0x10'),_0x49d7a9,_0x5960c6);_0x1447d1(_0x5960c6);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 44766f4..3f2f741 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 _0x7dfd=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','put','update','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x42aa91,_0x551526){var _0x5f3938=function(_0x33ff4a){while(--_0x33ff4a){_0x42aa91['push'](_0x42aa91['shift']());}};_0x5f3938(++_0x551526);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd7df('0x0'));var util=require(_0xd7df('0x1'));var path=require(_0xd7df('0x2'));var timeout=require(_0xd7df('0x3'));var express=require(_0xd7df('0x4'));var router=express[_0xd7df('0x5')]();var fs_extra=require(_0xd7df('0x6'));var auth=require(_0xd7df('0x7'));var interaction=require(_0xd7df('0x8'));var config=require(_0xd7df('0x9'));var controller=require(_0xd7df('0xa'));router[_0xd7df('0xb')](_0xd7df('0xc'),auth[_0xd7df('0xd')](),controller[_0xd7df('0xe')]);router[_0xd7df('0xf')]('/',auth[_0xd7df('0xd')](),controller['create']);router[_0xd7df('0x10')](_0xd7df('0xc'),auth[_0xd7df('0xd')](),controller[_0xd7df('0x11')]);router['delete'](_0xd7df('0xc'),auth['isAuthenticated'](),controller[_0xd7df('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x98a8=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','show','isAuthenticated','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4eec9b,_0x4aea09){var _0x2e3849=function(_0x24c06d){while(--_0x24c06d){_0x4eec9b['push'](_0x4eec9b['shift']());}};_0x2e3849(++_0x4aea09);}(_0x98a8,0x12c));var _0x898a=function(_0x26e3b0,_0x397e94){_0x26e3b0=_0x26e3b0-0x0;var _0x4205b8=_0x98a8[_0x26e3b0];return _0x4205b8;};'use strict';var multer=require(_0x898a('0x0'));var util=require(_0x898a('0x1'));var path=require(_0x898a('0x2'));var timeout=require(_0x898a('0x3'));var express=require(_0x898a('0x4'));var router=express[_0x898a('0x5')]();var fs_extra=require(_0x898a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x898a('0x7'));var config=require(_0x898a('0x8'));var controller=require(_0x898a('0x9'));router[_0x898a('0xa')](_0x898a('0xb'),auth['isAuthenticated'](),controller[_0x898a('0xc')]);router['post']('/',auth[_0x898a('0xd')](),controller['create']);router[_0x898a('0xe')](_0x898a('0xb'),auth[_0x898a('0xd')](),controller[_0x898a('0xf')]);router[_0x898a('0x10')](_0x898a('0xb'),auth[_0x898a('0xd')](),controller[_0x898a('0x11')]);module[_0x898a('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 7b39913..cc17994 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 _0x2c6b=['name','STRING','ENUM','rrmemory','beepall','roundrobin','exports'];(function(_0x27d6d4,_0x2f7449){var _0x25e6cc=function(_0x1f039b){while(--_0x1f039b){_0x27d6d4['push'](_0x27d6d4['shift']());}};_0x25e6cc(++_0x2f7449);}(_0x2c6b,0x1aa));var _0xb2c6=function(_0x227831,_0x1036ab){_0x227831=_0x227831-0x0;var _0x58dc93=_0x2c6b[_0x227831];return _0x58dc93;};'use strict';var Sequelize=require('sequelize');module[_0xb2c6('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xb2c6('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb2c6('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb2c6('0x3')](_0xb2c6('0x4'),_0xb2c6('0x5'),_0xb2c6('0x6'))}};
\ No newline at end of file
+var _0x995a=['name','INTEGER','ENUM','rrmemory','sequelize','exports','STRING'];(function(_0x25f440,_0x53e500){var _0x3f067c=function(_0x22b345){while(--_0x22b345){_0x25f440['push'](_0x25f440['shift']());}};_0x3f067c(++_0x53e500);}(_0x995a,0x115));var _0xa995=function(_0x1fec6f,_0x4580bf){_0x1fec6f=_0x1fec6f-0x0;var _0x30a4b0=_0x995a[_0x1fec6f];return _0x30a4b0;};'use strict';var Sequelize=require(_0xa995('0x0'));module[_0xa995('0x1')]={'name':{'type':Sequelize[_0xa995('0x2')],'unique':_0xa995('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa995('0x2')]},'timeout':{'type':Sequelize[_0xa995('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa995('0x5')](_0xa995('0x6'),'beepall','roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 95b30bf..117e373 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 _0x9a67=['filters','attributes','intersection','fields','length','merge','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatQueues','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','order','sort','where','pick','ChatQueueId','filter','User','findAndCountAll','UserId','agent','chatPause','rows','format','%s/%s','createdAt','updatedAt','getTeams','Team','nolimit','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','emit','userChatQueue:save','ids','select','field','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','forEach','addAgents','spread','isArray','userChatQueue:remove','getAgents','bluebird','util','squel','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatQueue.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','UserProfileResource','sendStatus','error','name','send','index','map','ChatQueue','rawAttributes','type','key','getOptions','include','findAll','catch','params','model','keys','query'];(function(_0x3145e0,_0x3263d8){var _0x40692f=function(_0x8d437){while(--_0x8d437){_0x3145e0['push'](_0x3145e0['shift']());}};_0x40692f(++_0x3263d8);}(_0x9a67,0x1c0));var _0x79a6=function(_0x3fafb9,_0x5d6612){_0x3fafb9=_0x3fafb9-0x0;var _0xada4d4=_0x9a67[_0x3fafb9];return _0xada4d4;};'use strict';var BPromise=require(_0x79a6('0x0'));var util=require(_0x79a6('0x1'));var _=require('lodash');var squel=require(_0x79a6('0x2'));var Redis=require(_0x79a6('0x3'));var qs=require(_0x79a6('0x4'));var logger=require(_0x79a6('0x5'))('api');var config=require(_0x79a6('0x6'));var db=require(_0x79a6('0x7'))['db'];config[_0x79a6('0x8')]=_[_0x79a6('0x9')](config[_0x79a6('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x79a6('0xa'))(new Redis(config[_0x79a6('0x8')]));require(_0x79a6('0xb'))[_0x79a6('0xc')](socket);function respondWithStatusCode(_0x200811,_0x47588b){_0x47588b=_0x47588b||0xcc;return function(_0x1f7b46){if(_0x1f7b46){return _0x200811['sendStatus'](_0x47588b);}return _0x200811[_0x79a6('0xd')](_0x47588b)[_0x79a6('0xe')]();};}function respondWithResult(_0x4d40ed,_0x2aa1c6){_0x2aa1c6=_0x2aa1c6||0xc8;return function(_0x2264a0){if(_0x2264a0){return _0x4d40ed[_0x79a6('0xd')](_0x2aa1c6)[_0x79a6('0xf')](_0x2264a0);}};}function respondWithFilteredResult(_0x556fd6,_0x34cdf5){return function(_0x215a9c){if(_0x215a9c){var _0x3e91a1=typeof _0x34cdf5['offset']===_0x79a6('0x10')&&typeof _0x34cdf5[_0x79a6('0x11')]===_0x79a6('0x10');var _0x2ec810=_0x215a9c['count'];var _0x37fc6b=_0x3e91a1?0x0:_0x34cdf5['offset'];var _0x2575eb=_0x3e91a1?_0x215a9c[_0x79a6('0x12')]:_0x34cdf5[_0x79a6('0x13')]+_0x34cdf5[_0x79a6('0x11')];var _0xd0e8cc;if(_0x2575eb>=_0x2ec810){_0x2575eb=_0x2ec810;_0xd0e8cc=0xc8;}else{_0xd0e8cc=0xce;}_0x556fd6[_0x79a6('0xd')](_0xd0e8cc);return _0x556fd6[_0x79a6('0x14')](_0x79a6('0x15'),_0x37fc6b+'-'+_0x2575eb+'/'+_0x2ec810)[_0x79a6('0xf')](_0x215a9c);}return null;};}function saveUpdates(_0x473013){return function(_0x5384da){if(_0x5384da){return _0x5384da[_0x79a6('0x16')](_0x473013)[_0x79a6('0x17')](function(_0x27688c){return _0x27688c;});}return null;};}function removeEntity(_0x3ca1e6){return function(_0x998388){if(_0x998388){return _0x998388[_0x79a6('0x18')]()[_0x79a6('0x17')](function(){var _0xca4e5=_0x998388['get']({'plain':!![]});var _0x348d57='ChatQueues';return db[_0x79a6('0x19')][_0x79a6('0x18')]({'where':{'type':_0x348d57,'resourceId':_0xca4e5['id']}})[_0x79a6('0x17')](function(){return _0x998388;});})['then'](function(){_0x3ca1e6[_0x79a6('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x319f0c){return function(_0x24942e){if(!_0x24942e){_0x319f0c[_0x79a6('0x1a')](0x194);}return _0x24942e;};}function handleError(_0x40e424,_0x126198){_0x126198=_0x126198||0x1f4;return function(_0x104f94){logger[_0x79a6('0x1b')](_0x104f94['stack']);if(_0x104f94[_0x79a6('0x1c')]){delete _0x104f94[_0x79a6('0x1c')];}_0x40e424[_0x79a6('0xd')](_0x126198)[_0x79a6('0x1d')](_0x104f94);};}exports[_0x79a6('0x1e')]=function(_0x2352fe,_0x4051ca){var _0x424a40={};var _0x31e3d7={'count':0x0,'rows':[]};var _0x3e1573=_[_0x79a6('0x1f')](db[_0x79a6('0x20')][_0x79a6('0x21')],function(_0x80ffc9){return{'name':_0x80ffc9['fieldName'],'type':_0x80ffc9[_0x79a6('0x22')][_0x79a6('0x23')]};});_0x424a40=qs[_0x79a6('0x24')](_0x3e1573,_0x2352fe);var _0x55e715={'where':_0x424a40['where']};return db[_0x79a6('0x20')][_0x79a6('0x12')](_0x55e715)[_0x79a6('0x17')](function(_0x160db5){_0x31e3d7[_0x79a6('0x12')]=_0x160db5;_0x424a40[_0x79a6('0x25')]=qs[_0x79a6('0x25')](_0x2352fe['query']);return db[_0x79a6('0x20')][_0x79a6('0x26')](_0x424a40);})[_0x79a6('0x17')](function(_0x2672d8){_0x31e3d7['rows']=_0x2672d8;return _0x31e3d7;})[_0x79a6('0x17')](respondWithFilteredResult(_0x4051ca,_0x424a40))[_0x79a6('0x27')](handleError(_0x4051ca,null));};exports['show']=function(_0x3e0572,_0x7c753){var _0x309119={'raw':!![],'where':{'id':_0x3e0572[_0x79a6('0x28')]['id']}},_0x44330e={};_0x44330e[_0x79a6('0x29')]=_[_0x79a6('0x2a')](db[_0x79a6('0x20')][_0x79a6('0x21')]);_0x44330e[_0x79a6('0x2b')]=_[_0x79a6('0x2a')](_0x3e0572['query']);_0x44330e[_0x79a6('0x2c')]=_['intersection'](_0x44330e[_0x79a6('0x29')],_0x44330e[_0x79a6('0x2b')]);_0x309119[_0x79a6('0x2d')]=_[_0x79a6('0x2e')](_0x44330e[_0x79a6('0x29')],qs['fields'](_0x3e0572[_0x79a6('0x2b')][_0x79a6('0x2f')]));_0x309119[_0x79a6('0x2d')]=_0x309119[_0x79a6('0x2d')][_0x79a6('0x30')]?_0x309119[_0x79a6('0x2d')]:_0x44330e[_0x79a6('0x29')];if(_0x3e0572[_0x79a6('0x2b')]['includeAll']){_0x309119[_0x79a6('0x25')]=[{'all':!![]}];}_0x309119=_[_0x79a6('0x31')]({},_0x309119,_0x3e0572[_0x79a6('0x32')]);return db['ChatQueue'][_0x79a6('0x33')](_0x309119)[_0x79a6('0x17')](handleEntityNotFound(_0x7c753,null))[_0x79a6('0x17')](respondWithResult(_0x7c753,null))[_0x79a6('0x27')](handleError(_0x7c753,null));};exports[_0x79a6('0x34')]=function(_0x2ef734,_0x8acca2){return db['ChatQueue'][_0x79a6('0x34')](_0x2ef734[_0x79a6('0x35')],{})[_0x79a6('0x17')](function(_0x18e7e5){var _0x2e237a=_0x2ef734['user'][_0x79a6('0x36')]({'plain':!![]});if(!_0x2e237a)throw new Error(_0x79a6('0x37'));if(_0x2e237a['role']==='user'){var _0x1351be=_0x18e7e5[_0x79a6('0x36')]({'plain':!![]});var _0x32981b=_0x79a6('0x38');return db['UserProfileSection'][_0x79a6('0x33')]({'where':{'name':_0x32981b,'userProfileId':_0x2e237a[_0x79a6('0x39')]},'raw':!![]})[_0x79a6('0x17')](function(_0xacc5ea){if(_0xacc5ea&&_0xacc5ea[_0x79a6('0x3a')]===0x0){return db['UserProfileResource'][_0x79a6('0x34')]({'name':_0x1351be['name'],'resourceId':_0x1351be['id'],'type':_0xacc5ea[_0x79a6('0x1c')],'sectionId':_0xacc5ea['id']},{})[_0x79a6('0x17')](function(){return _0x18e7e5;});}else{return _0x18e7e5;}})['catch'](function(_0x1c97d8){logger[_0x79a6('0x1b')](_0x79a6('0x3b'),_0x1c97d8);throw _0x1c97d8;});}return _0x18e7e5;})[_0x79a6('0x17')](respondWithResult(_0x8acca2,0xc9))['catch'](handleError(_0x8acca2,null));};exports[_0x79a6('0x16')]=function(_0x21f025,_0x5464ac){if(_0x21f025['body']['id']){delete _0x21f025[_0x79a6('0x35')]['id'];}return db[_0x79a6('0x20')][_0x79a6('0x33')]({'where':{'id':_0x21f025[_0x79a6('0x28')]['id']}})[_0x79a6('0x17')](handleEntityNotFound(_0x5464ac,null))[_0x79a6('0x17')](saveUpdates(_0x21f025[_0x79a6('0x35')],null))[_0x79a6('0x17')](respondWithResult(_0x5464ac,null))[_0x79a6('0x27')](handleError(_0x5464ac,null));};exports['destroy']=function(_0x52803d,_0x4e7792){return db[_0x79a6('0x20')][_0x79a6('0x33')]({'where':{'id':_0x52803d[_0x79a6('0x28')]['id']}})['then'](handleEntityNotFound(_0x4e7792,null))['then'](removeEntity(_0x4e7792,null))[_0x79a6('0x27')](handleError(_0x4e7792,null));};exports[_0x79a6('0x3c')]=function(_0x42fdf3,_0x3a5b13){return db['ChatQueue'][_0x79a6('0x3c')]()['then'](respondWithResult(_0x3a5b13,null))['catch'](handleError(_0x3a5b13,null));};exports[_0x79a6('0x3d')]=function(_0x437e9f,_0x1240c9){var _0x54ac6e={'raw':!![],'where':{}},_0x572fb1={},_0x18aada;return db[_0x79a6('0x20')][_0x79a6('0x3e')]({'where':{'id':_0x437e9f[_0x79a6('0x28')]['id']}})[_0x79a6('0x17')](handleEntityNotFound(_0x1240c9,null))[_0x79a6('0x17')](function(_0x1424a4){if(_0x1424a4){_0x18aada=_0x1424a4[_0x79a6('0x36')]({'plain':!![]});_0x572fb1[_0x79a6('0x29')]=_[_0x79a6('0x2a')](db[_0x79a6('0x3f')][_0x79a6('0x21')]);_0x572fb1[_0x79a6('0x2b')]=_['keys'](_0x437e9f[_0x79a6('0x2b')]);_0x572fb1[_0x79a6('0x2c')]=_[_0x79a6('0x2e')](_0x572fb1[_0x79a6('0x29')],_0x572fb1['query']);_0x54ac6e[_0x79a6('0x2d')]=_['intersection'](_0x572fb1[_0x79a6('0x29')],qs[_0x79a6('0x2f')](_0x437e9f['query'][_0x79a6('0x2f')]));_0x54ac6e[_0x79a6('0x2d')]=_0x54ac6e[_0x79a6('0x2d')][_0x79a6('0x30')]?_0x54ac6e[_0x79a6('0x2d')]:_0x572fb1['model'];if(!_0x437e9f['query'][_0x79a6('0x40')]('nolimit')){_0x54ac6e[_0x79a6('0x11')]=qs[_0x79a6('0x11')](_0x437e9f[_0x79a6('0x2b')][_0x79a6('0x11')]);_0x54ac6e[_0x79a6('0x13')]=qs[_0x79a6('0x13')](_0x437e9f[_0x79a6('0x2b')][_0x79a6('0x13')]);}_0x54ac6e[_0x79a6('0x41')]=qs[_0x79a6('0x42')](_0x437e9f[_0x79a6('0x2b')][_0x79a6('0x42')]);_0x54ac6e[_0x79a6('0x43')]=qs[_0x79a6('0x2c')](_[_0x79a6('0x44')](_0x437e9f[_0x79a6('0x2b')],_0x572fb1[_0x79a6('0x2c')]));_0x54ac6e[_0x79a6('0x43')][_0x79a6('0x45')]=_0x1424a4['id'];if(_0x437e9f[_0x79a6('0x2b')][_0x79a6('0x46')]){_0x54ac6e[_0x79a6('0x43')]=_[_0x79a6('0x31')](_0x54ac6e[_0x79a6('0x43')],{'$or':_[_0x79a6('0x1f')](_0x54ac6e['attributes'],function(_0x5be4f7){var _0x41dea5={};_0x41dea5[_0x5be4f7]={'$like':'%'+_0x437e9f['query']['filter']+'%'};return _0x41dea5;})});}_0x54ac6e=_[_0x79a6('0x31')]({},_0x54ac6e,_0x437e9f['options']);return db[_0x79a6('0x3f')][_0x79a6('0x26')](_0x54ac6e);}})[_0x79a6('0x17')](function(_0x309513){if(_0x309513){return db[_0x79a6('0x47')][_0x79a6('0x48')]({'where':{'id':_[_0x79a6('0x1f')](_0x309513,_0x79a6('0x49')),'role':_0x79a6('0x4a')},'attributes':['id','name',_0x79a6('0x4b'),'updatedAt','createdAt']});}})[_0x79a6('0x17')](function(_0x8ee49f){if(_0x8ee49f){return{'count':_0x8ee49f[_0x79a6('0x12')],'rows':_['map'](_0x8ee49f[_0x79a6('0x4c')],function(_0xee1bca){return{'membername':_0xee1bca[_0x79a6('0x1c')],'UserId':_0xee1bca['id'],'queue_name':_0x18aada[_0x79a6('0x1c')],'ChatQueueId':_0x18aada['id'],'interface':util[_0x79a6('0x4d')](_0x79a6('0x4e'),'SIP',_0xee1bca[_0x79a6('0x1c')]),'penalty':0x0,'paused':_0xee1bca[_0x79a6('0x4b')],'createdAt':_0xee1bca[_0x79a6('0x4f')],'updatedAt':_0xee1bca[_0x79a6('0x50')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x79a6('0x17')](respondWithFilteredResult(_0x1240c9,_0x54ac6e))[_0x79a6('0x27')](handleError(_0x1240c9,null));};exports[_0x79a6('0x51')]=function(_0x25155a,_0x324ee2){var _0x16855e={};var _0x347080={};var _0x557246;var _0xdb1e65;return db['ChatQueue'][_0x79a6('0x3e')]({'where':{'id':_0x25155a[_0x79a6('0x28')]['id']}})['then'](handleEntityNotFound(_0x324ee2,null))[_0x79a6('0x17')](function(_0x1fffc0){if(_0x1fffc0){_0x557246=_0x1fffc0;_0x347080[_0x79a6('0x29')]=_[_0x79a6('0x2a')](db[_0x79a6('0x52')][_0x79a6('0x21')]);_0x347080[_0x79a6('0x2b')]=_[_0x79a6('0x2a')](_0x25155a[_0x79a6('0x2b')]);_0x347080[_0x79a6('0x2c')]=_[_0x79a6('0x2e')](_0x347080['model'],_0x347080[_0x79a6('0x2b')]);_0x16855e[_0x79a6('0x2d')]=_['intersection'](_0x347080[_0x79a6('0x29')],qs['fields'](_0x25155a[_0x79a6('0x2b')][_0x79a6('0x2f')]));_0x16855e['attributes']=_0x16855e[_0x79a6('0x2d')]['length']?_0x16855e[_0x79a6('0x2d')]:_0x347080[_0x79a6('0x29')];_0x16855e['order']=qs[_0x79a6('0x42')](_0x25155a[_0x79a6('0x2b')][_0x79a6('0x42')]);_0x16855e[_0x79a6('0x43')]=qs[_0x79a6('0x2c')](_[_0x79a6('0x44')](_0x25155a[_0x79a6('0x2b')],_0x347080[_0x79a6('0x2c')]));if(_0x25155a[_0x79a6('0x2b')][_0x79a6('0x46')]){_0x16855e[_0x79a6('0x43')]=_[_0x79a6('0x31')](_0x16855e[_0x79a6('0x43')],{'$or':_[_0x79a6('0x1f')](_0x16855e[_0x79a6('0x2d')],function(_0x3b8202){var _0x35136a={};_0x35136a[_0x3b8202]={'$like':'%'+_0x25155a[_0x79a6('0x2b')][_0x79a6('0x46')]+'%'};return _0x35136a;})});}_0x16855e=_[_0x79a6('0x31')]({},_0x16855e,_0x25155a[_0x79a6('0x32')]);return _0x557246[_0x79a6('0x51')](_0x16855e);}})[_0x79a6('0x17')](function(_0x481103){if(_0x481103){_0xdb1e65=_0x481103[_0x79a6('0x30')];if(!_0x25155a['query']['hasOwnProperty'](_0x79a6('0x53'))){_0x16855e[_0x79a6('0x11')]=qs[_0x79a6('0x11')](_0x25155a['query'][_0x79a6('0x11')]);_0x16855e['offset']=qs[_0x79a6('0x13')](_0x25155a[_0x79a6('0x2b')][_0x79a6('0x13')]);}return _0x557246[_0x79a6('0x51')](_0x16855e);}})[_0x79a6('0x17')](function(_0x2c314e){if(_0x2c314e){return _0x2c314e?{'count':_0xdb1e65,'rows':_0x2c314e}:null;}})[_0x79a6('0x17')](respondWithResult(_0x324ee2,null))['catch'](handleError(_0x324ee2,null));};exports[_0x79a6('0x54')]=function(_0xc4418f,_0x270420){var _0x10a665=_0xc4418f['body']['ids'];return db[_0x79a6('0x52')]['findAll']({'where':{'id':_0x10a665},'attributes':['id'],'include':[{'model':db[_0x79a6('0x47')],'as':_0x79a6('0x55'),'attributes':['id',_0x79a6('0x1c'),_0x79a6('0x56'),_0x79a6('0x57'),_0x79a6('0x58')],'raw':!![]}]})[_0x79a6('0x17')](function(_0x171f85){if(_0x171f85){var _0x1cc9b2=_[_0x79a6('0x59')](_0x171f85,function(_0x3e570a){var _0x5cc6b2=_0x3e570a[_0x79a6('0x36')]({'plain':!![]});return _0x5cc6b2[_0x79a6('0x55')];});return db[_0x79a6('0x20')]['find']({'where':{'id':_0xc4418f[_0x79a6('0x28')]['id']}})[_0x79a6('0x17')](function(_0x39fc81){return db[_0x79a6('0x5a')][_0x79a6('0x5b')](function(_0x1b67f3){return _0x39fc81[_0x79a6('0x54')](_0x10a665,{'transaction':_0x1b67f3})[_0x79a6('0x17')](function(){return BPromise[_0x79a6('0x5c')](_0x1cc9b2,function(_0x48d1cf){return db[_0x79a6('0x3f')]['findOrCreate']({'where':{'UserId':_0x48d1cf['id'],'ChatQueueId':_0xc4418f[_0x79a6('0x28')]['id']},'transaction':_0x1b67f3});});})[_0x79a6('0x17')](function(){_0x1cc9b2['forEach'](function(_0x3d0d85){socket[_0x79a6('0x5d')](_0x79a6('0x5e'),{'UserId':_0x3d0d85['id'],'ChatQueueId':_0x39fc81['id']});});});});});}})[_0x79a6('0x17')](respondWithStatusCode(_0x270420,null))[_0x79a6('0x27')](handleError(_0x270420,null));};exports['removeTeams']=function(_0x457553,_0x120a37){return db[_0x79a6('0x52')][_0x79a6('0x26')]({'where':{'id':_0x457553['query'][_0x79a6('0x5f')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x79a6('0x55'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x120a37,null))[_0x79a6('0x17')](function(_0x56b02d){var _0x563d6c=_['map'](_0x56b02d,'id');var _0x234cd5=[];var _0x440898=[];var _0x4314dc=squel[_0x79a6('0x60')]();_0x4314dc[_0x79a6('0x61')]('tq.TeamId')[_0x79a6('0x62')](_0x79a6('0x63'),'tq')[_0x79a6('0x64')](_0x79a6('0x65'),'ut',_0x79a6('0x66'))[_0x79a6('0x43')]('ChatQueueId\x20=\x20?',_0x457553['params']['id']);for(var _0x1b41a5=0x0;_0x1b41a5<_0x56b02d['length'];_0x1b41a5+=0x1){let _0x333cf6=_0x56b02d[_0x1b41a5];for(var _0xdddea2=0x0;_0xdddea2<_0x333cf6[_0x79a6('0x55')][_0x79a6('0x30')];_0xdddea2+=0x1){let _0xf3ef3b=_0x333cf6[_0x79a6('0x55')][_0xdddea2];var _0x480a3f=_0x4314dc[_0x79a6('0x67')]();_0x480a3f[_0x79a6('0x43')](_0x79a6('0x68'),_0xf3ef3b['id']);_0x440898[_0x79a6('0x69')](db['sequelize'][_0x79a6('0x2b')](_0x480a3f[_0x79a6('0x6a')](),{'type':db[_0x79a6('0x5a')][_0x79a6('0x6b')]['SELECT']})[_0x79a6('0x17')](function(_0x2a7244){if(_0x2a7244[_0x79a6('0x30')]===0x1){return _0xf3ef3b['id'];}else{var _0x3f06e9=_[_0x79a6('0x6c')](_[_0x79a6('0x1f')](_0x2a7244,'TeamId'),function(_0x5ad0a8){return _[_0x79a6('0x6d')](_0x563d6c,_0x5ad0a8);});if(_0x3f06e9){return _0xf3ef3b['id'];}}}));}}return BPromise[_0x79a6('0x6e')](_0x440898)[_0x79a6('0x17')](function(_0x281815){_0x234cd5=_(_0x234cd5)[_0x79a6('0x6f')](_0x281815)[_0x79a6('0x70')]()[_0x79a6('0x71')]();return db[_0x79a6('0x20')][_0x79a6('0x33')]({'where':{'id':_0x457553['params']['id']}})[_0x79a6('0x17')](function(_0x1cb013){return db['sequelize'][_0x79a6('0x5b')](function(_0x2b143c){return _0x1cb013[_0x79a6('0x72')](_0x457553[_0x79a6('0x2b')][_0x79a6('0x5f')],{'transaction':_0x2b143c})[_0x79a6('0x17')](function(){if(!_[_0x79a6('0x73')](_0x234cd5)){return _0x1cb013[_0x79a6('0x74')](_0x234cd5,{'transaction':_0x2b143c});}})[_0x79a6('0x17')](function(){_0x234cd5[_0x79a6('0x75')](function(_0x7fcb2b){socket[_0x79a6('0x5d')]('userChatQueue:remove',{'UserId':_0x7fcb2b,'ChatQueueId':_0x1cb013['id']});});});});});});})[_0x79a6('0x17')](respondWithStatusCode(_0x120a37,null))[_0x79a6('0x27')](handleError(_0x120a37,null));};exports[_0x79a6('0x76')]=function(_0x59e324,_0x5e3fcd){return db[_0x79a6('0x20')][_0x79a6('0x33')]({'where':{'id':_0x59e324['params']['id']}})[_0x79a6('0x17')](handleEntityNotFound(_0x5e3fcd,null))[_0x79a6('0x17')](function(_0x307113){if(_0x307113){return _0x307113['addAgents'](_0x59e324[_0x79a6('0x35')]['ids'],_['omit'](_0x59e324[_0x79a6('0x35')],[_0x79a6('0x5f'),'id'])||{})[_0x79a6('0x77')](function(_0x200dc0){for(var _0x4298ae=0x0;_0x4298ae<_0x59e324[_0x79a6('0x35')]['ids'][_0x79a6('0x30')];_0x4298ae+=0x1){socket[_0x79a6('0x5d')](_0x79a6('0x5e'),{'UserId':Number(_0x59e324[_0x79a6('0x35')][_0x79a6('0x5f')][_0x4298ae]),'ChatQueueId':Number(_0x59e324[_0x79a6('0x28')]['id'])});}return _0x200dc0;});}})[_0x79a6('0x17')](respondWithResult(_0x5e3fcd,null))[_0x79a6('0x27')](handleError(_0x5e3fcd,null));};exports[_0x79a6('0x74')]=function(_0x46e00c,_0x44a5e9){return db['ChatQueue'][_0x79a6('0x33')]({'where':{'id':_0x46e00c['params']['id']}})[_0x79a6('0x17')](handleEntityNotFound(_0x44a5e9,null))[_0x79a6('0x17')](function(_0x1a867e){if(_0x1a867e){return _0x1a867e[_0x79a6('0x74')](_0x46e00c[_0x79a6('0x2b')][_0x79a6('0x5f')])[_0x79a6('0x17')](function(){if(_[_0x79a6('0x78')](_0x46e00c[_0x79a6('0x2b')]['ids'])){for(var _0x27424a=0x0;_0x27424a<_0x46e00c['query']['ids'][_0x79a6('0x30')];_0x27424a+=0x1){socket[_0x79a6('0x5d')](_0x79a6('0x79'),{'UserId':Number(_0x46e00c[_0x79a6('0x2b')]['ids'][_0x27424a]),'ChatQueueId':Number(_0x46e00c[_0x79a6('0x28')]['id'])});}}else{socket['emit'](_0x79a6('0x79'),{'UserId':Number(_0x46e00c[_0x79a6('0x2b')][_0x79a6('0x5f')]),'ChatQueueId':Number(_0x46e00c[_0x79a6('0x28')]['id'])});}});}})['then'](respondWithStatusCode(_0x44a5e9,null))[_0x79a6('0x27')](handleError(_0x44a5e9,null));};exports[_0x79a6('0x7a')]=function(_0x4e2ba5,_0x503434){var _0xfd8168={};var _0x39519f={};var _0x3f4dc1;var _0x21dda0;return db[_0x79a6('0x20')][_0x79a6('0x3e')]({'where':{'id':_0x4e2ba5[_0x79a6('0x28')]['id']}})['then'](handleEntityNotFound(_0x503434,null))['then'](function(_0x3847dc){if(_0x3847dc){_0x3f4dc1=_0x3847dc;_0x39519f[_0x79a6('0x29')]=_[_0x79a6('0x2a')](db[_0x79a6('0x47')][_0x79a6('0x21')]);_0x39519f[_0x79a6('0x2b')]=_[_0x79a6('0x2a')](_0x4e2ba5[_0x79a6('0x2b')]);_0x39519f[_0x79a6('0x2c')]=_['intersection'](_0x39519f[_0x79a6('0x29')],_0x39519f['query']);_0xfd8168['attributes']=_[_0x79a6('0x2e')](_0x39519f[_0x79a6('0x29')],qs[_0x79a6('0x2f')](_0x4e2ba5['query'][_0x79a6('0x2f')]));_0xfd8168[_0x79a6('0x2d')]=_0xfd8168[_0x79a6('0x2d')][_0x79a6('0x30')]?_0xfd8168[_0x79a6('0x2d')]:_0x39519f[_0x79a6('0x29')];_0xfd8168['order']=qs[_0x79a6('0x42')](_0x4e2ba5['query'][_0x79a6('0x42')]);_0xfd8168['where']=qs[_0x79a6('0x2c')](_[_0x79a6('0x44')](_0x4e2ba5['query'],_0x39519f[_0x79a6('0x2c')]));if(_0x4e2ba5[_0x79a6('0x2b')]['filter']){_0xfd8168[_0x79a6('0x43')]=_['merge'](_0xfd8168[_0x79a6('0x43')],{'$or':_[_0x79a6('0x1f')](_0xfd8168[_0x79a6('0x2d')],function(_0x44c7a4){var _0x46f10c={};_0x46f10c[_0x44c7a4]={'$like':'%'+_0x4e2ba5[_0x79a6('0x2b')][_0x79a6('0x46')]+'%'};return _0x46f10c;})});}_0xfd8168=_[_0x79a6('0x31')]({},_0xfd8168,_0x4e2ba5['options']);return _0x3f4dc1['getAgents'](_0xfd8168);}})['then'](function(_0x9f699c){if(_0x9f699c){_0x21dda0=_0x9f699c[_0x79a6('0x30')];if(!_0x4e2ba5[_0x79a6('0x2b')][_0x79a6('0x40')](_0x79a6('0x53'))){_0xfd8168[_0x79a6('0x11')]=qs[_0x79a6('0x11')](_0x4e2ba5[_0x79a6('0x2b')][_0x79a6('0x11')]);_0xfd8168['offset']=qs['offset'](_0x4e2ba5[_0x79a6('0x2b')][_0x79a6('0x13')]);}return _0x3f4dc1['getAgents'](_0xfd8168);}})['then'](function(_0x548b5b){if(_0x548b5b){return _0x548b5b?{'count':_0x21dda0,'rows':_0x548b5b}:null;}})[_0x79a6('0x17')](respondWithResult(_0x503434,null))[_0x79a6('0x27')](handleError(_0x503434,null));};
\ No newline at end of file
+var _0xbeb5=['ChatQueue','include','query','findAll','show','params','model','rawAttributes','keys','intersection','attributes','fields','length','includeAll','merge','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserChatQueue','filters','hasOwnProperty','order','sort','pick','filter','options','User','findAndCountAll','UserId','agent','chatPause','updatedAt','rows','format','SIP','createdAt','findOne','nolimit','getTeams','addTeams','ids','Team','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','userChatQueue:save','removeTeams','select','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','union','removeAgents','userChatQueue:remove','omit','spread','emit','isArray','getAgents','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','end','status','json','undefined','limit','offset','count','set','Content-Range','update','then','destroy','get','ChatQueues','error','stack','name','send','index','map','fieldName','key','getOptions','where'];(function(_0x3710f1,_0x4d55cf){var _0x1ef269=function(_0x286dce){while(--_0x286dce){_0x3710f1['push'](_0x3710f1['shift']());}};_0x1ef269(++_0x4d55cf);}(_0xbeb5,0x1c4));var _0x5beb=function(_0x58f59d,_0x24d60e){_0x58f59d=_0x58f59d-0x0;var _0x5daff3=_0xbeb5[_0x58f59d];return _0x5daff3;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x5beb('0x0'));var squel=require(_0x5beb('0x1'));var Redis=require('ioredis');var qs=require(_0x5beb('0x2'));var logger=require(_0x5beb('0x3'))(_0x5beb('0x4'));var config=require(_0x5beb('0x5'));var db=require('../../mysqldb')['db'];config[_0x5beb('0x6')]=_[_0x5beb('0x7')](config['redis'],{'host':_0x5beb('0x8'),'port':0x18eb});var socket=require(_0x5beb('0x9'))(new Redis(config[_0x5beb('0x6')]));require(_0x5beb('0xa'))[_0x5beb('0xb')](socket);function respondWithStatusCode(_0x30f197,_0x5bd0a5){_0x5bd0a5=_0x5bd0a5||0xcc;return function(_0x50e197){if(_0x50e197){return _0x30f197['sendStatus'](_0x5bd0a5);}return _0x30f197['status'](_0x5bd0a5)[_0x5beb('0xc')]();};}function respondWithResult(_0x3248d9,_0x2dd448){_0x2dd448=_0x2dd448||0xc8;return function(_0x36191c){if(_0x36191c){return _0x3248d9[_0x5beb('0xd')](_0x2dd448)[_0x5beb('0xe')](_0x36191c);}};}function respondWithFilteredResult(_0x4b1e18,_0x40505b){return function(_0x375107){if(_0x375107){var _0x4ebd61=typeof _0x40505b['offset']===_0x5beb('0xf')&&typeof _0x40505b[_0x5beb('0x10')]===_0x5beb('0xf');var _0x3f8268=_0x375107['count'];var _0x4e621c=_0x4ebd61?0x0:_0x40505b[_0x5beb('0x11')];var _0x12ce86=_0x4ebd61?_0x375107[_0x5beb('0x12')]:_0x40505b['offset']+_0x40505b[_0x5beb('0x10')];var _0x3282ff;if(_0x12ce86>=_0x3f8268){_0x12ce86=_0x3f8268;_0x3282ff=0xc8;}else{_0x3282ff=0xce;}_0x4b1e18[_0x5beb('0xd')](_0x3282ff);return _0x4b1e18[_0x5beb('0x13')](_0x5beb('0x14'),_0x4e621c+'-'+_0x12ce86+'/'+_0x3f8268)[_0x5beb('0xe')](_0x375107);}return null;};}function saveUpdates(_0x12d153){return function(_0x40582e){if(_0x40582e){return _0x40582e[_0x5beb('0x15')](_0x12d153)[_0x5beb('0x16')](function(_0x2d1266){return _0x2d1266;});}return null;};}function removeEntity(_0x3c5fad){return function(_0x475ba1){if(_0x475ba1){return _0x475ba1[_0x5beb('0x17')]()[_0x5beb('0x16')](function(){var _0x3e7bd3=_0x475ba1[_0x5beb('0x18')]({'plain':!![]});var _0x2662e9=_0x5beb('0x19');return db['UserProfileResource']['destroy']({'where':{'type':_0x2662e9,'resourceId':_0x3e7bd3['id']}})[_0x5beb('0x16')](function(){return _0x475ba1;});})[_0x5beb('0x16')](function(){_0x3c5fad[_0x5beb('0xd')](0xcc)[_0x5beb('0xc')]();});}};}function handleEntityNotFound(_0x33a892){return function(_0x3574b2){if(!_0x3574b2){_0x33a892['sendStatus'](0x194);}return _0x3574b2;};}function handleError(_0x2b05b9,_0x22e3c8){_0x22e3c8=_0x22e3c8||0x1f4;return function(_0x5c148d){logger[_0x5beb('0x1a')](_0x5c148d[_0x5beb('0x1b')]);if(_0x5c148d[_0x5beb('0x1c')]){delete _0x5c148d[_0x5beb('0x1c')];}_0x2b05b9[_0x5beb('0xd')](_0x22e3c8)[_0x5beb('0x1d')](_0x5c148d);};}exports[_0x5beb('0x1e')]=function(_0x266d30,_0x28a134){var _0xc8b202={};var _0x4d9643={'count':0x0,'rows':[]};var _0x1ad379=_[_0x5beb('0x1f')](db['ChatQueue']['rawAttributes'],function(_0x42c48){return{'name':_0x42c48[_0x5beb('0x20')],'type':_0x42c48['type'][_0x5beb('0x21')]};});_0xc8b202=qs[_0x5beb('0x22')](_0x1ad379,_0x266d30);var _0x56d13a={'where':_0xc8b202[_0x5beb('0x23')]};return db[_0x5beb('0x24')][_0x5beb('0x12')](_0x56d13a)[_0x5beb('0x16')](function(_0xb3fed7){_0x4d9643['count']=_0xb3fed7;_0xc8b202[_0x5beb('0x25')]=qs[_0x5beb('0x25')](_0x266d30[_0x5beb('0x26')]);return db[_0x5beb('0x24')][_0x5beb('0x27')](_0xc8b202);})['then'](function(_0x108574){_0x4d9643['rows']=_0x108574;return _0x4d9643;})[_0x5beb('0x16')](respondWithFilteredResult(_0x28a134,_0xc8b202))['catch'](handleError(_0x28a134,null));};exports[_0x5beb('0x28')]=function(_0x48464e,_0x4d42b4){var _0x2bd915={'raw':!![],'where':{'id':_0x48464e[_0x5beb('0x29')]['id']}},_0x2d06fb={};_0x2d06fb[_0x5beb('0x2a')]=_['keys'](db[_0x5beb('0x24')][_0x5beb('0x2b')]);_0x2d06fb[_0x5beb('0x26')]=_[_0x5beb('0x2c')](_0x48464e[_0x5beb('0x26')]);_0x2d06fb['filters']=_[_0x5beb('0x2d')](_0x2d06fb[_0x5beb('0x2a')],_0x2d06fb[_0x5beb('0x26')]);_0x2bd915[_0x5beb('0x2e')]=_['intersection'](_0x2d06fb['model'],qs[_0x5beb('0x2f')](_0x48464e[_0x5beb('0x26')][_0x5beb('0x2f')]));_0x2bd915['attributes']=_0x2bd915['attributes'][_0x5beb('0x30')]?_0x2bd915[_0x5beb('0x2e')]:_0x2d06fb[_0x5beb('0x2a')];if(_0x48464e[_0x5beb('0x26')][_0x5beb('0x31')]){_0x2bd915[_0x5beb('0x25')]=[{'all':!![]}];}_0x2bd915=_[_0x5beb('0x32')]({},_0x2bd915,_0x48464e['options']);return db[_0x5beb('0x24')]['find'](_0x2bd915)['then'](handleEntityNotFound(_0x4d42b4,null))[_0x5beb('0x16')](respondWithResult(_0x4d42b4,null))[_0x5beb('0x33')](handleError(_0x4d42b4,null));};exports[_0x5beb('0x34')]=function(_0x2b2e5c,_0x36ec0a){return db[_0x5beb('0x24')][_0x5beb('0x34')](_0x2b2e5c[_0x5beb('0x35')],{})['then'](function(_0x5a0c7b){var _0x274dd1=_0x2b2e5c[_0x5beb('0x36')]['get']({'plain':!![]});if(!_0x274dd1)throw new Error(_0x5beb('0x37'));if(_0x274dd1[_0x5beb('0x38')]===_0x5beb('0x36')){var _0x49c3c0=_0x5a0c7b[_0x5beb('0x18')]({'plain':!![]});var _0x12ae05='ChatQueues';return db[_0x5beb('0x39')][_0x5beb('0x3a')]({'where':{'name':_0x12ae05,'userProfileId':_0x274dd1[_0x5beb('0x3b')]},'raw':!![]})[_0x5beb('0x16')](function(_0x5078ff){if(_0x5078ff&&_0x5078ff['autoAssociation']===0x0){return db[_0x5beb('0x3c')][_0x5beb('0x34')]({'name':_0x49c3c0[_0x5beb('0x1c')],'resourceId':_0x49c3c0['id'],'type':_0x5078ff[_0x5beb('0x1c')],'sectionId':_0x5078ff['id']},{})[_0x5beb('0x16')](function(){return _0x5a0c7b;});}else{return _0x5a0c7b;}})[_0x5beb('0x33')](function(_0x28d1c5){logger[_0x5beb('0x1a')](_0x5beb('0x3d'),_0x28d1c5);throw _0x28d1c5;});}return _0x5a0c7b;})['then'](respondWithResult(_0x36ec0a,0xc9))['catch'](handleError(_0x36ec0a,null));};exports[_0x5beb('0x15')]=function(_0x582f69,_0x537433){if(_0x582f69['body']['id']){delete _0x582f69[_0x5beb('0x35')]['id'];}return db[_0x5beb('0x24')][_0x5beb('0x3a')]({'where':{'id':_0x582f69[_0x5beb('0x29')]['id']}})['then'](handleEntityNotFound(_0x537433,null))[_0x5beb('0x16')](saveUpdates(_0x582f69[_0x5beb('0x35')],null))[_0x5beb('0x16')](respondWithResult(_0x537433,null))['catch'](handleError(_0x537433,null));};exports['destroy']=function(_0x4ebcf7,_0x3dc8ba){return db['ChatQueue'][_0x5beb('0x3a')]({'where':{'id':_0x4ebcf7[_0x5beb('0x29')]['id']}})[_0x5beb('0x16')](handleEntityNotFound(_0x3dc8ba,null))[_0x5beb('0x16')](removeEntity(_0x3dc8ba,null))[_0x5beb('0x33')](handleError(_0x3dc8ba,null));};exports[_0x5beb('0x3e')]=function(_0x5206be,_0x1f72a4){return db[_0x5beb('0x24')][_0x5beb('0x3e')]()['then'](respondWithResult(_0x1f72a4,null))[_0x5beb('0x33')](handleError(_0x1f72a4,null));};exports[_0x5beb('0x3f')]=function(_0x246a53,_0xbe81dd){var _0x38fc47={'raw':!![],'where':{}},_0x97ec39={},_0x30015f;return db[_0x5beb('0x24')]['findOne']({'where':{'id':_0x246a53[_0x5beb('0x29')]['id']}})[_0x5beb('0x16')](handleEntityNotFound(_0xbe81dd,null))[_0x5beb('0x16')](function(_0x6732f4){if(_0x6732f4){_0x30015f=_0x6732f4['get']({'plain':!![]});_0x97ec39['model']=_['keys'](db[_0x5beb('0x40')][_0x5beb('0x2b')]);_0x97ec39[_0x5beb('0x26')]=_[_0x5beb('0x2c')](_0x246a53[_0x5beb('0x26')]);_0x97ec39[_0x5beb('0x41')]=_['intersection'](_0x97ec39['model'],_0x97ec39['query']);_0x38fc47['attributes']=_[_0x5beb('0x2d')](_0x97ec39[_0x5beb('0x2a')],qs['fields'](_0x246a53['query'][_0x5beb('0x2f')]));_0x38fc47[_0x5beb('0x2e')]=_0x38fc47[_0x5beb('0x2e')]['length']?_0x38fc47['attributes']:_0x97ec39['model'];if(!_0x246a53['query'][_0x5beb('0x42')]('nolimit')){_0x38fc47[_0x5beb('0x10')]=qs[_0x5beb('0x10')](_0x246a53['query'][_0x5beb('0x10')]);_0x38fc47['offset']=qs[_0x5beb('0x11')](_0x246a53[_0x5beb('0x26')][_0x5beb('0x11')]);}_0x38fc47[_0x5beb('0x43')]=qs[_0x5beb('0x44')](_0x246a53['query'][_0x5beb('0x44')]);_0x38fc47['where']=qs[_0x5beb('0x41')](_[_0x5beb('0x45')](_0x246a53[_0x5beb('0x26')],_0x97ec39[_0x5beb('0x41')]));_0x38fc47[_0x5beb('0x23')]['ChatQueueId']=_0x6732f4['id'];if(_0x246a53[_0x5beb('0x26')]['filter']){_0x38fc47[_0x5beb('0x23')]=_[_0x5beb('0x32')](_0x38fc47[_0x5beb('0x23')],{'$or':_[_0x5beb('0x1f')](_0x38fc47[_0x5beb('0x2e')],function(_0x59788d){var _0x2daa80={};_0x2daa80[_0x59788d]={'$like':'%'+_0x246a53['query'][_0x5beb('0x46')]+'%'};return _0x2daa80;})});}_0x38fc47=_[_0x5beb('0x32')]({},_0x38fc47,_0x246a53[_0x5beb('0x47')]);return db[_0x5beb('0x40')][_0x5beb('0x27')](_0x38fc47);}})[_0x5beb('0x16')](function(_0x388fe0){if(_0x388fe0){return db[_0x5beb('0x48')][_0x5beb('0x49')]({'where':{'id':_[_0x5beb('0x1f')](_0x388fe0,_0x5beb('0x4a')),'role':_0x5beb('0x4b')},'attributes':['id',_0x5beb('0x1c'),_0x5beb('0x4c'),_0x5beb('0x4d'),'createdAt']});}})[_0x5beb('0x16')](function(_0x5a8baa){if(_0x5a8baa){return{'count':_0x5a8baa['count'],'rows':_[_0x5beb('0x1f')](_0x5a8baa[_0x5beb('0x4e')],function(_0x38d0ba){return{'membername':_0x38d0ba[_0x5beb('0x1c')],'UserId':_0x38d0ba['id'],'queue_name':_0x30015f[_0x5beb('0x1c')],'ChatQueueId':_0x30015f['id'],'interface':util[_0x5beb('0x4f')]('%s/%s',_0x5beb('0x50'),_0x38d0ba['name']),'penalty':0x0,'paused':_0x38d0ba[_0x5beb('0x4c')],'createdAt':_0x38d0ba[_0x5beb('0x51')],'updatedAt':_0x38d0ba['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x5beb('0x16')](respondWithFilteredResult(_0xbe81dd,_0x38fc47))[_0x5beb('0x33')](handleError(_0xbe81dd,null));};exports['getTeams']=function(_0xe7aab9,_0xa459de){var _0x563fba={};var _0x1609c1={};var _0x143f6c;var _0x215d19;return db[_0x5beb('0x24')][_0x5beb('0x52')]({'where':{'id':_0xe7aab9[_0x5beb('0x29')]['id']}})[_0x5beb('0x16')](handleEntityNotFound(_0xa459de,null))['then'](function(_0x5319e4){if(_0x5319e4){_0x143f6c=_0x5319e4;_0x1609c1[_0x5beb('0x2a')]=_[_0x5beb('0x2c')](db['Team']['rawAttributes']);_0x1609c1[_0x5beb('0x26')]=_['keys'](_0xe7aab9['query']);_0x1609c1[_0x5beb('0x41')]=_['intersection'](_0x1609c1[_0x5beb('0x2a')],_0x1609c1[_0x5beb('0x26')]);_0x563fba[_0x5beb('0x2e')]=_[_0x5beb('0x2d')](_0x1609c1['model'],qs[_0x5beb('0x2f')](_0xe7aab9['query'][_0x5beb('0x2f')]));_0x563fba[_0x5beb('0x2e')]=_0x563fba['attributes']['length']?_0x563fba[_0x5beb('0x2e')]:_0x1609c1[_0x5beb('0x2a')];_0x563fba[_0x5beb('0x43')]=qs[_0x5beb('0x44')](_0xe7aab9['query'][_0x5beb('0x44')]);_0x563fba[_0x5beb('0x23')]=qs['filters'](_[_0x5beb('0x45')](_0xe7aab9[_0x5beb('0x26')],_0x1609c1[_0x5beb('0x41')]));if(_0xe7aab9[_0x5beb('0x26')][_0x5beb('0x46')]){_0x563fba[_0x5beb('0x23')]=_['merge'](_0x563fba[_0x5beb('0x23')],{'$or':_[_0x5beb('0x1f')](_0x563fba[_0x5beb('0x2e')],function(_0x4d028d){var _0x498a4d={};_0x498a4d[_0x4d028d]={'$like':'%'+_0xe7aab9['query'][_0x5beb('0x46')]+'%'};return _0x498a4d;})});}_0x563fba=_[_0x5beb('0x32')]({},_0x563fba,_0xe7aab9[_0x5beb('0x47')]);return _0x143f6c['getTeams'](_0x563fba);}})[_0x5beb('0x16')](function(_0x3c050e){if(_0x3c050e){_0x215d19=_0x3c050e[_0x5beb('0x30')];if(!_0xe7aab9['query'][_0x5beb('0x42')](_0x5beb('0x53'))){_0x563fba[_0x5beb('0x10')]=qs[_0x5beb('0x10')](_0xe7aab9[_0x5beb('0x26')]['limit']);_0x563fba[_0x5beb('0x11')]=qs['offset'](_0xe7aab9[_0x5beb('0x26')][_0x5beb('0x11')]);}return _0x143f6c[_0x5beb('0x54')](_0x563fba);}})[_0x5beb('0x16')](function(_0x5a5afb){if(_0x5a5afb){return _0x5a5afb?{'count':_0x215d19,'rows':_0x5a5afb}:null;}})[_0x5beb('0x16')](respondWithResult(_0xa459de,null))[_0x5beb('0x33')](handleError(_0xa459de,null));};exports[_0x5beb('0x55')]=function(_0xdf409a,_0x4a90d8){var _0x38fd27=_0xdf409a['body'][_0x5beb('0x56')];return db[_0x5beb('0x57')][_0x5beb('0x27')]({'where':{'id':_0x38fd27},'attributes':['id'],'include':[{'model':db[_0x5beb('0x48')],'as':'Agents','attributes':['id','name',_0x5beb('0x58'),_0x5beb('0x59'),_0x5beb('0x5a')],'raw':!![]}]})[_0x5beb('0x16')](function(_0x4c98a0){if(_0x4c98a0){var _0x37bb3b=_[_0x5beb('0x5b')](_0x4c98a0,function(_0x1a6f87){var _0x32089d=_0x1a6f87[_0x5beb('0x18')]({'plain':!![]});return _0x32089d[_0x5beb('0x5c')];});return db[_0x5beb('0x24')]['find']({'where':{'id':_0xdf409a[_0x5beb('0x29')]['id']}})[_0x5beb('0x16')](function(_0x49b7e3){return db[_0x5beb('0x5d')][_0x5beb('0x5e')](function(_0x36dc20){return _0x49b7e3['addTeams'](_0x38fd27,{'transaction':_0x36dc20})[_0x5beb('0x16')](function(){return BPromise[_0x5beb('0x5f')](_0x37bb3b,function(_0x44c435){return db[_0x5beb('0x40')][_0x5beb('0x60')]({'where':{'UserId':_0x44c435['id'],'ChatQueueId':_0xdf409a[_0x5beb('0x29')]['id']},'transaction':_0x36dc20});});})['then'](function(){_0x37bb3b[_0x5beb('0x61')](function(_0x34cce1){socket['emit'](_0x5beb('0x62'),{'UserId':_0x34cce1['id'],'ChatQueueId':_0x49b7e3['id']});});});});});}})[_0x5beb('0x16')](respondWithStatusCode(_0x4a90d8,null))[_0x5beb('0x33')](handleError(_0x4a90d8,null));};exports[_0x5beb('0x63')]=function(_0x4c2dff,_0x4ca7b8){return db[_0x5beb('0x57')][_0x5beb('0x27')]({'where':{'id':_0x4c2dff[_0x5beb('0x26')][_0x5beb('0x56')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4ca7b8,null))[_0x5beb('0x16')](function(_0x139014){var _0x3b7378=_[_0x5beb('0x1f')](_0x139014,'id');var _0xd2ea68=[];var _0x571d82=[];var _0x1af8ec=squel[_0x5beb('0x64')]();_0x1af8ec[_0x5beb('0x65')](_0x5beb('0x66'))['from'](_0x5beb('0x67'),'tq')[_0x5beb('0x68')](_0x5beb('0x69'),'ut',_0x5beb('0x6a'))[_0x5beb('0x23')](_0x5beb('0x6b'),_0x4c2dff[_0x5beb('0x29')]['id']);for(var _0x36b04c=0x0;_0x36b04c<_0x139014[_0x5beb('0x30')];_0x36b04c+=0x1){let _0x7eef0f=_0x139014[_0x36b04c];for(var _0x2b2d70=0x0;_0x2b2d70<_0x7eef0f[_0x5beb('0x5c')]['length'];_0x2b2d70+=0x1){let _0x95bb8d=_0x7eef0f['Agents'][_0x2b2d70];var _0x19c3be=_0x1af8ec[_0x5beb('0x6c')]();_0x19c3be[_0x5beb('0x23')](_0x5beb('0x6d'),_0x95bb8d['id']);_0x571d82[_0x5beb('0x6e')](db[_0x5beb('0x5d')]['query'](_0x19c3be[_0x5beb('0x6f')](),{'type':db[_0x5beb('0x5d')][_0x5beb('0x70')]['SELECT']})[_0x5beb('0x16')](function(_0x178a43){if(_0x178a43[_0x5beb('0x30')]===0x1){return _0x95bb8d['id'];}else{var _0x4d1eed=_[_0x5beb('0x71')](_[_0x5beb('0x1f')](_0x178a43,'TeamId'),function(_0x467e83){return _['includes'](_0x3b7378,_0x467e83);});if(_0x4d1eed){return _0x95bb8d['id'];}}}));}}return BPromise['all'](_0x571d82)[_0x5beb('0x16')](function(_0x5f4d2b){_0xd2ea68=_(_0xd2ea68)[_0x5beb('0x72')](_0x5f4d2b)['compact']()['value']();return db[_0x5beb('0x24')][_0x5beb('0x3a')]({'where':{'id':_0x4c2dff['params']['id']}})[_0x5beb('0x16')](function(_0x32d860){return db[_0x5beb('0x5d')][_0x5beb('0x5e')](function(_0x2752bc){return _0x32d860[_0x5beb('0x63')](_0x4c2dff[_0x5beb('0x26')][_0x5beb('0x56')],{'transaction':_0x2752bc})[_0x5beb('0x16')](function(){if(!_['isEmpty'](_0xd2ea68)){return _0x32d860[_0x5beb('0x73')](_0xd2ea68,{'transaction':_0x2752bc});}})[_0x5beb('0x16')](function(){_0xd2ea68[_0x5beb('0x61')](function(_0x3b16f6){socket['emit'](_0x5beb('0x74'),{'UserId':_0x3b16f6,'ChatQueueId':_0x32d860['id']});});});});});});})[_0x5beb('0x16')](respondWithStatusCode(_0x4ca7b8,null))[_0x5beb('0x33')](handleError(_0x4ca7b8,null));};exports['addAgents']=function(_0x516c36,_0x5ed3d1){return db[_0x5beb('0x24')][_0x5beb('0x3a')]({'where':{'id':_0x516c36[_0x5beb('0x29')]['id']}})[_0x5beb('0x16')](handleEntityNotFound(_0x5ed3d1,null))[_0x5beb('0x16')](function(_0x33137d){if(_0x33137d){return _0x33137d['addAgents'](_0x516c36['body'][_0x5beb('0x56')],_[_0x5beb('0x75')](_0x516c36[_0x5beb('0x35')],[_0x5beb('0x56'),'id'])||{})[_0x5beb('0x76')](function(_0x35db13){for(var _0x432376=0x0;_0x432376<_0x516c36[_0x5beb('0x35')][_0x5beb('0x56')][_0x5beb('0x30')];_0x432376+=0x1){socket[_0x5beb('0x77')](_0x5beb('0x62'),{'UserId':Number(_0x516c36[_0x5beb('0x35')][_0x5beb('0x56')][_0x432376]),'ChatQueueId':Number(_0x516c36[_0x5beb('0x29')]['id'])});}return _0x35db13;});}})['then'](respondWithResult(_0x5ed3d1,null))['catch'](handleError(_0x5ed3d1,null));};exports[_0x5beb('0x73')]=function(_0x1b6f99,_0x280303){return db[_0x5beb('0x24')][_0x5beb('0x3a')]({'where':{'id':_0x1b6f99[_0x5beb('0x29')]['id']}})[_0x5beb('0x16')](handleEntityNotFound(_0x280303,null))[_0x5beb('0x16')](function(_0x32aff9){if(_0x32aff9){return _0x32aff9[_0x5beb('0x73')](_0x1b6f99[_0x5beb('0x26')][_0x5beb('0x56')])[_0x5beb('0x16')](function(){if(_[_0x5beb('0x78')](_0x1b6f99[_0x5beb('0x26')][_0x5beb('0x56')])){for(var _0x427b27=0x0;_0x427b27<_0x1b6f99[_0x5beb('0x26')][_0x5beb('0x56')][_0x5beb('0x30')];_0x427b27+=0x1){socket['emit'](_0x5beb('0x74'),{'UserId':Number(_0x1b6f99[_0x5beb('0x26')][_0x5beb('0x56')][_0x427b27]),'ChatQueueId':Number(_0x1b6f99[_0x5beb('0x29')]['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x1b6f99[_0x5beb('0x26')][_0x5beb('0x56')]),'ChatQueueId':Number(_0x1b6f99[_0x5beb('0x29')]['id'])});}});}})['then'](respondWithStatusCode(_0x280303,null))[_0x5beb('0x33')](handleError(_0x280303,null));};exports[_0x5beb('0x79')]=function(_0x365797,_0x51aaeb){var _0x3a32c9={};var _0x4f72d2={};var _0x35ee5b;var _0x152c08;return db[_0x5beb('0x24')][_0x5beb('0x52')]({'where':{'id':_0x365797[_0x5beb('0x29')]['id']}})[_0x5beb('0x16')](handleEntityNotFound(_0x51aaeb,null))[_0x5beb('0x16')](function(_0x56a9b8){if(_0x56a9b8){_0x35ee5b=_0x56a9b8;_0x4f72d2['model']=_[_0x5beb('0x2c')](db[_0x5beb('0x48')][_0x5beb('0x2b')]);_0x4f72d2[_0x5beb('0x26')]=_[_0x5beb('0x2c')](_0x365797[_0x5beb('0x26')]);_0x4f72d2[_0x5beb('0x41')]=_[_0x5beb('0x2d')](_0x4f72d2['model'],_0x4f72d2['query']);_0x3a32c9[_0x5beb('0x2e')]=_['intersection'](_0x4f72d2[_0x5beb('0x2a')],qs['fields'](_0x365797[_0x5beb('0x26')]['fields']));_0x3a32c9[_0x5beb('0x2e')]=_0x3a32c9[_0x5beb('0x2e')]['length']?_0x3a32c9[_0x5beb('0x2e')]:_0x4f72d2[_0x5beb('0x2a')];_0x3a32c9['order']=qs[_0x5beb('0x44')](_0x365797[_0x5beb('0x26')]['sort']);_0x3a32c9[_0x5beb('0x23')]=qs['filters'](_[_0x5beb('0x45')](_0x365797[_0x5beb('0x26')],_0x4f72d2[_0x5beb('0x41')]));if(_0x365797['query'][_0x5beb('0x46')]){_0x3a32c9[_0x5beb('0x23')]=_['merge'](_0x3a32c9['where'],{'$or':_[_0x5beb('0x1f')](_0x3a32c9[_0x5beb('0x2e')],function(_0x4d5a4c){var _0x36b905={};_0x36b905[_0x4d5a4c]={'$like':'%'+_0x365797[_0x5beb('0x26')][_0x5beb('0x46')]+'%'};return _0x36b905;})});}_0x3a32c9=_[_0x5beb('0x32')]({},_0x3a32c9,_0x365797['options']);return _0x35ee5b[_0x5beb('0x79')](_0x3a32c9);}})[_0x5beb('0x16')](function(_0xc5f539){if(_0xc5f539){_0x152c08=_0xc5f539[_0x5beb('0x30')];if(!_0x365797[_0x5beb('0x26')][_0x5beb('0x42')]('nolimit')){_0x3a32c9[_0x5beb('0x10')]=qs[_0x5beb('0x10')](_0x365797[_0x5beb('0x26')]['limit']);_0x3a32c9[_0x5beb('0x11')]=qs[_0x5beb('0x11')](_0x365797[_0x5beb('0x26')]['offset']);}return _0x35ee5b[_0x5beb('0x79')](_0x3a32c9);}})[_0x5beb('0x16')](function(_0x467925){if(_0x467925){return _0x467925?{'count':_0x152c08,'rows':_0x467925}:null;}})[_0x5beb('0x16')](respondWithResult(_0x51aaeb,null))['catch'](handleError(_0x51aaeb,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 4b45edc..a608423 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 _0x2eff=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','remove'];(function(_0x323006,_0x5b327b){var _0x460838=function(_0x2637bb){while(--_0x2637bb){_0x323006['push'](_0x323006['shift']());}};_0x460838(++_0x5b327b);}(_0x2eff,0x176));var _0xf2ef=function(_0x1aca73,_0x446f01){_0x1aca73=_0x1aca73-0x0;var _0x3f06d8=_0x2eff[_0x1aca73];return _0x3f06d8;};'use strict';var EventEmitter=require(_0xf2ef('0x0'));var ChatQueue=require(_0xf2ef('0x1'))['db'][_0xf2ef('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf2ef('0x3')](0x0);var events={'afterCreate':_0xf2ef('0x4'),'afterUpdate':'update','afterDestroy':_0xf2ef('0x5')};function emitEvent(_0x54ad49){return function(_0x45c70d,_0x2ee193,_0x4b7b8a){ChatQueueEvents[_0xf2ef('0x6')](_0x54ad49+':'+_0x45c70d['id'],_0x45c70d);ChatQueueEvents[_0xf2ef('0x6')](_0x54ad49,_0x45c70d);_0x4b7b8a(null);};}for(var e in events){if(events[_0xf2ef('0x7')](e)){var event=events[e];ChatQueue[_0xf2ef('0x8')](e,emitEvent(event));}}module[_0xf2ef('0x9')]=ChatQueueEvents;
\ No newline at end of file
+var _0x11b7=['remove','emit','hasOwnProperty','setMaxListeners'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x11b7,0x12f));var _0x711b=function(_0x421b62,_0x462715){_0x421b62=_0x421b62-0x0;var _0x1ca612=_0x11b7[_0x421b62];return _0x1ca612;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x711b('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x711b('0x1')};function emitEvent(_0x35249b){return function(_0x4be832,_0x33d111,_0x2005cf){ChatQueueEvents['emit'](_0x35249b+':'+_0x4be832['id'],_0x4be832);ChatQueueEvents[_0x711b('0x2')](_0x35249b,_0x4be832);_0x2005cf(null);};}for(var e in events){if(events[_0x711b('0x3')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index a8a40c5..0a61438 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 _0x10a4=['bluebird','request-promise','../../config/environment','./chatQueue.attributes','exports','define','chat_queues','lodash','util','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x10a4,0x1e7));var _0x410a=function(_0x384dfd,_0x54bc76){_0x384dfd=_0x384dfd-0x0;var _0x5e232c=_0x10a4[_0x384dfd];return _0x5e232c;};'use strict';var _=require(_0x410a('0x0'));var util=require(_0x410a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x410a('0x2'));var BPromise=require(_0x410a('0x3'));var rp=require(_0x410a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x410a('0x5'));var attributes=require(_0x410a('0x6'));module[_0x410a('0x7')]=function(_0x4edfa3,_0x394ad0){return _0x4edfa3[_0x410a('0x8')]('ChatQueue',attributes,{'tableName':_0x410a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbdd2=['ChatQueue','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','define'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xbdd2,0x198));var _0x2bdd=function(_0x38a8a4,_0x4838d1){_0x38a8a4=_0x38a8a4-0x0;var _0x3833d0=_0xbdd2[_0x38a8a4];return _0x3833d0;};'use strict';var _=require('lodash');var util=require(_0x2bdd('0x0'));var logger=require(_0x2bdd('0x1'))('api');var moment=require(_0x2bdd('0x2'));var BPromise=require(_0x2bdd('0x3'));var rp=require(_0x2bdd('0x4'));var fs=require('fs');var path=require(_0x2bdd('0x5'));var rimraf=require(_0x2bdd('0x6'));var config=require(_0x2bdd('0x7'));var attributes=require(_0x2bdd('0x8'));module['exports']=function(_0xc69a54,_0x41b949){return _0xc69a54[_0x2bdd('0x9')](_0x2bdd('0xa'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index bfb1d8f..4edd6f8 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 _0x5464=['localhost','socket.io-emitter','./chatQueue.socket','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','error','message','catch','GetChatQueue','ChatQueue','options','where','attributes','limit','include','map','model','find','raw','then','debug','ShowChatQueue','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis'];(function(_0xd95342,_0xb75bf6){var _0x54d694=function(_0x1190c1){while(--_0x1190c1){_0xd95342['push'](_0xd95342['shift']());}};_0x54d694(++_0xb75bf6);}(_0x5464,0x15d));var _0x4546=function(_0x14d554,_0xa46ace){_0x14d554=_0x14d554-0x0;var _0x93b623=_0x5464[_0x14d554];return _0x93b623;};'use strict';var _=require(_0x4546('0x0'));var util=require(_0x4546('0x1'));var moment=require(_0x4546('0x2'));var BPromise=require('bluebird');var rs=require(_0x4546('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4546('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4546('0x5'))(_0x4546('0x6'));var config=require(_0x4546('0x7'));var jayson=require(_0x4546('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x4546('0x9')](config[_0x4546('0xa')],{'host':_0x4546('0xb'),'port':0x18eb});var socket=require(_0x4546('0xc'))(new Redis(config[_0x4546('0xa')]));require(_0x4546('0xd'))[_0x4546('0xe')](socket);function respondWithRpcPromise(_0x430b2e,_0x383bf2,_0x4ac723){return new BPromise(function(_0x1dd3f5,_0x8a15e2){return client[_0x4546('0xf')](_0x430b2e,_0x4ac723)['then'](function(_0x1f82c9){logger[_0x4546('0x10')](_0x4546('0x11'),_0x383bf2,_0x4546('0x12'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x383bf2,_0x4546('0x12'),JSON['stringify'](_0x1f82c9));if(_0x1f82c9['error']){if(_0x1f82c9['error']['code']===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x383bf2,_0x1f82c9[_0x4546('0x13')]['message']);return _0x8a15e2(_0x1f82c9[_0x4546('0x13')]['message']);}logger[_0x4546('0x13')]('ChatQueue,\x20%s,\x20%s',_0x383bf2,_0x1f82c9[_0x4546('0x13')][_0x4546('0x14')]);return _0x1dd3f5(_0x1f82c9[_0x4546('0x13')][_0x4546('0x14')]);}else{logger[_0x4546('0x10')](_0x4546('0x11'),_0x383bf2,'request\x20sent');_0x1dd3f5(_0x1f82c9['result']['message']);}})[_0x4546('0x15')](function(_0x39f552){logger[_0x4546('0x13')](_0x4546('0x11'),_0x383bf2,_0x39f552);_0x8a15e2(_0x39f552);});});}exports[_0x4546('0x16')]=function(_0x337a44){var _0x3ec009=this;return new Promise(function(_0x2f6329,_0x4034a5){return db[_0x4546('0x17')]['findAll']({'raw':_0x337a44[_0x4546('0x18')]?_0x337a44[_0x4546('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x337a44[_0x4546('0x18')]?_0x337a44[_0x4546('0x18')][_0x4546('0x19')]||null:null,'attributes':_0x337a44[_0x4546('0x18')]?_0x337a44[_0x4546('0x18')][_0x4546('0x1a')]||null:null,'limit':_0x337a44['options']?_0x337a44[_0x4546('0x18')][_0x4546('0x1b')]||null:null,'include':_0x337a44['options']?_0x337a44[_0x4546('0x18')][_0x4546('0x1c')]?_[_0x4546('0x1d')](_0x337a44[_0x4546('0x18')][_0x4546('0x1c')],function(_0x53ae5e){return{'model':db[_0x53ae5e[_0x4546('0x1e')]],'as':_0x53ae5e['as'],'attributes':_0x53ae5e[_0x4546('0x1a')],'include':_0x53ae5e[_0x4546('0x1c')]?_['map'](_0x53ae5e['include'],function(_0x43740e){return{'model':db[_0x43740e[_0x4546('0x1e')]],'as':_0x43740e['as'],'attributes':_0x43740e[_0x4546('0x1a')],'include':_0x43740e[_0x4546('0x1c')]?_[_0x4546('0x1d')](_0x43740e[_0x4546('0x1c')],function(_0xcea7da){return{'model':db[_0xcea7da['model']],'as':_0xcea7da['as'],'attributes':_0xcea7da[_0x4546('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a2d12){logger[_0x4546('0x10')]('GetChatQueue',_0x337a44);logger['debug'](_0x4546('0x16'),_0x337a44,JSON['stringify'](_0x3a2d12));_0x2f6329(_0x3a2d12);})[_0x4546('0x15')](function(_0x58b69){logger['error']('GetChatQueue',_0x58b69[_0x4546('0x14')],_0x337a44);_0x4034a5(_0x3ec009[_0x4546('0x13')](0x1f4,_0x58b69[_0x4546('0x14')]));});});};exports['ShowChatQueue']=function(_0x10db2e){var _0x2c8e44=this;return new Promise(function(_0x540983,_0xad1b9c){return db['ChatQueue'][_0x4546('0x1f')]({'raw':_0x10db2e[_0x4546('0x18')]?_0x10db2e[_0x4546('0x18')][_0x4546('0x20')]===undefined?!![]:![]:!![],'where':_0x10db2e['options']?_0x10db2e[_0x4546('0x18')][_0x4546('0x19')]||null:null,'attributes':_0x10db2e[_0x4546('0x18')]?_0x10db2e[_0x4546('0x18')][_0x4546('0x1a')]||null:null,'include':_0x10db2e[_0x4546('0x18')]?_0x10db2e['options'][_0x4546('0x1c')]?_[_0x4546('0x1d')](_0x10db2e['options']['include'],function(_0x3eb8e8){return{'model':db[_0x3eb8e8[_0x4546('0x1e')]],'as':_0x3eb8e8['as'],'attributes':_0x3eb8e8['attributes'],'include':_0x3eb8e8[_0x4546('0x1c')]?_[_0x4546('0x1d')](_0x3eb8e8['include'],function(_0x5acdc0){return{'model':db[_0x5acdc0[_0x4546('0x1e')]],'as':_0x5acdc0['as'],'attributes':_0x5acdc0[_0x4546('0x1a')],'include':_0x5acdc0[_0x4546('0x1c')]?_[_0x4546('0x1d')](_0x5acdc0[_0x4546('0x1c')],function(_0x24ae41){return{'model':db[_0x24ae41['model']],'as':_0x24ae41['as'],'attributes':_0x24ae41[_0x4546('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4546('0x21')](function(_0x4a70f5){logger[_0x4546('0x10')]('ShowChatQueue',_0x10db2e);logger[_0x4546('0x22')](_0x4546('0x23'),_0x10db2e,JSON['stringify'](_0x4a70f5));_0x540983(_0x4a70f5);})['catch'](function(_0x104d56){logger[_0x4546('0x13')](_0x4546('0x23'),_0x104d56['message'],_0x10db2e);_0xad1b9c(_0x2c8e44[_0x4546('0x13')](0x1f4,_0x104d56[_0x4546('0x14')]));});});};
\ No newline at end of file
+var _0x6a18=['redis','defaults','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowChatQueue','ChatQueue','find','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x7ff957,_0x3815a2){var _0x53ccf2=function(_0xa1cfb0){while(--_0xa1cfb0){_0x7ff957['push'](_0x7ff957['shift']());}};_0x53ccf2(++_0x3815a2);}(_0x6a18,0x114));var _0x86a1=function(_0x301dce,_0x5c03c4){_0x301dce=_0x301dce-0x0;var _0x494ac3=_0x6a18[_0x301dce];return _0x494ac3;};'use strict';var _=require(_0x86a1('0x0'));var util=require(_0x86a1('0x1'));var moment=require(_0x86a1('0x2'));var BPromise=require(_0x86a1('0x3'));var rs=require(_0x86a1('0x4'));var fs=require('fs');var Redis=require(_0x86a1('0x5'));var db=require(_0x86a1('0x6'))['db'];var utils=require(_0x86a1('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x86a1('0x8'));var jayson=require(_0x86a1('0x9'));var client=jayson[_0x86a1('0xa')]['http']({'port':0x232a});config[_0x86a1('0xb')]=_[_0x86a1('0xc')](config[_0x86a1('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x86a1('0xd'))(new Redis(config[_0x86a1('0xb')]));require(_0x86a1('0xe'))[_0x86a1('0xf')](socket);function respondWithRpcPromise(_0x46a079,_0x316957,_0x54b8b0){return new BPromise(function(_0x195a0d,_0x3946f2){return client[_0x86a1('0x10')](_0x46a079,_0x54b8b0)[_0x86a1('0x11')](function(_0xf2ddeb){logger[_0x86a1('0x12')](_0x86a1('0x13'),_0x316957,_0x86a1('0x14'));logger['debug'](_0x86a1('0x15'),_0x316957,_0x86a1('0x14'),JSON[_0x86a1('0x16')](_0xf2ddeb));if(_0xf2ddeb['error']){if(_0xf2ddeb[_0x86a1('0x17')][_0x86a1('0x18')]===0x1f4){logger[_0x86a1('0x17')](_0x86a1('0x13'),_0x316957,_0xf2ddeb[_0x86a1('0x17')]['message']);return _0x3946f2(_0xf2ddeb[_0x86a1('0x17')][_0x86a1('0x19')]);}logger['error'](_0x86a1('0x13'),_0x316957,_0xf2ddeb[_0x86a1('0x17')][_0x86a1('0x19')]);return _0x195a0d(_0xf2ddeb[_0x86a1('0x17')][_0x86a1('0x19')]);}else{logger[_0x86a1('0x12')](_0x86a1('0x13'),_0x316957,'request\x20sent');_0x195a0d(_0xf2ddeb['result']['message']);}})[_0x86a1('0x1a')](function(_0x2fe33b){logger['error'](_0x86a1('0x13'),_0x316957,_0x2fe33b);_0x3946f2(_0x2fe33b);});});}exports[_0x86a1('0x1b')]=function(_0x1ef692){var _0x7f88ba=this;return new Promise(function(_0x440a4d,_0x54478a){return db['ChatQueue'][_0x86a1('0x1c')]({'raw':_0x1ef692[_0x86a1('0x1d')]?_0x1ef692[_0x86a1('0x1d')][_0x86a1('0x1e')]===undefined?!![]:![]:!![],'where':_0x1ef692['options']?_0x1ef692[_0x86a1('0x1d')][_0x86a1('0x1f')]||null:null,'attributes':_0x1ef692['options']?_0x1ef692[_0x86a1('0x1d')][_0x86a1('0x20')]||null:null,'limit':_0x1ef692[_0x86a1('0x1d')]?_0x1ef692[_0x86a1('0x1d')][_0x86a1('0x21')]||null:null,'include':_0x1ef692['options']?_0x1ef692[_0x86a1('0x1d')][_0x86a1('0x22')]?_['map'](_0x1ef692['options'][_0x86a1('0x22')],function(_0x38c4cb){return{'model':db[_0x38c4cb['model']],'as':_0x38c4cb['as'],'attributes':_0x38c4cb[_0x86a1('0x20')],'include':_0x38c4cb[_0x86a1('0x22')]?_[_0x86a1('0x23')](_0x38c4cb[_0x86a1('0x22')],function(_0x48ccb7){return{'model':db[_0x48ccb7[_0x86a1('0x24')]],'as':_0x48ccb7['as'],'attributes':_0x48ccb7['attributes'],'include':_0x48ccb7[_0x86a1('0x22')]?_[_0x86a1('0x23')](_0x48ccb7[_0x86a1('0x22')],function(_0x2676f5){return{'model':db[_0x2676f5[_0x86a1('0x24')]],'as':_0x2676f5['as'],'attributes':_0x2676f5[_0x86a1('0x20')]};}):[]};}):[]};}):[]:[]})[_0x86a1('0x11')](function(_0x2f9cdc){logger[_0x86a1('0x12')](_0x86a1('0x1b'),_0x1ef692);logger['debug'](_0x86a1('0x1b'),_0x1ef692,JSON[_0x86a1('0x16')](_0x2f9cdc));_0x440a4d(_0x2f9cdc);})[_0x86a1('0x1a')](function(_0x5c39d7){logger[_0x86a1('0x17')](_0x86a1('0x1b'),_0x5c39d7[_0x86a1('0x19')],_0x1ef692);_0x54478a(_0x7f88ba[_0x86a1('0x17')](0x1f4,_0x5c39d7['message']));});});};exports[_0x86a1('0x25')]=function(_0xc88fc8){var _0x565e70=this;return new Promise(function(_0x3f69ce,_0x25e119){return db[_0x86a1('0x26')][_0x86a1('0x27')]({'raw':_0xc88fc8[_0x86a1('0x1d')]?_0xc88fc8['options'][_0x86a1('0x1e')]===undefined?!![]:![]:!![],'where':_0xc88fc8['options']?_0xc88fc8[_0x86a1('0x1d')]['where']||null:null,'attributes':_0xc88fc8[_0x86a1('0x1d')]?_0xc88fc8[_0x86a1('0x1d')][_0x86a1('0x20')]||null:null,'include':_0xc88fc8[_0x86a1('0x1d')]?_0xc88fc8['options']['include']?_[_0x86a1('0x23')](_0xc88fc8[_0x86a1('0x1d')][_0x86a1('0x22')],function(_0x49baa8){return{'model':db[_0x49baa8[_0x86a1('0x24')]],'as':_0x49baa8['as'],'attributes':_0x49baa8['attributes'],'include':_0x49baa8[_0x86a1('0x22')]?_[_0x86a1('0x23')](_0x49baa8[_0x86a1('0x22')],function(_0x2849f9){return{'model':db[_0x2849f9['model']],'as':_0x2849f9['as'],'attributes':_0x2849f9[_0x86a1('0x20')],'include':_0x2849f9['include']?_[_0x86a1('0x23')](_0x2849f9[_0x86a1('0x22')],function(_0x14898c){return{'model':db[_0x14898c[_0x86a1('0x24')]],'as':_0x14898c['as'],'attributes':_0x14898c[_0x86a1('0x20')]};}):[]};}):[]};}):[]:[]})[_0x86a1('0x11')](function(_0x3194ff){logger['info']('ShowChatQueue',_0xc88fc8);logger[_0x86a1('0x28')](_0x86a1('0x25'),_0xc88fc8,JSON[_0x86a1('0x16')](_0x3194ff));_0x3f69ce(_0x3194ff);})[_0x86a1('0x1a')](function(_0x527926){logger['error']('ShowChatQueue',_0x527926[_0x86a1('0x19')],_0xc88fc8);_0x25e119(_0x565e70[_0x86a1('0x17')](0x1f4,_0x527926[_0x86a1('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index a158c01..7713ed4 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 _0x0faf=['update','emit','removeListener','length','chatQueue:','./chatQueue.events','remove'];(function(_0x4ffa64,_0x271035){var _0x5da001=function(_0x7d1940){while(--_0x7d1940){_0x4ffa64['push'](_0x4ffa64['shift']());}};_0x5da001(++_0x271035);}(_0x0faf,0x132));var _0xf0fa=function(_0x16e0f5,_0x4ec0f3){_0x16e0f5=_0x16e0f5-0x0;var _0x4839d5=_0x0faf[_0x16e0f5];return _0x4839d5;};'use strict';var ChatQueueEvents=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(){ChatQueueEvents[_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);ChatQueueEvents['on'](_0x2db1d9,_0x587865);}};
\ No newline at end of file
+var _0x2d17=['update','emit','register','chatQueue:','./chatQueue.events','save'];(function(_0xbdd366,_0x1f09f5){var _0x53a53e=function(_0x10782b){while(--_0x10782b){_0xbdd366['push'](_0xbdd366['shift']());}};_0x53a53e(++_0x1f09f5);}(_0x2d17,0x17e));var _0x72d1=function(_0x27c26c,_0x243245){_0x27c26c=_0x27c26c-0x0;var _0x3335ec=_0x2d17[_0x27c26c];return _0x3335ec;};'use strict';var ChatQueueEvents=require(_0x72d1('0x0'));var events=[_0x72d1('0x1'),'remove',_0x72d1('0x2')];function createListener(_0x4727f9,_0x531f4e){return function(_0x3687bc){_0x531f4e[_0x72d1('0x3')](_0x4727f9,_0x3687bc);};}function removeListener(_0x55b722,_0x1dd6d8){return function(){ChatQueueEvents['removeListener'](_0x55b722,_0x1dd6d8);};}exports[_0x72d1('0x4')]=function(_0x50f551){for(var _0x139ba0=0x0,_0x239d1f=events['length'];_0x139ba0<_0x239d1f;_0x139ba0++){var _0x477264=events[_0x139ba0];var _0x422f5a=createListener(_0x72d1('0x5')+_0x477264,_0x50f551);ChatQueueEvents['on'](_0x477264,_0x422f5a);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index ebaa03f..874f2ca 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 _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x3097ee,_0x5d0bc8){var _0x40e045=function(_0x5d7fd4){while(--_0x5d7fd4){_0x3097ee['push'](_0x3097ee['shift']());}};_0x40e045(++_0x5d0bc8);}(_0x7217,0x19e));var _0x7721=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x7217[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router;
\ No newline at end of file
+var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x3f571c,_0x532e5c){var _0x4910ad=function(_0x332d43){while(--_0x332d43){_0x3f571c['push'](_0x3f571c['shift']());}};_0x4910ad(++_0x532e5c);}(_0x55ca,0x126));var _0xa55c=function(_0x3891e8,_0x3b6b95){_0x3891e8=_0x3891e8-0x0;var _0xc34c60=_0x55ca[_0x3891e8];return _0xc34c60;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 81a0280..1f8de3e 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 _0xb083=['STRING','DATE','moment','exports'];(function(_0x415c03,_0x3c87b0){var _0x3d51f9=function(_0x282598){while(--_0x282598){_0x415c03['push'](_0x415c03['shift']());}};_0x3d51f9(++_0x3c87b0);}(_0xb083,0xf6));var _0x3b08=function(_0x10e638,_0x3f3263){_0x10e638=_0x10e638-0x0;var _0xb67520=_0xb083[_0x10e638];return _0xb67520;};'use strict';var moment=require(_0x3b08('0x0'));var Sequelize=require('sequelize');module[_0x3b08('0x1')]={'uniqueid':{'type':Sequelize[_0x3b08('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x3b08('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x3b08('0x3')]},'exitAt':{'type':Sequelize[_0x3b08('0x3')]},'reason':{'type':Sequelize[_0x3b08('0x2')]}};
\ No newline at end of file
+var _0x1092=['DATE','moment','STRING'];(function(_0x378d7f,_0x4bfe7d){var _0xc01f95=function(_0x30280f){while(--_0x30280f){_0x378d7f['push'](_0x378d7f['shift']());}};_0xc01f95(++_0x4bfe7d);}(_0x1092,0x1ed));var _0x2109=function(_0x2428d5,_0x1bea56){_0x2428d5=_0x2428d5-0x0;var _0x40e112=_0x1092[_0x2428d5];return _0x40e112;};'use strict';var moment=require(_0x2109('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x2109('0x1')]},'joinAt':{'type':Sequelize[_0x2109('0x2')]},'leaveAt':{'type':Sequelize[_0x2109('0x2')]},'acceptAt':{'type':Sequelize[_0x2109('0x2')]},'exitAt':{'type':Sequelize[_0x2109('0x2')]},'reason':{'type':Sequelize[_0x2109('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index c196006..2d8bf61 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 _0xf2e3=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','error','stack','name','send','index','ChatQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','map','VIRTUAL','then','includeAll','include','rows','catch','show','params','create','body','update','destroy','find','describe','eml-format'];(function(_0x15cece,_0x19147f){var _0x182734=function(_0x12c3c1){while(--_0x12c3c1){_0x15cece['push'](_0x15cece['shift']());}};_0x182734(++_0x19147f);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0xf2e3[_0x3740fe];return _0x55492b;};'use strict';var emlformat=require(_0x3f2e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3f2e('0x1'));var jsonpatch=require(_0x3f2e('0x2'));var rp=require(_0x3f2e('0x3'));var moment=require(_0x3f2e('0x4'));var BPromise=require(_0x3f2e('0x5'));var Mustache=require(_0x3f2e('0x6'));var util=require(_0x3f2e('0x7'));var path=require(_0x3f2e('0x8'));var sox=require(_0x3f2e('0x9'));var csv=require('to-csv');var ejs=require(_0x3f2e('0xa'));var fs=require('fs');var fs_extra=require(_0x3f2e('0xb'));var _=require(_0x3f2e('0xc'));var squel=require(_0x3f2e('0xd'));var crypto=require(_0x3f2e('0xe'));var jsforce=require(_0x3f2e('0xf'));var deskjs=require(_0x3f2e('0x10'));var toCsv=require(_0x3f2e('0x11'));var querystring=require(_0x3f2e('0x12'));var Papa=require(_0x3f2e('0x13'));var Redis=require(_0x3f2e('0x14'));var authService=require(_0x3f2e('0x15'));var qs=require(_0x3f2e('0x16'));var as=require(_0x3f2e('0x17'));var hardwareService=require(_0x3f2e('0x18'));var logger=require(_0x3f2e('0x19'))(_0x3f2e('0x1a'));var utils=require(_0x3f2e('0x1b'));var config=require(_0x3f2e('0x1c'));var licenseUtil=require('../../config/license/util');var db=require(_0x3f2e('0x1d'))['db'];function respondWithStatusCode(_0xaa6ef5,_0x5471f9){_0x5471f9=_0x5471f9||0xcc;return function(_0xe83663){if(_0xe83663){return _0xaa6ef5[_0x3f2e('0x1e')](_0x5471f9);}return _0xaa6ef5[_0x3f2e('0x1f')](_0x5471f9)[_0x3f2e('0x20')]();};}function respondWithResult(_0x3d20d1,_0x57cba7){_0x57cba7=_0x57cba7||0xc8;return function(_0x298080){if(_0x298080){return _0x3d20d1[_0x3f2e('0x1f')](_0x57cba7)[_0x3f2e('0x21')](_0x298080);}};}function respondWithFilteredResult(_0x4f2e38,_0x43f69e){return function(_0x218b44){if(_0x218b44){var _0x17ef58=typeof _0x43f69e[_0x3f2e('0x22')]===_0x3f2e('0x23')&&typeof _0x43f69e[_0x3f2e('0x24')]===_0x3f2e('0x23');var _0x155411=_0x218b44[_0x3f2e('0x25')];var _0xc00add=_0x17ef58?0x0:_0x43f69e[_0x3f2e('0x22')];var _0x5b9989=_0x17ef58?_0x218b44[_0x3f2e('0x25')]:_0x43f69e[_0x3f2e('0x22')]+_0x43f69e[_0x3f2e('0x24')];var _0xbe899c;if(_0x5b9989>=_0x155411){_0x5b9989=_0x155411;_0xbe899c=0xc8;}else{_0xbe899c=0xce;}_0x4f2e38[_0x3f2e('0x1f')](_0xbe899c);return _0x4f2e38['set']('Content-Range',_0xc00add+'-'+_0x5b9989+'/'+_0x155411)[_0x3f2e('0x21')](_0x218b44);}return null;};}function patchUpdates(_0x11f84c){return function(_0x38bbae){try{jsonpatch[_0x3f2e('0x26')](_0x38bbae,_0x11f84c,!![]);}catch(_0x4381e5){return BPromise[_0x3f2e('0x27')](_0x4381e5);}return _0x38bbae['save']();};}function saveUpdates(_0x5a7047,_0xf81165){return function(_0x37dab2){if(_0x37dab2){return _0x37dab2['update'](_0x5a7047)['then'](function(_0x46bb1c){return _0x46bb1c;});}return null;};}function removeEntity(_0x5646f5,_0x1b8c67){return function(_0x401ed9){if(_0x401ed9){return _0x401ed9['destroy']()['then'](function(){_0x5646f5['status'](0xcc)[_0x3f2e('0x20')]();});}};}function handleEntityNotFound(_0x3d7631,_0x4c61d9){return function(_0x11a7cc){if(!_0x11a7cc){_0x3d7631['sendStatus'](0x194);}return _0x11a7cc;};}function handleError(_0x1ad875,_0x598541){_0x598541=_0x598541||0x1f4;return function(_0x2806d0){logger[_0x3f2e('0x28')](_0x2806d0[_0x3f2e('0x29')]);if(_0x2806d0[_0x3f2e('0x2a')]){delete _0x2806d0[_0x3f2e('0x2a')];}_0x1ad875['status'](_0x598541)[_0x3f2e('0x2b')](_0x2806d0);};}exports[_0x3f2e('0x2c')]=function(_0x5eab38,_0x528063){var _0x2b9fda={},_0x1e5db4={},_0x35f421={'count':0x0,'rows':[]};var _0x22e6ad=_['map'](db[_0x3f2e('0x2d')][_0x3f2e('0x2e')],function(_0x37ddfe){return{'name':_0x37ddfe['fieldName'],'type':_0x37ddfe[_0x3f2e('0x2f')][_0x3f2e('0x30')]};});_0x1e5db4[_0x3f2e('0x31')]=_['map'](_0x22e6ad,_0x3f2e('0x2a'));_0x1e5db4[_0x3f2e('0x32')]=_[_0x3f2e('0x33')](_0x5eab38[_0x3f2e('0x32')]);_0x1e5db4[_0x3f2e('0x34')]=_[_0x3f2e('0x35')](_0x1e5db4['model'],_0x1e5db4[_0x3f2e('0x32')]);_0x2b9fda[_0x3f2e('0x36')]=_[_0x3f2e('0x35')](_0x1e5db4[_0x3f2e('0x31')],qs[_0x3f2e('0x37')](_0x5eab38[_0x3f2e('0x32')][_0x3f2e('0x37')]));_0x2b9fda['attributes']=_0x2b9fda[_0x3f2e('0x36')][_0x3f2e('0x38')]?_0x2b9fda[_0x3f2e('0x36')]:_0x1e5db4[_0x3f2e('0x31')];if(!_0x5eab38['query']['hasOwnProperty'](_0x3f2e('0x39'))){_0x2b9fda[_0x3f2e('0x24')]=qs[_0x3f2e('0x24')](_0x5eab38[_0x3f2e('0x32')][_0x3f2e('0x24')]);_0x2b9fda[_0x3f2e('0x22')]=qs[_0x3f2e('0x22')](_0x5eab38[_0x3f2e('0x32')][_0x3f2e('0x22')]);}_0x2b9fda[_0x3f2e('0x3a')]=qs['sort'](_0x5eab38[_0x3f2e('0x32')][_0x3f2e('0x3b')]);_0x2b9fda[_0x3f2e('0x3c')]=qs[_0x3f2e('0x34')](_['pick'](_0x5eab38[_0x3f2e('0x32')],_0x1e5db4[_0x3f2e('0x34')]),_0x22e6ad);if(_0x5eab38[_0x3f2e('0x32')][_0x3f2e('0x3d')]){_0x2b9fda[_0x3f2e('0x3c')]=_[_0x3f2e('0x3e')](_0x2b9fda[_0x3f2e('0x3c')],{'$or':_[_0x3f2e('0x3f')](_0x22e6ad,function(_0x4c5ac2){if(_0x4c5ac2[_0x3f2e('0x2f')]!==_0x3f2e('0x40')){var _0x238b6b={};_0x238b6b[_0x4c5ac2[_0x3f2e('0x2a')]]={'$like':'%'+_0x5eab38['query'][_0x3f2e('0x3d')]+'%'};return _0x238b6b;}})});}_0x2b9fda=_[_0x3f2e('0x3e')]({},_0x2b9fda,_0x5eab38['options']);var _0x3fc694={'where':_0x2b9fda[_0x3f2e('0x3c')]};return db['ChatQueueReport'][_0x3f2e('0x25')](_0x3fc694)[_0x3f2e('0x41')](function(_0x849236){_0x35f421[_0x3f2e('0x25')]=_0x849236;if(_0x5eab38['query'][_0x3f2e('0x42')]){_0x2b9fda[_0x3f2e('0x43')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x2b9fda);})[_0x3f2e('0x41')](function(_0x23de01){_0x35f421[_0x3f2e('0x44')]=_0x23de01;return _0x35f421;})['then'](respondWithFilteredResult(_0x528063,_0x2b9fda))[_0x3f2e('0x45')](handleError(_0x528063,null));};exports[_0x3f2e('0x46')]=function(_0x43b35a,_0xe9000a){var _0x24df56={'raw':!![],'where':{'id':_0x43b35a[_0x3f2e('0x47')]['id']}},_0x3668dc={};_0x3668dc[_0x3f2e('0x31')]=_[_0x3f2e('0x33')](db[_0x3f2e('0x2d')]['rawAttributes']);_0x3668dc['query']=_[_0x3f2e('0x33')](_0x43b35a[_0x3f2e('0x32')]);_0x3668dc['filters']=_['intersection'](_0x3668dc[_0x3f2e('0x31')],_0x3668dc[_0x3f2e('0x32')]);_0x24df56[_0x3f2e('0x36')]=_['intersection'](_0x3668dc[_0x3f2e('0x31')],qs[_0x3f2e('0x37')](_0x43b35a[_0x3f2e('0x32')]['fields']));_0x24df56[_0x3f2e('0x36')]=_0x24df56[_0x3f2e('0x36')][_0x3f2e('0x38')]?_0x24df56['attributes']:_0x3668dc[_0x3f2e('0x31')];if(_0x43b35a[_0x3f2e('0x32')][_0x3f2e('0x42')]){_0x24df56['include']=[{'all':!![]}];}_0x24df56=_[_0x3f2e('0x3e')]({},_0x24df56,_0x43b35a['options']);return db[_0x3f2e('0x2d')]['find'](_0x24df56)['then'](handleEntityNotFound(_0xe9000a,null))[_0x3f2e('0x41')](respondWithResult(_0xe9000a,null))[_0x3f2e('0x45')](handleError(_0xe9000a,null));};exports[_0x3f2e('0x48')]=function(_0x3d6fd2,_0x3e7fac){return db['ChatQueueReport']['create'](_0x3d6fd2[_0x3f2e('0x49')],{})[_0x3f2e('0x41')](respondWithResult(_0x3e7fac,0xc9))[_0x3f2e('0x45')](handleError(_0x3e7fac,null));};exports[_0x3f2e('0x4a')]=function(_0x39dbd1,_0xb891b2){if(_0x39dbd1[_0x3f2e('0x49')]['id']){delete _0x39dbd1[_0x3f2e('0x49')]['id'];}return db[_0x3f2e('0x2d')]['find']({'where':{'id':_0x39dbd1['params']['id']}})[_0x3f2e('0x41')](handleEntityNotFound(_0xb891b2,null))['then'](saveUpdates(_0x39dbd1[_0x3f2e('0x49')],null))[_0x3f2e('0x41')](respondWithResult(_0xb891b2,null))[_0x3f2e('0x45')](handleError(_0xb891b2,null));};exports[_0x3f2e('0x4b')]=function(_0x4b6950,_0xd871da){return db['ChatQueueReport'][_0x3f2e('0x4c')]({'where':{'id':_0x4b6950[_0x3f2e('0x47')]['id']}})['then'](handleEntityNotFound(_0xd871da,null))[_0x3f2e('0x41')](removeEntity(_0xd871da,null))['catch'](handleError(_0xd871da,null));};exports[_0x3f2e('0x4d')]=function(_0x336003,_0x9ccf3b){return db['ChatQueueReport'][_0x3f2e('0x4d')]()[_0x3f2e('0x41')](respondWithResult(_0x9ccf3b,null))[_0x3f2e('0x45')](handleError(_0x9ccf3b,null));};
\ No newline at end of file
+var _0x9c48=['body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','includeAll','findAll','rows','catch','show','keys','options','find','create'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x9c48,0xa1));var _0x89c4=function(_0x4a2d92,_0x24671f){_0x4a2d92=_0x4a2d92-0x0;var _0x2cf74e=_0x9c48[_0x4a2d92];return _0x2cf74e;};'use strict';var emlformat=require(_0x89c4('0x0'));var rimraf=require(_0x89c4('0x1'));var zipdir=require(_0x89c4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x89c4('0x3'));var moment=require(_0x89c4('0x4'));var BPromise=require(_0x89c4('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x89c4('0x6'));var sox=require(_0x89c4('0x7'));var csv=require('to-csv');var ejs=require(_0x89c4('0x8'));var fs=require('fs');var fs_extra=require(_0x89c4('0x9'));var _=require(_0x89c4('0xa'));var squel=require(_0x89c4('0xb'));var crypto=require(_0x89c4('0xc'));var jsforce=require(_0x89c4('0xd'));var deskjs=require(_0x89c4('0xe'));var toCsv=require(_0x89c4('0xf'));var querystring=require(_0x89c4('0x10'));var Papa=require(_0x89c4('0x11'));var Redis=require(_0x89c4('0x12'));var authService=require(_0x89c4('0x13'));var qs=require(_0x89c4('0x14'));var as=require(_0x89c4('0x15'));var hardwareService=require(_0x89c4('0x16'));var logger=require(_0x89c4('0x17'))(_0x89c4('0x18'));var utils=require(_0x89c4('0x19'));var config=require(_0x89c4('0x1a'));var licenseUtil=require(_0x89c4('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59516a,_0x58f872){_0x58f872=_0x58f872||0xcc;return function(_0x1d2e9d){if(_0x1d2e9d){return _0x59516a[_0x89c4('0x1c')](_0x58f872);}return _0x59516a[_0x89c4('0x1d')](_0x58f872)[_0x89c4('0x1e')]();};}function respondWithResult(_0x620757,_0x18d0bf){_0x18d0bf=_0x18d0bf||0xc8;return function(_0x84b446){if(_0x84b446){return _0x620757['status'](_0x18d0bf)[_0x89c4('0x1f')](_0x84b446);}};}function respondWithFilteredResult(_0x2bd1d8,_0x5aefe9){return function(_0x4207a5){if(_0x4207a5){var _0x5cd765=typeof _0x5aefe9[_0x89c4('0x20')]===_0x89c4('0x21')&&typeof _0x5aefe9[_0x89c4('0x22')]==='undefined';var _0x41cb06=_0x4207a5['count'];var _0x29342c=_0x5cd765?0x0:_0x5aefe9[_0x89c4('0x20')];var _0x574f49=_0x5cd765?_0x4207a5[_0x89c4('0x23')]:_0x5aefe9['offset']+_0x5aefe9['limit'];var _0x40617b;if(_0x574f49>=_0x41cb06){_0x574f49=_0x41cb06;_0x40617b=0xc8;}else{_0x40617b=0xce;}_0x2bd1d8[_0x89c4('0x1d')](_0x40617b);return _0x2bd1d8[_0x89c4('0x24')]('Content-Range',_0x29342c+'-'+_0x574f49+'/'+_0x41cb06)[_0x89c4('0x1f')](_0x4207a5);}return null;};}function patchUpdates(_0x5b8a37){return function(_0x38e347){try{jsonpatch[_0x89c4('0x25')](_0x38e347,_0x5b8a37,!![]);}catch(_0x55473d){return BPromise[_0x89c4('0x26')](_0x55473d);}return _0x38e347[_0x89c4('0x27')]();};}function saveUpdates(_0x398fc4,_0xc528ee){return function(_0x15ad38){if(_0x15ad38){return _0x15ad38[_0x89c4('0x28')](_0x398fc4)['then'](function(_0x330226){return _0x330226;});}return null;};}function removeEntity(_0x41be54,_0x59e8ee){return function(_0x2e7e6b){if(_0x2e7e6b){return _0x2e7e6b[_0x89c4('0x29')]()[_0x89c4('0x2a')](function(){_0x41be54[_0x89c4('0x1d')](0xcc)[_0x89c4('0x1e')]();});}};}function handleEntityNotFound(_0xa739bd,_0x4f0b19){return function(_0x13d4db){if(!_0x13d4db){_0xa739bd[_0x89c4('0x1c')](0x194);}return _0x13d4db;};}function handleError(_0x1d95f6,_0x1d65c5){_0x1d65c5=_0x1d65c5||0x1f4;return function(_0x17c9f9){logger[_0x89c4('0x2b')](_0x17c9f9[_0x89c4('0x2c')]);if(_0x17c9f9[_0x89c4('0x2d')]){delete _0x17c9f9[_0x89c4('0x2d')];}_0x1d95f6[_0x89c4('0x1d')](_0x1d65c5)[_0x89c4('0x2e')](_0x17c9f9);};}exports[_0x89c4('0x2f')]=function(_0x79e258,_0xba0375){var _0x51fcda={},_0x5e9b35={},_0x271404={'count':0x0,'rows':[]};var _0x5e214e=_[_0x89c4('0x30')](db[_0x89c4('0x31')][_0x89c4('0x32')],function(_0x387e72){return{'name':_0x387e72[_0x89c4('0x33')],'type':_0x387e72[_0x89c4('0x34')][_0x89c4('0x35')]};});_0x5e9b35[_0x89c4('0x36')]=_[_0x89c4('0x30')](_0x5e214e,_0x89c4('0x2d'));_0x5e9b35[_0x89c4('0x37')]=_['keys'](_0x79e258['query']);_0x5e9b35['filters']=_[_0x89c4('0x38')](_0x5e9b35[_0x89c4('0x36')],_0x5e9b35[_0x89c4('0x37')]);_0x51fcda[_0x89c4('0x39')]=_[_0x89c4('0x38')](_0x5e9b35[_0x89c4('0x36')],qs[_0x89c4('0x3a')](_0x79e258[_0x89c4('0x37')][_0x89c4('0x3a')]));_0x51fcda[_0x89c4('0x39')]=_0x51fcda[_0x89c4('0x39')][_0x89c4('0x3b')]?_0x51fcda['attributes']:_0x5e9b35[_0x89c4('0x36')];if(!_0x79e258['query']['hasOwnProperty'](_0x89c4('0x3c'))){_0x51fcda[_0x89c4('0x22')]=qs[_0x89c4('0x22')](_0x79e258[_0x89c4('0x37')][_0x89c4('0x22')]);_0x51fcda['offset']=qs[_0x89c4('0x20')](_0x79e258[_0x89c4('0x37')][_0x89c4('0x20')]);}_0x51fcda['order']=qs[_0x89c4('0x3d')](_0x79e258['query'][_0x89c4('0x3d')]);_0x51fcda[_0x89c4('0x3e')]=qs[_0x89c4('0x3f')](_[_0x89c4('0x40')](_0x79e258[_0x89c4('0x37')],_0x5e9b35[_0x89c4('0x3f')]),_0x5e214e);if(_0x79e258[_0x89c4('0x37')][_0x89c4('0x41')]){_0x51fcda[_0x89c4('0x3e')]=_[_0x89c4('0x42')](_0x51fcda[_0x89c4('0x3e')],{'$or':_[_0x89c4('0x30')](_0x5e214e,function(_0x301b4d){if(_0x301b4d[_0x89c4('0x34')]!=='VIRTUAL'){var _0x15a021={};_0x15a021[_0x301b4d[_0x89c4('0x2d')]]={'$like':'%'+_0x79e258[_0x89c4('0x37')][_0x89c4('0x41')]+'%'};return _0x15a021;}})});}_0x51fcda=_[_0x89c4('0x42')]({},_0x51fcda,_0x79e258['options']);var _0x218da9={'where':_0x51fcda[_0x89c4('0x3e')]};return db['ChatQueueReport'][_0x89c4('0x23')](_0x218da9)[_0x89c4('0x2a')](function(_0x1d29d8){_0x271404[_0x89c4('0x23')]=_0x1d29d8;if(_0x79e258['query'][_0x89c4('0x43')]){_0x51fcda['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0x89c4('0x44')](_0x51fcda);})[_0x89c4('0x2a')](function(_0x2612cd){_0x271404[_0x89c4('0x45')]=_0x2612cd;return _0x271404;})['then'](respondWithFilteredResult(_0xba0375,_0x51fcda))[_0x89c4('0x46')](handleError(_0xba0375,null));};exports[_0x89c4('0x47')]=function(_0x431e17,_0x292247){var _0x969e35={'raw':!![],'where':{'id':_0x431e17['params']['id']}},_0x2bd72a={};_0x2bd72a['model']=_[_0x89c4('0x48')](db[_0x89c4('0x31')][_0x89c4('0x32')]);_0x2bd72a[_0x89c4('0x37')]=_[_0x89c4('0x48')](_0x431e17[_0x89c4('0x37')]);_0x2bd72a[_0x89c4('0x3f')]=_[_0x89c4('0x38')](_0x2bd72a['model'],_0x2bd72a['query']);_0x969e35[_0x89c4('0x39')]=_[_0x89c4('0x38')](_0x2bd72a[_0x89c4('0x36')],qs['fields'](_0x431e17[_0x89c4('0x37')][_0x89c4('0x3a')]));_0x969e35[_0x89c4('0x39')]=_0x969e35[_0x89c4('0x39')][_0x89c4('0x3b')]?_0x969e35[_0x89c4('0x39')]:_0x2bd72a['model'];if(_0x431e17[_0x89c4('0x37')]['includeAll']){_0x969e35['include']=[{'all':!![]}];}_0x969e35=_[_0x89c4('0x42')]({},_0x969e35,_0x431e17[_0x89c4('0x49')]);return db['ChatQueueReport'][_0x89c4('0x4a')](_0x969e35)['then'](handleEntityNotFound(_0x292247,null))['then'](respondWithResult(_0x292247,null))[_0x89c4('0x46')](handleError(_0x292247,null));};exports[_0x89c4('0x4b')]=function(_0xfd7317,_0x2612de){return db[_0x89c4('0x31')][_0x89c4('0x4b')](_0xfd7317[_0x89c4('0x4c')],{})[_0x89c4('0x2a')](respondWithResult(_0x2612de,0xc9))['catch'](handleError(_0x2612de,null));};exports[_0x89c4('0x28')]=function(_0x183115,_0x5e0b35){if(_0x183115[_0x89c4('0x4c')]['id']){delete _0x183115[_0x89c4('0x4c')]['id'];}return db[_0x89c4('0x31')]['find']({'where':{'id':_0x183115[_0x89c4('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5e0b35,null))[_0x89c4('0x2a')](saveUpdates(_0x183115[_0x89c4('0x4c')],null))[_0x89c4('0x2a')](respondWithResult(_0x5e0b35,null))[_0x89c4('0x46')](handleError(_0x5e0b35,null));};exports['destroy']=function(_0x2e6bcc,_0x492484){return db['ChatQueueReport'][_0x89c4('0x4a')]({'where':{'id':_0x2e6bcc[_0x89c4('0x4d')]['id']}})[_0x89c4('0x2a')](handleEntityNotFound(_0x492484,null))[_0x89c4('0x2a')](removeEntity(_0x492484,null))[_0x89c4('0x46')](handleError(_0x492484,null));};exports[_0x89c4('0x4e')]=function(_0x3c4bf1,_0xb532ea){return db[_0x89c4('0x31')][_0x89c4('0x4e')]()['then'](respondWithResult(_0xb532ea,null))[_0x89c4('0x46')](handleError(_0xb532ea,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index de108e5..fae59cb 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0xf37717,_0x5afacc){var _0x992835=function(_0x1d9e55){while(--_0x1d9e55){_0xf37717['push'](_0xf37717['shift']());}};_0x992835(++_0x5afacc);}(_0xe706,0xa3));var _0x6e70=function(_0xc23380,_0x18e158){_0xc23380=_0xc23380-0x0;var _0x4b1b26=_0xe706[_0xc23380];return _0x4b1b26;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x16295e,_0x4a9b05){var _0x2d9e54=function(_0x396291){while(--_0x396291){_0x16295e['push'](_0x16295e['shift']());}};_0x2d9e54(++_0x4a9b05);}(_0xb10b,0x12a));var _0xbb10=function(_0x3c0c9e,_0x3ecdee){_0x3c0c9e=_0x3c0c9e-0x0;var _0x5ba5fe=_0xb10b[_0x3c0c9e];return _0x5ba5fe;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 57d5eb7..26fc2d3 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 _0xac11=['jayson/promise','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','options','CreateChatQueueReport','UpdateChatQueueReport','ChatQueueReport','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3a92ea,_0x2e84d2){var _0xfe2066=function(_0xc7c02f){while(--_0xc7c02f){_0x3a92ea['push'](_0x3a92ea['shift']());}};_0xfe2066(++_0x2e84d2);}(_0xac11,0x195));var _0x1ac1=function(_0x207736,_0x45c025){_0x207736=_0x207736-0x0;var _0x8784ce=_0xac11[_0x207736];return _0x8784ce;};'use strict';var _=require(_0x1ac1('0x0'));var util=require(_0x1ac1('0x1'));var moment=require(_0x1ac1('0x2'));var BPromise=require(_0x1ac1('0x3'));var rs=require(_0x1ac1('0x4'));var fs=require('fs');var Redis=require(_0x1ac1('0x5'));var db=require(_0x1ac1('0x6'))['db'];var utils=require(_0x1ac1('0x7'));var logger=require(_0x1ac1('0x8'))(_0x1ac1('0x9'));var config=require(_0x1ac1('0xa'));var jayson=require(_0x1ac1('0xb'));var client=jayson['client'][_0x1ac1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xeec73c,_0x3e922b,_0x5d114e){return new BPromise(function(_0x4a0369,_0x45320c){return client['request'](_0xeec73c,_0x5d114e)[_0x1ac1('0xd')](function(_0x30960b){logger[_0x1ac1('0xe')](_0x1ac1('0xf'),_0x3e922b,_0x1ac1('0x10'));logger[_0x1ac1('0x11')](_0x1ac1('0x12'),_0x3e922b,_0x1ac1('0x10'),JSON[_0x1ac1('0x13')](_0x30960b));if(_0x30960b['error']){if(_0x30960b[_0x1ac1('0x14')][_0x1ac1('0x15')]===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x3e922b,_0x30960b[_0x1ac1('0x14')][_0x1ac1('0x16')]);return _0x45320c(_0x30960b['error'][_0x1ac1('0x16')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x3e922b,_0x30960b[_0x1ac1('0x14')][_0x1ac1('0x16')]);return _0x4a0369(_0x30960b[_0x1ac1('0x14')]['message']);}else{logger[_0x1ac1('0xe')](_0x1ac1('0xf'),_0x3e922b,_0x1ac1('0x10'));_0x4a0369(_0x30960b[_0x1ac1('0x17')][_0x1ac1('0x16')]);}})[_0x1ac1('0x18')](function(_0x2b3128){logger[_0x1ac1('0x14')](_0x1ac1('0xf'),_0x3e922b,_0x2b3128);_0x45320c(_0x2b3128);});});}exports['CreateChatQueueReport']=function(_0x4f0126){var _0x2c6975=this;return new Promise(function(_0x2361c0,_0x3fe008){return db['ChatQueueReport'][_0x1ac1('0x19')](_0x4f0126['body'],{'raw':_0x4f0126[_0x1ac1('0x1a')]?_0x4f0126['options']['raw']===undefined?!![]:![]:!![]})[_0x1ac1('0xd')](function(_0x1dc3c3){logger['info']('CreateChatQueueReport',_0x4f0126);logger[_0x1ac1('0x11')](_0x1ac1('0x1b'),_0x4f0126,JSON[_0x1ac1('0x13')](_0x1dc3c3));_0x2361c0(_0x1dc3c3);})[_0x1ac1('0x18')](function(_0x154e6c){logger[_0x1ac1('0x14')]('CreateChatQueueReport',_0x154e6c['message'],_0x4f0126);_0x3fe008(_0x2c6975['error'](0x1f4,_0x154e6c[_0x1ac1('0x16')]));});});};exports[_0x1ac1('0x1c')]=function(_0x2c2bd0){var _0x28b387=this;return new Promise(function(_0x2568d5,_0x42cbc8){return db[_0x1ac1('0x1d')]['update'](_0x2c2bd0['body'],{'raw':_0x2c2bd0[_0x1ac1('0x1a')]?_0x2c2bd0['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c2bd0['options']?_0x2c2bd0[_0x1ac1('0x1a')][_0x1ac1('0x1e')]||null:null,'attributes':_0x2c2bd0['options']?_0x2c2bd0[_0x1ac1('0x1a')][_0x1ac1('0x1f')]||null:null,'limit':_0x2c2bd0[_0x1ac1('0x1a')]?_0x2c2bd0[_0x1ac1('0x1a')]['limit']||null:null})[_0x1ac1('0xd')](function(_0x30d5dc){logger['info'](_0x1ac1('0x1c'),_0x2c2bd0);logger['debug']('UpdateChatQueueReport',_0x2c2bd0,JSON[_0x1ac1('0x13')](_0x30d5dc));_0x2568d5(_0x30d5dc);})[_0x1ac1('0x18')](function(_0x58a930){logger[_0x1ac1('0x14')](_0x1ac1('0x1c'),_0x58a930[_0x1ac1('0x16')],_0x2c2bd0);_0x42cbc8(_0x28b387[_0x1ac1('0x14')](0x1f4,_0x58a930[_0x1ac1('0x16')]));});});};
\ No newline at end of file
+var _0xac85=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','ChatQueueReport','options','then','UpdateChatQueueReport','update','body','raw','attributes','limit','lodash','util','moment'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0xac85,0xbd));var _0x5ac8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xac85[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5ac8('0x0'));var util=require(_0x5ac8('0x1'));var moment=require(_0x5ac8('0x2'));var BPromise=require(_0x5ac8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ac8('0x4'));var db=require(_0x5ac8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5ac8('0x6'))(_0x5ac8('0x7'));var config=require('../../config/environment');var jayson=require(_0x5ac8('0x8'));var client=jayson[_0x5ac8('0x9')][_0x5ac8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f5e87,_0x7e29c7,_0x3beaa2){return new BPromise(function(_0x3ffe7b,_0xe7a758){return client[_0x5ac8('0xb')](_0x3f5e87,_0x3beaa2)['then'](function(_0x45f93f){logger[_0x5ac8('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x7e29c7,_0x5ac8('0xd'));logger[_0x5ac8('0xe')](_0x5ac8('0xf'),_0x7e29c7,_0x5ac8('0xd'),JSON['stringify'](_0x45f93f));if(_0x45f93f[_0x5ac8('0x10')]){if(_0x45f93f['error'][_0x5ac8('0x11')]===0x1f4){logger[_0x5ac8('0x10')](_0x5ac8('0x12'),_0x7e29c7,_0x45f93f[_0x5ac8('0x10')]['message']);return _0xe7a758(_0x45f93f['error'][_0x5ac8('0x13')]);}logger['error'](_0x5ac8('0x12'),_0x7e29c7,_0x45f93f['error']['message']);return _0x3ffe7b(_0x45f93f[_0x5ac8('0x10')][_0x5ac8('0x13')]);}else{logger[_0x5ac8('0xc')](_0x5ac8('0x12'),_0x7e29c7,_0x5ac8('0xd'));_0x3ffe7b(_0x45f93f[_0x5ac8('0x14')][_0x5ac8('0x13')]);}})[_0x5ac8('0x15')](function(_0x3aca3c){logger[_0x5ac8('0x10')](_0x5ac8('0x12'),_0x7e29c7,_0x3aca3c);_0xe7a758(_0x3aca3c);});});}exports[_0x5ac8('0x16')]=function(_0x195e11){var _0x518142=this;return new Promise(function(_0x1d36e1,_0x5398a0){return db[_0x5ac8('0x17')]['create'](_0x195e11['body'],{'raw':_0x195e11[_0x5ac8('0x18')]?_0x195e11['options']['raw']===undefined?!![]:![]:!![]})[_0x5ac8('0x19')](function(_0x55484a){logger[_0x5ac8('0xc')](_0x5ac8('0x16'),_0x195e11);logger['debug'](_0x5ac8('0x16'),_0x195e11,JSON['stringify'](_0x55484a));_0x1d36e1(_0x55484a);})[_0x5ac8('0x15')](function(_0x39faf0){logger[_0x5ac8('0x10')](_0x5ac8('0x16'),_0x39faf0['message'],_0x195e11);_0x5398a0(_0x518142[_0x5ac8('0x10')](0x1f4,_0x39faf0['message']));});});};exports[_0x5ac8('0x1a')]=function(_0x58ab1b){var _0x19682b=this;return new Promise(function(_0x15e816,_0x5d4a98){return db[_0x5ac8('0x17')][_0x5ac8('0x1b')](_0x58ab1b[_0x5ac8('0x1c')],{'raw':_0x58ab1b['options']?_0x58ab1b[_0x5ac8('0x18')][_0x5ac8('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58ab1b[_0x5ac8('0x18')]?_0x58ab1b[_0x5ac8('0x18')]['where']||null:null,'attributes':_0x58ab1b['options']?_0x58ab1b['options'][_0x5ac8('0x1e')]||null:null,'limit':_0x58ab1b[_0x5ac8('0x18')]?_0x58ab1b[_0x5ac8('0x18')][_0x5ac8('0x1f')]||null:null})[_0x5ac8('0x19')](function(_0x3b8cdf){logger[_0x5ac8('0xc')]('UpdateChatQueueReport',_0x58ab1b);logger['debug'](_0x5ac8('0x1a'),_0x58ab1b,JSON['stringify'](_0x3b8cdf));_0x15e816(_0x3b8cdf);})['catch'](function(_0x16e5f8){logger[_0x5ac8('0x10')](_0x5ac8('0x1a'),_0x16e5f8['message'],_0x58ab1b);_0x5d4a98(_0x19682b[_0x5ac8('0x10')](0x1f4,_0x16e5f8[_0x5ac8('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 42c2e30..9264194 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 _0x2a5d=['./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','destroy','multer','util','path','express','Router','../../components/auth/service'];(function(_0x3ee005,_0x3f332c){var _0x52c52b=function(_0xf3169c){while(--_0xf3169c){_0x3ee005['push'](_0x3ee005['shift']());}};_0x52c52b(++_0x3f332c);}(_0x2a5d,0x19a));var _0xd2a5=function(_0x4c2f17,_0x5c6821){_0x4c2f17=_0x4c2f17-0x0;var _0x20919e=_0x2a5d[_0x4c2f17];return _0x20919e;};'use strict';var multer=require(_0xd2a5('0x0'));var util=require(_0xd2a5('0x1'));var path=require(_0xd2a5('0x2'));var timeout=require('connect-timeout');var express=require(_0xd2a5('0x3'));var router=express[_0xd2a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd2a5('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd2a5('0x6'));router[_0xd2a5('0x7')]('/',auth[_0xd2a5('0x8')](),controller[_0xd2a5('0x9')]);router[_0xd2a5('0x7')](_0xd2a5('0xa'),auth[_0xd2a5('0x8')](),controller[_0xd2a5('0xb')]);router['get'](_0xd2a5('0xc'),auth[_0xd2a5('0x8')](),controller[_0xd2a5('0xd')]);router['post']('/',auth[_0xd2a5('0x8')](),controller['create']);router[_0xd2a5('0xe')]('/:id',auth[_0xd2a5('0x8')](),controller['update']);router['delete']('/:id',auth[_0xd2a5('0x8')](),controller[_0xd2a5('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x04e6=['describe','/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get','index','/describe','isAuthenticated'];(function(_0x1ffb10,_0x28ce2c){var _0x390ad0=function(_0x1d1c1c){while(--_0x1d1c1c){_0x1ffb10['push'](_0x1ffb10['shift']());}};_0x390ad0(++_0x28ce2c);}(_0x04e6,0xce));var _0x604e=function(_0x47b15f,_0x103e93){_0x47b15f=_0x47b15f-0x0;var _0x55bf25=_0x04e6[_0x47b15f];return _0x55bf25;};'use strict';var multer=require(_0x604e('0x0'));var util=require(_0x604e('0x1'));var path=require(_0x604e('0x2'));var timeout=require(_0x604e('0x3'));var express=require(_0x604e('0x4'));var router=express[_0x604e('0x5')]();var fs_extra=require(_0x604e('0x6'));var auth=require(_0x604e('0x7'));var interaction=require(_0x604e('0x8'));var config=require('../../config/environment');var controller=require(_0x604e('0x9'));router[_0x604e('0xa')]('/',auth['isAuthenticated'](),controller[_0x604e('0xb')]);router[_0x604e('0xa')](_0x604e('0xc'),auth[_0x604e('0xd')](),controller[_0x604e('0xe')]);router['get'](_0x604e('0xf'),auth['isAuthenticated'](),controller[_0x604e('0x10')]);router['post']('/',auth[_0x604e('0xd')](),controller[_0x604e('0x11')]);router[_0x604e('0x12')](_0x604e('0xf'),auth[_0x604e('0xd')](),controller[_0x604e('0x13')]);router[_0x604e('0x14')](_0x604e('0xf'),auth[_0x604e('0xd')](),controller['destroy']);module[_0x604e('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index a8c950c..1f0338d 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x26adda,_0x215619){var _0x72f884=function(_0x16c706){while(--_0x16c706){_0x26adda['push'](_0x26adda['shift']());}};_0x72f884(++_0x215619);}(_0x70e0,0x17b));var _0x070e=function(_0x358ff9,_0x56724b){_0x358ff9=_0x358ff9-0x0;var _0x2a9165=_0x70e0[_0x358ff9];return _0x2a9165;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
+var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x78bc74,_0x15985e){var _0x158abb=function(_0x4c15df){while(--_0x4c15df){_0x78bc74['push'](_0x78bc74['shift']());}};_0x158abb(++_0x15985e);}(_0xaa88,0x137));var _0x8aa8=function(_0x45ce08,_0x59dcc7){_0x45ce08=_0x45ce08-0x0;var _0x23dff2=_0xaa88[_0x45ce08];return _0x23dff2;};'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
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index dbacac7..4c2249c 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 _0xcede=['ChatTransferReport','fieldName','type','key','model','map','query','keys','filters','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','options','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','save','update','then','destroy','end','error','name','send'];(function(_0x2aec07,_0xe18447){var _0x59ffb0=function(_0x31fb02){while(--_0x31fb02){_0x2aec07['push'](_0x2aec07['shift']());}};_0x59ffb0(++_0xe18447);}(_0xcede,0x1dc));var _0xeced=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xcede[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeced('0x0'));var zipdir=require(_0xeced('0x1'));var jsonpatch=require(_0xeced('0x2'));var rp=require(_0xeced('0x3'));var moment=require(_0xeced('0x4'));var BPromise=require(_0xeced('0x5'));var Mustache=require('mustache');var util=require(_0xeced('0x6'));var path=require('path');var sox=require(_0xeced('0x7'));var csv=require(_0xeced('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeced('0x9'));var _=require(_0xeced('0xa'));var squel=require(_0xeced('0xb'));var crypto=require(_0xeced('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xeced('0xd'));var toCsv=require('to-csv');var querystring=require(_0xeced('0xe'));var Papa=require(_0xeced('0xf'));var Redis=require(_0xeced('0x10'));var authService=require(_0xeced('0x11'));var qs=require(_0xeced('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xeced('0x13'))(_0xeced('0x14'));var utils=require(_0xeced('0x15'));var config=require(_0xeced('0x16'));var licenseUtil=require(_0xeced('0x17'));var db=require(_0xeced('0x18'))['db'];function respondWithStatusCode(_0x5bdc2c,_0x2df9a2){_0x2df9a2=_0x2df9a2||0xcc;return function(_0x474174){if(_0x474174){return _0x5bdc2c[_0xeced('0x19')](_0x2df9a2);}return _0x5bdc2c['status'](_0x2df9a2)['end']();};}function respondWithResult(_0x44ae16,_0x1a14ff){_0x1a14ff=_0x1a14ff||0xc8;return function(_0x2ecb52){if(_0x2ecb52){return _0x44ae16[_0xeced('0x1a')](_0x1a14ff)['json'](_0x2ecb52);}};}function respondWithFilteredResult(_0x33e5fa,_0x45a0b9){return function(_0x31c1d3){if(_0x31c1d3){var _0x1d3b1e=typeof _0x45a0b9[_0xeced('0x1b')]===_0xeced('0x1c')&&typeof _0x45a0b9[_0xeced('0x1d')]==='undefined';var _0x59f852=_0x31c1d3[_0xeced('0x1e')];var _0x10dadb=_0x1d3b1e?0x0:_0x45a0b9[_0xeced('0x1b')];var _0x2f989b=_0x1d3b1e?_0x31c1d3[_0xeced('0x1e')]:_0x45a0b9[_0xeced('0x1b')]+_0x45a0b9[_0xeced('0x1d')];var _0x480749;if(_0x2f989b>=_0x59f852){_0x2f989b=_0x59f852;_0x480749=0xc8;}else{_0x480749=0xce;}_0x33e5fa[_0xeced('0x1a')](_0x480749);return _0x33e5fa['set'](_0xeced('0x1f'),_0x10dadb+'-'+_0x2f989b+'/'+_0x59f852)[_0xeced('0x20')](_0x31c1d3);}return null;};}function patchUpdates(_0x1293ec){return function(_0x40a9e8){try{jsonpatch[_0xeced('0x21')](_0x40a9e8,_0x1293ec,!![]);}catch(_0x3b1e7c){return BPromise['reject'](_0x3b1e7c);}return _0x40a9e8[_0xeced('0x22')]();};}function saveUpdates(_0xb24f8d,_0x8fa108){return function(_0x20a6b5){if(_0x20a6b5){return _0x20a6b5[_0xeced('0x23')](_0xb24f8d)[_0xeced('0x24')](function(_0x27187a){return _0x27187a;});}return null;};}function removeEntity(_0x281e3a,_0x3000e8){return function(_0x64d68e){if(_0x64d68e){return _0x64d68e[_0xeced('0x25')]()[_0xeced('0x24')](function(){_0x281e3a[_0xeced('0x1a')](0xcc)[_0xeced('0x26')]();});}};}function handleEntityNotFound(_0x5b5e6e,_0x1a2884){return function(_0x27972c){if(!_0x27972c){_0x5b5e6e[_0xeced('0x19')](0x194);}return _0x27972c;};}function handleError(_0x34a0db,_0x190d24){_0x190d24=_0x190d24||0x1f4;return function(_0x17e536){logger[_0xeced('0x27')](_0x17e536['stack']);if(_0x17e536[_0xeced('0x28')]){delete _0x17e536[_0xeced('0x28')];}_0x34a0db[_0xeced('0x1a')](_0x190d24)[_0xeced('0x29')](_0x17e536);};}exports['index']=function(_0x55ec84,_0xaf6810){var _0x2cefcd={},_0xc74cdf={},_0x177eb1={'count':0x0,'rows':[]};var _0x1961e9=_['map'](db[_0xeced('0x2a')]['rawAttributes'],function(_0x341b82){return{'name':_0x341b82[_0xeced('0x2b')],'type':_0x341b82[_0xeced('0x2c')][_0xeced('0x2d')]};});_0xc74cdf[_0xeced('0x2e')]=_[_0xeced('0x2f')](_0x1961e9,_0xeced('0x28'));_0xc74cdf[_0xeced('0x30')]=_[_0xeced('0x31')](_0x55ec84[_0xeced('0x30')]);_0xc74cdf[_0xeced('0x32')]=_['intersection'](_0xc74cdf[_0xeced('0x2e')],_0xc74cdf[_0xeced('0x30')]);_0x2cefcd['attributes']=_['intersection'](_0xc74cdf['model'],qs[_0xeced('0x33')](_0x55ec84[_0xeced('0x30')][_0xeced('0x33')]));_0x2cefcd[_0xeced('0x34')]=_0x2cefcd[_0xeced('0x34')][_0xeced('0x35')]?_0x2cefcd[_0xeced('0x34')]:_0xc74cdf[_0xeced('0x2e')];if(!_0x55ec84['query'][_0xeced('0x36')]('nolimit')){_0x2cefcd[_0xeced('0x1d')]=qs[_0xeced('0x1d')](_0x55ec84[_0xeced('0x30')]['limit']);_0x2cefcd[_0xeced('0x1b')]=qs[_0xeced('0x1b')](_0x55ec84[_0xeced('0x30')][_0xeced('0x1b')]);}_0x2cefcd['order']=qs[_0xeced('0x37')](_0x55ec84[_0xeced('0x30')][_0xeced('0x37')]);_0x2cefcd[_0xeced('0x38')]=qs[_0xeced('0x32')](_[_0xeced('0x39')](_0x55ec84[_0xeced('0x30')],_0xc74cdf[_0xeced('0x32')]),_0x1961e9);if(_0x55ec84[_0xeced('0x30')][_0xeced('0x3a')]){_0x2cefcd['where']=_[_0xeced('0x3b')](_0x2cefcd[_0xeced('0x38')],{'$or':_[_0xeced('0x2f')](_0x1961e9,function(_0x2de84f){if(_0x2de84f['type']!=='VIRTUAL'){var _0x171c39={};_0x171c39[_0x2de84f['name']]={'$like':'%'+_0x55ec84['query'][_0xeced('0x3a')]+'%'};return _0x171c39;}})});}_0x2cefcd=_['merge']({},_0x2cefcd,_0x55ec84['options']);var _0x112909={'where':_0x2cefcd['where']};return db['ChatTransferReport'][_0xeced('0x1e')](_0x112909)['then'](function(_0x550bcd){_0x177eb1[_0xeced('0x1e')]=_0x550bcd;if(_0x55ec84['query'][_0xeced('0x3c')]){_0x2cefcd[_0xeced('0x3d')]=[{'all':!![]}];}return db[_0xeced('0x2a')][_0xeced('0x3e')](_0x2cefcd);})['then'](function(_0x189a8a){_0x177eb1[_0xeced('0x3f')]=_0x189a8a;return _0x177eb1;})['then'](respondWithFilteredResult(_0xaf6810,_0x2cefcd))[_0xeced('0x40')](handleError(_0xaf6810,null));};exports[_0xeced('0x41')]=function(_0x110fc8,_0xc9cbbf){var _0x446ec1={'raw':!![],'where':{'id':_0x110fc8[_0xeced('0x42')]['id']}},_0x1675a0={};_0x1675a0[_0xeced('0x2e')]=_[_0xeced('0x31')](db['ChatTransferReport'][_0xeced('0x43')]);_0x1675a0[_0xeced('0x30')]=_[_0xeced('0x31')](_0x110fc8[_0xeced('0x30')]);_0x1675a0[_0xeced('0x32')]=_[_0xeced('0x44')](_0x1675a0[_0xeced('0x2e')],_0x1675a0[_0xeced('0x30')]);_0x446ec1[_0xeced('0x34')]=_['intersection'](_0x1675a0[_0xeced('0x2e')],qs[_0xeced('0x33')](_0x110fc8['query'][_0xeced('0x33')]));_0x446ec1[_0xeced('0x34')]=_0x446ec1[_0xeced('0x34')][_0xeced('0x35')]?_0x446ec1[_0xeced('0x34')]:_0x1675a0[_0xeced('0x2e')];if(_0x110fc8[_0xeced('0x30')][_0xeced('0x3c')]){_0x446ec1[_0xeced('0x3d')]=[{'all':!![]}];}_0x446ec1=_[_0xeced('0x3b')]({},_0x446ec1,_0x110fc8[_0xeced('0x45')]);return db['ChatTransferReport']['find'](_0x446ec1)[_0xeced('0x24')](handleEntityNotFound(_0xc9cbbf,null))[_0xeced('0x24')](respondWithResult(_0xc9cbbf,null))['catch'](handleError(_0xc9cbbf,null));};exports[_0xeced('0x46')]=function(_0x385781,_0xc2747f){return db[_0xeced('0x2a')]['create'](_0x385781[_0xeced('0x47')],{})[_0xeced('0x24')](respondWithResult(_0xc2747f,0xc9))[_0xeced('0x40')](handleError(_0xc2747f,null));};exports['update']=function(_0x4f13a8,_0x426622){if(_0x4f13a8[_0xeced('0x47')]['id']){delete _0x4f13a8[_0xeced('0x47')]['id'];}return db[_0xeced('0x2a')]['find']({'where':{'id':_0x4f13a8[_0xeced('0x42')]['id']}})[_0xeced('0x24')](handleEntityNotFound(_0x426622,null))[_0xeced('0x24')](saveUpdates(_0x4f13a8['body'],null))[_0xeced('0x24')](respondWithResult(_0x426622,null))[_0xeced('0x40')](handleError(_0x426622,null));};exports[_0xeced('0x25')]=function(_0x49d788,_0x140717){return db[_0xeced('0x2a')][_0xeced('0x48')]({'where':{'id':_0x49d788[_0xeced('0x42')]['id']}})[_0xeced('0x24')](handleEntityNotFound(_0x140717,null))[_0xeced('0x24')](removeEntity(_0x140717,null))[_0xeced('0x40')](handleError(_0x140717,null));};exports[_0xeced('0x49')]=function(_0x51367e,_0x310317){return db[_0xeced('0x2a')]['describe']()['then'](respondWithResult(_0x310317,null))['catch'](handleError(_0x310317,null));};
\ No newline at end of file
+var _0x67a6=['findAll','rows','catch','show','params','length','find','create','body','describe','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','update','then','end','error','name','send','index','map','ChatTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include'];(function(_0x55cc58,_0x5ce0af){var _0x26062e=function(_0x59e29d){while(--_0x59e29d){_0x55cc58['push'](_0x55cc58['shift']());}};_0x26062e(++_0x5ce0af);}(_0x67a6,0x132));var _0x667a=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x67a6[_0x24237f];return _0x48298e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x667a('0x0'));var zipdir=require(_0x667a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x667a('0x2'));var moment=require(_0x667a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x667a('0x4'));var util=require(_0x667a('0x5'));var path=require('path');var sox=require(_0x667a('0x6'));var csv=require(_0x667a('0x7'));var ejs=require(_0x667a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x667a('0x9'));var squel=require(_0x667a('0xa'));var crypto=require(_0x667a('0xb'));var jsforce=require(_0x667a('0xc'));var deskjs=require(_0x667a('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x667a('0xe'));var Redis=require(_0x667a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x667a('0x10'));var as=require(_0x667a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x667a('0x12'))(_0x667a('0x13'));var utils=require(_0x667a('0x14'));var config=require(_0x667a('0x15'));var licenseUtil=require(_0x667a('0x16'));var db=require(_0x667a('0x17'))['db'];function respondWithStatusCode(_0x164bc6,_0x37011e){_0x37011e=_0x37011e||0xcc;return function(_0x33a28c){if(_0x33a28c){return _0x164bc6[_0x667a('0x18')](_0x37011e);}return _0x164bc6[_0x667a('0x19')](_0x37011e)['end']();};}function respondWithResult(_0x377d81,_0x470a64){_0x470a64=_0x470a64||0xc8;return function(_0x16e411){if(_0x16e411){return _0x377d81[_0x667a('0x19')](_0x470a64)[_0x667a('0x1a')](_0x16e411);}};}function respondWithFilteredResult(_0x4632bb,_0x32c3e0){return function(_0x51ec75){if(_0x51ec75){var _0x21ece1=typeof _0x32c3e0[_0x667a('0x1b')]===_0x667a('0x1c')&&typeof _0x32c3e0['limit']===_0x667a('0x1c');var _0x2b321a=_0x51ec75[_0x667a('0x1d')];var _0x41e100=_0x21ece1?0x0:_0x32c3e0[_0x667a('0x1b')];var _0x8d8473=_0x21ece1?_0x51ec75[_0x667a('0x1d')]:_0x32c3e0['offset']+_0x32c3e0['limit'];var _0x7a478f;if(_0x8d8473>=_0x2b321a){_0x8d8473=_0x2b321a;_0x7a478f=0xc8;}else{_0x7a478f=0xce;}_0x4632bb['status'](_0x7a478f);return _0x4632bb['set'](_0x667a('0x1e'),_0x41e100+'-'+_0x8d8473+'/'+_0x2b321a)[_0x667a('0x1a')](_0x51ec75);}return null;};}function patchUpdates(_0x54e2d5){return function(_0x5c25b8){try{jsonpatch[_0x667a('0x1f')](_0x5c25b8,_0x54e2d5,!![]);}catch(_0x44d1e0){return BPromise[_0x667a('0x20')](_0x44d1e0);}return _0x5c25b8['save']();};}function saveUpdates(_0x2ea0a5,_0xacc688){return function(_0x294ef5){if(_0x294ef5){return _0x294ef5[_0x667a('0x21')](_0x2ea0a5)[_0x667a('0x22')](function(_0x189c4c){return _0x189c4c;});}return null;};}function removeEntity(_0x7563e5,_0x4cfbeb){return function(_0x6b21eb){if(_0x6b21eb){return _0x6b21eb['destroy']()[_0x667a('0x22')](function(){_0x7563e5[_0x667a('0x19')](0xcc)[_0x667a('0x23')]();});}};}function handleEntityNotFound(_0xbc0f54,_0x1825f6){return function(_0x558da3){if(!_0x558da3){_0xbc0f54['sendStatus'](0x194);}return _0x558da3;};}function handleError(_0x43c87e,_0x1b0eae){_0x1b0eae=_0x1b0eae||0x1f4;return function(_0x5b562d){logger[_0x667a('0x24')](_0x5b562d['stack']);if(_0x5b562d[_0x667a('0x25')]){delete _0x5b562d[_0x667a('0x25')];}_0x43c87e[_0x667a('0x19')](_0x1b0eae)[_0x667a('0x26')](_0x5b562d);};}exports[_0x667a('0x27')]=function(_0x3ce297,_0x4e421f){var _0x33b290={},_0x4a68ef={},_0x170466={'count':0x0,'rows':[]};var _0x1e6166=_[_0x667a('0x28')](db[_0x667a('0x29')][_0x667a('0x2a')],function(_0x3bdf22){return{'name':_0x3bdf22['fieldName'],'type':_0x3bdf22[_0x667a('0x2b')][_0x667a('0x2c')]};});_0x4a68ef[_0x667a('0x2d')]=_[_0x667a('0x28')](_0x1e6166,'name');_0x4a68ef[_0x667a('0x2e')]=_[_0x667a('0x2f')](_0x3ce297[_0x667a('0x2e')]);_0x4a68ef[_0x667a('0x30')]=_[_0x667a('0x31')](_0x4a68ef['model'],_0x4a68ef[_0x667a('0x2e')]);_0x33b290[_0x667a('0x32')]=_[_0x667a('0x31')](_0x4a68ef[_0x667a('0x2d')],qs[_0x667a('0x33')](_0x3ce297[_0x667a('0x2e')][_0x667a('0x33')]));_0x33b290[_0x667a('0x32')]=_0x33b290[_0x667a('0x32')]['length']?_0x33b290[_0x667a('0x32')]:_0x4a68ef[_0x667a('0x2d')];if(!_0x3ce297[_0x667a('0x2e')][_0x667a('0x34')]('nolimit')){_0x33b290[_0x667a('0x35')]=qs['limit'](_0x3ce297[_0x667a('0x2e')][_0x667a('0x35')]);_0x33b290[_0x667a('0x1b')]=qs[_0x667a('0x1b')](_0x3ce297[_0x667a('0x2e')][_0x667a('0x1b')]);}_0x33b290[_0x667a('0x36')]=qs[_0x667a('0x37')](_0x3ce297[_0x667a('0x2e')][_0x667a('0x37')]);_0x33b290[_0x667a('0x38')]=qs['filters'](_[_0x667a('0x39')](_0x3ce297[_0x667a('0x2e')],_0x4a68ef[_0x667a('0x30')]),_0x1e6166);if(_0x3ce297[_0x667a('0x2e')][_0x667a('0x3a')]){_0x33b290['where']=_['merge'](_0x33b290[_0x667a('0x38')],{'$or':_[_0x667a('0x28')](_0x1e6166,function(_0x467c59){if(_0x467c59[_0x667a('0x2b')]!==_0x667a('0x3b')){var _0x386669={};_0x386669[_0x467c59[_0x667a('0x25')]]={'$like':'%'+_0x3ce297[_0x667a('0x2e')][_0x667a('0x3a')]+'%'};return _0x386669;}})});}_0x33b290=_[_0x667a('0x3c')]({},_0x33b290,_0x3ce297[_0x667a('0x3d')]);var _0x1147b4={'where':_0x33b290['where']};return db[_0x667a('0x29')][_0x667a('0x1d')](_0x1147b4)[_0x667a('0x22')](function(_0x336c1e){_0x170466['count']=_0x336c1e;if(_0x3ce297[_0x667a('0x2e')][_0x667a('0x3e')]){_0x33b290[_0x667a('0x3f')]=[{'all':!![]}];}return db[_0x667a('0x29')][_0x667a('0x40')](_0x33b290);})[_0x667a('0x22')](function(_0x523c22){_0x170466[_0x667a('0x41')]=_0x523c22;return _0x170466;})[_0x667a('0x22')](respondWithFilteredResult(_0x4e421f,_0x33b290))[_0x667a('0x42')](handleError(_0x4e421f,null));};exports[_0x667a('0x43')]=function(_0x4bbcda,_0x2ec66f){var _0x4e92cf={'raw':!![],'where':{'id':_0x4bbcda[_0x667a('0x44')]['id']}},_0x377479={};_0x377479[_0x667a('0x2d')]=_[_0x667a('0x2f')](db['ChatTransferReport'][_0x667a('0x2a')]);_0x377479[_0x667a('0x2e')]=_[_0x667a('0x2f')](_0x4bbcda[_0x667a('0x2e')]);_0x377479[_0x667a('0x30')]=_[_0x667a('0x31')](_0x377479[_0x667a('0x2d')],_0x377479['query']);_0x4e92cf[_0x667a('0x32')]=_[_0x667a('0x31')](_0x377479[_0x667a('0x2d')],qs[_0x667a('0x33')](_0x4bbcda[_0x667a('0x2e')][_0x667a('0x33')]));_0x4e92cf[_0x667a('0x32')]=_0x4e92cf['attributes'][_0x667a('0x45')]?_0x4e92cf[_0x667a('0x32')]:_0x377479[_0x667a('0x2d')];if(_0x4bbcda[_0x667a('0x2e')][_0x667a('0x3e')]){_0x4e92cf['include']=[{'all':!![]}];}_0x4e92cf=_['merge']({},_0x4e92cf,_0x4bbcda[_0x667a('0x3d')]);return db[_0x667a('0x29')][_0x667a('0x46')](_0x4e92cf)[_0x667a('0x22')](handleEntityNotFound(_0x2ec66f,null))['then'](respondWithResult(_0x2ec66f,null))[_0x667a('0x42')](handleError(_0x2ec66f,null));};exports['create']=function(_0xf3aa6c,_0x52001b){return db[_0x667a('0x29')][_0x667a('0x47')](_0xf3aa6c['body'],{})[_0x667a('0x22')](respondWithResult(_0x52001b,0xc9))[_0x667a('0x42')](handleError(_0x52001b,null));};exports[_0x667a('0x21')]=function(_0x430339,_0x1d4c5d){if(_0x430339[_0x667a('0x48')]['id']){delete _0x430339['body']['id'];}return db[_0x667a('0x29')][_0x667a('0x46')]({'where':{'id':_0x430339['params']['id']}})['then'](handleEntityNotFound(_0x1d4c5d,null))[_0x667a('0x22')](saveUpdates(_0x430339[_0x667a('0x48')],null))[_0x667a('0x22')](respondWithResult(_0x1d4c5d,null))[_0x667a('0x42')](handleError(_0x1d4c5d,null));};exports['destroy']=function(_0x4a3f6c,_0x5805c1){return db[_0x667a('0x29')]['find']({'where':{'id':_0x4a3f6c[_0x667a('0x44')]['id']}})['then'](handleEntityNotFound(_0x5805c1,null))[_0x667a('0x22')](removeEntity(_0x5805c1,null))[_0x667a('0x42')](handleError(_0x5805c1,null));};exports[_0x667a('0x49')]=function(_0x3b2dd0,_0x2d59e8){return db['ChatTransferReport'][_0x667a('0x49')]()['then'](respondWithResult(_0x2d59e8,null))[_0x667a('0x42')](handleError(_0x2d59e8,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index c87da25..70f1513 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 _0xc1fd=['bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x4bbc69,_0x296386){var _0x5cdb40=function(_0x25e087){while(--_0x25e087){_0x4bbc69['push'](_0x4bbc69['shift']());}};_0x5cdb40(++_0x296386);}(_0xc1fd,0x173));var _0xdc1f=function(_0x144830,_0x4c1671){_0x144830=_0x144830-0x0;var _0x5f378d=_0xc1fd[_0x144830];return _0x5f378d;};'use strict';var _=require(_0xdc1f('0x0'));var util=require(_0xdc1f('0x1'));var logger=require(_0xdc1f('0x2'))(_0xdc1f('0x3'));var moment=require('moment');var BPromise=require(_0xdc1f('0x4'));var rp=require(_0xdc1f('0x5'));var fs=require('fs');var path=require(_0xdc1f('0x6'));var rimraf=require(_0xdc1f('0x7'));var config=require(_0xdc1f('0x8'));var attributes=require(_0xdc1f('0x9'));module[_0xdc1f('0xa')]=function(_0x508c60,_0x1878ce){return _0x508c60[_0xdc1f('0xb')](_0xdc1f('0xc'),attributes,{'tableName':_0xdc1f('0xd'),'paranoid':![],'indexes':[{'name':_0xdc1f('0xe'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x34d7=['uniqueid','lodash','api','moment','bluebird','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer'];(function(_0x5bb7f4,_0xa9d6d9){var _0x1aee41=function(_0x45d924){while(--_0x45d924){_0x5bb7f4['push'](_0x5bb7f4['shift']());}};_0x1aee41(++_0xa9d6d9);}(_0x34d7,0x121));var _0x734d=function(_0xda7972,_0x37f5f6){_0xda7972=_0xda7972-0x0;var _0x168986=_0x34d7[_0xda7972];return _0x168986;};'use strict';var _=require(_0x734d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x734d('0x1'));var moment=require(_0x734d('0x2'));var BPromise=require(_0x734d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x734d('0x4'));var rimraf=require(_0x734d('0x5'));var config=require(_0x734d('0x6'));var attributes=require(_0x734d('0x7'));module[_0x734d('0x8')]=function(_0x59fda9,_0x35295d){return _0x59fda9['define'](_0x734d('0x9'),attributes,{'tableName':_0x734d('0xa'),'paranoid':![],'indexes':[{'name':_0x734d('0xb'),'fields':[_0x734d('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index a4d6dbd..d715d15 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 _0xba8b=['util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','ChatTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','lodash'];(function(_0x340c40,_0x1aaf30){var _0x1ecba3=function(_0x398fa6){while(--_0x398fa6){_0x340c40['push'](_0x340c40['shift']());}};_0x1ecba3(++_0x1aaf30);}(_0xba8b,0xc5));var _0xbba8=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xba8b[_0x45783c];return _0x1161da;};'use strict';var _=require(_0xbba8('0x0'));var util=require(_0xbba8('0x1'));var moment=require('moment');var BPromise=require(_0xbba8('0x2'));var rs=require(_0xbba8('0x3'));var fs=require('fs');var Redis=require(_0xbba8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbba8('0x5'));var logger=require(_0xbba8('0x6'))(_0xbba8('0x7'));var config=require(_0xbba8('0x8'));var jayson=require(_0xbba8('0x9'));var client=jayson['client'][_0xbba8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12a03a,_0x556190,_0x5a763e){return new BPromise(function(_0xae0a41,_0x22c607){return client['request'](_0x12a03a,_0x5a763e)[_0xbba8('0xb')](function(_0x100f76){logger['info'](_0xbba8('0xc'),_0x556190,'request\x20sent');logger[_0xbba8('0xd')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x556190,_0xbba8('0xe'),JSON[_0xbba8('0xf')](_0x100f76));if(_0x100f76[_0xbba8('0x10')]){if(_0x100f76[_0xbba8('0x10')][_0xbba8('0x11')]===0x1f4){logger['error'](_0xbba8('0xc'),_0x556190,_0x100f76[_0xbba8('0x10')][_0xbba8('0x12')]);return _0x22c607(_0x100f76['error'][_0xbba8('0x12')]);}logger[_0xbba8('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x556190,_0x100f76[_0xbba8('0x10')]['message']);return _0xae0a41(_0x100f76['error']['message']);}else{logger[_0xbba8('0x13')](_0xbba8('0xc'),_0x556190,_0xbba8('0xe'));_0xae0a41(_0x100f76[_0xbba8('0x14')][_0xbba8('0x12')]);}})[_0xbba8('0x15')](function(_0x4a2929){logger[_0xbba8('0x10')](_0xbba8('0xc'),_0x556190,_0x4a2929);_0x22c607(_0x4a2929);});});}
\ No newline at end of file
+var _0x5542=['ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug'];(function(_0x27a3cb,_0x4af597){var _0x54ff38=function(_0x3a82d2){while(--_0x3a82d2){_0x27a3cb['push'](_0x27a3cb['shift']());}};_0x54ff38(++_0x4af597);}(_0x5542,0x74));var _0x2554=function(_0x149b82,_0x15af5d){_0x149b82=_0x149b82-0x0;var _0x1952c9=_0x5542[_0x149b82];return _0x1952c9;};'use strict';var _=require(_0x2554('0x0'));var util=require(_0x2554('0x1'));var moment=require('moment');var BPromise=require(_0x2554('0x2'));var rs=require(_0x2554('0x3'));var fs=require('fs');var Redis=require(_0x2554('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2554('0x5'))(_0x2554('0x6'));var config=require(_0x2554('0x7'));var jayson=require(_0x2554('0x8'));var client=jayson[_0x2554('0x9')][_0x2554('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c3f21,_0x6ec308,_0x224d1a){return new BPromise(function(_0x562421,_0x4d9d36){return client[_0x2554('0xb')](_0x2c3f21,_0x224d1a)[_0x2554('0xc')](function(_0x40e280){logger[_0x2554('0xd')](_0x2554('0xe'),_0x6ec308,'request\x20sent');logger[_0x2554('0xf')](_0x2554('0x10'),_0x6ec308,'request\x20sent',JSON[_0x2554('0x11')](_0x40e280));if(_0x40e280['error']){if(_0x40e280[_0x2554('0x12')][_0x2554('0x13')]===0x1f4){logger[_0x2554('0x12')](_0x2554('0xe'),_0x6ec308,_0x40e280[_0x2554('0x12')][_0x2554('0x14')]);return _0x4d9d36(_0x40e280[_0x2554('0x12')][_0x2554('0x14')]);}logger[_0x2554('0x12')](_0x2554('0xe'),_0x6ec308,_0x40e280[_0x2554('0x12')][_0x2554('0x14')]);return _0x562421(_0x40e280[_0x2554('0x12')]['message']);}else{logger[_0x2554('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x6ec308,'request\x20sent');_0x562421(_0x40e280[_0x2554('0x15')]['message']);}})['catch'](function(_0x43f401){logger[_0x2554('0x12')](_0x2554('0xe'),_0x6ec308,_0x43f401);_0x4d9d36(_0x43f401);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 34eac12..4bb5e9b 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 _0xa77d=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe','/:id','create','put','update','delete','destroy','exports'];(function(_0x573205,_0x30586a){var _0x51fb13=function(_0x153dd8){while(--_0x153dd8){_0x573205['push'](_0x573205['shift']());}};_0x51fb13(++_0x30586a);}(_0xa77d,0x78));var _0xda77=function(_0xc51f6e,_0x34c0f4){_0xc51f6e=_0xc51f6e-0x0;var _0x1e3d83=_0xa77d[_0xc51f6e];return _0x1e3d83;};'use strict';var multer=require(_0xda77('0x0'));var util=require(_0xda77('0x1'));var path=require('path');var timeout=require(_0xda77('0x2'));var express=require(_0xda77('0x3'));var router=express[_0xda77('0x4')]();var fs_extra=require(_0xda77('0x5'));var auth=require(_0xda77('0x6'));var interaction=require(_0xda77('0x7'));var config=require(_0xda77('0x8'));var controller=require(_0xda77('0x9'));router[_0xda77('0xa')]('/',auth[_0xda77('0xb')](),controller['index']);router['get'](_0xda77('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xda77('0xd'),auth[_0xda77('0xb')](),controller['show']);router['post']('/',auth[_0xda77('0xb')](),controller[_0xda77('0xe')]);router[_0xda77('0xf')](_0xda77('0xd'),auth[_0xda77('0xb')](),controller[_0xda77('0x10')]);router[_0xda77('0x11')](_0xda77('0xd'),auth['isAuthenticated'](),controller[_0xda77('0x12')]);module[_0xda77('0x13')]=router;
\ No newline at end of file
+var _0xc8f1=['create','put','/:id','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x23aa9a,_0x2a21ab){var _0x4bd2c5=function(_0x542623){while(--_0x542623){_0x23aa9a['push'](_0x23aa9a['shift']());}};_0x4bd2c5(++_0x2a21ab);}(_0xc8f1,0x125));var _0x1c8f=function(_0xd4751f,_0x4e698f){_0xd4751f=_0xd4751f-0x0;var _0x773146=_0xc8f1[_0xd4751f];return _0x773146;};'use strict';var multer=require(_0x1c8f('0x0'));var util=require(_0x1c8f('0x1'));var path=require(_0x1c8f('0x2'));var timeout=require(_0x1c8f('0x3'));var express=require(_0x1c8f('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1c8f('0x5'));var interaction=require(_0x1c8f('0x6'));var config=require(_0x1c8f('0x7'));var controller=require('./chatTransferReport.controller');router[_0x1c8f('0x8')]('/',auth[_0x1c8f('0x9')](),controller[_0x1c8f('0xa')]);router[_0x1c8f('0x8')](_0x1c8f('0xb'),auth['isAuthenticated'](),controller[_0x1c8f('0xc')]);router['get']('/:id',auth[_0x1c8f('0x9')](),controller['show']);router['post']('/',auth[_0x1c8f('0x9')](),controller[_0x1c8f('0xd')]);router[_0x1c8f('0xe')](_0x1c8f('0xf'),auth[_0x1c8f('0x9')](),controller['update']);router[_0x1c8f('0x10')](_0x1c8f('0xf'),auth[_0x1c8f('0x9')](),controller[_0x1c8f('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 3574ade..9e940a7 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 _0x24af=['Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','Feedback','ENUM','star','thumb','TEXT','stringify','input','name','text','onlineForm','parse','getDataValue','setDataValue','textarea','Comments','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.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','squared','rounded','We\x20are\x20here!','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note'];(function(_0x262bf7,_0x5b9989){var _0xe2d32b=function(_0x250335){while(--_0x250335){_0x262bf7['push'](_0x262bf7['shift']());}};_0xe2d32b(++_0x5b9989);}(_0x24af,0x132));var _0xf24a=function(_0x1a8f86,_0x5ed9c4){_0x1a8f86=_0x1a8f86-0x0;var _0x20d876=_0x24af[_0x1a8f86];return _0x20d876;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xf24a('0x0'));module[_0xf24a('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xf24a('0x2')],'allowNull':![],'unique':_0xf24a('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xf24a('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xf24a('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':_0xf24a('0x5')},'customerAlias':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf24a('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xf24a('0x2')],'allowNull':![],'defaultValue':_0xf24a('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xf24a('0x2')],'allowNull':![],'defaultValue':_0xf24a('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xf24a('0x2')]},'animation':{'type':Sequelize[_0xf24a('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0xf24a('0x9')),'defaultValue':_0xf24a('0xa')},'header_online':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':_0xf24a('0xb')},'start_chat_button':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':_0xf24a('0xc')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xf24a('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':_0xf24a('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0xf24a('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':_0xf24a('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':_0xf24a('0x10')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':_0xf24a('0x11')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xf24a('0x12')},'closingMessage':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':_0xf24a('0x13')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xf24a('0x14')},'skipMessageButton':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':_0xf24a('0x15')},'conditionAgreement':{'type':Sequelize[_0xf24a('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xf24a('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xf24a('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xf24a('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xf24a('0x16')},'ratingType':{'type':Sequelize[_0xf24a('0x17')](_0xf24a('0x18'),_0xf24a('0x19')),'defaultValue':_0xf24a('0x18')},'ratingStarsNumber':{'type':Sequelize[_0xf24a('0xd')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xf24a('0x1a')],'defaultValue':function(){return JSON[_0xf24a('0x1b')]({'items':[{'type':_0xf24a('0x1c'),'variable':null,'config':{'placeholder':_0xf24a('0x1d'),'type':_0xf24a('0x1e'),'required':!![]},'props':{'title':_0xf24a('0x1d'),'helpText':''}},{'type':'input','props':{'title':_0xf24a('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xf24a('0x4'),'type':_0xf24a('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xf24a('0x1f'))?JSON[_0xf24a('0x20')](this[_0xf24a('0x21')](_0xf24a('0x1f'))):{};},'set':function(_0xd65654){return this[_0xf24a('0x22')](_0xf24a('0x1f'),JSON[_0xf24a('0x1b')](_0xd65654));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xf24a('0x1c'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xf24a('0x4')},'variable':null},{'type':_0xf24a('0x23'),'config':{'placeholder':'Comments'},'props':{'title':_0xf24a('0x24'),'helpText':_0xf24a('0x25')}}],'fromKey':0x0});},'get':function(){return this[_0xf24a('0x21')](_0xf24a('0x26'))?JSON[_0xf24a('0x20')](this[_0xf24a('0x21')](_0xf24a('0x26'))):{};},'set':function(_0x3b97af){return this['setDataValue'](_0xf24a('0x26'),JSON[_0xf24a('0x1b')](_0x3b97af));}},'token':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':function(){return rs[_0xf24a('0x27')]();}},'autoclose':{'type':Sequelize[_0xf24a('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xf24a('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xf24a('0x2')]},'waitingTitle':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':_0xf24a('0x28')},'waitingMessage':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':_0xf24a('0x29')},'offlineMessageBody':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':_0xf24a('0x2a')},'enableUnmanagedNote':{'type':Sequelize[_0xf24a('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xf24a('0x2b')},'skipUnmanaged':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':_0xf24a('0x15')},'sendUnmanaged':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':_0xf24a('0x14')},'enableCustomerAttachment':{'type':Sequelize[_0xf24a('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xf24a('0x1a')]},'showAgentAvatar':{'type':Sequelize[_0xf24a('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xf24a('0x1a')],'defaultValue':function(){return _0xf24a('0x2c');}},'notificationSound':{'type':Sequelize[_0xf24a('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf24a('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xf24a('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xf24a('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':_0xf24a('0x2d')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0xf24a('0x2')],'defaultValue':_0xf24a('0x2e')},'defaultTitle':{'type':Sequelize[_0xf24a('0x2')]},'customerAvatar':{'type':Sequelize[_0xf24a('0x1a')]},'showCustomerAvatar':{'type':Sequelize[_0xf24a('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xf24a('0xd')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf24a('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf24a('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf24a('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xf24a('0x30')},'systemAvatar':{'type':Sequelize[_0xf24a('0x1a')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xf24a('0x31')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x5253d5){if(!_0x5253d5)this[_0xf24a('0x22')](_0xf24a('0x32'),null);this[_0xf24a('0x22')](_0xf24a('0x33'),_0x5253d5);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xf24a('0x2')]},'vidaooTopic':{'type':Sequelize[_0xf24a('0x2')],'allowNull':![],'defaultValue':_0xf24a('0x34')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xf24a('0x35');}},'vidaooMetadata':{'type':Sequelize[_0xf24a('0x1a')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xf24a('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xf24a('0x1a')]}};
\ No newline at end of file
+var _0x278c=['Feedback','thumb','input','name','text','email','getDataValue','onlineForm','parse','setDataValue','stringify','textarea','Comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Contact\x20us','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send'];(function(_0x4fedd4,_0x1dbf05){var _0x5dce0d=function(_0x28f99e){while(--_0x28f99e){_0x4fedd4['push'](_0x4fedd4['shift']());}};_0x5dce0d(++_0x1dbf05);}(_0x278c,0x18c));var _0xc278=function(_0x5c38cd,_0x5a6b4e){_0x5c38cd=_0x5c38cd-0x0;var _0xc985ef=_0x278c[_0x5c38cd];return _0xc985ef;};'use strict';var Sequelize=require(_0xc278('0x0'));var rs=require('randomstring');module[_0xc278('0x1')]={'name':{'type':Sequelize[_0xc278('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc278('0x3')},'description':{'type':Sequelize[_0xc278('0x2')]},'mapKey':{'type':Sequelize[_0xc278('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0xc278('0x2')],'defaultValue':'email'},'key':{'type':Sequelize[_0xc278('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xc278('0x2')],'defaultValue':_0xc278('0x4')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc278('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc278('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xc278('0x2')],'allowNull':![],'defaultValue':_0xc278('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xc278('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xc278('0x2')]},'animation':{'type':Sequelize[_0xc278('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xc278('0x9')](_0xc278('0xa'),_0xc278('0xb')),'defaultValue':_0xc278('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xc278('0xc')},'start_chat_button':{'type':Sequelize[_0xc278('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0xc278('0x2')],'defaultValue':_0xc278('0xd')},'download_transcript':{'type':Sequelize[_0xc278('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xc278('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xc278('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xc278('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xc278('0x2')],'defaultValue':_0xc278('0xe')},'formSubmitSuccessMessage':{'type':Sequelize[_0xc278('0x2')],'defaultValue':_0xc278('0xf')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xc278('0x10')},'noteTitle':{'type':Sequelize[_0xc278('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xc278('0x2')],'defaultValue':_0xc278('0x11')},'closingMessage':{'type':Sequelize[_0xc278('0x2')],'defaultValue':_0xc278('0x12')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xc278('0x13')},'skipMessageButton':{'type':Sequelize[_0xc278('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xc278('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xc278('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xc278('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xc278('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xc278('0x2')],'defaultValue':_0xc278('0x14')},'ratingType':{'type':Sequelize[_0xc278('0x9')]('star',_0xc278('0x15')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xc278('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xc278('0x16'),'variable':null,'config':{'placeholder':_0xc278('0x17'),'type':_0xc278('0x18'),'required':!![]},'props':{'title':_0xc278('0x17'),'helpText':''}},{'type':_0xc278('0x16'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xc278('0x19'),'type':_0xc278('0x19')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xc278('0x1a')](_0xc278('0x1b'))?JSON[_0xc278('0x1c')](this[_0xc278('0x1a')](_0xc278('0x1b'))):{};},'set':function(_0x503e82){return this[_0xc278('0x1d')]('onlineForm',JSON[_0xc278('0x1e')](_0x503e82));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xc278('0x16'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xc278('0x19')},'variable':null},{'type':_0xc278('0x1f'),'config':{'placeholder':_0xc278('0x20')},'props':{'title':_0xc278('0x20'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xc278('0x1a')]('offlineForm')?JSON[_0xc278('0x1c')](this['getDataValue']('offlineForm')):{};},'set':function(_0x1ebc0f){return this['setDataValue'](_0xc278('0x21'),JSON['stringify'](_0x1ebc0f));}},'token':{'type':Sequelize[_0xc278('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xc278('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xc278('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xc278('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xc278('0x2')]},'forwardOffline':{'type':Sequelize[_0xc278('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xc278('0x2')]},'waitingTitle':{'type':Sequelize[_0xc278('0x2')],'defaultValue':_0xc278('0x22')},'waitingMessage':{'type':Sequelize[_0xc278('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xc278('0x2')],'defaultValue':_0xc278('0x23')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xc278('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xc278('0x2')],'defaultValue':_0xc278('0x24')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xc278('0x25')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xc278('0x13')},'enableCustomerAttachment':{'type':Sequelize[_0xc278('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xc278('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xc278('0x26')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xc278('0x2')]},'notificationTemplate':{'type':Sequelize[_0xc278('0x26')],'defaultValue':function(){return _0xc278('0x27');}},'notificationSound':{'type':Sequelize[_0xc278('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc278('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xc278('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xc278('0x2')],'defaultValue':_0xc278('0x28')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xc278('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xc278('0x2')],'defaultValue':_0xc278('0x29')},'verticalAlignment':{'type':Sequelize[_0xc278('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xc278('0x2')],'defaultValue':_0xc278('0x2a')},'messagesAlignment':{'type':Sequelize[_0xc278('0x2')],'defaultValue':_0xc278('0x2b')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xc278('0x26')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xc278('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc278('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xc278('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc278('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc278('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xc278('0x2')],'defaultValue':_0xc278('0x2d')},'systemAvatar':{'type':Sequelize[_0xc278('0x26')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc278('0x7')],'comment':_0xc278('0x2e')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xc278('0x2f'),'set':function(_0xc87636){if(!_0xc87636)this[_0xc278('0x1d')](_0xc278('0x30'),null);this[_0xc278('0x1d')](_0xc278('0x31'),_0xc87636);}},'vidaooEscalation':{'type':Sequelize[_0xc278('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xc278('0x2')]},'vidaooTopic':{'type':Sequelize[_0xc278('0x2')],'allowNull':![],'defaultValue':_0xc278('0x32')},'vidaooNote':{'type':Sequelize[_0xc278('0x2')],'defaultValue':function(){return _0xc278('0x33');}},'vidaooMetadata':{'type':Sequelize[_0xc278('0x26')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xc278('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xc278('0x26')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index d35a1bb..bd24ed0 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 _0x7a54=['set','Content-Range','update','destroy','get','UserProfileResource','name','send','Command','getSnippet','timezone','format','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','inspect','No\x20timezone','map','Interval','Intervals','all','some','setUA','user-agent','getResult','customerIp','cf-connecting-ip','first','split','firstName','lastName','x-real-port','referer','browser','version','%s\x20%s','device','%s\x20%s\x20%s','model','vendor','type','stringify','index','Pause','ChatWebsite','rawAttributes','fieldName','key','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','findAll','rows','params','mandatoryDispositionPause','includeAll','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','pick','Disposition','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addLogo','file','addAvatar','agentAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','sitepic','getLicense','custom','existsSync','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','isNil','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','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','ChatApplication','Applications','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','spread','account','list','applications','orderBy','asc','contact','threadId','ChatInteraction','interaction','messageId','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','queueId','ChatQueue','queue','waitForTheAssignedQueue','startRouting','EventManager','notify','offline','files','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','fromString','originalname','mimetype','attachments','offline-chat','openNewInteraction','transaction','Attachment','bulkCreate','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','sendMail','\x22%s\x22\x20<%s>','email','user','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','server','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','hasOwnProperty','options','Contact','Owner','fullname','internal','Tags','tag','getProactiveActions','../../config/license/util','virtual','License','increment','server/files/chat/iframe.ejs','URL','origin','remote','headers','x-forwarded-for','connection','remoteAddress','alignment','verticalAlignment','color','labelText','color_button','sequelize','Transaction','ISOLATION_LEVELS','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','mustache','util','path','fs-extra','lodash','html-to-text','ioredis','jayson/promise','url','../../components/parsers/qs','api','../../errors/api','APIOutOfIntervalError','APINotFoundError','redis','defaults','localhost','./chatWebsite.socket','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x560586,_0x35996b){var _0x3c09da=function(_0x56d3c7){while(--_0x56d3c7){_0x560586['push'](_0x560586['shift']());}};_0x3c09da(++_0x35996b);}(_0x7a54,0x106));var _0x47a5=function(_0x5a1b1b,_0xddeabf){_0x5a1b1b=_0x5a1b1b-0x0;var _0x1ae9e9=_0x7a54[_0x5a1b1b];return _0x1ae9e9;};'use strict';var Mustache=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0x3'));var _=require(_0x47a5('0x4'));var querystring=require('querystring');var htmlToText=require(_0x47a5('0x5'));var Redis=require(_0x47a5('0x6'));var jayson=require(_0x47a5('0x7'));var url=require(_0x47a5('0x8'));var qs=require(_0x47a5('0x9'));var logger=require('../../config/logger')(_0x47a5('0xa'));var config=require('../../config/environment');var APIOutOfIntervalError=require(_0x47a5('0xb'))[_0x47a5('0xc')];var APINotFoundError=require('../../errors/api')[_0x47a5('0xd')];var APIHandleError=require('../../errors/api')['handleError'];var db=require('../../mysqldb')['db'];config[_0x47a5('0xe')]=_[_0x47a5('0xf')](config['redis'],{'host':_0x47a5('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x47a5('0x11'))[_0x47a5('0x12')](socket);var client=jayson[_0x47a5('0x13')][_0x47a5('0x14')]({'port':0x232c});var client9002=jayson[_0x47a5('0x13')][_0x47a5('0x14')]({'port':0x232a});var client9003=jayson[_0x47a5('0x13')]['http']({'port':0x232b});var client9001=jayson[_0x47a5('0x13')][_0x47a5('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x1cf309,_0x711793,_0x139f25,_0x620ee9){return new Promise(function(_0x3c6c46,_0x190faa){var _0x4e99a8=_0x620ee9||client;return _0x4e99a8[_0x47a5('0x15')](_0x1cf309,_0x139f25)[_0x47a5('0x16')](function(_0x3b001e){logger[_0x47a5('0x17')](_0x47a5('0x18'),_0x711793,'request\x20sent');logger['debug'](_0x47a5('0x19'),_0x711793,'request\x20sent',JSON['stringify'](_0x3b001e));if(_0x3b001e[_0x47a5('0x1a')]){if(_0x3b001e[_0x47a5('0x1a')][_0x47a5('0x1b')]===0x1f4){logger[_0x47a5('0x1a')](_0x47a5('0x18'),_0x711793,_0x3b001e[_0x47a5('0x1a')][_0x47a5('0x1c')]);return _0x190faa(_0x3b001e[_0x47a5('0x1a')][_0x47a5('0x1c')]);}logger['error'](_0x47a5('0x18'),_0x711793,_0x3b001e[_0x47a5('0x1a')]['message']);return _0x3c6c46(_0x3b001e[_0x47a5('0x1a')][_0x47a5('0x1c')]);}else{logger[_0x47a5('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x711793,_0x47a5('0x1d'));_0x3c6c46(_0x3b001e[_0x47a5('0x1e')][_0x47a5('0x1c')]);}})[_0x47a5('0x1f')](function(_0x5ef1b1){logger[_0x47a5('0x1a')](_0x47a5('0x18'),_0x711793,_0x5ef1b1);_0x190faa(_0x5ef1b1);});});}function respondWithStatusCode(_0x513981,_0x28747d){_0x28747d=_0x28747d||0xcc;return function(_0xc4cd63){if(_0xc4cd63){return _0x513981[_0x47a5('0x20')](_0x28747d);}return _0x513981[_0x47a5('0x21')](_0x28747d)[_0x47a5('0x22')]();};}function respondWithResult(_0x50bf17,_0x53078a){_0x53078a=_0x53078a||0xc8;return function(_0x136745){if(_0x136745){return _0x50bf17['status'](_0x53078a)[_0x47a5('0x23')](_0x136745);}};}function respondWithFilteredResult(_0x5b6c4e,_0x23cb77){return function(_0x378208){if(_0x378208){var _0x36ad34=typeof _0x23cb77[_0x47a5('0x24')]===_0x47a5('0x25')&&typeof _0x23cb77[_0x47a5('0x26')]===_0x47a5('0x25');var _0x136b14=_0x378208[_0x47a5('0x27')];var _0x361bfa=_0x36ad34?0x0:_0x23cb77[_0x47a5('0x24')];var _0x11a4fa=_0x36ad34?_0x378208[_0x47a5('0x27')]:_0x23cb77['offset']+_0x23cb77[_0x47a5('0x26')];var _0x51833b;if(_0x11a4fa>=_0x136b14){_0x11a4fa=_0x136b14;_0x51833b=0xc8;}else{_0x51833b=0xce;}_0x5b6c4e[_0x47a5('0x21')](_0x51833b);return _0x5b6c4e[_0x47a5('0x28')](_0x47a5('0x29'),_0x361bfa+'-'+_0x11a4fa+'/'+_0x136b14)['json'](_0x378208);}return null;};}function saveUpdates(_0x256650){return function(_0x625952){if(_0x625952){return _0x625952[_0x47a5('0x2a')](_0x256650)[_0x47a5('0x16')](function(_0x51cc81){return _0x51cc81;});}return null;};}function removeEntity(_0x50d875){return function(_0x6f9a12){if(_0x6f9a12){return _0x6f9a12[_0x47a5('0x2b')]()['then'](function(){var _0x4e1006=_0x6f9a12[_0x47a5('0x2c')]({'plain':!![]});var _0x51544e='ChatWebsites';return db[_0x47a5('0x2d')]['destroy']({'where':{'type':_0x51544e,'resourceId':_0x4e1006['id']}})[_0x47a5('0x16')](function(){return _0x6f9a12;});})[_0x47a5('0x16')](function(){_0x50d875['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x274e34){return function(_0x5910bb){if(!_0x5910bb){_0x274e34[_0x47a5('0x20')](0x194);}return _0x5910bb;};}function handleError(_0x87e4c9,_0xf269a8){_0xf269a8=_0xf269a8||0x1f4;return function(_0x52749b){logger[_0x47a5('0x1a')](_0x52749b['stack']);if(_0x52749b['name']){delete _0x52749b[_0x47a5('0x2e')];}_0x87e4c9['status'](_0xf269a8)[_0x47a5('0x2f')](_0x52749b);};}function iftimePromise(_0x5ef577,_0x21ad34){return respondWithRpcPromise(_0x47a5('0x30'),_0x47a5('0x31'),{'command':_0x21ad34[_0x47a5('0x32')]?util[_0x47a5('0x33')](_0x47a5('0x34'),_0x5ef577[_0x47a5('0x35')],_0x21ad34[_0x47a5('0x32')]):util[_0x47a5('0x33')]('iftime\x20%s',_0x5ef577[_0x47a5('0x35')])},client9002)[_0x47a5('0x16')](function(_0x511c06){var _0x2c50d6=_0x511c06&&_0x511c06[_0x47a5('0x36')](_0x47a5('0x37'))>=0x0?!![]:![];logger['info'](_0x47a5('0x38'),_0x21ad34['id'],_0x5ef577['id'],_0x5ef577[_0x47a5('0x35')],_0x2c50d6?'ONLINE':_0x47a5('0x39'),_0x21ad34[_0x47a5('0x32')]?_0x21ad34['timezone']:'No\x20timezone');return _0x2c50d6;})['catch'](function(_0x12d9f2){logger['error'](_0x47a5('0x38'),_0x21ad34['id'],_0x5ef577['id'],_0x5ef577[_0x47a5('0x35')],util[_0x47a5('0x3a')](_0x12d9f2,{'showHidden':![],'depth':null}),_0x21ad34[_0x47a5('0x32')]?_0x21ad34[_0x47a5('0x32')]:_0x47a5('0x3b'));return![];});}function checkWebsiteIntervals(_0x2003b0){var _0x1f3d01=_[_0x47a5('0x3c')](_0x2003b0[_0x47a5('0x3d')][_0x47a5('0x3e')],function(_0x1658e8){var _0x23d6d8=_0x1658e8['get']({'plain':!![]});return iftimePromise(_0x23d6d8,_0x2003b0);});return Promise[_0x47a5('0x3f')](_0x1f3d01)[_0x47a5('0x16')](function(_0x331474){return _[_0x47a5('0x40')](_0x331474);});}function createInteractionObject(_0x586f4f,_0x7de536,_0x528ef3,_0x47c7a2){var _0x55c43d=require('user-agent-parser');var _0x27dd5d=new _0x55c43d();var _0x5ec4e5=_0x27dd5d[_0x47a5('0x41')](_0x528ef3[_0x47a5('0x42')])[_0x47a5('0x43')]();var _0x494526=_0x7de536[_0x47a5('0x44')];if(_0x528ef3[_0x47a5('0x45')]){_0x494526=_0x528ef3['cf-connecting-ip'];}else if(_0x528ef3['x-forwarded-for']){_0x494526=_[_0x47a5('0x46')](_0x528ef3['x-forwarded-for'][_0x47a5('0x47')](','));}return{'ContactId':_0x47c7a2['id'],'ChatWebsiteId':_0x586f4f,'from':(_0x47c7a2[_0x47a5('0x48')]||'')+'\x20'+(_0x47c7a2[_0x47a5('0x49')]||''),'customerIp':_0x494526,'customerPort':_0x528ef3[_0x47a5('0x4a')]?_0x528ef3[_0x47a5('0x4a')]:null,'referer':_0x7de536[_0x47a5('0x4b')],'browserName':_0x5ec4e5[_0x47a5('0x4c')][_0x47a5('0x2e')]&&_0x5ec4e5[_0x47a5('0x4c')][_0x47a5('0x4d')]?util[_0x47a5('0x33')](_0x47a5('0x4e'),_0x5ec4e5[_0x47a5('0x4c')][_0x47a5('0x2e')],_0x5ec4e5[_0x47a5('0x4c')][_0x47a5('0x4d')]):'unknown','browserVersion':_0x5ec4e5[_0x47a5('0x4c')][_0x47a5('0x4d')]||'unknown','osName':util['format'](_0x47a5('0x4e'),_0x5ec4e5['os']['name'],_0x5ec4e5['os'][_0x47a5('0x4d')]),'osVersion':_0x5ec4e5['os'][_0x47a5('0x4d')],'deviceModel':_0x5ec4e5['device']['model']&&_0x5ec4e5[_0x47a5('0x4f')]['vendor']?util[_0x47a5('0x33')](_0x47a5('0x50'),_0x5ec4e5[_0x47a5('0x4f')][_0x47a5('0x51')],_0x5ec4e5[_0x47a5('0x4f')][_0x47a5('0x52')],_0x5ec4e5[_0x47a5('0x4f')]['type']):null,'deviceVendor':_0x5ec4e5['device'][_0x47a5('0x52')],'deviceType':_0x5ec4e5[_0x47a5('0x4f')][_0x47a5('0x53')],'formData':JSON[_0x47a5('0x54')](_0x7de536)};}exports[_0x47a5('0x55')]=function(_0x2c0c86,_0x249de5){var _0x492cf7={'include':[{'model':db[_0x47a5('0x56')],'as':'mandatoryDispositionPause'}]},_0x45cca5={},_0x1c9a62={'count':0x0,'rows':[]};var _0x12ca40=_['map'](db[_0x47a5('0x57')][_0x47a5('0x58')],function(_0x46e90b){return{'name':_0x46e90b[_0x47a5('0x59')],'type':_0x46e90b['type'][_0x47a5('0x5a')]};});_0x45cca5[_0x47a5('0x51')]=_[_0x47a5('0x3c')](_0x12ca40,_0x47a5('0x2e'));_0x45cca5[_0x47a5('0x5b')]=_[_0x47a5('0x5c')](_0x2c0c86[_0x47a5('0x5b')]);_0x45cca5['filters']=_[_0x47a5('0x5d')](_0x45cca5[_0x47a5('0x51')],_0x45cca5[_0x47a5('0x5b')]);_0x492cf7[_0x47a5('0x5e')]=_[_0x47a5('0x5d')](_0x45cca5[_0x47a5('0x51')],qs['fields'](_0x2c0c86[_0x47a5('0x5b')][_0x47a5('0x5f')]));_0x492cf7[_0x47a5('0x5e')]=_0x492cf7['attributes'][_0x47a5('0x60')]?_0x492cf7[_0x47a5('0x5e')]:_0x45cca5[_0x47a5('0x51')];if(!_0x2c0c86['query']['hasOwnProperty'](_0x47a5('0x61'))){_0x492cf7[_0x47a5('0x26')]=qs['limit'](_0x2c0c86['query'][_0x47a5('0x26')]);_0x492cf7['offset']=qs[_0x47a5('0x24')](_0x2c0c86['query']['offset']);}_0x492cf7[_0x47a5('0x62')]=qs[_0x47a5('0x63')](_0x2c0c86['query'][_0x47a5('0x63')]);_0x492cf7[_0x47a5('0x64')]=qs['filters'](_['pick'](_0x2c0c86[_0x47a5('0x5b')],_0x45cca5[_0x47a5('0x65')]),_0x12ca40);if(_0x2c0c86[_0x47a5('0x5b')][_0x47a5('0x66')]){_0x492cf7['where']=_[_0x47a5('0x67')](_0x492cf7[_0x47a5('0x64')],{'$or':_[_0x47a5('0x3c')](_0x12ca40,function(_0x5a33b8){if(_0x5a33b8[_0x47a5('0x53')]!=='VIRTUAL'){var _0x485e3c={};_0x485e3c[_0x5a33b8[_0x47a5('0x2e')]]={'$like':'%'+_0x2c0c86[_0x47a5('0x5b')][_0x47a5('0x66')]+'%'};return _0x485e3c;}})});}_0x492cf7=_[_0x47a5('0x67')]({},_0x492cf7,_0x2c0c86['options']);var _0x144af9={'where':_0x492cf7['where']};return db['ChatWebsite']['count'](_0x144af9)['then'](function(_0x212d92){_0x1c9a62[_0x47a5('0x27')]=_0x212d92;if(_0x2c0c86[_0x47a5('0x5b')]['includeAll']){_0x492cf7['include']=[{'all':!![]}];}return db[_0x47a5('0x57')][_0x47a5('0x68')](_0x492cf7);})[_0x47a5('0x16')](function(_0x3c2b46){_0x1c9a62[_0x47a5('0x69')]=_0x3c2b46;return _0x1c9a62;})['then'](respondWithFilteredResult(_0x249de5,_0x492cf7))[_0x47a5('0x1f')](handleError(_0x249de5,null));};exports['show']=function(_0x22c886,_0x274d31){var _0x4d545f={'raw':![],'where':{'id':_0x22c886[_0x47a5('0x6a')]['id']},'include':[{'model':db[_0x47a5('0x56')],'as':_0x47a5('0x6b')}]},_0x32b4de={};_0x32b4de[_0x47a5('0x51')]=_[_0x47a5('0x5c')](db[_0x47a5('0x57')][_0x47a5('0x58')]);_0x32b4de['query']=_[_0x47a5('0x5c')](_0x22c886[_0x47a5('0x5b')]);_0x32b4de[_0x47a5('0x65')]=_[_0x47a5('0x5d')](_0x32b4de[_0x47a5('0x51')],_0x32b4de['query']);_0x4d545f[_0x47a5('0x5e')]=_[_0x47a5('0x5d')](_0x32b4de[_0x47a5('0x51')],qs[_0x47a5('0x5f')](_0x22c886[_0x47a5('0x5b')][_0x47a5('0x5f')]));_0x4d545f[_0x47a5('0x5e')]=_0x4d545f[_0x47a5('0x5e')][_0x47a5('0x60')]?_0x4d545f[_0x47a5('0x5e')]:_0x32b4de[_0x47a5('0x51')];if(_0x22c886[_0x47a5('0x5b')][_0x47a5('0x6c')]){_0x4d545f[_0x47a5('0x6d')]=[{'all':!![]}];}_0x4d545f=_[_0x47a5('0x67')]({},_0x4d545f,_0x22c886['options']);return db[_0x47a5('0x57')][_0x47a5('0x6e')](_0x4d545f)[_0x47a5('0x16')](handleEntityNotFound(_0x274d31,null))['then'](respondWithResult(_0x274d31,null))[_0x47a5('0x1f')](handleError(_0x274d31,null));};exports[_0x47a5('0x6f')]=function(_0x36c67,_0x26f1ac){return db['ChatWebsite'][_0x47a5('0x6f')](_0x36c67['body'],{})[_0x47a5('0x16')](function(_0x487e21){var _0x43f649=_0x36c67['user'][_0x47a5('0x2c')]({'plain':!![]});if(!_0x43f649)throw new Error(_0x47a5('0x70'));if(_0x43f649[_0x47a5('0x71')]==='user'){var _0x4af557=_0x487e21['get']({'plain':!![]});var _0x4164a3=_0x47a5('0x72');return db[_0x47a5('0x73')][_0x47a5('0x6e')]({'where':{'name':_0x4164a3,'userProfileId':_0x43f649['userProfileId']},'raw':!![]})[_0x47a5('0x16')](function(_0xc12a6a){if(_0xc12a6a&&_0xc12a6a[_0x47a5('0x74')]===0x0){return db[_0x47a5('0x2d')][_0x47a5('0x6f')]({'name':_0x4af557[_0x47a5('0x2e')],'resourceId':_0x4af557['id'],'type':_0xc12a6a[_0x47a5('0x2e')],'sectionId':_0xc12a6a['id']},{})[_0x47a5('0x16')](function(){return _0x487e21;});}else{return _0x487e21;}})[_0x47a5('0x1f')](function(_0xc69a68){logger[_0x47a5('0x1a')](_0x47a5('0x75'),_0xc69a68);throw _0xc69a68;});}return _0x487e21;})['then'](respondWithResult(_0x26f1ac,0xc9))[_0x47a5('0x1f')](handleError(_0x26f1ac,null));};exports['update']=function(_0x2ad00a,_0x2ac30f){if(_0x2ad00a[_0x47a5('0x76')]['id']){delete _0x2ad00a[_0x47a5('0x76')]['id'];}return db[_0x47a5('0x57')][_0x47a5('0x6e')]({'where':{'id':_0x2ad00a[_0x47a5('0x6a')]['id']},'include':[{'model':db[_0x47a5('0x56')],'as':_0x47a5('0x6b')}]})[_0x47a5('0x16')](handleEntityNotFound(_0x2ac30f,null))[_0x47a5('0x16')](saveUpdates(_0x2ad00a[_0x47a5('0x76')],null))[_0x47a5('0x16')](respondWithResult(_0x2ac30f,null))[_0x47a5('0x1f')](handleError(_0x2ac30f,null));};exports[_0x47a5('0x2b')]=function(_0x4de126,_0x48eb77){return db['ChatWebsite']['find']({'where':{'id':_0x4de126[_0x47a5('0x6a')]['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x48eb77,null))['then'](removeEntity(_0x48eb77,null))[_0x47a5('0x1f')](handleError(_0x48eb77,null));};exports[_0x47a5('0x77')]=function(_0x1baa5a,_0x396102){return db[_0x47a5('0x57')][_0x47a5('0x77')]()[_0x47a5('0x16')](respondWithResult(_0x396102,null))[_0x47a5('0x1f')](handleError(_0x396102,null));};exports[_0x47a5('0x78')]=function(_0x1ffe3c,_0x24a6c1){if(_0x1ffe3c['body']['id']){delete _0x1ffe3c[_0x47a5('0x76')]['id'];}return db[_0x47a5('0x57')][_0x47a5('0x6e')]({'where':{'id':_0x1ffe3c['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x24a6c1,null))[_0x47a5('0x16')](function(_0x17b61d){if(_0x17b61d){_0x1ffe3c['body'][_0x47a5('0x79')]=_0x17b61d['id'];return db['Disposition']['create'](_0x1ffe3c[_0x47a5('0x76')]);}})[_0x47a5('0x16')](respondWithResult(_0x24a6c1,null))[_0x47a5('0x1f')](handleError(_0x24a6c1,null));};exports[_0x47a5('0x7a')]=function(_0x164d42,_0xea50f3){var _0x479a82={'raw':![],'where':{}};var _0x592322={};var _0x3e0dbd={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x47a5('0x7b')]({'where':{'id':_0x164d42[_0x47a5('0x6a')]['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0xea50f3,null))[_0x47a5('0x16')](function(_0x53ea2b){if(_0x53ea2b){_0x592322[_0x47a5('0x51')]=_['keys'](db['Disposition'][_0x47a5('0x58')]);_0x592322[_0x47a5('0x5b')]=_['keys'](_0x164d42[_0x47a5('0x5b')]);_0x592322[_0x47a5('0x65')]=_[_0x47a5('0x5d')](_0x592322['model'],_0x592322[_0x47a5('0x5b')]);_0x479a82['attributes']=_[_0x47a5('0x5d')](_0x592322[_0x47a5('0x51')],qs[_0x47a5('0x5f')](_0x164d42['query'][_0x47a5('0x5f')]));_0x479a82[_0x47a5('0x5e')]=_0x479a82[_0x47a5('0x5e')]['length']?_0x479a82[_0x47a5('0x5e')]:_0x592322['model'];if(!_0x164d42[_0x47a5('0x5b')]['hasOwnProperty'](_0x47a5('0x61'))){_0x479a82[_0x47a5('0x26')]=qs[_0x47a5('0x26')](_0x164d42[_0x47a5('0x5b')]['limit']);_0x479a82[_0x47a5('0x24')]=qs[_0x47a5('0x24')](_0x164d42[_0x47a5('0x5b')][_0x47a5('0x24')]);}_0x479a82[_0x47a5('0x62')]=qs['sort'](_0x164d42['query'][_0x47a5('0x63')]);_0x479a82['where']=qs[_0x47a5('0x65')](_[_0x47a5('0x7c')](_0x164d42[_0x47a5('0x5b')],_0x592322['filters']));_0x479a82[_0x47a5('0x64')][_0x47a5('0x79')]=_0x53ea2b['id'];if(_0x164d42['query'][_0x47a5('0x66')]){_0x479a82[_0x47a5('0x64')]=_[_0x47a5('0x67')](_0x479a82[_0x47a5('0x64')],{'$or':_['map'](_0x479a82['attributes'],function(_0x132742){var _0x263046={};_0x263046[_0x132742]={'$like':'%'+_0x164d42['query'][_0x47a5('0x66')]+'%'};return _0x263046;})});}_0x479a82=_[_0x47a5('0x67')]({},_0x479a82,_0x164d42['options']);return db[_0x47a5('0x7d')][_0x47a5('0x27')]({'where':_0x479a82[_0x47a5('0x64')]})['then'](function(_0x3f2ad9){_0x3e0dbd['count']=_0x3f2ad9;if(_0x164d42[_0x47a5('0x5b')]['includeAll']){_0x479a82[_0x47a5('0x6d')]=[{'all':!![]}];}return db[_0x47a5('0x7d')]['findAll'](_0x479a82);})[_0x47a5('0x16')](function(_0x597cb2){_0x3e0dbd[_0x47a5('0x69')]=_0x597cb2;return _0x3e0dbd;});}})[_0x47a5('0x16')](respondWithFilteredResult(_0xea50f3,_0x479a82))[_0x47a5('0x1f')](handleError(_0xea50f3,null));};exports[_0x47a5('0x7e')]=function(_0x49b76a,_0x3eb5c1){return db['ChatWebsite']['find']({'where':{'id':_0x49b76a[_0x47a5('0x6a')]['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x3eb5c1,null))[_0x47a5('0x16')](function(_0x96fb22){if(_0x96fb22){return _0x96fb22[_0x47a5('0x7e')](_0x49b76a['query'][_0x47a5('0x7f')]);}})[_0x47a5('0x16')](respondWithStatusCode(_0x3eb5c1,null))[_0x47a5('0x1f')](handleError(_0x3eb5c1,null));};exports[_0x47a5('0x80')]=function(_0x50b98e,_0x240db9){if(_0x50b98e['body']['id']){delete _0x50b98e[_0x47a5('0x76')]['id'];}return db[_0x47a5('0x57')][_0x47a5('0x6e')]({'where':{'id':_0x50b98e[_0x47a5('0x6a')]['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x240db9,null))[_0x47a5('0x16')](function(_0x92bfd7){if(_0x92bfd7){_0x50b98e[_0x47a5('0x76')][_0x47a5('0x79')]=_0x92bfd7['id'];return db['CannedAnswer'][_0x47a5('0x6f')](_0x50b98e[_0x47a5('0x76')]);}})['then'](respondWithResult(_0x240db9,null))[_0x47a5('0x1f')](handleError(_0x240db9,null));};exports[_0x47a5('0x81')]=function(_0x6d6a5,_0x5b85cd){var _0x4bf1f5={'raw':![],'where':{}};var _0x126bb1={};var _0x3d7371={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x6d6a5[_0x47a5('0x6a')]['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x5b85cd,null))['then'](function(_0x29e384){if(_0x29e384){_0x126bb1[_0x47a5('0x51')]=_['keys'](db[_0x47a5('0x82')][_0x47a5('0x58')]);_0x126bb1[_0x47a5('0x5b')]=_[_0x47a5('0x5c')](_0x6d6a5[_0x47a5('0x5b')]);_0x126bb1[_0x47a5('0x65')]=_['intersection'](_0x126bb1['model'],_0x126bb1['query']);_0x4bf1f5[_0x47a5('0x5e')]=_[_0x47a5('0x5d')](_0x126bb1['model'],qs[_0x47a5('0x5f')](_0x6d6a5[_0x47a5('0x5b')][_0x47a5('0x5f')]));_0x4bf1f5[_0x47a5('0x5e')]=_0x4bf1f5[_0x47a5('0x5e')]['length']?_0x4bf1f5[_0x47a5('0x5e')]:_0x126bb1['model'];if(!_0x6d6a5['query']['hasOwnProperty'](_0x47a5('0x61'))){_0x4bf1f5['limit']=qs[_0x47a5('0x26')](_0x6d6a5[_0x47a5('0x5b')][_0x47a5('0x26')]);_0x4bf1f5['offset']=qs[_0x47a5('0x24')](_0x6d6a5[_0x47a5('0x5b')][_0x47a5('0x24')]);}_0x4bf1f5[_0x47a5('0x62')]=qs[_0x47a5('0x63')](_0x6d6a5['query'][_0x47a5('0x63')]);_0x4bf1f5[_0x47a5('0x64')]=qs['filters'](_[_0x47a5('0x7c')](_0x6d6a5[_0x47a5('0x5b')],_0x126bb1[_0x47a5('0x65')]));_0x4bf1f5[_0x47a5('0x64')][_0x47a5('0x79')]=_0x29e384['id'];if(_0x6d6a5[_0x47a5('0x5b')]['filter']){_0x4bf1f5[_0x47a5('0x64')]=_[_0x47a5('0x67')](_0x4bf1f5['where'],{'$or':_[_0x47a5('0x3c')](_0x4bf1f5[_0x47a5('0x5e')],function(_0x52a1b5){var _0x12a1de={};_0x12a1de[_0x52a1b5]={'$like':'%'+_0x6d6a5['query']['filter']+'%'};return _0x12a1de;})});}_0x4bf1f5=_['merge']({},_0x4bf1f5,_0x6d6a5['options']);return db[_0x47a5('0x82')][_0x47a5('0x27')]({'where':_0x4bf1f5[_0x47a5('0x64')]})[_0x47a5('0x16')](function(_0x31f896){_0x3d7371[_0x47a5('0x27')]=_0x31f896;if(_0x6d6a5[_0x47a5('0x5b')][_0x47a5('0x6c')]){_0x4bf1f5['include']=[{'all':!![]}];}return db[_0x47a5('0x82')][_0x47a5('0x68')](_0x4bf1f5);})[_0x47a5('0x16')](function(_0x399528){_0x3d7371['rows']=_0x399528;return _0x3d7371;});}})['then'](respondWithFilteredResult(_0x5b85cd,_0x4bf1f5))[_0x47a5('0x1f')](handleError(_0x5b85cd,null));};exports['removeAnswers']=function(_0x4cb8e4,_0x1b6a5c){return db[_0x47a5('0x57')]['find']({'where':{'id':_0x4cb8e4[_0x47a5('0x6a')]['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x1b6a5c,null))[_0x47a5('0x16')](function(_0x48835f){if(_0x48835f){return _0x48835f[_0x47a5('0x83')](_0x4cb8e4[_0x47a5('0x5b')]['ids']);}})[_0x47a5('0x16')](respondWithStatusCode(_0x1b6a5c,null))[_0x47a5('0x1f')](handleError(_0x1b6a5c,null));};exports[_0x47a5('0x84')]=function(_0x311109,_0x12a56a){_0x311109[_0x47a5('0x76')]['sitepic']=_0x311109[_0x47a5('0x85')]['filename'];return db[_0x47a5('0x57')][_0x47a5('0x6e')]({'where':{'id':_0x311109[_0x47a5('0x6a')]['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x12a56a,null))['then'](saveUpdates(_0x311109[_0x47a5('0x76')],null))[_0x47a5('0x16')](respondWithResult(_0x12a56a,null))[_0x47a5('0x1f')](handleError(_0x12a56a,null));};exports[_0x47a5('0x86')]=function(_0x34b7c9,_0x30df79){_0x34b7c9[_0x47a5('0x76')][_0x47a5('0x87')]=_0x34b7c9[_0x47a5('0x85')][_0x47a5('0x88')];return db[_0x47a5('0x57')][_0x47a5('0x6e')]({'where':{'id':_0x34b7c9['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x30df79,null))[_0x47a5('0x16')](saveUpdates(_0x34b7c9['body'],null))[_0x47a5('0x16')](respondWithResult(_0x30df79,null))[_0x47a5('0x1f')](handleError(_0x30df79,null));};exports[_0x47a5('0x89')]=function(_0x2ccf21,_0x2ff467){_0x2ccf21['body'][_0x47a5('0x8a')]=_0x2ccf21[_0x47a5('0x85')][_0x47a5('0x88')];return db[_0x47a5('0x57')][_0x47a5('0x6e')]({'where':{'id':_0x2ccf21[_0x47a5('0x6a')]['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x2ff467,null))['then'](saveUpdates(_0x2ccf21['body'],null))[_0x47a5('0x16')](respondWithResult(_0x2ff467,null))['catch'](handleError(_0x2ff467,null));};exports[_0x47a5('0x8b')]=function(_0x5544a2,_0x12572f){_0x5544a2[_0x47a5('0x76')][_0x47a5('0x8c')]=_0x5544a2[_0x47a5('0x85')]['filename'];return db[_0x47a5('0x57')][_0x47a5('0x6e')]({'where':{'id':_0x5544a2[_0x47a5('0x6a')]['id']}})['then'](handleEntityNotFound(_0x12572f,null))['then'](saveUpdates(_0x5544a2[_0x47a5('0x76')],null))[_0x47a5('0x16')](respondWithResult(_0x12572f,null))[_0x47a5('0x1f')](handleError(_0x12572f,null));};exports[_0x47a5('0x8d')]=function(_0x11f2f9,_0x402bba){var _0x1c0323=path[_0x47a5('0x8e')](config['root'],_0x47a5('0x8f'));var _0x4d333b={'where':{'id':_0x11f2f9[_0x47a5('0x6a')]['id']},'attributes':['id',_0x47a5('0x90')],'raw':!![]};var _0x5b0b0b=![];return require('../../config/license/util')[_0x47a5('0x91')]()[_0x47a5('0x16')](function(_0x530387){if(_0x530387){_0x5b0b0b=_0x530387[_0x47a5('0x92')];}})[_0x47a5('0x16')](function(){return db[_0x47a5('0x57')][_0x47a5('0x6e')](_0x4d333b);})['then'](handleEntityNotFound(_0x402bba,null))[_0x47a5('0x16')](function(_0x490947){if(_0x490947){if(!_['isNil'](_0x490947['sitepic'])){if(fs[_0x47a5('0x93')](path['join'](config[_0x47a5('0x94')],_0x47a5('0x95'),_0x490947[_0x47a5('0x90')]))&&_0x5b0b0b){_0x1c0323=path[_0x47a5('0x8e')](config[_0x47a5('0x94')],_0x47a5('0x95'),_0x490947[_0x47a5('0x90')]);}}return _0x402bba[_0x47a5('0x96')](_0x1c0323);}})[_0x47a5('0x1f')](handleError(_0x402bba,null));};exports[_0x47a5('0x97')]=function(_0x42b7ef,_0xf05c39){var _0x328faa=path[_0x47a5('0x8e')](config[_0x47a5('0x94')],'server/files/images/avatars/default_avatar.png');var _0xdd95c8={'where':{'id':_0x42b7ef[_0x47a5('0x6a')]['id']},'attributes':['id',_0x47a5('0x87')],'raw':!![]};return db[_0x47a5('0x57')]['find'](_0xdd95c8)[_0x47a5('0x16')](handleEntityNotFound(_0xf05c39,null))['then'](function(_0x4476b5){if(_0x4476b5){if(!_['isNil'](_0x4476b5[_0x47a5('0x87')])){if(fs[_0x47a5('0x93')](path[_0x47a5('0x8e')](config['root'],_0x47a5('0x98'),_0x4476b5[_0x47a5('0x87')]))){_0x328faa=path[_0x47a5('0x8e')](config['root'],'server/files/images/avatars/',_0x4476b5[_0x47a5('0x87')]);}}return _0xf05c39[_0x47a5('0x96')](_0x328faa);}})[_0x47a5('0x1f')](handleError(_0xf05c39,null));};exports[_0x47a5('0x99')]=function(_0x204bd6,_0x579e5c){var _0x1196a0=path['join'](config[_0x47a5('0x94')],_0x47a5('0x9a'));var _0x46647f={'where':{'id':_0x204bd6[_0x47a5('0x6a')]['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db[_0x47a5('0x57')][_0x47a5('0x6e')](_0x46647f)[_0x47a5('0x16')](handleEntityNotFound(_0x579e5c,null))[_0x47a5('0x16')](function(_0x259088){if(_0x259088){if(!_[_0x47a5('0x9b')](_0x259088[_0x47a5('0x8a')])){if(fs[_0x47a5('0x93')](path[_0x47a5('0x8e')](config['root'],'server/files/images/avatars/',_0x259088[_0x47a5('0x8a')]))&&_0x259088['showCustomerAvatar']){_0x1196a0=path[_0x47a5('0x8e')](config[_0x47a5('0x94')],_0x47a5('0x98'),_0x259088['customerAvatar']);}}return _0x579e5c[_0x47a5('0x96')](_0x1196a0);}})[_0x47a5('0x1f')](handleError(_0x579e5c,null));};exports['getSystemAvatar']=function(_0xcb6714,_0x51f6cf){var _0x277255=path[_0x47a5('0x8e')](config[_0x47a5('0x94')],'server/files/images/avatars/system_avatar.png');var _0x55b454={'where':{'id':_0xcb6714['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db['ChatWebsite'][_0x47a5('0x6e')](_0x55b454)['then'](handleEntityNotFound(_0x51f6cf,null))[_0x47a5('0x16')](function(_0x2287b0){if(_0x2287b0){if(!_['isNil'](_0x2287b0['systemAvatar'])){if(fs['existsSync'](path[_0x47a5('0x8e')](config['root'],'server/files/images/avatars/',_0x2287b0['systemAvatar']))){_0x277255=path[_0x47a5('0x8e')](config[_0x47a5('0x94')],_0x47a5('0x98'),_0x2287b0[_0x47a5('0x8c')]);}}return _0x51f6cf['download'](_0x277255);}})[_0x47a5('0x1f')](handleError(_0x51f6cf,null));};exports['notify']=function(_0x2b6f9e,_0x53a710){var _0x2de924={'body':_0x2b6f9e[_0x47a5('0x76')],'channel':_0x47a5('0x9c')};var _0x4f8171=[];var _0x106bbe=[];var _0x427c02={};var _0xc1c968=![];return db[_0x47a5('0x9d')]['describe']()[_0x47a5('0x16')](function(_0x9a7edc){if(!_0x9a7edc){throw new db[(_0x47a5('0x9e'))][(_0x47a5('0x9f'))](_0x47a5('0xa0'));}_0x4f8171=_[_0x47a5('0xa1')](_['keys'](_0x9a7edc),[_0x47a5('0xa2'),_0x47a5('0xa3')]);_0x106bbe=_[_0x47a5('0xa1')](_[_0x47a5('0x5c')](_0x9a7edc),[_0x47a5('0xa2'),_0x47a5('0xa3'),_0x47a5('0xa4'),_0x47a5('0xa5')]);if(_0x2b6f9e[_0x47a5('0x76')]['id']){delete _0x2b6f9e[_0x47a5('0x76')]['id'];}if(_[_0x47a5('0x9b')](_0x2b6f9e[_0x47a5('0x76')][_0x47a5('0xa6')])){throw new db[(_0x47a5('0x9e'))][(_0x47a5('0x9f'))](_0x47a5('0xa7'));}if(_[_0x47a5('0x9b')](_0x2b6f9e['body'][_0x47a5('0x76')])||_0x2b6f9e['body']['body']===''){throw new db[(_0x47a5('0x9e'))][(_0x47a5('0x9f'))](_0x47a5('0xa8'));}if(_['isNil'](_0x2b6f9e[_0x47a5('0x76')][_0x47a5('0xa9')])){throw new db[(_0x47a5('0x9e'))][(_0x47a5('0x9f'))](_0x47a5('0xaa')+_0x106bbe);}if(!_[_0x47a5('0xab')](_0x106bbe,_0x2b6f9e[_0x47a5('0x76')][_0x47a5('0xa9')])){throw new db[(_0x47a5('0x9e'))][(_0x47a5('0x9f'))](_0x47a5('0xac')+_0x106bbe);}_0x427c02[_0x2b6f9e[_0x47a5('0x76')][_0x47a5('0xa9')]]=_0x2b6f9e['body']['from'];})[_0x47a5('0x16')](function(){return db['ChatWebsite'][_0x47a5('0x6e')]({'where':{'id':_0x2b6f9e[_0x47a5('0x6a')]['id']},'include':[{'model':db[_0x47a5('0xad')],'as':_0x47a5('0xae'),'include':[{'model':db[_0x47a5('0x9d')],'as':_0x47a5('0xaf'),'where':_0x427c02,'limit':0x1,'order':[['updatedAt',_0x47a5('0xb0')]]}]},{'model':db[_0x47a5('0xb1')],'as':_0x47a5('0xb2')},{'model':db['Interval'],'as':_0x47a5('0x3d'),'include':[{'model':db[_0x47a5('0x3d')],'as':_0x47a5('0x3e'),'attributes':['id',_0x47a5('0x35')],'raw':!![]}]}]});})[_0x47a5('0x16')](function(_0x23e649){if(!_0x23e649)throw new APINotFoundError(util[_0x47a5('0x33')](_0x47a5('0xb3'),_0x2b6f9e[_0x47a5('0x6a')]['id']));if(!_0x23e649[_0x47a5('0x3d')]||!_0x23e649[_0x47a5('0x3d')][_0x47a5('0x3e')])return[_0x23e649,!![]];return[_0x23e649,checkWebsiteIntervals(_0x23e649)];})[_0x47a5('0xb4')](function(_0x2ac386,_0x578983){if(!_0x578983)throw new APIOutOfIntervalError();if(!_0x2ac386[_0x47a5('0xae')])return;_0x2de924[_0x47a5('0xb5')]=_0x2ac386;_0x2de924[_0x47a5('0xb6')]=_0x2ac386[_0x47a5('0xae')];_0x2de924[_0x47a5('0xb7')]=_[_0x47a5('0xb8')](_0x2ac386[_0x47a5('0xb2')],['priority'],[_0x47a5('0xb9')]);if(_0x2de924['account'][_0x47a5('0xb2')]){delete _0x2de924[_0x47a5('0xb5')][_0x47a5('0xb2')];}if(_0x2de924[_0x47a5('0xb5')][_0x47a5('0xae')]&&_0x2de924[_0x47a5('0xb5')][_0x47a5('0xae')][_0x47a5('0xaf')]['length']){return _0x2de924[_0x47a5('0xb5')][_0x47a5('0xae')][_0x47a5('0xaf')][0x0];}var _0x598ecb=_[_0x47a5('0xf')](_0x2b6f9e[_0x47a5('0x76')],{'firstName':_0x2b6f9e[_0x47a5('0x76')][_0x47a5('0xa6')],'ListId':_0x2ac386['ListId']});_0x598ecb[_0x2b6f9e[_0x47a5('0x76')][_0x47a5('0xa9')]]=_0x2b6f9e[_0x47a5('0x76')][_0x47a5('0xa6')];return db['CmContact'][_0x47a5('0x6f')](_0x598ecb,{'fields':_0x4f8171,'raw':!![]});})['then'](function(_0x5be91a){_0x2de924[_0x47a5('0xba')]=_0x5be91a;var _0x1efae8=createInteractionObject(_0x2b6f9e[_0x47a5('0x6a')]['id'],_0x2b6f9e[_0x47a5('0x76')],_0x2b6f9e['headers'],_0x5be91a);var _0x26ad0e={'ChatWebsiteId':_0x2b6f9e[_0x47a5('0x6a')]['id'],'closed':![]};if(_0x2b6f9e[_0x47a5('0x76')][_0x47a5('0xbb')]){_0x26ad0e[_0x47a5('0xbb')]=_0x2b6f9e[_0x47a5('0x76')]['threadId'];return db[_0x47a5('0xbc')][_0x47a5('0x6e')]({'where':_0x26ad0e})[_0x47a5('0x16')](function(_0x3f18a2){if(_0x3f18a2){_0xc1c968=!![];return _0x3f18a2;}_0x1efae8[_0x47a5('0xbb')]=_0x2b6f9e['body'][_0x47a5('0xbb')];_0x1efae8['externalUrl']=_0x2b6f9e[_0x47a5('0x76')]['externalUrl'];return db[_0x47a5('0xbc')]['create'](_0x1efae8);});}_0x26ad0e['ContactId']=_0x5be91a['id'];if(_0x2b6f9e[_0x47a5('0x76')][_0x47a5('0xbd')]&&_0x2b6f9e['body'][_0x47a5('0xbd')]['id']){_0x26ad0e['id']=_0x2b6f9e[_0x47a5('0x76')]['interaction']['id'];return db[_0x47a5('0xbc')][_0x47a5('0x6e')]({'where':_0x26ad0e})[_0x47a5('0x16')](function(_0x508622){if(_0x508622){_0xc1c968=!![];return _0x508622;}return db[_0x47a5('0xbc')][_0x47a5('0x6f')](_0x1efae8);});}return db[_0x47a5('0xbc')][_0x47a5('0x6f')](_0x1efae8);})[_0x47a5('0x16')](function(_0x53cc9e){if(!_0xc1c968)return _0x53cc9e;var _0x5973d4={'from':(_0x2de924[_0x47a5('0xba')]['firstName']||'')+'\x20'+(_0x2de924[_0x47a5('0xba')][_0x47a5('0x49')]||'')};if(_0x2b6f9e['body']['threadId']&&_0x2b6f9e[_0x47a5('0x76')]['messageId']&&_0x2b6f9e[_0x47a5('0x76')][_0x47a5('0xbb')]!=_0x2b6f9e[_0x47a5('0x76')][_0x47a5('0xbe')]){_0x5973d4[_0x47a5('0xbb')]=_0x2b6f9e[_0x47a5('0x76')][_0x47a5('0xbe')];}return _0x53cc9e['update'](_0x5973d4);})[_0x47a5('0x16')](function(_0x5d507f){_0x2de924[_0x47a5('0xbd')]=_0x5d507f[_0x47a5('0x2c')]({'plain':!![]});_0x2de924[_0x47a5('0xbd')][_0x47a5('0xbf')]=!_0xc1c968;if(_0x2de924[_0x47a5('0xbd')][_0x47a5('0xbf')]){if(_0x2de924[_0x47a5('0xb5')][_0x47a5('0xc0')]){_0x2de924[_0x47a5('0xb7')][_0x47a5('0xc1')]({'id':0x0,'priority':_0x2de924[_0x47a5('0xb7')][_0x47a5('0x60')]+0x1,'app':'close','appdata':_0x47a5('0xc2'),'interval':_0x47a5('0xc3')});}}return db[_0x47a5('0xc4')]['create']({'body':_0x2b6f9e[_0x47a5('0x76')][_0x47a5('0x76')],'ChatWebsiteId':_0x2b6f9e[_0x47a5('0x6a')]['id'],'ChatInteractionId':_0x5d507f['id'],'direction':'in','ContactId':_0x2de924[_0x47a5('0xba')]['id'],'AttachmentId':_0x2b6f9e[_0x47a5('0x76')][_0x47a5('0xc5')]});})['then'](function(_0x142af8){_0x2de924[_0x47a5('0x1c')]=_0x142af8;if(!_0x2de924[_0x47a5('0xbd')][_0x47a5('0xc6')]){return;}return db[_0x47a5('0xc7')][_0x47a5('0x6e')]({'attributes':['id',_0x47a5('0x2e')],'where':{'id':_0x2de924[_0x47a5('0xbd')][_0x47a5('0xc6')]}});})[_0x47a5('0x16')](function(_0x4817f8){if(_0x4817f8){_0x2de924['applications'][_0x47a5('0xc8')]({'id':0x0,'priority':0x0,'app':_0x47a5('0xc9'),'appdata':_0x4817f8[_0x47a5('0x2e')]+','+(_0x2de924['account'][_0x47a5('0xca')]||0xa),'interval':'*,*,*,*'});_0x2de924['forcedOwnership']=!![];}if(!_0x2de924[_0x47a5('0xbd')][_0x47a5('0xcb')]){return;}return db[_0x47a5('0xcc')][_0x47a5('0x6e')]({'attributes':['id','name'],'where':{'id':_0x2de924[_0x47a5('0xbd')][_0x47a5('0xcb')]}});})['then'](function(_0x59ba59){if(_0x59ba59){_0x2de924['applications'][_0x47a5('0xc8')]({'id':0x0,'priority':0x1,'app':_0x47a5('0xcd'),'appdata':_0x59ba59[_0x47a5('0x2e')]+','+(_0x2de924[_0x47a5('0xb5')][_0x47a5('0xce')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x47a5('0xcf'),_0x2de924);})[_0x47a5('0x16')](function(_0x3a0c7b){respondWithRpcPromise(_0x47a5('0xd0'),'EventManager',{'event':_0x47a5('0xd1'),'message':_0x3a0c7b},client9002);return _0x3a0c7b;})[_0x47a5('0x16')](respondWithResult(_0x53a710,null))[_0x47a5('0x1f')](APIHandleError(_0x53a710));};exports[_0x47a5('0xd2')]=function(_0x5e7fac,_0x528402){var _0x4e43d8,_0x74893a,_0x15ddfc;var _0x156ceb=[];var _0x3c6142={};var _0x242006=_0x5e7fac[_0x47a5('0xd3')]||[];var _0x3bcdbc=[];var _0x21a58e;return db[_0x47a5('0x9d')]['describe']()[_0x47a5('0x16')](function(_0x7b5348){if(!_0x7b5348){throw new db['Sequelize'][(_0x47a5('0x9f'))](_0x47a5('0xa0'));}_0x156ceb=_[_0x47a5('0xa1')](_[_0x47a5('0x5c')](_0x7b5348),['createdAt',_0x47a5('0xa3'),_0x47a5('0xa4'),_0x47a5('0xa5')]);if(_0x5e7fac['body']['id']){delete _0x5e7fac['body']['id'];}if(_[_0x47a5('0x9b')](_0x5e7fac['body'][_0x47a5('0xa6')])){throw _0x528402['status'](0x1f4)[_0x47a5('0x2f')](new db[(_0x47a5('0x9e'))][(_0x47a5('0x9f'))](_0x47a5('0xa7')));}if(_[_0x47a5('0x9b')](_0x5e7fac['body']['body'])||_0x5e7fac[_0x47a5('0x76')][_0x47a5('0x76')]===''){throw _0x528402[_0x47a5('0x21')](0x1f4)[_0x47a5('0x2f')](new db['Sequelize']['ValidationError'](_0x47a5('0xa8')));}if(_['isNil'](_0x5e7fac[_0x47a5('0x76')]['mapKeyOffline'])){throw _0x528402[_0x47a5('0x21')](0x1f4)['send'](new db[(_0x47a5('0x9e'))][(_0x47a5('0x9f'))](_0x47a5('0xd4')+_0x156ceb));}if(!_[_0x47a5('0xab')](_0x156ceb,_0x5e7fac[_0x47a5('0x76')][_0x47a5('0xd5')])){throw _0x528402[_0x47a5('0x21')](0x1f4)[_0x47a5('0x2f')](new db['Sequelize'][(_0x47a5('0x9f'))](_0x47a5('0xd6')+_0x156ceb));}_0x3c6142[_0x5e7fac['body'][_0x47a5('0xd5')]]=_0x5e7fac[_0x47a5('0x76')]['from'];})['then'](function(){return db[_0x47a5('0x57')]['find']({'where':{'id':_0x5e7fac[_0x47a5('0x6a')]['id']},'include':[{'model':db[_0x47a5('0xad')],'as':_0x47a5('0xae')},{'model':db['MailAccount'],'as':_0x47a5('0xd7')}]});})[_0x47a5('0x16')](handleEntityNotFound(_0x528402,null))[_0x47a5('0x16')](function(_0x45dd6b){if(_0x45dd6b&&_0x45dd6b[_0x47a5('0xae')]){_0x74893a=_0x45dd6b;var _0x454609=_[_0x47a5('0xf')](_0x5e7fac['body'],{'firstName':_0x5e7fac[_0x47a5('0x76')][_0x47a5('0xa6')],'phone':_0x5e7fac[_0x47a5('0x76')][_0x47a5('0xa6')],'ListId':_0x45dd6b[_0x47a5('0xa5')]});_0x454609[_0x5e7fac[_0x47a5('0x76')][_0x47a5('0xd5')]]=_0x5e7fac['body']['from'];return db[_0x47a5('0x9d')][_0x47a5('0xd8')]({'where':_0x3c6142,'defaults':_0x454609});}})[_0x47a5('0xb4')](function(_0x4bbc94){if(_0x4bbc94){_0x15ddfc=_0x4bbc94;var _0x5d2a10=fs[_0x47a5('0xd9')](path[_0x47a5('0x8e')](config[_0x47a5('0x94')],_0x47a5('0xda')),_0x47a5('0xdb'));var _0x4121c1=ejs[_0x47a5('0xdc')](_0x5d2a10,{'body':_['toPairs'](_0x5e7fac[_0x47a5('0x76')][_0x47a5('0x76')]),'bodyTitle':_0x74893a[_0x47a5('0xdd')]});return db['ChatOfflineMessage'][_0x47a5('0x6f')]({'body':_0x4121c1,'plainBody':htmlToText[_0x47a5('0xde')](_0x4121c1),'ContactId':_0x4bbc94['id'],'ChatWebsiteId':_0x74893a['id']});}})[_0x47a5('0x16')](function(_0x278b42){_0x21a58e=_0x278b42;if(_0x242006[_0x47a5('0x60')]){var _0x20eff3=_0x242006[_0x47a5('0x3c')](function(_0x3a52cf){return{'name':_0x3a52cf[_0x47a5('0xdf')],'basename':_0x3a52cf[_0x47a5('0x88')],'type':_0x3a52cf[_0x47a5('0xe0')],'ChatOfflineMessageId':_0x278b42['id']};});_0x3bcdbc=_0x20eff3[_0x47a5('0x3c')](_0x3bd9cf=>{var _0x5a3741={'filename':_0x3bd9cf[_0x47a5('0x2e')],'path':path['join'](config[_0x47a5('0x94')],'server',_0x47a5('0xd3'),_0x47a5('0xe1'),_0x47a5('0xe2'),_0x3bd9cf['basename'])};return _0x5a3741;});if(!_0x74893a[_0x47a5('0xe3')]){return db['sequelize'][_0x47a5('0xe4')](function(_0x1e5883){return db[_0x47a5('0xe5')][_0x47a5('0xe6')](_0x20eff3,{'transaction':_0x1e5883});});}}})['then'](function(){if(_0x21a58e){_0x4e43d8=_0x21a58e;return db[_0x47a5('0xd7')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x47a5('0xe7'),'raw':!![],'include':[{'model':db[_0x47a5('0xe8')],'as':_0x47a5('0xe8'),'raw':!![]}]}]});}})[_0x47a5('0x16')](function(_0x184a18){if(_0x184a18&&_0x184a18[_0x47a5('0xe7')]&&_0x74893a[_0x47a5('0xe9')]&&_0x74893a[_0x47a5('0xea')]){var _0x3d8c62=_0x184a18['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0x47a5('0xeb'),{'account':_0x3d8c62,'message':{'from':util[_0x47a5('0x33')](_0x47a5('0xec'),_0x184a18[_0x47a5('0x2e')],_0x184a18[_0x47a5('0xed')]||_0x184a18['Smtp'][_0x47a5('0xee')]),'to':_0x74893a[_0x47a5('0xea')],'subject':_0x74893a[_0x47a5('0xef')],'html':_0x4e43d8['body'],'attachments':_0x3bcdbc}},client9003)['then'](function(){return _0x4e43d8;})[_0x47a5('0x1f')](function(_0x3e8697){logger['error'](_0x3e8697);});}})[_0x47a5('0x16')](function(){if(_0x74893a&&_0x74893a[_0x47a5('0xe3')]&&_0x74893a[_0x47a5('0xf0')]){var _0x5952bd=[];if(_0x242006[_0x47a5('0x60')]){_0x5952bd=_0x242006[_0x47a5('0x3c')](function(_0x28193a){return{'name':_0x28193a[_0x47a5('0xdf')],'basename':_0x28193a[_0x47a5('0x88')],'type':_0x28193a['mimetype'],'ChatOfflineMessageId':_0x21a58e['id']};});}var _0x219f86;if(!_[_0x47a5('0x9b')](_0x74893a[_0x47a5('0xf1')])){var _0x9b617b=_['map'](_0x5e7fac['body'],function(_0x425daf){return _0x425daf;});var _0x5054f5=_[_0x47a5('0xf2')](_0x9b617b)[0x0];var _0xe66584=_[_0x47a5('0xf3')](_0x5054f5,function(_0x96adcc){return _0x96adcc;});_0x219f86=_0xe66584[0x1][_0x74893a[_0x47a5('0xf1')]];}var _0x5b8d81={'from':_0x15ddfc['email'],'firstName':_0x15ddfc[_0x47a5('0x48')],'lastName':_0x15ddfc[_0x47a5('0x49')],'mapKey':_0x47a5('0xed'),'message':{'from':_0x15ddfc['email'],'to':_0x74893a['MailAccount'][_0x47a5('0xed')],'cc':'','subject':_['isNil'](_0x219f86)?_0x74893a[_0x47a5('0xef')]:_0x219f86,'messageId':'','sentAt':new Date(),'attach':_0x5952bd[_0x47a5('0x60')],'attachments':_0x5952bd,'originChannel':_0x47a5('0xf4'),'ChatWebsiteId':_0x74893a['id'],'ChatOfflineMessageId':_0x4e43d8['id'],'originTo':_0x74893a[_0x47a5('0xd7')][_0x47a5('0xed')]},'body':_0x4e43d8['body']};var _0x56263c={'account':{'id':_0x74893a[_0x47a5('0xf0')]},'body':_0x5b8d81,'log':_0x47a5('0xf5')};return respondWithRpcPromise(_0x47a5('0xf5'),_0x47a5('0xf6'),_0x56263c,client9001)[_0x47a5('0x16')](function(){return _0x4e43d8;})['catch'](function(_0x56fc6){logger[_0x47a5('0x1a')](_0x56fc6);});}return;})[_0x47a5('0x16')](function(){if(_0x4e43d8){return _0x4e43d8;}})[_0x47a5('0x16')](respondWithResult(_0x528402,null))[_0x47a5('0x1f')](function(){for(var _0x4df71d of _0x242006){var _0x28a5f3=path[_0x47a5('0x8e')](config[_0x47a5('0x94')],_0x47a5('0xf7'),_0x47a5('0xd3'),_0x47a5('0xe1'),_0x47a5('0xe2'),_0x4df71d[_0x47a5('0x88')]);fs_extra[_0x47a5('0xf8')](_0x28a5f3)[_0x47a5('0x1f')](function(_0x2cc493){logger['error'](_0x47a5('0xf9'),_0x28a5f3,_0x2cc493);});}});};exports[_0x47a5('0xfa')]=function(_0x19f0da,_0x4233f4){return db['ChatInteraction']['find']({'where':{'id':_0x19f0da['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x4233f4,null))['then'](function(_0x5af4f7){if(_0x5af4f7){return _0x5af4f7[_0x47a5('0xfa')](_0x19f0da['body'][_0x47a5('0x7f')],_[_0x47a5('0xfb')](_0x19f0da[_0x47a5('0x76')],['ids','id'])||{});}})[_0x47a5('0x16')](respondWithResult(_0x4233f4,null))['catch'](handleError(_0x4233f4,null));};exports[_0x47a5('0xfc')]=function(_0x18c0b6,_0x460d52){var _0x3c4c48={'raw':![],'where':{}};var _0x428b9e={};var _0x302f14={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x18c0b6['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x460d52,null))[_0x47a5('0x16')](function(_0x1d6349){if(_0x1d6349){_0x428b9e[_0x47a5('0x51')]=_[_0x47a5('0x5c')](db[_0x47a5('0xbc')][_0x47a5('0x58')]);_0x428b9e[_0x47a5('0x5b')]=_[_0x47a5('0x5c')](_0x18c0b6[_0x47a5('0x5b')]);_0x428b9e[_0x47a5('0x65')]=_[_0x47a5('0x5d')](_0x428b9e[_0x47a5('0x51')],_0x428b9e[_0x47a5('0x5b')]);_0x3c4c48[_0x47a5('0x5e')]=_[_0x47a5('0x5d')](_0x428b9e['model'],qs[_0x47a5('0x5f')](_0x18c0b6[_0x47a5('0x5b')][_0x47a5('0x5f')]));_0x3c4c48[_0x47a5('0x5e')]=_0x3c4c48[_0x47a5('0x5e')][_0x47a5('0x60')]?_0x3c4c48[_0x47a5('0x5e')]:_0x428b9e[_0x47a5('0x51')];if(!_0x18c0b6['query'][_0x47a5('0xfd')]('nolimit')){_0x3c4c48[_0x47a5('0x26')]=qs[_0x47a5('0x26')](_0x18c0b6['query'][_0x47a5('0x26')]);_0x3c4c48['offset']=qs[_0x47a5('0x24')](_0x18c0b6[_0x47a5('0x5b')][_0x47a5('0x24')]);}_0x3c4c48[_0x47a5('0x62')]=qs[_0x47a5('0x63')](_0x18c0b6['query'][_0x47a5('0x63')]);_0x3c4c48[_0x47a5('0x64')]=qs[_0x47a5('0x65')](_['pick'](_0x18c0b6['query'],_0x428b9e[_0x47a5('0x65')]));_0x3c4c48[_0x47a5('0x64')][_0x47a5('0x79')]=_0x1d6349['id'];if(_0x18c0b6['query'][_0x47a5('0x66')]){_0x3c4c48[_0x47a5('0x64')]=_[_0x47a5('0x67')](_0x3c4c48['where'],{'$or':_[_0x47a5('0x3c')](_0x3c4c48[_0x47a5('0x5e')],function(_0x3ecc43){var _0xf4b1df={};_0xf4b1df[_0x3ecc43]={'$like':'%'+_0x18c0b6['query'][_0x47a5('0x66')]+'%'};return _0xf4b1df;})});}_0x3c4c48=_['merge']({},_0x3c4c48,_0x18c0b6[_0x47a5('0xfe')]);return db[_0x47a5('0xbc')][_0x47a5('0x27')]({'where':_0x3c4c48[_0x47a5('0x64')]})['then'](function(_0x1203f9){_0x302f14[_0x47a5('0x27')]=_0x1203f9;if(_0x18c0b6[_0x47a5('0x5b')][_0x47a5('0x6c')]){_0x3c4c48[_0x47a5('0x6d')]=[{'model':db['CmContact'],'as':_0x47a5('0xff'),'required':![]},{'model':db[_0x47a5('0xc7')],'as':_0x47a5('0x100'),'attributes':[_0x47a5('0x2e'),_0x47a5('0x101'),_0x47a5('0x102')],'required':![]},{'model':db['Tag'],'as':_0x47a5('0x103'),'attributes':['id',_0x47a5('0x2e'),'color'],'where':_0x18c0b6['query'][_0x47a5('0x104')]?{'id':_0x18c0b6[_0x47a5('0x5b')][_0x47a5('0x104')]}:undefined,'required':_0x18c0b6[_0x47a5('0x5b')][_0x47a5('0x104')]?!![]:![]}];}return db[_0x47a5('0xbc')]['findAll'](_0x3c4c48);})['then'](function(_0x2e5096){_0x302f14[_0x47a5('0x69')]=_0x2e5096;return _0x302f14;});}})['then'](respondWithFilteredResult(_0x460d52,_0x3c4c48))[_0x47a5('0x1f')](handleError(_0x460d52,null));};exports[_0x47a5('0x31')]=function(_0x5592f4,_0x269a37){var _0x5ed2b3=0x0;var _0x5c72e7=0x0;var _0x4aeaff=![];var _0x41ee78;var _0x385bfa;return db[_0x47a5('0x57')]['find']({'where':{'id':_0x5592f4[_0x47a5('0x6a')]['id']},'include':[{'model':db['Interval'],'as':_0x47a5('0x3d'),'include':[{'model':db['Interval'],'as':_0x47a5('0x3e'),'attributes':['id',_0x47a5('0x35')]}]}]})[_0x47a5('0x16')](handleEntityNotFound(_0x269a37,null))[_0x47a5('0x16')](function(_0x9095a4){if(_0x9095a4){_0x41ee78=_0x9095a4;return _0x9095a4[_0x47a5('0x105')]({'raw':!![]});}})[_0x47a5('0x16')](function(_0x15d573){if(_0x41ee78){if(_0x15d573){_0x385bfa=_0x15d573;}}return require(_0x47a5('0x106'))['getLicense']();})[_0x47a5('0x16')](function(_0x24c88e){if(_0x24c88e){_0x5c72e7=_0x24c88e[_0x47a5('0x107')];_0x4aeaff=_0x24c88e['custom'];}})[_0x47a5('0x16')](function(){return db[_0x47a5('0xbc')][_0x47a5('0x27')]({'where':{'closed':![]}});})[_0x47a5('0x16')](function(_0x24e241){_0x5ed2b3=_0x24e241;if(_0x5c72e7&&_0x24e241>_0x5c72e7){return db[_0x47a5('0x108')][_0x47a5('0x7b')]({'where':{'id':0x1}})[_0x47a5('0x16')](function(_0x33a9c5){if(_0x33a9c5){_0x33a9c5[_0x47a5('0x109')]('chatLicenseExceeded');}});}})['then'](function(){if(!_0x41ee78['Interval']||!_0x41ee78['Interval'][_0x47a5('0x3e')])return!![];return checkWebsiteIntervals(_0x41ee78);})['then'](function(_0x2330ae){var _0x1261ff=fs['readFileSync'](path[_0x47a5('0x8e')](config[_0x47a5('0x94')],_0x47a5('0x10a')),_0x47a5('0xdb'));var _0x2cbf08=new url[(_0x47a5('0x10b'))](_0x41ee78['address'])[_0x47a5('0x10c')];var _0x259e37='3.8.0';var _0x188ba1=![];var _0x5e41c8={'chatVersion':_0x259e37,'chatWebsiteAddressOrigin':_0x2cbf08,'remote':_0x41ee78[_0x47a5('0x10d')],'query':querystring[_0x47a5('0x54')](_[_0x47a5('0x67')](_0x41ee78[_0x47a5('0x2c')]({'plain':!![]}),{'customerIp':_0x5592f4[_0x47a5('0x10e')][_0x47a5('0x10f')]||_0x5592f4[_0x47a5('0x10e')]['x-real-ip']||_0x5592f4[_0x47a5('0x110')][_0x47a5('0x111')]||_0x5592f4['ip'],'referer':_0x5592f4['headers'][_0x47a5('0x4b')],'openedInteractions':_0x5ed2b3,'maxInteractions':_0x5c72e7,'virtual':_0x4aeaff[_0x47a5('0x107')],'online':_0x2330ae,'custom':_0x4aeaff}))['replace'](/'/g,'\x5c\x27')};_0x269a37[_0x47a5('0x2f')](ejs['render'](Mustache[_0x47a5('0xdc')](_0x1261ff,_0x5e41c8),{'proactiveActions':_0x385bfa,'alignment':_0x41ee78[_0x47a5('0x112')],'verticalAlignment':_0x41ee78[_0x47a5('0x113')],'div_color':_0x41ee78[_0x47a5('0x114')],'labelText':_0x41ee78[_0x47a5('0x115')],'text_color':_0x41ee78['textColor'],'text_button_color':_0x41ee78['textButtonColor'],'button_color':_0x41ee78[_0x47a5('0x116')],'background_color':_0x41ee78['backgroundColor'],'hideWhenOffline':_0x41ee78['hideWhenOffline'],'intervalId':_0x41ee78['IntervalId'],'isDevelopment':_0x188ba1,'chatVersion':_0x259e37}));})[_0x47a5('0x1f')](handleError(_0x269a37,null));};exports['addApplications']=function(_0x36752b,_0x1bcafd){var _0x1d4267=_0x36752b['params']['id'];var _0x4ffa91=_0x36752b[_0x47a5('0x76')];var _0x55fca6=0xc8;var _0x56f79f=null;return db[_0x47a5('0x117')]['transaction']({'isolationLevel':db['sequelize'][_0x47a5('0x118')][_0x47a5('0x119')]['READ_COMMITTED']},function(_0x48c3ed){return db[_0x47a5('0x57')][_0x47a5('0x7b')]({'where':{'id':_0x1d4267},'transaction':_0x48c3ed})[_0x47a5('0x16')](function(_0x1aa05c){if(_0x1aa05c){return db[_0x47a5('0xb1')]['destroy']({'where':{'ChatWebsiteId':_0x1d4267},'transaction':_0x48c3ed})[_0x47a5('0x16')](function(){var _0x2091c9=_[_0x47a5('0x3c')](_0x4ffa91,function(_0x26a3ad){_0x26a3ad['ChatWebsiteId']=_0x1d4267;return _0x26a3ad;});return db[_0x47a5('0xb1')][_0x47a5('0xe6')](_0x2091c9,{'transaction':_0x48c3ed});});}else{_0x55fca6=0x194;_0x56f79f=[];}});})[_0x47a5('0x16')](function(){if(_0x55fca6!==0x194){return db['ChatApplication'][_0x47a5('0x11a')]({'where':{'ChatWebsiteId':_0x1d4267},'order':'priority'})['then'](function(_0x187de4){_0x56f79f=_0x187de4;});}})[_0x47a5('0x1f')](function(_0x52ad1f){_0x55fca6=0x1f4;logger['error'](_0x52ad1f['stack']);if(_0x52ad1f[_0x47a5('0x2e')]){delete _0x52ad1f[_0x47a5('0x2e')];}_0x56f79f=_0x52ad1f;})['finally'](function(){if(_0x56f79f===null){_0x1bcafd[_0x47a5('0x20')](_0x55fca6);}else{if(_0x55fca6===0x1f4){_0x1bcafd['status'](_0x55fca6)[_0x47a5('0x2f')](_0x56f79f);}else{_0x1bcafd[_0x47a5('0x21')](_0x55fca6)['json'](_0x56f79f);}}});};exports[_0x47a5('0x11b')]=function(_0x307d7f,_0x5f2507){var _0x3fbd67={};var _0x5bca81={};var _0x447c32;var _0x46ae21;return db[_0x47a5('0x57')][_0x47a5('0x7b')]({'where':{'id':_0x307d7f[_0x47a5('0x6a')]['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x5f2507,null))[_0x47a5('0x16')](function(_0x1ebfcd){if(_0x1ebfcd){_0x447c32=_0x1ebfcd;_0x5bca81['model']=_[_0x47a5('0x5c')](db[_0x47a5('0xb1')][_0x47a5('0x58')]);_0x5bca81[_0x47a5('0x5b')]=_[_0x47a5('0x5c')](_0x307d7f['query']);_0x5bca81[_0x47a5('0x65')]=_[_0x47a5('0x5d')](_0x5bca81['model'],_0x5bca81[_0x47a5('0x5b')]);_0x3fbd67[_0x47a5('0x5e')]=_[_0x47a5('0x5d')](_0x5bca81[_0x47a5('0x51')],qs[_0x47a5('0x5f')](_0x307d7f['query'][_0x47a5('0x5f')]));_0x3fbd67['attributes']=_0x3fbd67['attributes'][_0x47a5('0x60')]?_0x3fbd67['attributes']:_0x5bca81[_0x47a5('0x51')];_0x3fbd67[_0x47a5('0x62')]=qs['sort'](_0x307d7f[_0x47a5('0x5b')]['sort']);_0x3fbd67[_0x47a5('0x64')]=qs[_0x47a5('0x65')](_[_0x47a5('0x7c')](_0x307d7f[_0x47a5('0x5b')],_0x5bca81[_0x47a5('0x65')]));if(_0x307d7f[_0x47a5('0x5b')]['filter']){_0x3fbd67[_0x47a5('0x64')]=_[_0x47a5('0x67')](_0x3fbd67[_0x47a5('0x64')],{'$or':_[_0x47a5('0x3c')](_0x3fbd67[_0x47a5('0x5e')],function(_0x1c0230){var _0x69b145={};_0x69b145[_0x1c0230]={'$like':'%'+_0x307d7f[_0x47a5('0x5b')][_0x47a5('0x66')]+'%'};return _0x69b145;})});}_0x3fbd67=_[_0x47a5('0x67')]({},_0x3fbd67,_0x307d7f[_0x47a5('0xfe')]);return _0x447c32[_0x47a5('0x11b')](_0x3fbd67);}})[_0x47a5('0x16')](function(_0x3f5f4c){if(_0x3f5f4c){_0x46ae21=_0x3f5f4c[_0x47a5('0x60')];if(!_0x307d7f[_0x47a5('0x5b')][_0x47a5('0xfd')]('nolimit')){_0x3fbd67['limit']=qs[_0x47a5('0x26')](_0x307d7f[_0x47a5('0x5b')][_0x47a5('0x26')]);_0x3fbd67[_0x47a5('0x24')]=qs[_0x47a5('0x24')](_0x307d7f[_0x47a5('0x5b')][_0x47a5('0x24')]);}return _0x447c32[_0x47a5('0x11b')](_0x3fbd67);}})['then'](function(_0x247099){if(_0x247099){return _0x247099?{'count':_0x46ae21,'rows':_0x247099}:null;}})['then'](respondWithResult(_0x5f2507,null))[_0x47a5('0x1f')](handleError(_0x5f2507,null));};exports[_0x47a5('0x11c')]=function(_0x22bc01,_0x15245f){return db[_0x47a5('0x11d')]['find']({'where':{'id':_0x22bc01[_0x47a5('0x6a')]['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x15245f,null))[_0x47a5('0x16')](function(_0x1d2039){if(_0x1d2039){return _0x1d2039[_0x47a5('0x11c')](_0x22bc01[_0x47a5('0x76')][_0x47a5('0x7f')],_[_0x47a5('0xfb')](_0x22bc01[_0x47a5('0x76')],[_0x47a5('0x7f'),'id'])||{});}})['then'](respondWithResult(_0x15245f,null))[_0x47a5('0x1f')](handleError(_0x15245f,null));};exports[_0x47a5('0x105')]=function(_0x59801d,_0x422249){var _0x4a9d0d={};var _0x1cd305={};var _0x54574a;var _0x5b8b2e;return db[_0x47a5('0x57')][_0x47a5('0x7b')]({'where':{'id':_0x59801d['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x422249,null))[_0x47a5('0x16')](function(_0xbfa21b){if(_0xbfa21b){_0x54574a=_0xbfa21b;_0x1cd305[_0x47a5('0x51')]=_[_0x47a5('0x5c')](db[_0x47a5('0x11e')]['rawAttributes']);_0x1cd305[_0x47a5('0x5b')]=_['keys'](_0x59801d[_0x47a5('0x5b')]);_0x1cd305[_0x47a5('0x65')]=_[_0x47a5('0x5d')](_0x1cd305[_0x47a5('0x51')],_0x1cd305[_0x47a5('0x5b')]);_0x4a9d0d[_0x47a5('0x5e')]=_[_0x47a5('0x5d')](_0x1cd305[_0x47a5('0x51')],qs['fields'](_0x59801d[_0x47a5('0x5b')]['fields']));_0x4a9d0d[_0x47a5('0x5e')]=_0x4a9d0d[_0x47a5('0x5e')][_0x47a5('0x60')]?_0x4a9d0d[_0x47a5('0x5e')]:_0x1cd305[_0x47a5('0x51')];_0x4a9d0d[_0x47a5('0x62')]=qs[_0x47a5('0x63')](_0x59801d['query'][_0x47a5('0x63')]);_0x4a9d0d[_0x47a5('0x64')]=qs[_0x47a5('0x65')](_[_0x47a5('0x7c')](_0x59801d[_0x47a5('0x5b')],_0x1cd305[_0x47a5('0x65')]));if(_0x59801d[_0x47a5('0x5b')]['filter']){_0x4a9d0d[_0x47a5('0x64')]=_[_0x47a5('0x67')](_0x4a9d0d[_0x47a5('0x64')],{'$or':_[_0x47a5('0x3c')](_0x4a9d0d['attributes'],function(_0x4c107a){var _0x3eb972={};_0x3eb972[_0x4c107a]={'$like':'%'+_0x59801d[_0x47a5('0x5b')][_0x47a5('0x66')]+'%'};return _0x3eb972;})});}_0x4a9d0d=_['merge']({},_0x4a9d0d,_0x59801d[_0x47a5('0xfe')]);return _0x54574a[_0x47a5('0x105')](_0x4a9d0d);}})['then'](function(_0x5847f3){if(_0x5847f3){_0x5b8b2e=_0x5847f3[_0x47a5('0x60')];if(!_0x59801d[_0x47a5('0x5b')][_0x47a5('0xfd')]('nolimit')){_0x4a9d0d['limit']=qs[_0x47a5('0x26')](_0x59801d[_0x47a5('0x5b')][_0x47a5('0x26')]);_0x4a9d0d[_0x47a5('0x24')]=qs[_0x47a5('0x24')](_0x59801d[_0x47a5('0x5b')][_0x47a5('0x24')]);}return _0x54574a['getProactiveActions'](_0x4a9d0d);}})[_0x47a5('0x16')](function(_0x59a791){if(_0x59a791){return _0x59a791?{'count':_0x5b8b2e,'rows':_0x59a791}:null;}})[_0x47a5('0x16')](respondWithResult(_0x422249,null))['catch'](handleError(_0x422249,null));};exports[_0x47a5('0x11f')]=function(_0x1da9a6,_0x3051c4){var _0x103478=_0x1da9a6[_0x47a5('0x5b')][_0x47a5('0x120')]===_0x47a5('0x121')?_0x47a5('0x122'):_0x47a5('0x123');return db[_0x47a5('0x57')]['find']({'attributes':['id',_0x103478],'where':{'id':_0x1da9a6[_0x47a5('0x6a')]['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x3051c4,null))[_0x47a5('0x16')](function(_0x300ccb){if(_0x300ccb){var _0x23c9b8=_0x300ccb[_0x103478];var _0x1ca2c1=_0x23c9b8&&_0x23c9b8[_0x47a5('0x124')]?_0x23c9b8[_0x47a5('0x124')]:[];_0x3051c4[_0x47a5('0x2f')]({'fromKey':_['isNil'](_0x23c9b8[_0x47a5('0x125')])?undefined:_0x23c9b8['fromKey'],'count':_0x1ca2c1[_0x47a5('0x60')],'rows':_0x1ca2c1});}})['catch'](handleError(_0x3051c4,null));};exports[_0x47a5('0x126')]=function(_0x596091,_0x4f04bb){var _0x251b9e={'raw':![],'where':{}};var _0x5669c7={};var _0x53a0c3={'count':0x0,'rows':[]};return db[_0x47a5('0x57')][_0x47a5('0x7b')]({'where':{'id':_0x596091[_0x47a5('0x6a')]['id']}})['then'](handleEntityNotFound(_0x4f04bb,null))[_0x47a5('0x16')](function(_0x48a71f){if(_0x48a71f){_0x5669c7[_0x47a5('0x51')]=_['keys'](db[_0x47a5('0x127')][_0x47a5('0x58')]);_0x5669c7['query']=_[_0x47a5('0x5c')](_0x596091[_0x47a5('0x5b')]);_0x5669c7['filters']=_[_0x47a5('0x5d')](_0x5669c7[_0x47a5('0x51')],_0x5669c7['query']);_0x251b9e['attributes']=_[_0x47a5('0x5d')](_0x5669c7[_0x47a5('0x51')],qs[_0x47a5('0x5f')](_0x596091[_0x47a5('0x5b')][_0x47a5('0x5f')]));_0x251b9e['attributes']=_0x251b9e[_0x47a5('0x5e')][_0x47a5('0x60')]?_0x251b9e[_0x47a5('0x5e')]:_0x5669c7[_0x47a5('0x51')];if(!_0x596091[_0x47a5('0x5b')][_0x47a5('0xfd')](_0x47a5('0x61'))){_0x251b9e[_0x47a5('0x26')]=qs['limit'](_0x596091['query'][_0x47a5('0x26')]);_0x251b9e[_0x47a5('0x24')]=qs['offset'](_0x596091[_0x47a5('0x5b')]['offset']);}_0x251b9e[_0x47a5('0x62')]=qs['sort'](_0x596091[_0x47a5('0x5b')]['sort']);_0x251b9e['where']=qs[_0x47a5('0x65')](_[_0x47a5('0x7c')](_0x596091[_0x47a5('0x5b')],_0x5669c7['filters']));_0x251b9e[_0x47a5('0x64')][_0x47a5('0x79')]=_0x48a71f['id'];if(_0x596091[_0x47a5('0x5b')][_0x47a5('0x66')]){_0x251b9e[_0x47a5('0x64')]=_[_0x47a5('0x67')](_0x251b9e[_0x47a5('0x64')],{'$or':_['map'](_0x251b9e[_0x47a5('0x5e')],function(_0x5c58c9){var _0x344fbe={};_0x344fbe[_0x5c58c9]={'$like':'%'+_0x596091['query'][_0x47a5('0x66')]+'%'};return _0x344fbe;})});}_0x251b9e=_[_0x47a5('0x67')]({},_0x251b9e,_0x596091[_0x47a5('0xfe')]);return db['ChatOfflineMessage'][_0x47a5('0x27')]({'where':_0x251b9e[_0x47a5('0x64')]})[_0x47a5('0x16')](function(_0x54c030){_0x53a0c3[_0x47a5('0x27')]=_0x54c030;if(_0x596091[_0x47a5('0x5b')][_0x47a5('0x6c')]){_0x251b9e[_0x47a5('0x6d')]=[{'all':!![]}];}else{_0x251b9e['include']=[{'model':db['CmContact'],'as':_0x47a5('0xff'),'required':![]},{'model':db[_0x47a5('0xe5')],'as':'Attachments','required':![]}];}return db[_0x47a5('0x127')]['findAll'](_0x251b9e);})[_0x47a5('0x16')](function(_0x196f41){_0x53a0c3[_0x47a5('0x69')]=_0x196f41;return _0x53a0c3;});}})[_0x47a5('0x16')](respondWithFilteredResult(_0x4f04bb,_0x251b9e))[_0x47a5('0x1f')](handleError(_0x4f04bb,null));};exports[_0x47a5('0x128')]=function(_0x549a8a,_0x1acf09){return db[_0x47a5('0x57')][_0x47a5('0x6e')]({'where':{'id':_0x549a8a['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x1acf09,null))[_0x47a5('0x16')](function(_0xe3ba91){if(_0xe3ba91){return _0xe3ba91[_0x47a5('0x128')](_0x549a8a[_0x47a5('0x76')][_0x47a5('0x7f')],_[_0x47a5('0xfb')](_0x549a8a['body'],[_0x47a5('0x7f'),'id'])||{})['spread'](function(_0x4d1060){for(var _0xa288ca=0x0;_0xa288ca<_0x549a8a['body']['ids']['length'];_0xa288ca+=0x1){socket[_0x47a5('0x129')](_0x47a5('0x12a'),{'UserId':Number(_0x549a8a[_0x47a5('0x76')]['ids'][_0xa288ca]),'ChatWebsiteId':Number(_0x549a8a['params']['id'])});}return _0x4d1060;});}})[_0x47a5('0x16')](respondWithResult(_0x1acf09,null))[_0x47a5('0x1f')](handleError(_0x1acf09,null));};exports[_0x47a5('0x12b')]=function(_0x13ed08,_0x2f2eb7){return db['ChatWebsite'][_0x47a5('0x6e')]({'where':{'id':_0x13ed08[_0x47a5('0x6a')]['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x2f2eb7,null))[_0x47a5('0x16')](function(_0x22cd5c){if(_0x22cd5c){return _0x22cd5c[_0x47a5('0x12b')](_0x13ed08[_0x47a5('0x5b')][_0x47a5('0x7f')])[_0x47a5('0x16')](function(){if(_['isArray'](_0x13ed08[_0x47a5('0x5b')][_0x47a5('0x7f')])){for(var _0x97a1a7=0x0;_0x97a1a7<_0x13ed08[_0x47a5('0x5b')][_0x47a5('0x7f')]['length'];_0x97a1a7+=0x1){socket[_0x47a5('0x129')](_0x47a5('0x12c'),{'UserId':Number(_0x13ed08[_0x47a5('0x5b')][_0x47a5('0x7f')][_0x97a1a7]),'ChatWebsiteId':Number(_0x13ed08['params']['id'])});}}else{socket[_0x47a5('0x129')](_0x47a5('0x12c'),{'UserId':Number(_0x13ed08['query'][_0x47a5('0x7f')]),'ChatWebsiteId':Number(_0x13ed08[_0x47a5('0x6a')]['id'])});}});}})[_0x47a5('0x16')](respondWithStatusCode(_0x2f2eb7,null))[_0x47a5('0x1f')](handleError(_0x2f2eb7,null));};exports[_0x47a5('0x12d')]=function(_0x25d495,_0x575ed3){var _0x81df5c={};var _0x7a562d={};var _0x592c32;var _0x5e0938;return db['ChatWebsite'][_0x47a5('0x7b')]({'where':{'id':_0x25d495[_0x47a5('0x6a')]['id']}})['then'](handleEntityNotFound(_0x575ed3,null))[_0x47a5('0x16')](function(_0x1deb82){if(_0x1deb82){_0x592c32=_0x1deb82;_0x7a562d['model']=_[_0x47a5('0x5c')](db[_0x47a5('0xc7')][_0x47a5('0x58')]);_0x7a562d[_0x47a5('0x5b')]=_[_0x47a5('0x5c')](_0x25d495['query']);_0x7a562d[_0x47a5('0x65')]=_['intersection'](_0x7a562d[_0x47a5('0x51')],_0x7a562d['query']);_0x81df5c[_0x47a5('0x5e')]=_[_0x47a5('0x5d')](_0x7a562d['model'],qs['fields'](_0x25d495['query'][_0x47a5('0x5f')]));_0x81df5c[_0x47a5('0x5e')]=_0x81df5c[_0x47a5('0x5e')]['length']?_0x81df5c[_0x47a5('0x5e')]:_0x7a562d[_0x47a5('0x51')];_0x81df5c[_0x47a5('0x62')]=qs[_0x47a5('0x63')](_0x25d495[_0x47a5('0x5b')][_0x47a5('0x63')]);_0x81df5c['where']=qs[_0x47a5('0x65')](_['pick'](_0x25d495[_0x47a5('0x5b')],_0x7a562d[_0x47a5('0x65')]));if(_0x25d495[_0x47a5('0x5b')]['filter']){_0x81df5c[_0x47a5('0x64')]=_[_0x47a5('0x67')](_0x81df5c[_0x47a5('0x64')],{'$or':_[_0x47a5('0x3c')](_0x81df5c['attributes'],function(_0x4e1fca){var _0xa5f6f1={};_0xa5f6f1[_0x4e1fca]={'$like':'%'+_0x25d495[_0x47a5('0x5b')][_0x47a5('0x66')]+'%'};return _0xa5f6f1;})});}_0x81df5c=_[_0x47a5('0x67')]({},_0x81df5c,_0x25d495['options']);return _0x592c32[_0x47a5('0x12d')](_0x81df5c);}})[_0x47a5('0x16')](function(_0x1b8fe1){if(_0x1b8fe1){_0x5e0938=_0x1b8fe1[_0x47a5('0x60')];if(!_0x25d495[_0x47a5('0x5b')][_0x47a5('0xfd')](_0x47a5('0x61'))){_0x81df5c[_0x47a5('0x26')]=qs['limit'](_0x25d495[_0x47a5('0x5b')]['limit']);_0x81df5c[_0x47a5('0x24')]=qs['offset'](_0x25d495[_0x47a5('0x5b')][_0x47a5('0x24')]);}return _0x592c32[_0x47a5('0x12d')](_0x81df5c);}})[_0x47a5('0x16')](function(_0x28b8aa){if(_0x28b8aa){return _0x28b8aa?{'count':_0x5e0938,'rows':_0x28b8aa}:null;}})[_0x47a5('0x16')](respondWithResult(_0x575ed3,null))[_0x47a5('0x1f')](handleError(_0x575ed3,null));};
\ No newline at end of file
+var _0xb10b=['url','../../components/parsers/qs','api','../../config/environment','APIOutOfIntervalError','../../errors/api','APINotFoundError','handleError','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','destroy','get','ChatWebsites','UserProfileResource','end','stack','name','send','Command','getSnippet','timezone','format','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','Intervals','all','some','user-agent-parser','setUA','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','unknown','%s\x20%s','model','device','vendor','%s\x20%s\x20%s','type','index','Pause','mandatoryDispositionPause','map','ChatWebsite','key','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','rows','params','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findAll','removeDispositions','addAnswer','CannedAnswer','findOne','removeAnswers','addLogo','file','filename','addAvatar','addSystemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','getLicense','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','chat','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','CmList','List','Contacts','DESC','Applications','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','list','applications','orderBy','priority','asc','CmContact','contact','headers','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','push','unmanaged','ChatMessage','UserId','User','unshift','queueId','ChatQueue','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','notify','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','ChatOfflineMessage','fromString','mimetype','server','attachments','openNewInteraction','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','originalname','subjectOffline','toPairsIn','mapValues','NotifyMailAccount','notifyMail','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','ids','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','getProactiveActions','virtual','increment','server/files/chat/iframe.ejs','URL','address','3.8.0','remote','x-real-ip','connection','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','sequelize','READ_COMMITTED','ChatApplication','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','getFields','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','spread','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','mustache','path','ejs','fs-extra','querystring','html-to-text','ioredis','jayson/promise'];(function(_0x1e7bdd,_0x216b81){var _0xcd343d=function(_0x5203cd){while(--_0x5203cd){_0x1e7bdd['push'](_0x1e7bdd['shift']());}};_0xcd343d(++_0x216b81);}(_0xb10b,0x12a));var _0xbb10=function(_0x504dc3,_0x547139){_0x504dc3=_0x504dc3-0x0;var _0x2d352c=_0xb10b[_0x504dc3];return _0x2d352c;};'use strict';var Mustache=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var ejs=require(_0xbb10('0x2'));var fs=require('fs');var fs_extra=require(_0xbb10('0x3'));var _=require('lodash');var querystring=require(_0xbb10('0x4'));var htmlToText=require(_0xbb10('0x5'));var Redis=require(_0xbb10('0x6'));var jayson=require(_0xbb10('0x7'));var url=require(_0xbb10('0x8'));var qs=require(_0xbb10('0x9'));var logger=require('../../config/logger')(_0xbb10('0xa'));var config=require(_0xbb10('0xb'));var APIOutOfIntervalError=require('../../errors/api')[_0xbb10('0xc')];var APINotFoundError=require(_0xbb10('0xd'))[_0xbb10('0xe')];var APIHandleError=require(_0xbb10('0xd'))[_0xbb10('0xf')];var db=require(_0xbb10('0x10'))['db'];config[_0xbb10('0x11')]=_[_0xbb10('0x12')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xbb10('0x13'))(new Redis(config[_0xbb10('0x11')]));require(_0xbb10('0x14'))['register'](socket);var client=jayson[_0xbb10('0x15')]['http']({'port':0x232c});var client9002=jayson[_0xbb10('0x15')][_0xbb10('0x16')]({'port':0x232a});var client9003=jayson[_0xbb10('0x15')][_0xbb10('0x16')]({'port':0x232b});var client9001=jayson[_0xbb10('0x15')][_0xbb10('0x16')]({'port':0x2329});function respondWithRpcPromise(_0x58a612,_0x26e021,_0x42d7e4,_0x45b9d6){return new Promise(function(_0x17fd46,_0x3df17b){var _0x2f2ebf=_0x45b9d6||client;return _0x2f2ebf[_0xbb10('0x17')](_0x58a612,_0x42d7e4)[_0xbb10('0x18')](function(_0x3e26f4){logger[_0xbb10('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x26e021,_0xbb10('0x1a'));logger[_0xbb10('0x1b')](_0xbb10('0x1c'),_0x26e021,_0xbb10('0x1a'),JSON[_0xbb10('0x1d')](_0x3e26f4));if(_0x3e26f4[_0xbb10('0x1e')]){if(_0x3e26f4[_0xbb10('0x1e')][_0xbb10('0x1f')]===0x1f4){logger[_0xbb10('0x1e')](_0xbb10('0x20'),_0x26e021,_0x3e26f4['error'][_0xbb10('0x21')]);return _0x3df17b(_0x3e26f4[_0xbb10('0x1e')][_0xbb10('0x21')]);}logger[_0xbb10('0x1e')](_0xbb10('0x20'),_0x26e021,_0x3e26f4[_0xbb10('0x1e')]['message']);return _0x17fd46(_0x3e26f4[_0xbb10('0x1e')][_0xbb10('0x21')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x26e021,_0xbb10('0x1a'));_0x17fd46(_0x3e26f4[_0xbb10('0x22')][_0xbb10('0x21')]);}})[_0xbb10('0x23')](function(_0x445761){logger[_0xbb10('0x1e')](_0xbb10('0x20'),_0x26e021,_0x445761);_0x3df17b(_0x445761);});});}function respondWithStatusCode(_0x436104,_0x7f2377){_0x7f2377=_0x7f2377||0xcc;return function(_0x395404){if(_0x395404){return _0x436104[_0xbb10('0x24')](_0x7f2377);}return _0x436104[_0xbb10('0x25')](_0x7f2377)['end']();};}function respondWithResult(_0x4fedac,_0x4fb5e0){_0x4fb5e0=_0x4fb5e0||0xc8;return function(_0xc93a04){if(_0xc93a04){return _0x4fedac[_0xbb10('0x25')](_0x4fb5e0)[_0xbb10('0x26')](_0xc93a04);}};}function respondWithFilteredResult(_0x4e25ff,_0x2fdde9){return function(_0x24d586){if(_0x24d586){var _0x6ed43b=typeof _0x2fdde9[_0xbb10('0x27')]===_0xbb10('0x28')&&typeof _0x2fdde9[_0xbb10('0x29')]===_0xbb10('0x28');var _0x4aabb9=_0x24d586[_0xbb10('0x2a')];var _0x21ac54=_0x6ed43b?0x0:_0x2fdde9[_0xbb10('0x27')];var _0x2e0249=_0x6ed43b?_0x24d586[_0xbb10('0x2a')]:_0x2fdde9[_0xbb10('0x27')]+_0x2fdde9['limit'];var _0x221624;if(_0x2e0249>=_0x4aabb9){_0x2e0249=_0x4aabb9;_0x221624=0xc8;}else{_0x221624=0xce;}_0x4e25ff['status'](_0x221624);return _0x4e25ff[_0xbb10('0x2b')]('Content-Range',_0x21ac54+'-'+_0x2e0249+'/'+_0x4aabb9)[_0xbb10('0x26')](_0x24d586);}return null;};}function saveUpdates(_0x1dcc9c){return function(_0x1b59f9){if(_0x1b59f9){return _0x1b59f9['update'](_0x1dcc9c)['then'](function(_0x4c3744){return _0x4c3744;});}return null;};}function removeEntity(_0x34f65e){return function(_0x4f590d){if(_0x4f590d){return _0x4f590d[_0xbb10('0x2c')]()[_0xbb10('0x18')](function(){var _0x2f653f=_0x4f590d[_0xbb10('0x2d')]({'plain':!![]});var _0x37a83f=_0xbb10('0x2e');return db[_0xbb10('0x2f')]['destroy']({'where':{'type':_0x37a83f,'resourceId':_0x2f653f['id']}})[_0xbb10('0x18')](function(){return _0x4f590d;});})[_0xbb10('0x18')](function(){_0x34f65e[_0xbb10('0x25')](0xcc)[_0xbb10('0x30')]();});}};}function handleEntityNotFound(_0xfb2c5e){return function(_0x9de708){if(!_0x9de708){_0xfb2c5e[_0xbb10('0x24')](0x194);}return _0x9de708;};}function handleError(_0x10202c,_0x3c8d7d){_0x3c8d7d=_0x3c8d7d||0x1f4;return function(_0x56943c){logger[_0xbb10('0x1e')](_0x56943c[_0xbb10('0x31')]);if(_0x56943c[_0xbb10('0x32')]){delete _0x56943c[_0xbb10('0x32')];}_0x10202c['status'](_0x3c8d7d)[_0xbb10('0x33')](_0x56943c);};}function iftimePromise(_0x5de37b,_0x4e2754){return respondWithRpcPromise(_0xbb10('0x34'),_0xbb10('0x35'),{'command':_0x4e2754[_0xbb10('0x36')]?util[_0xbb10('0x37')](_0xbb10('0x38'),_0x5de37b[_0xbb10('0x39')],_0x4e2754['timezone']):util[_0xbb10('0x37')](_0xbb10('0x3a'),_0x5de37b['interval'])},client9002)['then'](function(_0x5cd55f){var _0x31bee3=_0x5cd55f&&_0x5cd55f[_0xbb10('0x3b')](_0xbb10('0x3c'))>=0x0?!![]:![];logger['info'](_0xbb10('0x3d'),_0x4e2754['id'],_0x5de37b['id'],_0x5de37b[_0xbb10('0x39')],_0x31bee3?_0xbb10('0x3e'):'OFFLINE',_0x4e2754[_0xbb10('0x36')]?_0x4e2754[_0xbb10('0x36')]:_0xbb10('0x3f'));return _0x31bee3;})[_0xbb10('0x23')](function(_0x4f1cdd){logger[_0xbb10('0x1e')](_0xbb10('0x3d'),_0x4e2754['id'],_0x5de37b['id'],_0x5de37b['interval'],util[_0xbb10('0x40')](_0x4f1cdd,{'showHidden':![],'depth':null}),_0x4e2754[_0xbb10('0x36')]?_0x4e2754[_0xbb10('0x36')]:_0xbb10('0x3f'));return![];});}function checkWebsiteIntervals(_0x2dd35a){var _0x185a52=_['map'](_0x2dd35a[_0xbb10('0x41')][_0xbb10('0x42')],function(_0x3e7b4c){var _0x3d3c41=_0x3e7b4c['get']({'plain':!![]});return iftimePromise(_0x3d3c41,_0x2dd35a);});return Promise[_0xbb10('0x43')](_0x185a52)[_0xbb10('0x18')](function(_0x23dc18){return _[_0xbb10('0x44')](_0x23dc18);});}function createInteractionObject(_0x5e2cfa,_0x351484,_0x202c60,_0x54ac18){var _0x5d9a4f=require(_0xbb10('0x45'));var _0x4a3ddf=new _0x5d9a4f();var _0x318984=_0x4a3ddf[_0xbb10('0x46')](_0x202c60['user-agent'])[_0xbb10('0x47')]();var _0x1d82bf=_0x351484[_0xbb10('0x48')];if(_0x202c60['cf-connecting-ip']){_0x1d82bf=_0x202c60[_0xbb10('0x49')];}else if(_0x202c60[_0xbb10('0x4a')]){_0x1d82bf=_[_0xbb10('0x4b')](_0x202c60[_0xbb10('0x4a')][_0xbb10('0x4c')](','));}return{'ContactId':_0x54ac18['id'],'ChatWebsiteId':_0x5e2cfa,'from':(_0x54ac18[_0xbb10('0x4d')]||'')+'\x20'+(_0x54ac18[_0xbb10('0x4e')]||''),'customerIp':_0x1d82bf,'customerPort':_0x202c60[_0xbb10('0x4f')]?_0x202c60[_0xbb10('0x4f')]:null,'referer':_0x351484[_0xbb10('0x50')],'browserName':_0x318984[_0xbb10('0x51')][_0xbb10('0x32')]&&_0x318984['browser'][_0xbb10('0x52')]?util[_0xbb10('0x37')]('%s\x20%s',_0x318984[_0xbb10('0x51')][_0xbb10('0x32')],_0x318984[_0xbb10('0x51')][_0xbb10('0x52')]):_0xbb10('0x53'),'browserVersion':_0x318984[_0xbb10('0x51')][_0xbb10('0x52')]||'unknown','osName':util['format'](_0xbb10('0x54'),_0x318984['os'][_0xbb10('0x32')],_0x318984['os'][_0xbb10('0x52')]),'osVersion':_0x318984['os']['version'],'deviceModel':_0x318984['device'][_0xbb10('0x55')]&&_0x318984[_0xbb10('0x56')][_0xbb10('0x57')]?util[_0xbb10('0x37')](_0xbb10('0x58'),_0x318984[_0xbb10('0x56')][_0xbb10('0x55')],_0x318984[_0xbb10('0x56')][_0xbb10('0x57')],_0x318984[_0xbb10('0x56')]['type']):null,'deviceVendor':_0x318984['device'][_0xbb10('0x57')],'deviceType':_0x318984[_0xbb10('0x56')][_0xbb10('0x59')],'formData':JSON[_0xbb10('0x1d')](_0x351484)};}exports[_0xbb10('0x5a')]=function(_0x440f9e,_0x358e7e){var _0x445870={'include':[{'model':db[_0xbb10('0x5b')],'as':_0xbb10('0x5c')}]},_0x1c0d8f={},_0x1214f7={'count':0x0,'rows':[]};var _0x61e689=_[_0xbb10('0x5d')](db[_0xbb10('0x5e')]['rawAttributes'],function(_0x124052){return{'name':_0x124052['fieldName'],'type':_0x124052[_0xbb10('0x59')][_0xbb10('0x5f')]};});_0x1c0d8f[_0xbb10('0x55')]=_[_0xbb10('0x5d')](_0x61e689,_0xbb10('0x32'));_0x1c0d8f[_0xbb10('0x60')]=_[_0xbb10('0x61')](_0x440f9e[_0xbb10('0x60')]);_0x1c0d8f[_0xbb10('0x62')]=_[_0xbb10('0x63')](_0x1c0d8f[_0xbb10('0x55')],_0x1c0d8f[_0xbb10('0x60')]);_0x445870[_0xbb10('0x64')]=_[_0xbb10('0x63')](_0x1c0d8f[_0xbb10('0x55')],qs['fields'](_0x440f9e[_0xbb10('0x60')][_0xbb10('0x65')]));_0x445870[_0xbb10('0x64')]=_0x445870[_0xbb10('0x64')][_0xbb10('0x66')]?_0x445870[_0xbb10('0x64')]:_0x1c0d8f['model'];if(!_0x440f9e[_0xbb10('0x60')][_0xbb10('0x67')](_0xbb10('0x68'))){_0x445870[_0xbb10('0x29')]=qs[_0xbb10('0x29')](_0x440f9e[_0xbb10('0x60')][_0xbb10('0x29')]);_0x445870[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x440f9e[_0xbb10('0x60')][_0xbb10('0x27')]);}_0x445870[_0xbb10('0x69')]=qs[_0xbb10('0x6a')](_0x440f9e['query']['sort']);_0x445870[_0xbb10('0x6b')]=qs[_0xbb10('0x62')](_[_0xbb10('0x6c')](_0x440f9e[_0xbb10('0x60')],_0x1c0d8f['filters']),_0x61e689);if(_0x440f9e['query'][_0xbb10('0x6d')]){_0x445870[_0xbb10('0x6b')]=_[_0xbb10('0x6e')](_0x445870[_0xbb10('0x6b')],{'$or':_[_0xbb10('0x5d')](_0x61e689,function(_0x3e9753){if(_0x3e9753[_0xbb10('0x59')]!=='VIRTUAL'){var _0x117e84={};_0x117e84[_0x3e9753[_0xbb10('0x32')]]={'$like':'%'+_0x440f9e['query']['filter']+'%'};return _0x117e84;}})});}_0x445870=_['merge']({},_0x445870,_0x440f9e[_0xbb10('0x6f')]);var _0x31c727={'where':_0x445870[_0xbb10('0x6b')]};return db['ChatWebsite']['count'](_0x31c727)['then'](function(_0x3ebc5f){_0x1214f7[_0xbb10('0x2a')]=_0x3ebc5f;if(_0x440f9e[_0xbb10('0x60')]['includeAll']){_0x445870[_0xbb10('0x70')]=[{'all':!![]}];}return db[_0xbb10('0x5e')]['findAll'](_0x445870);})['then'](function(_0x27d7b9){_0x1214f7[_0xbb10('0x71')]=_0x27d7b9;return _0x1214f7;})[_0xbb10('0x18')](respondWithFilteredResult(_0x358e7e,_0x445870))[_0xbb10('0x23')](handleError(_0x358e7e,null));};exports['show']=function(_0x43eaec,_0xec48ac){var _0xa7179d={'raw':![],'where':{'id':_0x43eaec[_0xbb10('0x72')]['id']},'include':[{'model':db[_0xbb10('0x5b')],'as':_0xbb10('0x5c')}]},_0x5202d7={};_0x5202d7['model']=_[_0xbb10('0x61')](db[_0xbb10('0x5e')][_0xbb10('0x73')]);_0x5202d7[_0xbb10('0x60')]=_['keys'](_0x43eaec[_0xbb10('0x60')]);_0x5202d7[_0xbb10('0x62')]=_[_0xbb10('0x63')](_0x5202d7[_0xbb10('0x55')],_0x5202d7['query']);_0xa7179d[_0xbb10('0x64')]=_[_0xbb10('0x63')](_0x5202d7[_0xbb10('0x55')],qs[_0xbb10('0x65')](_0x43eaec[_0xbb10('0x60')][_0xbb10('0x65')]));_0xa7179d[_0xbb10('0x64')]=_0xa7179d['attributes']['length']?_0xa7179d['attributes']:_0x5202d7[_0xbb10('0x55')];if(_0x43eaec[_0xbb10('0x60')][_0xbb10('0x74')]){_0xa7179d['include']=[{'all':!![]}];}_0xa7179d=_['merge']({},_0xa7179d,_0x43eaec[_0xbb10('0x6f')]);return db[_0xbb10('0x5e')][_0xbb10('0x75')](_0xa7179d)[_0xbb10('0x18')](handleEntityNotFound(_0xec48ac,null))[_0xbb10('0x18')](respondWithResult(_0xec48ac,null))[_0xbb10('0x23')](handleError(_0xec48ac,null));};exports['create']=function(_0x1a5ca5,_0x15fae2){return db[_0xbb10('0x5e')][_0xbb10('0x76')](_0x1a5ca5[_0xbb10('0x77')],{})['then'](function(_0x56094a){var _0x5ad6ad=_0x1a5ca5[_0xbb10('0x78')][_0xbb10('0x2d')]({'plain':!![]});if(!_0x5ad6ad)throw new Error(_0xbb10('0x79'));if(_0x5ad6ad[_0xbb10('0x7a')]===_0xbb10('0x78')){var _0x1d40b8=_0x56094a['get']({'plain':!![]});var _0x93f3c4='ChatWebsites';return db['UserProfileSection']['find']({'where':{'name':_0x93f3c4,'userProfileId':_0x5ad6ad[_0xbb10('0x7b')]},'raw':!![]})[_0xbb10('0x18')](function(_0x23b1d5){if(_0x23b1d5&&_0x23b1d5[_0xbb10('0x7c')]===0x0){return db['UserProfileResource'][_0xbb10('0x76')]({'name':_0x1d40b8['name'],'resourceId':_0x1d40b8['id'],'type':_0x23b1d5['name'],'sectionId':_0x23b1d5['id']},{})[_0xbb10('0x18')](function(){return _0x56094a;});}else{return _0x56094a;}})[_0xbb10('0x23')](function(_0x29529c){logger[_0xbb10('0x1e')](_0xbb10('0x7d'),_0x29529c);throw _0x29529c;});}return _0x56094a;})['then'](respondWithResult(_0x15fae2,0xc9))[_0xbb10('0x23')](handleError(_0x15fae2,null));};exports[_0xbb10('0x7e')]=function(_0x2c6429,_0x3f3d38){if(_0x2c6429[_0xbb10('0x77')]['id']){delete _0x2c6429[_0xbb10('0x77')]['id'];}return db[_0xbb10('0x5e')]['find']({'where':{'id':_0x2c6429[_0xbb10('0x72')]['id']},'include':[{'model':db[_0xbb10('0x5b')],'as':_0xbb10('0x5c')}]})[_0xbb10('0x18')](handleEntityNotFound(_0x3f3d38,null))[_0xbb10('0x18')](saveUpdates(_0x2c6429[_0xbb10('0x77')],null))[_0xbb10('0x18')](respondWithResult(_0x3f3d38,null))[_0xbb10('0x23')](handleError(_0x3f3d38,null));};exports['destroy']=function(_0x428146,_0x218690){return db[_0xbb10('0x5e')]['find']({'where':{'id':_0x428146['params']['id']}})['then'](handleEntityNotFound(_0x218690,null))[_0xbb10('0x18')](removeEntity(_0x218690,null))['catch'](handleError(_0x218690,null));};exports['describe']=function(_0x1701c5,_0x3ee56b){return db[_0xbb10('0x5e')][_0xbb10('0x7f')]()[_0xbb10('0x18')](respondWithResult(_0x3ee56b,null))[_0xbb10('0x23')](handleError(_0x3ee56b,null));};exports[_0xbb10('0x80')]=function(_0x417304,_0x188b97){if(_0x417304['body']['id']){delete _0x417304[_0xbb10('0x77')]['id'];}return db[_0xbb10('0x5e')][_0xbb10('0x75')]({'where':{'id':_0x417304[_0xbb10('0x72')]['id']}})['then'](handleEntityNotFound(_0x188b97,null))['then'](function(_0x3547a3){if(_0x3547a3){_0x417304[_0xbb10('0x77')][_0xbb10('0x81')]=_0x3547a3['id'];return db[_0xbb10('0x82')]['create'](_0x417304[_0xbb10('0x77')]);}})[_0xbb10('0x18')](respondWithResult(_0x188b97,null))[_0xbb10('0x23')](handleError(_0x188b97,null));};exports[_0xbb10('0x83')]=function(_0x35c1e8,_0x517185){var _0x5f0691={'raw':![],'where':{}};var _0x372636={};var _0x53c698={'count':0x0,'rows':[]};return db[_0xbb10('0x5e')]['findOne']({'where':{'id':_0x35c1e8[_0xbb10('0x72')]['id']}})[_0xbb10('0x18')](handleEntityNotFound(_0x517185,null))['then'](function(_0x5caa06){if(_0x5caa06){_0x372636[_0xbb10('0x55')]=_[_0xbb10('0x61')](db[_0xbb10('0x82')]['rawAttributes']);_0x372636[_0xbb10('0x60')]=_[_0xbb10('0x61')](_0x35c1e8[_0xbb10('0x60')]);_0x372636[_0xbb10('0x62')]=_[_0xbb10('0x63')](_0x372636[_0xbb10('0x55')],_0x372636[_0xbb10('0x60')]);_0x5f0691[_0xbb10('0x64')]=_[_0xbb10('0x63')](_0x372636['model'],qs[_0xbb10('0x65')](_0x35c1e8[_0xbb10('0x60')][_0xbb10('0x65')]));_0x5f0691[_0xbb10('0x64')]=_0x5f0691[_0xbb10('0x64')][_0xbb10('0x66')]?_0x5f0691[_0xbb10('0x64')]:_0x372636[_0xbb10('0x55')];if(!_0x35c1e8[_0xbb10('0x60')][_0xbb10('0x67')](_0xbb10('0x68'))){_0x5f0691[_0xbb10('0x29')]=qs['limit'](_0x35c1e8['query'][_0xbb10('0x29')]);_0x5f0691[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x35c1e8[_0xbb10('0x60')][_0xbb10('0x27')]);}_0x5f0691['order']=qs[_0xbb10('0x6a')](_0x35c1e8[_0xbb10('0x60')][_0xbb10('0x6a')]);_0x5f0691[_0xbb10('0x6b')]=qs[_0xbb10('0x62')](_[_0xbb10('0x6c')](_0x35c1e8['query'],_0x372636[_0xbb10('0x62')]));_0x5f0691[_0xbb10('0x6b')]['ChatWebsiteId']=_0x5caa06['id'];if(_0x35c1e8[_0xbb10('0x60')]['filter']){_0x5f0691[_0xbb10('0x6b')]=_[_0xbb10('0x6e')](_0x5f0691[_0xbb10('0x6b')],{'$or':_[_0xbb10('0x5d')](_0x5f0691[_0xbb10('0x64')],function(_0x556d7b){var _0x10d91d={};_0x10d91d[_0x556d7b]={'$like':'%'+_0x35c1e8['query'][_0xbb10('0x6d')]+'%'};return _0x10d91d;})});}_0x5f0691=_[_0xbb10('0x6e')]({},_0x5f0691,_0x35c1e8['options']);return db['Disposition'][_0xbb10('0x2a')]({'where':_0x5f0691[_0xbb10('0x6b')]})[_0xbb10('0x18')](function(_0x283bab){_0x53c698[_0xbb10('0x2a')]=_0x283bab;if(_0x35c1e8[_0xbb10('0x60')][_0xbb10('0x74')]){_0x5f0691[_0xbb10('0x70')]=[{'all':!![]}];}return db[_0xbb10('0x82')][_0xbb10('0x84')](_0x5f0691);})[_0xbb10('0x18')](function(_0x4c0b83){_0x53c698[_0xbb10('0x71')]=_0x4c0b83;return _0x53c698;});}})[_0xbb10('0x18')](respondWithFilteredResult(_0x517185,_0x5f0691))[_0xbb10('0x23')](handleError(_0x517185,null));};exports[_0xbb10('0x85')]=function(_0xfe02f5,_0x86a6ff){return db[_0xbb10('0x5e')][_0xbb10('0x75')]({'where':{'id':_0xfe02f5[_0xbb10('0x72')]['id']}})[_0xbb10('0x18')](handleEntityNotFound(_0x86a6ff,null))[_0xbb10('0x18')](function(_0x2d3e98){if(_0x2d3e98){return _0x2d3e98['removeDispositions'](_0xfe02f5[_0xbb10('0x60')]['ids']);}})[_0xbb10('0x18')](respondWithStatusCode(_0x86a6ff,null))[_0xbb10('0x23')](handleError(_0x86a6ff,null));};exports[_0xbb10('0x86')]=function(_0x40236c,_0x38d369){if(_0x40236c['body']['id']){delete _0x40236c[_0xbb10('0x77')]['id'];}return db[_0xbb10('0x5e')][_0xbb10('0x75')]({'where':{'id':_0x40236c[_0xbb10('0x72')]['id']}})[_0xbb10('0x18')](handleEntityNotFound(_0x38d369,null))[_0xbb10('0x18')](function(_0x4970fe){if(_0x4970fe){_0x40236c['body'][_0xbb10('0x81')]=_0x4970fe['id'];return db[_0xbb10('0x87')][_0xbb10('0x76')](_0x40236c['body']);}})[_0xbb10('0x18')](respondWithResult(_0x38d369,null))[_0xbb10('0x23')](handleError(_0x38d369,null));};exports['getAnswers']=function(_0x2831de,_0xaede56){var _0x5642c3={'raw':![],'where':{}};var _0xdd3c7e={};var _0x4d7bca={'count':0x0,'rows':[]};return db[_0xbb10('0x5e')][_0xbb10('0x88')]({'where':{'id':_0x2831de['params']['id']}})[_0xbb10('0x18')](handleEntityNotFound(_0xaede56,null))[_0xbb10('0x18')](function(_0x4bac29){if(_0x4bac29){_0xdd3c7e['model']=_[_0xbb10('0x61')](db[_0xbb10('0x87')][_0xbb10('0x73')]);_0xdd3c7e[_0xbb10('0x60')]=_[_0xbb10('0x61')](_0x2831de['query']);_0xdd3c7e[_0xbb10('0x62')]=_[_0xbb10('0x63')](_0xdd3c7e[_0xbb10('0x55')],_0xdd3c7e['query']);_0x5642c3[_0xbb10('0x64')]=_[_0xbb10('0x63')](_0xdd3c7e[_0xbb10('0x55')],qs[_0xbb10('0x65')](_0x2831de[_0xbb10('0x60')][_0xbb10('0x65')]));_0x5642c3[_0xbb10('0x64')]=_0x5642c3[_0xbb10('0x64')][_0xbb10('0x66')]?_0x5642c3['attributes']:_0xdd3c7e['model'];if(!_0x2831de[_0xbb10('0x60')][_0xbb10('0x67')](_0xbb10('0x68'))){_0x5642c3[_0xbb10('0x29')]=qs[_0xbb10('0x29')](_0x2831de[_0xbb10('0x60')][_0xbb10('0x29')]);_0x5642c3[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x2831de[_0xbb10('0x60')][_0xbb10('0x27')]);}_0x5642c3[_0xbb10('0x69')]=qs[_0xbb10('0x6a')](_0x2831de['query'][_0xbb10('0x6a')]);_0x5642c3[_0xbb10('0x6b')]=qs[_0xbb10('0x62')](_[_0xbb10('0x6c')](_0x2831de[_0xbb10('0x60')],_0xdd3c7e[_0xbb10('0x62')]));_0x5642c3[_0xbb10('0x6b')][_0xbb10('0x81')]=_0x4bac29['id'];if(_0x2831de[_0xbb10('0x60')][_0xbb10('0x6d')]){_0x5642c3[_0xbb10('0x6b')]=_['merge'](_0x5642c3[_0xbb10('0x6b')],{'$or':_['map'](_0x5642c3[_0xbb10('0x64')],function(_0x22ae3c){var _0x25b1b3={};_0x25b1b3[_0x22ae3c]={'$like':'%'+_0x2831de[_0xbb10('0x60')][_0xbb10('0x6d')]+'%'};return _0x25b1b3;})});}_0x5642c3=_[_0xbb10('0x6e')]({},_0x5642c3,_0x2831de['options']);return db[_0xbb10('0x87')]['count']({'where':_0x5642c3[_0xbb10('0x6b')]})[_0xbb10('0x18')](function(_0xda122){_0x4d7bca[_0xbb10('0x2a')]=_0xda122;if(_0x2831de[_0xbb10('0x60')][_0xbb10('0x74')]){_0x5642c3[_0xbb10('0x70')]=[{'all':!![]}];}return db[_0xbb10('0x87')][_0xbb10('0x84')](_0x5642c3);})[_0xbb10('0x18')](function(_0x13efa1){_0x4d7bca[_0xbb10('0x71')]=_0x13efa1;return _0x4d7bca;});}})['then'](respondWithFilteredResult(_0xaede56,_0x5642c3))[_0xbb10('0x23')](handleError(_0xaede56,null));};exports['removeAnswers']=function(_0xe70161,_0x36e9b0){return db[_0xbb10('0x5e')][_0xbb10('0x75')]({'where':{'id':_0xe70161[_0xbb10('0x72')]['id']}})[_0xbb10('0x18')](handleEntityNotFound(_0x36e9b0,null))[_0xbb10('0x18')](function(_0x5e9888){if(_0x5e9888){return _0x5e9888[_0xbb10('0x89')](_0xe70161['query']['ids']);}})[_0xbb10('0x18')](respondWithStatusCode(_0x36e9b0,null))[_0xbb10('0x23')](handleError(_0x36e9b0,null));};exports[_0xbb10('0x8a')]=function(_0x1fd88a,_0x1fc4ec){_0x1fd88a[_0xbb10('0x77')]['sitepic']=_0x1fd88a[_0xbb10('0x8b')][_0xbb10('0x8c')];return db[_0xbb10('0x5e')][_0xbb10('0x75')]({'where':{'id':_0x1fd88a[_0xbb10('0x72')]['id']}})[_0xbb10('0x18')](handleEntityNotFound(_0x1fc4ec,null))['then'](saveUpdates(_0x1fd88a[_0xbb10('0x77')],null))[_0xbb10('0x18')](respondWithResult(_0x1fc4ec,null))[_0xbb10('0x23')](handleError(_0x1fc4ec,null));};exports[_0xbb10('0x8d')]=function(_0x31718f,_0x5ecb87){_0x31718f[_0xbb10('0x77')]['agentAvatar']=_0x31718f[_0xbb10('0x8b')]['filename'];return db[_0xbb10('0x5e')]['find']({'where':{'id':_0x31718f['params']['id']}})[_0xbb10('0x18')](handleEntityNotFound(_0x5ecb87,null))[_0xbb10('0x18')](saveUpdates(_0x31718f[_0xbb10('0x77')],null))[_0xbb10('0x18')](respondWithResult(_0x5ecb87,null))[_0xbb10('0x23')](handleError(_0x5ecb87,null));};exports['addCustomerAvatar']=function(_0xa42b80,_0x565ddf){_0xa42b80['body']['customerAvatar']=_0xa42b80[_0xbb10('0x8b')][_0xbb10('0x8c')];return db[_0xbb10('0x5e')][_0xbb10('0x75')]({'where':{'id':_0xa42b80[_0xbb10('0x72')]['id']}})['then'](handleEntityNotFound(_0x565ddf,null))[_0xbb10('0x18')](saveUpdates(_0xa42b80[_0xbb10('0x77')],null))[_0xbb10('0x18')](respondWithResult(_0x565ddf,null))[_0xbb10('0x23')](handleError(_0x565ddf,null));};exports[_0xbb10('0x8e')]=function(_0x37ff15,_0x2ef6ee){_0x37ff15['body']['systemAvatar']=_0x37ff15['file'][_0xbb10('0x8c')];return db[_0xbb10('0x5e')][_0xbb10('0x75')]({'where':{'id':_0x37ff15[_0xbb10('0x72')]['id']}})[_0xbb10('0x18')](handleEntityNotFound(_0x2ef6ee,null))[_0xbb10('0x18')](saveUpdates(_0x37ff15[_0xbb10('0x77')],null))[_0xbb10('0x18')](respondWithResult(_0x2ef6ee,null))[_0xbb10('0x23')](handleError(_0x2ef6ee,null));};exports[_0xbb10('0x8f')]=function(_0x4cc8d4,_0x58295f){var _0x4dce53=path[_0xbb10('0x90')](config[_0xbb10('0x91')],_0xbb10('0x92'));var _0x47c820={'where':{'id':_0x4cc8d4[_0xbb10('0x72')]['id']},'attributes':['id',_0xbb10('0x93')],'raw':!![]};var _0x2c638d=![];return require(_0xbb10('0x94'))[_0xbb10('0x95')]()[_0xbb10('0x18')](function(_0x485f46){if(_0x485f46){_0x2c638d=_0x485f46['custom'];}})[_0xbb10('0x18')](function(){return db['ChatWebsite'][_0xbb10('0x75')](_0x47c820);})[_0xbb10('0x18')](handleEntityNotFound(_0x58295f,null))[_0xbb10('0x18')](function(_0x15dcde){if(_0x15dcde){if(!_[_0xbb10('0x96')](_0x15dcde[_0xbb10('0x93')])){if(fs[_0xbb10('0x97')](path[_0xbb10('0x90')](config[_0xbb10('0x91')],_0xbb10('0x98'),_0x15dcde['sitepic']))&&_0x2c638d){_0x4dce53=path[_0xbb10('0x90')](config['root'],_0xbb10('0x98'),_0x15dcde['sitepic']);}}return _0x58295f[_0xbb10('0x99')](_0x4dce53);}})[_0xbb10('0x23')](handleError(_0x58295f,null));};exports[_0xbb10('0x9a')]=function(_0x373c0e,_0x5ee229){var _0xcc246f=path['join'](config[_0xbb10('0x91')],_0xbb10('0x9b'));var _0xcdaf04={'where':{'id':_0x373c0e['params']['id']},'attributes':['id',_0xbb10('0x9c')],'raw':!![]};return db[_0xbb10('0x5e')][_0xbb10('0x75')](_0xcdaf04)[_0xbb10('0x18')](handleEntityNotFound(_0x5ee229,null))[_0xbb10('0x18')](function(_0x309ec1){if(_0x309ec1){if(!_['isNil'](_0x309ec1['agentAvatar'])){if(fs['existsSync'](path[_0xbb10('0x90')](config['root'],_0xbb10('0x9d'),_0x309ec1['agentAvatar']))){_0xcc246f=path[_0xbb10('0x90')](config[_0xbb10('0x91')],_0xbb10('0x9d'),_0x309ec1['agentAvatar']);}}return _0x5ee229['download'](_0xcc246f);}})[_0xbb10('0x23')](handleError(_0x5ee229,null));};exports[_0xbb10('0x9e')]=function(_0x443e56,_0x59b20f){var _0x440108=path[_0xbb10('0x90')](config[_0xbb10('0x91')],'server/files/images/avatars/customer_avatar.png');var _0x47d144={'where':{'id':_0x443e56['params']['id']},'attributes':['id',_0xbb10('0x9f'),'showCustomerAvatar'],'raw':!![]};return db[_0xbb10('0x5e')][_0xbb10('0x75')](_0x47d144)[_0xbb10('0x18')](handleEntityNotFound(_0x59b20f,null))[_0xbb10('0x18')](function(_0x365238){if(_0x365238){if(!_[_0xbb10('0x96')](_0x365238[_0xbb10('0x9f')])){if(fs[_0xbb10('0x97')](path[_0xbb10('0x90')](config[_0xbb10('0x91')],_0xbb10('0x9d'),_0x365238['customerAvatar']))&&_0x365238[_0xbb10('0xa0')]){_0x440108=path[_0xbb10('0x90')](config['root'],_0xbb10('0x9d'),_0x365238['customerAvatar']);}}return _0x59b20f['download'](_0x440108);}})[_0xbb10('0x23')](handleError(_0x59b20f,null));};exports[_0xbb10('0xa1')]=function(_0x35a78e,_0x2fa574){var _0x99c4=path['join'](config[_0xbb10('0x91')],_0xbb10('0xa2'));var _0x4f17c1={'where':{'id':_0x35a78e[_0xbb10('0x72')]['id']},'attributes':['id',_0xbb10('0xa3')],'raw':!![]};return db['ChatWebsite'][_0xbb10('0x75')](_0x4f17c1)['then'](handleEntityNotFound(_0x2fa574,null))[_0xbb10('0x18')](function(_0x8e8049){if(_0x8e8049){if(!_[_0xbb10('0x96')](_0x8e8049[_0xbb10('0xa3')])){if(fs[_0xbb10('0x97')](path[_0xbb10('0x90')](config[_0xbb10('0x91')],'server/files/images/avatars/',_0x8e8049[_0xbb10('0xa3')]))){_0x99c4=path[_0xbb10('0x90')](config[_0xbb10('0x91')],_0xbb10('0x9d'),_0x8e8049[_0xbb10('0xa3')]);}}return _0x2fa574[_0xbb10('0x99')](_0x99c4);}})['catch'](handleError(_0x2fa574,null));};exports['notify']=function(_0x5a40e8,_0x23849e){var _0x377e6a={'body':_0x5a40e8[_0xbb10('0x77')],'channel':_0xbb10('0xa4')};var _0x57700b=[];var _0x3b01a3=[];var _0x3d7b4d={};var _0x468e26=![];return db['CmContact']['describe']()[_0xbb10('0x18')](function(_0x4b5b66){if(!_0x4b5b66){throw new db[(_0xbb10('0xa5'))][(_0xbb10('0xa6'))](_0xbb10('0xa7'));}_0x57700b=_[_0xbb10('0xa8')](_[_0xbb10('0x61')](_0x4b5b66),[_0xbb10('0xa9'),_0xbb10('0xaa')]);_0x3b01a3=_['difference'](_[_0xbb10('0x61')](_0x4b5b66),[_0xbb10('0xa9'),'updatedAt',_0xbb10('0xab'),_0xbb10('0xac')]);if(_0x5a40e8[_0xbb10('0x77')]['id']){delete _0x5a40e8['body']['id'];}if(_['isNil'](_0x5a40e8['body'][_0xbb10('0xad')])){throw new db[(_0xbb10('0xa5'))]['ValidationError'](_0xbb10('0xae'));}if(_[_0xbb10('0x96')](_0x5a40e8[_0xbb10('0x77')][_0xbb10('0x77')])||_0x5a40e8[_0xbb10('0x77')][_0xbb10('0x77')]===''){throw new db[(_0xbb10('0xa5'))]['ValidationError'](_0xbb10('0xaf'));}if(_['isNil'](_0x5a40e8['body']['mapKey'])){throw new db[(_0xbb10('0xa5'))][(_0xbb10('0xa6'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3b01a3);}if(!_[_0xbb10('0xb0')](_0x3b01a3,_0x5a40e8['body'][_0xbb10('0xb1')])){throw new db[(_0xbb10('0xa5'))][(_0xbb10('0xa6'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3b01a3);}_0x3d7b4d[_0x5a40e8['body'][_0xbb10('0xb1')]]=_0x5a40e8['body'][_0xbb10('0xad')];})[_0xbb10('0x18')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x5a40e8[_0xbb10('0x72')]['id']},'include':[{'model':db[_0xbb10('0xb2')],'as':_0xbb10('0xb3'),'include':[{'model':db['CmContact'],'as':_0xbb10('0xb4'),'where':_0x3d7b4d,'limit':0x1,'order':[[_0xbb10('0xaa'),_0xbb10('0xb5')]]}]},{'model':db['ChatApplication'],'as':_0xbb10('0xb6')},{'model':db[_0xbb10('0x41')],'as':_0xbb10('0x41'),'include':[{'model':db[_0xbb10('0x41')],'as':_0xbb10('0x42'),'attributes':['id',_0xbb10('0x39')],'raw':!![]}]}]});})[_0xbb10('0x18')](function(_0x1583cb){if(!_0x1583cb)throw new APINotFoundError(util[_0xbb10('0x37')](_0xbb10('0xb7'),_0x5a40e8[_0xbb10('0x72')]['id']));if(!_0x1583cb[_0xbb10('0x41')]||!_0x1583cb[_0xbb10('0x41')]['Intervals'])return[_0x1583cb,!![]];return[_0x1583cb,checkWebsiteIntervals(_0x1583cb)];})['spread'](function(_0x196be4,_0x52767a){if(!_0x52767a)throw new APIOutOfIntervalError();if(!_0x196be4[_0xbb10('0xb3')])return;_0x377e6a[_0xbb10('0xb8')]=_0x196be4;_0x377e6a[_0xbb10('0xb9')]=_0x196be4['List'];_0x377e6a[_0xbb10('0xba')]=_[_0xbb10('0xbb')](_0x196be4[_0xbb10('0xb6')],[_0xbb10('0xbc')],[_0xbb10('0xbd')]);if(_0x377e6a['account'][_0xbb10('0xb6')]){delete _0x377e6a[_0xbb10('0xb8')][_0xbb10('0xb6')];}if(_0x377e6a[_0xbb10('0xb8')][_0xbb10('0xb3')]&&_0x377e6a[_0xbb10('0xb8')]['List'][_0xbb10('0xb4')][_0xbb10('0x66')]){return _0x377e6a['account'][_0xbb10('0xb3')][_0xbb10('0xb4')][0x0];}var _0x2d0de5=_[_0xbb10('0x12')](_0x5a40e8[_0xbb10('0x77')],{'firstName':_0x5a40e8[_0xbb10('0x77')][_0xbb10('0xad')],'ListId':_0x196be4[_0xbb10('0xac')]});_0x2d0de5[_0x5a40e8[_0xbb10('0x77')][_0xbb10('0xb1')]]=_0x5a40e8[_0xbb10('0x77')][_0xbb10('0xad')];return db[_0xbb10('0xbe')][_0xbb10('0x76')](_0x2d0de5,{'fields':_0x57700b,'raw':!![]});})[_0xbb10('0x18')](function(_0x4dff47){_0x377e6a[_0xbb10('0xbf')]=_0x4dff47;var _0x6b5fb3=createInteractionObject(_0x5a40e8['params']['id'],_0x5a40e8['body'],_0x5a40e8[_0xbb10('0xc0')],_0x4dff47);var _0x230dd8={'ChatWebsiteId':_0x5a40e8[_0xbb10('0x72')]['id'],'closed':![]};if(_0x5a40e8[_0xbb10('0x77')][_0xbb10('0xc1')]){_0x230dd8[_0xbb10('0xc1')]=_0x5a40e8[_0xbb10('0x77')][_0xbb10('0xc1')];return db[_0xbb10('0xc2')]['find']({'where':_0x230dd8})['then'](function(_0x4e0cfb){if(_0x4e0cfb){_0x468e26=!![];return _0x4e0cfb;}_0x6b5fb3['threadId']=_0x5a40e8['body']['threadId'];_0x6b5fb3[_0xbb10('0xc3')]=_0x5a40e8[_0xbb10('0x77')][_0xbb10('0xc3')];return db[_0xbb10('0xc2')]['create'](_0x6b5fb3);});}_0x230dd8[_0xbb10('0xc4')]=_0x4dff47['id'];if(_0x5a40e8[_0xbb10('0x77')][_0xbb10('0xc5')]&&_0x5a40e8[_0xbb10('0x77')]['interaction']['id']){_0x230dd8['id']=_0x5a40e8['body'][_0xbb10('0xc5')]['id'];return db[_0xbb10('0xc2')]['find']({'where':_0x230dd8})['then'](function(_0x154a91){if(_0x154a91){_0x468e26=!![];return _0x154a91;}return db[_0xbb10('0xc2')][_0xbb10('0x76')](_0x6b5fb3);});}return db[_0xbb10('0xc2')][_0xbb10('0x76')](_0x6b5fb3);})['then'](function(_0x4744f4){if(!_0x468e26)return _0x4744f4;var _0x5382e9={'from':(_0x377e6a['contact'][_0xbb10('0x4d')]||'')+'\x20'+(_0x377e6a[_0xbb10('0xbf')][_0xbb10('0x4e')]||'')};if(_0x5a40e8[_0xbb10('0x77')][_0xbb10('0xc1')]&&_0x5a40e8[_0xbb10('0x77')]['messageId']&&_0x5a40e8[_0xbb10('0x77')][_0xbb10('0xc1')]!=_0x5a40e8[_0xbb10('0x77')][_0xbb10('0xc6')]){_0x5382e9[_0xbb10('0xc1')]=_0x5a40e8[_0xbb10('0x77')][_0xbb10('0xc6')];}return _0x4744f4[_0xbb10('0x7e')](_0x5382e9);})[_0xbb10('0x18')](function(_0x16f3ce){_0x377e6a[_0xbb10('0xc5')]=_0x16f3ce[_0xbb10('0x2d')]({'plain':!![]});_0x377e6a[_0xbb10('0xc5')][_0xbb10('0xc7')]=!_0x468e26;if(_0x377e6a[_0xbb10('0xc5')][_0xbb10('0xc7')]){if(_0x377e6a[_0xbb10('0xb8')][_0xbb10('0xc8')]){_0x377e6a[_0xbb10('0xba')][_0xbb10('0xc9')]({'id':0x0,'priority':_0x377e6a[_0xbb10('0xba')][_0xbb10('0x66')]+0x1,'app':'close','appdata':_0xbb10('0xca'),'interval':'*,*,*,*'});}}return db[_0xbb10('0xcb')][_0xbb10('0x76')]({'body':_0x5a40e8[_0xbb10('0x77')][_0xbb10('0x77')],'ChatWebsiteId':_0x5a40e8[_0xbb10('0x72')]['id'],'ChatInteractionId':_0x16f3ce['id'],'direction':'in','ContactId':_0x377e6a['contact']['id'],'AttachmentId':_0x5a40e8['body']['AttachmentId']});})[_0xbb10('0x18')](function(_0x2fac6c){_0x377e6a['message']=_0x2fac6c;if(!_0x377e6a[_0xbb10('0xc5')][_0xbb10('0xcc')]){return;}return db[_0xbb10('0xcd')]['find']({'attributes':['id',_0xbb10('0x32')],'where':{'id':_0x377e6a[_0xbb10('0xc5')][_0xbb10('0xcc')]}});})['then'](function(_0x46de6a){if(_0x46de6a){_0x377e6a['applications'][_0xbb10('0xce')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x46de6a['name']+','+(_0x377e6a['account']['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x377e6a['forcedOwnership']=!![];}if(!_0x377e6a[_0xbb10('0xc5')][_0xbb10('0xcf')]){return;}return db[_0xbb10('0xd0')][_0xbb10('0x75')]({'attributes':['id','name'],'where':{'id':_0x377e6a[_0xbb10('0xc5')][_0xbb10('0xcf')]}});})[_0xbb10('0x18')](function(_0x37bc34){if(_0x37bc34){_0x377e6a[_0xbb10('0xba')][_0xbb10('0xce')]({'id':0x0,'priority':0x1,'app':_0xbb10('0xd1'),'appdata':_0x37bc34[_0xbb10('0x32')]+','+(_0x377e6a[_0xbb10('0xb8')][_0xbb10('0xd2')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xbb10('0xd3'),_0xbb10('0xd4'),_0x377e6a);})[_0xbb10('0x18')](function(_0x5c5ecc){respondWithRpcPromise(_0xbb10('0xd5'),_0xbb10('0xd5'),{'event':_0xbb10('0xd6'),'message':_0x5c5ecc},client9002);return _0x5c5ecc;})[_0xbb10('0x18')](respondWithResult(_0x23849e,null))['catch'](APIHandleError(_0x23849e));};exports[_0xbb10('0xd7')]=function(_0xddfe35,_0x604d55){var _0x22ec50,_0x40eb16,_0x3ff3fe;var _0x38eb3d=[];var _0x1c0529={};var _0x3522cd=_0xddfe35[_0xbb10('0xd8')]||[];var _0x3c01ff=[];var _0x4d65e7;return db[_0xbb10('0xbe')][_0xbb10('0x7f')]()['then'](function(_0x5eb1fb){if(!_0x5eb1fb){throw new db[(_0xbb10('0xa5'))][(_0xbb10('0xa6'))]('no\x20available\x20attributes');}_0x38eb3d=_[_0xbb10('0xa8')](_[_0xbb10('0x61')](_0x5eb1fb),['createdAt',_0xbb10('0xaa'),_0xbb10('0xab'),_0xbb10('0xac')]);if(_0xddfe35[_0xbb10('0x77')]['id']){delete _0xddfe35[_0xbb10('0x77')]['id'];}if(_['isNil'](_0xddfe35['body']['from'])){throw _0x604d55[_0xbb10('0x25')](0x1f4)['send'](new db[(_0xbb10('0xa5'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0xbb10('0x96')](_0xddfe35[_0xbb10('0x77')][_0xbb10('0x77')])||_0xddfe35[_0xbb10('0x77')][_0xbb10('0x77')]===''){throw _0x604d55[_0xbb10('0x25')](0x1f4)['send'](new db['Sequelize']['ValidationError'](_0xbb10('0xaf')));}if(_[_0xbb10('0x96')](_0xddfe35[_0xbb10('0x77')][_0xbb10('0xd9')])){throw _0x604d55[_0xbb10('0x25')](0x1f4)[_0xbb10('0x33')](new db[(_0xbb10('0xa5'))]['ValidationError'](_0xbb10('0xda')+_0x38eb3d));}if(!_[_0xbb10('0xb0')](_0x38eb3d,_0xddfe35[_0xbb10('0x77')][_0xbb10('0xd9')])){throw _0x604d55['status'](0x1f4)[_0xbb10('0x33')](new db['Sequelize']['ValidationError'](_0xbb10('0xdb')+_0x38eb3d));}_0x1c0529[_0xddfe35[_0xbb10('0x77')][_0xbb10('0xd9')]]=_0xddfe35[_0xbb10('0x77')][_0xbb10('0xad')];})[_0xbb10('0x18')](function(){return db['ChatWebsite'][_0xbb10('0x75')]({'where':{'id':_0xddfe35[_0xbb10('0x72')]['id']},'include':[{'model':db[_0xbb10('0xb2')],'as':_0xbb10('0xb3')},{'model':db[_0xbb10('0xdc')],'as':_0xbb10('0xdc')}]});})[_0xbb10('0x18')](handleEntityNotFound(_0x604d55,null))['then'](function(_0x2cbbb6){if(_0x2cbbb6&&_0x2cbbb6[_0xbb10('0xb3')]){_0x40eb16=_0x2cbbb6;var _0x391bce=_['defaults'](_0xddfe35['body'],{'firstName':_0xddfe35[_0xbb10('0x77')][_0xbb10('0xad')],'phone':_0xddfe35[_0xbb10('0x77')][_0xbb10('0xad')],'ListId':_0x2cbbb6[_0xbb10('0xac')]});_0x391bce[_0xddfe35[_0xbb10('0x77')][_0xbb10('0xd9')]]=_0xddfe35['body'][_0xbb10('0xad')];return db[_0xbb10('0xbe')][_0xbb10('0xdd')]({'where':_0x1c0529,'defaults':_0x391bce});}})['spread'](function(_0x5e195a){if(_0x5e195a){_0x3ff3fe=_0x5e195a;var _0x55efcf=fs['readFileSync'](path[_0xbb10('0x90')](config[_0xbb10('0x91')],_0xbb10('0xde')),_0xbb10('0xdf'));var _0x59cc7b=ejs[_0xbb10('0xe0')](_0x55efcf,{'body':_['toPairs'](_0xddfe35[_0xbb10('0x77')][_0xbb10('0x77')]),'bodyTitle':_0x40eb16[_0xbb10('0xe1')]});return db[_0xbb10('0xe2')][_0xbb10('0x76')]({'body':_0x59cc7b,'plainBody':htmlToText[_0xbb10('0xe3')](_0x59cc7b),'ContactId':_0x5e195a['id'],'ChatWebsiteId':_0x40eb16['id']});}})[_0xbb10('0x18')](function(_0x4541f2){_0x4d65e7=_0x4541f2;if(_0x3522cd[_0xbb10('0x66')]){var _0x71d5a4=_0x3522cd[_0xbb10('0x5d')](function(_0x471042){return{'name':_0x471042['originalname'],'basename':_0x471042[_0xbb10('0x8c')],'type':_0x471042[_0xbb10('0xe4')],'ChatOfflineMessageId':_0x4541f2['id']};});_0x3c01ff=_0x71d5a4[_0xbb10('0x5d')](_0x4d0f0b=>{var _0x204ebf={'filename':_0x4d0f0b['name'],'path':path[_0xbb10('0x90')](config[_0xbb10('0x91')],_0xbb10('0xe5'),_0xbb10('0xd8'),_0xbb10('0xe6'),'offline-chat',_0x4d0f0b['basename'])};return _0x204ebf;});if(!_0x40eb16[_0xbb10('0xe7')]){return db['sequelize']['transaction'](function(_0x2ff72a){return db['Attachment'][_0xbb10('0xe8')](_0x71d5a4,{'transaction':_0x2ff72a});});}}})[_0xbb10('0x18')](function(){if(_0x4d65e7){_0x22ec50=_0x4d65e7;return db[_0xbb10('0xdc')][_0xbb10('0x88')]({'where':{'service':!![]},'include':[{'model':db[_0xbb10('0xe9')],'as':_0xbb10('0xea'),'raw':!![],'include':[{'model':db[_0xbb10('0xeb')],'as':_0xbb10('0xeb'),'raw':!![]}]}]});}})['then'](function(_0x2aa734){if(_0x2aa734&&_0x2aa734['Smtp']&&_0x40eb16[_0xbb10('0xec')]&&_0x40eb16['forwardOfflineAddress']){var _0x24c018=_0x2aa734[_0xbb10('0xed')]();return respondWithRpcPromise('SendMail',_0xbb10('0xee'),{'account':_0x24c018,'message':{'from':util[_0xbb10('0x37')](_0xbb10('0xef'),_0x2aa734['name'],_0x2aa734[_0xbb10('0xf0')]||_0x2aa734[_0xbb10('0xea')][_0xbb10('0x78')]),'to':_0x40eb16['forwardOfflineAddress'],'subject':_0x40eb16[_0xbb10('0xf1')],'html':_0x22ec50[_0xbb10('0x77')],'attachments':_0x3c01ff}},client9003)[_0xbb10('0x18')](function(){return _0x22ec50;})['catch'](function(_0x3e6756){logger['error'](_0x3e6756);});}})[_0xbb10('0x18')](function(){if(_0x40eb16&&_0x40eb16[_0xbb10('0xe7')]&&_0x40eb16[_0xbb10('0xf2')]){var _0xd94118=[];if(_0x3522cd[_0xbb10('0x66')]){_0xd94118=_0x3522cd[_0xbb10('0x5d')](function(_0x23e592){return{'name':_0x23e592[_0xbb10('0xf3')],'basename':_0x23e592[_0xbb10('0x8c')],'type':_0x23e592[_0xbb10('0xe4')],'ChatOfflineMessageId':_0x4d65e7['id']};});}var _0x49982e;if(!_['isNil'](_0x40eb16[_0xbb10('0xf4')])){var _0x4739a6=_[_0xbb10('0x5d')](_0xddfe35['body'],function(_0x3d5870){return _0x3d5870;});var _0x1067f2=_[_0xbb10('0xf5')](_0x4739a6)[0x0];var _0x108ec7=_[_0xbb10('0xf6')](_0x1067f2,function(_0x431673){return _0x431673;});_0x49982e=_0x108ec7[0x1][_0x40eb16[_0xbb10('0xf4')]];}var _0x2035e1={'from':_0x3ff3fe[_0xbb10('0xf0')],'firstName':_0x3ff3fe['firstName'],'lastName':_0x3ff3fe[_0xbb10('0x4e')],'mapKey':_0xbb10('0xf0'),'message':{'from':_0x3ff3fe[_0xbb10('0xf0')],'to':_0x40eb16[_0xbb10('0xdc')]['email'],'cc':'','subject':_[_0xbb10('0x96')](_0x49982e)?_0x40eb16[_0xbb10('0xf1')]:_0x49982e,'messageId':'','sentAt':new Date(),'attach':_0xd94118[_0xbb10('0x66')],'attachments':_0xd94118,'originChannel':'Chat','ChatWebsiteId':_0x40eb16['id'],'ChatOfflineMessageId':_0x22ec50['id'],'originTo':_0x40eb16['MailAccount'][_0xbb10('0xf0')]},'body':_0x22ec50['body']};var _0x37c688={'account':{'id':_0x40eb16['MailAccountId']},'body':_0x2035e1,'log':_0xbb10('0xf7')};return respondWithRpcPromise(_0xbb10('0xf7'),_0xbb10('0xf8'),_0x37c688,client9001)[_0xbb10('0x18')](function(){return _0x22ec50;})[_0xbb10('0x23')](function(_0x3c5a97){logger[_0xbb10('0x1e')](_0x3c5a97);});}return;})['then'](function(){if(_0x22ec50){return _0x22ec50;}})[_0xbb10('0x18')](respondWithResult(_0x604d55,null))[_0xbb10('0x23')](function(){for(var _0x28271e of _0x3522cd){var _0x2807d2=path[_0xbb10('0x90')](config[_0xbb10('0x91')],'server',_0xbb10('0xd8'),_0xbb10('0xe6'),_0xbb10('0xf9'),_0x28271e[_0xbb10('0x8c')]);fs_extra[_0xbb10('0xfa')](_0x2807d2)[_0xbb10('0x23')](function(_0x16c041){logger['error'](_0xbb10('0xfb'),_0x2807d2,_0x16c041);});}});};exports[_0xbb10('0xfc')]=function(_0x1e8713,_0x53c293){return db[_0xbb10('0xc2')]['find']({'where':{'id':_0x1e8713[_0xbb10('0x72')]['id']}})[_0xbb10('0x18')](handleEntityNotFound(_0x53c293,null))[_0xbb10('0x18')](function(_0x58a447){if(_0x58a447){return _0x58a447['addInteraction'](_0x1e8713[_0xbb10('0x77')][_0xbb10('0xfd')],_[_0xbb10('0xfe')](_0x1e8713[_0xbb10('0x77')],[_0xbb10('0xfd'),'id'])||{});}})[_0xbb10('0x18')](respondWithResult(_0x53c293,null))[_0xbb10('0x23')](handleError(_0x53c293,null));};exports[_0xbb10('0xff')]=function(_0x2ba569,_0x8700e6){var _0x1e6509={'raw':![],'where':{}};var _0x5d8005={};var _0x4e3b32={'count':0x0,'rows':[]};return db[_0xbb10('0x5e')][_0xbb10('0x88')]({'where':{'id':_0x2ba569['params']['id']}})['then'](handleEntityNotFound(_0x8700e6,null))[_0xbb10('0x18')](function(_0x160c01){if(_0x160c01){_0x5d8005[_0xbb10('0x55')]=_['keys'](db[_0xbb10('0xc2')][_0xbb10('0x73')]);_0x5d8005['query']=_[_0xbb10('0x61')](_0x2ba569[_0xbb10('0x60')]);_0x5d8005['filters']=_['intersection'](_0x5d8005[_0xbb10('0x55')],_0x5d8005[_0xbb10('0x60')]);_0x1e6509[_0xbb10('0x64')]=_['intersection'](_0x5d8005['model'],qs[_0xbb10('0x65')](_0x2ba569[_0xbb10('0x60')]['fields']));_0x1e6509[_0xbb10('0x64')]=_0x1e6509[_0xbb10('0x64')]['length']?_0x1e6509[_0xbb10('0x64')]:_0x5d8005[_0xbb10('0x55')];if(!_0x2ba569[_0xbb10('0x60')][_0xbb10('0x67')]('nolimit')){_0x1e6509[_0xbb10('0x29')]=qs['limit'](_0x2ba569[_0xbb10('0x60')][_0xbb10('0x29')]);_0x1e6509[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x2ba569[_0xbb10('0x60')][_0xbb10('0x27')]);}_0x1e6509[_0xbb10('0x69')]=qs[_0xbb10('0x6a')](_0x2ba569['query'][_0xbb10('0x6a')]);_0x1e6509[_0xbb10('0x6b')]=qs[_0xbb10('0x62')](_[_0xbb10('0x6c')](_0x2ba569['query'],_0x5d8005['filters']));_0x1e6509[_0xbb10('0x6b')][_0xbb10('0x81')]=_0x160c01['id'];if(_0x2ba569[_0xbb10('0x60')][_0xbb10('0x6d')]){_0x1e6509['where']=_[_0xbb10('0x6e')](_0x1e6509[_0xbb10('0x6b')],{'$or':_['map'](_0x1e6509[_0xbb10('0x64')],function(_0x4f71fd){var _0x59d6a7={};_0x59d6a7[_0x4f71fd]={'$like':'%'+_0x2ba569[_0xbb10('0x60')][_0xbb10('0x6d')]+'%'};return _0x59d6a7;})});}_0x1e6509=_[_0xbb10('0x6e')]({},_0x1e6509,_0x2ba569[_0xbb10('0x6f')]);return db[_0xbb10('0xc2')]['count']({'where':_0x1e6509[_0xbb10('0x6b')]})[_0xbb10('0x18')](function(_0x356601){_0x4e3b32[_0xbb10('0x2a')]=_0x356601;if(_0x2ba569[_0xbb10('0x60')][_0xbb10('0x74')]){_0x1e6509[_0xbb10('0x70')]=[{'model':db[_0xbb10('0xbe')],'as':_0xbb10('0x100'),'required':![]},{'model':db[_0xbb10('0xcd')],'as':_0xbb10('0x101'),'attributes':[_0xbb10('0x32'),_0xbb10('0x102'),_0xbb10('0x103')],'required':![]},{'model':db[_0xbb10('0x104')],'as':_0xbb10('0x105'),'attributes':['id',_0xbb10('0x32'),_0xbb10('0x106')],'where':_0x2ba569[_0xbb10('0x60')][_0xbb10('0x107')]?{'id':_0x2ba569[_0xbb10('0x60')][_0xbb10('0x107')]}:undefined,'required':_0x2ba569[_0xbb10('0x60')][_0xbb10('0x107')]?!![]:![]}];}return db[_0xbb10('0xc2')][_0xbb10('0x84')](_0x1e6509);})[_0xbb10('0x18')](function(_0x57b891){_0x4e3b32[_0xbb10('0x71')]=_0x57b891;return _0x4e3b32;});}})[_0xbb10('0x18')](respondWithFilteredResult(_0x8700e6,_0x1e6509))['catch'](handleError(_0x8700e6,null));};exports[_0xbb10('0x35')]=function(_0x1ebd41,_0x4d2ada){var _0x3a20c0=0x0;var _0x3b96dd=0x0;var _0x4e97fd=![];var _0x21a460;var _0x3ff9bc;return db[_0xbb10('0x5e')][_0xbb10('0x75')]({'where':{'id':_0x1ebd41['params']['id']},'include':[{'model':db[_0xbb10('0x41')],'as':_0xbb10('0x41'),'include':[{'model':db[_0xbb10('0x41')],'as':_0xbb10('0x42'),'attributes':['id','interval']}]}]})[_0xbb10('0x18')](handleEntityNotFound(_0x4d2ada,null))[_0xbb10('0x18')](function(_0x327749){if(_0x327749){_0x21a460=_0x327749;return _0x327749[_0xbb10('0x108')]({'raw':!![]});}})[_0xbb10('0x18')](function(_0x3045ff){if(_0x21a460){if(_0x3045ff){_0x3ff9bc=_0x3045ff;}}return require(_0xbb10('0x94'))[_0xbb10('0x95')]();})[_0xbb10('0x18')](function(_0x22900c){if(_0x22900c){_0x3b96dd=_0x22900c[_0xbb10('0x109')];_0x4e97fd=_0x22900c['custom'];}})[_0xbb10('0x18')](function(){return db[_0xbb10('0xc2')][_0xbb10('0x2a')]({'where':{'closed':![]}});})[_0xbb10('0x18')](function(_0x57d03c){_0x3a20c0=_0x57d03c;if(_0x3b96dd&&_0x57d03c>_0x3b96dd){return db['License'][_0xbb10('0x88')]({'where':{'id':0x1}})[_0xbb10('0x18')](function(_0x4785fb){if(_0x4785fb){_0x4785fb[_0xbb10('0x10a')]('chatLicenseExceeded');}});}})[_0xbb10('0x18')](function(){if(!_0x21a460[_0xbb10('0x41')]||!_0x21a460[_0xbb10('0x41')]['Intervals'])return!![];return checkWebsiteIntervals(_0x21a460);})['then'](function(_0x4206bf){var _0xd6b33=fs['readFileSync'](path['join'](config[_0xbb10('0x91')],_0xbb10('0x10b')),_0xbb10('0xdf'));var _0x45cd03=new url[(_0xbb10('0x10c'))](_0x21a460[_0xbb10('0x10d')])['origin'];var _0x408544=_0xbb10('0x10e');var _0x1bb753=![];var _0x235367={'chatVersion':_0x408544,'chatWebsiteAddressOrigin':_0x45cd03,'remote':_0x21a460[_0xbb10('0x10f')],'query':querystring[_0xbb10('0x1d')](_[_0xbb10('0x6e')](_0x21a460[_0xbb10('0x2d')]({'plain':!![]}),{'customerIp':_0x1ebd41[_0xbb10('0xc0')][_0xbb10('0x4a')]||_0x1ebd41['headers'][_0xbb10('0x110')]||_0x1ebd41[_0xbb10('0x111')]['remoteAddress']||_0x1ebd41['ip'],'referer':_0x1ebd41['headers']['referer'],'openedInteractions':_0x3a20c0,'maxInteractions':_0x3b96dd,'virtual':_0x4e97fd['virtual'],'online':_0x4206bf,'custom':_0x4e97fd}))['replace'](/'/g,'\x5c\x27')};_0x4d2ada['send'](ejs['render'](Mustache['render'](_0xd6b33,_0x235367),{'proactiveActions':_0x3ff9bc,'alignment':_0x21a460[_0xbb10('0x112')],'verticalAlignment':_0x21a460[_0xbb10('0x113')],'div_color':_0x21a460['color'],'labelText':_0x21a460[_0xbb10('0x114')],'text_color':_0x21a460[_0xbb10('0x115')],'text_button_color':_0x21a460[_0xbb10('0x116')],'button_color':_0x21a460[_0xbb10('0x117')],'background_color':_0x21a460[_0xbb10('0x118')],'hideWhenOffline':_0x21a460[_0xbb10('0x119')],'intervalId':_0x21a460[_0xbb10('0x11a')],'isDevelopment':_0x1bb753,'chatVersion':_0x408544}));})[_0xbb10('0x23')](handleError(_0x4d2ada,null));};exports[_0xbb10('0x11b')]=function(_0x14d9e7,_0x19dfef){var _0x13df4e=_0x14d9e7['params']['id'];var _0x44c373=_0x14d9e7[_0xbb10('0x77')];var _0x2e72e2=0xc8;var _0x3a6298=null;return db[_0xbb10('0x11c')]['transaction']({'isolationLevel':db[_0xbb10('0x11c')]['Transaction']['ISOLATION_LEVELS'][_0xbb10('0x11d')]},function(_0xf4ebf8){return db['ChatWebsite'][_0xbb10('0x88')]({'where':{'id':_0x13df4e},'transaction':_0xf4ebf8})[_0xbb10('0x18')](function(_0x201e05){if(_0x201e05){return db[_0xbb10('0x11e')][_0xbb10('0x2c')]({'where':{'ChatWebsiteId':_0x13df4e},'transaction':_0xf4ebf8})['then'](function(){var _0x486a2f=_[_0xbb10('0x5d')](_0x44c373,function(_0x118b63){_0x118b63['ChatWebsiteId']=_0x13df4e;return _0x118b63;});return db[_0xbb10('0x11e')][_0xbb10('0xe8')](_0x486a2f,{'transaction':_0xf4ebf8});});}else{_0x2e72e2=0x194;_0x3a6298=[];}});})[_0xbb10('0x18')](function(){if(_0x2e72e2!==0x194){return db[_0xbb10('0x11e')][_0xbb10('0x11f')]({'where':{'ChatWebsiteId':_0x13df4e},'order':_0xbb10('0xbc')})[_0xbb10('0x18')](function(_0x3be6ec){_0x3a6298=_0x3be6ec;});}})[_0xbb10('0x23')](function(_0x514c07){_0x2e72e2=0x1f4;logger[_0xbb10('0x1e')](_0x514c07[_0xbb10('0x31')]);if(_0x514c07[_0xbb10('0x32')]){delete _0x514c07[_0xbb10('0x32')];}_0x3a6298=_0x514c07;})['finally'](function(){if(_0x3a6298===null){_0x19dfef[_0xbb10('0x24')](_0x2e72e2);}else{if(_0x2e72e2===0x1f4){_0x19dfef[_0xbb10('0x25')](_0x2e72e2)['send'](_0x3a6298);}else{_0x19dfef['status'](_0x2e72e2)[_0xbb10('0x26')](_0x3a6298);}}});};exports['getApplications']=function(_0x40ff8e,_0x30ffca){var _0x214dcb={};var _0x3e19f4={};var _0x56e3d0;var _0x90ab9f;return db['ChatWebsite'][_0xbb10('0x88')]({'where':{'id':_0x40ff8e[_0xbb10('0x72')]['id']}})[_0xbb10('0x18')](handleEntityNotFound(_0x30ffca,null))[_0xbb10('0x18')](function(_0xa5cb35){if(_0xa5cb35){_0x56e3d0=_0xa5cb35;_0x3e19f4[_0xbb10('0x55')]=_[_0xbb10('0x61')](db[_0xbb10('0x11e')][_0xbb10('0x73')]);_0x3e19f4['query']=_[_0xbb10('0x61')](_0x40ff8e[_0xbb10('0x60')]);_0x3e19f4[_0xbb10('0x62')]=_[_0xbb10('0x63')](_0x3e19f4[_0xbb10('0x55')],_0x3e19f4['query']);_0x214dcb[_0xbb10('0x64')]=_[_0xbb10('0x63')](_0x3e19f4[_0xbb10('0x55')],qs[_0xbb10('0x65')](_0x40ff8e[_0xbb10('0x60')]['fields']));_0x214dcb['attributes']=_0x214dcb['attributes'][_0xbb10('0x66')]?_0x214dcb['attributes']:_0x3e19f4['model'];_0x214dcb[_0xbb10('0x69')]=qs['sort'](_0x40ff8e[_0xbb10('0x60')][_0xbb10('0x6a')]);_0x214dcb['where']=qs[_0xbb10('0x62')](_[_0xbb10('0x6c')](_0x40ff8e[_0xbb10('0x60')],_0x3e19f4[_0xbb10('0x62')]));if(_0x40ff8e['query']['filter']){_0x214dcb['where']=_[_0xbb10('0x6e')](_0x214dcb[_0xbb10('0x6b')],{'$or':_['map'](_0x214dcb[_0xbb10('0x64')],function(_0x3fd91c){var _0x3d2e5f={};_0x3d2e5f[_0x3fd91c]={'$like':'%'+_0x40ff8e[_0xbb10('0x60')][_0xbb10('0x6d')]+'%'};return _0x3d2e5f;})});}_0x214dcb=_['merge']({},_0x214dcb,_0x40ff8e[_0xbb10('0x6f')]);return _0x56e3d0[_0xbb10('0x120')](_0x214dcb);}})[_0xbb10('0x18')](function(_0x4aa311){if(_0x4aa311){_0x90ab9f=_0x4aa311[_0xbb10('0x66')];if(!_0x40ff8e['query'][_0xbb10('0x67')](_0xbb10('0x68'))){_0x214dcb[_0xbb10('0x29')]=qs['limit'](_0x40ff8e[_0xbb10('0x60')][_0xbb10('0x29')]);_0x214dcb['offset']=qs[_0xbb10('0x27')](_0x40ff8e[_0xbb10('0x60')][_0xbb10('0x27')]);}return _0x56e3d0[_0xbb10('0x120')](_0x214dcb);}})[_0xbb10('0x18')](function(_0x589c18){if(_0x589c18){return _0x589c18?{'count':_0x90ab9f,'rows':_0x589c18}:null;}})['then'](respondWithResult(_0x30ffca,null))[_0xbb10('0x23')](handleError(_0x30ffca,null));};exports[_0xbb10('0x121')]=function(_0x22dd3d,_0x1b0734){return db[_0xbb10('0x122')]['find']({'where':{'id':_0x22dd3d[_0xbb10('0x72')]['id']}})[_0xbb10('0x18')](handleEntityNotFound(_0x1b0734,null))[_0xbb10('0x18')](function(_0x13d77a){if(_0x13d77a){return _0x13d77a[_0xbb10('0x121')](_0x22dd3d['body']['ids'],_[_0xbb10('0xfe')](_0x22dd3d[_0xbb10('0x77')],[_0xbb10('0xfd'),'id'])||{});}})[_0xbb10('0x18')](respondWithResult(_0x1b0734,null))['catch'](handleError(_0x1b0734,null));};exports['getProactiveActions']=function(_0x1da101,_0x4d7ea2){var _0x4840ac={};var _0x4e2dbb={};var _0x5ce8f5;var _0x3758dd;return db[_0xbb10('0x5e')][_0xbb10('0x88')]({'where':{'id':_0x1da101[_0xbb10('0x72')]['id']}})[_0xbb10('0x18')](handleEntityNotFound(_0x4d7ea2,null))['then'](function(_0x12829c){if(_0x12829c){_0x5ce8f5=_0x12829c;_0x4e2dbb[_0xbb10('0x55')]=_[_0xbb10('0x61')](db['ChatProactiveAction'][_0xbb10('0x73')]);_0x4e2dbb[_0xbb10('0x60')]=_[_0xbb10('0x61')](_0x1da101[_0xbb10('0x60')]);_0x4e2dbb[_0xbb10('0x62')]=_[_0xbb10('0x63')](_0x4e2dbb[_0xbb10('0x55')],_0x4e2dbb[_0xbb10('0x60')]);_0x4840ac[_0xbb10('0x64')]=_[_0xbb10('0x63')](_0x4e2dbb[_0xbb10('0x55')],qs[_0xbb10('0x65')](_0x1da101[_0xbb10('0x60')][_0xbb10('0x65')]));_0x4840ac[_0xbb10('0x64')]=_0x4840ac['attributes']['length']?_0x4840ac['attributes']:_0x4e2dbb[_0xbb10('0x55')];_0x4840ac['order']=qs[_0xbb10('0x6a')](_0x1da101['query'][_0xbb10('0x6a')]);_0x4840ac['where']=qs['filters'](_[_0xbb10('0x6c')](_0x1da101[_0xbb10('0x60')],_0x4e2dbb['filters']));if(_0x1da101[_0xbb10('0x60')][_0xbb10('0x6d')]){_0x4840ac[_0xbb10('0x6b')]=_[_0xbb10('0x6e')](_0x4840ac['where'],{'$or':_['map'](_0x4840ac[_0xbb10('0x64')],function(_0x18c663){var _0x2c3bc0={};_0x2c3bc0[_0x18c663]={'$like':'%'+_0x1da101[_0xbb10('0x60')][_0xbb10('0x6d')]+'%'};return _0x2c3bc0;})});}_0x4840ac=_[_0xbb10('0x6e')]({},_0x4840ac,_0x1da101[_0xbb10('0x6f')]);return _0x5ce8f5['getProactiveActions'](_0x4840ac);}})[_0xbb10('0x18')](function(_0x51cdbd){if(_0x51cdbd){_0x3758dd=_0x51cdbd['length'];if(!_0x1da101[_0xbb10('0x60')]['hasOwnProperty'](_0xbb10('0x68'))){_0x4840ac[_0xbb10('0x29')]=qs[_0xbb10('0x29')](_0x1da101[_0xbb10('0x60')][_0xbb10('0x29')]);_0x4840ac['offset']=qs[_0xbb10('0x27')](_0x1da101[_0xbb10('0x60')][_0xbb10('0x27')]);}return _0x5ce8f5[_0xbb10('0x108')](_0x4840ac);}})[_0xbb10('0x18')](function(_0x1c387b){if(_0x1c387b){return _0x1c387b?{'count':_0x3758dd,'rows':_0x1c387b}:null;}})['then'](respondWithResult(_0x4d7ea2,null))['catch'](handleError(_0x4d7ea2,null));};exports[_0xbb10('0x123')]=function(_0x2f42cc,_0x22fa73){var _0x35971b=_0x2f42cc[_0xbb10('0x60')]['online']==='false'?_0xbb10('0x124'):_0xbb10('0x125');return db['ChatWebsite']['find']({'attributes':['id',_0x35971b],'where':{'id':_0x2f42cc[_0xbb10('0x72')]['id']}})[_0xbb10('0x18')](handleEntityNotFound(_0x22fa73,null))[_0xbb10('0x18')](function(_0x450772){if(_0x450772){var _0x170e2a=_0x450772[_0x35971b];var _0x19b8cc=_0x170e2a&&_0x170e2a['items']?_0x170e2a[_0xbb10('0x126')]:[];_0x22fa73[_0xbb10('0x33')]({'fromKey':_[_0xbb10('0x96')](_0x170e2a[_0xbb10('0x127')])?undefined:_0x170e2a[_0xbb10('0x127')],'count':_0x19b8cc[_0xbb10('0x66')],'rows':_0x19b8cc});}})[_0xbb10('0x23')](handleError(_0x22fa73,null));};exports[_0xbb10('0x128')]=function(_0x1b5bb8,_0x4d054b){var _0x54bf10={'raw':![],'where':{}};var _0x518ec0={};var _0x111c15={'count':0x0,'rows':[]};return db[_0xbb10('0x5e')][_0xbb10('0x88')]({'where':{'id':_0x1b5bb8[_0xbb10('0x72')]['id']}})['then'](handleEntityNotFound(_0x4d054b,null))['then'](function(_0x595ac6){if(_0x595ac6){_0x518ec0[_0xbb10('0x55')]=_[_0xbb10('0x61')](db[_0xbb10('0xe2')][_0xbb10('0x73')]);_0x518ec0[_0xbb10('0x60')]=_[_0xbb10('0x61')](_0x1b5bb8[_0xbb10('0x60')]);_0x518ec0[_0xbb10('0x62')]=_[_0xbb10('0x63')](_0x518ec0[_0xbb10('0x55')],_0x518ec0[_0xbb10('0x60')]);_0x54bf10[_0xbb10('0x64')]=_[_0xbb10('0x63')](_0x518ec0[_0xbb10('0x55')],qs['fields'](_0x1b5bb8[_0xbb10('0x60')][_0xbb10('0x65')]));_0x54bf10[_0xbb10('0x64')]=_0x54bf10[_0xbb10('0x64')][_0xbb10('0x66')]?_0x54bf10[_0xbb10('0x64')]:_0x518ec0['model'];if(!_0x1b5bb8[_0xbb10('0x60')][_0xbb10('0x67')](_0xbb10('0x68'))){_0x54bf10[_0xbb10('0x29')]=qs[_0xbb10('0x29')](_0x1b5bb8[_0xbb10('0x60')][_0xbb10('0x29')]);_0x54bf10[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x1b5bb8['query'][_0xbb10('0x27')]);}_0x54bf10[_0xbb10('0x69')]=qs[_0xbb10('0x6a')](_0x1b5bb8[_0xbb10('0x60')][_0xbb10('0x6a')]);_0x54bf10[_0xbb10('0x6b')]=qs[_0xbb10('0x62')](_[_0xbb10('0x6c')](_0x1b5bb8[_0xbb10('0x60')],_0x518ec0['filters']));_0x54bf10[_0xbb10('0x6b')]['ChatWebsiteId']=_0x595ac6['id'];if(_0x1b5bb8[_0xbb10('0x60')][_0xbb10('0x6d')]){_0x54bf10['where']=_['merge'](_0x54bf10[_0xbb10('0x6b')],{'$or':_[_0xbb10('0x5d')](_0x54bf10[_0xbb10('0x64')],function(_0x245219){var _0x13c10a={};_0x13c10a[_0x245219]={'$like':'%'+_0x1b5bb8[_0xbb10('0x60')][_0xbb10('0x6d')]+'%'};return _0x13c10a;})});}_0x54bf10=_[_0xbb10('0x6e')]({},_0x54bf10,_0x1b5bb8[_0xbb10('0x6f')]);return db[_0xbb10('0xe2')][_0xbb10('0x2a')]({'where':_0x54bf10[_0xbb10('0x6b')]})[_0xbb10('0x18')](function(_0x2f76){_0x111c15[_0xbb10('0x2a')]=_0x2f76;if(_0x1b5bb8['query'][_0xbb10('0x74')]){_0x54bf10['include']=[{'all':!![]}];}else{_0x54bf10[_0xbb10('0x70')]=[{'model':db[_0xbb10('0xbe')],'as':_0xbb10('0x100'),'required':![]},{'model':db[_0xbb10('0x129')],'as':_0xbb10('0x12a'),'required':![]}];}return db[_0xbb10('0xe2')][_0xbb10('0x84')](_0x54bf10);})[_0xbb10('0x18')](function(_0x5c88bd){_0x111c15['rows']=_0x5c88bd;return _0x111c15;});}})['then'](respondWithFilteredResult(_0x4d054b,_0x54bf10))[_0xbb10('0x23')](handleError(_0x4d054b,null));};exports[_0xbb10('0x12b')]=function(_0xdeed5b,_0x54c61c){return db[_0xbb10('0x5e')]['find']({'where':{'id':_0xdeed5b[_0xbb10('0x72')]['id']}})[_0xbb10('0x18')](handleEntityNotFound(_0x54c61c,null))['then'](function(_0x11154d){if(_0x11154d){return _0x11154d[_0xbb10('0x12b')](_0xdeed5b[_0xbb10('0x77')][_0xbb10('0xfd')],_[_0xbb10('0xfe')](_0xdeed5b['body'],[_0xbb10('0xfd'),'id'])||{})[_0xbb10('0x12c')](function(_0x54700f){for(var _0x358e1c=0x0;_0x358e1c<_0xdeed5b[_0xbb10('0x77')]['ids'][_0xbb10('0x66')];_0x358e1c+=0x1){socket[_0xbb10('0x12d')](_0xbb10('0x12e'),{'UserId':Number(_0xdeed5b[_0xbb10('0x77')]['ids'][_0x358e1c]),'ChatWebsiteId':Number(_0xdeed5b[_0xbb10('0x72')]['id'])});}return _0x54700f;});}})[_0xbb10('0x18')](respondWithResult(_0x54c61c,null))[_0xbb10('0x23')](handleError(_0x54c61c,null));};exports['removeAgents']=function(_0x593de5,_0x284b77){return db[_0xbb10('0x5e')][_0xbb10('0x75')]({'where':{'id':_0x593de5[_0xbb10('0x72')]['id']}})['then'](handleEntityNotFound(_0x284b77,null))[_0xbb10('0x18')](function(_0x2b6353){if(_0x2b6353){return _0x2b6353[_0xbb10('0x12f')](_0x593de5[_0xbb10('0x60')][_0xbb10('0xfd')])['then'](function(){if(_['isArray'](_0x593de5[_0xbb10('0x60')][_0xbb10('0xfd')])){for(var _0x556983=0x0;_0x556983<_0x593de5['query'][_0xbb10('0xfd')][_0xbb10('0x66')];_0x556983+=0x1){socket[_0xbb10('0x12d')](_0xbb10('0x130'),{'UserId':Number(_0x593de5[_0xbb10('0x60')][_0xbb10('0xfd')][_0x556983]),'ChatWebsiteId':Number(_0x593de5['params']['id'])});}}else{socket['emit'](_0xbb10('0x130'),{'UserId':Number(_0x593de5[_0xbb10('0x60')][_0xbb10('0xfd')]),'ChatWebsiteId':Number(_0x593de5[_0xbb10('0x72')]['id'])});}});}})[_0xbb10('0x18')](respondWithStatusCode(_0x284b77,null))[_0xbb10('0x23')](handleError(_0x284b77,null));};exports['getAgents']=function(_0x477d10,_0x19686c){var _0xb88335={};var _0x218f91={};var _0x492605;var _0x21ad98;return db[_0xbb10('0x5e')][_0xbb10('0x88')]({'where':{'id':_0x477d10[_0xbb10('0x72')]['id']}})[_0xbb10('0x18')](handleEntityNotFound(_0x19686c,null))[_0xbb10('0x18')](function(_0x245818){if(_0x245818){_0x492605=_0x245818;_0x218f91[_0xbb10('0x55')]=_[_0xbb10('0x61')](db[_0xbb10('0xcd')][_0xbb10('0x73')]);_0x218f91[_0xbb10('0x60')]=_['keys'](_0x477d10[_0xbb10('0x60')]);_0x218f91[_0xbb10('0x62')]=_['intersection'](_0x218f91[_0xbb10('0x55')],_0x218f91[_0xbb10('0x60')]);_0xb88335[_0xbb10('0x64')]=_['intersection'](_0x218f91[_0xbb10('0x55')],qs[_0xbb10('0x65')](_0x477d10[_0xbb10('0x60')][_0xbb10('0x65')]));_0xb88335[_0xbb10('0x64')]=_0xb88335[_0xbb10('0x64')]['length']?_0xb88335[_0xbb10('0x64')]:_0x218f91['model'];_0xb88335[_0xbb10('0x69')]=qs[_0xbb10('0x6a')](_0x477d10[_0xbb10('0x60')][_0xbb10('0x6a')]);_0xb88335['where']=qs[_0xbb10('0x62')](_[_0xbb10('0x6c')](_0x477d10['query'],_0x218f91[_0xbb10('0x62')]));if(_0x477d10['query'][_0xbb10('0x6d')]){_0xb88335[_0xbb10('0x6b')]=_[_0xbb10('0x6e')](_0xb88335[_0xbb10('0x6b')],{'$or':_[_0xbb10('0x5d')](_0xb88335[_0xbb10('0x64')],function(_0x130268){var _0x44050c={};_0x44050c[_0x130268]={'$like':'%'+_0x477d10['query']['filter']+'%'};return _0x44050c;})});}_0xb88335=_[_0xbb10('0x6e')]({},_0xb88335,_0x477d10[_0xbb10('0x6f')]);return _0x492605[_0xbb10('0x131')](_0xb88335);}})[_0xbb10('0x18')](function(_0x6f428e){if(_0x6f428e){_0x21ad98=_0x6f428e[_0xbb10('0x66')];if(!_0x477d10[_0xbb10('0x60')][_0xbb10('0x67')](_0xbb10('0x68'))){_0xb88335['limit']=qs[_0xbb10('0x29')](_0x477d10['query'][_0xbb10('0x29')]);_0xb88335[_0xbb10('0x27')]=qs['offset'](_0x477d10[_0xbb10('0x60')][_0xbb10('0x27')]);}return _0x492605[_0xbb10('0x131')](_0xb88335);}})[_0xbb10('0x18')](function(_0x14c314){if(_0x14c314){return _0x14c314?{'count':_0x21ad98,'rows':_0x14c314}:null;}})[_0xbb10('0x18')](respondWithResult(_0x19686c,null))[_0xbb10('0x23')](handleError(_0x19686c,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 4b7000d..fcfb5b7 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 _0x34e8=['emit','hasOwnProperty','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','update','remove'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0x34e8,0x12c));var _0x834e=function(_0x3038c0,_0x33d136){_0x3038c0=_0x3038c0-0x0;var _0xe0a1ca=_0x34e8[_0x3038c0];return _0xe0a1ca;};'use strict';var EventEmitter=require(_0x834e('0x0'));var ChatWebsite=require(_0x834e('0x1'))['db'][_0x834e('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x834e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x834e('0x4'),'afterDestroy':_0x834e('0x5')};function emitEvent(_0x472111){return function(_0x31bf20,_0x289ef2,_0x19a3e0){ChatWebsiteEvents[_0x834e('0x6')](_0x472111+':'+_0x31bf20['id'],_0x31bf20);ChatWebsiteEvents['emit'](_0x472111,_0x31bf20);_0x19a3e0(null);};}for(var e in events){if(events[_0x834e('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x834e('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x4ab0=['save','update','emit','hook','exports','../../mysqldb','ChatWebsite','setMaxListeners'];(function(_0xd95a4f,_0x5b2faf){var _0x913026=function(_0x4e9711){while(--_0x4e9711){_0xd95a4f['push'](_0xd95a4f['shift']());}};_0x913026(++_0x5b2faf);}(_0x4ab0,0xd5));var _0x04ab=function(_0x5c6103,_0x1acac5){_0x5c6103=_0x5c6103-0x0;var _0x545e28=_0x4ab0[_0x5c6103];return _0x545e28;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x04ab('0x0'))['db'][_0x04ab('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x04ab('0x2')](0x0);var events={'afterCreate':_0x04ab('0x3'),'afterUpdate':_0x04ab('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4c3a53){return function(_0x45dfee,_0xb1bf2d,_0x491958){ChatWebsiteEvents[_0x04ab('0x5')](_0x4c3a53+':'+_0x45dfee['id'],_0x45dfee);ChatWebsiteEvents[_0x04ab('0x5')](_0x4c3a53,_0x45dfee);_0x491958(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x04ab('0x6')](e,emitEvent(event));}}module[_0x04ab('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 4cc3fcb..f37c5fe 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 _0xd715=['moment','bluebird','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','../../config/logger'];(function(_0x288c41,_0x30e76c){var _0x1ca76e=function(_0x1f8bfa){while(--_0x1f8bfa){_0x288c41['push'](_0x288c41['shift']());}};_0x1ca76e(++_0x30e76c);}(_0xd715,0x1a2));var _0x5d71=function(_0x12697b,_0x549341){_0x12697b=_0x12697b-0x0;var _0x45770a=_0xd715[_0x12697b];return _0x45770a;};'use strict';var _=require(_0x5d71('0x0'));var util=require('util');var logger=require(_0x5d71('0x1'))('api');var moment=require(_0x5d71('0x2'));var BPromise=require(_0x5d71('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5d71('0x4'));var rimraf=require(_0x5d71('0x5'));var config=require(_0x5d71('0x6'));var attributes=require(_0x5d71('0x7'));module[_0x5d71('0x8')]=function(_0x31605f,_0x4e9f01){return _0x31605f[_0x5d71('0x9')](_0x5d71('0xa'),attributes,{'tableName':_0x5d71('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x63c8=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','define','ChatWebsite','lodash','util','api'];(function(_0xa2f623,_0x33a107){var _0x6ca8e1=function(_0x296a66){while(--_0x296a66){_0xa2f623['push'](_0xa2f623['shift']());}};_0x6ca8e1(++_0x33a107);}(_0x63c8,0x195));var _0x863c=function(_0x2f9724,_0x15e788){_0x2f9724=_0x2f9724-0x0;var _0x6418da=_0x63c8[_0x2f9724];return _0x6418da;};'use strict';var _=require(_0x863c('0x0'));var util=require(_0x863c('0x1'));var logger=require('../../config/logger')(_0x863c('0x2'));var moment=require(_0x863c('0x3'));var BPromise=require(_0x863c('0x4'));var rp=require(_0x863c('0x5'));var fs=require('fs');var path=require(_0x863c('0x6'));var rimraf=require(_0x863c('0x7'));var config=require(_0x863c('0x8'));var attributes=require(_0x863c('0x9'));module['exports']=function(_0x3538bf,_0x4f0171){return _0x3538bf[_0x863c('0xa')](_0x863c('0xb'),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 3a12b49..fcf01ce 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 _0x6a01=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','ChatWebsite,\x20%s,\x20%s','debug','error','code','message','info','request\x20sent','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x3a9503,_0x40e60c){var _0x538251=function(_0x25c755){while(--_0x25c755){_0x3a9503['push'](_0x3a9503['shift']());}};_0x538251(++_0x40e60c);}(_0x6a01,0x19a));var _0x16a0=function(_0xdca4a6,_0x4965f6){_0xdca4a6=_0xdca4a6-0x0;var _0x5c5b95=_0x6a01[_0xdca4a6];return _0x5c5b95;};'use strict';var _=require(_0x16a0('0x0'));var util=require(_0x16a0('0x1'));var moment=require('moment');var BPromise=require(_0x16a0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x16a0('0x3'));var db=require(_0x16a0('0x4'))['db'];var utils=require(_0x16a0('0x5'));var logger=require('../../config/logger')(_0x16a0('0x6'));var config=require(_0x16a0('0x7'));var jayson=require(_0x16a0('0x8'));var client=jayson[_0x16a0('0x9')][_0x16a0('0xa')]({'port':0x232a});config[_0x16a0('0xb')]=_[_0x16a0('0xc')](config[_0x16a0('0xb')],{'host':_0x16a0('0xd'),'port':0x18eb});var socket=require(_0x16a0('0xe'))(new Redis(config[_0x16a0('0xb')]));require('./chatWebsite.socket')[_0x16a0('0xf')](socket);function respondWithRpcPromise(_0x4e32a5,_0x2e16d3,_0x12d671){return new BPromise(function(_0xf107d2,_0x2693f9){return client[_0x16a0('0x10')](_0x4e32a5,_0x12d671)[_0x16a0('0x11')](function(_0x2a19e2){logger['info'](_0x16a0('0x12'),_0x2e16d3,'request\x20sent');logger[_0x16a0('0x13')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x2e16d3,'request\x20sent',JSON['stringify'](_0x2a19e2));if(_0x2a19e2[_0x16a0('0x14')]){if(_0x2a19e2[_0x16a0('0x14')][_0x16a0('0x15')]===0x1f4){logger[_0x16a0('0x14')](_0x16a0('0x12'),_0x2e16d3,_0x2a19e2['error']['message']);return _0x2693f9(_0x2a19e2[_0x16a0('0x14')]['message']);}logger[_0x16a0('0x14')](_0x16a0('0x12'),_0x2e16d3,_0x2a19e2[_0x16a0('0x14')]['message']);return _0xf107d2(_0x2a19e2[_0x16a0('0x14')][_0x16a0('0x16')]);}else{logger[_0x16a0('0x17')](_0x16a0('0x12'),_0x2e16d3,_0x16a0('0x18'));_0xf107d2(_0x2a19e2[_0x16a0('0x19')][_0x16a0('0x16')]);}})['catch'](function(_0x74dd60){logger[_0x16a0('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x2e16d3,_0x74dd60);_0x2693f9(_0x74dd60);});});}
\ No newline at end of file
+var _0x75c0=['socket.io-emitter','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost'];(function(_0x246a25,_0x2c0c46){var _0x5996f4=function(_0x5ae4bb){while(--_0x5ae4bb){_0x246a25['push'](_0x246a25['shift']());}};_0x5996f4(++_0x2c0c46);}(_0x75c0,0x9c));var _0x075c=function(_0x4e28c0,_0x1ef470){_0x4e28c0=_0x4e28c0-0x0;var _0x4039d4=_0x75c0[_0x4e28c0];return _0x4039d4;};'use strict';var _=require('lodash');var util=require(_0x075c('0x0'));var moment=require(_0x075c('0x1'));var BPromise=require(_0x075c('0x2'));var rs=require(_0x075c('0x3'));var fs=require('fs');var Redis=require(_0x075c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x075c('0x5'));var logger=require(_0x075c('0x6'))('rpc');var config=require(_0x075c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x075c('0x8')]['http']({'port':0x232a});config[_0x075c('0x9')]=_[_0x075c('0xa')](config[_0x075c('0x9')],{'host':_0x075c('0xb'),'port':0x18eb});var socket=require(_0x075c('0xc'))(new Redis(config[_0x075c('0x9')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x221d2b,_0x1354db,_0x34b44c){return new BPromise(function(_0x37b012,_0x1ef806){return client['request'](_0x221d2b,_0x34b44c)[_0x075c('0xd')](function(_0x532933){logger[_0x075c('0xe')](_0x075c('0xf'),_0x1354db,_0x075c('0x10'));logger[_0x075c('0x11')](_0x075c('0x12'),_0x1354db,'request\x20sent',JSON[_0x075c('0x13')](_0x532933));if(_0x532933[_0x075c('0x14')]){if(_0x532933[_0x075c('0x14')][_0x075c('0x15')]===0x1f4){logger[_0x075c('0x14')](_0x075c('0xf'),_0x1354db,_0x532933[_0x075c('0x14')][_0x075c('0x16')]);return _0x1ef806(_0x532933[_0x075c('0x14')][_0x075c('0x16')]);}logger[_0x075c('0x14')](_0x075c('0xf'),_0x1354db,_0x532933[_0x075c('0x14')][_0x075c('0x16')]);return _0x37b012(_0x532933[_0x075c('0x14')]['message']);}else{logger[_0x075c('0xe')](_0x075c('0xf'),_0x1354db,_0x075c('0x10'));_0x37b012(_0x532933['result'][_0x075c('0x16')]);}})[_0x075c('0x17')](function(_0x5842c8){logger[_0x075c('0x14')](_0x075c('0xf'),_0x1354db,_0x5842c8);_0x1ef806(_0x5842c8);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index b49f87b..683631b 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 _0x513c=['save','remove','removeListener','chatWebsite:','./chatWebsite.events'];(function(_0x40d1ba,_0x3cb77c){var _0x565261=function(_0x1a5b54){while(--_0x1a5b54){_0x40d1ba['push'](_0x40d1ba['shift']());}};_0x565261(++_0x3cb77c);}(_0x513c,0x135));var _0xc513=function(_0x44caf2,_0x8ffb16){_0x44caf2=_0x44caf2-0x0;var _0x25978d=_0x513c[_0x44caf2];return _0x25978d;};'use strict';var ChatWebsiteEvents=require(_0xc513('0x0'));var events=[_0xc513('0x1'),_0xc513('0x2'),'update'];function createListener(_0x2ab350,_0x21ef01){return function(_0x2f0cd6){_0x21ef01['emit'](_0x2ab350,_0x2f0cd6);};}function removeListener(_0x536f9c,_0x413598){return function(){ChatWebsiteEvents[_0xc513('0x3')](_0x536f9c,_0x413598);};}exports['register']=function(_0x25549e){for(var _0x58cc54=0x0,_0x141f1b=events['length'];_0x58cc54<_0x141f1b;_0x58cc54++){var _0x1c2097=events[_0x58cc54];var _0x41c266=createListener(_0xc513('0x4')+_0x1c2097,_0x25549e);ChatWebsiteEvents['on'](_0x1c2097,_0x41c266);}};
\ No newline at end of file
+var _0x5c51=['register','length','./chatWebsite.events','save','remove','update','emit','removeListener'];(function(_0x169878,_0x563094){var _0x3f1461=function(_0x101663){while(--_0x101663){_0x169878['push'](_0x169878['shift']());}};_0x3f1461(++_0x563094);}(_0x5c51,0x1aa));var _0x15c5=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0x5c51[_0x411017];return _0x2adeea;};'use strict';var ChatWebsiteEvents=require(_0x15c5('0x0'));var events=[_0x15c5('0x1'),_0x15c5('0x2'),_0x15c5('0x3')];function createListener(_0x2825aa,_0x4a5829){return function(_0x574a3c){_0x4a5829[_0x15c5('0x4')](_0x2825aa,_0x574a3c);};}function removeListener(_0x5c7dba,_0x5b98c1){return function(){ChatWebsiteEvents[_0x15c5('0x5')](_0x5c7dba,_0x5b98c1);};}exports[_0x15c5('0x6')]=function(_0x4720c2){for(var _0x164a35=0x0,_0x25e4fa=events[_0x15c5('0x7')];_0x164a35<_0x25e4fa;_0x164a35++){var _0x5bb88e=events[_0x164a35];var _0xd45f2d=createListener('chatWebsite:'+_0x5bb88e,_0x4720c2);ChatWebsiteEvents['on'](_0x5bb88e,_0xd45f2d);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 2735a8c..09e4cec 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 _0x15f6=['addCustomerAvatar','notify','server/files','offline-chat','ensureDir','extname','replace','/:id/offline','any','offline','/:id/interactions','addInteraction','addProactiveActions','/:id/users','addAgents','put','update','delete','removeDispositions','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','post','create','addAnswer','diskStorage','join','root','server/files/images/logos/','now','originalname','/:id/logo','single','file','server/files/images/avatars/','format','%s-%s'];(function(_0x3b8eb3,_0x4ad20f){var _0x2b2d38=function(_0xed090){while(--_0xed090){_0x3b8eb3['push'](_0x3b8eb3['shift']());}};_0x2b2d38(++_0x4ad20f);}(_0x15f6,0x9c));var _0x615f=function(_0x1d3c50,_0x4aa0b8){_0x1d3c50=_0x1d3c50-0x0;var _0x272d50=_0x15f6[_0x1d3c50];return _0x272d50;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x615f('0x0'));var timeout=require(_0x615f('0x1'));var express=require(_0x615f('0x2'));var router=express[_0x615f('0x3')]();var fs_extra=require(_0x615f('0x4'));var auth=require(_0x615f('0x5'));var interaction=require(_0x615f('0x6'));var config=require(_0x615f('0x7'));var controller=require('./chatWebsite.controller');router['get']('/',auth[_0x615f('0x8')](),controller['index']);router[_0x615f('0x9')](_0x615f('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x615f('0x9')](_0x615f('0xb'),auth['isAuthenticated'](),controller[_0x615f('0xc')]);router['get'](_0x615f('0xd'),auth[_0x615f('0x8')](),controller[_0x615f('0xe')]);router['get'](_0x615f('0xf'),auth[_0x615f('0x8')](),controller['getAnswers']);router[_0x615f('0x9')]('/:id/logo',controller[_0x615f('0x10')]);router[_0x615f('0x9')](_0x615f('0x11'),controller[_0x615f('0x12')]);router['get'](_0x615f('0x13'),controller[_0x615f('0x14')]);router['get'](_0x615f('0x15'),controller[_0x615f('0x16')]);router[_0x615f('0x9')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x615f('0x17')]);router[_0x615f('0x9')](_0x615f('0x18'),controller[_0x615f('0x19')]);router['get'](_0x615f('0x1a'),auth[_0x615f('0x8')](),controller['getApplications']);router['get'](_0x615f('0x1b'),auth[_0x615f('0x8')](),controller[_0x615f('0x1c')]);router[_0x615f('0x9')](_0x615f('0x1d'),controller[_0x615f('0x1e')]);router['get'](_0x615f('0x1f'),auth['isAuthenticated'](),controller[_0x615f('0x20')]);router[_0x615f('0x9')]('/:id/users',auth[_0x615f('0x8')](),controller['getAgents']);router[_0x615f('0x21')]('/',auth['isAuthenticated'](),controller[_0x615f('0x22')]);router['post'](_0x615f('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x615f('0x21')](_0x615f('0xf'),auth[_0x615f('0x8')](),controller[_0x615f('0x23')]);var upload=multer({'storage':multer[_0x615f('0x24')]({'destination':function(_0x5699b1,_0x5dbc3c,_0x245be3){_0x245be3(null,path[_0x615f('0x25')](config[_0x615f('0x26')],_0x615f('0x27')));},'filename':function(_0x5b5542,_0x309b01,_0x44fcf8){_0x44fcf8(null,util['format']('%s-%s',Date[_0x615f('0x28')](),_0x309b01[_0x615f('0x29')]));}})});router[_0x615f('0x21')](_0x615f('0x2a'),upload[_0x615f('0x2b')](_0x615f('0x2c')),controller['addLogo']);var upload=multer({'storage':multer[_0x615f('0x24')]({'destination':function(_0x48f95e,_0x47b3d7,_0x2b6f43){_0x2b6f43(null,path[_0x615f('0x25')](config[_0x615f('0x26')],_0x615f('0x2d')));},'filename':function(_0x541ce9,_0x2958e9,_0xcd1566){_0xcd1566(null,util[_0x615f('0x2e')](_0x615f('0x2f'),Date['now'](),_0x2958e9['originalname']));}})});router[_0x615f('0x21')]('/:id/avatar',upload[_0x615f('0x2b')]('file'),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x539e45,_0x1c8c07,_0x164786){_0x164786(null,path[_0x615f('0x25')](config['root'],_0x615f('0x2d')));},'filename':function(_0x356fdb,_0x11b488,_0x5db464){_0x5db464(null,util[_0x615f('0x2e')](_0x615f('0x2f'),Date[_0x615f('0x28')](),_0x11b488['originalname']));}})});router[_0x615f('0x21')](_0x615f('0x13'),upload[_0x615f('0x2b')](_0x615f('0x2c')),controller[_0x615f('0x30')]);var upload=multer({'storage':multer[_0x615f('0x24')]({'destination':function(_0x337b13,_0x2fe753,_0x4bffb2){_0x4bffb2(null,path['join'](config[_0x615f('0x26')],_0x615f('0x2d')));},'filename':function(_0x1740ee,_0xcae42f,_0x55648a){_0x55648a(null,util[_0x615f('0x2e')](_0x615f('0x2f'),Date[_0x615f('0x28')](),_0xcae42f[_0x615f('0x29')]));}})});router[_0x615f('0x21')](_0x615f('0x15'),upload[_0x615f('0x2b')](_0x615f('0x2c')),controller['addSystemAvatar']);router[_0x615f('0x21')]('/:id/notify',controller[_0x615f('0x31')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x1c1390,_0x39e6f7,_0x2cda91){const _0x18849e=path['join'](config['root'],_0x615f('0x32'),'attachments',_0x615f('0x33'));fs_extra[_0x615f('0x34')](_0x18849e,function(){_0x2cda91(null,_0x18849e);});},'filename':function(_0x1500d6,_0x4739d3,_0x27cb5e){const _0x4cdca0=_0x4739d3['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2bcdec=path[_0x615f('0x35')](_0x4cdca0);const _0x1a8e08=Date['now']()+'-'+_0x4cdca0[_0x615f('0x36')](_0x2bcdec,'')+_0x2bcdec;_0x27cb5e(null,_0x1a8e08);}})});router['post'](_0x615f('0x37'),offlineUploadMulter[_0x615f('0x38')](),controller[_0x615f('0x39')]);router[_0x615f('0x21')](_0x615f('0x3a'),auth[_0x615f('0x8')](),controller[_0x615f('0x3b')]);router[_0x615f('0x21')]('/:id/applications',auth[_0x615f('0x8')](),controller['addApplications']);router['post'](_0x615f('0x1b'),auth[_0x615f('0x8')](),controller[_0x615f('0x3c')]);router['post'](_0x615f('0x3d'),auth[_0x615f('0x8')](),controller[_0x615f('0x3e')]);router[_0x615f('0x3f')](_0x615f('0xb'),auth['isAuthenticated'](),controller[_0x615f('0x40')]);router['delete'](_0x615f('0xb'),auth[_0x615f('0x8')](),controller['destroy']);router[_0x615f('0x41')](_0x615f('0xd'),auth[_0x615f('0x8')](),controller[_0x615f('0x42')]);router['delete'](_0x615f('0xf'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x615f('0x41')](_0x615f('0x3d'),auth[_0x615f('0x8')](),controller['removeAgents']);module[_0x615f('0x43')]=router;
\ No newline at end of file
+var _0x5b07=['addLogo','server/files/images/avatars/','now','/:id/avatar','single','addCustomerAvatar','addSystemAvatar','server/files','attachments','replace','extname','/:id/offline','addInteraction','/:id/applications','addAgents','destroy','delete','/:id/dispositions','removeDispositions','removeAnswers','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/proactive_actions','getProactiveActions','/:id/fields','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','diskStorage','join','root','server/files/images/logos/','format','%s-%s','originalname','file'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x5b07,0x154));var _0x75b0=function(_0x187069,_0x1c3a56){_0x187069=_0x187069-0x0;var _0x5993e0=_0x5b07[_0x187069];return _0x5993e0;};'use strict';var multer=require(_0x75b0('0x0'));var util=require(_0x75b0('0x1'));var path=require(_0x75b0('0x2'));var timeout=require('connect-timeout');var express=require(_0x75b0('0x3'));var router=express[_0x75b0('0x4')]();var fs_extra=require(_0x75b0('0x5'));var auth=require(_0x75b0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x75b0('0x7'));var controller=require('./chatWebsite.controller');router[_0x75b0('0x8')]('/',auth[_0x75b0('0x9')](),controller[_0x75b0('0xa')]);router[_0x75b0('0x8')](_0x75b0('0xb'),auth['isAuthenticated'](),controller[_0x75b0('0xc')]);router[_0x75b0('0x8')](_0x75b0('0xd'),auth[_0x75b0('0x9')](),controller[_0x75b0('0xe')]);router['get']('/:id/dispositions',auth[_0x75b0('0x9')](),controller[_0x75b0('0xf')]);router['get'](_0x75b0('0x10'),auth[_0x75b0('0x9')](),controller[_0x75b0('0x11')]);router['get'](_0x75b0('0x12'),controller['getLogo']);router['get']('/:id/avatar',controller[_0x75b0('0x13')]);router[_0x75b0('0x8')](_0x75b0('0x14'),controller[_0x75b0('0x15')]);router[_0x75b0('0x8')](_0x75b0('0x16'),controller[_0x75b0('0x17')]);router[_0x75b0('0x8')](_0x75b0('0x18'),auth[_0x75b0('0x9')](),controller['getInteractions']);router[_0x75b0('0x8')](_0x75b0('0x19'),controller[_0x75b0('0x1a')]);router[_0x75b0('0x8')]('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router[_0x75b0('0x8')](_0x75b0('0x1b'),auth[_0x75b0('0x9')](),controller[_0x75b0('0x1c')]);router[_0x75b0('0x8')](_0x75b0('0x1d'),controller['getFields']);router[_0x75b0('0x8')]('/:id/offline_messages',auth[_0x75b0('0x9')](),controller[_0x75b0('0x1e')]);router[_0x75b0('0x8')](_0x75b0('0x1f'),auth[_0x75b0('0x9')](),controller[_0x75b0('0x20')]);router[_0x75b0('0x21')]('/',auth[_0x75b0('0x9')](),controller[_0x75b0('0x22')]);router[_0x75b0('0x21')]('/:id/dispositions',auth[_0x75b0('0x9')](),controller[_0x75b0('0x23')]);router[_0x75b0('0x21')](_0x75b0('0x10'),auth[_0x75b0('0x9')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x75b0('0x24')]({'destination':function(_0x50090d,_0x138ec9,_0xd0cedb){_0xd0cedb(null,path[_0x75b0('0x25')](config[_0x75b0('0x26')],_0x75b0('0x27')));},'filename':function(_0x356f40,_0x1cec0e,_0x5d5213){_0x5d5213(null,util[_0x75b0('0x28')](_0x75b0('0x29'),Date['now'](),_0x1cec0e[_0x75b0('0x2a')]));}})});router[_0x75b0('0x21')](_0x75b0('0x12'),upload['single'](_0x75b0('0x2b')),controller[_0x75b0('0x2c')]);var upload=multer({'storage':multer[_0x75b0('0x24')]({'destination':function(_0x3941a4,_0x3a7bf4,_0x438aa6){_0x438aa6(null,path['join'](config['root'],_0x75b0('0x2d')));},'filename':function(_0x2f4a04,_0x1dbf56,_0x30e3f0){_0x30e3f0(null,util[_0x75b0('0x28')](_0x75b0('0x29'),Date[_0x75b0('0x2e')](),_0x1dbf56[_0x75b0('0x2a')]));}})});router['post'](_0x75b0('0x2f'),upload[_0x75b0('0x30')](_0x75b0('0x2b')),controller['addAvatar']);var upload=multer({'storage':multer[_0x75b0('0x24')]({'destination':function(_0x2d3015,_0x592abc,_0x3e6f6f){_0x3e6f6f(null,path[_0x75b0('0x25')](config[_0x75b0('0x26')],'server/files/images/avatars/'));},'filename':function(_0x2a8c75,_0x472c2b,_0x30b3a){_0x30b3a(null,util[_0x75b0('0x28')]('%s-%s',Date[_0x75b0('0x2e')](),_0x472c2b[_0x75b0('0x2a')]));}})});router['post'](_0x75b0('0x14'),upload['single'](_0x75b0('0x2b')),controller[_0x75b0('0x31')]);var upload=multer({'storage':multer[_0x75b0('0x24')]({'destination':function(_0x3c036a,_0x23ce7b,_0x1bfe1a){_0x1bfe1a(null,path[_0x75b0('0x25')](config[_0x75b0('0x26')],_0x75b0('0x2d')));},'filename':function(_0x1632b3,_0x1a9661,_0x1b7fbe){_0x1b7fbe(null,util['format']('%s-%s',Date['now'](),_0x1a9661[_0x75b0('0x2a')]));}})});router['post']('/:id/system_avatar',upload[_0x75b0('0x30')](_0x75b0('0x2b')),controller[_0x75b0('0x32')]);router['post']('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x75b0('0x24')]({'destination':function(_0x1927f1,_0x44326b,_0x5b8d2f){const _0x5393bf=path[_0x75b0('0x25')](config['root'],_0x75b0('0x33'),_0x75b0('0x34'),'offline-chat');fs_extra['ensureDir'](_0x5393bf,function(){_0x5b8d2f(null,_0x5393bf);});},'filename':function(_0x4e9b5f,_0x484393,_0x535613){const _0x5be17c=_0x484393[_0x75b0('0x2a')][_0x75b0('0x35')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x531b8b=path[_0x75b0('0x36')](_0x5be17c);const _0x4688d4=Date['now']()+'-'+_0x5be17c['replace'](_0x531b8b,'')+_0x531b8b;_0x535613(null,_0x4688d4);}})});router[_0x75b0('0x21')](_0x75b0('0x37'),offlineUploadMulter['any'](),controller['offline']);router[_0x75b0('0x21')](_0x75b0('0x18'),auth[_0x75b0('0x9')](),controller[_0x75b0('0x38')]);router[_0x75b0('0x21')](_0x75b0('0x39'),auth[_0x75b0('0x9')](),controller['addApplications']);router[_0x75b0('0x21')](_0x75b0('0x1b'),auth['isAuthenticated'](),controller['addProactiveActions']);router[_0x75b0('0x21')](_0x75b0('0x1f'),auth[_0x75b0('0x9')](),controller[_0x75b0('0x3a')]);router['put']('/:id',auth[_0x75b0('0x9')](),controller['update']);router['delete'](_0x75b0('0xd'),auth[_0x75b0('0x9')](),controller[_0x75b0('0x3b')]);router[_0x75b0('0x3c')](_0x75b0('0x3d'),auth['isAuthenticated'](),controller[_0x75b0('0x3e')]);router[_0x75b0('0x3c')](_0x75b0('0x10'),auth[_0x75b0('0x9')](),controller[_0x75b0('0x3f')]);router[_0x75b0('0x3c')](_0x75b0('0x1f'),auth[_0x75b0('0x9')](),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 70b32d1..8db6d77 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 _0x1ae5=['../components/auth/service','../config/environment','Router','env','production','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','beaver-logger/server','express'];(function(_0x6a3dee,_0x43c2a4){var _0x28b6bf=function(_0x3e98dd){while(--_0x3e98dd){_0x6a3dee['push'](_0x6a3dee['shift']());}};_0x28b6bf(++_0x43c2a4);}(_0x1ae5,0xc1));var _0x51ae=function(_0x4363c9,_0x456292){_0x4363c9=_0x4363c9-0x0;var _0x5c1b6a=_0x1ae5[_0x4363c9];return _0x5c1b6a;};var beaverLogger=require(_0x51ae('0x0'));var express=require(_0x51ae('0x1'));var auth=require(_0x51ae('0x2'));var config=require(_0x51ae('0x3'));var router=express[_0x51ae('0x4')]();var isProduction=config[_0x51ae('0x5')]===_0x51ae('0x6')||![];function clientSideLogs(_0x3ba714,_0x9094b,_0x2df504){var _0x26384a=_0x3ba714['app']['get'](_0x51ae('0x7'));if(!_0x26384a){throw new Error(_0x51ae('0x8'));}return beaverLogger[_0x51ae('0x9')]({'uri':_0x51ae('0xa'),'logger':_0x26384a,'enableCors':!isProduction})(_0x3ba714,_0x9094b,_0x2df504);}router[_0x51ae('0xb')](auth[_0x51ae('0xc')](),clientSideLogs);module['exports']=router;
\ No newline at end of file
+var _0xe0d4=['exports','express','../components/auth/service','../config/environment','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xe0d4,0x18d));var _0x4e0d=function(_0x457e13,_0x3f80d3){_0x457e13=_0x457e13-0x0;var _0x4b473c=_0xe0d4[_0x457e13];return _0x4b473c;};var beaverLogger=require('beaver-logger/server');var express=require(_0x4e0d('0x0'));var auth=require(_0x4e0d('0x1'));var config=require(_0x4e0d('0x2'));var router=express['Router']();var isProduction=config['env']==='production'||![];function clientSideLogs(_0x22b5bb,_0x120ac7,_0x18dbf8){var _0x269d05=_0x22b5bb[_0x4e0d('0x3')][_0x4e0d('0x4')](_0x4e0d('0x5'));if(!_0x269d05){throw new Error(_0x4e0d('0x6'));}return beaverLogger[_0x4e0d('0x7')]({'uri':_0x4e0d('0x8'),'logger':_0x269d05,'enableCors':!isProduction})(_0x22b5bb,_0x120ac7,_0x18dbf8);}router[_0x4e0d('0x9')](auth[_0x4e0d('0xa')](),clientSideLogs);module[_0x4e0d('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 392a114..c779d7f 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 _0x0457=['ENUM','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','AmazonAWS','Google','MicrosoftAzure'];(function(_0x6bd4e3,_0x377cd6){var _0x2cc770=function(_0x7cad59){while(--_0x7cad59){_0x6bd4e3['push'](_0x6bd4e3['shift']());}};_0x2cc770(++_0x377cd6);}(_0x0457,0x78));var _0x7045=function(_0x43d701,_0x4bb2e9){_0x43d701=_0x43d701-0x0;var _0x2ec4c6=_0x0457[_0x43d701];return _0x2ec4c6;};'use strict';var Sequelize=require(_0x7045('0x0'));module[_0x7045('0x1')]={'name':{'type':Sequelize[_0x7045('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x7045('0x3'),_0x7045('0x4'),_0x7045('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x7045('0x6')]('Outlook365','Dynamics365')},'data1':{'type':Sequelize[_0x7045('0x2')],'comment':_0x7045('0x7')},'data2':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x7045('0x2')],'comment':_0x7045('0x8')},'data4':{'type':Sequelize[_0x7045('0x2')],'comment':_0x7045('0x9')},'data5':{'type':Sequelize[_0x7045('0xa')],'comment':_0x7045('0xb')},'data6':{'type':Sequelize[_0x7045('0xa')],'comment':_0x7045('0xc')},'data7':{'type':Sequelize['TEXT'],'comment':_0x7045('0xd')}};
\ No newline at end of file
+var _0xda73=['ENUM','AmazonAWS','MicrosoftAzure','Outlook365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','exports','STRING'];(function(_0x541a67,_0x50728d){var _0x45da2a=function(_0x158929){while(--_0x158929){_0x541a67['push'](_0x541a67['shift']());}};_0x45da2a(++_0x50728d);}(_0xda73,0x1b6));var _0x3da7=function(_0x256143,_0x639ed2){_0x256143=_0x256143-0x0;var _0x380a91=_0xda73[_0x256143];return _0x380a91;};'use strict';var Sequelize=require('sequelize');module[_0x3da7('0x0')]={'name':{'type':Sequelize[_0x3da7('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x3da7('0x2')](_0x3da7('0x3'),'Google',_0x3da7('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x3da7('0x2')](_0x3da7('0x5'),'Dynamics365')},'data1':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x3da7('0x1')],'comment':_0x3da7('0x6')},'data3':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x3da7('0x1')],'comment':_0x3da7('0x7')},'data5':{'type':Sequelize[_0x3da7('0x8')],'comment':_0x3da7('0x9')},'data6':{'type':Sequelize[_0x3da7('0x8')],'comment':_0x3da7('0xa')},'data7':{'type':Sequelize[_0x3da7('0x8')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 24da60f..024fe6e 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 _0xfb06=['model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','include','findAll','service','MicrosoftAzure','decryptString','data3','catch','show','params','keys','length','includeAll','find','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','join','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','get','state','Invalid\x20state\x20parameter','parse','from','base64','ascii','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','stringify','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','localhost','sendStatus','status','end','json','offset','undefined','limit','set','update','then','destroy','error','stack','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key'];(function(_0x40ce4f,_0x3cf557){var _0xb9b23d=function(_0x1a5d17){while(--_0x1a5d17){_0x40ce4f['push'](_0x40ce4f['shift']());}};_0xb9b23d(++_0x3cf557);}(_0xfb06,0x1c3));var _0x6fb0=function(_0x2649e2,_0x3e73be){_0x2649e2=_0x2649e2-0x0;var _0x4797d4=_0xfb06[_0x2649e2];return _0x4797d4;};'use strict';var _=require('lodash');var Redis=require(_0x6fb0('0x0'));var qs=require(_0x6fb0('0x1'));var encryptor=require(_0x6fb0('0x2'));var config=require(_0x6fb0('0x3'));var logger=require('../../config/logger')(_0x6fb0('0x4'));var db=require(_0x6fb0('0x5'))['db'];var oauth=require(_0x6fb0('0x6'));config['redis']=_[_0x6fb0('0x7')](config[_0x6fb0('0x8')],{'host':_0x6fb0('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var redis=new Redis(config[_0x6fb0('0x8')]);function respondWithStatusCode(_0x4d674e,_0x41f98c){_0x41f98c=_0x41f98c||0xcc;return function(_0x584ad7){if(_0x584ad7){return _0x4d674e[_0x6fb0('0xa')](_0x41f98c);}return _0x4d674e[_0x6fb0('0xb')](_0x41f98c)[_0x6fb0('0xc')]();};}function respondWithResult(_0x57d227,_0x2587d6){_0x2587d6=_0x2587d6||0xc8;return function(_0x12b0ac){if(_0x12b0ac){return _0x57d227[_0x6fb0('0xb')](_0x2587d6)[_0x6fb0('0xd')](_0x12b0ac);}};}function respondWithFilteredResult(_0x55c3c3,_0x2cfce6){return function(_0x5a5113){if(_0x5a5113){var _0x307f7a=typeof _0x2cfce6[_0x6fb0('0xe')]===_0x6fb0('0xf')&&typeof _0x2cfce6[_0x6fb0('0x10')]===_0x6fb0('0xf');var _0x4998a5=_0x5a5113['count'];var _0x4a2305=_0x307f7a?0x0:_0x2cfce6[_0x6fb0('0xe')];var _0x3440dc=_0x307f7a?_0x5a5113['count']:_0x2cfce6['offset']+_0x2cfce6[_0x6fb0('0x10')];var _0x1a0e1a;if(_0x3440dc>=_0x4998a5){_0x3440dc=_0x4998a5;_0x1a0e1a=0xc8;}else{_0x1a0e1a=0xce;}_0x55c3c3[_0x6fb0('0xb')](_0x1a0e1a);return _0x55c3c3[_0x6fb0('0x11')]('Content-Range',_0x4a2305+'-'+_0x3440dc+'/'+_0x4998a5)[_0x6fb0('0xd')](_0x5a5113);}return null;};}function saveUpdates(_0x57fd4){return function(_0x176e62){if(_0x176e62){return _0x176e62[_0x6fb0('0x12')](_0x57fd4)[_0x6fb0('0x13')](function(_0xe36d30){return _0xe36d30;});}return null;};}function removeEntity(_0x341174){return function(_0x1a76f9){if(_0x1a76f9){return _0x1a76f9[_0x6fb0('0x14')]()[_0x6fb0('0x13')](function(){_0x341174[_0x6fb0('0xb')](0xcc)[_0x6fb0('0xc')]();});}};}function handleEntityNotFound(_0x261096){return function(_0x5dda04){if(!_0x5dda04){_0x261096[_0x6fb0('0xa')](0x194);}return _0x5dda04;};}function handleError(_0x2807a8,_0xb93d4f){_0xb93d4f=_0xb93d4f||0x1f4;return function(_0xaf236d){logger[_0x6fb0('0x15')](_0xaf236d[_0x6fb0('0x16')]);if(_0xaf236d[_0x6fb0('0x17')]){delete _0xaf236d[_0x6fb0('0x17')];}_0x2807a8[_0x6fb0('0xb')](_0xb93d4f)[_0x6fb0('0x18')](_0xaf236d);};}function maskClientSecret(_0x12a792){return _[_0x6fb0('0x19')](_0x12a792[_0x6fb0('0x1a')](0x0,0x3),0x14,'*');}exports[_0x6fb0('0x1b')]=function(_0x3890eb,_0x2536c7){var _0x58d939={},_0x211ec2={},_0x59a684={'count':0x0,'rows':[]};var _0x365ca9=_[_0x6fb0('0x1c')](db[_0x6fb0('0x1d')][_0x6fb0('0x1e')],function(_0x7ae3b2){return{'name':_0x7ae3b2[_0x6fb0('0x1f')],'type':_0x7ae3b2[_0x6fb0('0x20')][_0x6fb0('0x21')]};});_0x211ec2[_0x6fb0('0x22')]=_[_0x6fb0('0x1c')](_0x365ca9,'name');_0x211ec2['query']=_['keys'](_0x3890eb[_0x6fb0('0x23')]);_0x211ec2[_0x6fb0('0x24')]=_[_0x6fb0('0x25')](_0x211ec2[_0x6fb0('0x22')],_0x211ec2['query']);_0x58d939['attributes']=_[_0x6fb0('0x25')](_0x211ec2[_0x6fb0('0x22')],qs[_0x6fb0('0x26')](_0x3890eb[_0x6fb0('0x23')][_0x6fb0('0x26')]));_0x58d939[_0x6fb0('0x27')]=_0x58d939[_0x6fb0('0x27')]['length']?_0x58d939[_0x6fb0('0x27')]:_0x211ec2[_0x6fb0('0x22')];if(!_0x3890eb[_0x6fb0('0x23')][_0x6fb0('0x28')](_0x6fb0('0x29'))){_0x58d939[_0x6fb0('0x10')]=qs[_0x6fb0('0x10')](_0x3890eb[_0x6fb0('0x23')]['limit']);_0x58d939[_0x6fb0('0xe')]=qs['offset'](_0x3890eb[_0x6fb0('0x23')][_0x6fb0('0xe')]);}_0x58d939[_0x6fb0('0x2a')]=qs[_0x6fb0('0x2b')](_0x3890eb[_0x6fb0('0x23')][_0x6fb0('0x2b')]);_0x58d939[_0x6fb0('0x2c')]=qs[_0x6fb0('0x24')](_[_0x6fb0('0x2d')](_0x3890eb[_0x6fb0('0x23')],_0x211ec2['filters']),_0x365ca9);if(_0x3890eb[_0x6fb0('0x23')]['filter']){_0x58d939[_0x6fb0('0x2c')]=_[_0x6fb0('0x2e')](_0x58d939[_0x6fb0('0x2c')],{'$or':_[_0x6fb0('0x1c')](_0x365ca9,function(_0x46c392){if(_0x46c392[_0x6fb0('0x20')]!==_0x6fb0('0x2f')){var _0x44a122={};_0x44a122[_0x46c392[_0x6fb0('0x17')]]={'$like':'%'+_0x3890eb[_0x6fb0('0x23')][_0x6fb0('0x30')]+'%'};return _0x44a122;}})});}_0x58d939=_[_0x6fb0('0x2e')]({},_0x58d939,_0x3890eb[_0x6fb0('0x31')]);var _0x32701d={'where':_0x58d939['where']};return db[_0x6fb0('0x1d')][_0x6fb0('0x32')](_0x32701d)[_0x6fb0('0x13')](function(_0xaf1f7a){_0x59a684[_0x6fb0('0x32')]=_0xaf1f7a;if(_0x3890eb[_0x6fb0('0x23')]['includeAll']){_0x58d939[_0x6fb0('0x33')]=[{'all':!![]}];}return db[_0x6fb0('0x1d')][_0x6fb0('0x34')](_0x58d939);})[_0x6fb0('0x13')](function(_0x47fc3b){_0x59a684['rows']=_[_0x6fb0('0x1c')](_0x47fc3b,function(_0x132851){if(_0x132851[_0x6fb0('0x35')]===_0x6fb0('0x36')){var _0x7c112f=encryptor[_0x6fb0('0x37')](_0x132851[_0x6fb0('0x38')]);_0x132851['data3']=maskClientSecret(_0x7c112f);}return _0x132851;});return _0x59a684;})[_0x6fb0('0x13')](respondWithFilteredResult(_0x2536c7,_0x58d939))[_0x6fb0('0x39')](handleError(_0x2536c7,null));};exports[_0x6fb0('0x3a')]=function(_0x23a3de,_0x430bad){var _0x92e3b6={'raw':!![],'where':{'id':_0x23a3de[_0x6fb0('0x3b')]['id']}},_0x45c562={};_0x45c562['model']=_[_0x6fb0('0x3c')](db[_0x6fb0('0x1d')][_0x6fb0('0x1e')]);_0x45c562[_0x6fb0('0x23')]=_['keys'](_0x23a3de[_0x6fb0('0x23')]);_0x45c562[_0x6fb0('0x24')]=_[_0x6fb0('0x25')](_0x45c562[_0x6fb0('0x22')],_0x45c562[_0x6fb0('0x23')]);_0x92e3b6[_0x6fb0('0x27')]=_[_0x6fb0('0x25')](_0x45c562[_0x6fb0('0x22')],qs[_0x6fb0('0x26')](_0x23a3de[_0x6fb0('0x23')][_0x6fb0('0x26')]));_0x92e3b6[_0x6fb0('0x27')]=_0x92e3b6['attributes'][_0x6fb0('0x3d')]?_0x92e3b6['attributes']:_0x45c562[_0x6fb0('0x22')];if(_0x23a3de[_0x6fb0('0x23')][_0x6fb0('0x3e')]){_0x92e3b6[_0x6fb0('0x33')]=[{'all':!![]}];}_0x92e3b6=_[_0x6fb0('0x2e')]({},_0x92e3b6,_0x23a3de[_0x6fb0('0x31')]);return db[_0x6fb0('0x1d')][_0x6fb0('0x3f')](_0x92e3b6)[_0x6fb0('0x13')](handleEntityNotFound(_0x430bad,null))[_0x6fb0('0x13')](function(_0x5e6366){if(_0x5e6366[_0x6fb0('0x35')]===_0x6fb0('0x36')){var _0x4ed9ad=encryptor[_0x6fb0('0x37')](_0x5e6366[_0x6fb0('0x38')]);_0x5e6366['data3']=maskClientSecret(_0x4ed9ad);}return _0x5e6366;})[_0x6fb0('0x13')](respondWithResult(_0x430bad,null))['catch'](handleError(_0x430bad,null));};exports[_0x6fb0('0x40')]=function(_0x17267e,_0x540738){if(!_0x17267e[_0x6fb0('0x41')][_0x6fb0('0x17')])throw new Error(_0x6fb0('0x42'));if(!_0x17267e[_0x6fb0('0x41')][_0x6fb0('0x35')])throw new Error(_0x6fb0('0x43'));var _0x522dc8=db[_0x6fb0('0x1d')][_0x6fb0('0x1e')][_0x6fb0('0x35')][_0x6fb0('0x44')];if(!_0x522dc8[_0x6fb0('0x45')](_0x17267e[_0x6fb0('0x41')][_0x6fb0('0x35')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x522dc8[_0x6fb0('0x46')](',\x20'));if(_0x17267e[_0x6fb0('0x41')][_0x6fb0('0x35')]==='MicrosoftAzure'&&_0x17267e[_0x6fb0('0x41')][_0x6fb0('0x38')]){_0x17267e[_0x6fb0('0x41')][_0x6fb0('0x38')]=encryptor[_0x6fb0('0x47')](_0x17267e[_0x6fb0('0x41')]['data3']);}return db['CloudProvider']['create'](_0x17267e[_0x6fb0('0x41')],{})[_0x6fb0('0x13')](respondWithResult(_0x540738,0xc9))[_0x6fb0('0x39')](handleError(_0x540738,null));};exports[_0x6fb0('0x12')]=function(_0x1f0501,_0x1869ae){if(_0x1f0501[_0x6fb0('0x41')]['id']){delete _0x1f0501[_0x6fb0('0x41')]['id'];}return db[_0x6fb0('0x1d')]['find']({'where':{'id':_0x1f0501[_0x6fb0('0x3b')]['id']}})[_0x6fb0('0x13')](handleEntityNotFound(_0x1869ae,null))['then'](function(_0x473697){if(_0x473697[_0x6fb0('0x35')]==='MicrosoftAzure'&&_0x1f0501[_0x6fb0('0x41')]['data3']){_0x1f0501['body'][_0x6fb0('0x38')]=encryptor[_0x6fb0('0x47')](_0x1f0501['body'][_0x6fb0('0x38')]);}return _0x473697;})[_0x6fb0('0x13')](saveUpdates(_0x1f0501[_0x6fb0('0x41')],null))['then'](respondWithResult(_0x1869ae,null))[_0x6fb0('0x39')](handleError(_0x1869ae,null));};exports[_0x6fb0('0x14')]=function(_0x5af706,_0x1fa972){return db[_0x6fb0('0x1d')][_0x6fb0('0x3f')]({'where':{'id':_0x5af706['params']['id']}})['then'](handleEntityNotFound(_0x1fa972,null))['then'](removeEntity(_0x1fa972,null))[_0x6fb0('0x39')](handleError(_0x1fa972,null));};exports[_0x6fb0('0x48')]=function(_0x3e5d64,_0x164606){return db['CloudProvider'][_0x6fb0('0x49')]({'where':{'id':_0x3e5d64[_0x6fb0('0x3b')]['id']},'raw':!![]})[_0x6fb0('0x13')](function(_0x50f427){if(!_0x50f427)return _0x164606[_0x6fb0('0xa')](0x194);return{'url':oauth[_0x6fb0('0x4a')](_0x50f427,_0x3e5d64[_0x6fb0('0x4b')]['id'])};})[_0x6fb0('0x13')](respondWithResult(_0x164606,null))[_0x6fb0('0x39')](handleError(_0x164606,null));};exports['oauth2MicrosoftCallback']=function(_0x2bc6c9,_0x562fe7){var _0x1f0982=_0x2bc6c9[_0x6fb0('0x41')];var _0x263885;var _0xa6975d;if(_0x1f0982[_0x6fb0('0x15')])throw _0x1f0982;redis[_0x6fb0('0x4c')](_0x1f0982[_0x6fb0('0x4d')])[_0x6fb0('0x13')](function(_0x3dd3ad){if(!_0x3dd3ad)throw new Error(_0x6fb0('0x4e'));_0x263885=JSON[_0x6fb0('0x4f')](_0x3dd3ad);var _0x34fe54=Buffer[_0x6fb0('0x50')](_0x1f0982[_0x6fb0('0x4d')],_0x6fb0('0x51'))['toString'](_0x6fb0('0x52'));_0xa6975d=JSON[_0x6fb0('0x4f')](_0x34fe54);if(!oauth['isValidIdToken'](_0x1f0982['id_token'],_0x263885[_0x6fb0('0x53')]))throw new Error(_0x6fb0('0x54'));redis[_0x6fb0('0x55')](_0x1f0982[_0x6fb0('0x4d')]);return oauth[_0x6fb0('0x56')](_0x1f0982['code'],_0x263885);})[_0x6fb0('0x13')](function(_0x14ef23){_0x263885[_0x6fb0('0x57')]=_0x14ef23[_0x6fb0('0x58')];_0x263885[_0x6fb0('0x59')]=_0x14ef23[_0x6fb0('0x5a')];return db['CloudProvider']['update']({'data5':_0x263885[_0x6fb0('0x57')],'data6':_0x263885[_0x6fb0('0x59')]},{'where':{'id':_0x263885['id']}});})[_0x6fb0('0x13')](function(){oauth[_0x6fb0('0x5b')](_0x263885);socket[_0x6fb0('0x5c')]('microsoftAuthorization:success',{'id':_0xa6975d['id']});return;})[_0x6fb0('0x13')](respondWithStatusCode(_0x562fe7,null))['catch'](function(_0x51f844){if(_0xa6975d){socket[_0x6fb0('0x5c')](_0x6fb0('0x5d'),{'id':_0xa6975d['id']});}if(!_0x263885){logger['error'](_0x6fb0('0x5e'),_0x51f844);return _0x562fe7[_0x6fb0('0xb')](0x1f4)[_0x6fb0('0x18')](_0x51f844[_0x6fb0('0x5f')]);}logger['error']('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x263885['id'],JSON[_0x6fb0('0x60')](_0x51f844));});};
\ No newline at end of file
+var _0x92a2=['socket.io-emitter','sendStatus','end','json','offset','limit','undefined','count','status','set','then','destroy','error','stack','name','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','keys','options','find','create','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','body','update','encryptString','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','state','parse','from','base64','toString','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','send','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','./cloudProvider.oauth','redis','defaults'];(function(_0xe8b9c7,_0x534838){var _0x4b606f=function(_0x355178){while(--_0x355178){_0xe8b9c7['push'](_0xe8b9c7['shift']());}};_0x4b606f(++_0x534838);}(_0x92a2,0x11a));var _0x292a=function(_0x164acd,_0x4a3160){_0x164acd=_0x164acd-0x0;var _0x2983e1=_0x92a2[_0x164acd];return _0x2983e1;};'use strict';var _=require(_0x292a('0x0'));var Redis=require(_0x292a('0x1'));var qs=require(_0x292a('0x2'));var encryptor=require(_0x292a('0x3'));var config=require(_0x292a('0x4'));var logger=require(_0x292a('0x5'))('api');var db=require('../../mysqldb')['db'];var oauth=require(_0x292a('0x6'));config[_0x292a('0x7')]=_[_0x292a('0x8')](config[_0x292a('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x292a('0x9'))(new Redis(config['redis']));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x2637e4,_0x8f6a6b){_0x8f6a6b=_0x8f6a6b||0xcc;return function(_0x168deb){if(_0x168deb){return _0x2637e4[_0x292a('0xa')](_0x8f6a6b);}return _0x2637e4['status'](_0x8f6a6b)[_0x292a('0xb')]();};}function respondWithResult(_0x58fb88,_0x52883f){_0x52883f=_0x52883f||0xc8;return function(_0x51b3f0){if(_0x51b3f0){return _0x58fb88['status'](_0x52883f)[_0x292a('0xc')](_0x51b3f0);}};}function respondWithFilteredResult(_0x17df08,_0x44e87b){return function(_0x12f213){if(_0x12f213){var _0x3dfcf0=typeof _0x44e87b[_0x292a('0xd')]==='undefined'&&typeof _0x44e87b[_0x292a('0xe')]===_0x292a('0xf');var _0x318bbb=_0x12f213['count'];var _0x1fd2f8=_0x3dfcf0?0x0:_0x44e87b[_0x292a('0xd')];var _0x3bea94=_0x3dfcf0?_0x12f213[_0x292a('0x10')]:_0x44e87b[_0x292a('0xd')]+_0x44e87b[_0x292a('0xe')];var _0x28abf1;if(_0x3bea94>=_0x318bbb){_0x3bea94=_0x318bbb;_0x28abf1=0xc8;}else{_0x28abf1=0xce;}_0x17df08[_0x292a('0x11')](_0x28abf1);return _0x17df08[_0x292a('0x12')]('Content-Range',_0x1fd2f8+'-'+_0x3bea94+'/'+_0x318bbb)['json'](_0x12f213);}return null;};}function saveUpdates(_0xc1c569){return function(_0x1ffad7){if(_0x1ffad7){return _0x1ffad7['update'](_0xc1c569)[_0x292a('0x13')](function(_0x414012){return _0x414012;});}return null;};}function removeEntity(_0x3976e3){return function(_0x1b8ccf){if(_0x1b8ccf){return _0x1b8ccf[_0x292a('0x14')]()[_0x292a('0x13')](function(){_0x3976e3[_0x292a('0x11')](0xcc)[_0x292a('0xb')]();});}};}function handleEntityNotFound(_0x514413){return function(_0x47b348){if(!_0x47b348){_0x514413['sendStatus'](0x194);}return _0x47b348;};}function handleError(_0x58f717,_0x5cf62f){_0x5cf62f=_0x5cf62f||0x1f4;return function(_0x15ab64){logger[_0x292a('0x15')](_0x15ab64[_0x292a('0x16')]);if(_0x15ab64[_0x292a('0x17')]){delete _0x15ab64[_0x292a('0x17')];}_0x58f717['status'](_0x5cf62f)['send'](_0x15ab64);};}function maskClientSecret(_0x354ed9){return _[_0x292a('0x18')](_0x354ed9[_0x292a('0x19')](0x0,0x3),0x14,'*');}exports[_0x292a('0x1a')]=function(_0x18b463,_0x10d580){var _0x2fbf08={},_0x5df4ca={},_0x116cbb={'count':0x0,'rows':[]};var _0x510281=_[_0x292a('0x1b')](db[_0x292a('0x1c')][_0x292a('0x1d')],function(_0xee01ae){return{'name':_0xee01ae[_0x292a('0x1e')],'type':_0xee01ae[_0x292a('0x1f')][_0x292a('0x20')]};});_0x5df4ca[_0x292a('0x21')]=_[_0x292a('0x1b')](_0x510281,_0x292a('0x17'));_0x5df4ca[_0x292a('0x22')]=_['keys'](_0x18b463[_0x292a('0x22')]);_0x5df4ca[_0x292a('0x23')]=_[_0x292a('0x24')](_0x5df4ca[_0x292a('0x21')],_0x5df4ca[_0x292a('0x22')]);_0x2fbf08[_0x292a('0x25')]=_[_0x292a('0x24')](_0x5df4ca[_0x292a('0x21')],qs[_0x292a('0x26')](_0x18b463[_0x292a('0x22')][_0x292a('0x26')]));_0x2fbf08[_0x292a('0x25')]=_0x2fbf08['attributes'][_0x292a('0x27')]?_0x2fbf08[_0x292a('0x25')]:_0x5df4ca['model'];if(!_0x18b463[_0x292a('0x22')][_0x292a('0x28')](_0x292a('0x29'))){_0x2fbf08['limit']=qs['limit'](_0x18b463['query'][_0x292a('0xe')]);_0x2fbf08[_0x292a('0xd')]=qs[_0x292a('0xd')](_0x18b463[_0x292a('0x22')][_0x292a('0xd')]);}_0x2fbf08[_0x292a('0x2a')]=qs[_0x292a('0x2b')](_0x18b463[_0x292a('0x22')]['sort']);_0x2fbf08[_0x292a('0x2c')]=qs['filters'](_[_0x292a('0x2d')](_0x18b463[_0x292a('0x22')],_0x5df4ca['filters']),_0x510281);if(_0x18b463[_0x292a('0x22')][_0x292a('0x2e')]){_0x2fbf08['where']=_[_0x292a('0x2f')](_0x2fbf08['where'],{'$or':_[_0x292a('0x1b')](_0x510281,function(_0xf46783){if(_0xf46783[_0x292a('0x1f')]!==_0x292a('0x30')){var _0x36f6be={};_0x36f6be[_0xf46783[_0x292a('0x17')]]={'$like':'%'+_0x18b463[_0x292a('0x22')][_0x292a('0x2e')]+'%'};return _0x36f6be;}})});}_0x2fbf08=_[_0x292a('0x2f')]({},_0x2fbf08,_0x18b463['options']);var _0x418364={'where':_0x2fbf08[_0x292a('0x2c')]};return db[_0x292a('0x1c')][_0x292a('0x10')](_0x418364)[_0x292a('0x13')](function(_0x5cad83){_0x116cbb[_0x292a('0x10')]=_0x5cad83;if(_0x18b463[_0x292a('0x22')][_0x292a('0x31')]){_0x2fbf08[_0x292a('0x32')]=[{'all':!![]}];}return db[_0x292a('0x1c')][_0x292a('0x33')](_0x2fbf08);})[_0x292a('0x13')](function(_0x2498fe){_0x116cbb[_0x292a('0x34')]=_[_0x292a('0x1b')](_0x2498fe,function(_0x41908d){if(_0x41908d[_0x292a('0x35')]===_0x292a('0x36')){var _0x28f54d=encryptor[_0x292a('0x37')](_0x41908d['data3']);_0x41908d[_0x292a('0x38')]=maskClientSecret(_0x28f54d);}return _0x41908d;});return _0x116cbb;})['then'](respondWithFilteredResult(_0x10d580,_0x2fbf08))[_0x292a('0x39')](handleError(_0x10d580,null));};exports[_0x292a('0x3a')]=function(_0x73ead9,_0x11856e){var _0x24faf3={'raw':!![],'where':{'id':_0x73ead9[_0x292a('0x3b')]['id']}},_0x3b3492={};_0x3b3492[_0x292a('0x21')]=_[_0x292a('0x3c')](db[_0x292a('0x1c')]['rawAttributes']);_0x3b3492[_0x292a('0x22')]=_[_0x292a('0x3c')](_0x73ead9[_0x292a('0x22')]);_0x3b3492[_0x292a('0x23')]=_[_0x292a('0x24')](_0x3b3492[_0x292a('0x21')],_0x3b3492['query']);_0x24faf3[_0x292a('0x25')]=_[_0x292a('0x24')](_0x3b3492[_0x292a('0x21')],qs['fields'](_0x73ead9['query']['fields']));_0x24faf3[_0x292a('0x25')]=_0x24faf3[_0x292a('0x25')][_0x292a('0x27')]?_0x24faf3['attributes']:_0x3b3492[_0x292a('0x21')];if(_0x73ead9[_0x292a('0x22')][_0x292a('0x31')]){_0x24faf3[_0x292a('0x32')]=[{'all':!![]}];}_0x24faf3=_[_0x292a('0x2f')]({},_0x24faf3,_0x73ead9[_0x292a('0x3d')]);return db['CloudProvider'][_0x292a('0x3e')](_0x24faf3)[_0x292a('0x13')](handleEntityNotFound(_0x11856e,null))[_0x292a('0x13')](function(_0x368e98){if(_0x368e98[_0x292a('0x35')]==='MicrosoftAzure'){var _0x6e319d=encryptor[_0x292a('0x37')](_0x368e98[_0x292a('0x38')]);_0x368e98[_0x292a('0x38')]=maskClientSecret(_0x6e319d);}return _0x368e98;})[_0x292a('0x13')](respondWithResult(_0x11856e,null))[_0x292a('0x39')](handleError(_0x11856e,null));};exports[_0x292a('0x3f')]=function(_0x325944,_0x13e745){if(!_0x325944['body'][_0x292a('0x17')])throw new Error(_0x292a('0x40'));if(!_0x325944['body'][_0x292a('0x35')])throw new Error(_0x292a('0x41'));var _0x391151=db[_0x292a('0x1c')]['rawAttributes'][_0x292a('0x35')][_0x292a('0x42')];if(!_0x391151[_0x292a('0x43')](_0x325944['body'][_0x292a('0x35')]))throw new Error(_0x292a('0x44')+_0x391151['join'](',\x20'));if(_0x325944[_0x292a('0x45')][_0x292a('0x35')]===_0x292a('0x36')&&_0x325944[_0x292a('0x45')][_0x292a('0x38')]){_0x325944[_0x292a('0x45')]['data3']=encryptor['encryptString'](_0x325944['body'][_0x292a('0x38')]);}return db[_0x292a('0x1c')]['create'](_0x325944[_0x292a('0x45')],{})[_0x292a('0x13')](respondWithResult(_0x13e745,0xc9))[_0x292a('0x39')](handleError(_0x13e745,null));};exports[_0x292a('0x46')]=function(_0x5184dc,_0xd6062f){if(_0x5184dc[_0x292a('0x45')]['id']){delete _0x5184dc[_0x292a('0x45')]['id'];}return db[_0x292a('0x1c')]['find']({'where':{'id':_0x5184dc[_0x292a('0x3b')]['id']}})[_0x292a('0x13')](handleEntityNotFound(_0xd6062f,null))[_0x292a('0x13')](function(_0x54c88e){if(_0x54c88e[_0x292a('0x35')]===_0x292a('0x36')&&_0x5184dc[_0x292a('0x45')][_0x292a('0x38')]){_0x5184dc[_0x292a('0x45')][_0x292a('0x38')]=encryptor[_0x292a('0x47')](_0x5184dc['body'][_0x292a('0x38')]);}return _0x54c88e;})[_0x292a('0x13')](saveUpdates(_0x5184dc[_0x292a('0x45')],null))[_0x292a('0x13')](respondWithResult(_0xd6062f,null))[_0x292a('0x39')](handleError(_0xd6062f,null));};exports[_0x292a('0x14')]=function(_0x21e529,_0x53bd86){return db[_0x292a('0x1c')][_0x292a('0x3e')]({'where':{'id':_0x21e529['params']['id']}})[_0x292a('0x13')](handleEntityNotFound(_0x53bd86,null))[_0x292a('0x13')](removeEntity(_0x53bd86,null))[_0x292a('0x39')](handleError(_0x53bd86,null));};exports[_0x292a('0x48')]=function(_0x48428e,_0x4657a4){return db['CloudProvider']['findOne']({'where':{'id':_0x48428e[_0x292a('0x3b')]['id']},'raw':!![]})[_0x292a('0x13')](function(_0x4051f8){if(!_0x4051f8)return _0x4657a4[_0x292a('0xa')](0x194);return{'url':oauth[_0x292a('0x49')](_0x4051f8,_0x48428e[_0x292a('0x4a')]['id'])};})[_0x292a('0x13')](respondWithResult(_0x4657a4,null))[_0x292a('0x39')](handleError(_0x4657a4,null));};exports[_0x292a('0x4b')]=function(_0x5f1c5b,_0x350901){var _0xc5f14c=_0x5f1c5b[_0x292a('0x45')];var _0x39988d;var _0x3a9cb3;if(_0xc5f14c['error'])throw _0xc5f14c;redis['get'](_0xc5f14c[_0x292a('0x4c')])['then'](function(_0x5bb6f6){if(!_0x5bb6f6)throw new Error('Invalid\x20state\x20parameter');_0x39988d=JSON[_0x292a('0x4d')](_0x5bb6f6);var _0x43431c=Buffer[_0x292a('0x4e')](_0xc5f14c[_0x292a('0x4c')],_0x292a('0x4f'))[_0x292a('0x50')]('ascii');_0x3a9cb3=JSON[_0x292a('0x4d')](_0x43431c);if(!oauth[_0x292a('0x51')](_0xc5f14c[_0x292a('0x52')],_0x39988d[_0x292a('0x53')]))throw new Error(_0x292a('0x54'));redis[_0x292a('0x55')](_0xc5f14c[_0x292a('0x4c')]);return oauth[_0x292a('0x56')](_0xc5f14c[_0x292a('0x57')],_0x39988d);})[_0x292a('0x13')](function(_0x3c4304){_0x39988d[_0x292a('0x58')]=_0x3c4304[_0x292a('0x59')];_0x39988d[_0x292a('0x5a')]=_0x3c4304[_0x292a('0x5b')];return db[_0x292a('0x1c')][_0x292a('0x46')]({'data5':_0x39988d['data5'],'data6':_0x39988d[_0x292a('0x5a')]},{'where':{'id':_0x39988d['id']}});})['then'](function(){oauth['startRefreshInterval'](_0x39988d);socket[_0x292a('0x5c')](_0x292a('0x5d'),{'id':_0x3a9cb3['id']});return;})['then'](respondWithStatusCode(_0x350901,null))[_0x292a('0x39')](function(_0x495687){if(_0x3a9cb3){socket['emit']('microsoftAuthorization:error',{'id':_0x3a9cb3['id']});}if(!_0x39988d){logger[_0x292a('0x15')](_0x292a('0x5e'),_0x495687);return _0x350901[_0x292a('0x11')](0x1f4)[_0x292a('0x5f')](_0x495687['message']);}logger[_0x292a('0x15')](_0x292a('0x60'),_0x39988d['id'],JSON['stringify'](_0x495687));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 89611d2..1cc105d 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 _0x06f0=['exports','define','CloudProvider','cloud_providers','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes'];(function(_0x16f8c6,_0x351149){var _0x1dcd00=function(_0xf763fb){while(--_0xf763fb){_0x16f8c6['push'](_0x16f8c6['shift']());}};_0x1dcd00(++_0x351149);}(_0x06f0,0x164));var _0x006f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x06f0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x006f('0x0'))(_0x006f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x006f('0x2'));var fs=require('fs');var path=require(_0x006f('0x3'));var rimraf=require(_0x006f('0x4'));var config=require(_0x006f('0x5'));var attributes=require(_0x006f('0x6'));module[_0x006f('0x7')]=function(_0x6ce500,_0x1c4123){return _0x6ce500[_0x006f('0x8')](_0x006f('0x9'),attributes,{'tableName':_0x006f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x27b4=['api','request-promise','path','./cloudProvider.attributes','exports','CloudProvider','cloud_providers','lodash','util'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x27b4,0x1c0));var _0x427b=function(_0x1ef1b1,_0x282ddb){_0x1ef1b1=_0x1ef1b1-0x0;var _0x3650d6=_0x27b4[_0x1ef1b1];return _0x3650d6;};'use strict';var _=require(_0x427b('0x0'));var util=require(_0x427b('0x1'));var logger=require('../../config/logger')(_0x427b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x427b('0x3'));var fs=require('fs');var path=require(_0x427b('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x427b('0x5'));module[_0x427b('0x6')]=function(_0x8daaa9,_0x1ae3b9){return _0x8daaa9['define'](_0x427b('0x7'),attributes,{'tableName':_0x427b('0x8'),'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 4258acc..0de5ec0 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 _0x40da=['bind','findAll','all','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','../../components/encryptor','../../config/environment','../../config/logger','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','{TENANT_ID}','code','id_token','from','stringify','toString','randomBytes','data1','response_type','data4','response_mode','form_post','scope','state','nonce','prompt','login','value','oauth2Claims','set','decode','payload','iss','issuer','aud','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider','refresh_token','data6','POST','data2','data5','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','intervals'];(function(_0x4adbb0,_0x5f5a74){var _0x5e235c=function(_0x3e84e7){while(--_0x3e84e7){_0x4adbb0['push'](_0x4adbb0['shift']());}};_0x5e235c(++_0x5f5a74);}(_0x40da,0x1da));var _0xa40d=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x40da[_0x45d55e];return _0x29812a;};'use strict';var _=require(_0xa40d('0x0'));var crypto=require(_0xa40d('0x1'));var jwt=require(_0xa40d('0x2'));var moment=require(_0xa40d('0x3'));var Redis=require(_0xa40d('0x4'));var rp=require(_0xa40d('0x5'));var util=require('util');var encryptor=require(_0xa40d('0x6'));var config=require(_0xa40d('0x7'));var logger=require(_0xa40d('0x8'))('api');var schedule=require('../../config/schedule/cloud-provider');var db=require('../../mysqldb')['db'];config[_0xa40d('0x9')]=_[_0xa40d('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0xa40d('0x9')]);var MICROSOFT_AUTH_URL=_0xa40d('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0xa40d('0xc'),'profile','email',_0xa40d('0xd'),_0xa40d('0xe'),_0xa40d('0xf'),_0xa40d('0x10')],'Dynamics365':['openid','offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0xa40d('0x11');var MICROSOFT_TOKEN_ENDPOINT=_0xa40d('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x18f7e9){var _0x419d6b=_[_0xa40d('0x13')](AZURE_AUTH_SCOPES[_0x18f7e9[_0xa40d('0x14')]]);if(_0x18f7e9[_0xa40d('0x14')]===_0xa40d('0x15'))_0x419d6b[_0xa40d('0x16')](_0x18f7e9[_0xa40d('0x17')]+_0xa40d('0x18'));return _0x419d6b[_0xa40d('0x19')]('\x20');}function getAccessTokenScope(_0x4ac112){if(_0x4ac112[_0xa40d('0x14')]===_0xa40d('0x1a'))return _0xa40d('0xe');if(_0x4ac112[_0xa40d('0x14')]===_0xa40d('0x15'))return _0x4ac112[_0xa40d('0x17')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x28cc20,_0x32a59b){var _0x53e993=MICROSOFT_AUTH_URL[_0xa40d('0x1b')](_0xa40d('0x1c'),_0x28cc20['data2']);var _0x16b5e5=[_0xa40d('0x1d'),_0xa40d('0x1e')];var _0x89de0b=Buffer[_0xa40d('0x1f')](JSON[_0xa40d('0x20')]({'id':_0x32a59b}))[_0xa40d('0x21')]('base64');var _0x50db05=crypto[_0xa40d('0x22')](0x10)['toString']('hex');var _0x5a63dd=getAuthorizationScopes(_0x28cc20);var _0x275460=[{'key':'client_id','value':_0x28cc20[_0xa40d('0x23')]},{'key':_0xa40d('0x24'),'value':encodeURIComponent(_0x16b5e5[_0xa40d('0x19')]('\x20'))},{'key':'redirect_uri','value':_0x28cc20[_0xa40d('0x25')]},{'key':_0xa40d('0x26'),'value':_0xa40d('0x27')},{'key':_0xa40d('0x28'),'value':encodeURIComponent(_0x5a63dd)},{'key':_0xa40d('0x29'),'value':_0x89de0b},{'key':_0xa40d('0x2a'),'value':_0x50db05},{'key':_0xa40d('0x2b'),'value':_0xa40d('0x2c')}];var _0x16bc4f=_0x53e993+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xa40d('0x13')](_0x275460,function(_0x511b6d){return _0x511b6d['key']+'='+_0x511b6d[_0xa40d('0x2d')];})['join']('&');_0x28cc20[_0xa40d('0x2e')]={'issuer':_0x53e993['replace']('oauth2/',''),'audience':_0x28cc20[_0xa40d('0x23')],'state':_0x89de0b,'nonce':_0x50db05};redis[_0xa40d('0x2f')](_0x89de0b,JSON[_0xa40d('0x20')](_0x28cc20));return _0x16bc4f;}function isValidIdToken(_0x3ef15f,_0x1a5248){try{var _0x44f4e9=jwt[_0xa40d('0x30')](_0x3ef15f,{'complete':!![]});var _0x4b60e3=_0x44f4e9[_0xa40d('0x31')];if(_0x4b60e3[_0xa40d('0x32')]!==_0x1a5248[_0xa40d('0x33')])return![];if(_0x4b60e3[_0xa40d('0x34')]!==_0x1a5248[_0xa40d('0x35')])return![];if(_0x4b60e3['nonce']!==_0x1a5248[_0xa40d('0x2a')])return![];if(moment()[_0xa40d('0x36')](moment[_0xa40d('0x37')](_0x4b60e3[_0xa40d('0x38')])))return![];return!![];}catch(_0x433a35){throw _0x433a35;}}function refreshOauth2MicrosoftAccessToken(_0x4b7381){return Promise[_0xa40d('0x39')]()[_0xa40d('0x3a')](function(){if(_0x4b7381[_0xa40d('0x3b')])return _0x4b7381;return db[_0xa40d('0x3c')]['findOne']({'where':{'id':_0x4b7381['id']},'raw':!![]});})[_0xa40d('0x3a')](function(_0xa96189){var _0x43eaad={'grant_type':_0xa40d('0x3d'),'refresh_token':_0xa96189[_0xa40d('0x3e')],'scope':getAccessTokenScope(_0xa96189),'redirect_uri':_0xa96189[_0xa40d('0x25')],'client_id':_0xa96189['data1'],'client_secret':encryptor['decryptString'](_0xa96189['data3'])};var _0x4c6aa5={'method':_0xa40d('0x3f'),'uri':MICROSOFT_AUTH_URL['replace'](_0xa40d('0x1c'),_0xa96189[_0xa40d('0x40')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x43eaad,'json':!![]};return rp(_0x4c6aa5);})[_0xa40d('0x3a')](function(_0x14477a){_0x4b7381[_0xa40d('0x41')]=_0x14477a['access_token'];_0x4b7381[_0xa40d('0x3e')]=_0x14477a['refresh_token'];return db[_0xa40d('0x3c')][_0xa40d('0x42')]({'data5':_0x4b7381[_0xa40d('0x41')],'data6':_0x4b7381[_0xa40d('0x3e')]},{'where':{'id':_0x4b7381['id']}});})[_0xa40d('0x3a')](function(){return _0x4b7381;})[_0xa40d('0x43')](function(_0x4e5f6c){logger['error'](_0xa40d('0x44'),_0x4b7381['id'],_0x4e5f6c);});}function getOauth2MicrosoftAccessToken(_0x2a435f,_0x332abb){var _0x1af73d={'grant_type':_0xa40d('0x45'),'code':_0x2a435f,'scope':getAccessTokenScope(_0x332abb),'redirect_uri':_0x332abb[_0xa40d('0x25')],'client_id':_0x332abb['data1'],'client_secret':encryptor[_0xa40d('0x46')](_0x332abb[_0xa40d('0x3b')])};var _0x4bb788={'method':_0xa40d('0x3f'),'uri':MICROSOFT_AUTH_URL['replace'](_0xa40d('0x1c'),_0x332abb[_0xa40d('0x40')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1af73d,'json':!![]};return rp(_0x4bb788);}function startRefreshInterval(_0x622e00){var _0x2d8026=schedule[_0xa40d('0x47')];if(_0x2d8026[_0x622e00['id']])clearInterval(_0x2d8026[_0x622e00['id']]);_0x2d8026[_0x622e00['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xa40d('0x48')](this,{'id':_0x622e00['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x2d8026;}function startAllRefreshIntervals(){return db[_0xa40d('0x3c')][_0xa40d('0x49')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x1e7ac5){var _0x488fec=_0x1e7ac5[_0xa40d('0x13')](function(_0x3fc45c){return refreshOauth2MicrosoftAccessToken(_0x3fc45c)[_0xa40d('0x3a')](function(_0xc03c2a){startRefreshInterval(_0xc03c2a);});});return Promise[_0xa40d('0x4a')](_0x488fec);})['catch'](function(_0x679c94){var _0x16bc57=_0x679c94?util['inspect'](_0x679c94,{'showHidden':![],'depth':null}):'';logger[_0xa40d('0x4b')](_0xa40d('0x4c'),_0x16bc57);});}module[_0xa40d('0x4d')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x0ec5=['issuer','aud','isAfter','unix','exp','resolve','then','data3','findOne','refresh_token','POST','data2','data6','CloudProvider','update','data5','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','intervals','findAll','all','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','moment','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','map','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','{TENANT_ID}','id_token','from','stringify','base64','randomBytes','toString','hex','client_id','data1','data4','form_post','state','nonce','prompt','login','key','value','oauth2Claims','oauth2/','set','payload','iss'];(function(_0x3dfc6f,_0x3d0a7f){var _0x5e09b2=function(_0x444588){while(--_0x444588){_0x3dfc6f['push'](_0x3dfc6f['shift']());}};_0x5e09b2(++_0x3d0a7f);}(_0x0ec5,0x19a));var _0x50ec=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x0ec5[_0x3ff085];return _0x2b68c3;};'use strict';var _=require(_0x50ec('0x0'));var crypto=require(_0x50ec('0x1'));var jwt=require('jsonwebtoken');var moment=require(_0x50ec('0x2'));var Redis=require('ioredis');var rp=require('request-promise');var util=require(_0x50ec('0x3'));var encryptor=require(_0x50ec('0x4'));var config=require(_0x50ec('0x5'));var logger=require(_0x50ec('0x6'))(_0x50ec('0x7'));var schedule=require(_0x50ec('0x8'));var db=require(_0x50ec('0x9'))['db'];config['redis']=_['defaults'](config[_0x50ec('0xa')],{'host':_0x50ec('0xb'),'port':0x18eb});var redis=new Redis(config[_0x50ec('0xa')]);var MICROSOFT_AUTH_URL=_0x50ec('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0x50ec('0xd'),_0x50ec('0xe'),_0x50ec('0xf'),_0x50ec('0x10'),_0x50ec('0x11'),_0x50ec('0x12'),_0x50ec('0x13')],'Dynamics365':[_0x50ec('0xd'),_0x50ec('0x10')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x368550){var _0x5da7e7=_[_0x50ec('0x14')](AZURE_AUTH_SCOPES[_0x368550[_0x50ec('0x15')]]);if(_0x368550['type']===_0x50ec('0x16'))_0x5da7e7[_0x50ec('0x17')](_0x368550[_0x50ec('0x18')]+_0x50ec('0x19'));return _0x5da7e7[_0x50ec('0x1a')]('\x20');}function getAccessTokenScope(_0x3358a8){if(_0x3358a8[_0x50ec('0x15')]===_0x50ec('0x1b'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x3358a8[_0x50ec('0x15')]===_0x50ec('0x16'))return _0x3358a8[_0x50ec('0x18')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x587346,_0x489acc){var _0x4094fe=MICROSOFT_AUTH_URL[_0x50ec('0x1c')](_0x50ec('0x1d'),_0x587346['data2']);var _0x221fe4=['code',_0x50ec('0x1e')];var _0x56331d=Buffer[_0x50ec('0x1f')](JSON[_0x50ec('0x20')]({'id':_0x489acc}))['toString'](_0x50ec('0x21'));var _0x48e598=crypto[_0x50ec('0x22')](0x10)[_0x50ec('0x23')](_0x50ec('0x24'));var _0x597808=getAuthorizationScopes(_0x587346);var _0x361d23=[{'key':_0x50ec('0x25'),'value':_0x587346[_0x50ec('0x26')]},{'key':'response_type','value':encodeURIComponent(_0x221fe4[_0x50ec('0x1a')]('\x20'))},{'key':'redirect_uri','value':_0x587346[_0x50ec('0x27')]},{'key':'response_mode','value':_0x50ec('0x28')},{'key':'scope','value':encodeURIComponent(_0x597808)},{'key':_0x50ec('0x29'),'value':_0x56331d},{'key':_0x50ec('0x2a'),'value':_0x48e598},{'key':_0x50ec('0x2b'),'value':_0x50ec('0x2c')}];var _0x42b144=_0x4094fe+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x50ec('0x14')](_0x361d23,function(_0x4c6a3a){return _0x4c6a3a[_0x50ec('0x2d')]+'='+_0x4c6a3a[_0x50ec('0x2e')];})[_0x50ec('0x1a')]('&');_0x587346[_0x50ec('0x2f')]={'issuer':_0x4094fe[_0x50ec('0x1c')](_0x50ec('0x30'),''),'audience':_0x587346[_0x50ec('0x26')],'state':_0x56331d,'nonce':_0x48e598};redis[_0x50ec('0x31')](_0x56331d,JSON[_0x50ec('0x20')](_0x587346));return _0x42b144;}function isValidIdToken(_0x1df27a,_0x53d5ef){try{var _0x475b97=jwt['decode'](_0x1df27a,{'complete':!![]});var _0x4d4e6a=_0x475b97[_0x50ec('0x32')];if(_0x4d4e6a[_0x50ec('0x33')]!==_0x53d5ef[_0x50ec('0x34')])return![];if(_0x4d4e6a[_0x50ec('0x35')]!==_0x53d5ef['audience'])return![];if(_0x4d4e6a['nonce']!==_0x53d5ef[_0x50ec('0x2a')])return![];if(moment()[_0x50ec('0x36')](moment[_0x50ec('0x37')](_0x4d4e6a[_0x50ec('0x38')])))return![];return!![];}catch(_0x795f3d){throw _0x795f3d;}}function refreshOauth2MicrosoftAccessToken(_0x4c36ff){return Promise[_0x50ec('0x39')]()[_0x50ec('0x3a')](function(){if(_0x4c36ff[_0x50ec('0x3b')])return _0x4c36ff;return db['CloudProvider'][_0x50ec('0x3c')]({'where':{'id':_0x4c36ff['id']},'raw':!![]});})[_0x50ec('0x3a')](function(_0x1de542){var _0x6b9c1e={'grant_type':_0x50ec('0x3d'),'refresh_token':_0x1de542['data6'],'scope':getAccessTokenScope(_0x1de542),'redirect_uri':_0x1de542['data4'],'client_id':_0x1de542['data1'],'client_secret':encryptor['decryptString'](_0x1de542[_0x50ec('0x3b')])};var _0x130159={'method':_0x50ec('0x3e'),'uri':MICROSOFT_AUTH_URL[_0x50ec('0x1c')](_0x50ec('0x1d'),_0x1de542[_0x50ec('0x3f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x6b9c1e,'json':!![]};return rp(_0x130159);})[_0x50ec('0x3a')](function(_0x3afcea){_0x4c36ff['data5']=_0x3afcea['access_token'];_0x4c36ff[_0x50ec('0x40')]=_0x3afcea[_0x50ec('0x3d')];return db[_0x50ec('0x41')][_0x50ec('0x42')]({'data5':_0x4c36ff[_0x50ec('0x43')],'data6':_0x4c36ff['data6']},{'where':{'id':_0x4c36ff['id']}});})[_0x50ec('0x3a')](function(){return _0x4c36ff;})[_0x50ec('0x44')](function(_0x42592d){logger['error'](_0x50ec('0x45'),_0x4c36ff['id'],_0x42592d);});}function getOauth2MicrosoftAccessToken(_0x5d6ce6,_0xd9db6d){var _0xd2fd98={'grant_type':'authorization_code','code':_0x5d6ce6,'scope':getAccessTokenScope(_0xd9db6d),'redirect_uri':_0xd9db6d['data4'],'client_id':_0xd9db6d[_0x50ec('0x26')],'client_secret':encryptor['decryptString'](_0xd9db6d[_0x50ec('0x3b')])};var _0x4d2ded={'method':_0x50ec('0x3e'),'uri':MICROSOFT_AUTH_URL[_0x50ec('0x1c')](_0x50ec('0x1d'),_0xd9db6d[_0x50ec('0x3f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xd2fd98,'json':!![]};return rp(_0x4d2ded);}function startRefreshInterval(_0x5a954e){var _0x467b41=schedule[_0x50ec('0x46')];if(_0x467b41[_0x5a954e['id']])clearInterval(_0x467b41[_0x5a954e['id']]);_0x467b41[_0x5a954e['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x5a954e['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x50ec('0x46')]=_0x467b41;}function startAllRefreshIntervals(){return db[_0x50ec('0x41')][_0x50ec('0x47')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x50ec('0x3a')](function(_0x17608b){var _0x30beee=_0x17608b[_0x50ec('0x14')](function(_0xe6e1a){return refreshOauth2MicrosoftAccessToken(_0xe6e1a)[_0x50ec('0x3a')](function(_0x5781d7){startRefreshInterval(_0x5781d7);});});return Promise[_0x50ec('0x48')](_0x30beee);})['catch'](function(_0x413478){var _0x42d30c=_0x413478?util[_0x50ec('0x49')](_0x413478,{'showHidden':![],'depth':null}):'';logger[_0x50ec('0x4a')](_0x50ec('0x4b'),_0x42d30c);});}module[_0x50ec('0x4c')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 1c6f2fb..1591733 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 _0xb96d=['then','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x483d2a,_0x1873a3){var _0x2284fa=function(_0xadde77){while(--_0xadde77){_0x483d2a['push'](_0x483d2a['shift']());}};_0x2284fa(++_0x1873a3);}(_0xb96d,0x9e));var _0xdb96=function(_0x1b4002,_0x5b4094){_0x1b4002=_0x1b4002-0x0;var _0x1716f3=_0xb96d[_0x1b4002];return _0x1716f3;};'use strict';var _=require('lodash');var util=require(_0xdb96('0x0'));var moment=require(_0xdb96('0x1'));var BPromise=require(_0xdb96('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdb96('0x3'));var db=require(_0xdb96('0x4'))['db'];var utils=require(_0xdb96('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xdb96('0x6'));var jayson=require(_0xdb96('0x7'));var client=jayson[_0xdb96('0x8')][_0xdb96('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f5e6f,_0x294084,_0x571e0e){return new BPromise(function(_0x5e2e95,_0x3384b4){return client['request'](_0x4f5e6f,_0x571e0e)[_0xdb96('0xa')](function(_0xaea492){logger['info'](_0xdb96('0xb'),_0x294084,_0xdb96('0xc'));logger['debug'](_0xdb96('0xd'),_0x294084,_0xdb96('0xc'),JSON[_0xdb96('0xe')](_0xaea492));if(_0xaea492[_0xdb96('0xf')]){if(_0xaea492['error'][_0xdb96('0x10')]===0x1f4){logger[_0xdb96('0xf')](_0xdb96('0xb'),_0x294084,_0xaea492['error'][_0xdb96('0x11')]);return _0x3384b4(_0xaea492[_0xdb96('0xf')][_0xdb96('0x11')]);}logger[_0xdb96('0xf')](_0xdb96('0xb'),_0x294084,_0xaea492[_0xdb96('0xf')][_0xdb96('0x11')]);return _0x5e2e95(_0xaea492[_0xdb96('0xf')][_0xdb96('0x11')]);}else{logger[_0xdb96('0x12')](_0xdb96('0xb'),_0x294084,_0xdb96('0xc'));_0x5e2e95(_0xaea492[_0xdb96('0x13')]['message']);}})[_0xdb96('0x14')](function(_0x2a766e){logger[_0xdb96('0xf')](_0xdb96('0xb'),_0x294084,_0x2a766e);_0x3384b4(_0x2a766e);});});}
\ No newline at end of file
+var _0xa321=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','http','request','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','catch','lodash','util','moment'];(function(_0x2934c3,_0x32f837){var _0x3b20e7=function(_0x2a9163){while(--_0x2a9163){_0x2934c3['push'](_0x2934c3['shift']());}};_0x3b20e7(++_0x32f837);}(_0xa321,0x9d));var _0x1a32=function(_0x5a6de2,_0x5c8b10){_0x5a6de2=_0x5a6de2-0x0;var _0x2c0525=_0xa321[_0x5a6de2];return _0x2c0525;};'use strict';var _=require(_0x1a32('0x0'));var util=require(_0x1a32('0x1'));var moment=require(_0x1a32('0x2'));var BPromise=require(_0x1a32('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a32('0x4'));var db=require(_0x1a32('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1a32('0x6'))(_0x1a32('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x1a32('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4859d6,_0x13b4d2,_0x1fa204){return new BPromise(function(_0xdfa9fe,_0x3f4723){return client[_0x1a32('0x9')](_0x4859d6,_0x1fa204)['then'](function(_0x343faf){logger[_0x1a32('0xa')]('CloudProvider,\x20%s,\x20%s',_0x13b4d2,_0x1a32('0xb'));logger[_0x1a32('0xc')](_0x1a32('0xd'),_0x13b4d2,_0x1a32('0xb'),JSON[_0x1a32('0xe')](_0x343faf));if(_0x343faf[_0x1a32('0xf')]){if(_0x343faf['error'][_0x1a32('0x10')]===0x1f4){logger[_0x1a32('0xf')](_0x1a32('0x11'),_0x13b4d2,_0x343faf['error'][_0x1a32('0x12')]);return _0x3f4723(_0x343faf[_0x1a32('0xf')][_0x1a32('0x12')]);}logger[_0x1a32('0xf')](_0x1a32('0x11'),_0x13b4d2,_0x343faf['error'][_0x1a32('0x12')]);return _0xdfa9fe(_0x343faf[_0x1a32('0xf')][_0x1a32('0x12')]);}else{logger[_0x1a32('0xa')](_0x1a32('0x11'),_0x13b4d2,_0x1a32('0xb'));_0xdfa9fe(_0x343faf['result'][_0x1a32('0x12')]);}})[_0x1a32('0x13')](function(_0x47bb8e){logger[_0x1a32('0xf')](_0x1a32('0x11'),_0x13b4d2,_0x47bb8e);_0x3f4723(_0x47bb8e);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 626e9f2..ef365f7 100644
--- a/server/api/cloudProvider/index.js
+++ b/server/api/cloudProvider/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0xbb6adf,_0x35ba93){var _0x1a3cf2=function(_0x46fe15){while(--_0x46fe15){_0xbb6adf['push'](_0xbb6adf['shift']());}};_0x1a3cf2(++_0x35ba93);}(_0xadb5,0xad));var _0x5adb=function(_0x487146,_0x7d3283){_0x487146=_0x487146-0x0;var _0x4e7a15=_0xadb5[_0x487146];return _0x4e7a15;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router;
\ No newline at end of file
+var _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x4394b6,_0x12357f){var _0x360244=function(_0x5689a1){while(--_0x5689a1){_0x4394b6['push'](_0x4394b6['shift']());}};_0x360244(++_0x12357f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2dee2f,_0x19572f){_0x2dee2f=_0x2dee2f-0x0;var _0x327c18=_0x5f2f[_0x2dee2f];return _0x327c18;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 0b81bf0..9f80299 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 _0x7859=['exports','STRING','name','sequelize'];(function(_0x29e3b6,_0x40b0b4){var _0x55d4b0=function(_0x55c58e){while(--_0x55c58e){_0x29e3b6['push'](_0x29e3b6['shift']());}};_0x55d4b0(++_0x40b0b4);}(_0x7859,0x1ef));var _0x9785=function(_0xca7e5b,_0x10f5f2){_0xca7e5b=_0xca7e5b-0x0;var _0x712872=_0x7859[_0xca7e5b];return _0x712872;};'use strict';var Sequelize=require(_0x9785('0x0'));module[_0x9785('0x1')]={'name':{'type':Sequelize[_0x9785('0x2')],'unique':_0x9785('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x9785('0x2')]},'companyId':{'type':Sequelize[_0x9785('0x2')]},'website':{'type':Sequelize[_0x9785('0x2')]},'phone':{'type':Sequelize[_0x9785('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9785('0x2')]},'street':{'type':Sequelize[_0x9785('0x2')]},'postalCode':{'type':Sequelize[_0x9785('0x2')]},'city':{'type':Sequelize[_0x9785('0x2')]},'country':{'type':Sequelize[_0x9785('0x2')]},'email':{'type':Sequelize[_0x9785('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x9785('0x2')]},'sPostalCode':{'type':Sequelize[_0x9785('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x9785('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xea19=['exports','name','STRING','sequelize'];(function(_0x2e474e,_0x524313){var _0x11856d=function(_0x4d061b){while(--_0x4d061b){_0x2e474e['push'](_0x2e474e['shift']());}};_0x11856d(++_0x524313);}(_0xea19,0x14f));var _0x9ea1=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xea19[_0x31e29a];return _0x32d892;};'use strict';var Sequelize=require(_0x9ea1('0x0'));module[_0x9ea1('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9ea1('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x9ea1('0x3')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x9ea1('0x3')]},'phone':{'type':Sequelize[_0x9ea1('0x3')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9ea1('0x3')]},'street':{'type':Sequelize[_0x9ea1('0x3')]},'postalCode':{'type':Sequelize[_0x9ea1('0x3')]},'city':{'type':Sequelize[_0x9ea1('0x3')]},'country':{'type':Sequelize[_0x9ea1('0x3')]},'email':{'type':Sequelize[_0x9ea1('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x9ea1('0x3')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x9ea1('0x3')]},'sCity':{'type':Sequelize[_0x9ea1('0x3')]},'sCountry':{'type':Sequelize[_0x9ea1('0x3')]},'description':{'type':Sequelize[_0x9ea1('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index d2f8d51..b845eea 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 _0xc0b9=['then','destroy','get','Companies','UserProfileResource','stack','name','send','index','CmCompany','describe','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','error','body','find','CmContact','addContacts','ids','omit','getContacts','findOne','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','save','update'];(function(_0x5d3db8,_0xed2937){var _0x12944f=function(_0x4c5dcd){while(--_0x4c5dcd){_0x5d3db8['push'](_0x5d3db8['shift']());}};_0x12944f(++_0xed2937);}(_0xc0b9,0x18f));var _0x9c0b=function(_0xae834e,_0x51ffb4){_0xae834e=_0xae834e-0x0;var _0x2a6d46=_0xc0b9[_0xae834e];return _0x2a6d46;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9c0b('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9c0b('0x1'));var moment=require(_0x9c0b('0x2'));var BPromise=require(_0x9c0b('0x3'));var Mustache=require(_0x9c0b('0x4'));var util=require(_0x9c0b('0x5'));var path=require(_0x9c0b('0x6'));var sox=require(_0x9c0b('0x7'));var csv=require(_0x9c0b('0x8'));var ejs=require(_0x9c0b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9c0b('0xa'));var crypto=require(_0x9c0b('0xb'));var jsforce=require(_0x9c0b('0xc'));var deskjs=require(_0x9c0b('0xd'));var toCsv=require(_0x9c0b('0x8'));var querystring=require('querystring');var Papa=require(_0x9c0b('0xe'));var Redis=require(_0x9c0b('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9c0b('0x10'));var hardwareService=require(_0x9c0b('0x11'));var logger=require(_0x9c0b('0x12'))(_0x9c0b('0x13'));var utils=require(_0x9c0b('0x14'));var config=require(_0x9c0b('0x15'));var licenseUtil=require(_0x9c0b('0x16'));var db=require(_0x9c0b('0x17'))['db'];function respondWithStatusCode(_0x32535a,_0x442e9d){_0x442e9d=_0x442e9d||0xcc;return function(_0x2531a1){if(_0x2531a1){return _0x32535a[_0x9c0b('0x18')](_0x442e9d);}return _0x32535a['status'](_0x442e9d)[_0x9c0b('0x19')]();};}function respondWithResult(_0x40d8e9,_0x34a4b9){_0x34a4b9=_0x34a4b9||0xc8;return function(_0x431e37){if(_0x431e37){return _0x40d8e9[_0x9c0b('0x1a')](_0x34a4b9)[_0x9c0b('0x1b')](_0x431e37);}};}function respondWithFilteredResult(_0x481bcd,_0x4f0bbb){return function(_0x49edbc){if(_0x49edbc){var _0x66d514=typeof _0x4f0bbb[_0x9c0b('0x1c')]===_0x9c0b('0x1d')&&typeof _0x4f0bbb['limit']==='undefined';var _0x2b6a5d=_0x49edbc[_0x9c0b('0x1e')];var _0x287946=_0x66d514?0x0:_0x4f0bbb[_0x9c0b('0x1c')];var _0x1081e4=_0x66d514?_0x49edbc[_0x9c0b('0x1e')]:_0x4f0bbb['offset']+_0x4f0bbb[_0x9c0b('0x1f')];var _0x4c9d18;if(_0x1081e4>=_0x2b6a5d){_0x1081e4=_0x2b6a5d;_0x4c9d18=0xc8;}else{_0x4c9d18=0xce;}_0x481bcd[_0x9c0b('0x1a')](_0x4c9d18);return _0x481bcd[_0x9c0b('0x20')](_0x9c0b('0x21'),_0x287946+'-'+_0x1081e4+'/'+_0x2b6a5d)['json'](_0x49edbc);}return null;};}function patchUpdates(_0x41a80d){return function(_0x367f71){try{jsonpatch['apply'](_0x367f71,_0x41a80d,!![]);}catch(_0x17e4fb){return BPromise['reject'](_0x17e4fb);}return _0x367f71[_0x9c0b('0x22')]();};}function saveUpdates(_0x2b8075,_0x36b4ee){return function(_0x842fe4){if(_0x842fe4){return _0x842fe4[_0x9c0b('0x23')](_0x2b8075)[_0x9c0b('0x24')](function(_0x39a382){return _0x39a382;});}return null;};}function removeEntity(_0x1702a2,_0x3fd047){return function(_0x2ea9c5){if(_0x2ea9c5){return _0x2ea9c5[_0x9c0b('0x25')]()[_0x9c0b('0x24')](function(){var _0x449da7=_0x2ea9c5[_0x9c0b('0x26')]({'plain':!![]});var _0x9612eb=_0x9c0b('0x27');return db[_0x9c0b('0x28')][_0x9c0b('0x25')]({'where':{'type':_0x9612eb,'resourceId':_0x449da7['id']}})['then'](function(){return _0x2ea9c5;});})[_0x9c0b('0x24')](function(){_0x1702a2[_0x9c0b('0x1a')](0xcc)[_0x9c0b('0x19')]();});}};}function handleEntityNotFound(_0x303e31,_0x259099){return function(_0x39bc21){if(!_0x39bc21){_0x303e31[_0x9c0b('0x18')](0x194);}return _0x39bc21;};}function handleError(_0x493848,_0x16845a){_0x16845a=_0x16845a||0x1f4;return function(_0x49050b){logger['error'](_0x49050b[_0x9c0b('0x29')]);if(_0x49050b[_0x9c0b('0x2a')]){delete _0x49050b[_0x9c0b('0x2a')];}_0x493848[_0x9c0b('0x1a')](_0x16845a)[_0x9c0b('0x2b')](_0x49050b);};}exports[_0x9c0b('0x2c')]=function(_0xa5445a,_0x2e9836){var _0x4ceeba={},_0x4b3378={},_0x51455a={'count':0x0,'rows':[]};return db[_0x9c0b('0x2d')][_0x9c0b('0x2e')]()[_0x9c0b('0x24')](function(_0x2ec8cd){_0x4b3378[_0x9c0b('0x2f')]=_['keys'](_0x2ec8cd);_0x4b3378[_0x9c0b('0x30')]=_[_0x9c0b('0x31')](_0xa5445a[_0x9c0b('0x30')]);_0x4b3378[_0x9c0b('0x32')]=_[_0x9c0b('0x33')](_0x4b3378[_0x9c0b('0x2f')],_0x4b3378[_0x9c0b('0x30')]);_0x4ceeba[_0x9c0b('0x34')]=_[_0x9c0b('0x33')](_0x4b3378[_0x9c0b('0x2f')],qs[_0x9c0b('0x35')](_0xa5445a[_0x9c0b('0x30')][_0x9c0b('0x35')]));_0x4ceeba['attributes']=_0x4ceeba['attributes'][_0x9c0b('0x36')]?_0x4ceeba[_0x9c0b('0x34')]:_0x4b3378[_0x9c0b('0x2f')];if(!_0xa5445a[_0x9c0b('0x30')][_0x9c0b('0x37')](_0x9c0b('0x38'))){_0x4ceeba[_0x9c0b('0x1f')]=qs['limit'](_0xa5445a[_0x9c0b('0x30')][_0x9c0b('0x1f')]);_0x4ceeba[_0x9c0b('0x1c')]=qs[_0x9c0b('0x1c')](_0xa5445a[_0x9c0b('0x30')][_0x9c0b('0x1c')]);}_0x4ceeba[_0x9c0b('0x39')]=qs[_0x9c0b('0x3a')](_0xa5445a[_0x9c0b('0x30')]['sort']);_0x4ceeba[_0x9c0b('0x3b')]=qs[_0x9c0b('0x32')](_[_0x9c0b('0x3c')](_0xa5445a[_0x9c0b('0x30')],_0x4b3378['filters']),_0x2ec8cd);if(_0xa5445a[_0x9c0b('0x30')][_0x9c0b('0x3d')]){_0x4ceeba['where']=_[_0x9c0b('0x3e')](_0x4ceeba['where'],{'$or':_['map'](_0x4ceeba[_0x9c0b('0x34')],function(_0x10675e){var _0x1fe16e={};_0x1fe16e[_0x10675e]={'$like':'%'+_0xa5445a[_0x9c0b('0x30')][_0x9c0b('0x3d')]+'%'};return _0x1fe16e;})});}_0x4ceeba=_[_0x9c0b('0x3e')]({},_0x4ceeba,_0xa5445a[_0x9c0b('0x3f')]);var _0x4e7826={'where':_0x4ceeba[_0x9c0b('0x3b')]};return db[_0x9c0b('0x2d')][_0x9c0b('0x1e')](_0x4e7826)[_0x9c0b('0x24')](function(_0x3c1f71){_0x51455a[_0x9c0b('0x1e')]=_0x3c1f71;if(_0xa5445a['query']['includeAll']){_0x4ceeba[_0x9c0b('0x40')]=[{'all':!![]}];}return db['CmCompany'][_0x9c0b('0x41')](_0x4ceeba);})[_0x9c0b('0x24')](function(_0x575ccf){_0x51455a[_0x9c0b('0x42')]=_0x575ccf;return _0x51455a;})[_0x9c0b('0x24')](respondWithFilteredResult(_0x2e9836,_0x4ceeba))[_0x9c0b('0x43')](handleError(_0x2e9836,null));})[_0x9c0b('0x43')](handleError(_0x2e9836,null));};exports[_0x9c0b('0x44')]=function(_0x4cbcc6,_0x13b86b){var _0x429380={'raw':![],'where':{'id':_0x4cbcc6[_0x9c0b('0x45')]['id']}},_0x2bf3fb={};_0x2bf3fb[_0x9c0b('0x2f')]=_[_0x9c0b('0x31')](db['CmCompany'][_0x9c0b('0x46')]);_0x2bf3fb[_0x9c0b('0x30')]=_['keys'](_0x4cbcc6[_0x9c0b('0x30')]);_0x2bf3fb[_0x9c0b('0x32')]=_[_0x9c0b('0x33')](_0x2bf3fb[_0x9c0b('0x2f')],_0x2bf3fb[_0x9c0b('0x30')]);_0x429380['attributes']=_[_0x9c0b('0x33')](_0x2bf3fb[_0x9c0b('0x2f')],qs['fields'](_0x4cbcc6[_0x9c0b('0x30')][_0x9c0b('0x35')]));_0x429380[_0x9c0b('0x34')]=_0x429380[_0x9c0b('0x34')][_0x9c0b('0x36')]?_0x429380['attributes']:_0x2bf3fb[_0x9c0b('0x2f')];if(_0x4cbcc6[_0x9c0b('0x30')][_0x9c0b('0x47')]){_0x429380[_0x9c0b('0x40')]=[{'all':!![]}];}_0x429380=_[_0x9c0b('0x3e')]({},_0x429380,_0x4cbcc6['options']);return db[_0x9c0b('0x2d')]['find'](_0x429380)[_0x9c0b('0x24')](handleEntityNotFound(_0x13b86b,null))['then'](respondWithResult(_0x13b86b,null))['catch'](handleError(_0x13b86b,null));};exports[_0x9c0b('0x48')]=function(_0x3a28c0,_0x408d3a){return db[_0x9c0b('0x2d')][_0x9c0b('0x48')](_0x3a28c0['body'],{})[_0x9c0b('0x24')](function(_0x2e63b5){var _0x34ce3f=_0x3a28c0['user'][_0x9c0b('0x26')]({'plain':!![]});if(!_0x34ce3f)throw new Error(_0x9c0b('0x49'));if(_0x34ce3f[_0x9c0b('0x4a')]===_0x9c0b('0x4b')){var _0x1cd2b6=_0x2e63b5[_0x9c0b('0x26')]({'plain':!![]});var _0x443935='Companies';return db[_0x9c0b('0x4c')]['find']({'where':{'name':_0x443935,'userProfileId':_0x34ce3f[_0x9c0b('0x4d')]},'raw':!![]})[_0x9c0b('0x24')](function(_0x555c6e){if(_0x555c6e&&_0x555c6e['autoAssociation']===0x0){return db[_0x9c0b('0x28')]['create']({'name':_0x1cd2b6['name'],'resourceId':_0x1cd2b6['id'],'type':_0x555c6e['name'],'sectionId':_0x555c6e['id']},{})[_0x9c0b('0x24')](function(){return _0x2e63b5;});}else{return _0x2e63b5;}})[_0x9c0b('0x43')](function(_0x41b484){logger[_0x9c0b('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x41b484);throw _0x41b484;});}return _0x2e63b5;})['then'](respondWithResult(_0x408d3a,0xc9))['catch'](handleError(_0x408d3a,null));};exports[_0x9c0b('0x23')]=function(_0xe3d8a6,_0x37197b){if(_0xe3d8a6[_0x9c0b('0x4f')]['id']){delete _0xe3d8a6[_0x9c0b('0x4f')]['id'];}return db[_0x9c0b('0x2d')][_0x9c0b('0x50')]({'where':{'id':_0xe3d8a6[_0x9c0b('0x45')]['id']}})[_0x9c0b('0x24')](handleEntityNotFound(_0x37197b,null))[_0x9c0b('0x24')](saveUpdates(_0xe3d8a6['body'],null))[_0x9c0b('0x24')](respondWithResult(_0x37197b,null))[_0x9c0b('0x43')](handleError(_0x37197b,null));};exports[_0x9c0b('0x25')]=function(_0x538982,_0x1a30d2){return db[_0x9c0b('0x2d')]['find']({'where':{'id':_0x538982[_0x9c0b('0x45')]['id']}})[_0x9c0b('0x24')](handleEntityNotFound(_0x1a30d2,null))[_0x9c0b('0x24')](removeEntity(_0x1a30d2,null))[_0x9c0b('0x43')](handleError(_0x1a30d2,null));};exports['describe']=function(_0x23b564,_0x3537bc){return db['CmCompany']['describe']()['then'](respondWithResult(_0x3537bc,null))['catch'](handleError(_0x3537bc,null));};exports['addContacts']=function(_0x12613e,_0x571f0e,_0x286e0b){return db[_0x9c0b('0x51')][_0x9c0b('0x50')]({'where':{'id':_0x12613e[_0x9c0b('0x45')]['id']}})[_0x9c0b('0x24')](handleEntityNotFound(_0x571f0e,null))['then'](function(_0x3f7eb3){if(_0x3f7eb3){return _0x3f7eb3[_0x9c0b('0x52')](_0x12613e[_0x9c0b('0x4f')][_0x9c0b('0x53')],_[_0x9c0b('0x54')](_0x12613e['body'],[_0x9c0b('0x53'),'id'])||{});}})[_0x9c0b('0x24')](respondWithResult(_0x571f0e,null))[_0x9c0b('0x43')](handleError(_0x571f0e,null));};exports[_0x9c0b('0x55')]=function(_0x526968,_0x32aaa6,_0x596c4a){var _0xeaca6e={};var _0x3d1a09={};var _0x5e8631;var _0x577482;return db[_0x9c0b('0x2d')][_0x9c0b('0x56')]({'where':{'id':_0x526968[_0x9c0b('0x45')]['id']}})[_0x9c0b('0x24')](handleEntityNotFound(_0x32aaa6,null))[_0x9c0b('0x24')](function(_0x4ade09){if(_0x4ade09){_0x5e8631=_0x4ade09;_0x3d1a09[_0x9c0b('0x2f')]=_[_0x9c0b('0x31')](db[_0x9c0b('0x51')][_0x9c0b('0x46')]);_0x3d1a09[_0x9c0b('0x30')]=_[_0x9c0b('0x31')](_0x526968[_0x9c0b('0x30')]);_0x3d1a09[_0x9c0b('0x32')]=_[_0x9c0b('0x33')](_0x3d1a09['model'],_0x3d1a09[_0x9c0b('0x30')]);_0xeaca6e[_0x9c0b('0x34')]=_[_0x9c0b('0x33')](_0x3d1a09['model'],qs[_0x9c0b('0x35')](_0x526968[_0x9c0b('0x30')][_0x9c0b('0x35')]));_0xeaca6e[_0x9c0b('0x34')]=_0xeaca6e[_0x9c0b('0x34')][_0x9c0b('0x36')]?_0xeaca6e[_0x9c0b('0x34')]:_0x3d1a09[_0x9c0b('0x2f')];_0xeaca6e['order']=qs[_0x9c0b('0x3a')](_0x526968[_0x9c0b('0x30')]['sort']);_0xeaca6e[_0x9c0b('0x3b')]=qs[_0x9c0b('0x32')](_['pick'](_0x526968[_0x9c0b('0x30')],_0x3d1a09[_0x9c0b('0x32')]));if(_0x526968[_0x9c0b('0x30')][_0x9c0b('0x3d')]){_0xeaca6e['where']=_[_0x9c0b('0x3e')](_0xeaca6e['where'],{'$or':_['map'](_0xeaca6e['attributes'],function(_0x4a2e75){var _0x17ad30={};_0x17ad30[_0x4a2e75]={'$like':'%'+_0x526968[_0x9c0b('0x30')][_0x9c0b('0x3d')]+'%'};return _0x17ad30;})});}_0xeaca6e=_['merge']({},_0xeaca6e,_0x526968[_0x9c0b('0x3f')]);return _0x5e8631['getContacts'](_0xeaca6e);}})[_0x9c0b('0x24')](function(_0x35a9d0){if(_0x35a9d0){_0x577482=_0x35a9d0[_0x9c0b('0x36')];if(!_0x526968[_0x9c0b('0x30')][_0x9c0b('0x37')](_0x9c0b('0x38'))){_0xeaca6e[_0x9c0b('0x1f')]=qs[_0x9c0b('0x1f')](_0x526968[_0x9c0b('0x30')][_0x9c0b('0x1f')]);_0xeaca6e['offset']=qs[_0x9c0b('0x1c')](_0x526968[_0x9c0b('0x30')][_0x9c0b('0x1c')]);}return _0x5e8631[_0x9c0b('0x55')](_0xeaca6e);}})[_0x9c0b('0x24')](function(_0xddf4a2){if(_0xddf4a2){return _0xddf4a2?{'count':_0x577482,'rows':_0xddf4a2}:null;}})[_0x9c0b('0x24')](respondWithResult(_0x32aaa6,null))[_0x9c0b('0x43')](handleError(_0x32aaa6,null));};
\ No newline at end of file
+var _0xed51=['rows','catch','params','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addContacts','CmContact','ids','omit','getContacts','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','reject','save','update','then','destroy','get','Companies','UserProfileResource','end','sendStatus','stack','name','send','index','CmCompany','describe','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','map','options','include','findAll'];(function(_0x57add2,_0x4f2b7d){var _0x4e3670=function(_0x3311b){while(--_0x3311b){_0x57add2['push'](_0x57add2['shift']());}};_0x4e3670(++_0x4f2b7d);}(_0xed51,0x1cb));var _0x1ed5=function(_0x264557,_0x17bf7e){_0x264557=_0x264557-0x0;var _0x574ed5=_0xed51[_0x264557];return _0x574ed5;};'use strict';var emlformat=require(_0x1ed5('0x0'));var rimraf=require(_0x1ed5('0x1'));var zipdir=require(_0x1ed5('0x2'));var jsonpatch=require(_0x1ed5('0x3'));var rp=require(_0x1ed5('0x4'));var moment=require(_0x1ed5('0x5'));var BPromise=require(_0x1ed5('0x6'));var Mustache=require(_0x1ed5('0x7'));var util=require(_0x1ed5('0x8'));var path=require('path');var sox=require(_0x1ed5('0x9'));var csv=require(_0x1ed5('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1ed5('0xb'));var _=require(_0x1ed5('0xc'));var squel=require(_0x1ed5('0xd'));var crypto=require('crypto');var jsforce=require(_0x1ed5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1ed5('0xa'));var querystring=require(_0x1ed5('0xf'));var Papa=require(_0x1ed5('0x10'));var Redis=require(_0x1ed5('0x11'));var authService=require(_0x1ed5('0x12'));var qs=require(_0x1ed5('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1ed5('0x14'));var logger=require(_0x1ed5('0x15'))(_0x1ed5('0x16'));var utils=require(_0x1ed5('0x17'));var config=require(_0x1ed5('0x18'));var licenseUtil=require(_0x1ed5('0x19'));var db=require(_0x1ed5('0x1a'))['db'];function respondWithStatusCode(_0x499c4d,_0x2d2ff0){_0x2d2ff0=_0x2d2ff0||0xcc;return function(_0x2c85d2){if(_0x2c85d2){return _0x499c4d['sendStatus'](_0x2d2ff0);}return _0x499c4d[_0x1ed5('0x1b')](_0x2d2ff0)['end']();};}function respondWithResult(_0x477b3e,_0x59545f){_0x59545f=_0x59545f||0xc8;return function(_0x2fb426){if(_0x2fb426){return _0x477b3e[_0x1ed5('0x1b')](_0x59545f)[_0x1ed5('0x1c')](_0x2fb426);}};}function respondWithFilteredResult(_0x3942c4,_0x162cc5){return function(_0x18db79){if(_0x18db79){var _0x536654=typeof _0x162cc5['offset']===_0x1ed5('0x1d')&&typeof _0x162cc5[_0x1ed5('0x1e')]===_0x1ed5('0x1d');var _0x37808a=_0x18db79[_0x1ed5('0x1f')];var _0x442175=_0x536654?0x0:_0x162cc5['offset'];var _0x59bc8c=_0x536654?_0x18db79[_0x1ed5('0x1f')]:_0x162cc5[_0x1ed5('0x20')]+_0x162cc5[_0x1ed5('0x1e')];var _0x4bcbd5;if(_0x59bc8c>=_0x37808a){_0x59bc8c=_0x37808a;_0x4bcbd5=0xc8;}else{_0x4bcbd5=0xce;}_0x3942c4['status'](_0x4bcbd5);return _0x3942c4['set']('Content-Range',_0x442175+'-'+_0x59bc8c+'/'+_0x37808a)['json'](_0x18db79);}return null;};}function patchUpdates(_0x5898e8){return function(_0x5449de){try{jsonpatch['apply'](_0x5449de,_0x5898e8,!![]);}catch(_0x38408a){return BPromise[_0x1ed5('0x21')](_0x38408a);}return _0x5449de[_0x1ed5('0x22')]();};}function saveUpdates(_0x485871,_0x2e8299){return function(_0x5cb65c){if(_0x5cb65c){return _0x5cb65c[_0x1ed5('0x23')](_0x485871)[_0x1ed5('0x24')](function(_0x498955){return _0x498955;});}return null;};}function removeEntity(_0x41fd12,_0x3d79cd){return function(_0x4d3631){if(_0x4d3631){return _0x4d3631[_0x1ed5('0x25')]()[_0x1ed5('0x24')](function(){var _0x6c9f8b=_0x4d3631[_0x1ed5('0x26')]({'plain':!![]});var _0x212fc4=_0x1ed5('0x27');return db[_0x1ed5('0x28')][_0x1ed5('0x25')]({'where':{'type':_0x212fc4,'resourceId':_0x6c9f8b['id']}})['then'](function(){return _0x4d3631;});})[_0x1ed5('0x24')](function(){_0x41fd12[_0x1ed5('0x1b')](0xcc)[_0x1ed5('0x29')]();});}};}function handleEntityNotFound(_0x1c56cb,_0x5aa68a){return function(_0x24d992){if(!_0x24d992){_0x1c56cb[_0x1ed5('0x2a')](0x194);}return _0x24d992;};}function handleError(_0x3273f5,_0x34f339){_0x34f339=_0x34f339||0x1f4;return function(_0x4d497a){logger['error'](_0x4d497a[_0x1ed5('0x2b')]);if(_0x4d497a[_0x1ed5('0x2c')]){delete _0x4d497a[_0x1ed5('0x2c')];}_0x3273f5['status'](_0x34f339)[_0x1ed5('0x2d')](_0x4d497a);};}exports[_0x1ed5('0x2e')]=function(_0x3e8734,_0x219969){var _0x8b8a75={},_0x31427d={},_0x11cdd3={'count':0x0,'rows':[]};return db[_0x1ed5('0x2f')][_0x1ed5('0x30')]()[_0x1ed5('0x24')](function(_0xa9abd0){_0x31427d[_0x1ed5('0x31')]=_[_0x1ed5('0x32')](_0xa9abd0);_0x31427d[_0x1ed5('0x33')]=_[_0x1ed5('0x32')](_0x3e8734['query']);_0x31427d['filters']=_[_0x1ed5('0x34')](_0x31427d[_0x1ed5('0x31')],_0x31427d[_0x1ed5('0x33')]);_0x8b8a75[_0x1ed5('0x35')]=_[_0x1ed5('0x34')](_0x31427d[_0x1ed5('0x31')],qs[_0x1ed5('0x36')](_0x3e8734[_0x1ed5('0x33')][_0x1ed5('0x36')]));_0x8b8a75[_0x1ed5('0x35')]=_0x8b8a75['attributes'][_0x1ed5('0x37')]?_0x8b8a75[_0x1ed5('0x35')]:_0x31427d[_0x1ed5('0x31')];if(!_0x3e8734[_0x1ed5('0x33')][_0x1ed5('0x38')](_0x1ed5('0x39'))){_0x8b8a75[_0x1ed5('0x1e')]=qs['limit'](_0x3e8734['query'][_0x1ed5('0x1e')]);_0x8b8a75[_0x1ed5('0x20')]=qs[_0x1ed5('0x20')](_0x3e8734[_0x1ed5('0x33')]['offset']);}_0x8b8a75[_0x1ed5('0x3a')]=qs[_0x1ed5('0x3b')](_0x3e8734[_0x1ed5('0x33')][_0x1ed5('0x3b')]);_0x8b8a75[_0x1ed5('0x3c')]=qs['filters'](_[_0x1ed5('0x3d')](_0x3e8734['query'],_0x31427d[_0x1ed5('0x3e')]),_0xa9abd0);if(_0x3e8734['query'][_0x1ed5('0x3f')]){_0x8b8a75[_0x1ed5('0x3c')]=_[_0x1ed5('0x40')](_0x8b8a75[_0x1ed5('0x3c')],{'$or':_[_0x1ed5('0x41')](_0x8b8a75['attributes'],function(_0x4870fc){var _0x39ff4f={};_0x39ff4f[_0x4870fc]={'$like':'%'+_0x3e8734[_0x1ed5('0x33')][_0x1ed5('0x3f')]+'%'};return _0x39ff4f;})});}_0x8b8a75=_['merge']({},_0x8b8a75,_0x3e8734[_0x1ed5('0x42')]);var _0x2cad68={'where':_0x8b8a75[_0x1ed5('0x3c')]};return db['CmCompany'][_0x1ed5('0x1f')](_0x2cad68)[_0x1ed5('0x24')](function(_0x2faaac){_0x11cdd3[_0x1ed5('0x1f')]=_0x2faaac;if(_0x3e8734['query']['includeAll']){_0x8b8a75[_0x1ed5('0x43')]=[{'all':!![]}];}return db[_0x1ed5('0x2f')][_0x1ed5('0x44')](_0x8b8a75);})[_0x1ed5('0x24')](function(_0x10f1c3){_0x11cdd3[_0x1ed5('0x45')]=_0x10f1c3;return _0x11cdd3;})[_0x1ed5('0x24')](respondWithFilteredResult(_0x219969,_0x8b8a75))[_0x1ed5('0x46')](handleError(_0x219969,null));})[_0x1ed5('0x46')](handleError(_0x219969,null));};exports['show']=function(_0x587864,_0xd3e4e4){var _0x3d5094={'raw':![],'where':{'id':_0x587864[_0x1ed5('0x47')]['id']}},_0x58c410={};_0x58c410[_0x1ed5('0x31')]=_['keys'](db[_0x1ed5('0x2f')][_0x1ed5('0x48')]);_0x58c410[_0x1ed5('0x33')]=_[_0x1ed5('0x32')](_0x587864[_0x1ed5('0x33')]);_0x58c410[_0x1ed5('0x3e')]=_[_0x1ed5('0x34')](_0x58c410[_0x1ed5('0x31')],_0x58c410[_0x1ed5('0x33')]);_0x3d5094[_0x1ed5('0x35')]=_[_0x1ed5('0x34')](_0x58c410[_0x1ed5('0x31')],qs[_0x1ed5('0x36')](_0x587864[_0x1ed5('0x33')][_0x1ed5('0x36')]));_0x3d5094[_0x1ed5('0x35')]=_0x3d5094[_0x1ed5('0x35')][_0x1ed5('0x37')]?_0x3d5094[_0x1ed5('0x35')]:_0x58c410[_0x1ed5('0x31')];if(_0x587864[_0x1ed5('0x33')]['includeAll']){_0x3d5094[_0x1ed5('0x43')]=[{'all':!![]}];}_0x3d5094=_[_0x1ed5('0x40')]({},_0x3d5094,_0x587864[_0x1ed5('0x42')]);return db['CmCompany'][_0x1ed5('0x49')](_0x3d5094)[_0x1ed5('0x24')](handleEntityNotFound(_0xd3e4e4,null))[_0x1ed5('0x24')](respondWithResult(_0xd3e4e4,null))[_0x1ed5('0x46')](handleError(_0xd3e4e4,null));};exports[_0x1ed5('0x4a')]=function(_0xda94aa,_0x498009){return db[_0x1ed5('0x2f')]['create'](_0xda94aa['body'],{})[_0x1ed5('0x24')](function(_0xafb1f){var _0x348e0e=_0xda94aa[_0x1ed5('0x4b')][_0x1ed5('0x26')]({'plain':!![]});if(!_0x348e0e)throw new Error(_0x1ed5('0x4c'));if(_0x348e0e[_0x1ed5('0x4d')]===_0x1ed5('0x4b')){var _0x178a71=_0xafb1f[_0x1ed5('0x26')]({'plain':!![]});var _0x386c06='Companies';return db['UserProfileSection']['find']({'where':{'name':_0x386c06,'userProfileId':_0x348e0e[_0x1ed5('0x4e')]},'raw':!![]})['then'](function(_0x580013){if(_0x580013&&_0x580013[_0x1ed5('0x4f')]===0x0){return db[_0x1ed5('0x28')]['create']({'name':_0x178a71[_0x1ed5('0x2c')],'resourceId':_0x178a71['id'],'type':_0x580013['name'],'sectionId':_0x580013['id']},{})[_0x1ed5('0x24')](function(){return _0xafb1f;});}else{return _0xafb1f;}})['catch'](function(_0x4a5d88){logger['error'](_0x1ed5('0x50'),_0x4a5d88);throw _0x4a5d88;});}return _0xafb1f;})[_0x1ed5('0x24')](respondWithResult(_0x498009,0xc9))[_0x1ed5('0x46')](handleError(_0x498009,null));};exports[_0x1ed5('0x23')]=function(_0x9c91b6,_0x434aba){if(_0x9c91b6[_0x1ed5('0x51')]['id']){delete _0x9c91b6[_0x1ed5('0x51')]['id'];}return db[_0x1ed5('0x2f')]['find']({'where':{'id':_0x9c91b6[_0x1ed5('0x47')]['id']}})[_0x1ed5('0x24')](handleEntityNotFound(_0x434aba,null))[_0x1ed5('0x24')](saveUpdates(_0x9c91b6['body'],null))[_0x1ed5('0x24')](respondWithResult(_0x434aba,null))[_0x1ed5('0x46')](handleError(_0x434aba,null));};exports[_0x1ed5('0x25')]=function(_0x3a1984,_0x88adfb){return db[_0x1ed5('0x2f')]['find']({'where':{'id':_0x3a1984['params']['id']}})['then'](handleEntityNotFound(_0x88adfb,null))[_0x1ed5('0x24')](removeEntity(_0x88adfb,null))[_0x1ed5('0x46')](handleError(_0x88adfb,null));};exports[_0x1ed5('0x30')]=function(_0x49d6bc,_0x57515e){return db[_0x1ed5('0x2f')]['describe']()['then'](respondWithResult(_0x57515e,null))[_0x1ed5('0x46')](handleError(_0x57515e,null));};exports[_0x1ed5('0x52')]=function(_0x5d5b05,_0x2c7cb5,_0x2eed57){return db[_0x1ed5('0x53')][_0x1ed5('0x49')]({'where':{'id':_0x5d5b05[_0x1ed5('0x47')]['id']}})[_0x1ed5('0x24')](handleEntityNotFound(_0x2c7cb5,null))['then'](function(_0x24e822){if(_0x24e822){return _0x24e822['addContacts'](_0x5d5b05[_0x1ed5('0x51')][_0x1ed5('0x54')],_[_0x1ed5('0x55')](_0x5d5b05[_0x1ed5('0x51')],[_0x1ed5('0x54'),'id'])||{});}})[_0x1ed5('0x24')](respondWithResult(_0x2c7cb5,null))['catch'](handleError(_0x2c7cb5,null));};exports[_0x1ed5('0x56')]=function(_0x201e12,_0x350ac3,_0x27a60d){var _0x4b3e67={};var _0x513689={};var _0xc74581;var _0xb12c49;return db[_0x1ed5('0x2f')][_0x1ed5('0x57')]({'where':{'id':_0x201e12[_0x1ed5('0x47')]['id']}})['then'](handleEntityNotFound(_0x350ac3,null))[_0x1ed5('0x24')](function(_0x55d3b4){if(_0x55d3b4){_0xc74581=_0x55d3b4;_0x513689['model']=_[_0x1ed5('0x32')](db[_0x1ed5('0x53')][_0x1ed5('0x48')]);_0x513689['query']=_[_0x1ed5('0x32')](_0x201e12[_0x1ed5('0x33')]);_0x513689[_0x1ed5('0x3e')]=_['intersection'](_0x513689[_0x1ed5('0x31')],_0x513689[_0x1ed5('0x33')]);_0x4b3e67[_0x1ed5('0x35')]=_[_0x1ed5('0x34')](_0x513689[_0x1ed5('0x31')],qs['fields'](_0x201e12['query'][_0x1ed5('0x36')]));_0x4b3e67['attributes']=_0x4b3e67[_0x1ed5('0x35')][_0x1ed5('0x37')]?_0x4b3e67[_0x1ed5('0x35')]:_0x513689[_0x1ed5('0x31')];_0x4b3e67[_0x1ed5('0x3a')]=qs['sort'](_0x201e12[_0x1ed5('0x33')][_0x1ed5('0x3b')]);_0x4b3e67[_0x1ed5('0x3c')]=qs[_0x1ed5('0x3e')](_['pick'](_0x201e12[_0x1ed5('0x33')],_0x513689[_0x1ed5('0x3e')]));if(_0x201e12[_0x1ed5('0x33')][_0x1ed5('0x3f')]){_0x4b3e67[_0x1ed5('0x3c')]=_[_0x1ed5('0x40')](_0x4b3e67[_0x1ed5('0x3c')],{'$or':_[_0x1ed5('0x41')](_0x4b3e67['attributes'],function(_0x221f0b){var _0x5f2464={};_0x5f2464[_0x221f0b]={'$like':'%'+_0x201e12[_0x1ed5('0x33')]['filter']+'%'};return _0x5f2464;})});}_0x4b3e67=_[_0x1ed5('0x40')]({},_0x4b3e67,_0x201e12['options']);return _0xc74581[_0x1ed5('0x56')](_0x4b3e67);}})[_0x1ed5('0x24')](function(_0xaba76d){if(_0xaba76d){_0xb12c49=_0xaba76d[_0x1ed5('0x37')];if(!_0x201e12[_0x1ed5('0x33')][_0x1ed5('0x38')](_0x1ed5('0x39'))){_0x4b3e67[_0x1ed5('0x1e')]=qs[_0x1ed5('0x1e')](_0x201e12[_0x1ed5('0x33')][_0x1ed5('0x1e')]);_0x4b3e67[_0x1ed5('0x20')]=qs['offset'](_0x201e12[_0x1ed5('0x33')]['offset']);}return _0xc74581['getContacts'](_0x4b3e67);}})[_0x1ed5('0x24')](function(_0x35edb8){if(_0x35edb8){return _0x35edb8?{'count':_0xb12c49,'rows':_0x35edb8}:null;}})[_0x1ed5('0x24')](respondWithResult(_0x350ac3,null))[_0x1ed5('0x46')](handleError(_0x350ac3,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 91d4ae0..173a917 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 _0xc874=['request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash','util','api','moment','bluebird'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xc874,0x1a8));var _0x4c87=function(_0x296897,_0x4d23ea){_0x296897=_0x296897-0x0;var _0x2b44ab=_0xc874[_0x296897];return _0x2b44ab;};'use strict';var _=require(_0x4c87('0x0'));var util=require(_0x4c87('0x1'));var logger=require('../../config/logger')(_0x4c87('0x2'));var moment=require(_0x4c87('0x3'));var BPromise=require(_0x4c87('0x4'));var rp=require(_0x4c87('0x5'));var fs=require('fs');var path=require(_0x4c87('0x6'));var rimraf=require(_0x4c87('0x7'));var config=require(_0x4c87('0x8'));var attributes=require(_0x4c87('0x9'));module['exports']=function(_0x4fdce2,_0x14f81d){return _0x4fdce2[_0x4c87('0xa')](_0x4c87('0xb'),attributes,{'tableName':_0x4c87('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x82f5=['cm_companies','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany'];(function(_0x183ade,_0x2b2446){var _0x103bfa=function(_0x5a6d27){while(--_0x5a6d27){_0x183ade['push'](_0x183ade['shift']());}};_0x103bfa(++_0x2b2446);}(_0x82f5,0xfd));var _0x582f=function(_0x341a9f,_0x1686f6){_0x341a9f=_0x341a9f-0x0;var _0x1d8c44=_0x82f5[_0x341a9f];return _0x1d8c44;};'use strict';var _=require(_0x582f('0x0'));var util=require(_0x582f('0x1'));var logger=require(_0x582f('0x2'))(_0x582f('0x3'));var moment=require(_0x582f('0x4'));var BPromise=require(_0x582f('0x5'));var rp=require(_0x582f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x582f('0x7'));var config=require(_0x582f('0x8'));var attributes=require(_0x582f('0x9'));module[_0x582f('0xa')]=function(_0x665351,_0x1fad3b){return _0x665351[_0x582f('0xb')](_0x582f('0xc'),attributes,{'tableName':_0x582f('0xd'),'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 a64be36..0e19e44 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 _0x48a9=['info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','CmCompany,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then'];(function(_0x22e4d3,_0x26a815){var _0x354f75=function(_0x533091){while(--_0x533091){_0x22e4d3['push'](_0x22e4d3['shift']());}};_0x354f75(++_0x26a815);}(_0x48a9,0xe6));var _0x948a=function(_0x5e6ea3,_0x9addd2){_0x5e6ea3=_0x5e6ea3-0x0;var _0x4048b5=_0x48a9[_0x5e6ea3];return _0x4048b5;};'use strict';var _=require('lodash');var util=require(_0x948a('0x0'));var moment=require(_0x948a('0x1'));var BPromise=require(_0x948a('0x2'));var rs=require(_0x948a('0x3'));var fs=require('fs');var Redis=require(_0x948a('0x4'));var db=require(_0x948a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x948a('0x6'))(_0x948a('0x7'));var config=require('../../config/environment');var jayson=require(_0x948a('0x8'));var client=jayson[_0x948a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34a47c,_0x1a7c21,_0x5299a6){return new BPromise(function(_0x2f3faf,_0x16df55){return client[_0x948a('0xa')](_0x34a47c,_0x5299a6)[_0x948a('0xb')](function(_0x4c2e91){logger[_0x948a('0xc')]('CmCompany,\x20%s,\x20%s',_0x1a7c21,_0x948a('0xd'));logger[_0x948a('0xe')](_0x948a('0xf'),_0x1a7c21,_0x948a('0xd'),JSON[_0x948a('0x10')](_0x4c2e91));if(_0x4c2e91['error']){if(_0x4c2e91[_0x948a('0x11')]['code']===0x1f4){logger[_0x948a('0x11')](_0x948a('0x12'),_0x1a7c21,_0x4c2e91[_0x948a('0x11')]['message']);return _0x16df55(_0x4c2e91[_0x948a('0x11')]['message']);}logger[_0x948a('0x11')]('CmCompany,\x20%s,\x20%s',_0x1a7c21,_0x4c2e91['error'][_0x948a('0x13')]);return _0x2f3faf(_0x4c2e91[_0x948a('0x11')]['message']);}else{logger[_0x948a('0xc')](_0x948a('0x12'),_0x1a7c21,_0x948a('0xd'));_0x2f3faf(_0x4c2e91[_0x948a('0x14')][_0x948a('0x13')]);}})[_0x948a('0x15')](function(_0x45b3d8){logger[_0x948a('0x11')]('CmCompany,\x20%s,\x20%s',_0x1a7c21,_0x45b3d8);_0x16df55(_0x45b3d8);});});}
\ No newline at end of file
+var _0x0eb8=['lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x5e1ddc,_0xd080b0){var _0x47dc89=function(_0x3f3902){while(--_0x3f3902){_0x5e1ddc['push'](_0x5e1ddc['shift']());}};_0x47dc89(++_0xd080b0);}(_0x0eb8,0xdc));var _0x80eb=function(_0x123acf,_0x4d0213){_0x123acf=_0x123acf-0x0;var _0x1efd4a=_0x0eb8[_0x123acf];return _0x1efd4a;};'use strict';var _=require(_0x80eb('0x0'));var util=require(_0x80eb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x80eb('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x80eb('0x3'))['db'];var utils=require(_0x80eb('0x4'));var logger=require(_0x80eb('0x5'))(_0x80eb('0x6'));var config=require(_0x80eb('0x7'));var jayson=require(_0x80eb('0x8'));var client=jayson[_0x80eb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3971aa,_0x1bd49d,_0x32e572){return new BPromise(function(_0x3d7e55,_0x5e48c9){return client[_0x80eb('0xa')](_0x3971aa,_0x32e572)[_0x80eb('0xb')](function(_0x5c4976){logger[_0x80eb('0xc')](_0x80eb('0xd'),_0x1bd49d,_0x80eb('0xe'));logger['debug'](_0x80eb('0xf'),_0x1bd49d,_0x80eb('0xe'),JSON[_0x80eb('0x10')](_0x5c4976));if(_0x5c4976[_0x80eb('0x11')]){if(_0x5c4976[_0x80eb('0x11')][_0x80eb('0x12')]===0x1f4){logger[_0x80eb('0x11')](_0x80eb('0xd'),_0x1bd49d,_0x5c4976[_0x80eb('0x11')][_0x80eb('0x13')]);return _0x5e48c9(_0x5c4976[_0x80eb('0x11')][_0x80eb('0x13')]);}logger[_0x80eb('0x11')](_0x80eb('0xd'),_0x1bd49d,_0x5c4976[_0x80eb('0x11')][_0x80eb('0x13')]);return _0x3d7e55(_0x5c4976[_0x80eb('0x11')][_0x80eb('0x13')]);}else{logger[_0x80eb('0xc')]('CmCompany,\x20%s,\x20%s',_0x1bd49d,_0x80eb('0xe'));_0x3d7e55(_0x5c4976[_0x80eb('0x14')][_0x80eb('0x13')]);}})[_0x80eb('0x15')](function(_0x28f3cf){logger[_0x80eb('0x11')]('CmCompany,\x20%s,\x20%s',_0x1bd49d,_0x28f3cf);_0x5e48c9(_0x28f3cf);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index d6b8823..3c41092 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 _0x61b3=['create','addContacts','put','update','delete','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./cmCompany.controller','index','get','/describe','isAuthenticated','/:id','show','/:id/contacts','post'];(function(_0x468777,_0x81b92){var _0x4eba33=function(_0x4e1471){while(--_0x4e1471){_0x468777['push'](_0x468777['shift']());}};_0x4eba33(++_0x81b92);}(_0x61b3,0x1be));var _0x361b=function(_0x244dd2,_0x1b0955){_0x244dd2=_0x244dd2-0x0;var _0x1faa57=_0x61b3[_0x244dd2];return _0x1faa57;};'use strict';var multer=require(_0x361b('0x0'));var util=require('util');var path=require(_0x361b('0x1'));var timeout=require(_0x361b('0x2'));var express=require(_0x361b('0x3'));var router=express['Router']();var fs_extra=require(_0x361b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x361b('0x5'));var config=require(_0x361b('0x6'));var controller=require(_0x361b('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x361b('0x8')]);router[_0x361b('0x9')](_0x361b('0xa'),auth[_0x361b('0xb')](),controller['describe']);router[_0x361b('0x9')](_0x361b('0xc'),auth[_0x361b('0xb')](),controller[_0x361b('0xd')]);router[_0x361b('0x9')](_0x361b('0xe'),auth[_0x361b('0xb')](),controller['getContacts']);router[_0x361b('0xf')]('/',auth['isAuthenticated'](),controller[_0x361b('0x10')]);router['post'](_0x361b('0xe'),auth[_0x361b('0xb')](),controller[_0x361b('0x11')]);router[_0x361b('0x12')](_0x361b('0xc'),auth[_0x361b('0xb')](),controller[_0x361b('0x13')]);router[_0x361b('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xe8e1=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/:id','show','getContacts','post','/:id/contacts','update','destroy','exports','multer','util'];(function(_0x39659e,_0x129655){var _0x19cee1=function(_0x387533){while(--_0x387533){_0x39659e['push'](_0x39659e['shift']());}};_0x19cee1(++_0x129655);}(_0xe8e1,0xc6));var _0x1e8e=function(_0x32659d,_0x58ece9){_0x32659d=_0x32659d-0x0;var _0x10d610=_0xe8e1[_0x32659d];return _0x10d610;};'use strict';var multer=require(_0x1e8e('0x0'));var util=require(_0x1e8e('0x1'));var path=require('path');var timeout=require(_0x1e8e('0x2'));var express=require('express');var router=express[_0x1e8e('0x3')]();var fs_extra=require(_0x1e8e('0x4'));var auth=require(_0x1e8e('0x5'));var interaction=require(_0x1e8e('0x6'));var config=require(_0x1e8e('0x7'));var controller=require('./cmCompany.controller');router[_0x1e8e('0x8')]('/',auth['isAuthenticated'](),controller[_0x1e8e('0x9')]);router['get'](_0x1e8e('0xa'),auth[_0x1e8e('0xb')](),controller['describe']);router[_0x1e8e('0x8')](_0x1e8e('0xc'),auth[_0x1e8e('0xb')](),controller[_0x1e8e('0xd')]);router[_0x1e8e('0x8')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x1e8e('0xe')]);router[_0x1e8e('0xf')]('/',auth[_0x1e8e('0xb')](),controller['create']);router[_0x1e8e('0xf')](_0x1e8e('0x10'),auth['isAuthenticated'](),controller['addContacts']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x1e8e('0x11')]);router['delete'](_0x1e8e('0xc'),auth[_0x1e8e('0xb')](),controller[_0x1e8e('0x12')]);module[_0x1e8e('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index cd707eb..60bec42 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 _0x12d3=['NOW','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0xa5c157,_0x5c6652){var _0xe625db=function(_0x3989bf){while(--_0x3989bf){_0xa5c157['push'](_0xa5c157['shift']());}};_0xe625db(++_0x5c6652);}(_0x12d3,0xa9));var _0x312d=function(_0xdf5f14,_0x48aa29){_0xdf5f14=_0xdf5f14-0x0;var _0x39e98a=_0x12d3[_0xdf5f14];return _0x39e98a;};'use strict';var _=require('lodash');var Sequelize=require(_0x312d('0x0'));module[_0x312d('0x1')]={'firstName':{'type':Sequelize[_0x312d('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x312d('0x2')]},'street':{'type':Sequelize[_0x312d('0x2')]},'postalCode':{'type':Sequelize[_0x312d('0x2')]},'city':{'type':Sequelize[_0x312d('0x2')]},'country':{'type':Sequelize[_0x312d('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x312d('0x3')]},'phone':{'type':Sequelize[_0x312d('0x2')]},'mobile':{'type':Sequelize[_0x312d('0x2')]},'fax':{'type':Sequelize[_0x312d('0x2')]},'email':{'type':Sequelize[_0x312d('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x312d('0x2')]},'fb_data':{'type':Sequelize[_0x312d('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x312d('0x2')]},'viber':{'type':Sequelize[_0x312d('0x2')]},'line':{'type':Sequelize[_0x312d('0x2')]},'wechat':{'type':Sequelize[_0x312d('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x312d('0x4')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x312d('0x4')](0x2)[_0x312d('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x312d('0x6')],'defaultValue':Sequelize[_0x312d('0x7')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x312d('0x4')]}};
\ No newline at end of file
+var _0x5bfa=['INTEGER','UNSIGNED','NOW','exports','STRING','TEXT'];(function(_0x1e3378,_0x35896f){var _0xec11f3=function(_0x178682){while(--_0x178682){_0x1e3378['push'](_0x1e3378['shift']());}};_0xec11f3(++_0x35896f);}(_0x5bfa,0x111));var _0xa5bf=function(_0x1b1a3b,_0x52a88a){_0x1b1a3b=_0x1b1a3b-0x0;var _0x385347=_0x5bfa[_0x1b1a3b];return _0x385347;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module[_0xa5bf('0x0')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xa5bf('0x1')]},'street':{'type':Sequelize[_0xa5bf('0x1')]},'postalCode':{'type':Sequelize[_0xa5bf('0x1')]},'city':{'type':Sequelize[_0xa5bf('0x1')]},'country':{'type':Sequelize[_0xa5bf('0x1')]},'dateOfBirth':{'type':Sequelize[_0xa5bf('0x1')]},'description':{'type':Sequelize[_0xa5bf('0x2')]},'phone':{'type':Sequelize[_0xa5bf('0x1')]},'mobile':{'type':Sequelize[_0xa5bf('0x1')]},'fax':{'type':Sequelize[_0xa5bf('0x1')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xa5bf('0x1')]},'facebook':{'type':Sequelize[_0xa5bf('0x1')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xa5bf('0x1')]},'skype':{'type':Sequelize[_0xa5bf('0x1')]},'teams':{'type':Sequelize[_0xa5bf('0x1')]},'viber':{'type':Sequelize[_0xa5bf('0x1')]},'line':{'type':Sequelize[_0xa5bf('0x1')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0xa5bf('0x1')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0xa5bf('0x1')]},'priority':{'type':Sequelize[_0xa5bf('0x3')](0x2)[_0xa5bf('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xa5bf('0x5')]},'dialTimezone':{'type':Sequelize[_0xa5bf('0x1')]},'utcOffset':{'type':Sequelize[_0xa5bf('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index e54c0a5..97a393d 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 _0x79e8=['cm_contacts','setFields','id\x20=\x20?','values','findOne','model','rawAttributes','intersection','attributes','fields','order','sort','filters','pick','options','getTags','nolimit','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','phone','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','PHONE','`ItemType`.OrderBy','ItemType.OrderBy','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','getHoppers','ContactId','filter','includeAll','include','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getJscriptySessions','uploadCsv','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','split','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','file','filename','chmodSync','0777','child_process','../../components/import/cm/csv','CompanyId','socket_timestamp','pid','upload','parse','meta','User','agent','No\x20ListId\x20specified','binding','fork','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','mail','sms','fax','whatsapp','voice','-createdAt','resolve','includes','channel','toLowerCase','Invalid\x20channel','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','uniqueid','source','destination','callerid','endtime','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','findAndCountAll','fullname','startCase','chat','Website','closed','disposition','secondDisposition','thirdDisposition','Account','DESC','browserName','customerIp','customerPort','deviceModel','ratingMessage','ratingType','ratingValue','referer','subject','substatus','openchannel','externalUrl','threadId','Interaction','Owner','sortBy','reverse','value','slice','moment','bluebird','path','lodash','papaparse','ioredis','../../components/contacts','../../components/parsers/qs','../../config/environment/shared','../../mysqldb','redis','localhost','socket.io-emitter','./cmContact.socket','register','json','offset','undefined','limit','count','status','set','Content-Range','update','then','destroy','end','sendStatus','name','send','describe','getOptions','findAll','user','catch','CmContact','find','params','tags','keys','startsWith','columnName','displayName','query','CmCustomField','length','cf_','alias','type','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body','from','get','mergeWith','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmContactHasItem','VoiceCallReport','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','$or','ListId','findOrCreate','spread','push','contact','all','Tag','Tags','color','tag','ContactItemType','ItemType','sequelize','literal','isNil','$and','omit','format','cf_%d','pickBy','map','isEmpty'];(function(_0x58fd8a,_0x471cf6){var _0x5f566=function(_0xe751a){while(--_0xe751a){_0x58fd8a['push'](_0x58fd8a['shift']());}};_0x5f566(++_0x471cf6);}(_0x79e8,0x184));var _0x879e=function(_0x27a331,_0x5ee322){_0x27a331=_0x27a331-0x0;var _0x2cf773=_0x79e8[_0x27a331];return _0x2cf773;};'use strict';var moment=require(_0x879e('0x0'));var BPromise=require(_0x879e('0x1'));var util=require('util');var path=require(_0x879e('0x2'));var fs=require('fs');var _=require(_0x879e('0x3'));var squel=require('squel');var Papa=require(_0x879e('0x4'));var Redis=require(_0x879e('0x5'));var contacts=require(_0x879e('0x6'));var qs=require(_0x879e('0x7'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var shared=require(_0x879e('0x8'));var db=require(_0x879e('0x9'))['db'];config[_0x879e('0xa')]=_['defaults'](config[_0x879e('0xa')],{'host':_0x879e('0xb'),'port':0x18eb});var socket=require(_0x879e('0xc'))(new Redis(config['redis']));require(_0x879e('0xd'))[_0x879e('0xe')](socket);function respondWithResult(_0x501863,_0x5248e2){_0x5248e2=_0x5248e2||0xc8;return function(_0x3e25d2){if(_0x3e25d2){return _0x501863['status'](_0x5248e2)[_0x879e('0xf')](_0x3e25d2);}};}function respondWithFilteredResult(_0x410c4a,_0x3e1bca){return function(_0x1a9917){if(_0x1a9917){var _0x267d03=typeof _0x3e1bca[_0x879e('0x10')]===_0x879e('0x11')&&typeof _0x3e1bca[_0x879e('0x12')]===_0x879e('0x11');var _0x2f9d14=_0x1a9917[_0x879e('0x13')];var _0x4df5e1=_0x267d03?0x0:_0x3e1bca['offset'];var _0x1577f3=_0x267d03?_0x1a9917[_0x879e('0x13')]:_0x3e1bca[_0x879e('0x10')]+_0x3e1bca[_0x879e('0x12')];var _0x2a757c;if(_0x1577f3>=_0x2f9d14){_0x1577f3=_0x2f9d14;_0x2a757c=0xc8;}else{_0x2a757c=0xce;}_0x410c4a[_0x879e('0x14')](_0x2a757c);return _0x410c4a[_0x879e('0x15')](_0x879e('0x16'),_0x4df5e1+'-'+_0x1577f3+'/'+_0x2f9d14)[_0x879e('0xf')](_0x1a9917);}return null;};}function saveUpdates(_0x1a9110){return function(_0x275744){if(_0x275744){return _0x275744[_0x879e('0x17')](_0x1a9110)[_0x879e('0x18')](function(_0x2eff56){return _0x2eff56;});}return null;};}function removeEntity(_0x2dbb93){return function(_0x7e7926){if(_0x7e7926){return _0x7e7926[_0x879e('0x19')]()[_0x879e('0x18')](function(){_0x2dbb93[_0x879e('0x14')](0xcc)[_0x879e('0x1a')]();});}};}function handleEntityNotFound(_0x983675){return function(_0x3b3be2){if(!_0x3b3be2){_0x983675[_0x879e('0x1b')](0x194);}return _0x3b3be2;};}function handleError(_0x84e371,_0x502934){_0x502934=_0x502934||0x1f4;return function(_0x59d1bb){logger['error'](_0x59d1bb['stack']);if(_0x59d1bb[_0x879e('0x1c')]){delete _0x59d1bb[_0x879e('0x1c')];}_0x84e371['status'](_0x502934)[_0x879e('0x1d')](_0x59d1bb);};}exports['index']=function(_0x196011,_0x441d87){var _0x27563a={};return contacts[_0x879e('0x1e')]()[_0x879e('0x18')](function(_0x3d775a){_0x27563a=qs[_0x879e('0x1f')](_0x3d775a,_0x196011);return contacts[_0x879e('0x20')](_0x196011['query'],_0x196011[_0x879e('0x21')],_0x27563a,_0x3d775a);})[_0x879e('0x18')](respondWithFilteredResult(_0x441d87,_0x27563a))[_0x879e('0x22')](handleError(_0x441d87,null));};exports[_0x879e('0x19')]=function(_0x224e71,_0x2b8720){return db[_0x879e('0x23')][_0x879e('0x24')]({'where':{'id':_0x224e71[_0x879e('0x25')]['id']}})[_0x879e('0x18')](handleEntityNotFound(_0x2b8720,null))[_0x879e('0x18')](removeEntity(_0x2b8720,null))['catch'](handleError(_0x2b8720,null));};exports['describe']=function(_0x3faf38,_0x1ad852){return db[_0x879e('0x23')][_0x879e('0x1e')]()[_0x879e('0x18')](function(_0x3ac393){delete _0x3ac393[_0x879e('0x26')];for(var _0x32440f=0x0;_0x32440f
','Attachments','Title','Data','utf-8','toString','base64','moment','path','util','../../../config/logger'];(function(_0x53f56d,_0x5225db){var _0x4e7726=function(_0x1578b0){while(--_0x1578b0){_0x53f56d['push'](_0x53f56d['shift']());}};_0x4e7726(++_0x5225db);}(_0x85b5,0x110));var _0x585b=function(_0x5afec3,_0x255c8c){_0x5afec3=_0x5afec3-0x0;var _0x3b4f7b=_0x85b5[_0x5afec3];return _0x3b4f7b;};'use strict';var _=require('lodash');var moment=require(_0x585b('0x0'));var random=require('randomstring');var fs=require('fs');var path=require(_0x585b('0x1'));var util=require(_0x585b('0x2'));var tnef=require('node-tnef');var logger=require(_0x585b('0x3'))(_0x585b('0x4'));var config=require('../../../config/environment');function getAddress(_0x4df663){var _0x21c2da=_['head'](_0x4df663[_0x585b('0x5')]);return _0x21c2da&&_0x21c2da[_0x585b('0x6')]?_0x21c2da['address']:'anonymous'+random[_0x585b('0x7')](0x6)+'@xcally.com';}function getFirstName(_0x2c84d9){var _0x2b5325=_['head'](_0x2c84d9[_0x585b('0x5')]);if(_0x2b5325&&_0x2b5325['name']){if(_0x2b5325[_0x585b('0x8')]==_0x2b5325['address']){return _0x2b5325['name'][_0x585b('0x9')](0x0,_0x2b5325[_0x585b('0x8')]['indexOf']('@'));}var _0x1a7f33=_0x2b5325[_0x585b('0x8')][_0x585b('0xa')](/\s+/);return _0x1a7f33[_0x585b('0xb')]>0x1?_0x1a7f33[_0x585b('0xc')](0x0,-0x1)[_0x585b('0xd')]('\x20'):_0x2b5325['name'];}return _0x585b('0xe');}function getLastName(_0x202741){var _0x19fead=_[_0x585b('0xf')](_0x202741[_0x585b('0x5')]);if(_0x19fead&&_0x19fead[_0x585b('0x8')]){var _0x15e837=_0x19fead[_0x585b('0x8')][_0x585b('0xa')](/\s+/);return _0x15e837[_0x585b('0xb')]>0x1?_0x15e837['pop']():'';}return'';}function getMails(_0x3856bf,_0x51d106){var _0x234e85='';for(var _0x2b8dbc=0x0;_0x2b8dbc<_0x51d106[_0x585b('0x5')][_0x585b('0xb')];_0x2b8dbc+=0x1){if(_0x51d106[_0x585b('0x5')][_0x2b8dbc]['address']!==_0x3856bf){if(!_[_0x585b('0x10')](_0x234e85)){_0x234e85+=',';}_0x234e85+=_0x51d106[_0x585b('0x5')][_0x2b8dbc][_0x585b('0x8')]||_0x51d106[_0x585b('0x5')][_0x2b8dbc]['address']||'';_0x234e85+='\x20<';_0x234e85+=_0x51d106[_0x585b('0x5')][_0x2b8dbc][_0x585b('0x6')]?_0x51d106[_0x585b('0x5')][_0x2b8dbc][_0x585b('0x6')]:_0x585b('0x11')+random[_0x585b('0x7')](0x6)+_0x585b('0x12');_0x234e85+='>';}}return _0x234e85;}function parseEmail(_0x371674,_0x3f4374,_0x43c7ee){if(_0x3f4374[_0x585b('0x13')]){var _0x119376=/