From d7080dd6a5e5c3d1717aca8278b8b3b01b8a960e Mon Sep 17 00:00:00 2001
From: Andrea Bianco
Date: Fri, 31 Dec 2021 15:49:37 +0100
Subject: [PATCH] Built motion from commit c102fb6e.|2.5.44
---
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 +-
.../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 +-
.../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 +-
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/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/integrations/configuration.js | 2 +-
server/components/interaction/service.js | 2 +-
server/components/license/service.js | 2 +-
server/components/parsers/advancedSearch.js | 2 +-
server/components/parsers/qs.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/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/graph/index.js | 2 +-
server/services/agi/index.js | 2 +-
server/services/agi/mailRpc/index.js | 2 +-
server/services/agi/reply.js | 2 +-
server/services/agi/rpc/index.js | 2 +-
server/services/agi/scripts/aws/index.js | 2 +-
server/services/agi/scripts/aws/lex/index.js | 2 +-
server/services/agi/scripts/aws/lex/lib/api.js | 2 +-
server/services/agi/scripts/aws/polly/index.js | 2 +-
server/services/agi/scripts/aws/polly/lib/api.js | 2 +-
server/services/agi/scripts/google/asr/index.js | 2 +-
server/services/agi/scripts/google/asr/lib/api.js | 2 +-
server/services/agi/scripts/google/index.js | 2 +-
server/services/agi/scripts/index.js | 2 +-
server/services/agi/scripts/sestek/index.js | 2 +-
server/services/agi/scripts/sestek/nda/index.js | 2 +-
server/services/agi/scripts/tilde/asr/index.js | 2 +-
server/services/agi/scripts/tilde/asr/lib/api.js | 2 +-
server/services/agi/scripts/tilde/index.js | 2 +-
server/services/agi/server.js | 2 +-
server/services/agi/vertices.js | 2 +-
server/services/ami/acw/index.js | 2 +-
server/services/ami/ami.js | 2 +-
server/services/ami/client.js | 2 +-
server/services/ami/dialer/action.js | 2 +-
server/services/ami/dialer/agentComplete.js | 2 +-
server/services/ami/dialer/final.js | 2 +-
server/services/ami/dialer/hangup.js | 2 +-
server/services/ami/dialer/history.js | 2 +-
server/services/ami/dialer/index.js | 2 +-
server/services/ami/dialer/queueCallerAbandon.js | 2 +-
server/services/ami/fax/action.js | 2 +-
server/services/ami/fax/index.js | 2 +-
server/services/ami/fax/rpcDb.js | 2 +-
server/services/ami/fax/util/gs.js | 2 +-
server/services/ami/fax/util/util.js | 2 +-
server/services/ami/index.js | 2 +-
server/services/ami/model/agent.js | 2 +-
server/services/ami/model/campaign.js | 2 +-
server/services/ami/model/channel.js | 2 +-
server/services/ami/model/deskAccount.js | 2 +-
server/services/ami/model/dynamics365Account.js | 2 +-
server/services/ami/model/faxAccount.js | 2 +-
server/services/ami/model/freshdeskAccount.js | 2 +-
server/services/ami/model/freshsalesAccount.js | 2 +-
server/services/ami/model/queueReport.js | 2 +-
server/services/ami/model/salesforceAccount.js | 2 +-
server/services/ami/model/servicenowAccount.js | 2 +-
server/services/ami/model/sugarcrmAccount.js | 2 +-
server/services/ami/model/telephone.js | 2 +-
server/services/ami/model/template.js | 2 +-
server/services/ami/model/trigger.js | 2 +-
server/services/ami/model/trunk.js | 2 +-
server/services/ami/model/voiceExtension.js | 2 +-
server/services/ami/model/voiceQueue.js | 2 +-
server/services/ami/model/vtigerAccount.js | 2 +-
server/services/ami/model/zendeskAccount.js | 2 +-
server/services/ami/model/zohoAccount.js | 2 +-
server/services/ami/preview/action.js | 2 +-
server/services/ami/preview/index.js | 2 +-
server/services/ami/preview/rpcDb.js | 2 +-
server/services/ami/preview/util/util.js | 2 +-
server/services/ami/properties.js | 2 +-
server/services/ami/realtime/index.js | 2 +-
server/services/ami/report/index.js | 2 +-
server/services/ami/report/userReport.js | 2 +-
server/services/ami/report/voiceAgentReport.js | 2 +-
server/services/ami/report/voiceCallReport.js | 2 +-
server/services/ami/report/voiceDialReport.js | 2 +-
server/services/ami/report/voiceQueueReport.js | 2 +-
server/services/ami/rpc/agentReportPreview.js | 2 +-
server/services/ami/rpc/attachment.js | 2 +-
server/services/ami/rpc/campaign.js | 2 +-
server/services/ami/rpc/cmContact.js | 2 +-
server/services/ami/rpc/cmHopper.js | 2 +-
server/services/ami/rpc/cmHopperBlack.js | 2 +-
server/services/ami/rpc/cmHopperFinal.js | 2 +-
server/services/ami/rpc/cmHopperHistory.js | 2 +-
server/services/ami/rpc/faxAccount.js | 2 +-
server/services/ami/rpc/faxMessage.js | 2 +-
server/services/ami/rpc/integrations/desk.js | 2 +-
.../services/ami/rpc/integrations/dynamics365.js | 2 +-
server/services/ami/rpc/integrations/freshdesk.js | 2 +-
server/services/ami/rpc/integrations/freshsales.js | 2 +-
server/services/ami/rpc/integrations/salesforce.js | 2 +-
server/services/ami/rpc/integrations/servicenow.js | 2 +-
server/services/ami/rpc/integrations/sugarcrm.js | 2 +-
server/services/ami/rpc/integrations/vtiger.js | 2 +-
server/services/ami/rpc/integrations/zendesk.js | 2 +-
server/services/ami/rpc/integrations/zoho.js | 2 +-
server/services/ami/rpc/memberReport.js | 2 +-
server/services/ami/rpc/setting.js | 2 +-
server/services/ami/rpc/template.js | 2 +-
server/services/ami/rpc/trigger.js | 2 +-
server/services/ami/rpc/trunk.js | 2 +-
server/services/ami/rpc/user.js | 2 +-
server/services/ami/rpc/voiceAgentReport.js | 2 +-
server/services/ami/rpc/voiceCallReport.js | 2 +-
server/services/ami/rpc/voiceDialReport.js | 2 +-
server/services/ami/rpc/voiceExtension.js | 2 +-
server/services/ami/rpc/voiceQueue.js | 2 +-
server/services/ami/rpc/voiceQueueReport.js | 2 +-
server/services/ami/rpc/voiceQueueRt.js | 2 +-
server/services/ami/rpc/voiceRecording.js | 2 +-
server/services/ami/rpc/voiceTransferReport.js | 2 +-
server/services/ami/server/index.js | 2 +-
server/services/ami/trigger/cmContact/index.js | 2 +-
server/services/ami/trigger/index.js | 2 +-
server/services/ami/trigger/integration/desk.js | 2 +-
.../ami/trigger/integration/dynamics365.js | 2 +-
.../services/ami/trigger/integration/freshdesk.js | 2 +-
.../services/ami/trigger/integration/freshsales.js | 2 +-
server/services/ami/trigger/integration/index.js | 2 +-
.../services/ami/trigger/integration/salesforce.js | 2 +-
.../services/ami/trigger/integration/servicenow.js | 2 +-
.../services/ami/trigger/integration/sugarcrm.js | 2 +-
server/services/ami/trigger/integration/util.js | 2 +-
server/services/ami/trigger/integration/vtiger.js | 2 +-
server/services/ami/trigger/integration/zendesk.js | 2 +-
server/services/ami/trigger/integration/zoho.js | 2 +-
server/services/ami/trigger/script/index.js | 2 +-
server/services/ami/trigger/urlforward/index.js | 2 +-
server/services/email/client.js | 2 +-
server/services/email/index.js | 2 +-
server/services/email/lib/email.js | 2 +-
server/services/email/lib/imap.js | 2 +-
server/services/email/lib/smtp.js | 2 +-
server/services/email/lib/utils.js | 2 +-
server/services/email/model/mailAccount.js | 2 +-
server/services/email/realtime/index.js | 2 +-
server/services/email/rpc/mailAccount.js | 2 +-
server/services/email/rpc/setting.js | 2 +-
server/services/email/server/index.js | 2 +-
server/services/express/index.js | 2 +-
server/services/routing/client.js | 2 +-
server/services/routing/index.js | 2 +-
server/services/routing/lib/rule-engine.js | 2 +-
server/services/routing/mailRpc/index.js | 2 +-
server/services/routing/model/agent.js | 2 +-
server/services/routing/model/chatQueue.js | 2 +-
server/services/routing/model/faxQueue.js | 2 +-
server/services/routing/model/interval.js | 2 +-
server/services/routing/model/mailQueue.js | 2 +-
server/services/routing/model/openchannelQueue.js | 2 +-
server/services/routing/model/smsQueue.js | 2 +-
server/services/routing/model/whatsappQueue.js | 2 +-
server/services/routing/realtime/index.js | 2 +-
server/services/routing/rpc/chatInteraction.js | 2 +-
server/services/routing/rpc/chatMessage.js | 2 +-
server/services/routing/rpc/chatQueue.js | 2 +-
server/services/routing/rpc/chatQueueReport.js | 2 +-
server/services/routing/rpc/faxInteraction.js | 2 +-
server/services/routing/rpc/faxMessage.js | 2 +-
server/services/routing/rpc/faxQueue.js | 2 +-
server/services/routing/rpc/faxQueueReport.js | 2 +-
server/services/routing/rpc/interval.js | 2 +-
server/services/routing/rpc/mailInteraction.js | 2 +-
server/services/routing/rpc/mailMessage.js | 2 +-
server/services/routing/rpc/mailQueue.js | 2 +-
server/services/routing/rpc/mailQueueReport.js | 2 +-
.../services/routing/rpc/openchannelInteraction.js | 2 +-
server/services/routing/rpc/openchannelMessage.js | 2 +-
server/services/routing/rpc/openchannelQueue.js | 2 +-
.../services/routing/rpc/openchannelQueueReport.js | 2 +-
server/services/routing/rpc/smsInteraction.js | 2 +-
server/services/routing/rpc/smsMessage.js | 2 +-
server/services/routing/rpc/smsQueue.js | 2 +-
server/services/routing/rpc/smsQueueReport.js | 2 +-
server/services/routing/rpc/user.js | 2 +-
server/services/routing/rpc/whatsappInteraction.js | 2 +-
server/services/routing/rpc/whatsappMessage.js | 2 +-
server/services/routing/rpc/whatsappQueue.js | 2 +-
server/services/routing/rpc/whatsappQueueReport.js | 2 +-
.../services/routing/server/applications/agent.js | 2 +-
.../routing/server/applications/amazonlex.js | 2 +-
.../routing/server/applications/autoreply.js | 2 +-
.../services/routing/server/applications/close.js | 2 +-
.../routing/server/applications/dialogflow.js | 2 +-
.../routing/server/applications/dialogflowV2.js | 2 +-
.../services/routing/server/applications/gotoif.js | 2 +-
.../services/routing/server/applications/gotop.js | 2 +-
.../routing/server/applications/message.js | 2 +-
.../services/routing/server/applications/noop.js | 2 +-
.../services/routing/server/applications/queue.js | 2 +-
.../routing/server/applications/strategy/agent.js | 2 +-
.../server/applications/strategy/beepall.js | 2 +-
.../routing/server/applications/strategy/index.js | 2 +-
.../server/applications/strategy/rrmemory.js | 2 +-
.../routing/server/applications/strategy/util.js | 2 +-
.../services/routing/server/applications/system.js | 2 +-
server/services/routing/server/applications/tag.js | 2 +-
.../services/routing/server/applications/tvox.js | 2 +-
.../services/routing/server/applications/utils.js | 2 +-
server/services/routing/server/index.js | 2 +-
server/services/routing/server/interval.js | 2 +-
server/services/xdr/agents.controller.js | 2 +-
server/services/xdr/calls.controller.js | 2 +-
server/services/xdr/core.controller.js | 2 +-
server/services/xdr/dials.controller.js | 2 +-
server/services/xdr/index.js | 2 +-
server/services/xdr/members.controller.js | 2 +-
server/services/xdr/queues.controller.js | 2 +-
server/services/xdr/recordings.controller.js | 2 +-
server/services/xdr/transfers.controller.js | 2 +-
server/services/xdr/utils.js | 2 +-
server/utils/client-side-logger.js | 2 +-
server/utils/loggers.js | 2 +-
server/utils/mask-sensitive-data.js | 2 +-
server/utils/safe-template.js | 2 +-
1169 files changed, 1169 insertions(+), 1169 deletions(-)
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index cc2637b..447374e 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-12-31T11:38:22.763Z",
+ "time": "2021-12-31T14:37:19.750Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index e37c6ae..00887be 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-12-31T11:38:22.763Z",
+ "time": "2021-12-31T14:37:19.750Z",
"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 a023ea1..220a67b 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 _0x201e=['contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','getDataValue','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING'];(function(_0x2b42bf,_0x2f1463){var _0x23c423=function(_0x464e69){while(--_0x464e69){_0x2b42bf['push'](_0x2b42bf['shift']());}};_0x23c423(++_0x2f1463);}(_0x201e,0xd8));var _0xe201=function(_0x19dd7a,_0x51de21){_0x19dd7a=_0x19dd7a-0x0;var _0x3feb6a=_0x201e[_0x19dd7a];return _0x3feb6a;};'use strict';var Sequelize=require(_0xe201('0x0'));module[_0xe201('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x431d70){return this[_0xe201('0x2')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xe201('0x3'),_0xe201('0x4'),_0xe201('0x5'),_0xe201('0x6'),_0xe201('0x7'),_0xe201('0x8'),_0xe201('0x9')]],'msg':_0xe201('0xa')}},'comment':_0xe201('0xa')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0xe201('0xb')](0x1000),'comment':_0xe201('0xc')},'data3':{'type':Sequelize[_0xe201('0xb')](0x1000),'comment':_0xe201('0xd')},'data4':{'type':Sequelize[_0xe201('0xb')](0x1000),'comments':_0xe201('0xe')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xe201('0xf')},'data6':{'type':Sequelize[_0xe201('0xb')],'comments':_0xe201('0x10')},'data7':{'type':Sequelize[_0xe201('0x11')],'comments':_0xe201('0x12')}};
\ No newline at end of file
+var _0x1376=['VIRTUAL','getDataValue','action','STRING','contactManager','motionbar','jscripty','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports'];(function(_0x58345f,_0x4631db){var _0x27d9ef=function(_0x3ac80a){while(--_0x3ac80a){_0x58345f['push'](_0x58345f['shift']());}};_0x27d9ef(++_0x4631db);}(_0x1376,0x6f));var _0x6137=function(_0x1d2992,_0x598caa){_0x1d2992=_0x1d2992-0x0;var _0x30f362=_0x1376[_0x1d2992];return _0x30f362;};'use strict';var Sequelize=require('sequelize');module[_0x6137('0x0')]={'name':{'type':Sequelize[_0x6137('0x1')],'get':function(_0x97fa5){return this[_0x6137('0x2')](_0x6137('0x3'));}},'action':{'type':Sequelize[_0x6137('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x6137('0x5'),'integration',_0x6137('0x6'),_0x6137('0x7'),'urlForward','browser','bot',_0x6137('0x8')]],'msg':_0x6137('0x9')}},'comment':_0x6137('0x9')},'data1':{'type':Sequelize[_0x6137('0x4')](0x1000),'comment':_0x6137('0xa')},'data2':{'type':Sequelize[_0x6137('0x4')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x6137('0x4')](0x1000),'comment':_0x6137('0xb')},'data4':{'type':Sequelize[_0x6137('0x4')](0x1000),'comments':_0x6137('0xc')},'data5':{'type':Sequelize[_0x6137('0x4')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':_0x6137('0xd')},'data7':{'type':Sequelize[_0x6137('0xe')],'comments':_0x6137('0xf')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 46a835b..7ea1277 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 _0xf68f=['lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','error','stack','name','send','body','Action','catch','destroy','find','params','eml-format','bluebird','util','path','sox','to-csv','fs-extra'];(function(_0x1f09fa,_0x3265ca){var _0x197c8d=function(_0x91c3b){while(--_0x91c3b){_0x1f09fa['push'](_0x1f09fa['shift']());}};_0x197c8d(++_0x3265ca);}(_0xf68f,0x197));var _0xff68=function(_0x3c4c0a,_0x31d74c){_0x3c4c0a=_0x3c4c0a-0x0;var _0x5bd729=_0xf68f[_0x3c4c0a];return _0x5bd729;};'use strict';var emlformat=require(_0xff68('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xff68('0x1'));var Mustache=require('mustache');var util=require(_0xff68('0x2'));var path=require(_0xff68('0x3'));var sox=require(_0xff68('0x4'));var csv=require(_0xff68('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff68('0x6'));var _=require(_0xff68('0x7'));var squel=require('squel');var crypto=require(_0xff68('0x8'));var jsforce=require(_0xff68('0x9'));var deskjs=require(_0xff68('0xa'));var toCsv=require(_0xff68('0x5'));var querystring=require(_0xff68('0xb'));var Papa=require(_0xff68('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xff68('0xd'));var as=require(_0xff68('0xe'));var hardwareService=require(_0xff68('0xf'));var logger=require(_0xff68('0x10'))(_0xff68('0x11'));var utils=require(_0xff68('0x12'));var config=require(_0xff68('0x13'));var licenseUtil=require(_0xff68('0x14'));var db=require(_0xff68('0x15'))['db'];function respondWithStatusCode(_0x1db935,_0x538f1e){_0x538f1e=_0x538f1e||0xcc;return function(_0x34905c){if(_0x34905c){return _0x1db935[_0xff68('0x16')](_0x538f1e);}return _0x1db935[_0xff68('0x17')](_0x538f1e)[_0xff68('0x18')]();};}function respondWithResult(_0x81fe52,_0x39284a){_0x39284a=_0x39284a||0xc8;return function(_0x517975){if(_0x517975){return _0x81fe52['status'](_0x39284a)[_0xff68('0x19')](_0x517975);}};}function respondWithFilteredResult(_0x2ed6e8,_0x47550a){return function(_0xe9b74){if(_0xe9b74){var _0x1fa53d=typeof _0x47550a['offset']==='undefined'&&typeof _0x47550a[_0xff68('0x1a')]===_0xff68('0x1b');var _0x211497=_0xe9b74[_0xff68('0x1c')];var _0x7c517e=_0x1fa53d?0x0:_0x47550a[_0xff68('0x1d')];var _0x40dafb=_0x1fa53d?_0xe9b74['count']:_0x47550a['offset']+_0x47550a[_0xff68('0x1a')];var _0xdd65f9;if(_0x40dafb>=_0x211497){_0x40dafb=_0x211497;_0xdd65f9=0xc8;}else{_0xdd65f9=0xce;}_0x2ed6e8[_0xff68('0x17')](_0xdd65f9);return _0x2ed6e8[_0xff68('0x1e')]('Content-Range',_0x7c517e+'-'+_0x40dafb+'/'+_0x211497)['json'](_0xe9b74);}return null;};}function patchUpdates(_0x1c034a){return function(_0x599335){try{jsonpatch[_0xff68('0x1f')](_0x599335,_0x1c034a,!![]);}catch(_0x4ec569){return BPromise[_0xff68('0x20')](_0x4ec569);}return _0x599335[_0xff68('0x21')]();};}function saveUpdates(_0x480949,_0x4e116c){return function(_0x339649){if(_0x339649){return _0x339649[_0xff68('0x22')](_0x480949)['then'](function(_0x559a7f){return _0x559a7f;});}return null;};}function removeEntity(_0x55e101,_0x57e501){return function(_0x282012){if(_0x282012){return _0x282012['destroy']()[_0xff68('0x23')](function(){_0x55e101[_0xff68('0x17')](0xcc)[_0xff68('0x18')]();});}};}function handleEntityNotFound(_0x3668f7,_0x48dbf5){return function(_0xabd9c6){if(!_0xabd9c6){_0x3668f7[_0xff68('0x16')](0x194);}return _0xabd9c6;};}function handleError(_0x414a38,_0x12bc40){_0x12bc40=_0x12bc40||0x1f4;return function(_0x24ffd9){logger[_0xff68('0x24')](_0x24ffd9[_0xff68('0x25')]);if(_0x24ffd9['name']){delete _0x24ffd9[_0xff68('0x26')];}_0x414a38[_0xff68('0x17')](_0x12bc40)[_0xff68('0x27')](_0x24ffd9);};}exports[_0xff68('0x22')]=function(_0x28b129,_0x233a91){if(_0x28b129[_0xff68('0x28')]['id']){delete _0x28b129[_0xff68('0x28')]['id'];}return db[_0xff68('0x29')]['find']({'where':{'id':_0x28b129['params']['id']}})[_0xff68('0x23')](handleEntityNotFound(_0x233a91,null))['then'](saveUpdates(_0x28b129[_0xff68('0x28')],null))[_0xff68('0x23')](respondWithResult(_0x233a91,null))[_0xff68('0x2a')](handleError(_0x233a91,null));};exports[_0xff68('0x2b')]=function(_0x11ca18,_0x3769ce){return db[_0xff68('0x29')][_0xff68('0x2c')]({'where':{'id':_0x11ca18[_0xff68('0x2d')]['id']}})[_0xff68('0x23')](handleEntityNotFound(_0x3769ce,null))['then'](removeEntity(_0x3769ce,null))[_0xff68('0x2a')](handleError(_0x3769ce,null));};
\ No newline at end of file
+var _0x9e76=['send','body','Action','find','params','catch','eml-format','rimraf','zip-dir','bluebird','util','path','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','stack','name'];(function(_0x3b826d,_0x1d0b68){var _0x38e1b3=function(_0x314620){while(--_0x314620){_0x3b826d['push'](_0x3b826d['shift']());}};_0x38e1b3(++_0x1d0b68);}(_0x9e76,0x114));var _0x69e7=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x9e76[_0x1762b4];return _0x29beda;};'use strict';var emlformat=require(_0x69e7('0x0'));var rimraf=require(_0x69e7('0x1'));var zipdir=require(_0x69e7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x69e7('0x3'));var Mustache=require('mustache');var util=require(_0x69e7('0x4'));var path=require(_0x69e7('0x5'));var sox=require('sox');var csv=require(_0x69e7('0x6'));var ejs=require(_0x69e7('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x69e7('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x69e7('0x9'));var toCsv=require(_0x69e7('0x6'));var querystring=require(_0x69e7('0xa'));var Papa=require(_0x69e7('0xb'));var Redis=require(_0x69e7('0xc'));var authService=require(_0x69e7('0xd'));var qs=require(_0x69e7('0xe'));var as=require(_0x69e7('0xf'));var hardwareService=require(_0x69e7('0x10'));var logger=require(_0x69e7('0x11'))('api');var utils=require(_0x69e7('0x12'));var config=require(_0x69e7('0x13'));var licenseUtil=require(_0x69e7('0x14'));var db=require(_0x69e7('0x15'))['db'];function respondWithStatusCode(_0x344ee2,_0xc0478d){_0xc0478d=_0xc0478d||0xcc;return function(_0x4a0e23){if(_0x4a0e23){return _0x344ee2[_0x69e7('0x16')](_0xc0478d);}return _0x344ee2[_0x69e7('0x17')](_0xc0478d)[_0x69e7('0x18')]();};}function respondWithResult(_0xff9b77,_0x35eef4){_0x35eef4=_0x35eef4||0xc8;return function(_0x5650ea){if(_0x5650ea){return _0xff9b77[_0x69e7('0x17')](_0x35eef4)[_0x69e7('0x19')](_0x5650ea);}};}function respondWithFilteredResult(_0x233318,_0x533dca){return function(_0x165cca){if(_0x165cca){var _0x33c195=typeof _0x533dca[_0x69e7('0x1a')]===_0x69e7('0x1b')&&typeof _0x533dca[_0x69e7('0x1c')]==='undefined';var _0x41a5ac=_0x165cca[_0x69e7('0x1d')];var _0x1fc4d5=_0x33c195?0x0:_0x533dca[_0x69e7('0x1a')];var _0x50d52f=_0x33c195?_0x165cca[_0x69e7('0x1d')]:_0x533dca['offset']+_0x533dca[_0x69e7('0x1c')];var _0x19be00;if(_0x50d52f>=_0x41a5ac){_0x50d52f=_0x41a5ac;_0x19be00=0xc8;}else{_0x19be00=0xce;}_0x233318[_0x69e7('0x17')](_0x19be00);return _0x233318[_0x69e7('0x1e')]('Content-Range',_0x1fc4d5+'-'+_0x50d52f+'/'+_0x41a5ac)[_0x69e7('0x19')](_0x165cca);}return null;};}function patchUpdates(_0x4519dc){return function(_0x2b9024){try{jsonpatch[_0x69e7('0x1f')](_0x2b9024,_0x4519dc,!![]);}catch(_0x363774){return BPromise['reject'](_0x363774);}return _0x2b9024[_0x69e7('0x20')]();};}function saveUpdates(_0x5371ef,_0x4e9038){return function(_0x16f3f5){if(_0x16f3f5){return _0x16f3f5[_0x69e7('0x21')](_0x5371ef)[_0x69e7('0x22')](function(_0x547b06){return _0x547b06;});}return null;};}function removeEntity(_0xac79a9,_0x86a808){return function(_0x45ab24){if(_0x45ab24){return _0x45ab24[_0x69e7('0x23')]()['then'](function(){_0xac79a9[_0x69e7('0x17')](0xcc)[_0x69e7('0x18')]();});}};}function handleEntityNotFound(_0x2709fc,_0x48d0e9){return function(_0x48adfa){if(!_0x48adfa){_0x2709fc[_0x69e7('0x16')](0x194);}return _0x48adfa;};}function handleError(_0x117efc,_0x1fa0af){_0x1fa0af=_0x1fa0af||0x1f4;return function(_0x188ece){logger[_0x69e7('0x24')](_0x188ece[_0x69e7('0x25')]);if(_0x188ece[_0x69e7('0x26')]){delete _0x188ece[_0x69e7('0x26')];}_0x117efc[_0x69e7('0x17')](_0x1fa0af)[_0x69e7('0x27')](_0x188ece);};}exports[_0x69e7('0x21')]=function(_0x519a47,_0x54af35){if(_0x519a47[_0x69e7('0x28')]['id']){delete _0x519a47[_0x69e7('0x28')]['id'];}return db[_0x69e7('0x29')][_0x69e7('0x2a')]({'where':{'id':_0x519a47[_0x69e7('0x2b')]['id']}})[_0x69e7('0x22')](handleEntityNotFound(_0x54af35,null))[_0x69e7('0x22')](saveUpdates(_0x519a47['body'],null))[_0x69e7('0x22')](respondWithResult(_0x54af35,null))['catch'](handleError(_0x54af35,null));};exports[_0x69e7('0x23')]=function(_0x3f2261,_0x9dcc3e){return db['Action'][_0x69e7('0x2a')]({'where':{'id':_0x3f2261[_0x69e7('0x2b')]['id']}})['then'](handleEntityNotFound(_0x9dcc3e,null))[_0x69e7('0x22')](removeEntity(_0x9dcc3e,null))[_0x69e7('0x2c')](handleError(_0x9dcc3e,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index b1ac685..6144453 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 _0xddc7=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','Action','tools_actions'];(function(_0x576c74,_0x52aacc){var _0x3c6c9b=function(_0x4544e3){while(--_0x4544e3){_0x576c74['push'](_0x576c74['shift']());}};_0x3c6c9b(++_0x52aacc);}(_0xddc7,0x1b0));var _0x7ddc=function(_0x59ee41,_0xaf7db8){_0x59ee41=_0x59ee41-0x0;var _0x3ecd3e=_0xddc7[_0x59ee41];return _0x3ecd3e;};'use strict';var _=require(_0x7ddc('0x0'));var util=require(_0x7ddc('0x1'));var logger=require(_0x7ddc('0x2'))('api');var moment=require(_0x7ddc('0x3'));var BPromise=require(_0x7ddc('0x4'));var rp=require(_0x7ddc('0x5'));var fs=require('fs');var path=require(_0x7ddc('0x6'));var rimraf=require(_0x7ddc('0x7'));var config=require(_0x7ddc('0x8'));var attributes=require('./action.attributes');module['exports']=function(_0x531548,_0xbde15){return _0x531548[_0x7ddc('0x9')](_0x7ddc('0xa'),attributes,{'tableName':_0x7ddc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5a41=['tools_actions','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./action.attributes','define'];(function(_0x2f3d29,_0x150e7b){var _0x53d69d=function(_0x45f6ec){while(--_0x45f6ec){_0x2f3d29['push'](_0x2f3d29['shift']());}};_0x53d69d(++_0x150e7b);}(_0x5a41,0x1b1));var _0x15a4=function(_0x3d09e2,_0x58e784){_0x3d09e2=_0x3d09e2-0x0;var _0x5d03cd=_0x5a41[_0x3d09e2];return _0x5d03cd;};'use strict';var _=require(_0x15a4('0x0'));var util=require(_0x15a4('0x1'));var logger=require(_0x15a4('0x2'))(_0x15a4('0x3'));var moment=require(_0x15a4('0x4'));var BPromise=require('bluebird');var rp=require(_0x15a4('0x5'));var fs=require('fs');var path=require(_0x15a4('0x6'));var rimraf=require(_0x15a4('0x7'));var config=require(_0x15a4('0x8'));var attributes=require(_0x15a4('0x9'));module['exports']=function(_0x28841f,_0x209552){return _0x28841f[_0x15a4('0xa')]('Action',attributes,{'tableName':_0x15a4('0xb'),'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 e7e0de0..d2d7a83 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x523aab,_0x3a9c5e){var _0x4346ea=function(_0x1a4e5b){while(--_0x1a4e5b){_0x523aab['push'](_0x523aab['shift']());}};_0x4346ea(++_0x3a9c5e);}(_0x1261,0x144));var _0x1126=function(_0x559cc4,_0x44ce57){_0x559cc4=_0x559cc4-0x0;var _0x138971=_0x1261[_0x559cc4];return _0x138971;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+var _0x814b=['info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x814b,0x1a2));var _0xb814=function(_0x27a3cb,_0x4af597){_0x27a3cb=_0x27a3cb-0x0;var _0x54ff38=_0x814b[_0x27a3cb];return _0x54ff38;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index dc50ac1..c948935 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 _0x0310=['/:id','isAuthenticated','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','put'];(function(_0x3c6ec9,_0x40e417){var _0x178f0c=function(_0x280a1e){while(--_0x280a1e){_0x3c6ec9['push'](_0x3c6ec9['shift']());}};_0x178f0c(++_0x40e417);}(_0x0310,0x8b));var _0x0031=function(_0x20ae09,_0x5df3e3){_0x20ae09=_0x20ae09-0x0;var _0x180d2d=_0x0310[_0x20ae09];return _0x180d2d;};'use strict';var multer=require(_0x0031('0x0'));var util=require(_0x0031('0x1'));var path=require(_0x0031('0x2'));var timeout=require(_0x0031('0x3'));var express=require(_0x0031('0x4'));var router=express[_0x0031('0x5')]();var fs_extra=require(_0x0031('0x6'));var auth=require(_0x0031('0x7'));var interaction=require(_0x0031('0x8'));var config=require('../../config/environment');var controller=require(_0x0031('0x9'));router[_0x0031('0xa')](_0x0031('0xb'),auth[_0x0031('0xc')](),controller[_0x0031('0xd')]);router['delete']('/:id',auth[_0x0031('0xc')](),controller['destroy']);module[_0x0031('0xe')]=router;
\ No newline at end of file
+var _0xabbf=['exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','/:id','isAuthenticated','delete'];(function(_0x2855b9,_0x53188f){var _0x70ea14=function(_0x191616){while(--_0x191616){_0x2855b9['push'](_0x2855b9['shift']());}};_0x70ea14(++_0x53188f);}(_0xabbf,0x1c4));var _0xfabb=function(_0x25c988,_0xce8221){_0x25c988=_0x25c988-0x0;var _0x45fcc2=_0xabbf[_0x25c988];return _0x45fcc2;};'use strict';var multer=require('multer');var util=require(_0xfabb('0x0'));var path=require(_0xfabb('0x1'));var timeout=require('connect-timeout');var express=require(_0xfabb('0x2'));var router=express['Router']();var fs_extra=require(_0xfabb('0x3'));var auth=require(_0xfabb('0x4'));var interaction=require(_0xfabb('0x5'));var config=require('../../config/environment');var controller=require(_0xfabb('0x6'));router['put'](_0xfabb('0x7'),auth[_0xfabb('0x8')](),controller['update']);router[_0xfabb('0x9')]('/:id',auth[_0xfabb('0x8')](),controller['destroy']);module[_0xfabb('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 758028b..1e56c61 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 _0x425d=['sequelize','STRING','TEXT'];(function(_0x1ee109,_0x342d7d){var _0x968a7e=function(_0x5c40ae){while(--_0x5c40ae){_0x1ee109['push'](_0x1ee109['shift']());}};_0x968a7e(++_0x342d7d);}(_0x425d,0x1e0));var _0xd425=function(_0x1d7bd9,_0x4dc87f){_0x1d7bd9=_0x1d7bd9-0x0;var _0x15384e=_0x425d[_0x1d7bd9];return _0x15384e;};'use strict';var Sequelize=require(_0xd425('0x0'));module['exports']={'name':{'type':Sequelize[_0xd425('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd425('0x1')]},'parent':{'type':Sequelize[_0xd425('0x1')]},'table':{'type':Sequelize[_0xd425('0x1')]},'conditions':{'type':Sequelize[_0xd425('0x2')]},'joins':{'type':Sequelize[_0xd425('0x2')]}};
\ No newline at end of file
+var _0xafc4=['sequelize','STRING','TEXT'];(function(_0x27530d,_0x46480a){var _0x59e561=function(_0x395fe9){while(--_0x395fe9){_0x27530d['push'](_0x27530d['shift']());}};_0x59e561(++_0x46480a);}(_0xafc4,0x69));var _0x4afc=function(_0x3469b4,_0x3cc80d){_0x3469b4=_0x3469b4-0x0;var _0x263397=_0xafc4[_0x3469b4];return _0x263397;};'use strict';var Sequelize=require(_0x4afc('0x0'));module['exports']={'name':{'type':Sequelize[_0x4afc('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4afc('0x1')]},'table':{'type':Sequelize[_0x4afc('0x1')]},'conditions':{'type':Sequelize[_0x4afc('0x2')]},'joins':{'type':Sequelize[_0x4afc('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index ac0b66d..a7a8547 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 _0xb480=['IS\x20NOT\x20EMPTY','rules','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','MetricId','metric','function','replace','format','orderBy','DESC','field','alias','parse','joins','parentKey','foreignTable','table','foreignKey','conditions','clone','debug','sequelize','toString','QueryTypes','SELECT','join','left_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','HOUR(%s)','operator','from','%s.%s\x20=\x20%s.%s','output','web','fullPath','randomstring','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../files/reports','savename','runReport','Sequelize','groupBy','Limited\x20Query:','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','end','json','offset','undefined','count','limit','status','set','apply','reject','update','then','get','UserProfileResource','stack','name','send','AnalyticCustomReport','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','rows','catch','show','params','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','CustomReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','preview','right_join','cross_join','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY'];(function(_0x2158c9,_0x5d139e){var _0xe2a6f0=function(_0x25e08d){while(--_0x25e08d){_0x2158c9['push'](_0x2158c9['shift']());}};_0xe2a6f0(++_0x5d139e);}(_0xb480,0x186));var _0x0b48=function(_0x27c00a,_0x5c3f23){_0x27c00a=_0x27c00a-0x0;var _0x1ad46d=_0xb480[_0x27c00a];return _0x1ad46d;};'use strict';var emlformat=require(_0x0b48('0x0'));var rimraf=require(_0x0b48('0x1'));var zipdir=require(_0x0b48('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0b48('0x3'));var BPromise=require(_0x0b48('0x4'));var Mustache=require(_0x0b48('0x5'));var util=require(_0x0b48('0x6'));var path=require('path');var sox=require(_0x0b48('0x7'));var csv=require(_0x0b48('0x8'));var ejs=require(_0x0b48('0x9'));var fs=require('fs');var fs_extra=require(_0x0b48('0xa'));var _=require(_0x0b48('0xb'));var squel=require(_0x0b48('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0b48('0xd'));var toCsv=require(_0x0b48('0x8'));var querystring=require(_0x0b48('0xe'));var Papa=require('papaparse');var Redis=require(_0x0b48('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x0b48('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0b48('0x11'))(_0x0b48('0x12'));var utils=require(_0x0b48('0x13'));var config=require(_0x0b48('0x14'));var licenseUtil=require(_0x0b48('0x15'));var db=require(_0x0b48('0x16'))['db'];var dbH=require(_0x0b48('0x16'))[_0x0b48('0x17')];function respondWithStatusCode(_0x50bd92,_0x2014e9){_0x2014e9=_0x2014e9||0xcc;return function(_0x584a43){if(_0x584a43){return _0x50bd92[_0x0b48('0x18')](_0x2014e9);}return _0x50bd92['status'](_0x2014e9)[_0x0b48('0x19')]();};}function respondWithResult(_0xd09229,_0x14ebd9){_0x14ebd9=_0x14ebd9||0xc8;return function(_0x552fea){if(_0x552fea){return _0xd09229['status'](_0x14ebd9)[_0x0b48('0x1a')](_0x552fea);}};}function respondWithFilteredResult(_0x396950,_0x33abe6){return function(_0x12605b){if(_0x12605b){var _0x5eab15=typeof _0x33abe6[_0x0b48('0x1b')]==='undefined'&&typeof _0x33abe6['limit']===_0x0b48('0x1c');var _0x11bd3b=_0x12605b[_0x0b48('0x1d')];var _0x34ef84=_0x5eab15?0x0:_0x33abe6['offset'];var _0x12a70d=_0x5eab15?_0x12605b[_0x0b48('0x1d')]:_0x33abe6[_0x0b48('0x1b')]+_0x33abe6[_0x0b48('0x1e')];var _0x1a23a5;if(_0x12a70d>=_0x11bd3b){_0x12a70d=_0x11bd3b;_0x1a23a5=0xc8;}else{_0x1a23a5=0xce;}_0x396950[_0x0b48('0x1f')](_0x1a23a5);return _0x396950[_0x0b48('0x20')]('Content-Range',_0x34ef84+'-'+_0x12a70d+'/'+_0x11bd3b)[_0x0b48('0x1a')](_0x12605b);}return null;};}function patchUpdates(_0x5ebbb1){return function(_0x22a3e7){try{jsonpatch[_0x0b48('0x21')](_0x22a3e7,_0x5ebbb1,!![]);}catch(_0x404c0f){return BPromise[_0x0b48('0x22')](_0x404c0f);}return _0x22a3e7['save']();};}function saveUpdates(_0x2e78fb,_0x84bc5c){return function(_0xc31d79){if(_0xc31d79){return _0xc31d79[_0x0b48('0x23')](_0x2e78fb)['then'](function(_0x130f44){return _0x130f44;});}return null;};}function removeEntity(_0x20424c,_0x51ff47){return function(_0x43c756){if(_0x43c756){return _0x43c756['destroy']()[_0x0b48('0x24')](function(){var _0x5b70ec=_0x43c756[_0x0b48('0x25')]({'plain':!![]});var _0x5babb2='CustomReports';return db[_0x0b48('0x26')]['destroy']({'where':{'type':_0x5babb2,'resourceId':_0x5b70ec['id']}})[_0x0b48('0x24')](function(){return _0x43c756;});})[_0x0b48('0x24')](function(){_0x20424c['status'](0xcc)[_0x0b48('0x19')]();});}};}function handleEntityNotFound(_0x5a3041,_0x193fff){return function(_0x5a1d2b){if(!_0x5a1d2b){_0x5a3041[_0x0b48('0x18')](0x194);}return _0x5a1d2b;};}function handleError(_0x1173c2,_0x41f4b5){_0x41f4b5=_0x41f4b5||0x1f4;return function(_0x550a84){logger['error'](_0x550a84[_0x0b48('0x27')]);if(_0x550a84[_0x0b48('0x28')]){delete _0x550a84['name'];}_0x1173c2[_0x0b48('0x1f')](_0x41f4b5)[_0x0b48('0x29')](_0x550a84);};}exports['index']=function(_0x57d3e2,_0x4625da){var _0x2c79ab={},_0x9fa79a={},_0x1b851f={'count':0x0,'rows':[]};var _0x25691d=_['map'](db[_0x0b48('0x2a')][_0x0b48('0x2b')],function(_0x4d02b5){return{'name':_0x4d02b5['fieldName'],'type':_0x4d02b5['type'][_0x0b48('0x2c')]};});_0x9fa79a[_0x0b48('0x2d')]=_[_0x0b48('0x2e')](_0x25691d,'name');_0x9fa79a[_0x0b48('0x2f')]=_[_0x0b48('0x30')](_0x57d3e2[_0x0b48('0x2f')]);_0x9fa79a[_0x0b48('0x31')]=_[_0x0b48('0x32')](_0x9fa79a[_0x0b48('0x2d')],_0x9fa79a[_0x0b48('0x2f')]);_0x2c79ab[_0x0b48('0x33')]=_['intersection'](_0x9fa79a[_0x0b48('0x2d')],qs[_0x0b48('0x34')](_0x57d3e2[_0x0b48('0x2f')][_0x0b48('0x34')]));_0x2c79ab[_0x0b48('0x33')]=_0x2c79ab[_0x0b48('0x33')][_0x0b48('0x35')]?_0x2c79ab[_0x0b48('0x33')]:_0x9fa79a[_0x0b48('0x2d')];if(!_0x57d3e2[_0x0b48('0x2f')][_0x0b48('0x36')](_0x0b48('0x37'))){_0x2c79ab['limit']=qs[_0x0b48('0x1e')](_0x57d3e2['query'][_0x0b48('0x1e')]);_0x2c79ab[_0x0b48('0x1b')]=qs[_0x0b48('0x1b')](_0x57d3e2['query'][_0x0b48('0x1b')]);}_0x2c79ab[_0x0b48('0x38')]=qs[_0x0b48('0x39')](_0x57d3e2['query'][_0x0b48('0x39')]);_0x2c79ab[_0x0b48('0x3a')]=qs[_0x0b48('0x31')](_[_0x0b48('0x3b')](_0x57d3e2[_0x0b48('0x2f')],_0x9fa79a[_0x0b48('0x31')]),_0x25691d);if(_0x57d3e2['query'][_0x0b48('0x3c')]){_0x2c79ab[_0x0b48('0x3a')]=_[_0x0b48('0x3d')](_0x2c79ab[_0x0b48('0x3a')],{'$or':_[_0x0b48('0x2e')](_0x25691d,function(_0x32f748){if(_0x32f748[_0x0b48('0x3e')]!==_0x0b48('0x3f')){var _0x509c86={};_0x509c86[_0x32f748['name']]={'$like':'%'+_0x57d3e2[_0x0b48('0x2f')][_0x0b48('0x3c')]+'%'};return _0x509c86;}})});}_0x2c79ab=_[_0x0b48('0x3d')]({},_0x2c79ab,_0x57d3e2[_0x0b48('0x40')]);var _0x48c78d={'where':_0x2c79ab['where']};return db[_0x0b48('0x2a')]['count'](_0x48c78d)[_0x0b48('0x24')](function(_0x12c284){_0x1b851f[_0x0b48('0x1d')]=_0x12c284;if(_0x57d3e2['query']['includeAll']){_0x2c79ab[_0x0b48('0x41')]=[{'all':!![]}];}return db[_0x0b48('0x2a')]['findAll'](_0x2c79ab);})['then'](function(_0xa17b36){_0x1b851f[_0x0b48('0x42')]=_0xa17b36;return _0x1b851f;})['then'](respondWithFilteredResult(_0x4625da,_0x2c79ab))[_0x0b48('0x43')](handleError(_0x4625da,null));};exports[_0x0b48('0x44')]=function(_0x11b94a,_0x123790){var _0x3cc896={'raw':![],'where':{'id':_0x11b94a[_0x0b48('0x45')]['id']}},_0x3b5f5b={};_0x3b5f5b[_0x0b48('0x2d')]=_['keys'](db['AnalyticCustomReport'][_0x0b48('0x2b')]);_0x3b5f5b['query']=_[_0x0b48('0x30')](_0x11b94a['query']);_0x3b5f5b[_0x0b48('0x31')]=_[_0x0b48('0x32')](_0x3b5f5b['model'],_0x3b5f5b[_0x0b48('0x2f')]);_0x3cc896[_0x0b48('0x33')]=_[_0x0b48('0x32')](_0x3b5f5b[_0x0b48('0x2d')],qs[_0x0b48('0x34')](_0x11b94a[_0x0b48('0x2f')]['fields']));_0x3cc896[_0x0b48('0x33')]=_0x3cc896[_0x0b48('0x33')][_0x0b48('0x35')]?_0x3cc896['attributes']:_0x3b5f5b[_0x0b48('0x2d')];if(_0x11b94a[_0x0b48('0x2f')][_0x0b48('0x46')]){_0x3cc896[_0x0b48('0x41')]=[{'all':!![]}];}_0x3cc896=_[_0x0b48('0x3d')]({},_0x3cc896,_0x11b94a[_0x0b48('0x40')]);return db[_0x0b48('0x2a')][_0x0b48('0x47')](_0x3cc896)[_0x0b48('0x24')](handleEntityNotFound(_0x123790,null))[_0x0b48('0x24')](respondWithResult(_0x123790,null))[_0x0b48('0x43')](handleError(_0x123790,null));};exports[_0x0b48('0x48')]=function(_0x5db271,_0x2b77f4){return db[_0x0b48('0x2a')][_0x0b48('0x48')](_0x5db271[_0x0b48('0x49')],{})['then'](function(_0x2b5608){var _0x563ebf=_0x5db271['user'][_0x0b48('0x25')]({'plain':!![]});if(!_0x563ebf)throw new Error(_0x0b48('0x4a'));if(_0x563ebf[_0x0b48('0x4b')]===_0x0b48('0x4c')){var _0x5db15a=_0x2b5608[_0x0b48('0x25')]({'plain':!![]});var _0x37c331=_0x0b48('0x4d');return db[_0x0b48('0x4e')][_0x0b48('0x47')]({'where':{'name':_0x37c331,'userProfileId':_0x563ebf[_0x0b48('0x4f')]},'raw':!![]})[_0x0b48('0x24')](function(_0x4fc175){if(_0x4fc175&&_0x4fc175[_0x0b48('0x50')]===0x0){return db[_0x0b48('0x26')][_0x0b48('0x48')]({'name':_0x5db15a[_0x0b48('0x28')],'resourceId':_0x5db15a['id'],'type':_0x0b48('0x51'),'sectionId':_0x4fc175['id']},{})['then'](function(){return _0x2b5608;});}else{return _0x2b5608;}})['catch'](function(_0x389dfb){logger[_0x0b48('0x52')](_0x0b48('0x53'),_0x389dfb);throw _0x389dfb;});}return _0x2b5608;})['then'](respondWithResult(_0x2b77f4,0xc9))[_0x0b48('0x43')](handleError(_0x2b77f4,null));};exports[_0x0b48('0x23')]=function(_0x23c870,_0x3ae0f2){if(_0x23c870['body']['id']){delete _0x23c870[_0x0b48('0x49')]['id'];}return db['AnalyticCustomReport'][_0x0b48('0x47')]({'where':{'id':_0x23c870[_0x0b48('0x45')]['id']}})['then'](handleEntityNotFound(_0x3ae0f2,null))[_0x0b48('0x24')](saveUpdates(_0x23c870[_0x0b48('0x49')],null))[_0x0b48('0x24')](respondWithResult(_0x3ae0f2,null))[_0x0b48('0x43')](handleError(_0x3ae0f2,null));};exports[_0x0b48('0x54')]=function(_0x31b094,_0x138299){return db[_0x0b48('0x2a')][_0x0b48('0x47')]({'where':{'id':_0x31b094[_0x0b48('0x45')]['id']}})['then'](handleEntityNotFound(_0x138299,null))[_0x0b48('0x24')](removeEntity(_0x138299,null))['catch'](handleError(_0x138299,null));};exports[_0x0b48('0x55')]=function(_0x4dc6b3,_0x253b43){var _0x153ebe=0xa;var _0x1a25df=['join','left_join',_0x0b48('0x56'),_0x0b48('0x57')];var _0x21e6cb={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x0b48('0x58'),'MIN':_0x0b48('0x59'),'AVG':_0x0b48('0x5a'),'GROUP_CONCAT':_0x0b48('0x5b'),'GROUP_CONCAT ASC':_0x0b48('0x5c'),'GROUP_CONCAT DESC':_0x0b48('0x5d')};var _0x26dff6={'SEC_TO_TIME':_0x0b48('0x5e'),'DATE':_0x0b48('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x0b48('0x60'),'UNIX_TIMESTAMP':_0x0b48('0x61')};var _0x8841ad=function(_0x3716d9){return!_[_0x0b48('0x62')]([_0x0b48('0x63'),_0x0b48('0x64'),_0x0b48('0x65'),_0x0b48('0x66')],_0x3716d9);};var _0x33bfb8=function(_0xb5b9f1){if(!_0xb5b9f1||!_0xb5b9f1['rules'][_0x0b48('0x35')]){return'';}for(var _0x14822a='(',_0x44963e=0x0;_0x44963e<_0xb5b9f1[_0x0b48('0x67')]['length'];_0x44963e+=0x1){_0x44963e>0x0&&(_0x14822a+='\x20'+_0xb5b9f1['operator']+'\x20');_0x14822a+=_0xb5b9f1['rules'][_0x44963e]['group']?_0x33bfb8(_0xb5b9f1[_0x0b48('0x67')][_0x44963e][_0x0b48('0x68')]):_0xb5b9f1[_0x0b48('0x67')][_0x44963e]['field']+'\x20'+_0xb5b9f1['rules'][_0x44963e][_0x0b48('0x69')]+(_0x8841ad(_0xb5b9f1['rules'][_0x44963e]['condition'])?'\x20'+_0xb5b9f1[_0x0b48('0x67')][_0x44963e][_0x0b48('0x6a')]:'');}return _0x14822a+')';};var _0x1e6cf9={'where':{'id':_0x4dc6b3[_0x0b48('0x45')]['id']}},_0x3e2ec7,_0x2d0cc4,_0x35dc43,_0x6434d8,_0x45f649;_0x1e6cf9=_[_0x0b48('0x3d')]({},_0x1e6cf9,_0x4dc6b3[_0x0b48('0x40')]);return db[_0x0b48('0x2a')]['find'](_0x1e6cf9)['then'](function(_0x5006a4){if(_0x5006a4){_0x3e2ec7=_0x5006a4;return _0x5006a4[_0x0b48('0x6b')]();}return null;})[_0x0b48('0x24')](function(_0x346827){if(_0x346827){if(!_0x346827[_0x0b48('0x35')]){throw new db['Sequelize'][(_0x0b48('0x6c'))](_0x0b48('0x6d'),0x193);}_0x2d0cc4=_0x346827;return db[_0x0b48('0x6e')][_0x0b48('0x6f')]({'raw':!![]});}return null;})[_0x0b48('0x24')](function(_0x28a50f){if(_0x28a50f){_0x35dc43=_[_0x0b48('0x70')](_0x28a50f,'id');var _0x59dbb6;var _0x216d1e=squel[_0x0b48('0x71')]();_0x216d1e['from'](_0x3e2ec7['table']);for(var _0x225395=0x0;_0x225395<_0x2d0cc4['length'];_0x225395+=0x1){_0x59dbb6=_0x2d0cc4[_0x225395][_0x0b48('0x72')]?_0x35dc43[_0x2d0cc4[_0x225395]['MetricId']][_0x0b48('0x73')]:_0x2d0cc4[_0x225395]['field'];_0x59dbb6=_0x2d0cc4[_0x225395][_0x0b48('0x74')]?_[_0x0b48('0x75')](_0x21e6cb[_0x2d0cc4[_0x225395][_0x0b48('0x74')]],'%s',_0x59dbb6):_0x59dbb6;_0x59dbb6=_0x2d0cc4[_0x225395][_0x0b48('0x76')]?_[_0x0b48('0x75')](_0x26dff6[_0x2d0cc4[_0x225395]['format']],'%s',_0x59dbb6):_0x59dbb6;if(_0x2d0cc4[_0x225395]['groupBy']){_0x216d1e['group'](_0x59dbb6);}_0x2d0cc4[_0x225395]['orderBy']&&_0x216d1e[_0x0b48('0x38')](_0x59dbb6,_0x2d0cc4[_0x225395][_0x0b48('0x77')]===_0x0b48('0x78')?![]:!![]);_0x216d1e[_0x0b48('0x79')](_0x59dbb6,_0x2d0cc4[_0x225395][_0x0b48('0x7a')]||_0x59dbb6);}if(_0x3e2ec7['joins']){_0x3e2ec7['joins']=JSON[_0x0b48('0x7b')](_0x3e2ec7['joins']);for(var _0x2b32f5=0x0;_0x2b32f5<_0x3e2ec7['joins'][_0x0b48('0x35')];_0x2b32f5+=0x1){if(_0x3e2ec7['joins'][_0x2b32f5][_0x0b48('0x3e')]&&_['includes'](_0x1a25df,_0x3e2ec7[_0x0b48('0x7c')][_0x2b32f5][_0x0b48('0x3e')])&&_0x3e2ec7[_0x0b48('0x7c')][_0x2b32f5][_0x0b48('0x7d')]&&_0x3e2ec7[_0x0b48('0x7c')][_0x2b32f5][_0x0b48('0x7e')]&&_0x3e2ec7[_0x0b48('0x7c')][_0x2b32f5]['foreignKey']){_0x216d1e[_0x3e2ec7[_0x0b48('0x7c')][_0x2b32f5][_0x0b48('0x3e')]](_0x3e2ec7[_0x0b48('0x7c')][_0x2b32f5]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3e2ec7[_0x0b48('0x7f')],_0x3e2ec7[_0x0b48('0x7c')][_0x2b32f5][_0x0b48('0x7d')],_0x3e2ec7[_0x0b48('0x7c')][_0x2b32f5][_0x0b48('0x7e')],_0x3e2ec7['joins'][_0x2b32f5][_0x0b48('0x80')]));}}}if(_0x3e2ec7[_0x0b48('0x81')]){_0x3e2ec7[_0x0b48('0x81')]=JSON[_0x0b48('0x7b')](_0x3e2ec7['conditions']);_0x216d1e[_0x0b48('0x3a')](_0x33bfb8(_0x3e2ec7['conditions'][_0x0b48('0x68')]));}_0x45f649=_0x216d1e[_0x0b48('0x82')]();_0x216d1e[_0x0b48('0x1e')](_0x153ebe);_0x216d1e[_0x0b48('0x1b')](0x0);logger[_0x0b48('0x83')]('Limited\x20Query:',_0x216d1e['toString']());return dbH[_0x0b48('0x84')]['query'](_0x216d1e[_0x0b48('0x85')](),{'type':dbH[_0x0b48('0x84')][_0x0b48('0x86')][_0x0b48('0x87')]});}})[_0x0b48('0x24')](respondWithResult(_0x253b43,null))[_0x0b48('0x43')](handleError(_0x253b43,null));};function runReport(_0x4fbcbe,_0x18e8e6,_0x482d30){var _0x4c47bc=_0x18e8e6[_0x0b48('0x28')];var _0xc2ddbe=0xa;var _0xe163d6=[_0x0b48('0x88'),_0x0b48('0x89'),_0x0b48('0x56'),_0x0b48('0x57')];var _0x4909c4={'SUM':_0x0b48('0x8a'),'COUNT':_0x0b48('0x8b'),'COUNT DISTINCT':_0x0b48('0x8c'),'MAX':_0x0b48('0x58'),'MIN':_0x0b48('0x59'),'AVG':_0x0b48('0x5a'),'GROUP_CONCAT':_0x0b48('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x0b48('0x5d')};var _0xd8ff16={'SEC_TO_TIME':_0x0b48('0x5e'),'DATE':_0x0b48('0x5f'),'HOUR':_0x0b48('0x8d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x0b48('0x61')};var _0x1da37b=function(_0x10e039){return!_[_0x0b48('0x62')]([_0x0b48('0x63'),'IS\x20NOT\x20NULL',_0x0b48('0x65'),_0x0b48('0x66')],_0x10e039);};var _0x510de5=function(_0x18d3d4){if(!_0x18d3d4||!_0x18d3d4[_0x0b48('0x67')][_0x0b48('0x35')]){return'';}for(var _0x583ff2='(',_0x1f2323=0x0;_0x1f2323<_0x18d3d4[_0x0b48('0x67')][_0x0b48('0x35')];_0x1f2323+=0x1){_0x1f2323>0x0&&(_0x583ff2+='\x20'+_0x18d3d4[_0x0b48('0x8e')]+'\x20');_0x583ff2+=_0x18d3d4[_0x0b48('0x67')][_0x1f2323][_0x0b48('0x68')]?_0x510de5(_0x18d3d4[_0x0b48('0x67')][_0x1f2323][_0x0b48('0x68')]):_0x18d3d4[_0x0b48('0x67')][_0x1f2323][_0x0b48('0x79')]+'\x20'+_0x18d3d4[_0x0b48('0x67')][_0x1f2323][_0x0b48('0x69')]+(_0x1da37b(_0x18d3d4[_0x0b48('0x67')][_0x1f2323]['condition'])?'\x20'+_0x18d3d4['rules'][_0x1f2323][_0x0b48('0x6a')]:'');}return _0x583ff2+')';};var _0xa7434c={'where':{'id':_0x4fbcbe['id']}},_0x5aec87,_0x336303,_0x5368f3,_0x404f4b,_0x2e6f31;_0xa7434c=_[_0x0b48('0x3d')]({},_0xa7434c,_0x482d30);return db[_0x0b48('0x2a')][_0x0b48('0x47')](_0xa7434c)[_0x0b48('0x24')](function(_0xb019ba){if(_0xb019ba){_0x5aec87=_0xb019ba;return _0xb019ba['getFields']();}return null;})[_0x0b48('0x24')](function(_0x530436){if(_0x530436){if(!_0x530436['length']){throw new db['Sequelize'][(_0x0b48('0x6c'))](_0x0b48('0x6d'),0x193);}_0x336303=_0x530436;return db[_0x0b48('0x6e')][_0x0b48('0x6f')]({'raw':!![]});}return null;})[_0x0b48('0x24')](function(_0x5ee9f1){if(_0x5ee9f1){_0x5368f3=_['keyBy'](_0x5ee9f1,'id');var _0x37b793;var _0x4377bc=squel['select']();_0x4377bc[_0x0b48('0x8f')](_0x5aec87[_0x0b48('0x7f')]);for(var _0x3b295d=0x0;_0x3b295d<_0x336303[_0x0b48('0x35')];_0x3b295d+=0x1){_0x37b793=_0x336303[_0x3b295d][_0x0b48('0x72')]?_0x5368f3[_0x336303[_0x3b295d][_0x0b48('0x72')]][_0x0b48('0x73')]:_0x336303[_0x3b295d][_0x0b48('0x79')];_0x37b793=_0x336303[_0x3b295d][_0x0b48('0x74')]?_['replace'](_0x4909c4[_0x336303[_0x3b295d][_0x0b48('0x74')]],'%s',_0x37b793):_0x37b793;_0x37b793=_0x336303[_0x3b295d][_0x0b48('0x76')]?_[_0x0b48('0x75')](_0xd8ff16[_0x336303[_0x3b295d][_0x0b48('0x76')]],'%s',_0x37b793):_0x37b793;if(_0x336303[_0x3b295d]['groupBy']){_0x4377bc[_0x0b48('0x68')](_0x37b793);}_0x336303[_0x3b295d][_0x0b48('0x77')]&&_0x4377bc['order'](_0x37b793,_0x336303[_0x3b295d]['orderBy']===_0x0b48('0x78')?![]:!![]);_0x4377bc[_0x0b48('0x79')](_0x37b793,_0x336303[_0x3b295d][_0x0b48('0x7a')]||_0x37b793);}if(_0x5aec87[_0x0b48('0x7c')]){_0x5aec87[_0x0b48('0x7c')]=JSON[_0x0b48('0x7b')](_0x5aec87[_0x0b48('0x7c')]);for(var _0xb36097=0x0;_0xb36097<_0x5aec87[_0x0b48('0x7c')][_0x0b48('0x35')];_0xb36097+=0x1){if(_0x5aec87[_0x0b48('0x7c')][_0xb36097]['type']&&_[_0x0b48('0x62')](_0xe163d6,_0x5aec87[_0x0b48('0x7c')][_0xb36097][_0x0b48('0x3e')])&&_0x5aec87[_0x0b48('0x7c')][_0xb36097][_0x0b48('0x7d')]&&_0x5aec87[_0x0b48('0x7c')][_0xb36097]['foreignTable']&&_0x5aec87[_0x0b48('0x7c')][_0xb36097][_0x0b48('0x80')]){_0x4377bc[_0x5aec87[_0x0b48('0x7c')][_0xb36097][_0x0b48('0x3e')]](_0x5aec87[_0x0b48('0x7c')][_0xb36097][_0x0b48('0x7e')],null,util[_0x0b48('0x76')](_0x0b48('0x90'),_0x5aec87[_0x0b48('0x7f')],_0x5aec87['joins'][_0xb36097][_0x0b48('0x7d')],_0x5aec87['joins'][_0xb36097][_0x0b48('0x7e')],_0x5aec87[_0x0b48('0x7c')][_0xb36097][_0x0b48('0x80')]));}}}if(_0x5aec87[_0x0b48('0x81')]){_0x5aec87['conditions']=JSON[_0x0b48('0x7b')](_0x5aec87[_0x0b48('0x81')]);_0x4377bc[_0x0b48('0x3a')](_0x510de5(_0x5aec87[_0x0b48('0x81')][_0x0b48('0x68')]));}_0x2e6f31=_0x4377bc[_0x0b48('0x82')]();_0x4377bc['limit'](_0xc2ddbe);_0x4377bc[_0x0b48('0x1b')](0x0);return;}})[_0x0b48('0x24')](function(){if(_0x18e8e6[_0x0b48('0x91')]===_0x0b48('0x92')){return null;}var _0x240d27=_[_0x0b48('0x3d')](_0x18e8e6,{'name':_0x18e8e6[_0x0b48('0x93')]||_0x18e8e6[_0x0b48('0x28')]||_0x5aec87[_0x0b48('0x28')],'basename':_0x4c47bc,'savename':util['format']('%s-%s.%s',_0x18e8e6[_0x0b48('0x28')]||_0x5aec87[_0x0b48('0x28')],require(_0x0b48('0x94'))['generate'](0x4),_0x18e8e6[_0x0b48('0x91')]||_0x0b48('0x95')),'reportId':_0x5aec87['id'],'reportType':'custom'});return db[_0x0b48('0x96')][_0x0b48('0x48')](_0x240d27,{'raw':!![]});})[_0x0b48('0x24')](function(_0x1bf7fc){if(_0x5aec87['table']===_0x0b48('0x97')){_0x2e6f31[_0x0b48('0x3a')](_0x5aec87['table']+_0x0b48('0x98'),_0x18e8e6[_0x0b48('0x99')],_0x18e8e6['endDate']);}else{_0x2e6f31[_0x0b48('0x3a')](_0x5aec87['table']+_0x0b48('0x9a'),_0x18e8e6['startDate'],_0x18e8e6['endDate']);}if(_0x1bf7fc){logger['info'](_0x0b48('0x9b'),_0x2e6f31[_0x0b48('0x85')]());require(_0x0b48('0x9c'))[_0x0b48('0x9d')](path[_0x0b48('0x88')](__dirname,'../../components/export/',_0x1bf7fc['output']),[_0x1bf7fc['id'],_0x2e6f31['toString'](),path[_0x0b48('0x88')](__dirname,_0x0b48('0x9e'),_0x1bf7fc[_0x0b48('0x9f')]),_0x4c47bc]);return _0x1bf7fc;}else{var _0x565acf=squel[_0x0b48('0x71')]();_0x565acf[_0x0b48('0x8f')]('('+_0x2e6f31[_0x0b48('0x85')]()+')','countTable');_0x565acf['field']('COUNT(*)','count');_0x2e6f31['limit'](_0x18e8e6[_0x0b48('0x1e')]||_0xc2ddbe);_0x2e6f31[_0x0b48('0x1b')](_0x18e8e6[_0x0b48('0x1b')]||0x0);return dbH[_0x0b48('0x84')][_0x0b48('0x2f')](_0x565acf['toString'](),{'type':dbH[_0x0b48('0x84')]['QueryTypes'][_0x0b48('0x87')]})[_0x0b48('0x24')](function(_0x509150){if(!_0x509150['length']){_0x404f4b=0x0;}else{_0x404f4b=_0x509150[0x0]['count']||0x0;}return dbH[_0x0b48('0x84')][_0x0b48('0x2f')](_0x2e6f31[_0x0b48('0x85')](),{'type':dbH[_0x0b48('0x84')][_0x0b48('0x86')]['SELECT']});})['then'](function(_0x3d1ad2){return{'rows':_0x3d1ad2||[],'count':_0x404f4b};});}});}exports['run']=function(_0x17ca44,_0x760f87){return runReport(_0x17ca44[_0x0b48('0x45')],_0x17ca44['query'],_0x17ca44['options'])[_0x0b48('0x24')](respondWithResult(_0x760f87,null))[_0x0b48('0x43')](handleError(_0x760f87,null));};exports[_0x0b48('0xa0')]=runReport;exports['query']=function(_0xf6973a,_0x202e0a){var _0x3b380a=0xa;var _0x387199=[_0x0b48('0x88'),_0x0b48('0x89'),_0x0b48('0x56'),'cross_join'];var _0x387dd7={'SUM':_0x0b48('0x8a'),'COUNT':_0x0b48('0x8b'),'COUNT DISTINCT':_0x0b48('0x8c'),'MAX':_0x0b48('0x58'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x0b48('0x5c'),'GROUP_CONCAT DESC':_0x0b48('0x5d')};var _0x14b3ce={'SEC_TO_TIME':_0x0b48('0x5e'),'DATE':_0x0b48('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x0b48('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x105486=function(_0x4909c7){return!_[_0x0b48('0x62')]([_0x0b48('0x63'),_0x0b48('0x64'),_0x0b48('0x65'),'IS\x20NOT\x20EMPTY'],_0x4909c7);};var _0x554119=function(_0x261eef){if(!_0x261eef||!_0x261eef[_0x0b48('0x67')][_0x0b48('0x35')]){return'';}for(var _0x45d138='(',_0x26b310=0x0;_0x26b310<_0x261eef[_0x0b48('0x67')]['length'];_0x26b310+=0x1){_0x26b310>0x0&&(_0x45d138+='\x20'+_0x261eef[_0x0b48('0x8e')]+'\x20');_0x45d138+=_0x261eef[_0x0b48('0x67')][_0x26b310][_0x0b48('0x68')]?_0x554119(_0x261eef[_0x0b48('0x67')][_0x26b310]['group']):_0x261eef[_0x0b48('0x67')][_0x26b310][_0x0b48('0x79')]+'\x20'+_0x261eef[_0x0b48('0x67')][_0x26b310][_0x0b48('0x69')]+(_0x105486(_0x261eef[_0x0b48('0x67')][_0x26b310][_0x0b48('0x69')])?'\x20'+_0x261eef[_0x0b48('0x67')][_0x26b310][_0x0b48('0x6a')]:'');}return _0x45d138+')';};var _0x294e80={'where':{'id':_0xf6973a[_0x0b48('0x45')]['id']}},_0x4e3f73,_0x5ef0d9,_0x3d465b,_0xe07cb3,_0x109373;_0x294e80=_[_0x0b48('0x3d')]({},_0x294e80,_0xf6973a[_0x0b48('0x40')]);return db[_0x0b48('0x2a')][_0x0b48('0x47')](_0x294e80)['then'](function(_0x27242e){if(_0x27242e){_0x4e3f73=_0x27242e;return _0x27242e[_0x0b48('0x6b')]();}return null;})[_0x0b48('0x24')](function(_0x399d31){if(_0x399d31){if(!_0x399d31[_0x0b48('0x35')]){throw new db[(_0x0b48('0xa1'))]['ValidationErrorItem'](_0x0b48('0x6d'),0x193);}_0x5ef0d9=_0x399d31;return db[_0x0b48('0x6e')][_0x0b48('0x6f')]({'raw':!![]});}return null;})[_0x0b48('0x24')](function(_0x5e3e69){if(_0x5e3e69){_0x3d465b=_['keyBy'](_0x5e3e69,'id');var _0x32849a;var _0x2ef775=squel[_0x0b48('0x71')]();_0x2ef775[_0x0b48('0x8f')](_0x4e3f73['table']);for(var _0x75c401=0x0;_0x75c401<_0x5ef0d9['length'];_0x75c401+=0x1){_0x32849a=_0x5ef0d9[_0x75c401]['MetricId']?_0x3d465b[_0x5ef0d9[_0x75c401]['MetricId']][_0x0b48('0x73')]:_0x5ef0d9[_0x75c401][_0x0b48('0x79')];_0x32849a=_0x5ef0d9[_0x75c401][_0x0b48('0x74')]?_['replace'](_0x387dd7[_0x5ef0d9[_0x75c401][_0x0b48('0x74')]],'%s',_0x32849a):_0x32849a;_0x32849a=_0x5ef0d9[_0x75c401][_0x0b48('0x76')]?_['replace'](_0x14b3ce[_0x5ef0d9[_0x75c401]['format']],'%s',_0x32849a):_0x32849a;if(_0x5ef0d9[_0x75c401][_0x0b48('0xa2')]){_0x2ef775['group'](_0x32849a);}_0x5ef0d9[_0x75c401]['orderBy']&&_0x2ef775['order'](_0x32849a,_0x5ef0d9[_0x75c401][_0x0b48('0x77')]===_0x0b48('0x78')?![]:!![]);_0x2ef775[_0x0b48('0x79')](_0x32849a,_0x5ef0d9[_0x75c401][_0x0b48('0x7a')]||_0x32849a);}if(_0x4e3f73[_0x0b48('0x7c')]){_0x4e3f73[_0x0b48('0x7c')]=JSON[_0x0b48('0x7b')](_0x4e3f73[_0x0b48('0x7c')]);for(var _0x476073=0x0;_0x476073<_0x4e3f73[_0x0b48('0x7c')][_0x0b48('0x35')];_0x476073+=0x1){if(_0x4e3f73[_0x0b48('0x7c')][_0x476073]['type']&&_['includes'](_0x387199,_0x4e3f73[_0x0b48('0x7c')][_0x476073]['type'])&&_0x4e3f73[_0x0b48('0x7c')][_0x476073][_0x0b48('0x7d')]&&_0x4e3f73['joins'][_0x476073]['foreignTable']&&_0x4e3f73['joins'][_0x476073][_0x0b48('0x80')]){_0x2ef775[_0x4e3f73[_0x0b48('0x7c')][_0x476073][_0x0b48('0x3e')]](_0x4e3f73[_0x0b48('0x7c')][_0x476073]['foreignTable'],null,util[_0x0b48('0x76')](_0x0b48('0x90'),_0x4e3f73[_0x0b48('0x7f')],_0x4e3f73['joins'][_0x476073]['parentKey'],_0x4e3f73[_0x0b48('0x7c')][_0x476073][_0x0b48('0x7e')],_0x4e3f73['joins'][_0x476073]['foreignKey']));}}}if(_0x4e3f73['conditions']){_0x4e3f73[_0x0b48('0x81')]=JSON['parse'](_0x4e3f73[_0x0b48('0x81')]);_0x2ef775['where'](_0x554119(_0x4e3f73['conditions'][_0x0b48('0x68')]));}_0x109373=_0x2ef775['clone']();_0x2ef775[_0x0b48('0x1e')](_0x3b380a);_0x2ef775[_0x0b48('0x1b')](0x0);logger[_0x0b48('0x83')](_0x0b48('0xa3'),_0x2ef775['toString']());return dbH[_0x0b48('0x84')][_0x0b48('0x2f')](_0x2ef775['toString'](),{'type':dbH[_0x0b48('0x84')]['QueryTypes'][_0x0b48('0x87')]});}})[_0x0b48('0x24')](function(){return{'sql':_0x109373[_0x0b48('0x85')]()};})[_0x0b48('0x24')](respondWithResult(_0x202e0a,null))[_0x0b48('0x43')](handleError(_0x202e0a,null));};
\ No newline at end of file
+var _0xd4a3=['name','send','index','AnalyticCustomReport','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_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)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','function','format','replace','groupBy','orderBy','DESC','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','ROUND(%s)','IS\x20NOT\x20NULL','value','Sequelize','from','alias','%s.%s\x20=\x20%s.%s','generate','output','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','countTable','COUNT(*)','run','runReport','right_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','eml-format','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','get','CustomReports','error'];(function(_0x29ebf,_0x5d73f0){var _0x3261f2=function(_0x26b9d5){while(--_0x26b9d5){_0x29ebf['push'](_0x29ebf['shift']());}};_0x3261f2(++_0x5d73f0);}(_0xd4a3,0x7a));var _0x3d4a=function(_0x1cfd2d,_0xc2bfae){_0x1cfd2d=_0x1cfd2d-0x0;var _0x227ed0=_0xd4a3[_0x1cfd2d];return _0x227ed0;};'use strict';var emlformat=require(_0x3d4a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3d4a('0x1'));var moment=require(_0x3d4a('0x2'));var BPromise=require(_0x3d4a('0x3'));var Mustache=require(_0x3d4a('0x4'));var util=require('util');var path=require('path');var sox=require(_0x3d4a('0x5'));var csv=require(_0x3d4a('0x6'));var ejs=require(_0x3d4a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3d4a('0x8'));var toCsv=require('to-csv');var querystring=require(_0x3d4a('0x9'));var Papa=require(_0x3d4a('0xa'));var Redis=require(_0x3d4a('0xb'));var authService=require(_0x3d4a('0xc'));var qs=require(_0x3d4a('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d4a('0xe'));var logger=require(_0x3d4a('0xf'))(_0x3d4a('0x10'));var utils=require(_0x3d4a('0x11'));var config=require(_0x3d4a('0x12'));var licenseUtil=require(_0x3d4a('0x13'));var db=require(_0x3d4a('0x14'))['db'];var dbH=require('../../mysqldb')[_0x3d4a('0x15')];function respondWithStatusCode(_0x428024,_0x46367d){_0x46367d=_0x46367d||0xcc;return function(_0xfa35b9){if(_0xfa35b9){return _0x428024[_0x3d4a('0x16')](_0x46367d);}return _0x428024[_0x3d4a('0x17')](_0x46367d)[_0x3d4a('0x18')]();};}function respondWithResult(_0x3b5658,_0x4fda68){_0x4fda68=_0x4fda68||0xc8;return function(_0x5f2282){if(_0x5f2282){return _0x3b5658['status'](_0x4fda68)[_0x3d4a('0x19')](_0x5f2282);}};}function respondWithFilteredResult(_0x149f55,_0x4cf75d){return function(_0x2e29ed){if(_0x2e29ed){var _0x850685=typeof _0x4cf75d[_0x3d4a('0x1a')]===_0x3d4a('0x1b')&&typeof _0x4cf75d[_0x3d4a('0x1c')]===_0x3d4a('0x1b');var _0x3d8944=_0x2e29ed[_0x3d4a('0x1d')];var _0x1274b0=_0x850685?0x0:_0x4cf75d[_0x3d4a('0x1a')];var _0x3aa044=_0x850685?_0x2e29ed[_0x3d4a('0x1d')]:_0x4cf75d[_0x3d4a('0x1a')]+_0x4cf75d[_0x3d4a('0x1c')];var _0x43bb14;if(_0x3aa044>=_0x3d8944){_0x3aa044=_0x3d8944;_0x43bb14=0xc8;}else{_0x43bb14=0xce;}_0x149f55['status'](_0x43bb14);return _0x149f55['set'](_0x3d4a('0x1e'),_0x1274b0+'-'+_0x3aa044+'/'+_0x3d8944)['json'](_0x2e29ed);}return null;};}function patchUpdates(_0x261690){return function(_0x21aa17){try{jsonpatch[_0x3d4a('0x1f')](_0x21aa17,_0x261690,!![]);}catch(_0x3df475){return BPromise[_0x3d4a('0x20')](_0x3df475);}return _0x21aa17[_0x3d4a('0x21')]();};}function saveUpdates(_0x1d4e79,_0x5b1741){return function(_0x19d663){if(_0x19d663){return _0x19d663['update'](_0x1d4e79)[_0x3d4a('0x22')](function(_0x1a10c9){return _0x1a10c9;});}return null;};}function removeEntity(_0x1bd0f6,_0x36038e){return function(_0x544fcc){if(_0x544fcc){return _0x544fcc[_0x3d4a('0x23')]()[_0x3d4a('0x22')](function(){var _0x83880=_0x544fcc[_0x3d4a('0x24')]({'plain':!![]});var _0xfd631f=_0x3d4a('0x25');return db['UserProfileResource'][_0x3d4a('0x23')]({'where':{'type':_0xfd631f,'resourceId':_0x83880['id']}})[_0x3d4a('0x22')](function(){return _0x544fcc;});})['then'](function(){_0x1bd0f6[_0x3d4a('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3de273,_0x323e19){return function(_0x46a717){if(!_0x46a717){_0x3de273[_0x3d4a('0x16')](0x194);}return _0x46a717;};}function handleError(_0x1a6570,_0x441d58){_0x441d58=_0x441d58||0x1f4;return function(_0x5eaa4c){logger[_0x3d4a('0x26')](_0x5eaa4c['stack']);if(_0x5eaa4c['name']){delete _0x5eaa4c[_0x3d4a('0x27')];}_0x1a6570[_0x3d4a('0x17')](_0x441d58)[_0x3d4a('0x28')](_0x5eaa4c);};}exports[_0x3d4a('0x29')]=function(_0x496fc5,_0x2a947c){var _0x9047ef={},_0x487a9d={},_0x51111a={'count':0x0,'rows':[]};var _0x3e0661=_['map'](db[_0x3d4a('0x2a')][_0x3d4a('0x2b')],function(_0x755c7b){return{'name':_0x755c7b[_0x3d4a('0x2c')],'type':_0x755c7b[_0x3d4a('0x2d')]['key']};});_0x487a9d[_0x3d4a('0x2e')]=_[_0x3d4a('0x2f')](_0x3e0661,'name');_0x487a9d[_0x3d4a('0x30')]=_[_0x3d4a('0x31')](_0x496fc5[_0x3d4a('0x30')]);_0x487a9d[_0x3d4a('0x32')]=_[_0x3d4a('0x33')](_0x487a9d[_0x3d4a('0x2e')],_0x487a9d[_0x3d4a('0x30')]);_0x9047ef[_0x3d4a('0x34')]=_[_0x3d4a('0x33')](_0x487a9d[_0x3d4a('0x2e')],qs[_0x3d4a('0x35')](_0x496fc5[_0x3d4a('0x30')][_0x3d4a('0x35')]));_0x9047ef[_0x3d4a('0x34')]=_0x9047ef[_0x3d4a('0x34')]['length']?_0x9047ef[_0x3d4a('0x34')]:_0x487a9d[_0x3d4a('0x2e')];if(!_0x496fc5[_0x3d4a('0x30')][_0x3d4a('0x36')](_0x3d4a('0x37'))){_0x9047ef[_0x3d4a('0x1c')]=qs[_0x3d4a('0x1c')](_0x496fc5[_0x3d4a('0x30')]['limit']);_0x9047ef[_0x3d4a('0x1a')]=qs[_0x3d4a('0x1a')](_0x496fc5[_0x3d4a('0x30')]['offset']);}_0x9047ef[_0x3d4a('0x38')]=qs[_0x3d4a('0x39')](_0x496fc5[_0x3d4a('0x30')][_0x3d4a('0x39')]);_0x9047ef[_0x3d4a('0x3a')]=qs[_0x3d4a('0x32')](_[_0x3d4a('0x3b')](_0x496fc5['query'],_0x487a9d[_0x3d4a('0x32')]),_0x3e0661);if(_0x496fc5[_0x3d4a('0x30')][_0x3d4a('0x3c')]){_0x9047ef[_0x3d4a('0x3a')]=_[_0x3d4a('0x3d')](_0x9047ef[_0x3d4a('0x3a')],{'$or':_[_0x3d4a('0x2f')](_0x3e0661,function(_0x4d17fb){if(_0x4d17fb[_0x3d4a('0x2d')]!==_0x3d4a('0x3e')){var _0x3b9a6a={};_0x3b9a6a[_0x4d17fb[_0x3d4a('0x27')]]={'$like':'%'+_0x496fc5['query'][_0x3d4a('0x3c')]+'%'};return _0x3b9a6a;}})});}_0x9047ef=_[_0x3d4a('0x3d')]({},_0x9047ef,_0x496fc5[_0x3d4a('0x3f')]);var _0x481225={'where':_0x9047ef[_0x3d4a('0x3a')]};return db[_0x3d4a('0x2a')][_0x3d4a('0x1d')](_0x481225)[_0x3d4a('0x22')](function(_0x3103fa){_0x51111a['count']=_0x3103fa;if(_0x496fc5[_0x3d4a('0x30')][_0x3d4a('0x40')]){_0x9047ef[_0x3d4a('0x41')]=[{'all':!![]}];}return db[_0x3d4a('0x2a')][_0x3d4a('0x42')](_0x9047ef);})[_0x3d4a('0x22')](function(_0x355aaf){_0x51111a[_0x3d4a('0x43')]=_0x355aaf;return _0x51111a;})[_0x3d4a('0x22')](respondWithFilteredResult(_0x2a947c,_0x9047ef))['catch'](handleError(_0x2a947c,null));};exports['show']=function(_0x27abc2,_0x48c257){var _0x4b5ce1={'raw':![],'where':{'id':_0x27abc2[_0x3d4a('0x44')]['id']}},_0x529a65={};_0x529a65[_0x3d4a('0x2e')]=_[_0x3d4a('0x31')](db['AnalyticCustomReport'][_0x3d4a('0x2b')]);_0x529a65[_0x3d4a('0x30')]=_[_0x3d4a('0x31')](_0x27abc2['query']);_0x529a65[_0x3d4a('0x32')]=_[_0x3d4a('0x33')](_0x529a65['model'],_0x529a65[_0x3d4a('0x30')]);_0x4b5ce1[_0x3d4a('0x34')]=_[_0x3d4a('0x33')](_0x529a65[_0x3d4a('0x2e')],qs[_0x3d4a('0x35')](_0x27abc2['query'][_0x3d4a('0x35')]));_0x4b5ce1[_0x3d4a('0x34')]=_0x4b5ce1[_0x3d4a('0x34')][_0x3d4a('0x45')]?_0x4b5ce1['attributes']:_0x529a65[_0x3d4a('0x2e')];if(_0x27abc2['query'][_0x3d4a('0x40')]){_0x4b5ce1['include']=[{'all':!![]}];}_0x4b5ce1=_[_0x3d4a('0x3d')]({},_0x4b5ce1,_0x27abc2[_0x3d4a('0x3f')]);return db[_0x3d4a('0x2a')]['find'](_0x4b5ce1)[_0x3d4a('0x22')](handleEntityNotFound(_0x48c257,null))[_0x3d4a('0x22')](respondWithResult(_0x48c257,null))['catch'](handleError(_0x48c257,null));};exports[_0x3d4a('0x46')]=function(_0x364651,_0xaab3b3){return db[_0x3d4a('0x2a')][_0x3d4a('0x46')](_0x364651['body'],{})[_0x3d4a('0x22')](function(_0x4de6a0){var _0x1f3b91=_0x364651[_0x3d4a('0x47')]['get']({'plain':!![]});if(!_0x1f3b91)throw new Error(_0x3d4a('0x48'));if(_0x1f3b91[_0x3d4a('0x49')]===_0x3d4a('0x47')){var _0x1d8a01=_0x4de6a0[_0x3d4a('0x24')]({'plain':!![]});var _0x1c301f=_0x3d4a('0x4a');return db[_0x3d4a('0x4b')][_0x3d4a('0x4c')]({'where':{'name':_0x1c301f,'userProfileId':_0x1f3b91[_0x3d4a('0x4d')]},'raw':!![]})[_0x3d4a('0x22')](function(_0x4a56c9){if(_0x4a56c9&&_0x4a56c9[_0x3d4a('0x4e')]===0x0){return db[_0x3d4a('0x4f')][_0x3d4a('0x46')]({'name':_0x1d8a01['name'],'resourceId':_0x1d8a01['id'],'type':_0x3d4a('0x25'),'sectionId':_0x4a56c9['id']},{})[_0x3d4a('0x22')](function(){return _0x4de6a0;});}else{return _0x4de6a0;}})[_0x3d4a('0x50')](function(_0x1bec5d){logger['error'](_0x3d4a('0x51'),_0x1bec5d);throw _0x1bec5d;});}return _0x4de6a0;})[_0x3d4a('0x22')](respondWithResult(_0xaab3b3,0xc9))[_0x3d4a('0x50')](handleError(_0xaab3b3,null));};exports[_0x3d4a('0x52')]=function(_0x1d7d4d,_0x3e4c05){if(_0x1d7d4d['body']['id']){delete _0x1d7d4d['body']['id'];}return db[_0x3d4a('0x2a')][_0x3d4a('0x4c')]({'where':{'id':_0x1d7d4d[_0x3d4a('0x44')]['id']}})[_0x3d4a('0x22')](handleEntityNotFound(_0x3e4c05,null))[_0x3d4a('0x22')](saveUpdates(_0x1d7d4d['body'],null))[_0x3d4a('0x22')](respondWithResult(_0x3e4c05,null))[_0x3d4a('0x50')](handleError(_0x3e4c05,null));};exports[_0x3d4a('0x23')]=function(_0x19a237,_0x56009f){return db[_0x3d4a('0x2a')][_0x3d4a('0x4c')]({'where':{'id':_0x19a237[_0x3d4a('0x44')]['id']}})[_0x3d4a('0x22')](handleEntityNotFound(_0x56009f,null))['then'](removeEntity(_0x56009f,null))[_0x3d4a('0x50')](handleError(_0x56009f,null));};exports[_0x3d4a('0x53')]=function(_0x21b55d,_0x13e592){var _0x2bcf50=0xa;var _0x188e28=[_0x3d4a('0x54'),_0x3d4a('0x55'),'right_join','cross_join'];var _0x3e33a9={'SUM':_0x3d4a('0x56'),'COUNT':_0x3d4a('0x57'),'COUNT DISTINCT':_0x3d4a('0x58'),'MAX':_0x3d4a('0x59'),'MIN':_0x3d4a('0x5a'),'AVG':_0x3d4a('0x5b'),'GROUP_CONCAT':_0x3d4a('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x3d4a('0x5d')};var _0x3547a9={'SEC_TO_TIME':_0x3d4a('0x5e'),'DATE':_0x3d4a('0x5f'),'HOUR':_0x3d4a('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x3d4a('0x61')};var _0x1b5b7d=function(_0xc7d9ca){return!_[_0x3d4a('0x62')]([_0x3d4a('0x63'),'IS\x20NOT\x20NULL',_0x3d4a('0x64'),_0x3d4a('0x65')],_0xc7d9ca);};var _0x22fe52=function(_0x2bb5ec){if(!_0x2bb5ec||!_0x2bb5ec[_0x3d4a('0x66')][_0x3d4a('0x45')]){return'';}for(var _0x2d1d46='(',_0xed2a93=0x0;_0xed2a93<_0x2bb5ec[_0x3d4a('0x66')]['length'];_0xed2a93+=0x1){_0xed2a93>0x0&&(_0x2d1d46+='\x20'+_0x2bb5ec[_0x3d4a('0x67')]+'\x20');_0x2d1d46+=_0x2bb5ec['rules'][_0xed2a93][_0x3d4a('0x68')]?_0x22fe52(_0x2bb5ec['rules'][_0xed2a93][_0x3d4a('0x68')]):_0x2bb5ec['rules'][_0xed2a93][_0x3d4a('0x69')]+'\x20'+_0x2bb5ec[_0x3d4a('0x66')][_0xed2a93][_0x3d4a('0x6a')]+(_0x1b5b7d(_0x2bb5ec[_0x3d4a('0x66')][_0xed2a93][_0x3d4a('0x6a')])?'\x20'+_0x2bb5ec[_0x3d4a('0x66')][_0xed2a93]['value']:'');}return _0x2d1d46+')';};var _0x40cf1e={'where':{'id':_0x21b55d[_0x3d4a('0x44')]['id']}},_0x3c1b87,_0x154feb,_0x2a0744,_0x141ee0,_0x398a47;_0x40cf1e=_['merge']({},_0x40cf1e,_0x21b55d[_0x3d4a('0x3f')]);return db[_0x3d4a('0x2a')][_0x3d4a('0x4c')](_0x40cf1e)[_0x3d4a('0x22')](function(_0x951038){if(_0x951038){_0x3c1b87=_0x951038;return _0x951038[_0x3d4a('0x6b')]();}return null;})[_0x3d4a('0x22')](function(_0xa5bdb1){if(_0xa5bdb1){if(!_0xa5bdb1['length']){throw new db['Sequelize'][(_0x3d4a('0x6c'))](_0x3d4a('0x6d'),0x193);}_0x154feb=_0xa5bdb1;return db[_0x3d4a('0x6e')][_0x3d4a('0x42')]({'raw':!![]});}return null;})['then'](function(_0x58e1c8){if(_0x58e1c8){_0x2a0744=_[_0x3d4a('0x6f')](_0x58e1c8,'id');var _0x50cb32;var _0x26ddca=squel[_0x3d4a('0x70')]();_0x26ddca['from'](_0x3c1b87[_0x3d4a('0x71')]);for(var _0x2e65cc=0x0;_0x2e65cc<_0x154feb['length'];_0x2e65cc+=0x1){_0x50cb32=_0x154feb[_0x2e65cc][_0x3d4a('0x72')]?_0x2a0744[_0x154feb[_0x2e65cc][_0x3d4a('0x72')]][_0x3d4a('0x73')]:_0x154feb[_0x2e65cc][_0x3d4a('0x69')];_0x50cb32=_0x154feb[_0x2e65cc][_0x3d4a('0x74')]?_['replace'](_0x3e33a9[_0x154feb[_0x2e65cc]['function']],'%s',_0x50cb32):_0x50cb32;_0x50cb32=_0x154feb[_0x2e65cc][_0x3d4a('0x75')]?_[_0x3d4a('0x76')](_0x3547a9[_0x154feb[_0x2e65cc][_0x3d4a('0x75')]],'%s',_0x50cb32):_0x50cb32;if(_0x154feb[_0x2e65cc][_0x3d4a('0x77')]){_0x26ddca[_0x3d4a('0x68')](_0x50cb32);}_0x154feb[_0x2e65cc][_0x3d4a('0x78')]&&_0x26ddca[_0x3d4a('0x38')](_0x50cb32,_0x154feb[_0x2e65cc]['orderBy']===_0x3d4a('0x79')?![]:!![]);_0x26ddca[_0x3d4a('0x69')](_0x50cb32,_0x154feb[_0x2e65cc]['alias']||_0x50cb32);}if(_0x3c1b87[_0x3d4a('0x7a')]){_0x3c1b87['joins']=JSON[_0x3d4a('0x7b')](_0x3c1b87[_0x3d4a('0x7a')]);for(var _0x640afb=0x0;_0x640afb<_0x3c1b87[_0x3d4a('0x7a')][_0x3d4a('0x45')];_0x640afb+=0x1){if(_0x3c1b87[_0x3d4a('0x7a')][_0x640afb][_0x3d4a('0x2d')]&&_[_0x3d4a('0x62')](_0x188e28,_0x3c1b87[_0x3d4a('0x7a')][_0x640afb][_0x3d4a('0x2d')])&&_0x3c1b87[_0x3d4a('0x7a')][_0x640afb][_0x3d4a('0x7c')]&&_0x3c1b87['joins'][_0x640afb][_0x3d4a('0x7d')]&&_0x3c1b87[_0x3d4a('0x7a')][_0x640afb][_0x3d4a('0x7e')]){_0x26ddca[_0x3c1b87[_0x3d4a('0x7a')][_0x640afb][_0x3d4a('0x2d')]](_0x3c1b87['joins'][_0x640afb][_0x3d4a('0x7d')],null,util[_0x3d4a('0x75')]('%s.%s\x20=\x20%s.%s',_0x3c1b87[_0x3d4a('0x71')],_0x3c1b87['joins'][_0x640afb][_0x3d4a('0x7c')],_0x3c1b87[_0x3d4a('0x7a')][_0x640afb][_0x3d4a('0x7d')],_0x3c1b87[_0x3d4a('0x7a')][_0x640afb][_0x3d4a('0x7e')]));}}}if(_0x3c1b87['conditions']){_0x3c1b87[_0x3d4a('0x7f')]=JSON['parse'](_0x3c1b87[_0x3d4a('0x7f')]);_0x26ddca[_0x3d4a('0x3a')](_0x22fe52(_0x3c1b87[_0x3d4a('0x7f')][_0x3d4a('0x68')]));}_0x398a47=_0x26ddca[_0x3d4a('0x80')]();_0x26ddca['limit'](_0x2bcf50);_0x26ddca[_0x3d4a('0x1a')](0x0);logger[_0x3d4a('0x81')](_0x3d4a('0x82'),_0x26ddca[_0x3d4a('0x83')]());return dbH[_0x3d4a('0x84')][_0x3d4a('0x30')](_0x26ddca['toString'](),{'type':dbH[_0x3d4a('0x84')][_0x3d4a('0x85')][_0x3d4a('0x86')]});}})['then'](respondWithResult(_0x13e592,null))[_0x3d4a('0x50')](handleError(_0x13e592,null));};function runReport(_0x5a78b8,_0xfc1912,_0x5efeb1){var _0x270d0a=_0xfc1912['name'];var _0x3002ff=0xa;var _0x102bb2=[_0x3d4a('0x54'),_0x3d4a('0x55'),'right_join',_0x3d4a('0x87')];var _0x3d7553={'SUM':_0x3d4a('0x56'),'COUNT':_0x3d4a('0x57'),'COUNT DISTINCT':_0x3d4a('0x58'),'MAX':_0x3d4a('0x59'),'MIN':_0x3d4a('0x5a'),'AVG':_0x3d4a('0x5b'),'GROUP_CONCAT':_0x3d4a('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x18217f={'SEC_TO_TIME':_0x3d4a('0x5e'),'DATE':_0x3d4a('0x5f'),'HOUR':_0x3d4a('0x60'),'ROUND':_0x3d4a('0x88'),'UNIX_TIMESTAMP':_0x3d4a('0x61')};var _0xec11ce=function(_0x27010a){return!_[_0x3d4a('0x62')](['IS\x20NULL',_0x3d4a('0x89'),_0x3d4a('0x64'),_0x3d4a('0x65')],_0x27010a);};var _0x4ad5db=function(_0x10335d){if(!_0x10335d||!_0x10335d[_0x3d4a('0x66')][_0x3d4a('0x45')]){return'';}for(var _0x3160e1='(',_0x505c88=0x0;_0x505c88<_0x10335d[_0x3d4a('0x66')][_0x3d4a('0x45')];_0x505c88+=0x1){_0x505c88>0x0&&(_0x3160e1+='\x20'+_0x10335d[_0x3d4a('0x67')]+'\x20');_0x3160e1+=_0x10335d[_0x3d4a('0x66')][_0x505c88][_0x3d4a('0x68')]?_0x4ad5db(_0x10335d['rules'][_0x505c88]['group']):_0x10335d['rules'][_0x505c88][_0x3d4a('0x69')]+'\x20'+_0x10335d[_0x3d4a('0x66')][_0x505c88][_0x3d4a('0x6a')]+(_0xec11ce(_0x10335d[_0x3d4a('0x66')][_0x505c88][_0x3d4a('0x6a')])?'\x20'+_0x10335d['rules'][_0x505c88][_0x3d4a('0x8a')]:'');}return _0x3160e1+')';};var _0x499708={'where':{'id':_0x5a78b8['id']}},_0x16d3e5,_0x3caa95,_0x9f73b6,_0x332a1d,_0x242c7c;_0x499708=_[_0x3d4a('0x3d')]({},_0x499708,_0x5efeb1);return db['AnalyticCustomReport'][_0x3d4a('0x4c')](_0x499708)[_0x3d4a('0x22')](function(_0x3f7d86){if(_0x3f7d86){_0x16d3e5=_0x3f7d86;return _0x3f7d86[_0x3d4a('0x6b')]();}return null;})[_0x3d4a('0x22')](function(_0x5cc8f2){if(_0x5cc8f2){if(!_0x5cc8f2[_0x3d4a('0x45')]){throw new db[(_0x3d4a('0x8b'))][(_0x3d4a('0x6c'))](_0x3d4a('0x6d'),0x193);}_0x3caa95=_0x5cc8f2;return db[_0x3d4a('0x6e')][_0x3d4a('0x42')]({'raw':!![]});}return null;})[_0x3d4a('0x22')](function(_0x39e42a){if(_0x39e42a){_0x9f73b6=_[_0x3d4a('0x6f')](_0x39e42a,'id');var _0x11d38c;var _0x30cb71=squel[_0x3d4a('0x70')]();_0x30cb71[_0x3d4a('0x8c')](_0x16d3e5['table']);for(var _0x2f10b0=0x0;_0x2f10b0<_0x3caa95[_0x3d4a('0x45')];_0x2f10b0+=0x1){_0x11d38c=_0x3caa95[_0x2f10b0][_0x3d4a('0x72')]?_0x9f73b6[_0x3caa95[_0x2f10b0][_0x3d4a('0x72')]]['metric']:_0x3caa95[_0x2f10b0]['field'];_0x11d38c=_0x3caa95[_0x2f10b0][_0x3d4a('0x74')]?_['replace'](_0x3d7553[_0x3caa95[_0x2f10b0][_0x3d4a('0x74')]],'%s',_0x11d38c):_0x11d38c;_0x11d38c=_0x3caa95[_0x2f10b0]['format']?_[_0x3d4a('0x76')](_0x18217f[_0x3caa95[_0x2f10b0][_0x3d4a('0x75')]],'%s',_0x11d38c):_0x11d38c;if(_0x3caa95[_0x2f10b0]['groupBy']){_0x30cb71[_0x3d4a('0x68')](_0x11d38c);}_0x3caa95[_0x2f10b0][_0x3d4a('0x78')]&&_0x30cb71[_0x3d4a('0x38')](_0x11d38c,_0x3caa95[_0x2f10b0][_0x3d4a('0x78')]===_0x3d4a('0x79')?![]:!![]);_0x30cb71['field'](_0x11d38c,_0x3caa95[_0x2f10b0][_0x3d4a('0x8d')]||_0x11d38c);}if(_0x16d3e5[_0x3d4a('0x7a')]){_0x16d3e5[_0x3d4a('0x7a')]=JSON[_0x3d4a('0x7b')](_0x16d3e5[_0x3d4a('0x7a')]);for(var _0x59ca45=0x0;_0x59ca45<_0x16d3e5[_0x3d4a('0x7a')][_0x3d4a('0x45')];_0x59ca45+=0x1){if(_0x16d3e5[_0x3d4a('0x7a')][_0x59ca45][_0x3d4a('0x2d')]&&_[_0x3d4a('0x62')](_0x102bb2,_0x16d3e5['joins'][_0x59ca45][_0x3d4a('0x2d')])&&_0x16d3e5['joins'][_0x59ca45][_0x3d4a('0x7c')]&&_0x16d3e5['joins'][_0x59ca45][_0x3d4a('0x7d')]&&_0x16d3e5[_0x3d4a('0x7a')][_0x59ca45][_0x3d4a('0x7e')]){_0x30cb71[_0x16d3e5[_0x3d4a('0x7a')][_0x59ca45]['type']](_0x16d3e5['joins'][_0x59ca45][_0x3d4a('0x7d')],null,util['format'](_0x3d4a('0x8e'),_0x16d3e5[_0x3d4a('0x71')],_0x16d3e5['joins'][_0x59ca45][_0x3d4a('0x7c')],_0x16d3e5['joins'][_0x59ca45]['foreignTable'],_0x16d3e5[_0x3d4a('0x7a')][_0x59ca45][_0x3d4a('0x7e')]));}}}if(_0x16d3e5[_0x3d4a('0x7f')]){_0x16d3e5[_0x3d4a('0x7f')]=JSON[_0x3d4a('0x7b')](_0x16d3e5[_0x3d4a('0x7f')]);_0x30cb71[_0x3d4a('0x3a')](_0x4ad5db(_0x16d3e5[_0x3d4a('0x7f')][_0x3d4a('0x68')]));}_0x242c7c=_0x30cb71['clone']();_0x30cb71[_0x3d4a('0x1c')](_0x3002ff);_0x30cb71[_0x3d4a('0x1a')](0x0);return;}})[_0x3d4a('0x22')](function(){if(_0xfc1912['output']==='web'){return null;}var _0x2fb169=_['merge'](_0xfc1912,{'name':_0xfc1912['fullPath']||_0xfc1912[_0x3d4a('0x27')]||_0x16d3e5['name'],'basename':_0x270d0a,'savename':util[_0x3d4a('0x75')]('%s-%s.%s',_0xfc1912['name']||_0x16d3e5['name'],require('randomstring')[_0x3d4a('0x8f')](0x4),_0xfc1912[_0x3d4a('0x90')]||_0x3d4a('0x91')),'reportId':_0x16d3e5['id'],'reportType':_0x3d4a('0x92')});return db[_0x3d4a('0x93')][_0x3d4a('0x46')](_0x2fb169,{'raw':!![]});})[_0x3d4a('0x22')](function(_0x2420bb){if(_0x16d3e5[_0x3d4a('0x71')]===_0x3d4a('0x94')){_0x242c7c[_0x3d4a('0x3a')](_0x16d3e5['table']+_0x3d4a('0x95'),_0xfc1912[_0x3d4a('0x96')],_0xfc1912['endDate']);}else{_0x242c7c[_0x3d4a('0x3a')](_0x16d3e5[_0x3d4a('0x71')]+_0x3d4a('0x97'),_0xfc1912[_0x3d4a('0x96')],_0xfc1912['endDate']);}if(_0x2420bb){logger[_0x3d4a('0x98')]('Run\x20Query:',_0x242c7c[_0x3d4a('0x83')]());require(_0x3d4a('0x99'))[_0x3d4a('0x9a')](path[_0x3d4a('0x54')](__dirname,'../../components/export/',_0x2420bb[_0x3d4a('0x90')]),[_0x2420bb['id'],_0x242c7c[_0x3d4a('0x83')](),path[_0x3d4a('0x54')](__dirname,'../../files/reports',_0x2420bb['savename']),_0x270d0a]);return _0x2420bb;}else{var _0x317125=squel[_0x3d4a('0x70')]();_0x317125[_0x3d4a('0x8c')]('('+_0x242c7c['toString']()+')',_0x3d4a('0x9b'));_0x317125[_0x3d4a('0x69')](_0x3d4a('0x9c'),_0x3d4a('0x1d'));_0x242c7c[_0x3d4a('0x1c')](_0xfc1912[_0x3d4a('0x1c')]||_0x3002ff);_0x242c7c[_0x3d4a('0x1a')](_0xfc1912['offset']||0x0);return dbH[_0x3d4a('0x84')][_0x3d4a('0x30')](_0x317125[_0x3d4a('0x83')](),{'type':dbH[_0x3d4a('0x84')][_0x3d4a('0x85')][_0x3d4a('0x86')]})[_0x3d4a('0x22')](function(_0x5a0719){if(!_0x5a0719[_0x3d4a('0x45')]){_0x332a1d=0x0;}else{_0x332a1d=_0x5a0719[0x0][_0x3d4a('0x1d')]||0x0;}return dbH[_0x3d4a('0x84')][_0x3d4a('0x30')](_0x242c7c[_0x3d4a('0x83')](),{'type':dbH[_0x3d4a('0x84')][_0x3d4a('0x85')]['SELECT']});})[_0x3d4a('0x22')](function(_0x21fb14){return{'rows':_0x21fb14||[],'count':_0x332a1d};});}});}exports[_0x3d4a('0x9d')]=function(_0x3696b5,_0x1a52d2){return runReport(_0x3696b5[_0x3d4a('0x44')],_0x3696b5[_0x3d4a('0x30')],_0x3696b5[_0x3d4a('0x3f')])['then'](respondWithResult(_0x1a52d2,null))[_0x3d4a('0x50')](handleError(_0x1a52d2,null));};exports[_0x3d4a('0x9e')]=runReport;exports[_0x3d4a('0x30')]=function(_0x5efdc5,_0x1e5240){var _0x2a6c7e=0xa;var _0x508f2e=['join',_0x3d4a('0x55'),_0x3d4a('0x9f'),_0x3d4a('0x87')];var _0x3583ae={'SUM':'SUM(%s)','COUNT':_0x3d4a('0x57'),'COUNT DISTINCT':_0x3d4a('0x58'),'MAX':_0x3d4a('0x59'),'MIN':_0x3d4a('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x3d4a('0x5c'),'GROUP_CONCAT ASC':_0x3d4a('0xa0'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5b1118={'SEC_TO_TIME':_0x3d4a('0x5e'),'DATE':_0x3d4a('0x5f'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x3d4a('0x61')};var _0x1c0697=function(_0x5e11a6){return!_[_0x3d4a('0x62')]([_0x3d4a('0x63'),_0x3d4a('0x89'),_0x3d4a('0x64'),_0x3d4a('0x65')],_0x5e11a6);};var _0x31540a=function(_0x3a2988){if(!_0x3a2988||!_0x3a2988[_0x3d4a('0x66')]['length']){return'';}for(var _0x10a8d0='(',_0x2d94f5=0x0;_0x2d94f5<_0x3a2988[_0x3d4a('0x66')][_0x3d4a('0x45')];_0x2d94f5+=0x1){_0x2d94f5>0x0&&(_0x10a8d0+='\x20'+_0x3a2988[_0x3d4a('0x67')]+'\x20');_0x10a8d0+=_0x3a2988[_0x3d4a('0x66')][_0x2d94f5][_0x3d4a('0x68')]?_0x31540a(_0x3a2988[_0x3d4a('0x66')][_0x2d94f5][_0x3d4a('0x68')]):_0x3a2988['rules'][_0x2d94f5]['field']+'\x20'+_0x3a2988[_0x3d4a('0x66')][_0x2d94f5][_0x3d4a('0x6a')]+(_0x1c0697(_0x3a2988['rules'][_0x2d94f5][_0x3d4a('0x6a')])?'\x20'+_0x3a2988[_0x3d4a('0x66')][_0x2d94f5]['value']:'');}return _0x10a8d0+')';};var _0x176618={'where':{'id':_0x5efdc5[_0x3d4a('0x44')]['id']}},_0x182208,_0x1a0f7e,_0x306d45,_0x5ee4f5,_0x54ff53;_0x176618=_[_0x3d4a('0x3d')]({},_0x176618,_0x5efdc5[_0x3d4a('0x3f')]);return db['AnalyticCustomReport']['find'](_0x176618)[_0x3d4a('0x22')](function(_0x41efbb){if(_0x41efbb){_0x182208=_0x41efbb;return _0x41efbb[_0x3d4a('0x6b')]();}return null;})[_0x3d4a('0x22')](function(_0x163f91){if(_0x163f91){if(!_0x163f91[_0x3d4a('0x45')]){throw new db[(_0x3d4a('0x8b'))][(_0x3d4a('0x6c'))](_0x3d4a('0x6d'),0x193);}_0x1a0f7e=_0x163f91;return db[_0x3d4a('0x6e')][_0x3d4a('0x42')]({'raw':!![]});}return null;})[_0x3d4a('0x22')](function(_0x2eb139){if(_0x2eb139){_0x306d45=_[_0x3d4a('0x6f')](_0x2eb139,'id');var _0x3d3478;var _0xf58c86=squel[_0x3d4a('0x70')]();_0xf58c86[_0x3d4a('0x8c')](_0x182208[_0x3d4a('0x71')]);for(var _0x454c3f=0x0;_0x454c3f<_0x1a0f7e['length'];_0x454c3f+=0x1){_0x3d3478=_0x1a0f7e[_0x454c3f][_0x3d4a('0x72')]?_0x306d45[_0x1a0f7e[_0x454c3f][_0x3d4a('0x72')]][_0x3d4a('0x73')]:_0x1a0f7e[_0x454c3f][_0x3d4a('0x69')];_0x3d3478=_0x1a0f7e[_0x454c3f][_0x3d4a('0x74')]?_[_0x3d4a('0x76')](_0x3583ae[_0x1a0f7e[_0x454c3f][_0x3d4a('0x74')]],'%s',_0x3d3478):_0x3d3478;_0x3d3478=_0x1a0f7e[_0x454c3f][_0x3d4a('0x75')]?_[_0x3d4a('0x76')](_0x5b1118[_0x1a0f7e[_0x454c3f][_0x3d4a('0x75')]],'%s',_0x3d3478):_0x3d3478;if(_0x1a0f7e[_0x454c3f]['groupBy']){_0xf58c86[_0x3d4a('0x68')](_0x3d3478);}_0x1a0f7e[_0x454c3f][_0x3d4a('0x78')]&&_0xf58c86[_0x3d4a('0x38')](_0x3d3478,_0x1a0f7e[_0x454c3f][_0x3d4a('0x78')]===_0x3d4a('0x79')?![]:!![]);_0xf58c86[_0x3d4a('0x69')](_0x3d3478,_0x1a0f7e[_0x454c3f][_0x3d4a('0x8d')]||_0x3d3478);}if(_0x182208[_0x3d4a('0x7a')]){_0x182208['joins']=JSON[_0x3d4a('0x7b')](_0x182208[_0x3d4a('0x7a')]);for(var _0x3e049c=0x0;_0x3e049c<_0x182208[_0x3d4a('0x7a')][_0x3d4a('0x45')];_0x3e049c+=0x1){if(_0x182208['joins'][_0x3e049c][_0x3d4a('0x2d')]&&_[_0x3d4a('0x62')](_0x508f2e,_0x182208[_0x3d4a('0x7a')][_0x3e049c][_0x3d4a('0x2d')])&&_0x182208[_0x3d4a('0x7a')][_0x3e049c][_0x3d4a('0x7c')]&&_0x182208['joins'][_0x3e049c][_0x3d4a('0x7d')]&&_0x182208[_0x3d4a('0x7a')][_0x3e049c][_0x3d4a('0x7e')]){_0xf58c86[_0x182208['joins'][_0x3e049c]['type']](_0x182208[_0x3d4a('0x7a')][_0x3e049c]['foreignTable'],null,util[_0x3d4a('0x75')](_0x3d4a('0x8e'),_0x182208['table'],_0x182208[_0x3d4a('0x7a')][_0x3e049c][_0x3d4a('0x7c')],_0x182208[_0x3d4a('0x7a')][_0x3e049c]['foreignTable'],_0x182208[_0x3d4a('0x7a')][_0x3e049c][_0x3d4a('0x7e')]));}}}if(_0x182208[_0x3d4a('0x7f')]){_0x182208[_0x3d4a('0x7f')]=JSON[_0x3d4a('0x7b')](_0x182208[_0x3d4a('0x7f')]);_0xf58c86['where'](_0x31540a(_0x182208['conditions'][_0x3d4a('0x68')]));}_0x54ff53=_0xf58c86[_0x3d4a('0x80')]();_0xf58c86['limit'](_0x2a6c7e);_0xf58c86[_0x3d4a('0x1a')](0x0);logger[_0x3d4a('0x81')](_0x3d4a('0x82'),_0xf58c86['toString']());return dbH[_0x3d4a('0x84')][_0x3d4a('0x30')](_0xf58c86['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x3d4a('0x86')]});}})['then'](function(){return{'sql':_0x54ff53[_0x3d4a('0x83')]()};})[_0x3d4a('0x22')](respondWithResult(_0x1e5240,null))[_0x3d4a('0x50')](handleError(_0x1e5240,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 5b0feb9..04ec93f 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 _0x1e4c=['bluebird','request-promise','path','rimraf','../../config/environment','define','AnalyticCustomReport','lodash','util','../../config/logger','api'];(function(_0x59d42d,_0x44eddc){var _0x53ef8b=function(_0x21dee2){while(--_0x21dee2){_0x59d42d['push'](_0x59d42d['shift']());}};_0x53ef8b(++_0x44eddc);}(_0x1e4c,0xb7));var _0xc1e4=function(_0x1d611c,_0x5bf400){_0x1d611c=_0x1d611c-0x0;var _0x25da4f=_0x1e4c[_0x1d611c];return _0x25da4f;};'use strict';var _=require(_0xc1e4('0x0'));var util=require(_0xc1e4('0x1'));var logger=require(_0xc1e4('0x2'))(_0xc1e4('0x3'));var moment=require('moment');var BPromise=require(_0xc1e4('0x4'));var rp=require(_0xc1e4('0x5'));var fs=require('fs');var path=require(_0xc1e4('0x6'));var rimraf=require(_0xc1e4('0x7'));var config=require(_0xc1e4('0x8'));var attributes=require('./analyticCustomReport.attributes');module['exports']=function(_0x59b749,_0x28939a){return _0x59b749[_0xc1e4('0x9')](_0xc1e4('0xa'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2d72=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports'];(function(_0xbdc2be,_0x1b9b1e){var _0x3702cc=function(_0x2fde47){while(--_0x2fde47){_0xbdc2be['push'](_0xbdc2be['shift']());}};_0x3702cc(++_0x1b9b1e);}(_0x2d72,0xa8));var _0x22d7=function(_0x391cdd,_0x3c4065){_0x391cdd=_0x391cdd-0x0;var _0x111c4c=_0x2d72[_0x391cdd];return _0x111c4c;};'use strict';var _=require(_0x22d7('0x0'));var util=require(_0x22d7('0x1'));var logger=require(_0x22d7('0x2'))(_0x22d7('0x3'));var moment=require(_0x22d7('0x4'));var BPromise=require(_0x22d7('0x5'));var rp=require(_0x22d7('0x6'));var fs=require('fs');var path=require(_0x22d7('0x7'));var rimraf=require(_0x22d7('0x8'));var config=require(_0x22d7('0x9'));var attributes=require(_0x22d7('0xa'));module[_0x22d7('0xb')]=function(_0x208b5b,_0x100426){return _0x208b5b['define'](_0x22d7('0xc'),attributes,{'tableName':_0x22d7('0xd'),'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 81c15cc..a261e49 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 _0xc639=['message','result','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x36a8dd,_0x18263b){var _0x306e43=function(_0xe899c0){while(--_0xe899c0){_0x36a8dd['push'](_0x36a8dd['shift']());}};_0x306e43(++_0x18263b);}(_0xc639,0xc0));var _0x9c63=function(_0x4b7d4a,_0x25fb23){_0x4b7d4a=_0x4b7d4a-0x0;var _0x7ea5ad=_0xc639[_0x4b7d4a];return _0x7ea5ad;};'use strict';var _=require(_0x9c63('0x0'));var util=require('util');var moment=require(_0x9c63('0x1'));var BPromise=require(_0x9c63('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9c63('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9c63('0x4'));var logger=require(_0x9c63('0x5'))(_0x9c63('0x6'));var config=require(_0x9c63('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9c63('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x308cf3,_0x1b9365,_0x490321){return new BPromise(function(_0x506234,_0x52c13d){return client['request'](_0x308cf3,_0x490321)[_0x9c63('0x9')](function(_0x376245){logger['info'](_0x9c63('0xa'),_0x1b9365,_0x9c63('0xb'));logger[_0x9c63('0xc')](_0x9c63('0xd'),_0x1b9365,_0x9c63('0xb'),JSON[_0x9c63('0xe')](_0x376245));if(_0x376245[_0x9c63('0xf')]){if(_0x376245[_0x9c63('0xf')][_0x9c63('0x10')]===0x1f4){logger[_0x9c63('0xf')](_0x9c63('0xa'),_0x1b9365,_0x376245[_0x9c63('0xf')][_0x9c63('0x11')]);return _0x52c13d(_0x376245['error']['message']);}logger[_0x9c63('0xf')](_0x9c63('0xa'),_0x1b9365,_0x376245[_0x9c63('0xf')][_0x9c63('0x11')]);return _0x506234(_0x376245['error'][_0x9c63('0x11')]);}else{logger['info'](_0x9c63('0xa'),_0x1b9365,'request\x20sent');_0x506234(_0x376245[_0x9c63('0x12')]['message']);}})['catch'](function(_0xc0f75c){logger[_0x9c63('0xf')](_0x9c63('0xa'),_0x1b9365,_0xc0f75c);_0x52c13d(_0xc0f75c);});});}
\ No newline at end of file
+var _0xc090=['request\x20sent','debug','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0xb6b229,_0x3637b6){var _0x4aa2cf=function(_0x1a7d7f){while(--_0x1a7d7f){_0xb6b229['push'](_0xb6b229['shift']());}};_0x4aa2cf(++_0x3637b6);}(_0xc090,0x10c));var _0x0c09=function(_0x435470,_0x519a29){_0x435470=_0x435470-0x0;var _0x35ac9a=_0xc090[_0x435470];return _0x35ac9a;};'use strict';var _=require(_0x0c09('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0c09('0x1'));var rs=require(_0x0c09('0x2'));var fs=require('fs');var Redis=require(_0x0c09('0x3'));var db=require(_0x0c09('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0c09('0x5'))('rpc');var config=require(_0x0c09('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x0c09('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4bb58d,_0x12a03d,_0x746b9d){return new BPromise(function(_0xb3636f,_0x59eff2){return client[_0x0c09('0x8')](_0x4bb58d,_0x746b9d)[_0x0c09('0x9')](function(_0x2da373){logger[_0x0c09('0xa')](_0x0c09('0xb'),_0x12a03d,_0x0c09('0xc'));logger[_0x0c09('0xd')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x12a03d,_0x0c09('0xc'),JSON[_0x0c09('0xe')](_0x2da373));if(_0x2da373[_0x0c09('0xf')]){if(_0x2da373[_0x0c09('0xf')][_0x0c09('0x10')]===0x1f4){logger[_0x0c09('0xf')](_0x0c09('0xb'),_0x12a03d,_0x2da373['error'][_0x0c09('0x11')]);return _0x59eff2(_0x2da373[_0x0c09('0xf')][_0x0c09('0x11')]);}logger[_0x0c09('0xf')](_0x0c09('0xb'),_0x12a03d,_0x2da373['error']['message']);return _0xb3636f(_0x2da373[_0x0c09('0xf')][_0x0c09('0x11')]);}else{logger[_0x0c09('0xa')](_0x0c09('0xb'),_0x12a03d,_0x0c09('0xc'));_0xb3636f(_0x2da373[_0x0c09('0x12')][_0x0c09('0x11')]);}})[_0x0c09('0x13')](function(_0x28ce2c){logger['error'](_0x0c09('0xb'),_0x12a03d,_0x28ce2c);_0x59eff2(_0x28ce2c);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 64d7ee8..a205dd7 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 _0x7749=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','query','post','create','put','/:id','update','delete','destroy','connect-timeout'];(function(_0x44c431,_0x18137a){var _0x33447e=function(_0x401b57){while(--_0x401b57){_0x44c431['push'](_0x44c431['shift']());}};_0x33447e(++_0x18137a);}(_0x7749,0x179));var _0x9774=function(_0x227518,_0x3edf1c){_0x227518=_0x227518-0x0;var _0x46307b=_0x7749[_0x227518];return _0x46307b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x9774('0x0'));var express=require(_0x9774('0x1'));var router=express[_0x9774('0x2')]();var fs_extra=require(_0x9774('0x3'));var auth=require(_0x9774('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9774('0x5'));var controller=require('./analyticCustomReport.controller');router[_0x9774('0x6')]('/',auth[_0x9774('0x7')](),controller[_0x9774('0x8')]);router[_0x9774('0x6')]('/:id',auth[_0x9774('0x7')](),controller[_0x9774('0x9')]);router[_0x9774('0x6')](_0x9774('0xa'),auth[_0x9774('0x7')](),controller[_0x9774('0xb')]);router[_0x9774('0x6')](_0x9774('0xc'),auth['isAuthenticated'](),controller['run']);router[_0x9774('0x6')]('/:id/query',auth['isAuthenticated'](),controller[_0x9774('0xd')]);router[_0x9774('0xe')]('/',auth[_0x9774('0x7')](),controller[_0x9774('0xf')]);router[_0x9774('0x10')](_0x9774('0x11'),auth[_0x9774('0x7')](),controller[_0x9774('0x12')]);router[_0x9774('0x13')]('/:id',auth[_0x9774('0x7')](),controller[_0x9774('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x83a6=['/:id/query','query','post','create','put','/:id','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','run'];(function(_0x173060,_0xf5ad1){var _0x122cad=function(_0x10a570){while(--_0x10a570){_0x173060['push'](_0x173060['shift']());}};_0x122cad(++_0xf5ad1);}(_0x83a6,0x190));var _0x683a=function(_0x5703f6,_0x4910f9){_0x5703f6=_0x5703f6-0x0;var _0x5cf623=_0x83a6[_0x5703f6];return _0x5cf623;};'use strict';var multer=require(_0x683a('0x0'));var util=require('util');var path=require(_0x683a('0x1'));var timeout=require('connect-timeout');var express=require(_0x683a('0x2'));var router=express[_0x683a('0x3')]();var fs_extra=require(_0x683a('0x4'));var auth=require(_0x683a('0x5'));var interaction=require(_0x683a('0x6'));var config=require(_0x683a('0x7'));var controller=require('./analyticCustomReport.controller');router[_0x683a('0x8')]('/',auth[_0x683a('0x9')](),controller[_0x683a('0xa')]);router['get']('/:id',auth[_0x683a('0x9')](),controller[_0x683a('0xb')]);router['get'](_0x683a('0xc'),auth[_0x683a('0x9')](),controller[_0x683a('0xd')]);router[_0x683a('0x8')](_0x683a('0xe'),auth[_0x683a('0x9')](),controller[_0x683a('0xf')]);router[_0x683a('0x8')](_0x683a('0x10'),auth[_0x683a('0x9')](),controller[_0x683a('0x11')]);router[_0x683a('0x12')]('/',auth[_0x683a('0x9')](),controller[_0x683a('0x13')]);router[_0x683a('0x14')](_0x683a('0x15'),auth['isAuthenticated'](),controller[_0x683a('0x16')]);router[_0x683a('0x17')]('/:id',auth[_0x683a('0x9')](),controller[_0x683a('0x18')]);module[_0x683a('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 15b79b0..1f7c0b2 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 _0xdc97=['exports','STRING','TEXT','sequelize'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xdc97,0x13b));var _0x7dc9=function(_0x15546f,_0x7f1105){_0x15546f=_0x15546f-0x0;var _0x4859c7=_0xdc97[_0x15546f];return _0x4859c7;};'use strict';var Sequelize=require(_0x7dc9('0x0'));module[_0x7dc9('0x1')]={'name':{'type':Sequelize[_0x7dc9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x7dc9('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7dc9('0x3')]},'joins':{'type':Sequelize[_0x7dc9('0x3')]}};
\ No newline at end of file
+var _0xe14b=['exports','STRING','TEXT','sequelize'];(function(_0x53f6fb,_0x289c49){var _0x74a568=function(_0x197cba){while(--_0x197cba){_0x53f6fb['push'](_0x53f6fb['shift']());}};_0x74a568(++_0x289c49);}(_0xe14b,0x93));var _0xbe14=function(_0x5b16fa,_0x157f60){_0x5b16fa=_0x5b16fa-0x0;var _0x35dd49=_0xe14b[_0x5b16fa];return _0x35dd49;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xbe14('0x2')]},'table':{'type':Sequelize[_0xbe14('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xbe14('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 2e87544..0eb4a72 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 _0x5fc3=['QueryTypes','right_join','HOUR(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','dbH','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','DefaultReports','destroy','error','stack','name','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','groupBy','orderBy','order','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','format','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','sequelize','toString','SELECT','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','getFields','ValidationErrorItem','fullPath','%s-%s.%s','generate','output','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)'];(function(_0xdd5a91,_0x4d10ad){var _0x16c4c2=function(_0x4e4785){while(--_0x4e4785){_0xdd5a91['push'](_0xdd5a91['shift']());}};_0x16c4c2(++_0x4d10ad);}(_0x5fc3,0xa8));var _0x35fc=function(_0x135904,_0x1e252b){_0x135904=_0x135904-0x0;var _0x1ce7d5=_0x5fc3[_0x135904];return _0x1ce7d5;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x35fc('0x17')];function respondWithStatusCode(_0x5d462a,_0x397738){_0x397738=_0x397738||0xcc;return function(_0x22055e){if(_0x22055e){return _0x5d462a[_0x35fc('0x18')](_0x397738);}return _0x5d462a[_0x35fc('0x19')](_0x397738)[_0x35fc('0x1a')]();};}function respondWithResult(_0x5cfe94,_0x59507a){_0x59507a=_0x59507a||0xc8;return function(_0x5eac0f){if(_0x5eac0f){return _0x5cfe94['status'](_0x59507a)[_0x35fc('0x1b')](_0x5eac0f);}};}function respondWithFilteredResult(_0x229d56,_0x53b898){return function(_0x154958){if(_0x154958){var _0x227a49=typeof _0x53b898[_0x35fc('0x1c')]==='undefined'&&typeof _0x53b898[_0x35fc('0x1d')]===_0x35fc('0x1e');var _0x553677=_0x154958[_0x35fc('0x1f')];var _0x363e47=_0x227a49?0x0:_0x53b898[_0x35fc('0x1c')];var _0x5f56c6=_0x227a49?_0x154958[_0x35fc('0x1f')]:_0x53b898[_0x35fc('0x1c')]+_0x53b898[_0x35fc('0x1d')];var _0x488234;if(_0x5f56c6>=_0x553677){_0x5f56c6=_0x553677;_0x488234=0xc8;}else{_0x488234=0xce;}_0x229d56[_0x35fc('0x19')](_0x488234);return _0x229d56[_0x35fc('0x20')](_0x35fc('0x21'),_0x363e47+'-'+_0x5f56c6+'/'+_0x553677)[_0x35fc('0x1b')](_0x154958);}return null;};}function patchUpdates(_0x20ffde){return function(_0x21f1a9){try{jsonpatch[_0x35fc('0x22')](_0x21f1a9,_0x20ffde,!![]);}catch(_0x3b05b0){return BPromise[_0x35fc('0x23')](_0x3b05b0);}return _0x21f1a9[_0x35fc('0x24')]();};}function saveUpdates(_0x5bd2b8,_0x323aee){return function(_0xd5399f){if(_0xd5399f){return _0xd5399f[_0x35fc('0x25')](_0x5bd2b8)[_0x35fc('0x26')](function(_0x3b4743){return _0x3b4743;});}return null;};}function removeEntity(_0x55e9e7,_0x33f5e8){return function(_0x4c587a){if(_0x4c587a){return _0x4c587a['destroy']()[_0x35fc('0x26')](function(){var _0x5a93df=_0x4c587a[_0x35fc('0x27')]({'plain':!![]});var _0x51cfec=_0x35fc('0x28');return db['UserProfileResource'][_0x35fc('0x29')]({'where':{'type':_0x51cfec,'resourceId':_0x5a93df['id']}})[_0x35fc('0x26')](function(){return _0x4c587a;});})['then'](function(){_0x55e9e7['status'](0xcc)[_0x35fc('0x1a')]();});}};}function handleEntityNotFound(_0x58edb6,_0x274208){return function(_0x1a5d92){if(!_0x1a5d92){_0x58edb6['sendStatus'](0x194);}return _0x1a5d92;};}function handleError(_0x26b7cb,_0x645eac){_0x645eac=_0x645eac||0x1f4;return function(_0x383837){logger[_0x35fc('0x2a')](_0x383837[_0x35fc('0x2b')]);if(_0x383837[_0x35fc('0x2c')]){delete _0x383837[_0x35fc('0x2c')];}_0x26b7cb[_0x35fc('0x19')](_0x645eac)['send'](_0x383837);};}exports[_0x35fc('0x2d')]=function(_0x220931,_0x22af18){var _0x52acc5={},_0xe79f52={},_0x16f067={'count':0x0,'rows':[]};var _0x3822a8=_[_0x35fc('0x2e')](db[_0x35fc('0x2f')][_0x35fc('0x30')],function(_0x222ddb){return{'name':_0x222ddb[_0x35fc('0x31')],'type':_0x222ddb[_0x35fc('0x32')][_0x35fc('0x33')]};});_0xe79f52['model']=_['map'](_0x3822a8,_0x35fc('0x2c'));_0xe79f52['query']=_[_0x35fc('0x34')](_0x220931[_0x35fc('0x35')]);_0xe79f52[_0x35fc('0x36')]=_[_0x35fc('0x37')](_0xe79f52[_0x35fc('0x38')],_0xe79f52[_0x35fc('0x35')]);_0x52acc5['attributes']=_[_0x35fc('0x37')](_0xe79f52[_0x35fc('0x38')],qs[_0x35fc('0x39')](_0x220931[_0x35fc('0x35')][_0x35fc('0x39')]));_0x52acc5[_0x35fc('0x3a')]=_0x52acc5['attributes'][_0x35fc('0x3b')]?_0x52acc5[_0x35fc('0x3a')]:_0xe79f52[_0x35fc('0x38')];if(!_0x220931['query'][_0x35fc('0x3c')]('nolimit')){_0x52acc5[_0x35fc('0x1d')]=qs[_0x35fc('0x1d')](_0x220931[_0x35fc('0x35')][_0x35fc('0x1d')]);_0x52acc5['offset']=qs['offset'](_0x220931['query'][_0x35fc('0x1c')]);}_0x52acc5['order']=qs[_0x35fc('0x3d')](_0x220931['query'][_0x35fc('0x3d')]);_0x52acc5[_0x35fc('0x3e')]=qs[_0x35fc('0x36')](_[_0x35fc('0x3f')](_0x220931[_0x35fc('0x35')],_0xe79f52[_0x35fc('0x36')]),_0x3822a8);if(_0x220931[_0x35fc('0x35')]['filter']){_0x52acc5[_0x35fc('0x3e')]=_[_0x35fc('0x40')](_0x52acc5['where'],{'$or':_[_0x35fc('0x2e')](_0x3822a8,function(_0x1ccc41){if(_0x1ccc41[_0x35fc('0x32')]!==_0x35fc('0x41')){var _0x813866={};_0x813866[_0x1ccc41[_0x35fc('0x2c')]]={'$like':'%'+_0x220931['query'][_0x35fc('0x42')]+'%'};return _0x813866;}})});}_0x52acc5=_[_0x35fc('0x40')]({},_0x52acc5,_0x220931[_0x35fc('0x43')]);var _0x52543b={'where':_0x52acc5[_0x35fc('0x3e')]};return db[_0x35fc('0x2f')]['count'](_0x52543b)[_0x35fc('0x26')](function(_0x280af1){_0x16f067[_0x35fc('0x1f')]=_0x280af1;if(_0x220931[_0x35fc('0x35')][_0x35fc('0x44')]){_0x52acc5[_0x35fc('0x45')]=[{'all':!![]}];}return db[_0x35fc('0x2f')][_0x35fc('0x46')](_0x52acc5);})['then'](function(_0x596e83){_0x16f067[_0x35fc('0x47')]=_0x596e83;return _0x16f067;})[_0x35fc('0x26')](respondWithFilteredResult(_0x22af18,_0x52acc5))['catch'](handleError(_0x22af18,null));};exports['show']=function(_0x4ff202,_0x79677d){var _0x10f98b={'raw':!![],'where':{'id':_0x4ff202[_0x35fc('0x48')]['id']}},_0x4e56ed={};_0x4e56ed[_0x35fc('0x38')]=_[_0x35fc('0x34')](db[_0x35fc('0x2f')]['rawAttributes']);_0x4e56ed['query']=_['keys'](_0x4ff202['query']);_0x4e56ed['filters']=_[_0x35fc('0x37')](_0x4e56ed[_0x35fc('0x38')],_0x4e56ed['query']);_0x10f98b[_0x35fc('0x3a')]=_['intersection'](_0x4e56ed[_0x35fc('0x38')],qs[_0x35fc('0x39')](_0x4ff202[_0x35fc('0x35')][_0x35fc('0x39')]));_0x10f98b[_0x35fc('0x3a')]=_0x10f98b['attributes'][_0x35fc('0x3b')]?_0x10f98b[_0x35fc('0x3a')]:_0x4e56ed['model'];if(_0x4ff202[_0x35fc('0x35')][_0x35fc('0x44')]){_0x10f98b[_0x35fc('0x45')]=[{'all':!![]}];}_0x10f98b=_[_0x35fc('0x40')]({},_0x10f98b,_0x4ff202['options']);return db[_0x35fc('0x2f')]['find'](_0x10f98b)['then'](handleEntityNotFound(_0x79677d,null))[_0x35fc('0x26')](respondWithResult(_0x79677d,null))[_0x35fc('0x49')](handleError(_0x79677d,null));};exports[_0x35fc('0x4a')]=function(_0xca8aef,_0xf2ca20){return db[_0x35fc('0x2f')][_0x35fc('0x4a')](_0xca8aef[_0x35fc('0x4b')],{})['then'](function(_0x3e2961){var _0x91d7c0=_0xca8aef[_0x35fc('0x4c')][_0x35fc('0x27')]({'plain':!![]});if(!_0x91d7c0)throw new Error(_0x35fc('0x4d'));if(_0x91d7c0[_0x35fc('0x4e')]===_0x35fc('0x4c')){var _0x347a4a=_0x3e2961[_0x35fc('0x27')]({'plain':!![]});var _0xe6eb6a=_0x35fc('0x4f');return db[_0x35fc('0x50')][_0x35fc('0x51')]({'where':{'name':_0xe6eb6a,'userProfileId':_0x91d7c0[_0x35fc('0x52')]},'raw':!![]})['then'](function(_0x553ed6){if(_0x553ed6&&_0x553ed6[_0x35fc('0x53')]===0x0){return db[_0x35fc('0x54')][_0x35fc('0x4a')]({'name':_0x347a4a[_0x35fc('0x2c')],'resourceId':_0x347a4a['id'],'type':_0x35fc('0x28'),'sectionId':_0x553ed6['id']},{})[_0x35fc('0x26')](function(){return _0x3e2961;});}else{return _0x3e2961;}})['catch'](function(_0x4f024c){logger[_0x35fc('0x2a')](_0x35fc('0x55'),_0x4f024c);throw _0x4f024c;});}return _0x3e2961;})[_0x35fc('0x26')](respondWithResult(_0xf2ca20,0xc9))[_0x35fc('0x49')](handleError(_0xf2ca20,null));};exports['update']=function(_0x467980,_0x13281f){if(_0x467980['body']['id']){delete _0x467980[_0x35fc('0x4b')]['id'];}return db[_0x35fc('0x2f')]['find']({'where':{'id':_0x467980[_0x35fc('0x48')]['id']}})[_0x35fc('0x26')](handleEntityNotFound(_0x13281f,null))[_0x35fc('0x26')](saveUpdates(_0x467980[_0x35fc('0x4b')],null))['then'](respondWithResult(_0x13281f,null))['catch'](handleError(_0x13281f,null));};exports['destroy']=function(_0x240338,_0x2ea8d6){return db['AnalyticDefaultReport'][_0x35fc('0x51')]({'where':{'id':_0x240338[_0x35fc('0x48')]['id']}})[_0x35fc('0x26')](handleEntityNotFound(_0x2ea8d6,null))[_0x35fc('0x26')](removeEntity(_0x2ea8d6,null))[_0x35fc('0x49')](handleError(_0x2ea8d6,null));};exports['preview']=function(_0x2d9d45,_0x757aa6){var _0x39d470=0xa;var _0x509e77=[_0x35fc('0x56'),_0x35fc('0x57'),'right_join',_0x35fc('0x58')];var _0x164c7b={'SUM':_0x35fc('0x59'),'COUNT':_0x35fc('0x5a'),'COUNT DISTINCT':_0x35fc('0x5b'),'MAX':_0x35fc('0x5c'),'MIN':_0x35fc('0x5d'),'AVG':_0x35fc('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':_0x35fc('0x60')};var _0x303927={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x35fc('0x61'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x23b54f=function(_0xb1c68a){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xb1c68a);};var _0x5353ea=function(_0x4faef4){if(!_0x4faef4||!_0x4faef4['rules'][_0x35fc('0x3b')]){return'';}for(var _0x44250b='(',_0xd470e8=0x0;_0xd470e8<_0x4faef4[_0x35fc('0x65')]['length'];_0xd470e8+=0x1){_0xd470e8>0x0&&(_0x44250b+='\x20'+_0x4faef4[_0x35fc('0x66')]+'\x20');_0x44250b+=_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x67')]?_0x5353ea(_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x67')]):_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x68')]+'\x20'+_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x69')]+(_0x23b54f(_0x4faef4['rules'][_0xd470e8][_0x35fc('0x69')])?'\x20'+_0x4faef4['rules'][_0xd470e8][_0x35fc('0x6a')]:'');}return _0x44250b+')';};var _0x9029e3={'where':{'id':_0x2d9d45['params']['id']}},_0x2ac8e1,_0x2bc76c,_0x4bdde7,_0x465c14,_0x4af592;_0x9029e3=_['merge']({},_0x9029e3,_0x2d9d45[_0x35fc('0x43')]);return db['AnalyticDefaultReport'][_0x35fc('0x51')](_0x9029e3)['then'](function(_0x11717){if(_0x11717){_0x2ac8e1=_0x11717;return _0x11717['getFields']();}return null;})[_0x35fc('0x26')](function(_0x455b84){if(_0x455b84){if(!_0x455b84[_0x35fc('0x3b')]){throw new db[(_0x35fc('0x6b'))]['ValidationErrorItem'](_0x35fc('0x6c'),0x193);}_0x2bc76c=_0x455b84;return db[_0x35fc('0x6d')][_0x35fc('0x46')]({'raw':!![]});}return null;})['then'](function(_0x3aa7fa){if(_0x3aa7fa){_0x4bdde7=_[_0x35fc('0x6e')](_0x3aa7fa,'id');var _0x37764b;var _0x3c1b56=squel[_0x35fc('0x6f')]();_0x3c1b56[_0x35fc('0x70')](_0x2ac8e1[_0x35fc('0x71')]);for(var _0x4464d5=0x0;_0x4464d5<_0x2bc76c['length'];_0x4464d5+=0x1){_0x37764b=_0x2bc76c[_0x4464d5][_0x35fc('0x72')]?_0x4bdde7[_0x2bc76c[_0x4464d5][_0x35fc('0x72')]][_0x35fc('0x73')]:_0x2bc76c[_0x4464d5]['field'];_0x37764b=_0x2bc76c[_0x4464d5][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0x164c7b[_0x2bc76c[_0x4464d5]['function']],'%s',_0x37764b):_0x37764b;_0x37764b=_0x2bc76c[_0x4464d5]['format']?_[_0x35fc('0x75')](_0x303927[_0x2bc76c[_0x4464d5]['format']],'%s',_0x37764b):_0x37764b;if(_0x2bc76c[_0x4464d5][_0x35fc('0x76')]){_0x3c1b56[_0x35fc('0x67')](_0x37764b);}_0x2bc76c[_0x4464d5][_0x35fc('0x77')]&&_0x3c1b56[_0x35fc('0x78')](_0x37764b,_0x2bc76c[_0x4464d5][_0x35fc('0x77')]===_0x35fc('0x79')?![]:!![]);_0x3c1b56[_0x35fc('0x68')](_0x37764b,_0x2bc76c[_0x4464d5][_0x35fc('0x7a')]||_0x37764b);}if(_0x2ac8e1[_0x35fc('0x7b')]){_0x2ac8e1[_0x35fc('0x7b')]=JSON[_0x35fc('0x7c')](_0x2ac8e1[_0x35fc('0x7b')]);for(var _0x29f2b9=0x0;_0x29f2b9<_0x2ac8e1[_0x35fc('0x7b')][_0x35fc('0x3b')];_0x29f2b9+=0x1){if(_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')]&&_[_0x35fc('0x62')](_0x509e77,_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')])&&_0x2ac8e1['joins'][_0x29f2b9][_0x35fc('0x7d')]&&_0x2ac8e1['joins'][_0x29f2b9][_0x35fc('0x7e')]&&_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7f')]){_0x3c1b56[_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')]](_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7e')],null,util[_0x35fc('0x80')](_0x35fc('0x81'),_0x2ac8e1[_0x35fc('0x71')],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9]['parentKey'],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7e')],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7f')]));}}}if(_0x2ac8e1[_0x35fc('0x82')]){_0x2ac8e1[_0x35fc('0x82')]=JSON['parse'](_0x2ac8e1[_0x35fc('0x82')]);_0x3c1b56[_0x35fc('0x3e')](_0x5353ea(_0x2ac8e1[_0x35fc('0x82')][_0x35fc('0x67')]));}_0x4af592=_0x3c1b56[_0x35fc('0x83')]();_0x3c1b56[_0x35fc('0x1d')](_0x39d470);_0x3c1b56[_0x35fc('0x1c')](0x0);logger[_0x35fc('0x84')](_0x35fc('0x85'),_0x3c1b56['toString']());return dbH[_0x35fc('0x86')]['query'](_0x3c1b56[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')]['QueryTypes'][_0x35fc('0x88')]});}})[_0x35fc('0x26')](respondWithResult(_0x757aa6,null))[_0x35fc('0x49')](handleError(_0x757aa6,null));};function runReport(_0x4274d6,_0x4026cc,_0x1a765f){var _0x42f87e=_0x4026cc[_0x35fc('0x2c')];var _0x25ee61=0xa;var _0x5806bf=['join','left_join','right_join',_0x35fc('0x58')];var _0x23cf84={'SUM':_0x35fc('0x59'),'COUNT':_0x35fc('0x5a'),'COUNT DISTINCT':_0x35fc('0x5b'),'MAX':'MAX(%s)','MIN':_0x35fc('0x5d'),'AVG':_0x35fc('0x5e'),'GROUP_CONCAT':_0x35fc('0x89'),'GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x15e936={'SEC_TO_TIME':_0x35fc('0x8a'),'DATE':_0x35fc('0x61'),'HOUR':'HOUR(%s)','ROUND':_0x35fc('0x8b'),'UNIX_TIMESTAMP':_0x35fc('0x8c')};var _0x319033=function(_0x9fe765){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),_0x35fc('0x8d'),'IS\x20NOT\x20EMPTY'],_0x9fe765);};var _0x2faff7=function(_0xa2c5f8){if(!_0xa2c5f8||!_0xa2c5f8[_0x35fc('0x65')][_0x35fc('0x3b')]){return'';}for(var _0x221c5b='(',_0x1fcd36=0x0;_0x1fcd36<_0xa2c5f8['rules'][_0x35fc('0x3b')];_0x1fcd36+=0x1){_0x1fcd36>0x0&&(_0x221c5b+='\x20'+_0xa2c5f8['operator']+'\x20');_0x221c5b+=_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x67')]?_0x2faff7(_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x67')]):_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x68')]+'\x20'+_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x69')]+(_0x319033(_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x69')])?'\x20'+_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x6a')]:'');}return _0x221c5b+')';};var _0x5abdf9={'where':{'id':_0x4274d6['id']}},_0x5512f6,_0x487cb5,_0x23b261,_0x4c742c,_0x2fae26;_0x5abdf9=_[_0x35fc('0x40')]({},_0x5abdf9,_0x1a765f);return db[_0x35fc('0x2f')][_0x35fc('0x51')](_0x5abdf9)['then'](function(_0x28e80d){if(_0x28e80d){_0x5512f6=_0x28e80d;return _0x28e80d[_0x35fc('0x8e')]();}return null;})[_0x35fc('0x26')](function(_0x47c507){if(_0x47c507){if(!_0x47c507[_0x35fc('0x3b')]){throw new db[(_0x35fc('0x6b'))][(_0x35fc('0x8f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x487cb5=_0x47c507;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x35fc('0x26')](function(_0x2edb1b){if(_0x2edb1b){_0x23b261=_[_0x35fc('0x6e')](_0x2edb1b,'id');var _0x3858a9;var _0x4859be=squel[_0x35fc('0x6f')]();_0x4859be[_0x35fc('0x70')](_0x5512f6['table']);for(var _0x5849a0=0x0;_0x5849a0<_0x487cb5[_0x35fc('0x3b')];_0x5849a0+=0x1){_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x72')]?_0x23b261[_0x487cb5[_0x5849a0][_0x35fc('0x72')]]['metric']:_0x487cb5[_0x5849a0]['field'];_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0x23cf84[_0x487cb5[_0x5849a0]['function']],'%s',_0x3858a9):_0x3858a9;_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x80')]?_[_0x35fc('0x75')](_0x15e936[_0x487cb5[_0x5849a0][_0x35fc('0x80')]],'%s',_0x3858a9):_0x3858a9;if(_0x487cb5[_0x5849a0]['groupBy']){_0x4859be[_0x35fc('0x67')](_0x3858a9);}_0x487cb5[_0x5849a0][_0x35fc('0x77')]&&_0x4859be[_0x35fc('0x78')](_0x3858a9,_0x487cb5[_0x5849a0][_0x35fc('0x77')]==='DESC'?![]:!![]);_0x4859be[_0x35fc('0x68')](_0x3858a9,_0x487cb5[_0x5849a0][_0x35fc('0x7a')]||_0x3858a9);}if(_0x5512f6[_0x35fc('0x7b')]){_0x5512f6['joins']=JSON[_0x35fc('0x7c')](_0x5512f6[_0x35fc('0x7b')]);for(var _0x425f72=0x0;_0x425f72<_0x5512f6['joins'][_0x35fc('0x3b')];_0x425f72+=0x1){if(_0x5512f6[_0x35fc('0x7b')][_0x425f72]['type']&&_[_0x35fc('0x62')](_0x5806bf,_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x32')])&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7d')]&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')]&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7f')]){_0x4859be[_0x5512f6['joins'][_0x425f72][_0x35fc('0x32')]](_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')],null,util[_0x35fc('0x80')]('%s.%s\x20=\x20%s.%s',_0x5512f6[_0x35fc('0x71')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7d')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7f')]));}}}if(_0x5512f6[_0x35fc('0x82')]){_0x5512f6['conditions']=JSON['parse'](_0x5512f6[_0x35fc('0x82')]);_0x4859be[_0x35fc('0x3e')](_0x2faff7(_0x5512f6[_0x35fc('0x82')]['group']));}_0x2fae26=_0x4859be[_0x35fc('0x83')]();_0x4859be[_0x35fc('0x1d')](_0x25ee61);_0x4859be[_0x35fc('0x1c')](0x0);return;}})[_0x35fc('0x26')](function(){if(_0x4026cc['output']==='web'){return null;}var _0x379650=_['merge'](_0x4026cc,{'name':_0x4026cc[_0x35fc('0x90')]||_0x4026cc[_0x35fc('0x2c')]||_0x5512f6['name'],'basename':_0x42f87e,'savename':util['format'](_0x35fc('0x91'),_0x4026cc[_0x35fc('0x2c')]||_0x5512f6[_0x35fc('0x2c')],require('randomstring')[_0x35fc('0x92')](0x4),_0x4026cc[_0x35fc('0x93')]||_0x35fc('0x94')),'reportId':_0x5512f6['id'],'reportType':'default'});return db[_0x35fc('0x95')][_0x35fc('0x4a')](_0x379650,{'raw':!![]});})[_0x35fc('0x26')](function(_0x328e90){if(_0x5512f6['table']===_0x35fc('0x96')){_0x2fae26[_0x35fc('0x3e')](_0x5512f6[_0x35fc('0x71')]+_0x35fc('0x97'),_0x4026cc[_0x35fc('0x98')],_0x4026cc[_0x35fc('0x99')]);}else{_0x2fae26['where'](_0x5512f6[_0x35fc('0x71')]+_0x35fc('0x9a'),_0x4026cc['startDate'],_0x4026cc[_0x35fc('0x99')]);}if(_0x328e90){logger[_0x35fc('0x9b')]('Run\x20Query:',_0x2fae26[_0x35fc('0x87')]());require(_0x35fc('0x9c'))[_0x35fc('0x9d')](path[_0x35fc('0x56')](__dirname,_0x35fc('0x9e'),_0x328e90['output']),[_0x328e90['id'],_0x2fae26[_0x35fc('0x87')](),path[_0x35fc('0x56')](__dirname,_0x35fc('0x9f'),_0x328e90['savename']),_0x42f87e]);return _0x328e90;}else{var _0x1224cd=squel['select']();_0x1224cd['from']('('+_0x2fae26[_0x35fc('0x87')]()+')',_0x35fc('0xa0'));_0x1224cd[_0x35fc('0x68')](_0x35fc('0xa1'),_0x35fc('0x1f'));_0x2fae26['limit'](_0x4026cc[_0x35fc('0x1d')]||_0x25ee61);_0x2fae26[_0x35fc('0x1c')](_0x4026cc[_0x35fc('0x1c')]||0x0);return dbH['sequelize'][_0x35fc('0x35')](_0x1224cd[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')][_0x35fc('0xa2')][_0x35fc('0x88')]})['then'](function(_0x1a2d73){if(!_0x1a2d73[_0x35fc('0x3b')]){_0x4c742c=0x0;}else{_0x4c742c=_0x1a2d73[0x0]['count']||0x0;}return dbH['sequelize'][_0x35fc('0x35')](_0x2fae26[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')][_0x35fc('0xa2')][_0x35fc('0x88')]});})[_0x35fc('0x26')](function(_0x8c80ca){return{'rows':_0x8c80ca||[],'count':_0x4c742c};});}});}exports['run']=function(_0x5dc286,_0x146ce1){return runReport(_0x5dc286[_0x35fc('0x48')],_0x5dc286[_0x35fc('0x35')],_0x5dc286[_0x35fc('0x43')])[_0x35fc('0x26')](respondWithResult(_0x146ce1,null))['catch'](handleError(_0x146ce1,null));};exports['runReport']=runReport;exports[_0x35fc('0x35')]=function(_0x2451f2,_0x3fff79){var _0x1c6ce9=0xa;var _0x4b2079=['join',_0x35fc('0x57'),_0x35fc('0xa3'),_0x35fc('0x58')];var _0xd46d64={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x35fc('0x5b'),'MAX':_0x35fc('0x5c'),'MIN':'MIN(%s)','AVG':_0x35fc('0x5e'),'GROUP_CONCAT':_0x35fc('0x89'),'GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':_0x35fc('0x60')};var _0x274337={'SEC_TO_TIME':_0x35fc('0x8a'),'DATE':_0x35fc('0x61'),'HOUR':_0x35fc('0xa4'),'ROUND':_0x35fc('0x8b'),'UNIX_TIMESTAMP':_0x35fc('0x8c')};var _0x19ae76=function(_0x366a3b){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),_0x35fc('0x8d'),'IS\x20NOT\x20EMPTY'],_0x366a3b);};var _0x345026=function(_0x553f7d){if(!_0x553f7d||!_0x553f7d[_0x35fc('0x65')]['length']){return'';}for(var _0x5aa072='(',_0x3c96ef=0x0;_0x3c96ef<_0x553f7d[_0x35fc('0x65')][_0x35fc('0x3b')];_0x3c96ef+=0x1){_0x3c96ef>0x0&&(_0x5aa072+='\x20'+_0x553f7d['operator']+'\x20');_0x5aa072+=_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x67')]?_0x345026(_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x67')]):_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x68')]+'\x20'+_0x553f7d['rules'][_0x3c96ef]['condition']+(_0x19ae76(_0x553f7d[_0x35fc('0x65')][_0x3c96ef]['condition'])?'\x20'+_0x553f7d['rules'][_0x3c96ef][_0x35fc('0x6a')]:'');}return _0x5aa072+')';};var _0x48b826={'where':{'id':_0x2451f2[_0x35fc('0x48')]['id']}},_0x556f9a,_0x5ae83f,_0x450769,_0x5d461c,_0x355154;_0x48b826=_[_0x35fc('0x40')]({},_0x48b826,_0x2451f2[_0x35fc('0x43')]);return db[_0x35fc('0x2f')][_0x35fc('0x51')](_0x48b826)['then'](function(_0x522ff2){if(_0x522ff2){_0x556f9a=_0x522ff2;return _0x522ff2[_0x35fc('0x8e')]();}return null;})['then'](function(_0x233c94){if(_0x233c94){if(!_0x233c94[_0x35fc('0x3b')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5ae83f=_0x233c94;return db[_0x35fc('0x6d')][_0x35fc('0x46')]({'raw':!![]});}return null;})[_0x35fc('0x26')](function(_0x135e18){if(_0x135e18){_0x450769=_[_0x35fc('0x6e')](_0x135e18,'id');var _0x28525f;var _0x9116b1=squel[_0x35fc('0x6f')]();_0x9116b1['from'](_0x556f9a['table']);for(var _0x5cefdb=0x0;_0x5cefdb<_0x5ae83f['length'];_0x5cefdb+=0x1){_0x28525f=_0x5ae83f[_0x5cefdb][_0x35fc('0x72')]?_0x450769[_0x5ae83f[_0x5cefdb]['MetricId']][_0x35fc('0x73')]:_0x5ae83f[_0x5cefdb]['field'];_0x28525f=_0x5ae83f[_0x5cefdb][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0xd46d64[_0x5ae83f[_0x5cefdb]['function']],'%s',_0x28525f):_0x28525f;_0x28525f=_0x5ae83f[_0x5cefdb]['format']?_[_0x35fc('0x75')](_0x274337[_0x5ae83f[_0x5cefdb][_0x35fc('0x80')]],'%s',_0x28525f):_0x28525f;if(_0x5ae83f[_0x5cefdb][_0x35fc('0x76')]){_0x9116b1[_0x35fc('0x67')](_0x28525f);}_0x5ae83f[_0x5cefdb][_0x35fc('0x77')]&&_0x9116b1['order'](_0x28525f,_0x5ae83f[_0x5cefdb]['orderBy']===_0x35fc('0x79')?![]:!![]);_0x9116b1['field'](_0x28525f,_0x5ae83f[_0x5cefdb][_0x35fc('0x7a')]||_0x28525f);}if(_0x556f9a['joins']){_0x556f9a[_0x35fc('0x7b')]=JSON[_0x35fc('0x7c')](_0x556f9a[_0x35fc('0x7b')]);for(var _0x10e30e=0x0;_0x10e30e<_0x556f9a['joins'][_0x35fc('0x3b')];_0x10e30e+=0x1){if(_0x556f9a['joins'][_0x10e30e][_0x35fc('0x32')]&&_['includes'](_0x4b2079,_0x556f9a['joins'][_0x10e30e][_0x35fc('0x32')])&&_0x556f9a['joins'][_0x10e30e][_0x35fc('0x7d')]&&_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')]&&_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7f')]){_0x9116b1[_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x32')]](_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')],null,util['format'](_0x35fc('0x81'),_0x556f9a[_0x35fc('0x71')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7d')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7f')]));}}}if(_0x556f9a['conditions']){_0x556f9a['conditions']=JSON['parse'](_0x556f9a['conditions']);_0x9116b1['where'](_0x345026(_0x556f9a[_0x35fc('0x82')][_0x35fc('0x67')]));}_0x355154=_0x9116b1[_0x35fc('0x83')]();_0x9116b1[_0x35fc('0x1d')](_0x1c6ce9);_0x9116b1[_0x35fc('0x1c')](0x0);logger['debug'](_0x35fc('0x85'),_0x9116b1[_0x35fc('0x87')]());return dbH[_0x35fc('0x86')][_0x35fc('0x35')](_0x9116b1[_0x35fc('0x87')](),{'type':dbH['sequelize'][_0x35fc('0xa2')][_0x35fc('0x88')]});}})[_0x35fc('0x26')](function(){return{'sql':_0x355154['toString']()};})[_0x35fc('0x26')](respondWithResult(_0x3fff79,null))[_0x35fc('0x49')](handleError(_0x3fff79,null));};
\ No newline at end of file
+var _0xc4aa=['Content-Range','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','AnalyticDefaultReport','findAll','rows','catch','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','alias','includes','foreignKey','output','web','fullPath','%s-%s.%s','randomstring','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','countTable','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x1a73f7,_0x274c12){var _0x3570fa=function(_0xdb9fc0){while(--_0xdb9fc0){_0x1a73f7['push'](_0x1a73f7['shift']());}};_0x3570fa(++_0x274c12);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xc4aa[_0x5c2e3e];return _0x53f64a;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];var dbH=require(_0xac4a('0x16'))['dbH'];function respondWithStatusCode(_0x21a79,_0x68424a){_0x68424a=_0x68424a||0xcc;return function(_0x247b78){if(_0x247b78){return _0x21a79[_0xac4a('0x17')](_0x68424a);}return _0x21a79[_0xac4a('0x18')](_0x68424a)[_0xac4a('0x19')]();};}function respondWithResult(_0x34bc01,_0x33c287){_0x33c287=_0x33c287||0xc8;return function(_0x190418){if(_0x190418){return _0x34bc01[_0xac4a('0x18')](_0x33c287)[_0xac4a('0x1a')](_0x190418);}};}function respondWithFilteredResult(_0x26dbb8,_0x4a2119){return function(_0x402fff){if(_0x402fff){var _0x34d797=typeof _0x4a2119[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x4a2119[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x28e304=_0x402fff[_0xac4a('0x1e')];var _0x546c5d=_0x34d797?0x0:_0x4a2119['offset'];var _0x21a729=_0x34d797?_0x402fff[_0xac4a('0x1e')]:_0x4a2119[_0xac4a('0x1b')]+_0x4a2119['limit'];var _0x39e83e;if(_0x21a729>=_0x28e304){_0x21a729=_0x28e304;_0x39e83e=0xc8;}else{_0x39e83e=0xce;}_0x26dbb8[_0xac4a('0x18')](_0x39e83e);return _0x26dbb8[_0xac4a('0x1f')](_0xac4a('0x20'),_0x546c5d+'-'+_0x21a729+'/'+_0x28e304)[_0xac4a('0x1a')](_0x402fff);}return null;};}function patchUpdates(_0x3e829c){return function(_0xe38996){try{jsonpatch[_0xac4a('0x21')](_0xe38996,_0x3e829c,!![]);}catch(_0x534092){return BPromise[_0xac4a('0x22')](_0x534092);}return _0xe38996[_0xac4a('0x23')]();};}function saveUpdates(_0x599787,_0x3d7ce0){return function(_0x4169c0){if(_0x4169c0){return _0x4169c0[_0xac4a('0x24')](_0x599787)[_0xac4a('0x25')](function(_0x4d2d6c){return _0x4d2d6c;});}return null;};}function removeEntity(_0x1b7998,_0x2503d8){return function(_0x15435c){if(_0x15435c){return _0x15435c[_0xac4a('0x26')]()[_0xac4a('0x25')](function(){var _0x2b0dc2=_0x15435c[_0xac4a('0x27')]({'plain':!![]});var _0x36054a=_0xac4a('0x28');return db[_0xac4a('0x29')][_0xac4a('0x26')]({'where':{'type':_0x36054a,'resourceId':_0x2b0dc2['id']}})[_0xac4a('0x25')](function(){return _0x15435c;});})[_0xac4a('0x25')](function(){_0x1b7998[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x20202c,_0x4e17ce){return function(_0x23b061){if(!_0x23b061){_0x20202c[_0xac4a('0x17')](0x194);}return _0x23b061;};}function handleError(_0x42a33c,_0x2772fe){_0x2772fe=_0x2772fe||0x1f4;return function(_0x116700){logger['error'](_0x116700['stack']);if(_0x116700[_0xac4a('0x2a')]){delete _0x116700[_0xac4a('0x2a')];}_0x42a33c[_0xac4a('0x18')](_0x2772fe)['send'](_0x116700);};}exports['index']=function(_0x355755,_0x2896bc){var _0x228629={},_0x432066={},_0x17118e={'count':0x0,'rows':[]};var _0x53d3a5=_[_0xac4a('0x2b')](db['AnalyticDefaultReport'][_0xac4a('0x2c')],function(_0x57adcf){return{'name':_0x57adcf[_0xac4a('0x2d')],'type':_0x57adcf[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x432066[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0x53d3a5,_0xac4a('0x2a'));_0x432066[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x355755[_0xac4a('0x31')]);_0x432066[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x432066[_0xac4a('0x30')],_0x432066[_0xac4a('0x31')]);_0x228629[_0xac4a('0x35')]=_['intersection'](_0x432066[_0xac4a('0x30')],qs[_0xac4a('0x36')](_0x355755['query'][_0xac4a('0x36')]));_0x228629[_0xac4a('0x35')]=_0x228629['attributes']['length']?_0x228629[_0xac4a('0x35')]:_0x432066[_0xac4a('0x30')];if(!_0x355755[_0xac4a('0x31')][_0xac4a('0x37')]('nolimit')){_0x228629[_0xac4a('0x1d')]=qs[_0xac4a('0x1d')](_0x355755['query'][_0xac4a('0x1d')]);_0x228629[_0xac4a('0x1b')]=qs[_0xac4a('0x1b')](_0x355755['query'][_0xac4a('0x1b')]);}_0x228629[_0xac4a('0x38')]=qs[_0xac4a('0x39')](_0x355755['query'][_0xac4a('0x39')]);_0x228629[_0xac4a('0x3a')]=qs['filters'](_['pick'](_0x355755[_0xac4a('0x31')],_0x432066['filters']),_0x53d3a5);if(_0x355755['query']['filter']){_0x228629['where']=_[_0xac4a('0x3b')](_0x228629[_0xac4a('0x3a')],{'$or':_[_0xac4a('0x2b')](_0x53d3a5,function(_0x472484){if(_0x472484[_0xac4a('0x2e')]!==_0xac4a('0x3c')){var _0x4220e2={};_0x4220e2[_0x472484[_0xac4a('0x2a')]]={'$like':'%'+_0x355755[_0xac4a('0x31')][_0xac4a('0x3d')]+'%'};return _0x4220e2;}})});}_0x228629=_[_0xac4a('0x3b')]({},_0x228629,_0x355755[_0xac4a('0x3e')]);var _0x4e4994={'where':_0x228629['where']};return db['AnalyticDefaultReport'][_0xac4a('0x1e')](_0x4e4994)[_0xac4a('0x25')](function(_0x14e80b){_0x17118e[_0xac4a('0x1e')]=_0x14e80b;if(_0x355755[_0xac4a('0x31')][_0xac4a('0x3f')]){_0x228629[_0xac4a('0x40')]=[{'all':!![]}];}return db[_0xac4a('0x41')][_0xac4a('0x42')](_0x228629);})[_0xac4a('0x25')](function(_0x561cb7){_0x17118e[_0xac4a('0x43')]=_0x561cb7;return _0x17118e;})[_0xac4a('0x25')](respondWithFilteredResult(_0x2896bc,_0x228629))[_0xac4a('0x44')](handleError(_0x2896bc,null));};exports[_0xac4a('0x45')]=function(_0x1a96cf,_0x57b879){var _0x8700b4={'raw':!![],'where':{'id':_0x1a96cf['params']['id']}},_0x1b77bb={};_0x1b77bb[_0xac4a('0x30')]=_['keys'](db[_0xac4a('0x41')][_0xac4a('0x2c')]);_0x1b77bb[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x1a96cf[_0xac4a('0x31')]);_0x1b77bb[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],_0x1b77bb[_0xac4a('0x31')]);_0x8700b4[_0xac4a('0x35')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],qs['fields'](_0x1a96cf[_0xac4a('0x31')][_0xac4a('0x36')]));_0x8700b4[_0xac4a('0x35')]=_0x8700b4['attributes'][_0xac4a('0x46')]?_0x8700b4[_0xac4a('0x35')]:_0x1b77bb['model'];if(_0x1a96cf[_0xac4a('0x31')]['includeAll']){_0x8700b4[_0xac4a('0x40')]=[{'all':!![]}];}_0x8700b4=_[_0xac4a('0x3b')]({},_0x8700b4,_0x1a96cf[_0xac4a('0x3e')]);return db['AnalyticDefaultReport']['find'](_0x8700b4)[_0xac4a('0x25')](handleEntityNotFound(_0x57b879,null))['then'](respondWithResult(_0x57b879,null))[_0xac4a('0x44')](handleError(_0x57b879,null));};exports['create']=function(_0x3d2aaf,_0x530bbb){return db[_0xac4a('0x41')][_0xac4a('0x47')](_0x3d2aaf[_0xac4a('0x48')],{})[_0xac4a('0x25')](function(_0x54782f){var _0x31c794=_0x3d2aaf[_0xac4a('0x49')][_0xac4a('0x27')]({'plain':!![]});if(!_0x31c794)throw new Error(_0xac4a('0x4a'));if(_0x31c794[_0xac4a('0x4b')]===_0xac4a('0x49')){var _0x187306=_0x54782f['get']({'plain':!![]});var _0x35dee5=_0xac4a('0x4c');return db['UserProfileSection'][_0xac4a('0x4d')]({'where':{'name':_0x35dee5,'userProfileId':_0x31c794[_0xac4a('0x4e')]},'raw':!![]})[_0xac4a('0x25')](function(_0x3ac36e){if(_0x3ac36e&&_0x3ac36e['autoAssociation']===0x0){return db[_0xac4a('0x29')][_0xac4a('0x47')]({'name':_0x187306[_0xac4a('0x2a')],'resourceId':_0x187306['id'],'type':_0xac4a('0x28'),'sectionId':_0x3ac36e['id']},{})[_0xac4a('0x25')](function(){return _0x54782f;});}else{return _0x54782f;}})['catch'](function(_0x179373){logger['error'](_0xac4a('0x4f'),_0x179373);throw _0x179373;});}return _0x54782f;})[_0xac4a('0x25')](respondWithResult(_0x530bbb,0xc9))['catch'](handleError(_0x530bbb,null));};exports['update']=function(_0x437466,_0x70fdc3){if(_0x437466['body']['id']){delete _0x437466[_0xac4a('0x48')]['id'];}return db[_0xac4a('0x41')][_0xac4a('0x4d')]({'where':{'id':_0x437466[_0xac4a('0x50')]['id']}})['then'](handleEntityNotFound(_0x70fdc3,null))[_0xac4a('0x25')](saveUpdates(_0x437466[_0xac4a('0x48')],null))[_0xac4a('0x25')](respondWithResult(_0x70fdc3,null))[_0xac4a('0x44')](handleError(_0x70fdc3,null));};exports[_0xac4a('0x26')]=function(_0x411547,_0x36179a){return db['AnalyticDefaultReport'][_0xac4a('0x4d')]({'where':{'id':_0x411547[_0xac4a('0x50')]['id']}})[_0xac4a('0x25')](handleEntityNotFound(_0x36179a,null))[_0xac4a('0x25')](removeEntity(_0x36179a,null))[_0xac4a('0x44')](handleError(_0x36179a,null));};exports[_0xac4a('0x51')]=function(_0x213df2,_0x236f57){var _0x159e43=0xa;var _0x786d9=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x5222f3={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xac4a('0x57'),'MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x5cac9b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x2f9940=function(_0xb7b884){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),'IS\x20NOT\x20EMPTY'],_0xb7b884);};var _0x347880=function(_0x19ce2c){if(!_0x19ce2c||!_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x429273='(',_0x2bc39a=0x0;_0x2bc39a<_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')];_0x2bc39a+=0x1){_0x2bc39a>0x0&&(_0x429273+='\x20'+_0x19ce2c[_0xac4a('0x62')]+'\x20');_0x429273+=_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]?_0x347880(_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]):_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x64')]+'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x65')]+(_0x2f9940(_0x19ce2c['rules'][_0x2bc39a][_0xac4a('0x65')])?'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a]['value']:'');}return _0x429273+')';};var _0x3c3576={'where':{'id':_0x213df2['params']['id']}},_0x34bd1c,_0x2d24c7,_0x2b8562,_0x357cac,_0x4d1440;_0x3c3576=_[_0xac4a('0x3b')]({},_0x3c3576,_0x213df2[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x3c3576)[_0xac4a('0x25')](function(_0x21ef8b){if(_0x21ef8b){_0x34bd1c=_0x21ef8b;return _0x21ef8b[_0xac4a('0x66')]();}return null;})[_0xac4a('0x25')](function(_0x44c60b){if(_0x44c60b){if(!_0x44c60b[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d24c7=_0x44c60b;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x423f70){if(_0x423f70){_0x2b8562=_[_0xac4a('0x69')](_0x423f70,'id');var _0x283107;var _0x1d24bb=squel[_0xac4a('0x6a')]();_0x1d24bb[_0xac4a('0x6b')](_0x34bd1c[_0xac4a('0x6c')]);for(var _0xb09b89=0x0;_0xb09b89<_0x2d24c7[_0xac4a('0x46')];_0xb09b89+=0x1){_0x283107=_0x2d24c7[_0xb09b89]['MetricId']?_0x2b8562[_0x2d24c7[_0xb09b89][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x2d24c7[_0xb09b89][_0xac4a('0x64')];_0x283107=_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]?_['replace'](_0x5222f3[_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]],'%s',_0x283107):_0x283107;_0x283107=_0x2d24c7[_0xb09b89]['format']?_[_0xac4a('0x70')](_0x5cac9b[_0x2d24c7[_0xb09b89][_0xac4a('0x71')]],'%s',_0x283107):_0x283107;if(_0x2d24c7[_0xb09b89]['groupBy']){_0x1d24bb['group'](_0x283107);}_0x2d24c7[_0xb09b89][_0xac4a('0x72')]&&_0x1d24bb[_0xac4a('0x38')](_0x283107,_0x2d24c7[_0xb09b89][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x1d24bb[_0xac4a('0x64')](_0x283107,_0x2d24c7[_0xb09b89]['alias']||_0x283107);}if(_0x34bd1c[_0xac4a('0x73')]){_0x34bd1c['joins']=JSON['parse'](_0x34bd1c[_0xac4a('0x73')]);for(var _0x56ef2a=0x0;_0x56ef2a<_0x34bd1c[_0xac4a('0x73')]['length'];_0x56ef2a+=0x1){if(_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x2e')]&&_['includes'](_0x786d9,_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type'])&&_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x74')]&&_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')]&&_0x34bd1c['joins'][_0x56ef2a]['foreignKey']){_0x1d24bb[_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type']](_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignTable'],null,util['format'](_0xac4a('0x76'),_0x34bd1c[_0xac4a('0x6c')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['parentKey'],_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignKey']));}}}if(_0x34bd1c['conditions']){_0x34bd1c[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x34bd1c[_0xac4a('0x77')]);_0x1d24bb[_0xac4a('0x3a')](_0x347880(_0x34bd1c[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x4d1440=_0x1d24bb[_0xac4a('0x79')]();_0x1d24bb[_0xac4a('0x1d')](_0x159e43);_0x1d24bb[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x1d24bb[_0xac4a('0x7b')]());return dbH[_0xac4a('0x7c')]['query'](_0x1d24bb[_0xac4a('0x7b')](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')][_0xac4a('0x7e')]});}})[_0xac4a('0x25')](respondWithResult(_0x236f57,null))['catch'](handleError(_0x236f57,null));};function runReport(_0x290a73,_0x19ce24,_0xc9d040){var _0x37e519=_0x19ce24[_0xac4a('0x2a')];var _0x451248=0xa;var _0xd7bdd6=['join',_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x35a97c={'SUM':_0xac4a('0x56'),'COUNT':_0xac4a('0x7f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xac4a('0x80'),'MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x56a934={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x212a22=function(_0x1fe86a){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),_0xac4a('0x83')],_0x1fe86a);};var _0x406b64=function(_0x35328e){if(!_0x35328e||!_0x35328e[_0xac4a('0x61')]['length']){return'';}for(var _0x50f471='(',_0x31cda0=0x0;_0x31cda0<_0x35328e[_0xac4a('0x61')][_0xac4a('0x46')];_0x31cda0+=0x1){_0x31cda0>0x0&&(_0x50f471+='\x20'+_0x35328e[_0xac4a('0x62')]+'\x20');_0x50f471+=_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]?_0x406b64(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]):_0x35328e['rules'][_0x31cda0]['field']+'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')]+(_0x212a22(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')])?'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x84')]:'');}return _0x50f471+')';};var _0xdaa2ef={'where':{'id':_0x290a73['id']}},_0x2e704b,_0x540d8e,_0x5e0be4,_0x32fd0c,_0x168f30;_0xdaa2ef=_[_0xac4a('0x3b')]({},_0xdaa2ef,_0xc9d040);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0xdaa2ef)[_0xac4a('0x25')](function(_0x338af3){if(_0x338af3){_0x2e704b=_0x338af3;return _0x338af3['getFields']();}return null;})[_0xac4a('0x25')](function(_0x1bacf2){if(_0x1bacf2){if(!_0x1bacf2[_0xac4a('0x46')]){throw new db['Sequelize'][(_0xac4a('0x85'))](_0xac4a('0x86'),0x193);}_0x540d8e=_0x1bacf2;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x27d023){if(_0x27d023){_0x5e0be4=_[_0xac4a('0x69')](_0x27d023,'id');var _0x2ef42a;var _0x322465=squel['select']();_0x322465[_0xac4a('0x6b')](_0x2e704b['table']);for(var _0x203321=0x0;_0x203321<_0x540d8e[_0xac4a('0x46')];_0x203321+=0x1){_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6d')]?_0x5e0be4[_0x540d8e[_0x203321][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x540d8e[_0x203321][_0xac4a('0x64')];_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6f')]?_['replace'](_0x35a97c[_0x540d8e[_0x203321][_0xac4a('0x6f')]],'%s',_0x2ef42a):_0x2ef42a;_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x71')]?_[_0xac4a('0x70')](_0x56a934[_0x540d8e[_0x203321][_0xac4a('0x71')]],'%s',_0x2ef42a):_0x2ef42a;if(_0x540d8e[_0x203321][_0xac4a('0x87')]){_0x322465['group'](_0x2ef42a);}_0x540d8e[_0x203321][_0xac4a('0x72')]&&_0x322465[_0xac4a('0x38')](_0x2ef42a,_0x540d8e[_0x203321]['orderBy']==='DESC'?![]:!![]);_0x322465[_0xac4a('0x64')](_0x2ef42a,_0x540d8e[_0x203321][_0xac4a('0x88')]||_0x2ef42a);}if(_0x2e704b['joins']){_0x2e704b[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x73')]);for(var _0x37657e=0x0;_0x37657e<_0x2e704b[_0xac4a('0x73')][_0xac4a('0x46')];_0x37657e+=0x1){if(_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]&&_[_0xac4a('0x89')](_0xd7bdd6,_0x2e704b[_0xac4a('0x73')][_0x37657e]['type'])&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x74')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x75')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x8a')]){_0x322465[_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]](_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],null,util[_0xac4a('0x71')]('%s.%s\x20=\x20%s.%s',_0x2e704b[_0xac4a('0x6c')],_0x2e704b[_0xac4a('0x73')][_0x37657e]['parentKey'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignKey']));}}}if(_0x2e704b[_0xac4a('0x77')]){_0x2e704b[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x77')]);_0x322465[_0xac4a('0x3a')](_0x406b64(_0x2e704b[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x168f30=_0x322465[_0xac4a('0x79')]();_0x322465[_0xac4a('0x1d')](_0x451248);_0x322465[_0xac4a('0x1b')](0x0);return;}})[_0xac4a('0x25')](function(){if(_0x19ce24[_0xac4a('0x8b')]===_0xac4a('0x8c')){return null;}var _0x4217df=_['merge'](_0x19ce24,{'name':_0x19ce24[_0xac4a('0x8d')]||_0x19ce24[_0xac4a('0x2a')]||_0x2e704b['name'],'basename':_0x37e519,'savename':util[_0xac4a('0x71')](_0xac4a('0x8e'),_0x19ce24[_0xac4a('0x2a')]||_0x2e704b[_0xac4a('0x2a')],require(_0xac4a('0x8f'))['generate'](0x4),_0x19ce24[_0xac4a('0x8b')]||'csv'),'reportId':_0x2e704b['id'],'reportType':_0xac4a('0x90')});return db[_0xac4a('0x91')][_0xac4a('0x47')](_0x4217df,{'raw':!![]});})[_0xac4a('0x25')](function(_0x53f23d){if(_0x2e704b[_0xac4a('0x6c')]==='cdr'){_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+_0xac4a('0x92'),_0x19ce24['startDate'],_0x19ce24[_0xac4a('0x93')]);}else{_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19ce24[_0xac4a('0x94')],_0x19ce24[_0xac4a('0x93')]);}if(_0x53f23d){logger[_0xac4a('0x95')](_0xac4a('0x96'),_0x168f30[_0xac4a('0x7b')]());require(_0xac4a('0x97'))[_0xac4a('0x98')](path[_0xac4a('0x52')](__dirname,'../../components/export/',_0x53f23d[_0xac4a('0x8b')]),[_0x53f23d['id'],_0x168f30['toString'](),path['join'](__dirname,'../../files/reports',_0x53f23d['savename']),_0x37e519]);return _0x53f23d;}else{var _0x502275=squel[_0xac4a('0x6a')]();_0x502275[_0xac4a('0x6b')]('('+_0x168f30[_0xac4a('0x7b')]()+')',_0xac4a('0x99'));_0x502275[_0xac4a('0x64')]('COUNT(*)',_0xac4a('0x1e'));_0x168f30[_0xac4a('0x1d')](_0x19ce24[_0xac4a('0x1d')]||_0x451248);_0x168f30[_0xac4a('0x1b')](_0x19ce24[_0xac4a('0x1b')]||0x0);return dbH[_0xac4a('0x7c')][_0xac4a('0x31')](_0x502275[_0xac4a('0x7b')](),{'type':dbH['sequelize'][_0xac4a('0x7d')][_0xac4a('0x7e')]})[_0xac4a('0x25')](function(_0x25331f){if(!_0x25331f[_0xac4a('0x46')]){_0x32fd0c=0x0;}else{_0x32fd0c=_0x25331f[0x0][_0xac4a('0x1e')]||0x0;}return dbH[_0xac4a('0x7c')]['query'](_0x168f30['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});})[_0xac4a('0x25')](function(_0x366f5a){return{'rows':_0x366f5a||[],'count':_0x32fd0c};});}});}exports['run']=function(_0x5bd013,_0x2fe103){return runReport(_0x5bd013[_0xac4a('0x50')],_0x5bd013[_0xac4a('0x31')],_0x5bd013[_0xac4a('0x3e')])[_0xac4a('0x25')](respondWithResult(_0x2fe103,null))['catch'](handleError(_0x2fe103,null));};exports[_0xac4a('0x9a')]=runReport;exports['query']=function(_0x4f2d85,_0x538cfd){var _0x63c30=0xa;var _0x4301c3=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0xcad25d={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':_0xac4a('0x9b'),'GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0xcd140e={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x37cb49=function(_0xe0fd57){return!_[_0xac4a('0x89')]([_0xac4a('0x5f'),_0xac4a('0x9c'),_0xac4a('0x60'),_0xac4a('0x83')],_0xe0fd57);};var _0x41cdb5=function(_0x172d03){if(!_0x172d03||!_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x3e2575='(',_0x4cc581=0x0;_0x4cc581<_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')];_0x4cc581+=0x1){_0x4cc581>0x0&&(_0x3e2575+='\x20'+_0x172d03[_0xac4a('0x62')]+'\x20');_0x3e2575+=_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]?_0x41cdb5(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]):_0x172d03[_0xac4a('0x61')][_0x4cc581]['field']+'\x20'+_0x172d03['rules'][_0x4cc581][_0xac4a('0x65')]+(_0x37cb49(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x65')])?'\x20'+_0x172d03['rules'][_0x4cc581]['value']:'');}return _0x3e2575+')';};var _0x5de198={'where':{'id':_0x4f2d85[_0xac4a('0x50')]['id']}},_0x2b6773,_0x52df82,_0x59e82c,_0x216055,_0x52963c;_0x5de198=_['merge']({},_0x5de198,_0x4f2d85[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x5de198)[_0xac4a('0x25')](function(_0x403a16){if(_0x403a16){_0x2b6773=_0x403a16;return _0x403a16[_0xac4a('0x66')]();}return null;})['then'](function(_0x25bf23){if(_0x25bf23){if(!_0x25bf23[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem'](_0xac4a('0x86'),0x193);}_0x52df82=_0x25bf23;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x5bb911){if(_0x5bb911){_0x59e82c=_[_0xac4a('0x69')](_0x5bb911,'id');var _0x403f5a;var _0x3eae2f=squel[_0xac4a('0x6a')]();_0x3eae2f[_0xac4a('0x6b')](_0x2b6773[_0xac4a('0x6c')]);for(var _0x4a0cd9=0x0;_0x4a0cd9<_0x52df82['length'];_0x4a0cd9+=0x1){_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]?_0x59e82c[_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x52df82[_0x4a0cd9][_0xac4a('0x64')];_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6f')]?_[_0xac4a('0x70')](_0xcad25d[_0x52df82[_0x4a0cd9]['function']],'%s',_0x403f5a):_0x403f5a;_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x71')]?_['replace'](_0xcd140e[_0x52df82[_0x4a0cd9][_0xac4a('0x71')]],'%s',_0x403f5a):_0x403f5a;if(_0x52df82[_0x4a0cd9]['groupBy']){_0x3eae2f[_0xac4a('0x63')](_0x403f5a);}_0x52df82[_0x4a0cd9][_0xac4a('0x72')]&&_0x3eae2f[_0xac4a('0x38')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x3eae2f[_0xac4a('0x64')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x88')]||_0x403f5a);}if(_0x2b6773[_0xac4a('0x73')]){_0x2b6773[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2b6773['joins']);for(var _0x3dd60a=0x0;_0x3dd60a<_0x2b6773[_0xac4a('0x73')][_0xac4a('0x46')];_0x3dd60a+=0x1){if(_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')]&&_['includes'](_0x4301c3,_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')])&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')]&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a]['foreignTable']&&_0x2b6773['joins'][_0x3dd60a]['foreignKey']){_0x3eae2f[_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x2e')]](_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x75')],null,util[_0xac4a('0x71')](_0xac4a('0x76'),_0x2b6773['table'],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')],_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x75')],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x8a')]));}}}if(_0x2b6773['conditions']){_0x2b6773[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2b6773[_0xac4a('0x77')]);_0x3eae2f[_0xac4a('0x3a')](_0x41cdb5(_0x2b6773[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x52963c=_0x3eae2f[_0xac4a('0x79')]();_0x3eae2f[_0xac4a('0x1d')](_0x63c30);_0x3eae2f[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x3eae2f[_0xac4a('0x7b')]());return dbH['sequelize'][_0xac4a('0x31')](_0x3eae2f['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});}})[_0xac4a('0x25')](function(){return{'sql':_0x52963c[_0xac4a('0x7b')]()};})[_0xac4a('0x25')](respondWithResult(_0x538cfd,null))[_0xac4a('0x44')](handleError(_0x538cfd,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index ffdc097..efea234 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 _0x1d59=['api','moment','bluebird','../../config/environment','./analyticDefaultReport.attributes','define','lodash','util','../../config/logger'];(function(_0x52d8f3,_0x284575){var _0xc93307=function(_0x44844e){while(--_0x44844e){_0x52d8f3['push'](_0x52d8f3['shift']());}};_0xc93307(++_0x284575);}(_0x1d59,0x165));var _0x91d5=function(_0x273750,_0x1c7e8b){_0x273750=_0x273750-0x0;var _0x1b1524=_0x1d59[_0x273750];return _0x1b1524;};'use strict';var _=require(_0x91d5('0x0'));var util=require(_0x91d5('0x1'));var logger=require(_0x91d5('0x2'))(_0x91d5('0x3'));var moment=require(_0x91d5('0x4'));var BPromise=require(_0x91d5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x91d5('0x6'));var attributes=require(_0x91d5('0x7'));module['exports']=function(_0x5edf84,_0x111387){return _0x5edf84[_0x91d5('0x8')]('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x21b0=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment'];(function(_0x1ab5b5,_0x582f1b){var _0x53fafa=function(_0x44e1ff){while(--_0x44e1ff){_0x1ab5b5['push'](_0x1ab5b5['shift']());}};_0x53fafa(++_0x582f1b);}(_0x21b0,0x183));var _0x021b=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x21b0[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x021b('0x0'));var util=require(_0x021b('0x1'));var logger=require(_0x021b('0x2'))(_0x021b('0x3'));var moment=require(_0x021b('0x4'));var BPromise=require(_0x021b('0x5'));var rp=require(_0x021b('0x6'));var fs=require('fs');var path=require(_0x021b('0x7'));var rimraf=require(_0x021b('0x8'));var config=require(_0x021b('0x9'));var attributes=require(_0x021b('0xa'));module['exports']=function(_0x216e92,_0x4cb36c){return _0x216e92[_0x021b('0xb')](_0x021b('0xc'),attributes,{'tableName':_0x021b('0xd'),'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 28a4ca9..94abff7 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 _0xc708=['bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment'];(function(_0x393436,_0x2100f4){var _0x1a54a4=function(_0x2318f3){while(--_0x2318f3){_0x393436['push'](_0x393436['shift']());}};_0x1a54a4(++_0x2100f4);}(_0xc708,0xbb));var _0x8c70=function(_0x1a0ef3,_0x535bbf){_0x1a0ef3=_0x1a0ef3-0x0;var _0x2b86da=_0xc708[_0x1a0ef3];return _0x2b86da;};'use strict';var _=require(_0x8c70('0x0'));var util=require(_0x8c70('0x1'));var moment=require(_0x8c70('0x2'));var BPromise=require(_0x8c70('0x3'));var rs=require(_0x8c70('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8c70('0x5'));var logger=require(_0x8c70('0x6'))(_0x8c70('0x7'));var config=require(_0x8c70('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8c70('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x129b1d,_0x316bef,_0x314cb6){return new BPromise(function(_0x4da848,_0x44de48){return client['request'](_0x129b1d,_0x314cb6)[_0x8c70('0xa')](function(_0x14a523){logger[_0x8c70('0xb')](_0x8c70('0xc'),_0x316bef,'request\x20sent');logger['debug'](_0x8c70('0xd'),_0x316bef,_0x8c70('0xe'),JSON[_0x8c70('0xf')](_0x14a523));if(_0x14a523[_0x8c70('0x10')]){if(_0x14a523['error']['code']===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x316bef,_0x14a523[_0x8c70('0x10')][_0x8c70('0x11')]);return _0x44de48(_0x14a523[_0x8c70('0x10')][_0x8c70('0x11')]);}logger[_0x8c70('0x10')](_0x8c70('0xc'),_0x316bef,_0x14a523['error'][_0x8c70('0x11')]);return _0x4da848(_0x14a523[_0x8c70('0x10')][_0x8c70('0x11')]);}else{logger[_0x8c70('0xb')](_0x8c70('0xc'),_0x316bef,_0x8c70('0xe'));_0x4da848(_0x14a523[_0x8c70('0x12')][_0x8c70('0x11')]);}})['catch'](function(_0x10026a){logger[_0x8c70('0x10')](_0x8c70('0xc'),_0x316bef,_0x10026a);_0x44de48(_0x10026a);});});}
\ No newline at end of file
+var _0x44ba=['request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x44ba,0x1b6));var _0xa44b=function(_0x2e2eab,_0x2e609a){_0x2e2eab=_0x2e2eab-0x0;var _0x2357bc=_0x44ba[_0x2e2eab];return _0x2357bc;};'use strict';var _=require(_0xa44b('0x0'));var util=require(_0xa44b('0x1'));var moment=require(_0xa44b('0x2'));var BPromise=require('bluebird');var rs=require(_0xa44b('0x3'));var fs=require('fs');var Redis=require(_0xa44b('0x4'));var db=require(_0xa44b('0x5'))['db'];var utils=require(_0xa44b('0x6'));var logger=require(_0xa44b('0x7'))(_0xa44b('0x8'));var config=require(_0xa44b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa44b('0xa')][_0xa44b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x218a5d,_0x1c7589,_0x2244b0){return new BPromise(function(_0x594017,_0x3d048a){return client[_0xa44b('0xc')](_0x218a5d,_0x2244b0)[_0xa44b('0xd')](function(_0x28cc8e){logger[_0xa44b('0xe')](_0xa44b('0xf'),_0x1c7589,'request\x20sent');logger[_0xa44b('0x10')](_0xa44b('0x11'),_0x1c7589,_0xa44b('0x12'),JSON[_0xa44b('0x13')](_0x28cc8e));if(_0x28cc8e[_0xa44b('0x14')]){if(_0x28cc8e['error'][_0xa44b('0x15')]===0x1f4){logger[_0xa44b('0x14')](_0xa44b('0xf'),_0x1c7589,_0x28cc8e[_0xa44b('0x14')]['message']);return _0x3d048a(_0x28cc8e['error'][_0xa44b('0x16')]);}logger[_0xa44b('0x14')](_0xa44b('0xf'),_0x1c7589,_0x28cc8e[_0xa44b('0x14')][_0xa44b('0x16')]);return _0x594017(_0x28cc8e[_0xa44b('0x14')][_0xa44b('0x16')]);}else{logger[_0xa44b('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1c7589,_0xa44b('0x12'));_0x594017(_0x28cc8e[_0xa44b('0x17')][_0xa44b('0x16')]);}})[_0xa44b('0x18')](function(_0x41897c){logger['error'](_0xa44b('0xf'),_0x1c7589,_0x41897c);_0x3d048a(_0x41897c);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 1ab0ea4..6923dcf 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 _0xc59f=['/:id/query','query','post','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','run'];(function(_0x3b7962,_0x49f772){var _0x3c42a1=function(_0x8369eb){while(--_0x8369eb){_0x3b7962['push'](_0x3b7962['shift']());}};_0x3c42a1(++_0x49f772);}(_0xc59f,0xe3));var _0xfc59=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc59f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xfc59('0x0'));var path=require(_0xfc59('0x1'));var timeout=require(_0xfc59('0x2'));var express=require(_0xfc59('0x3'));var router=express[_0xfc59('0x4')]();var fs_extra=require(_0xfc59('0x5'));var auth=require(_0xfc59('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0xfc59('0x7')]('/',auth[_0xfc59('0x8')](),controller['index']);router[_0xfc59('0x7')](_0xfc59('0x9'),auth[_0xfc59('0x8')](),controller[_0xfc59('0xa')]);router['get'](_0xfc59('0xb'),auth['isAuthenticated'](),controller[_0xfc59('0xc')]);router['get'](_0xfc59('0xd'),auth[_0xfc59('0x8')](),controller[_0xfc59('0xe')]);router[_0xfc59('0x7')](_0xfc59('0xf'),auth[_0xfc59('0x8')](),controller[_0xfc59('0x10')]);router[_0xfc59('0x11')]('/',auth[_0xfc59('0x8')](),controller['create']);router[_0xfc59('0x12')](_0xfc59('0x9'),auth[_0xfc59('0x8')](),controller[_0xfc59('0x13')]);router[_0xfc59('0x14')](_0xfc59('0x9'),auth[_0xfc59('0x8')](),controller['destroy']);module[_0xfc59('0x15')]=router;
\ No newline at end of file
+var _0xcc8d=['get','isAuthenticated','/:id','run','/:id/query','query','post','create','put','update','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcc8d,0xfc));var _0xdcc8=function(_0x8abd64,_0x539570){_0x8abd64=_0x8abd64-0x0;var _0xd2511e=_0xcc8d[_0x8abd64];return _0xd2511e;};'use strict';var multer=require(_0xdcc8('0x0'));var util=require(_0xdcc8('0x1'));var path=require('path');var timeout=require(_0xdcc8('0x2'));var express=require('express');var router=express[_0xdcc8('0x3')]();var fs_extra=require(_0xdcc8('0x4'));var auth=require(_0xdcc8('0x5'));var interaction=require(_0xdcc8('0x6'));var config=require(_0xdcc8('0x7'));var controller=require('./analyticDefaultReport.controller');router[_0xdcc8('0x8')]('/',auth[_0xdcc8('0x9')](),controller['index']);router[_0xdcc8('0x8')](_0xdcc8('0xa'),auth[_0xdcc8('0x9')](),controller['show']);router[_0xdcc8('0x8')]('/:id/preview',auth['isAuthenticated'](),controller['preview']);router['get']('/:id/run',auth[_0xdcc8('0x9')](),controller[_0xdcc8('0xb')]);router[_0xdcc8('0x8')](_0xdcc8('0xc'),auth[_0xdcc8('0x9')](),controller[_0xdcc8('0xd')]);router[_0xdcc8('0xe')]('/',auth[_0xdcc8('0x9')](),controller[_0xdcc8('0xf')]);router[_0xdcc8('0x10')](_0xdcc8('0xa'),auth[_0xdcc8('0x9')](),controller[_0xdcc8('0x11')]);router['delete'](_0xdcc8('0xa'),auth[_0xdcc8('0x9')](),controller[_0xdcc8('0x12')]);module[_0xdcc8('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 7a14a22..a05fb1d 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 _0xaee3=['Loading','manual','scheduled','INTEGER','sequelize','moment','exports','STRING','ENUM','pdf','csv','DATE'];(function(_0x25609f,_0x2569de){var _0x1dfc22=function(_0x3eae32){while(--_0x3eae32){_0x25609f['push'](_0x25609f['shift']());}};_0x1dfc22(++_0x2569de);}(_0xaee3,0x88));var _0x3aee=function(_0x430459,_0x58519c){_0x430459=_0x430459-0x0;var _0x3a2439=_0xaee3[_0x430459];return _0x3a2439;};'use strict';var Sequelize=require(_0x3aee('0x0'));var moment=require(_0x3aee('0x1'));module[_0x3aee('0x2')]={'name':{'type':Sequelize[_0x3aee('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x3aee('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x3aee('0x4')]('csv',_0x3aee('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0x3aee('0x6')},'savename':{'type':Sequelize[_0x3aee('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x3aee('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x3aee('0x3')],'defaultValue':_0x3aee('0x8')},'type':{'type':Sequelize[_0x3aee('0x4')](_0x3aee('0x9'),_0x3aee('0xa')),'allowNull':![],'defaultValue':_0x3aee('0x9')},'reportId':{'type':Sequelize[_0x3aee('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xc785=['manual','sequelize','exports','STRING','csv','pdf','Loading','ENUM'];(function(_0x59397f,_0x297dd5){var _0x3b6829=function(_0x4d8d42){while(--_0x4d8d42){_0x59397f['push'](_0x59397f['shift']());}};_0x3b6829(++_0x297dd5);}(_0xc785,0x161));var _0x5c78=function(_0x4e4e4f,_0x54d91b){_0x4e4e4f=_0x4e4e4f-0x0;var _0xb4f281=_0xc785[_0x4e4e4f];return _0xb4f281;};'use strict';var Sequelize=require(_0x5c78('0x0'));var moment=require('moment');module[_0x5c78('0x1')]={'name':{'type':Sequelize[_0x5c78('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x5c78('0x3'),_0x5c78('0x4'),'xlsx'),'allowNull':![],'defaultValue':_0x5c78('0x3')},'savename':{'type':Sequelize[_0x5c78('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x5c78('0x2')],'defaultValue':_0x5c78('0x5')},'type':{'type':Sequelize[_0x5c78('0x6')](_0x5c78('0x7'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index d5c0908..e084797 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 _0x4768=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','count','limit','Content-Range','update','then','destroy','get','UserProfileResource','error','send','map','AnalyticExtractedReport','rawAttributes','fieldName','type','model','name','keys','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x40bdbc,_0x3fabcd){var _0xc603a8=function(_0x17c0e6){while(--_0x17c0e6){_0x40bdbc['push'](_0x40bdbc['shift']());}};_0xc603a8(++_0x3fabcd);}(_0x4768,0xa8));var _0x8476=function(_0x5855e,_0x18d7a3){_0x5855e=_0x5855e-0x0;var _0x58276c=_0x4768[_0x5855e];return _0x58276c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8476('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8476('0x1'));var rp=require(_0x8476('0x2'));var moment=require(_0x8476('0x3'));var BPromise=require(_0x8476('0x4'));var Mustache=require('mustache');var util=require(_0x8476('0x5'));var path=require(_0x8476('0x6'));var sox=require('sox');var csv=require(_0x8476('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8476('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8476('0x9'));var toCsv=require('to-csv');var querystring=require(_0x8476('0xa'));var Papa=require(_0x8476('0xb'));var Redis=require(_0x8476('0xc'));var authService=require(_0x8476('0xd'));var qs=require(_0x8476('0xe'));var as=require(_0x8476('0xf'));var hardwareService=require(_0x8476('0x10'));var logger=require('../../config/logger')(_0x8476('0x11'));var utils=require(_0x8476('0x12'));var config=require(_0x8476('0x13'));var licenseUtil=require(_0x8476('0x14'));var db=require(_0x8476('0x15'))['db'];function respondWithStatusCode(_0x1d1f45,_0x86d59e){_0x86d59e=_0x86d59e||0xcc;return function(_0x213ba2){if(_0x213ba2){return _0x1d1f45[_0x8476('0x16')](_0x86d59e);}return _0x1d1f45['status'](_0x86d59e)[_0x8476('0x17')]();};}function respondWithResult(_0x5794f0,_0x3a0095){_0x3a0095=_0x3a0095||0xc8;return function(_0x39eaf6){if(_0x39eaf6){return _0x5794f0[_0x8476('0x18')](_0x3a0095)[_0x8476('0x19')](_0x39eaf6);}};}function respondWithFilteredResult(_0x459c2d,_0x41f0ac){return function(_0x147987){if(_0x147987){var _0xafb7e4=typeof _0x41f0ac[_0x8476('0x1a')]==='undefined'&&typeof _0x41f0ac['limit']==='undefined';var _0x5e1f32=_0x147987[_0x8476('0x1b')];var _0x126a4b=_0xafb7e4?0x0:_0x41f0ac[_0x8476('0x1a')];var _0x2794bd=_0xafb7e4?_0x147987[_0x8476('0x1b')]:_0x41f0ac[_0x8476('0x1a')]+_0x41f0ac[_0x8476('0x1c')];var _0xa892ba;if(_0x2794bd>=_0x5e1f32){_0x2794bd=_0x5e1f32;_0xa892ba=0xc8;}else{_0xa892ba=0xce;}_0x459c2d['status'](_0xa892ba);return _0x459c2d['set'](_0x8476('0x1d'),_0x126a4b+'-'+_0x2794bd+'/'+_0x5e1f32)[_0x8476('0x19')](_0x147987);}return null;};}function patchUpdates(_0x268b01){return function(_0x415cb1){try{jsonpatch['apply'](_0x415cb1,_0x268b01,!![]);}catch(_0x2b09d9){return BPromise['reject'](_0x2b09d9);}return _0x415cb1['save']();};}function saveUpdates(_0x5bca7f,_0x486a83){return function(_0x13ab74){if(_0x13ab74){return _0x13ab74[_0x8476('0x1e')](_0x5bca7f)[_0x8476('0x1f')](function(_0x253e38){return _0x253e38;});}return null;};}function removeEntity(_0x3649c8,_0x34059c){return function(_0x195e02){if(_0x195e02){return _0x195e02[_0x8476('0x20')]()[_0x8476('0x1f')](function(){var _0x742bc4=_0x195e02[_0x8476('0x21')]({'plain':!![]});var _0x1d67a7='ExtractedReports';return db[_0x8476('0x22')][_0x8476('0x20')]({'where':{'type':_0x1d67a7,'resourceId':_0x742bc4['id']}})[_0x8476('0x1f')](function(){return _0x195e02;});})[_0x8476('0x1f')](function(){_0x3649c8[_0x8476('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21362d,_0x5792ac){return function(_0x57f052){if(!_0x57f052){_0x21362d[_0x8476('0x16')](0x194);}return _0x57f052;};}function handleError(_0x5a4016,_0x2b512f){_0x2b512f=_0x2b512f||0x1f4;return function(_0x41c15a){logger[_0x8476('0x23')](_0x41c15a['stack']);if(_0x41c15a['name']){delete _0x41c15a['name'];}_0x5a4016[_0x8476('0x18')](_0x2b512f)[_0x8476('0x24')](_0x41c15a);};}exports['index']=function(_0x51e75e,_0x2aa341){var _0x40c430={},_0x454351={},_0x210ab4={'count':0x0,'rows':[]};var _0x4cedf4=_[_0x8476('0x25')](db[_0x8476('0x26')][_0x8476('0x27')],function(_0x34ef21){return{'name':_0x34ef21[_0x8476('0x28')],'type':_0x34ef21[_0x8476('0x29')]['key']};});_0x454351[_0x8476('0x2a')]=_[_0x8476('0x25')](_0x4cedf4,_0x8476('0x2b'));_0x454351['query']=_[_0x8476('0x2c')](_0x51e75e['query']);_0x454351[_0x8476('0x2d')]=_[_0x8476('0x2e')](_0x454351[_0x8476('0x2a')],_0x454351[_0x8476('0x2f')]);_0x40c430['attributes']=_[_0x8476('0x2e')](_0x454351[_0x8476('0x2a')],qs[_0x8476('0x30')](_0x51e75e['query'][_0x8476('0x30')]));_0x40c430[_0x8476('0x31')]=_0x40c430[_0x8476('0x31')]['length']?_0x40c430['attributes']:_0x454351[_0x8476('0x2a')];if(!_0x51e75e[_0x8476('0x2f')][_0x8476('0x32')](_0x8476('0x33'))){_0x40c430[_0x8476('0x1c')]=qs['limit'](_0x51e75e[_0x8476('0x2f')][_0x8476('0x1c')]);_0x40c430[_0x8476('0x1a')]=qs[_0x8476('0x1a')](_0x51e75e[_0x8476('0x2f')]['offset']);}_0x40c430[_0x8476('0x34')]=qs['sort'](_0x51e75e[_0x8476('0x2f')][_0x8476('0x35')]);_0x40c430[_0x8476('0x36')]=qs[_0x8476('0x2d')](_[_0x8476('0x37')](_0x51e75e[_0x8476('0x2f')],_0x454351[_0x8476('0x2d')]),_0x4cedf4);if(_0x51e75e['query'][_0x8476('0x38')]){_0x40c430[_0x8476('0x36')]=_['merge'](_0x40c430[_0x8476('0x36')],{'$or':_[_0x8476('0x25')](_0x4cedf4,function(_0x3ff4d1){if(_0x3ff4d1['type']!==_0x8476('0x39')){var _0x3a864e={};_0x3a864e[_0x3ff4d1['name']]={'$like':'%'+_0x51e75e[_0x8476('0x2f')][_0x8476('0x38')]+'%'};return _0x3a864e;}})});}_0x40c430=_[_0x8476('0x3a')]({},_0x40c430,_0x51e75e[_0x8476('0x3b')]);var _0x2ef267={'where':_0x40c430[_0x8476('0x36')]};return db[_0x8476('0x26')][_0x8476('0x1b')](_0x2ef267)['then'](function(_0x1e8649){_0x210ab4[_0x8476('0x1b')]=_0x1e8649;if(_0x51e75e[_0x8476('0x2f')][_0x8476('0x3c')]){_0x40c430[_0x8476('0x3d')]=[{'all':!![]}];}return db[_0x8476('0x26')]['findAll'](_0x40c430);})['then'](function(_0x165ddb){_0x210ab4[_0x8476('0x3e')]=_0x165ddb;return _0x210ab4;})['then'](respondWithFilteredResult(_0x2aa341,_0x40c430))[_0x8476('0x3f')](handleError(_0x2aa341,null));};exports['show']=function(_0x5ba886,_0x55e29d){var _0x3c97ea={'raw':!![],'where':{'id':_0x5ba886[_0x8476('0x40')]['id']}},_0x44705d={};_0x44705d[_0x8476('0x2a')]=_[_0x8476('0x2c')](db[_0x8476('0x26')][_0x8476('0x27')]);_0x44705d['query']=_[_0x8476('0x2c')](_0x5ba886[_0x8476('0x2f')]);_0x44705d[_0x8476('0x2d')]=_[_0x8476('0x2e')](_0x44705d[_0x8476('0x2a')],_0x44705d['query']);_0x3c97ea[_0x8476('0x31')]=_[_0x8476('0x2e')](_0x44705d['model'],qs[_0x8476('0x30')](_0x5ba886['query']['fields']));_0x3c97ea[_0x8476('0x31')]=_0x3c97ea['attributes'][_0x8476('0x41')]?_0x3c97ea['attributes']:_0x44705d['model'];if(_0x5ba886[_0x8476('0x2f')][_0x8476('0x3c')]){_0x3c97ea[_0x8476('0x3d')]=[{'all':!![]}];}_0x3c97ea=_[_0x8476('0x3a')]({},_0x3c97ea,_0x5ba886[_0x8476('0x3b')]);return db[_0x8476('0x26')][_0x8476('0x42')](_0x3c97ea)[_0x8476('0x1f')](handleEntityNotFound(_0x55e29d,null))[_0x8476('0x1f')](respondWithResult(_0x55e29d,null))[_0x8476('0x3f')](handleError(_0x55e29d,null));};exports[_0x8476('0x43')]=function(_0x539296,_0x304cd2){return db[_0x8476('0x26')][_0x8476('0x43')](_0x539296[_0x8476('0x44')],{})[_0x8476('0x1f')](function(_0x3d880d){var _0x279fe4=_0x539296[_0x8476('0x45')]['get']({'plain':!![]});if(!_0x279fe4)throw new Error(_0x8476('0x46'));if(_0x279fe4[_0x8476('0x47')]===_0x8476('0x45')){var _0x1832e3=_0x3d880d[_0x8476('0x21')]({'plain':!![]});var _0x18328f=_0x8476('0x48');return db[_0x8476('0x49')][_0x8476('0x42')]({'where':{'name':_0x18328f,'userProfileId':_0x279fe4[_0x8476('0x4a')]},'raw':!![]})[_0x8476('0x1f')](function(_0x51e43f){if(_0x51e43f&&_0x51e43f['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x1832e3['name'],'resourceId':_0x1832e3['id'],'type':_0x51e43f[_0x8476('0x2b')],'sectionId':_0x51e43f['id']},{})['then'](function(){return _0x3d880d;});}else{return _0x3d880d;}})[_0x8476('0x3f')](function(_0x281c84){logger[_0x8476('0x23')](_0x8476('0x4b'),_0x281c84);throw _0x281c84;});}return _0x3d880d;})[_0x8476('0x1f')](respondWithResult(_0x304cd2,0xc9))[_0x8476('0x3f')](handleError(_0x304cd2,null));};exports[_0x8476('0x1e')]=function(_0x45d346,_0x50cff0){if(_0x45d346[_0x8476('0x44')]['id']){delete _0x45d346[_0x8476('0x44')]['id'];}return db[_0x8476('0x26')][_0x8476('0x42')]({'where':{'id':_0x45d346[_0x8476('0x40')]['id']}})[_0x8476('0x1f')](handleEntityNotFound(_0x50cff0,null))['then'](saveUpdates(_0x45d346[_0x8476('0x44')],null))[_0x8476('0x1f')](respondWithResult(_0x50cff0,null))[_0x8476('0x3f')](handleError(_0x50cff0,null));};exports[_0x8476('0x20')]=function(_0x25d515,_0x5df9e3){return db[_0x8476('0x26')][_0x8476('0x42')]({'where':{'id':_0x25d515[_0x8476('0x40')]['id']}})[_0x8476('0x1f')](handleEntityNotFound(_0x5df9e3,null))[_0x8476('0x1f')](removeEntity(_0x5df9e3,null))[_0x8476('0x3f')](handleError(_0x5df9e3,null));};exports[_0x8476('0x4c')]=function(_0xa13b4e,_0x2d1acc,_0x4a5ee7){return db[_0x8476('0x26')][_0x8476('0x42')]({'where':{'id':_0xa13b4e[_0x8476('0x40')]['id']},'attributes':[_0x8476('0x2b'),_0x8476('0x4d'),_0x8476('0x4e'),_0x8476('0x4f')],'raw':!![]})[_0x8476('0x1f')](handleEntityNotFound(_0x2d1acc,null))['then'](function(_0x3efb82){if(_0x3efb82){if(!fs[_0x8476('0x50')](path[_0x8476('0x51')](config[_0x8476('0x52')],_0x8476('0x53'),_0x3efb82[_0x8476('0x4e')]))){throw new db[(_0x8476('0x54'))][(_0x8476('0x55'))](_0x8476('0x56'));}if(_0xa13b4e[_0x8476('0x2f')][_0x8476('0x57')]){return _0x2d1acc[_0x8476('0x16')](0xc8);}return _0x2d1acc['download'](path['join'](config[_0x8476('0x52')],_0x8476('0x53'),_0x3efb82['savename']),util[_0x8476('0x58')](_0x8476('0x59'),_0x3efb82[_0x8476('0x4d')]||_0x3efb82[_0x8476('0x2b')],_0x3efb82[_0x8476('0x4f')][_0x8476('0x5a')]()));}})[_0x8476('0x3f')](handleError(_0x2d1acc,null));};
\ No newline at end of file
+var _0x09df=['existsSync','join','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','download','root','server/files/reports','format','%s.%s','output','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','stack','name','index','AnalyticExtractedReport','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','rawAttributes','create','user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','basename','savename'];(function(_0x198070,_0x8b89a4){var _0x3e3aac=function(_0x1b89eb){while(--_0x1b89eb){_0x198070['push'](_0x198070['shift']());}};_0x3e3aac(++_0x8b89a4);}(_0x09df,0x123));var _0xf09d=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x09df[_0x2aa0e7];return _0x1472c0;};'use strict';var emlformat=require(_0xf09d('0x0'));var rimraf=require(_0xf09d('0x1'));var zipdir=require(_0xf09d('0x2'));var jsonpatch=require(_0xf09d('0x3'));var rp=require(_0xf09d('0x4'));var moment=require(_0xf09d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf09d('0x6'));var util=require(_0xf09d('0x7'));var path=require(_0xf09d('0x8'));var sox=require(_0xf09d('0x9'));var csv=require(_0xf09d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf09d('0xb'));var _=require(_0xf09d('0xc'));var squel=require(_0xf09d('0xd'));var crypto=require('crypto');var jsforce=require(_0xf09d('0xe'));var deskjs=require(_0xf09d('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf09d('0x10'));var Redis=require('ioredis');var authService=require(_0xf09d('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf09d('0x12'));var logger=require(_0xf09d('0x13'))(_0xf09d('0x14'));var utils=require(_0xf09d('0x15'));var config=require(_0xf09d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf09d('0x17'))['db'];function respondWithStatusCode(_0x2d8814,_0x3cf76f){_0x3cf76f=_0x3cf76f||0xcc;return function(_0x27f885){if(_0x27f885){return _0x2d8814[_0xf09d('0x18')](_0x3cf76f);}return _0x2d8814[_0xf09d('0x19')](_0x3cf76f)[_0xf09d('0x1a')]();};}function respondWithResult(_0x386e2a,_0x4bff69){_0x4bff69=_0x4bff69||0xc8;return function(_0x46798e){if(_0x46798e){return _0x386e2a[_0xf09d('0x19')](_0x4bff69)[_0xf09d('0x1b')](_0x46798e);}};}function respondWithFilteredResult(_0x4a5eef,_0x2570ed){return function(_0x37e245){if(_0x37e245){var _0x532efc=typeof _0x2570ed[_0xf09d('0x1c')]===_0xf09d('0x1d')&&typeof _0x2570ed['limit']===_0xf09d('0x1d');var _0x2c4934=_0x37e245[_0xf09d('0x1e')];var _0x5a7dab=_0x532efc?0x0:_0x2570ed[_0xf09d('0x1c')];var _0x170d79=_0x532efc?_0x37e245[_0xf09d('0x1e')]:_0x2570ed['offset']+_0x2570ed[_0xf09d('0x1f')];var _0x3c7a85;if(_0x170d79>=_0x2c4934){_0x170d79=_0x2c4934;_0x3c7a85=0xc8;}else{_0x3c7a85=0xce;}_0x4a5eef[_0xf09d('0x19')](_0x3c7a85);return _0x4a5eef[_0xf09d('0x20')]('Content-Range',_0x5a7dab+'-'+_0x170d79+'/'+_0x2c4934)[_0xf09d('0x1b')](_0x37e245);}return null;};}function patchUpdates(_0x3e4a5b){return function(_0x2e3ba5){try{jsonpatch['apply'](_0x2e3ba5,_0x3e4a5b,!![]);}catch(_0x397ec9){return BPromise[_0xf09d('0x21')](_0x397ec9);}return _0x2e3ba5[_0xf09d('0x22')]();};}function saveUpdates(_0xc9778e,_0x2777b1){return function(_0x5b4ebb){if(_0x5b4ebb){return _0x5b4ebb[_0xf09d('0x23')](_0xc9778e)[_0xf09d('0x24')](function(_0x443cf2){return _0x443cf2;});}return null;};}function removeEntity(_0x71f53e,_0x42d47e){return function(_0x328bf5){if(_0x328bf5){return _0x328bf5[_0xf09d('0x25')]()['then'](function(){var _0x5313f2=_0x328bf5[_0xf09d('0x26')]({'plain':!![]});var _0x40262e=_0xf09d('0x27');return db[_0xf09d('0x28')][_0xf09d('0x25')]({'where':{'type':_0x40262e,'resourceId':_0x5313f2['id']}})[_0xf09d('0x24')](function(){return _0x328bf5;});})[_0xf09d('0x24')](function(){_0x71f53e[_0xf09d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d554b,_0x38d0ea){return function(_0x585e9a){if(!_0x585e9a){_0x3d554b['sendStatus'](0x194);}return _0x585e9a;};}function handleError(_0x211c40,_0x15927e){_0x15927e=_0x15927e||0x1f4;return function(_0x27bbbc){logger['error'](_0x27bbbc[_0xf09d('0x29')]);if(_0x27bbbc[_0xf09d('0x2a')]){delete _0x27bbbc[_0xf09d('0x2a')];}_0x211c40[_0xf09d('0x19')](_0x15927e)['send'](_0x27bbbc);};}exports[_0xf09d('0x2b')]=function(_0x19af85,_0x45c080){var _0x2a5fa7={},_0x57c7d1={},_0x59a54f={'count':0x0,'rows':[]};var _0x20cd68=_['map'](db[_0xf09d('0x2c')]['rawAttributes'],function(_0x2d3745){return{'name':_0x2d3745[_0xf09d('0x2d')],'type':_0x2d3745['type'][_0xf09d('0x2e')]};});_0x57c7d1[_0xf09d('0x2f')]=_[_0xf09d('0x30')](_0x20cd68,_0xf09d('0x2a'));_0x57c7d1[_0xf09d('0x31')]=_[_0xf09d('0x32')](_0x19af85['query']);_0x57c7d1[_0xf09d('0x33')]=_[_0xf09d('0x34')](_0x57c7d1[_0xf09d('0x2f')],_0x57c7d1[_0xf09d('0x31')]);_0x2a5fa7[_0xf09d('0x35')]=_[_0xf09d('0x34')](_0x57c7d1[_0xf09d('0x2f')],qs[_0xf09d('0x36')](_0x19af85['query'][_0xf09d('0x36')]));_0x2a5fa7[_0xf09d('0x35')]=_0x2a5fa7[_0xf09d('0x35')][_0xf09d('0x37')]?_0x2a5fa7['attributes']:_0x57c7d1[_0xf09d('0x2f')];if(!_0x19af85[_0xf09d('0x31')][_0xf09d('0x38')](_0xf09d('0x39'))){_0x2a5fa7['limit']=qs[_0xf09d('0x1f')](_0x19af85[_0xf09d('0x31')][_0xf09d('0x1f')]);_0x2a5fa7[_0xf09d('0x1c')]=qs[_0xf09d('0x1c')](_0x19af85['query']['offset']);}_0x2a5fa7['order']=qs['sort'](_0x19af85[_0xf09d('0x31')]['sort']);_0x2a5fa7[_0xf09d('0x3a')]=qs[_0xf09d('0x33')](_[_0xf09d('0x3b')](_0x19af85[_0xf09d('0x31')],_0x57c7d1[_0xf09d('0x33')]),_0x20cd68);if(_0x19af85[_0xf09d('0x31')][_0xf09d('0x3c')]){_0x2a5fa7[_0xf09d('0x3a')]=_[_0xf09d('0x3d')](_0x2a5fa7['where'],{'$or':_['map'](_0x20cd68,function(_0x46f5dd){if(_0x46f5dd[_0xf09d('0x3e')]!==_0xf09d('0x3f')){var _0x4a8bcd={};_0x4a8bcd[_0x46f5dd[_0xf09d('0x2a')]]={'$like':'%'+_0x19af85['query'][_0xf09d('0x3c')]+'%'};return _0x4a8bcd;}})});}_0x2a5fa7=_['merge']({},_0x2a5fa7,_0x19af85[_0xf09d('0x40')]);var _0x92fb14={'where':_0x2a5fa7['where']};return db[_0xf09d('0x2c')]['count'](_0x92fb14)[_0xf09d('0x24')](function(_0x52e046){_0x59a54f['count']=_0x52e046;if(_0x19af85[_0xf09d('0x31')][_0xf09d('0x41')]){_0x2a5fa7[_0xf09d('0x42')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x2a5fa7);})[_0xf09d('0x24')](function(_0x41ebcb){_0x59a54f[_0xf09d('0x43')]=_0x41ebcb;return _0x59a54f;})['then'](respondWithFilteredResult(_0x45c080,_0x2a5fa7))[_0xf09d('0x44')](handleError(_0x45c080,null));};exports['show']=function(_0x3c82a0,_0x25923d){var _0x38de1e={'raw':!![],'where':{'id':_0x3c82a0['params']['id']}},_0x5c3565={};_0x5c3565[_0xf09d('0x2f')]=_[_0xf09d('0x32')](db[_0xf09d('0x2c')][_0xf09d('0x45')]);_0x5c3565[_0xf09d('0x31')]=_[_0xf09d('0x32')](_0x3c82a0[_0xf09d('0x31')]);_0x5c3565[_0xf09d('0x33')]=_[_0xf09d('0x34')](_0x5c3565[_0xf09d('0x2f')],_0x5c3565['query']);_0x38de1e[_0xf09d('0x35')]=_['intersection'](_0x5c3565[_0xf09d('0x2f')],qs[_0xf09d('0x36')](_0x3c82a0[_0xf09d('0x31')][_0xf09d('0x36')]));_0x38de1e['attributes']=_0x38de1e['attributes'][_0xf09d('0x37')]?_0x38de1e[_0xf09d('0x35')]:_0x5c3565[_0xf09d('0x2f')];if(_0x3c82a0[_0xf09d('0x31')][_0xf09d('0x41')]){_0x38de1e['include']=[{'all':!![]}];}_0x38de1e=_[_0xf09d('0x3d')]({},_0x38de1e,_0x3c82a0[_0xf09d('0x40')]);return db['AnalyticExtractedReport']['find'](_0x38de1e)[_0xf09d('0x24')](handleEntityNotFound(_0x25923d,null))[_0xf09d('0x24')](respondWithResult(_0x25923d,null))['catch'](handleError(_0x25923d,null));};exports[_0xf09d('0x46')]=function(_0x519450,_0xddedc0){return db[_0xf09d('0x2c')][_0xf09d('0x46')](_0x519450['body'],{})['then'](function(_0x46cfd3){var _0x164229=_0x519450[_0xf09d('0x47')]['get']({'plain':!![]});if(!_0x164229)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x164229[_0xf09d('0x48')]===_0xf09d('0x47')){var _0x514884=_0x46cfd3[_0xf09d('0x26')]({'plain':!![]});var _0x1b88ac=_0xf09d('0x27');return db['UserProfileSection'][_0xf09d('0x49')]({'where':{'name':_0x1b88ac,'userProfileId':_0x164229[_0xf09d('0x4a')]},'raw':!![]})['then'](function(_0x1e4332){if(_0x1e4332&&_0x1e4332[_0xf09d('0x4b')]===0x0){return db['UserProfileResource']['create']({'name':_0x514884[_0xf09d('0x2a')],'resourceId':_0x514884['id'],'type':_0x1e4332['name'],'sectionId':_0x1e4332['id']},{})[_0xf09d('0x24')](function(){return _0x46cfd3;});}else{return _0x46cfd3;}})[_0xf09d('0x44')](function(_0x2ef3af){logger['error'](_0xf09d('0x4c'),_0x2ef3af);throw _0x2ef3af;});}return _0x46cfd3;})['then'](respondWithResult(_0xddedc0,0xc9))['catch'](handleError(_0xddedc0,null));};exports[_0xf09d('0x23')]=function(_0x446ccc,_0x30244a){if(_0x446ccc[_0xf09d('0x4d')]['id']){delete _0x446ccc['body']['id'];}return db[_0xf09d('0x2c')][_0xf09d('0x49')]({'where':{'id':_0x446ccc[_0xf09d('0x4e')]['id']}})[_0xf09d('0x24')](handleEntityNotFound(_0x30244a,null))[_0xf09d('0x24')](saveUpdates(_0x446ccc[_0xf09d('0x4d')],null))[_0xf09d('0x24')](respondWithResult(_0x30244a,null))[_0xf09d('0x44')](handleError(_0x30244a,null));};exports[_0xf09d('0x25')]=function(_0x504b8f,_0x17759a){return db[_0xf09d('0x2c')]['find']({'where':{'id':_0x504b8f[_0xf09d('0x4e')]['id']}})[_0xf09d('0x24')](handleEntityNotFound(_0x17759a,null))[_0xf09d('0x24')](removeEntity(_0x17759a,null))[_0xf09d('0x44')](handleError(_0x17759a,null));};exports['download']=function(_0xf10987,_0x29101b,_0x42c16e){return db[_0xf09d('0x2c')][_0xf09d('0x49')]({'where':{'id':_0xf10987['params']['id']},'attributes':[_0xf09d('0x2a'),_0xf09d('0x4f'),_0xf09d('0x50'),'output'],'raw':!![]})['then'](handleEntityNotFound(_0x29101b,null))[_0xf09d('0x24')](function(_0x38a956){if(_0x38a956){if(!fs[_0xf09d('0x51')](path[_0xf09d('0x52')](config['root'],'server/files/reports',_0x38a956[_0xf09d('0x50')]))){throw new db[(_0xf09d('0x53'))][(_0xf09d('0x54'))](_0xf09d('0x55'));}if(_0xf10987['query']['exists']){return _0x29101b[_0xf09d('0x18')](0xc8);}return _0x29101b[_0xf09d('0x56')](path[_0xf09d('0x52')](config[_0xf09d('0x57')],_0xf09d('0x58'),_0x38a956[_0xf09d('0x50')]),util[_0xf09d('0x59')](_0xf09d('0x5a'),_0x38a956[_0xf09d('0x4f')]||_0x38a956[_0xf09d('0x2a')],_0x38a956[_0xf09d('0x5b')][_0xf09d('0x5c')]()));}})[_0xf09d('0x44')](handleError(_0x29101b,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 4d3b65a..2db5538 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 _0x911a=['bluebird','path','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','lodash','util','api'];(function(_0x49cb18,_0x52be4e){var _0x2bc292=function(_0x3a58ba){while(--_0x3a58ba){_0x49cb18['push'](_0x49cb18['shift']());}};_0x2bc292(++_0x52be4e);}(_0x911a,0x1f1));var _0xa911=function(_0x102e71,_0x284f7e){_0x102e71=_0x102e71-0x0;var _0x46678d=_0x911a[_0x102e71];return _0x46678d;};'use strict';var _=require(_0xa911('0x0'));var util=require(_0xa911('0x1'));var logger=require('../../config/logger')(_0xa911('0x2'));var moment=require('moment');var BPromise=require(_0xa911('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa911('0x4'));var rimraf=require('rimraf');var config=require(_0xa911('0x5'));var attributes=require(_0xa911('0x6'));module[_0xa911('0x7')]=function(_0x1c029b,_0x27d0f0){return _0x1c029b[_0xa911('0x8')](_0xa911('0x9'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcb8b=['AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','api','moment','path','rimraf','../../config/environment','define'];(function(_0x15feaf,_0x53ff1c){var _0x4dbbec=function(_0x44ffbb){while(--_0x44ffbb){_0x15feaf['push'](_0x15feaf['shift']());}};_0x4dbbec(++_0x53ff1c);}(_0xcb8b,0x1b0));var _0xbcb8=function(_0x498a7a,_0x95fce){_0x498a7a=_0x498a7a-0x0;var _0x4ff437=_0xcb8b[_0x498a7a];return _0x4ff437;};'use strict';var _=require('lodash');var util=require(_0xbcb8('0x0'));var logger=require(_0xbcb8('0x1'))(_0xbcb8('0x2'));var moment=require(_0xbcb8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbcb8('0x4'));var rimraf=require(_0xbcb8('0x5'));var config=require(_0xbcb8('0x6'));var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x574b9f,_0x5ea062){return _0x574b9f[_0xbcb8('0x7')](_0xbcb8('0x8'),attributes,{'tableName':_0xbcb8('0x9'),'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 01f44f2..ef4b097 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 _0xea5a=['moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticExtractedReport,\x20%s,\x20%s','result','catch','util'];(function(_0x4ce07d,_0x38003c){var _0x5923e2=function(_0x415580){while(--_0x415580){_0x4ce07d['push'](_0x4ce07d['shift']());}};_0x5923e2(++_0x38003c);}(_0xea5a,0x1e3));var _0xaea5=function(_0x120f46,_0x32cab3){_0x120f46=_0x120f46-0x0;var _0x44cf93=_0xea5a[_0x120f46];return _0x44cf93;};'use strict';var _=require('lodash');var util=require(_0xaea5('0x0'));var moment=require(_0xaea5('0x1'));var BPromise=require('bluebird');var rs=require(_0xaea5('0x2'));var fs=require('fs');var Redis=require(_0xaea5('0x3'));var db=require(_0xaea5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xaea5('0x5'))(_0xaea5('0x6'));var config=require('../../config/environment');var jayson=require(_0xaea5('0x7'));var client=jayson[_0xaea5('0x8')][_0xaea5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10d9ea,_0x15696e,_0x29617e){return new BPromise(function(_0x56ca9b,_0x1736c0){return client[_0xaea5('0xa')](_0x10d9ea,_0x29617e)[_0xaea5('0xb')](function(_0x1b5f90){logger[_0xaea5('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x15696e,_0xaea5('0xd'));logger['debug'](_0xaea5('0xe'),_0x15696e,_0xaea5('0xd'),JSON[_0xaea5('0xf')](_0x1b5f90));if(_0x1b5f90[_0xaea5('0x10')]){if(_0x1b5f90[_0xaea5('0x10')][_0xaea5('0x11')]===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x15696e,_0x1b5f90['error']['message']);return _0x1736c0(_0x1b5f90['error'][_0xaea5('0x12')]);}logger[_0xaea5('0x10')](_0xaea5('0x13'),_0x15696e,_0x1b5f90[_0xaea5('0x10')][_0xaea5('0x12')]);return _0x56ca9b(_0x1b5f90['error'][_0xaea5('0x12')]);}else{logger[_0xaea5('0xc')](_0xaea5('0x13'),_0x15696e,'request\x20sent');_0x56ca9b(_0x1b5f90[_0xaea5('0x14')][_0xaea5('0x12')]);}})[_0xaea5('0x15')](function(_0x5df913){logger[_0xaea5('0x10')](_0xaea5('0x13'),_0x15696e,_0x5df913);_0x1736c0(_0x5df913);});});}
\ No newline at end of file
+var _0x1458=['jayson/promise','client','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x35a5e3,_0xb14268){var _0x5653bb=function(_0x3048f0){while(--_0x3048f0){_0x35a5e3['push'](_0x35a5e3['shift']());}};_0x5653bb(++_0xb14268);}(_0x1458,0x16c));var _0x8145=function(_0x431186,_0x592739){_0x431186=_0x431186-0x0;var _0x401ce8=_0x1458[_0x431186];return _0x401ce8;};'use strict';var _=require(_0x8145('0x0'));var util=require(_0x8145('0x1'));var moment=require(_0x8145('0x2'));var BPromise=require(_0x8145('0x3'));var rs=require(_0x8145('0x4'));var fs=require('fs');var Redis=require(_0x8145('0x5'));var db=require(_0x8145('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8145('0x7'))(_0x8145('0x8'));var config=require(_0x8145('0x9'));var jayson=require(_0x8145('0xa'));var client=jayson[_0x8145('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe25a1b,_0x5f3a02,_0x5b7b04){return new BPromise(function(_0x5d2f25,_0x22468d){return client['request'](_0xe25a1b,_0x5b7b04)[_0x8145('0xc')](function(_0x1bb760){logger['info'](_0x8145('0xd'),_0x5f3a02,_0x8145('0xe'));logger[_0x8145('0xf')](_0x8145('0x10'),_0x5f3a02,_0x8145('0xe'),JSON['stringify'](_0x1bb760));if(_0x1bb760[_0x8145('0x11')]){if(_0x1bb760[_0x8145('0x11')][_0x8145('0x12')]===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x5f3a02,_0x1bb760[_0x8145('0x11')][_0x8145('0x13')]);return _0x22468d(_0x1bb760[_0x8145('0x11')][_0x8145('0x13')]);}logger[_0x8145('0x11')](_0x8145('0xd'),_0x5f3a02,_0x1bb760[_0x8145('0x11')]['message']);return _0x5d2f25(_0x1bb760[_0x8145('0x11')][_0x8145('0x13')]);}else{logger[_0x8145('0x14')](_0x8145('0xd'),_0x5f3a02,'request\x20sent');_0x5d2f25(_0x1bb760['result'][_0x8145('0x13')]);}})[_0x8145('0x15')](function(_0x19b151){logger[_0x8145('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5f3a02,_0x19b151);_0x22468d(_0x19b151);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 931ab3b..7a7cde9 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 _0x2e6f=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create'];(function(_0x58965a,_0x2e71db){var _0x254efc=function(_0xf14fb4){while(--_0xf14fb4){_0x58965a['push'](_0x58965a['shift']());}};_0x254efc(++_0x2e71db);}(_0x2e6f,0x1a6));var _0xf2e6=function(_0x575bca,_0x30a565){_0x575bca=_0x575bca-0x0;var _0x158271=_0x2e6f[_0x575bca];return _0x158271;};'use strict';var multer=require(_0xf2e6('0x0'));var util=require(_0xf2e6('0x1'));var path=require(_0xf2e6('0x2'));var timeout=require(_0xf2e6('0x3'));var express=require(_0xf2e6('0x4'));var router=express[_0xf2e6('0x5')]();var fs_extra=require(_0xf2e6('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf2e6('0x7'));var config=require(_0xf2e6('0x8'));var controller=require('./analyticExtractedReport.controller');router[_0xf2e6('0x9')]('/',auth[_0xf2e6('0xa')](),controller[_0xf2e6('0xb')]);router[_0xf2e6('0x9')](_0xf2e6('0xc'),auth[_0xf2e6('0xa')](),controller[_0xf2e6('0xd')]);router['get'](_0xf2e6('0xe'),auth[_0xf2e6('0xa')](),controller[_0xf2e6('0xf')]);router[_0xf2e6('0x10')]('/',auth[_0xf2e6('0xa')](),controller[_0xf2e6('0x11')]);router[_0xf2e6('0x12')](_0xf2e6('0xc'),auth[_0xf2e6('0xa')](),controller[_0xf2e6('0x13')]);router[_0xf2e6('0x14')](_0xf2e6('0xc'),auth[_0xf2e6('0xa')](),controller['destroy']);module[_0xf2e6('0x15')]=router;
\ No newline at end of file
+var _0x5a4e=['index','get','show','download','post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated'];(function(_0x4b9652,_0x43b335){var _0x35f6e8=function(_0x5efc1c){while(--_0x5efc1c){_0x4b9652['push'](_0x4b9652['shift']());}};_0x35f6e8(++_0x43b335);}(_0x5a4e,0x155));var _0xe5a4=function(_0x35ba71,_0xa2fbbd){_0x35ba71=_0x35ba71-0x0;var _0x5f04f4=_0x5a4e[_0x35ba71];return _0x5f04f4;};'use strict';var multer=require(_0xe5a4('0x0'));var util=require(_0xe5a4('0x1'));var path=require(_0xe5a4('0x2'));var timeout=require(_0xe5a4('0x3'));var express=require('express');var router=express[_0xe5a4('0x4')]();var fs_extra=require(_0xe5a4('0x5'));var auth=require(_0xe5a4('0x6'));var interaction=require(_0xe5a4('0x7'));var config=require(_0xe5a4('0x8'));var controller=require(_0xe5a4('0x9'));router['get']('/',auth[_0xe5a4('0xa')](),controller[_0xe5a4('0xb')]);router[_0xe5a4('0xc')]('/:id',auth[_0xe5a4('0xa')](),controller[_0xe5a4('0xd')]);router[_0xe5a4('0xc')]('/:id/download',auth[_0xe5a4('0xa')](),controller[_0xe5a4('0xe')]);router[_0xe5a4('0xf')]('/',auth[_0xe5a4('0xa')](),controller[_0xe5a4('0x10')]);router[_0xe5a4('0x11')](_0xe5a4('0x12'),auth[_0xe5a4('0xa')](),controller[_0xe5a4('0x13')]);router['delete'](_0xe5a4('0x12'),auth[_0xe5a4('0xa')](),controller[_0xe5a4('0x14')]);module[_0xe5a4('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 3c47dbd..02d2e20 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 _0x19ce=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x4213ba,_0x2e31c7){var _0x3a404e=function(_0x17d161){while(--_0x17d161){_0x4213ba['push'](_0x4213ba['shift']());}};_0x3a404e(++_0x2e31c7);}(_0x19ce,0xa1));var _0xe19c=function(_0x2b817a,_0x4bcba5){_0x2b817a=_0x2b817a-0x0;var _0x209041=_0x19ce[_0x2b817a];return _0x209041;};'use strict';var Sequelize=require(_0xe19c('0x0'));module[_0xe19c('0x1')]={'field':{'type':Sequelize[_0xe19c('0x2')]},'alias':{'type':Sequelize[_0xe19c('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xe19c('0x3')]},'groupBy':{'type':Sequelize[_0xe19c('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xe19c('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xa04e=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x5c590f,_0x4b5aa4){var _0x52ef41=function(_0x2ef2d7){while(--_0x2ef2d7){_0x5c590f['push'](_0x5c590f['shift']());}};_0x52ef41(++_0x4b5aa4);}(_0xa04e,0x6a));var _0xea04=function(_0x57f590,_0x31e929){_0x57f590=_0x57f590-0x0;var _0x3181dd=_0xa04e[_0x57f590];return _0x3181dd;};'use strict';var Sequelize=require(_0xea04('0x0'));module[_0xea04('0x1')]={'field':{'type':Sequelize[_0xea04('0x2')]},'alias':{'type':Sequelize[_0xea04('0x3')]},'function':{'type':Sequelize[_0xea04('0x3')]},'format':{'type':Sequelize[_0xea04('0x3')]},'groupBy':{'type':Sequelize[_0xea04('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xea04('0x3')]},'custom':{'type':Sequelize[_0xea04('0x4')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 4c62e21..da28dbc 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 _0xa221=['type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','bulkCreate','body','bulkDestroy','destroy','ids','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','findAll','eml-format','zip-dir','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName'];(function(_0x3507f2,_0x26b02d){var _0xd5e672=function(_0x3a8144){while(--_0x3a8144){_0x3507f2['push'](_0x3507f2['shift']());}};_0xd5e672(++_0x26b02d);}(_0xa221,0x1ba));var _0x1a22=function(_0x1a1c17,_0x385ba8){_0x1a1c17=_0x1a1c17-0x0;var _0x3cae24=_0xa221[_0x1a1c17];return _0x3cae24;};'use strict';var emlformat=require(_0x1a22('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1a22('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1a22('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x1a22('0x3'));var util=require(_0x1a22('0x4'));var path=require(_0x1a22('0x5'));var sox=require('sox');var csv=require(_0x1a22('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1a22('0x7'));var _=require(_0x1a22('0x8'));var squel=require(_0x1a22('0x9'));var crypto=require(_0x1a22('0xa'));var jsforce=require(_0x1a22('0xb'));var deskjs=require(_0x1a22('0xc'));var toCsv=require(_0x1a22('0x6'));var querystring=require(_0x1a22('0xd'));var Papa=require(_0x1a22('0xe'));var Redis=require(_0x1a22('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1a22('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1a22('0x11'))(_0x1a22('0x12'));var utils=require(_0x1a22('0x13'));var config=require(_0x1a22('0x14'));var licenseUtil=require(_0x1a22('0x15'));var db=require(_0x1a22('0x16'))['db'];function respondWithStatusCode(_0x3fb4c2,_0x1696ce){_0x1696ce=_0x1696ce||0xcc;return function(_0x1d69b2){if(_0x1d69b2){return _0x3fb4c2[_0x1a22('0x17')](_0x1696ce);}return _0x3fb4c2[_0x1a22('0x18')](_0x1696ce)['end']();};}function respondWithResult(_0x35a346,_0x11d654){_0x11d654=_0x11d654||0xc8;return function(_0x1382ca){if(_0x1382ca){return _0x35a346[_0x1a22('0x18')](_0x11d654)[_0x1a22('0x19')](_0x1382ca);}};}function respondWithFilteredResult(_0x1c8c40,_0x1e7640){return function(_0x4b2e60){if(_0x4b2e60){var _0x33f2a9=typeof _0x1e7640[_0x1a22('0x1a')]===_0x1a22('0x1b')&&typeof _0x1e7640[_0x1a22('0x1c')]==='undefined';var _0x36d83d=_0x4b2e60[_0x1a22('0x1d')];var _0x714384=_0x33f2a9?0x0:_0x1e7640[_0x1a22('0x1a')];var _0x9418dd=_0x33f2a9?_0x4b2e60[_0x1a22('0x1d')]:_0x1e7640[_0x1a22('0x1a')]+_0x1e7640[_0x1a22('0x1c')];var _0x5c9ad7;if(_0x9418dd>=_0x36d83d){_0x9418dd=_0x36d83d;_0x5c9ad7=0xc8;}else{_0x5c9ad7=0xce;}_0x1c8c40[_0x1a22('0x18')](_0x5c9ad7);return _0x1c8c40[_0x1a22('0x1e')](_0x1a22('0x1f'),_0x714384+'-'+_0x9418dd+'/'+_0x36d83d)[_0x1a22('0x19')](_0x4b2e60);}return null;};}function patchUpdates(_0x2f0cb2){return function(_0x2ee0a2){try{jsonpatch['apply'](_0x2ee0a2,_0x2f0cb2,!![]);}catch(_0x47b9eb){return BPromise[_0x1a22('0x20')](_0x47b9eb);}return _0x2ee0a2['save']();};}function saveUpdates(_0x299bbe,_0x1c3380){return function(_0x206a4b){if(_0x206a4b){return _0x206a4b[_0x1a22('0x21')](_0x299bbe)[_0x1a22('0x22')](function(_0x325f03){return _0x325f03;});}return null;};}function removeEntity(_0x5b159b,_0x4da751){return function(_0x58839e){if(_0x58839e){return _0x58839e['destroy']()[_0x1a22('0x22')](function(){_0x5b159b[_0x1a22('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x489405,_0x2a539a){return function(_0x346a00){if(!_0x346a00){_0x489405[_0x1a22('0x17')](0x194);}return _0x346a00;};}function handleError(_0x4c7093,_0x49affe){_0x49affe=_0x49affe||0x1f4;return function(_0x4bffe2){logger[_0x1a22('0x23')](_0x4bffe2[_0x1a22('0x24')]);if(_0x4bffe2['name']){delete _0x4bffe2[_0x1a22('0x25')];}_0x4c7093[_0x1a22('0x18')](_0x49affe)[_0x1a22('0x26')](_0x4bffe2);};}exports[_0x1a22('0x27')]=function(_0x527705,_0x5a7269){var _0x3997b4={},_0x4e9add={},_0x1e1409={'count':0x0,'rows':[]};var _0x28e1f2=_[_0x1a22('0x28')](db[_0x1a22('0x29')][_0x1a22('0x2a')],function(_0x546dc4){return{'name':_0x546dc4[_0x1a22('0x2b')],'type':_0x546dc4[_0x1a22('0x2c')][_0x1a22('0x2d')]};});_0x4e9add[_0x1a22('0x2e')]=_[_0x1a22('0x28')](_0x28e1f2,_0x1a22('0x25'));_0x4e9add['query']=_[_0x1a22('0x2f')](_0x527705[_0x1a22('0x30')]);_0x4e9add['filters']=_[_0x1a22('0x31')](_0x4e9add['model'],_0x4e9add[_0x1a22('0x30')]);_0x3997b4[_0x1a22('0x32')]=_['intersection'](_0x4e9add[_0x1a22('0x2e')],qs[_0x1a22('0x33')](_0x527705[_0x1a22('0x30')]['fields']));_0x3997b4['attributes']=_0x3997b4[_0x1a22('0x32')]['length']?_0x3997b4[_0x1a22('0x32')]:_0x4e9add[_0x1a22('0x2e')];if(!_0x527705[_0x1a22('0x30')][_0x1a22('0x34')](_0x1a22('0x35'))){_0x3997b4[_0x1a22('0x1c')]=qs[_0x1a22('0x1c')](_0x527705[_0x1a22('0x30')]['limit']);_0x3997b4[_0x1a22('0x1a')]=qs['offset'](_0x527705[_0x1a22('0x30')]['offset']);}_0x3997b4[_0x1a22('0x36')]=qs[_0x1a22('0x37')](_0x527705[_0x1a22('0x30')][_0x1a22('0x37')]);_0x3997b4[_0x1a22('0x38')]=qs[_0x1a22('0x39')](_['pick'](_0x527705['query'],_0x4e9add[_0x1a22('0x39')]),_0x28e1f2);if(_0x527705[_0x1a22('0x30')][_0x1a22('0x3a')]){_0x3997b4['where']=_[_0x1a22('0x3b')](_0x3997b4[_0x1a22('0x38')],{'$or':_[_0x1a22('0x28')](_0x28e1f2,function(_0x259b24){if(_0x259b24[_0x1a22('0x2c')]!==_0x1a22('0x3c')){var _0xa8652={};_0xa8652[_0x259b24[_0x1a22('0x25')]]={'$like':'%'+_0x527705[_0x1a22('0x30')][_0x1a22('0x3a')]+'%'};return _0xa8652;}})});}_0x3997b4=_[_0x1a22('0x3b')]({},_0x3997b4,_0x527705[_0x1a22('0x3d')]);var _0x484c12={'where':_0x3997b4[_0x1a22('0x38')]};return db[_0x1a22('0x29')][_0x1a22('0x1d')](_0x484c12)['then'](function(_0x2f34df){_0x1e1409[_0x1a22('0x1d')]=_0x2f34df;if(_0x527705[_0x1a22('0x30')][_0x1a22('0x3e')]){_0x3997b4[_0x1a22('0x3f')]=[{'all':!![]}];}return db[_0x1a22('0x29')]['findAll'](_0x3997b4);})[_0x1a22('0x22')](function(_0x4909e9){_0x1e1409[_0x1a22('0x40')]=_0x4909e9;return _0x1e1409;})[_0x1a22('0x22')](respondWithFilteredResult(_0x5a7269,_0x3997b4))[_0x1a22('0x41')](handleError(_0x5a7269,null));};exports[_0x1a22('0x42')]=function(_0x1d4f80,_0x31b38b){var _0x1376a7={'raw':![],'where':{'id':_0x1d4f80[_0x1a22('0x43')]['id']}},_0x3d437d={};_0x3d437d[_0x1a22('0x2e')]=_['keys'](db[_0x1a22('0x29')]['rawAttributes']);_0x3d437d['query']=_[_0x1a22('0x2f')](_0x1d4f80[_0x1a22('0x30')]);_0x3d437d[_0x1a22('0x39')]=_[_0x1a22('0x31')](_0x3d437d[_0x1a22('0x2e')],_0x3d437d[_0x1a22('0x30')]);_0x1376a7[_0x1a22('0x32')]=_[_0x1a22('0x31')](_0x3d437d[_0x1a22('0x2e')],qs[_0x1a22('0x33')](_0x1d4f80['query'][_0x1a22('0x33')]));_0x1376a7[_0x1a22('0x32')]=_0x1376a7[_0x1a22('0x32')]['length']?_0x1376a7[_0x1a22('0x32')]:_0x3d437d[_0x1a22('0x2e')];if(_0x1d4f80[_0x1a22('0x30')][_0x1a22('0x3e')]){_0x1376a7[_0x1a22('0x3f')]=[{'all':!![]}];}_0x1376a7=_[_0x1a22('0x3b')]({},_0x1376a7,_0x1d4f80[_0x1a22('0x3d')]);return db[_0x1a22('0x29')][_0x1a22('0x44')](_0x1376a7)[_0x1a22('0x22')](handleEntityNotFound(_0x31b38b,null))[_0x1a22('0x22')](respondWithResult(_0x31b38b,null))[_0x1a22('0x41')](handleError(_0x31b38b,null));};exports[_0x1a22('0x45')]=function(_0x17e7f9,_0x327c3a){return db[_0x1a22('0x29')][_0x1a22('0x45')](_0x17e7f9['body'],{})[_0x1a22('0x22')](respondWithResult(_0x327c3a,0xc9))[_0x1a22('0x41')](handleError(_0x327c3a,null));};exports[_0x1a22('0x46')]=function(_0x37b6b1,_0x2e135f){return db['AnalyticFieldReport'][_0x1a22('0x46')](_0x37b6b1['body'],{'raw':![],'individualHooks':!![]})[_0x1a22('0x22')](respondWithResult(_0x2e135f,0xc9))[_0x1a22('0x41')](handleError(_0x2e135f,null));};exports[_0x1a22('0x21')]=function(_0x177855,_0x443fa4){if(_0x177855[_0x1a22('0x47')]['id']){delete _0x177855['body']['id'];}return db[_0x1a22('0x29')][_0x1a22('0x44')]({'where':{'id':_0x177855[_0x1a22('0x43')]['id']}})[_0x1a22('0x22')](handleEntityNotFound(_0x443fa4,null))['then'](saveUpdates(_0x177855[_0x1a22('0x47')],null))[_0x1a22('0x22')](respondWithResult(_0x443fa4,null))[_0x1a22('0x41')](handleError(_0x443fa4,null));};exports['destroy']=function(_0x36b945,_0x476e1a){return db[_0x1a22('0x29')][_0x1a22('0x44')]({'where':{'id':_0x36b945[_0x1a22('0x43')]['id']}})[_0x1a22('0x22')](handleEntityNotFound(_0x476e1a,null))[_0x1a22('0x22')](removeEntity(_0x476e1a,null))['catch'](handleError(_0x476e1a,null));};exports[_0x1a22('0x48')]=function(_0x36fb4e,_0x244996){return db[_0x1a22('0x29')][_0x1a22('0x49')]({'where':{'id':_0x36fb4e[_0x1a22('0x30')][_0x1a22('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x1a22('0x22')](respondWithResult(_0x244996,0xcc))['catch'](handleError(_0x244996,null));};exports['addFields']=function(_0x2107f9,_0x451161,_0x44ac78){return db[_0x1a22('0x4b')][_0x1a22('0x4c')]({'where':{'id':_0x2107f9[_0x1a22('0x43')]['id']}})[_0x1a22('0x22')](handleEntityNotFound(_0x451161,null))[_0x1a22('0x22')](function(_0x3c5861){if(_0x3c5861){return db[_0x1a22('0x4d')][_0x1a22('0x4e')](function(_0xe484a1){return db[_0x1a22('0x29')]['destroy']({'where':{'CustomReportId':_0x2107f9[_0x1a22('0x43')]['id']},'transaction':_0xe484a1})[_0x1a22('0x22')](function(_0x1104e4){var _0x3caa0d=_[_0x1a22('0x28')](_0x2107f9['body'],function(_0x165738){delete _0x165738['id'];_0x165738[_0x1a22('0x4f')]=_0x2107f9[_0x1a22('0x43')]['id'];return _0x165738;});return db['AnalyticFieldReport']['bulkCreate'](_0x3caa0d,{'transaction':_0xe484a1});});})[_0x1a22('0x22')](function(){return db[_0x1a22('0x29')][_0x1a22('0x50')]({'where':{'CustomReportId':_0x2107f9[_0x1a22('0x43')]['id']}});});}})[_0x1a22('0x22')](respondWithResult(_0x451161,null))[_0x1a22('0x41')](handleError(_0x451161,null));};
\ No newline at end of file
+var _0xb6a7=['fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','bulkCreate','body','bulkDestroy','ids','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x52b0b2,_0xf6dbf9){var _0x322769=function(_0x3ad9da){while(--_0x3ad9da){_0x52b0b2['push'](_0x52b0b2['shift']());}};_0x322769(++_0xf6dbf9);}(_0xb6a7,0xf6));var _0x7b6a=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xb6a7[_0x565ed7];return _0x183ad7;};'use strict';var emlformat=require(_0x7b6a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b6a('0x1'));var jsonpatch=require(_0x7b6a('0x2'));var rp=require(_0x7b6a('0x3'));var moment=require(_0x7b6a('0x4'));var BPromise=require(_0x7b6a('0x5'));var Mustache=require(_0x7b6a('0x6'));var util=require(_0x7b6a('0x7'));var path=require(_0x7b6a('0x8'));var sox=require(_0x7b6a('0x9'));var csv=require(_0x7b6a('0xa'));var ejs=require(_0x7b6a('0xb'));var fs=require('fs');var fs_extra=require(_0x7b6a('0xc'));var _=require(_0x7b6a('0xd'));var squel=require(_0x7b6a('0xe'));var crypto=require(_0x7b6a('0xf'));var jsforce=require(_0x7b6a('0x10'));var deskjs=require(_0x7b6a('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7b6a('0x12'));var Redis=require(_0x7b6a('0x13'));var authService=require(_0x7b6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x7b6a('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7b6a('0x16'))('api');var utils=require(_0x7b6a('0x17'));var config=require(_0x7b6a('0x18'));var licenseUtil=require(_0x7b6a('0x19'));var db=require(_0x7b6a('0x1a'))['db'];function respondWithStatusCode(_0x2dd736,_0x1396c0){_0x1396c0=_0x1396c0||0xcc;return function(_0x513ac6){if(_0x513ac6){return _0x2dd736[_0x7b6a('0x1b')](_0x1396c0);}return _0x2dd736[_0x7b6a('0x1c')](_0x1396c0)[_0x7b6a('0x1d')]();};}function respondWithResult(_0x96e7e4,_0x577410){_0x577410=_0x577410||0xc8;return function(_0xb2f03d){if(_0xb2f03d){return _0x96e7e4[_0x7b6a('0x1c')](_0x577410)[_0x7b6a('0x1e')](_0xb2f03d);}};}function respondWithFilteredResult(_0x55f7bd,_0x2eb663){return function(_0x9a6cae){if(_0x9a6cae){var _0x6543b4=typeof _0x2eb663[_0x7b6a('0x1f')]==='undefined'&&typeof _0x2eb663[_0x7b6a('0x20')]===_0x7b6a('0x21');var _0x20f0ad=_0x9a6cae['count'];var _0x9bbeef=_0x6543b4?0x0:_0x2eb663[_0x7b6a('0x1f')];var _0x5b12ec=_0x6543b4?_0x9a6cae[_0x7b6a('0x22')]:_0x2eb663['offset']+_0x2eb663[_0x7b6a('0x20')];var _0x2cb364;if(_0x5b12ec>=_0x20f0ad){_0x5b12ec=_0x20f0ad;_0x2cb364=0xc8;}else{_0x2cb364=0xce;}_0x55f7bd[_0x7b6a('0x1c')](_0x2cb364);return _0x55f7bd[_0x7b6a('0x23')](_0x7b6a('0x24'),_0x9bbeef+'-'+_0x5b12ec+'/'+_0x20f0ad)[_0x7b6a('0x1e')](_0x9a6cae);}return null;};}function patchUpdates(_0x2bff4a){return function(_0x5d45b1){try{jsonpatch['apply'](_0x5d45b1,_0x2bff4a,!![]);}catch(_0x17eb6a){return BPromise[_0x7b6a('0x25')](_0x17eb6a);}return _0x5d45b1[_0x7b6a('0x26')]();};}function saveUpdates(_0x4f9392,_0x72c364){return function(_0x2b092f){if(_0x2b092f){return _0x2b092f[_0x7b6a('0x27')](_0x4f9392)[_0x7b6a('0x28')](function(_0x584ae0){return _0x584ae0;});}return null;};}function removeEntity(_0x2ddab4,_0xc5e36f){return function(_0x5ec37f){if(_0x5ec37f){return _0x5ec37f[_0x7b6a('0x29')]()['then'](function(){_0x2ddab4[_0x7b6a('0x1c')](0xcc)[_0x7b6a('0x1d')]();});}};}function handleEntityNotFound(_0x52de06,_0x218952){return function(_0xbf66a1){if(!_0xbf66a1){_0x52de06['sendStatus'](0x194);}return _0xbf66a1;};}function handleError(_0x3a59a0,_0x41fe1b){_0x41fe1b=_0x41fe1b||0x1f4;return function(_0x3afda3){logger[_0x7b6a('0x2a')](_0x3afda3[_0x7b6a('0x2b')]);if(_0x3afda3[_0x7b6a('0x2c')]){delete _0x3afda3[_0x7b6a('0x2c')];}_0x3a59a0[_0x7b6a('0x1c')](_0x41fe1b)[_0x7b6a('0x2d')](_0x3afda3);};}exports['index']=function(_0x5731aa,_0x300803){var _0x59d689={},_0x3c9e91={},_0x19e449={'count':0x0,'rows':[]};var _0x588598=_[_0x7b6a('0x2e')](db[_0x7b6a('0x2f')][_0x7b6a('0x30')],function(_0x58f045){return{'name':_0x58f045[_0x7b6a('0x31')],'type':_0x58f045[_0x7b6a('0x32')][_0x7b6a('0x33')]};});_0x3c9e91[_0x7b6a('0x34')]=_[_0x7b6a('0x2e')](_0x588598,_0x7b6a('0x2c'));_0x3c9e91[_0x7b6a('0x35')]=_['keys'](_0x5731aa[_0x7b6a('0x35')]);_0x3c9e91[_0x7b6a('0x36')]=_[_0x7b6a('0x37')](_0x3c9e91['model'],_0x3c9e91[_0x7b6a('0x35')]);_0x59d689[_0x7b6a('0x38')]=_[_0x7b6a('0x37')](_0x3c9e91[_0x7b6a('0x34')],qs[_0x7b6a('0x39')](_0x5731aa[_0x7b6a('0x35')][_0x7b6a('0x39')]));_0x59d689[_0x7b6a('0x38')]=_0x59d689[_0x7b6a('0x38')]['length']?_0x59d689['attributes']:_0x3c9e91[_0x7b6a('0x34')];if(!_0x5731aa['query']['hasOwnProperty']('nolimit')){_0x59d689['limit']=qs['limit'](_0x5731aa['query'][_0x7b6a('0x20')]);_0x59d689[_0x7b6a('0x1f')]=qs['offset'](_0x5731aa[_0x7b6a('0x35')][_0x7b6a('0x1f')]);}_0x59d689[_0x7b6a('0x3a')]=qs[_0x7b6a('0x3b')](_0x5731aa['query'][_0x7b6a('0x3b')]);_0x59d689[_0x7b6a('0x3c')]=qs[_0x7b6a('0x36')](_[_0x7b6a('0x3d')](_0x5731aa[_0x7b6a('0x35')],_0x3c9e91[_0x7b6a('0x36')]),_0x588598);if(_0x5731aa[_0x7b6a('0x35')][_0x7b6a('0x3e')]){_0x59d689['where']=_[_0x7b6a('0x3f')](_0x59d689[_0x7b6a('0x3c')],{'$or':_[_0x7b6a('0x2e')](_0x588598,function(_0x42b366){if(_0x42b366[_0x7b6a('0x32')]!==_0x7b6a('0x40')){var _0xf75a11={};_0xf75a11[_0x42b366[_0x7b6a('0x2c')]]={'$like':'%'+_0x5731aa[_0x7b6a('0x35')][_0x7b6a('0x3e')]+'%'};return _0xf75a11;}})});}_0x59d689=_[_0x7b6a('0x3f')]({},_0x59d689,_0x5731aa[_0x7b6a('0x41')]);var _0x184c13={'where':_0x59d689[_0x7b6a('0x3c')]};return db['AnalyticFieldReport'][_0x7b6a('0x22')](_0x184c13)[_0x7b6a('0x28')](function(_0x3abdaa){_0x19e449[_0x7b6a('0x22')]=_0x3abdaa;if(_0x5731aa[_0x7b6a('0x35')][_0x7b6a('0x42')]){_0x59d689[_0x7b6a('0x43')]=[{'all':!![]}];}return db[_0x7b6a('0x2f')][_0x7b6a('0x44')](_0x59d689);})['then'](function(_0x2be885){_0x19e449[_0x7b6a('0x45')]=_0x2be885;return _0x19e449;})[_0x7b6a('0x28')](respondWithFilteredResult(_0x300803,_0x59d689))[_0x7b6a('0x46')](handleError(_0x300803,null));};exports[_0x7b6a('0x47')]=function(_0x54fe12,_0x11ac65){var _0x5e2331={'raw':![],'where':{'id':_0x54fe12[_0x7b6a('0x48')]['id']}},_0x566434={};_0x566434[_0x7b6a('0x34')]=_[_0x7b6a('0x49')](db[_0x7b6a('0x2f')][_0x7b6a('0x30')]);_0x566434[_0x7b6a('0x35')]=_['keys'](_0x54fe12[_0x7b6a('0x35')]);_0x566434[_0x7b6a('0x36')]=_[_0x7b6a('0x37')](_0x566434['model'],_0x566434[_0x7b6a('0x35')]);_0x5e2331[_0x7b6a('0x38')]=_['intersection'](_0x566434['model'],qs[_0x7b6a('0x39')](_0x54fe12['query'][_0x7b6a('0x39')]));_0x5e2331[_0x7b6a('0x38')]=_0x5e2331[_0x7b6a('0x38')][_0x7b6a('0x4a')]?_0x5e2331[_0x7b6a('0x38')]:_0x566434[_0x7b6a('0x34')];if(_0x54fe12[_0x7b6a('0x35')][_0x7b6a('0x42')]){_0x5e2331[_0x7b6a('0x43')]=[{'all':!![]}];}_0x5e2331=_['merge']({},_0x5e2331,_0x54fe12['options']);return db[_0x7b6a('0x2f')][_0x7b6a('0x4b')](_0x5e2331)[_0x7b6a('0x28')](handleEntityNotFound(_0x11ac65,null))[_0x7b6a('0x28')](respondWithResult(_0x11ac65,null))['catch'](handleError(_0x11ac65,null));};exports[_0x7b6a('0x4c')]=function(_0xcaec43,_0x423e92){return db[_0x7b6a('0x2f')][_0x7b6a('0x4c')](_0xcaec43['body'],{})[_0x7b6a('0x28')](respondWithResult(_0x423e92,0xc9))[_0x7b6a('0x46')](handleError(_0x423e92,null));};exports[_0x7b6a('0x4d')]=function(_0x3ac714,_0x47531b){return db[_0x7b6a('0x2f')][_0x7b6a('0x4d')](_0x3ac714['body'],{'raw':![],'individualHooks':!![]})[_0x7b6a('0x28')](respondWithResult(_0x47531b,0xc9))[_0x7b6a('0x46')](handleError(_0x47531b,null));};exports[_0x7b6a('0x27')]=function(_0x189e87,_0xa21ed3){if(_0x189e87[_0x7b6a('0x4e')]['id']){delete _0x189e87[_0x7b6a('0x4e')]['id'];}return db[_0x7b6a('0x2f')][_0x7b6a('0x4b')]({'where':{'id':_0x189e87[_0x7b6a('0x48')]['id']}})[_0x7b6a('0x28')](handleEntityNotFound(_0xa21ed3,null))['then'](saveUpdates(_0x189e87[_0x7b6a('0x4e')],null))['then'](respondWithResult(_0xa21ed3,null))[_0x7b6a('0x46')](handleError(_0xa21ed3,null));};exports[_0x7b6a('0x29')]=function(_0xa8d595,_0x548408){return db[_0x7b6a('0x2f')][_0x7b6a('0x4b')]({'where':{'id':_0xa8d595[_0x7b6a('0x48')]['id']}})[_0x7b6a('0x28')](handleEntityNotFound(_0x548408,null))['then'](removeEntity(_0x548408,null))['catch'](handleError(_0x548408,null));};exports[_0x7b6a('0x4f')]=function(_0x3d7ede,_0xc93eff){return db[_0x7b6a('0x2f')][_0x7b6a('0x29')]({'where':{'id':_0x3d7ede[_0x7b6a('0x35')][_0x7b6a('0x50')]||[]},'raw':![],'individualHooks':!![]})[_0x7b6a('0x28')](respondWithResult(_0xc93eff,0xcc))[_0x7b6a('0x46')](handleError(_0xc93eff,null));};exports['addFields']=function(_0x2d13f3,_0x2fb96a,_0x936728){return db[_0x7b6a('0x51')][_0x7b6a('0x52')]({'where':{'id':_0x2d13f3[_0x7b6a('0x48')]['id']}})[_0x7b6a('0x28')](handleEntityNotFound(_0x2fb96a,null))[_0x7b6a('0x28')](function(_0x2b4312){if(_0x2b4312){return db[_0x7b6a('0x53')][_0x7b6a('0x54')](function(_0x2f900f){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x2d13f3['params']['id']},'transaction':_0x2f900f})[_0x7b6a('0x28')](function(_0x2a7bd2){var _0x1f40bb=_['map'](_0x2d13f3[_0x7b6a('0x4e')],function(_0x18532e){delete _0x18532e['id'];_0x18532e[_0x7b6a('0x55')]=_0x2d13f3[_0x7b6a('0x48')]['id'];return _0x18532e;});return db[_0x7b6a('0x2f')][_0x7b6a('0x4d')](_0x1f40bb,{'transaction':_0x2f900f});});})['then'](function(){return db[_0x7b6a('0x2f')][_0x7b6a('0x44')]({'where':{'CustomReportId':_0x2d13f3['params']['id']}});});}})['then'](respondWithResult(_0x2fb96a,null))['catch'](handleError(_0x2fb96a,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index af01f2f..8bfb1f4 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 _0xc511=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','util'];(function(_0x5948a7,_0x944950){var _0x4926e6=function(_0x42c767){while(--_0x42c767){_0x5948a7['push'](_0x5948a7['shift']());}};_0x4926e6(++_0x944950);}(_0xc511,0x166));var _0x1c51=function(_0x18e52b,_0x1fae35){_0x18e52b=_0x18e52b-0x0;var _0x3d3062=_0xc511[_0x18e52b];return _0x3d3062;};'use strict';var _=require(_0x1c51('0x0'));var util=require(_0x1c51('0x1'));var logger=require(_0x1c51('0x2'))('api');var moment=require(_0x1c51('0x3'));var BPromise=require(_0x1c51('0x4'));var rp=require(_0x1c51('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1c51('0x6'));var config=require(_0x1c51('0x7'));var attributes=require(_0x1c51('0x8'));module[_0x1c51('0x9')]=function(_0x21d241,_0x399d5d){return _0x21d241['define'](_0x1c51('0xa'),attributes,{'tableName':_0x1c51('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1346=['path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x36a7cf,_0x2dfa31){var _0x4862ec=function(_0x4b8fd1){while(--_0x4b8fd1){_0x36a7cf['push'](_0x36a7cf['shift']());}};_0x4862ec(++_0x2dfa31);}(_0x1346,0xf6));var _0x6134=function(_0xf44ff2,_0x5e9e66){_0xf44ff2=_0xf44ff2-0x0;var _0x241096=_0x1346[_0xf44ff2];return _0x241096;};'use strict';var _=require(_0x6134('0x0'));var util=require(_0x6134('0x1'));var logger=require(_0x6134('0x2'))('api');var moment=require(_0x6134('0x3'));var BPromise=require(_0x6134('0x4'));var rp=require(_0x6134('0x5'));var fs=require('fs');var path=require(_0x6134('0x6'));var rimraf=require(_0x6134('0x7'));var config=require(_0x6134('0x8'));var attributes=require(_0x6134('0x9'));module[_0x6134('0xa')]=function(_0x50e981,_0x4b8d61){return _0x50e981[_0x6134('0xb')](_0x6134('0xc'),attributes,{'tableName':_0x6134('0xd'),'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 1a2c8b8..931db44 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 _0x37fb=['error','code','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x37fb,0xec));var _0xb37f=function(_0x436ed4,_0x1fb74b){_0x436ed4=_0x436ed4-0x0;var _0x560ac7=_0x37fb[_0x436ed4];return _0x560ac7;};'use strict';var _=require('lodash');var util=require(_0xb37f('0x0'));var moment=require(_0xb37f('0x1'));var BPromise=require(_0xb37f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb37f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb37f('0x4'))(_0xb37f('0x5'));var config=require(_0xb37f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb37f('0x7')][_0xb37f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x256866,_0x6029e4,_0x374a43){return new BPromise(function(_0x172283,_0x80ac6){return client[_0xb37f('0x9')](_0x256866,_0x374a43)[_0xb37f('0xa')](function(_0x89f253){logger[_0xb37f('0xb')](_0xb37f('0xc'),_0x6029e4,'request\x20sent');logger['debug'](_0xb37f('0xd'),_0x6029e4,_0xb37f('0xe'),JSON[_0xb37f('0xf')](_0x89f253));if(_0x89f253[_0xb37f('0x10')]){if(_0x89f253[_0xb37f('0x10')][_0xb37f('0x11')]===0x1f4){logger[_0xb37f('0x10')](_0xb37f('0xc'),_0x6029e4,_0x89f253['error']['message']);return _0x80ac6(_0x89f253[_0xb37f('0x10')][_0xb37f('0x12')]);}logger[_0xb37f('0x10')](_0xb37f('0xc'),_0x6029e4,_0x89f253[_0xb37f('0x10')][_0xb37f('0x12')]);return _0x172283(_0x89f253[_0xb37f('0x10')]['message']);}else{logger['info'](_0xb37f('0xc'),_0x6029e4,_0xb37f('0xe'));_0x172283(_0x89f253[_0xb37f('0x13')]['message']);}})[_0xb37f('0x14')](function(_0x5c34a5){logger['error'](_0xb37f('0xc'),_0x6029e4,_0x5c34a5);_0x80ac6(_0x5c34a5);});});}
\ No newline at end of file
+var _0x7a1f=['client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x2034d2,_0x59d479){var _0x2b99af=function(_0x322771){while(--_0x322771){_0x2034d2['push'](_0x2034d2['shift']());}};_0x2b99af(++_0x59d479);}(_0x7a1f,0x134));var _0xf7a1=function(_0x11946c,_0x12152c){_0x11946c=_0x11946c-0x0;var _0x383935=_0x7a1f[_0x11946c];return _0x383935;};'use strict';var _=require(_0xf7a1('0x0'));var util=require(_0xf7a1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf7a1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf7a1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf7a1('0x4'))('rpc');var config=require(_0xf7a1('0x5'));var jayson=require(_0xf7a1('0x6'));var client=jayson[_0xf7a1('0x7')][_0xf7a1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe76d88,_0x169f3c,_0x4ae197){return new BPromise(function(_0x9ed9c2,_0x104700){return client[_0xf7a1('0x9')](_0xe76d88,_0x4ae197)[_0xf7a1('0xa')](function(_0x234691){logger[_0xf7a1('0xb')](_0xf7a1('0xc'),_0x169f3c,_0xf7a1('0xd'));logger['debug'](_0xf7a1('0xe'),_0x169f3c,'request\x20sent',JSON[_0xf7a1('0xf')](_0x234691));if(_0x234691['error']){if(_0x234691[_0xf7a1('0x10')][_0xf7a1('0x11')]===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x169f3c,_0x234691[_0xf7a1('0x10')][_0xf7a1('0x12')]);return _0x104700(_0x234691['error']['message']);}logger[_0xf7a1('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x169f3c,_0x234691[_0xf7a1('0x10')][_0xf7a1('0x12')]);return _0x9ed9c2(_0x234691['error'][_0xf7a1('0x12')]);}else{logger[_0xf7a1('0xb')](_0xf7a1('0xc'),_0x169f3c,_0xf7a1('0xd'));_0x9ed9c2(_0x234691[_0xf7a1('0x13')][_0xf7a1('0x12')]);}})[_0xf7a1('0x14')](function(_0x28a43e){logger[_0xf7a1('0x10')](_0xf7a1('0xc'),_0x169f3c,_0x28a43e);_0x104700(_0x28a43e);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 0b489ad..cb74356 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(_0x5cd7be,_0x255740){var _0x527e37=function(_0x3eb157){while(--_0x3eb157){_0x5cd7be['push'](_0x5cd7be['shift']());}};_0x527e37(++_0x255740);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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(_0x276999,_0x786d6f){var _0x4ac783=function(_0x38ecc2){while(--_0x38ecc2){_0x276999['push'](_0x276999['shift']());}};_0x4ac783(++_0x786d6f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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 3a3006a..021e770 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 _0xd820=['exports','name','STRING','sequelize'];(function(_0x134f16,_0x148d1e){var _0x506c95=function(_0x257667){while(--_0x257667){_0x134f16['push'](_0x134f16['shift']());}};_0x506c95(++_0x148d1e);}(_0xd820,0x16f));var _0x0d82=function(_0x34cafa,_0x251fc9){_0x34cafa=_0x34cafa-0x0;var _0x2741d1=_0xd820[_0x34cafa];return _0x2741d1;};'use strict';var Sequelize=require(_0x0d82('0x0'));module[_0x0d82('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0d82('0x2')},'table':{'type':Sequelize[_0x0d82('0x3')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xd8b0=['STRING','sequelize','exports','TEXT'];(function(_0x2c341e,_0x414d11){var _0x43c1e8=function(_0xe783f3){while(--_0xe783f3){_0x2c341e['push'](_0x2c341e['shift']());}};_0x43c1e8(++_0x414d11);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x0d8b('0x2')]},'description':{'type':Sequelize[_0x0d8b('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index cfe5f35..7d082a8 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(_0x2a8554,_0x2c15cb){var _0x1d14ad=function(_0x404580){while(--_0x404580){_0x2a8554['push'](_0x2a8554['shift']());}};_0x1d14ad(++_0x2c15cb);}(_0x8ef6,0xf2));var _0x68ef=function(_0x4a00cc,_0x297247){_0x4a00cc=_0x4a00cc-0x0;var _0x179c2a=_0x8ef6[_0x4a00cc];return _0x179c2a;};'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 _0x8d0e=['then','get','Metrics','UserProfileResource','end','sendStatus','error','stack','name','send','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','fields','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','count','set','apply','reject','save','update','destroy'];(function(_0x1f88d4,_0x3f2a9c){var _0x31970d=function(_0x439a8a){while(--_0x439a8a){_0x1f88d4['push'](_0x1f88d4['shift']());}};_0x31970d(++_0x3f2a9c);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x1fa400,_0x850a42){_0x1fa400=_0x1fa400-0x0;var _0x65cddc=_0x8d0e[_0x1fa400];return _0x65cddc;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];function respondWithStatusCode(_0x5934b2,_0x38fac0){_0x38fac0=_0x38fac0||0xcc;return function(_0x15b9e5){if(_0x15b9e5){return _0x5934b2['sendStatus'](_0x38fac0);}return _0x5934b2[_0xe8d0('0x1b')](_0x38fac0)['end']();};}function respondWithResult(_0x59b4b7,_0x90a1ea){_0x90a1ea=_0x90a1ea||0xc8;return function(_0x2aa906){if(_0x2aa906){return _0x59b4b7[_0xe8d0('0x1b')](_0x90a1ea)[_0xe8d0('0x1c')](_0x2aa906);}};}function respondWithFilteredResult(_0x15d3a1,_0x7151c6){return function(_0x52818a){if(_0x52818a){var _0x6ccffa=typeof _0x7151c6['offset']===_0xe8d0('0x1d')&&typeof _0x7151c6[_0xe8d0('0x1e')]===_0xe8d0('0x1d');var _0x4d1db4=_0x52818a['count'];var _0x47c67a=_0x6ccffa?0x0:_0x7151c6[_0xe8d0('0x1f')];var _0x384854=_0x6ccffa?_0x52818a[_0xe8d0('0x20')]:_0x7151c6[_0xe8d0('0x1f')]+_0x7151c6[_0xe8d0('0x1e')];var _0x588133;if(_0x384854>=_0x4d1db4){_0x384854=_0x4d1db4;_0x588133=0xc8;}else{_0x588133=0xce;}_0x15d3a1[_0xe8d0('0x1b')](_0x588133);return _0x15d3a1[_0xe8d0('0x21')]('Content-Range',_0x47c67a+'-'+_0x384854+'/'+_0x4d1db4)['json'](_0x52818a);}return null;};}function patchUpdates(_0x554402){return function(_0x384a60){try{jsonpatch[_0xe8d0('0x22')](_0x384a60,_0x554402,!![]);}catch(_0x25363b){return BPromise[_0xe8d0('0x23')](_0x25363b);}return _0x384a60[_0xe8d0('0x24')]();};}function saveUpdates(_0x23a945,_0x1bd25c){return function(_0x28a6b5){if(_0x28a6b5){return _0x28a6b5[_0xe8d0('0x25')](_0x23a945)['then'](function(_0xed8f2e){return _0xed8f2e;});}return null;};}function removeEntity(_0x9f747,_0x572c25){return function(_0x106614){if(_0x106614){return _0x106614[_0xe8d0('0x26')]()[_0xe8d0('0x27')](function(){var _0xd86c76=_0x106614[_0xe8d0('0x28')]({'plain':!![]});var _0x149dfd=_0xe8d0('0x29');return db[_0xe8d0('0x2a')][_0xe8d0('0x26')]({'where':{'type':_0x149dfd,'resourceId':_0xd86c76['id']}})[_0xe8d0('0x27')](function(){return _0x106614;});})[_0xe8d0('0x27')](function(){_0x9f747['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0x26dd52,_0x10dec2){return function(_0x486f49){if(!_0x486f49){_0x26dd52[_0xe8d0('0x2c')](0x194);}return _0x486f49;};}function handleError(_0x343b08,_0x526240){_0x526240=_0x526240||0x1f4;return function(_0x1519e2){logger[_0xe8d0('0x2d')](_0x1519e2[_0xe8d0('0x2e')]);if(_0x1519e2[_0xe8d0('0x2f')]){delete _0x1519e2[_0xe8d0('0x2f')];}_0x343b08['status'](_0x526240)[_0xe8d0('0x30')](_0x1519e2);};}exports['index']=function(_0x5d3276,_0x50ad3c){var _0x547a2b={},_0x13cd4c={},_0x36ccec={'count':0x0,'rows':[]};var _0x5151fa=_['map'](db[_0xe8d0('0x31')]['rawAttributes'],function(_0x3b5d31){return{'name':_0x3b5d31[_0xe8d0('0x32')],'type':_0x3b5d31[_0xe8d0('0x33')][_0xe8d0('0x34')]};});_0x13cd4c[_0xe8d0('0x35')]=_['map'](_0x5151fa,_0xe8d0('0x2f'));_0x13cd4c[_0xe8d0('0x36')]=_[_0xe8d0('0x37')](_0x5d3276[_0xe8d0('0x36')]);_0x13cd4c['filters']=_[_0xe8d0('0x38')](_0x13cd4c[_0xe8d0('0x35')],_0x13cd4c['query']);_0x547a2b[_0xe8d0('0x39')]=_['intersection'](_0x13cd4c[_0xe8d0('0x35')],qs['fields'](_0x5d3276[_0xe8d0('0x36')]['fields']));_0x547a2b[_0xe8d0('0x39')]=_0x547a2b[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x547a2b[_0xe8d0('0x39')]:_0x13cd4c['model'];if(!_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3b')](_0xe8d0('0x3c'))){_0x547a2b['limit']=qs[_0xe8d0('0x1e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x1e')]);_0x547a2b[_0xe8d0('0x1f')]=qs[_0xe8d0('0x1f')](_0x5d3276['query'][_0xe8d0('0x1f')]);}_0x547a2b[_0xe8d0('0x3d')]=qs[_0xe8d0('0x3e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3e')]);_0x547a2b[_0xe8d0('0x3f')]=qs[_0xe8d0('0x40')](_[_0xe8d0('0x41')](_0x5d3276['query'],_0x13cd4c['filters']),_0x5151fa);if(_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x42')]){_0x547a2b[_0xe8d0('0x3f')]=_[_0xe8d0('0x43')](_0x547a2b[_0xe8d0('0x3f')],{'$or':_['map'](_0x5151fa,function(_0x2e4362){if(_0x2e4362['type']!==_0xe8d0('0x44')){var _0x458294={};_0x458294[_0x2e4362[_0xe8d0('0x2f')]]={'$like':'%'+_0x5d3276['query'][_0xe8d0('0x42')]+'%'};return _0x458294;}})});}_0x547a2b=_[_0xe8d0('0x43')]({},_0x547a2b,_0x5d3276[_0xe8d0('0x45')]);var _0x230a90={'where':_0x547a2b[_0xe8d0('0x3f')]};return db['AnalyticMetric']['count'](_0x230a90)['then'](function(_0x4cf0da){_0x36ccec[_0xe8d0('0x20')]=_0x4cf0da;if(_0x5d3276['query'][_0xe8d0('0x46')]){_0x547a2b[_0xe8d0('0x47')]=[{'all':!![]}];}return db[_0xe8d0('0x31')][_0xe8d0('0x48')](_0x547a2b);})[_0xe8d0('0x27')](function(_0x1156da){_0x36ccec[_0xe8d0('0x49')]=_0x1156da;return _0x36ccec;})[_0xe8d0('0x27')](respondWithFilteredResult(_0x50ad3c,_0x547a2b))['catch'](handleError(_0x50ad3c,null));};exports[_0xe8d0('0x4a')]=function(_0x1da8b2,_0x4a3740){var _0x4bcdff={'raw':!![],'where':{'id':_0x1da8b2[_0xe8d0('0x4b')]['id']}},_0x3825a1={};_0x3825a1[_0xe8d0('0x35')]=_['keys'](db[_0xe8d0('0x31')][_0xe8d0('0x4c')]);_0x3825a1['query']=_[_0xe8d0('0x37')](_0x1da8b2[_0xe8d0('0x36')]);_0x3825a1['filters']=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],_0x3825a1[_0xe8d0('0x36')]);_0x4bcdff[_0xe8d0('0x39')]=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],qs[_0xe8d0('0x4d')](_0x1da8b2[_0xe8d0('0x36')]['fields']));_0x4bcdff[_0xe8d0('0x39')]=_0x4bcdff[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x4bcdff[_0xe8d0('0x39')]:_0x3825a1[_0xe8d0('0x35')];if(_0x1da8b2[_0xe8d0('0x36')][_0xe8d0('0x46')]){_0x4bcdff[_0xe8d0('0x47')]=[{'all':!![]}];}_0x4bcdff=_[_0xe8d0('0x43')]({},_0x4bcdff,_0x1da8b2[_0xe8d0('0x45')]);return db[_0xe8d0('0x31')][_0xe8d0('0x4e')](_0x4bcdff)['then'](handleEntityNotFound(_0x4a3740,null))[_0xe8d0('0x27')](respondWithResult(_0x4a3740,null))[_0xe8d0('0x4f')](handleError(_0x4a3740,null));};exports[_0xe8d0('0x50')]=function(_0xad7d94,_0x34047c){return db[_0xe8d0('0x31')][_0xe8d0('0x50')](_0xad7d94['body'],{})[_0xe8d0('0x27')](function(_0x424764){var _0x151cf4=_0xad7d94[_0xe8d0('0x51')]['get']({'plain':!![]});if(!_0x151cf4)throw new Error(_0xe8d0('0x52'));if(_0x151cf4['role']===_0xe8d0('0x51')){var _0x382ae9=_0x424764[_0xe8d0('0x28')]({'plain':!![]});var _0x158d24=_0xe8d0('0x29');return db[_0xe8d0('0x53')][_0xe8d0('0x4e')]({'where':{'name':_0x158d24,'userProfileId':_0x151cf4['userProfileId']},'raw':!![]})[_0xe8d0('0x27')](function(_0x55f93d){if(_0x55f93d&&_0x55f93d['autoAssociation']===0x0){return db[_0xe8d0('0x2a')]['create']({'name':_0x382ae9[_0xe8d0('0x2f')],'resourceId':_0x382ae9['id'],'type':_0x55f93d['name'],'sectionId':_0x55f93d['id']},{})[_0xe8d0('0x27')](function(){return _0x424764;});}else{return _0x424764;}})[_0xe8d0('0x4f')](function(_0x13713c){logger[_0xe8d0('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13713c);throw _0x13713c;});}return _0x424764;})[_0xe8d0('0x27')](respondWithResult(_0x34047c,0xc9))[_0xe8d0('0x4f')](handleError(_0x34047c,null));};exports[_0xe8d0('0x25')]=function(_0x2e3f1d,_0x18cc14){if(_0x2e3f1d['body']['id']){delete _0x2e3f1d[_0xe8d0('0x54')]['id'];}return db[_0xe8d0('0x31')][_0xe8d0('0x4e')]({'where':{'id':_0x2e3f1d['params']['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x18cc14,null))['then'](saveUpdates(_0x2e3f1d['body'],null))[_0xe8d0('0x27')](respondWithResult(_0x18cc14,null))[_0xe8d0('0x4f')](handleError(_0x18cc14,null));};exports['destroy']=function(_0xcb6ce2,_0x3a8074){return db['AnalyticMetric'][_0xe8d0('0x4e')]({'where':{'id':_0xcb6ce2[_0xe8d0('0x4b')]['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x3a8074,null))[_0xe8d0('0x27')](removeEntity(_0x3a8074,null))['catch'](handleError(_0x3a8074,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index fa61d76..9d1caeb 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 _0xbc1c=['path','rimraf','./analyticMetric.attributes','exports','define','AnalyticMetric','util','api','bluebird','request-promise'];(function(_0x37a713,_0x59d661){var _0x4ee6b3=function(_0x22b2dd){while(--_0x22b2dd){_0x37a713['push'](_0x37a713['shift']());}};_0x4ee6b3(++_0x59d661);}(_0xbc1c,0xd8));var _0xcbc1=function(_0x152aa1,_0x307718){_0x152aa1=_0x152aa1-0x0;var _0x1bc01a=_0xbc1c[_0x152aa1];return _0x1bc01a;};'use strict';var _=require('lodash');var util=require(_0xcbc1('0x0'));var logger=require('../../config/logger')(_0xcbc1('0x1'));var moment=require('moment');var BPromise=require(_0xcbc1('0x2'));var rp=require(_0xcbc1('0x3'));var fs=require('fs');var path=require(_0xcbc1('0x4'));var rimraf=require(_0xcbc1('0x5'));var config=require('../../config/environment');var attributes=require(_0xcbc1('0x6'));module[_0xcbc1('0x7')]=function(_0x54c13c,_0x27da8d){return _0x54c13c[_0xcbc1('0x8')](_0xcbc1('0x9'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe4d9=['moment','path','rimraf','./analyticMetric.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x1e43f3,_0x842e34){var _0x56f416=function(_0x221a26){while(--_0x221a26){_0x1e43f3['push'](_0x1e43f3['shift']());}};_0x56f416(++_0x842e34);}(_0xe4d9,0x141));var _0x9e4d=function(_0x2c62a1,_0x320c52){_0x2c62a1=_0x2c62a1-0x0;var _0xd6e286=_0xe4d9[_0x2c62a1];return _0xd6e286;};'use strict';var _=require(_0x9e4d('0x0'));var util=require(_0x9e4d('0x1'));var logger=require(_0x9e4d('0x2'))('api');var moment=require(_0x9e4d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e4d('0x4'));var rimraf=require(_0x9e4d('0x5'));var config=require('../../config/environment');var attributes=require(_0x9e4d('0x6'));module[_0x9e4d('0x7')]=function(_0x5a4881,_0x493fb5){return _0x5a4881[_0x9e4d('0x8')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index b24ae9a..c9cb516 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 _0x5139=['http','request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x1dae94,_0x239003){var _0x36ce2d=function(_0x295f18){while(--_0x295f18){_0x1dae94['push'](_0x1dae94['shift']());}};_0x36ce2d(++_0x239003);}(_0x5139,0x183));var _0x9513=function(_0x1c695a,_0x186ab4){_0x1c695a=_0x1c695a-0x0;var _0x38b9e0=_0x5139[_0x1c695a];return _0x38b9e0;};'use strict';var _=require(_0x9513('0x0'));var util=require(_0x9513('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9513('0x2'));var fs=require('fs');var Redis=require(_0x9513('0x3'));var db=require(_0x9513('0x4'))['db'];var utils=require(_0x9513('0x5'));var logger=require(_0x9513('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9513('0x7'));var client=jayson[_0x9513('0x8')][_0x9513('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4750c5,_0x110c74,_0x292b21){return new BPromise(function(_0x209dc5,_0x126aa2){return client[_0x9513('0xa')](_0x4750c5,_0x292b21)[_0x9513('0xb')](function(_0x4824f7){logger[_0x9513('0xc')](_0x9513('0xd'),_0x110c74,'request\x20sent');logger[_0x9513('0xe')](_0x9513('0xf'),_0x110c74,_0x9513('0x10'),JSON[_0x9513('0x11')](_0x4824f7));if(_0x4824f7[_0x9513('0x12')]){if(_0x4824f7[_0x9513('0x12')][_0x9513('0x13')]===0x1f4){logger['error'](_0x9513('0xd'),_0x110c74,_0x4824f7[_0x9513('0x12')][_0x9513('0x14')]);return _0x126aa2(_0x4824f7[_0x9513('0x12')][_0x9513('0x14')]);}logger[_0x9513('0x12')](_0x9513('0xd'),_0x110c74,_0x4824f7[_0x9513('0x12')][_0x9513('0x14')]);return _0x209dc5(_0x4824f7[_0x9513('0x12')][_0x9513('0x14')]);}else{logger[_0x9513('0xc')](_0x9513('0xd'),_0x110c74,_0x9513('0x10'));_0x209dc5(_0x4824f7[_0x9513('0x15')][_0x9513('0x14')]);}})['catch'](function(_0x16eda6){logger[_0x9513('0x12')](_0x9513('0xd'),_0x110c74,_0x16eda6);_0x126aa2(_0x16eda6);});});}
\ No newline at end of file
+var _0x876a=['rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x559757,_0x3be899){var _0x160474=function(_0x4f5a2b){while(--_0x4f5a2b){_0x559757['push'](_0x559757['shift']());}};_0x160474(++_0x3be899);}(_0x876a,0x1f2));var _0xa876=function(_0x2c8574,_0x2c6cde){_0x2c8574=_0x2c8574-0x0;var _0x4c8129=_0x876a[_0x2c8574];return _0x4c8129;};'use strict';var _=require(_0xa876('0x0'));var util=require(_0xa876('0x1'));var moment=require('moment');var BPromise=require(_0xa876('0x2'));var rs=require(_0xa876('0x3'));var fs=require('fs');var Redis=require(_0xa876('0x4'));var db=require(_0xa876('0x5'))['db'];var utils=require(_0xa876('0x6'));var logger=require(_0xa876('0x7'))(_0xa876('0x8'));var config=require(_0xa876('0x9'));var jayson=require(_0xa876('0xa'));var client=jayson[_0xa876('0xb')][_0xa876('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1e49e4,_0x2e8c80,_0x4b8a85){return new BPromise(function(_0x138be1,_0x519ea6){return client['request'](_0x1e49e4,_0x4b8a85)[_0xa876('0xd')](function(_0x4578c9){logger[_0xa876('0xe')](_0xa876('0xf'),_0x2e8c80,_0xa876('0x10'));logger[_0xa876('0x11')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x2e8c80,_0xa876('0x10'),JSON[_0xa876('0x12')](_0x4578c9));if(_0x4578c9['error']){if(_0x4578c9[_0xa876('0x13')]['code']===0x1f4){logger[_0xa876('0x13')](_0xa876('0xf'),_0x2e8c80,_0x4578c9['error'][_0xa876('0x14')]);return _0x519ea6(_0x4578c9[_0xa876('0x13')][_0xa876('0x14')]);}logger[_0xa876('0x13')](_0xa876('0xf'),_0x2e8c80,_0x4578c9[_0xa876('0x13')]['message']);return _0x138be1(_0x4578c9[_0xa876('0x13')][_0xa876('0x14')]);}else{logger[_0xa876('0xe')](_0xa876('0xf'),_0x2e8c80,'request\x20sent');_0x138be1(_0x4578c9[_0xa876('0x15')][_0xa876('0x14')]);}})[_0xa876('0x16')](function(_0x21243d){logger[_0xa876('0x13')](_0xa876('0xf'),_0x2e8c80,_0x21243d);_0x519ea6(_0x21243d);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index ca2f80c..d9c5e53 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 _0xd2bb=['get','isAuthenticated','index','/:id','show','post','put','update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller'];(function(_0x24a0b6,_0x3394da){var _0x3cdb5e=function(_0x1f1c11){while(--_0x1f1c11){_0x24a0b6['push'](_0x24a0b6['shift']());}};_0x3cdb5e(++_0x3394da);}(_0xd2bb,0x9a));var _0xbd2b=function(_0x9e0fad,_0x1fcf56){_0x9e0fad=_0x9e0fad-0x0;var _0x1a3f9c=_0xd2bb[_0x9e0fad];return _0x1a3f9c;};'use strict';var multer=require('multer');var util=require(_0xbd2b('0x0'));var path=require('path');var timeout=require(_0xbd2b('0x1'));var express=require(_0xbd2b('0x2'));var router=express[_0xbd2b('0x3')]();var fs_extra=require(_0xbd2b('0x4'));var auth=require(_0xbd2b('0x5'));var interaction=require(_0xbd2b('0x6'));var config=require('../../config/environment');var controller=require(_0xbd2b('0x7'));router[_0xbd2b('0x8')]('/',auth[_0xbd2b('0x9')](),controller[_0xbd2b('0xa')]);router[_0xbd2b('0x8')](_0xbd2b('0xb'),auth[_0xbd2b('0x9')](),controller[_0xbd2b('0xc')]);router[_0xbd2b('0xd')]('/',auth[_0xbd2b('0x9')](),controller['create']);router[_0xbd2b('0xe')]('/:id',auth[_0xbd2b('0x9')](),controller[_0xbd2b('0xf')]);router['delete'](_0xbd2b('0xb'),auth[_0xbd2b('0x9')](),controller[_0xbd2b('0x10')]);module[_0xbd2b('0x11')]=router;
\ No newline at end of file
+var _0x3561=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','show','post','put','/:id','update','exports','multer','path','connect-timeout','express'];(function(_0x367eca,_0x20ebf4){var _0x53888a=function(_0x1eea02){while(--_0x1eea02){_0x367eca['push'](_0x367eca['shift']());}};_0x53888a(++_0x20ebf4);}(_0x3561,0x94));var _0x1356=function(_0x5350f4,_0x48a111){_0x5350f4=_0x5350f4-0x0;var _0xf76cfc=_0x3561[_0x5350f4];return _0xf76cfc;};'use strict';var multer=require(_0x1356('0x0'));var util=require('util');var path=require(_0x1356('0x1'));var timeout=require(_0x1356('0x2'));var express=require(_0x1356('0x3'));var router=express[_0x1356('0x4')]();var fs_extra=require(_0x1356('0x5'));var auth=require(_0x1356('0x6'));var interaction=require(_0x1356('0x7'));var config=require(_0x1356('0x8'));var controller=require(_0x1356('0x9'));router[_0x1356('0xa')]('/',auth[_0x1356('0xb')](),controller[_0x1356('0xc')]);router[_0x1356('0xa')]('/:id',auth[_0x1356('0xb')](),controller[_0x1356('0xd')]);router[_0x1356('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1356('0xf')](_0x1356('0x10'),auth['isAuthenticated'](),controller[_0x1356('0x11')]);router['delete'](_0x1356('0x10'),auth[_0x1356('0xb')](),controller['destroy']);module[_0x1356('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 71ce92d..b6f3ad8 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 _0x9dd5=['TEXT','sequelize','exports'];(function(_0x13309a,_0x24b152){var _0x482510=function(_0x54d681){while(--_0x54d681){_0x13309a['push'](_0x13309a['shift']());}};_0x482510(++_0x24b152);}(_0x9dd5,0x1d2));var _0x59dd=function(_0x3698b8,_0x5230a1){_0x3698b8=_0x3698b8-0x0;var _0x2bf571=_0x9dd5[_0x3698b8];return _0x2bf571;};'use strict';var Sequelize=require(_0x59dd('0x0'));module[_0x59dd('0x1')]={'tree':{'type':Sequelize[_0x59dd('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x70e2=['sequelize','exports','TEXT'];(function(_0x39665a,_0xc729df){var _0x173185=function(_0x2263f4){while(--_0x2263f4){_0x39665a['push'](_0x39665a['shift']());}};_0x173185(++_0xc729df);}(_0x70e2,0xc3));var _0x270e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x70e2[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x270e('0x0'));module[_0x270e('0x1')]={'tree':{'type':Sequelize[_0x270e('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 c8445d8..8726bf0 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 _0x3c08=['desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','merge','where','VIRTUAL','filter','includeAll','include','findAll','show','params','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto'];(function(_0x58175c,_0x2d9373){var _0x55b88f=function(_0x13ed84){while(--_0x13ed84){_0x58175c['push'](_0x58175c['shift']());}};_0x55b88f(++_0x2d9373);}(_0x3c08,0x12d));var _0x83c0=function(_0x243203,_0x2a9990){_0x243203=_0x243203-0x0;var _0x4707de=_0x3c08[_0x243203];return _0x4707de;};'use strict';var emlformat=require(_0x83c0('0x0'));var rimraf=require(_0x83c0('0x1'));var zipdir=require(_0x83c0('0x2'));var jsonpatch=require(_0x83c0('0x3'));var rp=require(_0x83c0('0x4'));var moment=require(_0x83c0('0x5'));var BPromise=require(_0x83c0('0x6'));var Mustache=require(_0x83c0('0x7'));var util=require(_0x83c0('0x8'));var path=require('path');var sox=require(_0x83c0('0x9'));var csv=require(_0x83c0('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x83c0('0xb'));var _=require(_0x83c0('0xc'));var squel=require(_0x83c0('0xd'));var crypto=require(_0x83c0('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x83c0('0xf'));var toCsv=require(_0x83c0('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x83c0('0x10'));var qs=require(_0x83c0('0x11'));var as=require(_0x83c0('0x12'));var hardwareService=require(_0x83c0('0x13'));var logger=require(_0x83c0('0x14'))(_0x83c0('0x15'));var utils=require(_0x83c0('0x16'));var config=require(_0x83c0('0x17'));var licenseUtil=require(_0x83c0('0x18'));var db=require(_0x83c0('0x19'))['db'];function respondWithStatusCode(_0x483615,_0x1a41b1){_0x1a41b1=_0x1a41b1||0xcc;return function(_0x4d806f){if(_0x4d806f){return _0x483615[_0x83c0('0x1a')](_0x1a41b1);}return _0x483615['status'](_0x1a41b1)[_0x83c0('0x1b')]();};}function respondWithResult(_0x1292af,_0x34f1bd){_0x34f1bd=_0x34f1bd||0xc8;return function(_0x28aa1b){if(_0x28aa1b){return _0x1292af[_0x83c0('0x1c')](_0x34f1bd)['json'](_0x28aa1b);}};}function respondWithFilteredResult(_0x2c527d,_0x10239c){return function(_0x31b9f4){if(_0x31b9f4){var _0x4187aa=typeof _0x10239c[_0x83c0('0x1d')]===_0x83c0('0x1e')&&typeof _0x10239c[_0x83c0('0x1f')]===_0x83c0('0x1e');var _0x58ccbc=_0x31b9f4[_0x83c0('0x20')];var _0x4f8773=_0x4187aa?0x0:_0x10239c[_0x83c0('0x1d')];var _0x43cd84=_0x4187aa?_0x31b9f4[_0x83c0('0x20')]:_0x10239c['offset']+_0x10239c['limit'];var _0x2821a9;if(_0x43cd84>=_0x58ccbc){_0x43cd84=_0x58ccbc;_0x2821a9=0xc8;}else{_0x2821a9=0xce;}_0x2c527d['status'](_0x2821a9);return _0x2c527d[_0x83c0('0x21')](_0x83c0('0x22'),_0x4f8773+'-'+_0x43cd84+'/'+_0x58ccbc)[_0x83c0('0x23')](_0x31b9f4);}return null;};}function patchUpdates(_0x46ade9){return function(_0x153fd7){try{jsonpatch[_0x83c0('0x24')](_0x153fd7,_0x46ade9,!![]);}catch(_0x30f226){return BPromise[_0x83c0('0x25')](_0x30f226);}return _0x153fd7[_0x83c0('0x26')]();};}function saveUpdates(_0x520778,_0x2db38){return function(_0x27f293){if(_0x27f293){return _0x27f293[_0x83c0('0x27')](_0x520778)['then'](function(_0x5642f5){return _0x5642f5;});}return null;};}function removeEntity(_0x7b3567,_0x1b2648){return function(_0x41a962){if(_0x41a962){return _0x41a962[_0x83c0('0x28')]()[_0x83c0('0x29')](function(){_0x7b3567[_0x83c0('0x1c')](0xcc)[_0x83c0('0x1b')]();});}};}function handleEntityNotFound(_0x8bf4c5,_0x7d47de){return function(_0x34c655){if(!_0x34c655){_0x8bf4c5[_0x83c0('0x1a')](0x194);}return _0x34c655;};}function handleError(_0x4e7d31,_0x423672){_0x423672=_0x423672||0x1f4;return function(_0x520b35){logger[_0x83c0('0x2a')](_0x520b35[_0x83c0('0x2b')]);if(_0x520b35[_0x83c0('0x2c')]){delete _0x520b35[_0x83c0('0x2c')];}_0x4e7d31[_0x83c0('0x1c')](_0x423672)[_0x83c0('0x2d')](_0x520b35);};}exports[_0x83c0('0x2e')]=function(_0x4f5d13,_0x455327){var _0x549847={},_0x3f2167={},_0x4fc064={'count':0x0,'rows':[]};var _0x2d8846=_[_0x83c0('0x2f')](db[_0x83c0('0x30')][_0x83c0('0x31')],function(_0x50fa85){return{'name':_0x50fa85[_0x83c0('0x32')],'type':_0x50fa85[_0x83c0('0x33')][_0x83c0('0x34')]};});_0x3f2167[_0x83c0('0x35')]=_[_0x83c0('0x2f')](_0x2d8846,'name');_0x3f2167[_0x83c0('0x36')]=_[_0x83c0('0x37')](_0x4f5d13[_0x83c0('0x36')]);_0x3f2167[_0x83c0('0x38')]=_[_0x83c0('0x39')](_0x3f2167[_0x83c0('0x35')],_0x3f2167['query']);_0x549847[_0x83c0('0x3a')]=_[_0x83c0('0x39')](_0x3f2167[_0x83c0('0x35')],qs[_0x83c0('0x3b')](_0x4f5d13[_0x83c0('0x36')]['fields']));_0x549847[_0x83c0('0x3a')]=_0x549847[_0x83c0('0x3a')][_0x83c0('0x3c')]?_0x549847[_0x83c0('0x3a')]:_0x3f2167[_0x83c0('0x35')];if(!_0x4f5d13[_0x83c0('0x36')][_0x83c0('0x3d')](_0x83c0('0x3e'))){_0x549847[_0x83c0('0x1f')]=qs['limit'](_0x4f5d13['query']['limit']);_0x549847[_0x83c0('0x1d')]=qs[_0x83c0('0x1d')](_0x4f5d13[_0x83c0('0x36')][_0x83c0('0x1d')]);}_0x549847[_0x83c0('0x3f')]=qs[_0x83c0('0x40')](_0x4f5d13[_0x83c0('0x36')][_0x83c0('0x40')]);_0x549847['where']=qs[_0x83c0('0x38')](_['pick'](_0x4f5d13['query'],_0x3f2167[_0x83c0('0x38')]),_0x2d8846);if(_0x4f5d13['query']['filter']){_0x549847['where']=_[_0x83c0('0x41')](_0x549847[_0x83c0('0x42')],{'$or':_[_0x83c0('0x2f')](_0x2d8846,function(_0x458997){if(_0x458997[_0x83c0('0x33')]!==_0x83c0('0x43')){var _0x212281={};_0x212281[_0x458997[_0x83c0('0x2c')]]={'$like':'%'+_0x4f5d13['query'][_0x83c0('0x44')]+'%'};return _0x212281;}})});}_0x549847=_[_0x83c0('0x41')]({},_0x549847,_0x4f5d13['options']);var _0x287893={'where':_0x549847['where']};return db[_0x83c0('0x30')]['count'](_0x287893)['then'](function(_0x3a09f3){_0x4fc064[_0x83c0('0x20')]=_0x3a09f3;if(_0x4f5d13[_0x83c0('0x36')][_0x83c0('0x45')]){_0x549847[_0x83c0('0x46')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x83c0('0x47')](_0x549847);})[_0x83c0('0x29')](function(_0x1f2e05){_0x4fc064['rows']=_0x1f2e05;return _0x4fc064;})['then'](respondWithFilteredResult(_0x455327,_0x549847))['catch'](handleError(_0x455327,null));};exports[_0x83c0('0x48')]=function(_0x45148a,_0x14e997){var _0x5593c2={'raw':!![],'where':{'id':_0x45148a[_0x83c0('0x49')]['id']}},_0xa27b9e={};_0xa27b9e[_0x83c0('0x35')]=_[_0x83c0('0x37')](db['AnalyticTreeReport'][_0x83c0('0x31')]);_0xa27b9e[_0x83c0('0x36')]=_[_0x83c0('0x37')](_0x45148a['query']);_0xa27b9e[_0x83c0('0x38')]=_[_0x83c0('0x39')](_0xa27b9e['model'],_0xa27b9e[_0x83c0('0x36')]);_0x5593c2['attributes']=_[_0x83c0('0x39')](_0xa27b9e['model'],qs[_0x83c0('0x3b')](_0x45148a[_0x83c0('0x36')][_0x83c0('0x3b')]));_0x5593c2[_0x83c0('0x3a')]=_0x5593c2[_0x83c0('0x3a')][_0x83c0('0x3c')]?_0x5593c2[_0x83c0('0x3a')]:_0xa27b9e[_0x83c0('0x35')];if(_0x45148a[_0x83c0('0x36')][_0x83c0('0x45')]){_0x5593c2[_0x83c0('0x46')]=[{'all':!![]}];}_0x5593c2=_[_0x83c0('0x41')]({},_0x5593c2,_0x45148a[_0x83c0('0x4a')]);return db[_0x83c0('0x30')][_0x83c0('0x4b')](_0x5593c2)['then'](handleEntityNotFound(_0x14e997,null))[_0x83c0('0x29')](respondWithResult(_0x14e997,null))[_0x83c0('0x4c')](handleError(_0x14e997,null));};exports['create']=function(_0x23e5ed,_0xac391d){return db[_0x83c0('0x30')][_0x83c0('0x4d')](_0x23e5ed[_0x83c0('0x4e')],{})[_0x83c0('0x29')](respondWithResult(_0xac391d,0xc9))['catch'](handleError(_0xac391d,null));};exports[_0x83c0('0x27')]=function(_0x2758d1,_0x27c867){if(_0x2758d1['body']['id']){delete _0x2758d1[_0x83c0('0x4e')]['id'];}return db[_0x83c0('0x30')]['find']({'where':{'id':_0x2758d1[_0x83c0('0x49')]['id']}})[_0x83c0('0x29')](handleEntityNotFound(_0x27c867,null))[_0x83c0('0x29')](saveUpdates(_0x2758d1['body'],null))[_0x83c0('0x29')](respondWithResult(_0x27c867,null))[_0x83c0('0x4c')](handleError(_0x27c867,null));};exports['destroy']=function(_0x1e41f2,_0x48ad4e){return db[_0x83c0('0x30')][_0x83c0('0x4b')]({'where':{'id':_0x1e41f2[_0x83c0('0x49')]['id']}})['then'](handleEntityNotFound(_0x48ad4e,null))['then'](removeEntity(_0x48ad4e,null))[_0x83c0('0x4c')](handleError(_0x48ad4e,null));};
\ No newline at end of file
+var _0xe70b=['params','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','AnalyticTreeReport','catch','show','rawAttributes','length','includeAll','include','find','create','body'];(function(_0x7293b,_0x5a478e){var _0x54e309=function(_0x211dda){while(--_0x211dda){_0x7293b['push'](_0x7293b['shift']());}};_0x54e309(++_0x5a478e);}(_0xe70b,0xd6));var _0xbe70=function(_0x56c8a8,_0x834642){_0x56c8a8=_0x56c8a8-0x0;var _0x3a4430=_0xe70b[_0x56c8a8];return _0x3a4430;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbe70('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbe70('0x1'));var rp=require('request-promise');var moment=require(_0xbe70('0x2'));var BPromise=require(_0xbe70('0x3'));var Mustache=require(_0xbe70('0x4'));var util=require(_0xbe70('0x5'));var path=require(_0xbe70('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbe70('0x7'));var fs=require('fs');var fs_extra=require(_0xbe70('0x8'));var _=require(_0xbe70('0x9'));var squel=require(_0xbe70('0xa'));var crypto=require(_0xbe70('0xb'));var jsforce=require(_0xbe70('0xc'));var deskjs=require(_0xbe70('0xd'));var toCsv=require(_0xbe70('0xe'));var querystring=require('querystring');var Papa=require(_0xbe70('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbe70('0x10'));var as=require(_0xbe70('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbe70('0x12'))(_0xbe70('0x13'));var utils=require(_0xbe70('0x14'));var config=require(_0xbe70('0x15'));var licenseUtil=require(_0xbe70('0x16'));var db=require(_0xbe70('0x17'))['db'];function respondWithStatusCode(_0x3ed655,_0x2ab0c2){_0x2ab0c2=_0x2ab0c2||0xcc;return function(_0x1eb5de){if(_0x1eb5de){return _0x3ed655[_0xbe70('0x18')](_0x2ab0c2);}return _0x3ed655[_0xbe70('0x19')](_0x2ab0c2)['end']();};}function respondWithResult(_0x5628c4,_0x47adfa){_0x47adfa=_0x47adfa||0xc8;return function(_0xe04dc0){if(_0xe04dc0){return _0x5628c4[_0xbe70('0x19')](_0x47adfa)[_0xbe70('0x1a')](_0xe04dc0);}};}function respondWithFilteredResult(_0x1b9f34,_0x5782d4){return function(_0x3c0871){if(_0x3c0871){var _0x5c82a7=typeof _0x5782d4['offset']===_0xbe70('0x1b')&&typeof _0x5782d4['limit']==='undefined';var _0x150689=_0x3c0871[_0xbe70('0x1c')];var _0x2bdc18=_0x5c82a7?0x0:_0x5782d4['offset'];var _0x15b6a5=_0x5c82a7?_0x3c0871['count']:_0x5782d4[_0xbe70('0x1d')]+_0x5782d4[_0xbe70('0x1e')];var _0x47b131;if(_0x15b6a5>=_0x150689){_0x15b6a5=_0x150689;_0x47b131=0xc8;}else{_0x47b131=0xce;}_0x1b9f34[_0xbe70('0x19')](_0x47b131);return _0x1b9f34[_0xbe70('0x1f')](_0xbe70('0x20'),_0x2bdc18+'-'+_0x15b6a5+'/'+_0x150689)[_0xbe70('0x1a')](_0x3c0871);}return null;};}function patchUpdates(_0x276682){return function(_0x1f11e9){try{jsonpatch[_0xbe70('0x21')](_0x1f11e9,_0x276682,!![]);}catch(_0x43b4fb){return BPromise[_0xbe70('0x22')](_0x43b4fb);}return _0x1f11e9[_0xbe70('0x23')]();};}function saveUpdates(_0x1646e2,_0x194925){return function(_0xdbb4b6){if(_0xdbb4b6){return _0xdbb4b6[_0xbe70('0x24')](_0x1646e2)[_0xbe70('0x25')](function(_0x76afeb){return _0x76afeb;});}return null;};}function removeEntity(_0x1a69ec,_0x33714c){return function(_0x36a176){if(_0x36a176){return _0x36a176[_0xbe70('0x26')]()['then'](function(){_0x1a69ec[_0xbe70('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xafaf24,_0x4cc937){return function(_0x6f56f4){if(!_0x6f56f4){_0xafaf24[_0xbe70('0x18')](0x194);}return _0x6f56f4;};}function handleError(_0x565f11,_0x164859){_0x164859=_0x164859||0x1f4;return function(_0x57b7a8){logger['error'](_0x57b7a8['stack']);if(_0x57b7a8[_0xbe70('0x27')]){delete _0x57b7a8[_0xbe70('0x27')];}_0x565f11[_0xbe70('0x19')](_0x164859)[_0xbe70('0x28')](_0x57b7a8);};}exports[_0xbe70('0x29')]=function(_0x136b1b,_0x312b02){var _0x59f602={},_0x3d7fa3={},_0x1b0937={'count':0x0,'rows':[]};var _0x22acd6=_[_0xbe70('0x2a')](db['AnalyticTreeReport']['rawAttributes'],function(_0x1d2b23){return{'name':_0x1d2b23[_0xbe70('0x2b')],'type':_0x1d2b23[_0xbe70('0x2c')]['key']};});_0x3d7fa3[_0xbe70('0x2d')]=_[_0xbe70('0x2a')](_0x22acd6,'name');_0x3d7fa3[_0xbe70('0x2e')]=_[_0xbe70('0x2f')](_0x136b1b['query']);_0x3d7fa3[_0xbe70('0x30')]=_[_0xbe70('0x31')](_0x3d7fa3[_0xbe70('0x2d')],_0x3d7fa3[_0xbe70('0x2e')]);_0x59f602[_0xbe70('0x32')]=_[_0xbe70('0x31')](_0x3d7fa3[_0xbe70('0x2d')],qs[_0xbe70('0x33')](_0x136b1b[_0xbe70('0x2e')][_0xbe70('0x33')]));_0x59f602[_0xbe70('0x32')]=_0x59f602[_0xbe70('0x32')]['length']?_0x59f602[_0xbe70('0x32')]:_0x3d7fa3[_0xbe70('0x2d')];if(!_0x136b1b[_0xbe70('0x2e')][_0xbe70('0x34')]('nolimit')){_0x59f602[_0xbe70('0x1e')]=qs[_0xbe70('0x1e')](_0x136b1b[_0xbe70('0x2e')][_0xbe70('0x1e')]);_0x59f602[_0xbe70('0x1d')]=qs['offset'](_0x136b1b['query'][_0xbe70('0x1d')]);}_0x59f602[_0xbe70('0x35')]=qs[_0xbe70('0x36')](_0x136b1b['query']['sort']);_0x59f602[_0xbe70('0x37')]=qs['filters'](_[_0xbe70('0x38')](_0x136b1b['query'],_0x3d7fa3['filters']),_0x22acd6);if(_0x136b1b[_0xbe70('0x2e')][_0xbe70('0x39')]){_0x59f602['where']=_[_0xbe70('0x3a')](_0x59f602[_0xbe70('0x37')],{'$or':_['map'](_0x22acd6,function(_0x368148){if(_0x368148[_0xbe70('0x2c')]!=='VIRTUAL'){var _0x250c39={};_0x250c39[_0x368148[_0xbe70('0x27')]]={'$like':'%'+_0x136b1b[_0xbe70('0x2e')][_0xbe70('0x39')]+'%'};return _0x250c39;}})});}_0x59f602=_[_0xbe70('0x3a')]({},_0x59f602,_0x136b1b[_0xbe70('0x3b')]);var _0x3a704c={'where':_0x59f602['where']};return db['AnalyticTreeReport']['count'](_0x3a704c)[_0xbe70('0x25')](function(_0xac99e0){_0x1b0937[_0xbe70('0x1c')]=_0xac99e0;if(_0x136b1b[_0xbe70('0x2e')]['includeAll']){_0x59f602['include']=[{'all':!![]}];}return db[_0xbe70('0x3c')]['findAll'](_0x59f602);})[_0xbe70('0x25')](function(_0x25f5f8){_0x1b0937['rows']=_0x25f5f8;return _0x1b0937;})['then'](respondWithFilteredResult(_0x312b02,_0x59f602))[_0xbe70('0x3d')](handleError(_0x312b02,null));};exports[_0xbe70('0x3e')]=function(_0x453010,_0x4e272e){var _0xe62f79={'raw':!![],'where':{'id':_0x453010['params']['id']}},_0x510764={};_0x510764['model']=_[_0xbe70('0x2f')](db[_0xbe70('0x3c')][_0xbe70('0x3f')]);_0x510764[_0xbe70('0x2e')]=_[_0xbe70('0x2f')](_0x453010[_0xbe70('0x2e')]);_0x510764[_0xbe70('0x30')]=_[_0xbe70('0x31')](_0x510764[_0xbe70('0x2d')],_0x510764[_0xbe70('0x2e')]);_0xe62f79[_0xbe70('0x32')]=_['intersection'](_0x510764[_0xbe70('0x2d')],qs[_0xbe70('0x33')](_0x453010['query'][_0xbe70('0x33')]));_0xe62f79['attributes']=_0xe62f79[_0xbe70('0x32')][_0xbe70('0x40')]?_0xe62f79[_0xbe70('0x32')]:_0x510764['model'];if(_0x453010['query'][_0xbe70('0x41')]){_0xe62f79[_0xbe70('0x42')]=[{'all':!![]}];}_0xe62f79=_['merge']({},_0xe62f79,_0x453010[_0xbe70('0x3b')]);return db['AnalyticTreeReport'][_0xbe70('0x43')](_0xe62f79)[_0xbe70('0x25')](handleEntityNotFound(_0x4e272e,null))[_0xbe70('0x25')](respondWithResult(_0x4e272e,null))[_0xbe70('0x3d')](handleError(_0x4e272e,null));};exports[_0xbe70('0x44')]=function(_0x47b43d,_0x1ebcc8){return db['AnalyticTreeReport'][_0xbe70('0x44')](_0x47b43d['body'],{})['then'](respondWithResult(_0x1ebcc8,0xc9))[_0xbe70('0x3d')](handleError(_0x1ebcc8,null));};exports['update']=function(_0x286819,_0x441c78){if(_0x286819[_0xbe70('0x45')]['id']){delete _0x286819[_0xbe70('0x45')]['id'];}return db[_0xbe70('0x3c')][_0xbe70('0x43')]({'where':{'id':_0x286819[_0xbe70('0x46')]['id']}})[_0xbe70('0x25')](handleEntityNotFound(_0x441c78,null))[_0xbe70('0x25')](saveUpdates(_0x286819[_0xbe70('0x45')],null))[_0xbe70('0x25')](respondWithResult(_0x441c78,null))[_0xbe70('0x3d')](handleError(_0x441c78,null));};exports[_0xbe70('0x26')]=function(_0x3390e5,_0x547b89){return db['AnalyticTreeReport'][_0xbe70('0x43')]({'where':{'id':_0x3390e5[_0xbe70('0x46')]['id']}})[_0xbe70('0x25')](handleEntityNotFound(_0x547b89,null))['then'](removeEntity(_0x547b89,null))[_0xbe70('0x3d')](handleError(_0x547b89,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 5f92d3d..5aebac7 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 _0xff57=['lodash','util','../../config/logger','api','moment','request-promise','rimraf','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport'];(function(_0x4c1869,_0x1a6600){var _0x9280f6=function(_0x40e2f9){while(--_0x40e2f9){_0x4c1869['push'](_0x4c1869['shift']());}};_0x9280f6(++_0x1a6600);}(_0xff57,0x1e4));var _0x7ff5=function(_0x587b1f,_0x576a41){_0x587b1f=_0x587b1f-0x0;var _0x2caf3b=_0xff57[_0x587b1f];return _0x2caf3b;};'use strict';var _=require(_0x7ff5('0x0'));var util=require(_0x7ff5('0x1'));var logger=require(_0x7ff5('0x2'))(_0x7ff5('0x3'));var moment=require(_0x7ff5('0x4'));var BPromise=require('bluebird');var rp=require(_0x7ff5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7ff5('0x6'));var config=require('../../config/environment');var attributes=require(_0x7ff5('0x7'));module[_0x7ff5('0x8')]=function(_0x5dca29,_0x383996){return _0x5dca29[_0x7ff5('0x9')](_0x7ff5('0xa'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd15f=['../../config/environment','./analyticTreeReport.attributes','exports','define','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0xd15f,0xf6));var _0xfd15=function(_0x1e8b1e,_0x407bbd){_0x1e8b1e=_0x1e8b1e-0x0;var _0x4a0fde=_0xd15f[_0x1e8b1e];return _0x4a0fde;};'use strict';var _=require(_0xfd15('0x0'));var util=require(_0xfd15('0x1'));var logger=require(_0xfd15('0x2'))(_0xfd15('0x3'));var moment=require(_0xfd15('0x4'));var BPromise=require('bluebird');var rp=require(_0xfd15('0x5'));var fs=require('fs');var path=require(_0xfd15('0x6'));var rimraf=require('rimraf');var config=require(_0xfd15('0x7'));var attributes=require(_0xfd15('0x8'));module[_0xfd15('0x9')]=function(_0x2c6dc9,_0x2e7f87){return _0x2c6dc9[_0xfd15('0xa')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 2786163..2c14b1b 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 _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\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(_0x2d6b63,_0x26b926){var _0x3681bb=function(_0x25d60d){while(--_0x25d60d){_0x2d6b63['push'](_0x2d6b63['shift']());}};_0x3681bb(++_0x26b926);}(_0x1261,0x144));var _0x1126=function(_0x53ddab,_0x4ada9d){_0x53ddab=_0x53ddab-0x0;var _0x5819ac=_0x1261[_0x53ddab];return _0x5819ac;};'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')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x2de1da,_0x49b428){var _0x10ca5f=function(_0x4276cb){while(--_0x4276cb){_0x2de1da['push'](_0x2de1da['shift']());}};_0x10ca5f(++_0x49b428);}(_0x5f2f,0x73));var _0xf5f2=function(_0x707aaa,_0x25752e){_0x707aaa=_0x707aaa-0x0;var _0x1931d3=_0x5f2f[_0x707aaa];return _0x1931d3;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index d949f5b..bcdb64b 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 _0x09af=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy'];(function(_0x3b627f,_0x4305a2){var _0x2514da=function(_0x17d8de){while(--_0x17d8de){_0x3b627f['push'](_0x3b627f['shift']());}};_0x2514da(++_0x4305a2);}(_0x09af,0xd2));var _0xf09a=function(_0x16c745,_0x43cb6b){_0x16c745=_0x16c745-0x0;var _0x30ecbd=_0x09af[_0x16c745];return _0x30ecbd;};'use strict';var multer=require(_0xf09a('0x0'));var util=require(_0xf09a('0x1'));var path=require(_0xf09a('0x2'));var timeout=require(_0xf09a('0x3'));var express=require('express');var router=express[_0xf09a('0x4')]();var fs_extra=require(_0xf09a('0x5'));var auth=require(_0xf09a('0x6'));var interaction=require(_0xf09a('0x7'));var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router[_0xf09a('0x8')]('/',auth[_0xf09a('0x9')](),controller[_0xf09a('0xa')]);router[_0xf09a('0x8')](_0xf09a('0xb'),auth[_0xf09a('0x9')](),controller[_0xf09a('0xc')]);router[_0xf09a('0xd')]('/',auth['isAuthenticated'](),controller[_0xf09a('0xe')]);router[_0xf09a('0xf')](_0xf09a('0xb'),auth[_0xf09a('0x9')](),controller['update']);router[_0xf09a('0x10')]('/:id',auth[_0xf09a('0x9')](),controller[_0xf09a('0x11')]);module[_0xf09a('0x12')]=router;
\ No newline at end of file
+var _0xd848=['get','isAuthenticated','index','show','post','create','put','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller'];(function(_0x430a79,_0x17b2af){var _0xda6181=function(_0x488aca){while(--_0x488aca){_0x430a79['push'](_0x430a79['shift']());}};_0xda6181(++_0x17b2af);}(_0xd848,0x1ad));var _0x8d84=function(_0x4dcc2d,_0x422839){_0x4dcc2d=_0x4dcc2d-0x0;var _0x1bbd79=_0xd848[_0x4dcc2d];return _0x1bbd79;};'use strict';var multer=require(_0x8d84('0x0'));var util=require(_0x8d84('0x1'));var path=require(_0x8d84('0x2'));var timeout=require(_0x8d84('0x3'));var express=require(_0x8d84('0x4'));var router=express[_0x8d84('0x5')]();var fs_extra=require(_0x8d84('0x6'));var auth=require(_0x8d84('0x7'));var interaction=require(_0x8d84('0x8'));var config=require(_0x8d84('0x9'));var controller=require(_0x8d84('0xa'));router[_0x8d84('0xb')]('/',auth[_0x8d84('0xc')](),controller[_0x8d84('0xd')]);router[_0x8d84('0xb')]('/:id',auth[_0x8d84('0xc')](),controller[_0x8d84('0xe')]);router[_0x8d84('0xf')]('/',auth['isAuthenticated'](),controller[_0x8d84('0x10')]);router[_0x8d84('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x8d84('0x12')](_0x8d84('0x13'),auth[_0x8d84('0xc')](),controller[_0x8d84('0x14')]);module[_0x8d84('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index c4ba723..1c5509e 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 _0xda65=['exports','STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda65,0x1d0));var _0x5da6=function(_0x4b79a9,_0x3aa1ed){_0x4b79a9=_0x4b79a9-0x0;var _0x50ff41=_0xda65[_0x4b79a9];return _0x50ff41;};'use strict';var Sequelize=require(_0x5da6('0x0'));module[_0x5da6('0x1')]={'name':{'type':Sequelize[_0x5da6('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5da6('0x2')]}};
\ No newline at end of file
+var _0x3cd1=['exports','STRING'];(function(_0x34baf0,_0x44d55c){var _0x30e3a0=function(_0x36445d){while(--_0x36445d){_0x34baf0['push'](_0x34baf0['shift']());}};_0x30e3a0(++_0x44d55c);}(_0x3cd1,0x112));var _0x13cd=function(_0x46cef6,_0x1d434c){_0x46cef6=_0x46cef6-0x0;var _0x239be7=_0x3cd1[_0x46cef6];return _0x239be7;};'use strict';var Sequelize=require('sequelize');module[_0x13cd('0x0')]={'name':{'type':Sequelize[_0x13cd('0x1')]},'basename':{'type':Sequelize[_0x13cd('0x1')]},'type':{'type':Sequelize[_0x13cd('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 8582d27..e5901db 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 _0xec50=['originalname','filename','mimetype','download','findOne','root','server/files/attachments/','join','offline-chat/','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','index','map','Attachment','fieldName','type','key','keys','query','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filters','filter','merge','options','include','findAll','rows','catch','show','params','rawAttributes','intersection','length','find','clone','includeAll','get','createdAt','updatedAt','body','create','file'];(function(_0x5dd52e,_0x98ee28){var _0x4d2f78=function(_0x239648){while(--_0x239648){_0x5dd52e['push'](_0x5dd52e['shift']());}};_0x4d2f78(++_0x98ee28);}(_0xec50,0xba));var _0x0ec5=function(_0x1bc013,_0x7771c6){_0x1bc013=_0x1bc013-0x0;var _0x55df36=_0xec50[_0x1bc013];return _0x55df36;};'use strict';var emlformat=require(_0x0ec5('0x0'));var rimraf=require(_0x0ec5('0x1'));var zipdir=require(_0x0ec5('0x2'));var jsonpatch=require(_0x0ec5('0x3'));var rp=require(_0x0ec5('0x4'));var moment=require(_0x0ec5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0ec5('0x6'));var util=require('util');var path=require(_0x0ec5('0x7'));var sox=require(_0x0ec5('0x8'));var csv=require(_0x0ec5('0x9'));var ejs=require(_0x0ec5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0ec5('0xb'));var squel=require('squel');var crypto=require(_0x0ec5('0xc'));var jsforce=require(_0x0ec5('0xd'));var deskjs=require(_0x0ec5('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0ec5('0xf'));var Papa=require(_0x0ec5('0x10'));var Redis=require(_0x0ec5('0x11'));var authService=require(_0x0ec5('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0ec5('0x13'));var logger=require(_0x0ec5('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0ec5('0x15'));var db=require(_0x0ec5('0x16'))['db'];function respondWithStatusCode(_0x2f8c2d,_0x96c1b3){_0x96c1b3=_0x96c1b3||0xcc;return function(_0x5315fd){if(_0x5315fd){return _0x2f8c2d[_0x0ec5('0x17')](_0x96c1b3);}return _0x2f8c2d[_0x0ec5('0x18')](_0x96c1b3)['end']();};}function respondWithResult(_0x1fc84a,_0xb7d5e4){_0xb7d5e4=_0xb7d5e4||0xc8;return function(_0x1fd75e){if(_0x1fd75e){return _0x1fc84a[_0x0ec5('0x18')](_0xb7d5e4)[_0x0ec5('0x19')](_0x1fd75e);}};}function respondWithFilteredResult(_0x1707b9,_0x296869){return function(_0x5ab9e4){if(_0x5ab9e4){var _0x700bb2=typeof _0x296869[_0x0ec5('0x1a')]===_0x0ec5('0x1b')&&typeof _0x296869[_0x0ec5('0x1c')]===_0x0ec5('0x1b');var _0x5bc5d5=_0x5ab9e4[_0x0ec5('0x1d')];var _0x2d8320=_0x700bb2?0x0:_0x296869[_0x0ec5('0x1a')];var _0x16776d=_0x700bb2?_0x5ab9e4[_0x0ec5('0x1d')]:_0x296869[_0x0ec5('0x1a')]+_0x296869[_0x0ec5('0x1c')];var _0x151ec2;if(_0x16776d>=_0x5bc5d5){_0x16776d=_0x5bc5d5;_0x151ec2=0xc8;}else{_0x151ec2=0xce;}_0x1707b9[_0x0ec5('0x18')](_0x151ec2);return _0x1707b9[_0x0ec5('0x1e')]('Content-Range',_0x2d8320+'-'+_0x16776d+'/'+_0x5bc5d5)[_0x0ec5('0x19')](_0x5ab9e4);}return null;};}function patchUpdates(_0x31ed42){return function(_0x523315){try{jsonpatch[_0x0ec5('0x1f')](_0x523315,_0x31ed42,!![]);}catch(_0x468ee4){return BPromise[_0x0ec5('0x20')](_0x468ee4);}return _0x523315[_0x0ec5('0x21')]();};}function saveUpdates(_0x40afb7,_0x7baa70){return function(_0x2df636){if(_0x2df636){return _0x2df636[_0x0ec5('0x22')](_0x40afb7)[_0x0ec5('0x23')](function(_0x572fab){return _0x572fab;});}return null;};}function removeEntity(_0xeda9be,_0x224241){return function(_0x4ce01e){if(_0x4ce01e){return _0x4ce01e[_0x0ec5('0x24')]()[_0x0ec5('0x23')](function(){_0xeda9be[_0x0ec5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41cbc7,_0x2b3a2b){return function(_0x31678b){if(!_0x31678b){_0x41cbc7[_0x0ec5('0x17')](0x194);}return _0x31678b;};}function handleError(_0x5ebd88,_0x1bd6aa){_0x1bd6aa=_0x1bd6aa||0x1f4;return function(_0x4da2dd){logger[_0x0ec5('0x25')](_0x4da2dd[_0x0ec5('0x26')]);if(_0x4da2dd[_0x0ec5('0x27')]){delete _0x4da2dd[_0x0ec5('0x27')];}_0x5ebd88['status'](_0x1bd6aa)['send'](_0x4da2dd);};}exports[_0x0ec5('0x28')]=function(_0x191234,_0x224030){var _0x95e989={},_0x4d49b7={},_0x1719fc={'count':0x0,'rows':[]};var _0x27a2e4=_[_0x0ec5('0x29')](db[_0x0ec5('0x2a')]['rawAttributes'],function(_0x19b30b){return{'name':_0x19b30b[_0x0ec5('0x2b')],'type':_0x19b30b[_0x0ec5('0x2c')][_0x0ec5('0x2d')]};});_0x4d49b7['model']=_[_0x0ec5('0x29')](_0x27a2e4,'name');_0x4d49b7['query']=_[_0x0ec5('0x2e')](_0x191234[_0x0ec5('0x2f')]);_0x4d49b7['filters']=_['intersection'](_0x4d49b7[_0x0ec5('0x30')],_0x4d49b7[_0x0ec5('0x2f')]);_0x95e989[_0x0ec5('0x31')]=_['intersection'](_0x4d49b7[_0x0ec5('0x30')],qs[_0x0ec5('0x32')](_0x191234['query']['fields']));_0x95e989[_0x0ec5('0x31')]=_0x95e989[_0x0ec5('0x31')]['length']?_0x95e989[_0x0ec5('0x31')]:_0x4d49b7['model'];if(!_0x191234['query'][_0x0ec5('0x33')]('nolimit')){_0x95e989[_0x0ec5('0x1c')]=qs[_0x0ec5('0x1c')](_0x191234[_0x0ec5('0x2f')][_0x0ec5('0x1c')]);_0x95e989[_0x0ec5('0x1a')]=qs[_0x0ec5('0x1a')](_0x191234[_0x0ec5('0x2f')]['offset']);}_0x95e989[_0x0ec5('0x34')]=qs['sort'](_0x191234[_0x0ec5('0x2f')][_0x0ec5('0x35')]);_0x95e989[_0x0ec5('0x36')]=qs['filters'](_[_0x0ec5('0x37')](_0x191234[_0x0ec5('0x2f')],_0x4d49b7[_0x0ec5('0x38')]),_0x27a2e4);if(_0x191234['query'][_0x0ec5('0x39')]){_0x95e989[_0x0ec5('0x36')]=_[_0x0ec5('0x3a')](_0x95e989['where'],{'$or':_[_0x0ec5('0x29')](_0x27a2e4,function(_0x5ce369){if(_0x5ce369[_0x0ec5('0x2c')]!=='VIRTUAL'){var _0x202880={};_0x202880[_0x5ce369[_0x0ec5('0x27')]]={'$like':'%'+_0x191234[_0x0ec5('0x2f')][_0x0ec5('0x39')]+'%'};return _0x202880;}})});}_0x95e989=_['merge']({},_0x95e989,_0x191234[_0x0ec5('0x3b')]);var _0x2a4e01={'where':_0x95e989[_0x0ec5('0x36')]};return db['Attachment']['count'](_0x2a4e01)['then'](function(_0x214782){_0x1719fc[_0x0ec5('0x1d')]=_0x214782;if(_0x191234[_0x0ec5('0x2f')]['includeAll']){_0x95e989[_0x0ec5('0x3c')]=[{'all':!![]}];}return db[_0x0ec5('0x2a')][_0x0ec5('0x3d')](_0x95e989);})[_0x0ec5('0x23')](function(_0x5e42be){_0x1719fc[_0x0ec5('0x3e')]=_0x5e42be;return _0x1719fc;})[_0x0ec5('0x23')](respondWithFilteredResult(_0x224030,_0x95e989))[_0x0ec5('0x3f')](handleError(_0x224030,null));};exports[_0x0ec5('0x40')]=function(_0x4609c7,_0x32ab18){var _0x180923={'raw':!![],'where':{'id':_0x4609c7[_0x0ec5('0x41')]['id']}},_0x1e396f={};_0x1e396f[_0x0ec5('0x30')]=_[_0x0ec5('0x2e')](db[_0x0ec5('0x2a')][_0x0ec5('0x42')]);_0x1e396f[_0x0ec5('0x2f')]=_[_0x0ec5('0x2e')](_0x4609c7[_0x0ec5('0x2f')]);_0x1e396f[_0x0ec5('0x38')]=_[_0x0ec5('0x43')](_0x1e396f[_0x0ec5('0x30')],_0x1e396f[_0x0ec5('0x2f')]);_0x180923[_0x0ec5('0x31')]=_['intersection'](_0x1e396f[_0x0ec5('0x30')],qs[_0x0ec5('0x32')](_0x4609c7['query'][_0x0ec5('0x32')]));_0x180923[_0x0ec5('0x31')]=_0x180923[_0x0ec5('0x31')][_0x0ec5('0x44')]?_0x180923['attributes']:_0x1e396f['model'];if(_0x4609c7['query']['includeAll']){_0x180923[_0x0ec5('0x3c')]=[{'all':!![]}];}_0x180923=_[_0x0ec5('0x3a')]({},_0x180923,_0x4609c7[_0x0ec5('0x3b')]);return db[_0x0ec5('0x2a')][_0x0ec5('0x45')](_0x180923)[_0x0ec5('0x23')](handleEntityNotFound(_0x32ab18,null))[_0x0ec5('0x23')](respondWithResult(_0x32ab18,null))[_0x0ec5('0x3f')](handleError(_0x32ab18,null));};exports[_0x0ec5('0x46')]=function(_0x5c01ff,_0x272415){var _0x55d795={'where':{'id':_0x5c01ff['params']['id']}},_0xc4832={};_0xc4832[_0x0ec5('0x30')]=_[_0x0ec5('0x2e')](db[_0x0ec5('0x2a')][_0x0ec5('0x42')]);_0x55d795[_0x0ec5('0x31')]=_['intersection'](_0xc4832['model'],qs[_0x0ec5('0x32')](_0x5c01ff[_0x0ec5('0x2f')][_0x0ec5('0x32')]));_0x55d795[_0x0ec5('0x31')]=_0x55d795[_0x0ec5('0x31')][_0x0ec5('0x44')]?_0x55d795[_0x0ec5('0x31')]:_0xc4832[_0x0ec5('0x30')];if(_0x5c01ff[_0x0ec5('0x2f')][_0x0ec5('0x47')]){_0x55d795['include']=[{'all':!![]}];}_0x55d795=_[_0x0ec5('0x3a')]({},_0x55d795,_0x5c01ff[_0x0ec5('0x3b')]);return db[_0x0ec5('0x2a')][_0x0ec5('0x45')](_0x55d795)[_0x0ec5('0x23')](handleEntityNotFound(_0x272415,null))[_0x0ec5('0x23')](function(_0x542524){if(_0x542524){var _0x26241b=_0x542524[_0x0ec5('0x48')]({'plain':!![]});_0x26241b=qs['omit'](_0x26241b,['id',_0x0ec5('0x49'),_0x0ec5('0x4a')]);_0x5c01ff[_0x0ec5('0x4b')]=_['omit'](_0x5c01ff[_0x0ec5('0x4b')],['id',_0x0ec5('0x49'),_0x0ec5('0x4a')]);return db[_0x0ec5('0x2a')]['create'](_[_0x0ec5('0x3a')](_0x26241b,_0x5c01ff['body']),{'include':_0x5c01ff[_0x0ec5('0x2f')][_0x0ec5('0x47')]?[{'all':!![]}]:undefined});}})[_0x0ec5('0x23')](respondWithResult(_0x272415,0xc9))[_0x0ec5('0x3f')](handleError(_0x272415,null));};exports['update']=function(_0x5b5358,_0x5d7e1d){if(_0x5b5358[_0x0ec5('0x4b')]['id']){delete _0x5b5358[_0x0ec5('0x4b')]['id'];}return db[_0x0ec5('0x2a')][_0x0ec5('0x45')]({'where':{'id':_0x5b5358[_0x0ec5('0x41')]['id']}})['then'](handleEntityNotFound(_0x5d7e1d,null))[_0x0ec5('0x23')](saveUpdates(_0x5b5358['body'],null))[_0x0ec5('0x23')](respondWithResult(_0x5d7e1d,null))[_0x0ec5('0x3f')](handleError(_0x5d7e1d,null));};exports[_0x0ec5('0x24')]=function(_0x26e831,_0x21baaf){return db[_0x0ec5('0x2a')]['find']({'where':{'id':_0x26e831[_0x0ec5('0x41')]['id']}})['then'](handleEntityNotFound(_0x21baaf,null))['then'](removeEntity(_0x21baaf,null))[_0x0ec5('0x3f')](handleError(_0x21baaf,null));};exports[_0x0ec5('0x4c')]=function(_0x531271,_0x406013,_0x366bd4){_0x531271[_0x0ec5('0x4b')]['name']=_0x531271[_0x0ec5('0x4d')][_0x0ec5('0x4e')];_0x531271[_0x0ec5('0x4b')]['basename']=_0x531271[_0x0ec5('0x4d')][_0x0ec5('0x4f')];_0x531271[_0x0ec5('0x4b')][_0x0ec5('0x2c')]=_0x531271[_0x0ec5('0x4d')][_0x0ec5('0x50')];return db[_0x0ec5('0x2a')][_0x0ec5('0x4c')](_0x531271[_0x0ec5('0x4b')])[_0x0ec5('0x23')](respondWithResult(_0x406013,0xc9))[_0x0ec5('0x3f')](handleError(_0x406013,null));};exports[_0x0ec5('0x51')]=function(_0x590e8f,_0x376ff9,_0x11c20d){return db[_0x0ec5('0x2a')][_0x0ec5('0x52')]({'where':{'id':_0x590e8f[_0x0ec5('0x41')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x376ff9,null))[_0x0ec5('0x23')](function(_0x31c8ef){if(_0x31c8ef){var _0x3ea8ea=_0x31c8ef['ChatOfflineMessageId']!==null;var _0x405930=path['join'](config[_0x0ec5('0x53')],_0x0ec5('0x54'));if(_0x3ea8ea){_0x405930=path[_0x0ec5('0x55')](_0x405930,_0x0ec5('0x56'));}var _0x1b717f=path['join'](_0x405930,_0x31c8ef[_0x0ec5('0x57')]);return _0x376ff9['download'](_0x1b717f);}})['catch'](handleError(_0x376ff9,null));};
\ No newline at end of file
+var _0xe7de=['find','catch','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','mimetype','ChatOfflineMessageId','join','root','download','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','keys','query','filters','attributes','intersection','fields','model','nolimit','order','sort','where','filter','VIRTUAL','merge','Attachment','includeAll','findAll','rows','show','params','include','options'];(function(_0x3340fa,_0x54eae8){var _0x309e22=function(_0x1095ff){while(--_0x1095ff){_0x3340fa['push'](_0x3340fa['shift']());}};_0x309e22(++_0x54eae8);}(_0xe7de,0x109));var _0xee7d=function(_0x53fd72,_0x29776b){_0x53fd72=_0x53fd72-0x0;var _0x52a03a=_0xe7de[_0x53fd72];return _0x52a03a;};'use strict';var emlformat=require(_0xee7d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xee7d('0x1'));var jsonpatch=require(_0xee7d('0x2'));var rp=require(_0xee7d('0x3'));var moment=require('moment');var BPromise=require(_0xee7d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xee7d('0x5'));var sox=require(_0xee7d('0x6'));var csv=require(_0xee7d('0x7'));var ejs=require(_0xee7d('0x8'));var fs=require('fs');var fs_extra=require(_0xee7d('0x9'));var _=require(_0xee7d('0xa'));var squel=require(_0xee7d('0xb'));var crypto=require(_0xee7d('0xc'));var jsforce=require(_0xee7d('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xee7d('0xe'));var Redis=require(_0xee7d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xee7d('0x10'));var as=require(_0xee7d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee7d('0x12'))(_0xee7d('0x13'));var utils=require('../../config/utils');var config=require(_0xee7d('0x14'));var licenseUtil=require(_0xee7d('0x15'));var db=require(_0xee7d('0x16'))['db'];function respondWithStatusCode(_0x59ecbd,_0x4cc96b){_0x4cc96b=_0x4cc96b||0xcc;return function(_0x44552d){if(_0x44552d){return _0x59ecbd[_0xee7d('0x17')](_0x4cc96b);}return _0x59ecbd[_0xee7d('0x18')](_0x4cc96b)[_0xee7d('0x19')]();};}function respondWithResult(_0x4d0a37,_0x40593b){_0x40593b=_0x40593b||0xc8;return function(_0x7428fd){if(_0x7428fd){return _0x4d0a37[_0xee7d('0x18')](_0x40593b)['json'](_0x7428fd);}};}function respondWithFilteredResult(_0x5ee6ea,_0x245027){return function(_0x1f30ae){if(_0x1f30ae){var _0x266469=typeof _0x245027[_0xee7d('0x1a')]===_0xee7d('0x1b')&&typeof _0x245027[_0xee7d('0x1c')]===_0xee7d('0x1b');var _0x3bc737=_0x1f30ae[_0xee7d('0x1d')];var _0x54853d=_0x266469?0x0:_0x245027[_0xee7d('0x1a')];var _0x1231d2=_0x266469?_0x1f30ae[_0xee7d('0x1d')]:_0x245027[_0xee7d('0x1a')]+_0x245027[_0xee7d('0x1c')];var _0x3fe539;if(_0x1231d2>=_0x3bc737){_0x1231d2=_0x3bc737;_0x3fe539=0xc8;}else{_0x3fe539=0xce;}_0x5ee6ea[_0xee7d('0x18')](_0x3fe539);return _0x5ee6ea['set']('Content-Range',_0x54853d+'-'+_0x1231d2+'/'+_0x3bc737)['json'](_0x1f30ae);}return null;};}function patchUpdates(_0xc163f4){return function(_0x512e45){try{jsonpatch[_0xee7d('0x1e')](_0x512e45,_0xc163f4,!![]);}catch(_0x140188){return BPromise[_0xee7d('0x1f')](_0x140188);}return _0x512e45[_0xee7d('0x20')]();};}function saveUpdates(_0x452c88,_0x15a746){return function(_0x215bfe){if(_0x215bfe){return _0x215bfe[_0xee7d('0x21')](_0x452c88)[_0xee7d('0x22')](function(_0x19fd60){return _0x19fd60;});}return null;};}function removeEntity(_0x3d578c,_0xcfeb7e){return function(_0x1e8179){if(_0x1e8179){return _0x1e8179[_0xee7d('0x23')]()[_0xee7d('0x22')](function(){_0x3d578c['status'](0xcc)[_0xee7d('0x19')]();});}};}function handleEntityNotFound(_0x4dc643,_0x48c279){return function(_0x2c14e8){if(!_0x2c14e8){_0x4dc643['sendStatus'](0x194);}return _0x2c14e8;};}function handleError(_0x2bd9f5,_0x541fbc){_0x541fbc=_0x541fbc||0x1f4;return function(_0x1b24d2){logger[_0xee7d('0x24')](_0x1b24d2[_0xee7d('0x25')]);if(_0x1b24d2[_0xee7d('0x26')]){delete _0x1b24d2[_0xee7d('0x26')];}_0x2bd9f5[_0xee7d('0x18')](_0x541fbc)['send'](_0x1b24d2);};}exports[_0xee7d('0x27')]=function(_0x239368,_0x2b7e0d){var _0x5ad5f4={},_0x521e9f={},_0x37466e={'count':0x0,'rows':[]};var _0x182174=_[_0xee7d('0x28')](db['Attachment'][_0xee7d('0x29')],function(_0x48e0e9){return{'name':_0x48e0e9[_0xee7d('0x2a')],'type':_0x48e0e9[_0xee7d('0x2b')][_0xee7d('0x2c')]};});_0x521e9f['model']=_[_0xee7d('0x28')](_0x182174,'name');_0x521e9f['query']=_[_0xee7d('0x2d')](_0x239368[_0xee7d('0x2e')]);_0x521e9f[_0xee7d('0x2f')]=_['intersection'](_0x521e9f['model'],_0x521e9f['query']);_0x5ad5f4[_0xee7d('0x30')]=_[_0xee7d('0x31')](_0x521e9f['model'],qs[_0xee7d('0x32')](_0x239368['query'][_0xee7d('0x32')]));_0x5ad5f4[_0xee7d('0x30')]=_0x5ad5f4[_0xee7d('0x30')]['length']?_0x5ad5f4['attributes']:_0x521e9f[_0xee7d('0x33')];if(!_0x239368[_0xee7d('0x2e')]['hasOwnProperty'](_0xee7d('0x34'))){_0x5ad5f4[_0xee7d('0x1c')]=qs[_0xee7d('0x1c')](_0x239368[_0xee7d('0x2e')]['limit']);_0x5ad5f4[_0xee7d('0x1a')]=qs[_0xee7d('0x1a')](_0x239368['query'][_0xee7d('0x1a')]);}_0x5ad5f4[_0xee7d('0x35')]=qs[_0xee7d('0x36')](_0x239368[_0xee7d('0x2e')]['sort']);_0x5ad5f4[_0xee7d('0x37')]=qs['filters'](_['pick'](_0x239368[_0xee7d('0x2e')],_0x521e9f[_0xee7d('0x2f')]),_0x182174);if(_0x239368[_0xee7d('0x2e')][_0xee7d('0x38')]){_0x5ad5f4[_0xee7d('0x37')]=_['merge'](_0x5ad5f4[_0xee7d('0x37')],{'$or':_[_0xee7d('0x28')](_0x182174,function(_0x4ef8ac){if(_0x4ef8ac[_0xee7d('0x2b')]!==_0xee7d('0x39')){var _0x33a04f={};_0x33a04f[_0x4ef8ac[_0xee7d('0x26')]]={'$like':'%'+_0x239368[_0xee7d('0x2e')][_0xee7d('0x38')]+'%'};return _0x33a04f;}})});}_0x5ad5f4=_[_0xee7d('0x3a')]({},_0x5ad5f4,_0x239368['options']);var _0x895c3f={'where':_0x5ad5f4[_0xee7d('0x37')]};return db[_0xee7d('0x3b')][_0xee7d('0x1d')](_0x895c3f)[_0xee7d('0x22')](function(_0x10e97a){_0x37466e[_0xee7d('0x1d')]=_0x10e97a;if(_0x239368[_0xee7d('0x2e')][_0xee7d('0x3c')]){_0x5ad5f4['include']=[{'all':!![]}];}return db[_0xee7d('0x3b')][_0xee7d('0x3d')](_0x5ad5f4);})[_0xee7d('0x22')](function(_0x2ead51){_0x37466e[_0xee7d('0x3e')]=_0x2ead51;return _0x37466e;})[_0xee7d('0x22')](respondWithFilteredResult(_0x2b7e0d,_0x5ad5f4))['catch'](handleError(_0x2b7e0d,null));};exports[_0xee7d('0x3f')]=function(_0xfcf96b,_0x18fbbf){var _0x9f0627={'raw':!![],'where':{'id':_0xfcf96b[_0xee7d('0x40')]['id']}},_0x4e4e06={};_0x4e4e06[_0xee7d('0x33')]=_[_0xee7d('0x2d')](db[_0xee7d('0x3b')][_0xee7d('0x29')]);_0x4e4e06[_0xee7d('0x2e')]=_[_0xee7d('0x2d')](_0xfcf96b[_0xee7d('0x2e')]);_0x4e4e06[_0xee7d('0x2f')]=_['intersection'](_0x4e4e06['model'],_0x4e4e06[_0xee7d('0x2e')]);_0x9f0627[_0xee7d('0x30')]=_[_0xee7d('0x31')](_0x4e4e06[_0xee7d('0x33')],qs[_0xee7d('0x32')](_0xfcf96b[_0xee7d('0x2e')]['fields']));_0x9f0627['attributes']=_0x9f0627['attributes']['length']?_0x9f0627['attributes']:_0x4e4e06[_0xee7d('0x33')];if(_0xfcf96b['query'][_0xee7d('0x3c')]){_0x9f0627[_0xee7d('0x41')]=[{'all':!![]}];}_0x9f0627=_[_0xee7d('0x3a')]({},_0x9f0627,_0xfcf96b[_0xee7d('0x42')]);return db[_0xee7d('0x3b')][_0xee7d('0x43')](_0x9f0627)[_0xee7d('0x22')](handleEntityNotFound(_0x18fbbf,null))['then'](respondWithResult(_0x18fbbf,null))[_0xee7d('0x44')](handleError(_0x18fbbf,null));};exports['clone']=function(_0x2f4dcd,_0x11e781){var _0x5637d8={'where':{'id':_0x2f4dcd['params']['id']}},_0x8ac70c={};_0x8ac70c[_0xee7d('0x33')]=_[_0xee7d('0x2d')](db[_0xee7d('0x3b')][_0xee7d('0x29')]);_0x5637d8[_0xee7d('0x30')]=_[_0xee7d('0x31')](_0x8ac70c['model'],qs[_0xee7d('0x32')](_0x2f4dcd[_0xee7d('0x2e')][_0xee7d('0x32')]));_0x5637d8[_0xee7d('0x30')]=_0x5637d8[_0xee7d('0x30')]['length']?_0x5637d8['attributes']:_0x8ac70c[_0xee7d('0x33')];if(_0x2f4dcd[_0xee7d('0x2e')][_0xee7d('0x3c')]){_0x5637d8['include']=[{'all':!![]}];}_0x5637d8=_[_0xee7d('0x3a')]({},_0x5637d8,_0x2f4dcd[_0xee7d('0x42')]);return db[_0xee7d('0x3b')]['find'](_0x5637d8)[_0xee7d('0x22')](handleEntityNotFound(_0x11e781,null))[_0xee7d('0x22')](function(_0xeeec01){if(_0xeeec01){var _0x8ed839=_0xeeec01[_0xee7d('0x45')]({'plain':!![]});_0x8ed839=qs[_0xee7d('0x46')](_0x8ed839,['id',_0xee7d('0x47'),_0xee7d('0x48')]);_0x2f4dcd[_0xee7d('0x49')]=_[_0xee7d('0x46')](_0x2f4dcd[_0xee7d('0x49')],['id','createdAt',_0xee7d('0x48')]);return db[_0xee7d('0x3b')][_0xee7d('0x4a')](_[_0xee7d('0x3a')](_0x8ed839,_0x2f4dcd['body']),{'include':_0x2f4dcd[_0xee7d('0x2e')][_0xee7d('0x3c')]?[{'all':!![]}]:undefined});}})[_0xee7d('0x22')](respondWithResult(_0x11e781,0xc9))[_0xee7d('0x44')](handleError(_0x11e781,null));};exports[_0xee7d('0x21')]=function(_0x5be6a0,_0x197cb7){if(_0x5be6a0['body']['id']){delete _0x5be6a0[_0xee7d('0x49')]['id'];}return db[_0xee7d('0x3b')]['find']({'where':{'id':_0x5be6a0['params']['id']}})[_0xee7d('0x22')](handleEntityNotFound(_0x197cb7,null))[_0xee7d('0x22')](saveUpdates(_0x5be6a0[_0xee7d('0x49')],null))[_0xee7d('0x22')](respondWithResult(_0x197cb7,null))['catch'](handleError(_0x197cb7,null));};exports[_0xee7d('0x23')]=function(_0x3cc7a3,_0x1ab3a9){return db[_0xee7d('0x3b')][_0xee7d('0x43')]({'where':{'id':_0x3cc7a3[_0xee7d('0x40')]['id']}})[_0xee7d('0x22')](handleEntityNotFound(_0x1ab3a9,null))['then'](removeEntity(_0x1ab3a9,null))['catch'](handleError(_0x1ab3a9,null));};exports['create']=function(_0x5c1457,_0x492f81,_0xa45a09){_0x5c1457[_0xee7d('0x49')]['name']=_0x5c1457[_0xee7d('0x4b')][_0xee7d('0x4c')];_0x5c1457[_0xee7d('0x49')][_0xee7d('0x4d')]=_0x5c1457[_0xee7d('0x4b')]['filename'];_0x5c1457['body'][_0xee7d('0x2b')]=_0x5c1457[_0xee7d('0x4b')][_0xee7d('0x4e')];return db['Attachment']['create'](_0x5c1457[_0xee7d('0x49')])['then'](respondWithResult(_0x492f81,0xc9))[_0xee7d('0x44')](handleError(_0x492f81,null));};exports['download']=function(_0x58b348,_0x3b2153,_0x246994){return db['Attachment']['findOne']({'where':{'id':_0x58b348['params']['id']},'raw':!![]})[_0xee7d('0x22')](handleEntityNotFound(_0x3b2153,null))['then'](function(_0x34888e){if(_0x34888e){var _0x15d4f0=_0x34888e[_0xee7d('0x4f')]!==null;var _0x3398a1=path[_0xee7d('0x50')](config[_0xee7d('0x51')],'server/files/attachments/');if(_0x15d4f0){_0x3398a1=path['join'](_0x3398a1,'offline-chat/');}var _0x38039b=path[_0xee7d('0x50')](_0x3398a1,_0x34888e[_0xee7d('0x4d')]);return _0x3b2153[_0xee7d('0x52')](_0x38039b);}})[_0xee7d('0x44')](handleError(_0x3b2153,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index f8d37b6..4e03c27 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 _0x94ed=['rimraf','../../config/environment','exports','define','attachments','lodash','api','moment','bluebird','request-promise','path'];(function(_0x9c3c56,_0x169b56){var _0x2dd782=function(_0x386962){while(--_0x386962){_0x9c3c56['push'](_0x9c3c56['shift']());}};_0x2dd782(++_0x169b56);}(_0x94ed,0x9f));var _0xd94e=function(_0x828160,_0x26d5be){_0x828160=_0x828160-0x0;var _0x296b5f=_0x94ed[_0x828160];return _0x296b5f;};'use strict';var _=require(_0xd94e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd94e('0x1'));var moment=require(_0xd94e('0x2'));var BPromise=require(_0xd94e('0x3'));var rp=require(_0xd94e('0x4'));var fs=require('fs');var path=require(_0xd94e('0x5'));var rimraf=require(_0xd94e('0x6'));var config=require(_0xd94e('0x7'));var attributes=require('./attachment.attributes');module[_0xd94e('0x8')]=function(_0x344e6e,_0x498312){return _0x344e6e[_0xd94e('0x9')]('Attachment',attributes,{'tableName':_0xd94e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x05a9=['attachments','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','./attachment.attributes','exports','define','Attachment'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x05a9,0x9b));var _0x905a=function(_0x2c3869,_0x514109){_0x2c3869=_0x2c3869-0x0;var _0x3af880=_0x05a9[_0x2c3869];return _0x3af880;};'use strict';var _=require(_0x905a('0x0'));var util=require('util');var logger=require(_0x905a('0x1'))('api');var moment=require(_0x905a('0x2'));var BPromise=require(_0x905a('0x3'));var rp=require(_0x905a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x905a('0x5'));var config=require('../../config/environment');var attributes=require(_0x905a('0x6'));module[_0x905a('0x7')]=function(_0x1933e6,_0x224201){return _0x1933e6[_0x905a('0x8')](_0x905a('0x9'),attributes,{'tableName':_0x905a('0xa'),'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 fc0d189..27d6220 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 _0x7341=['../../config/environment','jayson/promise','client','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','raw','then','CreateAttachment','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x5d8dc7,_0x12cb21){var _0x2b7c1c=function(_0x3a8936){while(--_0x3a8936){_0x5d8dc7['push'](_0x5d8dc7['shift']());}};_0x2b7c1c(++_0x12cb21);}(_0x7341,0xe4));var _0x1734=function(_0x74bd5e,_0x2a0da1){_0x74bd5e=_0x74bd5e-0x0;var _0x1cb97c=_0x7341[_0x74bd5e];return _0x1cb97c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1734('0x0'));var BPromise=require('bluebird');var rs=require(_0x1734('0x1'));var fs=require('fs');var Redis=require(_0x1734('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1734('0x3'));var logger=require(_0x1734('0x4'))(_0x1734('0x5'));var config=require(_0x1734('0x6'));var jayson=require(_0x1734('0x7'));var client=jayson[_0x1734('0x8')][_0x1734('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c7349,_0x1ca30b,_0x2c223d){return new BPromise(function(_0x45c529,_0x5b8977){return client[_0x1734('0xa')](_0x4c7349,_0x2c223d)['then'](function(_0x56f0d5){logger[_0x1734('0xb')](_0x1734('0xc'),_0x1ca30b,_0x1734('0xd'));logger[_0x1734('0xe')](_0x1734('0xf'),_0x1ca30b,_0x1734('0xd'),JSON[_0x1734('0x10')](_0x56f0d5));if(_0x56f0d5[_0x1734('0x11')]){if(_0x56f0d5[_0x1734('0x11')][_0x1734('0x12')]===0x1f4){logger['error'](_0x1734('0xc'),_0x1ca30b,_0x56f0d5[_0x1734('0x11')][_0x1734('0x13')]);return _0x5b8977(_0x56f0d5[_0x1734('0x11')][_0x1734('0x13')]);}logger[_0x1734('0x11')](_0x1734('0xc'),_0x1ca30b,_0x56f0d5[_0x1734('0x11')][_0x1734('0x13')]);return _0x45c529(_0x56f0d5[_0x1734('0x11')][_0x1734('0x13')]);}else{logger[_0x1734('0xb')](_0x1734('0xc'),_0x1ca30b,_0x1734('0xd'));_0x45c529(_0x56f0d5[_0x1734('0x14')][_0x1734('0x13')]);}})[_0x1734('0x15')](function(_0x1ea188){logger[_0x1734('0x11')]('Attachment,\x20%s,\x20%s',_0x1ca30b,_0x1ea188);_0x5b8977(_0x1ea188);});});}exports['CreateAttachment']=function(_0x1fa9c0){var _0x665ddc=this;return new Promise(function(_0x4a86d1,_0x212e63){return db['Attachment']['create'](_0x1fa9c0['body'],{'raw':_0x1fa9c0[_0x1734('0x16')]?_0x1fa9c0['options'][_0x1734('0x17')]===undefined?!![]:![]:!![]})[_0x1734('0x18')](function(_0x4fc4ed){logger['info']('CreateAttachment',_0x1fa9c0);logger[_0x1734('0xe')]('CreateAttachment',_0x1fa9c0,JSON[_0x1734('0x10')](_0x4fc4ed));_0x4a86d1(_0x4fc4ed);})['catch'](function(_0x215ae4){logger[_0x1734('0x11')](_0x1734('0x19'),_0x215ae4[_0x1734('0x13')],_0x1fa9c0);_0x212e63(_0x665ddc[_0x1734('0x11')](0x1f4,_0x215ae4[_0x1734('0x13')]));});});};
\ No newline at end of file
+var _0xfa2b=['Attachment','create','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','code','error','message','result','CreateAttachment'];(function(_0x41582d,_0x291b1c){var _0x59c504=function(_0x4d967e){while(--_0x4d967e){_0x41582d['push'](_0x41582d['shift']());}};_0x59c504(++_0x291b1c);}(_0xfa2b,0x1b7));var _0xbfa2=function(_0x14ff16,_0x18a9ab){_0x14ff16=_0x14ff16-0x0;var _0x16c67a=_0xfa2b[_0x14ff16];return _0x16c67a;};'use strict';var _=require(_0xbfa2('0x0'));var util=require(_0xbfa2('0x1'));var moment=require(_0xbfa2('0x2'));var BPromise=require(_0xbfa2('0x3'));var rs=require(_0xbfa2('0x4'));var fs=require('fs');var Redis=require(_0xbfa2('0x5'));var db=require(_0xbfa2('0x6'))['db'];var utils=require(_0xbfa2('0x7'));var logger=require(_0xbfa2('0x8'))(_0xbfa2('0x9'));var config=require(_0xbfa2('0xa'));var jayson=require(_0xbfa2('0xb'));var client=jayson[_0xbfa2('0xc')][_0xbfa2('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x26ed93,_0x26e9bf,_0x4cd9ae){return new BPromise(function(_0x46a151,_0x4f17e6){return client[_0xbfa2('0xe')](_0x26ed93,_0x4cd9ae)[_0xbfa2('0xf')](function(_0x1b1c13){logger[_0xbfa2('0x10')](_0xbfa2('0x11'),_0x26e9bf,_0xbfa2('0x12'));logger[_0xbfa2('0x13')](_0xbfa2('0x14'),_0x26e9bf,_0xbfa2('0x12'),JSON['stringify'](_0x1b1c13));if(_0x1b1c13['error']){if(_0x1b1c13['error'][_0xbfa2('0x15')]===0x1f4){logger[_0xbfa2('0x16')](_0xbfa2('0x11'),_0x26e9bf,_0x1b1c13[_0xbfa2('0x16')][_0xbfa2('0x17')]);return _0x4f17e6(_0x1b1c13[_0xbfa2('0x16')]['message']);}logger[_0xbfa2('0x16')](_0xbfa2('0x11'),_0x26e9bf,_0x1b1c13[_0xbfa2('0x16')][_0xbfa2('0x17')]);return _0x46a151(_0x1b1c13[_0xbfa2('0x16')]['message']);}else{logger[_0xbfa2('0x10')]('Attachment,\x20%s,\x20%s',_0x26e9bf,'request\x20sent');_0x46a151(_0x1b1c13[_0xbfa2('0x18')]['message']);}})['catch'](function(_0xab2c91){logger[_0xbfa2('0x16')]('Attachment,\x20%s,\x20%s',_0x26e9bf,_0xab2c91);_0x4f17e6(_0xab2c91);});});}exports[_0xbfa2('0x19')]=function(_0x12627a){var _0x28fe6f=this;return new Promise(function(_0x4088c5,_0x37aed6){return db[_0xbfa2('0x1a')][_0xbfa2('0x1b')](_0x12627a['body'],{'raw':_0x12627a[_0xbfa2('0x1c')]?_0x12627a[_0xbfa2('0x1c')][_0xbfa2('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x2ac6c3){logger[_0xbfa2('0x10')]('CreateAttachment',_0x12627a);logger[_0xbfa2('0x13')]('CreateAttachment',_0x12627a,JSON['stringify'](_0x2ac6c3));_0x4088c5(_0x2ac6c3);})[_0xbfa2('0x1e')](function(_0xdb059b){logger[_0xbfa2('0x16')](_0xbfa2('0x19'),_0xdb059b['message'],_0x12627a);_0x37aed6(_0x28fe6f['error'](0x1f4,_0xdb059b[_0xbfa2('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index d616fdd..83de210 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 _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x13945a,_0x193193){var _0x23b9f0=function(_0x417933){while(--_0x417933){_0x13945a['push'](_0x13945a['shift']());}};_0x23b9f0(++_0x193193);}(_0xadb5,0xad));var _0x5adb=function(_0x4b9ef7,_0x215516){_0x4b9ef7=_0x4b9ef7-0x0;var _0x5a5da7=_0xadb5[_0x4b9ef7];return _0x5a5da7;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router;
\ No newline at end of file
+var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x2ef8d9,_0x2fb8d0){var _0x18d1db=function(_0x4165bb){while(--_0x4165bb){_0x2ef8d9['push'](_0x2ef8d9['shift']());}};_0x18d1db(++_0x2fb8d0);}(_0x2032,0xd9));var _0x2203=function(_0xb6a7a6,_0x36f65f){_0xb6a7a6=_0xb6a7a6-0x0;var _0x4fdfb2=_0x2032[_0xb6a7a6];return _0x4fdfb2;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 12b86a7..0812d9d 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 _0x61ce=['../../config/logger','api','activedirectory','baseDN','url','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','password','salt','role','disabled','blocked','blockedAt','online','user','agent','name','domain','blockDuration','minutes','clearBlockUser','getLicense','catch','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','use','User','passport','passport-local','Strategy','moment','activedirectory2','util','../../mysqldb','../../components/auth/service'];(function(_0x5a92a7,_0x20aaeb){var _0x795d3c=function(_0x46330b){while(--_0x46330b){_0x5a92a7['push'](_0x5a92a7['shift']());}};_0x795d3c(++_0x20aaeb);}(_0x61ce,0x8e));var _0xe61c=function(_0x46836f,_0x3093d1){_0x46836f=_0x46836f-0x0;var _0x310cc0=_0x61ce[_0x46836f];return _0x310cc0;};'use strict';var passport=require(_0xe61c('0x0'));var LocalStrategy=require(_0xe61c('0x1'))[_0xe61c('0x2')];var moment=require(_0xe61c('0x3'));var ActiveDirectory=require(_0xe61c('0x4'));var BPromise=require('bluebird');var util=require(_0xe61c('0x5'));var db=require(_0xe61c('0x6'))['db'];var authService=require(_0xe61c('0x7'));var utils=require('../../config/utils');var config=require('../../config/environment');var logger=require(_0xe61c('0x8'))(_0xe61c('0x9'));function isActiveDirectoryConfigured(_0x569e14){var _0x55d5ef=![];if(typeof _0x569e14[_0xe61c('0xa')]!=='undefined'){_0x55d5ef=_0x569e14['activedirectory'][_0xe61c('0xb')]&&_0x569e14[_0xe61c('0xa')][_0xe61c('0xc')]&&_0x569e14[_0xe61c('0xa')]['domain'];}return _0x55d5ef;}function adAuthenticate(_0x5696cf,_0x1002b1,_0x449fc7){return new BPromise(function(_0x3df490,_0x5df3cb){try{var _0x243ac4=new ActiveDirectory(_0x5696cf);_0x243ac4[_0xe61c('0xd')](_0x1002b1,_0x449fc7,function(_0x59713e,_0x367122){if(_0x59713e){logger[_0xe61c('0xe')](_0xe61c('0xf'),_0x1002b1,util[_0xe61c('0x10')](_0x59713e,{'showHidden':![],'depth':null}));_0x5df3cb(_0xe61c('0x11'));}else if(!_0x367122){logger[_0xe61c('0xe')](_0xe61c('0x12'),_0x1002b1);_0x5df3cb(_0xe61c('0x11'));}else{_0x3df490(_0x367122);}});}catch(_0x1222c4){_0x5df3cb(_0x1222c4);}});}function ActiveDirectoryAuthenticate(_0x1d05fe,_0x4f9b8a,_0x5d1e21,_0x42db2e){var _0x2abf04,_0x4f6f9a;if(!isActiveDirectoryConfigured(config)){logger['error'](_0xe61c('0x13'),_0x4f9b8a);return _0x42db2e(null,![],{'message':_0xe61c('0x11')});}return db[_0xe61c('0x14')]['findOne']({'where':{'id':0x1},'attributes':['adSsoEnabled','blockDuration'],'raw':!![]})[_0xe61c('0x15')](function(_0x2abf5a){_0x2abf04=_0x2abf5a;if(!_0x2abf04[_0xe61c('0x16')]){logger[_0xe61c('0xe')](_0xe61c('0x17'),_0x4f9b8a);throw new Error(_0xe61c('0x11'));}return _0x1d05fe[_0xe61c('0x18')]({'logging':!![],'attributes':['id','name',_0xe61c('0x19'),_0xe61c('0x1a'),_0xe61c('0x1b'),_0xe61c('0x1c'),_0xe61c('0x1d'),_0xe61c('0x1e'),_0xe61c('0x1f')],'where':{'name':_0x4f9b8a,'role':{'$or':['admin',_0xe61c('0x20'),_0xe61c('0x21')]},'adSsoEnabled':!![]}});})[_0xe61c('0x15')](function(_0xa3e3d1){if(!_0xa3e3d1||_0xa3e3d1&&_0xa3e3d1[_0xe61c('0x22')]!==_0x4f9b8a){throw new Error(_0xe61c('0x11'));}_0x4f6f9a=_0xa3e3d1;var _0x1cc890=_0x4f6f9a[_0xe61c('0x22')]+'@'+config[_0xe61c('0xa')][_0xe61c('0x23')];return adAuthenticate(config['activedirectory'],_0x1cc890,_0x5d1e21);})['then'](function(_0x46f6d9){if(_0x4f6f9a['disabled']){throw new Error(_0xe61c('0x11'));}if(_0x2abf04[_0xe61c('0x24')]>0x0){if(_0x4f6f9a[_0xe61c('0x1d')]){if(moment(_0x4f6f9a[_0xe61c('0x1e')])['add'](_0x2abf04[_0xe61c('0x24')],_0xe61c('0x25'))>moment()){throw new Error(_0xe61c('0x11'));}return utils[_0xe61c('0x26')](_0x4f6f9a,0x0,![],null)['then'](function(){return utils[_0xe61c('0x27')](_0x4f6f9a);})[_0xe61c('0x15')](function(){return _0x42db2e(null,_0x4f6f9a);});}else{return utils[_0xe61c('0x27')](_0x4f6f9a)['then'](function(){return _0x42db2e(null,_0x4f6f9a);});}}else{return utils[_0xe61c('0x27')](_0x4f6f9a)[_0xe61c('0x15')](function(){return _0x42db2e(null,_0x4f6f9a);});}})[_0xe61c('0x28')](function(_0x2dd070){return _0x42db2e(null,![],_0x2dd070);});}function handleError(_0x11480b,_0x44cc7f,_0xc1f1e0){return _0x11480b[_0xe61c('0x29')](_0x44cc7f||0x1f4)[_0xe61c('0x2a')]({'message':_0xc1f1e0?_0xc1f1e0[_0xe61c('0x2b')]||_0xc1f1e0:''});}exports[_0xe61c('0x2c')]=function(_0x3eb57c,_0x4214cf,_0x6a8514){passport[_0xe61c('0xd')](_0xe61c('0x2d'),function(_0x17cced,_0x1130c1,_0x4b6099){var _0x4e3c00=_0x17cced||_0x4b6099;if(_0x4e3c00){return handleError(_0x4214cf,0x191,_0x4e3c00);}if(!_0x1130c1){return handleError(_0x4214cf,0x194,{'message':_0xe61c('0x2e')});}else{var _0xf06734={'payload':{'id':_0x1130c1['id'],'role':_0x1130c1[_0xe61c('0x1b')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0xf06734)[_0xe61c('0x15')](function(_0x24c988){_0x4214cf[_0xe61c('0x2f')]({'id':_0x1130c1['id'],'token':_0x24c988,'statusCall':'','isAlreadyLogged':_0x1130c1[_0xe61c('0x1f')]});});}})(_0x3eb57c,_0x4214cf,_0x6a8514);};passport[_0xe61c('0x30')](_0xe61c('0x2d'),new LocalStrategy({'usernameField':_0xe61c('0x22'),'passwordField':'password'},function(_0x3001ba,_0x39fbf6,_0x2e3159){return ActiveDirectoryAuthenticate(db[_0xe61c('0x31')],_0x3001ba,_0x39fbf6,_0x2e3159);}));
\ No newline at end of file
+var _0x6a99=['undefined','error','Error\x20authenticate\x20%s:\x20%s','inspect','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','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','name','password','role','blocked','blockedAt','online','admin','user','agent','domain','clearBlockUser','getLicense','catch','status','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','use','User','passport','passport-local','moment','activedirectory2','../../mysqldb','../../components/auth/service','../../config/logger','activedirectory'];(function(_0xc26c95,_0xed8018){var _0x5626f6=function(_0x4dbc04){while(--_0x4dbc04){_0xc26c95['push'](_0xc26c95['shift']());}};_0x5626f6(++_0xed8018);}(_0x6a99,0x148));var _0x96a9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6a99[_0x20a584];return _0x4b41a8;};'use strict';var passport=require(_0x96a9('0x0'));var LocalStrategy=require(_0x96a9('0x1'))['Strategy'];var moment=require(_0x96a9('0x2'));var ActiveDirectory=require(_0x96a9('0x3'));var BPromise=require('bluebird');var util=require('util');var db=require(_0x96a9('0x4'))['db'];var authService=require(_0x96a9('0x5'));var utils=require('../../config/utils');var config=require('../../config/environment');var logger=require(_0x96a9('0x6'))('api');function isActiveDirectoryConfigured(_0xa8aa2){var _0x4b7fbf=![];if(typeof _0xa8aa2[_0x96a9('0x7')]!==_0x96a9('0x8')){_0x4b7fbf=_0xa8aa2[_0x96a9('0x7')]['baseDN']&&_0xa8aa2[_0x96a9('0x7')]['url']&&_0xa8aa2['activedirectory']['domain'];}return _0x4b7fbf;}function adAuthenticate(_0x4fb216,_0x1d856f,_0xf0fbc1){return new BPromise(function(_0x16f995,_0x4e7ba9){try{var _0x26c207=new ActiveDirectory(_0x4fb216);_0x26c207['authenticate'](_0x1d856f,_0xf0fbc1,function(_0x5a8ab6,_0x16000f){if(_0x5a8ab6){logger[_0x96a9('0x9')](_0x96a9('0xa'),_0x1d856f,util[_0x96a9('0xb')](_0x5a8ab6,{'showHidden':![],'depth':null}));_0x4e7ba9('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x16000f){logger[_0x96a9('0x9')](_0x96a9('0xc'),_0x1d856f);_0x4e7ba9('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x16f995(_0x16000f);}});}catch(_0x201b2d){_0x4e7ba9(_0x201b2d);}});}function ActiveDirectoryAuthenticate(_0x4417df,_0x24be2f,_0x57041e,_0x4db3d3){var _0x31843a,_0x4a5208;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x96a9('0xd'),_0x24be2f);return _0x4db3d3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x96a9('0xe')][_0x96a9('0xf')]({'where':{'id':0x1},'attributes':[_0x96a9('0x10'),_0x96a9('0x11')],'raw':!![]})[_0x96a9('0x12')](function(_0x1a7ac6){_0x31843a=_0x1a7ac6;if(!_0x31843a[_0x96a9('0x10')]){logger[_0x96a9('0x9')](_0x96a9('0x13'),_0x24be2f);throw new Error(_0x96a9('0x14'));}return _0x4417df['findOne']({'logging':!![],'attributes':['id',_0x96a9('0x15'),_0x96a9('0x16'),'salt',_0x96a9('0x17'),'disabled',_0x96a9('0x18'),_0x96a9('0x19'),_0x96a9('0x1a')],'where':{'name':_0x24be2f,'role':{'$or':[_0x96a9('0x1b'),_0x96a9('0x1c'),_0x96a9('0x1d')]},'adSsoEnabled':!![]}});})[_0x96a9('0x12')](function(_0x2b0d91){if(!_0x2b0d91||_0x2b0d91&&_0x2b0d91['name']!==_0x24be2f){throw new Error(_0x96a9('0x14'));}_0x4a5208=_0x2b0d91;var _0x51aa4b=_0x4a5208[_0x96a9('0x15')]+'@'+config[_0x96a9('0x7')][_0x96a9('0x1e')];return adAuthenticate(config[_0x96a9('0x7')],_0x51aa4b,_0x57041e);})[_0x96a9('0x12')](function(_0x191074){if(_0x4a5208['disabled']){throw new Error(_0x96a9('0x14'));}if(_0x31843a[_0x96a9('0x11')]>0x0){if(_0x4a5208[_0x96a9('0x18')]){if(moment(_0x4a5208[_0x96a9('0x19')])['add'](_0x31843a[_0x96a9('0x11')],'minutes')>moment()){throw new Error(_0x96a9('0x14'));}return utils[_0x96a9('0x1f')](_0x4a5208,0x0,![],null)[_0x96a9('0x12')](function(){return utils[_0x96a9('0x20')](_0x4a5208);})[_0x96a9('0x12')](function(){return _0x4db3d3(null,_0x4a5208);});}else{return utils['getLicense'](_0x4a5208)[_0x96a9('0x12')](function(){return _0x4db3d3(null,_0x4a5208);});}}else{return utils[_0x96a9('0x20')](_0x4a5208)[_0x96a9('0x12')](function(){return _0x4db3d3(null,_0x4a5208);});}})[_0x96a9('0x21')](function(_0x51d99d){return _0x4db3d3(null,![],_0x51d99d);});}function handleError(_0x120b79,_0x452cde,_0x16e0ec){return _0x120b79[_0x96a9('0x22')](_0x452cde||0x1f4)['send']({'message':_0x16e0ec?_0x16e0ec['message']||_0x16e0ec:''});}exports[_0x96a9('0x23')]=function(_0x210c82,_0x3b977f,_0x2b8ac3){passport[_0x96a9('0x24')](_0x96a9('0x25'),function(_0x387c99,_0x3d232f,_0x5b2dbc){var _0x39ad3f=_0x387c99||_0x5b2dbc;if(_0x39ad3f){return handleError(_0x3b977f,0x191,_0x39ad3f);}if(!_0x3d232f){return handleError(_0x3b977f,0x194,{'message':_0x96a9('0x26')});}else{var _0x66c693={'payload':{'id':_0x3d232f['id'],'role':_0x3d232f[_0x96a9('0x17')]},'options':{'expiresIn':0x15180}};return authService[_0x96a9('0x27')](_0x66c693)[_0x96a9('0x12')](function(_0x14c13b){_0x3b977f['json']({'id':_0x3d232f['id'],'token':_0x14c13b,'statusCall':'','isAlreadyLogged':_0x3d232f['online']});});}})(_0x210c82,_0x3b977f,_0x2b8ac3);};passport[_0x96a9('0x28')](_0x96a9('0x25'),new LocalStrategy({'usernameField':_0x96a9('0x15'),'passwordField':'password'},function(_0x1c0319,_0x177dc,_0x6a98c0){return ActiveDirectoryAuthenticate(db[_0x96a9('0x29')],_0x1c0319,_0x177dc,_0x6a98c0);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index ff60bb9..5eca1dc 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 _0xa3ea=['Router','./authActiveDirectory.controller','post','express'];(function(_0x57c8cf,_0x3d2d4b){var _0x31d74e=function(_0x1b1cba){while(--_0x1b1cba){_0x57c8cf['push'](_0x57c8cf['shift']());}};_0x31d74e(++_0x3d2d4b);}(_0xa3ea,0xcb));var _0xaa3e=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xa3ea[_0x19950b];return _0x3c6b41;};'use strict';var express=require(_0xaa3e('0x0'));var router=express[_0xaa3e('0x1')]();var controller=require(_0xaa3e('0x2'));router[_0xaa3e('0x3')]('/',controller['login']);module['exports']=router;
\ No newline at end of file
+var _0xcd5e=['login','exports','express','./authActiveDirectory.controller','post'];(function(_0x40df65,_0x317cec){var _0x3c0717=function(_0x128475){while(--_0x128475){_0x40df65['push'](_0x40df65['shift']());}};_0x3c0717(++_0x317cec);}(_0xcd5e,0xe8));var _0xecd5=function(_0xc33e1c,_0x52abd6){_0xc33e1c=_0xc33e1c-0x0;var _0x48a39d=_0xcd5e[_0xc33e1c];return _0x48a39d;};'use strict';var express=require(_0xecd5('0x0'));var router=express['Router']();var controller=require(_0xecd5('0x1'));router[_0xecd5('0x2')]('/',controller[_0xecd5('0x3')]);module[_0xecd5('0x4')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index d9c3233..e42ea44 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(_0x5a2adf,_0x39dc46){var _0x37b651=function(_0x24f4a7){while(--_0x24f4a7){_0x5a2adf['push'](_0x5a2adf['shift']());}};_0x37b651(++_0x39dc46);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x7a54,0x106));var _0x47a5=function(_0xbfb1ac,_0x5352e9){_0xbfb1ac=_0xbfb1ac-0x0;var _0x79e76d=_0x7a54[_0xbfb1ac];return _0x79e76d;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index e16d4df..3627148 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 _0x43df=['/callback','callback','isMiddleware','setTokenCookie','exports','passport','Router','../user/user.controller.js','../../components/auth/service','get','login'];(function(_0x324e86,_0x81b1cb){var _0x592846=function(_0x33439c){while(--_0x33439c){_0x324e86['push'](_0x324e86['shift']());}};_0x592846(++_0x81b1cb);}(_0x43df,0x1c8));var _0xf43d=function(_0x33ccaf,_0x192235){_0x33ccaf=_0x33ccaf-0x0;var _0x30abf6=_0x43df[_0x33ccaf];return _0x30abf6;};'use strict';var express=require('express');var passport=require(_0xf43d('0x0'));var router=express[_0xf43d('0x1')]();var controller=require('./authGoogle.controller');var userController=require(_0xf43d('0x2'));var authService=require(_0xf43d('0x3'));router[_0xf43d('0x4')]('/',controller[_0xf43d('0x5')]);router[_0xf43d('0x4')](_0xf43d('0x6'),controller[_0xf43d('0x7')],authService[_0xf43d('0x8')],userController[_0xf43d('0x5')],authService[_0xf43d('0x9')]);module[_0xf43d('0xa')]=router;
\ No newline at end of file
+var _0xb7fb=['Router','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','exports','express','passport'];(function(_0x319aee,_0x344705){var _0x596984=function(_0x277dad){while(--_0x277dad){_0x319aee['push'](_0x319aee['shift']());}};_0x596984(++_0x344705);}(_0xb7fb,0x76));var _0xbb7f=function(_0x485fc,_0x170c23){_0x485fc=_0x485fc-0x0;var _0x5ee62c=_0xb7fb[_0x485fc];return _0x5ee62c;};'use strict';var express=require(_0xbb7f('0x0'));var passport=require(_0xbb7f('0x1'));var router=express[_0xbb7f('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0xbb7f('0x3'));var authService=require(_0xbb7f('0x4'));router[_0xbb7f('0x5')]('/',controller[_0xbb7f('0x6')]);router[_0xbb7f('0x5')](_0xbb7f('0x7'),controller[_0xbb7f('0x8')],authService[_0xbb7f('0x9')],userController[_0xbb7f('0x6')],authService[_0xbb7f('0xa')]);module[_0xbb7f('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 7f6f03e..b70e0a5 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 _0xdf92=['token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','resetPasswordExpires','save','Password\x20reset!','use','local-login','util','passport','passport-local','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','allowedLoginAttempts','then','findOne','name','password','salt','role','blocked','blockedAt','loginAttempts','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','minutes','clearBlockUser','disabled','getLicense','catch','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','secure','auth','pass','merge','format','\x22%s\x22\x20<%s>','user','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','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://','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','reset','User','params'];(function(_0x477314,_0x23ec31){var _0x73b4b3=function(_0x3befd9){while(--_0x3befd9){_0x477314['push'](_0x477314['shift']());}};_0x73b4b3(++_0x23ec31);}(_0xdf92,0x15c));var _0x2df9=function(_0x4a3e80,_0x1ceabd){_0x4a3e80=_0x4a3e80-0x0;var _0x4fce61=_0xdf92[_0x4a3e80];return _0x4fce61;};'use strict';var util=require(_0x2df9('0x0'));var passport=require(_0x2df9('0x1'));var LocalStrategy=require(_0x2df9('0x2'))[_0x2df9('0x3')];var jayson=require(_0x2df9('0x4'));var _=require(_0x2df9('0x5'));var rs=require('randomstring');var moment=require(_0x2df9('0x6'));var db=require(_0x2df9('0x7'))['db'];var authService=require(_0x2df9('0x8'));var utils=require(_0x2df9('0x9'));var client=jayson[_0x2df9('0xa')]['http']({'port':0x232b});function localAuthenticate(_0x18b0a6,_0x4b3b48,_0x4659ba,_0x4f5031){var _0xbb5309,_0x354293;return db[_0x2df9('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0x2df9('0xc'),'blockDuration'],'raw':!![]})[_0x2df9('0xd')](function(_0x3b6202){_0xbb5309=_0x3b6202;return _0x18b0a6[_0x2df9('0xe')]({'attributes':['id',_0x2df9('0xf'),_0x2df9('0x10'),_0x2df9('0x11'),_0x2df9('0x12'),'disabled',_0x2df9('0x13'),_0x2df9('0x14'),_0x2df9('0x15')],'where':{'name':_0x4b3b48,'role':{'$or':[_0x2df9('0x16'),'user',_0x2df9('0x17')]}}});})[_0x2df9('0xd')](function(_0x3b20e7){if(!_0x3b20e7||_0x3b20e7&&_0x3b20e7[_0x2df9('0xf')]!==_0x4b3b48){throw new Error(_0x2df9('0x18'));}else{_0x354293=_0x3b20e7;return _0x354293;}})['then'](function(){_0x354293[_0x2df9('0x19')](_0x4659ba,function(_0x23e49e,_0x447dda){var _0x2f0fbb=_0x354293[_0x2df9('0x15')]+0x1;if(_0x23e49e){return _0x4f5031(_0x23e49e);}else if(!_0x447dda){if(_0x354293['disabled']){return _0x4f5031(null,![],{'message':_0x2df9('0x18')});}else if(_0xbb5309[_0x2df9('0xc')]>0x0){if(_0x354293[_0x2df9('0x13')]){if(_0xbb5309[_0x2df9('0x1a')]>0x0){if(moment(_0x354293['blockedAt'])['add'](_0xbb5309['blockDuration'],_0x2df9('0x1b'))>moment()){return _0x4f5031(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x354293,_0x2f0fbb,![],null)['then'](function(){return _0x4f5031(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x4f5031(null,![],{'message':_0x2df9('0x18')});}}else{if(_0x2f0fbb>=_0xbb5309[_0x2df9('0xc')]){return utils[_0x2df9('0x1c')](_0x354293,0x0,!![],moment())['then'](function(){return _0x4f5031(null,![],{'message':_0x2df9('0x18')});});}else{return utils[_0x2df9('0x1c')](_0x354293,_0x2f0fbb,![],null)[_0x2df9('0xd')](function(){return _0x4f5031(null,![],{'message':_0x2df9('0x18')});});}}}else{return _0x4f5031(null,![],{'message':_0x2df9('0x18')});}}else{if(_0x354293[_0x2df9('0x1d')]){return _0x4f5031(null,![],{'message':_0x2df9('0x18')});}else if(_0xbb5309['allowedLoginAttempts']>0x0){if(_0x354293[_0x2df9('0x13')]){if(_0xbb5309[_0x2df9('0x1a')]>0x0){if(moment(_0x354293[_0x2df9('0x14')])['add'](_0xbb5309[_0x2df9('0x1a')],_0x2df9('0x1b'))>moment()){return _0x4f5031(null,![],{'message':_0x2df9('0x18')});}else{return utils[_0x2df9('0x1c')](_0x354293,0x0,![],null)[_0x2df9('0xd')](function(){return utils[_0x2df9('0x1e')](_0x354293);})[_0x2df9('0xd')](function(){return _0x4f5031(null,_0x354293);});}}else{return _0x4f5031(null,![],{'message':_0x2df9('0x18')});}}else{return utils[_0x2df9('0x1c')](_0x354293,0x0,![],null)[_0x2df9('0xd')](function(){return utils[_0x2df9('0x1e')](_0x354293);})['then'](function(){return _0x4f5031(null,_0x354293);})[_0x2df9('0x1f')](function(_0x52ff04){return _0x4f5031(null,![],_0x52ff04);});}}else{if(_0x354293[_0x2df9('0x13')]){return _0x4f5031(null,![],{'message':_0x2df9('0x18')});}else{return utils[_0x2df9('0x1e')](_0x354293)[_0x2df9('0xd')](function(){return _0x4f5031(null,_0x354293);});}}}});})[_0x2df9('0x1f')](function(_0x1f1e32){return _0x4f5031(null,![],_0x1f1e32);});}function sendServiceMail(_0x2a192e){return db['MailAccount'][_0x2df9('0x20')]({'where':{'service':!![]},'attributes':['id',_0x2df9('0xf'),_0x2df9('0x21')],'include':[{'model':db[_0x2df9('0x22')],'as':_0x2df9('0x23')}]})[_0x2df9('0xd')](function(_0x4426d2){if(!_0x4426d2){throw new Error(_0x2df9('0x24'));}var _0x4c09af={'tls':{'rejectUnauthorized':![]}};if(_0x4426d2[_0x2df9('0x23')][_0x2df9('0x25')]){_0x4c09af['service']=_0x4426d2[_0x2df9('0x23')]['service'];}else{_0x4c09af[_0x2df9('0x26')]=_0x4426d2['Smtp']['host'];_0x4c09af['port']=_0x4426d2[_0x2df9('0x23')]['port'];_0x4c09af[_0x2df9('0x27')]=_0x4426d2[_0x2df9('0x23')][_0x2df9('0x27')];}if(_0x4426d2[_0x2df9('0x23')]['authentication']){_0x4c09af[_0x2df9('0x28')]={'user':_0x4426d2[_0x2df9('0x23')]['user'],'pass':_0x4426d2[_0x2df9('0x23')][_0x2df9('0x29')]};}var _0x393494={'account':_0x4c09af,'message':_[_0x2df9('0x2a')]({'from':util[_0x2df9('0x2b')](_0x2df9('0x2c'),_0x4426d2[_0x2df9('0xf')],_0x4426d2[_0x2df9('0x21')]||_0x4426d2['Smtp'][_0x2df9('0x2d')])},_0x2a192e)};return client[_0x2df9('0x2e')](_0x2df9('0x2f'),_0x393494);})[_0x2df9('0xd')](function(_0xcb9b3a){if(_0xcb9b3a[_0x2df9('0x30')]){throw new Error(util[_0x2df9('0x2b')](_0x2df9('0x31'),_0xcb9b3a['error'][_0x2df9('0x32')]||JSON[_0x2df9('0x33')](_0xcb9b3a['error'])));}return!![];});}function handleError(_0x1c2906,_0x2bfa69,_0x80f8ce){return _0x1c2906['status'](_0x2bfa69||0x1f4)[_0x2df9('0x34')]({'message':_0x80f8ce?_0x80f8ce['message']||_0x80f8ce:''});}exports[_0x2df9('0x35')]=function(_0x1dc94a,_0x1f9c66,_0x25d168){passport[_0x2df9('0x19')]('local-login',function(_0x221473,_0x5ecbe4,_0xb2907){var _0x52c3cd=_0x221473||_0xb2907;if(_0x52c3cd){return handleError(_0x1f9c66,0x191,_0x52c3cd);}if(!_0x5ecbe4){return handleError(_0x1f9c66,0x194,{'message':_0x2df9('0x36')});}else{var _0x52a75b={'payload':{'id':_0x5ecbe4['id'],'role':_0x5ecbe4[_0x2df9('0x12')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x52a75b)[_0x2df9('0xd')](function(_0x26c23d){_0x1f9c66[_0x2df9('0x37')]({'id':_0x5ecbe4['id'],'token':_0x26c23d,'statusCall':'','isAlreadyLogged':_0x5ecbe4['online']});});}})(_0x1dc94a,_0x1f9c66,_0x25d168);};exports[_0x2df9('0x38')]=function(_0x499497,_0x102cf4,_0x2a5b17){if(!_0x499497[_0x2df9('0x39')][_0x2df9('0x21')]){return handleError(_0x102cf4,0x1f4,{'message':_0x2df9('0x3a')});}var _0x3d0f81=rs[_0x2df9('0x3b')]();_0x499497[_0x2df9('0x39')][_0x2df9('0x21')]=_0x499497[_0x2df9('0x39')]['email'][_0x2df9('0x3c')]()[_0x2df9('0x3d')]();var _0x2669b1;return db[_0x2df9('0xb')][_0x2df9('0xe')]({'where':{'id':0x1},'attributes':[_0x2df9('0xc'),'blockDuration'],'raw':!![]})['then'](function(_0x3aefbb){_0x2669b1=_0x3aefbb;return db['User'][_0x2df9('0x20')]({'where':{'email':_0x499497[_0x2df9('0x39')][_0x2df9('0x21')]}});})[_0x2df9('0xd')](function(_0x25901c){if(!_0x25901c){throw new Error(_0x2df9('0x3e'));}if(_0x25901c['disabled']){throw new Error(_0x2df9('0x3f'));}if(_0x25901c['blocked']){if(moment(_0x25901c[_0x2df9('0x14')])['add'](_0x2669b1[_0x2df9('0x1a')],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x25901c[_0x2df9('0x13')]=![];_0x25901c[_0x2df9('0x14')]=null;}}_0x25901c['resetPasswordToken']=_0x3d0f81;_0x25901c['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x25901c['save']();})[_0x2df9('0xd')](function(){return sendServiceMail({'to':_0x499497[_0x2df9('0x39')][_0x2df9('0x21')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x2df9('0x40')+_0x2df9('0x41')+_0x2df9('0x42')+_0x499497['headers']['host']+'/reset/'+_0x3d0f81+'\x0a\x0a'+_0x2df9('0x43')});})[_0x2df9('0xd')](function(){_0x102cf4[_0x2df9('0x44')](0xc8)[_0x2df9('0x34')]({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x8038cb){return handleError(_0x102cf4,0x1f4,_0x8038cb);});};exports[_0x2df9('0x45')]=function(_0x5369ed,_0xc4d593,_0x1974f7){return db[_0x2df9('0x46')][_0x2df9('0x20')]({'where':{'resetPasswordToken':_0x5369ed[_0x2df9('0x47')][_0x2df9('0x48')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x2df9('0xd')](function(_0x3fd0bb){if(!_0x3fd0bb){throw new Error(_0x2df9('0x49'));}return db['Setting'][_0x2df9('0xe')]({'attributes':['id','securePassword',_0x2df9('0x4a'),_0x2df9('0x4b')]})['then'](function(_0x4396b6){if(_0x4396b6[_0x2df9('0x4c')])authService[_0x2df9('0x4d')](_0x5369ed[_0x2df9('0x39')][_0x2df9('0x10')]);if(!_0x4396b6[_0x2df9('0x4a')]||!_0x3fd0bb[_0x2df9('0x4e')])return _0x3fd0bb;authService['validatePasswordHistory'](_0x5369ed['body'][_0x2df9('0x10')],_0x3fd0bb['previousPasswords'],_0x4396b6[_0x2df9('0x4b')]);return _0x3fd0bb;})[_0x2df9('0xd')](function(){_0x3fd0bb[_0x2df9('0x10')]=_0x5369ed[_0x2df9('0x39')][_0x2df9('0x10')];_0x3fd0bb['resetPasswordToken']=null;_0x3fd0bb[_0x2df9('0x4f')]=null;return _0x3fd0bb[_0x2df9('0x50')]();});})['then'](function(){_0xc4d593[_0x2df9('0x44')](0xc8)[_0x2df9('0x34')]({'message':_0x2df9('0x51')});})['catch'](function(_0xf9f18d){return handleError(_0xc4d593,0x1f4,_0xf9f18d);});};passport[_0x2df9('0x52')](_0x2df9('0x53'),new LocalStrategy({'usernameField':'name','passwordField':_0x2df9('0x10')},function(_0x64186c,_0x2c48c3,_0x32adb3){return localAuthenticate(db[_0x2df9('0x46')],_0x64186c,_0x2c48c3,_0x32adb3);}));
\ No newline at end of file
+var _0x6403=['login','authenticate','body','Email\x20parameter\x20is\x20missing','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','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','send','Reset\x20Email\x20sent!','reset','params','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','password','status','Password\x20reset!','use','local-login','passport','passport-local','Strategy','lodash','randomstring','moment','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','salt','role','disabled','blockedAt','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','loginAttempts','blocked','add','clearBlockUser','minutes','getLicense','catch','MailAccount','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','pass','format','SendMail','error','stringify','message'];(function(_0x2a8e5f,_0x317747){var _0x425b4a=function(_0x16b158){while(--_0x16b158){_0x2a8e5f['push'](_0x2a8e5f['shift']());}};_0x425b4a(++_0x317747);}(_0x6403,0x71));var _0x3640=function(_0x5c29ef,_0x4c73dd){_0x5c29ef=_0x5c29ef-0x0;var _0x2dad94=_0x6403[_0x5c29ef];return _0x2dad94;};'use strict';var util=require('util');var passport=require(_0x3640('0x0'));var LocalStrategy=require(_0x3640('0x1'))[_0x3640('0x2')];var jayson=require('jayson/promise');var _=require(_0x3640('0x3'));var rs=require(_0x3640('0x4'));var moment=require(_0x3640('0x5'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x3640('0x6'));var client=jayson[_0x3640('0x7')][_0x3640('0x8')]({'port':0x232b});function localAuthenticate(_0x466de0,_0x227068,_0x1c5509,_0x1d5726){var _0x2db085,_0x2042ae;return db[_0x3640('0x9')][_0x3640('0xa')]({'where':{'id':0x1},'attributes':[_0x3640('0xb'),_0x3640('0xc')],'raw':!![]})[_0x3640('0xd')](function(_0x2604db){_0x2db085=_0x2604db;return _0x466de0[_0x3640('0xa')]({'attributes':['id','name','password',_0x3640('0xe'),_0x3640('0xf'),_0x3640('0x10'),'blocked',_0x3640('0x11'),'loginAttempts'],'where':{'name':_0x227068,'role':{'$or':['admin',_0x3640('0x12'),_0x3640('0x13')]}}});})['then'](function(_0xa2a20d){if(!_0xa2a20d||_0xa2a20d&&_0xa2a20d[_0x3640('0x14')]!==_0x227068){throw new Error(_0x3640('0x15'));}else{_0x2042ae=_0xa2a20d;return _0x2042ae;}})[_0x3640('0xd')](function(){_0x2042ae['authenticate'](_0x1c5509,function(_0x3f03ba,_0x538f1b){var _0x57ce78=_0x2042ae[_0x3640('0x16')]+0x1;if(_0x3f03ba){return _0x1d5726(_0x3f03ba);}else if(!_0x538f1b){if(_0x2042ae['disabled']){return _0x1d5726(null,![],{'message':_0x3640('0x15')});}else if(_0x2db085['allowedLoginAttempts']>0x0){if(_0x2042ae[_0x3640('0x17')]){if(_0x2db085[_0x3640('0xc')]>0x0){if(moment(_0x2042ae[_0x3640('0x11')])[_0x3640('0x18')](_0x2db085[_0x3640('0xc')],'minutes')>moment()){return _0x1d5726(null,![],{'message':_0x3640('0x15')});}else{return utils[_0x3640('0x19')](_0x2042ae,_0x57ce78,![],null)[_0x3640('0xd')](function(){return _0x1d5726(null,![],{'message':_0x3640('0x15')});});}}else{return _0x1d5726(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x57ce78>=_0x2db085[_0x3640('0xb')]){return utils[_0x3640('0x19')](_0x2042ae,0x0,!![],moment())[_0x3640('0xd')](function(){return _0x1d5726(null,![],{'message':_0x3640('0x15')});});}else{return utils[_0x3640('0x19')](_0x2042ae,_0x57ce78,![],null)['then'](function(){return _0x1d5726(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x1d5726(null,![],{'message':_0x3640('0x15')});}}else{if(_0x2042ae[_0x3640('0x10')]){return _0x1d5726(null,![],{'message':_0x3640('0x15')});}else if(_0x2db085[_0x3640('0xb')]>0x0){if(_0x2042ae['blocked']){if(_0x2db085[_0x3640('0xc')]>0x0){if(moment(_0x2042ae[_0x3640('0x11')])[_0x3640('0x18')](_0x2db085[_0x3640('0xc')],_0x3640('0x1a'))>moment()){return _0x1d5726(null,![],{'message':_0x3640('0x15')});}else{return utils[_0x3640('0x19')](_0x2042ae,0x0,![],null)[_0x3640('0xd')](function(){return utils[_0x3640('0x1b')](_0x2042ae);})['then'](function(){return _0x1d5726(null,_0x2042ae);});}}else{return _0x1d5726(null,![],{'message':_0x3640('0x15')});}}else{return utils[_0x3640('0x19')](_0x2042ae,0x0,![],null)[_0x3640('0xd')](function(){return utils[_0x3640('0x1b')](_0x2042ae);})[_0x3640('0xd')](function(){return _0x1d5726(null,_0x2042ae);})[_0x3640('0x1c')](function(_0x520c87){return _0x1d5726(null,![],_0x520c87);});}}else{if(_0x2042ae['blocked']){return _0x1d5726(null,![],{'message':_0x3640('0x15')});}else{return utils['getLicense'](_0x2042ae)[_0x3640('0xd')](function(){return _0x1d5726(null,_0x2042ae);});}}}});})[_0x3640('0x1c')](function(_0x1f307f){return _0x1d5726(null,![],_0x1f307f);});}function sendServiceMail(_0xfec7b9){return db[_0x3640('0x1d')][_0x3640('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x3640('0x14'),_0x3640('0x1f')],'include':[{'model':db['MailServerOut'],'as':_0x3640('0x20')}]})[_0x3640('0xd')](function(_0xa2de9a){if(!_0xa2de9a){throw new Error(_0x3640('0x21'));}var _0x476a46={'tls':{'rejectUnauthorized':![]}};if(_0xa2de9a[_0x3640('0x20')][_0x3640('0x22')]){_0x476a46[_0x3640('0x22')]=_0xa2de9a[_0x3640('0x20')]['service'];}else{_0x476a46['host']=_0xa2de9a[_0x3640('0x20')][_0x3640('0x23')];_0x476a46[_0x3640('0x24')]=_0xa2de9a[_0x3640('0x20')][_0x3640('0x24')];_0x476a46['secure']=_0xa2de9a[_0x3640('0x20')][_0x3640('0x25')];}if(_0xa2de9a['Smtp'][_0x3640('0x26')]){_0x476a46['auth']={'user':_0xa2de9a[_0x3640('0x20')][_0x3640('0x12')],'pass':_0xa2de9a['Smtp'][_0x3640('0x27')]};}var _0x355d68={'account':_0x476a46,'message':_['merge']({'from':util[_0x3640('0x28')]('\x22%s\x22\x20<%s>',_0xa2de9a[_0x3640('0x14')],_0xa2de9a[_0x3640('0x1f')]||_0xa2de9a[_0x3640('0x20')][_0x3640('0x12')])},_0xfec7b9)};return client['request'](_0x3640('0x29'),_0x355d68);})[_0x3640('0xd')](function(_0x90cf36){if(_0x90cf36[_0x3640('0x2a')]){throw new Error(util[_0x3640('0x28')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x90cf36[_0x3640('0x2a')]['message']||JSON[_0x3640('0x2b')](_0x90cf36['error'])));}return!![];});}function handleError(_0x4fdf56,_0x1ba96d,_0x2b975f){return _0x4fdf56['status'](_0x1ba96d||0x1f4)['send']({'message':_0x2b975f?_0x2b975f[_0x3640('0x2c')]||_0x2b975f:''});}exports[_0x3640('0x2d')]=function(_0x19bf95,_0x52ede4,_0x47c897){passport[_0x3640('0x2e')]('local-login',function(_0x5bc006,_0x479705,_0x42e1a2){var _0x2d6418=_0x5bc006||_0x42e1a2;if(_0x2d6418){return handleError(_0x52ede4,0x191,_0x2d6418);}if(!_0x479705){return handleError(_0x52ede4,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x4a2368={'payload':{'id':_0x479705['id'],'role':_0x479705[_0x3640('0xf')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x4a2368)['then'](function(_0x489f3d){_0x52ede4['json']({'id':_0x479705['id'],'token':_0x489f3d,'statusCall':'','isAlreadyLogged':_0x479705['online']});});}})(_0x19bf95,_0x52ede4,_0x47c897);};exports['forgot']=function(_0x292fdf,_0x275652,_0x5a76f9){if(!_0x292fdf[_0x3640('0x2f')]['email']){return handleError(_0x275652,0x1f4,{'message':_0x3640('0x30')});}var _0x19bb22=rs['generate']();_0x292fdf[_0x3640('0x2f')][_0x3640('0x1f')]=_0x292fdf[_0x3640('0x2f')][_0x3640('0x1f')][_0x3640('0x31')]()[_0x3640('0x32')]();var _0x494e99;return db[_0x3640('0x9')][_0x3640('0xa')]({'where':{'id':0x1},'attributes':[_0x3640('0xb'),_0x3640('0xc')],'raw':!![]})[_0x3640('0xd')](function(_0xdace8e){_0x494e99=_0xdace8e;return db[_0x3640('0x33')][_0x3640('0x1e')]({'where':{'email':_0x292fdf[_0x3640('0x2f')][_0x3640('0x1f')]}});})[_0x3640('0xd')](function(_0xb26788){if(!_0xb26788){throw new Error(_0x3640('0x34'));}if(_0xb26788[_0x3640('0x10')]){throw new Error(_0x3640('0x35'));}if(_0xb26788[_0x3640('0x17')]){if(moment(_0xb26788[_0x3640('0x11')])['add'](_0x494e99['blockDuration'],_0x3640('0x1a'))>moment()){throw new Error(_0x3640('0x36'));}else{_0xb26788[_0x3640('0x17')]=![];_0xb26788['blockedAt']=null;}}_0xb26788[_0x3640('0x37')]=_0x19bb22;_0xb26788[_0x3640('0x38')]=Date[_0x3640('0x39')]()+0x36ee80;return _0xb26788[_0x3640('0x3a')]();})['then'](function(){return sendServiceMail({'to':_0x292fdf[_0x3640('0x2f')][_0x3640('0x1f')],'subject':_0x3640('0x3b'),'text':_0x3640('0x3c')+_0x3640('0x3d')+_0x3640('0x3e')+_0x292fdf['headers']['host']+_0x3640('0x3f')+_0x19bb22+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})['then'](function(){_0x275652['status'](0xc8)[_0x3640('0x40')]({'message':_0x3640('0x41')});})['catch'](function(_0x539acd){return handleError(_0x275652,0x1f4,_0x539acd);});};exports[_0x3640('0x42')]=function(_0x48be2e,_0x43ff2d,_0xd708e0){return db[_0x3640('0x33')][_0x3640('0x1e')]({'where':{'resetPasswordToken':_0x48be2e[_0x3640('0x43')][_0x3640('0x44')],'resetPasswordExpires':{'$gt':Date[_0x3640('0x39')]()}}})[_0x3640('0xd')](function(_0x3e1a71){if(!_0x3e1a71){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x3640('0x9')][_0x3640('0xa')]({'attributes':['id',_0x3640('0x45'),_0x3640('0x46'),_0x3640('0x47')]})[_0x3640('0xd')](function(_0x157b9f){if(_0x157b9f[_0x3640('0x45')])authService[_0x3640('0x48')](_0x48be2e[_0x3640('0x2f')]['password']);if(!_0x157b9f[_0x3640('0x46')]||!_0x3e1a71[_0x3640('0x49')])return _0x3e1a71;authService['validatePasswordHistory'](_0x48be2e[_0x3640('0x2f')][_0x3640('0x4a')],_0x3e1a71[_0x3640('0x49')],_0x157b9f['passwordHistoryLimit']);return _0x3e1a71;})['then'](function(){_0x3e1a71[_0x3640('0x4a')]=_0x48be2e[_0x3640('0x2f')][_0x3640('0x4a')];_0x3e1a71[_0x3640('0x37')]=null;_0x3e1a71[_0x3640('0x38')]=null;return _0x3e1a71[_0x3640('0x3a')]();});})['then'](function(){_0x43ff2d[_0x3640('0x4b')](0xc8)[_0x3640('0x40')]({'message':_0x3640('0x4c')});})[_0x3640('0x1c')](function(_0x109c31){return handleError(_0x43ff2d,0x1f4,_0x109c31);});};passport[_0x3640('0x4d')](_0x3640('0x4e'),new LocalStrategy({'usernameField':_0x3640('0x14'),'passwordField':'password'},function(_0x5e3418,_0x3f7ef0,_0x2ac1bc){return localAuthenticate(db[_0x3640('0x33')],_0x5e3418,_0x3f7ef0,_0x2ac1bc);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 158c697..9d0e615 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 _0xf455=['express','Router','./authLocal.controller','post','forgot','/reset/:token','reset'];(function(_0x358162,_0x449f5e){var _0x1c15e9=function(_0x8554b1){while(--_0x8554b1){_0x358162['push'](_0x358162['shift']());}};_0x1c15e9(++_0x449f5e);}(_0xf455,0x1b2));var _0x5f45=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf455[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x5f45('0x0'));var router=express[_0x5f45('0x1')]();var controller=require(_0x5f45('0x2'));router[_0x5f45('0x3')]('/',controller['login']);router[_0x5f45('0x3')]('/forgot',controller[_0x5f45('0x4')]);router[_0x5f45('0x3')](_0x5f45('0x5'),controller[_0x5f45('0x6')]);module['exports']=router;
\ No newline at end of file
+var _0xeba4=['/reset/:token','reset','exports','express','Router','./authLocal.controller','post','login','forgot'];(function(_0x30f73d,_0x5387af){var _0x20b23d=function(_0x387c1b){while(--_0x387c1b){_0x30f73d['push'](_0x30f73d['shift']());}};_0x20b23d(++_0x5387af);}(_0xeba4,0xc0));var _0x4eba=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0xeba4[_0x3fba9f];return _0x192cf1;};'use strict';var express=require(_0x4eba('0x0'));var router=express[_0x4eba('0x1')]();var controller=require(_0x4eba('0x2'));router[_0x4eba('0x3')]('/',controller[_0x4eba('0x4')]);router['post']('/forgot',controller[_0x4eba('0x5')]);router[_0x4eba('0x3')](_0x4eba('0x6'),controller[_0x4eba('0x7')]);module[_0x4eba('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 05c4d6e..0621020 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 _0xa8c3=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xa8c3,0x16b));var _0x3a8c=function(_0x72a33d,_0x5691da){_0x72a33d=_0x72a33d-0x0;var _0x2621d5=_0xa8c3[_0x72a33d];return _0x2621d5;};'use strict';var Sequelize=require(_0x3a8c('0x0'));module[_0x3a8c('0x1')]={'name':{'type':Sequelize[_0x3a8c('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x3a8c('0x2')]},'description':{'type':Sequelize[_0x3a8c('0x2')]},'status':{'type':Sequelize[_0x3a8c('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x3a8c('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xa9c0=['INTEGER','sequelize','exports','STRING'];(function(_0x5ca79e,_0x185d0e){var _0x8d5177=function(_0x19f16c){while(--_0x19f16c){_0x5ca79e['push'](_0x5ca79e['shift']());}};_0x8d5177(++_0x185d0e);}(_0xa9c0,0x1a9));var _0x0a9c=function(_0x9e1f67,_0x1d30c1){_0x9e1f67=_0x9e1f67-0x0;var _0x8a177d=_0xa9c0[_0x9e1f67];return _0x8a177d;};'use strict';var Sequelize=require(_0x0a9c('0x0'));module[_0x0a9c('0x1')]={'name':{'type':Sequelize[_0x0a9c('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x0a9c('0x2')]},'description':{'type':Sequelize[_0x0a9c('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x0a9c('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 b664a5e..d7acc8a 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 _0x7f02=['attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','catch','body','destroy','addConditions','Condition','ids','omit','getConditions','length','order','addActions','Action','getActions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','update','then','stack','name','send','index','Automation','rawAttributes','fieldName','type','model','keys','query'];(function(_0x4e9751,_0x1dd051){var _0x39186f=function(_0x4e76ff){while(--_0x4e76ff){_0x4e9751['push'](_0x4e9751['shift']());}};_0x39186f(++_0x1dd051);}(_0x7f02,0x77));var _0x27f0=function(_0x570294,_0x139ae4){_0x570294=_0x570294-0x0;var _0x41b542=_0x7f02[_0x570294];return _0x41b542;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x27f0('0x0'));var zipdir=require(_0x27f0('0x1'));var jsonpatch=require(_0x27f0('0x2'));var rp=require(_0x27f0('0x3'));var moment=require(_0x27f0('0x4'));var BPromise=require(_0x27f0('0x5'));var Mustache=require(_0x27f0('0x6'));var util=require(_0x27f0('0x7'));var path=require('path');var sox=require(_0x27f0('0x8'));var csv=require(_0x27f0('0x9'));var ejs=require(_0x27f0('0xa'));var fs=require('fs');var fs_extra=require(_0x27f0('0xb'));var _=require(_0x27f0('0xc'));var squel=require(_0x27f0('0xd'));var crypto=require(_0x27f0('0xe'));var jsforce=require(_0x27f0('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x27f0('0x10'));var Papa=require(_0x27f0('0x11'));var Redis=require(_0x27f0('0x12'));var authService=require(_0x27f0('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x27f0('0x14'));var hardwareService=require(_0x27f0('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x27f0('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x27f0('0x17'));var db=require(_0x27f0('0x18'))['db'];function respondWithStatusCode(_0x2d1c01,_0x5beeb4){_0x5beeb4=_0x5beeb4||0xcc;return function(_0x56c865){if(_0x56c865){return _0x2d1c01[_0x27f0('0x19')](_0x5beeb4);}return _0x2d1c01[_0x27f0('0x1a')](_0x5beeb4)['end']();};}function respondWithResult(_0x2502db,_0x4a7fdf){_0x4a7fdf=_0x4a7fdf||0xc8;return function(_0x35c4d2){if(_0x35c4d2){return _0x2502db[_0x27f0('0x1a')](_0x4a7fdf)[_0x27f0('0x1b')](_0x35c4d2);}};}function respondWithFilteredResult(_0x95b028,_0x2906bf){return function(_0x47b5a7){if(_0x47b5a7){var _0xe584e4=typeof _0x2906bf['offset']==='undefined'&&typeof _0x2906bf[_0x27f0('0x1c')]===_0x27f0('0x1d');var _0x4d0cad=_0x47b5a7[_0x27f0('0x1e')];var _0x3f7aec=_0xe584e4?0x0:_0x2906bf[_0x27f0('0x1f')];var _0x3fc8cb=_0xe584e4?_0x47b5a7['count']:_0x2906bf[_0x27f0('0x1f')]+_0x2906bf[_0x27f0('0x1c')];var _0x90ea75;if(_0x3fc8cb>=_0x4d0cad){_0x3fc8cb=_0x4d0cad;_0x90ea75=0xc8;}else{_0x90ea75=0xce;}_0x95b028[_0x27f0('0x1a')](_0x90ea75);return _0x95b028[_0x27f0('0x20')](_0x27f0('0x21'),_0x3f7aec+'-'+_0x3fc8cb+'/'+_0x4d0cad)['json'](_0x47b5a7);}return null;};}function patchUpdates(_0x3f2889){return function(_0x27322c){try{jsonpatch[_0x27f0('0x22')](_0x27322c,_0x3f2889,!![]);}catch(_0x3f97be){return BPromise[_0x27f0('0x23')](_0x3f97be);}return _0x27322c['save']();};}function saveUpdates(_0x94115a,_0x58c1f9){return function(_0x24c0cd){if(_0x24c0cd){return _0x24c0cd[_0x27f0('0x24')](_0x94115a)[_0x27f0('0x25')](function(_0x3f7fa6){return _0x3f7fa6;});}return null;};}function removeEntity(_0x34412f,_0x237802){return function(_0x3dd623){if(_0x3dd623){return _0x3dd623['destroy']()['then'](function(){_0x34412f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1cb62b,_0xa9b66b){return function(_0x7baae5){if(!_0x7baae5){_0x1cb62b[_0x27f0('0x19')](0x194);}return _0x7baae5;};}function handleError(_0x3ec842,_0x3d605e){_0x3d605e=_0x3d605e||0x1f4;return function(_0x8ed955){logger['error'](_0x8ed955[_0x27f0('0x26')]);if(_0x8ed955[_0x27f0('0x27')]){delete _0x8ed955[_0x27f0('0x27')];}_0x3ec842[_0x27f0('0x1a')](_0x3d605e)[_0x27f0('0x28')](_0x8ed955);};}exports[_0x27f0('0x29')]=function(_0x373a86,_0x7d32fb){var _0x408733={},_0x5aba17={},_0x3a78fb={'count':0x0,'rows':[]};var _0x2dcef8=_['map'](db[_0x27f0('0x2a')][_0x27f0('0x2b')],function(_0x1081ac){return{'name':_0x1081ac[_0x27f0('0x2c')],'type':_0x1081ac[_0x27f0('0x2d')]['key']};});_0x5aba17[_0x27f0('0x2e')]=_['map'](_0x2dcef8,_0x27f0('0x27'));_0x5aba17['query']=_[_0x27f0('0x2f')](_0x373a86[_0x27f0('0x30')]);_0x5aba17['filters']=_['intersection'](_0x5aba17['model'],_0x5aba17['query']);_0x408733[_0x27f0('0x31')]=_[_0x27f0('0x32')](_0x5aba17['model'],qs[_0x27f0('0x33')](_0x373a86[_0x27f0('0x30')][_0x27f0('0x33')]));_0x408733[_0x27f0('0x31')]=_0x408733[_0x27f0('0x31')]['length']?_0x408733['attributes']:_0x5aba17[_0x27f0('0x2e')];if(!_0x373a86[_0x27f0('0x30')][_0x27f0('0x34')](_0x27f0('0x35'))){_0x408733[_0x27f0('0x1c')]=qs['limit'](_0x373a86[_0x27f0('0x30')][_0x27f0('0x1c')]);_0x408733[_0x27f0('0x1f')]=qs[_0x27f0('0x1f')](_0x373a86['query'][_0x27f0('0x1f')]);}_0x408733['order']=qs[_0x27f0('0x36')](_0x373a86['query']['sort']);_0x408733[_0x27f0('0x37')]=qs[_0x27f0('0x38')](_[_0x27f0('0x39')](_0x373a86['query'],_0x5aba17['filters']),_0x2dcef8);if(_0x373a86[_0x27f0('0x30')][_0x27f0('0x3a')]){_0x408733[_0x27f0('0x37')]=_[_0x27f0('0x3b')](_0x408733[_0x27f0('0x37')],{'$or':_[_0x27f0('0x3c')](_0x2dcef8,function(_0x5ea7db){if(_0x5ea7db[_0x27f0('0x2d')]!==_0x27f0('0x3d')){var _0x5cdef5={};_0x5cdef5[_0x5ea7db[_0x27f0('0x27')]]={'$like':'%'+_0x373a86[_0x27f0('0x30')][_0x27f0('0x3a')]+'%'};return _0x5cdef5;}})});}_0x408733=_[_0x27f0('0x3b')]({},_0x408733,_0x373a86[_0x27f0('0x3e')]);var _0x1d16c9={'where':_0x408733[_0x27f0('0x37')]};return db[_0x27f0('0x2a')][_0x27f0('0x1e')](_0x1d16c9)[_0x27f0('0x25')](function(_0x2e931c){_0x3a78fb[_0x27f0('0x1e')]=_0x2e931c;if(_0x373a86[_0x27f0('0x30')][_0x27f0('0x3f')]){_0x408733[_0x27f0('0x40')]=[{'all':!![]}];}return db[_0x27f0('0x2a')][_0x27f0('0x41')](_0x408733);})['then'](function(_0x289739){_0x3a78fb[_0x27f0('0x42')]=_0x289739;return _0x3a78fb;})['then'](respondWithFilteredResult(_0x7d32fb,_0x408733))['catch'](handleError(_0x7d32fb,null));};exports[_0x27f0('0x43')]=function(_0x7346ab,_0x4c7010){var _0x32b3cd={'raw':![],'where':{'id':_0x7346ab[_0x27f0('0x44')]['id']}},_0x341691={};_0x341691['model']=_[_0x27f0('0x2f')](db['Automation'][_0x27f0('0x2b')]);_0x341691[_0x27f0('0x30')]=_[_0x27f0('0x2f')](_0x7346ab['query']);_0x341691[_0x27f0('0x38')]=_[_0x27f0('0x32')](_0x341691[_0x27f0('0x2e')],_0x341691[_0x27f0('0x30')]);_0x32b3cd[_0x27f0('0x31')]=_[_0x27f0('0x32')](_0x341691[_0x27f0('0x2e')],qs[_0x27f0('0x33')](_0x7346ab['query'][_0x27f0('0x33')]));_0x32b3cd[_0x27f0('0x31')]=_0x32b3cd['attributes']['length']?_0x32b3cd[_0x27f0('0x31')]:_0x341691[_0x27f0('0x2e')];if(_0x7346ab[_0x27f0('0x30')]['includeAll']){_0x32b3cd['include']=[{'all':!![]}];}_0x32b3cd=_[_0x27f0('0x3b')]({},_0x32b3cd,_0x7346ab[_0x27f0('0x3e')]);return db[_0x27f0('0x2a')][_0x27f0('0x45')](_0x32b3cd)['then'](handleEntityNotFound(_0x4c7010,null))['then'](respondWithResult(_0x4c7010,null))['catch'](handleError(_0x4c7010,null));};exports[_0x27f0('0x46')]=function(_0x8f5e25,_0x5c807a){return db[_0x27f0('0x2a')]['create'](_0x8f5e25['body'],{})[_0x27f0('0x25')](respondWithResult(_0x5c807a,0xc9))[_0x27f0('0x47')](handleError(_0x5c807a,null));};exports[_0x27f0('0x24')]=function(_0x402b14,_0x167ca6){if(_0x402b14[_0x27f0('0x48')]['id']){delete _0x402b14[_0x27f0('0x48')]['id'];}return db[_0x27f0('0x2a')][_0x27f0('0x45')]({'where':{'id':_0x402b14[_0x27f0('0x44')]['id']}})[_0x27f0('0x25')](handleEntityNotFound(_0x167ca6,null))[_0x27f0('0x25')](saveUpdates(_0x402b14['body'],null))[_0x27f0('0x25')](respondWithResult(_0x167ca6,null))[_0x27f0('0x47')](handleError(_0x167ca6,null));};exports[_0x27f0('0x49')]=function(_0x22dc1e,_0x5efeb3){return db[_0x27f0('0x2a')][_0x27f0('0x45')]({'where':{'id':_0x22dc1e[_0x27f0('0x44')]['id']}})[_0x27f0('0x25')](handleEntityNotFound(_0x5efeb3,null))[_0x27f0('0x25')](removeEntity(_0x5efeb3,null))[_0x27f0('0x47')](handleError(_0x5efeb3,null));};exports[_0x27f0('0x4a')]=function(_0x5dc3ee,_0x51b19d,_0x3481bc){return db[_0x27f0('0x4b')][_0x27f0('0x45')]({'where':{'id':_0x5dc3ee[_0x27f0('0x44')]['id']}})[_0x27f0('0x25')](handleEntityNotFound(_0x51b19d,null))['then'](function(_0x538ae1){if(_0x538ae1){return _0x538ae1[_0x27f0('0x4a')](_0x5dc3ee[_0x27f0('0x48')][_0x27f0('0x4c')],_[_0x27f0('0x4d')](_0x5dc3ee[_0x27f0('0x48')],[_0x27f0('0x4c'),'id'])||{});}})[_0x27f0('0x25')](respondWithResult(_0x51b19d,null))[_0x27f0('0x47')](handleError(_0x51b19d,null));};exports[_0x27f0('0x4e')]=function(_0xba1138,_0x406154,_0x7c33c3){var _0x328a91={};var _0x206a95={};var _0x343c5f;var _0x1f69e3;return db[_0x27f0('0x2a')]['findOne']({'where':{'id':_0xba1138[_0x27f0('0x44')]['id']}})[_0x27f0('0x25')](handleEntityNotFound(_0x406154,null))['then'](function(_0x1e5fa9){if(_0x1e5fa9){_0x343c5f=_0x1e5fa9;_0x206a95['model']=_['keys'](db['Condition']['rawAttributes']);_0x206a95[_0x27f0('0x30')]=_[_0x27f0('0x2f')](_0xba1138[_0x27f0('0x30')]);_0x206a95[_0x27f0('0x38')]=_[_0x27f0('0x32')](_0x206a95[_0x27f0('0x2e')],_0x206a95[_0x27f0('0x30')]);_0x328a91[_0x27f0('0x31')]=_['intersection'](_0x206a95[_0x27f0('0x2e')],qs['fields'](_0xba1138[_0x27f0('0x30')][_0x27f0('0x33')]));_0x328a91[_0x27f0('0x31')]=_0x328a91[_0x27f0('0x31')][_0x27f0('0x4f')]?_0x328a91['attributes']:_0x206a95[_0x27f0('0x2e')];_0x328a91[_0x27f0('0x50')]=qs[_0x27f0('0x36')](_0xba1138[_0x27f0('0x30')][_0x27f0('0x36')]);_0x328a91[_0x27f0('0x37')]=qs[_0x27f0('0x38')](_[_0x27f0('0x39')](_0xba1138[_0x27f0('0x30')],_0x206a95['filters']));if(_0xba1138[_0x27f0('0x30')]['filter']){_0x328a91['where']=_[_0x27f0('0x3b')](_0x328a91['where'],{'$or':_[_0x27f0('0x3c')](_0x328a91[_0x27f0('0x31')],function(_0x46d8dd){var _0x1b0c23={};_0x1b0c23[_0x46d8dd]={'$like':'%'+_0xba1138[_0x27f0('0x30')]['filter']+'%'};return _0x1b0c23;})});}_0x328a91=_['merge']({},_0x328a91,_0xba1138[_0x27f0('0x3e')]);return _0x343c5f[_0x27f0('0x4e')](_0x328a91);}})[_0x27f0('0x25')](function(_0x444787){if(_0x444787){_0x1f69e3=_0x444787['length'];if(!_0xba1138['query'][_0x27f0('0x34')](_0x27f0('0x35'))){_0x328a91['limit']=qs[_0x27f0('0x1c')](_0xba1138[_0x27f0('0x30')][_0x27f0('0x1c')]);_0x328a91['offset']=qs['offset'](_0xba1138['query'][_0x27f0('0x1f')]);}return _0x343c5f[_0x27f0('0x4e')](_0x328a91);}})[_0x27f0('0x25')](function(_0xacdd67){if(_0xacdd67){return _0xacdd67?{'count':_0x1f69e3,'rows':_0xacdd67}:null;}})['then'](respondWithResult(_0x406154,null))[_0x27f0('0x47')](handleError(_0x406154,null));};exports[_0x27f0('0x51')]=function(_0x1e48fa,_0x14272b,_0x4b598c){return db[_0x27f0('0x52')][_0x27f0('0x45')]({'where':{'id':_0x1e48fa[_0x27f0('0x44')]['id']}})[_0x27f0('0x25')](handleEntityNotFound(_0x14272b,null))['then'](function(_0xccc41d){if(_0xccc41d){return _0xccc41d['addActions'](_0x1e48fa[_0x27f0('0x48')][_0x27f0('0x4c')],_['omit'](_0x1e48fa[_0x27f0('0x48')],[_0x27f0('0x4c'),'id'])||{});}})[_0x27f0('0x25')](respondWithResult(_0x14272b,null))[_0x27f0('0x47')](handleError(_0x14272b,null));};exports[_0x27f0('0x53')]=function(_0x1784ab,_0x31ae30,_0x8886c){var _0x32d332={};var _0x5c7c2b={};var _0x549126;var _0x223d37;return db[_0x27f0('0x2a')]['findOne']({'where':{'id':_0x1784ab[_0x27f0('0x44')]['id']}})['then'](handleEntityNotFound(_0x31ae30,null))[_0x27f0('0x25')](function(_0x47d733){if(_0x47d733){_0x549126=_0x47d733;_0x5c7c2b[_0x27f0('0x2e')]=_[_0x27f0('0x2f')](db['Action'][_0x27f0('0x2b')]);_0x5c7c2b[_0x27f0('0x30')]=_[_0x27f0('0x2f')](_0x1784ab[_0x27f0('0x30')]);_0x5c7c2b['filters']=_[_0x27f0('0x32')](_0x5c7c2b[_0x27f0('0x2e')],_0x5c7c2b[_0x27f0('0x30')]);_0x32d332[_0x27f0('0x31')]=_['intersection'](_0x5c7c2b[_0x27f0('0x2e')],qs[_0x27f0('0x33')](_0x1784ab[_0x27f0('0x30')][_0x27f0('0x33')]));_0x32d332['attributes']=_0x32d332['attributes']['length']?_0x32d332[_0x27f0('0x31')]:_0x5c7c2b[_0x27f0('0x2e')];_0x32d332[_0x27f0('0x50')]=qs[_0x27f0('0x36')](_0x1784ab[_0x27f0('0x30')][_0x27f0('0x36')]);_0x32d332[_0x27f0('0x37')]=qs[_0x27f0('0x38')](_[_0x27f0('0x39')](_0x1784ab['query'],_0x5c7c2b['filters']));if(_0x1784ab[_0x27f0('0x30')]['filter']){_0x32d332['where']=_['merge'](_0x32d332[_0x27f0('0x37')],{'$or':_['map'](_0x32d332[_0x27f0('0x31')],function(_0x1db23f){var _0x43eb5d={};_0x43eb5d[_0x1db23f]={'$like':'%'+_0x1784ab['query'][_0x27f0('0x3a')]+'%'};return _0x43eb5d;})});}_0x32d332=_['merge']({},_0x32d332,_0x1784ab['options']);return _0x549126[_0x27f0('0x53')](_0x32d332);}})[_0x27f0('0x25')](function(_0x4bd858){if(_0x4bd858){_0x223d37=_0x4bd858[_0x27f0('0x4f')];if(!_0x1784ab[_0x27f0('0x30')][_0x27f0('0x34')](_0x27f0('0x35'))){_0x32d332[_0x27f0('0x1c')]=qs['limit'](_0x1784ab['query'][_0x27f0('0x1c')]);_0x32d332[_0x27f0('0x1f')]=qs[_0x27f0('0x1f')](_0x1784ab[_0x27f0('0x30')][_0x27f0('0x1f')]);}return _0x549126[_0x27f0('0x53')](_0x32d332);}})[_0x27f0('0x25')](function(_0x5f56ac){if(_0x5f56ac){return _0x5f56ac?{'count':_0x223d37,'rows':_0x5f56ac}:null;}})[_0x27f0('0x25')](respondWithResult(_0x31ae30,null))[_0x27f0('0x47')](handleError(_0x31ae30,null));};
\ No newline at end of file
+var _0xcd70=['end','error','name','send','index','map','Automation','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','then','rows','catch','params','find','create','body','omit','ids','getConditions','findOne','Condition','rawAttributes','addActions','getActions','Action','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy'];(function(_0x57104f,_0x15879c){var _0x234152=function(_0x4b0a79){while(--_0x4b0a79){_0x57104f['push'](_0x57104f['shift']());}};_0x234152(++_0x15879c);}(_0xcd70,0x1c2));var _0x0cd7=function(_0x817d9b,_0x3c37e3){_0x817d9b=_0x817d9b-0x0;var _0x2752e1=_0xcd70[_0x817d9b];return _0x2752e1;};'use strict';var emlformat=require(_0x0cd7('0x0'));var rimraf=require(_0x0cd7('0x1'));var zipdir=require(_0x0cd7('0x2'));var jsonpatch=require(_0x0cd7('0x3'));var rp=require(_0x0cd7('0x4'));var moment=require(_0x0cd7('0x5'));var BPromise=require(_0x0cd7('0x6'));var Mustache=require(_0x0cd7('0x7'));var util=require(_0x0cd7('0x8'));var path=require(_0x0cd7('0x9'));var sox=require(_0x0cd7('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0cd7('0xb'));var _=require(_0x0cd7('0xc'));var squel=require(_0x0cd7('0xd'));var crypto=require(_0x0cd7('0xe'));var jsforce=require(_0x0cd7('0xf'));var deskjs=require(_0x0cd7('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0cd7('0x11'));var Redis=require(_0x0cd7('0x12'));var authService=require(_0x0cd7('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0cd7('0x14'));var hardwareService=require(_0x0cd7('0x15'));var logger=require(_0x0cd7('0x16'))('api');var utils=require(_0x0cd7('0x17'));var config=require(_0x0cd7('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e4019,_0x440a9e){_0x440a9e=_0x440a9e||0xcc;return function(_0x73d96b){if(_0x73d96b){return _0x1e4019[_0x0cd7('0x19')](_0x440a9e);}return _0x1e4019[_0x0cd7('0x1a')](_0x440a9e)['end']();};}function respondWithResult(_0x5319e9,_0x5d7ee0){_0x5d7ee0=_0x5d7ee0||0xc8;return function(_0x1a63b8){if(_0x1a63b8){return _0x5319e9[_0x0cd7('0x1a')](_0x5d7ee0)[_0x0cd7('0x1b')](_0x1a63b8);}};}function respondWithFilteredResult(_0x22c3fe,_0x2207c5){return function(_0x19834f){if(_0x19834f){var _0x2c0698=typeof _0x2207c5[_0x0cd7('0x1c')]===_0x0cd7('0x1d')&&typeof _0x2207c5[_0x0cd7('0x1e')]==='undefined';var _0xacb65e=_0x19834f['count'];var _0x526141=_0x2c0698?0x0:_0x2207c5['offset'];var _0x3c69e0=_0x2c0698?_0x19834f[_0x0cd7('0x1f')]:_0x2207c5[_0x0cd7('0x1c')]+_0x2207c5['limit'];var _0x3e1e06;if(_0x3c69e0>=_0xacb65e){_0x3c69e0=_0xacb65e;_0x3e1e06=0xc8;}else{_0x3e1e06=0xce;}_0x22c3fe[_0x0cd7('0x1a')](_0x3e1e06);return _0x22c3fe[_0x0cd7('0x20')](_0x0cd7('0x21'),_0x526141+'-'+_0x3c69e0+'/'+_0xacb65e)['json'](_0x19834f);}return null;};}function patchUpdates(_0x23a2d0){return function(_0x4c5db4){try{jsonpatch['apply'](_0x4c5db4,_0x23a2d0,!![]);}catch(_0x4e91c0){return BPromise['reject'](_0x4e91c0);}return _0x4c5db4['save']();};}function saveUpdates(_0x2b0e11,_0x4138eb){return function(_0x30942a){if(_0x30942a){return _0x30942a[_0x0cd7('0x22')](_0x2b0e11)['then'](function(_0x3c3d6a){return _0x3c3d6a;});}return null;};}function removeEntity(_0x59de24,_0x16881d){return function(_0x2fc374){if(_0x2fc374){return _0x2fc374[_0x0cd7('0x23')]()['then'](function(){_0x59de24[_0x0cd7('0x1a')](0xcc)[_0x0cd7('0x24')]();});}};}function handleEntityNotFound(_0x4728c7,_0x235eee){return function(_0x1d6f8c){if(!_0x1d6f8c){_0x4728c7['sendStatus'](0x194);}return _0x1d6f8c;};}function handleError(_0x39f79e,_0x285f79){_0x285f79=_0x285f79||0x1f4;return function(_0x350f23){logger[_0x0cd7('0x25')](_0x350f23['stack']);if(_0x350f23['name']){delete _0x350f23[_0x0cd7('0x26')];}_0x39f79e[_0x0cd7('0x1a')](_0x285f79)[_0x0cd7('0x27')](_0x350f23);};}exports[_0x0cd7('0x28')]=function(_0x325717,_0x1d81ca){var _0x65fea0={},_0x2da9e2={},_0x3219aa={'count':0x0,'rows':[]};var _0x57d59a=_[_0x0cd7('0x29')](db[_0x0cd7('0x2a')]['rawAttributes'],function(_0x4e61dc){return{'name':_0x4e61dc[_0x0cd7('0x2b')],'type':_0x4e61dc[_0x0cd7('0x2c')]['key']};});_0x2da9e2[_0x0cd7('0x2d')]=_[_0x0cd7('0x29')](_0x57d59a,_0x0cd7('0x26'));_0x2da9e2[_0x0cd7('0x2e')]=_[_0x0cd7('0x2f')](_0x325717[_0x0cd7('0x2e')]);_0x2da9e2[_0x0cd7('0x30')]=_['intersection'](_0x2da9e2[_0x0cd7('0x2d')],_0x2da9e2[_0x0cd7('0x2e')]);_0x65fea0[_0x0cd7('0x31')]=_[_0x0cd7('0x32')](_0x2da9e2[_0x0cd7('0x2d')],qs[_0x0cd7('0x33')](_0x325717[_0x0cd7('0x2e')]['fields']));_0x65fea0[_0x0cd7('0x31')]=_0x65fea0[_0x0cd7('0x31')][_0x0cd7('0x34')]?_0x65fea0['attributes']:_0x2da9e2[_0x0cd7('0x2d')];if(!_0x325717[_0x0cd7('0x2e')][_0x0cd7('0x35')](_0x0cd7('0x36'))){_0x65fea0['limit']=qs['limit'](_0x325717[_0x0cd7('0x2e')][_0x0cd7('0x1e')]);_0x65fea0[_0x0cd7('0x1c')]=qs[_0x0cd7('0x1c')](_0x325717['query']['offset']);}_0x65fea0[_0x0cd7('0x37')]=qs[_0x0cd7('0x38')](_0x325717['query']['sort']);_0x65fea0[_0x0cd7('0x39')]=qs[_0x0cd7('0x30')](_[_0x0cd7('0x3a')](_0x325717['query'],_0x2da9e2['filters']),_0x57d59a);if(_0x325717[_0x0cd7('0x2e')][_0x0cd7('0x3b')]){_0x65fea0['where']=_[_0x0cd7('0x3c')](_0x65fea0[_0x0cd7('0x39')],{'$or':_['map'](_0x57d59a,function(_0x2a43df){if(_0x2a43df['type']!==_0x0cd7('0x3d')){var _0x133b9d={};_0x133b9d[_0x2a43df[_0x0cd7('0x26')]]={'$like':'%'+_0x325717[_0x0cd7('0x2e')][_0x0cd7('0x3b')]+'%'};return _0x133b9d;}})});}_0x65fea0=_['merge']({},_0x65fea0,_0x325717[_0x0cd7('0x3e')]);var _0x2a355f={'where':_0x65fea0[_0x0cd7('0x39')]};return db['Automation']['count'](_0x2a355f)['then'](function(_0x3b61be){_0x3219aa[_0x0cd7('0x1f')]=_0x3b61be;if(_0x325717['query'][_0x0cd7('0x3f')]){_0x65fea0[_0x0cd7('0x40')]=[{'all':!![]}];}return db[_0x0cd7('0x2a')]['findAll'](_0x65fea0);})[_0x0cd7('0x41')](function(_0x41b826){_0x3219aa[_0x0cd7('0x42')]=_0x41b826;return _0x3219aa;})['then'](respondWithFilteredResult(_0x1d81ca,_0x65fea0))[_0x0cd7('0x43')](handleError(_0x1d81ca,null));};exports['show']=function(_0x4b6334,_0x58c6f3){var _0x3f4a86={'raw':![],'where':{'id':_0x4b6334[_0x0cd7('0x44')]['id']}},_0x3dc960={};_0x3dc960[_0x0cd7('0x2d')]=_[_0x0cd7('0x2f')](db[_0x0cd7('0x2a')]['rawAttributes']);_0x3dc960[_0x0cd7('0x2e')]=_[_0x0cd7('0x2f')](_0x4b6334[_0x0cd7('0x2e')]);_0x3dc960[_0x0cd7('0x30')]=_['intersection'](_0x3dc960[_0x0cd7('0x2d')],_0x3dc960[_0x0cd7('0x2e')]);_0x3f4a86[_0x0cd7('0x31')]=_['intersection'](_0x3dc960[_0x0cd7('0x2d')],qs[_0x0cd7('0x33')](_0x4b6334[_0x0cd7('0x2e')]['fields']));_0x3f4a86['attributes']=_0x3f4a86[_0x0cd7('0x31')][_0x0cd7('0x34')]?_0x3f4a86['attributes']:_0x3dc960[_0x0cd7('0x2d')];if(_0x4b6334[_0x0cd7('0x2e')][_0x0cd7('0x3f')]){_0x3f4a86[_0x0cd7('0x40')]=[{'all':!![]}];}_0x3f4a86=_[_0x0cd7('0x3c')]({},_0x3f4a86,_0x4b6334['options']);return db[_0x0cd7('0x2a')][_0x0cd7('0x45')](_0x3f4a86)[_0x0cd7('0x41')](handleEntityNotFound(_0x58c6f3,null))[_0x0cd7('0x41')](respondWithResult(_0x58c6f3,null))[_0x0cd7('0x43')](handleError(_0x58c6f3,null));};exports[_0x0cd7('0x46')]=function(_0x13b9a6,_0x5a337a){return db[_0x0cd7('0x2a')][_0x0cd7('0x46')](_0x13b9a6[_0x0cd7('0x47')],{})['then'](respondWithResult(_0x5a337a,0xc9))[_0x0cd7('0x43')](handleError(_0x5a337a,null));};exports[_0x0cd7('0x22')]=function(_0x8e81cc,_0x5b6b63){if(_0x8e81cc['body']['id']){delete _0x8e81cc['body']['id'];}return db[_0x0cd7('0x2a')][_0x0cd7('0x45')]({'where':{'id':_0x8e81cc['params']['id']}})[_0x0cd7('0x41')](handleEntityNotFound(_0x5b6b63,null))[_0x0cd7('0x41')](saveUpdates(_0x8e81cc[_0x0cd7('0x47')],null))[_0x0cd7('0x41')](respondWithResult(_0x5b6b63,null))['catch'](handleError(_0x5b6b63,null));};exports['destroy']=function(_0x35eaa9,_0x26e05e){return db[_0x0cd7('0x2a')][_0x0cd7('0x45')]({'where':{'id':_0x35eaa9[_0x0cd7('0x44')]['id']}})[_0x0cd7('0x41')](handleEntityNotFound(_0x26e05e,null))[_0x0cd7('0x41')](removeEntity(_0x26e05e,null))['catch'](handleError(_0x26e05e,null));};exports['addConditions']=function(_0x2646d4,_0xea5dec,_0x303c94){return db['Condition'][_0x0cd7('0x45')]({'where':{'id':_0x2646d4[_0x0cd7('0x44')]['id']}})[_0x0cd7('0x41')](handleEntityNotFound(_0xea5dec,null))[_0x0cd7('0x41')](function(_0x13902d){if(_0x13902d){return _0x13902d['addConditions'](_0x2646d4['body']['ids'],_[_0x0cd7('0x48')](_0x2646d4[_0x0cd7('0x47')],[_0x0cd7('0x49'),'id'])||{});}})[_0x0cd7('0x41')](respondWithResult(_0xea5dec,null))['catch'](handleError(_0xea5dec,null));};exports[_0x0cd7('0x4a')]=function(_0x3683a7,_0x47d2bb,_0x407dcb){var _0x402c7c={};var _0x3b8665={};var _0x1bcec6;var _0x2823da;return db['Automation'][_0x0cd7('0x4b')]({'where':{'id':_0x3683a7[_0x0cd7('0x44')]['id']}})['then'](handleEntityNotFound(_0x47d2bb,null))[_0x0cd7('0x41')](function(_0x26138a){if(_0x26138a){_0x1bcec6=_0x26138a;_0x3b8665[_0x0cd7('0x2d')]=_[_0x0cd7('0x2f')](db[_0x0cd7('0x4c')][_0x0cd7('0x4d')]);_0x3b8665[_0x0cd7('0x2e')]=_[_0x0cd7('0x2f')](_0x3683a7[_0x0cd7('0x2e')]);_0x3b8665[_0x0cd7('0x30')]=_[_0x0cd7('0x32')](_0x3b8665[_0x0cd7('0x2d')],_0x3b8665[_0x0cd7('0x2e')]);_0x402c7c['attributes']=_['intersection'](_0x3b8665[_0x0cd7('0x2d')],qs[_0x0cd7('0x33')](_0x3683a7[_0x0cd7('0x2e')][_0x0cd7('0x33')]));_0x402c7c[_0x0cd7('0x31')]=_0x402c7c[_0x0cd7('0x31')][_0x0cd7('0x34')]?_0x402c7c[_0x0cd7('0x31')]:_0x3b8665[_0x0cd7('0x2d')];_0x402c7c['order']=qs['sort'](_0x3683a7['query'][_0x0cd7('0x38')]);_0x402c7c['where']=qs['filters'](_[_0x0cd7('0x3a')](_0x3683a7[_0x0cd7('0x2e')],_0x3b8665[_0x0cd7('0x30')]));if(_0x3683a7[_0x0cd7('0x2e')][_0x0cd7('0x3b')]){_0x402c7c[_0x0cd7('0x39')]=_[_0x0cd7('0x3c')](_0x402c7c[_0x0cd7('0x39')],{'$or':_[_0x0cd7('0x29')](_0x402c7c['attributes'],function(_0x4dc7b1){var _0x50f8e6={};_0x50f8e6[_0x4dc7b1]={'$like':'%'+_0x3683a7[_0x0cd7('0x2e')]['filter']+'%'};return _0x50f8e6;})});}_0x402c7c=_[_0x0cd7('0x3c')]({},_0x402c7c,_0x3683a7[_0x0cd7('0x3e')]);return _0x1bcec6[_0x0cd7('0x4a')](_0x402c7c);}})[_0x0cd7('0x41')](function(_0x2816b0){if(_0x2816b0){_0x2823da=_0x2816b0['length'];if(!_0x3683a7[_0x0cd7('0x2e')][_0x0cd7('0x35')](_0x0cd7('0x36'))){_0x402c7c[_0x0cd7('0x1e')]=qs['limit'](_0x3683a7[_0x0cd7('0x2e')][_0x0cd7('0x1e')]);_0x402c7c['offset']=qs[_0x0cd7('0x1c')](_0x3683a7[_0x0cd7('0x2e')]['offset']);}return _0x1bcec6[_0x0cd7('0x4a')](_0x402c7c);}})[_0x0cd7('0x41')](function(_0x112417){if(_0x112417){return _0x112417?{'count':_0x2823da,'rows':_0x112417}:null;}})[_0x0cd7('0x41')](respondWithResult(_0x47d2bb,null))[_0x0cd7('0x43')](handleError(_0x47d2bb,null));};exports[_0x0cd7('0x4e')]=function(_0x5e643f,_0x413a20,_0xb1fe20){return db['Action']['find']({'where':{'id':_0x5e643f[_0x0cd7('0x44')]['id']}})[_0x0cd7('0x41')](handleEntityNotFound(_0x413a20,null))[_0x0cd7('0x41')](function(_0x14da63){if(_0x14da63){return _0x14da63[_0x0cd7('0x4e')](_0x5e643f[_0x0cd7('0x47')][_0x0cd7('0x49')],_['omit'](_0x5e643f[_0x0cd7('0x47')],[_0x0cd7('0x49'),'id'])||{});}})[_0x0cd7('0x41')](respondWithResult(_0x413a20,null))['catch'](handleError(_0x413a20,null));};exports[_0x0cd7('0x4f')]=function(_0x391248,_0x33d7d4,_0x5be048){var _0x58162b={};var _0xf374b={};var _0x2cfb68;var _0xd1c99d;return db[_0x0cd7('0x2a')][_0x0cd7('0x4b')]({'where':{'id':_0x391248[_0x0cd7('0x44')]['id']}})[_0x0cd7('0x41')](handleEntityNotFound(_0x33d7d4,null))[_0x0cd7('0x41')](function(_0x541fff){if(_0x541fff){_0x2cfb68=_0x541fff;_0xf374b[_0x0cd7('0x2d')]=_[_0x0cd7('0x2f')](db[_0x0cd7('0x50')][_0x0cd7('0x4d')]);_0xf374b[_0x0cd7('0x2e')]=_[_0x0cd7('0x2f')](_0x391248[_0x0cd7('0x2e')]);_0xf374b[_0x0cd7('0x30')]=_[_0x0cd7('0x32')](_0xf374b[_0x0cd7('0x2d')],_0xf374b['query']);_0x58162b[_0x0cd7('0x31')]=_['intersection'](_0xf374b[_0x0cd7('0x2d')],qs[_0x0cd7('0x33')](_0x391248[_0x0cd7('0x2e')]['fields']));_0x58162b['attributes']=_0x58162b[_0x0cd7('0x31')][_0x0cd7('0x34')]?_0x58162b[_0x0cd7('0x31')]:_0xf374b[_0x0cd7('0x2d')];_0x58162b['order']=qs['sort'](_0x391248['query'][_0x0cd7('0x38')]);_0x58162b[_0x0cd7('0x39')]=qs[_0x0cd7('0x30')](_['pick'](_0x391248[_0x0cd7('0x2e')],_0xf374b[_0x0cd7('0x30')]));if(_0x391248['query']['filter']){_0x58162b[_0x0cd7('0x39')]=_[_0x0cd7('0x3c')](_0x58162b[_0x0cd7('0x39')],{'$or':_[_0x0cd7('0x29')](_0x58162b[_0x0cd7('0x31')],function(_0x348768){var _0x1211d3={};_0x1211d3[_0x348768]={'$like':'%'+_0x391248[_0x0cd7('0x2e')]['filter']+'%'};return _0x1211d3;})});}_0x58162b=_[_0x0cd7('0x3c')]({},_0x58162b,_0x391248[_0x0cd7('0x3e')]);return _0x2cfb68['getActions'](_0x58162b);}})['then'](function(_0x97fea6){if(_0x97fea6){_0xd1c99d=_0x97fea6['length'];if(!_0x391248['query'][_0x0cd7('0x35')](_0x0cd7('0x36'))){_0x58162b[_0x0cd7('0x1e')]=qs[_0x0cd7('0x1e')](_0x391248['query']['limit']);_0x58162b[_0x0cd7('0x1c')]=qs[_0x0cd7('0x1c')](_0x391248[_0x0cd7('0x2e')][_0x0cd7('0x1c')]);}return _0x2cfb68[_0x0cd7('0x4f')](_0x58162b);}})['then'](function(_0x121ac7){if(_0x121ac7){return _0x121ac7?{'count':_0xd1c99d,'rows':_0x121ac7}:null;}})[_0x0cd7('0x41')](respondWithResult(_0x33d7d4,null))['catch'](handleError(_0x33d7d4,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 13e6298..a47d8e0 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 _0x3c43=['Automation','tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define'];(function(_0x58252d,_0x2070b3){var _0x55a98c=function(_0x4a2a1e){while(--_0x4a2a1e){_0x58252d['push'](_0x58252d['shift']());}};_0x55a98c(++_0x2070b3);}(_0x3c43,0x15b));var _0x33c4=function(_0xd59cfa,_0x5c7d28){_0xd59cfa=_0xd59cfa-0x0;var _0x39fc91=_0x3c43[_0xd59cfa];return _0x39fc91;};'use strict';var _=require(_0x33c4('0x0'));var util=require(_0x33c4('0x1'));var logger=require(_0x33c4('0x2'))(_0x33c4('0x3'));var moment=require(_0x33c4('0x4'));var BPromise=require(_0x33c4('0x5'));var rp=require(_0x33c4('0x6'));var fs=require('fs');var path=require(_0x33c4('0x7'));var rimraf=require(_0x33c4('0x8'));var config=require(_0x33c4('0x9'));var attributes=require(_0x33c4('0xa'));module[_0x33c4('0xb')]=function(_0x3199ad,_0x143509){return _0x3199ad[_0x33c4('0xc')](_0x33c4('0xd'),attributes,{'tableName':_0x33c4('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x16dd=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./automation.attributes','exports','Automation','tools_automations','util','../../config/logger'];(function(_0x942780,_0x865231){var _0x2fbdd5=function(_0x32ae9b){while(--_0x32ae9b){_0x942780['push'](_0x942780['shift']());}};_0x2fbdd5(++_0x865231);}(_0x16dd,0x17e));var _0xd16d=function(_0x2ea66e,_0xafd23a){_0x2ea66e=_0x2ea66e-0x0;var _0x1d5cf6=_0x16dd[_0x2ea66e];return _0x1d5cf6;};'use strict';var _=require('lodash');var util=require(_0xd16d('0x0'));var logger=require(_0xd16d('0x1'))(_0xd16d('0x2'));var moment=require(_0xd16d('0x3'));var BPromise=require(_0xd16d('0x4'));var rp=require(_0xd16d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd16d('0x6'));var config=require(_0xd16d('0x7'));var attributes=require(_0xd16d('0x8'));module[_0xd16d('0x9')]=function(_0x5d9f39,_0x3da107){return _0x5d9f39['define'](_0xd16d('0xa'),attributes,{'tableName':_0xd16d('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 b577fdb..974ba55 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 _0xa6ea=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','Automation,\x20%s,\x20%s','Automation,\x20%s,\x20%s,\x20%s','error','message','info','request\x20sent','catch','lodash','util','moment','bluebird'];(function(_0x442792,_0x4324fd){var _0x6d8f3a=function(_0x25c381){while(--_0x25c381){_0x442792['push'](_0x442792['shift']());}};_0x6d8f3a(++_0x4324fd);}(_0xa6ea,0x122));var _0xaa6e=function(_0x74ad7c,_0x2f394c){_0x74ad7c=_0x74ad7c-0x0;var _0x4ea94f=_0xa6ea[_0x74ad7c];return _0x4ea94f;};'use strict';var _=require(_0xaa6e('0x0'));var util=require(_0xaa6e('0x1'));var moment=require(_0xaa6e('0x2'));var BPromise=require(_0xaa6e('0x3'));var rs=require(_0xaa6e('0x4'));var fs=require('fs');var Redis=require(_0xaa6e('0x5'));var db=require(_0xaa6e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xaa6e('0x7'))(_0xaa6e('0x8'));var config=require(_0xaa6e('0x9'));var jayson=require(_0xaa6e('0xa'));var client=jayson[_0xaa6e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x543fc1,_0x582240,_0x1e3706){return new BPromise(function(_0x22d3e4,_0x2c9dcd){return client[_0xaa6e('0xc')](_0x543fc1,_0x1e3706)[_0xaa6e('0xd')](function(_0x139806){logger['info'](_0xaa6e('0xe'),_0x582240,'request\x20sent');logger['debug'](_0xaa6e('0xf'),_0x582240,'request\x20sent',JSON['stringify'](_0x139806));if(_0x139806[_0xaa6e('0x10')]){if(_0x139806[_0xaa6e('0x10')]['code']===0x1f4){logger[_0xaa6e('0x10')]('Automation,\x20%s,\x20%s',_0x582240,_0x139806[_0xaa6e('0x10')][_0xaa6e('0x11')]);return _0x2c9dcd(_0x139806[_0xaa6e('0x10')][_0xaa6e('0x11')]);}logger[_0xaa6e('0x10')](_0xaa6e('0xe'),_0x582240,_0x139806[_0xaa6e('0x10')][_0xaa6e('0x11')]);return _0x22d3e4(_0x139806[_0xaa6e('0x10')]['message']);}else{logger[_0xaa6e('0x12')](_0xaa6e('0xe'),_0x582240,_0xaa6e('0x13'));_0x22d3e4(_0x139806['result'][_0xaa6e('0x11')]);}})[_0xaa6e('0x14')](function(_0x475b7d){logger[_0xaa6e('0x10')]('Automation,\x20%s,\x20%s',_0x582240,_0x475b7d);_0x2c9dcd(_0x475b7d);});});}
\ No newline at end of file
+var _0xe2ab=['Automation,\x20%s,\x20%s,\x20%s','stringify','error','Automation,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','info','request\x20sent','debug'];(function(_0x584d37,_0x13fb20){var _0x1a1dbf=function(_0x23cd11){while(--_0x23cd11){_0x584d37['push'](_0x584d37['shift']());}};_0x1a1dbf(++_0x13fb20);}(_0xe2ab,0xc4));var _0xbe2a=function(_0x5cfcaa,_0x70377e){_0x5cfcaa=_0x5cfcaa-0x0;var _0x5e1e7b=_0xe2ab[_0x5cfcaa];return _0x5e1e7b;};'use strict';var _=require(_0xbe2a('0x0'));var util=require(_0xbe2a('0x1'));var moment=require(_0xbe2a('0x2'));var BPromise=require(_0xbe2a('0x3'));var rs=require(_0xbe2a('0x4'));var fs=require('fs');var Redis=require(_0xbe2a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe2a('0x6'));var logger=require(_0xbe2a('0x7'))(_0xbe2a('0x8'));var config=require(_0xbe2a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xbe2a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f504b,_0x58b8f1,_0x5a8a5d){return new BPromise(function(_0xfccbff,_0x232194){return client['request'](_0x2f504b,_0x5a8a5d)['then'](function(_0x83d775){logger[_0xbe2a('0xb')]('Automation,\x20%s,\x20%s',_0x58b8f1,_0xbe2a('0xc'));logger[_0xbe2a('0xd')](_0xbe2a('0xe'),_0x58b8f1,_0xbe2a('0xc'),JSON[_0xbe2a('0xf')](_0x83d775));if(_0x83d775['error']){if(_0x83d775['error']['code']===0x1f4){logger[_0xbe2a('0x10')](_0xbe2a('0x11'),_0x58b8f1,_0x83d775[_0xbe2a('0x10')][_0xbe2a('0x12')]);return _0x232194(_0x83d775[_0xbe2a('0x10')]['message']);}logger[_0xbe2a('0x10')](_0xbe2a('0x11'),_0x58b8f1,_0x83d775[_0xbe2a('0x10')]['message']);return _0xfccbff(_0x83d775[_0xbe2a('0x10')][_0xbe2a('0x12')]);}else{logger[_0xbe2a('0xb')](_0xbe2a('0x11'),_0x58b8f1,_0xbe2a('0xc'));_0xfccbff(_0x83d775[_0xbe2a('0x13')][_0xbe2a('0x12')]);}})[_0xbe2a('0x14')](function(_0x4395fe){logger['error'](_0xbe2a('0x11'),_0x58b8f1,_0x4395fe);_0x232194(_0x4395fe);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 703439f..080f2f2 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 _0x23d3=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','getConditions','/:id/actions','getActions','post','create','/:id/conditions','addConditions','addActions','/:id','update','delete','destroy','exports','multer','util'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x23d3,0xe8));var _0x323d=function(_0x18607c,_0x48559e){_0x18607c=_0x18607c-0x0;var _0x5e0619=_0x23d3[_0x18607c];return _0x5e0619;};'use strict';var multer=require(_0x323d('0x0'));var util=require(_0x323d('0x1'));var path=require(_0x323d('0x2'));var timeout=require('connect-timeout');var express=require(_0x323d('0x3'));var router=express[_0x323d('0x4')]();var fs_extra=require(_0x323d('0x5'));var auth=require(_0x323d('0x6'));var interaction=require(_0x323d('0x7'));var config=require(_0x323d('0x8'));var controller=require('./automation.controller');router[_0x323d('0x9')]('/',auth[_0x323d('0xa')](),controller[_0x323d('0xb')]);router[_0x323d('0x9')]('/:id',auth[_0x323d('0xa')](),controller[_0x323d('0xc')]);router[_0x323d('0x9')]('/:id/conditions',auth[_0x323d('0xa')](),controller[_0x323d('0xd')]);router['get'](_0x323d('0xe'),auth[_0x323d('0xa')](),controller[_0x323d('0xf')]);router[_0x323d('0x10')]('/',auth['isAuthenticated'](),controller[_0x323d('0x11')]);router[_0x323d('0x10')](_0x323d('0x12'),auth[_0x323d('0xa')](),controller[_0x323d('0x13')]);router[_0x323d('0x10')](_0x323d('0xe'),auth['isAuthenticated'](),controller[_0x323d('0x14')]);router['put'](_0x323d('0x15'),auth[_0x323d('0xa')](),controller[_0x323d('0x16')]);router[_0x323d('0x17')](_0x323d('0x15'),auth[_0x323d('0xa')](),controller[_0x323d('0x18')]);module[_0x323d('0x19')]=router;
\ No newline at end of file
+var _0x1798=['getConditions','/:id/actions','getActions','post','addConditions','put','update','delete','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','/:id','show','/:id/conditions','isAuthenticated'];(function(_0x123623,_0x9694e2){var _0x3b00d1=function(_0x7e48e0){while(--_0x7e48e0){_0x123623['push'](_0x123623['shift']());}};_0x3b00d1(++_0x9694e2);}(_0x1798,0x1d6));var _0x8179=function(_0x8f3ae9,_0x119634){_0x8f3ae9=_0x8f3ae9-0x0;var _0x53d8a4=_0x1798[_0x8f3ae9];return _0x53d8a4;};'use strict';var multer=require(_0x8179('0x0'));var util=require('util');var path=require(_0x8179('0x1'));var timeout=require(_0x8179('0x2'));var express=require('express');var router=express[_0x8179('0x3')]();var fs_extra=require(_0x8179('0x4'));var auth=require(_0x8179('0x5'));var interaction=require(_0x8179('0x6'));var config=require('../../config/environment');var controller=require(_0x8179('0x7'));router[_0x8179('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8179('0x8')](_0x8179('0x9'),auth['isAuthenticated'](),controller[_0x8179('0xa')]);router[_0x8179('0x8')](_0x8179('0xb'),auth[_0x8179('0xc')](),controller[_0x8179('0xd')]);router['get'](_0x8179('0xe'),auth[_0x8179('0xc')](),controller[_0x8179('0xf')]);router[_0x8179('0x10')]('/',auth[_0x8179('0xc')](),controller['create']);router[_0x8179('0x10')](_0x8179('0xb'),auth[_0x8179('0xc')](),controller[_0x8179('0x11')]);router[_0x8179('0x10')]('/:id/actions',auth['isAuthenticated'](),controller['addActions']);router[_0x8179('0x12')](_0x8179('0x9'),auth['isAuthenticated'](),controller[_0x8179('0x13')]);router[_0x8179('0x14')](_0x8179('0x9'),auth[_0x8179('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 79e4cc9..bf92b90 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 _0xc8e5=['#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','never','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence'];(function(_0x4dbf68,_0x243704){var _0x224b3b=function(_0x42d570){while(--_0x42d570){_0x4dbf68['push'](_0x4dbf68['shift']());}};_0x224b3b(++_0x243704);}(_0xc8e5,0xee));var _0x5c8e=function(_0xbe472d,_0x51db05){_0xbe472d=_0xbe472d-0x0;var _0x21a8da=_0xc8e5[_0xbe472d];return _0x21a8da;};'use strict';var Sequelize=require(_0x5c8e('0x0'));module[_0x5c8e('0x1')]={'name':{'type':Sequelize[_0x5c8e('0x2')],'unique':_0x5c8e('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x5c8e('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x5c8e('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x5c8e('0x5')},'limitCalls':{'type':Sequelize[_0x5c8e('0x6')](0x4)[_0x5c8e('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x5c8e('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x5c8e('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x5c8e('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x5c8e('0x6')](0x3)[_0x5c8e('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5c8e('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x5c8e('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5c8e('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x5c8e('0x6')](0x5)[_0x5c8e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5c8e('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x5c8e('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5c8e('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5c8e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5c8e('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x5c8e('0x6')](0x3)[_0x5c8e('0x7')],'defaultValue':0x3,'comment':_0x5c8e('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x5c8e('0x6')](0x5)[_0x5c8e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5c8e('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x5c8e('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x5c8e('0x10')},'dialTimezone':{'type':Sequelize[_0x5c8e('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x5c8e('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0x5c8e('0x12')](_0x5c8e('0x13'),_0x5c8e('0x14'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x5c8e('0x15')],'defaultValue':0x0,'comment':_0x5c8e('0x16')},'dialAMDInitialSilence':{'type':Sequelize[_0x5c8e('0x6')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x5c8e('0x17')},'dialAMDGreeting':{'type':Sequelize[_0x5c8e('0x6')](0x9)[_0x5c8e('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x5c8e('0x18')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x5c8e('0x6')](0x9)[_0x5c8e('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x5c8e('0x6')](0x9)[_0x5c8e('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5c8e('0x19')},'dialAMDMinWordLength':{'type':Sequelize[_0x5c8e('0x6')](0x9)[_0x5c8e('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x5c8e('0x1a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5c8e('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x5c8e('0x1b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x5c8e('0x1c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x5c8e('0x6')](0x5)[_0x5c8e('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x5c8e('0x1d')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x5c8e('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x5c8e('0x12')](_0x5c8e('0x1e'),'ASC'),'defaultValue':_0x5c8e('0x1e')},'dialPrefix':{'type':Sequelize[_0x5c8e('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x5c8e('0x6')](0x3)[_0x5c8e('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5c8e('0x1f')},'dialCutDigit':{'type':Sequelize[_0x5c8e('0x6')](0x3)[_0x5c8e('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x5c8e('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x5c8e('0x6')](0x5)[_0x5c8e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x5c8e('0x6')](0x3)[_0x5c8e('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5c8e('0x20')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5c8e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5c8e('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x5c8e('0x6')](0x3)[_0x5c8e('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5c8e('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x5c8e('0x6')](0x5)[_0x5c8e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x5c8e('0x6')](0x3)[_0x5c8e('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5c8e('0x23')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5c8e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5c8e('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x5c8e('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x5c8e('0x6')](0x5)[_0x5c8e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5c8e('0x25')}};
\ No newline at end of file
+var _0xb52a=['#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','#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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'];(function(_0x1fb6be,_0x2fd9a3){var _0x1eebff=function(_0x427c9b){while(--_0x427c9b){_0x1fb6be['push'](_0x1fb6be['shift']());}};_0x1eebff(++_0x2fd9a3);}(_0xb52a,0x76));var _0xab52=function(_0x246148,_0x1358ee){_0x246148=_0x246148-0x0;var _0x453d94=_0xb52a[_0x246148];return _0x453d94;};'use strict';var Sequelize=require('sequelize');module[_0xab52('0x0')]={'name':{'type':Sequelize[_0xab52('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xab52('0x2')),'allowNull':![],'defaultValue':_0xab52('0x2')},'description':{'type':Sequelize[_0xab52('0x1')]},'active':{'type':Sequelize[_0xab52('0x3')],'defaultValue':0x0,'comment':_0xab52('0x4')},'limitCalls':{'type':Sequelize[_0xab52('0x5')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xab52('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0xab52('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xab52('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xab52('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xab52('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xab52('0x5')](0x3)[_0xab52('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xab52('0x5')](0x5)[_0xab52('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xab52('0x5')](0x3)[_0xab52('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xab52('0x9')},'dialBusyRetryFrequency':{'type':Sequelize[_0xab52('0x5')](0x5)[_0xab52('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xab52('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xab52('0x7')],'defaultValue':0x3,'comment':_0xab52('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xab52('0x5')](0x5)[_0xab52('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xab52('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0xab52('0x5')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xab52('0xd')},'dialTimezone':{'type':Sequelize[_0xab52('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xab52('0x1')],'defaultValue':_0xab52('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0xab52('0xf')](_0xab52('0x10'),_0xab52('0x11'),_0xab52('0x12')),'defaultValue':_0xab52('0x10')},'dialAMDActive':{'type':Sequelize[_0xab52('0x3')],'defaultValue':0x0,'comment':_0xab52('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xab52('0x5')](0x9)[_0xab52('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xab52('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xab52('0x5')](0x9)[_0xab52('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xab52('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xab52('0x5')](0x9)[_0xab52('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xab52('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xab52('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xab52('0x5')](0x9)[_0xab52('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xab52('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xab52('0x5')](0x9)[_0xab52('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xab52('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xab52('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xab52('0x5')](0x5)[_0xab52('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xab52('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xab52('0x5')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xab52('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xab52('0xf')](_0xab52('0x1b'),_0xab52('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xab52('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xab52('0x5')](0x3)[_0xab52('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xab52('0x1d')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xab52('0x5')](0x3)[_0xab52('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xab52('0x5')](0x5)[_0xab52('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xab52('0x5')](0x3)[_0xab52('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xab52('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0xab52('0x5')](0x5)[_0xab52('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xab52('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xab52('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xab52('0x5')](0x5)[_0xab52('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xab52('0x20')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xab52('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xab52('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0xab52('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xab52('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xab52('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xab52('0x5')](0x5)[_0xab52('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xab52('0x23')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 68afa2b..4de4fc7 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 _0xa196=['getHopperHistories','order','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','phone','scheduledAt','ContactId','ListId','updatedAt','select','field','NOW()','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','cm_contacts','push','all','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','zip-dir','request-promise','bluebird','sox','ejs','fs-extra','lodash','squel','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','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','get','IvrCampaigns','sendStatus','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','query','model','fields','attributes','length','hasOwnProperty','limit','sort','where','pick','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','intersection','includeAll','find','create','user','role','userProfileId','UserProfileResource','error','clone','createdAt','body','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','CmHopper','nolimit','CampaignId'];(function(_0x5b8779,_0x57d736){var _0x265e9a=function(_0x70ea26){while(--_0x70ea26){_0x5b8779['push'](_0x5b8779['shift']());}};_0x265e9a(++_0x57d736);}(_0xa196,0x1c3));var _0x6a19=function(_0x4ed078,_0x461723){_0x4ed078=_0x4ed078-0x0;var _0x163477=_0xa196[_0x4ed078];return _0x163477;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6a19('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a19('0x1'));var moment=require('moment');var BPromise=require(_0x6a19('0x2'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x6a19('0x3'));var csv=require('to-csv');var ejs=require(_0x6a19('0x4'));var fs=require('fs');var fs_extra=require(_0x6a19('0x5'));var _=require(_0x6a19('0x6'));var squel=require(_0x6a19('0x7'));var crypto=require('crypto');var jsforce=require(_0x6a19('0x8'));var deskjs=require(_0x6a19('0x9'));var toCsv=require(_0x6a19('0xa'));var querystring=require(_0x6a19('0xb'));var Papa=require(_0x6a19('0xc'));var Redis=require(_0x6a19('0xd'));var authService=require(_0x6a19('0xe'));var qs=require(_0x6a19('0xf'));var as=require(_0x6a19('0x10'));var hardwareService=require(_0x6a19('0x11'));var logger=require(_0x6a19('0x12'))(_0x6a19('0x13'));var utils=require(_0x6a19('0x14'));var config=require(_0x6a19('0x15'));var licenseUtil=require(_0x6a19('0x16'));var db=require(_0x6a19('0x17'))['db'];function respondWithStatusCode(_0xdeaf87,_0x530f8b){_0x530f8b=_0x530f8b||0xcc;return function(_0xff7411){if(_0xff7411){return _0xdeaf87['sendStatus'](_0x530f8b);}return _0xdeaf87[_0x6a19('0x18')](_0x530f8b)[_0x6a19('0x19')]();};}function respondWithResult(_0x22229e,_0x197b87){_0x197b87=_0x197b87||0xc8;return function(_0x3d8e8a){if(_0x3d8e8a){return _0x22229e[_0x6a19('0x18')](_0x197b87)[_0x6a19('0x1a')](_0x3d8e8a);}};}function respondWithFilteredResult(_0x1bfc9f,_0x5a0847){return function(_0x2a5817){if(_0x2a5817){var _0x57cbd4=typeof _0x5a0847[_0x6a19('0x1b')]===_0x6a19('0x1c')&&typeof _0x5a0847['limit']===_0x6a19('0x1c');var _0x473092=_0x2a5817[_0x6a19('0x1d')];var _0x47a246=_0x57cbd4?0x0:_0x5a0847[_0x6a19('0x1b')];var _0x4397ef=_0x57cbd4?_0x2a5817[_0x6a19('0x1d')]:_0x5a0847['offset']+_0x5a0847['limit'];var _0x2cdf4c;if(_0x4397ef>=_0x473092){_0x4397ef=_0x473092;_0x2cdf4c=0xc8;}else{_0x2cdf4c=0xce;}_0x1bfc9f[_0x6a19('0x18')](_0x2cdf4c);return _0x1bfc9f[_0x6a19('0x1e')](_0x6a19('0x1f'),_0x47a246+'-'+_0x4397ef+'/'+_0x473092)[_0x6a19('0x1a')](_0x2a5817);}return null;};}function patchUpdates(_0x4d609f){return function(_0x371fe0){try{jsonpatch[_0x6a19('0x20')](_0x371fe0,_0x4d609f,!![]);}catch(_0x3be5da){return BPromise['reject'](_0x3be5da);}return _0x371fe0[_0x6a19('0x21')]();};}function saveUpdates(_0x4a555a,_0x495673){return function(_0x1472f4){if(_0x1472f4){return _0x1472f4[_0x6a19('0x22')](_0x4a555a)[_0x6a19('0x23')](function(_0x2f59ee){return _0x2f59ee;});}return null;};}function removeEntity(_0x1116a0,_0x5d20ce){return function(_0x4aa88d){if(_0x4aa88d){return _0x4aa88d[_0x6a19('0x24')]()[_0x6a19('0x23')](function(){var _0x24e36b=_0x4aa88d[_0x6a19('0x25')]({'plain':!![]});var _0x4e0d81=_0x6a19('0x26');return db['UserProfileResource'][_0x6a19('0x24')]({'where':{'type':_0x4e0d81,'resourceId':_0x24e36b['id']}})[_0x6a19('0x23')](function(){return _0x4aa88d;});})[_0x6a19('0x23')](function(){_0x1116a0[_0x6a19('0x18')](0xcc)[_0x6a19('0x19')]();});}};}function handleEntityNotFound(_0x32593c,_0x51abcf){return function(_0x7dcab3){if(!_0x7dcab3){_0x32593c[_0x6a19('0x27')](0x194);}return _0x7dcab3;};}function handleError(_0x1f51a8,_0x5462b9){_0x5462b9=_0x5462b9||0x1f4;return function(_0x4e0d1){logger['error'](_0x4e0d1[_0x6a19('0x28')]);if(_0x4e0d1[_0x6a19('0x29')]){delete _0x4e0d1[_0x6a19('0x29')];}_0x1f51a8['status'](_0x5462b9)[_0x6a19('0x2a')](_0x4e0d1);};}exports[_0x6a19('0x2b')]=function(_0x2246ea,_0x354ad5){var _0xc3e7b2={},_0x3845d5={},_0x128b42={'count':0x0,'rows':[]};var _0x308d52=_[_0x6a19('0x2c')](db[_0x6a19('0x2d')][_0x6a19('0x2e')],function(_0x551153){return{'name':_0x551153[_0x6a19('0x2f')],'type':_0x551153[_0x6a19('0x30')][_0x6a19('0x31')]};});_0x3845d5['model']=_[_0x6a19('0x2c')](_0x308d52,'name');_0x3845d5['query']=_['keys'](_0x2246ea[_0x6a19('0x32')]);_0x3845d5['filters']=_['intersection'](_0x3845d5['model'],_0x3845d5[_0x6a19('0x32')]);_0xc3e7b2['attributes']=_['intersection'](_0x3845d5[_0x6a19('0x33')],qs[_0x6a19('0x34')](_0x2246ea[_0x6a19('0x32')][_0x6a19('0x34')]));_0xc3e7b2[_0x6a19('0x35')]=_0xc3e7b2['attributes'][_0x6a19('0x36')]?_0xc3e7b2[_0x6a19('0x35')]:_0x3845d5['model'];if(!_0x2246ea[_0x6a19('0x32')][_0x6a19('0x37')]('nolimit')){_0xc3e7b2[_0x6a19('0x38')]=qs[_0x6a19('0x38')](_0x2246ea[_0x6a19('0x32')][_0x6a19('0x38')]);_0xc3e7b2['offset']=qs[_0x6a19('0x1b')](_0x2246ea[_0x6a19('0x32')][_0x6a19('0x1b')]);}_0xc3e7b2['order']=qs[_0x6a19('0x39')](_0x2246ea[_0x6a19('0x32')]['sort']);_0xc3e7b2[_0x6a19('0x3a')]=qs['filters'](_[_0x6a19('0x3b')](_0x2246ea[_0x6a19('0x32')],_0x3845d5[_0x6a19('0x3c')]),_0x308d52);if(_0x2246ea[_0x6a19('0x32')][_0x6a19('0x3d')]){_0xc3e7b2[_0x6a19('0x3a')]=_[_0x6a19('0x3e')](_0xc3e7b2[_0x6a19('0x3a')],{'$or':_[_0x6a19('0x2c')](_0x308d52,function(_0x4b5788){if(_0x4b5788[_0x6a19('0x30')]!==_0x6a19('0x3f')){var _0x4ed007={};_0x4ed007[_0x4b5788[_0x6a19('0x29')]]={'$like':'%'+_0x2246ea['query']['filter']+'%'};return _0x4ed007;}})});}_0xc3e7b2=_[_0x6a19('0x3e')]({},_0xc3e7b2,_0x2246ea[_0x6a19('0x40')]);var _0x2543ac={'where':_0xc3e7b2['where']};return db[_0x6a19('0x2d')][_0x6a19('0x1d')](_0x2543ac)[_0x6a19('0x23')](function(_0x382606){_0x128b42[_0x6a19('0x1d')]=_0x382606;if(_0x2246ea[_0x6a19('0x32')]['includeAll']){_0xc3e7b2[_0x6a19('0x41')]=[{'all':!![]}];}return db[_0x6a19('0x2d')][_0x6a19('0x42')](_0xc3e7b2);})[_0x6a19('0x23')](function(_0x3f5db1){_0x128b42[_0x6a19('0x43')]=_0x3f5db1;return _0x128b42;})[_0x6a19('0x23')](respondWithFilteredResult(_0x354ad5,_0xc3e7b2))[_0x6a19('0x44')](handleError(_0x354ad5,null));};exports[_0x6a19('0x45')]=function(_0x34c467,_0x39e08b){var _0x4e8dac={'raw':![],'where':{'id':_0x34c467[_0x6a19('0x46')]['id']}},_0x58775e={};_0x58775e[_0x6a19('0x33')]=_['keys'](db[_0x6a19('0x2d')][_0x6a19('0x2e')]);_0x58775e[_0x6a19('0x32')]=_[_0x6a19('0x47')](_0x34c467[_0x6a19('0x32')]);_0x58775e['filters']=_[_0x6a19('0x48')](_0x58775e[_0x6a19('0x33')],_0x58775e['query']);_0x4e8dac['attributes']=_[_0x6a19('0x48')](_0x58775e[_0x6a19('0x33')],qs[_0x6a19('0x34')](_0x34c467[_0x6a19('0x32')]['fields']));_0x4e8dac[_0x6a19('0x35')]=_0x4e8dac['attributes']['length']?_0x4e8dac[_0x6a19('0x35')]:_0x58775e['model'];if(_0x34c467[_0x6a19('0x32')][_0x6a19('0x49')]){_0x4e8dac[_0x6a19('0x41')]=[{'all':!![]}];}_0x4e8dac=_[_0x6a19('0x3e')]({},_0x4e8dac,_0x34c467[_0x6a19('0x40')]);return db[_0x6a19('0x2d')][_0x6a19('0x4a')](_0x4e8dac)[_0x6a19('0x23')](handleEntityNotFound(_0x39e08b,null))[_0x6a19('0x23')](respondWithResult(_0x39e08b,null))[_0x6a19('0x44')](handleError(_0x39e08b,null));};exports[_0x6a19('0x4b')]=function(_0x4be11b,_0x493186){return db[_0x6a19('0x2d')][_0x6a19('0x4b')](_0x4be11b['body'],{})[_0x6a19('0x23')](function(_0x21b661){var _0x461d6f=_0x4be11b[_0x6a19('0x4c')][_0x6a19('0x25')]({'plain':!![]});if(!_0x461d6f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x461d6f[_0x6a19('0x4d')]===_0x6a19('0x4c')){var _0xa417ec=_0x21b661['get']({'plain':!![]});var _0x241383=_0x6a19('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x241383,'userProfileId':_0x461d6f[_0x6a19('0x4e')]},'raw':!![]})[_0x6a19('0x23')](function(_0x5a9a81){if(_0x5a9a81&&_0x5a9a81['autoAssociation']===0x0){return db[_0x6a19('0x4f')]['create']({'name':_0xa417ec[_0x6a19('0x29')],'resourceId':_0xa417ec['id'],'type':_0x5a9a81[_0x6a19('0x29')],'sectionId':_0x5a9a81['id']},{})['then'](function(){return _0x21b661;});}else{return _0x21b661;}})[_0x6a19('0x44')](function(_0x863cea){logger[_0x6a19('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x863cea);throw _0x863cea;});}return _0x21b661;})[_0x6a19('0x23')](respondWithResult(_0x493186,0xc9))['catch'](handleError(_0x493186,null));};exports[_0x6a19('0x51')]=function(_0x4ffa6d,_0x26204c){var _0x5a8d8c={'where':{'id':_0x4ffa6d[_0x6a19('0x46')]['id']}},_0x517e9a={};_0x517e9a[_0x6a19('0x33')]=_[_0x6a19('0x47')](db[_0x6a19('0x2d')][_0x6a19('0x2e')]);_0x5a8d8c[_0x6a19('0x35')]=_[_0x6a19('0x48')](_0x517e9a[_0x6a19('0x33')],qs[_0x6a19('0x34')](_0x4ffa6d['query'][_0x6a19('0x34')]));_0x5a8d8c[_0x6a19('0x35')]=_0x5a8d8c[_0x6a19('0x35')][_0x6a19('0x36')]?_0x5a8d8c[_0x6a19('0x35')]:_0x517e9a[_0x6a19('0x33')];if(_0x4ffa6d[_0x6a19('0x32')][_0x6a19('0x49')]){_0x5a8d8c[_0x6a19('0x41')]=[{'all':!![]}];}_0x5a8d8c=_[_0x6a19('0x3e')]({},_0x5a8d8c,_0x4ffa6d[_0x6a19('0x40')]);return db[_0x6a19('0x2d')][_0x6a19('0x4a')](_0x5a8d8c)[_0x6a19('0x23')](handleEntityNotFound(_0x26204c,null))[_0x6a19('0x23')](function(_0x5a6221){if(_0x5a6221){var _0x3c6700=_0x5a6221['get']({'plain':!![]});_0x3c6700=qs['omit'](_0x3c6700,['id',_0x6a19('0x52'),'updatedAt']);_0x4ffa6d[_0x6a19('0x53')]=_[_0x6a19('0x54')](_0x4ffa6d['body'],['id',_0x6a19('0x52'),'updatedAt']);return db[_0x6a19('0x2d')][_0x6a19('0x4b')](_['merge'](_0x3c6700,_0x4ffa6d[_0x6a19('0x53')]),{'include':_0x4ffa6d['query'][_0x6a19('0x49')]?[{'all':!![]}]:undefined})['then'](function(_0x5a7a6a){var _0xf2732f=_0x4ffa6d[_0x6a19('0x4c')][_0x6a19('0x25')]({'plain':!![]});if(!_0xf2732f)throw new Error(_0x6a19('0x55'));if(_0xf2732f['role']===_0x6a19('0x4c')){var _0x15e87f=_0x5a7a6a[_0x6a19('0x25')]({'plain':!![]});var _0x424f77=_0x6a19('0x26');return db[_0x6a19('0x56')][_0x6a19('0x4a')]({'where':{'name':_0x424f77,'userProfileId':_0xf2732f[_0x6a19('0x4e')]},'raw':!![]})[_0x6a19('0x23')](function(_0x3e9bea){if(_0x3e9bea&&_0x3e9bea[_0x6a19('0x57')]===0x0){return db['UserProfileResource'][_0x6a19('0x4b')]({'name':_0x15e87f['name'],'resourceId':_0x15e87f['id'],'type':_0x3e9bea['name'],'sectionId':_0x3e9bea['id']},{})[_0x6a19('0x23')](function(){return _0x5a7a6a;});}else{return _0x5a7a6a;}})[_0x6a19('0x44')](function(_0x5e1419){logger[_0x6a19('0x50')](_0x6a19('0x58'),_0x5e1419);throw _0x5e1419;});}return _0x5a7a6a;});}})[_0x6a19('0x23')](respondWithResult(_0x26204c,0xc9))[_0x6a19('0x44')](handleError(_0x26204c,null));};exports[_0x6a19('0x22')]=function(_0x2bf86e,_0x430bfc){if(_0x2bf86e['body']['id']){delete _0x2bf86e[_0x6a19('0x53')]['id'];}return db['Campaign'][_0x6a19('0x4a')]({'where':{'id':_0x2bf86e['params']['id']}})[_0x6a19('0x23')](handleEntityNotFound(_0x430bfc,null))[_0x6a19('0x23')](saveUpdates(_0x2bf86e[_0x6a19('0x53')],null))['then'](respondWithResult(_0x430bfc,null))[_0x6a19('0x44')](handleError(_0x430bfc,null));};exports[_0x6a19('0x24')]=function(_0x335fa1,_0x3becde){return db[_0x6a19('0x2d')][_0x6a19('0x4a')]({'where':{'id':_0x335fa1[_0x6a19('0x46')]['id']}})[_0x6a19('0x23')](handleEntityNotFound(_0x3becde,null))['then'](removeEntity(_0x3becde,null))[_0x6a19('0x44')](handleError(_0x3becde,null));};exports['getHoppers']=function(_0xd2dc97,_0x25af8b,_0x3e739a){var _0x5ecbed={'raw':!![],'where':{}};var _0x38817a={};var _0x30f8dc={'count':0x0,'rows':[]};return db[_0x6a19('0x2d')][_0x6a19('0x59')]({'where':{'id':_0xd2dc97[_0x6a19('0x46')]['id']}})[_0x6a19('0x23')](handleEntityNotFound(_0x25af8b,null))[_0x6a19('0x23')](function(_0xa26a88){if(_0xa26a88){_0x38817a[_0x6a19('0x33')]=_[_0x6a19('0x47')](db[_0x6a19('0x5a')][_0x6a19('0x2e')]);_0x38817a['query']=_['keys'](_0xd2dc97[_0x6a19('0x32')]);_0x38817a[_0x6a19('0x3c')]=_['intersection'](_0x38817a['model'],_0x38817a['query']);_0x5ecbed[_0x6a19('0x35')]=_['intersection'](_0x38817a[_0x6a19('0x33')],qs['fields'](_0xd2dc97[_0x6a19('0x32')]['fields']));_0x5ecbed[_0x6a19('0x35')]=_0x5ecbed[_0x6a19('0x35')][_0x6a19('0x36')]?_0x5ecbed['attributes']:_0x38817a[_0x6a19('0x33')];if(!_0xd2dc97[_0x6a19('0x32')]['hasOwnProperty'](_0x6a19('0x5b'))){_0x5ecbed[_0x6a19('0x38')]=qs[_0x6a19('0x38')](_0xd2dc97[_0x6a19('0x32')][_0x6a19('0x38')]);_0x5ecbed[_0x6a19('0x1b')]=qs[_0x6a19('0x1b')](_0xd2dc97['query'][_0x6a19('0x1b')]);}_0x5ecbed['order']=qs[_0x6a19('0x39')](_0xd2dc97['query']['sort']);_0x5ecbed[_0x6a19('0x3a')]=qs[_0x6a19('0x3c')](_['pick'](_0xd2dc97['query'],_0x38817a[_0x6a19('0x3c')]));_0x5ecbed[_0x6a19('0x3a')][_0x6a19('0x5c')]=_0xa26a88['id'];if(_0xd2dc97[_0x6a19('0x32')]['filter']){_0x5ecbed[_0x6a19('0x3a')]=_[_0x6a19('0x3e')](_0x5ecbed[_0x6a19('0x3a')],{'$or':_['map'](_0x5ecbed[_0x6a19('0x35')],function(_0x3c8c82){var _0x176c22={};_0x176c22[_0x3c8c82]={'$like':'%'+_0xd2dc97[_0x6a19('0x32')][_0x6a19('0x3d')]+'%'};return _0x176c22;})});}_0x5ecbed=_['merge']({},_0x5ecbed,_0xd2dc97[_0x6a19('0x40')]);return db[_0x6a19('0x5a')][_0x6a19('0x1d')]({'where':_0x5ecbed[_0x6a19('0x3a')]})[_0x6a19('0x23')](function(_0x1a55d9){_0x30f8dc[_0x6a19('0x1d')]=_0x1a55d9;if(_0xd2dc97[_0x6a19('0x32')][_0x6a19('0x49')]){_0x5ecbed['include']=[{'all':!![]}];}return db[_0x6a19('0x5a')][_0x6a19('0x42')](_0x5ecbed);})['then'](function(_0x2ee7c1){_0x30f8dc[_0x6a19('0x43')]=_0x2ee7c1;return _0x30f8dc;});}})['then'](respondWithFilteredResult(_0x25af8b,_0x5ecbed))[_0x6a19('0x44')](handleError(_0x25af8b,null));};exports[_0x6a19('0x5d')]=function(_0x300556,_0x246dc0,_0x44a45e){var _0x443451={'raw':!![],'where':{}};var _0x4d1813={};var _0x18ec6e={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x300556[_0x6a19('0x46')]['id']}})[_0x6a19('0x23')](handleEntityNotFound(_0x246dc0,null))[_0x6a19('0x23')](function(_0x1705e9){if(_0x1705e9){_0x4d1813['model']=_[_0x6a19('0x47')](db['CmHopperHistory'][_0x6a19('0x2e')]);_0x4d1813[_0x6a19('0x32')]=_[_0x6a19('0x47')](_0x300556[_0x6a19('0x32')]);_0x4d1813[_0x6a19('0x3c')]=_[_0x6a19('0x48')](_0x4d1813[_0x6a19('0x33')],_0x4d1813[_0x6a19('0x32')]);_0x443451[_0x6a19('0x35')]=_[_0x6a19('0x48')](_0x4d1813['model'],qs['fields'](_0x300556[_0x6a19('0x32')][_0x6a19('0x34')]));_0x443451[_0x6a19('0x35')]=_0x443451[_0x6a19('0x35')]['length']?_0x443451[_0x6a19('0x35')]:_0x4d1813[_0x6a19('0x33')];if(!_0x300556['query'][_0x6a19('0x37')](_0x6a19('0x5b'))){_0x443451[_0x6a19('0x38')]=qs[_0x6a19('0x38')](_0x300556['query']['limit']);_0x443451[_0x6a19('0x1b')]=qs[_0x6a19('0x1b')](_0x300556[_0x6a19('0x32')]['offset']);}_0x443451[_0x6a19('0x5e')]=qs[_0x6a19('0x39')](_0x300556[_0x6a19('0x32')][_0x6a19('0x39')]);_0x443451[_0x6a19('0x3a')]=qs['filters'](_[_0x6a19('0x3b')](_0x300556[_0x6a19('0x32')],_0x4d1813['filters']));_0x443451['where'][_0x6a19('0x5c')]=_0x1705e9['id'];if(_0x300556['query'][_0x6a19('0x3d')]){_0x443451[_0x6a19('0x3a')]=_[_0x6a19('0x3e')](_0x443451[_0x6a19('0x3a')],{'$or':_[_0x6a19('0x2c')](_0x443451[_0x6a19('0x35')],function(_0x469494){var _0x52f01a={};_0x52f01a[_0x469494]={'$like':'%'+_0x300556[_0x6a19('0x32')][_0x6a19('0x3d')]+'%'};return _0x52f01a;})});}_0x443451=_[_0x6a19('0x3e')]({},_0x443451,_0x300556[_0x6a19('0x40')]);return db['CmHopperHistory'][_0x6a19('0x1d')]({'where':_0x443451[_0x6a19('0x3a')]})[_0x6a19('0x23')](function(_0x3b9130){_0x18ec6e['count']=_0x3b9130;if(_0x300556[_0x6a19('0x32')][_0x6a19('0x49')]){_0x443451['include']=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x443451);})[_0x6a19('0x23')](function(_0x52a8c0){_0x18ec6e['rows']=_0x52a8c0;return _0x18ec6e;});}})['then'](respondWithFilteredResult(_0x246dc0,_0x443451))[_0x6a19('0x44')](handleError(_0x246dc0,null));};exports[_0x6a19('0x5f')]=function(_0x2843c8,_0x3c3b9e,_0x445278){var _0x5a3d0={'raw':!![],'where':{}};var _0x4800af={};var _0x5d5f0a={'count':0x0,'rows':[]};return db[_0x6a19('0x2d')][_0x6a19('0x59')]({'where':{'id':_0x2843c8[_0x6a19('0x46')]['id']}})[_0x6a19('0x23')](handleEntityNotFound(_0x3c3b9e,null))[_0x6a19('0x23')](function(_0x43fffb){if(_0x43fffb){_0x4800af[_0x6a19('0x33')]=_[_0x6a19('0x47')](db[_0x6a19('0x60')][_0x6a19('0x2e')]);_0x4800af[_0x6a19('0x32')]=_['keys'](_0x2843c8[_0x6a19('0x32')]);_0x4800af['filters']=_[_0x6a19('0x48')](_0x4800af[_0x6a19('0x33')],_0x4800af[_0x6a19('0x32')]);_0x5a3d0[_0x6a19('0x35')]=_[_0x6a19('0x48')](_0x4800af['model'],qs['fields'](_0x2843c8['query'][_0x6a19('0x34')]));_0x5a3d0['attributes']=_0x5a3d0[_0x6a19('0x35')][_0x6a19('0x36')]?_0x5a3d0[_0x6a19('0x35')]:_0x4800af[_0x6a19('0x33')];if(!_0x2843c8['query']['hasOwnProperty']('nolimit')){_0x5a3d0[_0x6a19('0x38')]=qs[_0x6a19('0x38')](_0x2843c8[_0x6a19('0x32')][_0x6a19('0x38')]);_0x5a3d0[_0x6a19('0x1b')]=qs['offset'](_0x2843c8[_0x6a19('0x32')][_0x6a19('0x1b')]);}_0x5a3d0[_0x6a19('0x5e')]=qs[_0x6a19('0x39')](_0x2843c8[_0x6a19('0x32')]['sort']);_0x5a3d0[_0x6a19('0x3a')]=qs[_0x6a19('0x3c')](_[_0x6a19('0x3b')](_0x2843c8['query'],_0x4800af[_0x6a19('0x3c')]));_0x5a3d0[_0x6a19('0x3a')]['CampaignId']=_0x43fffb['id'];if(_0x2843c8[_0x6a19('0x32')][_0x6a19('0x3d')]){_0x5a3d0[_0x6a19('0x3a')]=_['merge'](_0x5a3d0[_0x6a19('0x3a')],{'$or':_[_0x6a19('0x2c')](_0x5a3d0['attributes'],function(_0x44e657){var _0x28de74={};_0x28de74[_0x44e657]={'$like':'%'+_0x2843c8['query']['filter']+'%'};return _0x28de74;})});}_0x5a3d0=_[_0x6a19('0x3e')]({},_0x5a3d0,_0x2843c8[_0x6a19('0x40')]);return db[_0x6a19('0x60')][_0x6a19('0x1d')]({'where':_0x5a3d0[_0x6a19('0x3a')]})[_0x6a19('0x23')](function(_0x11d472){_0x5d5f0a[_0x6a19('0x1d')]=_0x11d472;if(_0x2843c8[_0x6a19('0x32')]['includeAll']){_0x5a3d0['include']=[{'all':!![]}];}return db[_0x6a19('0x60')][_0x6a19('0x42')](_0x5a3d0);})[_0x6a19('0x23')](function(_0x119a30){_0x5d5f0a[_0x6a19('0x43')]=_0x119a30;return _0x5d5f0a;});}})[_0x6a19('0x23')](respondWithFilteredResult(_0x3c3b9e,_0x5a3d0))[_0x6a19('0x44')](handleError(_0x3c3b9e,null));};exports[_0x6a19('0x61')]=function(_0x3a3359,_0x5f6b3d,_0x26a997){var _0x22fe2b={'raw':!![],'where':{}};var _0x3af508={};var _0x2474a0={'count':0x0,'rows':[]};return db[_0x6a19('0x2d')][_0x6a19('0x59')]({'where':{'id':_0x3a3359['params']['id']}})[_0x6a19('0x23')](handleEntityNotFound(_0x5f6b3d,null))[_0x6a19('0x23')](function(_0x32ae01){if(_0x32ae01){_0x3af508[_0x6a19('0x33')]=_['keys'](db[_0x6a19('0x62')][_0x6a19('0x2e')]);_0x3af508[_0x6a19('0x32')]=_[_0x6a19('0x47')](_0x3a3359[_0x6a19('0x32')]);_0x3af508[_0x6a19('0x3c')]=_[_0x6a19('0x48')](_0x3af508[_0x6a19('0x33')],_0x3af508[_0x6a19('0x32')]);_0x22fe2b[_0x6a19('0x35')]=_['intersection'](_0x3af508[_0x6a19('0x33')],qs[_0x6a19('0x34')](_0x3a3359[_0x6a19('0x32')]['fields']));_0x22fe2b[_0x6a19('0x35')]=_0x22fe2b[_0x6a19('0x35')][_0x6a19('0x36')]?_0x22fe2b['attributes']:_0x3af508[_0x6a19('0x33')];if(!_0x3a3359[_0x6a19('0x32')][_0x6a19('0x37')](_0x6a19('0x5b'))){_0x22fe2b['limit']=qs[_0x6a19('0x38')](_0x3a3359[_0x6a19('0x32')][_0x6a19('0x38')]);_0x22fe2b['offset']=qs[_0x6a19('0x1b')](_0x3a3359['query'][_0x6a19('0x1b')]);}_0x22fe2b[_0x6a19('0x5e')]=qs[_0x6a19('0x39')](_0x3a3359['query'][_0x6a19('0x39')]);_0x22fe2b[_0x6a19('0x3a')]=qs[_0x6a19('0x3c')](_['pick'](_0x3a3359[_0x6a19('0x32')],_0x3af508[_0x6a19('0x3c')]));_0x22fe2b[_0x6a19('0x3a')][_0x6a19('0x5c')]=_0x32ae01['id'];if(_0x3a3359['query'][_0x6a19('0x3d')]){_0x22fe2b['where']=_['merge'](_0x22fe2b[_0x6a19('0x3a')],{'$or':_[_0x6a19('0x2c')](_0x22fe2b[_0x6a19('0x35')],function(_0x89a3ae){var _0x42cc28={};_0x42cc28[_0x89a3ae]={'$like':'%'+_0x3a3359[_0x6a19('0x32')]['filter']+'%'};return _0x42cc28;})});}_0x22fe2b=_[_0x6a19('0x3e')]({},_0x22fe2b,_0x3a3359['options']);return db[_0x6a19('0x62')][_0x6a19('0x1d')]({'where':_0x22fe2b['where']})[_0x6a19('0x23')](function(_0x48ca7f){_0x2474a0[_0x6a19('0x1d')]=_0x48ca7f;if(_0x3a3359[_0x6a19('0x32')][_0x6a19('0x49')]){_0x22fe2b[_0x6a19('0x41')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x6a19('0x42')](_0x22fe2b);})[_0x6a19('0x23')](function(_0x2e4acc){_0x2474a0[_0x6a19('0x43')]=_0x2e4acc;return _0x2474a0;});}})['then'](respondWithFilteredResult(_0x5f6b3d,_0x22fe2b))['catch'](handleError(_0x5f6b3d,null));};exports['getLists']=function(_0x2f983f,_0x491a5b,_0x13c4ac){var _0x1e8e3f={};var _0x3b042d={};var _0x1a135e;var _0xc8a94f;return db['Campaign']['findOne']({'where':{'id':_0x2f983f[_0x6a19('0x46')]['id']}})[_0x6a19('0x23')](handleEntityNotFound(_0x491a5b,null))[_0x6a19('0x23')](function(_0x3457ab){if(_0x3457ab){_0x1a135e=_0x3457ab;_0x3b042d['model']=_[_0x6a19('0x47')](db[_0x6a19('0x63')][_0x6a19('0x2e')]);_0x3b042d['query']=_[_0x6a19('0x47')](_0x2f983f['query']);_0x3b042d[_0x6a19('0x3c')]=_[_0x6a19('0x48')](_0x3b042d[_0x6a19('0x33')],_0x3b042d[_0x6a19('0x32')]);_0x1e8e3f[_0x6a19('0x35')]=_['intersection'](_0x3b042d[_0x6a19('0x33')],qs['fields'](_0x2f983f[_0x6a19('0x32')]['fields']));_0x1e8e3f[_0x6a19('0x35')]=_0x1e8e3f['attributes'][_0x6a19('0x36')]?_0x1e8e3f['attributes']:_0x3b042d[_0x6a19('0x33')];_0x1e8e3f[_0x6a19('0x5e')]=qs[_0x6a19('0x39')](_0x2f983f[_0x6a19('0x32')][_0x6a19('0x39')]);_0x1e8e3f['where']=qs['filters'](_[_0x6a19('0x3b')](_0x2f983f[_0x6a19('0x32')],_0x3b042d[_0x6a19('0x3c')]));if(_0x2f983f[_0x6a19('0x32')][_0x6a19('0x3d')]){_0x1e8e3f[_0x6a19('0x3a')]=_['merge'](_0x1e8e3f[_0x6a19('0x3a')],{'$or':_[_0x6a19('0x2c')](_0x1e8e3f[_0x6a19('0x35')],function(_0x4007eb){var _0xf8075f={};_0xf8075f[_0x4007eb]={'$like':'%'+_0x2f983f['query']['filter']+'%'};return _0xf8075f;})});}_0x1e8e3f=_[_0x6a19('0x3e')]({},_0x1e8e3f,_0x2f983f[_0x6a19('0x40')]);return _0x1a135e[_0x6a19('0x64')](_0x1e8e3f);}})['then'](function(_0x51da58){if(_0x51da58){_0xc8a94f=_0x51da58[_0x6a19('0x36')];if(!_0x2f983f[_0x6a19('0x32')][_0x6a19('0x37')](_0x6a19('0x5b'))){_0x1e8e3f[_0x6a19('0x38')]=qs[_0x6a19('0x38')](_0x2f983f[_0x6a19('0x32')][_0x6a19('0x38')]);_0x1e8e3f['offset']=qs['offset'](_0x2f983f['query'][_0x6a19('0x1b')]);}return _0x1a135e[_0x6a19('0x64')](_0x1e8e3f);}})[_0x6a19('0x23')](function(_0x105d91){if(_0x105d91){return _0x105d91?{'count':_0xc8a94f,'rows':_0x105d91}:null;}})['then'](respondWithResult(_0x491a5b,null))['catch'](handleError(_0x491a5b,null));};exports[_0x6a19('0x65')]=function(_0x36a9e7,_0x5cc0d2,_0x3a5b42){var _0x442c24,_0x15d7d7;return db[_0x6a19('0x2d')]['find']({'where':{'id':_0x36a9e7[_0x6a19('0x46')]['id']}})[_0x6a19('0x23')](handleEntityNotFound(_0x5cc0d2,null))['then'](function(_0x10d2b7){if(_0x10d2b7){_0x15d7d7=_0x10d2b7;return _0x10d2b7[_0x6a19('0x65')](_0x36a9e7[_0x6a19('0x53')]['ids'],_[_0x6a19('0x54')](_0x36a9e7[_0x6a19('0x53')],[_0x6a19('0x66'),'id'])||{});}return null;})[_0x6a19('0x67')](function(_0x30256d){var _0xe60359;_0x442c24=_0x30256d||[];var _0x334565=[];if(_0x30256d){for(var _0x50f772=0x0;_0x50f772<_0x30256d[_0x6a19('0x36')];_0x50f772+=0x1){var _0x48266c=_0x30256d[_0x50f772][_0x6a19('0x25')]({'plain':!![]});_0x15d7d7[_0x6a19('0x68')]=_0x36a9e7[_0x6a19('0x53')][_0x6a19('0x68')]?_0x36a9e7[_0x6a19('0x53')][_0x6a19('0x68')]:_0x15d7d7[_0x6a19('0x68')];switch(_0x15d7d7[_0x6a19('0x68')]){case _0x6a19('0x69'):_0xe60359=squel[_0x6a19('0x6a')]()[_0x6a19('0x6b')]('cm_hopper')[_0x6a19('0x6c')]([_0x6a19('0x6d'),_0x6a19('0x6e'),_0x6a19('0x6f'),_0x6a19('0x70'),_0x6a19('0x5c'),_0x6a19('0x52'),_0x6a19('0x71')],squel[_0x6a19('0x72')]()['field']('phone',_0x6a19('0x6d'))[_0x6a19('0x73')](_0x6a19('0x74'),_0x6a19('0x6e'))[_0x6a19('0x73')]('id',_0x6a19('0x6f'))[_0x6a19('0x73')](_0x48266c['CmListId'][_0x6a19('0x75')](),_0x6a19('0x70'))['field'](_0x36a9e7[_0x6a19('0x46')]['id'][_0x6a19('0x75')](),'CampaignId')['field'](_0x6a19('0x74'),_0x6a19('0x52'))['field'](_0x6a19('0x74'),_0x6a19('0x71'))[_0x6a19('0x76')]('cm_contacts')[_0x6a19('0x3a')](_0x6a19('0x77'))[_0x6a19('0x3a')](_0x6a19('0x78'),_0x48266c[_0x6a19('0x79')][_0x6a19('0x75')]())[_0x6a19('0x3a')](_0x6a19('0x7a'))[_0x6a19('0x3a')](_0x6a19('0x7b'),squel[_0x6a19('0x72')]()[_0x6a19('0x73')](_0x6a19('0x7c'))[_0x6a19('0x76')]('cm_hopper_final')[_0x6a19('0x3a')](_0x6a19('0x7d'),_0x36a9e7[_0x6a19('0x46')]['id'][_0x6a19('0x75')]()))['where'](_0x6a19('0x7b'),squel[_0x6a19('0x72')]()[_0x6a19('0x73')](_0x6a19('0x7e'))['from'](_0x6a19('0x7f'))['where']('CampaignId\x20=\x20?',_0x36a9e7[_0x6a19('0x46')]['id'][_0x6a19('0x75')]())))[_0x6a19('0x75')]();break;case _0x6a19('0x80'):_0xe60359=squel[_0x6a19('0x6a')]()['into']('cm_hopper')[_0x6a19('0x6c')]([_0x6a19('0x6d'),_0x6a19('0x6e'),_0x6a19('0x6f'),'ListId',_0x6a19('0x5c'),_0x6a19('0x52'),_0x6a19('0x71')],squel[_0x6a19('0x72')]()[_0x6a19('0x73')](_0x6a19('0x6d'),_0x6a19('0x6d'))[_0x6a19('0x73')](_0x6a19('0x74'),_0x6a19('0x6e'))['field']('id',_0x6a19('0x6f'))[_0x6a19('0x73')](_0x48266c[_0x6a19('0x79')][_0x6a19('0x75')](),'ListId')[_0x6a19('0x73')](_0x36a9e7[_0x6a19('0x46')]['id'][_0x6a19('0x75')](),_0x6a19('0x5c'))[_0x6a19('0x73')]('NOW()',_0x6a19('0x52'))[_0x6a19('0x73')](_0x6a19('0x74'),_0x6a19('0x71'))[_0x6a19('0x76')](_0x6a19('0x81'))[_0x6a19('0x3a')](_0x6a19('0x77'))[_0x6a19('0x3a')](_0x6a19('0x78'),_0x48266c[_0x6a19('0x79')][_0x6a19('0x75')]())[_0x6a19('0x3a')](_0x6a19('0x7a'))[_0x6a19('0x3a')](_0x6a19('0x7b'),squel[_0x6a19('0x72')]()[_0x6a19('0x73')](_0x6a19('0x7e'))[_0x6a19('0x76')](_0x6a19('0x7f'))[_0x6a19('0x3a')](_0x6a19('0x7d'),_0x36a9e7[_0x6a19('0x46')]['id'][_0x6a19('0x75')]())))[_0x6a19('0x75')]();break;default:_0xe60359=squel[_0x6a19('0x6a')]()[_0x6a19('0x6b')](_0x6a19('0x7f'))[_0x6a19('0x6c')]([_0x6a19('0x6d'),_0x6a19('0x6e'),_0x6a19('0x6f'),'ListId','CampaignId',_0x6a19('0x52'),_0x6a19('0x71')],squel[_0x6a19('0x72')]()['field'](_0x6a19('0x6d'),'phone')[_0x6a19('0x73')](_0x6a19('0x74'),_0x6a19('0x6e'))[_0x6a19('0x73')]('id','ContactId')[_0x6a19('0x73')](_0x48266c[_0x6a19('0x79')][_0x6a19('0x75')](),_0x6a19('0x70'))[_0x6a19('0x73')](_0x36a9e7[_0x6a19('0x46')]['id']['toString'](),_0x6a19('0x5c'))['field'](_0x6a19('0x74'),_0x6a19('0x52'))[_0x6a19('0x73')]('NOW()',_0x6a19('0x71'))[_0x6a19('0x76')](_0x6a19('0x81'))[_0x6a19('0x3a')]('deletedAt\x20IS\x20NULL')[_0x6a19('0x3a')]('ListId\x20=\x20?',_0x48266c[_0x6a19('0x79')][_0x6a19('0x75')]())[_0x6a19('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0x6a19('0x75')]();}_0x334565[_0x6a19('0x82')](db['sequelize'][_0x6a19('0x32')](_0xe60359));}return BPromise[_0x6a19('0x83')](_0x334565);}})[_0x6a19('0x23')](function(){return _0x442c24;})[_0x6a19('0x23')](respondWithResult(_0x5cc0d2,null))[_0x6a19('0x44')](handleError(_0x5cc0d2,null));};exports['removeLists']=function(_0x2bb064,_0x57929e,_0x1ba558){return db[_0x6a19('0x2d')][_0x6a19('0x4a')]({'where':{'id':_0x2bb064[_0x6a19('0x46')]['id']}})[_0x6a19('0x23')](handleEntityNotFound(_0x57929e,null))[_0x6a19('0x23')](function(_0x21ed5d){if(_0x21ed5d){return _0x21ed5d['removeLists'](_0x2bb064[_0x6a19('0x32')][_0x6a19('0x66')]);}})[_0x6a19('0x23')](function(_0x116d48){if(_0x116d48){return db[_0x6a19('0x5a')][_0x6a19('0x24')]({'where':{'ListId':_0x2bb064[_0x6a19('0x32')][_0x6a19('0x66')],'CampaignId':_0x2bb064[_0x6a19('0x46')]['id']}})['then'](function(){return _0x116d48;});}})[_0x6a19('0x23')](respondWithStatusCode(_0x57929e,null))[_0x6a19('0x44')](handleError(_0x57929e,null));};exports[_0x6a19('0x84')]=function(_0x45ae00,_0x1837a2,_0x27f66b){var _0x2f037a={};var _0x163613={};var _0x2bd794;var _0xe4b4f;return db[_0x6a19('0x2d')][_0x6a19('0x59')]({'where':{'id':_0x45ae00[_0x6a19('0x46')]['id']}})[_0x6a19('0x23')](handleEntityNotFound(_0x1837a2,null))['then'](function(_0x5c015a){if(_0x5c015a){_0x2bd794=_0x5c015a;_0x163613[_0x6a19('0x33')]=_[_0x6a19('0x47')](db[_0x6a19('0x63')][_0x6a19('0x2e')]);_0x163613[_0x6a19('0x32')]=_['keys'](_0x45ae00[_0x6a19('0x32')]);_0x163613['filters']=_[_0x6a19('0x48')](_0x163613[_0x6a19('0x33')],_0x163613['query']);_0x2f037a['attributes']=_['intersection'](_0x163613['model'],qs[_0x6a19('0x34')](_0x45ae00[_0x6a19('0x32')][_0x6a19('0x34')]));_0x2f037a[_0x6a19('0x35')]=_0x2f037a['attributes'][_0x6a19('0x36')]?_0x2f037a[_0x6a19('0x35')]:_0x163613[_0x6a19('0x33')];_0x2f037a['order']=qs[_0x6a19('0x39')](_0x45ae00['query'][_0x6a19('0x39')]);_0x2f037a[_0x6a19('0x3a')]=qs[_0x6a19('0x3c')](_[_0x6a19('0x3b')](_0x45ae00['query'],_0x163613[_0x6a19('0x3c')]));if(_0x45ae00[_0x6a19('0x32')][_0x6a19('0x3d')]){_0x2f037a[_0x6a19('0x3a')]=_['merge'](_0x2f037a[_0x6a19('0x3a')],{'$or':_[_0x6a19('0x2c')](_0x2f037a['attributes'],function(_0x5eb055){var _0x14e222={};_0x14e222[_0x5eb055]={'$like':'%'+_0x45ae00['query'][_0x6a19('0x3d')]+'%'};return _0x14e222;})});}_0x2f037a=_[_0x6a19('0x3e')]({},_0x2f037a,_0x45ae00['options']);return _0x2bd794[_0x6a19('0x84')](_0x2f037a);}})[_0x6a19('0x23')](function(_0x130946){if(_0x130946){_0xe4b4f=_0x130946['length'];if(!_0x45ae00[_0x6a19('0x32')][_0x6a19('0x37')](_0x6a19('0x5b'))){_0x2f037a[_0x6a19('0x38')]=qs[_0x6a19('0x38')](_0x45ae00[_0x6a19('0x32')]['limit']);_0x2f037a[_0x6a19('0x1b')]=qs[_0x6a19('0x1b')](_0x45ae00[_0x6a19('0x32')][_0x6a19('0x1b')]);}return _0x2bd794[_0x6a19('0x84')](_0x2f037a);}})[_0x6a19('0x23')](function(_0x15a7db){if(_0x15a7db){return _0x15a7db?{'count':_0xe4b4f,'rows':_0x15a7db}:null;}})[_0x6a19('0x23')](respondWithResult(_0x1837a2,null))[_0x6a19('0x44')](handleError(_0x1837a2,null));};exports[_0x6a19('0x85')]=function(_0x84eb7f,_0x2f472d,_0x5f20f5){var _0x501b24,_0x38d7da;return db['Campaign'][_0x6a19('0x4a')]({'where':{'id':_0x84eb7f[_0x6a19('0x46')]['id']}})[_0x6a19('0x23')](handleEntityNotFound(_0x2f472d,null))[_0x6a19('0x23')](function(_0x288ed6){if(_0x288ed6){_0x38d7da=_0x288ed6;return _0x288ed6[_0x6a19('0x85')](_0x84eb7f['body'][_0x6a19('0x66')],_[_0x6a19('0x54')](_0x84eb7f[_0x6a19('0x53')],['ids','id'])||{});}return null;})['spread'](function(_0x375c2c){var _0x4368e8;_0x501b24=_0x375c2c||[];var _0x5128c4=[];if(_0x375c2c){for(var _0x31a266=0x0;_0x31a266<_0x375c2c['length'];_0x31a266+=0x1){var _0xfc3caa=_0x375c2c[_0x31a266][_0x6a19('0x25')]({'plain':!![]});_0x4368e8=squel[_0x6a19('0x6a')]()[_0x6a19('0x6b')](_0x6a19('0x86'))[_0x6a19('0x6c')]([_0x6a19('0x6d'),_0x6a19('0x6f'),_0x6a19('0x70'),_0x6a19('0x5c'),_0x6a19('0x52'),_0x6a19('0x71')],squel['select']()[_0x6a19('0x73')](_0x6a19('0x6d'),_0x6a19('0x6d'))[_0x6a19('0x73')]('id',_0x6a19('0x6f'))['field'](_0xfc3caa[_0x6a19('0x79')]['toString'](),_0x6a19('0x70'))[_0x6a19('0x73')](_0x84eb7f['params']['id']['toString'](),'CampaignId')['field'](_0x6a19('0x74'),'createdAt')[_0x6a19('0x73')](_0x6a19('0x74'),_0x6a19('0x71'))[_0x6a19('0x76')](_0x6a19('0x81'))[_0x6a19('0x3a')](_0x6a19('0x77'))[_0x6a19('0x3a')](_0x6a19('0x78'),_0xfc3caa[_0x6a19('0x79')][_0x6a19('0x75')]())[_0x6a19('0x3a')](_0x6a19('0x7a')))[_0x6a19('0x75')]();_0x5128c4[_0x6a19('0x82')](db['sequelize'][_0x6a19('0x32')](_0x4368e8));}return BPromise[_0x6a19('0x83')](_0x5128c4);}})[_0x6a19('0x23')](function(){return _0x501b24;})['then'](respondWithResult(_0x2f472d,null))[_0x6a19('0x44')](handleError(_0x2f472d,null));};exports[_0x6a19('0x87')]=function(_0x180126,_0x13e71f,_0x524d36){return db['Campaign'][_0x6a19('0x4a')]({'where':{'id':_0x180126[_0x6a19('0x46')]['id']}})['then'](handleEntityNotFound(_0x13e71f,null))[_0x6a19('0x23')](function(_0x176906){if(_0x176906){return _0x176906['removeBlackLists'](_0x180126[_0x6a19('0x32')][_0x6a19('0x66')]);}})[_0x6a19('0x23')](function(_0x4c5e48){if(_0x4c5e48){return db[_0x6a19('0x62')][_0x6a19('0x24')]({'where':{'ListId':_0x180126[_0x6a19('0x32')][_0x6a19('0x66')],'CampaignId':_0x180126[_0x6a19('0x46')]['id']}})[_0x6a19('0x23')](function(){return _0x4c5e48;});}})[_0x6a19('0x23')](respondWithStatusCode(_0x13e71f,null))[_0x6a19('0x44')](handleError(_0x13e71f,null));};
\ No newline at end of file
+var _0x9990=['into','cm_hopper','ListId','select','field','NOW()','scheduledAt','ContactId','CmListId','toString','updatedAt','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','phone','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','push','removeBlackLists','eml-format','zip-dir','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','filters','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','params','keys','intersection','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','omit','createdAt','IvrCampaigns','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CampaignId','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','insert'];(function(_0x18f713,_0x379588){var _0x4d524a=function(_0x405ef4){while(--_0x405ef4){_0x18f713['push'](_0x18f713['shift']());}};_0x4d524a(++_0x379588);}(_0x9990,0xa8));var _0x0999=function(_0x8033a9,_0x23db75){_0x8033a9=_0x8033a9-0x0;var _0x4af01f=_0x9990[_0x8033a9];return _0x4af01f;};'use strict';var emlformat=require(_0x0999('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0999('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0999('0x2'));var moment=require(_0x0999('0x3'));var BPromise=require(_0x0999('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0999('0x5'));var sox=require(_0x0999('0x6'));var csv=require('to-csv');var ejs=require(_0x0999('0x7'));var fs=require('fs');var fs_extra=require(_0x0999('0x8'));var _=require(_0x0999('0x9'));var squel=require(_0x0999('0xa'));var crypto=require(_0x0999('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0999('0xc'));var toCsv=require(_0x0999('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0999('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0999('0xf'));var as=require(_0x0999('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0999('0x11'))(_0x0999('0x12'));var utils=require(_0x0999('0x13'));var config=require(_0x0999('0x14'));var licenseUtil=require(_0x0999('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50af2c,_0x508f94){_0x508f94=_0x508f94||0xcc;return function(_0x70c45c){if(_0x70c45c){return _0x50af2c[_0x0999('0x16')](_0x508f94);}return _0x50af2c[_0x0999('0x17')](_0x508f94)[_0x0999('0x18')]();};}function respondWithResult(_0x45fb10,_0xe74d67){_0xe74d67=_0xe74d67||0xc8;return function(_0x6181eb){if(_0x6181eb){return _0x45fb10[_0x0999('0x17')](_0xe74d67)['json'](_0x6181eb);}};}function respondWithFilteredResult(_0x1066f3,_0x97bdaa){return function(_0x1e1d51){if(_0x1e1d51){var _0x11ec09=typeof _0x97bdaa['offset']===_0x0999('0x19')&&typeof _0x97bdaa['limit']==='undefined';var _0x495588=_0x1e1d51[_0x0999('0x1a')];var _0x3f86d8=_0x11ec09?0x0:_0x97bdaa['offset'];var _0x4354d8=_0x11ec09?_0x1e1d51[_0x0999('0x1a')]:_0x97bdaa[_0x0999('0x1b')]+_0x97bdaa[_0x0999('0x1c')];var _0x128933;if(_0x4354d8>=_0x495588){_0x4354d8=_0x495588;_0x128933=0xc8;}else{_0x128933=0xce;}_0x1066f3[_0x0999('0x17')](_0x128933);return _0x1066f3[_0x0999('0x1d')](_0x0999('0x1e'),_0x3f86d8+'-'+_0x4354d8+'/'+_0x495588)[_0x0999('0x1f')](_0x1e1d51);}return null;};}function patchUpdates(_0x55761f){return function(_0x430e77){try{jsonpatch[_0x0999('0x20')](_0x430e77,_0x55761f,!![]);}catch(_0x2605f5){return BPromise[_0x0999('0x21')](_0x2605f5);}return _0x430e77['save']();};}function saveUpdates(_0x45a790,_0x35da19){return function(_0x5c6f8b){if(_0x5c6f8b){return _0x5c6f8b[_0x0999('0x22')](_0x45a790)[_0x0999('0x23')](function(_0xe75920){return _0xe75920;});}return null;};}function removeEntity(_0x1b3a4a,_0x154671){return function(_0x46a931){if(_0x46a931){return _0x46a931[_0x0999('0x24')]()[_0x0999('0x23')](function(){var _0xc95bb2=_0x46a931[_0x0999('0x25')]({'plain':!![]});var _0x5dab60='IvrCampaigns';return db[_0x0999('0x26')][_0x0999('0x24')]({'where':{'type':_0x5dab60,'resourceId':_0xc95bb2['id']}})[_0x0999('0x23')](function(){return _0x46a931;});})[_0x0999('0x23')](function(){_0x1b3a4a[_0x0999('0x17')](0xcc)[_0x0999('0x18')]();});}};}function handleEntityNotFound(_0x47e22c,_0x1221d4){return function(_0x4f1ca1){if(!_0x4f1ca1){_0x47e22c['sendStatus'](0x194);}return _0x4f1ca1;};}function handleError(_0x40c277,_0x4ab939){_0x4ab939=_0x4ab939||0x1f4;return function(_0x400acf){logger[_0x0999('0x27')](_0x400acf[_0x0999('0x28')]);if(_0x400acf[_0x0999('0x29')]){delete _0x400acf[_0x0999('0x29')];}_0x40c277[_0x0999('0x17')](_0x4ab939)[_0x0999('0x2a')](_0x400acf);};}exports[_0x0999('0x2b')]=function(_0x1bde8a,_0x232c73){var _0x320851={},_0x327f86={},_0x25b238={'count':0x0,'rows':[]};var _0x2c0ca1=_[_0x0999('0x2c')](db[_0x0999('0x2d')][_0x0999('0x2e')],function(_0x463678){return{'name':_0x463678[_0x0999('0x2f')],'type':_0x463678[_0x0999('0x30')][_0x0999('0x31')]};});_0x327f86[_0x0999('0x32')]=_['map'](_0x2c0ca1,_0x0999('0x29'));_0x327f86['query']=_['keys'](_0x1bde8a['query']);_0x327f86[_0x0999('0x33')]=_['intersection'](_0x327f86[_0x0999('0x32')],_0x327f86[_0x0999('0x34')]);_0x320851[_0x0999('0x35')]=_['intersection'](_0x327f86[_0x0999('0x32')],qs[_0x0999('0x36')](_0x1bde8a[_0x0999('0x34')]['fields']));_0x320851['attributes']=_0x320851[_0x0999('0x35')][_0x0999('0x37')]?_0x320851[_0x0999('0x35')]:_0x327f86[_0x0999('0x32')];if(!_0x1bde8a[_0x0999('0x34')][_0x0999('0x38')](_0x0999('0x39'))){_0x320851[_0x0999('0x1c')]=qs[_0x0999('0x1c')](_0x1bde8a[_0x0999('0x34')][_0x0999('0x1c')]);_0x320851[_0x0999('0x1b')]=qs[_0x0999('0x1b')](_0x1bde8a[_0x0999('0x34')][_0x0999('0x1b')]);}_0x320851[_0x0999('0x3a')]=qs['sort'](_0x1bde8a[_0x0999('0x34')][_0x0999('0x3b')]);_0x320851['where']=qs[_0x0999('0x33')](_[_0x0999('0x3c')](_0x1bde8a['query'],_0x327f86[_0x0999('0x33')]),_0x2c0ca1);if(_0x1bde8a[_0x0999('0x34')][_0x0999('0x3d')]){_0x320851[_0x0999('0x3e')]=_['merge'](_0x320851[_0x0999('0x3e')],{'$or':_['map'](_0x2c0ca1,function(_0x20454){if(_0x20454[_0x0999('0x30')]!==_0x0999('0x3f')){var _0x438758={};_0x438758[_0x20454[_0x0999('0x29')]]={'$like':'%'+_0x1bde8a['query'][_0x0999('0x3d')]+'%'};return _0x438758;}})});}_0x320851=_[_0x0999('0x40')]({},_0x320851,_0x1bde8a[_0x0999('0x41')]);var _0x5e27d1={'where':_0x320851[_0x0999('0x3e')]};return db[_0x0999('0x2d')]['count'](_0x5e27d1)[_0x0999('0x23')](function(_0x4d11c3){_0x25b238[_0x0999('0x1a')]=_0x4d11c3;if(_0x1bde8a[_0x0999('0x34')]['includeAll']){_0x320851[_0x0999('0x42')]=[{'all':!![]}];}return db[_0x0999('0x2d')][_0x0999('0x43')](_0x320851);})['then'](function(_0x294a8e){_0x25b238[_0x0999('0x44')]=_0x294a8e;return _0x25b238;})['then'](respondWithFilteredResult(_0x232c73,_0x320851))[_0x0999('0x45')](handleError(_0x232c73,null));};exports['show']=function(_0x45b798,_0x464d53){var _0x24c71e={'raw':![],'where':{'id':_0x45b798[_0x0999('0x46')]['id']}},_0x2c6686={};_0x2c6686['model']=_[_0x0999('0x47')](db['Campaign']['rawAttributes']);_0x2c6686[_0x0999('0x34')]=_['keys'](_0x45b798[_0x0999('0x34')]);_0x2c6686[_0x0999('0x33')]=_[_0x0999('0x48')](_0x2c6686[_0x0999('0x32')],_0x2c6686[_0x0999('0x34')]);_0x24c71e[_0x0999('0x35')]=_[_0x0999('0x48')](_0x2c6686[_0x0999('0x32')],qs[_0x0999('0x36')](_0x45b798['query'][_0x0999('0x36')]));_0x24c71e['attributes']=_0x24c71e[_0x0999('0x35')][_0x0999('0x37')]?_0x24c71e[_0x0999('0x35')]:_0x2c6686[_0x0999('0x32')];if(_0x45b798['query'][_0x0999('0x49')]){_0x24c71e[_0x0999('0x42')]=[{'all':!![]}];}_0x24c71e=_[_0x0999('0x40')]({},_0x24c71e,_0x45b798[_0x0999('0x41')]);return db[_0x0999('0x2d')][_0x0999('0x4a')](_0x24c71e)[_0x0999('0x23')](handleEntityNotFound(_0x464d53,null))[_0x0999('0x23')](respondWithResult(_0x464d53,null))[_0x0999('0x45')](handleError(_0x464d53,null));};exports[_0x0999('0x4b')]=function(_0x15abcb,_0x2b7bcf){return db[_0x0999('0x2d')]['create'](_0x15abcb[_0x0999('0x4c')],{})[_0x0999('0x23')](function(_0x557ab5){var _0x457f7c=_0x15abcb[_0x0999('0x4d')][_0x0999('0x25')]({'plain':!![]});if(!_0x457f7c)throw new Error(_0x0999('0x4e'));if(_0x457f7c[_0x0999('0x4f')]==='user'){var _0x28841a=_0x557ab5[_0x0999('0x25')]({'plain':!![]});var _0x43fe4a='IvrCampaigns';return db[_0x0999('0x50')][_0x0999('0x4a')]({'where':{'name':_0x43fe4a,'userProfileId':_0x457f7c[_0x0999('0x51')]},'raw':!![]})[_0x0999('0x23')](function(_0x44db1d){if(_0x44db1d&&_0x44db1d['autoAssociation']===0x0){return db[_0x0999('0x26')][_0x0999('0x4b')]({'name':_0x28841a[_0x0999('0x29')],'resourceId':_0x28841a['id'],'type':_0x44db1d[_0x0999('0x29')],'sectionId':_0x44db1d['id']},{})['then'](function(){return _0x557ab5;});}else{return _0x557ab5;}})[_0x0999('0x45')](function(_0x497e2d){logger[_0x0999('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x497e2d);throw _0x497e2d;});}return _0x557ab5;})[_0x0999('0x23')](respondWithResult(_0x2b7bcf,0xc9))[_0x0999('0x45')](handleError(_0x2b7bcf,null));};exports['clone']=function(_0x265785,_0x1c7418){var _0x1ba2ee={'where':{'id':_0x265785[_0x0999('0x46')]['id']}},_0x36f561={};_0x36f561[_0x0999('0x32')]=_['keys'](db[_0x0999('0x2d')][_0x0999('0x2e')]);_0x1ba2ee[_0x0999('0x35')]=_[_0x0999('0x48')](_0x36f561[_0x0999('0x32')],qs[_0x0999('0x36')](_0x265785[_0x0999('0x34')][_0x0999('0x36')]));_0x1ba2ee['attributes']=_0x1ba2ee[_0x0999('0x35')][_0x0999('0x37')]?_0x1ba2ee[_0x0999('0x35')]:_0x36f561[_0x0999('0x32')];if(_0x265785[_0x0999('0x34')]['includeAll']){_0x1ba2ee[_0x0999('0x42')]=[{'all':!![]}];}_0x1ba2ee=_['merge']({},_0x1ba2ee,_0x265785[_0x0999('0x41')]);return db[_0x0999('0x2d')][_0x0999('0x4a')](_0x1ba2ee)[_0x0999('0x23')](handleEntityNotFound(_0x1c7418,null))[_0x0999('0x23')](function(_0x64576d){if(_0x64576d){var _0x24ef48=_0x64576d[_0x0999('0x25')]({'plain':!![]});_0x24ef48=qs[_0x0999('0x52')](_0x24ef48,['id',_0x0999('0x53'),'updatedAt']);_0x265785[_0x0999('0x4c')]=_[_0x0999('0x52')](_0x265785[_0x0999('0x4c')],['id',_0x0999('0x53'),'updatedAt']);return db[_0x0999('0x2d')][_0x0999('0x4b')](_[_0x0999('0x40')](_0x24ef48,_0x265785[_0x0999('0x4c')]),{'include':_0x265785['query']['includeAll']?[{'all':!![]}]:undefined})[_0x0999('0x23')](function(_0xa83846){var _0x4428b6=_0x265785['user']['get']({'plain':!![]});if(!_0x4428b6)throw new Error(_0x0999('0x4e'));if(_0x4428b6[_0x0999('0x4f')]==='user'){var _0x106068=_0xa83846[_0x0999('0x25')]({'plain':!![]});var _0x21a436=_0x0999('0x54');return db['UserProfileSection']['find']({'where':{'name':_0x21a436,'userProfileId':_0x4428b6['userProfileId']},'raw':!![]})['then'](function(_0x3e3a56){if(_0x3e3a56&&_0x3e3a56[_0x0999('0x55')]===0x0){return db[_0x0999('0x26')][_0x0999('0x4b')]({'name':_0x106068[_0x0999('0x29')],'resourceId':_0x106068['id'],'type':_0x3e3a56[_0x0999('0x29')],'sectionId':_0x3e3a56['id']},{})[_0x0999('0x23')](function(){return _0xa83846;});}else{return _0xa83846;}})['catch'](function(_0x3f0196){logger[_0x0999('0x27')](_0x0999('0x56'),_0x3f0196);throw _0x3f0196;});}return _0xa83846;});}})['then'](respondWithResult(_0x1c7418,0xc9))[_0x0999('0x45')](handleError(_0x1c7418,null));};exports['update']=function(_0x28b440,_0x386da0){if(_0x28b440[_0x0999('0x4c')]['id']){delete _0x28b440[_0x0999('0x4c')]['id'];}return db[_0x0999('0x2d')][_0x0999('0x4a')]({'where':{'id':_0x28b440[_0x0999('0x46')]['id']}})[_0x0999('0x23')](handleEntityNotFound(_0x386da0,null))['then'](saveUpdates(_0x28b440[_0x0999('0x4c')],null))[_0x0999('0x23')](respondWithResult(_0x386da0,null))[_0x0999('0x45')](handleError(_0x386da0,null));};exports[_0x0999('0x24')]=function(_0xc7b3f4,_0x198a43){return db[_0x0999('0x2d')][_0x0999('0x4a')]({'where':{'id':_0xc7b3f4[_0x0999('0x46')]['id']}})[_0x0999('0x23')](handleEntityNotFound(_0x198a43,null))['then'](removeEntity(_0x198a43,null))[_0x0999('0x45')](handleError(_0x198a43,null));};exports[_0x0999('0x57')]=function(_0x5b8770,_0x4d4607,_0x2a9edc){var _0x4ae2de={'raw':!![],'where':{}};var _0x30a0da={};var _0x3987ee={'count':0x0,'rows':[]};return db[_0x0999('0x2d')][_0x0999('0x58')]({'where':{'id':_0x5b8770[_0x0999('0x46')]['id']}})[_0x0999('0x23')](handleEntityNotFound(_0x4d4607,null))['then'](function(_0x246e42){if(_0x246e42){_0x30a0da['model']=_['keys'](db[_0x0999('0x59')][_0x0999('0x2e')]);_0x30a0da[_0x0999('0x34')]=_[_0x0999('0x47')](_0x5b8770['query']);_0x30a0da[_0x0999('0x33')]=_[_0x0999('0x48')](_0x30a0da[_0x0999('0x32')],_0x30a0da['query']);_0x4ae2de[_0x0999('0x35')]=_['intersection'](_0x30a0da[_0x0999('0x32')],qs[_0x0999('0x36')](_0x5b8770['query'][_0x0999('0x36')]));_0x4ae2de[_0x0999('0x35')]=_0x4ae2de[_0x0999('0x35')][_0x0999('0x37')]?_0x4ae2de[_0x0999('0x35')]:_0x30a0da['model'];if(!_0x5b8770[_0x0999('0x34')][_0x0999('0x38')](_0x0999('0x39'))){_0x4ae2de['limit']=qs['limit'](_0x5b8770[_0x0999('0x34')][_0x0999('0x1c')]);_0x4ae2de[_0x0999('0x1b')]=qs[_0x0999('0x1b')](_0x5b8770[_0x0999('0x34')][_0x0999('0x1b')]);}_0x4ae2de['order']=qs[_0x0999('0x3b')](_0x5b8770[_0x0999('0x34')][_0x0999('0x3b')]);_0x4ae2de[_0x0999('0x3e')]=qs['filters'](_[_0x0999('0x3c')](_0x5b8770[_0x0999('0x34')],_0x30a0da['filters']));_0x4ae2de[_0x0999('0x3e')]['CampaignId']=_0x246e42['id'];if(_0x5b8770[_0x0999('0x34')][_0x0999('0x3d')]){_0x4ae2de[_0x0999('0x3e')]=_[_0x0999('0x40')](_0x4ae2de[_0x0999('0x3e')],{'$or':_['map'](_0x4ae2de[_0x0999('0x35')],function(_0x3712c2){var _0x152aaf={};_0x152aaf[_0x3712c2]={'$like':'%'+_0x5b8770[_0x0999('0x34')][_0x0999('0x3d')]+'%'};return _0x152aaf;})});}_0x4ae2de=_[_0x0999('0x40')]({},_0x4ae2de,_0x5b8770[_0x0999('0x41')]);return db[_0x0999('0x59')][_0x0999('0x1a')]({'where':_0x4ae2de[_0x0999('0x3e')]})[_0x0999('0x23')](function(_0x4452b6){_0x3987ee[_0x0999('0x1a')]=_0x4452b6;if(_0x5b8770[_0x0999('0x34')][_0x0999('0x49')]){_0x4ae2de[_0x0999('0x42')]=[{'all':!![]}];}return db['CmHopper'][_0x0999('0x43')](_0x4ae2de);})['then'](function(_0x2dbd3a){_0x3987ee[_0x0999('0x44')]=_0x2dbd3a;return _0x3987ee;});}})[_0x0999('0x23')](respondWithFilteredResult(_0x4d4607,_0x4ae2de))['catch'](handleError(_0x4d4607,null));};exports[_0x0999('0x5a')]=function(_0x2ee7dd,_0x3526a4,_0x1224ab){var _0x28e7c1={'raw':!![],'where':{}};var _0x1495d5={};var _0x2f8a46={'count':0x0,'rows':[]};return db[_0x0999('0x2d')][_0x0999('0x58')]({'where':{'id':_0x2ee7dd[_0x0999('0x46')]['id']}})['then'](handleEntityNotFound(_0x3526a4,null))[_0x0999('0x23')](function(_0x34c021){if(_0x34c021){_0x1495d5[_0x0999('0x32')]=_[_0x0999('0x47')](db[_0x0999('0x5b')][_0x0999('0x2e')]);_0x1495d5[_0x0999('0x34')]=_[_0x0999('0x47')](_0x2ee7dd[_0x0999('0x34')]);_0x1495d5['filters']=_['intersection'](_0x1495d5[_0x0999('0x32')],_0x1495d5[_0x0999('0x34')]);_0x28e7c1[_0x0999('0x35')]=_[_0x0999('0x48')](_0x1495d5[_0x0999('0x32')],qs[_0x0999('0x36')](_0x2ee7dd[_0x0999('0x34')]['fields']));_0x28e7c1['attributes']=_0x28e7c1[_0x0999('0x35')][_0x0999('0x37')]?_0x28e7c1['attributes']:_0x1495d5[_0x0999('0x32')];if(!_0x2ee7dd[_0x0999('0x34')][_0x0999('0x38')](_0x0999('0x39'))){_0x28e7c1[_0x0999('0x1c')]=qs[_0x0999('0x1c')](_0x2ee7dd[_0x0999('0x34')][_0x0999('0x1c')]);_0x28e7c1[_0x0999('0x1b')]=qs[_0x0999('0x1b')](_0x2ee7dd[_0x0999('0x34')][_0x0999('0x1b')]);}_0x28e7c1[_0x0999('0x3a')]=qs['sort'](_0x2ee7dd['query'][_0x0999('0x3b')]);_0x28e7c1[_0x0999('0x3e')]=qs['filters'](_[_0x0999('0x3c')](_0x2ee7dd[_0x0999('0x34')],_0x1495d5[_0x0999('0x33')]));_0x28e7c1[_0x0999('0x3e')]['CampaignId']=_0x34c021['id'];if(_0x2ee7dd['query']['filter']){_0x28e7c1[_0x0999('0x3e')]=_[_0x0999('0x40')](_0x28e7c1[_0x0999('0x3e')],{'$or':_[_0x0999('0x2c')](_0x28e7c1[_0x0999('0x35')],function(_0x2cc80d){var _0x46847e={};_0x46847e[_0x2cc80d]={'$like':'%'+_0x2ee7dd[_0x0999('0x34')]['filter']+'%'};return _0x46847e;})});}_0x28e7c1=_['merge']({},_0x28e7c1,_0x2ee7dd[_0x0999('0x41')]);return db[_0x0999('0x5b')][_0x0999('0x1a')]({'where':_0x28e7c1[_0x0999('0x3e')]})[_0x0999('0x23')](function(_0x2009f8){_0x2f8a46[_0x0999('0x1a')]=_0x2009f8;if(_0x2ee7dd['query'][_0x0999('0x49')]){_0x28e7c1[_0x0999('0x42')]=[{'all':!![]}];}return db[_0x0999('0x5b')][_0x0999('0x43')](_0x28e7c1);})['then'](function(_0x21b1d5){_0x2f8a46[_0x0999('0x44')]=_0x21b1d5;return _0x2f8a46;});}})[_0x0999('0x23')](respondWithFilteredResult(_0x3526a4,_0x28e7c1))[_0x0999('0x45')](handleError(_0x3526a4,null));};exports[_0x0999('0x5c')]=function(_0x59bd3b,_0x35c1fd,_0x37e888){var _0x219d8b={'raw':!![],'where':{}};var _0x2fea6f={};var _0x2a0265={'count':0x0,'rows':[]};return db[_0x0999('0x2d')]['findOne']({'where':{'id':_0x59bd3b['params']['id']}})[_0x0999('0x23')](handleEntityNotFound(_0x35c1fd,null))['then'](function(_0x525bbe){if(_0x525bbe){_0x2fea6f[_0x0999('0x32')]=_[_0x0999('0x47')](db[_0x0999('0x5d')][_0x0999('0x2e')]);_0x2fea6f[_0x0999('0x34')]=_[_0x0999('0x47')](_0x59bd3b[_0x0999('0x34')]);_0x2fea6f[_0x0999('0x33')]=_['intersection'](_0x2fea6f[_0x0999('0x32')],_0x2fea6f[_0x0999('0x34')]);_0x219d8b[_0x0999('0x35')]=_[_0x0999('0x48')](_0x2fea6f[_0x0999('0x32')],qs[_0x0999('0x36')](_0x59bd3b[_0x0999('0x34')][_0x0999('0x36')]));_0x219d8b[_0x0999('0x35')]=_0x219d8b[_0x0999('0x35')]['length']?_0x219d8b[_0x0999('0x35')]:_0x2fea6f[_0x0999('0x32')];if(!_0x59bd3b[_0x0999('0x34')]['hasOwnProperty'](_0x0999('0x39'))){_0x219d8b[_0x0999('0x1c')]=qs[_0x0999('0x1c')](_0x59bd3b['query'][_0x0999('0x1c')]);_0x219d8b[_0x0999('0x1b')]=qs['offset'](_0x59bd3b[_0x0999('0x34')][_0x0999('0x1b')]);}_0x219d8b['order']=qs[_0x0999('0x3b')](_0x59bd3b[_0x0999('0x34')][_0x0999('0x3b')]);_0x219d8b[_0x0999('0x3e')]=qs[_0x0999('0x33')](_[_0x0999('0x3c')](_0x59bd3b['query'],_0x2fea6f[_0x0999('0x33')]));_0x219d8b['where'][_0x0999('0x5e')]=_0x525bbe['id'];if(_0x59bd3b[_0x0999('0x34')]['filter']){_0x219d8b[_0x0999('0x3e')]=_[_0x0999('0x40')](_0x219d8b[_0x0999('0x3e')],{'$or':_['map'](_0x219d8b[_0x0999('0x35')],function(_0x58ffe7){var _0x54e7d9={};_0x54e7d9[_0x58ffe7]={'$like':'%'+_0x59bd3b[_0x0999('0x34')]['filter']+'%'};return _0x54e7d9;})});}_0x219d8b=_[_0x0999('0x40')]({},_0x219d8b,_0x59bd3b[_0x0999('0x41')]);return db[_0x0999('0x5d')]['count']({'where':_0x219d8b['where']})[_0x0999('0x23')](function(_0xd6019a){_0x2a0265[_0x0999('0x1a')]=_0xd6019a;if(_0x59bd3b[_0x0999('0x34')][_0x0999('0x49')]){_0x219d8b[_0x0999('0x42')]=[{'all':!![]}];}return db[_0x0999('0x5d')][_0x0999('0x43')](_0x219d8b);})[_0x0999('0x23')](function(_0x5c35cf){_0x2a0265[_0x0999('0x44')]=_0x5c35cf;return _0x2a0265;});}})['then'](respondWithFilteredResult(_0x35c1fd,_0x219d8b))['catch'](handleError(_0x35c1fd,null));};exports['getHopperBlacks']=function(_0xb51bb8,_0x3ea772,_0x4a5516){var _0xe9bd52={'raw':!![],'where':{}};var _0x156b05={};var _0x5b47f4={'count':0x0,'rows':[]};return db[_0x0999('0x2d')][_0x0999('0x58')]({'where':{'id':_0xb51bb8[_0x0999('0x46')]['id']}})['then'](handleEntityNotFound(_0x3ea772,null))[_0x0999('0x23')](function(_0x4721aa){if(_0x4721aa){_0x156b05[_0x0999('0x32')]=_[_0x0999('0x47')](db[_0x0999('0x5f')]['rawAttributes']);_0x156b05['query']=_[_0x0999('0x47')](_0xb51bb8[_0x0999('0x34')]);_0x156b05[_0x0999('0x33')]=_[_0x0999('0x48')](_0x156b05['model'],_0x156b05['query']);_0xe9bd52[_0x0999('0x35')]=_[_0x0999('0x48')](_0x156b05[_0x0999('0x32')],qs['fields'](_0xb51bb8[_0x0999('0x34')][_0x0999('0x36')]));_0xe9bd52[_0x0999('0x35')]=_0xe9bd52[_0x0999('0x35')][_0x0999('0x37')]?_0xe9bd52[_0x0999('0x35')]:_0x156b05[_0x0999('0x32')];if(!_0xb51bb8[_0x0999('0x34')][_0x0999('0x38')](_0x0999('0x39'))){_0xe9bd52[_0x0999('0x1c')]=qs[_0x0999('0x1c')](_0xb51bb8['query']['limit']);_0xe9bd52['offset']=qs['offset'](_0xb51bb8['query']['offset']);}_0xe9bd52[_0x0999('0x3a')]=qs[_0x0999('0x3b')](_0xb51bb8['query'][_0x0999('0x3b')]);_0xe9bd52[_0x0999('0x3e')]=qs[_0x0999('0x33')](_[_0x0999('0x3c')](_0xb51bb8[_0x0999('0x34')],_0x156b05[_0x0999('0x33')]));_0xe9bd52['where'][_0x0999('0x5e')]=_0x4721aa['id'];if(_0xb51bb8[_0x0999('0x34')][_0x0999('0x3d')]){_0xe9bd52[_0x0999('0x3e')]=_['merge'](_0xe9bd52[_0x0999('0x3e')],{'$or':_[_0x0999('0x2c')](_0xe9bd52[_0x0999('0x35')],function(_0x241809){var _0x15f647={};_0x15f647[_0x241809]={'$like':'%'+_0xb51bb8['query'][_0x0999('0x3d')]+'%'};return _0x15f647;})});}_0xe9bd52=_[_0x0999('0x40')]({},_0xe9bd52,_0xb51bb8['options']);return db['CmHopperBlack']['count']({'where':_0xe9bd52[_0x0999('0x3e')]})['then'](function(_0x7048b8){_0x5b47f4[_0x0999('0x1a')]=_0x7048b8;if(_0xb51bb8[_0x0999('0x34')][_0x0999('0x49')]){_0xe9bd52[_0x0999('0x42')]=[{'all':!![]}];}return db[_0x0999('0x5f')][_0x0999('0x43')](_0xe9bd52);})['then'](function(_0x74efb2){_0x5b47f4[_0x0999('0x44')]=_0x74efb2;return _0x5b47f4;});}})['then'](respondWithFilteredResult(_0x3ea772,_0xe9bd52))[_0x0999('0x45')](handleError(_0x3ea772,null));};exports[_0x0999('0x60')]=function(_0x5635d6,_0x1bdd98,_0x5382e5){var _0x3fc723={};var _0x4ddf2a={};var _0x2c0d4e;var _0x4cd956;return db[_0x0999('0x2d')]['findOne']({'where':{'id':_0x5635d6[_0x0999('0x46')]['id']}})['then'](handleEntityNotFound(_0x1bdd98,null))['then'](function(_0x5d6c00){if(_0x5d6c00){_0x2c0d4e=_0x5d6c00;_0x4ddf2a[_0x0999('0x32')]=_[_0x0999('0x47')](db['CmList'][_0x0999('0x2e')]);_0x4ddf2a[_0x0999('0x34')]=_[_0x0999('0x47')](_0x5635d6[_0x0999('0x34')]);_0x4ddf2a[_0x0999('0x33')]=_[_0x0999('0x48')](_0x4ddf2a[_0x0999('0x32')],_0x4ddf2a[_0x0999('0x34')]);_0x3fc723['attributes']=_['intersection'](_0x4ddf2a[_0x0999('0x32')],qs[_0x0999('0x36')](_0x5635d6[_0x0999('0x34')][_0x0999('0x36')]));_0x3fc723['attributes']=_0x3fc723[_0x0999('0x35')][_0x0999('0x37')]?_0x3fc723[_0x0999('0x35')]:_0x4ddf2a[_0x0999('0x32')];_0x3fc723[_0x0999('0x3a')]=qs[_0x0999('0x3b')](_0x5635d6[_0x0999('0x34')][_0x0999('0x3b')]);_0x3fc723[_0x0999('0x3e')]=qs[_0x0999('0x33')](_[_0x0999('0x3c')](_0x5635d6[_0x0999('0x34')],_0x4ddf2a[_0x0999('0x33')]));if(_0x5635d6[_0x0999('0x34')][_0x0999('0x3d')]){_0x3fc723[_0x0999('0x3e')]=_[_0x0999('0x40')](_0x3fc723[_0x0999('0x3e')],{'$or':_[_0x0999('0x2c')](_0x3fc723[_0x0999('0x35')],function(_0x2187ab){var _0x5b2a13={};_0x5b2a13[_0x2187ab]={'$like':'%'+_0x5635d6[_0x0999('0x34')][_0x0999('0x3d')]+'%'};return _0x5b2a13;})});}_0x3fc723=_[_0x0999('0x40')]({},_0x3fc723,_0x5635d6[_0x0999('0x41')]);return _0x2c0d4e[_0x0999('0x60')](_0x3fc723);}})['then'](function(_0x5eb6ca){if(_0x5eb6ca){_0x4cd956=_0x5eb6ca[_0x0999('0x37')];if(!_0x5635d6[_0x0999('0x34')][_0x0999('0x38')]('nolimit')){_0x3fc723[_0x0999('0x1c')]=qs[_0x0999('0x1c')](_0x5635d6[_0x0999('0x34')]['limit']);_0x3fc723['offset']=qs[_0x0999('0x1b')](_0x5635d6[_0x0999('0x34')][_0x0999('0x1b')]);}return _0x2c0d4e[_0x0999('0x60')](_0x3fc723);}})['then'](function(_0x5f41f6){if(_0x5f41f6){return _0x5f41f6?{'count':_0x4cd956,'rows':_0x5f41f6}:null;}})[_0x0999('0x23')](respondWithResult(_0x1bdd98,null))[_0x0999('0x45')](handleError(_0x1bdd98,null));};exports[_0x0999('0x61')]=function(_0xb51c01,_0x47cfe2,_0x4546c7){var _0x25c88f,_0x2e759b;return db[_0x0999('0x2d')][_0x0999('0x4a')]({'where':{'id':_0xb51c01[_0x0999('0x46')]['id']}})['then'](handleEntityNotFound(_0x47cfe2,null))['then'](function(_0x809ddd){if(_0x809ddd){_0x2e759b=_0x809ddd;return _0x809ddd[_0x0999('0x61')](_0xb51c01[_0x0999('0x4c')][_0x0999('0x62')],_[_0x0999('0x52')](_0xb51c01[_0x0999('0x4c')],[_0x0999('0x62'),'id'])||{});}return null;})[_0x0999('0x63')](function(_0x8956c){var _0x59e545;_0x25c88f=_0x8956c||[];var _0x1ff849=[];if(_0x8956c){for(var _0x547249=0x0;_0x547249<_0x8956c['length'];_0x547249+=0x1){var _0x27d318=_0x8956c[_0x547249][_0x0999('0x25')]({'plain':!![]});_0x2e759b[_0x0999('0x64')]=_0xb51c01[_0x0999('0x4c')]['dialCheckDuplicateType']?_0xb51c01[_0x0999('0x4c')]['dialCheckDuplicateType']:_0x2e759b[_0x0999('0x64')];switch(_0x2e759b[_0x0999('0x64')]){case'always':_0x59e545=squel[_0x0999('0x65')]()[_0x0999('0x66')](_0x0999('0x67'))['fromQuery'](['phone','scheduledAt','ContactId',_0x0999('0x68'),_0x0999('0x5e'),_0x0999('0x53'),'updatedAt'],squel[_0x0999('0x69')]()['field']('phone','phone')[_0x0999('0x6a')](_0x0999('0x6b'),_0x0999('0x6c'))[_0x0999('0x6a')]('id',_0x0999('0x6d'))[_0x0999('0x6a')](_0x27d318[_0x0999('0x6e')][_0x0999('0x6f')](),_0x0999('0x68'))[_0x0999('0x6a')](_0xb51c01[_0x0999('0x46')]['id']['toString'](),_0x0999('0x5e'))[_0x0999('0x6a')](_0x0999('0x6b'),'createdAt')['field'](_0x0999('0x6b'),_0x0999('0x70'))['from'](_0x0999('0x71'))[_0x0999('0x3e')](_0x0999('0x72'))[_0x0999('0x3e')](_0x0999('0x73'),_0x27d318[_0x0999('0x6e')]['toString']())['where'](_0x0999('0x74'))[_0x0999('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0999('0x69')]()[_0x0999('0x6a')](_0x0999('0x75'))[_0x0999('0x76')](_0x0999('0x77'))[_0x0999('0x3e')](_0x0999('0x78'),_0xb51c01[_0x0999('0x46')]['id']['toString']()))[_0x0999('0x3e')](_0x0999('0x79'),squel[_0x0999('0x69')]()[_0x0999('0x6a')](_0x0999('0x7a'))['from'](_0x0999('0x67'))[_0x0999('0x3e')](_0x0999('0x78'),_0xb51c01[_0x0999('0x46')]['id'][_0x0999('0x6f')]())))[_0x0999('0x6f')]();break;case _0x0999('0x7b'):_0x59e545=squel['insert']()[_0x0999('0x66')]('cm_hopper')[_0x0999('0x7c')]([_0x0999('0x7d'),'scheduledAt',_0x0999('0x6d'),_0x0999('0x68'),_0x0999('0x5e'),_0x0999('0x53'),_0x0999('0x70')],squel[_0x0999('0x69')]()[_0x0999('0x6a')](_0x0999('0x7d'),_0x0999('0x7d'))[_0x0999('0x6a')](_0x0999('0x6b'),_0x0999('0x6c'))[_0x0999('0x6a')]('id',_0x0999('0x6d'))['field'](_0x27d318['CmListId'][_0x0999('0x6f')](),_0x0999('0x68'))[_0x0999('0x6a')](_0xb51c01[_0x0999('0x46')]['id'][_0x0999('0x6f')](),_0x0999('0x5e'))[_0x0999('0x6a')](_0x0999('0x6b'),_0x0999('0x53'))[_0x0999('0x6a')](_0x0999('0x6b'),'updatedAt')[_0x0999('0x76')](_0x0999('0x71'))[_0x0999('0x3e')](_0x0999('0x72'))[_0x0999('0x3e')](_0x0999('0x73'),_0x27d318['CmListId']['toString']())['where'](_0x0999('0x74'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x0999('0x69')]()[_0x0999('0x6a')](_0x0999('0x7a'))[_0x0999('0x76')]('cm_hopper')['where'](_0x0999('0x78'),_0xb51c01[_0x0999('0x46')]['id']['toString']())))[_0x0999('0x6f')]();break;default:_0x59e545=squel[_0x0999('0x65')]()[_0x0999('0x66')]('cm_hopper')[_0x0999('0x7c')]([_0x0999('0x7d'),_0x0999('0x6c'),'ContactId',_0x0999('0x68'),_0x0999('0x5e'),'createdAt',_0x0999('0x70')],squel[_0x0999('0x69')]()[_0x0999('0x6a')](_0x0999('0x7d'),_0x0999('0x7d'))[_0x0999('0x6a')](_0x0999('0x6b'),_0x0999('0x6c'))['field']('id',_0x0999('0x6d'))[_0x0999('0x6a')](_0x27d318[_0x0999('0x6e')]['toString'](),'ListId')['field'](_0xb51c01[_0x0999('0x46')]['id'][_0x0999('0x6f')](),_0x0999('0x5e'))[_0x0999('0x6a')]('NOW()','createdAt')[_0x0999('0x6a')](_0x0999('0x6b'),_0x0999('0x70'))[_0x0999('0x76')](_0x0999('0x71'))[_0x0999('0x3e')](_0x0999('0x72'))[_0x0999('0x3e')](_0x0999('0x73'),_0x27d318['CmListId'][_0x0999('0x6f')]())[_0x0999('0x3e')](_0x0999('0x74')))[_0x0999('0x6f')]();}_0x1ff849['push'](db[_0x0999('0x7e')][_0x0999('0x34')](_0x59e545));}return BPromise[_0x0999('0x7f')](_0x1ff849);}})[_0x0999('0x23')](function(){return _0x25c88f;})[_0x0999('0x23')](respondWithResult(_0x47cfe2,null))[_0x0999('0x45')](handleError(_0x47cfe2,null));};exports['removeLists']=function(_0x2a4d7a,_0xa13da4,_0x55e8c9){return db[_0x0999('0x2d')][_0x0999('0x4a')]({'where':{'id':_0x2a4d7a[_0x0999('0x46')]['id']}})['then'](handleEntityNotFound(_0xa13da4,null))[_0x0999('0x23')](function(_0x2fdc0b){if(_0x2fdc0b){return _0x2fdc0b[_0x0999('0x80')](_0x2a4d7a[_0x0999('0x34')]['ids']);}})['then'](function(_0x521afa){if(_0x521afa){return db[_0x0999('0x59')]['destroy']({'where':{'ListId':_0x2a4d7a[_0x0999('0x34')][_0x0999('0x62')],'CampaignId':_0x2a4d7a['params']['id']}})[_0x0999('0x23')](function(){return _0x521afa;});}})[_0x0999('0x23')](respondWithStatusCode(_0xa13da4,null))['catch'](handleError(_0xa13da4,null));};exports[_0x0999('0x81')]=function(_0xf542f9,_0x240568,_0x318b79){var _0x5afd71={};var _0x29979d={};var _0x4b4a62;var _0x242913;return db['Campaign']['findOne']({'where':{'id':_0xf542f9[_0x0999('0x46')]['id']}})['then'](handleEntityNotFound(_0x240568,null))[_0x0999('0x23')](function(_0x134b1f){if(_0x134b1f){_0x4b4a62=_0x134b1f;_0x29979d[_0x0999('0x32')]=_[_0x0999('0x47')](db[_0x0999('0x82')][_0x0999('0x2e')]);_0x29979d[_0x0999('0x34')]=_['keys'](_0xf542f9[_0x0999('0x34')]);_0x29979d['filters']=_['intersection'](_0x29979d[_0x0999('0x32')],_0x29979d['query']);_0x5afd71['attributes']=_[_0x0999('0x48')](_0x29979d[_0x0999('0x32')],qs[_0x0999('0x36')](_0xf542f9[_0x0999('0x34')][_0x0999('0x36')]));_0x5afd71[_0x0999('0x35')]=_0x5afd71[_0x0999('0x35')][_0x0999('0x37')]?_0x5afd71[_0x0999('0x35')]:_0x29979d[_0x0999('0x32')];_0x5afd71[_0x0999('0x3a')]=qs[_0x0999('0x3b')](_0xf542f9['query'][_0x0999('0x3b')]);_0x5afd71[_0x0999('0x3e')]=qs[_0x0999('0x33')](_[_0x0999('0x3c')](_0xf542f9[_0x0999('0x34')],_0x29979d[_0x0999('0x33')]));if(_0xf542f9[_0x0999('0x34')][_0x0999('0x3d')]){_0x5afd71['where']=_[_0x0999('0x40')](_0x5afd71[_0x0999('0x3e')],{'$or':_[_0x0999('0x2c')](_0x5afd71[_0x0999('0x35')],function(_0x4dada5){var _0x211877={};_0x211877[_0x4dada5]={'$like':'%'+_0xf542f9[_0x0999('0x34')][_0x0999('0x3d')]+'%'};return _0x211877;})});}_0x5afd71=_[_0x0999('0x40')]({},_0x5afd71,_0xf542f9['options']);return _0x4b4a62[_0x0999('0x81')](_0x5afd71);}})[_0x0999('0x23')](function(_0x19cfb5){if(_0x19cfb5){_0x242913=_0x19cfb5[_0x0999('0x37')];if(!_0xf542f9[_0x0999('0x34')][_0x0999('0x38')](_0x0999('0x39'))){_0x5afd71[_0x0999('0x1c')]=qs[_0x0999('0x1c')](_0xf542f9[_0x0999('0x34')][_0x0999('0x1c')]);_0x5afd71['offset']=qs[_0x0999('0x1b')](_0xf542f9[_0x0999('0x34')][_0x0999('0x1b')]);}return _0x4b4a62['getBlackLists'](_0x5afd71);}})[_0x0999('0x23')](function(_0x2c5bee){if(_0x2c5bee){return _0x2c5bee?{'count':_0x242913,'rows':_0x2c5bee}:null;}})[_0x0999('0x23')](respondWithResult(_0x240568,null))['catch'](handleError(_0x240568,null));};exports[_0x0999('0x83')]=function(_0x50e95f,_0x43f7bb,_0x42191b){var _0xd31557,_0x704d2f;return db[_0x0999('0x2d')][_0x0999('0x4a')]({'where':{'id':_0x50e95f[_0x0999('0x46')]['id']}})[_0x0999('0x23')](handleEntityNotFound(_0x43f7bb,null))[_0x0999('0x23')](function(_0x319ec8){if(_0x319ec8){_0x704d2f=_0x319ec8;return _0x319ec8['addBlackLists'](_0x50e95f[_0x0999('0x4c')]['ids'],_[_0x0999('0x52')](_0x50e95f[_0x0999('0x4c')],[_0x0999('0x62'),'id'])||{});}return null;})[_0x0999('0x63')](function(_0x5b6e10){var _0x16ae05;_0xd31557=_0x5b6e10||[];var _0x42cdeb=[];if(_0x5b6e10){for(var _0x2c36d1=0x0;_0x2c36d1<_0x5b6e10['length'];_0x2c36d1+=0x1){var _0x2cd537=_0x5b6e10[_0x2c36d1][_0x0999('0x25')]({'plain':!![]});_0x16ae05=squel[_0x0999('0x65')]()[_0x0999('0x66')](_0x0999('0x84'))['fromQuery'](['phone',_0x0999('0x6d'),'ListId','CampaignId',_0x0999('0x53'),_0x0999('0x70')],squel[_0x0999('0x69')]()[_0x0999('0x6a')](_0x0999('0x7d'),_0x0999('0x7d'))[_0x0999('0x6a')]('id',_0x0999('0x6d'))['field'](_0x2cd537[_0x0999('0x6e')][_0x0999('0x6f')](),_0x0999('0x68'))['field'](_0x50e95f[_0x0999('0x46')]['id'][_0x0999('0x6f')](),_0x0999('0x5e'))[_0x0999('0x6a')](_0x0999('0x6b'),_0x0999('0x53'))['field'](_0x0999('0x6b'),'updatedAt')[_0x0999('0x76')](_0x0999('0x71'))['where'](_0x0999('0x72'))['where'](_0x0999('0x73'),_0x2cd537[_0x0999('0x6e')][_0x0999('0x6f')]())['where'](_0x0999('0x74')))[_0x0999('0x6f')]();_0x42cdeb[_0x0999('0x85')](db['sequelize'][_0x0999('0x34')](_0x16ae05));}return BPromise[_0x0999('0x7f')](_0x42cdeb);}})['then'](function(){return _0xd31557;})[_0x0999('0x23')](respondWithResult(_0x43f7bb,null))[_0x0999('0x45')](handleError(_0x43f7bb,null));};exports['removeBlackLists']=function(_0x2080d4,_0x55a2a5,_0x1f2102){return db[_0x0999('0x2d')]['find']({'where':{'id':_0x2080d4[_0x0999('0x46')]['id']}})[_0x0999('0x23')](handleEntityNotFound(_0x55a2a5,null))[_0x0999('0x23')](function(_0x18964f){if(_0x18964f){return _0x18964f[_0x0999('0x86')](_0x2080d4[_0x0999('0x34')]['ids']);}})['then'](function(_0x459baf){if(_0x459baf){return db['CmHopperBlack'][_0x0999('0x24')]({'where':{'ListId':_0x2080d4[_0x0999('0x34')][_0x0999('0x62')],'CampaignId':_0x2080d4['params']['id']}})[_0x0999('0x23')](function(){return _0x459baf;});}})['then'](respondWithStatusCode(_0x55a2a5,null))[_0x0999('0x45')](handleError(_0x55a2a5,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index df77e50..f1fbe1b 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x1c50d6,_0x1097f2){var _0x566560=function(_0x7fad7){while(--_0x7fad7){_0x1c50d6['push'](_0x1c50d6['shift']());}};_0x566560(++_0x1097f2);}(_0x7a54,0x106));var _0x47a5=function(_0x360072,_0x30daf4){_0x360072=_0x360072-0x0;var _0x44cd9b=_0x7a54[_0x360072];return _0x44cd9b;};'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 89858a9..8c312a9 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 _0xa900=['Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','Campaign','findAll','options','raw','attributes','limit','include','map','model','GetCampaign','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','Campaign,\x20%s,\x20%s','debug'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa900,0x101));var _0x0a90=function(_0x5ce34a,_0x57887e){_0x5ce34a=_0x5ce34a-0x0;var _0x309350=_0xa900[_0x5ce34a];return _0x309350;};'use strict';var _=require(_0x0a90('0x0'));var util=require(_0x0a90('0x1'));var moment=require(_0x0a90('0x2'));var BPromise=require(_0x0a90('0x3'));var rs=require(_0x0a90('0x4'));var fs=require('fs');var Redis=require(_0x0a90('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a90('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x0a90('0x7'));var jayson=require(_0x0a90('0x8'));var client=jayson[_0x0a90('0x9')][_0x0a90('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56a1e5,_0x3909ac,_0x4718e9){return new BPromise(function(_0x33e3cf,_0x4f2b58){return client[_0x0a90('0xb')](_0x56a1e5,_0x4718e9)[_0x0a90('0xc')](function(_0x36c82f){logger['info'](_0x0a90('0xd'),_0x3909ac,'request\x20sent');logger[_0x0a90('0xe')](_0x0a90('0xf'),_0x3909ac,'request\x20sent',JSON[_0x0a90('0x10')](_0x36c82f));if(_0x36c82f[_0x0a90('0x11')]){if(_0x36c82f[_0x0a90('0x11')][_0x0a90('0x12')]===0x1f4){logger[_0x0a90('0x11')](_0x0a90('0xd'),_0x3909ac,_0x36c82f[_0x0a90('0x11')][_0x0a90('0x13')]);return _0x4f2b58(_0x36c82f[_0x0a90('0x11')][_0x0a90('0x13')]);}logger[_0x0a90('0x11')](_0x0a90('0xd'),_0x3909ac,_0x36c82f[_0x0a90('0x11')]['message']);return _0x33e3cf(_0x36c82f['error'][_0x0a90('0x13')]);}else{logger[_0x0a90('0x14')](_0x0a90('0xd'),_0x3909ac,_0x0a90('0x15'));_0x33e3cf(_0x36c82f[_0x0a90('0x16')][_0x0a90('0x13')]);}})[_0x0a90('0x17')](function(_0x4c5979){logger[_0x0a90('0x11')](_0x0a90('0xd'),_0x3909ac,_0x4c5979);_0x4f2b58(_0x4c5979);});});}exports['GetCampaign']=function(_0x2c0719){var _0x5cbe3c=this;return new Promise(function(_0x619487,_0x44b75d){return db[_0x0a90('0x18')][_0x0a90('0x19')]({'raw':_0x2c0719['options']?_0x2c0719[_0x0a90('0x1a')][_0x0a90('0x1b')]===undefined?!![]:![]:!![],'where':_0x2c0719[_0x0a90('0x1a')]?_0x2c0719['options']['where']||null:null,'attributes':_0x2c0719[_0x0a90('0x1a')]?_0x2c0719['options'][_0x0a90('0x1c')]||null:null,'limit':_0x2c0719['options']?_0x2c0719[_0x0a90('0x1a')][_0x0a90('0x1d')]||null:null,'include':_0x2c0719[_0x0a90('0x1a')]?_0x2c0719[_0x0a90('0x1a')][_0x0a90('0x1e')]?_[_0x0a90('0x1f')](_0x2c0719[_0x0a90('0x1a')][_0x0a90('0x1e')],function(_0x2c3431){return{'model':db[_0x2c3431[_0x0a90('0x20')]],'as':_0x2c3431['as'],'attributes':_0x2c3431[_0x0a90('0x1c')],'include':_0x2c3431[_0x0a90('0x1e')]?_[_0x0a90('0x1f')](_0x2c3431[_0x0a90('0x1e')],function(_0x569dc3){return{'model':db[_0x569dc3[_0x0a90('0x20')]],'as':_0x569dc3['as'],'attributes':_0x569dc3[_0x0a90('0x1c')],'include':_0x569dc3[_0x0a90('0x1e')]?_[_0x0a90('0x1f')](_0x569dc3['include'],function(_0x1711e2){return{'model':db[_0x1711e2[_0x0a90('0x20')]],'as':_0x1711e2['as'],'attributes':_0x1711e2[_0x0a90('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0a90('0xc')](function(_0xe4729b){logger[_0x0a90('0x14')](_0x0a90('0x21'),_0x2c0719);logger[_0x0a90('0xe')](_0x0a90('0x21'),_0x2c0719,JSON[_0x0a90('0x10')](_0xe4729b));_0x619487(_0xe4729b);})['catch'](function(_0x3c194e){logger[_0x0a90('0x11')](_0x0a90('0x21'),_0x3c194e['message'],_0x2c0719);_0x44b75d(_0x5cbe3c[_0x0a90('0x11')](0x1f4,_0x3c194e['message']));});});};
\ No newline at end of file
+var _0x2f68=['limit','include','map','model','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetCampaign','Campaign','findAll','options','attributes'];(function(_0x321504,_0xfde0ac){var _0xf9f5ac=function(_0x462ed7){while(--_0x462ed7){_0x321504['push'](_0x321504['shift']());}};_0xf9f5ac(++_0xfde0ac);}(_0x2f68,0x9a));var _0x82f6=function(_0x5987da,_0x355ca7){_0x5987da=_0x5987da-0x0;var _0x2c18b9=_0x2f68[_0x5987da];return _0x2c18b9;};'use strict';var _=require('lodash');var util=require(_0x82f6('0x0'));var moment=require(_0x82f6('0x1'));var BPromise=require(_0x82f6('0x2'));var rs=require(_0x82f6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x82f6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x82f6('0x5'))(_0x82f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x82f6('0x7'));var client=jayson[_0x82f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a8089,_0x1bc0be,_0x5660bf){return new BPromise(function(_0x5daa3c,_0x864400){return client[_0x82f6('0x9')](_0x5a8089,_0x5660bf)[_0x82f6('0xa')](function(_0x5ee0e5){logger[_0x82f6('0xb')](_0x82f6('0xc'),_0x1bc0be,'request\x20sent');logger[_0x82f6('0xd')](_0x82f6('0xe'),_0x1bc0be,_0x82f6('0xf'),JSON[_0x82f6('0x10')](_0x5ee0e5));if(_0x5ee0e5[_0x82f6('0x11')]){if(_0x5ee0e5[_0x82f6('0x11')]['code']===0x1f4){logger[_0x82f6('0x11')](_0x82f6('0xc'),_0x1bc0be,_0x5ee0e5['error'][_0x82f6('0x12')]);return _0x864400(_0x5ee0e5[_0x82f6('0x11')][_0x82f6('0x12')]);}logger[_0x82f6('0x11')](_0x82f6('0xc'),_0x1bc0be,_0x5ee0e5[_0x82f6('0x11')][_0x82f6('0x12')]);return _0x5daa3c(_0x5ee0e5[_0x82f6('0x11')][_0x82f6('0x12')]);}else{logger['info'](_0x82f6('0xc'),_0x1bc0be,'request\x20sent');_0x5daa3c(_0x5ee0e5[_0x82f6('0x13')][_0x82f6('0x12')]);}})[_0x82f6('0x14')](function(_0x1033d3){logger[_0x82f6('0x11')](_0x82f6('0xc'),_0x1bc0be,_0x1033d3);_0x864400(_0x1033d3);});});}exports[_0x82f6('0x15')]=function(_0xcbc95f){var _0x4072f0=this;return new Promise(function(_0x2bfd57,_0x1c79f9){return db[_0x82f6('0x16')][_0x82f6('0x17')]({'raw':_0xcbc95f[_0x82f6('0x18')]?_0xcbc95f[_0x82f6('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xcbc95f[_0x82f6('0x18')]?_0xcbc95f[_0x82f6('0x18')]['where']||null:null,'attributes':_0xcbc95f[_0x82f6('0x18')]?_0xcbc95f[_0x82f6('0x18')][_0x82f6('0x19')]||null:null,'limit':_0xcbc95f[_0x82f6('0x18')]?_0xcbc95f['options'][_0x82f6('0x1a')]||null:null,'include':_0xcbc95f['options']?_0xcbc95f[_0x82f6('0x18')][_0x82f6('0x1b')]?_['map'](_0xcbc95f['options'][_0x82f6('0x1b')],function(_0x1d96d5){return{'model':db[_0x1d96d5['model']],'as':_0x1d96d5['as'],'attributes':_0x1d96d5['attributes'],'include':_0x1d96d5[_0x82f6('0x1b')]?_[_0x82f6('0x1c')](_0x1d96d5['include'],function(_0xfd8b68){return{'model':db[_0xfd8b68[_0x82f6('0x1d')]],'as':_0xfd8b68['as'],'attributes':_0xfd8b68['attributes'],'include':_0xfd8b68['include']?_[_0x82f6('0x1c')](_0xfd8b68['include'],function(_0x469b6b){return{'model':db[_0x469b6b[_0x82f6('0x1d')]],'as':_0x469b6b['as'],'attributes':_0x469b6b['attributes']};}):[]};}):[]};}):[]:[]})[_0x82f6('0xa')](function(_0x15c9b7){logger[_0x82f6('0xb')](_0x82f6('0x15'),_0xcbc95f);logger['debug'](_0x82f6('0x15'),_0xcbc95f,JSON[_0x82f6('0x10')](_0x15c9b7));_0x2bfd57(_0x15c9b7);})[_0x82f6('0x14')](function(_0x400137){logger[_0x82f6('0x11')](_0x82f6('0x15'),_0x400137[_0x82f6('0x12')],_0xcbc95f);_0x1c79f9(_0x4072f0[_0x82f6('0x11')](0x1f4,_0x400137[_0x82f6('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 7de9330..9f6924c 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 _0xa232=['getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','create','post','/:id/clone','clone','addLists','/:id/blacklists','addBlackLists','put','delete','removeLists','removeBlackLists','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated','/:id'];(function(_0x49c957,_0x3509d8){var _0x5b1d38=function(_0x219976){while(--_0x219976){_0x49c957['push'](_0x49c957['shift']());}};_0x5b1d38(++_0x3509d8);}(_0xa232,0x141));var _0x2a23=function(_0xdb6bb3,_0x385924){_0xdb6bb3=_0xdb6bb3-0x0;var _0x495cd9=_0xa232[_0xdb6bb3];return _0x495cd9;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x2a23('0x0'));var express=require(_0x2a23('0x1'));var router=express[_0x2a23('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2a23('0x3'));var interaction=require(_0x2a23('0x4'));var config=require('../../config/environment');var controller=require(_0x2a23('0x5'));router[_0x2a23('0x6')]('/',auth[_0x2a23('0x7')](),controller['index']);router['get'](_0x2a23('0x8'),auth[_0x2a23('0x7')](),controller['show']);router['get']('/:id/hoppers',auth[_0x2a23('0x7')](),controller[_0x2a23('0x9')]);router[_0x2a23('0x6')](_0x2a23('0xa'),auth[_0x2a23('0x7')](),controller['getHopperHistories']);router[_0x2a23('0x6')](_0x2a23('0xb'),auth['isAuthenticated'](),controller[_0x2a23('0xc')]);router['get'](_0x2a23('0xd'),auth[_0x2a23('0x7')](),controller[_0x2a23('0xe')]);router[_0x2a23('0x6')](_0x2a23('0xf'),auth['isAuthenticated'](),controller[_0x2a23('0x10')]);router['get']('/:id/blacklists',auth[_0x2a23('0x7')](),controller[_0x2a23('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2a23('0x12')]);router[_0x2a23('0x13')](_0x2a23('0x14'),auth['isAuthenticated'](),controller[_0x2a23('0x15')]);router[_0x2a23('0x13')](_0x2a23('0xf'),auth[_0x2a23('0x7')](),controller[_0x2a23('0x16')]);router['post'](_0x2a23('0x17'),auth[_0x2a23('0x7')](),controller[_0x2a23('0x18')]);router[_0x2a23('0x19')](_0x2a23('0x8'),auth[_0x2a23('0x7')](),controller['update']);router[_0x2a23('0x1a')](_0x2a23('0x8'),auth[_0x2a23('0x7')](),controller['destroy']);router[_0x2a23('0x1a')]('/:id/lists',auth[_0x2a23('0x7')](),controller[_0x2a23('0x1b')]);router['delete'](_0x2a23('0x17'),auth[_0x2a23('0x7')](),controller[_0x2a23('0x1c')]);module[_0x2a23('0x1d')]=router;
\ No newline at end of file
+var _0x1e1a=['show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','isAuthenticated','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','post','create','clone','addLists','/:id/blacklists','put','update','delete','destroy','removeLists','removeBlackLists','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','index','/:id'];(function(_0x5c082a,_0x19ac27){var _0x3b60ac=function(_0x2f37ef){while(--_0x2f37ef){_0x5c082a['push'](_0x5c082a['shift']());}};_0x3b60ac(++_0x19ac27);}(_0x1e1a,0x175));var _0xa1e1=function(_0x3addef,_0x37deb2){_0x3addef=_0x3addef-0x0;var _0x3a2b8e=_0x1e1a[_0x3addef];return _0x3a2b8e;};'use strict';var multer=require('multer');var util=require(_0xa1e1('0x0'));var path=require(_0xa1e1('0x1'));var timeout=require(_0xa1e1('0x2'));var express=require(_0xa1e1('0x3'));var router=express[_0xa1e1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa1e1('0x5'));var interaction=require(_0xa1e1('0x6'));var config=require(_0xa1e1('0x7'));var controller=require(_0xa1e1('0x8'));router[_0xa1e1('0x9')]('/',auth['isAuthenticated'](),controller[_0xa1e1('0xa')]);router[_0xa1e1('0x9')](_0xa1e1('0xb'),auth['isAuthenticated'](),controller[_0xa1e1('0xc')]);router[_0xa1e1('0x9')](_0xa1e1('0xd'),auth['isAuthenticated'](),controller[_0xa1e1('0xe')]);router['get'](_0xa1e1('0xf'),auth['isAuthenticated'](),controller[_0xa1e1('0x10')]);router['get'](_0xa1e1('0x11'),auth[_0xa1e1('0x12')](),controller[_0xa1e1('0x13')]);router['get'](_0xa1e1('0x14'),auth[_0xa1e1('0x12')](),controller[_0xa1e1('0x15')]);router['get'](_0xa1e1('0x16'),auth[_0xa1e1('0x12')](),controller[_0xa1e1('0x17')]);router['get']('/:id/blacklists',auth[_0xa1e1('0x12')](),controller['getBlackLists']);router[_0xa1e1('0x18')]('/',auth['isAuthenticated'](),controller[_0xa1e1('0x19')]);router[_0xa1e1('0x18')]('/:id/clone',auth['isAuthenticated'](),controller[_0xa1e1('0x1a')]);router['post'](_0xa1e1('0x16'),auth['isAuthenticated'](),controller[_0xa1e1('0x1b')]);router['post'](_0xa1e1('0x1c'),auth[_0xa1e1('0x12')](),controller['addBlackLists']);router[_0xa1e1('0x1d')]('/:id',auth[_0xa1e1('0x12')](),controller[_0xa1e1('0x1e')]);router[_0xa1e1('0x1f')](_0xa1e1('0xb'),auth[_0xa1e1('0x12')](),controller[_0xa1e1('0x20')]);router[_0xa1e1('0x1f')](_0xa1e1('0x16'),auth[_0xa1e1('0x12')](),controller[_0xa1e1('0x21')]);router[_0xa1e1('0x1f')](_0xa1e1('0x1c'),auth[_0xa1e1('0x12')](),controller[_0xa1e1('0x22')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 3d45a55..f84c15d 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 _0xaa21=['STRING','TEXT','getDataValue','exports'];(function(_0x1ddb21,_0x2c3404){var _0x547a7a=function(_0x252bbe){while(--_0x252bbe){_0x1ddb21['push'](_0x1ddb21['shift']());}};_0x547a7a(++_0x2c3404);}(_0xaa21,0x183));var _0x1aa2=function(_0x287c49,_0x1b4ef2){_0x287c49=_0x287c49-0x0;var _0x51cddb=_0xaa21[_0x287c49];return _0x51cddb;};'use strict';var Sequelize=require('sequelize');module[_0x1aa2('0x0')]={'key':{'type':Sequelize[_0x1aa2('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x1aa2('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x1aa2('0x3')]('key');}}};
\ No newline at end of file
+var _0xcd78=['getDataValue','key','sequelize','exports','TEXT','STRING','VIRTUAL'];(function(_0x2a8122,_0xd957e){var _0x49a5c7=function(_0x12ab58){while(--_0x12ab58){_0x2a8122['push'](_0x2a8122['shift']());}};_0x49a5c7(++_0xd957e);}(_0xcd78,0x79));var _0x8cd7=function(_0x4fde1b,_0xd723f9){_0x4fde1b=_0x4fde1b-0x0;var _0x1364e5=_0xcd78[_0x4fde1b];return _0x1364e5;};'use strict';var Sequelize=require(_0x8cd7('0x0'));module[_0x8cd7('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x8cd7('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8cd7('0x3')]},'name':{'type':Sequelize[_0x8cd7('0x4')],'get':function(){return this[_0x8cd7('0x5')](_0x8cd7('0x6'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 788b5ea..f2fda09 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 _0x25a8=['querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','CannedAnswers','UserProfileResource','end','name','send','index','map','CannedAnswer','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','sort','pick','filter','where','merge','options','includeAll','include','findAll','catch','show','params','keys','rawAttributes','length','find','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','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','path','sox','ejs','fs-extra','crypto'];(function(_0x3f6b1b,_0x58d3d6){var _0x4a3d2b=function(_0x5648f0){while(--_0x5648f0){_0x3f6b1b['push'](_0x3f6b1b['shift']());}};_0x4a3d2b(++_0x58d3d6);}(_0x25a8,0x1aa));var _0x825a=function(_0x3a8c64,_0x3ad3bb){_0x3a8c64=_0x3a8c64-0x0;var _0xb72146=_0x25a8[_0x3a8c64];return _0xb72146;};'use strict';var emlformat=require(_0x825a('0x0'));var rimraf=require(_0x825a('0x1'));var zipdir=require(_0x825a('0x2'));var jsonpatch=require(_0x825a('0x3'));var rp=require(_0x825a('0x4'));var moment=require(_0x825a('0x5'));var BPromise=require(_0x825a('0x6'));var Mustache=require(_0x825a('0x7'));var util=require(_0x825a('0x8'));var path=require(_0x825a('0x9'));var sox=require(_0x825a('0xa'));var csv=require('to-csv');var ejs=require(_0x825a('0xb'));var fs=require('fs');var fs_extra=require(_0x825a('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x825a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x825a('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x825a('0xf'));var qs=require(_0x825a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x825a('0x11'));var logger=require(_0x825a('0x12'))(_0x825a('0x13'));var utils=require(_0x825a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x825a('0x15'));var db=require(_0x825a('0x16'))['db'];function respondWithStatusCode(_0x15ab16,_0x4c75d6){_0x4c75d6=_0x4c75d6||0xcc;return function(_0xd09262){if(_0xd09262){return _0x15ab16[_0x825a('0x17')](_0x4c75d6);}return _0x15ab16[_0x825a('0x18')](_0x4c75d6)['end']();};}function respondWithResult(_0x4c6987,_0x27d37b){_0x27d37b=_0x27d37b||0xc8;return function(_0x15e689){if(_0x15e689){return _0x4c6987[_0x825a('0x18')](_0x27d37b)['json'](_0x15e689);}};}function respondWithFilteredResult(_0xde5d09,_0x689356){return function(_0x598ee2){if(_0x598ee2){var _0x64c780=typeof _0x689356[_0x825a('0x19')]==='undefined'&&typeof _0x689356['limit']===_0x825a('0x1a');var _0x4f3c80=_0x598ee2[_0x825a('0x1b')];var _0x166a98=_0x64c780?0x0:_0x689356[_0x825a('0x19')];var _0x48bd4f=_0x64c780?_0x598ee2[_0x825a('0x1b')]:_0x689356[_0x825a('0x19')]+_0x689356[_0x825a('0x1c')];var _0x42bbbe;if(_0x48bd4f>=_0x4f3c80){_0x48bd4f=_0x4f3c80;_0x42bbbe=0xc8;}else{_0x42bbbe=0xce;}_0xde5d09['status'](_0x42bbbe);return _0xde5d09[_0x825a('0x1d')](_0x825a('0x1e'),_0x166a98+'-'+_0x48bd4f+'/'+_0x4f3c80)[_0x825a('0x1f')](_0x598ee2);}return null;};}function patchUpdates(_0x4d3f3b){return function(_0x4123cb){try{jsonpatch[_0x825a('0x20')](_0x4123cb,_0x4d3f3b,!![]);}catch(_0x320636){return BPromise[_0x825a('0x21')](_0x320636);}return _0x4123cb[_0x825a('0x22')]();};}function saveUpdates(_0x1205b2,_0x2e4abe){return function(_0x4926c3){if(_0x4926c3){return _0x4926c3['update'](_0x1205b2)[_0x825a('0x23')](function(_0x26698a){return _0x26698a;});}return null;};}function removeEntity(_0x22bc99,_0x2b4be5){return function(_0x593ce4){if(_0x593ce4){return _0x593ce4[_0x825a('0x24')]()['then'](function(){var _0x2be7d0=_0x593ce4['get']({'plain':!![]});var _0x5871d8=_0x825a('0x25');return db[_0x825a('0x26')]['destroy']({'where':{'type':_0x5871d8,'resourceId':_0x2be7d0['id']}})[_0x825a('0x23')](function(){return _0x593ce4;});})[_0x825a('0x23')](function(){_0x22bc99[_0x825a('0x18')](0xcc)[_0x825a('0x27')]();});}};}function handleEntityNotFound(_0x16c055,_0x59fef0){return function(_0x2c904d){if(!_0x2c904d){_0x16c055[_0x825a('0x17')](0x194);}return _0x2c904d;};}function handleError(_0x2edafd,_0x29552d){_0x29552d=_0x29552d||0x1f4;return function(_0x1d044d){logger['error'](_0x1d044d['stack']);if(_0x1d044d['name']){delete _0x1d044d[_0x825a('0x28')];}_0x2edafd[_0x825a('0x18')](_0x29552d)[_0x825a('0x29')](_0x1d044d);};}exports[_0x825a('0x2a')]=function(_0x375135,_0x3f2aac){var _0x36551b={},_0x2f8c24={},_0x314732={'count':0x0,'rows':[]};var _0xefc2d4=_[_0x825a('0x2b')](db[_0x825a('0x2c')]['rawAttributes'],function(_0x28ccf8){return{'name':_0x28ccf8[_0x825a('0x2d')],'type':_0x28ccf8[_0x825a('0x2e')][_0x825a('0x2f')]};});_0x2f8c24[_0x825a('0x30')]=_[_0x825a('0x2b')](_0xefc2d4,_0x825a('0x28'));_0x2f8c24['query']=_['keys'](_0x375135[_0x825a('0x31')]);_0x2f8c24[_0x825a('0x32')]=_[_0x825a('0x33')](_0x2f8c24[_0x825a('0x30')],_0x2f8c24[_0x825a('0x31')]);_0x36551b[_0x825a('0x34')]=_[_0x825a('0x33')](_0x2f8c24[_0x825a('0x30')],qs[_0x825a('0x35')](_0x375135[_0x825a('0x31')][_0x825a('0x35')]));_0x36551b[_0x825a('0x34')]=_0x36551b[_0x825a('0x34')]['length']?_0x36551b['attributes']:_0x2f8c24[_0x825a('0x30')];if(!_0x375135[_0x825a('0x31')][_0x825a('0x36')]('nolimit')){_0x36551b[_0x825a('0x1c')]=qs[_0x825a('0x1c')](_0x375135[_0x825a('0x31')]['limit']);_0x36551b[_0x825a('0x19')]=qs['offset'](_0x375135[_0x825a('0x31')][_0x825a('0x19')]);}_0x36551b['order']=qs[_0x825a('0x37')](_0x375135['query'][_0x825a('0x37')]);_0x36551b['where']=qs[_0x825a('0x32')](_[_0x825a('0x38')](_0x375135[_0x825a('0x31')],_0x2f8c24['filters']),_0xefc2d4);if(_0x375135[_0x825a('0x31')][_0x825a('0x39')]){_0x36551b[_0x825a('0x3a')]=_['merge'](_0x36551b[_0x825a('0x3a')],{'$or':[{'key':{'$like':'%'+_0x375135[_0x825a('0x31')][_0x825a('0x39')]+'%'}},{'value':{'$like':'%'+_0x375135[_0x825a('0x31')][_0x825a('0x39')]+'%'}}]});}_0x36551b=_[_0x825a('0x3b')]({},_0x36551b,_0x375135[_0x825a('0x3c')]);var _0x57700c={'where':_0x36551b['where']};return db[_0x825a('0x2c')]['count'](_0x57700c)[_0x825a('0x23')](function(_0x49cbe3){_0x314732[_0x825a('0x1b')]=_0x49cbe3;if(_0x375135['query'][_0x825a('0x3d')]){_0x36551b[_0x825a('0x3e')]=[{'all':!![]}];}return db[_0x825a('0x2c')][_0x825a('0x3f')](_0x36551b);})[_0x825a('0x23')](function(_0x8df2b2){_0x314732['rows']=_0x8df2b2;return _0x314732;})[_0x825a('0x23')](respondWithFilteredResult(_0x3f2aac,_0x36551b))[_0x825a('0x40')](handleError(_0x3f2aac,null));};exports[_0x825a('0x41')]=function(_0x26f4b5,_0x373717){var _0x3cef05={'raw':!![],'where':{'id':_0x26f4b5[_0x825a('0x42')]['id']}},_0x52d022={};_0x52d022['model']=_[_0x825a('0x43')](db[_0x825a('0x2c')][_0x825a('0x44')]);_0x52d022[_0x825a('0x31')]=_[_0x825a('0x43')](_0x26f4b5[_0x825a('0x31')]);_0x52d022[_0x825a('0x32')]=_['intersection'](_0x52d022['model'],_0x52d022[_0x825a('0x31')]);_0x3cef05[_0x825a('0x34')]=_[_0x825a('0x33')](_0x52d022[_0x825a('0x30')],qs[_0x825a('0x35')](_0x26f4b5[_0x825a('0x31')][_0x825a('0x35')]));_0x3cef05[_0x825a('0x34')]=_0x3cef05[_0x825a('0x34')][_0x825a('0x45')]?_0x3cef05[_0x825a('0x34')]:_0x52d022[_0x825a('0x30')];if(_0x26f4b5[_0x825a('0x31')]['includeAll']){_0x3cef05[_0x825a('0x3e')]=[{'all':!![]}];}_0x3cef05=_[_0x825a('0x3b')]({},_0x3cef05,_0x26f4b5['options']);return db[_0x825a('0x2c')][_0x825a('0x46')](_0x3cef05)[_0x825a('0x23')](handleEntityNotFound(_0x373717,null))[_0x825a('0x23')](respondWithResult(_0x373717,null))[_0x825a('0x40')](handleError(_0x373717,null));};exports[_0x825a('0x47')]=function(_0x31ff15,_0x328b27){if(_0x31ff15[_0x825a('0x48')]['id']){delete _0x31ff15['body']['id'];}return db['CannedAnswer']['find']({'where':{'id':_0x31ff15[_0x825a('0x42')]['id']}})[_0x825a('0x23')](handleEntityNotFound(_0x328b27,null))['then'](saveUpdates(_0x31ff15[_0x825a('0x48')],null))[_0x825a('0x23')](respondWithResult(_0x328b27,null))['catch'](handleError(_0x328b27,null));};exports[_0x825a('0x24')]=function(_0x5b186e,_0x11429b){return db['CannedAnswer'][_0x825a('0x46')]({'where':{'id':_0x5b186e[_0x825a('0x42')]['id']}})[_0x825a('0x23')](handleEntityNotFound(_0x11429b,null))[_0x825a('0x23')](removeEntity(_0x11429b,null))[_0x825a('0x40')](handleError(_0x11429b,null));};exports[_0x825a('0x49')]=function(_0x136880,_0xfde2a8){var _0x1eb0ee={'key':_0x136880['body'][_0x825a('0x2f')]};if(_0x136880['body'][_0x825a('0x4a')]){_0x1eb0ee[_0x825a('0x4a')]=_0x136880['body'][_0x825a('0x4a')];}else if(_0x136880[_0x825a('0x48')][_0x825a('0x4b')]){_0x1eb0ee['SmsAccountId']=_0x136880[_0x825a('0x48')]['SmsAccountId'];}else if(_0x136880[_0x825a('0x48')][_0x825a('0x4c')]){_0x1eb0ee['OpenchannelAccountId']=_0x136880[_0x825a('0x48')][_0x825a('0x4c')];}else if(_0x136880[_0x825a('0x48')][_0x825a('0x4d')]){_0x1eb0ee[_0x825a('0x4d')]=_0x136880[_0x825a('0x48')][_0x825a('0x4d')];}return db[_0x825a('0x2c')][_0x825a('0x46')]({'where':_0x1eb0ee})[_0x825a('0x23')](function(_0x1e9565){if(_0x1e9565){throw new db[(_0x825a('0x4e'))][(_0x825a('0x4f'))](_0x825a('0x50'));}return db[_0x825a('0x2c')][_0x825a('0x49')](_0x136880[_0x825a('0x48')]);})[_0x825a('0x23')](function(_0x3c6349){var _0x2c183a=_0x136880[_0x825a('0x51')][_0x825a('0x52')]({'plain':!![]});if(!_0x2c183a)throw new Error(_0x825a('0x53'));if(_0x2c183a[_0x825a('0x54')]==='user'){var _0x34a7fe=_0x3c6349[_0x825a('0x52')]({'plain':!![]});return db[_0x825a('0x55')][_0x825a('0x46')]({'where':{'name':'CannedAnswers','userProfileId':_0x2c183a[_0x825a('0x56')]},'raw':!![]})[_0x825a('0x23')](function(_0x31afd){if(_0x31afd&&_0x31afd['autoAssociation']===0x0){return db[_0x825a('0x26')][_0x825a('0x49')]({'name':_0x34a7fe[_0x825a('0x28')],'resourceId':_0x34a7fe['id'],'type':_0x31afd[_0x825a('0x28')],'sectionId':_0x31afd['id']},{})[_0x825a('0x23')](function(){return _0x3c6349;});}else{return _0x3c6349;}})[_0x825a('0x40')](function(_0x4011c9){logger['error'](_0x825a('0x57'),_0x4011c9);throw _0x4011c9;});}return _0x3c6349;})[_0x825a('0x23')](respondWithResult(_0xfde2a8,0xc9))[_0x825a('0x40')](handleError(_0xfde2a8,null));};
\ No newline at end of file
+var _0x69b0=['Content-Range','apply','reject','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','rows','catch','length','update','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set'];(function(_0x5376a2,_0x23e471){var _0x29a3a0=function(_0x12c5cb){while(--_0x12c5cb){_0x5376a2['push'](_0x5376a2['shift']());}};_0x29a3a0(++_0x23e471);}(_0x69b0,0x1a4));var _0x069b=function(_0x33593e,_0x22ddd3){_0x33593e=_0x33593e-0x0;var _0x53db1a=_0x69b0[_0x33593e];return _0x53db1a;};'use strict';var emlformat=require(_0x069b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x069b('0x1'));var jsonpatch=require(_0x069b('0x2'));var rp=require(_0x069b('0x3'));var moment=require('moment');var BPromise=require(_0x069b('0x4'));var Mustache=require(_0x069b('0x5'));var util=require(_0x069b('0x6'));var path=require(_0x069b('0x7'));var sox=require(_0x069b('0x8'));var csv=require('to-csv');var ejs=require(_0x069b('0x9'));var fs=require('fs');var fs_extra=require(_0x069b('0xa'));var _=require(_0x069b('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x069b('0xc'));var deskjs=require(_0x069b('0xd'));var toCsv=require(_0x069b('0xe'));var querystring=require(_0x069b('0xf'));var Papa=require(_0x069b('0x10'));var Redis=require(_0x069b('0x11'));var authService=require(_0x069b('0x12'));var qs=require(_0x069b('0x13'));var as=require(_0x069b('0x14'));var hardwareService=require(_0x069b('0x15'));var logger=require(_0x069b('0x16'))(_0x069b('0x17'));var utils=require('../../config/utils');var config=require(_0x069b('0x18'));var licenseUtil=require(_0x069b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x337571,_0x30ea84){_0x30ea84=_0x30ea84||0xcc;return function(_0xe96cd7){if(_0xe96cd7){return _0x337571[_0x069b('0x1a')](_0x30ea84);}return _0x337571[_0x069b('0x1b')](_0x30ea84)[_0x069b('0x1c')]();};}function respondWithResult(_0x33c045,_0x41f637){_0x41f637=_0x41f637||0xc8;return function(_0x1feb88){if(_0x1feb88){return _0x33c045[_0x069b('0x1b')](_0x41f637)[_0x069b('0x1d')](_0x1feb88);}};}function respondWithFilteredResult(_0x35adcf,_0x35e21e){return function(_0x5382dd){if(_0x5382dd){var _0x2e38b0=typeof _0x35e21e[_0x069b('0x1e')]===_0x069b('0x1f')&&typeof _0x35e21e['limit']===_0x069b('0x1f');var _0x523c31=_0x5382dd[_0x069b('0x20')];var _0x5e396a=_0x2e38b0?0x0:_0x35e21e[_0x069b('0x1e')];var _0xe48b55=_0x2e38b0?_0x5382dd['count']:_0x35e21e[_0x069b('0x1e')]+_0x35e21e[_0x069b('0x21')];var _0x7920f;if(_0xe48b55>=_0x523c31){_0xe48b55=_0x523c31;_0x7920f=0xc8;}else{_0x7920f=0xce;}_0x35adcf[_0x069b('0x1b')](_0x7920f);return _0x35adcf[_0x069b('0x22')](_0x069b('0x23'),_0x5e396a+'-'+_0xe48b55+'/'+_0x523c31)[_0x069b('0x1d')](_0x5382dd);}return null;};}function patchUpdates(_0x26733a){return function(_0x8b82f5){try{jsonpatch[_0x069b('0x24')](_0x8b82f5,_0x26733a,!![]);}catch(_0x437715){return BPromise[_0x069b('0x25')](_0x437715);}return _0x8b82f5['save']();};}function saveUpdates(_0x9ffba5,_0x69d307){return function(_0x452cce){if(_0x452cce){return _0x452cce['update'](_0x9ffba5)[_0x069b('0x26')](function(_0x4f74a5){return _0x4f74a5;});}return null;};}function removeEntity(_0x23da2b,_0x4bc3be){return function(_0x3819a8){if(_0x3819a8){return _0x3819a8[_0x069b('0x27')]()[_0x069b('0x26')](function(){var _0x3a8272=_0x3819a8[_0x069b('0x28')]({'plain':!![]});var _0x46e2e8=_0x069b('0x29');return db[_0x069b('0x2a')][_0x069b('0x27')]({'where':{'type':_0x46e2e8,'resourceId':_0x3a8272['id']}})[_0x069b('0x26')](function(){return _0x3819a8;});})[_0x069b('0x26')](function(){_0x23da2b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x550321,_0x8cfcc4){return function(_0x487ac3){if(!_0x487ac3){_0x550321[_0x069b('0x1a')](0x194);}return _0x487ac3;};}function handleError(_0x3d726d,_0x4f0930){_0x4f0930=_0x4f0930||0x1f4;return function(_0x541540){logger[_0x069b('0x2b')](_0x541540[_0x069b('0x2c')]);if(_0x541540[_0x069b('0x2d')]){delete _0x541540[_0x069b('0x2d')];}_0x3d726d[_0x069b('0x1b')](_0x4f0930)[_0x069b('0x2e')](_0x541540);};}exports[_0x069b('0x2f')]=function(_0x233af5,_0x58c23f){var _0x1a4a1a={},_0x47c381={},_0x39c203={'count':0x0,'rows':[]};var _0x5e5f21=_[_0x069b('0x30')](db[_0x069b('0x31')][_0x069b('0x32')],function(_0x31c438){return{'name':_0x31c438[_0x069b('0x33')],'type':_0x31c438['type'][_0x069b('0x34')]};});_0x47c381[_0x069b('0x35')]=_[_0x069b('0x30')](_0x5e5f21,_0x069b('0x2d'));_0x47c381[_0x069b('0x36')]=_[_0x069b('0x37')](_0x233af5[_0x069b('0x36')]);_0x47c381['filters']=_[_0x069b('0x38')](_0x47c381[_0x069b('0x35')],_0x47c381[_0x069b('0x36')]);_0x1a4a1a[_0x069b('0x39')]=_[_0x069b('0x38')](_0x47c381['model'],qs[_0x069b('0x3a')](_0x233af5[_0x069b('0x36')][_0x069b('0x3a')]));_0x1a4a1a[_0x069b('0x39')]=_0x1a4a1a['attributes']['length']?_0x1a4a1a['attributes']:_0x47c381[_0x069b('0x35')];if(!_0x233af5[_0x069b('0x36')][_0x069b('0x3b')](_0x069b('0x3c'))){_0x1a4a1a[_0x069b('0x21')]=qs['limit'](_0x233af5[_0x069b('0x36')][_0x069b('0x21')]);_0x1a4a1a[_0x069b('0x1e')]=qs[_0x069b('0x1e')](_0x233af5[_0x069b('0x36')][_0x069b('0x1e')]);}_0x1a4a1a[_0x069b('0x3d')]=qs[_0x069b('0x3e')](_0x233af5[_0x069b('0x36')][_0x069b('0x3e')]);_0x1a4a1a[_0x069b('0x3f')]=qs[_0x069b('0x40')](_[_0x069b('0x41')](_0x233af5['query'],_0x47c381['filters']),_0x5e5f21);if(_0x233af5['query'][_0x069b('0x42')]){_0x1a4a1a[_0x069b('0x3f')]=_[_0x069b('0x43')](_0x1a4a1a[_0x069b('0x3f')],{'$or':[{'key':{'$like':'%'+_0x233af5[_0x069b('0x36')]['filter']+'%'}},{'value':{'$like':'%'+_0x233af5['query']['filter']+'%'}}]});}_0x1a4a1a=_[_0x069b('0x43')]({},_0x1a4a1a,_0x233af5[_0x069b('0x44')]);var _0x58da57={'where':_0x1a4a1a[_0x069b('0x3f')]};return db[_0x069b('0x31')][_0x069b('0x20')](_0x58da57)[_0x069b('0x26')](function(_0x46d567){_0x39c203[_0x069b('0x20')]=_0x46d567;if(_0x233af5['query'][_0x069b('0x45')]){_0x1a4a1a[_0x069b('0x46')]=[{'all':!![]}];}return db[_0x069b('0x31')]['findAll'](_0x1a4a1a);})[_0x069b('0x26')](function(_0x491661){_0x39c203[_0x069b('0x47')]=_0x491661;return _0x39c203;})[_0x069b('0x26')](respondWithFilteredResult(_0x58c23f,_0x1a4a1a))[_0x069b('0x48')](handleError(_0x58c23f,null));};exports['show']=function(_0x59d7ca,_0x30b07c){var _0x37f528={'raw':!![],'where':{'id':_0x59d7ca['params']['id']}},_0x3a243b={};_0x3a243b['model']=_[_0x069b('0x37')](db['CannedAnswer'][_0x069b('0x32')]);_0x3a243b['query']=_[_0x069b('0x37')](_0x59d7ca[_0x069b('0x36')]);_0x3a243b[_0x069b('0x40')]=_[_0x069b('0x38')](_0x3a243b[_0x069b('0x35')],_0x3a243b[_0x069b('0x36')]);_0x37f528[_0x069b('0x39')]=_[_0x069b('0x38')](_0x3a243b[_0x069b('0x35')],qs[_0x069b('0x3a')](_0x59d7ca[_0x069b('0x36')]['fields']));_0x37f528[_0x069b('0x39')]=_0x37f528[_0x069b('0x39')][_0x069b('0x49')]?_0x37f528[_0x069b('0x39')]:_0x3a243b['model'];if(_0x59d7ca[_0x069b('0x36')]['includeAll']){_0x37f528[_0x069b('0x46')]=[{'all':!![]}];}_0x37f528=_[_0x069b('0x43')]({},_0x37f528,_0x59d7ca[_0x069b('0x44')]);return db[_0x069b('0x31')]['find'](_0x37f528)[_0x069b('0x26')](handleEntityNotFound(_0x30b07c,null))[_0x069b('0x26')](respondWithResult(_0x30b07c,null))['catch'](handleError(_0x30b07c,null));};exports[_0x069b('0x4a')]=function(_0x3622ac,_0x21b6ea){if(_0x3622ac[_0x069b('0x4b')]['id']){delete _0x3622ac[_0x069b('0x4b')]['id'];}return db['CannedAnswer'][_0x069b('0x4c')]({'where':{'id':_0x3622ac['params']['id']}})[_0x069b('0x26')](handleEntityNotFound(_0x21b6ea,null))[_0x069b('0x26')](saveUpdates(_0x3622ac[_0x069b('0x4b')],null))['then'](respondWithResult(_0x21b6ea,null))[_0x069b('0x48')](handleError(_0x21b6ea,null));};exports[_0x069b('0x27')]=function(_0x25312c,_0x53f1b1){return db[_0x069b('0x31')][_0x069b('0x4c')]({'where':{'id':_0x25312c['params']['id']}})['then'](handleEntityNotFound(_0x53f1b1,null))[_0x069b('0x26')](removeEntity(_0x53f1b1,null))[_0x069b('0x48')](handleError(_0x53f1b1,null));};exports[_0x069b('0x4d')]=function(_0xae4320,_0x4e5371){var _0xae7f40={'key':_0xae4320[_0x069b('0x4b')]['key']};if(_0xae4320[_0x069b('0x4b')][_0x069b('0x4e')]){_0xae7f40[_0x069b('0x4e')]=_0xae4320['body'][_0x069b('0x4e')];}else if(_0xae4320[_0x069b('0x4b')][_0x069b('0x4f')]){_0xae7f40[_0x069b('0x4f')]=_0xae4320['body']['SmsAccountId'];}else if(_0xae4320['body'][_0x069b('0x50')]){_0xae7f40[_0x069b('0x50')]=_0xae4320['body'][_0x069b('0x50')];}else if(_0xae4320['body'][_0x069b('0x51')]){_0xae7f40[_0x069b('0x51')]=_0xae4320[_0x069b('0x4b')][_0x069b('0x51')];}return db[_0x069b('0x31')]['find']({'where':_0xae7f40})[_0x069b('0x26')](function(_0x4f1889){if(_0x4f1889){throw new db[(_0x069b('0x52'))][(_0x069b('0x53'))](_0x069b('0x54'));}return db[_0x069b('0x31')][_0x069b('0x4d')](_0xae4320[_0x069b('0x4b')]);})['then'](function(_0x1010a1){var _0x21fd20=_0xae4320['user'][_0x069b('0x28')]({'plain':!![]});if(!_0x21fd20)throw new Error(_0x069b('0x55'));if(_0x21fd20[_0x069b('0x56')]===_0x069b('0x57')){var _0x59465d=_0x1010a1[_0x069b('0x28')]({'plain':!![]});return db[_0x069b('0x58')][_0x069b('0x4c')]({'where':{'name':_0x069b('0x29'),'userProfileId':_0x21fd20[_0x069b('0x59')]},'raw':!![]})[_0x069b('0x26')](function(_0x45e770){if(_0x45e770&&_0x45e770[_0x069b('0x5a')]===0x0){return db[_0x069b('0x2a')][_0x069b('0x4d')]({'name':_0x59465d[_0x069b('0x2d')],'resourceId':_0x59465d['id'],'type':_0x45e770[_0x069b('0x2d')],'sectionId':_0x45e770['id']},{})['then'](function(){return _0x1010a1;});}else{return _0x1010a1;}})[_0x069b('0x48')](function(_0x3a2f1f){logger[_0x069b('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3a2f1f);throw _0x3a2f1f;});}return _0x1010a1;})[_0x069b('0x26')](respondWithResult(_0x4e5371,0xc9))[_0x069b('0x48')](handleError(_0x4e5371,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 2643969..f4bb88e 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 _0x68c9=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./cannedAnswer.attributes','define'];(function(_0x4a3da6,_0x16e828){var _0x1d37da=function(_0xa9fb47){while(--_0xa9fb47){_0x4a3da6['push'](_0x4a3da6['shift']());}};_0x1d37da(++_0x16e828);}(_0x68c9,0x18e));var _0x968c=function(_0x4d48b1,_0x4bded7){_0x4d48b1=_0x4d48b1-0x0;var _0x2e2280=_0x68c9[_0x4d48b1];return _0x2e2280;};'use strict';var _=require(_0x968c('0x0'));var util=require(_0x968c('0x1'));var logger=require(_0x968c('0x2'))(_0x968c('0x3'));var moment=require(_0x968c('0x4'));var BPromise=require('bluebird');var rp=require(_0x968c('0x5'));var fs=require('fs');var path=require(_0x968c('0x6'));var rimraf=require(_0x968c('0x7'));var config=require('../../config/environment');var attributes=require(_0x968c('0x8'));module['exports']=function(_0x19484f,_0x2d692d){return _0x19484f[_0x968c('0x9')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x968c('0xa'),'collate':_0x968c('0xb')});};
\ No newline at end of file
+var _0x6b0e=['./cannedAnswer.attributes','exports','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment'];(function(_0x48326a,_0x8cfa0c){var _0x466709=function(_0x5ab1b7){while(--_0x5ab1b7){_0x48326a['push'](_0x48326a['shift']());}};_0x466709(++_0x8cfa0c);}(_0x6b0e,0x185));var _0xe6b0=function(_0x1e851f,_0x1c7630){_0x1e851f=_0x1e851f-0x0;var _0x4c3e02=_0x6b0e[_0x1e851f];return _0x4c3e02;};'use strict';var _=require(_0xe6b0('0x0'));var util=require(_0xe6b0('0x1'));var logger=require(_0xe6b0('0x2'))('api');var moment=require(_0xe6b0('0x3'));var BPromise=require('bluebird');var rp=require(_0xe6b0('0x4'));var fs=require('fs');var path=require(_0xe6b0('0x5'));var rimraf=require('rimraf');var config=require(_0xe6b0('0x6'));var attributes=require(_0xe6b0('0x7'));module[_0xe6b0('0x8')]=function(_0x2eb83e,_0x1eb26c){return _0x2eb83e['define']('CannedAnswer',attributes,{'tableName':_0xe6b0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe6b0('0xa'),'collate':_0xe6b0('0xb')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 2cecb81..c1c7e68 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(_0x4465a9,_0x918ca0){var _0x585b2c=function(_0x52ec58){while(--_0x52ec58){_0x4465a9['push'](_0x4465a9['shift']());}};_0x585b2c(++_0x918ca0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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(_0x37545f,_0x4cfc2f){var _0x1d19be=function(_0x50178c){while(--_0x50178c){_0x37545f['push'](_0x37545f['shift']());}};_0x1d19be(++_0x4cfc2f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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 a5f40e9..39cd44d 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 _0x4909=['show','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index'];(function(_0x4dd42e,_0x4f109b){var _0x4d78b0=function(_0x3a9a93){while(--_0x3a9a93){_0x4dd42e['push'](_0x4dd42e['shift']());}};_0x4d78b0(++_0x4f109b);}(_0x4909,0x1a9));var _0x9490=function(_0x2e1907,_0x229a70){_0x2e1907=_0x2e1907-0x0;var _0x401555=_0x4909[_0x2e1907];return _0x401555;};'use strict';var multer=require(_0x9490('0x0'));var util=require(_0x9490('0x1'));var path=require(_0x9490('0x2'));var timeout=require(_0x9490('0x3'));var express=require(_0x9490('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9490('0x5'));var interaction=require(_0x9490('0x6'));var config=require(_0x9490('0x7'));var controller=require(_0x9490('0x8'));router[_0x9490('0x9')]('/',auth[_0x9490('0xa')](),controller[_0x9490('0xb')]);router[_0x9490('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x9490('0xc')]);router['post']('/',auth[_0x9490('0xa')](),controller[_0x9490('0xd')]);router[_0x9490('0xe')](_0x9490('0xf'),auth[_0x9490('0xa')](),controller[_0x9490('0x10')]);router[_0x9490('0x11')](_0x9490('0xf'),auth['isAuthenticated'](),controller[_0x9490('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xe879=['update','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','post','create','put'];(function(_0x55af25,_0x2d0b4a){var _0x5d94ad=function(_0x1090c6){while(--_0x1090c6){_0x55af25['push'](_0x55af25['shift']());}};_0x5d94ad(++_0x2d0b4a);}(_0xe879,0xf2));var _0x9e87=function(_0x197fde,_0x175d73){_0x197fde=_0x197fde-0x0;var _0x4fe854=_0xe879[_0x197fde];return _0x4fe854;};'use strict';var multer=require(_0x9e87('0x0'));var util=require(_0x9e87('0x1'));var path=require(_0x9e87('0x2'));var timeout=require('connect-timeout');var express=require(_0x9e87('0x3'));var router=express['Router']();var fs_extra=require(_0x9e87('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9e87('0x5'));var config=require(_0x9e87('0x6'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0x9e87('0x7')](),controller[_0x9e87('0x8')]);router['get'](_0x9e87('0x9'),auth[_0x9e87('0x7')](),controller['show']);router[_0x9e87('0xa')]('/',auth['isAuthenticated'](),controller[_0x9e87('0xb')]);router[_0x9e87('0xc')](_0x9e87('0x9'),auth['isAuthenticated'](),controller[_0x9e87('0xd')]);router['delete'](_0x9e87('0x9'),auth[_0x9e87('0x7')](),controller['destroy']);module[_0x9e87('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 833133d..abb30dc 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 _0x938c=['STRING','INTEGER','sequelize','exports','1970-01-01\x2000:00:01'];(function(_0x304ec3,_0x22a58c){var _0x36ccfb=function(_0x20a4ac){while(--_0x20a4ac){_0x304ec3['push'](_0x304ec3['shift']());}};_0x36ccfb(++_0x22a58c);}(_0x938c,0x11f));var _0xc938=function(_0x839358,_0x57c52d){_0x839358=_0x839358-0x0;var _0x2de1cb=_0x938c[_0x839358];return _0x2de1cb;};'use strict';var Sequelize=require(_0xc938('0x0'));module[_0xc938('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xc938('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xc938('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xc938('0x3')]},'dstchannel':{'type':Sequelize[_0xc938('0x3')]},'lastapp':{'type':Sequelize[_0xc938('0x3')]},'lastdata':{'type':Sequelize[_0xc938('0x3')]},'duration':{'type':Sequelize[_0xc938('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xc938('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xc938('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xc938('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xc938('0x3')]},'linkedid':{'type':Sequelize[_0xc938('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xc938('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xd87e=['STRING','INTEGER','sequelize','exports','1970-01-01\x2000:00:01'];(function(_0x284235,_0x3c1a25){var _0x18d480=function(_0x51dd17){while(--_0x51dd17){_0x284235['push'](_0x284235['shift']());}};_0x18d480(++_0x3c1a25);}(_0xd87e,0x1bf));var _0xed87=function(_0x1ef726,_0x16fdea){_0x1ef726=_0x1ef726-0x0;var _0x4c3c66=_0xd87e[_0x1ef726];return _0x4c3c66;};'use strict';var Sequelize=require(_0xed87('0x0'));module[_0xed87('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xed87('0x2')},'clid':{'type':Sequelize[_0xed87('0x3')]},'src':{'type':Sequelize[_0xed87('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xed87('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0xed87('0x3')]},'lastapp':{'type':Sequelize[_0xed87('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xed87('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xed87('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xed87('0x3')]},'userfield':{'type':Sequelize[_0xed87('0x3')]},'uniqueid':{'type':Sequelize[_0xed87('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xed87('0x3')]},'peeraccount':{'type':Sequelize[_0xed87('0x3')]},'type':{'type':Sequelize[_0xed87('0x3')]},'tag':{'type':Sequelize[_0xed87('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 134422d..88b4b18 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 _0x1c9a=['status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','includeAll','show','params','find','catch','create','update','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x13197f,_0x1a2d35){var _0x5ed097=function(_0x483eec){while(--_0x483eec){_0x13197f['push'](_0x13197f['shift']());}};_0x5ed097(++_0x1a2d35);}(_0x1c9a,0x1a7));var _0xa1c9=function(_0x3372ec,_0x2405f6){_0x3372ec=_0x3372ec-0x0;var _0x4eec8c=_0x1c9a[_0x3372ec];return _0x4eec8c;};'use strict';var emlformat=require(_0xa1c9('0x0'));var rimraf=require(_0xa1c9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa1c9('0x2'));var rp=require(_0xa1c9('0x3'));var moment=require(_0xa1c9('0x4'));var BPromise=require(_0xa1c9('0x5'));var Mustache=require(_0xa1c9('0x6'));var util=require('util');var path=require(_0xa1c9('0x7'));var sox=require('sox');var csv=require(_0xa1c9('0x8'));var ejs=require(_0xa1c9('0x9'));var fs=require('fs');var fs_extra=require(_0xa1c9('0xa'));var _=require(_0xa1c9('0xb'));var squel=require(_0xa1c9('0xc'));var crypto=require(_0xa1c9('0xd'));var jsforce=require(_0xa1c9('0xe'));var deskjs=require(_0xa1c9('0xf'));var toCsv=require(_0xa1c9('0x8'));var querystring=require(_0xa1c9('0x10'));var Papa=require(_0xa1c9('0x11'));var Redis=require(_0xa1c9('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa1c9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa1c9('0x14'))(_0xa1c9('0x15'));var utils=require(_0xa1c9('0x16'));var config=require(_0xa1c9('0x17'));var licenseUtil=require(_0xa1c9('0x18'));var db=require(_0xa1c9('0x19'))['db'];function respondWithStatusCode(_0x390bd3,_0x1b0149){_0x1b0149=_0x1b0149||0xcc;return function(_0x33191d){if(_0x33191d){return _0x390bd3[_0xa1c9('0x1a')](_0x1b0149);}return _0x390bd3[_0xa1c9('0x1b')](_0x1b0149)[_0xa1c9('0x1c')]();};}function respondWithResult(_0x409dcc,_0x9df889){_0x9df889=_0x9df889||0xc8;return function(_0x33aaa8){if(_0x33aaa8){return _0x409dcc[_0xa1c9('0x1b')](_0x9df889)[_0xa1c9('0x1d')](_0x33aaa8);}};}function respondWithFilteredResult(_0x275059,_0x3f16d6){return function(_0x3f4131){if(_0x3f4131){var _0x59463b=typeof _0x3f16d6[_0xa1c9('0x1e')]==='undefined'&&typeof _0x3f16d6[_0xa1c9('0x1f')]===_0xa1c9('0x20');var _0x3f244b=_0x3f4131[_0xa1c9('0x21')];var _0x13086a=_0x59463b?0x0:_0x3f16d6[_0xa1c9('0x1e')];var _0x223932=_0x59463b?_0x3f4131[_0xa1c9('0x21')]:_0x3f16d6[_0xa1c9('0x1e')]+_0x3f16d6[_0xa1c9('0x1f')];var _0x278ba6;if(_0x223932>=_0x3f244b){_0x223932=_0x3f244b;_0x278ba6=0xc8;}else{_0x278ba6=0xce;}_0x275059[_0xa1c9('0x1b')](_0x278ba6);return _0x275059['set'](_0xa1c9('0x22'),_0x13086a+'-'+_0x223932+'/'+_0x3f244b)[_0xa1c9('0x1d')](_0x3f4131);}return null;};}function patchUpdates(_0x5d0599){return function(_0x1cc3c9){try{jsonpatch[_0xa1c9('0x23')](_0x1cc3c9,_0x5d0599,!![]);}catch(_0x22031f){return BPromise[_0xa1c9('0x24')](_0x22031f);}return _0x1cc3c9[_0xa1c9('0x25')]();};}function saveUpdates(_0x58ac15,_0x3c2b40){return function(_0x2acfb7){if(_0x2acfb7){return _0x2acfb7['update'](_0x58ac15)[_0xa1c9('0x26')](function(_0x23e18e){return _0x23e18e;});}return null;};}function removeEntity(_0x33b4ae,_0x25418a){return function(_0x168c19){if(_0x168c19){return _0x168c19['destroy']()[_0xa1c9('0x26')](function(){_0x33b4ae[_0xa1c9('0x1b')](0xcc)[_0xa1c9('0x1c')]();});}};}function handleEntityNotFound(_0x484a6b,_0x1fa411){return function(_0x37da08){if(!_0x37da08){_0x484a6b[_0xa1c9('0x1a')](0x194);}return _0x37da08;};}function handleError(_0x401380,_0x1575cc){_0x1575cc=_0x1575cc||0x1f4;return function(_0x339dee){logger[_0xa1c9('0x27')](_0x339dee[_0xa1c9('0x28')]);if(_0x339dee[_0xa1c9('0x29')]){delete _0x339dee[_0xa1c9('0x29')];}_0x401380[_0xa1c9('0x1b')](_0x1575cc)[_0xa1c9('0x2a')](_0x339dee);};}exports[_0xa1c9('0x2b')]=function(_0x3f43f1,_0x35cea){var _0xf584e2={},_0x568996={},_0x603beb={'count':0x0,'rows':[]};var _0x429f3d=_[_0xa1c9('0x2c')](db[_0xa1c9('0x2d')][_0xa1c9('0x2e')],function(_0x4c6dd4){return{'name':_0x4c6dd4[_0xa1c9('0x2f')],'type':_0x4c6dd4[_0xa1c9('0x30')]['key']};});_0x568996[_0xa1c9('0x31')]=_[_0xa1c9('0x2c')](_0x429f3d,_0xa1c9('0x29'));_0x568996[_0xa1c9('0x32')]=_[_0xa1c9('0x33')](_0x3f43f1[_0xa1c9('0x32')]);_0x568996[_0xa1c9('0x34')]=_[_0xa1c9('0x35')](_0x568996[_0xa1c9('0x31')],_0x568996[_0xa1c9('0x32')]);_0xf584e2[_0xa1c9('0x36')]=_[_0xa1c9('0x35')](_0x568996[_0xa1c9('0x31')],qs[_0xa1c9('0x37')](_0x3f43f1[_0xa1c9('0x32')]['fields']));_0xf584e2[_0xa1c9('0x36')]=_0xf584e2[_0xa1c9('0x36')][_0xa1c9('0x38')]?_0xf584e2[_0xa1c9('0x36')]:_0x568996['model'];if(!_0x3f43f1[_0xa1c9('0x32')][_0xa1c9('0x39')]('nolimit')){_0xf584e2['limit']=qs[_0xa1c9('0x1f')](_0x3f43f1[_0xa1c9('0x32')][_0xa1c9('0x1f')]);_0xf584e2[_0xa1c9('0x1e')]=qs[_0xa1c9('0x1e')](_0x3f43f1[_0xa1c9('0x32')][_0xa1c9('0x1e')]);}_0xf584e2[_0xa1c9('0x3a')]=qs[_0xa1c9('0x3b')](_0x3f43f1[_0xa1c9('0x32')][_0xa1c9('0x3b')]);_0xf584e2['where']=qs[_0xa1c9('0x34')](_[_0xa1c9('0x3c')](_0x3f43f1[_0xa1c9('0x32')],_0x568996[_0xa1c9('0x34')]),_0x429f3d);if(_0x3f43f1[_0xa1c9('0x32')][_0xa1c9('0x3d')]){_0xf584e2[_0xa1c9('0x3e')]=_[_0xa1c9('0x3f')](_0xf584e2['where'],{'$or':_[_0xa1c9('0x2c')](_0x429f3d,function(_0x15d6b2){if(_0x15d6b2[_0xa1c9('0x30')]!=='VIRTUAL'){var _0x211853={};_0x211853[_0x15d6b2[_0xa1c9('0x29')]]={'$like':'%'+_0x3f43f1[_0xa1c9('0x32')][_0xa1c9('0x3d')]+'%'};return _0x211853;}})});}_0xf584e2=_[_0xa1c9('0x3f')]({},_0xf584e2,_0x3f43f1[_0xa1c9('0x40')]);var _0x32502b={'where':_0xf584e2['where']};return db[_0xa1c9('0x2d')]['count'](_0x32502b)[_0xa1c9('0x26')](function(_0x4c1a9e){_0x603beb[_0xa1c9('0x21')]=_0x4c1a9e;if(_0x3f43f1[_0xa1c9('0x32')][_0xa1c9('0x41')]){_0xf584e2['include']=[{'all':!![]}];}return db[_0xa1c9('0x2d')]['findAll'](_0xf584e2);})[_0xa1c9('0x26')](function(_0x57ed69){_0x603beb['rows']=_0x57ed69;return _0x603beb;})[_0xa1c9('0x26')](respondWithFilteredResult(_0x35cea,_0xf584e2))['catch'](handleError(_0x35cea,null));};exports[_0xa1c9('0x42')]=function(_0x525833,_0x550872){var _0x45a528={'raw':!![],'where':{'id':_0x525833[_0xa1c9('0x43')]['id']}},_0x418e95={};_0x418e95[_0xa1c9('0x31')]=_['keys'](db[_0xa1c9('0x2d')]['rawAttributes']);_0x418e95[_0xa1c9('0x32')]=_[_0xa1c9('0x33')](_0x525833[_0xa1c9('0x32')]);_0x418e95[_0xa1c9('0x34')]=_[_0xa1c9('0x35')](_0x418e95[_0xa1c9('0x31')],_0x418e95[_0xa1c9('0x32')]);_0x45a528[_0xa1c9('0x36')]=_[_0xa1c9('0x35')](_0x418e95[_0xa1c9('0x31')],qs['fields'](_0x525833[_0xa1c9('0x32')][_0xa1c9('0x37')]));_0x45a528[_0xa1c9('0x36')]=_0x45a528[_0xa1c9('0x36')][_0xa1c9('0x38')]?_0x45a528[_0xa1c9('0x36')]:_0x418e95[_0xa1c9('0x31')];if(_0x525833[_0xa1c9('0x32')][_0xa1c9('0x41')]){_0x45a528['include']=[{'all':!![]}];}_0x45a528=_[_0xa1c9('0x3f')]({},_0x45a528,_0x525833[_0xa1c9('0x40')]);return db['Cdr'][_0xa1c9('0x44')](_0x45a528)[_0xa1c9('0x26')](handleEntityNotFound(_0x550872,null))['then'](respondWithResult(_0x550872,null))[_0xa1c9('0x45')](handleError(_0x550872,null));};exports[_0xa1c9('0x46')]=function(_0x468894,_0x222d0c){return db['Cdr'][_0xa1c9('0x46')](_0x468894['body'],{})[_0xa1c9('0x26')](respondWithResult(_0x222d0c,0xc9))['catch'](handleError(_0x222d0c,null));};exports[_0xa1c9('0x47')]=function(_0x1c5317,_0x6d28a1){if(_0x1c5317[_0xa1c9('0x48')]['id']){delete _0x1c5317[_0xa1c9('0x48')]['id'];}return db[_0xa1c9('0x2d')][_0xa1c9('0x44')]({'where':{'id':_0x1c5317[_0xa1c9('0x43')]['id']}})[_0xa1c9('0x26')](handleEntityNotFound(_0x6d28a1,null))[_0xa1c9('0x26')](saveUpdates(_0x1c5317[_0xa1c9('0x48')],null))[_0xa1c9('0x26')](respondWithResult(_0x6d28a1,null))[_0xa1c9('0x45')](handleError(_0x6d28a1,null));};exports[_0xa1c9('0x49')]=function(_0x2774d3,_0x4e8cd2){return db[_0xa1c9('0x2d')][_0xa1c9('0x44')]({'where':{'id':_0x2774d3[_0xa1c9('0x43')]['id']}})[_0xa1c9('0x26')](handleEntityNotFound(_0x4e8cd2,null))['then'](removeEntity(_0x4e8cd2,null))[_0xa1c9('0x45')](handleError(_0x4e8cd2,null));};exports[_0xa1c9('0x4a')]=function(_0x2cfba4,_0xef1290){return db['Cdr'][_0xa1c9('0x4a')]()[_0xa1c9('0x26')](respondWithResult(_0xef1290,null))[_0xa1c9('0x45')](handleError(_0xef1290,null));};
\ No newline at end of file
+var _0x5577=['../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','stack','name','send','Cdr','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','merge','options','includeAll','include','rows','show','find','catch','create','body','update','params','describe','eml-format','zip-dir','fast-json-patch','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/utils','../../config/environment'];(function(_0x4dea4e,_0xc1a71b){var _0xca799d=function(_0x5bc9fb){while(--_0x5bc9fb){_0x4dea4e['push'](_0x4dea4e['shift']());}};_0xca799d(++_0xc1a71b);}(_0x5577,0x1b4));var _0x7557=function(_0x21cb5f,_0x2aa2bd){_0x21cb5f=_0x21cb5f-0x0;var _0x394180=_0x5577[_0x21cb5f];return _0x394180;};'use strict';var emlformat=require(_0x7557('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7557('0x1'));var jsonpatch=require(_0x7557('0x2'));var rp=require('request-promise');var moment=require(_0x7557('0x3'));var BPromise=require(_0x7557('0x4'));var Mustache=require(_0x7557('0x5'));var util=require(_0x7557('0x6'));var path=require(_0x7557('0x7'));var sox=require(_0x7557('0x8'));var csv=require('to-csv');var ejs=require(_0x7557('0x9'));var fs=require('fs');var fs_extra=require(_0x7557('0xa'));var _=require(_0x7557('0xb'));var squel=require(_0x7557('0xc'));var crypto=require(_0x7557('0xd'));var jsforce=require(_0x7557('0xe'));var deskjs=require(_0x7557('0xf'));var toCsv=require(_0x7557('0x10'));var querystring=require(_0x7557('0x11'));var Papa=require(_0x7557('0x12'));var Redis=require(_0x7557('0x13'));var authService=require(_0x7557('0x14'));var qs=require(_0x7557('0x15'));var as=require(_0x7557('0x16'));var hardwareService=require(_0x7557('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x7557('0x18'));var config=require(_0x7557('0x19'));var licenseUtil=require(_0x7557('0x1a'));var db=require(_0x7557('0x1b'))['db'];function respondWithStatusCode(_0xb6ed30,_0x467ac5){_0x467ac5=_0x467ac5||0xcc;return function(_0x156ac1){if(_0x156ac1){return _0xb6ed30[_0x7557('0x1c')](_0x467ac5);}return _0xb6ed30[_0x7557('0x1d')](_0x467ac5)[_0x7557('0x1e')]();};}function respondWithResult(_0x5468df,_0x276031){_0x276031=_0x276031||0xc8;return function(_0x3fb7a6){if(_0x3fb7a6){return _0x5468df[_0x7557('0x1d')](_0x276031)['json'](_0x3fb7a6);}};}function respondWithFilteredResult(_0x3ad3a1,_0x3c3953){return function(_0x33098f){if(_0x33098f){var _0x325849=typeof _0x3c3953['offset']===_0x7557('0x1f')&&typeof _0x3c3953[_0x7557('0x20')]==='undefined';var _0x4a9cae=_0x33098f[_0x7557('0x21')];var _0x11f186=_0x325849?0x0:_0x3c3953[_0x7557('0x22')];var _0x40a81b=_0x325849?_0x33098f['count']:_0x3c3953[_0x7557('0x22')]+_0x3c3953['limit'];var _0x3e2972;if(_0x40a81b>=_0x4a9cae){_0x40a81b=_0x4a9cae;_0x3e2972=0xc8;}else{_0x3e2972=0xce;}_0x3ad3a1[_0x7557('0x1d')](_0x3e2972);return _0x3ad3a1[_0x7557('0x23')](_0x7557('0x24'),_0x11f186+'-'+_0x40a81b+'/'+_0x4a9cae)['json'](_0x33098f);}return null;};}function patchUpdates(_0x1b60a9){return function(_0x3180cd){try{jsonpatch[_0x7557('0x25')](_0x3180cd,_0x1b60a9,!![]);}catch(_0x34bed5){return BPromise[_0x7557('0x26')](_0x34bed5);}return _0x3180cd['save']();};}function saveUpdates(_0x502e49,_0x4eb212){return function(_0x211fbe){if(_0x211fbe){return _0x211fbe['update'](_0x502e49)[_0x7557('0x27')](function(_0x352b63){return _0x352b63;});}return null;};}function removeEntity(_0x1e97d3,_0x9bbcf6){return function(_0x1533b2){if(_0x1533b2){return _0x1533b2[_0x7557('0x28')]()[_0x7557('0x27')](function(){_0x1e97d3['status'](0xcc)[_0x7557('0x1e')]();});}};}function handleEntityNotFound(_0x5bc953,_0x3daeac){return function(_0x5b2c6a){if(!_0x5b2c6a){_0x5bc953[_0x7557('0x1c')](0x194);}return _0x5b2c6a;};}function handleError(_0x3aa642,_0x4758b9){_0x4758b9=_0x4758b9||0x1f4;return function(_0x42ae94){logger['error'](_0x42ae94[_0x7557('0x29')]);if(_0x42ae94['name']){delete _0x42ae94[_0x7557('0x2a')];}_0x3aa642[_0x7557('0x1d')](_0x4758b9)[_0x7557('0x2b')](_0x42ae94);};}exports['index']=function(_0x3b36eb,_0x2b4ca8){var _0x1c6df9={},_0x1c4649={},_0x19095d={'count':0x0,'rows':[]};var _0x414eec=_['map'](db[_0x7557('0x2c')][_0x7557('0x2d')],function(_0x9080c6){return{'name':_0x9080c6[_0x7557('0x2e')],'type':_0x9080c6['type'][_0x7557('0x2f')]};});_0x1c4649[_0x7557('0x30')]=_[_0x7557('0x31')](_0x414eec,_0x7557('0x2a'));_0x1c4649[_0x7557('0x32')]=_[_0x7557('0x33')](_0x3b36eb[_0x7557('0x32')]);_0x1c4649[_0x7557('0x34')]=_[_0x7557('0x35')](_0x1c4649[_0x7557('0x30')],_0x1c4649[_0x7557('0x32')]);_0x1c6df9[_0x7557('0x36')]=_[_0x7557('0x35')](_0x1c4649[_0x7557('0x30')],qs[_0x7557('0x37')](_0x3b36eb[_0x7557('0x32')][_0x7557('0x37')]));_0x1c6df9[_0x7557('0x36')]=_0x1c6df9[_0x7557('0x36')][_0x7557('0x38')]?_0x1c6df9[_0x7557('0x36')]:_0x1c4649[_0x7557('0x30')];if(!_0x3b36eb['query'][_0x7557('0x39')]('nolimit')){_0x1c6df9['limit']=qs[_0x7557('0x20')](_0x3b36eb['query'][_0x7557('0x20')]);_0x1c6df9['offset']=qs['offset'](_0x3b36eb[_0x7557('0x32')][_0x7557('0x22')]);}_0x1c6df9[_0x7557('0x3a')]=qs['sort'](_0x3b36eb[_0x7557('0x32')][_0x7557('0x3b')]);_0x1c6df9[_0x7557('0x3c')]=qs[_0x7557('0x34')](_[_0x7557('0x3d')](_0x3b36eb[_0x7557('0x32')],_0x1c4649[_0x7557('0x34')]),_0x414eec);if(_0x3b36eb[_0x7557('0x32')]['filter']){_0x1c6df9['where']=_['merge'](_0x1c6df9['where'],{'$or':_['map'](_0x414eec,function(_0x4f3c68){if(_0x4f3c68[_0x7557('0x3e')]!==_0x7557('0x3f')){var _0x3a7c60={};_0x3a7c60[_0x4f3c68[_0x7557('0x2a')]]={'$like':'%'+_0x3b36eb['query']['filter']+'%'};return _0x3a7c60;}})});}_0x1c6df9=_[_0x7557('0x40')]({},_0x1c6df9,_0x3b36eb[_0x7557('0x41')]);var _0x962488={'where':_0x1c6df9[_0x7557('0x3c')]};return db[_0x7557('0x2c')]['count'](_0x962488)[_0x7557('0x27')](function(_0x5149c9){_0x19095d[_0x7557('0x21')]=_0x5149c9;if(_0x3b36eb[_0x7557('0x32')][_0x7557('0x42')]){_0x1c6df9[_0x7557('0x43')]=[{'all':!![]}];}return db[_0x7557('0x2c')]['findAll'](_0x1c6df9);})[_0x7557('0x27')](function(_0x3023e5){_0x19095d[_0x7557('0x44')]=_0x3023e5;return _0x19095d;})[_0x7557('0x27')](respondWithFilteredResult(_0x2b4ca8,_0x1c6df9))['catch'](handleError(_0x2b4ca8,null));};exports[_0x7557('0x45')]=function(_0x59a75a,_0x156f3b){var _0x576461={'raw':!![],'where':{'id':_0x59a75a['params']['id']}},_0x16e40f={};_0x16e40f[_0x7557('0x30')]=_['keys'](db[_0x7557('0x2c')]['rawAttributes']);_0x16e40f[_0x7557('0x32')]=_[_0x7557('0x33')](_0x59a75a[_0x7557('0x32')]);_0x16e40f[_0x7557('0x34')]=_[_0x7557('0x35')](_0x16e40f[_0x7557('0x30')],_0x16e40f['query']);_0x576461['attributes']=_['intersection'](_0x16e40f[_0x7557('0x30')],qs[_0x7557('0x37')](_0x59a75a[_0x7557('0x32')][_0x7557('0x37')]));_0x576461[_0x7557('0x36')]=_0x576461['attributes'][_0x7557('0x38')]?_0x576461['attributes']:_0x16e40f[_0x7557('0x30')];if(_0x59a75a[_0x7557('0x32')][_0x7557('0x42')]){_0x576461[_0x7557('0x43')]=[{'all':!![]}];}_0x576461=_[_0x7557('0x40')]({},_0x576461,_0x59a75a[_0x7557('0x41')]);return db[_0x7557('0x2c')][_0x7557('0x46')](_0x576461)['then'](handleEntityNotFound(_0x156f3b,null))[_0x7557('0x27')](respondWithResult(_0x156f3b,null))[_0x7557('0x47')](handleError(_0x156f3b,null));};exports[_0x7557('0x48')]=function(_0x59904c,_0xb25031){return db['Cdr']['create'](_0x59904c[_0x7557('0x49')],{})[_0x7557('0x27')](respondWithResult(_0xb25031,0xc9))[_0x7557('0x47')](handleError(_0xb25031,null));};exports[_0x7557('0x4a')]=function(_0x3683c9,_0x4d9b43){if(_0x3683c9[_0x7557('0x49')]['id']){delete _0x3683c9[_0x7557('0x49')]['id'];}return db[_0x7557('0x2c')][_0x7557('0x46')]({'where':{'id':_0x3683c9[_0x7557('0x4b')]['id']}})[_0x7557('0x27')](handleEntityNotFound(_0x4d9b43,null))[_0x7557('0x27')](saveUpdates(_0x3683c9['body'],null))['then'](respondWithResult(_0x4d9b43,null))['catch'](handleError(_0x4d9b43,null));};exports['destroy']=function(_0x2b85c5,_0x36a2a1){return db[_0x7557('0x2c')][_0x7557('0x46')]({'where':{'id':_0x2b85c5[_0x7557('0x4b')]['id']}})[_0x7557('0x27')](handleEntityNotFound(_0x36a2a1,null))[_0x7557('0x27')](removeEntity(_0x36a2a1,null))[_0x7557('0x47')](handleError(_0x36a2a1,null));};exports['describe']=function(_0x46b871,_0x445e17){return db['Cdr'][_0x7557('0x4c')]()['then'](respondWithResult(_0x445e17,null))[_0x7557('0x47')](handleError(_0x445e17,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 89a07e3..f79eabb 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(_0x5ceb91,_0x2acd20){var _0x35aecc=function(_0x8c3abc){while(--_0x8c3abc){_0x5ceb91['push'](_0x5ceb91['shift']());}};_0x35aecc(++_0x2acd20);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x571dd4,_0x69bfae){var _0x134b59=function(_0x721b1){while(--_0x721b1){_0x571dd4['push'](_0x571dd4['shift']());}};_0x134b59(++_0x69bfae);}(_0x7a54,0x106));var _0x47a5=function(_0x30ede1,_0xa90d28){_0x30ede1=_0x30ede1-0x0;var _0xe1603d=_0x7a54[_0x30ede1];return _0xe1603d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 99e4294..1e6f871 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 _0x20ff=['request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http'];(function(_0x237fdb,_0x5485c0){var _0x4d26f1=function(_0x560a98){while(--_0x560a98){_0x237fdb['push'](_0x237fdb['shift']());}};_0x4d26f1(++_0x5485c0);}(_0x20ff,0x193));var _0xf20f=function(_0x1f1801,_0x5471fb){_0x1f1801=_0x1f1801-0x0;var _0x2f993c=_0x20ff[_0x1f1801];return _0x2f993c;};'use strict';var _=require(_0xf20f('0x0'));var util=require(_0xf20f('0x1'));var moment=require(_0xf20f('0x2'));var BPromise=require(_0xf20f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf20f('0x4'));var db=require(_0xf20f('0x5'))['db'];var utils=require(_0xf20f('0x6'));var logger=require('../../config/logger')(_0xf20f('0x7'));var config=require(_0xf20f('0x8'));var jayson=require(_0xf20f('0x9'));var client=jayson['client'][_0xf20f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10ed2f,_0x52adb2,_0x474d07){return new BPromise(function(_0x2392ce,_0x3487aa){return client[_0xf20f('0xb')](_0x10ed2f,_0x474d07)[_0xf20f('0xc')](function(_0x58bb61){logger[_0xf20f('0xd')](_0xf20f('0xe'),_0x52adb2,_0xf20f('0xf'));logger[_0xf20f('0x10')]('Cdr,\x20%s,\x20%s,\x20%s',_0x52adb2,_0xf20f('0xf'),JSON[_0xf20f('0x11')](_0x58bb61));if(_0x58bb61[_0xf20f('0x12')]){if(_0x58bb61[_0xf20f('0x12')][_0xf20f('0x13')]===0x1f4){logger[_0xf20f('0x12')](_0xf20f('0xe'),_0x52adb2,_0x58bb61[_0xf20f('0x12')]['message']);return _0x3487aa(_0x58bb61['error'][_0xf20f('0x14')]);}logger[_0xf20f('0x12')](_0xf20f('0xe'),_0x52adb2,_0x58bb61[_0xf20f('0x12')]['message']);return _0x2392ce(_0x58bb61['error'][_0xf20f('0x14')]);}else{logger[_0xf20f('0xd')](_0xf20f('0xe'),_0x52adb2,_0xf20f('0xf'));_0x2392ce(_0x58bb61[_0xf20f('0x15')]['message']);}})[_0xf20f('0x16')](function(_0x1ebc70){logger[_0xf20f('0x12')](_0xf20f('0xe'),_0x52adb2,_0x1ebc70);_0x3487aa(_0x1ebc70);});});}
\ No newline at end of file
+var _0xc0c0=['lodash','util','moment','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1658cc,_0x342989){var _0x36ccf6=function(_0x216077){while(--_0x216077){_0x1658cc['push'](_0x1658cc['shift']());}};_0x36ccf6(++_0x342989);}(_0xc0c0,0xd2));var _0x0c0c=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0xc0c0[_0x1a72f3];return _0x57ef47;};'use strict';var _=require(_0x0c0c('0x0'));var util=require(_0x0c0c('0x1'));var moment=require(_0x0c0c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0c0c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0c0c('0x4'));var logger=require('../../config/logger')(_0x0c0c('0x5'));var config=require(_0x0c0c('0x6'));var jayson=require(_0x0c0c('0x7'));var client=jayson[_0x0c0c('0x8')][_0x0c0c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3bf174,_0x5be767,_0x3e7e44){return new BPromise(function(_0x3d50b3,_0x29711a){return client[_0x0c0c('0xa')](_0x3bf174,_0x3e7e44)[_0x0c0c('0xb')](function(_0x580341){logger[_0x0c0c('0xc')](_0x0c0c('0xd'),_0x5be767,_0x0c0c('0xe'));logger[_0x0c0c('0xf')](_0x0c0c('0x10'),_0x5be767,'request\x20sent',JSON[_0x0c0c('0x11')](_0x580341));if(_0x580341[_0x0c0c('0x12')]){if(_0x580341[_0x0c0c('0x12')][_0x0c0c('0x13')]===0x1f4){logger[_0x0c0c('0x12')](_0x0c0c('0xd'),_0x5be767,_0x580341[_0x0c0c('0x12')][_0x0c0c('0x14')]);return _0x29711a(_0x580341[_0x0c0c('0x12')][_0x0c0c('0x14')]);}logger[_0x0c0c('0x12')](_0x0c0c('0xd'),_0x5be767,_0x580341['error'][_0x0c0c('0x14')]);return _0x3d50b3(_0x580341[_0x0c0c('0x12')][_0x0c0c('0x14')]);}else{logger['info'](_0x0c0c('0xd'),_0x5be767,_0x0c0c('0xe'));_0x3d50b3(_0x580341['result'][_0x0c0c('0x14')]);}})['catch'](function(_0x4f3d67){logger[_0x0c0c('0x12')]('Cdr,\x20%s,\x20%s',_0x5be767,_0x4f3d67);_0x29711a(_0x4f3d67);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index ec0b2fb..4d98c2b 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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+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(_0x565605,_0x17dd6f){var _0x19193b=function(_0x3fb056){while(--_0x3fb056){_0x565605['push'](_0x565605['shift']());}};_0x19193b(++_0x17dd6f);}(_0xb10b,0x12a));var _0xbb10=function(_0x2d3d0d,_0x67ac82){_0x2d3d0d=_0x2d3d0d-0x0;var _0xca35b6=_0xb10b[_0x2d3d0d];return _0xca35b6;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 4197a63..bee4ac7 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 _0x5219=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x2e0661,_0x25f81d){var _0x16c7cb=function(_0x34b90f){while(--_0x34b90f){_0x2e0661['push'](_0x2e0661['shift']());}};_0x16c7cb(++_0x25f81d);}(_0x5219,0x1ac));var _0x9521=function(_0xdc6b17,_0x279612){_0xdc6b17=_0xdc6b17-0x0;var _0x979e36=_0x5219[_0xdc6b17];return _0x979e36;};'use strict';var Sequelize=require(_0x9521('0x0'));module[_0x9521('0x1')]={'priority':{'type':Sequelize[_0x9521('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9521('0x3')],'allowNull':![],'defaultValue':_0x9521('0x4')},'appdata':{'type':Sequelize[_0x9521('0x5')]()},'description':{'type':Sequelize[_0x9521('0x3')]},'interval':{'type':Sequelize[_0x9521('0x3')],'defaultValue':_0x9521('0x6')}};
\ No newline at end of file
+var _0xd2a6=['noop','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x3f8a03,_0x319b9c){var _0x147fb2=function(_0x523c1c){while(--_0x523c1c){_0x3f8a03['push'](_0x3f8a03['shift']());}};_0x147fb2(++_0x319b9c);}(_0xd2a6,0x170));var _0x6d2a=function(_0x48ec91,_0x212edc){_0x48ec91=_0x48ec91-0x0;var _0x22766c=_0xd2a6[_0x48ec91];return _0x22766c;};'use strict';var Sequelize=require(_0x6d2a('0x0'));module[_0x6d2a('0x1')]={'priority':{'type':Sequelize[_0x6d2a('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6d2a('0x3')],'allowNull':![],'defaultValue':_0x6d2a('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x6d2a('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x6d2a('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 928341f..2787122 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 _0x50a8=['undefined','limit','count','set','Content-Range','json','apply','update','destroy','then','error','stack','name','send','show','params','model','keys','ChatApplication','query','filters','intersection','fields','attributes','length','includeAll','options','find','catch','body','eml-format','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','offset'];(function(_0x4f0363,_0x12a02c){var _0xa5e67=function(_0x577c65){while(--_0x577c65){_0x4f0363['push'](_0x4f0363['shift']());}};_0xa5e67(++_0x12a02c);}(_0x50a8,0x198));var _0x850a=function(_0x50daa4,_0x3c336d){_0x50daa4=_0x50daa4-0x0;var _0x389935=_0x50a8[_0x50daa4];return _0x389935;};'use strict';var emlformat=require(_0x850a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x850a('0x1'));var moment=require('moment');var BPromise=require(_0x850a('0x2'));var Mustache=require(_0x850a('0x3'));var util=require(_0x850a('0x4'));var path=require(_0x850a('0x5'));var sox=require(_0x850a('0x6'));var csv=require(_0x850a('0x7'));var ejs=require(_0x850a('0x8'));var fs=require('fs');var fs_extra=require(_0x850a('0x9'));var _=require(_0x850a('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x850a('0xb'));var deskjs=require(_0x850a('0xc'));var toCsv=require(_0x850a('0x7'));var querystring=require(_0x850a('0xd'));var Papa=require('papaparse');var Redis=require(_0x850a('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x850a('0xf'));var hardwareService=require(_0x850a('0x10'));var logger=require(_0x850a('0x11'))(_0x850a('0x12'));var utils=require(_0x850a('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b12a1,_0x4d591d){_0x4d591d=_0x4d591d||0xcc;return function(_0x45cd78){if(_0x45cd78){return _0x3b12a1[_0x850a('0x14')](_0x4d591d);}return _0x3b12a1[_0x850a('0x15')](_0x4d591d)[_0x850a('0x16')]();};}function respondWithResult(_0x3328e6,_0x50c199){_0x50c199=_0x50c199||0xc8;return function(_0x355a31){if(_0x355a31){return _0x3328e6['status'](_0x50c199)['json'](_0x355a31);}};}function respondWithFilteredResult(_0x537679,_0x4c0156){return function(_0x3e6e81){if(_0x3e6e81){var _0x5e0fbe=typeof _0x4c0156[_0x850a('0x17')]===_0x850a('0x18')&&typeof _0x4c0156[_0x850a('0x19')]===_0x850a('0x18');var _0x22d759=_0x3e6e81[_0x850a('0x1a')];var _0x3e2715=_0x5e0fbe?0x0:_0x4c0156[_0x850a('0x17')];var _0x57e789=_0x5e0fbe?_0x3e6e81[_0x850a('0x1a')]:_0x4c0156['offset']+_0x4c0156['limit'];var _0x49690e;if(_0x57e789>=_0x22d759){_0x57e789=_0x22d759;_0x49690e=0xc8;}else{_0x49690e=0xce;}_0x537679['status'](_0x49690e);return _0x537679[_0x850a('0x1b')](_0x850a('0x1c'),_0x3e2715+'-'+_0x57e789+'/'+_0x22d759)[_0x850a('0x1d')](_0x3e6e81);}return null;};}function patchUpdates(_0x5b2917){return function(_0x17eadb){try{jsonpatch[_0x850a('0x1e')](_0x17eadb,_0x5b2917,!![]);}catch(_0x15c39b){return BPromise['reject'](_0x15c39b);}return _0x17eadb['save']();};}function saveUpdates(_0x342b50,_0x285ef4){return function(_0x5758af){if(_0x5758af){return _0x5758af[_0x850a('0x1f')](_0x342b50)['then'](function(_0x5eb2a4){return _0x5eb2a4;});}return null;};}function removeEntity(_0x561fde,_0x4363d4){return function(_0x47d527){if(_0x47d527){return _0x47d527[_0x850a('0x20')]()[_0x850a('0x21')](function(){_0x561fde[_0x850a('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4606ef,_0xc52e71){return function(_0x33327e){if(!_0x33327e){_0x4606ef['sendStatus'](0x194);}return _0x33327e;};}function handleError(_0x1da9ad,_0xe46a27){_0xe46a27=_0xe46a27||0x1f4;return function(_0x4d715c){logger[_0x850a('0x22')](_0x4d715c[_0x850a('0x23')]);if(_0x4d715c[_0x850a('0x24')]){delete _0x4d715c[_0x850a('0x24')];}_0x1da9ad[_0x850a('0x15')](_0xe46a27)[_0x850a('0x25')](_0x4d715c);};}exports[_0x850a('0x26')]=function(_0x314d36,_0x3a228f){var _0x177dd6={'raw':!![],'where':{'id':_0x314d36[_0x850a('0x27')]['id']}},_0x44fb58={};_0x44fb58[_0x850a('0x28')]=_[_0x850a('0x29')](db[_0x850a('0x2a')]['rawAttributes']);_0x44fb58[_0x850a('0x2b')]=_['keys'](_0x314d36[_0x850a('0x2b')]);_0x44fb58[_0x850a('0x2c')]=_[_0x850a('0x2d')](_0x44fb58['model'],_0x44fb58['query']);_0x177dd6['attributes']=_[_0x850a('0x2d')](_0x44fb58['model'],qs[_0x850a('0x2e')](_0x314d36[_0x850a('0x2b')][_0x850a('0x2e')]));_0x177dd6[_0x850a('0x2f')]=_0x177dd6['attributes'][_0x850a('0x30')]?_0x177dd6[_0x850a('0x2f')]:_0x44fb58[_0x850a('0x28')];if(_0x314d36[_0x850a('0x2b')][_0x850a('0x31')]){_0x177dd6['include']=[{'all':!![]}];}_0x177dd6=_['merge']({},_0x177dd6,_0x314d36[_0x850a('0x32')]);return db['ChatApplication'][_0x850a('0x33')](_0x177dd6)[_0x850a('0x21')](handleEntityNotFound(_0x3a228f,null))[_0x850a('0x21')](respondWithResult(_0x3a228f,null))[_0x850a('0x34')](handleError(_0x3a228f,null));};exports[_0x850a('0x1f')]=function(_0x172050,_0x3d88bb){if(_0x172050[_0x850a('0x35')]['id']){delete _0x172050[_0x850a('0x35')]['id'];}return db[_0x850a('0x2a')]['find']({'where':{'id':_0x172050[_0x850a('0x27')]['id']}})[_0x850a('0x21')](handleEntityNotFound(_0x3d88bb,null))[_0x850a('0x21')](saveUpdates(_0x172050[_0x850a('0x35')],null))[_0x850a('0x21')](respondWithResult(_0x3d88bb,null))['catch'](handleError(_0x3d88bb,null));};exports[_0x850a('0x20')]=function(_0x376a12,_0x58d34d){return db[_0x850a('0x2a')][_0x850a('0x33')]({'where':{'id':_0x376a12[_0x850a('0x27')]['id']}})['then'](handleEntityNotFound(_0x58d34d,null))['then'](removeEntity(_0x58d34d,null))[_0x850a('0x34')](handleError(_0x58d34d,null));};
\ No newline at end of file
+var _0xfa20=['request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','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','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','show','params','model','keys','filters','intersection','query','fields','attributes','includeAll','include','merge','options','ChatApplication','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x597f6c,_0x2d7f48){var _0x20e8b8=function(_0x7552e6){while(--_0x7552e6){_0x597f6c['push'](_0x597f6c['shift']());}};_0x20e8b8(++_0x2d7f48);}(_0xfa20,0x141));var _0x0fa2=function(_0x4bf5ec,_0x333deb){_0x4bf5ec=_0x4bf5ec-0x0;var _0x128359=_0xfa20[_0x4bf5ec];return _0x128359;};'use strict';var emlformat=require(_0x0fa2('0x0'));var rimraf=require(_0x0fa2('0x1'));var zipdir=require(_0x0fa2('0x2'));var jsonpatch=require(_0x0fa2('0x3'));var rp=require(_0x0fa2('0x4'));var moment=require(_0x0fa2('0x5'));var BPromise=require(_0x0fa2('0x6'));var Mustache=require(_0x0fa2('0x7'));var util=require(_0x0fa2('0x8'));var path=require(_0x0fa2('0x9'));var sox=require(_0x0fa2('0xa'));var csv=require('to-csv');var ejs=require(_0x0fa2('0xb'));var fs=require('fs');var fs_extra=require(_0x0fa2('0xc'));var _=require('lodash');var squel=require(_0x0fa2('0xd'));var crypto=require(_0x0fa2('0xe'));var jsforce=require(_0x0fa2('0xf'));var deskjs=require(_0x0fa2('0x10'));var toCsv=require(_0x0fa2('0x11'));var querystring=require(_0x0fa2('0x12'));var Papa=require(_0x0fa2('0x13'));var Redis=require(_0x0fa2('0x14'));var authService=require(_0x0fa2('0x15'));var qs=require(_0x0fa2('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0fa2('0x17'));var logger=require(_0x0fa2('0x18'))(_0x0fa2('0x19'));var utils=require(_0x0fa2('0x1a'));var config=require(_0x0fa2('0x1b'));var licenseUtil=require(_0x0fa2('0x1c'));var db=require(_0x0fa2('0x1d'))['db'];function respondWithStatusCode(_0x15a25c,_0x524360){_0x524360=_0x524360||0xcc;return function(_0x3d86ee){if(_0x3d86ee){return _0x15a25c['sendStatus'](_0x524360);}return _0x15a25c[_0x0fa2('0x1e')](_0x524360)['end']();};}function respondWithResult(_0x539b6b,_0x4a5ba2){_0x4a5ba2=_0x4a5ba2||0xc8;return function(_0x2d4c9d){if(_0x2d4c9d){return _0x539b6b[_0x0fa2('0x1e')](_0x4a5ba2)[_0x0fa2('0x1f')](_0x2d4c9d);}};}function respondWithFilteredResult(_0x157b03,_0x4366a8){return function(_0x46e317){if(_0x46e317){var _0x162cb3=typeof _0x4366a8[_0x0fa2('0x20')]==='undefined'&&typeof _0x4366a8[_0x0fa2('0x21')]===_0x0fa2('0x22');var _0x3e3baf=_0x46e317[_0x0fa2('0x23')];var _0x40f402=_0x162cb3?0x0:_0x4366a8[_0x0fa2('0x20')];var _0x2083a0=_0x162cb3?_0x46e317[_0x0fa2('0x23')]:_0x4366a8[_0x0fa2('0x20')]+_0x4366a8[_0x0fa2('0x21')];var _0x59177e;if(_0x2083a0>=_0x3e3baf){_0x2083a0=_0x3e3baf;_0x59177e=0xc8;}else{_0x59177e=0xce;}_0x157b03['status'](_0x59177e);return _0x157b03[_0x0fa2('0x24')](_0x0fa2('0x25'),_0x40f402+'-'+_0x2083a0+'/'+_0x3e3baf)['json'](_0x46e317);}return null;};}function patchUpdates(_0x383ebd){return function(_0x29b93c){try{jsonpatch[_0x0fa2('0x26')](_0x29b93c,_0x383ebd,!![]);}catch(_0x48d549){return BPromise[_0x0fa2('0x27')](_0x48d549);}return _0x29b93c[_0x0fa2('0x28')]();};}function saveUpdates(_0x5cbca0,_0x3b51bc){return function(_0x574ae0){if(_0x574ae0){return _0x574ae0[_0x0fa2('0x29')](_0x5cbca0)[_0x0fa2('0x2a')](function(_0xb6b606){return _0xb6b606;});}return null;};}function removeEntity(_0x2cf751,_0x7f6eb){return function(_0x4d921b){if(_0x4d921b){return _0x4d921b[_0x0fa2('0x2b')]()[_0x0fa2('0x2a')](function(){_0x2cf751[_0x0fa2('0x1e')](0xcc)[_0x0fa2('0x2c')]();});}};}function handleEntityNotFound(_0x16b313,_0x40d425){return function(_0x38a2c4){if(!_0x38a2c4){_0x16b313['sendStatus'](0x194);}return _0x38a2c4;};}function handleError(_0x461c54,_0x5180d1){_0x5180d1=_0x5180d1||0x1f4;return function(_0x3611ca){logger['error'](_0x3611ca[_0x0fa2('0x2d')]);if(_0x3611ca[_0x0fa2('0x2e')]){delete _0x3611ca[_0x0fa2('0x2e')];}_0x461c54[_0x0fa2('0x1e')](_0x5180d1)[_0x0fa2('0x2f')](_0x3611ca);};}exports[_0x0fa2('0x30')]=function(_0x50779a,_0xda3cdf){var _0x597f53={'raw':!![],'where':{'id':_0x50779a[_0x0fa2('0x31')]['id']}},_0x5060bf={};_0x5060bf[_0x0fa2('0x32')]=_[_0x0fa2('0x33')](db['ChatApplication']['rawAttributes']);_0x5060bf['query']=_['keys'](_0x50779a['query']);_0x5060bf[_0x0fa2('0x34')]=_[_0x0fa2('0x35')](_0x5060bf[_0x0fa2('0x32')],_0x5060bf[_0x0fa2('0x36')]);_0x597f53['attributes']=_['intersection'](_0x5060bf['model'],qs[_0x0fa2('0x37')](_0x50779a['query'][_0x0fa2('0x37')]));_0x597f53[_0x0fa2('0x38')]=_0x597f53[_0x0fa2('0x38')]['length']?_0x597f53['attributes']:_0x5060bf[_0x0fa2('0x32')];if(_0x50779a[_0x0fa2('0x36')][_0x0fa2('0x39')]){_0x597f53[_0x0fa2('0x3a')]=[{'all':!![]}];}_0x597f53=_[_0x0fa2('0x3b')]({},_0x597f53,_0x50779a[_0x0fa2('0x3c')]);return db[_0x0fa2('0x3d')][_0x0fa2('0x3e')](_0x597f53)[_0x0fa2('0x2a')](handleEntityNotFound(_0xda3cdf,null))[_0x0fa2('0x2a')](respondWithResult(_0xda3cdf,null))[_0x0fa2('0x3f')](handleError(_0xda3cdf,null));};exports[_0x0fa2('0x29')]=function(_0x18eb5a,_0x2a6317){if(_0x18eb5a[_0x0fa2('0x40')]['id']){delete _0x18eb5a[_0x0fa2('0x40')]['id'];}return db[_0x0fa2('0x3d')][_0x0fa2('0x3e')]({'where':{'id':_0x18eb5a['params']['id']}})['then'](handleEntityNotFound(_0x2a6317,null))[_0x0fa2('0x2a')](saveUpdates(_0x18eb5a[_0x0fa2('0x40')],null))[_0x0fa2('0x2a')](respondWithResult(_0x2a6317,null))[_0x0fa2('0x3f')](handleError(_0x2a6317,null));};exports[_0x0fa2('0x2b')]=function(_0x4526e7,_0x59df2b){return db[_0x0fa2('0x3d')][_0x0fa2('0x3e')]({'where':{'id':_0x4526e7[_0x0fa2('0x31')]['id']}})[_0x0fa2('0x2a')](handleEntityNotFound(_0x59df2b,null))[_0x0fa2('0x2a')](removeEntity(_0x59df2b,null))['catch'](handleError(_0x59df2b,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 2ea966d..7a206a4 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 _0x968b=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x1ab180,_0x382b2c){var _0xfb2c2d=function(_0x1c5fd3){while(--_0x1c5fd3){_0x1ab180['push'](_0x1ab180['shift']());}};_0xfb2c2d(++_0x382b2c);}(_0x968b,0x8f));var _0xb968=function(_0x4da3b6,_0x233aff){_0x4da3b6=_0x4da3b6-0x0;var _0x574d38=_0x968b[_0x4da3b6];return _0x574d38;};'use strict';var _=require(_0xb968('0x0'));var util=require(_0xb968('0x1'));var logger=require(_0xb968('0x2'))(_0xb968('0x3'));var moment=require('moment');var BPromise=require(_0xb968('0x4'));var rp=require(_0xb968('0x5'));var fs=require('fs');var path=require(_0xb968('0x6'));var rimraf=require(_0xb968('0x7'));var config=require(_0xb968('0x8'));var attributes=require(_0xb968('0x9'));module[_0xb968('0xa')]=function(_0x482e8d,_0x4c0d59){return _0x482e8d[_0xb968('0xb')](_0xb968('0xc'),attributes,{'tableName':_0xb968('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb968('0xe'),'collate':_0xb968('0xf')});};
\ No newline at end of file
+var _0xc439=['api','moment','bluebird','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x2373c6,_0x4218c9){var _0xf2aaa9=function(_0x26eb3b){while(--_0x26eb3b){_0x2373c6['push'](_0x2373c6['shift']());}};_0xf2aaa9(++_0x4218c9);}(_0xc439,0x174));var _0x9c43=function(_0x4170cb,_0x20f4b0){_0x4170cb=_0x4170cb-0x0;var _0x396e15=_0xc439[_0x4170cb];return _0x396e15;};'use strict';var _=require(_0x9c43('0x0'));var util=require(_0x9c43('0x1'));var logger=require(_0x9c43('0x2'))(_0x9c43('0x3'));var moment=require(_0x9c43('0x4'));var BPromise=require(_0x9c43('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9c43('0x6'));var config=require(_0x9c43('0x7'));var attributes=require(_0x9c43('0x8'));module[_0x9c43('0x9')]=function(_0x34e2fc,_0x4e9ad5){return _0x34e2fc[_0x9c43('0xa')](_0x9c43('0xb'),attributes,{'tableName':_0x9c43('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9c43('0xd'),'collate':_0x9c43('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index acf61de..f94c24c 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 _0xfaf4=['error','message','request\x20sent','result','catch','moment','bluebird','randomstring','../../mysqldb','jayson/promise','client','http','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s'];(function(_0x5e98cc,_0x18c78d){var _0xa2bd7f=function(_0x4b672c){while(--_0x4b672c){_0x5e98cc['push'](_0x5e98cc['shift']());}};_0xa2bd7f(++_0x18c78d);}(_0xfaf4,0x1d5));var _0x4faf=function(_0x180a2a,_0x304a90){_0x180a2a=_0x180a2a-0x0;var _0x5ad1fb=_0xfaf4[_0x180a2a];return _0x5ad1fb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4faf('0x0'));var BPromise=require(_0x4faf('0x1'));var rs=require(_0x4faf('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4faf('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x4faf('0x4'));var client=jayson[_0x4faf('0x5')][_0x4faf('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5a3235,_0x1eddbf,_0x2714a0){return new BPromise(function(_0x44fd93,_0x553358){return client['request'](_0x5a3235,_0x2714a0)['then'](function(_0x5d70c2){logger[_0x4faf('0x7')](_0x4faf('0x8'),_0x1eddbf,'request\x20sent');logger[_0x4faf('0x9')](_0x4faf('0xa'),_0x1eddbf,'request\x20sent',JSON['stringify'](_0x5d70c2));if(_0x5d70c2[_0x4faf('0xb')]){if(_0x5d70c2[_0x4faf('0xb')]['code']===0x1f4){logger[_0x4faf('0xb')](_0x4faf('0x8'),_0x1eddbf,_0x5d70c2[_0x4faf('0xb')][_0x4faf('0xc')]);return _0x553358(_0x5d70c2['error'][_0x4faf('0xc')]);}logger[_0x4faf('0xb')]('ChatApplication,\x20%s,\x20%s',_0x1eddbf,_0x5d70c2[_0x4faf('0xb')]['message']);return _0x44fd93(_0x5d70c2['error'][_0x4faf('0xc')]);}else{logger[_0x4faf('0x7')](_0x4faf('0x8'),_0x1eddbf,_0x4faf('0xd'));_0x44fd93(_0x5d70c2[_0x4faf('0xe')][_0x4faf('0xc')]);}})[_0x4faf('0xf')](function(_0x3dcc47){logger[_0x4faf('0xb')](_0x4faf('0x8'),_0x1eddbf,_0x3dcc47);_0x553358(_0x3dcc47);});});}
\ No newline at end of file
+var _0x32ab=['../../mysqldb','../../config/logger','jayson/promise','request','info','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatApplication,\x20%s,\x20%s','lodash','moment','bluebird','randomstring'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x32ab,0x17c));var _0xb32a=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x32ab[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0xb32a('0x0'));var util=require('util');var moment=require(_0xb32a('0x1'));var BPromise=require(_0xb32a('0x2'));var rs=require(_0xb32a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb32a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb32a('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb32a('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2d1638,_0x1e850f,_0x55fb79){return new BPromise(function(_0x4d1ba0,_0x33f31d){return client[_0xb32a('0x7')](_0x2d1638,_0x55fb79)['then'](function(_0x52c373){logger[_0xb32a('0x8')]('ChatApplication,\x20%s,\x20%s',_0x1e850f,_0xb32a('0x9'));logger['debug'](_0xb32a('0xa'),_0x1e850f,_0xb32a('0x9'),JSON[_0xb32a('0xb')](_0x52c373));if(_0x52c373[_0xb32a('0xc')]){if(_0x52c373[_0xb32a('0xc')][_0xb32a('0xd')]===0x1f4){logger[_0xb32a('0xc')]('ChatApplication,\x20%s,\x20%s',_0x1e850f,_0x52c373[_0xb32a('0xc')]['message']);return _0x33f31d(_0x52c373['error'][_0xb32a('0xe')]);}logger['error'](_0xb32a('0xf'),_0x1e850f,_0x52c373[_0xb32a('0xc')][_0xb32a('0xe')]);return _0x4d1ba0(_0x52c373[_0xb32a('0xc')][_0xb32a('0xe')]);}else{logger[_0xb32a('0x8')]('ChatApplication,\x20%s,\x20%s',_0x1e850f,_0xb32a('0x9'));_0x4d1ba0(_0x52c373['result']['message']);}})['catch'](function(_0x23cecd){logger[_0xb32a('0xc')](_0xb32a('0xf'),_0x1e850f,_0x23cecd);_0x33f31d(_0x23cecd);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 5b12bed..0f08f99 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 _0x5536=['update','destroy','exports','multer','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','show'];(function(_0x330f00,_0x2208d8){var _0x3c79d8=function(_0x1f7e4e){while(--_0x1f7e4e){_0x330f00['push'](_0x330f00['shift']());}};_0x3c79d8(++_0x2208d8);}(_0x5536,0x189));var _0x6553=function(_0x1498e9,_0x267008){_0x1498e9=_0x1498e9-0x0;var _0x5c15f2=_0x5536[_0x1498e9];return _0x5c15f2;};'use strict';var multer=require(_0x6553('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6553('0x1'));var router=express[_0x6553('0x2')]();var fs_extra=require(_0x6553('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x6553('0x4'));var config=require(_0x6553('0x5'));var controller=require(_0x6553('0x6'));router['get'](_0x6553('0x7'),auth[_0x6553('0x8')](),controller[_0x6553('0x9')]);router['put']('/:id',auth[_0x6553('0x8')](),controller[_0x6553('0xa')]);router['delete'](_0x6553('0x7'),auth[_0x6553('0x8')](),controller[_0x6553('0xb')]);module[_0x6553('0xc')]=router;
\ No newline at end of file
+var _0x45aa=['delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','show','put','isAuthenticated','update'];(function(_0x240a63,_0x3403f3){var _0x528aa3=function(_0x4b8b79){while(--_0x4b8b79){_0x240a63['push'](_0x240a63['shift']());}};_0x528aa3(++_0x3403f3);}(_0x45aa,0x1b8));var _0xa45a=function(_0x593567,_0x537f33){_0x593567=_0x593567-0x0;var _0x2e1562=_0x45aa[_0x593567];return _0x2e1562;};'use strict';var multer=require(_0xa45a('0x0'));var util=require(_0xa45a('0x1'));var path=require(_0xa45a('0x2'));var timeout=require(_0xa45a('0x3'));var express=require('express');var router=express[_0xa45a('0x4')]();var fs_extra=require(_0xa45a('0x5'));var auth=require(_0xa45a('0x6'));var interaction=require(_0xa45a('0x7'));var config=require(_0xa45a('0x8'));var controller=require(_0xa45a('0x9'));router[_0xa45a('0xa')](_0xa45a('0xb'),auth['isAuthenticated'](),controller[_0xa45a('0xc')]);router[_0xa45a('0xd')]('/:id',auth[_0xa45a('0xe')](),controller[_0xa45a('0xf')]);router[_0xa45a('0x10')](_0xa45a('0xb'),auth[_0xa45a('0xe')](),controller[_0xa45a('0x11')]);module[_0xa45a('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 227b18d..b91720a 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 _0xfa45=['exports','STRING','BOOLEAN','sequelize'];(function(_0x4232ec,_0x58bb90){var _0x36373b=function(_0x5e7195){while(--_0x5e7195){_0x4232ec['push'](_0x4232ec['shift']());}};_0x36373b(++_0x58bb90);}(_0xfa45,0x11b));var _0x5fa4=function(_0x1b4309,_0x4870e9){_0x1b4309=_0x1b4309-0x0;var _0x53e3fc=_0xfa45[_0x1b4309];return _0x53e3fc;};'use strict';var Sequelize=require(_0x5fa4('0x0'));module[_0x5fa4('0x1')]={'name':{'type':Sequelize[_0x5fa4('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5fa4('0x2')]},'write':{'type':Sequelize[_0x5fa4('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x9541=['exports','STRING','BOOLEAN','sequelize'];(function(_0x3b39b8,_0x1e19b7){var _0x936eb=function(_0x51c343){while(--_0x51c343){_0x3b39b8['push'](_0x3b39b8['shift']());}};_0x936eb(++_0x1e19b7);}(_0x9541,0xb3));var _0x1954=function(_0x1b060d,_0x218177){_0x1b060d=_0x1b060d-0x0;var _0xf36c56=_0x9541[_0x1b060d];return _0xf36c56;};'use strict';var Sequelize=require(_0x1954('0x0'));module[_0x1954('0x1')]={'name':{'type':Sequelize[_0x1954('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1954('0x2')]},'write':{'type':Sequelize[_0x1954('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 065707d..794c73d 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 _0xc01d=['../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','redis','./chatGroup.socket','register','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatGroup','includeAll','include','show','find','catch','create','body','params','describe','getUnread','ChatInternalMessage','user','addMembers','ids','getMembers','findOne','removeMembers','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0xc01d,0x1db));var _0xdc01=function(_0x4a9386,_0x3d95bf){_0x4a9386=_0x4a9386-0x0;var _0x10b348=_0xc01d[_0x4a9386];return _0x10b348;};'use strict';var emlformat=require(_0xdc01('0x0'));var rimraf=require(_0xdc01('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdc01('0x2'));var rp=require(_0xdc01('0x3'));var moment=require(_0xdc01('0x4'));var BPromise=require(_0xdc01('0x5'));var Mustache=require(_0xdc01('0x6'));var util=require(_0xdc01('0x7'));var path=require(_0xdc01('0x8'));var sox=require(_0xdc01('0x9'));var csv=require(_0xdc01('0xa'));var ejs=require(_0xdc01('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdc01('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdc01('0xd'));var deskjs=require(_0xdc01('0xe'));var toCsv=require(_0xdc01('0xa'));var querystring=require(_0xdc01('0xf'));var Papa=require(_0xdc01('0x10'));var Redis=require(_0xdc01('0x11'));var authService=require(_0xdc01('0x12'));var qs=require(_0xdc01('0x13'));var as=require(_0xdc01('0x14'));var hardwareService=require(_0xdc01('0x15'));var logger=require(_0xdc01('0x16'))(_0xdc01('0x17'));var utils=require(_0xdc01('0x18'));var config=require(_0xdc01('0x19'));var licenseUtil=require(_0xdc01('0x1a'));var db=require(_0xdc01('0x1b'))['db'];config['redis']=_[_0xdc01('0x1c')](config['redis'],{'host':_0xdc01('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdc01('0x1e')]));require(_0xdc01('0x1f'))[_0xdc01('0x20')](socket);function respondWithStatusCode(_0x489417,_0xa0f766){_0xa0f766=_0xa0f766||0xcc;return function(_0x252c04){if(_0x252c04){return _0x489417['sendStatus'](_0xa0f766);}return _0x489417['status'](_0xa0f766)[_0xdc01('0x21')]();};}function respondWithResult(_0x13e3cc,_0x11104e){_0x11104e=_0x11104e||0xc8;return function(_0x20ac77){if(_0x20ac77){return _0x13e3cc['status'](_0x11104e)[_0xdc01('0x22')](_0x20ac77);}};}function respondWithFilteredResult(_0x3c219c,_0x4d290e){return function(_0x353391){if(_0x353391){var _0x2c9580=typeof _0x4d290e[_0xdc01('0x23')]===_0xdc01('0x24')&&typeof _0x4d290e[_0xdc01('0x25')]==='undefined';var _0x5f04fd=_0x353391[_0xdc01('0x26')];var _0x3db98c=_0x2c9580?0x0:_0x4d290e[_0xdc01('0x23')];var _0x87f0fa=_0x2c9580?_0x353391['count']:_0x4d290e[_0xdc01('0x23')]+_0x4d290e[_0xdc01('0x25')];var _0x30e1cf;if(_0x87f0fa>=_0x5f04fd){_0x87f0fa=_0x5f04fd;_0x30e1cf=0xc8;}else{_0x30e1cf=0xce;}_0x3c219c[_0xdc01('0x27')](_0x30e1cf);return _0x3c219c[_0xdc01('0x28')](_0xdc01('0x29'),_0x3db98c+'-'+_0x87f0fa+'/'+_0x5f04fd)[_0xdc01('0x22')](_0x353391);}return null;};}function patchUpdates(_0x58883c){return function(_0x13da54){try{jsonpatch[_0xdc01('0x2a')](_0x13da54,_0x58883c,!![]);}catch(_0x1b17ae){return BPromise[_0xdc01('0x2b')](_0x1b17ae);}return _0x13da54[_0xdc01('0x2c')]();};}function saveUpdates(_0x8a8801,_0x20ccf8){return function(_0x105ca1){if(_0x105ca1){return _0x105ca1[_0xdc01('0x2d')](_0x8a8801)[_0xdc01('0x2e')](function(_0x27b196){return _0x27b196;});}return null;};}function removeEntity(_0xeb32cb,_0x8b0815){return function(_0x2b42e0){if(_0x2b42e0){return _0x2b42e0[_0xdc01('0x2f')]()[_0xdc01('0x2e')](function(){_0xeb32cb[_0xdc01('0x27')](0xcc)[_0xdc01('0x21')]();});}};}function handleEntityNotFound(_0x205a4c,_0x597949){return function(_0x1f5b1f){if(!_0x1f5b1f){_0x205a4c[_0xdc01('0x30')](0x194);}return _0x1f5b1f;};}function handleError(_0x508432,_0x7b9f4f){_0x7b9f4f=_0x7b9f4f||0x1f4;return function(_0x3daf26){logger[_0xdc01('0x31')](_0x3daf26[_0xdc01('0x32')]);if(_0x3daf26[_0xdc01('0x33')]){delete _0x3daf26[_0xdc01('0x33')];}_0x508432[_0xdc01('0x27')](_0x7b9f4f)[_0xdc01('0x34')](_0x3daf26);};}exports[_0xdc01('0x35')]=function(_0x1ecd52,_0x6aefd5){var _0x478660={},_0x4088f8={},_0x309881={'count':0x0,'rows':[]};var _0x211ccd=_['map'](db['ChatGroup'][_0xdc01('0x36')],function(_0x15e16c){return{'name':_0x15e16c[_0xdc01('0x37')],'type':_0x15e16c[_0xdc01('0x38')][_0xdc01('0x39')]};});_0x4088f8[_0xdc01('0x3a')]=_[_0xdc01('0x3b')](_0x211ccd,_0xdc01('0x33'));_0x4088f8[_0xdc01('0x3c')]=_[_0xdc01('0x3d')](_0x1ecd52['query']);_0x4088f8[_0xdc01('0x3e')]=_['intersection'](_0x4088f8[_0xdc01('0x3a')],_0x4088f8[_0xdc01('0x3c')]);_0x478660[_0xdc01('0x3f')]=_[_0xdc01('0x40')](_0x4088f8[_0xdc01('0x3a')],qs[_0xdc01('0x41')](_0x1ecd52[_0xdc01('0x3c')][_0xdc01('0x41')]));_0x478660[_0xdc01('0x3f')]=_0x478660['attributes'][_0xdc01('0x42')]?_0x478660['attributes']:_0x4088f8[_0xdc01('0x3a')];if(!_0x1ecd52['query'][_0xdc01('0x43')](_0xdc01('0x44'))){_0x478660[_0xdc01('0x25')]=qs[_0xdc01('0x25')](_0x1ecd52[_0xdc01('0x3c')]['limit']);_0x478660['offset']=qs[_0xdc01('0x23')](_0x1ecd52[_0xdc01('0x3c')][_0xdc01('0x23')]);}_0x478660[_0xdc01('0x45')]=qs[_0xdc01('0x46')](_0x1ecd52[_0xdc01('0x3c')]['sort']);_0x478660[_0xdc01('0x47')]=qs[_0xdc01('0x3e')](_[_0xdc01('0x48')](_0x1ecd52[_0xdc01('0x3c')],_0x4088f8[_0xdc01('0x3e')]),_0x211ccd);if(_0x1ecd52['query'][_0xdc01('0x49')]){_0x478660['where']=_[_0xdc01('0x4a')](_0x478660[_0xdc01('0x47')],{'$or':_[_0xdc01('0x3b')](_0x211ccd,function(_0x4e2ed1){if(_0x4e2ed1[_0xdc01('0x38')]!==_0xdc01('0x4b')){var _0x2661aa={};_0x2661aa[_0x4e2ed1[_0xdc01('0x33')]]={'$like':'%'+_0x1ecd52[_0xdc01('0x3c')]['filter']+'%'};return _0x2661aa;}})});}_0x478660=_[_0xdc01('0x4a')]({},_0x478660,_0x1ecd52[_0xdc01('0x4c')]);var _0x5bbd7d={'where':_0x478660[_0xdc01('0x47')]};return db[_0xdc01('0x4d')][_0xdc01('0x26')](_0x5bbd7d)[_0xdc01('0x2e')](function(_0x186bd9){_0x309881[_0xdc01('0x26')]=_0x186bd9;if(_0x1ecd52[_0xdc01('0x3c')][_0xdc01('0x4e')]){_0x478660[_0xdc01('0x4f')]=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x478660);})[_0xdc01('0x2e')](function(_0x36b557){_0x309881['rows']=_0x36b557;return _0x309881;})[_0xdc01('0x2e')](respondWithFilteredResult(_0x6aefd5,_0x478660))['catch'](handleError(_0x6aefd5,null));};exports[_0xdc01('0x50')]=function(_0x4847ea,_0x583846){var _0x313a38={'raw':!![],'where':{'id':_0x4847ea['params']['id']}},_0x636132={};_0x636132[_0xdc01('0x3a')]=_['keys'](db[_0xdc01('0x4d')][_0xdc01('0x36')]);_0x636132[_0xdc01('0x3c')]=_[_0xdc01('0x3d')](_0x4847ea[_0xdc01('0x3c')]);_0x636132[_0xdc01('0x3e')]=_['intersection'](_0x636132['model'],_0x636132['query']);_0x313a38[_0xdc01('0x3f')]=_[_0xdc01('0x40')](_0x636132[_0xdc01('0x3a')],qs[_0xdc01('0x41')](_0x4847ea[_0xdc01('0x3c')][_0xdc01('0x41')]));_0x313a38['attributes']=_0x313a38[_0xdc01('0x3f')][_0xdc01('0x42')]?_0x313a38[_0xdc01('0x3f')]:_0x636132['model'];if(_0x4847ea[_0xdc01('0x3c')]['includeAll']){_0x313a38['include']=[{'all':!![]}];}_0x313a38=_[_0xdc01('0x4a')]({},_0x313a38,_0x4847ea[_0xdc01('0x4c')]);return db['ChatGroup'][_0xdc01('0x51')](_0x313a38)['then'](handleEntityNotFound(_0x583846,null))[_0xdc01('0x2e')](respondWithResult(_0x583846,null))[_0xdc01('0x52')](handleError(_0x583846,null));};exports[_0xdc01('0x53')]=function(_0x459dd1,_0x557796){return db[_0xdc01('0x4d')]['create'](_0x459dd1['body'],{})['then'](respondWithResult(_0x557796,0xc9))[_0xdc01('0x52')](handleError(_0x557796,null));};exports['update']=function(_0x4ac0cc,_0x5e332b){if(_0x4ac0cc[_0xdc01('0x54')]['id']){delete _0x4ac0cc[_0xdc01('0x54')]['id'];}return db['ChatGroup'][_0xdc01('0x51')]({'where':{'id':_0x4ac0cc[_0xdc01('0x55')]['id']}})[_0xdc01('0x2e')](handleEntityNotFound(_0x5e332b,null))[_0xdc01('0x2e')](saveUpdates(_0x4ac0cc[_0xdc01('0x54')],null))['then'](respondWithResult(_0x5e332b,null))[_0xdc01('0x52')](handleError(_0x5e332b,null));};exports[_0xdc01('0x2f')]=function(_0x3555e3,_0x6c8be4){return db[_0xdc01('0x4d')][_0xdc01('0x51')]({'where':{'id':_0x3555e3['params']['id']}})[_0xdc01('0x2e')](handleEntityNotFound(_0x6c8be4,null))['then'](removeEntity(_0x6c8be4,null))['catch'](handleError(_0x6c8be4,null));};exports[_0xdc01('0x56')]=function(_0x2acd2,_0x294ba3){return db['ChatGroup']['describe']()[_0xdc01('0x2e')](respondWithResult(_0x294ba3,null))['catch'](handleError(_0x294ba3,null));};exports[_0xdc01('0x57')]=function(_0x8e61de,_0x55108d,_0x4d9d26){return db[_0xdc01('0x58')]['count']({'where':{'ChatGroupId':_0x8e61de['params']['id'],'ToId':_0x8e61de[_0xdc01('0x59')]['id'],'read':![]}})[_0xdc01('0x2e')](function(_0x331103){return{'id':_['toInteger'](_0x8e61de[_0xdc01('0x55')]['id']),'count':_0x331103};})[_0xdc01('0x2e')](respondWithResult(_0x55108d,null))['catch'](handleError(_0x55108d,null));};exports[_0xdc01('0x5a')]=function(_0x5c87df,_0x3e1bf4,_0x388e76){return db['ChatGroup'][_0xdc01('0x51')]({'where':{'id':_0x5c87df[_0xdc01('0x55')]['id']}})[_0xdc01('0x2e')](handleEntityNotFound(_0x3e1bf4,null))[_0xdc01('0x2e')](function(_0x4fc1f7){if(_0x4fc1f7){return _0x4fc1f7['addMembers'](_0x5c87df[_0xdc01('0x54')]['ids'],_['omit'](_0x5c87df['body'],[_0xdc01('0x5b'),'id'])||{});}})[_0xdc01('0x2e')](respondWithResult(_0x3e1bf4,null))[_0xdc01('0x52')](handleError(_0x3e1bf4,null));};exports[_0xdc01('0x5c')]=function(_0x590f23,_0x4b16ca,_0x5a61a1){var _0x57545d={};var _0x10ebd3={};var _0x546730;var _0x4047ed;return db[_0xdc01('0x4d')][_0xdc01('0x5d')]({'where':{'id':_0x590f23[_0xdc01('0x55')]['id']}})[_0xdc01('0x2e')](handleEntityNotFound(_0x4b16ca,null))[_0xdc01('0x2e')](function(_0x43daa5){if(_0x43daa5){_0x546730=_0x43daa5;_0x10ebd3[_0xdc01('0x3a')]=_['keys'](db['User'][_0xdc01('0x36')]);_0x10ebd3['query']=_[_0xdc01('0x3d')](_0x590f23[_0xdc01('0x3c')]);_0x10ebd3[_0xdc01('0x3e')]=_[_0xdc01('0x40')](_0x10ebd3['model'],_0x10ebd3[_0xdc01('0x3c')]);_0x57545d[_0xdc01('0x3f')]=_['intersection'](_0x10ebd3[_0xdc01('0x3a')],qs[_0xdc01('0x41')](_0x590f23[_0xdc01('0x3c')][_0xdc01('0x41')]));_0x57545d[_0xdc01('0x3f')]=_0x57545d[_0xdc01('0x3f')][_0xdc01('0x42')]?_0x57545d[_0xdc01('0x3f')]:_0x10ebd3[_0xdc01('0x3a')];_0x57545d['order']=qs[_0xdc01('0x46')](_0x590f23[_0xdc01('0x3c')][_0xdc01('0x46')]);_0x57545d[_0xdc01('0x47')]=qs[_0xdc01('0x3e')](_[_0xdc01('0x48')](_0x590f23[_0xdc01('0x3c')],_0x10ebd3[_0xdc01('0x3e')]));if(_0x590f23['query'][_0xdc01('0x49')]){_0x57545d[_0xdc01('0x47')]=_[_0xdc01('0x4a')](_0x57545d[_0xdc01('0x47')],{'$or':_[_0xdc01('0x3b')](_0x57545d['attributes'],function(_0x905c1){var _0xe7aefa={};_0xe7aefa[_0x905c1]={'$like':'%'+_0x590f23[_0xdc01('0x3c')][_0xdc01('0x49')]+'%'};return _0xe7aefa;})});}_0x57545d=_['merge']({},_0x57545d,_0x590f23[_0xdc01('0x4c')]);return _0x546730['getMembers'](_0x57545d);}})[_0xdc01('0x2e')](function(_0x5efb23){if(_0x5efb23){_0x4047ed=_0x5efb23['length'];if(!_0x590f23[_0xdc01('0x3c')][_0xdc01('0x43')](_0xdc01('0x44'))){_0x57545d[_0xdc01('0x25')]=qs[_0xdc01('0x25')](_0x590f23['query']['limit']);_0x57545d[_0xdc01('0x23')]=qs['offset'](_0x590f23['query']['offset']);}return _0x546730[_0xdc01('0x5c')](_0x57545d);}})[_0xdc01('0x2e')](function(_0x5c988e){if(_0x5c988e){return _0x5c988e?{'count':_0x4047ed,'rows':_0x5c988e}:null;}})[_0xdc01('0x2e')](respondWithResult(_0x4b16ca,null))[_0xdc01('0x52')](handleError(_0x4b16ca,null));};exports[_0xdc01('0x5e')]=function(_0x55668b,_0x9d89e,_0x78a689){return db[_0xdc01('0x4d')][_0xdc01('0x51')]({'where':{'id':_0x55668b[_0xdc01('0x55')]['id']}})[_0xdc01('0x2e')](handleEntityNotFound(_0x9d89e,null))[_0xdc01('0x2e')](function(_0x485927){if(_0x485927){return _0x485927[_0xdc01('0x5e')](_0x55668b[_0xdc01('0x3c')][_0xdc01('0x5b')]);}})[_0xdc01('0x2e')](respondWithStatusCode(_0x9d89e,null))[_0xdc01('0x52')](handleError(_0x9d89e,null));};exports['addMessage']=function(_0x29d846,_0x168ba4,_0x238251){if(_0x29d846['body']['id']){delete _0x29d846[_0xdc01('0x54')]['id'];}return db[_0xdc01('0x4d')][_0xdc01('0x51')]({'where':{'id':_0x29d846[_0xdc01('0x55')]['id']}})['then'](handleEntityNotFound(_0x168ba4,null))[_0xdc01('0x2e')](function(_0x552a47){if(_0x552a47){_0x29d846['body']['ChatGroupId']=_0x552a47['id'];return db[_0xdc01('0x58')][_0xdc01('0x53')](_0x29d846['body']);}})[_0xdc01('0x2e')](respondWithResult(_0x168ba4,null))[_0xdc01('0x52')](handleError(_0x168ba4,null));};exports[_0xdc01('0x5f')]=function(_0x15d903,_0x319526,_0x542621){var _0xfa59b9={};var _0x17a3c0={};var _0x3a44ba;var _0x3b7e83;return db[_0xdc01('0x4d')][_0xdc01('0x5d')]({'where':{'id':_0x15d903[_0xdc01('0x55')]['id']}})['then'](handleEntityNotFound(_0x319526,null))[_0xdc01('0x2e')](function(_0x55a272){if(_0x55a272){_0x3a44ba=_0x55a272;_0x17a3c0[_0xdc01('0x3a')]=_[_0xdc01('0x3d')](db['ChatInternalMessage']['rawAttributes']);_0x17a3c0[_0xdc01('0x3c')]=_['keys'](_0x15d903[_0xdc01('0x3c')]);_0x17a3c0[_0xdc01('0x3e')]=_[_0xdc01('0x40')](_0x17a3c0[_0xdc01('0x3a')],_0x17a3c0[_0xdc01('0x3c')]);_0xfa59b9[_0xdc01('0x3f')]=_[_0xdc01('0x40')](_0x17a3c0[_0xdc01('0x3a')],qs[_0xdc01('0x41')](_0x15d903[_0xdc01('0x3c')][_0xdc01('0x41')]));_0xfa59b9[_0xdc01('0x3f')]=_0xfa59b9[_0xdc01('0x3f')][_0xdc01('0x42')]?_0xfa59b9['attributes']:_0x17a3c0['model'];_0xfa59b9['order']=qs[_0xdc01('0x46')](_0x15d903[_0xdc01('0x3c')][_0xdc01('0x46')]);_0xfa59b9['where']=qs[_0xdc01('0x3e')](_['pick'](_0x15d903['query'],_0x17a3c0[_0xdc01('0x3e')]));if(_0x15d903[_0xdc01('0x3c')][_0xdc01('0x49')]){_0xfa59b9[_0xdc01('0x47')]=_[_0xdc01('0x4a')](_0xfa59b9[_0xdc01('0x47')],{'$or':_['map'](_0xfa59b9[_0xdc01('0x3f')],function(_0x57f830){var _0x1624fa={};_0x1624fa[_0x57f830]={'$like':'%'+_0x15d903[_0xdc01('0x3c')][_0xdc01('0x49')]+'%'};return _0x1624fa;})});}if(_0x15d903['query'][_0xdc01('0x60')]){var _0x5caf48=_0x15d903[_0xdc01('0x3c')][_0xdc01('0x60')][_0xdc01('0x61')](',');var _0x5ce1f7={};_0x5ce1f7[_0x5caf48[0x0]]={'$gte':moment(_0x5caf48[0x1])[_0xdc01('0x62')](_0xdc01('0x63'))};_0xfa59b9[_0xdc01('0x47')]=_['merge'](_0xfa59b9[_0xdc01('0x47')],_0x5ce1f7);}_0xfa59b9=_[_0xdc01('0x4a')]({},_0xfa59b9,_0x15d903['options']);return _0x3a44ba[_0xdc01('0x5f')](_0xfa59b9);}})[_0xdc01('0x2e')](function(_0x20a7c6){if(_0x20a7c6){_0x3b7e83=_0x20a7c6[_0xdc01('0x42')];if(!_0x15d903[_0xdc01('0x3c')][_0xdc01('0x43')](_0xdc01('0x44'))){_0xfa59b9['limit']=qs[_0xdc01('0x25')](_0x15d903[_0xdc01('0x3c')][_0xdc01('0x25')]);_0xfa59b9[_0xdc01('0x23')]=qs[_0xdc01('0x23')](_0x15d903[_0xdc01('0x3c')]['offset']);}return _0x3a44ba[_0xdc01('0x5f')](_0xfa59b9);}})[_0xdc01('0x2e')](function(_0x57f810){if(_0x57f810){return _0x57f810?{'count':_0x3b7e83,'rows':_0x57f810}:null;}})[_0xdc01('0x2e')](respondWithResult(_0x319526,null))['catch'](handleError(_0x319526,null));};
\ No newline at end of file
+var _0x0b4e=['VIRTUAL','filter','options','includeAll','findAll','catch','show','params','length','include','body','find','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','rawAttributes','nolimit','removeMembers','addMessage','ChatGroupId','create','getMessages','$gte','split','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','update','then','destroy','error','stack','name','send','map','ChatGroup','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','merge'];(function(_0x42fced,_0x55d428){var _0x12c61e=function(_0x29d41b){while(--_0x29d41b){_0x42fced['push'](_0x42fced['shift']());}};_0x12c61e(++_0x55d428);}(_0x0b4e,0x7f));var _0xe0b4=function(_0xe327b1,_0x333197){_0xe327b1=_0xe327b1-0x0;var _0x364891=_0x0b4e[_0xe327b1];return _0x364891;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe0b4('0x0'));var zipdir=require(_0xe0b4('0x1'));var jsonpatch=require(_0xe0b4('0x2'));var rp=require(_0xe0b4('0x3'));var moment=require(_0xe0b4('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xe0b4('0x5'));var sox=require(_0xe0b4('0x6'));var csv=require('to-csv');var ejs=require(_0xe0b4('0x7'));var fs=require('fs');var fs_extra=require(_0xe0b4('0x8'));var _=require(_0xe0b4('0x9'));var squel=require(_0xe0b4('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe0b4('0xb'));var toCsv=require(_0xe0b4('0xc'));var querystring=require('querystring');var Papa=require(_0xe0b4('0xd'));var Redis=require(_0xe0b4('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe0b4('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe0b4('0x10'));var logger=require('../../config/logger')(_0xe0b4('0x11'));var utils=require(_0xe0b4('0x12'));var config=require(_0xe0b4('0x13'));var licenseUtil=require(_0xe0b4('0x14'));var db=require(_0xe0b4('0x15'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xe0b4('0x16'),'port':0x18eb});var socket=require(_0xe0b4('0x17'))(new Redis(config[_0xe0b4('0x18')]));require(_0xe0b4('0x19'))[_0xe0b4('0x1a')](socket);function respondWithStatusCode(_0x4dffdc,_0x495562){_0x495562=_0x495562||0xcc;return function(_0x4bce2e){if(_0x4bce2e){return _0x4dffdc[_0xe0b4('0x1b')](_0x495562);}return _0x4dffdc[_0xe0b4('0x1c')](_0x495562)[_0xe0b4('0x1d')]();};}function respondWithResult(_0xbcdd80,_0x5cb099){_0x5cb099=_0x5cb099||0xc8;return function(_0x52ebaa){if(_0x52ebaa){return _0xbcdd80['status'](_0x5cb099)[_0xe0b4('0x1e')](_0x52ebaa);}};}function respondWithFilteredResult(_0x432fc8,_0x5d9bf0){return function(_0x54a73a){if(_0x54a73a){var _0x173522=typeof _0x5d9bf0[_0xe0b4('0x1f')]===_0xe0b4('0x20')&&typeof _0x5d9bf0['limit']==='undefined';var _0x1b1e3c=_0x54a73a[_0xe0b4('0x21')];var _0x220069=_0x173522?0x0:_0x5d9bf0[_0xe0b4('0x1f')];var _0x1a7e93=_0x173522?_0x54a73a[_0xe0b4('0x21')]:_0x5d9bf0[_0xe0b4('0x1f')]+_0x5d9bf0[_0xe0b4('0x22')];var _0x3fad9e;if(_0x1a7e93>=_0x1b1e3c){_0x1a7e93=_0x1b1e3c;_0x3fad9e=0xc8;}else{_0x3fad9e=0xce;}_0x432fc8[_0xe0b4('0x1c')](_0x3fad9e);return _0x432fc8[_0xe0b4('0x23')]('Content-Range',_0x220069+'-'+_0x1a7e93+'/'+_0x1b1e3c)['json'](_0x54a73a);}return null;};}function patchUpdates(_0x532479){return function(_0x65c20d){try{jsonpatch[_0xe0b4('0x24')](_0x65c20d,_0x532479,!![]);}catch(_0x4276d6){return BPromise[_0xe0b4('0x25')](_0x4276d6);}return _0x65c20d['save']();};}function saveUpdates(_0x1d4adb,_0x2a52c7){return function(_0x5c2332){if(_0x5c2332){return _0x5c2332[_0xe0b4('0x26')](_0x1d4adb)[_0xe0b4('0x27')](function(_0x533106){return _0x533106;});}return null;};}function removeEntity(_0x2d33e0,_0x3a06f6){return function(_0x27a6e1){if(_0x27a6e1){return _0x27a6e1[_0xe0b4('0x28')]()[_0xe0b4('0x27')](function(){_0x2d33e0['status'](0xcc)[_0xe0b4('0x1d')]();});}};}function handleEntityNotFound(_0xf459c,_0x33b99f){return function(_0xa1d4bd){if(!_0xa1d4bd){_0xf459c[_0xe0b4('0x1b')](0x194);}return _0xa1d4bd;};}function handleError(_0x12bb5f,_0x4bb78e){_0x4bb78e=_0x4bb78e||0x1f4;return function(_0x415932){logger[_0xe0b4('0x29')](_0x415932[_0xe0b4('0x2a')]);if(_0x415932[_0xe0b4('0x2b')]){delete _0x415932['name'];}_0x12bb5f[_0xe0b4('0x1c')](_0x4bb78e)[_0xe0b4('0x2c')](_0x415932);};}exports['index']=function(_0x4ae48e,_0x3a8c64){var _0x116622={},_0x2e5796={},_0x29c353={'count':0x0,'rows':[]};var _0x416950=_[_0xe0b4('0x2d')](db[_0xe0b4('0x2e')]['rawAttributes'],function(_0x301cc7){return{'name':_0x301cc7[_0xe0b4('0x2f')],'type':_0x301cc7[_0xe0b4('0x30')][_0xe0b4('0x31')]};});_0x2e5796[_0xe0b4('0x32')]=_['map'](_0x416950,'name');_0x2e5796[_0xe0b4('0x33')]=_[_0xe0b4('0x34')](_0x4ae48e['query']);_0x2e5796['filters']=_[_0xe0b4('0x35')](_0x2e5796[_0xe0b4('0x32')],_0x2e5796[_0xe0b4('0x33')]);_0x116622[_0xe0b4('0x36')]=_[_0xe0b4('0x35')](_0x2e5796['model'],qs['fields'](_0x4ae48e[_0xe0b4('0x33')][_0xe0b4('0x37')]));_0x116622[_0xe0b4('0x36')]=_0x116622[_0xe0b4('0x36')]['length']?_0x116622['attributes']:_0x2e5796[_0xe0b4('0x32')];if(!_0x4ae48e[_0xe0b4('0x33')][_0xe0b4('0x38')]('nolimit')){_0x116622['limit']=qs[_0xe0b4('0x22')](_0x4ae48e['query'][_0xe0b4('0x22')]);_0x116622['offset']=qs[_0xe0b4('0x1f')](_0x4ae48e['query'][_0xe0b4('0x1f')]);}_0x116622[_0xe0b4('0x39')]=qs[_0xe0b4('0x3a')](_0x4ae48e[_0xe0b4('0x33')]['sort']);_0x116622[_0xe0b4('0x3b')]=qs[_0xe0b4('0x3c')](_[_0xe0b4('0x3d')](_0x4ae48e[_0xe0b4('0x33')],_0x2e5796[_0xe0b4('0x3c')]),_0x416950);if(_0x4ae48e['query']['filter']){_0x116622[_0xe0b4('0x3b')]=_[_0xe0b4('0x3e')](_0x116622[_0xe0b4('0x3b')],{'$or':_[_0xe0b4('0x2d')](_0x416950,function(_0x14ca18){if(_0x14ca18[_0xe0b4('0x30')]!==_0xe0b4('0x3f')){var _0x24deb1={};_0x24deb1[_0x14ca18[_0xe0b4('0x2b')]]={'$like':'%'+_0x4ae48e[_0xe0b4('0x33')][_0xe0b4('0x40')]+'%'};return _0x24deb1;}})});}_0x116622=_[_0xe0b4('0x3e')]({},_0x116622,_0x4ae48e[_0xe0b4('0x41')]);var _0xf3e698={'where':_0x116622['where']};return db['ChatGroup'][_0xe0b4('0x21')](_0xf3e698)['then'](function(_0x399b6f){_0x29c353[_0xe0b4('0x21')]=_0x399b6f;if(_0x4ae48e[_0xe0b4('0x33')][_0xe0b4('0x42')]){_0x116622['include']=[{'all':!![]}];}return db[_0xe0b4('0x2e')][_0xe0b4('0x43')](_0x116622);})[_0xe0b4('0x27')](function(_0x29e899){_0x29c353['rows']=_0x29e899;return _0x29c353;})[_0xe0b4('0x27')](respondWithFilteredResult(_0x3a8c64,_0x116622))[_0xe0b4('0x44')](handleError(_0x3a8c64,null));};exports[_0xe0b4('0x45')]=function(_0x47d508,_0x5cf259){var _0x61082e={'raw':!![],'where':{'id':_0x47d508[_0xe0b4('0x46')]['id']}},_0x18aa76={};_0x18aa76[_0xe0b4('0x32')]=_[_0xe0b4('0x34')](db[_0xe0b4('0x2e')]['rawAttributes']);_0x18aa76[_0xe0b4('0x33')]=_['keys'](_0x47d508[_0xe0b4('0x33')]);_0x18aa76[_0xe0b4('0x3c')]=_[_0xe0b4('0x35')](_0x18aa76[_0xe0b4('0x32')],_0x18aa76[_0xe0b4('0x33')]);_0x61082e[_0xe0b4('0x36')]=_[_0xe0b4('0x35')](_0x18aa76[_0xe0b4('0x32')],qs[_0xe0b4('0x37')](_0x47d508['query']['fields']));_0x61082e[_0xe0b4('0x36')]=_0x61082e['attributes'][_0xe0b4('0x47')]?_0x61082e[_0xe0b4('0x36')]:_0x18aa76[_0xe0b4('0x32')];if(_0x47d508[_0xe0b4('0x33')][_0xe0b4('0x42')]){_0x61082e[_0xe0b4('0x48')]=[{'all':!![]}];}_0x61082e=_[_0xe0b4('0x3e')]({},_0x61082e,_0x47d508[_0xe0b4('0x41')]);return db['ChatGroup']['find'](_0x61082e)['then'](handleEntityNotFound(_0x5cf259,null))[_0xe0b4('0x27')](respondWithResult(_0x5cf259,null))['catch'](handleError(_0x5cf259,null));};exports['create']=function(_0xe6e600,_0x23778a){return db[_0xe0b4('0x2e')]['create'](_0xe6e600[_0xe0b4('0x49')],{})['then'](respondWithResult(_0x23778a,0xc9))[_0xe0b4('0x44')](handleError(_0x23778a,null));};exports[_0xe0b4('0x26')]=function(_0x348271,_0x1aa0bf){if(_0x348271['body']['id']){delete _0x348271[_0xe0b4('0x49')]['id'];}return db[_0xe0b4('0x2e')][_0xe0b4('0x4a')]({'where':{'id':_0x348271['params']['id']}})[_0xe0b4('0x27')](handleEntityNotFound(_0x1aa0bf,null))[_0xe0b4('0x27')](saveUpdates(_0x348271[_0xe0b4('0x49')],null))[_0xe0b4('0x27')](respondWithResult(_0x1aa0bf,null))['catch'](handleError(_0x1aa0bf,null));};exports[_0xe0b4('0x28')]=function(_0x34f3a5,_0x540ac7){return db[_0xe0b4('0x2e')]['find']({'where':{'id':_0x34f3a5[_0xe0b4('0x46')]['id']}})['then'](handleEntityNotFound(_0x540ac7,null))[_0xe0b4('0x27')](removeEntity(_0x540ac7,null))['catch'](handleError(_0x540ac7,null));};exports[_0xe0b4('0x4b')]=function(_0x11b03d,_0x2f831b){return db[_0xe0b4('0x2e')][_0xe0b4('0x4b')]()[_0xe0b4('0x27')](respondWithResult(_0x2f831b,null))['catch'](handleError(_0x2f831b,null));};exports[_0xe0b4('0x4c')]=function(_0x1771fe,_0x194136,_0x53bf30){return db[_0xe0b4('0x4d')][_0xe0b4('0x21')]({'where':{'ChatGroupId':_0x1771fe[_0xe0b4('0x46')]['id'],'ToId':_0x1771fe[_0xe0b4('0x4e')]['id'],'read':![]}})[_0xe0b4('0x27')](function(_0x3b7337){return{'id':_[_0xe0b4('0x4f')](_0x1771fe[_0xe0b4('0x46')]['id']),'count':_0x3b7337};})[_0xe0b4('0x27')](respondWithResult(_0x194136,null))[_0xe0b4('0x44')](handleError(_0x194136,null));};exports[_0xe0b4('0x50')]=function(_0x84a5e1,_0x576415,_0x562ac3){return db[_0xe0b4('0x2e')][_0xe0b4('0x4a')]({'where':{'id':_0x84a5e1[_0xe0b4('0x46')]['id']}})[_0xe0b4('0x27')](handleEntityNotFound(_0x576415,null))[_0xe0b4('0x27')](function(_0x3e53f4){if(_0x3e53f4){return _0x3e53f4['addMembers'](_0x84a5e1['body'][_0xe0b4('0x51')],_[_0xe0b4('0x52')](_0x84a5e1[_0xe0b4('0x49')],[_0xe0b4('0x51'),'id'])||{});}})[_0xe0b4('0x27')](respondWithResult(_0x576415,null))[_0xe0b4('0x44')](handleError(_0x576415,null));};exports[_0xe0b4('0x53')]=function(_0x556f72,_0x38dc59,_0x201988){var _0x58feea={};var _0x54a853={};var _0xdd8172;var _0x18fa0e;return db[_0xe0b4('0x2e')][_0xe0b4('0x54')]({'where':{'id':_0x556f72[_0xe0b4('0x46')]['id']}})[_0xe0b4('0x27')](handleEntityNotFound(_0x38dc59,null))[_0xe0b4('0x27')](function(_0x52f26b){if(_0x52f26b){_0xdd8172=_0x52f26b;_0x54a853[_0xe0b4('0x32')]=_[_0xe0b4('0x34')](db[_0xe0b4('0x55')][_0xe0b4('0x56')]);_0x54a853[_0xe0b4('0x33')]=_[_0xe0b4('0x34')](_0x556f72[_0xe0b4('0x33')]);_0x54a853[_0xe0b4('0x3c')]=_[_0xe0b4('0x35')](_0x54a853[_0xe0b4('0x32')],_0x54a853[_0xe0b4('0x33')]);_0x58feea[_0xe0b4('0x36')]=_['intersection'](_0x54a853[_0xe0b4('0x32')],qs['fields'](_0x556f72['query'][_0xe0b4('0x37')]));_0x58feea[_0xe0b4('0x36')]=_0x58feea['attributes'][_0xe0b4('0x47')]?_0x58feea[_0xe0b4('0x36')]:_0x54a853[_0xe0b4('0x32')];_0x58feea[_0xe0b4('0x39')]=qs[_0xe0b4('0x3a')](_0x556f72[_0xe0b4('0x33')][_0xe0b4('0x3a')]);_0x58feea[_0xe0b4('0x3b')]=qs[_0xe0b4('0x3c')](_['pick'](_0x556f72[_0xe0b4('0x33')],_0x54a853[_0xe0b4('0x3c')]));if(_0x556f72['query'][_0xe0b4('0x40')]){_0x58feea[_0xe0b4('0x3b')]=_[_0xe0b4('0x3e')](_0x58feea[_0xe0b4('0x3b')],{'$or':_[_0xe0b4('0x2d')](_0x58feea['attributes'],function(_0x1b6725){var _0x3be9be={};_0x3be9be[_0x1b6725]={'$like':'%'+_0x556f72[_0xe0b4('0x33')][_0xe0b4('0x40')]+'%'};return _0x3be9be;})});}_0x58feea=_[_0xe0b4('0x3e')]({},_0x58feea,_0x556f72[_0xe0b4('0x41')]);return _0xdd8172[_0xe0b4('0x53')](_0x58feea);}})[_0xe0b4('0x27')](function(_0x1b92c2){if(_0x1b92c2){_0x18fa0e=_0x1b92c2[_0xe0b4('0x47')];if(!_0x556f72[_0xe0b4('0x33')]['hasOwnProperty'](_0xe0b4('0x57'))){_0x58feea[_0xe0b4('0x22')]=qs[_0xe0b4('0x22')](_0x556f72[_0xe0b4('0x33')][_0xe0b4('0x22')]);_0x58feea[_0xe0b4('0x1f')]=qs[_0xe0b4('0x1f')](_0x556f72[_0xe0b4('0x33')]['offset']);}return _0xdd8172['getMembers'](_0x58feea);}})[_0xe0b4('0x27')](function(_0x125dd2){if(_0x125dd2){return _0x125dd2?{'count':_0x18fa0e,'rows':_0x125dd2}:null;}})[_0xe0b4('0x27')](respondWithResult(_0x38dc59,null))['catch'](handleError(_0x38dc59,null));};exports['removeMembers']=function(_0x4f456e,_0x7718f5,_0x39bc72){return db[_0xe0b4('0x2e')]['find']({'where':{'id':_0x4f456e['params']['id']}})[_0xe0b4('0x27')](handleEntityNotFound(_0x7718f5,null))[_0xe0b4('0x27')](function(_0x2127f7){if(_0x2127f7){return _0x2127f7[_0xe0b4('0x58')](_0x4f456e['query'][_0xe0b4('0x51')]);}})[_0xe0b4('0x27')](respondWithStatusCode(_0x7718f5,null))[_0xe0b4('0x44')](handleError(_0x7718f5,null));};exports[_0xe0b4('0x59')]=function(_0x476332,_0x3aee75,_0x376ace){if(_0x476332[_0xe0b4('0x49')]['id']){delete _0x476332[_0xe0b4('0x49')]['id'];}return db[_0xe0b4('0x2e')]['find']({'where':{'id':_0x476332['params']['id']}})[_0xe0b4('0x27')](handleEntityNotFound(_0x3aee75,null))[_0xe0b4('0x27')](function(_0x2c521e){if(_0x2c521e){_0x476332['body'][_0xe0b4('0x5a')]=_0x2c521e['id'];return db['ChatInternalMessage'][_0xe0b4('0x5b')](_0x476332['body']);}})['then'](respondWithResult(_0x3aee75,null))[_0xe0b4('0x44')](handleError(_0x3aee75,null));};exports[_0xe0b4('0x5c')]=function(_0x9038a5,_0x21a939,_0x1e9d89){var _0x59f82c={};var _0x2ca12d={};var _0x4bdf99;var _0x136a3d;return db[_0xe0b4('0x2e')][_0xe0b4('0x54')]({'where':{'id':_0x9038a5[_0xe0b4('0x46')]['id']}})[_0xe0b4('0x27')](handleEntityNotFound(_0x21a939,null))[_0xe0b4('0x27')](function(_0x4eb0ed){if(_0x4eb0ed){_0x4bdf99=_0x4eb0ed;_0x2ca12d[_0xe0b4('0x32')]=_['keys'](db[_0xe0b4('0x4d')]['rawAttributes']);_0x2ca12d[_0xe0b4('0x33')]=_[_0xe0b4('0x34')](_0x9038a5[_0xe0b4('0x33')]);_0x2ca12d[_0xe0b4('0x3c')]=_[_0xe0b4('0x35')](_0x2ca12d[_0xe0b4('0x32')],_0x2ca12d['query']);_0x59f82c['attributes']=_[_0xe0b4('0x35')](_0x2ca12d[_0xe0b4('0x32')],qs[_0xe0b4('0x37')](_0x9038a5['query']['fields']));_0x59f82c['attributes']=_0x59f82c[_0xe0b4('0x36')][_0xe0b4('0x47')]?_0x59f82c[_0xe0b4('0x36')]:_0x2ca12d[_0xe0b4('0x32')];_0x59f82c[_0xe0b4('0x39')]=qs['sort'](_0x9038a5[_0xe0b4('0x33')][_0xe0b4('0x3a')]);_0x59f82c[_0xe0b4('0x3b')]=qs['filters'](_['pick'](_0x9038a5[_0xe0b4('0x33')],_0x2ca12d['filters']));if(_0x9038a5['query'][_0xe0b4('0x40')]){_0x59f82c[_0xe0b4('0x3b')]=_[_0xe0b4('0x3e')](_0x59f82c['where'],{'$or':_['map'](_0x59f82c['attributes'],function(_0x46cb1c){var _0x22ca84={};_0x22ca84[_0x46cb1c]={'$like':'%'+_0x9038a5[_0xe0b4('0x33')]['filter']+'%'};return _0x22ca84;})});}if(_0x9038a5[_0xe0b4('0x33')]['$gte']){var _0x352203=_0x9038a5[_0xe0b4('0x33')][_0xe0b4('0x5d')][_0xe0b4('0x5e')](',');var _0x9b9392={};_0x9b9392[_0x352203[0x0]]={'$gte':moment(_0x352203[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x59f82c[_0xe0b4('0x3b')]=_[_0xe0b4('0x3e')](_0x59f82c['where'],_0x9b9392);}_0x59f82c=_[_0xe0b4('0x3e')]({},_0x59f82c,_0x9038a5[_0xe0b4('0x41')]);return _0x4bdf99['getMessages'](_0x59f82c);}})[_0xe0b4('0x27')](function(_0x15206d){if(_0x15206d){_0x136a3d=_0x15206d['length'];if(!_0x9038a5[_0xe0b4('0x33')][_0xe0b4('0x38')]('nolimit')){_0x59f82c[_0xe0b4('0x22')]=qs['limit'](_0x9038a5[_0xe0b4('0x33')][_0xe0b4('0x22')]);_0x59f82c[_0xe0b4('0x1f')]=qs[_0xe0b4('0x1f')](_0x9038a5[_0xe0b4('0x33')][_0xe0b4('0x1f')]);}return _0x4bdf99[_0xe0b4('0x5c')](_0x59f82c);}})[_0xe0b4('0x27')](function(_0x29e322){if(_0x29e322){return _0x29e322?{'count':_0x136a3d,'rows':_0x29e322}:null;}})[_0xe0b4('0x27')](respondWithResult(_0x21a939,null))[_0xe0b4('0x44')](handleError(_0x21a939,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 97f82e1..cfb1948 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 _0xc76e=['ChatGroup','setMaxListeners','save','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x2aa725,_0x2cebe7){var _0x4bfaae=function(_0x126ccd){while(--_0x126ccd){_0x2aa725['push'](_0x2aa725['shift']());}};_0x4bfaae(++_0x2cebe7);}(_0xc76e,0x10c));var _0xec76=function(_0x2d8d50,_0x29e476){_0x2d8d50=_0x2d8d50-0x0;var _0x3b463b=_0xc76e[_0x2d8d50];return _0x3b463b;};'use strict';var EventEmitter=require(_0xec76('0x0'));var ChatGroup=require(_0xec76('0x1'))['db'][_0xec76('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xec76('0x3')](0x0);var events={'afterCreate':_0xec76('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1cbc61){return function(_0x1d70c9,_0x539538,_0x38695c){ChatGroupEvents['emit'](_0x1cbc61+':'+_0x1d70c9['id'],_0x1d70c9);ChatGroupEvents[_0xec76('0x5')](_0x1cbc61,_0x1d70c9);_0x38695c(null);};}for(var e in events){if(events[_0xec76('0x6')](e)){var event=events[e];ChatGroup[_0xec76('0x7')](e,emitEvent(event));}}module[_0xec76('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0x2186=['update','remove','emit','events','save'];(function(_0x38569a,_0x1279f2){var _0x5aa538=function(_0xc7747f){while(--_0xc7747f){_0x38569a['push'](_0x38569a['shift']());}};_0x5aa538(++_0x1279f2);}(_0x2186,0x1ca));var _0x6218=function(_0x41c011,_0x49be6f){_0x41c011=_0x41c011-0x0;var _0x2bbb98=_0x2186[_0x41c011];return _0x2bbb98;};'use strict';var EventEmitter=require(_0x6218('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6218('0x1'),'afterUpdate':_0x6218('0x2'),'afterDestroy':_0x6218('0x3')};function emitEvent(_0x587b23){return function(_0x10aa49,_0x1bc6b1,_0x2b0e28){ChatGroupEvents[_0x6218('0x4')](_0x587b23+':'+_0x10aa49['id'],_0x10aa49);ChatGroupEvents[_0x6218('0x4')](_0x587b23,_0x10aa49);_0x2b0e28(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index e7bfe52..1459413 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 _0xb9c9=['bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger','moment'];(function(_0x44a62c,_0x4c35af){var _0x66fe93=function(_0x44ab47){while(--_0x44ab47){_0x44a62c['push'](_0x44a62c['shift']());}};_0x66fe93(++_0x4c35af);}(_0xb9c9,0x184));var _0x9b9c=function(_0x8aeabf,_0x5b5806){_0x8aeabf=_0x8aeabf-0x0;var _0x578064=_0xb9c9[_0x8aeabf];return _0x578064;};'use strict';var _=require(_0x9b9c('0x0'));var util=require(_0x9b9c('0x1'));var logger=require(_0x9b9c('0x2'))('api');var moment=require(_0x9b9c('0x3'));var BPromise=require(_0x9b9c('0x4'));var rp=require(_0x9b9c('0x5'));var fs=require('fs');var path=require(_0x9b9c('0x6'));var rimraf=require(_0x9b9c('0x7'));var config=require(_0x9b9c('0x8'));var attributes=require(_0x9b9c('0x9'));module[_0x9b9c('0xa')]=function(_0xffe64,_0xf8368c){return _0xffe64[_0x9b9c('0xb')](_0x9b9c('0xc'),attributes,{'tableName':_0x9b9c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xce54=['../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','moment','bluebird','request-promise','rimraf'];(function(_0x2503dc,_0x24d155){var _0x317eb8=function(_0x41c240){while(--_0x41c240){_0x2503dc['push'](_0x2503dc['shift']());}};_0x317eb8(++_0x24d155);}(_0xce54,0x1c9));var _0x4ce5=function(_0x34c7f3,_0x530552){_0x34c7f3=_0x34c7f3-0x0;var _0x45f682=_0xce54[_0x34c7f3];return _0x45f682;};'use strict';var _=require(_0x4ce5('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x4ce5('0x1'));var BPromise=require(_0x4ce5('0x2'));var rp=require(_0x4ce5('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4ce5('0x4'));var config=require(_0x4ce5('0x5'));var attributes=require(_0x4ce5('0x6'));module[_0x4ce5('0x7')]=function(_0x4ebfe4,_0x389848){return _0x4ebfe4[_0x4ce5('0x8')](_0x4ce5('0x9'),attributes,{'tableName':_0x4ce5('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 f8f47e5..f4f0a1c 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 _0xb453=['defaults','socket.io-emitter','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x249a9b,_0x29db45){var _0x2f17e6=function(_0x1fcbb2){while(--_0x1fcbb2){_0x249a9b['push'](_0x249a9b['shift']());}};_0x2f17e6(++_0x29db45);}(_0xb453,0x1e8));var _0x3b45=function(_0x1c6c0c,_0x5c0cd4){_0x1c6c0c=_0x1c6c0c-0x0;var _0x51cbea=_0xb453[_0x1c6c0c];return _0x51cbea;};'use strict';var _=require(_0x3b45('0x0'));var util=require(_0x3b45('0x1'));var moment=require('moment');var BPromise=require(_0x3b45('0x2'));var rs=require(_0x3b45('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3b45('0x4'));var logger=require(_0x3b45('0x5'))(_0x3b45('0x6'));var config=require(_0x3b45('0x7'));var jayson=require(_0x3b45('0x8'));var client=jayson[_0x3b45('0x9')][_0x3b45('0xa')]({'port':0x232a});config[_0x3b45('0xb')]=_[_0x3b45('0xc')](config[_0x3b45('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x3b45('0xd'))(new Redis(config[_0x3b45('0xb')]));require(_0x3b45('0xe'))[_0x3b45('0xf')](socket);function respondWithRpcPromise(_0x7f50f1,_0x71e2b0,_0x378cda){return new BPromise(function(_0x4ccbdb,_0x7f9f5b){return client['request'](_0x7f50f1,_0x378cda)[_0x3b45('0x10')](function(_0x336b8b){logger[_0x3b45('0x11')](_0x3b45('0x12'),_0x71e2b0,_0x3b45('0x13'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x71e2b0,_0x3b45('0x13'),JSON[_0x3b45('0x14')](_0x336b8b));if(_0x336b8b['error']){if(_0x336b8b[_0x3b45('0x15')][_0x3b45('0x16')]===0x1f4){logger[_0x3b45('0x15')](_0x3b45('0x12'),_0x71e2b0,_0x336b8b[_0x3b45('0x15')][_0x3b45('0x17')]);return _0x7f9f5b(_0x336b8b[_0x3b45('0x15')][_0x3b45('0x17')]);}logger[_0x3b45('0x15')](_0x3b45('0x12'),_0x71e2b0,_0x336b8b[_0x3b45('0x15')][_0x3b45('0x17')]);return _0x4ccbdb(_0x336b8b['error']['message']);}else{logger[_0x3b45('0x11')](_0x3b45('0x12'),_0x71e2b0,_0x3b45('0x13'));_0x4ccbdb(_0x336b8b['result']['message']);}})[_0x3b45('0x18')](function(_0x47da1d){logger[_0x3b45('0x15')](_0x3b45('0x12'),_0x71e2b0,_0x47da1d);_0x7f9f5b(_0x47da1d);});});}
\ No newline at end of file
+var _0x1670=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util'];(function(_0xc5e02a,_0xd9da3c){var _0xbeca77=function(_0x2a7d11){while(--_0x2a7d11){_0xc5e02a['push'](_0xc5e02a['shift']());}};_0xbeca77(++_0xd9da3c);}(_0x1670,0x9a));var _0x0167=function(_0x1c3bb1,_0x5a7c99){_0x1c3bb1=_0x1c3bb1-0x0;var _0xf6cc1d=_0x1670[_0x1c3bb1];return _0xf6cc1d;};'use strict';var _=require(_0x0167('0x0'));var util=require(_0x0167('0x1'));var moment=require('moment');var BPromise=require(_0x0167('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0167('0x3'));var db=require(_0x0167('0x4'))['db'];var utils=require(_0x0167('0x5'));var logger=require(_0x0167('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0167('0x7'));var client=jayson[_0x0167('0x8')][_0x0167('0x9')]({'port':0x232a});config[_0x0167('0xa')]=_[_0x0167('0xb')](config[_0x0167('0xa')],{'host':_0x0167('0xc'),'port':0x18eb});var socket=require(_0x0167('0xd'))(new Redis(config['redis']));require('./chatGroup.socket')[_0x0167('0xe')](socket);function respondWithRpcPromise(_0x178f5f,_0x2b88ec,_0x1632d4){return new BPromise(function(_0x338288,_0x364dc7){return client[_0x0167('0xf')](_0x178f5f,_0x1632d4)[_0x0167('0x10')](function(_0x257ed6){logger[_0x0167('0x11')](_0x0167('0x12'),_0x2b88ec,_0x0167('0x13'));logger[_0x0167('0x14')](_0x0167('0x15'),_0x2b88ec,'request\x20sent',JSON[_0x0167('0x16')](_0x257ed6));if(_0x257ed6['error']){if(_0x257ed6[_0x0167('0x17')]['code']===0x1f4){logger[_0x0167('0x17')](_0x0167('0x12'),_0x2b88ec,_0x257ed6[_0x0167('0x17')]['message']);return _0x364dc7(_0x257ed6['error']['message']);}logger[_0x0167('0x17')](_0x0167('0x12'),_0x2b88ec,_0x257ed6['error'][_0x0167('0x18')]);return _0x338288(_0x257ed6['error']['message']);}else{logger[_0x0167('0x11')]('ChatGroup,\x20%s,\x20%s',_0x2b88ec,_0x0167('0x13'));_0x338288(_0x257ed6['result'][_0x0167('0x18')]);}})[_0x0167('0x19')](function(_0x170207){logger[_0x0167('0x17')](_0x0167('0x12'),_0x2b88ec,_0x170207);_0x364dc7(_0x170207);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index b41262a..ad62b6a 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 _0x0bd0=['./chatGroup.events','save','update','emit','register','length'];(function(_0x25bb37,_0x471024){var _0x27cec9=function(_0x317341){while(--_0x317341){_0x25bb37['push'](_0x25bb37['shift']());}};_0x27cec9(++_0x471024);}(_0x0bd0,0x14a));var _0x00bd=function(_0x27a5bb,_0x3f4cfb){_0x27a5bb=_0x27a5bb-0x0;var _0x2e17ea=_0x0bd0[_0x27a5bb];return _0x2e17ea;};'use strict';var ChatGroupEvents=require(_0x00bd('0x0'));var events=[_0x00bd('0x1'),'remove',_0x00bd('0x2')];function createListener(_0x3570b1,_0x57b725){return function(_0x2882e5){_0x57b725[_0x00bd('0x3')](_0x3570b1,_0x2882e5);};}function removeListener(_0x1a96ad,_0x3a00c3){return function(){ChatGroupEvents['removeListener'](_0x1a96ad,_0x3a00c3);};}exports[_0x00bd('0x4')]=function(_0x431040){for(var _0x4699db=0x0,_0x5393ee=events[_0x00bd('0x5')];_0x4699db<_0x5393ee;_0x4699db++){var _0x381b38=events[_0x4699db];var _0xc9214=createListener('chatGroup:'+_0x381b38,_0x431040);ChatGroupEvents['on'](_0x381b38,_0xc9214);}};
\ No newline at end of file
+var _0x7182=['save','update','emit','removeListener','length','./chatGroup.events'];(function(_0x16ecd6,_0x23b605){var _0x4c4cf9=function(_0xd85893){while(--_0xd85893){_0x16ecd6['push'](_0x16ecd6['shift']());}};_0x4c4cf9(++_0x23b605);}(_0x7182,0xb9));var _0x2718=function(_0x4d0c0c,_0x4f82e8){_0x4d0c0c=_0x4d0c0c-0x0;var _0x5bbee8=_0x7182[_0x4d0c0c];return _0x5bbee8;};'use strict';var ChatGroupEvents=require(_0x2718('0x0'));var events=[_0x2718('0x1'),'remove',_0x2718('0x2')];function createListener(_0x11e8d1,_0x1f019f){return function(_0x1eb4e9){_0x1f019f[_0x2718('0x3')](_0x11e8d1,_0x1eb4e9);};}function removeListener(_0x2bfc07,_0x37edf7){return function(){ChatGroupEvents[_0x2718('0x4')](_0x2bfc07,_0x37edf7);};}exports['register']=function(_0x570198){for(var _0x2d8340=0x0,_0x3842ce=events[_0x2718('0x5')];_0x2d8340<_0x3842ce;_0x2d8340++){var _0x218771=events[_0x2d8340];var _0x144dbc=createListener('chatGroup:'+_0x218771,_0x570198);ChatGroupEvents['on'](_0x218771,_0x144dbc);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 8911e4f..b4cf03b 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 _0x2b26=['post','addMessage','put','delete','removeMembers','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','/:id','show','getUnread','/:id/members','getMembers','/:id/messages','create','addMembers'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x2b26,0x1c6));var _0x62b2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2b26[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x62b2('0x0'));var util=require(_0x62b2('0x1'));var path=require(_0x62b2('0x2'));var timeout=require(_0x62b2('0x3'));var express=require('express');var router=express[_0x62b2('0x4')]();var fs_extra=require(_0x62b2('0x5'));var auth=require(_0x62b2('0x6'));var interaction=require(_0x62b2('0x7'));var config=require(_0x62b2('0x8'));var controller=require(_0x62b2('0x9'));router[_0x62b2('0xa')]('/',auth[_0x62b2('0xb')](),controller[_0x62b2('0xc')]);router[_0x62b2('0xa')](_0x62b2('0xd'),auth[_0x62b2('0xb')](),controller['describe']);router['get'](_0x62b2('0xe'),auth[_0x62b2('0xb')](),controller[_0x62b2('0xf')]);router[_0x62b2('0xa')]('/:id/unread',auth[_0x62b2('0xb')](),controller[_0x62b2('0x10')]);router[_0x62b2('0xa')](_0x62b2('0x11'),auth[_0x62b2('0xb')](),controller[_0x62b2('0x12')]);router['get'](_0x62b2('0x13'),auth['isAuthenticated'](),controller['getMessages']);router['post']('/',auth['isAuthenticated'](),controller[_0x62b2('0x14')]);router['post'](_0x62b2('0x11'),auth[_0x62b2('0xb')](),controller[_0x62b2('0x15')]);router[_0x62b2('0x16')](_0x62b2('0x13'),auth[_0x62b2('0xb')](),controller[_0x62b2('0x17')]);router[_0x62b2('0x18')](_0x62b2('0xe'),auth[_0x62b2('0xb')](),controller['update']);router[_0x62b2('0x19')](_0x62b2('0xe'),auth[_0x62b2('0xb')](),controller['destroy']);router[_0x62b2('0x19')](_0x62b2('0x11'),auth[_0x62b2('0xb')](),controller[_0x62b2('0x1a')]);module[_0x62b2('0x1b')]=router;
\ No newline at end of file
+var _0xcdcc=['getMessages','post','create','addMembers','addMessage','update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','/describe','get','/:id','show','getUnread','/:id/members','getMembers','/:id/messages'];(function(_0x55e58c,_0x5278e9){var _0x32ce31=function(_0x4098d2){while(--_0x4098d2){_0x55e58c['push'](_0x55e58c['shift']());}};_0x32ce31(++_0x5278e9);}(_0xcdcc,0x13e));var _0xccdc=function(_0x5657ed,_0x48f5cb){_0x5657ed=_0x5657ed-0x0;var _0x23b0d8=_0xcdcc[_0x5657ed];return _0x23b0d8;};'use strict';var multer=require(_0xccdc('0x0'));var util=require(_0xccdc('0x1'));var path=require(_0xccdc('0x2'));var timeout=require(_0xccdc('0x3'));var express=require(_0xccdc('0x4'));var router=express['Router']();var fs_extra=require(_0xccdc('0x5'));var auth=require(_0xccdc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xccdc('0x7'));var controller=require('./chatGroup.controller');router['get']('/',auth[_0xccdc('0x8')](),controller[_0xccdc('0x9')]);router['get'](_0xccdc('0xa'),auth[_0xccdc('0x8')](),controller['describe']);router[_0xccdc('0xb')](_0xccdc('0xc'),auth[_0xccdc('0x8')](),controller[_0xccdc('0xd')]);router[_0xccdc('0xb')]('/:id/unread',auth[_0xccdc('0x8')](),controller[_0xccdc('0xe')]);router['get'](_0xccdc('0xf'),auth[_0xccdc('0x8')](),controller[_0xccdc('0x10')]);router[_0xccdc('0xb')](_0xccdc('0x11'),auth['isAuthenticated'](),controller[_0xccdc('0x12')]);router[_0xccdc('0x13')]('/',auth[_0xccdc('0x8')](),controller[_0xccdc('0x14')]);router[_0xccdc('0x13')](_0xccdc('0xf'),auth[_0xccdc('0x8')](),controller[_0xccdc('0x15')]);router[_0xccdc('0x13')](_0xccdc('0x11'),auth[_0xccdc('0x8')](),controller[_0xccdc('0x16')]);router['put'](_0xccdc('0xc'),auth[_0xccdc('0x8')](),controller[_0xccdc('0x17')]);router[_0xccdc('0x18')](_0xccdc('0xc'),auth['isAuthenticated'](),controller[_0xccdc('0x19')]);router[_0xccdc('0x18')]('/:id/members',auth[_0xccdc('0x8')](),controller[_0xccdc('0x1a')]);module[_0xccdc('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 0e9dd89..afb0a5f 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 _0x7334=['out','sequelize','exports','BOOLEAN','star','TEXT','STRING','DATE','long'];(function(_0x462c6d,_0x4b63b2){var _0x4e948f=function(_0x1ff084){while(--_0x1ff084){_0x462c6d['push'](_0x462c6d['shift']());}};_0x4e948f(++_0x4b63b2);}(_0x7334,0x184));var _0x4733=function(_0x299994,_0x53b6d0){_0x299994=_0x299994-0x0;var _0x46ac87=_0x7334[_0x299994];return _0x46ac87;};'use strict';var Sequelize=require(_0x4733('0x0'));module[_0x4733('0x1')]={'closed':{'type':Sequelize[_0x4733('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0x4733('0x3'),'thumb'),'defaultValue':_0x4733('0x3')},'ratingMessage':{'type':Sequelize[_0x4733('0x4')]},'pathTranscript':{'type':Sequelize[_0x4733('0x4')]},'mailTranscript':{'type':Sequelize[_0x4733('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x4733('0x6')]},'disposition':{'type':Sequelize[_0x4733('0x5')]},'secondDisposition':{'type':Sequelize[_0x4733('0x5')]},'thirdDisposition':{'type':Sequelize[_0x4733('0x5')]},'note':{'type':Sequelize[_0x4733('0x5')]},'browserName':{'type':Sequelize[_0x4733('0x5')]},'browserVersion':{'type':Sequelize[_0x4733('0x5')]},'osName':{'type':Sequelize[_0x4733('0x5')]},'osVersion':{'type':Sequelize[_0x4733('0x5')]},'deviceModel':{'type':Sequelize[_0x4733('0x5')]},'deviceVendor':{'type':Sequelize[_0x4733('0x5')]},'deviceType':{'type':Sequelize[_0x4733('0x5')]},'referer':{'type':Sequelize[_0x4733('0x4')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x4733('0x4')](_0x4733('0x7'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x4733('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x4733('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x4733('0x5')]},'customerPort':{'type':Sequelize[_0x4733('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x4733('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x4733('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x4e81=['DATE','long','ENUM','out','sequelize','exports','BOOLEAN','thumb','star','TEXT','STRING'];(function(_0x1f60c2,_0x361dfd){var _0x2958f8=function(_0x3ecdf6){while(--_0x3ecdf6){_0x1f60c2['push'](_0x1f60c2['shift']());}};_0x2958f8(++_0x361dfd);}(_0x4e81,0x1bc));var _0x14e8=function(_0x52ea08,_0x15d935){_0x52ea08=_0x52ea08-0x0;var _0x28d546=_0x4e81[_0x52ea08];return _0x28d546;};'use strict';var Sequelize=require(_0x14e8('0x0'));module[_0x14e8('0x1')]={'closed':{'type':Sequelize[_0x14e8('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM']('star',_0x14e8('0x3')),'defaultValue':_0x14e8('0x4')},'ratingMessage':{'type':Sequelize[_0x14e8('0x5')]},'pathTranscript':{'type':Sequelize[_0x14e8('0x5')]},'mailTranscript':{'type':Sequelize[_0x14e8('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x14e8('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x14e8('0x6')]},'note':{'type':Sequelize[_0x14e8('0x6')]},'browserName':{'type':Sequelize[_0x14e8('0x6')]},'browserVersion':{'type':Sequelize[_0x14e8('0x6')]},'osName':{'type':Sequelize[_0x14e8('0x6')]},'osVersion':{'type':Sequelize[_0x14e8('0x6')]},'deviceModel':{'type':Sequelize[_0x14e8('0x6')]},'deviceVendor':{'type':Sequelize[_0x14e8('0x6')]},'deviceType':{'type':Sequelize[_0x14e8('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x14e8('0x6')]},'formData':{'type':Sequelize[_0x14e8('0x5')](_0x14e8('0x8'))},'read1stAt':{'type':Sequelize[_0x14e8('0x7')]},'lastMsgAt':{'type':Sequelize[_0x14e8('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x14e8('0x9')]('in',_0x14e8('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x14e8('0x6')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x14e8('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 5a6c7a4..cdced43 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 _0xae86=['CmContact','agentAlias','%s%d','Visitor','System','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','hasOwnProperty','findAll','getMyMessages','includeAgent','alias','setTags','spread','emit','chatInteractionTags:save','removeTags','download','root','server','tmp','attachments','firstName','Account','Owner','mkdirSync','YYYY-MM-DD\x20HH:mm:ss','browserName','osName','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','pipe','createWriteStream','lastName','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','fs-extra','lodash','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','then','name','send','render','merge','contact','agent','interaction','account','map','fullname','TagIds','Tags','split','forEach','waiting','talking','abandoned','UserId','closed','disposition','unmanaged','answered','total','index','rawAttributes','fieldName','model','query','filters','attributes','fields','length','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','expr','search','sqlOperator','conditions','find','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','body','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','role','toString','count','sequelize','keyBy','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.lastName','Contact.lastName','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','push','rows','show','params','keys','ChatInteraction','intersection','includeAll','include','options','create','update','destroy','describe','createVidaooSession','findOne','vidaooApiKey','vidaooTopic','vidaooNote','vidaooMetadata','vidaooEscalation','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','metadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','originalname','basename','file','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','server/files/attachments/','offline-chat/','join','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','ChatWebsite'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0xae86,0x17f));var _0x6ae8=function(_0x2126d9,_0x3d5e60){_0x2126d9=_0x2126d9-0x0;var _0x4a21a3=_0xae86[_0x2126d9];return _0x4a21a3;};'use strict';var emlformat=require(_0x6ae8('0x0'));var rimraf=require(_0x6ae8('0x1'));var zipdir=require(_0x6ae8('0x2'));var jsonpatch=require(_0x6ae8('0x3'));var rp=require(_0x6ae8('0x4'));var moment=require('moment');var BPromise=require(_0x6ae8('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6ae8('0x6'));var _=require(_0x6ae8('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6ae8('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6ae8('0x9'));var authService=require(_0x6ae8('0xa'));var qs=require(_0x6ae8('0xb'));var as=require(_0x6ae8('0xc'));var pdf=require(_0x6ae8('0xd'));var hardwareService=require(_0x6ae8('0xe'));var logger=require('../../config/logger')(_0x6ae8('0xf'));var utils=require(_0x6ae8('0x10'));var config=require(_0x6ae8('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x6ae8('0x12')]=_[_0x6ae8('0x13')](config['redis'],{'host':_0x6ae8('0x14'),'port':0x18eb});var socket=require(_0x6ae8('0x15'))(new Redis(config[_0x6ae8('0x12')]));require(_0x6ae8('0x16'))[_0x6ae8('0x17')](socket);var jayson=require(_0x6ae8('0x18'));var client=jayson[_0x6ae8('0x19')][_0x6ae8('0x1a')]({'port':0x232b});var client9004=jayson['client'][_0x6ae8('0x1a')]({'port':0x232c});function respondWithRpcPromise(_0x4dfbc2,_0x47d0a8,_0x4fe339,_0x75ca26){return new BPromise(function(_0x24f76a,_0x87ecc8){var _0x2a7cc8=_0x75ca26||client;return _0x2a7cc8[_0x6ae8('0x1b')](_0x4dfbc2,_0x4fe339)['then'](function(_0x1db5c6){logger[_0x6ae8('0x1c')](_0x6ae8('0x1d'),_0x47d0a8,'request\x20sent');logger[_0x6ae8('0x1e')](_0x6ae8('0x1f'),_0x47d0a8,'request\x20sent',JSON['stringify'](_0x1db5c6));if(_0x1db5c6['error']){if(_0x1db5c6[_0x6ae8('0x20')][_0x6ae8('0x21')]===0x1f4){logger[_0x6ae8('0x20')]('ChatInteraction,\x20%s,\x20%s',_0x47d0a8,_0x1db5c6[_0x6ae8('0x20')][_0x6ae8('0x22')]);return _0x87ecc8(_0x1db5c6[_0x6ae8('0x20')][_0x6ae8('0x22')]);}logger[_0x6ae8('0x20')](_0x6ae8('0x1d'),_0x47d0a8,_0x1db5c6['error'][_0x6ae8('0x22')]);return _0x24f76a(_0x1db5c6[_0x6ae8('0x20')]['message']);}else{logger[_0x6ae8('0x1c')](_0x6ae8('0x1d'),_0x47d0a8,'request\x20sent');_0x24f76a(_0x1db5c6[_0x6ae8('0x23')][_0x6ae8('0x22')]);}})[_0x6ae8('0x24')](function(_0x44922c){logger[_0x6ae8('0x20')](_0x6ae8('0x1d'),_0x47d0a8,_0x44922c);_0x87ecc8(_0x44922c);});});}function respondWithStatusCode(_0x3a79d6,_0x585d94){_0x585d94=_0x585d94||0xcc;return function(_0x1550dc){if(_0x1550dc){return _0x3a79d6[_0x6ae8('0x25')](_0x585d94);}return _0x3a79d6[_0x6ae8('0x26')](_0x585d94)[_0x6ae8('0x27')]();};}function respondWithResult(_0x420558,_0xea629d){_0xea629d=_0xea629d||0xc8;return function(_0x472817){if(_0x472817){return _0x420558[_0x6ae8('0x26')](_0xea629d)[_0x6ae8('0x28')](_0x472817);}};}function respondWithFilteredResult(_0x316ab6,_0x115f1a){return function(_0x58cb46){if(_0x58cb46){var _0x1281f6=typeof _0x115f1a[_0x6ae8('0x29')]===_0x6ae8('0x2a')&&typeof _0x115f1a[_0x6ae8('0x2b')]==='undefined';var _0x41b1bc=_0x58cb46['count'];var _0xadccd9=_0x1281f6?0x0:_0x115f1a['offset'];var _0x33e149=_0x1281f6?_0x58cb46['count']:_0x115f1a[_0x6ae8('0x29')]+_0x115f1a[_0x6ae8('0x2b')];var _0x122b74;if(_0x33e149>=_0x41b1bc){_0x33e149=_0x41b1bc;_0x122b74=0xc8;}else{_0x122b74=0xce;}_0x316ab6[_0x6ae8('0x26')](_0x122b74);return _0x316ab6[_0x6ae8('0x2c')](_0x6ae8('0x2d'),_0xadccd9+'-'+_0x33e149+'/'+_0x41b1bc)['json'](_0x58cb46);}return null;};}function patchUpdates(_0x4a4874){return function(_0x5120c9){try{jsonpatch[_0x6ae8('0x2e')](_0x5120c9,_0x4a4874,!![]);}catch(_0x584280){return BPromise[_0x6ae8('0x2f')](_0x584280);}return _0x5120c9['save']();};}function saveUpdates(_0x140950,_0x3f4e71){return function(_0x3b2716){if(_0x3b2716){return _0x3b2716['update'](_0x140950)[_0x6ae8('0x30')](function(_0x46285c){return _0x46285c;});}return null;};}function removeEntity(_0x3f1722,_0x1416dd){return function(_0x4290a3){if(_0x4290a3){return _0x4290a3['destroy']()[_0x6ae8('0x30')](function(){_0x3f1722['status'](0xcc)[_0x6ae8('0x27')]();});}};}function handleEntityNotFound(_0x437446,_0x349bf9){return function(_0xfb5388){if(!_0xfb5388){_0x437446[_0x6ae8('0x25')](0x194);}return _0xfb5388;};}function handleError(_0x163e49,_0x29c48f){_0x29c48f=_0x29c48f||0x1f4;return function(_0x119d1a){logger[_0x6ae8('0x20')](_0x119d1a['stack']);if(_0x119d1a[_0x6ae8('0x31')]){delete _0x119d1a[_0x6ae8('0x31')];}_0x163e49[_0x6ae8('0x26')](_0x29c48f)[_0x6ae8('0x32')](_0x119d1a);};}function getMustacheRender(_0x364682,_0x4d9cb7){return Mustache[_0x6ae8('0x33')](_0x364682,_[_0x6ae8('0x34')](_0x4d9cb7['body'],{'contact':_0x4d9cb7[_0x6ae8('0x35')],'message':_0x4d9cb7[_0x6ae8('0x22')],'agent':_0x4d9cb7[_0x6ae8('0x36')],'interaction':_0x4d9cb7[_0x6ae8('0x37')],'account':_0x4d9cb7[_0x6ae8('0x38')]}))||'';}function getInteractionUsers(_0x1360ab,_0x82f4b7){return new BPromise(function(_0xf41ba8,_0x4278e5){try{if(_0x82f4b7[_0x1360ab['id']]){_0x1360ab['Users']=_[_0x6ae8('0x39')](_0x82f4b7[_0x1360ab['id']],function(_0x25be4b){return{'id':_0x25be4b['id'],'fullname':_0x25be4b[_0x6ae8('0x3a')]};});}}catch(_0xe69d7e){_0x4278e5(_0xe69d7e);}_0xf41ba8(_0x1360ab);});}function getInteractionTags(_0x294cbd,_0x434a02){return new BPromise(function(_0x1a5217,_0x44ed48){try{if(_0x294cbd[_0x6ae8('0x3b')]){_0x294cbd[_0x6ae8('0x3c')]=[];_0x294cbd['TagIds'][_0x6ae8('0x3d')](',')[_0x6ae8('0x3e')](function(_0x564c87){_0x294cbd['Tags']['push'](_0x434a02[_0x564c87]);});}delete _0x294cbd[_0x6ae8('0x3b')];}catch(_0xb04ae8){_0x44ed48(_0xb04ae8);}_0x1a5217(_0x294cbd);});}function updateChatInteraction(_0x3158b6,_0x207780,_0x2dbe95){return new BPromise(function(_0x5ab712,_0x75a73a){return getInteractionUsers(_0x3158b6,_0x2dbe95)[_0x6ae8('0x30')](function(_0x97b6ab){return getInteractionTags(_0x97b6ab,_0x207780);})[_0x6ae8('0x30')](function(_0x37c6fe){return getStateInteraction(_0x37c6fe);})[_0x6ae8('0x30')](function(_0x2e86bb){_0x5ab712(_0x2e86bb);})[_0x6ae8('0x24')](function(_0x1afe66){_0x75a73a(_0x1afe66);});});}function getStateInteraction(_0x7efcd1){return new BPromise(function(_0x21594e){_0x7efcd1[_0x6ae8('0x3f')]=0x0;_0x7efcd1[_0x6ae8('0x40')]=0x0;_0x7efcd1['answered']=0x0;_0x7efcd1['unmanaged']=0x0;_0x7efcd1[_0x6ae8('0x41')]=0x0;_0x7efcd1['total']=0x0;if(!_0x7efcd1['closed']&&!_0x7efcd1[_0x6ae8('0x42')]){_0x7efcd1[_0x6ae8('0x3f')]+=0x1;}if(!_0x7efcd1[_0x6ae8('0x43')]&&_0x7efcd1[_0x6ae8('0x42')]){_0x7efcd1[_0x6ae8('0x40')]+=0x1;if(_0x7efcd1[_0x6ae8('0x3f')]){_0x7efcd1['waiting']-=0x1;}}if(_0x7efcd1[_0x6ae8('0x43')]&&_0x7efcd1[_0x6ae8('0x44')]===_0x6ae8('0x41')){_0x7efcd1[_0x6ae8('0x41')]+=0x1;if(_0x7efcd1[_0x6ae8('0x3f')]){_0x7efcd1['waiting']-=0x1;}}else if(_0x7efcd1[_0x6ae8('0x43')]&&!_0x7efcd1[_0x6ae8('0x42')]&&_0x7efcd1[_0x6ae8('0x44')]){_0x7efcd1[_0x6ae8('0x45')]+=0x1;if(_0x7efcd1[_0x6ae8('0x3f')]){_0x7efcd1['waiting']-=0x1;}}else if(_0x7efcd1[_0x6ae8('0x43')]&&_0x7efcd1['UserId']){_0x7efcd1[_0x6ae8('0x46')]+=0x1;if(_0x7efcd1['talking']){_0x7efcd1[_0x6ae8('0x40')]-=0x1;}}_0x7efcd1[_0x6ae8('0x47')]+=0x1;_0x21594e(_0x7efcd1);});}exports[_0x6ae8('0x48')]=function(_0x4b603a,_0x4aae33){var _0x4f2f67={},_0x4bc9fa={},_0x19a513={'count':0x0,'rows':[]};var _0xd43cea=_['map'](db['ChatInteraction'][_0x6ae8('0x49')],function(_0x58ef38){return{'name':_0x58ef38[_0x6ae8('0x4a')],'type':_0x58ef38['type']['key']};});_0x4bc9fa[_0x6ae8('0x4b')]=_['map'](_0xd43cea,_0x6ae8('0x31'));_0x4bc9fa[_0x6ae8('0x4c')]=_['keys'](_0x4b603a['query']);_0x4bc9fa[_0x6ae8('0x4d')]=_['intersection'](_0x4bc9fa[_0x6ae8('0x4b')],_0x4bc9fa[_0x6ae8('0x4c')]);_0x4f2f67[_0x6ae8('0x4e')]=_['intersection'](_0x4bc9fa['model'],qs[_0x6ae8('0x4f')](_0x4b603a[_0x6ae8('0x4c')][_0x6ae8('0x4f')]));_0x4f2f67[_0x6ae8('0x4e')]=_0x4f2f67[_0x6ae8('0x4e')][_0x6ae8('0x50')]?_0x4f2f67[_0x6ae8('0x4e')]:_0x4bc9fa['model'];if(!_0x4b603a[_0x6ae8('0x4c')]['hasOwnProperty'](_0x6ae8('0x51'))){_0x4f2f67['limit']=qs['limit'](_0x4b603a[_0x6ae8('0x4c')]['limit']);_0x4f2f67[_0x6ae8('0x29')]=qs['offset'](_0x4b603a[_0x6ae8('0x4c')]['offset']);}_0x4f2f67[_0x6ae8('0x52')]=qs[_0x6ae8('0x53')](_0x4b603a[_0x6ae8('0x4c')][_0x6ae8('0x53')]);_0x4f2f67[_0x6ae8('0x54')]=qs['filters'](_[_0x6ae8('0x55')](_0x4b603a[_0x6ae8('0x4c')],_0x4bc9fa[_0x6ae8('0x4d')]),_0xd43cea);var _0x5844ce=[];var _0x321eda=squel[_0x6ae8('0x56')]()[_0x6ae8('0x57')]('id')['field'](_0x6ae8('0x31'))[_0x6ae8('0x57')](_0x6ae8('0x58'))[_0x6ae8('0x59')](_0x6ae8('0x5a'));var _0x2c6f9b=squel[_0x6ae8('0x56')]()[_0x6ae8('0x57')](_0x6ae8('0x5b'))[_0x6ae8('0x57')](_0x6ae8('0x5c'))[_0x6ae8('0x57')](_0x6ae8('0x5d'))[_0x6ae8('0x59')](_0x6ae8('0x5e'),'ui')[_0x6ae8('0x5f')](_0x6ae8('0x60'),'u',_0x6ae8('0x61'));var _0x465d3c=squel[_0x6ae8('0x56')]()[_0x6ae8('0x59')](_0x6ae8('0x62'),'i')[_0x6ae8('0x5f')]('cm_contacts','c',_0x6ae8('0x63'))[_0x6ae8('0x5f')](_0x6ae8('0x60'),'o',_0x6ae8('0x64'))[_0x6ae8('0x5f')](_0x6ae8('0x65'),'a',_0x6ae8('0x66'))[_0x6ae8('0x5f')](_0x6ae8('0x67'),'me',_0x6ae8('0x68'))['left_join'](_0x6ae8('0x69'),'it','it.ChatInteractionId\x20=\x20i.id')[_0x6ae8('0x5f')](_0x6ae8('0x5a'),'t','t.id\x20=\x20it.TagId');var _0x822173=squel[_0x6ae8('0x6a')]();var _0x522618=[];var _0x244e86=squel[_0x6ae8('0x6a')]();var _0x3e57e3;if(_0x4b603a[_0x6ae8('0x4c')][_0x6ae8('0x6b')]){_0x3e57e3=as['parseSearch'](_0x4b603a[_0x6ae8('0x4c')]['search']);var _0x25b86c=_0x3e57e3[_0x6ae8('0x6c')];for(var _0x49c74e=0x0;_0x49c74e<_0x3e57e3['conditions']['length'];_0x49c74e++){var _0x40a745=_0x3e57e3[_0x6ae8('0x6d')][_0x49c74e];var _0x1f9b93='i';var _0x338aad=_[_0x6ae8('0x6e')](_0xd43cea,['name',_0x40a745[_0x6ae8('0x57')]]);if(!_0x338aad){switch(_0x40a745[_0x6ae8('0x57')]){case'unreadMessages':if(_0x40a745['value']==0x1){_0x465d3c[_0x6ae8('0x6f')]('`'+_0x40a745[_0x6ae8('0x57')]+_0x6ae8('0x70'));}else{_0x465d3c[_0x6ae8('0x6f')]('`'+_0x40a745[_0x6ae8('0x57')]+_0x6ae8('0x71'));}break;case _0x6ae8('0x72'):if(_0x40a745[_0x6ae8('0x73')]===_0x6ae8('0x74')){if(_0x40a745[_0x6ae8('0x75')][_0x6ae8('0x3d')]('\x20')['length']>0x1){_0x822173[_0x25b86c](_0x6ae8('0x76'),qs[_0x6ae8('0x77')](_0x40a745[_0x6ae8('0x75')]),null);}else{var _0x17a6e8='%'+_0x40a745[_0x6ae8('0x75')]+'%';_0x822173[_0x25b86c](_0x6ae8('0x78'),_0x17a6e8,_0x17a6e8,_0x17a6e8);}}else{_0x338aad=_[_0x6ae8('0x6e')](_0xd43cea,[_0x6ae8('0x31'),_0x6ae8('0x79')]);_0x40a745['field']='ContactId';_0x50c1d4=as[_0x6ae8('0x7a')](_0x1f9b93,_0x338aad[_0x6ae8('0x7b')],_0x40a745);_0x822173[_0x25b86c](_0x50c1d4[_0x6ae8('0x7c')],_0x50c1d4[_0x6ae8('0x75')][_0x6ae8('0x7d')],_0x50c1d4[_0x6ae8('0x75')][_0x6ae8('0x27')]);}break;case _0x6ae8('0x7e'):var _0x93b90=_0x40a745[_0x6ae8('0x75')]['split'](',')[_0x6ae8('0x39')](function(_0x442983){return Number(_0x442983);});_0x93b90[_0x6ae8('0x3e')](function(_0xb8c6e7){_0x244e86['or'](_0x6ae8('0x7f'),'%,'+_0xb8c6e7+',%');});_0x522618=_[_0x6ae8('0x80')](_0x522618,_0x93b90);break;case _0x6ae8('0x81'):if(_0x40a745[_0x6ae8('0x73')]===_0x6ae8('0x74')){_0x822173[_0x25b86c]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x40a745[_0x6ae8('0x75')]+'%',null);}else{_0x338aad=_[_0x6ae8('0x6e')](_0xd43cea,[_0x6ae8('0x31'),'UserId']);_0x40a745['field']=_0x6ae8('0x42');_0x50c1d4=as[_0x6ae8('0x7a')](_0x1f9b93,_0x338aad[_0x6ae8('0x7b')],_0x40a745);_0x822173[_0x25b86c](_0x50c1d4['text'],_0x50c1d4['value'][_0x6ae8('0x7d')],_0x50c1d4[_0x6ae8('0x75')][_0x6ae8('0x27')]);}break;case _0x6ae8('0x82'):_0x50c1d4=as[_0x6ae8('0x7a')]('me',null,_0x40a745);_0x822173[_0x25b86c](_0x50c1d4[_0x6ae8('0x7c')],_0x50c1d4[_0x6ae8('0x75')][_0x6ae8('0x7d')],_0x50c1d4[_0x6ae8('0x75')]['end']);break;}}else{var _0x50c1d4=as[_0x6ae8('0x7a')](_0x1f9b93,_0x338aad[_0x6ae8('0x7b')],_0x40a745);_0x822173[_0x25b86c](_0x50c1d4['text'],_0x50c1d4[_0x6ae8('0x75')][_0x6ae8('0x7d')],_0x50c1d4[_0x6ae8('0x75')][_0x6ae8('0x27')]);}}}else{var _0x2d644f=_(_0x4b603a[_0x6ae8('0x4c')])['keys']()[_0x6ae8('0x39')](function(_0x3d1c30){return _[_0x6ae8('0x83')](_0xd43cea,[_0x6ae8('0x31'),_0x3d1c30])?_0x3d1c30:undefined;})[_0x6ae8('0x84')]()[_0x6ae8('0x75')]();if(!_[_0x6ae8('0x85')](_0x2d644f)){_0x2d644f[_0x6ae8('0x3e')](function(_0x2b931d){if(_0x2b931d===_0x6ae8('0x86')){_0x465d3c[_0x6ae8('0x54')](_0x6ae8('0x87'),[]['concat'](_0x4b603a[_0x6ae8('0x4c')][_0x2b931d]));}else if(_0x2b931d===_0x6ae8('0x88')){var _0x75e5f7=JSON[_0x6ae8('0x89')](_0x4b603a[_0x6ae8('0x4c')][_0x2b931d])[_0x6ae8('0x8a')];var _0x2d7759=JSON['parse'](_0x4b603a[_0x6ae8('0x4c')][_0x2b931d])['$lte'];_0x465d3c['where'](_0x6ae8('0x8b'),_0x75e5f7,_0x2d7759);}else{if(_0x4b603a[_0x6ae8('0x4c')][_0x2b931d]==='null'){_0x465d3c[_0x6ae8('0x54')]('i.'+_0x2b931d+'\x20IS\x20NULL');}else{_0x465d3c['where']('i.'+_0x2b931d+'\x20=\x20?',_0x4b603a[_0x6ae8('0x4c')][_0x2b931d]);}}});}if(_0x4b603a[_0x6ae8('0x4c')]['read']){if(_0x4b603a[_0x6ae8('0x4c')][_0x6ae8('0x8c')]==0x1){_0x465d3c[_0x6ae8('0x6f')](_0x6ae8('0x8d'));}else{_0x465d3c[_0x6ae8('0x6f')](_0x6ae8('0x8e'));}}if(_0x4b603a[_0x6ae8('0x4c')][_0x6ae8('0x8f')]){_0x522618=_[_0x6ae8('0x90')](_0x4b603a[_0x6ae8('0x4c')]['tag'])?_0x4b603a['query'][_0x6ae8('0x8f')]:new Array(_0x4b603a[_0x6ae8('0x4c')]['tag']);_0x522618[_0x6ae8('0x3e')](function(_0x322a24){_0x244e86['or'](_0x6ae8('0x7f'),'%,'+_0x322a24+',%');});}if(_0x4b603a[_0x6ae8('0x4c')][_0x6ae8('0x91')]){var _0x388b65=_0x4b603a['query'][_0x6ae8('0x91')][_0x6ae8('0x92')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x6ae8('0x93')](_0x388b65)){_0x822173['or'](_0x6ae8('0x94'),_0x388b65+'%');}else{_0x822173['or'](_0x6ae8('0x95'),qs[_0x6ae8('0x77')](_0x388b65))['or'](_0x6ae8('0x96'),_0x388b65+'%');}}}_0x465d3c[_0x6ae8('0x54')](_0x822173);_0x465d3c[_0x6ae8('0x97')](_0x6ae8('0x98'));var _0x4d5ee1={'type':db[_0x6ae8('0x99')][_0x6ae8('0x9a')][_0x6ae8('0x9b')],'raw':!![]};var _0x1e6af5=_0x465d3c['clone']();_0x1e6af5[_0x6ae8('0x57')](_0x6ae8('0x98'));_0x1e6af5[_0x6ae8('0x57')](_0x6ae8('0x9c'),_0x6ae8('0x9d'));if(_0x4f2f67['order']){_0x4f2f67[_0x6ae8('0x52')][_0x6ae8('0x3e')](function(_0x590334){var _0x329300=_0x590334[0x0]===_0x6ae8('0x9e')?_0x590334[0x0]:'i.'+_0x590334[0x0];_0x465d3c[_0x6ae8('0x52')](_0x329300,_0x590334[0x1]===_0x6ae8('0x9f')?![]:!![]);});}if(!_[_0x6ae8('0x85')](_0x522618)){_0x465d3c[_0x6ae8('0x6f')](_0x244e86);_0x1e6af5[_0x6ae8('0x54')]('t.id\x20IN\x20?',_0x522618);}BPromise[_0x6ae8('0xa0')]()['then'](function(){if(!_0x3e57e3){if(_0x4b603a[_0x6ae8('0x4c')][_0x6ae8('0x86')])return;_0x1e6af5[_0x6ae8('0x54')](_0x6ae8('0xa1'));_0x465d3c[_0x6ae8('0x54')](_0x6ae8('0xa1'));return;}if(_0x4b603a['user']['role']!==_0x6ae8('0x36'))return;return _0x4b603a[_0x6ae8('0xa2')][_0x6ae8('0xa3')]({'attributes':['id'],'raw':!![]})['then'](function(_0x401662){if(_[_0x6ae8('0x85')](_0x401662)){_0x1e6af5[_0x6ae8('0x54')](_0x6ae8('0xa4'));_0x465d3c[_0x6ae8('0x54')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x1e6af5['where']('i.ChatWebsiteId\x20IN\x20?',_[_0x6ae8('0x39')](_0x401662,'id'));_0x465d3c[_0x6ae8('0x54')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x401662,'id'));}});})[_0x6ae8('0x30')](function(){if(_0x4b603a['user'][_0x6ae8('0xa5')]==='agent'&&!_0x3e57e3&&!_0x4b603a[_0x6ae8('0x4c')]['ChatWebsiteId'])return[];return db['sequelize'][_0x6ae8('0x4c')](_0x1e6af5[_0x6ae8('0xa6')](),_0x4d5ee1);})[_0x6ae8('0x30')](function(_0x42e0f8){_0x19a513[_0x6ae8('0xa7')]=_0x42e0f8[_0x6ae8('0x50')];if(_0x19a513[_0x6ae8('0xa7')]===0x0)return[];return db[_0x6ae8('0xa8')][_0x6ae8('0x4c')](_0x321eda[_0x6ae8('0xa6')](),_0x4d5ee1)[_0x6ae8('0x30')](function(_0x4d86be){_0x5844ce=_[_0x6ae8('0xa9')](_0x4d86be,'id');_0x4d5ee1=_[_0x6ae8('0x34')](_0x4d5ee1,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4b603a[_0x6ae8('0x4c')]['fields']){_0x4f2f67[_0x6ae8('0x4e')]['forEach'](function(_0x331a3d){_0x465d3c[_0x6ae8('0x57')]('i.'+_0x331a3d);});}else{_0x465d3c[_0x6ae8('0x57')](_0x6ae8('0x9c'),_0x6ae8('0x9d'));_0x465d3c['field'](_0x6ae8('0xaa'),_0x6ae8('0xab'));_0x465d3c[_0x6ae8('0x57')](_0x6ae8('0xac'),'Account.mandatoryDisposition');_0x465d3c['field'](_0x6ae8('0xad'),_0x6ae8('0x9e'));_0x465d3c['field'](_0x6ae8('0xae'));_0x465d3c[_0x6ae8('0x57')]('c.firstName','Contact.firstName');_0x465d3c[_0x6ae8('0x57')](_0x6ae8('0xaf'),_0x6ae8('0xb0'));_0x465d3c[_0x6ae8('0x57')]('c.email','Contact.email');_0x465d3c[_0x6ae8('0x57')]('c.phone',_0x6ae8('0xb1'));_0x465d3c[_0x6ae8('0x57')]('c.mobile',_0x6ae8('0xb2'));_0x465d3c[_0x6ae8('0x57')](_0x6ae8('0xb3'),_0x6ae8('0xb4'));_0x465d3c[_0x6ae8('0x57')](_0x6ae8('0xb5'),_0x6ae8('0xb6'));_0x465d3c[_0x6ae8('0x57')](_0x6ae8('0xb7'),_0x6ae8('0xb8'));_0x465d3c[_0x6ae8('0x57')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x6ae8('0x3b'));}if(_0x4f2f67[_0x6ae8('0x2b')])_0x465d3c[_0x6ae8('0x2b')](_0x4f2f67[_0x6ae8('0x2b')]);if(_0x4f2f67[_0x6ae8('0x29')])_0x465d3c['offset'](_0x4f2f67[_0x6ae8('0x29')]);return db[_0x6ae8('0xa8')]['query'](_0x465d3c[_0x6ae8('0xa6')](),_0x4d5ee1);})[_0x6ae8('0x30')](function(_0x4c31b7){if(_0x4c31b7[_0x6ae8('0x50')]>0x0)_0x2c6f9b[_0x6ae8('0x54')](_0x6ae8('0xb9'),_['map'](_0x4c31b7,'id'));return db[_0x6ae8('0xa8')][_0x6ae8('0x4c')](_0x2c6f9b[_0x6ae8('0xa6')](),_0x4d5ee1)[_0x6ae8('0x30')](function(_0x12ffa9){var _0x156cca=_['groupBy'](_0x12ffa9,_0x6ae8('0xba'));var _0x4fe4c7=[];_0x4c31b7[_0x6ae8('0x3e')](function(_0x59d62e){_0x4fe4c7[_0x6ae8('0xbb')](updateChatInteraction(_0x59d62e,_0x5844ce,_0x156cca));});return BPromise['all'](_0x4fe4c7);});});})['then'](function(_0x28b04f){_0x19a513[_0x6ae8('0xbc')]=_0x28b04f;return _0x19a513;})[_0x6ae8('0x30')](respondWithFilteredResult(_0x4aae33,_0x4f2f67))[_0x6ae8('0x24')](handleError(_0x4aae33,null));};exports[_0x6ae8('0xbd')]=function(_0x17f8cf,_0x353740){var _0x4e48dc={'raw':![],'where':{'id':_0x17f8cf[_0x6ae8('0xbe')]['id']}},_0x3216c4={};_0x3216c4[_0x6ae8('0x4b')]=_[_0x6ae8('0xbf')](db[_0x6ae8('0xc0')][_0x6ae8('0x49')]);_0x3216c4[_0x6ae8('0x4c')]=_[_0x6ae8('0xbf')](_0x17f8cf[_0x6ae8('0x4c')]);_0x3216c4['filters']=_[_0x6ae8('0xc1')](_0x3216c4[_0x6ae8('0x4b')],_0x3216c4[_0x6ae8('0x4c')]);_0x4e48dc['attributes']=_['intersection'](_0x3216c4[_0x6ae8('0x4b')],qs['fields'](_0x17f8cf['query']['fields']));_0x4e48dc[_0x6ae8('0x4e')]=_0x4e48dc['attributes'][_0x6ae8('0x50')]?_0x4e48dc['attributes']:_0x3216c4[_0x6ae8('0x4b')];if(_0x17f8cf['query'][_0x6ae8('0xc2')]){_0x4e48dc[_0x6ae8('0xc3')]=[{'all':!![]}];}_0x4e48dc=_[_0x6ae8('0x34')]({},_0x4e48dc,_0x17f8cf[_0x6ae8('0xc4')]);return db[_0x6ae8('0xc0')][_0x6ae8('0x6e')](_0x4e48dc)[_0x6ae8('0x30')](handleEntityNotFound(_0x353740,null))['then'](respondWithResult(_0x353740,null))[_0x6ae8('0x24')](handleError(_0x353740,null));};exports[_0x6ae8('0xc5')]=function(_0xccbb28,_0x1a8c0f){return db[_0x6ae8('0xc0')][_0x6ae8('0xc5')](_0xccbb28[_0x6ae8('0x82')],{})['then'](respondWithResult(_0x1a8c0f,0xc9))[_0x6ae8('0x24')](handleError(_0x1a8c0f,null));};exports[_0x6ae8('0xc6')]=function(_0xf53598,_0x1565bb){if(_0xf53598[_0x6ae8('0x82')]['id']){delete _0xf53598[_0x6ae8('0x82')]['id'];}return db[_0x6ae8('0xc0')][_0x6ae8('0x6e')]({'where':{'id':_0xf53598[_0x6ae8('0xbe')]['id']}})[_0x6ae8('0x30')](handleEntityNotFound(_0x1565bb,null))[_0x6ae8('0x30')](saveUpdates(_0xf53598[_0x6ae8('0x82')],null))['then'](respondWithResult(_0x1565bb,null))[_0x6ae8('0x24')](handleError(_0x1565bb,null));};exports[_0x6ae8('0xc7')]=function(_0x4b93bd,_0x232b88){return db[_0x6ae8('0xc0')][_0x6ae8('0x6e')]({'where':{'id':_0x4b93bd['params']['id']}})[_0x6ae8('0x30')](handleEntityNotFound(_0x232b88,null))[_0x6ae8('0x30')](removeEntity(_0x232b88,null))['catch'](handleError(_0x232b88,null));};exports[_0x6ae8('0xc8')]=function(_0x3d3be6,_0x24ee21){return db['ChatInteraction'][_0x6ae8('0xc8')]()[_0x6ae8('0x30')](respondWithResult(_0x24ee21,null))[_0x6ae8('0x24')](handleError(_0x24ee21,null));};exports[_0x6ae8('0xc9')]=function(_0x1e7a7f,_0x2db673){var _0x5e0828=_0x1e7a7f[_0x6ae8('0xbe')]['id'];var _0x44477d;var _0x15a1a1;var _0x2553fa;return db[_0x6ae8('0xc0')][_0x6ae8('0xca')]({'where':{'id':_0x5e0828}})[_0x6ae8('0x30')](function(_0x63534c){_0x44477d=_0x63534c;return db['ChatWebsite'][_0x6ae8('0xca')]({'where':{'id':_0x63534c['ChatWebsiteId']},'attributes':['id',_0x6ae8('0xcb'),'vidaooEscalation',_0x6ae8('0xcc'),_0x6ae8('0xcd'),_0x6ae8('0xce')],'raw':!![]});})[_0x6ae8('0x30')](function(_0x510d7f){if(_0x510d7f&&_0x510d7f[_0x6ae8('0xcb')]&&_0x510d7f[_0x6ae8('0xcf')]){_0x15a1a1=_0x510d7f;var _0x54a0e6={'interaction':{'id':_0x5e0828},'agent':{'id':_0x1e7a7f[_0x6ae8('0xa2')]['id'],'name':_0x1e7a7f[_0x6ae8('0xa2')][_0x6ae8('0x31')],'fullname':_0x1e7a7f[_0x6ae8('0xa2')][_0x6ae8('0x3a')],'email':_0x1e7a7f['user'][_0x6ae8('0xd0')]},'contact':_0x1e7a7f['body'][_0x6ae8('0x35')],'account':_0x1e7a7f[_0x6ae8('0x82')][_0x6ae8('0x38')]};var _0xd17272={'rejectUnauthorized':![],'method':'POST','url':_0x6ae8('0xd1'),'headers':{'X-APIKEY':_0x510d7f[_0x6ae8('0xcb')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1e7a7f[_0x6ae8('0xa2')]['email']],'buttons':null,'topic':_0x15a1a1['vidaooTopic'],'note':_[_0x6ae8('0xd2')](_0x15a1a1[_0x6ae8('0xcd')])?null:getMustacheRender(_0x15a1a1[_0x6ae8('0xcd')],_0x54a0e6),'metadata':null},'redirect':_0x6ae8('0xd3'),'json':!![]};try{if(!_[_0x6ae8('0xd2')](_0x15a1a1['vidaooMetadata'])){var _0x69a602=getMustacheRender(_0x15a1a1['vidaooMetadata'],_0x54a0e6);var _0x2c47d9=JSON[_0x6ae8('0x89')](_0x69a602);_0xd17272[_0x6ae8('0x82')][_0x6ae8('0xd4')]=_0x2c47d9;}}catch(_0x45c417){throw new db['Sequelize'][(_0x6ae8('0xd5'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0xd17272);}else{throw new db[(_0x6ae8('0x99'))][(_0x6ae8('0xd5'))](_0x6ae8('0xd6'));}})[_0x6ae8('0x30')](function(_0x5b5a2b){_0x2553fa=_0x5b5a2b;if(_0x2553fa['id']){var _0x2a1276={'body':_0x2553fa[_0x6ae8('0xd7')],'ChatWebsiteId':_0x15a1a1['id'],'ChatInteractionId':_0x44477d['id'],'direction':'out','UserId':_0x1e7a7f['user']['id']};return db[_0x6ae8('0xd8')]['create'](_0x2a1276,{});}else{throw new db['Sequelize'][(_0x6ae8('0xd5'))](_0x6ae8('0xd9'));}})['then'](function(){return _0x44477d['updateAttributes']({'vidaooSessionId':_0x2553fa['id']});})[_0x6ae8('0x30')](respondWithResult(_0x2db673,null))['catch'](handleError(_0x2db673,null));};exports[_0x6ae8('0xda')]=function(_0x2f88c9,_0x5f4c43){if(_0x2f88c9[_0x6ae8('0x82')]['id']){delete _0x2f88c9[_0x6ae8('0x82')]['id'];}return db[_0x6ae8('0xc0')][_0x6ae8('0x6e')]({'where':{'id':_0x2f88c9[_0x6ae8('0xbe')]['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0x6ae8('0x30')](handleEntityNotFound(_0x5f4c43,null))[_0x6ae8('0x30')](saveUpdates(_0x2f88c9[_0x6ae8('0x82')],null))[_0x6ae8('0x30')](respondWithResult(_0x5f4c43,null))[_0x6ae8('0x24')](handleError(_0x5f4c43,null));};exports[_0x6ae8('0xdb')]=function(_0x3a42f4,_0x25c7f4,_0xf29491){if(_0x3a42f4['body']['id']){delete _0x3a42f4['body']['id'];}return db[_0x6ae8('0xc0')][_0x6ae8('0x6e')]({'where':{'id':_0x3a42f4[_0x6ae8('0xbe')]['id']}})['then'](function(_0x1b2468){if(!_0x1b2468){logger[_0x6ae8('0x20')](_0x6ae8('0xdc'),_0x6ae8('0xdb'),0x194,_0x6ae8('0xdd'));_0x25c7f4[_0x6ae8('0x25')](0x194);}else{if(_0x1b2468[_0x6ae8('0x42')]){throw new db[(_0x6ae8('0x99'))][(_0x6ae8('0xd5'))](_0x6ae8('0xde'));}}return _0x1b2468;})[_0x6ae8('0x30')](function(_0xb8e677){if(_0xb8e677){return _0xb8e677[_0x6ae8('0xc6')]({'closed':_0x3a42f4['body'][_0x6ae8('0x43')],'disposition':_0x3a42f4[_0x6ae8('0x82')][_0x6ae8('0x44')]})['then'](function(_0x51e545){return _0x51e545;});}})[_0x6ae8('0x30')](function(_0x57d19c){return respondWithRpcPromise(_0x6ae8('0xdf'),'abandon',_0x3a42f4[_0x6ae8('0x82')],client9004);})[_0x6ae8('0x30')](respondWithResult(_0x25c7f4,null))['catch'](handleError(_0x25c7f4,null));};exports[_0x6ae8('0xe0')]=function(_0xa9c6ce,_0x1ebd34,_0x4e6dc9){_0xa9c6ce[_0x6ae8('0x82')][_0x6ae8('0x31')]=_0xa9c6ce['file'][_0x6ae8('0xe1')];_0xa9c6ce['body'][_0x6ae8('0xe2')]=_0xa9c6ce[_0x6ae8('0xe3')]['filename'];_0xa9c6ce[_0x6ae8('0x82')][_0x6ae8('0x7b')]=_0xa9c6ce[_0x6ae8('0xe3')][_0x6ae8('0xe4')];return db[_0x6ae8('0xe5')][_0x6ae8('0xc5')](_0xa9c6ce[_0x6ae8('0x82')])[_0x6ae8('0x30')](respondWithResult(_0x1ebd34,0xc9))[_0x6ae8('0x24')](handleError(_0x1ebd34,null));};exports[_0x6ae8('0xe6')]=function(_0x124fa6,_0x1879b9,_0x59da3a){return db['ChatInteraction'][_0x6ae8('0xca')]({'where':{'id':_0x124fa6[_0x6ae8('0xbe')]['id']},'raw':!![]})[_0x6ae8('0x30')](handleEntityNotFound(_0x1879b9,null))['then'](function(_0x100969){if(_0x100969){if(_0x100969[_0x6ae8('0x43')]){return _0x1879b9[_0x6ae8('0x26')](0x193)[_0x6ae8('0x28')]({'status':0x193,'message':_0x6ae8('0xe7')});}return db[_0x6ae8('0xe5')][_0x6ae8('0xca')]({'where':{'id':_0x124fa6[_0x6ae8('0x4c')][_0x6ae8('0xe8')]},'raw':!![]})['then'](handleEntityNotFound(_0x1879b9,null));}})['then'](function(_0x482a9c){if(_0x482a9c){var _0x223efa=_0x482a9c['ChatOfflineMessageId']!==null;var _0x4f2a5e=path['join'](config['root'],_0x6ae8('0xe9'));if(_0x223efa){_0x4f2a5e=path['join'](_0x4f2a5e,_0x6ae8('0xea'));}var _0x223c4c=path[_0x6ae8('0xeb')](_0x4f2a5e,_0x482a9c['basename']);return _0x1879b9['download'](_0x223c4c);}})[_0x6ae8('0x24')](handleError(_0x1879b9,null));};exports[_0x6ae8('0xec')]=function(_0x2bf393,_0x14a0d2){var _0xab9903=null;var _0xb937ca=null;var _0x3d50ac=null;var _0x1600a8=null;if(_0x2bf393[_0x6ae8('0x82')]['id']){delete _0x2bf393['body']['id'];}if(_0x2bf393[_0x6ae8('0x82')][_0x6ae8('0xed')]){_0x1600a8=path[_0x6ae8('0xeb')](config['root'],_0x6ae8('0xee'),util[_0x6ae8('0xef')](_0x6ae8('0xf0'),Date[_0x6ae8('0xf1')]()));_0x2bf393[_0x6ae8('0x82')][_0x6ae8('0xf2')]=_0x1600a8;}return db[_0x6ae8('0xc0')][_0x6ae8('0x6e')]({'where':{'id':_0x2bf393[_0x6ae8('0xbe')]['id']},'include':[{'model':db[_0x6ae8('0xd8')],'as':_0x6ae8('0xf3'),'include':[{'model':db[_0x6ae8('0x81')],'as':_0x6ae8('0x81')}]}]})[_0x6ae8('0x30')](handleEntityNotFound(_0x14a0d2,null))[_0x6ae8('0x30')](saveUpdates(_0x2bf393[_0x6ae8('0x82')],null))[_0x6ae8('0x30')](function(_0x4a8355){if(_0x4a8355){_0xab9903=_0x4a8355;return db[_0x6ae8('0xf4')][_0x6ae8('0x6e')]({'where':{'id':_0xab9903[_0x6ae8('0x86')]}});}})[_0x6ae8('0x30')](function(_0x429613){if(_0x429613){_0x3d50ac=_0x429613;return db[_0x6ae8('0xf5')][_0x6ae8('0x6e')]({'where':{'id':_0xab9903[_0x6ae8('0x79')]}});}})[_0x6ae8('0x30')](function(_0x174b01){if(_0x174b01){_0xb937ca=_0x174b01;if(_0x1600a8){var _0x1522a9=null;for(var _0x308dae=0x1;_0x308dae<_0xab9903[_0x6ae8('0xf3')][_0x6ae8('0x50')];++_0x308dae){_0x1522a9=_0xab9903[_0x6ae8('0xf3')][_0x308dae];var _0x4df4fd=_0x1522a9[_0x6ae8('0x42')]?util[_0x6ae8('0xef')]('%s%d',_0x3d50ac[_0x6ae8('0xf6')],_0x1522a9[_0x6ae8('0x42')]):'System';var _0x18ce16=_0x2bf393[_0x6ae8('0x82')]['customer']||util[_0x6ae8('0xef')](_0x6ae8('0xf7'),_0x6ae8('0xf8'),_0x1522a9[_0x6ae8('0x79')]);switch(_0x3d50ac['agentIdentifier']){case'website_alias':_0x4df4fd=_0x1522a9['UserId']?util[_0x6ae8('0xef')](_0x6ae8('0xf7'),_0x3d50ac['agentAlias'],_0x1522a9['UserId']):_0x6ae8('0xf9');break;case'agent_alias':_0x4df4fd=_0x1522a9['UserId']?_0x1522a9[_0x6ae8('0x81')]['alias']||_0x1522a9[_0x6ae8('0x81')][_0x6ae8('0x3a')]:_0x6ae8('0xf9');break;case _0x6ae8('0xfa'):_0x4df4fd=_0x1522a9[_0x6ae8('0x42')]?_0x1522a9[_0x6ae8('0x81')]['fullname']:_0x6ae8('0xf9');break;default:_0x4df4fd=_0x1522a9['UserId']?util[_0x6ae8('0xef')](_0x6ae8('0xf7'),_0x3d50ac['agentAlias'],_0x1522a9[_0x6ae8('0x42')]):_0x6ae8('0xf9');}var _0x32ad20=util[_0x6ae8('0xef')](_0x6ae8('0xfb'),moment(_0x1522a9[_0x6ae8('0x88')])[_0x6ae8('0xef')](_0x6ae8('0xfc')),_0x1522a9[_0x6ae8('0xfd')]==='in'?_0x18ce16:_0x4df4fd,_0x1522a9[_0x6ae8('0x82')]);if(!_0x1522a9[_0x6ae8('0xfe')]){fs[_0x6ae8('0xff')](_0x1600a8,_0x32ad20);}}return db[_0x6ae8('0x100')][_0x6ae8('0xca')]({'where':{'service':!![]},'include':[{'model':db[_0x6ae8('0x101')],'as':_0x6ae8('0x102'),'raw':!![]}]});}}})['then'](function(_0xba8458){if(_0xba8458&&_0xba8458[_0x6ae8('0x102')]&&_0x2bf393[_0x6ae8('0x82')]){var _0x32d510={'tls':{'rejectUnauthorized':![]}};if(_0xba8458[_0x6ae8('0x102')][_0x6ae8('0x103')]){_0x32d510['service']=_0xba8458[_0x6ae8('0x102')][_0x6ae8('0x103')];}else{_0x32d510[_0x6ae8('0x104')]=_0xba8458['Smtp'][_0x6ae8('0x104')];_0x32d510[_0x6ae8('0x105')]=_0xba8458[_0x6ae8('0x102')]['port'];_0x32d510[_0x6ae8('0x106')]=_0xba8458['Smtp'][_0x6ae8('0x106')];}if(_0xba8458[_0x6ae8('0x102')][_0x6ae8('0x107')]){_0x32d510[_0x6ae8('0x108')]={'user':_0xba8458[_0x6ae8('0x102')][_0x6ae8('0xa2')],'pass':_0xba8458[_0x6ae8('0x102')]['pass']};}return respondWithRpcPromise(_0x6ae8('0x109'),_0x6ae8('0x10a'),{'account':_0x32d510,'message':{'from':util[_0x6ae8('0xef')](_0x6ae8('0x10b'),_0xba8458[_0x6ae8('0x31')],_0xba8458['email']||_0xba8458['Smtp'][_0x6ae8('0xa2')]),'to':_0x2bf393['body'][_0x6ae8('0xed')],'subject':_0x6ae8('0x10c'),'text':util[_0x6ae8('0xef')](_0x6ae8('0x10d'),_0x2bf393[_0x6ae8('0x82')][_0x6ae8('0xed')]),'attachments':[{'path':_0x1600a8}]}})[_0x6ae8('0x30')](function(){return _0xab9903;})[_0x6ae8('0x24')](function(_0x3085c1){console['error'](_0x3085c1);});}else{return _0xab9903;}})[_0x6ae8('0x30')](respondWithStatusCode(_0x14a0d2,0xc8))[_0x6ae8('0x24')](handleError(_0x14a0d2,null));};exports[_0x6ae8('0x10e')]=function(_0xf2afa5,_0x2a86ef,_0x2d53d1){return db[_0x6ae8('0xd8')]['find']({'where':{'id':_0xf2afa5[_0x6ae8('0xbe')]['id']}})[_0x6ae8('0x30')](handleEntityNotFound(_0x2a86ef,null))[_0x6ae8('0x30')](function(_0x598f29){if(_0x598f29){return _0x598f29[_0x6ae8('0x10e')](_0xf2afa5[_0x6ae8('0x82')][_0x6ae8('0x10f')],_[_0x6ae8('0x110')](_0xf2afa5['body'],[_0x6ae8('0x10f'),'id'])||{});}})[_0x6ae8('0x30')](respondWithResult(_0x2a86ef,null))['catch'](handleError(_0x2a86ef,null));};exports[_0x6ae8('0x111')]=function(_0x10df22,_0x13ca70,_0xdc6758){var _0x27fb4e={'raw':![],'where':{}};var _0x43f618={};var _0x3e6fe1={'count':0x0,'rows':[]};return db[_0x6ae8('0xc0')][_0x6ae8('0xca')]({'where':{'id':_0x10df22[_0x6ae8('0xbe')]['id']}})['then'](handleEntityNotFound(_0x13ca70,null))[_0x6ae8('0x30')](function(_0xd5c5aa){if(_0xd5c5aa){_0x43f618[_0x6ae8('0x4b')]=_[_0x6ae8('0xbf')](db[_0x6ae8('0xd8')][_0x6ae8('0x49')]);_0x43f618[_0x6ae8('0x4c')]=_[_0x6ae8('0xbf')](_0x10df22[_0x6ae8('0x4c')]);_0x43f618[_0x6ae8('0x4d')]=_[_0x6ae8('0xc1')](_0x43f618[_0x6ae8('0x4b')],_0x43f618['query']);_0x27fb4e['attributes']=_['intersection'](_0x43f618[_0x6ae8('0x4b')],qs[_0x6ae8('0x4f')](_0x10df22[_0x6ae8('0x4c')][_0x6ae8('0x4f')]));_0x27fb4e[_0x6ae8('0x4e')]=_0x27fb4e[_0x6ae8('0x4e')]['length']?_0x27fb4e[_0x6ae8('0x4e')]:_0x43f618[_0x6ae8('0x4b')];if(!_0x10df22[_0x6ae8('0x4c')][_0x6ae8('0x112')](_0x6ae8('0x51'))){_0x27fb4e[_0x6ae8('0x2b')]=qs[_0x6ae8('0x2b')](_0x10df22['query'][_0x6ae8('0x2b')]);_0x27fb4e['offset']=qs[_0x6ae8('0x29')](_0x10df22[_0x6ae8('0x4c')][_0x6ae8('0x29')]);}_0x27fb4e['order']=qs[_0x6ae8('0x53')](_0x10df22['query'][_0x6ae8('0x53')]);_0x27fb4e['where']=qs[_0x6ae8('0x4d')](_[_0x6ae8('0x55')](_0x10df22['query'],_0x43f618[_0x6ae8('0x4d')]));_0x27fb4e[_0x6ae8('0x54')][_0x6ae8('0xba')]=_0xd5c5aa['id'];if(_0x10df22['query']['filter']){_0x27fb4e[_0x6ae8('0x54')]=_[_0x6ae8('0x34')](_0x27fb4e['where'],{'$or':_[_0x6ae8('0x39')](_0x27fb4e['attributes'],function(_0x33667b){var _0x28c4ba={};_0x28c4ba[_0x33667b]={'$like':'%'+_0x10df22[_0x6ae8('0x4c')][_0x6ae8('0x91')]+'%'};return _0x28c4ba;})});}if(_0x10df22[_0x6ae8('0x4c')]['$gte']){var _0x5be917=_0x10df22[_0x6ae8('0x4c')][_0x6ae8('0x8a')][_0x6ae8('0x3d')](',');var _0x3b5f5a={};_0x3b5f5a[_0x5be917[0x0]]={'$gte':moment(_0x5be917[0x1])[_0x6ae8('0xef')]('YYYY-MM-DD\x20HH:mm:ss')};_0x27fb4e[_0x6ae8('0x54')]=_['merge'](_0x27fb4e[_0x6ae8('0x54')],_0x3b5f5a);}_0x27fb4e=_['merge']({},_0x27fb4e,_0x10df22['options']);return db[_0x6ae8('0xd8')][_0x6ae8('0xa7')]({'where':_0x27fb4e[_0x6ae8('0x54')]})[_0x6ae8('0x30')](function(_0xfd7deb){_0x3e6fe1[_0x6ae8('0xa7')]=_0xfd7deb;if(_0x10df22[_0x6ae8('0x4c')][_0x6ae8('0xc2')]){_0x27fb4e[_0x6ae8('0xc3')]=[{'all':!![]}];}return db['ChatMessage'][_0x6ae8('0x113')](_0x27fb4e);})[_0x6ae8('0x30')](function(_0x5793b8){_0x3e6fe1[_0x6ae8('0xbc')]=_0x5793b8;return _0x3e6fe1;});}})[_0x6ae8('0x30')](respondWithFilteredResult(_0x13ca70,_0x27fb4e))[_0x6ae8('0x24')](handleError(_0x13ca70,null));};exports[_0x6ae8('0x114')]=function(_0x36fe9d,_0x324f65,_0xc7bae2){var _0x3fb406={'where':{}},_0x3e60e3={},_0x338449={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x6ae8('0xca')]({'where':{'id':_0x36fe9d['params']['id']}})[_0x6ae8('0x30')](handleEntityNotFound(_0x324f65,null))['then'](function(_0x1d3f96){if(_0x1d3f96){_0x3e60e3['model']=_['keys'](db[_0x6ae8('0xd8')]['rawAttributes']);_0x3e60e3[_0x6ae8('0x4c')]=_['keys'](_0x36fe9d[_0x6ae8('0x4c')]);_0x3e60e3[_0x6ae8('0x4d')]=_[_0x6ae8('0xc1')](_0x3e60e3[_0x6ae8('0x4b')],_0x3e60e3[_0x6ae8('0x4c')]);_0x3fb406[_0x6ae8('0x4e')]=_[_0x6ae8('0xc1')](_0x3e60e3[_0x6ae8('0x4b')],qs[_0x6ae8('0x4f')](_0x36fe9d[_0x6ae8('0x4c')][_0x6ae8('0x4f')]));_0x3fb406[_0x6ae8('0x4e')]=_0x3fb406[_0x6ae8('0x4e')][_0x6ae8('0x50')]?_0x3fb406['attributes']:_0x3e60e3[_0x6ae8('0x4b')];if(!_0x36fe9d[_0x6ae8('0x4c')]['hasOwnProperty']('nolimit')){_0x3fb406[_0x6ae8('0x2b')]=qs[_0x6ae8('0x2b')](_0x36fe9d[_0x6ae8('0x4c')]['limit']);_0x3fb406[_0x6ae8('0x29')]=qs['offset'](_0x36fe9d[_0x6ae8('0x4c')][_0x6ae8('0x29')]);}_0x3fb406[_0x6ae8('0x52')]=qs['sort'](_0x36fe9d[_0x6ae8('0x4c')][_0x6ae8('0x53')]);_0x3fb406[_0x6ae8('0x54')]=qs[_0x6ae8('0x4d')](_[_0x6ae8('0x55')](_0x36fe9d[_0x6ae8('0x4c')],_0x3e60e3[_0x6ae8('0x4d')]));_0x3fb406[_0x6ae8('0x54')][_0x6ae8('0xba')]=_0x1d3f96['id'];if(_0x36fe9d[_0x6ae8('0x4c')][_0x6ae8('0x91')]){_0x3fb406[_0x6ae8('0x54')]=_['merge'](_0x3fb406['where'],{'$or':_[_0x6ae8('0x39')](_0x3fb406[_0x6ae8('0x4e')],function(_0x447b71){var _0x4861b0={};_0x4861b0[_0x447b71]={'$like':'%'+_0x36fe9d[_0x6ae8('0x4c')][_0x6ae8('0x91')]+'%'};return _0x4861b0;})});}_0x3fb406[_0x6ae8('0x54')][_0x6ae8('0xfe')]=![];if(_0x36fe9d[_0x6ae8('0x4c')]['id']){_0x3fb406['where']['id']={'$gt':_0x36fe9d[_0x6ae8('0x4c')]['id']};}_0x3fb406=_[_0x6ae8('0x34')]({},_0x3fb406,_0x36fe9d[_0x6ae8('0xc4')]);return db[_0x6ae8('0xd8')]['count']({'where':_0x3fb406[_0x6ae8('0x54')]})['then'](function(_0xf048cd){_0x338449[_0x6ae8('0xa7')]=_0xf048cd;_0x3fb406[_0x6ae8('0xc3')]=[];if(_0x36fe9d[_0x6ae8('0x4c')][_0x6ae8('0x115')]){_0x3fb406[_0x6ae8('0xc3')][_0x6ae8('0xbb')]({'model':db[_0x6ae8('0x81')],'as':_0x6ae8('0x81'),'attributes':['id',_0x6ae8('0x3a'),_0x6ae8('0x116')]});}if(_0x36fe9d[_0x6ae8('0x4c')]['includeAll']){_0x3fb406[_0x6ae8('0xc3')]=[{'all':!![]}];}return db['ChatMessage'][_0x6ae8('0x113')](_0x3fb406);})[_0x6ae8('0x30')](function(_0x468bc9){_0x338449['rows']=_0x468bc9;return _0x338449;});}})[_0x6ae8('0x30')](respondWithFilteredResult(_0x324f65,_0x3fb406))[_0x6ae8('0x24')](handleError(_0x324f65,null));};exports['addTags']=function(_0x3a29d9,_0x167a6c,_0x1ba72f){return db[_0x6ae8('0xc0')][_0x6ae8('0x6e')]({'where':{'id':_0x3a29d9[_0x6ae8('0xbe')]['id']}})['then'](handleEntityNotFound(_0x167a6c,null))['then'](function(_0x1976f2){if(_0x1976f2){return _0x1976f2[_0x6ae8('0x117')](_0x3a29d9[_0x6ae8('0x82')][_0x6ae8('0x10f')],_['omit'](_0x3a29d9[_0x6ae8('0x82')],[_0x6ae8('0x10f'),'id'])||{})[_0x6ae8('0x118')](function(){return db[_0x6ae8('0x7e')]['findAll']({'attributes':['id',_0x6ae8('0x31'),_0x6ae8('0x58')],'where':{'id':_0x3a29d9['body']['ids']}});})[_0x6ae8('0x30')](function(_0x9228b3){socket[_0x6ae8('0x119')](_0x6ae8('0x11a'),{'id':Number(_0x3a29d9[_0x6ae8('0xbe')]['id']),'tags':_0x9228b3||[]});return{'id':Number(_0x3a29d9[_0x6ae8('0xbe')]['id']),'tags':_0x9228b3||[]};});}})[_0x6ae8('0x30')](respondWithResult(_0x167a6c,null))[_0x6ae8('0x24')](handleError(_0x167a6c,null));};exports[_0x6ae8('0x11b')]=function(_0x266568,_0x4aaed8,_0x431403){return db[_0x6ae8('0xc0')]['find']({'where':{'id':_0x266568['params']['id']}})[_0x6ae8('0x30')](handleEntityNotFound(_0x4aaed8,null))['then'](function(_0x18f638){if(_0x18f638){return _0x18f638[_0x6ae8('0x11b')](_0x266568[_0x6ae8('0x4c')][_0x6ae8('0x10f')]);}})[_0x6ae8('0x30')](respondWithStatusCode(_0x4aaed8,null))[_0x6ae8('0x24')](handleError(_0x4aaed8,null));};exports[_0x6ae8('0x11c')]=function(_0x387fad,_0x49911e){var _0x228d6b=moment()['unix']()[_0x6ae8('0xa6')]();var _0x5dcbd8=path[_0x6ae8('0xeb')](config[_0x6ae8('0x11d')],_0x6ae8('0x11e'),'files',_0x6ae8('0x11f'));var _0x5ec49b=path[_0x6ae8('0xeb')](config[_0x6ae8('0x11d')],_0x6ae8('0x11e'),'files',_0x6ae8('0x120'));var _0x327593=path[_0x6ae8('0xeb')](_0x5dcbd8,_0x228d6b);var _0x37b5ca=util[_0x6ae8('0xef')]('transcript-%d-%s.zip',_0x387fad['params']['id'],_0x228d6b);var _0x1ea845=path['join'](_0x5dcbd8,_0x37b5ca);var _0x73d06c=[];_0x73d06c[_0x6ae8('0xbb')]({'model':db[_0x6ae8('0x81')],'as':_0x6ae8('0x81'),'attributes':['id',_0x6ae8('0x3a')],'raw':!![]});_0x73d06c[_0x6ae8('0xbb')]({'model':db[_0x6ae8('0xf5')],'as':_0x6ae8('0x72'),'attributes':['id',_0x6ae8('0x121'),'lastName'],'raw':!![]});if(_0x387fad[_0x6ae8('0x4c')][_0x6ae8('0x120')]){_0x73d06c[_0x6ae8('0xbb')]({'model':db[_0x6ae8('0xe5')],'as':_0x6ae8('0xe5'),'raw':!![]});}var _0x47dd12=[{'model':db[_0x6ae8('0xd8')],'as':_0x6ae8('0xf3'),'attributes':['id','body',_0x6ae8('0x88'),_0x6ae8('0xfd'),_0x6ae8('0xfe'),_0x6ae8('0x8c')],'include':_0x73d06c}];_0x47dd12[_0x6ae8('0xbb')]({'model':db[_0x6ae8('0xf4')],'as':_0x6ae8('0x122'),'attributes':['id',_0x6ae8('0x31')]});_0x47dd12[_0x6ae8('0xbb')]({'model':db['User'],'as':_0x6ae8('0x123'),'attributes':['id',_0x6ae8('0x3a')]});return db[_0x6ae8('0xc0')][_0x6ae8('0x6e')]({'where':{'id':_0x387fad[_0x6ae8('0xbe')]['id']},'include':_0x47dd12})[_0x6ae8('0x30')](handleEntityNotFound(_0x49911e,null))[_0x6ae8('0x30')](function(_0x124bf3){if(_0x124bf3){var _0x12b28c=_0x124bf3['get']({'plain':!![]});fs[_0x6ae8('0x124')](_0x327593);var _0x5194f1={'channel':'Chat','account':_0x12b28c[_0x6ae8('0x122')]['name'],'agent':_0x12b28c['Owner']?_0x12b28c[_0x6ae8('0x123')]['fullname']:'N.A.','createdAt':moment(_0x12b28c[_0x6ae8('0x88')])['format'](_0x6ae8('0x125'))[_0x6ae8('0xa6')](),'closedAt':_0x12b28c[_0x6ae8('0x43')]?moment(_0x12b28c['closedAt'])['format'](_0x6ae8('0x125'))[_0x6ae8('0xa6')]():'','disposition':_0x12b28c[_0x6ae8('0x44')],'chatInfo':{'browser':_0x12b28c[_0x6ae8('0x126')],'os':_0x12b28c[_0x6ae8('0x127')],'referer':_0x12b28c['referer'],'customerIp':_0x12b28c[_0x6ae8('0x128')],'customerPort':_0x12b28c[_0x6ae8('0x129')]?_0x12b28c[_0x6ae8('0x129')]:_0x6ae8('0x12a')},'messages':_(_0x12b28c['Messages'])[_0x6ae8('0x12b')]()[_0x6ae8('0x91')]({'secret':![]})[_0x6ae8('0x39')](function(_0x275201){if(_0x275201['Attachment']){var _0x5eef4e=path[_0x6ae8('0xeb')](_0x5ec49b,_0x275201[_0x6ae8('0xe5')][_0x6ae8('0xe2')]);if(fs[_0x6ae8('0x12c')](_0x5eef4e)){fs[_0x6ae8('0x12d')](_0x5eef4e)[_0x6ae8('0x12e')](fs[_0x6ae8('0x12f')](path[_0x6ae8('0xeb')](_0x327593,_0x275201[_0x6ae8('0xe5')]['basename'])));}}return{'date':moment(_0x275201['createdAt'])[_0x6ae8('0xef')](_0x6ae8('0x125'))[_0x6ae8('0xa6')](),'sender':_0x275201[_0x6ae8('0xfd')]==='out'?_0x275201[_0x6ae8('0x81')]?_0x275201[_0x6ae8('0x81')][_0x6ae8('0x3a')]:_0x6ae8('0xf9'):_0x275201[_0x6ae8('0x72')]['firstName']+(_0x275201[_0x6ae8('0x72')][_0x6ae8('0x130')]?'\x20'+_0x275201['Contact'][_0x6ae8('0x130')]:''),'body':_0x275201['Attachment']?_0x275201[_0x6ae8('0xe5')][_0x6ae8('0xe2')]:_0x275201[_0x6ae8('0x82')],'direction':_0x275201[_0x6ae8('0xfd')]===_0x6ae8('0x131')?'A':'C','secret':_0x275201['secret'],'read':_0x275201[_0x6ae8('0x8c')],'attachment':_0x275201[_0x6ae8('0xe5')]};})[_0x6ae8('0x75')]()};return ejs[_0x6ae8('0x132')](path['join'](config['root'],_0x6ae8('0x11e'),_0x6ae8('0x133'),_0x6ae8('0x134')),{'interaction':_0x5194f1})[_0x6ae8('0x30')](function(_0xd0cf3c){var _0x3d5da2=path['join'](_0x327593,_0x6ae8('0x135')+_0x12b28c['id']+'-'+_0x228d6b+_0x6ae8('0x136'));var _0x41a369={'path':_0x3d5da2,'channel':'Chat','interactionId':_0x12b28c['id']};return pdf['createPdfFromHTML'](_0xd0cf3c,_0x41a369);})['then'](function(){return new BPromise(function(_0x38f673,_0x1303c3){zipdir(_0x327593,{'saveTo':_0x1ea845},function(_0x391903,_0x3f0e78){if(_0x391903)return _0x1303c3(_0x391903);return _0x38f673(_0x3f0e78);});})[_0x6ae8('0x30')](function(){return new BPromise(function(_0x4bab30,_0x32b9db){rimraf(_0x327593,function(_0x517484){if(_0x517484)_0x32b9db(_0x517484);return _0x4bab30();});});})[_0x6ae8('0x30')](function(){return _0x49911e[_0x6ae8('0x11c')](_0x1ea845,_0x37b5ca,function(_0x3822e4){if(_0x3822e4){console[_0x6ae8('0x137')](_0x6ae8('0x138'),_0x3822e4);}else{fs[_0x6ae8('0x139')](_0x1ea845);}});});});}else{return _0x49911e[_0x6ae8('0x25')](0xc8);}})[_0x6ae8('0x24')](handleError(_0x49911e,null));};
\ No newline at end of file
+var _0x6b2b=['pick','YYYY-MM-DD\x20HH:mm:ss','options','findAll','getMyMessages','includeAgent','spread','emit','chatInteractionTags:save','removeTags','server','files','tmp','transcript-%d-%s.zip','lastName','Account','Owner','get','Chat','osName','referer','N.A.','tail','existsSync','createReadStream','pipe','firstName','renderFile','views','downloadInteraction.ejs','.pdf','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','request\x20sent','debug','stringify','error','ChatInteraction,\x20%s,\x20%s','message','info','result','sendStatus','end','status','offset','limit','undefined','count','Content-Range','apply','reject','update','then','destroy','stack','name','render','merge','contact','interaction','Users','TagIds','Tags','split','forEach','push','catch','waiting','unmanaged','abandoned','total','UserId','talking','closed','disposition','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','field','color','from','tools_tags','select','u.fullname','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','conditions','find','unreadMessages','`\x20=\x200','having','`\x20>\x200','Contact','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','keys','some','compact','isEmpty','ChatWebsiteId','concat','createdAt','parse','$gte','$lte','null','\x20=\x20?','read','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','contactName','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','keyBy','ChatInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','params','includeAll','include','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','account','isNull','follow','metadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','create','customUpdate','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','originalname','filename','mimetype','Attachment','attachmentDownload','json','Unauthorized','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','basename','download','close','mailTranscript','root','format','now','pathTranscript','Messages','CmContact','agentAlias','customer','Visitor','agentIdentifier','%s%d','System','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','service','host','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0x6b2b,0x159));var _0xb6b2=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0x6b2b[_0x1abb09];return _0xea1c07;};'use strict';var emlformat=require(_0xb6b2('0x0'));var rimraf=require(_0xb6b2('0x1'));var zipdir=require(_0xb6b2('0x2'));var jsonpatch=require(_0xb6b2('0x3'));var rp=require(_0xb6b2('0x4'));var moment=require(_0xb6b2('0x5'));var BPromise=require(_0xb6b2('0x6'));var Mustache=require('mustache');var util=require(_0xb6b2('0x7'));var path=require(_0xb6b2('0x8'));var sox=require('sox');var csv=require(_0xb6b2('0x9'));var ejs=require(_0xb6b2('0xa'));var fs=require('fs');var fs_extra=require(_0xb6b2('0xb'));var _=require(_0xb6b2('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb6b2('0xd'));var toCsv=require(_0xb6b2('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb6b2('0xe'));var authService=require(_0xb6b2('0xf'));var qs=require(_0xb6b2('0x10'));var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0xb6b2('0x11'));var logger=require(_0xb6b2('0x12'))(_0xb6b2('0x13'));var utils=require(_0xb6b2('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xb6b2('0x15')]=_['defaults'](config['redis'],{'host':_0xb6b2('0x16'),'port':0x18eb});var socket=require(_0xb6b2('0x17'))(new Redis(config[_0xb6b2('0x15')]));require('./chatInteraction.socket')[_0xb6b2('0x18')](socket);var jayson=require(_0xb6b2('0x19'));var client=jayson[_0xb6b2('0x1a')][_0xb6b2('0x1b')]({'port':0x232b});var client9004=jayson[_0xb6b2('0x1a')][_0xb6b2('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x1df918,_0xf772c1,_0x3c404f,_0x486b34){return new BPromise(function(_0x4ad7d8,_0x190814){var _0x5de903=_0x486b34||client;return _0x5de903[_0xb6b2('0x1c')](_0x1df918,_0x3c404f)['then'](function(_0x559b69){logger['info']('ChatInteraction,\x20%s,\x20%s',_0xf772c1,_0xb6b2('0x1d'));logger[_0xb6b2('0x1e')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0xf772c1,_0xb6b2('0x1d'),JSON[_0xb6b2('0x1f')](_0x559b69));if(_0x559b69[_0xb6b2('0x20')]){if(_0x559b69[_0xb6b2('0x20')]['code']===0x1f4){logger[_0xb6b2('0x20')](_0xb6b2('0x21'),_0xf772c1,_0x559b69[_0xb6b2('0x20')][_0xb6b2('0x22')]);return _0x190814(_0x559b69[_0xb6b2('0x20')]['message']);}logger[_0xb6b2('0x20')](_0xb6b2('0x21'),_0xf772c1,_0x559b69[_0xb6b2('0x20')][_0xb6b2('0x22')]);return _0x4ad7d8(_0x559b69[_0xb6b2('0x20')][_0xb6b2('0x22')]);}else{logger[_0xb6b2('0x23')](_0xb6b2('0x21'),_0xf772c1,_0xb6b2('0x1d'));_0x4ad7d8(_0x559b69[_0xb6b2('0x24')][_0xb6b2('0x22')]);}})['catch'](function(_0x213fa6){logger[_0xb6b2('0x20')](_0xb6b2('0x21'),_0xf772c1,_0x213fa6);_0x190814(_0x213fa6);});});}function respondWithStatusCode(_0xa24596,_0xced468){_0xced468=_0xced468||0xcc;return function(_0x2609cf){if(_0x2609cf){return _0xa24596[_0xb6b2('0x25')](_0xced468);}return _0xa24596['status'](_0xced468)[_0xb6b2('0x26')]();};}function respondWithResult(_0x38e42b,_0x54d614){_0x54d614=_0x54d614||0xc8;return function(_0x4586e2){if(_0x4586e2){return _0x38e42b[_0xb6b2('0x27')](_0x54d614)['json'](_0x4586e2);}};}function respondWithFilteredResult(_0x42f738,_0x280981){return function(_0x3d12ab){if(_0x3d12ab){var _0x3876dc=typeof _0x280981[_0xb6b2('0x28')]==='undefined'&&typeof _0x280981[_0xb6b2('0x29')]===_0xb6b2('0x2a');var _0x40d714=_0x3d12ab[_0xb6b2('0x2b')];var _0xb7a94a=_0x3876dc?0x0:_0x280981['offset'];var _0x348077=_0x3876dc?_0x3d12ab[_0xb6b2('0x2b')]:_0x280981['offset']+_0x280981['limit'];var _0x2ff4e0;if(_0x348077>=_0x40d714){_0x348077=_0x40d714;_0x2ff4e0=0xc8;}else{_0x2ff4e0=0xce;}_0x42f738[_0xb6b2('0x27')](_0x2ff4e0);return _0x42f738['set'](_0xb6b2('0x2c'),_0xb7a94a+'-'+_0x348077+'/'+_0x40d714)['json'](_0x3d12ab);}return null;};}function patchUpdates(_0x21cff1){return function(_0x3bc0ba){try{jsonpatch[_0xb6b2('0x2d')](_0x3bc0ba,_0x21cff1,!![]);}catch(_0xcfdc4d){return BPromise[_0xb6b2('0x2e')](_0xcfdc4d);}return _0x3bc0ba['save']();};}function saveUpdates(_0x25a175,_0x527401){return function(_0x16d410){if(_0x16d410){return _0x16d410[_0xb6b2('0x2f')](_0x25a175)[_0xb6b2('0x30')](function(_0x413158){return _0x413158;});}return null;};}function removeEntity(_0x117b89,_0x407ed1){return function(_0x1f109b){if(_0x1f109b){return _0x1f109b[_0xb6b2('0x31')]()[_0xb6b2('0x30')](function(){_0x117b89[_0xb6b2('0x27')](0xcc)[_0xb6b2('0x26')]();});}};}function handleEntityNotFound(_0x250324,_0x2ae87d){return function(_0x4c05e5){if(!_0x4c05e5){_0x250324[_0xb6b2('0x25')](0x194);}return _0x4c05e5;};}function handleError(_0x218683,_0x5d3eb0){_0x5d3eb0=_0x5d3eb0||0x1f4;return function(_0x224a3e){logger[_0xb6b2('0x20')](_0x224a3e[_0xb6b2('0x32')]);if(_0x224a3e[_0xb6b2('0x33')]){delete _0x224a3e[_0xb6b2('0x33')];}_0x218683['status'](_0x5d3eb0)['send'](_0x224a3e);};}function getMustacheRender(_0x477351,_0x29146c){return Mustache[_0xb6b2('0x34')](_0x477351,_[_0xb6b2('0x35')](_0x29146c['body'],{'contact':_0x29146c[_0xb6b2('0x36')],'message':_0x29146c[_0xb6b2('0x22')],'agent':_0x29146c['agent'],'interaction':_0x29146c[_0xb6b2('0x37')],'account':_0x29146c['account']}))||'';}function getInteractionUsers(_0x8167e6,_0x4f9309){return new BPromise(function(_0x367e5e,_0x1a9865){try{if(_0x4f9309[_0x8167e6['id']]){_0x8167e6[_0xb6b2('0x38')]=_['map'](_0x4f9309[_0x8167e6['id']],function(_0x468075){return{'id':_0x468075['id'],'fullname':_0x468075['fullname']};});}}catch(_0x1b366b){_0x1a9865(_0x1b366b);}_0x367e5e(_0x8167e6);});}function getInteractionTags(_0x474f4f,_0x567330){return new BPromise(function(_0xf530c1,_0x4da618){try{if(_0x474f4f[_0xb6b2('0x39')]){_0x474f4f[_0xb6b2('0x3a')]=[];_0x474f4f[_0xb6b2('0x39')][_0xb6b2('0x3b')](',')[_0xb6b2('0x3c')](function(_0x1e8e01){_0x474f4f[_0xb6b2('0x3a')][_0xb6b2('0x3d')](_0x567330[_0x1e8e01]);});}delete _0x474f4f[_0xb6b2('0x39')];}catch(_0x15b076){_0x4da618(_0x15b076);}_0xf530c1(_0x474f4f);});}function updateChatInteraction(_0x50deeb,_0x22bf5c,_0x34c5ab){return new BPromise(function(_0x52f17e,_0x4b3163){return getInteractionUsers(_0x50deeb,_0x34c5ab)[_0xb6b2('0x30')](function(_0x1b0a76){return getInteractionTags(_0x1b0a76,_0x22bf5c);})['then'](function(_0x194359){return getStateInteraction(_0x194359);})[_0xb6b2('0x30')](function(_0x238ce8){_0x52f17e(_0x238ce8);})[_0xb6b2('0x3e')](function(_0x495280){_0x4b3163(_0x495280);});});}function getStateInteraction(_0x30c3c3){return new BPromise(function(_0x4de027){_0x30c3c3[_0xb6b2('0x3f')]=0x0;_0x30c3c3['talking']=0x0;_0x30c3c3['answered']=0x0;_0x30c3c3[_0xb6b2('0x40')]=0x0;_0x30c3c3[_0xb6b2('0x41')]=0x0;_0x30c3c3[_0xb6b2('0x42')]=0x0;if(!_0x30c3c3['closed']&&!_0x30c3c3['UserId']){_0x30c3c3['waiting']+=0x1;}if(!_0x30c3c3['closed']&&_0x30c3c3[_0xb6b2('0x43')]){_0x30c3c3[_0xb6b2('0x44')]+=0x1;if(_0x30c3c3[_0xb6b2('0x3f')]){_0x30c3c3[_0xb6b2('0x3f')]-=0x1;}}if(_0x30c3c3[_0xb6b2('0x45')]&&_0x30c3c3[_0xb6b2('0x46')]===_0xb6b2('0x41')){_0x30c3c3[_0xb6b2('0x41')]+=0x1;if(_0x30c3c3[_0xb6b2('0x3f')]){_0x30c3c3[_0xb6b2('0x3f')]-=0x1;}}else if(_0x30c3c3['closed']&&!_0x30c3c3[_0xb6b2('0x43')]&&_0x30c3c3['disposition']){_0x30c3c3[_0xb6b2('0x40')]+=0x1;if(_0x30c3c3[_0xb6b2('0x3f')]){_0x30c3c3[_0xb6b2('0x3f')]-=0x1;}}else if(_0x30c3c3['closed']&&_0x30c3c3['UserId']){_0x30c3c3['answered']+=0x1;if(_0x30c3c3[_0xb6b2('0x44')]){_0x30c3c3[_0xb6b2('0x44')]-=0x1;}}_0x30c3c3['total']+=0x1;_0x4de027(_0x30c3c3);});}exports['index']=function(_0x3f1723,_0x31c71e){var _0xe03c4d={},_0x1bfc58={},_0x25f015={'count':0x0,'rows':[]};var _0x39a308=_[_0xb6b2('0x47')](db['ChatInteraction'][_0xb6b2('0x48')],function(_0x4220c3){return{'name':_0x4220c3[_0xb6b2('0x49')],'type':_0x4220c3[_0xb6b2('0x4a')][_0xb6b2('0x4b')]};});_0x1bfc58[_0xb6b2('0x4c')]=_[_0xb6b2('0x47')](_0x39a308,'name');_0x1bfc58['query']=_['keys'](_0x3f1723[_0xb6b2('0x4d')]);_0x1bfc58[_0xb6b2('0x4e')]=_['intersection'](_0x1bfc58[_0xb6b2('0x4c')],_0x1bfc58[_0xb6b2('0x4d')]);_0xe03c4d[_0xb6b2('0x4f')]=_[_0xb6b2('0x50')](_0x1bfc58[_0xb6b2('0x4c')],qs[_0xb6b2('0x51')](_0x3f1723[_0xb6b2('0x4d')][_0xb6b2('0x51')]));_0xe03c4d[_0xb6b2('0x4f')]=_0xe03c4d['attributes'][_0xb6b2('0x52')]?_0xe03c4d[_0xb6b2('0x4f')]:_0x1bfc58[_0xb6b2('0x4c')];if(!_0x3f1723[_0xb6b2('0x4d')][_0xb6b2('0x53')](_0xb6b2('0x54'))){_0xe03c4d['limit']=qs[_0xb6b2('0x29')](_0x3f1723[_0xb6b2('0x4d')][_0xb6b2('0x29')]);_0xe03c4d[_0xb6b2('0x28')]=qs[_0xb6b2('0x28')](_0x3f1723[_0xb6b2('0x4d')][_0xb6b2('0x28')]);}_0xe03c4d[_0xb6b2('0x55')]=qs[_0xb6b2('0x56')](_0x3f1723[_0xb6b2('0x4d')][_0xb6b2('0x56')]);_0xe03c4d[_0xb6b2('0x57')]=qs[_0xb6b2('0x4e')](_['pick'](_0x3f1723[_0xb6b2('0x4d')],_0x1bfc58[_0xb6b2('0x4e')]),_0x39a308);var _0xf564af=[];var _0x1d28e2=squel['select']()[_0xb6b2('0x58')]('id')[_0xb6b2('0x58')](_0xb6b2('0x33'))[_0xb6b2('0x58')](_0xb6b2('0x59'))[_0xb6b2('0x5a')](_0xb6b2('0x5b'));var _0x413f62=squel[_0xb6b2('0x5c')]()[_0xb6b2('0x58')]('u.id')[_0xb6b2('0x58')](_0xb6b2('0x5d'))[_0xb6b2('0x58')](_0xb6b2('0x5e'))[_0xb6b2('0x5a')]('user_has_chat_interactions','ui')[_0xb6b2('0x5f')](_0xb6b2('0x60'),'u',_0xb6b2('0x61'));var _0x562144=squel[_0xb6b2('0x5c')]()['from'](_0xb6b2('0x62'),'i')['left_join'](_0xb6b2('0x63'),'c',_0xb6b2('0x64'))[_0xb6b2('0x5f')](_0xb6b2('0x60'),'o',_0xb6b2('0x65'))[_0xb6b2('0x5f')](_0xb6b2('0x66'),'a',_0xb6b2('0x67'))[_0xb6b2('0x5f')](_0xb6b2('0x68'),'me','me.ChatInteractionId\x20=\x20i.id')['left_join'](_0xb6b2('0x69'),'it',_0xb6b2('0x6a'))[_0xb6b2('0x5f')](_0xb6b2('0x5b'),'t',_0xb6b2('0x6b'));var _0x39be05=squel[_0xb6b2('0x6c')]();var _0x10f99f=[];var _0x2f270e=squel['expr']();var _0x50b05d;if(_0x3f1723[_0xb6b2('0x4d')]['search']){_0x50b05d=as[_0xb6b2('0x6d')](_0x3f1723[_0xb6b2('0x4d')][_0xb6b2('0x6e')]);var _0x5bb7c2=_0x50b05d['sqlOperator'];for(var _0x4b4f0c=0x0;_0x4b4f0c<_0x50b05d['conditions'][_0xb6b2('0x52')];_0x4b4f0c++){var _0x3a156e=_0x50b05d[_0xb6b2('0x6f')][_0x4b4f0c];var _0x43ce06='i';var _0x589603=_[_0xb6b2('0x70')](_0x39a308,[_0xb6b2('0x33'),_0x3a156e[_0xb6b2('0x58')]]);if(!_0x589603){switch(_0x3a156e[_0xb6b2('0x58')]){case _0xb6b2('0x71'):if(_0x3a156e['value']==0x1){_0x562144['having']('`'+_0x3a156e['field']+_0xb6b2('0x72'));}else{_0x562144[_0xb6b2('0x73')]('`'+_0x3a156e['field']+_0xb6b2('0x74'));}break;case _0xb6b2('0x75'):if(_0x3a156e['operator']===_0xb6b2('0x76')){if(_0x3a156e[_0xb6b2('0x77')]['split']('\x20')[_0xb6b2('0x52')]>0x1){_0x39be05[_0x5bb7c2](_0xb6b2('0x78'),qs[_0xb6b2('0x79')](_0x3a156e[_0xb6b2('0x77')]),null);}else{var _0x5880bc='%'+_0x3a156e[_0xb6b2('0x77')]+'%';_0x39be05[_0x5bb7c2](_0xb6b2('0x7a'),_0x5880bc,_0x5880bc,_0x5880bc);}}else{_0x589603=_[_0xb6b2('0x70')](_0x39a308,[_0xb6b2('0x33'),_0xb6b2('0x7b')]);_0x3a156e[_0xb6b2('0x58')]=_0xb6b2('0x7b');_0x50ca0c=as[_0xb6b2('0x7c')](_0x43ce06,_0x589603[_0xb6b2('0x4a')],_0x3a156e);_0x39be05[_0x5bb7c2](_0x50ca0c[_0xb6b2('0x7d')],_0x50ca0c[_0xb6b2('0x77')][_0xb6b2('0x7e')],_0x50ca0c[_0xb6b2('0x77')][_0xb6b2('0x26')]);}break;case _0xb6b2('0x7f'):var _0x5176ba=_0x3a156e[_0xb6b2('0x77')][_0xb6b2('0x3b')](',')[_0xb6b2('0x47')](function(_0x24be70){return Number(_0x24be70);});_0x5176ba[_0xb6b2('0x3c')](function(_0x3433ec){_0x2f270e['or'](_0xb6b2('0x80'),'%,'+_0x3433ec+',%');});_0x10f99f=_[_0xb6b2('0x81')](_0x10f99f,_0x5176ba);break;case _0xb6b2('0x82'):if(_0x3a156e['operator']==='$substring'){_0x39be05[_0x5bb7c2](_0xb6b2('0x83'),'%'+_0x3a156e['value']+'%',null);}else{_0x589603=_['find'](_0x39a308,[_0xb6b2('0x33'),_0xb6b2('0x43')]);_0x3a156e[_0xb6b2('0x58')]=_0xb6b2('0x43');_0x50ca0c=as[_0xb6b2('0x7c')](_0x43ce06,_0x589603[_0xb6b2('0x4a')],_0x3a156e);_0x39be05[_0x5bb7c2](_0x50ca0c[_0xb6b2('0x7d')],_0x50ca0c['value'][_0xb6b2('0x7e')],_0x50ca0c[_0xb6b2('0x77')]['end']);}break;case _0xb6b2('0x84'):_0x50ca0c=as[_0xb6b2('0x7c')]('me',null,_0x3a156e);_0x39be05[_0x5bb7c2](_0x50ca0c[_0xb6b2('0x7d')],_0x50ca0c['value'][_0xb6b2('0x7e')],_0x50ca0c[_0xb6b2('0x77')][_0xb6b2('0x26')]);break;}}else{var _0x50ca0c=as[_0xb6b2('0x7c')](_0x43ce06,_0x589603[_0xb6b2('0x4a')],_0x3a156e);_0x39be05[_0x5bb7c2](_0x50ca0c['text'],_0x50ca0c[_0xb6b2('0x77')][_0xb6b2('0x7e')],_0x50ca0c[_0xb6b2('0x77')][_0xb6b2('0x26')]);}}}else{var _0x32d111=_(_0x3f1723['query'])[_0xb6b2('0x85')]()[_0xb6b2('0x47')](function(_0xda9b6b){return _[_0xb6b2('0x86')](_0x39a308,[_0xb6b2('0x33'),_0xda9b6b])?_0xda9b6b:undefined;})[_0xb6b2('0x87')]()[_0xb6b2('0x77')]();if(!_[_0xb6b2('0x88')](_0x32d111)){_0x32d111[_0xb6b2('0x3c')](function(_0x33ff3a){if(_0x33ff3a===_0xb6b2('0x89')){_0x562144[_0xb6b2('0x57')]('i.ChatWebsiteId\x20IN\x20?',[][_0xb6b2('0x8a')](_0x3f1723['query'][_0x33ff3a]));}else if(_0x33ff3a===_0xb6b2('0x8b')){var _0x4e7443=JSON[_0xb6b2('0x8c')](_0x3f1723['query'][_0x33ff3a])[_0xb6b2('0x8d')];var _0x9138ea=JSON[_0xb6b2('0x8c')](_0x3f1723['query'][_0x33ff3a])[_0xb6b2('0x8e')];_0x562144[_0xb6b2('0x57')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4e7443,_0x9138ea);}else{if(_0x3f1723[_0xb6b2('0x4d')][_0x33ff3a]===_0xb6b2('0x8f')){_0x562144['where']('i.'+_0x33ff3a+'\x20IS\x20NULL');}else{_0x562144[_0xb6b2('0x57')]('i.'+_0x33ff3a+_0xb6b2('0x90'),_0x3f1723[_0xb6b2('0x4d')][_0x33ff3a]);}}});}if(_0x3f1723['query'][_0xb6b2('0x91')]){if(_0x3f1723['query'][_0xb6b2('0x91')]==0x1){_0x562144['having']('`unreadMessages`\x20=\x200');}else{_0x562144[_0xb6b2('0x73')](_0xb6b2('0x92'));}}if(_0x3f1723[_0xb6b2('0x4d')]['tag']){_0x10f99f=_[_0xb6b2('0x93')](_0x3f1723[_0xb6b2('0x4d')][_0xb6b2('0x94')])?_0x3f1723[_0xb6b2('0x4d')]['tag']:new Array(_0x3f1723[_0xb6b2('0x4d')][_0xb6b2('0x94')]);_0x10f99f[_0xb6b2('0x3c')](function(_0x1e7faa){_0x2f270e['or'](_0xb6b2('0x80'),'%,'+_0x1e7faa+',%');});}if(_0x3f1723[_0xb6b2('0x4d')][_0xb6b2('0x95')]){var _0x494900=_0x3f1723['query']['filter'][_0xb6b2('0x96')]('\x5c','\x5c\x5c')[_0xb6b2('0x96')](/'/g,'\x27\x27');if(qs[_0xb6b2('0x97')](_0x494900)){_0x39be05['or'](_0xb6b2('0x98'),_0x494900+'%');}else{_0x39be05['or'](_0xb6b2('0x99'),qs['getFullTextValue'](_0x494900))['or'](_0xb6b2('0x9a'),_0x494900+'%');}}}_0x562144[_0xb6b2('0x57')](_0x39be05);_0x562144[_0xb6b2('0x9b')](_0xb6b2('0x9c'));var _0x2b69b9={'type':db[_0xb6b2('0x9d')]['QueryTypes'][_0xb6b2('0x9e')],'raw':!![]};var _0x467bcc=_0x562144[_0xb6b2('0x9f')]();_0x467bcc['field'](_0xb6b2('0x9c'));_0x467bcc['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xb6b2('0x71'));if(_0xe03c4d[_0xb6b2('0x55')]){_0xe03c4d[_0xb6b2('0x55')][_0xb6b2('0x3c')](function(_0x2bffe4){var _0x4b12f6=_0x2bffe4[0x0]===_0xb6b2('0xa0')?_0x2bffe4[0x0]:'i.'+_0x2bffe4[0x0];_0x562144[_0xb6b2('0x55')](_0x4b12f6,_0x2bffe4[0x1]==='DESC'?![]:!![]);});}if(!_[_0xb6b2('0x88')](_0x10f99f)){_0x562144[_0xb6b2('0x73')](_0x2f270e);_0x467bcc[_0xb6b2('0x57')](_0xb6b2('0xa1'),_0x10f99f);}BPromise[_0xb6b2('0xa2')]()[_0xb6b2('0x30')](function(){if(!_0x50b05d){if(_0x3f1723[_0xb6b2('0x4d')][_0xb6b2('0x89')])return;_0x467bcc[_0xb6b2('0x57')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x562144[_0xb6b2('0x57')](_0xb6b2('0xa3'));return;}if(_0x3f1723[_0xb6b2('0xa4')][_0xb6b2('0xa5')]!==_0xb6b2('0xa6'))return;return _0x3f1723[_0xb6b2('0xa4')][_0xb6b2('0xa7')]({'attributes':['id'],'raw':!![]})[_0xb6b2('0x30')](function(_0x311dc1){if(_[_0xb6b2('0x88')](_0x311dc1)){_0x467bcc[_0xb6b2('0x57')](_0xb6b2('0xa8'));_0x562144['where']('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x467bcc[_0xb6b2('0x57')](_0xb6b2('0xa9'),_[_0xb6b2('0x47')](_0x311dc1,'id'));_0x562144[_0xb6b2('0x57')]('i.ChatWebsiteId\x20IN\x20?',_[_0xb6b2('0x47')](_0x311dc1,'id'));}});})[_0xb6b2('0x30')](function(){if(_0x3f1723[_0xb6b2('0xa4')][_0xb6b2('0xa5')]===_0xb6b2('0xa6')&&!_0x50b05d&&!_0x3f1723[_0xb6b2('0x4d')]['ChatWebsiteId'])return[];return db[_0xb6b2('0xaa')][_0xb6b2('0x4d')](_0x467bcc[_0xb6b2('0xab')](),_0x2b69b9);})[_0xb6b2('0x30')](function(_0x54b460){_0x25f015[_0xb6b2('0x2b')]=_0x54b460['length'];if(_0x25f015[_0xb6b2('0x2b')]===0x0)return[];return db[_0xb6b2('0xaa')]['query'](_0x1d28e2[_0xb6b2('0xab')](),_0x2b69b9)[_0xb6b2('0x30')](function(_0x28861f){_0xf564af=_[_0xb6b2('0xac')](_0x28861f,'id');_0x2b69b9=_[_0xb6b2('0x35')](_0x2b69b9,{'model':db[_0xb6b2('0xad')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3f1723['query'][_0xb6b2('0x51')]){_0xe03c4d[_0xb6b2('0x4f')][_0xb6b2('0x3c')](function(_0x307c12){_0x562144[_0xb6b2('0x58')]('i.'+_0x307c12);});}else{_0x562144[_0xb6b2('0x58')](_0xb6b2('0xae'),'unreadMessages');_0x562144['field'](_0xb6b2('0xaf'),_0xb6b2('0xb0'));_0x562144[_0xb6b2('0x58')]('a.mandatoryDisposition',_0xb6b2('0xb1'));_0x562144[_0xb6b2('0x58')](_0xb6b2('0xb2'),_0xb6b2('0xa0'));_0x562144[_0xb6b2('0x58')](_0xb6b2('0xb3'));_0x562144['field']('c.firstName',_0xb6b2('0xb4'));_0x562144[_0xb6b2('0x58')]('c.lastName',_0xb6b2('0xb5'));_0x562144[_0xb6b2('0x58')]('c.email',_0xb6b2('0xb6'));_0x562144[_0xb6b2('0x58')](_0xb6b2('0xb7'),_0xb6b2('0xb8'));_0x562144[_0xb6b2('0x58')](_0xb6b2('0xb9'),_0xb6b2('0xba'));_0x562144[_0xb6b2('0x58')](_0xb6b2('0xbb'),_0xb6b2('0xbc'));_0x562144[_0xb6b2('0x58')]('o.fullname','Owner.fullname');_0x562144[_0xb6b2('0x58')](_0xb6b2('0xbd'),_0xb6b2('0xbe'));_0x562144[_0xb6b2('0x58')](_0xb6b2('0xbf'),'TagIds');}if(_0xe03c4d['limit'])_0x562144[_0xb6b2('0x29')](_0xe03c4d[_0xb6b2('0x29')]);if(_0xe03c4d['offset'])_0x562144['offset'](_0xe03c4d[_0xb6b2('0x28')]);return db['sequelize']['query'](_0x562144[_0xb6b2('0xab')](),_0x2b69b9);})['then'](function(_0x42801a){if(_0x42801a['length']>0x0)_0x413f62[_0xb6b2('0x57')](_0xb6b2('0xc0'),_[_0xb6b2('0x47')](_0x42801a,'id'));return db[_0xb6b2('0xaa')][_0xb6b2('0x4d')](_0x413f62['toString'](),_0x2b69b9)['then'](function(_0x579822){var _0x2a1a72=_[_0xb6b2('0xc1')](_0x579822,_0xb6b2('0xc2'));var _0x18033d=[];_0x42801a[_0xb6b2('0x3c')](function(_0x16eca0){_0x18033d['push'](updateChatInteraction(_0x16eca0,_0xf564af,_0x2a1a72));});return BPromise[_0xb6b2('0xc3')](_0x18033d);});});})['then'](function(_0x544207){_0x25f015[_0xb6b2('0xc4')]=_0x544207;return _0x25f015;})['then'](respondWithFilteredResult(_0x31c71e,_0xe03c4d))[_0xb6b2('0x3e')](handleError(_0x31c71e,null));};exports[_0xb6b2('0xc5')]=function(_0x38a48a,_0x6b42b2){var _0x498ae6={'raw':![],'where':{'id':_0x38a48a[_0xb6b2('0xc6')]['id']}},_0x4bb27d={};_0x4bb27d[_0xb6b2('0x4c')]=_[_0xb6b2('0x85')](db[_0xb6b2('0xad')][_0xb6b2('0x48')]);_0x4bb27d[_0xb6b2('0x4d')]=_[_0xb6b2('0x85')](_0x38a48a['query']);_0x4bb27d[_0xb6b2('0x4e')]=_[_0xb6b2('0x50')](_0x4bb27d['model'],_0x4bb27d[_0xb6b2('0x4d')]);_0x498ae6[_0xb6b2('0x4f')]=_['intersection'](_0x4bb27d[_0xb6b2('0x4c')],qs['fields'](_0x38a48a[_0xb6b2('0x4d')][_0xb6b2('0x51')]));_0x498ae6[_0xb6b2('0x4f')]=_0x498ae6[_0xb6b2('0x4f')][_0xb6b2('0x52')]?_0x498ae6[_0xb6b2('0x4f')]:_0x4bb27d['model'];if(_0x38a48a[_0xb6b2('0x4d')][_0xb6b2('0xc7')]){_0x498ae6[_0xb6b2('0xc8')]=[{'all':!![]}];}_0x498ae6=_[_0xb6b2('0x35')]({},_0x498ae6,_0x38a48a['options']);return db['ChatInteraction'][_0xb6b2('0x70')](_0x498ae6)[_0xb6b2('0x30')](handleEntityNotFound(_0x6b42b2,null))[_0xb6b2('0x30')](respondWithResult(_0x6b42b2,null))['catch'](handleError(_0x6b42b2,null));};exports['create']=function(_0x17efe8,_0x5e26f6){return db[_0xb6b2('0xad')]['create'](_0x17efe8[_0xb6b2('0x84')],{})[_0xb6b2('0x30')](respondWithResult(_0x5e26f6,0xc9))['catch'](handleError(_0x5e26f6,null));};exports[_0xb6b2('0x2f')]=function(_0xc842d1,_0x188993){if(_0xc842d1['body']['id']){delete _0xc842d1['body']['id'];}return db[_0xb6b2('0xad')]['find']({'where':{'id':_0xc842d1[_0xb6b2('0xc6')]['id']}})[_0xb6b2('0x30')](handleEntityNotFound(_0x188993,null))['then'](saveUpdates(_0xc842d1[_0xb6b2('0x84')],null))['then'](respondWithResult(_0x188993,null))['catch'](handleError(_0x188993,null));};exports[_0xb6b2('0x31')]=function(_0x3b6d6e,_0x13404a){return db['ChatInteraction'][_0xb6b2('0x70')]({'where':{'id':_0x3b6d6e[_0xb6b2('0xc6')]['id']}})[_0xb6b2('0x30')](handleEntityNotFound(_0x13404a,null))[_0xb6b2('0x30')](removeEntity(_0x13404a,null))['catch'](handleError(_0x13404a,null));};exports[_0xb6b2('0xc9')]=function(_0x58389d,_0x2a5635){return db[_0xb6b2('0xad')][_0xb6b2('0xc9')]()['then'](respondWithResult(_0x2a5635,null))['catch'](handleError(_0x2a5635,null));};exports[_0xb6b2('0xca')]=function(_0x46b423,_0x4faeba){var _0x556665=_0x46b423[_0xb6b2('0xc6')]['id'];var _0x48f595;var _0x4c644e;var _0x3bd135;return db[_0xb6b2('0xad')][_0xb6b2('0xcb')]({'where':{'id':_0x556665}})[_0xb6b2('0x30')](function(_0x27605d){_0x48f595=_0x27605d;return db[_0xb6b2('0xcc')][_0xb6b2('0xcb')]({'where':{'id':_0x27605d[_0xb6b2('0x89')]},'attributes':['id',_0xb6b2('0xcd'),_0xb6b2('0xce'),_0xb6b2('0xcf'),_0xb6b2('0xd0'),_0xb6b2('0xd1')],'raw':!![]});})[_0xb6b2('0x30')](function(_0x10c516){if(_0x10c516&&_0x10c516[_0xb6b2('0xcd')]&&_0x10c516[_0xb6b2('0xce')]){_0x4c644e=_0x10c516;var _0x359314={'interaction':{'id':_0x556665},'agent':{'id':_0x46b423[_0xb6b2('0xa4')]['id'],'name':_0x46b423[_0xb6b2('0xa4')][_0xb6b2('0x33')],'fullname':_0x46b423[_0xb6b2('0xa4')][_0xb6b2('0xd2')],'email':_0x46b423[_0xb6b2('0xa4')][_0xb6b2('0xd3')]},'contact':_0x46b423[_0xb6b2('0x84')][_0xb6b2('0x36')],'account':_0x46b423['body'][_0xb6b2('0xd4')]};var _0x5665b4={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x10c516[_0xb6b2('0xcd')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x46b423[_0xb6b2('0xa4')][_0xb6b2('0xd3')]],'buttons':null,'topic':_0x4c644e[_0xb6b2('0xcf')],'note':_[_0xb6b2('0xd5')](_0x4c644e[_0xb6b2('0xd0')])?null:getMustacheRender(_0x4c644e[_0xb6b2('0xd0')],_0x359314),'metadata':null},'redirect':_0xb6b2('0xd6'),'json':!![]};try{if(!_[_0xb6b2('0xd5')](_0x4c644e['vidaooMetadata'])){var _0x2c3831=getMustacheRender(_0x4c644e['vidaooMetadata'],_0x359314);var _0x18ddaa=JSON[_0xb6b2('0x8c')](_0x2c3831);_0x5665b4['body'][_0xb6b2('0xd7')]=_0x18ddaa;}}catch(_0x585a9a){throw new db['Sequelize']['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x5665b4);}else{throw new db[(_0xb6b2('0x9d'))][(_0xb6b2('0xd8'))](_0xb6b2('0xd9'));}})[_0xb6b2('0x30')](function(_0x11aaa0){_0x3bd135=_0x11aaa0;if(_0x3bd135['id']){var _0x3d9379={'body':_0x3bd135['join_url'],'ChatWebsiteId':_0x4c644e['id'],'ChatInteractionId':_0x48f595['id'],'direction':_0xb6b2('0xda'),'UserId':_0x46b423[_0xb6b2('0xa4')]['id']};return db[_0xb6b2('0xdb')][_0xb6b2('0xdc')](_0x3d9379,{});}else{throw new db[(_0xb6b2('0x9d'))][(_0xb6b2('0xd8'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xb6b2('0x30')](function(){return _0x48f595['updateAttributes']({'vidaooSessionId':_0x3bd135['id']});})[_0xb6b2('0x30')](respondWithResult(_0x4faeba,null))[_0xb6b2('0x3e')](handleError(_0x4faeba,null));};exports[_0xb6b2('0xdd')]=function(_0x1d6aea,_0x369788){if(_0x1d6aea[_0xb6b2('0x84')]['id']){delete _0x1d6aea['body']['id'];}return db[_0xb6b2('0xad')][_0xb6b2('0x70')]({'where':{'id':_0x1d6aea[_0xb6b2('0xc6')]['id']},'include':[{'model':db['CmContact'],'as':_0xb6b2('0x75')}]})['then'](handleEntityNotFound(_0x369788,null))[_0xb6b2('0x30')](saveUpdates(_0x1d6aea[_0xb6b2('0x84')],null))[_0xb6b2('0x30')](respondWithResult(_0x369788,null))[_0xb6b2('0x3e')](handleError(_0x369788,null));};exports[_0xb6b2('0xde')]=function(_0x3c1a40,_0x4c0f3b,_0x42fff2){if(_0x3c1a40['body']['id']){delete _0x3c1a40['body']['id'];}return db[_0xb6b2('0xad')]['find']({'where':{'id':_0x3c1a40['params']['id']}})[_0xb6b2('0x30')](function(_0x16864f){if(!_0x16864f){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xb6b2('0xde'),0x194,_0xb6b2('0xdf'));_0x4c0f3b['sendStatus'](0x194);}else{if(_0x16864f[_0xb6b2('0x43')]){throw new db[(_0xb6b2('0x9d'))]['ValidationError'](_0xb6b2('0xe0'));}}return _0x16864f;})[_0xb6b2('0x30')](function(_0x184b74){if(_0x184b74){return _0x184b74[_0xb6b2('0x2f')]({'closed':_0x3c1a40[_0xb6b2('0x84')]['closed'],'disposition':_0x3c1a40[_0xb6b2('0x84')][_0xb6b2('0x46')]})[_0xb6b2('0x30')](function(_0x26d7b9){return _0x26d7b9;});}})['then'](function(_0x26c9dc){return respondWithRpcPromise(_0xb6b2('0xe1'),_0xb6b2('0xde'),_0x3c1a40[_0xb6b2('0x84')],client9004);})['then'](respondWithResult(_0x4c0f3b,null))['catch'](handleError(_0x4c0f3b,null));};exports[_0xb6b2('0xe2')]=function(_0x5f1d67,_0x3b4797,_0x4910f0){_0x5f1d67[_0xb6b2('0x84')][_0xb6b2('0x33')]=_0x5f1d67[_0xb6b2('0xe3')][_0xb6b2('0xe4')];_0x5f1d67[_0xb6b2('0x84')]['basename']=_0x5f1d67[_0xb6b2('0xe3')][_0xb6b2('0xe5')];_0x5f1d67['body'][_0xb6b2('0x4a')]=_0x5f1d67[_0xb6b2('0xe3')][_0xb6b2('0xe6')];return db[_0xb6b2('0xe7')][_0xb6b2('0xdc')](_0x5f1d67[_0xb6b2('0x84')])['then'](respondWithResult(_0x3b4797,0xc9))[_0xb6b2('0x3e')](handleError(_0x3b4797,null));};exports[_0xb6b2('0xe8')]=function(_0x121900,_0xeff631,_0xe796e0){return db[_0xb6b2('0xad')][_0xb6b2('0xcb')]({'where':{'id':_0x121900[_0xb6b2('0xc6')]['id']},'raw':!![]})[_0xb6b2('0x30')](handleEntityNotFound(_0xeff631,null))[_0xb6b2('0x30')](function(_0x2e44b1){if(_0x2e44b1){if(_0x2e44b1[_0xb6b2('0x45')]){return _0xeff631[_0xb6b2('0x27')](0x193)[_0xb6b2('0xe9')]({'status':0x193,'message':_0xb6b2('0xea')});}return db['Attachment']['findOne']({'where':{'id':_0x121900[_0xb6b2('0x4d')]['attachId']},'raw':!![]})[_0xb6b2('0x30')](handleEntityNotFound(_0xeff631,null));}})[_0xb6b2('0x30')](function(_0x45443a){if(_0x45443a){var _0x1e711a=_0x45443a[_0xb6b2('0xeb')]!==null;var _0xfcdf13=path[_0xb6b2('0xec')](config['root'],_0xb6b2('0xed'));if(_0x1e711a){_0xfcdf13=path[_0xb6b2('0xec')](_0xfcdf13,_0xb6b2('0xee'));}var _0x139bda=path[_0xb6b2('0xec')](_0xfcdf13,_0x45443a[_0xb6b2('0xef')]);return _0xeff631[_0xb6b2('0xf0')](_0x139bda);}})['catch'](handleError(_0xeff631,null));};exports[_0xb6b2('0xf1')]=function(_0x536151,_0x2011aa){var _0x2eb30e=null;var _0x47dff2=null;var _0x461a20=null;var _0x17edce=null;if(_0x536151[_0xb6b2('0x84')]['id']){delete _0x536151[_0xb6b2('0x84')]['id'];}if(_0x536151[_0xb6b2('0x84')][_0xb6b2('0xf2')]){_0x17edce=path['join'](config[_0xb6b2('0xf3')],'server/files/chat/upload/',util[_0xb6b2('0xf4')]('transcript-%s.txt',Date[_0xb6b2('0xf5')]()));_0x536151[_0xb6b2('0x84')][_0xb6b2('0xf6')]=_0x17edce;}return db['ChatInteraction'][_0xb6b2('0x70')]({'where':{'id':_0x536151['params']['id']},'include':[{'model':db[_0xb6b2('0xdb')],'as':_0xb6b2('0xf7'),'include':[{'model':db[_0xb6b2('0x82')],'as':'User'}]}]})[_0xb6b2('0x30')](handleEntityNotFound(_0x2011aa,null))[_0xb6b2('0x30')](saveUpdates(_0x536151[_0xb6b2('0x84')],null))[_0xb6b2('0x30')](function(_0x674576){if(_0x674576){_0x2eb30e=_0x674576;return db[_0xb6b2('0xcc')][_0xb6b2('0x70')]({'where':{'id':_0x2eb30e[_0xb6b2('0x89')]}});}})[_0xb6b2('0x30')](function(_0x5187b7){if(_0x5187b7){_0x461a20=_0x5187b7;return db[_0xb6b2('0xf8')]['find']({'where':{'id':_0x2eb30e[_0xb6b2('0x7b')]}});}})[_0xb6b2('0x30')](function(_0x72931f){if(_0x72931f){_0x47dff2=_0x72931f;if(_0x17edce){var _0x41392e=null;for(var _0x5a656e=0x1;_0x5a656e<_0x2eb30e[_0xb6b2('0xf7')][_0xb6b2('0x52')];++_0x5a656e){_0x41392e=_0x2eb30e[_0xb6b2('0xf7')][_0x5a656e];var _0x29d098=_0x41392e['UserId']?util[_0xb6b2('0xf4')]('%s%d',_0x461a20[_0xb6b2('0xf9')],_0x41392e[_0xb6b2('0x43')]):'System';var _0x2f95ba=_0x536151['body'][_0xb6b2('0xfa')]||util[_0xb6b2('0xf4')]('%s%d',_0xb6b2('0xfb'),_0x41392e[_0xb6b2('0x7b')]);switch(_0x461a20[_0xb6b2('0xfc')]){case'website_alias':_0x29d098=_0x41392e[_0xb6b2('0x43')]?util[_0xb6b2('0xf4')](_0xb6b2('0xfd'),_0x461a20[_0xb6b2('0xf9')],_0x41392e[_0xb6b2('0x43')]):_0xb6b2('0xfe');break;case _0xb6b2('0xff'):_0x29d098=_0x41392e['UserId']?_0x41392e[_0xb6b2('0x82')][_0xb6b2('0x100')]||_0x41392e[_0xb6b2('0x82')][_0xb6b2('0xd2')]:'System';break;case _0xb6b2('0x101'):_0x29d098=_0x41392e[_0xb6b2('0x43')]?_0x41392e[_0xb6b2('0x82')][_0xb6b2('0xd2')]:_0xb6b2('0xfe');break;default:_0x29d098=_0x41392e['UserId']?util[_0xb6b2('0xf4')](_0xb6b2('0xfd'),_0x461a20[_0xb6b2('0xf9')],_0x41392e[_0xb6b2('0x43')]):_0xb6b2('0xfe');}var _0x224bcc=util[_0xb6b2('0xf4')](_0xb6b2('0x102'),moment(_0x41392e['createdAt'])[_0xb6b2('0xf4')](_0xb6b2('0x103')),_0x41392e[_0xb6b2('0x104')]==='in'?_0x2f95ba:_0x29d098,_0x41392e['body']);if(!_0x41392e[_0xb6b2('0x105')]){fs[_0xb6b2('0x106')](_0x17edce,_0x224bcc);}}return db['MailAccount'][_0xb6b2('0xcb')]({'where':{'service':!![]},'include':[{'model':db[_0xb6b2('0x107')],'as':_0xb6b2('0x108'),'raw':!![]}]});}}})['then'](function(_0x5b068a){if(_0x5b068a&&_0x5b068a[_0xb6b2('0x108')]&&_0x536151['body']){var _0x2a3e7c={'tls':{'rejectUnauthorized':![]}};if(_0x5b068a[_0xb6b2('0x108')][_0xb6b2('0x109')]){_0x2a3e7c[_0xb6b2('0x109')]=_0x5b068a[_0xb6b2('0x108')][_0xb6b2('0x109')];}else{_0x2a3e7c[_0xb6b2('0x10a')]=_0x5b068a[_0xb6b2('0x108')][_0xb6b2('0x10a')];_0x2a3e7c['port']=_0x5b068a['Smtp']['port'];_0x2a3e7c[_0xb6b2('0x10b')]=_0x5b068a[_0xb6b2('0x108')][_0xb6b2('0x10b')];}if(_0x5b068a[_0xb6b2('0x108')][_0xb6b2('0x10c')]){_0x2a3e7c[_0xb6b2('0x10d')]={'user':_0x5b068a[_0xb6b2('0x108')][_0xb6b2('0xa4')],'pass':_0x5b068a['Smtp'][_0xb6b2('0x10e')]};}return respondWithRpcPromise(_0xb6b2('0x10f'),_0xb6b2('0x110'),{'account':_0x2a3e7c,'message':{'from':util[_0xb6b2('0xf4')](_0xb6b2('0x111'),_0x5b068a[_0xb6b2('0x33')],_0x5b068a[_0xb6b2('0xd3')]||_0x5b068a[_0xb6b2('0x108')]['user']),'to':_0x536151['body']['mailTranscript'],'subject':_0xb6b2('0x112'),'text':util[_0xb6b2('0xf4')](_0xb6b2('0x113'),_0x536151[_0xb6b2('0x84')][_0xb6b2('0xf2')]),'attachments':[{'path':_0x17edce}]}})[_0xb6b2('0x30')](function(){return _0x2eb30e;})[_0xb6b2('0x3e')](function(_0x29a939){console[_0xb6b2('0x20')](_0x29a939);});}else{return _0x2eb30e;}})[_0xb6b2('0x30')](respondWithStatusCode(_0x2011aa,0xc8))['catch'](handleError(_0x2011aa,null));};exports[_0xb6b2('0x114')]=function(_0x1e6db7,_0x1fa7e5,_0x5e1544){return db[_0xb6b2('0xdb')][_0xb6b2('0x70')]({'where':{'id':_0x1e6db7[_0xb6b2('0xc6')]['id']}})[_0xb6b2('0x30')](handleEntityNotFound(_0x1fa7e5,null))[_0xb6b2('0x30')](function(_0x492d85){if(_0x492d85){return _0x492d85[_0xb6b2('0x114')](_0x1e6db7['body'][_0xb6b2('0x115')],_[_0xb6b2('0x116')](_0x1e6db7['body'],[_0xb6b2('0x115'),'id'])||{});}})[_0xb6b2('0x30')](respondWithResult(_0x1fa7e5,null))[_0xb6b2('0x3e')](handleError(_0x1fa7e5,null));};exports['getMessages']=function(_0x259eef,_0x55a2d8,_0x48f78d){var _0x3229fc={'raw':![],'where':{}};var _0x8458cc={};var _0x543449={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xb6b2('0xcb')]({'where':{'id':_0x259eef[_0xb6b2('0xc6')]['id']}})[_0xb6b2('0x30')](handleEntityNotFound(_0x55a2d8,null))[_0xb6b2('0x30')](function(_0x1b5e04){if(_0x1b5e04){_0x8458cc[_0xb6b2('0x4c')]=_['keys'](db[_0xb6b2('0xdb')]['rawAttributes']);_0x8458cc['query']=_['keys'](_0x259eef['query']);_0x8458cc[_0xb6b2('0x4e')]=_[_0xb6b2('0x50')](_0x8458cc[_0xb6b2('0x4c')],_0x8458cc['query']);_0x3229fc['attributes']=_['intersection'](_0x8458cc[_0xb6b2('0x4c')],qs[_0xb6b2('0x51')](_0x259eef[_0xb6b2('0x4d')]['fields']));_0x3229fc['attributes']=_0x3229fc[_0xb6b2('0x4f')][_0xb6b2('0x52')]?_0x3229fc['attributes']:_0x8458cc[_0xb6b2('0x4c')];if(!_0x259eef[_0xb6b2('0x4d')][_0xb6b2('0x53')](_0xb6b2('0x54'))){_0x3229fc[_0xb6b2('0x29')]=qs[_0xb6b2('0x29')](_0x259eef[_0xb6b2('0x4d')]['limit']);_0x3229fc[_0xb6b2('0x28')]=qs['offset'](_0x259eef[_0xb6b2('0x4d')][_0xb6b2('0x28')]);}_0x3229fc['order']=qs['sort'](_0x259eef['query'][_0xb6b2('0x56')]);_0x3229fc[_0xb6b2('0x57')]=qs[_0xb6b2('0x4e')](_[_0xb6b2('0x117')](_0x259eef[_0xb6b2('0x4d')],_0x8458cc[_0xb6b2('0x4e')]));_0x3229fc[_0xb6b2('0x57')]['ChatInteractionId']=_0x1b5e04['id'];if(_0x259eef[_0xb6b2('0x4d')]['filter']){_0x3229fc['where']=_[_0xb6b2('0x35')](_0x3229fc['where'],{'$or':_['map'](_0x3229fc[_0xb6b2('0x4f')],function(_0x502878){var _0x50be29={};_0x50be29[_0x502878]={'$like':'%'+_0x259eef[_0xb6b2('0x4d')]['filter']+'%'};return _0x50be29;})});}if(_0x259eef[_0xb6b2('0x4d')][_0xb6b2('0x8d')]){var _0x1c23e8=_0x259eef[_0xb6b2('0x4d')][_0xb6b2('0x8d')][_0xb6b2('0x3b')](',');var _0x1bf9ea={};_0x1bf9ea[_0x1c23e8[0x0]]={'$gte':moment(_0x1c23e8[0x1])[_0xb6b2('0xf4')](_0xb6b2('0x118'))};_0x3229fc['where']=_['merge'](_0x3229fc[_0xb6b2('0x57')],_0x1bf9ea);}_0x3229fc=_[_0xb6b2('0x35')]({},_0x3229fc,_0x259eef[_0xb6b2('0x119')]);return db['ChatMessage'][_0xb6b2('0x2b')]({'where':_0x3229fc[_0xb6b2('0x57')]})[_0xb6b2('0x30')](function(_0x406c72){_0x543449[_0xb6b2('0x2b')]=_0x406c72;if(_0x259eef[_0xb6b2('0x4d')][_0xb6b2('0xc7')]){_0x3229fc[_0xb6b2('0xc8')]=[{'all':!![]}];}return db['ChatMessage'][_0xb6b2('0x11a')](_0x3229fc);})[_0xb6b2('0x30')](function(_0x29e297){_0x543449[_0xb6b2('0xc4')]=_0x29e297;return _0x543449;});}})['then'](respondWithFilteredResult(_0x55a2d8,_0x3229fc))[_0xb6b2('0x3e')](handleError(_0x55a2d8,null));};exports[_0xb6b2('0x11b')]=function(_0x7368f3,_0xb9017a,_0x31e38f){var _0x2ddca3={'where':{}},_0x27d92c={},_0x5ba306={'count':0x0,'rows':[]};return db[_0xb6b2('0xad')][_0xb6b2('0xcb')]({'where':{'id':_0x7368f3[_0xb6b2('0xc6')]['id']}})[_0xb6b2('0x30')](handleEntityNotFound(_0xb9017a,null))[_0xb6b2('0x30')](function(_0x37fcc8){if(_0x37fcc8){_0x27d92c[_0xb6b2('0x4c')]=_[_0xb6b2('0x85')](db[_0xb6b2('0xdb')][_0xb6b2('0x48')]);_0x27d92c[_0xb6b2('0x4d')]=_[_0xb6b2('0x85')](_0x7368f3[_0xb6b2('0x4d')]);_0x27d92c[_0xb6b2('0x4e')]=_['intersection'](_0x27d92c['model'],_0x27d92c[_0xb6b2('0x4d')]);_0x2ddca3[_0xb6b2('0x4f')]=_[_0xb6b2('0x50')](_0x27d92c[_0xb6b2('0x4c')],qs[_0xb6b2('0x51')](_0x7368f3[_0xb6b2('0x4d')][_0xb6b2('0x51')]));_0x2ddca3[_0xb6b2('0x4f')]=_0x2ddca3[_0xb6b2('0x4f')][_0xb6b2('0x52')]?_0x2ddca3['attributes']:_0x27d92c[_0xb6b2('0x4c')];if(!_0x7368f3[_0xb6b2('0x4d')][_0xb6b2('0x53')](_0xb6b2('0x54'))){_0x2ddca3[_0xb6b2('0x29')]=qs[_0xb6b2('0x29')](_0x7368f3[_0xb6b2('0x4d')]['limit']);_0x2ddca3[_0xb6b2('0x28')]=qs[_0xb6b2('0x28')](_0x7368f3[_0xb6b2('0x4d')][_0xb6b2('0x28')]);}_0x2ddca3['order']=qs[_0xb6b2('0x56')](_0x7368f3[_0xb6b2('0x4d')][_0xb6b2('0x56')]);_0x2ddca3['where']=qs['filters'](_[_0xb6b2('0x117')](_0x7368f3[_0xb6b2('0x4d')],_0x27d92c[_0xb6b2('0x4e')]));_0x2ddca3[_0xb6b2('0x57')][_0xb6b2('0xc2')]=_0x37fcc8['id'];if(_0x7368f3['query']['filter']){_0x2ddca3[_0xb6b2('0x57')]=_[_0xb6b2('0x35')](_0x2ddca3['where'],{'$or':_['map'](_0x2ddca3[_0xb6b2('0x4f')],function(_0x15ea1e){var _0x20c077={};_0x20c077[_0x15ea1e]={'$like':'%'+_0x7368f3[_0xb6b2('0x4d')][_0xb6b2('0x95')]+'%'};return _0x20c077;})});}_0x2ddca3['where'][_0xb6b2('0x105')]=![];if(_0x7368f3[_0xb6b2('0x4d')]['id']){_0x2ddca3[_0xb6b2('0x57')]['id']={'$gt':_0x7368f3[_0xb6b2('0x4d')]['id']};}_0x2ddca3=_[_0xb6b2('0x35')]({},_0x2ddca3,_0x7368f3['options']);return db[_0xb6b2('0xdb')][_0xb6b2('0x2b')]({'where':_0x2ddca3['where']})[_0xb6b2('0x30')](function(_0x8d955c){_0x5ba306['count']=_0x8d955c;_0x2ddca3[_0xb6b2('0xc8')]=[];if(_0x7368f3[_0xb6b2('0x4d')][_0xb6b2('0x11c')]){_0x2ddca3[_0xb6b2('0xc8')]['push']({'model':db[_0xb6b2('0x82')],'as':'User','attributes':['id',_0xb6b2('0xd2'),_0xb6b2('0x100')]});}if(_0x7368f3[_0xb6b2('0x4d')][_0xb6b2('0xc7')]){_0x2ddca3[_0xb6b2('0xc8')]=[{'all':!![]}];}return db[_0xb6b2('0xdb')][_0xb6b2('0x11a')](_0x2ddca3);})[_0xb6b2('0x30')](function(_0x42281b){_0x5ba306[_0xb6b2('0xc4')]=_0x42281b;return _0x5ba306;});}})['then'](respondWithFilteredResult(_0xb9017a,_0x2ddca3))[_0xb6b2('0x3e')](handleError(_0xb9017a,null));};exports['addTags']=function(_0x27bd38,_0x2ae9dc,_0x126984){return db[_0xb6b2('0xad')]['find']({'where':{'id':_0x27bd38['params']['id']}})['then'](handleEntityNotFound(_0x2ae9dc,null))[_0xb6b2('0x30')](function(_0x173edb){if(_0x173edb){return _0x173edb['setTags'](_0x27bd38['body']['ids'],_[_0xb6b2('0x116')](_0x27bd38[_0xb6b2('0x84')],['ids','id'])||{})[_0xb6b2('0x11d')](function(){return db[_0xb6b2('0x7f')][_0xb6b2('0x11a')]({'attributes':['id','name',_0xb6b2('0x59')],'where':{'id':_0x27bd38[_0xb6b2('0x84')][_0xb6b2('0x115')]}});})[_0xb6b2('0x30')](function(_0xbdef8f){socket[_0xb6b2('0x11e')](_0xb6b2('0x11f'),{'id':Number(_0x27bd38[_0xb6b2('0xc6')]['id']),'tags':_0xbdef8f||[]});return{'id':Number(_0x27bd38[_0xb6b2('0xc6')]['id']),'tags':_0xbdef8f||[]};});}})[_0xb6b2('0x30')](respondWithResult(_0x2ae9dc,null))['catch'](handleError(_0x2ae9dc,null));};exports[_0xb6b2('0x120')]=function(_0x27cd16,_0x1a10aa,_0x3a6610){return db[_0xb6b2('0xad')]['find']({'where':{'id':_0x27cd16['params']['id']}})[_0xb6b2('0x30')](handleEntityNotFound(_0x1a10aa,null))['then'](function(_0x40bd7d){if(_0x40bd7d){return _0x40bd7d[_0xb6b2('0x120')](_0x27cd16[_0xb6b2('0x4d')][_0xb6b2('0x115')]);}})['then'](respondWithStatusCode(_0x1a10aa,null))[_0xb6b2('0x3e')](handleError(_0x1a10aa,null));};exports[_0xb6b2('0xf0')]=function(_0xb33f09,_0x431b79){var _0xb273b7=moment()['unix']()[_0xb6b2('0xab')]();var _0x50328e=path[_0xb6b2('0xec')](config['root'],_0xb6b2('0x121'),_0xb6b2('0x122'),_0xb6b2('0x123'));var _0x40942a=path[_0xb6b2('0xec')](config[_0xb6b2('0xf3')],'server',_0xb6b2('0x122'),'attachments');var _0x92eeba=path[_0xb6b2('0xec')](_0x50328e,_0xb273b7);var _0x3d1f79=util[_0xb6b2('0xf4')](_0xb6b2('0x124'),_0xb33f09['params']['id'],_0xb273b7);var _0x289110=path[_0xb6b2('0xec')](_0x50328e,_0x3d1f79);var _0x34be29=[];_0x34be29[_0xb6b2('0x3d')]({'model':db[_0xb6b2('0x82')],'as':_0xb6b2('0x82'),'attributes':['id',_0xb6b2('0xd2')],'raw':!![]});_0x34be29[_0xb6b2('0x3d')]({'model':db[_0xb6b2('0xf8')],'as':_0xb6b2('0x75'),'attributes':['id','firstName',_0xb6b2('0x125')],'raw':!![]});if(_0xb33f09[_0xb6b2('0x4d')]['attachments']){_0x34be29[_0xb6b2('0x3d')]({'model':db[_0xb6b2('0xe7')],'as':_0xb6b2('0xe7'),'raw':!![]});}var _0x2d0c9f=[{'model':db[_0xb6b2('0xdb')],'as':_0xb6b2('0xf7'),'attributes':['id',_0xb6b2('0x84'),_0xb6b2('0x8b'),_0xb6b2('0x104'),_0xb6b2('0x105'),_0xb6b2('0x91')],'include':_0x34be29}];_0x2d0c9f['push']({'model':db['ChatWebsite'],'as':_0xb6b2('0x126'),'attributes':['id',_0xb6b2('0x33')]});_0x2d0c9f[_0xb6b2('0x3d')]({'model':db[_0xb6b2('0x82')],'as':_0xb6b2('0x127'),'attributes':['id','fullname']});return db[_0xb6b2('0xad')][_0xb6b2('0x70')]({'where':{'id':_0xb33f09[_0xb6b2('0xc6')]['id']},'include':_0x2d0c9f})['then'](handleEntityNotFound(_0x431b79,null))[_0xb6b2('0x30')](function(_0x20ff2e){if(_0x20ff2e){var _0x40f6c1=_0x20ff2e[_0xb6b2('0x128')]({'plain':!![]});fs['mkdirSync'](_0x92eeba);var _0x4bec5f={'channel':_0xb6b2('0x129'),'account':_0x40f6c1[_0xb6b2('0x126')][_0xb6b2('0x33')],'agent':_0x40f6c1['Owner']?_0x40f6c1[_0xb6b2('0x127')][_0xb6b2('0xd2')]:'N.A.','createdAt':moment(_0x40f6c1['createdAt'])[_0xb6b2('0xf4')](_0xb6b2('0x118'))['toString'](),'closedAt':_0x40f6c1['closed']?moment(_0x40f6c1['closedAt'])['format'](_0xb6b2('0x118'))[_0xb6b2('0xab')]():'','disposition':_0x40f6c1[_0xb6b2('0x46')],'chatInfo':{'browser':_0x40f6c1['browserName'],'os':_0x40f6c1[_0xb6b2('0x12a')],'referer':_0x40f6c1[_0xb6b2('0x12b')],'customerIp':_0x40f6c1['customerIp'],'customerPort':_0x40f6c1['customerPort']?_0x40f6c1['customerPort']:_0xb6b2('0x12c')},'messages':_(_0x40f6c1[_0xb6b2('0xf7')])[_0xb6b2('0x12d')]()[_0xb6b2('0x95')]({'secret':![]})['map'](function(_0x4e226e){if(_0x4e226e[_0xb6b2('0xe7')]){var _0x28c834=path['join'](_0x40942a,_0x4e226e[_0xb6b2('0xe7')][_0xb6b2('0xef')]);if(fs[_0xb6b2('0x12e')](_0x28c834)){fs[_0xb6b2('0x12f')](_0x28c834)[_0xb6b2('0x130')](fs['createWriteStream'](path[_0xb6b2('0xec')](_0x92eeba,_0x4e226e[_0xb6b2('0xe7')][_0xb6b2('0xef')])));}}return{'date':moment(_0x4e226e['createdAt'])[_0xb6b2('0xf4')](_0xb6b2('0x118'))['toString'](),'sender':_0x4e226e[_0xb6b2('0x104')]===_0xb6b2('0xda')?_0x4e226e[_0xb6b2('0x82')]?_0x4e226e['User']['fullname']:_0xb6b2('0xfe'):_0x4e226e['Contact'][_0xb6b2('0x131')]+(_0x4e226e['Contact'][_0xb6b2('0x125')]?'\x20'+_0x4e226e[_0xb6b2('0x75')][_0xb6b2('0x125')]:''),'body':_0x4e226e[_0xb6b2('0xe7')]?_0x4e226e[_0xb6b2('0xe7')][_0xb6b2('0xef')]:_0x4e226e[_0xb6b2('0x84')],'direction':_0x4e226e[_0xb6b2('0x104')]===_0xb6b2('0xda')?'A':'C','secret':_0x4e226e[_0xb6b2('0x105')],'read':_0x4e226e[_0xb6b2('0x91')],'attachment':_0x4e226e[_0xb6b2('0xe7')]};})[_0xb6b2('0x77')]()};return ejs[_0xb6b2('0x132')](path[_0xb6b2('0xec')](config['root'],'server',_0xb6b2('0x133'),_0xb6b2('0x134')),{'interaction':_0x4bec5f})['then'](function(_0x3824a2){var _0x53aa75=path[_0xb6b2('0xec')](_0x92eeba,'transcript-'+_0x40f6c1['id']+'-'+_0xb273b7+_0xb6b2('0x135'));var _0x4d9b2a={'path':_0x53aa75,'channel':_0xb6b2('0x129'),'interactionId':_0x40f6c1['id']};return pdf['createPdfFromHTML'](_0x3824a2,_0x4d9b2a);})[_0xb6b2('0x30')](function(){return new BPromise(function(_0x131ad9,_0x5dbe7f){zipdir(_0x92eeba,{'saveTo':_0x289110},function(_0xb6b198,_0x2a8d9b){if(_0xb6b198)return _0x5dbe7f(_0xb6b198);return _0x131ad9(_0x2a8d9b);});})['then'](function(){return new BPromise(function(_0x225ce0,_0x432fd1){rimraf(_0x92eeba,function(_0x36abe8){if(_0x36abe8)_0x432fd1(_0x36abe8);return _0x225ce0();});});})['then'](function(){return _0x431b79['download'](_0x289110,_0x3d1f79,function(_0x1cde6c){if(_0x1cde6c){console[_0xb6b2('0x136')]('err',_0x1cde6c);}else{fs[_0xb6b2('0x137')](_0x289110);}});});});}else{return _0x431b79[_0xb6b2('0x25')](0xc8);}})[_0xb6b2('0x3e')](handleError(_0x431b79,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index bb0e899..737d217 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 _0x977e=['exports','events','../../mysqldb','ChatInteraction','ChatMessage','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x977e,0x1c9));var _0xe977=function(_0x5482b3,_0x522dc0){_0x5482b3=_0x5482b3-0x0;var _0x31284c=_0x977e[_0x5482b3];return _0x31284c;};'use strict';var EventEmitter=require(_0xe977('0x0'));var ChatInteraction=require(_0xe977('0x1'))['db'][_0xe977('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0xe977('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe977('0x4'),'afterDestroy':_0xe977('0x5')};function emitEvent(_0x2db67c){return function(_0xd86bbf,_0x49b9f1,_0x1466e7){_0xd86bbf[_0xe977('0x6')]({'attributes':['id'],'raw':!![]})[_0xe977('0x7')](function(_0x19c730){_0xd86bbf[_0xe977('0x8')](_0xe977('0x9'),_0x19c730[_0xe977('0xa')](function(_0x2f9b9b){return{'id':_0x2f9b9b['id']};}));return ChatMessage[_0xe977('0xb')]({'where':{'ChatInteractionId':_0xd86bbf['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe977('0x7')](function(_0x4e3dfc){_0xd86bbf[_0xe977('0x8')](_0xe977('0xc'),_0x4e3dfc[_0xe977('0xd')]);ChatInteractionEvents['emit'](_0x2db67c+':'+_0xd86bbf['id'],_0xd86bbf);ChatInteractionEvents[_0xe977('0xe')](_0x2db67c,_0xd86bbf);_0x1466e7(null);})[_0xe977('0xf')](_0x1466e7(null));};}for(var e in events){if(events[_0xe977('0x10')](e)){var event=events[e];ChatInteraction[_0xe977('0x11')](e,emitEvent(event));}}module[_0xe977('0x12')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xe6f0=['setMaxListeners','save','remove','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe6f0,0x1a5));var _0x0e6f=function(_0x3fec1f,_0x563512){_0x3fec1f=_0x3fec1f-0x0;var _0x5cb79b=_0xe6f0[_0x3fec1f];return _0x5cb79b;};'use strict';var EventEmitter=require(_0x0e6f('0x0'));var ChatInteraction=require(_0x0e6f('0x1'))['db'][_0x0e6f('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x0e6f('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x0e6f('0x4')](0x0);var events={'afterCreate':_0x0e6f('0x5'),'afterUpdate':'update','afterDestroy':_0x0e6f('0x6')};function emitEvent(_0x3a6e7c){return function(_0x3b60b4,_0x54a845,_0x29197d){_0x3b60b4['getUsers']({'attributes':['id'],'raw':!![]})[_0x0e6f('0x7')](function(_0x4271be){_0x3b60b4[_0x0e6f('0x8')]('Users',_0x4271be[_0x0e6f('0x9')](function(_0x57ac2b){return{'id':_0x57ac2b['id']};}));return ChatMessage[_0x0e6f('0xa')]({'where':{'ChatInteractionId':_0x3b60b4['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0e6f('0x7')](function(_0x238ad9){_0x3b60b4[_0x0e6f('0x8')](_0x0e6f('0xb'),_0x238ad9[_0x0e6f('0xc')]);ChatInteractionEvents[_0x0e6f('0xd')](_0x3a6e7c+':'+_0x3b60b4['id'],_0x3b60b4);ChatInteractionEvents['emit'](_0x3a6e7c,_0x3b60b4);_0x29197d(null);})[_0x0e6f('0xe')](_0x29197d(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x0e6f('0xf')](e,emitEvent(event));}}module[_0x0e6f('0x10')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 22a6c86..8aebf4e 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 _0x79c9=['YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','closed','closedAt','format'];(function(_0x417b27,_0x3d89e8){var _0x2abb16=function(_0x3a7653){while(--_0x3a7653){_0x417b27['push'](_0x417b27['shift']());}};_0x2abb16(++_0x3d89e8);}(_0x79c9,0x159));var _0x979c=function(_0x3c2067,_0xa7f55c){_0x3c2067=_0x3c2067-0x0;var _0x3b6b60=_0x79c9[_0x3c2067];return _0x3b6b60;};'use strict';var _=require(_0x979c('0x0'));var util=require(_0x979c('0x1'));var logger=require(_0x979c('0x2'))(_0x979c('0x3'));var moment=require('moment');var BPromise=require(_0x979c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x979c('0x5'));var rimraf=require(_0x979c('0x6'));var config=require(_0x979c('0x7'));var attributes=require(_0x979c('0x8'));module[_0x979c('0x9')]=function(_0x5413a1,_0x5cc0ac){return _0x5413a1[_0x979c('0xa')](_0x979c('0xb'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x29b4e1,_0xfef358,_0x53eff9){if(_0x29b4e1['changed'](_0x979c('0xc'))){_0x29b4e1[_0x979c('0xd')]=moment()[_0x979c('0xe')](_0x979c('0xf'));}_0x53eff9(null,_0x29b4e1);}},'charset':_0x979c('0x10'),'collate':_0x979c('0x11')});};
\ No newline at end of file
+var _0x692c=['api','moment','bluebird','request-promise','rimraf','define','chat_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','../../config/logger'];(function(_0x533b87,_0x591790){var _0xf39d05=function(_0x3a5f60){while(--_0x3a5f60){_0x533b87['push'](_0x533b87['shift']());}};_0xf39d05(++_0x591790);}(_0x692c,0x84));var _0xc692=function(_0x698254,_0x487811){_0x698254=_0x698254-0x0;var _0x1736c6=_0x692c[_0x698254];return _0x1736c6;};'use strict';var _=require(_0xc692('0x0'));var util=require(_0xc692('0x1'));var logger=require(_0xc692('0x2'))(_0xc692('0x3'));var moment=require(_0xc692('0x4'));var BPromise=require(_0xc692('0x5'));var rp=require(_0xc692('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc692('0x7'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module['exports']=function(_0x4c837a,_0x400fbd){return _0x4c837a[_0xc692('0x8')]('ChatInteraction',attributes,{'tableName':_0xc692('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xc93261,_0x4c01c4,_0x598332){if(_0xc93261[_0xc692('0xa')](_0xc692('0xb'))){_0xc93261[_0xc692('0xc')]=moment()['format'](_0xc692('0xd'));}_0x598332(null,_0xc93261);}},'charset':_0xc692('0xe'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 2114437..b1b7158 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 _0x63cd=['./chatInteraction.socket','request','then','info','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','update','options','where','attributes','limit','AddTagsToChatInteraction','find','body','ids','omit','spread','AddTags','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter'];(function(_0x47a768,_0x3357cc){var _0x5d756d=function(_0x3d89b4){while(--_0x3d89b4){_0x47a768['push'](_0x47a768['shift']());}};_0x5d756d(++_0x3357cc);}(_0x63cd,0xdd));var _0xd63c=function(_0xe3f14c,_0x5967bf){_0xe3f14c=_0xe3f14c-0x0;var _0x41edc0=_0x63cd[_0xe3f14c];return _0x41edc0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xd63c('0x0'));var rs=require(_0xd63c('0x1'));var fs=require('fs');var Redis=require(_0xd63c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xd63c('0x3'));var logger=require(_0xd63c('0x4'))(_0xd63c('0x5'));var config=require(_0xd63c('0x6'));var jayson=require(_0xd63c('0x7'));var client=jayson[_0xd63c('0x8')][_0xd63c('0x9')]({'port':0x232a});config[_0xd63c('0xa')]=_['defaults'](config[_0xd63c('0xa')],{'host':_0xd63c('0xb'),'port':0x18eb});var socket=require(_0xd63c('0xc'))(new Redis(config[_0xd63c('0xa')]));require(_0xd63c('0xd'))['register'](socket);function respondWithRpcPromise(_0x2f22d2,_0xe83b71,_0x16e41e){return new BPromise(function(_0xc6273e,_0x8fbaa5){return client[_0xd63c('0xe')](_0x2f22d2,_0x16e41e)[_0xd63c('0xf')](function(_0x4b598f){logger[_0xd63c('0x10')]('ChatInteraction,\x20%s,\x20%s',_0xe83b71,'request\x20sent');logger[_0xd63c('0x11')](_0xd63c('0x12'),_0xe83b71,_0xd63c('0x13'),JSON[_0xd63c('0x14')](_0x4b598f));if(_0x4b598f[_0xd63c('0x15')]){if(_0x4b598f['error']['code']===0x1f4){logger['error'](_0xd63c('0x16'),_0xe83b71,_0x4b598f[_0xd63c('0x15')][_0xd63c('0x17')]);return _0x8fbaa5(_0x4b598f[_0xd63c('0x15')]['message']);}logger['error'](_0xd63c('0x16'),_0xe83b71,_0x4b598f['error'][_0xd63c('0x17')]);return _0xc6273e(_0x4b598f[_0xd63c('0x15')]['message']);}else{logger['info'](_0xd63c('0x16'),_0xe83b71,_0xd63c('0x13'));_0xc6273e(_0x4b598f[_0xd63c('0x18')][_0xd63c('0x17')]);}})[_0xd63c('0x19')](function(_0x355ec4){logger[_0xd63c('0x15')](_0xd63c('0x16'),_0xe83b71,_0x355ec4);_0x8fbaa5(_0x355ec4);});});}exports[_0xd63c('0x1a')]=function(_0x3b2f68){var _0x2aba87=this;return new Promise(function(_0x4602cd,_0x4d7679){return db['ChatInteraction'][_0xd63c('0x1b')](_0x3b2f68['body'],{'raw':_0x3b2f68[_0xd63c('0x1c')]?_0x3b2f68[_0xd63c('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b2f68[_0xd63c('0x1c')]?_0x3b2f68[_0xd63c('0x1c')][_0xd63c('0x1d')]||null:null,'attributes':_0x3b2f68['options']?_0x3b2f68[_0xd63c('0x1c')][_0xd63c('0x1e')]||null:null,'limit':_0x3b2f68['options']?_0x3b2f68[_0xd63c('0x1c')][_0xd63c('0x1f')]||null:null})[_0xd63c('0xf')](function(_0x1fc213){logger['info'](_0xd63c('0x1a'),_0x3b2f68);logger['debug'](_0xd63c('0x1a'),_0x3b2f68,JSON[_0xd63c('0x14')](_0x1fc213));_0x4602cd(_0x1fc213);})[_0xd63c('0x19')](function(_0x5ebcde){logger[_0xd63c('0x15')](_0xd63c('0x1a'),_0x5ebcde['message'],_0x3b2f68);_0x4d7679(_0x2aba87[_0xd63c('0x15')](0x1f4,_0x5ebcde[_0xd63c('0x17')]));});});};exports[_0xd63c('0x20')]=function(_0x31bd6f){return new Promise(function(_0x455129,_0x34a8eb){return db['ChatInteraction'][_0xd63c('0x21')]({'where':_0x31bd6f[_0xd63c('0x1c')]?_0x31bd6f[_0xd63c('0x1c')][_0xd63c('0x1d')]||null:null})[_0xd63c('0xf')](function(_0x19769f){if(_0x19769f){return _0x19769f['addTags'](_0x31bd6f[_0xd63c('0x22')][_0xd63c('0x23')],_[_0xd63c('0x24')](_0x31bd6f[_0xd63c('0x22')],[_0xd63c('0x23'),'id'])||{});}})[_0xd63c('0x25')](function(_0x483374){logger[_0xd63c('0x10')](_0xd63c('0x26'),_0x31bd6f);logger[_0xd63c('0x11')]('AddTags',_0x31bd6f,JSON[_0xd63c('0x14')](_0x483374));_0x455129(_0x483374);})[_0xd63c('0x19')](function(_0x11f99e){logger[_0xd63c('0x15')](_0xd63c('0x26'),_0x11f99e[_0xd63c('0x17')],_0x31bd6f);_0x34a8eb(_this['error'](0x1f4,_0x11f99e['message']));});});};
\ No newline at end of file
+var _0xd062=['socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','UpdateChatInteraction','update','body','options','raw','where','attributes','stringify','catch','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x87c726,_0x2235d3){var _0xbcdcdd=function(_0x22565c){while(--_0x22565c){_0x87c726['push'](_0x87c726['shift']());}};_0xbcdcdd(++_0x2235d3);}(_0xd062,0xa0));var _0x2d06=function(_0x543dd8,_0xfe806e){_0x543dd8=_0x543dd8-0x0;var _0x2f8b46=_0xd062[_0x543dd8];return _0x2f8b46;};'use strict';var _=require('lodash');var util=require(_0x2d06('0x0'));var moment=require(_0x2d06('0x1'));var BPromise=require(_0x2d06('0x2'));var rs=require(_0x2d06('0x3'));var fs=require('fs');var Redis=require(_0x2d06('0x4'));var db=require(_0x2d06('0x5'))['db'];var utils=require(_0x2d06('0x6'));var logger=require(_0x2d06('0x7'))(_0x2d06('0x8'));var config=require(_0x2d06('0x9'));var jayson=require(_0x2d06('0xa'));var client=jayson[_0x2d06('0xb')][_0x2d06('0xc')]({'port':0x232a});config[_0x2d06('0xd')]=_[_0x2d06('0xe')](config[_0x2d06('0xd')],{'host':_0x2d06('0xf'),'port':0x18eb});var socket=require(_0x2d06('0x10'))(new Redis(config[_0x2d06('0xd')]));require(_0x2d06('0x11'))[_0x2d06('0x12')](socket);function respondWithRpcPromise(_0x16e6d3,_0x82e084,_0x40e510){return new BPromise(function(_0xd9117d,_0x344c29){return client['request'](_0x16e6d3,_0x40e510)[_0x2d06('0x13')](function(_0x5dd5a9){logger[_0x2d06('0x14')](_0x2d06('0x15'),_0x82e084,'request\x20sent');logger[_0x2d06('0x16')](_0x2d06('0x17'),_0x82e084,_0x2d06('0x18'),JSON['stringify'](_0x5dd5a9));if(_0x5dd5a9[_0x2d06('0x19')]){if(_0x5dd5a9['error'][_0x2d06('0x1a')]===0x1f4){logger['error'](_0x2d06('0x15'),_0x82e084,_0x5dd5a9['error'][_0x2d06('0x1b')]);return _0x344c29(_0x5dd5a9[_0x2d06('0x19')][_0x2d06('0x1b')]);}logger[_0x2d06('0x19')](_0x2d06('0x15'),_0x82e084,_0x5dd5a9[_0x2d06('0x19')][_0x2d06('0x1b')]);return _0xd9117d(_0x5dd5a9['error'][_0x2d06('0x1b')]);}else{logger['info'](_0x2d06('0x15'),_0x82e084,_0x2d06('0x18'));_0xd9117d(_0x5dd5a9['result'][_0x2d06('0x1b')]);}})['catch'](function(_0x3310bf){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x82e084,_0x3310bf);_0x344c29(_0x3310bf);});});}exports[_0x2d06('0x1c')]=function(_0x4f0a96){var _0x4ed3ee=this;return new Promise(function(_0x318168,_0x2bf91e){return db['ChatInteraction'][_0x2d06('0x1d')](_0x4f0a96[_0x2d06('0x1e')],{'raw':_0x4f0a96[_0x2d06('0x1f')]?_0x4f0a96[_0x2d06('0x1f')][_0x2d06('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f0a96[_0x2d06('0x1f')]?_0x4f0a96[_0x2d06('0x1f')][_0x2d06('0x21')]||null:null,'attributes':_0x4f0a96[_0x2d06('0x1f')]?_0x4f0a96[_0x2d06('0x1f')][_0x2d06('0x22')]||null:null,'limit':_0x4f0a96[_0x2d06('0x1f')]?_0x4f0a96[_0x2d06('0x1f')]['limit']||null:null})[_0x2d06('0x13')](function(_0x5b97f4){logger[_0x2d06('0x14')](_0x2d06('0x1c'),_0x4f0a96);logger[_0x2d06('0x16')](_0x2d06('0x1c'),_0x4f0a96,JSON[_0x2d06('0x23')](_0x5b97f4));_0x318168(_0x5b97f4);})[_0x2d06('0x24')](function(_0x3271c7){logger[_0x2d06('0x19')]('UpdateChatInteraction',_0x3271c7[_0x2d06('0x1b')],_0x4f0a96);_0x2bf91e(_0x4ed3ee[_0x2d06('0x19')](0x1f4,_0x3271c7['message']));});});};exports[_0x2d06('0x25')]=function(_0x8a2f80){return new Promise(function(_0x2d26a7,_0x5d91ac){return db['ChatInteraction'][_0x2d06('0x26')]({'where':_0x8a2f80[_0x2d06('0x1f')]?_0x8a2f80[_0x2d06('0x1f')][_0x2d06('0x21')]||null:null})[_0x2d06('0x13')](function(_0x1096a9){if(_0x1096a9){return _0x1096a9[_0x2d06('0x27')](_0x8a2f80[_0x2d06('0x1e')][_0x2d06('0x28')],_[_0x2d06('0x29')](_0x8a2f80[_0x2d06('0x1e')],['ids','id'])||{});}})[_0x2d06('0x2a')](function(_0x37ce58){logger[_0x2d06('0x14')](_0x2d06('0x2b'),_0x8a2f80);logger[_0x2d06('0x16')](_0x2d06('0x2b'),_0x8a2f80,JSON['stringify'](_0x37ce58));_0x2d26a7(_0x37ce58);})[_0x2d06('0x24')](function(_0x186c7f){logger[_0x2d06('0x19')](_0x2d06('0x2b'),_0x186c7f[_0x2d06('0x1b')],_0x8a2f80);_0x5d91ac(_this[_0x2d06('0x19')](0x1f4,_0x186c7f[_0x2d06('0x1b')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 4909465..f1db2d5 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 _0xb763=['save','remove','update','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events'];(function(_0x35b211,_0x4276a4){var _0x23c359=function(_0x34fde2){while(--_0x34fde2){_0x35b211['push'](_0x35b211['shift']());}};_0x23c359(++_0x4276a4);}(_0xb763,0x155));var _0x3b76=function(_0x3380f0,_0x2094c6){_0x3380f0=_0x3380f0-0x0;var _0x2a0e64=_0xb763[_0x3380f0];return _0x2a0e64;};'use strict';var ChatInteractionEvents=require(_0x3b76('0x0'));var events=[_0x3b76('0x1'),_0x3b76('0x2'),_0x3b76('0x3')];function createListener(_0x535caf,_0x5d966d){return function(_0x2f6e42){_0x5d966d[_0x3b76('0x4')](_0x535caf,_0x2f6e42);};}function removeListener(_0x32b878,_0x222d63){return function(){ChatInteractionEvents[_0x3b76('0x5')](_0x32b878,_0x222d63);};}exports[_0x3b76('0x6')]=function(_0x54f432){for(var _0x4c5a23=0x0,_0x4a0428=events[_0x3b76('0x7')];_0x4c5a23<_0x4a0428;_0x4c5a23++){var _0xe60f92=events[_0x4c5a23];var _0x4b7b35=createListener(_0x3b76('0x8')+_0xe60f92,_0x54f432);ChatInteractionEvents['on'](_0xe60f92,_0x4b7b35);}};
\ No newline at end of file
+var _0xea85=['removeListener','register','length','chatInteraction:','./chatInteraction.events','save','remove','update','emit'];(function(_0x26a591,_0x2202a6){var _0x25bbc3=function(_0x34ba10){while(--_0x34ba10){_0x26a591['push'](_0x26a591['shift']());}};_0x25bbc3(++_0x2202a6);}(_0xea85,0x1ea));var _0x5ea8=function(_0x2dcc5e,_0xee1ec2){_0x2dcc5e=_0x2dcc5e-0x0;var _0x40c2d4=_0xea85[_0x2dcc5e];return _0x40c2d4;};'use strict';var ChatInteractionEvents=require(_0x5ea8('0x0'));var events=[_0x5ea8('0x1'),_0x5ea8('0x2'),_0x5ea8('0x3')];function createListener(_0x664ad7,_0x483e29){return function(_0x2a620b){_0x483e29[_0x5ea8('0x4')](_0x664ad7,_0x2a620b);};}function removeListener(_0x159005,_0x2e9052){return function(){ChatInteractionEvents[_0x5ea8('0x5')](_0x159005,_0x2e9052);};}exports[_0x5ea8('0x6')]=function(_0x4f5975){for(var _0x563fc9=0x0,_0x333b3c=events[_0x5ea8('0x7')];_0x563fc9<_0x333b3c;_0x563fc9++){var _0x2f4142=events[_0x563fc9];var _0x20dd3c=createListener(_0x5ea8('0x8')+_0x2f4142,_0x4f5975);ChatInteractionEvents['on'](_0x2f4142,_0x20dd3c);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 5b134c8..6fbef4e 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 _0xdb3d=['/:id/vidaoo','diskStorage','server/files/attachments/','originalname','/:id/attachment_upload','single','file','post','addMessage','/:id/tags','tracked','chat','addTags','put','update','/:id/custom_update','/:id/abandon','abandon','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','isAuthenticated','get','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages','download'];(function(_0x51c491,_0x3df387){var _0x41a29a=function(_0x2f7dec){while(--_0x2f7dec){_0x51c491['push'](_0x51c491['shift']());}};_0x41a29a(++_0x3df387);}(_0xdb3d,0xa2));var _0xddb3=function(_0x179170,_0x414a7a){_0x179170=_0x179170-0x0;var _0x2e0aac=_0xdb3d[_0x179170];return _0x2e0aac;};'use strict';var multer=require(_0xddb3('0x0'));var util=require(_0xddb3('0x1'));var path=require(_0xddb3('0x2'));var timeout=require(_0xddb3('0x3'));var express=require(_0xddb3('0x4'));var router=express['Router']();var fs_extra=require(_0xddb3('0x5'));var auth=require(_0xddb3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xddb3('0x7'));var controller=require(_0xddb3('0x8'));router['get']('/',auth[_0xddb3('0x9')](),controller['index']);router[_0xddb3('0xa')](_0xddb3('0xb'),auth[_0xddb3('0x9')](),controller[_0xddb3('0xc')]);router['get'](_0xddb3('0xd'),auth[_0xddb3('0xe')](),controller[_0xddb3('0xf')]);router[_0xddb3('0xa')](_0xddb3('0x10'),auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router[_0xddb3('0xa')](_0xddb3('0x11'),auth[_0xddb3('0x9')](),controller[_0xddb3('0x12')]);router[_0xddb3('0xa')](_0xddb3('0x13'),auth[_0xddb3('0xe')](),controller[_0xddb3('0x14')]);router[_0xddb3('0xa')]('/:id/download',auth[_0xddb3('0x9')](),controller[_0xddb3('0x15')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xddb3('0x16'),auth['isAuthenticated'](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xddb3('0x17')]({'destination':function(_0x363c41,_0x102070,_0x25df61){_0x25df61(null,path['join'](config['root'],_0xddb3('0x18')));},'filename':function(_0x15e317,_0x5503d8,_0x342339){_0x342339(null,util['format']('%s-%s',Date['now'](),_0x5503d8[_0xddb3('0x19')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xddb3('0x1a'),upload[_0xddb3('0x1b')](_0xddb3('0x1c')),controller['attachmentUpload']);router[_0xddb3('0x1d')](_0xddb3('0x11'),auth[_0xddb3('0xe')](),controller[_0xddb3('0x1e')]);router['post'](_0xddb3('0x1f'),auth['isAuthenticated'](),interaction[_0xddb3('0x20')](_0xddb3('0x21'),'chatinteraction:addtags'),controller[_0xddb3('0x22')]);router[_0xddb3('0x23')](_0xddb3('0xd'),auth['isAuthenticated'](),interaction[_0xddb3('0x20')](_0xddb3('0x21'),'chatinteraction:update'),controller[_0xddb3('0x24')]);router[_0xddb3('0x23')](_0xddb3('0x25'),controller['customUpdate']);router[_0xddb3('0x23')](_0xddb3('0x26'),auth[_0xddb3('0xe')](),controller[_0xddb3('0x27')]);router['put']('/:id/close',controller[_0xddb3('0x28')]);router[_0xddb3('0x29')](_0xddb3('0xd'),auth[_0xddb3('0x9')](),interaction[_0xddb3('0x20')](_0xddb3('0x21'),_0xddb3('0x2a')),controller[_0xddb3('0x2b')]);router[_0xddb3('0x29')]('/:id/tags',auth['isAuthenticated'](),controller[_0xddb3('0x2c')]);module[_0xddb3('0x2d')]=router;
\ No newline at end of file
+var _0xb18f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','/describe','describe','get','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','%s-%s','now','originalname','replace','/:id/attachment_upload','addMessage','tracked','chatinteraction:addtags','put','chatinteraction:update','update','customUpdate','/:id/close','close','delete','chat','destroy','removeTags','exports','multer','path','connect-timeout','Router','fs-extra'];(function(_0x39d182,_0x4c4547){var _0x575302=function(_0x10b878){while(--_0x10b878){_0x39d182['push'](_0x39d182['shift']());}};_0x575302(++_0x4c4547);}(_0xb18f,0x91));var _0xfb18=function(_0x27091c,_0x309348){_0x27091c=_0x27091c-0x0;var _0x3ad65a=_0xb18f[_0x27091c];return _0x3ad65a;};'use strict';var multer=require(_0xfb18('0x0'));var util=require('util');var path=require(_0xfb18('0x1'));var timeout=require(_0xfb18('0x2'));var express=require('express');var router=express[_0xfb18('0x3')]();var fs_extra=require(_0xfb18('0x4'));var auth=require(_0xfb18('0x5'));var interaction=require(_0xfb18('0x6'));var config=require(_0xfb18('0x7'));var controller=require(_0xfb18('0x8'));router['get']('/',auth[_0xfb18('0x9')](),controller['index']);router['get'](_0xfb18('0xa'),auth[_0xfb18('0x9')](),controller[_0xfb18('0xb')]);router[_0xfb18('0xc')](_0xfb18('0xd'),auth[_0xfb18('0xe')](),controller[_0xfb18('0xf')]);router[_0xfb18('0xc')](_0xfb18('0x10'),auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router[_0xfb18('0xc')](_0xfb18('0x11'),auth[_0xfb18('0x9')](),controller[_0xfb18('0x12')]);router[_0xfb18('0xc')](_0xfb18('0x13'),auth[_0xfb18('0xe')](),controller[_0xfb18('0x14')]);router[_0xfb18('0xc')](_0xfb18('0x15'),auth['isAuthenticated'](),controller[_0xfb18('0x16')]);router['post']('/',auth[_0xfb18('0x9')](),controller[_0xfb18('0x17')]);router[_0xfb18('0x18')](_0xfb18('0x19'),auth['isAuthenticated'](),controller[_0xfb18('0x1a')]);var upload=multer({'storage':multer[_0xfb18('0x1b')]({'destination':function(_0x51d6af,_0x352c92,_0x2b1e0a){_0x2b1e0a(null,path[_0xfb18('0x1c')](config[_0xfb18('0x1d')],_0xfb18('0x1e')));},'filename':function(_0x4fe169,_0xadf240,_0x3ae776){_0x3ae776(null,util['format'](_0xfb18('0x1f'),Date[_0xfb18('0x20')](),_0xadf240[_0xfb18('0x21')][_0xfb18('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xfb18('0x23'),upload['single']('file'),controller['attachmentUpload']);router[_0xfb18('0x18')](_0xfb18('0x11'),auth['isChatInteractionAuthorized'](),controller[_0xfb18('0x24')]);router[_0xfb18('0x18')]('/:id/tags',auth['isAuthenticated'](),interaction[_0xfb18('0x25')]('chat',_0xfb18('0x26')),controller['addTags']);router[_0xfb18('0x27')]('/:id',auth[_0xfb18('0x9')](),interaction[_0xfb18('0x25')]('chat',_0xfb18('0x28')),controller[_0xfb18('0x29')]);router[_0xfb18('0x27')]('/:id/custom_update',controller[_0xfb18('0x2a')]);router[_0xfb18('0x27')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller['abandon']);router[_0xfb18('0x27')](_0xfb18('0x2b'),controller[_0xfb18('0x2c')]);router[_0xfb18('0x2d')](_0xfb18('0xd'),auth[_0xfb18('0x9')](),interaction[_0xfb18('0x25')](_0xfb18('0x2e'),'chatinteraction:destroy'),controller[_0xfb18('0x2f')]);router[_0xfb18('0x2d')]('/:id/tags',auth[_0xfb18('0x9')](),controller[_0xfb18('0x30')]);module[_0xfb18('0x31')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 5cdbb51..7877309 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 _0xcd1d=['sequelize','BOOLEAN','INTEGER'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xcd1d,0x138));var _0xdcd1=function(_0x5cd1d3,_0x45431e){_0x5cd1d3=_0x5cd1d3-0x0;var _0x3edb7c=_0xcd1d[_0x5cd1d3];return _0x3edb7c;};'use strict';var Sequelize=require(_0xdcd1('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xdcd1('0x1')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xdcd1('0x2')]}};
\ No newline at end of file
+var _0x4daa=['BOOLEAN','medium'];(function(_0x39a3e1,_0x7aea5d){var _0x5c142b=function(_0x3e2233){while(--_0x3e2233){_0x39a3e1['push'](_0x39a3e1['shift']());}};_0x5c142b(++_0x7aea5d);}(_0x4daa,0x1c1));var _0xa4da=function(_0x3e3d0a,_0x4745dd){_0x3e3d0a=_0x3e3d0a-0x0;var _0x3fc765=_0x4daa[_0x3e3d0a];return _0x3fc765;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0xa4da('0x0')),'allowNull':![]},'read':{'type':Sequelize[_0xa4da('0x1')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 684e375..4ce0f35 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 _0xcd9d=['intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','show','params','keys','length','create','body','catch','find','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','fullname','role','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Agents','userProfileId','autoAssociation','push','ToId','read','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','status','end','json','offset','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','filters'];(function(_0x340101,_0x10e146){var _0x41ecad=function(_0x5dbb07){while(--_0x5dbb07){_0x340101['push'](_0x340101['shift']());}};_0x41ecad(++_0x10e146);}(_0xcd9d,0x199));var _0xdcd9=function(_0x2e5480,_0x539dbe){_0x2e5480=_0x2e5480-0x0;var _0x55e079=_0xcd9d[_0x2e5480];return _0x55e079;};'use strict';var emlformat=require(_0xdcd9('0x0'));var rimraf=require(_0xdcd9('0x1'));var zipdir=require(_0xdcd9('0x2'));var jsonpatch=require(_0xdcd9('0x3'));var rp=require(_0xdcd9('0x4'));var moment=require('moment');var BPromise=require(_0xdcd9('0x5'));var Mustache=require('mustache');var util=require(_0xdcd9('0x6'));var path=require(_0xdcd9('0x7'));var sox=require(_0xdcd9('0x8'));var csv=require(_0xdcd9('0x9'));var ejs=require(_0xdcd9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdcd9('0xb'));var squel=require(_0xdcd9('0xc'));var crypto=require(_0xdcd9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xdcd9('0xe'));var toCsv=require(_0xdcd9('0x9'));var querystring=require(_0xdcd9('0xf'));var Papa=require(_0xdcd9('0x10'));var Redis=require(_0xdcd9('0x11'));var authService=require(_0xdcd9('0x12'));var qs=require(_0xdcd9('0x13'));var as=require(_0xdcd9('0x14'));var hardwareService=require(_0xdcd9('0x15'));var logger=require('../../config/logger')(_0xdcd9('0x16'));var utils=require(_0xdcd9('0x17'));var config=require(_0xdcd9('0x18'));var licenseUtil=require(_0xdcd9('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xdcd9('0x1a')](config[_0xdcd9('0x1b')],{'host':_0xdcd9('0x1c'),'port':0x18eb});var socket=require(_0xdcd9('0x1d'))(new Redis(config['redis']));require(_0xdcd9('0x1e'))[_0xdcd9('0x1f')](socket);function respondWithStatusCode(_0x15d634,_0x754ab3){_0x754ab3=_0x754ab3||0xcc;return function(_0x196e19){if(_0x196e19){return _0x15d634['sendStatus'](_0x754ab3);}return _0x15d634[_0xdcd9('0x20')](_0x754ab3)[_0xdcd9('0x21')]();};}function respondWithResult(_0x4ac2c1,_0x4a3f51){_0x4a3f51=_0x4a3f51||0xc8;return function(_0x4d7a14){if(_0x4d7a14){return _0x4ac2c1[_0xdcd9('0x20')](_0x4a3f51)[_0xdcd9('0x22')](_0x4d7a14);}};}function respondWithFilteredResult(_0x10cb4a,_0x27019b){return function(_0x56012e){if(_0x56012e){var _0x3d23b2=typeof _0x27019b[_0xdcd9('0x23')]==='undefined'&&typeof _0x27019b['limit']==='undefined';var _0x14d9b1=_0x56012e[_0xdcd9('0x24')];var _0x496d54=_0x3d23b2?0x0:_0x27019b['offset'];var _0x38175f=_0x3d23b2?_0x56012e['count']:_0x27019b[_0xdcd9('0x23')]+_0x27019b['limit'];var _0x1b84a7;if(_0x38175f>=_0x14d9b1){_0x38175f=_0x14d9b1;_0x1b84a7=0xc8;}else{_0x1b84a7=0xce;}_0x10cb4a[_0xdcd9('0x20')](_0x1b84a7);return _0x10cb4a[_0xdcd9('0x25')](_0xdcd9('0x26'),_0x496d54+'-'+_0x38175f+'/'+_0x14d9b1)[_0xdcd9('0x22')](_0x56012e);}return null;};}function patchUpdates(_0x218700){return function(_0x37f162){try{jsonpatch[_0xdcd9('0x27')](_0x37f162,_0x218700,!![]);}catch(_0x35f181){return BPromise[_0xdcd9('0x28')](_0x35f181);}return _0x37f162[_0xdcd9('0x29')]();};}function saveUpdates(_0x205905,_0x239a83){return function(_0x321ec7){if(_0x321ec7){return _0x321ec7[_0xdcd9('0x2a')](_0x205905)['then'](function(_0x4cbd73){return _0x4cbd73;});}return null;};}function removeEntity(_0x910b33,_0x5ac919){return function(_0x5b40f8){if(_0x5b40f8){return _0x5b40f8[_0xdcd9('0x2b')]()['then'](function(){_0x910b33[_0xdcd9('0x20')](0xcc)[_0xdcd9('0x21')]();});}};}function handleEntityNotFound(_0x3fc702,_0x41fd73){return function(_0x24ec9c){if(!_0x24ec9c){_0x3fc702[_0xdcd9('0x2c')](0x194);}return _0x24ec9c;};}function handleError(_0x267267,_0x2453a6){_0x2453a6=_0x2453a6||0x1f4;return function(_0xc823b3){logger[_0xdcd9('0x2d')](_0xc823b3[_0xdcd9('0x2e')]);if(_0xc823b3[_0xdcd9('0x2f')]){delete _0xc823b3[_0xdcd9('0x2f')];}_0x267267[_0xdcd9('0x20')](_0x2453a6)[_0xdcd9('0x30')](_0xc823b3);};}exports[_0xdcd9('0x31')]=function(_0x58039f,_0x318a50){var _0x59a969={},_0x5172f8={},_0x402fc6={'count':0x0,'rows':[]};var _0x567ae0=_[_0xdcd9('0x32')](db[_0xdcd9('0x33')][_0xdcd9('0x34')],function(_0x103b6a){return{'name':_0x103b6a[_0xdcd9('0x35')],'type':_0x103b6a[_0xdcd9('0x36')][_0xdcd9('0x37')]};});_0x5172f8[_0xdcd9('0x38')]=_[_0xdcd9('0x32')](_0x567ae0,_0xdcd9('0x2f'));_0x5172f8[_0xdcd9('0x39')]=_['keys'](_0x58039f[_0xdcd9('0x39')]);_0x5172f8[_0xdcd9('0x3a')]=_[_0xdcd9('0x3b')](_0x5172f8['model'],_0x5172f8['query']);_0x59a969[_0xdcd9('0x3c')]=_[_0xdcd9('0x3b')](_0x5172f8['model'],qs[_0xdcd9('0x3d')](_0x58039f[_0xdcd9('0x39')][_0xdcd9('0x3d')]));_0x59a969[_0xdcd9('0x3c')]=_0x59a969[_0xdcd9('0x3c')]['length']?_0x59a969[_0xdcd9('0x3c')]:_0x5172f8['model'];if(!_0x58039f[_0xdcd9('0x39')][_0xdcd9('0x3e')](_0xdcd9('0x3f'))){_0x59a969[_0xdcd9('0x40')]=qs[_0xdcd9('0x40')](_0x58039f['query'][_0xdcd9('0x40')]);_0x59a969[_0xdcd9('0x23')]=qs[_0xdcd9('0x23')](_0x58039f[_0xdcd9('0x39')][_0xdcd9('0x23')]);}_0x59a969[_0xdcd9('0x41')]=qs[_0xdcd9('0x42')](_0x58039f[_0xdcd9('0x39')][_0xdcd9('0x42')]);_0x59a969[_0xdcd9('0x43')]=qs['filters'](_[_0xdcd9('0x44')](_0x58039f[_0xdcd9('0x39')],_0x5172f8[_0xdcd9('0x3a')]),_0x567ae0);if(_0x58039f[_0xdcd9('0x39')][_0xdcd9('0x45')]){_0x59a969['where']=_[_0xdcd9('0x46')](_0x59a969['where'],{'$or':_[_0xdcd9('0x32')](_0x567ae0,function(_0x16826){if(_0x16826['type']!==_0xdcd9('0x47')){var _0x4084b3={};_0x4084b3[_0x16826[_0xdcd9('0x2f')]]={'$like':'%'+_0x58039f[_0xdcd9('0x39')][_0xdcd9('0x45')]+'%'};return _0x4084b3;}})});}_0x59a969=_['merge']({},_0x59a969,_0x58039f[_0xdcd9('0x48')]);var _0x246968={'where':_0x59a969[_0xdcd9('0x43')]};return db[_0xdcd9('0x33')][_0xdcd9('0x24')](_0x246968)[_0xdcd9('0x49')](function(_0x163973){_0x402fc6[_0xdcd9('0x24')]=_0x163973;if(_0x58039f['query'][_0xdcd9('0x4a')]){_0x59a969[_0xdcd9('0x4b')]=[{'all':!![]}];}return db[_0xdcd9('0x33')][_0xdcd9('0x4c')](_0x59a969);})[_0xdcd9('0x49')](function(_0x5480e7){_0x402fc6['rows']=_0x5480e7;return _0x402fc6;})[_0xdcd9('0x49')](respondWithFilteredResult(_0x318a50,_0x59a969))['catch'](handleError(_0x318a50,null));};exports[_0xdcd9('0x4d')]=function(_0x2cf3f1,_0x417b53){var _0x8b772e={'raw':!![],'where':{'id':_0x2cf3f1[_0xdcd9('0x4e')]['id']}},_0x49ddf8={};_0x49ddf8['model']=_[_0xdcd9('0x4f')](db[_0xdcd9('0x33')][_0xdcd9('0x34')]);_0x49ddf8[_0xdcd9('0x39')]=_[_0xdcd9('0x4f')](_0x2cf3f1[_0xdcd9('0x39')]);_0x49ddf8[_0xdcd9('0x3a')]=_[_0xdcd9('0x3b')](_0x49ddf8[_0xdcd9('0x38')],_0x49ddf8[_0xdcd9('0x39')]);_0x8b772e[_0xdcd9('0x3c')]=_[_0xdcd9('0x3b')](_0x49ddf8['model'],qs['fields'](_0x2cf3f1['query'][_0xdcd9('0x3d')]));_0x8b772e[_0xdcd9('0x3c')]=_0x8b772e[_0xdcd9('0x3c')][_0xdcd9('0x50')]?_0x8b772e[_0xdcd9('0x3c')]:_0x49ddf8[_0xdcd9('0x38')];if(_0x2cf3f1['query'][_0xdcd9('0x4a')]){_0x8b772e['include']=[{'all':!![]}];}_0x8b772e=_['merge']({},_0x8b772e,_0x2cf3f1[_0xdcd9('0x48')]);return db[_0xdcd9('0x33')]['find'](_0x8b772e)[_0xdcd9('0x49')](handleEntityNotFound(_0x417b53,null))[_0xdcd9('0x49')](respondWithResult(_0x417b53,null))['catch'](handleError(_0x417b53,null));};exports[_0xdcd9('0x51')]=function(_0x2d556a,_0x1a353f){return db[_0xdcd9('0x33')][_0xdcd9('0x51')](_0x2d556a[_0xdcd9('0x52')],{})[_0xdcd9('0x49')](respondWithResult(_0x1a353f,0xc9))[_0xdcd9('0x53')](handleError(_0x1a353f,null));};exports[_0xdcd9('0x2a')]=function(_0x5b85d0,_0x53c893){if(_0x5b85d0[_0xdcd9('0x52')]['id']){delete _0x5b85d0[_0xdcd9('0x52')]['id'];}return db[_0xdcd9('0x33')][_0xdcd9('0x54')]({'where':{'id':_0x5b85d0['params']['id']}})[_0xdcd9('0x49')](handleEntityNotFound(_0x53c893,null))['then'](saveUpdates(_0x5b85d0[_0xdcd9('0x52')],null))[_0xdcd9('0x49')](respondWithResult(_0x53c893,null))[_0xdcd9('0x53')](handleError(_0x53c893,null));};exports[_0xdcd9('0x2b')]=function(_0x4d64c9,_0x9ea72f){return db[_0xdcd9('0x33')][_0xdcd9('0x54')]({'where':{'id':_0x4d64c9[_0xdcd9('0x4e')]['id']}})[_0xdcd9('0x49')](handleEntityNotFound(_0x9ea72f,null))[_0xdcd9('0x49')](removeEntity(_0x9ea72f,null))[_0xdcd9('0x53')](handleError(_0x9ea72f,null));};exports[_0xdcd9('0x55')]=function(_0x3de6f6,_0x272863){return db['ChatInternalMessage'][_0xdcd9('0x55')]()[_0xdcd9('0x49')](respondWithResult(_0x272863,null))[_0xdcd9('0x53')](handleError(_0x272863,null));};function wrapUser(_0xe69a40){return function(_0x391056){var _0x3396f1=_0xe69a40[_0xdcd9('0x56')]({'plain':!![]});_0x3396f1[_0xdcd9('0x57')]=[];if(_0x391056){_0x3396f1[_0xdcd9('0x58')]=_0x391056[_0xdcd9('0x59')];_0x3396f1[_0xdcd9('0x5a')]=_0x391056;}else{_0x3396f1['lastMessageAt']=moment(0x0)[_0xdcd9('0x5b')](_0xdcd9('0x5c'));_0x3396f1['lastMessage']={};}return _0x3396f1;};}exports[_0xdcd9('0x5d')]=function(_0x322ffe,_0x5b2299,_0x4e8886){var _0x122a52=[];return db[_0xdcd9('0x5e')]['findAll']({'where':{'role':[_0xdcd9('0x5f'),_0xdcd9('0x60'),'user']},'attributes':['id',_0xdcd9('0x61'),_0xdcd9('0x2f'),_0xdcd9('0x62'),_0xdcd9('0x63'),_0xdcd9('0x64'),_0xdcd9('0x65'),'lastLoginAt',_0xdcd9('0x66'),_0xdcd9('0x67')],'order':qs[_0xdcd9('0x42')](_0xdcd9('0x68')),'include':[{'model':db[_0xdcd9('0x69')],'as':_0xdcd9('0x6a'),'attributes':['id','name',_0xdcd9('0x36')],'through':{'attributes':[]}}]})[_0xdcd9('0x49')](function(_0x5d0eeb){if(_0x5d0eeb){var _0xbd1961=_0x322ffe['user'][_0xdcd9('0x56')]({'plain':!![]});if(!_0xbd1961)throw new Error(_0xdcd9('0x6b'));if(_0xbd1961[_0xdcd9('0x62')]===_0xdcd9('0x6c')){return db[_0xdcd9('0x6d')]['find']({'where':{'name':_0xdcd9('0x6e'),'userProfileId':_0xbd1961[_0xdcd9('0x6f')]},'raw':!![]})['then'](function(_0x4f2a8e){if(_0x4f2a8e){if(_0x4f2a8e[_0xdcd9('0x70')]===0x0){return db['UserProfileResource'][_0xdcd9('0x4c')]({'where':{'sectionId':_0x4f2a8e['id']},'raw':!![]})['then'](function(_0x3356a0){var _0x2df4ab=[];if(_['isEmpty'](_0x3356a0)){_0x2df4ab=_['filter'](_0x5d0eeb,function(_0xd966f1){if(_0xd966f1[_0xdcd9('0x62')]!==_0xdcd9('0x5f')){return _0xd966f1;}});return _0x2df4ab;}else{for(var _0x1251eb=0x0;_0x1251eb<_0x5d0eeb['length'];_0x1251eb++){var _0x1e8ac5=_0x5d0eeb[_0x1251eb];if(_0x1e8ac5['role']===_0xdcd9('0x5f')){var _0x524c70=_[_0xdcd9('0x54')](_0x3356a0,function(_0x2a4106){return _0x2a4106['resourceId']===_0x1e8ac5['id'];});if(_0x524c70)_0x2df4ab[_0xdcd9('0x71')](_0x1e8ac5);}else{_0x2df4ab[_0xdcd9('0x71')](_0x1e8ac5);}}return _0x2df4ab;}});}else{return _0x5d0eeb;}}else{var _0x4cafef=_['filter'](_0x5d0eeb,function(_0x2d696c){if(_0x2d696c[_0xdcd9('0x62')]!==_0xdcd9('0x5f')){return _0x2d696c;}});return _0x4cafef;}});}else{return _0x5d0eeb;}}})['then'](function(_0x4e85a7){var _0x1bf3b6=[];if(_0x4e85a7){_0x122a52=_0x4e85a7;for(var _0x5237e8=0x0;_0x5237e8<_0x4e85a7['length'];_0x5237e8+=0x1){_0x122a52[_0x5237e8][_0xdcd9('0x57')]=[];_0x1bf3b6[_0xdcd9('0x71')](db[_0xdcd9('0x33')]['find']({'where':{'FromId':[_0x322ffe[_0xdcd9('0x6c')]['id'],_0x4e85a7[_0x5237e8]['id']],'ToId':[_0x322ffe[_0xdcd9('0x6c')]['id'],_0x4e85a7[_0x5237e8]['id']],'ChatGroupId':null},'attributes':['id',_0xdcd9('0x59'),'FromId',_0xdcd9('0x72'),_0xdcd9('0x73'),_0xdcd9('0x52')],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xdcd9('0x49')](wrapUser(_0x4e85a7[_0x5237e8])));}return BPromise[_0xdcd9('0x74')](_0x1bf3b6);}return[];})['then'](function(_0x15f70d){return{'rows':_0x15f70d,'count':_0x15f70d[_0xdcd9('0x50')]};})[_0xdcd9('0x49')](respondWithResult(_0x5b2299,null))['catch'](handleError(_0x5b2299,null));};
\ No newline at end of file
+var _0x8a20=['../../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','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','ChatInternalMessage','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','isEmpty','length','resourceId','push','FromId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x39fe18,_0x5a2db7){var _0x9fc66b=function(_0x408b30){while(--_0x408b30){_0x39fe18['push'](_0x39fe18['shift']());}};_0x9fc66b(++_0x5a2db7);}(_0x8a20,0x14e));var _0x08a2=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x8a20[_0x160c73];return _0xd9302;};'use strict';var emlformat=require(_0x08a2('0x0'));var rimraf=require(_0x08a2('0x1'));var zipdir=require(_0x08a2('0x2'));var jsonpatch=require(_0x08a2('0x3'));var rp=require('request-promise');var moment=require(_0x08a2('0x4'));var BPromise=require(_0x08a2('0x5'));var Mustache=require(_0x08a2('0x6'));var util=require('util');var path=require(_0x08a2('0x7'));var sox=require('sox');var csv=require(_0x08a2('0x8'));var ejs=require(_0x08a2('0x9'));var fs=require('fs');var fs_extra=require(_0x08a2('0xa'));var _=require(_0x08a2('0xb'));var squel=require(_0x08a2('0xc'));var crypto=require(_0x08a2('0xd'));var jsforce=require(_0x08a2('0xe'));var deskjs=require(_0x08a2('0xf'));var toCsv=require('to-csv');var querystring=require(_0x08a2('0x10'));var Papa=require('papaparse');var Redis=require(_0x08a2('0x11'));var authService=require(_0x08a2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x08a2('0x13'));var hardwareService=require(_0x08a2('0x14'));var logger=require(_0x08a2('0x15'))(_0x08a2('0x16'));var utils=require(_0x08a2('0x17'));var config=require(_0x08a2('0x18'));var licenseUtil=require(_0x08a2('0x19'));var db=require(_0x08a2('0x1a'))['db'];config[_0x08a2('0x1b')]=_[_0x08a2('0x1c')](config[_0x08a2('0x1b')],{'host':_0x08a2('0x1d'),'port':0x18eb});var socket=require(_0x08a2('0x1e'))(new Redis(config[_0x08a2('0x1b')]));require(_0x08a2('0x1f'))[_0x08a2('0x20')](socket);function respondWithStatusCode(_0x1cec65,_0x523eff){_0x523eff=_0x523eff||0xcc;return function(_0x9fd3ff){if(_0x9fd3ff){return _0x1cec65['sendStatus'](_0x523eff);}return _0x1cec65['status'](_0x523eff)[_0x08a2('0x21')]();};}function respondWithResult(_0x313119,_0x267dfa){_0x267dfa=_0x267dfa||0xc8;return function(_0x5ae8db){if(_0x5ae8db){return _0x313119[_0x08a2('0x22')](_0x267dfa)[_0x08a2('0x23')](_0x5ae8db);}};}function respondWithFilteredResult(_0x4a299c,_0x26b48d){return function(_0x21deea){if(_0x21deea){var _0x508540=typeof _0x26b48d[_0x08a2('0x24')]===_0x08a2('0x25')&&typeof _0x26b48d[_0x08a2('0x26')]==='undefined';var _0x3e6190=_0x21deea[_0x08a2('0x27')];var _0x29f29d=_0x508540?0x0:_0x26b48d[_0x08a2('0x24')];var _0x3b5621=_0x508540?_0x21deea['count']:_0x26b48d['offset']+_0x26b48d[_0x08a2('0x26')];var _0x1bffd3;if(_0x3b5621>=_0x3e6190){_0x3b5621=_0x3e6190;_0x1bffd3=0xc8;}else{_0x1bffd3=0xce;}_0x4a299c[_0x08a2('0x22')](_0x1bffd3);return _0x4a299c[_0x08a2('0x28')](_0x08a2('0x29'),_0x29f29d+'-'+_0x3b5621+'/'+_0x3e6190)[_0x08a2('0x23')](_0x21deea);}return null;};}function patchUpdates(_0x4778b1){return function(_0x49137a){try{jsonpatch[_0x08a2('0x2a')](_0x49137a,_0x4778b1,!![]);}catch(_0x14fc52){return BPromise[_0x08a2('0x2b')](_0x14fc52);}return _0x49137a['save']();};}function saveUpdates(_0x28aac,_0x487596){return function(_0x30ac06){if(_0x30ac06){return _0x30ac06[_0x08a2('0x2c')](_0x28aac)[_0x08a2('0x2d')](function(_0x437ecd){return _0x437ecd;});}return null;};}function removeEntity(_0x1a6bb5,_0x16e0dd){return function(_0x14ac39){if(_0x14ac39){return _0x14ac39[_0x08a2('0x2e')]()[_0x08a2('0x2d')](function(){_0x1a6bb5[_0x08a2('0x22')](0xcc)[_0x08a2('0x21')]();});}};}function handleEntityNotFound(_0x3aaac7,_0x50b518){return function(_0x1d1049){if(!_0x1d1049){_0x3aaac7['sendStatus'](0x194);}return _0x1d1049;};}function handleError(_0x415fce,_0x1a9e2c){_0x1a9e2c=_0x1a9e2c||0x1f4;return function(_0x16c435){logger[_0x08a2('0x2f')](_0x16c435[_0x08a2('0x30')]);if(_0x16c435[_0x08a2('0x31')]){delete _0x16c435[_0x08a2('0x31')];}_0x415fce[_0x08a2('0x22')](_0x1a9e2c)[_0x08a2('0x32')](_0x16c435);};}exports[_0x08a2('0x33')]=function(_0x4d0d70,_0x15d4e1){var _0x106733={},_0x436cfc={},_0x85944a={'count':0x0,'rows':[]};var _0x3b3315=_[_0x08a2('0x34')](db['ChatInternalMessage'][_0x08a2('0x35')],function(_0x4248b4){return{'name':_0x4248b4['fieldName'],'type':_0x4248b4[_0x08a2('0x36')][_0x08a2('0x37')]};});_0x436cfc['model']=_[_0x08a2('0x34')](_0x3b3315,'name');_0x436cfc[_0x08a2('0x38')]=_[_0x08a2('0x39')](_0x4d0d70[_0x08a2('0x38')]);_0x436cfc[_0x08a2('0x3a')]=_[_0x08a2('0x3b')](_0x436cfc['model'],_0x436cfc[_0x08a2('0x38')]);_0x106733['attributes']=_[_0x08a2('0x3b')](_0x436cfc[_0x08a2('0x3c')],qs[_0x08a2('0x3d')](_0x4d0d70[_0x08a2('0x38')]['fields']));_0x106733['attributes']=_0x106733['attributes']['length']?_0x106733[_0x08a2('0x3e')]:_0x436cfc[_0x08a2('0x3c')];if(!_0x4d0d70[_0x08a2('0x38')][_0x08a2('0x3f')]('nolimit')){_0x106733[_0x08a2('0x26')]=qs[_0x08a2('0x26')](_0x4d0d70[_0x08a2('0x38')][_0x08a2('0x26')]);_0x106733[_0x08a2('0x24')]=qs[_0x08a2('0x24')](_0x4d0d70[_0x08a2('0x38')][_0x08a2('0x24')]);}_0x106733[_0x08a2('0x40')]=qs['sort'](_0x4d0d70[_0x08a2('0x38')][_0x08a2('0x41')]);_0x106733['where']=qs[_0x08a2('0x3a')](_[_0x08a2('0x42')](_0x4d0d70[_0x08a2('0x38')],_0x436cfc[_0x08a2('0x3a')]),_0x3b3315);if(_0x4d0d70['query'][_0x08a2('0x43')]){_0x106733[_0x08a2('0x44')]=_[_0x08a2('0x45')](_0x106733['where'],{'$or':_['map'](_0x3b3315,function(_0x25f8d5){if(_0x25f8d5['type']!==_0x08a2('0x46')){var _0x3a7d81={};_0x3a7d81[_0x25f8d5['name']]={'$like':'%'+_0x4d0d70[_0x08a2('0x38')][_0x08a2('0x43')]+'%'};return _0x3a7d81;}})});}_0x106733=_[_0x08a2('0x45')]({},_0x106733,_0x4d0d70['options']);var _0x341132={'where':_0x106733[_0x08a2('0x44')]};return db[_0x08a2('0x47')][_0x08a2('0x27')](_0x341132)['then'](function(_0x54c019){_0x85944a[_0x08a2('0x27')]=_0x54c019;if(_0x4d0d70[_0x08a2('0x38')][_0x08a2('0x48')]){_0x106733[_0x08a2('0x49')]=[{'all':!![]}];}return db[_0x08a2('0x47')][_0x08a2('0x4a')](_0x106733);})[_0x08a2('0x2d')](function(_0x416504){_0x85944a[_0x08a2('0x4b')]=_0x416504;return _0x85944a;})[_0x08a2('0x2d')](respondWithFilteredResult(_0x15d4e1,_0x106733))[_0x08a2('0x4c')](handleError(_0x15d4e1,null));};exports[_0x08a2('0x4d')]=function(_0x55cc7a,_0x5f5391){var _0x3fde89={'raw':!![],'where':{'id':_0x55cc7a[_0x08a2('0x4e')]['id']}},_0x19267b={};_0x19267b[_0x08a2('0x3c')]=_[_0x08a2('0x39')](db[_0x08a2('0x47')]['rawAttributes']);_0x19267b[_0x08a2('0x38')]=_[_0x08a2('0x39')](_0x55cc7a['query']);_0x19267b[_0x08a2('0x3a')]=_['intersection'](_0x19267b[_0x08a2('0x3c')],_0x19267b[_0x08a2('0x38')]);_0x3fde89[_0x08a2('0x3e')]=_['intersection'](_0x19267b[_0x08a2('0x3c')],qs[_0x08a2('0x3d')](_0x55cc7a[_0x08a2('0x38')][_0x08a2('0x3d')]));_0x3fde89[_0x08a2('0x3e')]=_0x3fde89[_0x08a2('0x3e')]['length']?_0x3fde89[_0x08a2('0x3e')]:_0x19267b[_0x08a2('0x3c')];if(_0x55cc7a['query'][_0x08a2('0x48')]){_0x3fde89[_0x08a2('0x49')]=[{'all':!![]}];}_0x3fde89=_[_0x08a2('0x45')]({},_0x3fde89,_0x55cc7a[_0x08a2('0x4f')]);return db[_0x08a2('0x47')][_0x08a2('0x50')](_0x3fde89)[_0x08a2('0x2d')](handleEntityNotFound(_0x5f5391,null))[_0x08a2('0x2d')](respondWithResult(_0x5f5391,null))[_0x08a2('0x4c')](handleError(_0x5f5391,null));};exports[_0x08a2('0x51')]=function(_0x40dc0c,_0x8f39a1){return db[_0x08a2('0x47')][_0x08a2('0x51')](_0x40dc0c[_0x08a2('0x52')],{})[_0x08a2('0x2d')](respondWithResult(_0x8f39a1,0xc9))['catch'](handleError(_0x8f39a1,null));};exports[_0x08a2('0x2c')]=function(_0x17fe4f,_0x51494c){if(_0x17fe4f[_0x08a2('0x52')]['id']){delete _0x17fe4f[_0x08a2('0x52')]['id'];}return db[_0x08a2('0x47')][_0x08a2('0x50')]({'where':{'id':_0x17fe4f[_0x08a2('0x4e')]['id']}})[_0x08a2('0x2d')](handleEntityNotFound(_0x51494c,null))['then'](saveUpdates(_0x17fe4f[_0x08a2('0x52')],null))[_0x08a2('0x2d')](respondWithResult(_0x51494c,null))[_0x08a2('0x4c')](handleError(_0x51494c,null));};exports[_0x08a2('0x2e')]=function(_0x447065,_0x13f789){return db[_0x08a2('0x47')][_0x08a2('0x50')]({'where':{'id':_0x447065[_0x08a2('0x4e')]['id']}})[_0x08a2('0x2d')](handleEntityNotFound(_0x13f789,null))[_0x08a2('0x2d')](removeEntity(_0x13f789,null))['catch'](handleError(_0x13f789,null));};exports[_0x08a2('0x53')]=function(_0x48ec2a,_0x451159){return db[_0x08a2('0x47')][_0x08a2('0x53')]()[_0x08a2('0x2d')](respondWithResult(_0x451159,null))[_0x08a2('0x4c')](handleError(_0x451159,null));};function wrapUser(_0x3d6055){return function(_0x471e3b){var _0x59f9e3=_0x3d6055[_0x08a2('0x54')]({'plain':!![]});_0x59f9e3[_0x08a2('0x55')]=[];if(_0x471e3b){_0x59f9e3[_0x08a2('0x56')]=_0x471e3b[_0x08a2('0x57')];_0x59f9e3[_0x08a2('0x58')]=_0x471e3b;}else{_0x59f9e3[_0x08a2('0x56')]=moment(0x0)[_0x08a2('0x59')](_0x08a2('0x5a'));_0x59f9e3[_0x08a2('0x58')]={};}return _0x59f9e3;};}exports[_0x08a2('0x5b')]=function(_0x5040af,_0x2f13c1,_0x4caaa6){var _0x3278a7=[];return db[_0x08a2('0x5c')]['findAll']({'where':{'role':[_0x08a2('0x5d'),_0x08a2('0x5e'),_0x08a2('0x5f')]},'attributes':['id',_0x08a2('0x60'),_0x08a2('0x31'),_0x08a2('0x61'),_0x08a2('0x62'),_0x08a2('0x63'),_0x08a2('0x64'),'lastLoginAt',_0x08a2('0x65'),_0x08a2('0x66')],'order':qs['sort'](_0x08a2('0x67')),'include':[{'model':db[_0x08a2('0x68')],'as':_0x08a2('0x69'),'attributes':['id',_0x08a2('0x31'),_0x08a2('0x36')],'through':{'attributes':[]}}]})[_0x08a2('0x2d')](function(_0x16a12c){if(_0x16a12c){var _0x5dc640=_0x5040af[_0x08a2('0x5f')][_0x08a2('0x54')]({'plain':!![]});if(!_0x5dc640)throw new Error(_0x08a2('0x6a'));if(_0x5dc640[_0x08a2('0x61')]===_0x08a2('0x5f')){return db[_0x08a2('0x6b')][_0x08a2('0x50')]({'where':{'name':'Agents','userProfileId':_0x5dc640[_0x08a2('0x6c')]},'raw':!![]})[_0x08a2('0x2d')](function(_0x476ad1){if(_0x476ad1){if(_0x476ad1[_0x08a2('0x6d')]===0x0){return db[_0x08a2('0x6e')][_0x08a2('0x4a')]({'where':{'sectionId':_0x476ad1['id']},'raw':!![]})[_0x08a2('0x2d')](function(_0x5adf01){var _0x5bc953=[];if(_[_0x08a2('0x6f')](_0x5adf01)){_0x5bc953=_[_0x08a2('0x43')](_0x16a12c,function(_0x1417c3){if(_0x1417c3[_0x08a2('0x61')]!==_0x08a2('0x5d')){return _0x1417c3;}});return _0x5bc953;}else{for(var _0x138b26=0x0;_0x138b26<_0x16a12c[_0x08a2('0x70')];_0x138b26++){var _0x15f291=_0x16a12c[_0x138b26];if(_0x15f291[_0x08a2('0x61')]==='agent'){var _0x195486=_[_0x08a2('0x50')](_0x5adf01,function(_0x2db0d4){return _0x2db0d4[_0x08a2('0x71')]===_0x15f291['id'];});if(_0x195486)_0x5bc953[_0x08a2('0x72')](_0x15f291);}else{_0x5bc953[_0x08a2('0x72')](_0x15f291);}}return _0x5bc953;}});}else{return _0x16a12c;}}else{var _0x433c21=_['filter'](_0x16a12c,function(_0x52eff6){if(_0x52eff6['role']!==_0x08a2('0x5d')){return _0x52eff6;}});return _0x433c21;}});}else{return _0x16a12c;}}})[_0x08a2('0x2d')](function(_0x4c3a7b){var _0x1de82b=[];if(_0x4c3a7b){_0x3278a7=_0x4c3a7b;for(var _0x497d21=0x0;_0x497d21<_0x4c3a7b['length'];_0x497d21+=0x1){_0x3278a7[_0x497d21][_0x08a2('0x55')]=[];_0x1de82b['push'](db[_0x08a2('0x47')][_0x08a2('0x50')]({'where':{'FromId':[_0x5040af[_0x08a2('0x5f')]['id'],_0x4c3a7b[_0x497d21]['id']],'ToId':[_0x5040af[_0x08a2('0x5f')]['id'],_0x4c3a7b[_0x497d21]['id']],'ChatGroupId':null},'attributes':['id',_0x08a2('0x57'),_0x08a2('0x73'),'ToId',_0x08a2('0x74'),'body'],'order':qs['sort'](_0x08a2('0x75')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x08a2('0x2d')](wrapUser(_0x4c3a7b[_0x497d21])));}return BPromise[_0x08a2('0x76')](_0x1de82b);}return[];})[_0x08a2('0x2d')](function(_0x37a9a2){return{'rows':_0x37a9a2,'count':_0x37a9a2[_0x08a2('0x70')]};})['then'](respondWithResult(_0x2f13c1,null))['catch'](handleError(_0x2f13c1,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index feeabc5..5fc1845 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 _0xf6f3=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update'];(function(_0x19afa1,_0x2314f1){var _0x3a1e9d=function(_0x191d40){while(--_0x191d40){_0x19afa1['push'](_0x19afa1['shift']());}};_0x3a1e9d(++_0x2314f1);}(_0xf6f3,0xd6));var _0x3f6f=function(_0xba6f5,_0x3c7d08){_0xba6f5=_0xba6f5-0x0;var _0x334f46=_0xf6f3[_0xba6f5];return _0x334f46;};'use strict';var EventEmitter=require(_0x3f6f('0x0'));var ChatInternalMessage=require(_0x3f6f('0x1'))['db'][_0x3f6f('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x3f6f('0x3')](0x0);var events={'afterCreate':_0x3f6f('0x4'),'afterUpdate':_0x3f6f('0x5'),'afterDestroy':_0x3f6f('0x6')};function emitEvent(_0x293f79){return function(_0x33e3cf,_0x425fdc,_0x3be385){ChatInternalMessageEvents[_0x3f6f('0x7')](_0x293f79+':'+_0x33e3cf['id'],_0x33e3cf);ChatInternalMessageEvents['emit'](_0x293f79,_0x33e3cf);_0x3be385(null);};}for(var e in events){if(events[_0x3f6f('0x8')](e)){var event=events[e];ChatInternalMessage[_0x3f6f('0x9')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xfd6e=['hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x314a07,_0x5bf266){var _0x5ecb57=function(_0x1416bf){while(--_0x1416bf){_0x314a07['push'](_0x314a07['shift']());}};_0x5ecb57(++_0x5bf266);}(_0xfd6e,0x1b0));var _0xefd6=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xfd6e[_0x3ab51d];return _0x29a04e;};'use strict';var EventEmitter=require(_0xefd6('0x0'));var ChatInternalMessage=require(_0xefd6('0x1'))['db'][_0xefd6('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xefd6('0x3')](0x0);var events={'afterCreate':_0xefd6('0x4'),'afterUpdate':_0xefd6('0x5'),'afterDestroy':'remove'};function emitEvent(_0x433511){return function(_0x839f34,_0x1eb842,_0x2df7ed){ChatInternalMessageEvents[_0xefd6('0x6')](_0x433511+':'+_0x839f34['id'],_0x839f34);ChatInternalMessageEvents[_0xefd6('0x6')](_0x433511,_0x839f34);_0x2df7ed(null);};}for(var e in events){if(events[_0xefd6('0x7')](e)){var event=events[e];ChatInternalMessage[_0xefd6('0x8')](e,emitEvent(event));}}module[_0xefd6('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 bb0f87b..cf32996 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 _0x95ea=['utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','path','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x95ea,0x16a));var _0xa95e=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x95ea[_0x42245d];return _0x4b211a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa95e('0x0'))(_0xa95e('0x1'));var moment=require(_0xa95e('0x2'));var BPromise=require(_0xa95e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa95e('0x4'));var rimraf=require('rimraf');var config=require(_0xa95e('0x5'));var attributes=require(_0xa95e('0x6'));module[_0xa95e('0x7')]=function(_0x47f834,_0x4e7a44){return _0x47f834[_0xa95e('0x8')](_0xa95e('0x9'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa95e('0xa'),'collate':_0xa95e('0xb')});};
\ No newline at end of file
+var _0x4213=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','util'];(function(_0x10616d,_0x55e992){var _0x2b9b47=function(_0x34c345){while(--_0x34c345){_0x10616d['push'](_0x10616d['shift']());}};_0x2b9b47(++_0x55e992);}(_0x4213,0x140));var _0x3421=function(_0x1532ae,_0xa14bcc){_0x1532ae=_0x1532ae-0x0;var _0x5c09d1=_0x4213[_0x1532ae];return _0x5c09d1;};'use strict';var _=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var logger=require(_0x3421('0x2'))(_0x3421('0x3'));var moment=require(_0x3421('0x4'));var BPromise=require(_0x3421('0x5'));var rp=require(_0x3421('0x6'));var fs=require('fs');var path=require(_0x3421('0x7'));var rimraf=require(_0x3421('0x8'));var config=require(_0x3421('0x9'));var attributes=require(_0x3421('0xa'));module['exports']=function(_0x1566de,_0xe1d745){return _0x1566de['define'](_0x3421('0xb'),attributes,{'tableName':_0x3421('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3421('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 42ebb60..a9dc3f9 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 _0xadbd=['then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','register','request'];(function(_0x4923d5,_0x377193){var _0x3de247=function(_0x40d036){while(--_0x40d036){_0x4923d5['push'](_0x4923d5['shift']());}};_0x3de247(++_0x377193);}(_0xadbd,0x150));var _0xdadb=function(_0xda00bc,_0x2af92e){_0xda00bc=_0xda00bc-0x0;var _0x35e2bd=_0xadbd[_0xda00bc];return _0x35e2bd;};'use strict';var _=require(_0xdadb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdadb('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdadb('0x2'))['db'];var utils=require(_0xdadb('0x3'));var logger=require(_0xdadb('0x4'))(_0xdadb('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdadb('0x6')][_0xdadb('0x7')]({'port':0x232a});config[_0xdadb('0x8')]=_[_0xdadb('0x9')](config[_0xdadb('0x8')],{'host':_0xdadb('0xa'),'port':0x18eb});var socket=require(_0xdadb('0xb'))(new Redis(config[_0xdadb('0x8')]));require('./chatInternalMessage.socket')[_0xdadb('0xc')](socket);function respondWithRpcPromise(_0x5b4138,_0x3532c4,_0x24a0d7){return new BPromise(function(_0x2e13b9,_0x2a661e){return client[_0xdadb('0xd')](_0x5b4138,_0x24a0d7)[_0xdadb('0xe')](function(_0x37cc8e){logger[_0xdadb('0xf')](_0xdadb('0x10'),_0x3532c4,_0xdadb('0x11'));logger[_0xdadb('0x12')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x3532c4,_0xdadb('0x11'),JSON[_0xdadb('0x13')](_0x37cc8e));if(_0x37cc8e[_0xdadb('0x14')]){if(_0x37cc8e[_0xdadb('0x14')][_0xdadb('0x15')]===0x1f4){logger[_0xdadb('0x14')](_0xdadb('0x10'),_0x3532c4,_0x37cc8e['error'][_0xdadb('0x16')]);return _0x2a661e(_0x37cc8e['error']['message']);}logger[_0xdadb('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x3532c4,_0x37cc8e['error'][_0xdadb('0x16')]);return _0x2e13b9(_0x37cc8e[_0xdadb('0x14')][_0xdadb('0x16')]);}else{logger[_0xdadb('0xf')](_0xdadb('0x10'),_0x3532c4,_0xdadb('0x11'));_0x2e13b9(_0x37cc8e[_0xdadb('0x17')][_0xdadb('0x16')]);}})[_0xdadb('0x18')](function(_0x3fafb6){logger[_0xdadb('0x14')](_0xdadb('0x10'),_0x3532c4,_0x3fafb6);_0x2a661e(_0x3fafb6);});});}
\ No newline at end of file
+var _0xd370=['rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','register','request','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2a453b,_0x479c50){var _0x132f79=function(_0x5e3d83){while(--_0x5e3d83){_0x2a453b['push'](_0x2a453b['shift']());}};_0x132f79(++_0x479c50);}(_0xd370,0x1d3));var _0x0d37=function(_0x28beaf,_0x122959){_0x28beaf=_0x28beaf-0x0;var _0x2df201=_0xd370[_0x28beaf];return _0x2df201;};'use strict';var _=require(_0x0d37('0x0'));var util=require(_0x0d37('0x1'));var moment=require(_0x0d37('0x2'));var BPromise=require(_0x0d37('0x3'));var rs=require(_0x0d37('0x4'));var fs=require('fs');var Redis=require(_0x0d37('0x5'));var db=require(_0x0d37('0x6'))['db'];var utils=require(_0x0d37('0x7'));var logger=require(_0x0d37('0x8'))(_0x0d37('0x9'));var config=require(_0x0d37('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x0d37('0xb')][_0x0d37('0xc')]({'port':0x232a});config[_0x0d37('0xd')]=_[_0x0d37('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0d37('0xf'))(new Redis(config[_0x0d37('0xd')]));require('./chatInternalMessage.socket')[_0x0d37('0x10')](socket);function respondWithRpcPromise(_0x56a47d,_0x49d2e0,_0x14eede){return new BPromise(function(_0x2afe78,_0x5c1a46){return client[_0x0d37('0x11')](_0x56a47d,_0x14eede)['then'](function(_0x5847f4){logger['info'](_0x0d37('0x12'),_0x49d2e0,_0x0d37('0x13'));logger[_0x0d37('0x14')](_0x0d37('0x15'),_0x49d2e0,'request\x20sent',JSON['stringify'](_0x5847f4));if(_0x5847f4[_0x0d37('0x16')]){if(_0x5847f4[_0x0d37('0x16')][_0x0d37('0x17')]===0x1f4){logger[_0x0d37('0x16')](_0x0d37('0x12'),_0x49d2e0,_0x5847f4['error'][_0x0d37('0x18')]);return _0x5c1a46(_0x5847f4[_0x0d37('0x16')][_0x0d37('0x18')]);}logger[_0x0d37('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x49d2e0,_0x5847f4['error'][_0x0d37('0x18')]);return _0x2afe78(_0x5847f4[_0x0d37('0x16')]['message']);}else{logger[_0x0d37('0x19')](_0x0d37('0x12'),_0x49d2e0,'request\x20sent');_0x2afe78(_0x5847f4[_0x0d37('0x1a')][_0x0d37('0x18')]);}})[_0x0d37('0x1b')](function(_0x5db285){logger[_0x0d37('0x16')](_0x0d37('0x12'),_0x49d2e0,_0x5db285);_0x5c1a46(_0x5db285);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index a47cb47..e2b8527 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 _0x0da6=['length','./chatInternalMessage.events','save','update','emit','register'];(function(_0x1c0567,_0x4c323f){var _0x504619=function(_0x986058){while(--_0x986058){_0x1c0567['push'](_0x1c0567['shift']());}};_0x504619(++_0x4c323f);}(_0x0da6,0x19f));var _0x60da=function(_0x3b0598,_0x15100f){_0x3b0598=_0x3b0598-0x0;var _0x5e2198=_0x0da6[_0x3b0598];return _0x5e2198;};'use strict';var ChatInternalMessageEvents=require(_0x60da('0x0'));var events=[_0x60da('0x1'),'remove',_0x60da('0x2')];function createListener(_0x360c5b,_0x18542a){return function(_0x11cee7){_0x18542a[_0x60da('0x3')](_0x360c5b,_0x11cee7);};}function removeListener(_0x31865d,_0x47b9f9){return function(){ChatInternalMessageEvents['removeListener'](_0x31865d,_0x47b9f9);};}exports[_0x60da('0x4')]=function(_0x396390){for(var _0x5dd7da=0x0,_0x1b3bc3=events[_0x60da('0x5')];_0x5dd7da<_0x1b3bc3;_0x5dd7da++){var _0x32e2dc=events[_0x5dd7da];var _0x107493=createListener('chatInternalMessage:'+_0x32e2dc,_0x396390);ChatInternalMessageEvents['on'](_0x32e2dc,_0x107493);}};
\ No newline at end of file
+var _0xc960=['emit','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xc960,0x114));var _0x0c96=function(_0x12fae2,_0x4045c1){_0x12fae2=_0x12fae2-0x0;var _0x5d6abc=_0xc960[_0x12fae2];return _0x5d6abc;};'use strict';var ChatInternalMessageEvents=require(_0x0c96('0x0'));var events=[_0x0c96('0x1'),_0x0c96('0x2'),_0x0c96('0x3')];function createListener(_0x262812,_0x43699c){return function(_0x1200aa){_0x43699c[_0x0c96('0x4')](_0x262812,_0x1200aa);};}function removeListener(_0x296beb,_0x495e7a){return function(){ChatInternalMessageEvents['removeListener'](_0x296beb,_0x495e7a);};}exports[_0x0c96('0x5')]=function(_0x3b8d56){for(var _0x1aa866=0x0,_0x5886e8=events[_0x0c96('0x6')];_0x1aa866<_0x5886e8;_0x1aa866++){var _0x573004=events[_0x1aa866];var _0x10a702=createListener(_0x0c96('0x7')+_0x573004,_0x3b8d56);ChatInternalMessageEvents['on'](_0x573004,_0x10a702);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index f051f47..6f0f1e2 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 _0x8f6e=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/users','getUsers','/:id','show','post','create','put','update','delete','destroy','exports','util'];(function(_0x78bf40,_0x271697){var _0x4d58be=function(_0x468008){while(--_0x468008){_0x78bf40['push'](_0x78bf40['shift']());}};_0x4d58be(++_0x271697);}(_0x8f6e,0x1cb));var _0xe8f6=function(_0x982859,_0x14be5d){_0x982859=_0x982859-0x0;var _0x27adac=_0x8f6e[_0x982859];return _0x27adac;};'use strict';var multer=require('multer');var util=require(_0xe8f6('0x0'));var path=require(_0xe8f6('0x1'));var timeout=require(_0xe8f6('0x2'));var express=require(_0xe8f6('0x3'));var router=express[_0xe8f6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe8f6('0x5'));var interaction=require(_0xe8f6('0x6'));var config=require(_0xe8f6('0x7'));var controller=require('./chatInternalMessage.controller');router[_0xe8f6('0x8')]('/',auth[_0xe8f6('0x9')](),controller[_0xe8f6('0xa')]);router['get'](_0xe8f6('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xe8f6('0x8')](_0xe8f6('0xc'),auth[_0xe8f6('0x9')](),controller[_0xe8f6('0xd')]);router[_0xe8f6('0x8')](_0xe8f6('0xe'),auth[_0xe8f6('0x9')](),controller[_0xe8f6('0xf')]);router[_0xe8f6('0x10')]('/',auth[_0xe8f6('0x9')](),controller[_0xe8f6('0x11')]);router[_0xe8f6('0x12')](_0xe8f6('0xe'),controller[_0xe8f6('0x13')]);router[_0xe8f6('0x14')](_0xe8f6('0xe'),auth['isAuthenticated'](),controller[_0xe8f6('0x15')]);module[_0xe8f6('0x16')]=router;
\ No newline at end of file
+var _0x30f0=['index','/describe','describe','/users','show','post','create','put','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x30f0,0x12b));var _0x030f=function(_0x3e9784,_0xf05e6e){_0x3e9784=_0x3e9784-0x0;var _0x2994a1=_0x30f0[_0x3e9784];return _0x2994a1;};'use strict';var multer=require(_0x030f('0x0'));var util=require(_0x030f('0x1'));var path=require(_0x030f('0x2'));var timeout=require(_0x030f('0x3'));var express=require(_0x030f('0x4'));var router=express[_0x030f('0x5')]();var fs_extra=require(_0x030f('0x6'));var auth=require(_0x030f('0x7'));var interaction=require(_0x030f('0x8'));var config=require(_0x030f('0x9'));var controller=require(_0x030f('0xa'));router[_0x030f('0xb')]('/',auth[_0x030f('0xc')](),controller[_0x030f('0xd')]);router[_0x030f('0xb')](_0x030f('0xe'),auth[_0x030f('0xc')](),controller[_0x030f('0xf')]);router[_0x030f('0xb')](_0x030f('0x10'),auth[_0x030f('0xc')](),controller['getUsers']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x030f('0x11')]);router[_0x030f('0x12')]('/',auth[_0x030f('0xc')](),controller[_0x030f('0x13')]);router[_0x030f('0x14')](_0x030f('0x15'),controller['update']);router[_0x030f('0x16')](_0x030f('0x15'),auth[_0x030f('0xc')](),controller['destroy']);module[_0x030f('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 701be6e..774dd2e 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 _0x6146=['BOOLEAN','ENUM','out','STRING','sequelize','TEXT','medium'];(function(_0x1667df,_0x266940){var _0x341abf=function(_0x123c3f){while(--_0x123c3f){_0x1667df['push'](_0x1667df['shift']());}};_0x341abf(++_0x266940);}(_0x6146,0xba));var _0x6614=function(_0x4b2090,_0x4cd935){_0x4b2090=_0x4b2090-0x0;var _0x7e8098=_0x6146[_0x4b2090];return _0x7e8098;};'use strict';var Sequelize=require(_0x6614('0x0'));module['exports']={'body':{'type':Sequelize[_0x6614('0x1')](_0x6614('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x6614('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x6614('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6614('0x4')]('in',_0x6614('0x5')),'defaultValue':_0x6614('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x6614('0x6')]},'providerResponse':{'type':Sequelize[_0x6614('0x1')]}};
\ No newline at end of file
+var _0xd2bf=['DATE','STRING','TEXT','sequelize','BOOLEAN','out'];(function(_0x457d1a,_0x6b408d){var _0x51388c=function(_0x478abe){while(--_0x478abe){_0x457d1a['push'](_0x457d1a['shift']());}};_0x51388c(++_0x6b408d);}(_0xd2bf,0x1dd));var _0xfd2b=function(_0x199bc4,_0x338105){_0x199bc4=_0x199bc4-0x0;var _0x136ffb=_0xd2bf[_0x199bc4];return _0x136ffb;};'use strict';var Sequelize=require(_0xfd2b('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xfd2b('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0xfd2b('0x1')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xfd2b('0x2')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xfd2b('0x3')]},'providerName':{'type':Sequelize[_0xfd2b('0x4')]},'providerResponse':{'type':Sequelize[_0xfd2b('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 284cdef..a44dc26 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 _0x0285=['sort','filter','where','VIRTUAL','merge','ChatMessage','includeAll','include','options','find','create','body','params','catch','describe','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','chat-interactions','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','QueryTypes','SELECT','internal','reject','rejectmessage','formData','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','http','request','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','save','update','then','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order'];(function(_0x595609,_0x4d56f3){var _0x3822ba=function(_0x54a3b0){while(--_0x54a3b0){_0x595609['push'](_0x595609['shift']());}};_0x3822ba(++_0x4d56f3);}(_0x0285,0x148));var _0x5028=function(_0x5983ff,_0x4fe79e){_0x5983ff=_0x5983ff-0x0;var _0x51a562=_0x0285[_0x5983ff];return _0x51a562;};'use strict';var emlformat=require(_0x5028('0x0'));var rimraf=require(_0x5028('0x1'));var zipdir=require(_0x5028('0x2'));var jsonpatch=require(_0x5028('0x3'));var rp=require(_0x5028('0x4'));var moment=require(_0x5028('0x5'));var BPromise=require(_0x5028('0x6'));var Mustache=require('mustache');var util=require(_0x5028('0x7'));var path=require(_0x5028('0x8'));var sox=require('sox');var csv=require(_0x5028('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5028('0xa'));var _=require(_0x5028('0xb'));var squel=require(_0x5028('0xc'));var crypto=require(_0x5028('0xd'));var jsforce=require(_0x5028('0xe'));var deskjs=require(_0x5028('0xf'));var toCsv=require(_0x5028('0x9'));var querystring=require(_0x5028('0x10'));var Papa=require('papaparse');var Redis=require(_0x5028('0x11'));var authService=require(_0x5028('0x12'));var qs=require(_0x5028('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5028('0x14'));var logger=require(_0x5028('0x15'))(_0x5028('0x16'));var utils=require('../../config/utils');var config=require(_0x5028('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x5028('0x18')]=_[_0x5028('0x19')](config[_0x5028('0x18')],{'host':_0x5028('0x1a'),'port':0x18eb});var socket=require(_0x5028('0x1b'))(new Redis(config['redis']));require(_0x5028('0x1c'))[_0x5028('0x1d')](socket);var jayson=require(_0x5028('0x1e'));var client=jayson['client'][_0x5028('0x1f')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5add0f,_0x317f25,_0x51006b,_0xd43b39){return new BPromise(function(_0x41f71b,_0x3c17a8){var _0x516e4c=_0xd43b39||client;return _0x516e4c[_0x5028('0x20')](_0x5add0f,_0x51006b)['then'](function(_0x57366a){logger['info'](_0x5028('0x21'),_0x317f25,_0x5028('0x22'));logger[_0x5028('0x23')](_0x5028('0x24'),_0x317f25,_0x5028('0x22'),JSON[_0x5028('0x25')](_0x57366a));if(_0x57366a[_0x5028('0x26')]){if(_0x57366a[_0x5028('0x26')][_0x5028('0x27')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x317f25,_0x57366a[_0x5028('0x26')][_0x5028('0x28')]);return _0x3c17a8(_0x57366a[_0x5028('0x26')][_0x5028('0x28')]);}logger[_0x5028('0x26')](_0x5028('0x21'),_0x317f25,_0x57366a[_0x5028('0x26')][_0x5028('0x28')]);return _0x41f71b(_0x57366a[_0x5028('0x26')][_0x5028('0x28')]);}else{logger[_0x5028('0x29')](_0x5028('0x21'),_0x317f25,'request\x20sent');_0x41f71b(_0x57366a[_0x5028('0x2a')][_0x5028('0x28')]);}})['catch'](function(_0x33e2fb){logger[_0x5028('0x26')]('ChatMessage,\x20%s,\x20%s',_0x317f25,_0x33e2fb);_0x3c17a8(_0x33e2fb);});});}function respondWithStatusCode(_0x1363f6,_0x40f016){_0x40f016=_0x40f016||0xcc;return function(_0x106abc){if(_0x106abc){return _0x1363f6[_0x5028('0x2b')](_0x40f016);}return _0x1363f6[_0x5028('0x2c')](_0x40f016)[_0x5028('0x2d')]();};}function respondWithResult(_0x1be777,_0x1d36b2){_0x1d36b2=_0x1d36b2||0xc8;return function(_0x421cf7){if(_0x421cf7){return _0x1be777[_0x5028('0x2c')](_0x1d36b2)[_0x5028('0x2e')](_0x421cf7);}};}function respondWithFilteredResult(_0x4e2093,_0x58bfa4){return function(_0x5417b5){if(_0x5417b5){var _0x281164=typeof _0x58bfa4[_0x5028('0x2f')]==='undefined'&&typeof _0x58bfa4[_0x5028('0x30')]===_0x5028('0x31');var _0x8ded8b=_0x5417b5[_0x5028('0x32')];var _0x4f42d3=_0x281164?0x0:_0x58bfa4[_0x5028('0x2f')];var _0x47e733=_0x281164?_0x5417b5[_0x5028('0x32')]:_0x58bfa4['offset']+_0x58bfa4[_0x5028('0x30')];var _0xe77763;if(_0x47e733>=_0x8ded8b){_0x47e733=_0x8ded8b;_0xe77763=0xc8;}else{_0xe77763=0xce;}_0x4e2093[_0x5028('0x2c')](_0xe77763);return _0x4e2093['set'](_0x5028('0x33'),_0x4f42d3+'-'+_0x47e733+'/'+_0x8ded8b)[_0x5028('0x2e')](_0x5417b5);}return null;};}function patchUpdates(_0xe3c256){return function(_0x171c12){try{jsonpatch[_0x5028('0x34')](_0x171c12,_0xe3c256,!![]);}catch(_0x592135){return BPromise['reject'](_0x592135);}return _0x171c12[_0x5028('0x35')]();};}function saveUpdates(_0x277a87,_0x3eed19){return function(_0x57f3bf){if(_0x57f3bf){return _0x57f3bf[_0x5028('0x36')](_0x277a87)[_0x5028('0x37')](function(_0x19e571){return _0x19e571;});}return null;};}function removeEntity(_0x330394,_0x3f4929){return function(_0x4f9282){if(_0x4f9282){return _0x4f9282[_0x5028('0x38')]()[_0x5028('0x37')](function(){_0x330394[_0x5028('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2db8b6,_0x577a53){return function(_0x4b4ae6){if(!_0x4b4ae6){_0x2db8b6['sendStatus'](0x194);}return _0x4b4ae6;};}function handleError(_0x1a1f6d,_0x2399ad){_0x2399ad=_0x2399ad||0x1f4;return function(_0x1fde70){logger[_0x5028('0x26')](_0x1fde70[_0x5028('0x39')]);if(_0x1fde70[_0x5028('0x3a')]){delete _0x1fde70['name'];}_0x1a1f6d['status'](_0x2399ad)[_0x5028('0x3b')](_0x1fde70);};}exports[_0x5028('0x3c')]=function(_0x3bef27,_0x707521){var _0x7a5b9d={},_0x1c59f6={},_0x5c2f1f={'count':0x0,'rows':[]};var _0x490a3f=_['map'](db['ChatMessage'][_0x5028('0x3d')],function(_0x205315){return{'name':_0x205315[_0x5028('0x3e')],'type':_0x205315[_0x5028('0x3f')][_0x5028('0x40')]};});_0x1c59f6[_0x5028('0x41')]=_[_0x5028('0x42')](_0x490a3f,_0x5028('0x3a'));_0x1c59f6[_0x5028('0x43')]=_[_0x5028('0x44')](_0x3bef27[_0x5028('0x43')]);_0x1c59f6[_0x5028('0x45')]=_['intersection'](_0x1c59f6[_0x5028('0x41')],_0x1c59f6[_0x5028('0x43')]);_0x7a5b9d[_0x5028('0x46')]=_[_0x5028('0x47')](_0x1c59f6['model'],qs['fields'](_0x3bef27[_0x5028('0x43')][_0x5028('0x48')]));_0x7a5b9d['attributes']=_0x7a5b9d[_0x5028('0x46')][_0x5028('0x49')]?_0x7a5b9d[_0x5028('0x46')]:_0x1c59f6[_0x5028('0x41')];if(!_0x3bef27[_0x5028('0x43')][_0x5028('0x4a')](_0x5028('0x4b'))){_0x7a5b9d[_0x5028('0x30')]=qs[_0x5028('0x30')](_0x3bef27[_0x5028('0x43')][_0x5028('0x30')]);_0x7a5b9d['offset']=qs['offset'](_0x3bef27[_0x5028('0x43')][_0x5028('0x2f')]);}_0x7a5b9d[_0x5028('0x4c')]=qs['sort'](_0x3bef27[_0x5028('0x43')][_0x5028('0x4d')]);_0x7a5b9d['where']=qs['filters'](_['pick'](_0x3bef27[_0x5028('0x43')],_0x1c59f6[_0x5028('0x45')]),_0x490a3f);if(_0x3bef27['query'][_0x5028('0x4e')]){_0x7a5b9d[_0x5028('0x4f')]=_['merge'](_0x7a5b9d['where'],{'$or':_[_0x5028('0x42')](_0x490a3f,function(_0x45a611){if(_0x45a611[_0x5028('0x3f')]!==_0x5028('0x50')){var _0x21e76d={};_0x21e76d[_0x45a611[_0x5028('0x3a')]]={'$like':'%'+_0x3bef27[_0x5028('0x43')]['filter']+'%'};return _0x21e76d;}})});}_0x7a5b9d=_[_0x5028('0x51')]({},_0x7a5b9d,_0x3bef27['options']);var _0x455729={'where':_0x7a5b9d['where']};return db[_0x5028('0x52')][_0x5028('0x32')](_0x455729)['then'](function(_0x239710){_0x5c2f1f[_0x5028('0x32')]=_0x239710;if(_0x3bef27[_0x5028('0x43')][_0x5028('0x53')]){_0x7a5b9d[_0x5028('0x54')]=[{'all':!![]}];}return db[_0x5028('0x52')]['findAll'](_0x7a5b9d);})['then'](function(_0x443200){_0x5c2f1f['rows']=_0x443200;return _0x5c2f1f;})[_0x5028('0x37')](respondWithFilteredResult(_0x707521,_0x7a5b9d))['catch'](handleError(_0x707521,null));};exports['show']=function(_0x5d733f,_0x4b54c6){var _0x7999ce={'raw':!![],'where':{'id':_0x5d733f['params']['id']}},_0x3cda25={};_0x3cda25[_0x5028('0x41')]=_[_0x5028('0x44')](db['ChatMessage']['rawAttributes']);_0x3cda25[_0x5028('0x43')]=_[_0x5028('0x44')](_0x5d733f['query']);_0x3cda25[_0x5028('0x45')]=_[_0x5028('0x47')](_0x3cda25[_0x5028('0x41')],_0x3cda25[_0x5028('0x43')]);_0x7999ce[_0x5028('0x46')]=_[_0x5028('0x47')](_0x3cda25[_0x5028('0x41')],qs[_0x5028('0x48')](_0x5d733f[_0x5028('0x43')]['fields']));_0x7999ce[_0x5028('0x46')]=_0x7999ce[_0x5028('0x46')]['length']?_0x7999ce[_0x5028('0x46')]:_0x3cda25['model'];if(_0x5d733f[_0x5028('0x43')][_0x5028('0x53')]){_0x7999ce[_0x5028('0x54')]=[{'all':!![]}];}_0x7999ce=_[_0x5028('0x51')]({},_0x7999ce,_0x5d733f[_0x5028('0x55')]);return db[_0x5028('0x52')][_0x5028('0x56')](_0x7999ce)[_0x5028('0x37')](handleEntityNotFound(_0x4b54c6,null))[_0x5028('0x37')](respondWithResult(_0x4b54c6,null))['catch'](handleError(_0x4b54c6,null));};exports[_0x5028('0x57')]=function(_0x2671b1,_0x496ba2){return db['ChatMessage'][_0x5028('0x57')](_0x2671b1['body'],{})[_0x5028('0x37')](respondWithResult(_0x496ba2,0xc9))['catch'](handleError(_0x496ba2,null));};exports['update']=function(_0x104fb5,_0x15f5ae){if(_0x104fb5[_0x5028('0x58')]['id']){delete _0x104fb5[_0x5028('0x58')]['id'];}return db[_0x5028('0x52')][_0x5028('0x56')]({'where':{'id':_0x104fb5[_0x5028('0x59')]['id']}})['then'](handleEntityNotFound(_0x15f5ae,null))['then'](saveUpdates(_0x104fb5[_0x5028('0x58')],null))['then'](respondWithResult(_0x15f5ae,null))[_0x5028('0x5a')](handleError(_0x15f5ae,null));};exports[_0x5028('0x38')]=function(_0x276e0a,_0x9b409d){return db[_0x5028('0x52')][_0x5028('0x56')]({'where':{'id':_0x276e0a[_0x5028('0x59')]['id']}})[_0x5028('0x37')](handleEntityNotFound(_0x9b409d,null))[_0x5028('0x37')](removeEntity(_0x9b409d,null))[_0x5028('0x5a')](handleError(_0x9b409d,null));};exports[_0x5028('0x5b')]=function(_0x2d99f5,_0x2a13e9){return db['ChatMessage']['describe']()[_0x5028('0x37')](respondWithResult(_0x2a13e9,null))[_0x5028('0x5a')](handleError(_0x2a13e9,null));};var interaction_log=require(_0x5028('0x15'))('chat-interactions');exports[_0x5028('0x5c')]=function(_0x1d5306,_0x537bee,_0x332f64){var _0x2d55fd={'agent':{},'channel':_0x5028('0x5d')};if(_0x1d5306[_0x5028('0x58')]['id']){delete _0x1d5306['body']['id'];}_0x1d5306['body'][_0x5028('0x5e')]=!![];_0x1d5306[_0x5028('0x58')][_0x5028('0x5f')]=moment()['format'](_0x5028('0x60'));_0x1d5306[_0x5028('0x58')][_0x5028('0x61')]=_0x1d5306[_0x5028('0x58')][_0x5028('0x61')]||_0x1d5306[_0x5028('0x62')]['id'];_0x2d55fd[_0x5028('0x63')]['id']=_0x1d5306[_0x5028('0x58')][_0x5028('0x61')];return db[_0x5028('0x52')][_0x5028('0x56')]({'where':{'id':_0x1d5306['params']['id'],'UserId':null}})[_0x5028('0x37')](handleEntityNotFound(_0x537bee,null))[_0x5028('0x37')](saveUpdates(_0x1d5306['body'],null))['then'](function(_0xb889e6){if(_0xb889e6){_0x2d55fd['message']=_0xb889e6[_0x5028('0x64')]({'plain':!![]});return db[_0x5028('0x65')]['find']({'where':{'id':_0xb889e6[_0x5028('0x66')]}});}return null;})[_0x5028('0x37')](handleEntityNotFound(_0x537bee,null))[_0x5028('0x37')](function(_0x13b811){if(_0x13b811){return _0x13b811['update']({'UserId':_0x1d5306[_0x5028('0x58')][_0x5028('0x61')],'read1stAt':_[_0x5028('0x67')](_0x13b811[_0x5028('0x68')])?moment()[_0x5028('0x69')](_0x5028('0x60')):undefined});}return null;})[_0x5028('0x37')](function(_0x6d43de){if(_0x6d43de){_0x2d55fd[_0x5028('0x6a')]=_0x6d43de[_0x5028('0x64')]({'plain':!![]});interaction_log[_0x5028('0x29')](_0x5028('0x6b'),_0x1d5306[_0x5028('0x62')]['id'],_0x1d5306[_0x5028('0x62')][_0x5028('0x3a')],_0x1d5306[_0x5028('0x62')][_0x5028('0x6c')],_0x2d55fd[_0x5028('0x6a')]['id'],_0x1d5306[_0x5028('0x58')]?JSON[_0x5028('0x25')](_0x1d5306['body']):_0x5028('0x6d'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x2d55fd);}return null;})[_0x5028('0x37')](function(_0x580923){var _0x273370=_0x5028('0x6e')+_0x580923[_0x5028('0x28')]['ContactId'];return db[_0x5028('0x6f')][_0x5028('0x43')](_0x273370,{'type':db[_0x5028('0x70')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x1d066c){return _0x1d066c;});})[_0x5028('0x37')](function(_0xd9cdba){if(_0xd9cdba){_0x2d55fd['message'][_0x5028('0x71')]=_0xd9cdba[0x0];if(!_0x1d5306[_0x5028('0x58')][_0x5028('0x61')])return;return db[_0x5028('0x72')][_0x5028('0x56')]({'where':{'id':_0x1d5306[_0x5028('0x58')][_0x5028('0x61')],'role':_0x5028('0x63')},'attributes':['id',_0x5028('0x3a'),_0x5028('0x73'),_0x5028('0x74'),'internal'],'raw':!![]});}return null;})[_0x5028('0x37')](function(_0x55ea9b){if(!_0x55ea9b)return null;_0x2d55fd[_0x5028('0x28')][_0x5028('0x63')]=_0x55ea9b;return _0x2d55fd;})[_0x5028('0x37')](function(_0x15a490){if(_0x15a490){if(_0x1d5306['body'][_0x5028('0x75')]){_0x2d55fd['message'][_0x5028('0x76')]=util[_0x5028('0x69')](_0x5028('0x77'),_0x1d5306[_0x5028('0x62')][_0x5028('0x3a')]);_0x2d55fd[_0x5028('0x28')][_0x5028('0x78')]=_0x2d55fd[_0x5028('0x78')];_0x2d55fd[_0x5028('0x28')][_0x5028('0x79')]=_0x2d55fd['channel'];_0x2d55fd[_0x5028('0x28')][_0x5028('0x7a')]='accept';return respondWithRpcPromise(_0x5028('0x7b'),_0x5028('0x7b'),{'event':_0x5028('0x7c'),'message':_[_0x5028('0x51')](_0x2d55fd['message'],JSON[_0x5028('0x7d')](_0x2d55fd['interaction']['formData']))},client9002)[_0x5028('0x37')](function(){return _0x2d55fd;});}return _0x2d55fd;}return null;})[_0x5028('0x37')](respondWithResult(_0x537bee,null))[_0x5028('0x5a')](handleError(_0x537bee,null));};var interaction_log=require(_0x5028('0x15'))(_0x5028('0x7e'));exports['reject']=function(_0x359373,_0xf7f84a,_0x4ebf7a){var _0x30753f={'agent':{},'channel':_0x5028('0x5d')};if(_0x359373['body']['id']){delete _0x359373[_0x5028('0x58')]['id'];}_0x359373[_0x5028('0x58')][_0x5028('0x61')]=_0x359373[_0x5028('0x58')]['UserId']||_0x359373[_0x5028('0x62')]['id'];_0x30753f['agent']['id']=_0x359373[_0x5028('0x58')][_0x5028('0x61')];return db[_0x5028('0x52')]['find']({'where':{'id':_0x359373['params']['id'],'UserId':null}})[_0x5028('0x37')](handleEntityNotFound(_0xf7f84a,null))[_0x5028('0x37')](function(_0x2672a1){if(_0x2672a1){_0x30753f[_0x5028('0x28')]=_0x2672a1['get']({'plain':!![]});return db[_0x5028('0x65')]['find']({'where':{'id':_0x2672a1[_0x5028('0x66')]}});}return null;})[_0x5028('0x37')](handleEntityNotFound(_0xf7f84a,null))[_0x5028('0x37')](function(_0xfe8409){if(_0xfe8409){_0x30753f[_0x5028('0x6a')]=_0xfe8409['get']({'plain':!![]});interaction_log[_0x5028('0x29')](_0x5028('0x7f'),_0x359373[_0x5028('0x62')]['id'],_0x359373[_0x5028('0x62')][_0x5028('0x3a')],_0x359373[_0x5028('0x62')][_0x5028('0x6c')],_0x30753f['interaction']['id'],_0x359373[_0x5028('0x58')]?JSON['stringify'](_0x359373[_0x5028('0x58')]):_0x5028('0x6d'));return respondWithRpcPromise('RejectMessage',_0x5028('0x80'),_0x30753f);}return null;})[_0x5028('0x37')](function(_0x2284a7){var _0xbbfb72=_0x5028('0x6e')+_0x2284a7[_0x5028('0x28')]['ContactId'];return db['sequelize'][_0x5028('0x43')](_0xbbfb72,{'type':db[_0x5028('0x70')][_0x5028('0x81')][_0x5028('0x82')],'raw':!![]})[_0x5028('0x37')](function(_0x403c8f){return _0x403c8f;});})[_0x5028('0x37')](function(_0x1828ad){if(_0x1828ad){_0x30753f['message'][_0x5028('0x71')]=_0x1828ad[0x0];if(!_0x359373[_0x5028('0x58')][_0x5028('0x61')])return;return db[_0x5028('0x72')]['find']({'where':{'id':_0x359373[_0x5028('0x58')][_0x5028('0x61')],'role':_0x5028('0x63')},'attributes':['id',_0x5028('0x3a'),_0x5028('0x73'),_0x5028('0x74'),_0x5028('0x83')],'raw':!![]});}return null;})['then'](function(_0xe0ddb6){if(!_0xe0ddb6)return null;_0x30753f[_0x5028('0x28')][_0x5028('0x63')]=_0xe0ddb6;return _0x30753f;})[_0x5028('0x37')](function(_0x4b012c){if(_0x4b012c){_0x4b012c[_0x5028('0x28')][_0x5028('0x76')]=util[_0x5028('0x69')](_0x5028('0x77'),_0x359373[_0x5028('0x62')][_0x5028('0x3a')]);_0x4b012c[_0x5028('0x28')][_0x5028('0x78')]=_0x30753f['channel'];_0x4b012c[_0x5028('0x28')][_0x5028('0x79')]=_0x30753f['channel'];_0x4b012c[_0x5028('0x28')][_0x5028('0x7a')]=_0x5028('0x84');respondWithRpcPromise('EventManager',_0x5028('0x7b'),{'event':_0x5028('0x85'),'message':_['merge'](_0x30753f[_0x5028('0x28')],JSON[_0x5028('0x7d')](_0x30753f[_0x5028('0x6a')][_0x5028('0x86')]))},client9002);return _0x30753f;}return null;})[_0x5028('0x37')](respondWithResult(_0xf7f84a,null))['catch'](handleError(_0xf7f84a,null));};
\ No newline at end of file
+var _0x068a=['path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','map','ChatMessage','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','hasOwnProperty','sort','pick','where','type','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','keys','length','find','create','body','describe','chat-interactions','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','parse','RejectMessage','rejectMessage','Sequelize','contact','User','eml-format','rimraf','zip-dir','moment','bluebird','mustache'];(function(_0x1c81d7,_0x23fb0f){var _0x52961e=function(_0x2b0022){while(--_0x2b0022){_0x1c81d7['push'](_0x1c81d7['shift']());}};_0x52961e(++_0x23fb0f);}(_0x068a,0xfe));var _0xa068=function(_0x30fddd,_0x16fe5f){_0x30fddd=_0x30fddd-0x0;var _0x3005e3=_0x068a[_0x30fddd];return _0x3005e3;};'use strict';var emlformat=require(_0xa068('0x0'));var rimraf=require(_0xa068('0x1'));var zipdir=require(_0xa068('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa068('0x3'));var BPromise=require(_0xa068('0x4'));var Mustache=require(_0xa068('0x5'));var util=require('util');var path=require(_0xa068('0x6'));var sox=require('sox');var csv=require(_0xa068('0x7'));var ejs=require(_0xa068('0x8'));var fs=require('fs');var fs_extra=require(_0xa068('0x9'));var _=require(_0xa068('0xa'));var squel=require('squel');var crypto=require(_0xa068('0xb'));var jsforce=require(_0xa068('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa068('0xd'));var Papa=require(_0xa068('0xe'));var Redis=require(_0xa068('0xf'));var authService=require(_0xa068('0x10'));var qs=require(_0xa068('0x11'));var as=require(_0xa068('0x12'));var hardwareService=require(_0xa068('0x13'));var logger=require(_0xa068('0x14'))('api');var utils=require(_0xa068('0x15'));var config=require(_0xa068('0x16'));var licenseUtil=require(_0xa068('0x17'));var db=require(_0xa068('0x18'))['db'];config[_0xa068('0x19')]=_[_0xa068('0x1a')](config['redis'],{'host':_0xa068('0x1b'),'port':0x18eb});var socket=require(_0xa068('0x1c'))(new Redis(config[_0xa068('0x19')]));require(_0xa068('0x1d'))[_0xa068('0x1e')](socket);var jayson=require(_0xa068('0x1f'));var client=jayson[_0xa068('0x20')][_0xa068('0x21')]({'port':0x232c});var client9002=jayson[_0xa068('0x20')][_0xa068('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x1246a1,_0x32391e,_0x8251c6,_0x59d4f0){return new BPromise(function(_0x1eef08,_0x58f0e3){var _0x1860d7=_0x59d4f0||client;return _0x1860d7[_0xa068('0x22')](_0x1246a1,_0x8251c6)['then'](function(_0xbd45db){logger[_0xa068('0x23')](_0xa068('0x24'),_0x32391e,_0xa068('0x25'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x32391e,_0xa068('0x25'),JSON[_0xa068('0x26')](_0xbd45db));if(_0xbd45db['error']){if(_0xbd45db[_0xa068('0x27')]['code']===0x1f4){logger[_0xa068('0x27')](_0xa068('0x24'),_0x32391e,_0xbd45db[_0xa068('0x27')][_0xa068('0x28')]);return _0x58f0e3(_0xbd45db[_0xa068('0x27')][_0xa068('0x28')]);}logger[_0xa068('0x27')](_0xa068('0x24'),_0x32391e,_0xbd45db[_0xa068('0x27')]['message']);return _0x1eef08(_0xbd45db['error'][_0xa068('0x28')]);}else{logger[_0xa068('0x23')](_0xa068('0x24'),_0x32391e,_0xa068('0x25'));_0x1eef08(_0xbd45db['result']['message']);}})[_0xa068('0x29')](function(_0x3523a8){logger['error'](_0xa068('0x24'),_0x32391e,_0x3523a8);_0x58f0e3(_0x3523a8);});});}function respondWithStatusCode(_0x4dc0b0,_0x14e25e){_0x14e25e=_0x14e25e||0xcc;return function(_0x27455d){if(_0x27455d){return _0x4dc0b0['sendStatus'](_0x14e25e);}return _0x4dc0b0['status'](_0x14e25e)['end']();};}function respondWithResult(_0x42b4b0,_0x5b4b5b){_0x5b4b5b=_0x5b4b5b||0xc8;return function(_0x72acd6){if(_0x72acd6){return _0x42b4b0[_0xa068('0x2a')](_0x5b4b5b)[_0xa068('0x2b')](_0x72acd6);}};}function respondWithFilteredResult(_0x39a785,_0x5d79d8){return function(_0x3c15e2){if(_0x3c15e2){var _0xa305a5=typeof _0x5d79d8[_0xa068('0x2c')]===_0xa068('0x2d')&&typeof _0x5d79d8[_0xa068('0x2e')]===_0xa068('0x2d');var _0x615939=_0x3c15e2[_0xa068('0x2f')];var _0x2ca324=_0xa305a5?0x0:_0x5d79d8[_0xa068('0x2c')];var _0x5cf276=_0xa305a5?_0x3c15e2['count']:_0x5d79d8[_0xa068('0x2c')]+_0x5d79d8['limit'];var _0x53d19f;if(_0x5cf276>=_0x615939){_0x5cf276=_0x615939;_0x53d19f=0xc8;}else{_0x53d19f=0xce;}_0x39a785[_0xa068('0x2a')](_0x53d19f);return _0x39a785[_0xa068('0x30')](_0xa068('0x31'),_0x2ca324+'-'+_0x5cf276+'/'+_0x615939)[_0xa068('0x2b')](_0x3c15e2);}return null;};}function patchUpdates(_0x106b10){return function(_0x12b1bf){try{jsonpatch[_0xa068('0x32')](_0x12b1bf,_0x106b10,!![]);}catch(_0x4abb8a){return BPromise[_0xa068('0x33')](_0x4abb8a);}return _0x12b1bf[_0xa068('0x34')]();};}function saveUpdates(_0x1c8da8,_0x379bd6){return function(_0x405474){if(_0x405474){return _0x405474[_0xa068('0x35')](_0x1c8da8)[_0xa068('0x36')](function(_0x838f58){return _0x838f58;});}return null;};}function removeEntity(_0x2cc4da,_0x31567a){return function(_0x2c8280){if(_0x2c8280){return _0x2c8280[_0xa068('0x37')]()['then'](function(){_0x2cc4da[_0xa068('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e0f5f,_0x524f25){return function(_0x67a15f){if(!_0x67a15f){_0x2e0f5f[_0xa068('0x38')](0x194);}return _0x67a15f;};}function handleError(_0x24406b,_0x3a9db6){_0x3a9db6=_0x3a9db6||0x1f4;return function(_0xde8dec){logger[_0xa068('0x27')](_0xde8dec[_0xa068('0x39')]);if(_0xde8dec[_0xa068('0x3a')]){delete _0xde8dec[_0xa068('0x3a')];}_0x24406b[_0xa068('0x2a')](_0x3a9db6)[_0xa068('0x3b')](_0xde8dec);};}exports['index']=function(_0x3aea29,_0x4d9b3e){var _0x2f1117={},_0xe3b1b8={},_0x2525c8={'count':0x0,'rows':[]};var _0x38f756=_[_0xa068('0x3c')](db[_0xa068('0x3d')][_0xa068('0x3e')],function(_0x35bbf2){return{'name':_0x35bbf2[_0xa068('0x3f')],'type':_0x35bbf2['type']['key']};});_0xe3b1b8[_0xa068('0x40')]=_[_0xa068('0x3c')](_0x38f756,'name');_0xe3b1b8['query']=_['keys'](_0x3aea29[_0xa068('0x41')]);_0xe3b1b8[_0xa068('0x42')]=_[_0xa068('0x43')](_0xe3b1b8[_0xa068('0x40')],_0xe3b1b8[_0xa068('0x41')]);_0x2f1117[_0xa068('0x44')]=_[_0xa068('0x43')](_0xe3b1b8[_0xa068('0x40')],qs[_0xa068('0x45')](_0x3aea29[_0xa068('0x41')][_0xa068('0x45')]));_0x2f1117[_0xa068('0x44')]=_0x2f1117[_0xa068('0x44')]['length']?_0x2f1117[_0xa068('0x44')]:_0xe3b1b8['model'];if(!_0x3aea29['query'][_0xa068('0x46')]('nolimit')){_0x2f1117[_0xa068('0x2e')]=qs[_0xa068('0x2e')](_0x3aea29[_0xa068('0x41')]['limit']);_0x2f1117[_0xa068('0x2c')]=qs[_0xa068('0x2c')](_0x3aea29[_0xa068('0x41')]['offset']);}_0x2f1117['order']=qs[_0xa068('0x47')](_0x3aea29[_0xa068('0x41')][_0xa068('0x47')]);_0x2f1117['where']=qs[_0xa068('0x42')](_[_0xa068('0x48')](_0x3aea29[_0xa068('0x41')],_0xe3b1b8[_0xa068('0x42')]),_0x38f756);if(_0x3aea29['query']['filter']){_0x2f1117[_0xa068('0x49')]=_['merge'](_0x2f1117[_0xa068('0x49')],{'$or':_[_0xa068('0x3c')](_0x38f756,function(_0x54c2c5){if(_0x54c2c5[_0xa068('0x4a')]!==_0xa068('0x4b')){var _0x31cfd7={};_0x31cfd7[_0x54c2c5[_0xa068('0x3a')]]={'$like':'%'+_0x3aea29[_0xa068('0x41')]['filter']+'%'};return _0x31cfd7;}})});}_0x2f1117=_[_0xa068('0x4c')]({},_0x2f1117,_0x3aea29[_0xa068('0x4d')]);var _0x1d6736={'where':_0x2f1117[_0xa068('0x49')]};return db[_0xa068('0x3d')]['count'](_0x1d6736)[_0xa068('0x36')](function(_0x3655c6){_0x2525c8['count']=_0x3655c6;if(_0x3aea29['query'][_0xa068('0x4e')]){_0x2f1117['include']=[{'all':!![]}];}return db[_0xa068('0x3d')][_0xa068('0x4f')](_0x2f1117);})['then'](function(_0x32028b){_0x2525c8[_0xa068('0x50')]=_0x32028b;return _0x2525c8;})['then'](respondWithFilteredResult(_0x4d9b3e,_0x2f1117))[_0xa068('0x29')](handleError(_0x4d9b3e,null));};exports[_0xa068('0x51')]=function(_0x3d16c8,_0x3533b0){var _0x432594={'raw':!![],'where':{'id':_0x3d16c8[_0xa068('0x52')]['id']}},_0x3efd99={};_0x3efd99[_0xa068('0x40')]=_[_0xa068('0x53')](db[_0xa068('0x3d')][_0xa068('0x3e')]);_0x3efd99[_0xa068('0x41')]=_['keys'](_0x3d16c8[_0xa068('0x41')]);_0x3efd99[_0xa068('0x42')]=_[_0xa068('0x43')](_0x3efd99['model'],_0x3efd99[_0xa068('0x41')]);_0x432594[_0xa068('0x44')]=_['intersection'](_0x3efd99[_0xa068('0x40')],qs[_0xa068('0x45')](_0x3d16c8[_0xa068('0x41')][_0xa068('0x45')]));_0x432594[_0xa068('0x44')]=_0x432594['attributes'][_0xa068('0x54')]?_0x432594[_0xa068('0x44')]:_0x3efd99['model'];if(_0x3d16c8[_0xa068('0x41')][_0xa068('0x4e')]){_0x432594['include']=[{'all':!![]}];}_0x432594=_[_0xa068('0x4c')]({},_0x432594,_0x3d16c8['options']);return db[_0xa068('0x3d')][_0xa068('0x55')](_0x432594)[_0xa068('0x36')](handleEntityNotFound(_0x3533b0,null))[_0xa068('0x36')](respondWithResult(_0x3533b0,null))[_0xa068('0x29')](handleError(_0x3533b0,null));};exports[_0xa068('0x56')]=function(_0x20c793,_0x1d1a6d){return db[_0xa068('0x3d')][_0xa068('0x56')](_0x20c793[_0xa068('0x57')],{})[_0xa068('0x36')](respondWithResult(_0x1d1a6d,0xc9))[_0xa068('0x29')](handleError(_0x1d1a6d,null));};exports[_0xa068('0x35')]=function(_0x3ffba6,_0x4cd5f3){if(_0x3ffba6[_0xa068('0x57')]['id']){delete _0x3ffba6[_0xa068('0x57')]['id'];}return db[_0xa068('0x3d')][_0xa068('0x55')]({'where':{'id':_0x3ffba6['params']['id']}})[_0xa068('0x36')](handleEntityNotFound(_0x4cd5f3,null))[_0xa068('0x36')](saveUpdates(_0x3ffba6[_0xa068('0x57')],null))[_0xa068('0x36')](respondWithResult(_0x4cd5f3,null))[_0xa068('0x29')](handleError(_0x4cd5f3,null));};exports[_0xa068('0x37')]=function(_0xf6b510,_0x27be55){return db[_0xa068('0x3d')][_0xa068('0x55')]({'where':{'id':_0xf6b510['params']['id']}})[_0xa068('0x36')](handleEntityNotFound(_0x27be55,null))['then'](removeEntity(_0x27be55,null))['catch'](handleError(_0x27be55,null));};exports[_0xa068('0x58')]=function(_0x4c64cd,_0x2d375c){return db['ChatMessage'][_0xa068('0x58')]()[_0xa068('0x36')](respondWithResult(_0x2d375c,null))[_0xa068('0x29')](handleError(_0x2d375c,null));};var interaction_log=require(_0xa068('0x14'))(_0xa068('0x59'));exports['accept']=function(_0x242f4c,_0x58087b,_0x49b49c){var _0x563238={'agent':{},'channel':_0xa068('0x5a')};if(_0x242f4c[_0xa068('0x57')]['id']){delete _0x242f4c[_0xa068('0x57')]['id'];}_0x242f4c['body']['read']=!![];_0x242f4c[_0xa068('0x57')][_0xa068('0x5b')]=moment()[_0xa068('0x5c')](_0xa068('0x5d'));_0x242f4c[_0xa068('0x57')][_0xa068('0x5e')]=_0x242f4c['body']['UserId']||_0x242f4c[_0xa068('0x5f')]['id'];_0x563238[_0xa068('0x60')]['id']=_0x242f4c[_0xa068('0x57')][_0xa068('0x5e')];return db[_0xa068('0x3d')][_0xa068('0x55')]({'where':{'id':_0x242f4c[_0xa068('0x52')]['id'],'UserId':null}})[_0xa068('0x36')](handleEntityNotFound(_0x58087b,null))[_0xa068('0x36')](saveUpdates(_0x242f4c[_0xa068('0x57')],null))['then'](function(_0x24e995){if(_0x24e995){_0x563238[_0xa068('0x28')]=_0x24e995[_0xa068('0x61')]({'plain':!![]});return db[_0xa068('0x62')][_0xa068('0x55')]({'where':{'id':_0x24e995['ChatInteractionId']}});}return null;})[_0xa068('0x36')](handleEntityNotFound(_0x58087b,null))[_0xa068('0x36')](function(_0x4642cf){if(_0x4642cf){return _0x4642cf[_0xa068('0x35')]({'UserId':_0x242f4c[_0xa068('0x57')][_0xa068('0x5e')],'read1stAt':_[_0xa068('0x63')](_0x4642cf[_0xa068('0x64')])?moment()[_0xa068('0x5c')](_0xa068('0x5d')):undefined});}return null;})[_0xa068('0x36')](function(_0x31304a){if(_0x31304a){_0x563238[_0xa068('0x65')]=_0x31304a[_0xa068('0x61')]({'plain':!![]});interaction_log[_0xa068('0x23')](_0xa068('0x66'),_0x242f4c[_0xa068('0x5f')]['id'],_0x242f4c[_0xa068('0x5f')]['name'],_0x242f4c[_0xa068('0x5f')][_0xa068('0x67')],_0x563238[_0xa068('0x65')]['id'],_0x242f4c[_0xa068('0x57')]?JSON[_0xa068('0x26')](_0x242f4c[_0xa068('0x57')]):_0xa068('0x68'));return respondWithRpcPromise(_0xa068('0x69'),_0xa068('0x6a'),_0x563238);}return null;})['then'](function(_0x5a596f){var _0x3fa311=_0xa068('0x6b')+_0x5a596f['message'][_0xa068('0x6c')];return db[_0xa068('0x6d')][_0xa068('0x41')](_0x3fa311,{'type':db['Sequelize'][_0xa068('0x6e')][_0xa068('0x6f')],'raw':!![]})['then'](function(_0x30a6){return _0x30a6;});})[_0xa068('0x36')](function(_0x2ba909){if(_0x2ba909){_0x563238[_0xa068('0x28')]['contact']=_0x2ba909[0x0];if(!_0x242f4c['body']['UserId'])return;return db['User']['find']({'where':{'id':_0x242f4c[_0xa068('0x57')][_0xa068('0x5e')],'role':_0xa068('0x60')},'attributes':['id',_0xa068('0x3a'),_0xa068('0x70'),_0xa068('0x71'),_0xa068('0x72')],'raw':!![]});}return null;})['then'](function(_0x3621f7){if(!_0x3621f7)return null;_0x563238[_0xa068('0x28')][_0xa068('0x60')]=_0x3621f7;return _0x563238;})[_0xa068('0x36')](function(_0x551ab4){if(_0x551ab4){if(_0x242f4c['body'][_0xa068('0x73')]){_0x563238[_0xa068('0x28')][_0xa068('0x74')]=util[_0xa068('0x5c')](_0xa068('0x75'),_0x242f4c['user'][_0xa068('0x3a')]);_0x563238['message']['channel']=_0x563238[_0xa068('0x76')];_0x563238[_0xa068('0x28')][_0xa068('0x77')]=_0x563238[_0xa068('0x76')];_0x563238[_0xa068('0x28')][_0xa068('0x78')]=_0xa068('0x79');return respondWithRpcPromise(_0xa068('0x7a'),'EventManager',{'event':_0xa068('0x7b'),'message':_[_0xa068('0x4c')](_0x563238[_0xa068('0x28')],JSON[_0xa068('0x7c')](_0x563238[_0xa068('0x65')]['formData']))},client9002)['then'](function(){return _0x563238;});}return _0x563238;}return null;})[_0xa068('0x36')](respondWithResult(_0x58087b,null))['catch'](handleError(_0x58087b,null));};var interaction_log=require('../../config/logger')(_0xa068('0x59'));exports[_0xa068('0x33')]=function(_0x4b16d5,_0x1fee28,_0x5258a8){var _0x3bc5b6={'agent':{},'channel':_0xa068('0x5a')};if(_0x4b16d5[_0xa068('0x57')]['id']){delete _0x4b16d5[_0xa068('0x57')]['id'];}_0x4b16d5[_0xa068('0x57')][_0xa068('0x5e')]=_0x4b16d5[_0xa068('0x57')][_0xa068('0x5e')]||_0x4b16d5[_0xa068('0x5f')]['id'];_0x3bc5b6[_0xa068('0x60')]['id']=_0x4b16d5[_0xa068('0x57')]['UserId'];return db[_0xa068('0x3d')]['find']({'where':{'id':_0x4b16d5[_0xa068('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1fee28,null))[_0xa068('0x36')](function(_0x222668){if(_0x222668){_0x3bc5b6[_0xa068('0x28')]=_0x222668[_0xa068('0x61')]({'plain':!![]});return db[_0xa068('0x62')][_0xa068('0x55')]({'where':{'id':_0x222668['ChatInteractionId']}});}return null;})[_0xa068('0x36')](handleEntityNotFound(_0x1fee28,null))[_0xa068('0x36')](function(_0x44bc92){if(_0x44bc92){_0x3bc5b6[_0xa068('0x65')]=_0x44bc92[_0xa068('0x61')]({'plain':!![]});interaction_log[_0xa068('0x23')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4b16d5[_0xa068('0x5f')]['id'],_0x4b16d5[_0xa068('0x5f')][_0xa068('0x3a')],_0x4b16d5[_0xa068('0x5f')][_0xa068('0x67')],_0x3bc5b6[_0xa068('0x65')]['id'],_0x4b16d5[_0xa068('0x57')]?JSON[_0xa068('0x26')](_0x4b16d5[_0xa068('0x57')]):_0xa068('0x68'));return respondWithRpcPromise(_0xa068('0x7d'),_0xa068('0x7e'),_0x3bc5b6);}return null;})[_0xa068('0x36')](function(_0x4d9922){var _0x381e75=_0xa068('0x6b')+_0x4d9922[_0xa068('0x28')][_0xa068('0x6c')];return db[_0xa068('0x6d')][_0xa068('0x41')](_0x381e75,{'type':db[_0xa068('0x7f')][_0xa068('0x6e')][_0xa068('0x6f')],'raw':!![]})[_0xa068('0x36')](function(_0x55d97f){return _0x55d97f;});})['then'](function(_0x1cc41b){if(_0x1cc41b){_0x3bc5b6[_0xa068('0x28')][_0xa068('0x80')]=_0x1cc41b[0x0];if(!_0x4b16d5[_0xa068('0x57')][_0xa068('0x5e')])return;return db[_0xa068('0x81')]['find']({'where':{'id':_0x4b16d5['body'][_0xa068('0x5e')],'role':_0xa068('0x60')},'attributes':['id',_0xa068('0x3a'),_0xa068('0x70'),_0xa068('0x71'),_0xa068('0x72')],'raw':!![]});}return null;})[_0xa068('0x36')](function(_0x30be5d){if(!_0x30be5d)return null;_0x3bc5b6[_0xa068('0x28')][_0xa068('0x60')]=_0x30be5d;return _0x3bc5b6;})[_0xa068('0x36')](function(_0x3ee4b7){if(_0x3ee4b7){_0x3ee4b7['message'][_0xa068('0x74')]=util[_0xa068('0x5c')]('SIP/%s',_0x4b16d5['user'][_0xa068('0x3a')]);_0x3ee4b7['message']['channel']=_0x3bc5b6['channel'];_0x3ee4b7[_0xa068('0x28')][_0xa068('0x77')]=_0x3bc5b6[_0xa068('0x76')];_0x3ee4b7[_0xa068('0x28')][_0xa068('0x78')]=_0xa068('0x33');respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_[_0xa068('0x4c')](_0x3bc5b6[_0xa068('0x28')],JSON[_0xa068('0x7c')](_0x3bc5b6[_0xa068('0x65')]['formData']))},client9002);return _0x3bc5b6;}return null;})['then'](respondWithResult(_0x1fee28,null))['catch'](handleError(_0x1fee28,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index c729cb6..c728a62 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 _0xa9c0=['emit','exports','events','../../mysqldb','ChatMessage','save','update'];(function(_0xdbd4f7,_0x4e3bdd){var _0x5c3f9d=function(_0xa7a35a){while(--_0xa7a35a){_0xdbd4f7['push'](_0xdbd4f7['shift']());}};_0x5c3f9d(++_0x4e3bdd);}(_0xa9c0,0x72));var _0x0a9c=function(_0x522505,_0x52d1eb){_0x522505=_0x522505-0x0;var _0x16e2cd=_0xa9c0[_0x522505];return _0x16e2cd;};'use strict';var EventEmitter=require(_0x0a9c('0x0'));var ChatMessage=require(_0x0a9c('0x1'))['db'][_0x0a9c('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0a9c('0x3'),'afterUpdate':_0x0a9c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4ac2b6){return function(_0x159036,_0x319357,_0x1880a1){ChatMessageEvents[_0x0a9c('0x5')](_0x4ac2b6+':'+_0x159036['id'],_0x159036);ChatMessageEvents['emit'](_0x4ac2b6,_0x159036);_0x1880a1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x0a9c('0x6')]=ChatMessageEvents;
\ No newline at end of file
+var _0x2cef=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage'];(function(_0x4966a4,_0x39662c){var _0x3c6bf6=function(_0x53c4f2){while(--_0x53c4f2){_0x4966a4['push'](_0x4966a4['shift']());}};_0x3c6bf6(++_0x39662c);}(_0x2cef,0x97));var _0xf2ce=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x2cef[_0x1facfa];return _0x9ec701;};'use strict';var EventEmitter=require(_0xf2ce('0x0'));var ChatMessage=require(_0xf2ce('0x1'))['db'][_0xf2ce('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xf2ce('0x3')](0x0);var events={'afterCreate':_0xf2ce('0x4'),'afterUpdate':_0xf2ce('0x5'),'afterDestroy':_0xf2ce('0x6')};function emitEvent(_0x5334cf){return function(_0x4f1b4a,_0x4ef215,_0x3329c1){ChatMessageEvents[_0xf2ce('0x7')](_0x5334cf+':'+_0x4f1b4a['id'],_0x4f1b4a);ChatMessageEvents[_0xf2ce('0x7')](_0x5334cf,_0x4f1b4a);_0x3329c1(null);};}for(var e in events){if(events[_0xf2ce('0x8')](e)){var event=events[e];ChatMessage[_0xf2ce('0x9')](e,emitEvent(event));}}module[_0xf2ce('0xa')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index e5231ca..5a3e620 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 _0x0a35=['utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatMessage.attributes','exports','ChatMessage','chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','then','update','createdAt','catch'];(function(_0x573311,_0x46eec4){var _0x3ae3ce=function(_0x298f93){while(--_0x298f93){_0x573311['push'](_0x573311['shift']());}};_0x3ae3ce(++_0x46eec4);}(_0x0a35,0xe1));var _0x50a3=function(_0x5e9689,_0x48e034){_0x5e9689=_0x5e9689-0x0;var _0x2fac94=_0x0a35[_0x5e9689];return _0x2fac94;};'use strict';var _=require(_0x50a3('0x0'));var util=require(_0x50a3('0x1'));var logger=require(_0x50a3('0x2'))(_0x50a3('0x3'));var moment=require(_0x50a3('0x4'));var BPromise=require(_0x50a3('0x5'));var rp=require(_0x50a3('0x6'));var fs=require('fs');var path=require(_0x50a3('0x7'));var rimraf=require(_0x50a3('0x8'));var config=require('../../config/environment');var attributes=require(_0x50a3('0x9'));module[_0x50a3('0xa')]=function(_0x5b742,_0x2ee696){return _0x5b742['define'](_0x50a3('0xb'),attributes,{'tableName':_0x50a3('0xc'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x50a3('0xd')],'type':_0x50a3('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xc4e4dd,_0xfdcdb,_0x166474){var _0x557506=_0x5b742[_0x50a3('0xf')];var _0x3a526d=_0xc4e4dd[_0x50a3('0x10')]({'plain':!![]});if(_0x3a526d[_0x50a3('0x11')]['toLowerCase']()==='in'||_0x3a526d['direction'][_0x50a3('0x12')]()==='out'&&!_0x3a526d[_0x50a3('0x13')]&&!_[_0x50a3('0x14')](_0x3a526d[_0x50a3('0x15')])){_0x557506[_0x50a3('0x16')]['findOne']({'where':{'id':_0x3a526d['ChatInteractionId']}})[_0x50a3('0x17')](function(_0x1784b1){if(_0x1784b1){_0x1784b1[_0x50a3('0x18')]({'lastMsgAt':_0x3a526d[_0x50a3('0x19')],'lastMsgDirection':_0x3a526d[_0x50a3('0x11')]['toLowerCase']()});}})[_0x50a3('0x1a')](function(_0x180cac){console['error'](_0x180cac);});}_0x166474();}},'charset':_0x50a3('0x1b'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x1f36=['UserId','ChatInteraction','ChatInteractionId','update','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','out','secret'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0x1f36,0x1ed));var _0x61f3=function(_0x5989e9,_0xef6905){_0x5989e9=_0x5989e9-0x0;var _0xac49f2=_0x1f36[_0x5989e9];return _0xac49f2;};'use strict';var _=require(_0x61f3('0x0'));var util=require(_0x61f3('0x1'));var logger=require(_0x61f3('0x2'))(_0x61f3('0x3'));var moment=require('moment');var BPromise=require(_0x61f3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x61f3('0x5'));var rimraf=require(_0x61f3('0x6'));var config=require(_0x61f3('0x7'));var attributes=require(_0x61f3('0x8'));module[_0x61f3('0x9')]=function(_0x12c372,_0x72af3d){return _0x12c372['define'](_0x61f3('0xa'),attributes,{'tableName':_0x61f3('0xb'),'paranoid':![],'indexes':[{'name':_0x61f3('0xc'),'fields':[_0x61f3('0xd')],'type':_0x61f3('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3e184d,_0x3e7987,_0x51f786){var _0x1dba23=_0x12c372[_0x61f3('0xf')];var _0x14b24e=_0x3e184d[_0x61f3('0x10')]({'plain':!![]});if(_0x14b24e[_0x61f3('0x11')]['toLowerCase']()==='in'||_0x14b24e[_0x61f3('0x11')]['toLowerCase']()===_0x61f3('0x12')&&!_0x14b24e[_0x61f3('0x13')]&&!_['isNil'](_0x14b24e[_0x61f3('0x14')])){_0x1dba23[_0x61f3('0x15')]['findOne']({'where':{'id':_0x14b24e[_0x61f3('0x16')]}})['then'](function(_0x42c8b4){if(_0x42c8b4){_0x42c8b4[_0x61f3('0x17')]({'lastMsgAt':_0x14b24e['createdAt'],'lastMsgDirection':_0x14b24e[_0x61f3('0x11')]['toLowerCase']()});}})[_0x61f3('0x18')](function(_0x222d54){console[_0x61f3('0x19')](_0x222d54);});}_0x51f786();}},'charset':'utf8mb4','collate':_0x61f3('0x1a')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 96a4cf1..e0452ab 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 _0x325a=['body','options','then','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','ChatMessage,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','CreateChatMessage','ChatMessage','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x325a,0x1b5));var _0xa325=function(_0x4847e2,_0x5ac9db){_0x4847e2=_0x4847e2-0x0;var _0x25a9dc=_0x325a[_0x4847e2];return _0x25a9dc;};'use strict';var _=require(_0xa325('0x0'));var util=require(_0xa325('0x1'));var moment=require('moment');var BPromise=require(_0xa325('0x2'));var rs=require(_0xa325('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa325('0x4'))['db'];var utils=require(_0xa325('0x5'));var logger=require(_0xa325('0x6'))(_0xa325('0x7'));var config=require(_0xa325('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa325('0x9')][_0xa325('0xa')]({'port':0x232a});config[_0xa325('0xb')]=_[_0xa325('0xc')](config[_0xa325('0xb')],{'host':_0xa325('0xd'),'port':0x18eb});var socket=require(_0xa325('0xe'))(new Redis(config[_0xa325('0xb')]));require('./chatMessage.socket')[_0xa325('0xf')](socket);function respondWithRpcPromise(_0x5c7be3,_0x50a13d,_0x2d7684){return new BPromise(function(_0x2b15e5,_0x222664){return client[_0xa325('0x10')](_0x5c7be3,_0x2d7684)['then'](function(_0x1bfb7a){logger['info'](_0xa325('0x11'),_0x50a13d,_0xa325('0x12'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x50a13d,_0xa325('0x12'),JSON['stringify'](_0x1bfb7a));if(_0x1bfb7a[_0xa325('0x13')]){if(_0x1bfb7a[_0xa325('0x13')][_0xa325('0x14')]===0x1f4){logger[_0xa325('0x13')](_0xa325('0x11'),_0x50a13d,_0x1bfb7a[_0xa325('0x13')][_0xa325('0x15')]);return _0x222664(_0x1bfb7a['error'][_0xa325('0x15')]);}logger[_0xa325('0x13')](_0xa325('0x11'),_0x50a13d,_0x1bfb7a['error'][_0xa325('0x15')]);return _0x2b15e5(_0x1bfb7a[_0xa325('0x13')][_0xa325('0x15')]);}else{logger[_0xa325('0x16')]('ChatMessage,\x20%s,\x20%s',_0x50a13d,_0xa325('0x12'));_0x2b15e5(_0x1bfb7a[_0xa325('0x17')][_0xa325('0x15')]);}})[_0xa325('0x18')](function(_0x36bc88){logger[_0xa325('0x13')](_0xa325('0x11'),_0x50a13d,_0x36bc88);_0x222664(_0x36bc88);});});}exports[_0xa325('0x19')]=function(_0x159bbb){var _0x21f78c=this;return new Promise(function(_0x22272f,_0x5468c4){return db[_0xa325('0x1a')][_0xa325('0x1b')](_0x159bbb[_0xa325('0x1c')],{'raw':_0x159bbb[_0xa325('0x1d')]?_0x159bbb[_0xa325('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0xa325('0x1e')](function(_0x5eacb6){logger['info'](_0xa325('0x19'),_0x159bbb);logger['debug'](_0xa325('0x19'),_0x159bbb,JSON['stringify'](_0x5eacb6));_0x22272f(_0x5eacb6);})['catch'](function(_0x4919c6){logger[_0xa325('0x13')](_0xa325('0x19'),_0x4919c6[_0xa325('0x15')],_0x159bbb);_0x5468c4(_0x21f78c['error'](0x1f4,_0x4919c6['message']));});});};
\ No newline at end of file
+var _0xae4e=['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','error','code','message','result','catch','CreateChatMessage','create','body','options','raw','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x138293,_0x197e7f){var _0x34c4a2=function(_0x20192b){while(--_0x20192b){_0x138293['push'](_0x138293['shift']());}};_0x34c4a2(++_0x197e7f);}(_0xae4e,0x116));var _0xeae4=function(_0x13c223,_0x433b38){_0x13c223=_0x13c223-0x0;var _0x3e8d83=_0xae4e[_0x13c223];return _0x3e8d83;};'use strict';var _=require(_0xeae4('0x0'));var util=require(_0xeae4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xeae4('0x2'));var fs=require('fs');var Redis=require(_0xeae4('0x3'));var db=require(_0xeae4('0x4'))['db'];var utils=require(_0xeae4('0x5'));var logger=require(_0xeae4('0x6'))(_0xeae4('0x7'));var config=require(_0xeae4('0x8'));var jayson=require(_0xeae4('0x9'));var client=jayson[_0xeae4('0xa')][_0xeae4('0xb')]({'port':0x232a});config[_0xeae4('0xc')]=_[_0xeae4('0xd')](config['redis'],{'host':_0xeae4('0xe'),'port':0x18eb});var socket=require(_0xeae4('0xf'))(new Redis(config[_0xeae4('0xc')]));require(_0xeae4('0x10'))[_0xeae4('0x11')](socket);function respondWithRpcPromise(_0x412af8,_0xea104a,_0x8cbd2d){return new BPromise(function(_0x95276f,_0x44e6c8){return client[_0xeae4('0x12')](_0x412af8,_0x8cbd2d)[_0xeae4('0x13')](function(_0x3f7de4){logger[_0xeae4('0x14')](_0xeae4('0x15'),_0xea104a,_0xeae4('0x16'));logger[_0xeae4('0x17')](_0xeae4('0x18'),_0xea104a,_0xeae4('0x16'),JSON[_0xeae4('0x19')](_0x3f7de4));if(_0x3f7de4[_0xeae4('0x1a')]){if(_0x3f7de4[_0xeae4('0x1a')][_0xeae4('0x1b')]===0x1f4){logger['error'](_0xeae4('0x15'),_0xea104a,_0x3f7de4[_0xeae4('0x1a')][_0xeae4('0x1c')]);return _0x44e6c8(_0x3f7de4['error'][_0xeae4('0x1c')]);}logger[_0xeae4('0x1a')](_0xeae4('0x15'),_0xea104a,_0x3f7de4['error'][_0xeae4('0x1c')]);return _0x95276f(_0x3f7de4['error'][_0xeae4('0x1c')]);}else{logger[_0xeae4('0x14')]('ChatMessage,\x20%s,\x20%s',_0xea104a,_0xeae4('0x16'));_0x95276f(_0x3f7de4[_0xeae4('0x1d')]['message']);}})[_0xeae4('0x1e')](function(_0x414b4a){logger['error'](_0xeae4('0x15'),_0xea104a,_0x414b4a);_0x44e6c8(_0x414b4a);});});}exports[_0xeae4('0x1f')]=function(_0x5efb17){var _0x3bc873=this;return new Promise(function(_0x11f20c,_0x3d98d1){return db['ChatMessage'][_0xeae4('0x20')](_0x5efb17[_0xeae4('0x21')],{'raw':_0x5efb17[_0xeae4('0x22')]?_0x5efb17['options'][_0xeae4('0x23')]===undefined?!![]:![]:!![]})[_0xeae4('0x13')](function(_0x8103be){logger['info'](_0xeae4('0x1f'),_0x5efb17);logger[_0xeae4('0x17')](_0xeae4('0x1f'),_0x5efb17,JSON[_0xeae4('0x19')](_0x8103be));_0x11f20c(_0x8103be);})['catch'](function(_0x341738){logger[_0xeae4('0x1a')](_0xeae4('0x1f'),_0x341738['message'],_0x5efb17);_0x3d98d1(_0x3bc873[_0xeae4('0x1a')](0x1f4,_0x341738['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 96ca8bc..2ce798c 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 _0xe5d5=['length','chatMessage:','remove','removeListener','register'];(function(_0x51b661,_0x566ef8){var _0x5d1971=function(_0x5cc6b8){while(--_0x5cc6b8){_0x51b661['push'](_0x51b661['shift']());}};_0x5d1971(++_0x566ef8);}(_0xe5d5,0x156));var _0x5e5d=function(_0x5404dd,_0xa1b7a3){_0x5404dd=_0x5404dd-0x0;var _0x53afdd=_0xe5d5[_0x5404dd];return _0x53afdd;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save',_0x5e5d('0x0'),'update'];function createListener(_0x9f47d6,_0x4b8ae9){return function(_0x50afd3){_0x4b8ae9['emit'](_0x9f47d6,_0x50afd3);};}function removeListener(_0x3e2410,_0x191980){return function(){ChatMessageEvents[_0x5e5d('0x1')](_0x3e2410,_0x191980);};}exports[_0x5e5d('0x2')]=function(_0x13bcb7){for(var _0x39077f=0x0,_0x3200d5=events[_0x5e5d('0x3')];_0x39077f<_0x3200d5;_0x39077f++){var _0x23de8d=events[_0x39077f];var _0x131a59=createListener(_0x5e5d('0x4')+_0x23de8d,_0x13bcb7);ChatMessageEvents['on'](_0x23de8d,_0x131a59);}};
\ No newline at end of file
+var _0x29d4=['removeListener','register','length','./chatMessage.events','remove','update'];(function(_0x522a3b,_0x22b40a){var _0x761494=function(_0x4c599a){while(--_0x4c599a){_0x522a3b['push'](_0x522a3b['shift']());}};_0x761494(++_0x22b40a);}(_0x29d4,0x1a1));var _0x429d=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x29d4[_0x54d4fe];return _0x1ab5bb;};'use strict';var ChatMessageEvents=require(_0x429d('0x0'));var events=['save',_0x429d('0x1'),_0x429d('0x2')];function createListener(_0x16ce75,_0x472fc9){return function(_0x45df1c){_0x472fc9['emit'](_0x16ce75,_0x45df1c);};}function removeListener(_0xc3989d,_0x3f43f5){return function(){ChatMessageEvents[_0x429d('0x3')](_0xc3989d,_0x3f43f5);};}exports[_0x429d('0x4')]=function(_0x1c55aa){for(var _0xa71445=0x0,_0x56aa2f=events[_0x429d('0x5')];_0xa71445<_0x56aa2f;_0xa71445++){var _0x4befb9=events[_0xa71445];var _0x9fc337=createListener('chatMessage:'+_0x4befb9,_0x1c55aa);ChatMessageEvents['on'](_0x4befb9,_0x9fc337);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 5550046..b192b48 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 _0x8ca0=['describe','/:id','post','chat','chatmessage:create','create','put','update','/:id/accept','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe'];(function(_0x228516,_0x44b04d){var _0x19fd2b=function(_0x2d63b){while(--_0x2d63b){_0x228516['push'](_0x228516['shift']());}};_0x19fd2b(++_0x44b04d);}(_0x8ca0,0x110));var _0x08ca=function(_0x1a0694,_0x318d2b){_0x1a0694=_0x1a0694-0x0;var _0x48c228=_0x8ca0[_0x1a0694];return _0x48c228;};'use strict';var multer=require(_0x08ca('0x0'));var util=require(_0x08ca('0x1'));var path=require(_0x08ca('0x2'));var timeout=require(_0x08ca('0x3'));var express=require(_0x08ca('0x4'));var router=express[_0x08ca('0x5')]();var fs_extra=require(_0x08ca('0x6'));var auth=require(_0x08ca('0x7'));var interaction=require(_0x08ca('0x8'));var config=require(_0x08ca('0x9'));var controller=require(_0x08ca('0xa'));router[_0x08ca('0xb')]('/',auth[_0x08ca('0xc')](),controller['index']);router[_0x08ca('0xb')](_0x08ca('0xd'),auth[_0x08ca('0xc')](),controller[_0x08ca('0xe')]);router[_0x08ca('0xb')](_0x08ca('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x08ca('0x10')]('/',auth[_0x08ca('0xc')](),interaction['tracked'](_0x08ca('0x11'),_0x08ca('0x12')),controller[_0x08ca('0x13')]);router[_0x08ca('0x14')](_0x08ca('0xf'),controller[_0x08ca('0x15')]);router[_0x08ca('0x14')](_0x08ca('0x16'),auth[_0x08ca('0xc')](),controller['accept']);router[_0x08ca('0x14')]('/:id/reject',auth[_0x08ca('0xc')](),controller['reject']);router[_0x08ca('0x17')](_0x08ca('0xf'),auth[_0x08ca('0xc')](),controller[_0x08ca('0x18')]);module[_0x08ca('0x19')]=router;
\ No newline at end of file
+var _0xaeee=['/:id/accept','accept','delete','/:id','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','tracked','chat','chatmessage:create','create','put','update'];(function(_0x51dd8b,_0x326222){var _0x11cc3d=function(_0x2f1138){while(--_0x2f1138){_0x51dd8b['push'](_0x51dd8b['shift']());}};_0x11cc3d(++_0x326222);}(_0xaeee,0x124));var _0xeaee=function(_0x330bdf,_0x4f10f3){_0x330bdf=_0x330bdf-0x0;var _0x3db14d=_0xaeee[_0x330bdf];return _0x3db14d;};'use strict';var multer=require(_0xeaee('0x0'));var util=require('util');var path=require(_0xeaee('0x1'));var timeout=require(_0xeaee('0x2'));var express=require(_0xeaee('0x3'));var router=express['Router']();var fs_extra=require(_0xeaee('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xeaee('0x5'));var config=require(_0xeaee('0x6'));var controller=require('./chatMessage.controller');router[_0xeaee('0x7')]('/',auth[_0xeaee('0x8')](),controller[_0xeaee('0x9')]);router['get'](_0xeaee('0xa'),auth[_0xeaee('0x8')](),controller[_0xeaee('0xb')]);router[_0xeaee('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xeaee('0xc')]);router[_0xeaee('0xd')]('/',auth[_0xeaee('0x8')](),interaction[_0xeaee('0xe')](_0xeaee('0xf'),_0xeaee('0x10')),controller[_0xeaee('0x11')]);router[_0xeaee('0x12')]('/:id',controller[_0xeaee('0x13')]);router['put'](_0xeaee('0x14'),auth[_0xeaee('0x8')](),controller[_0xeaee('0x15')]);router[_0xeaee('0x12')]('/:id/reject',auth[_0xeaee('0x8')](),controller['reject']);router[_0xeaee('0x16')](_0xeaee('0x17'),auth[_0xeaee('0x8')](),controller[_0xeaee('0x18')]);module[_0xeaee('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 d5c9592..c2cd8c0 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 _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0xeb5065,_0x534468){var _0x466f5d=function(_0x5de2ea){while(--_0x5de2ea){_0xeb5065['push'](_0xeb5065['shift']());}};_0x466f5d(++_0x534468);}(_0xdb28,0x106));var _0x8db2=function(_0x2f36bd,_0x4a8866){_0x2f36bd=_0x2f36bd-0x0;var _0x299a9f=_0xdb28[_0x2f36bd];return _0x299a9f;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0x5f66=['medium','TEXT','exports'];(function(_0x51b9cd,_0x2f3f83){var _0x4ebcf7=function(_0x588728){while(--_0x588728){_0x51b9cd['push'](_0x51b9cd['shift']());}};_0x4ebcf7(++_0x2f3f83);}(_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
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 970c945..ebc95b5 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x7a54,0x106));var _0x47a5=function(_0x21e576,_0x24aceb){_0x21e576=_0x21e576-0x0;var _0x3df6e6=_0x7a54[_0x21e576];return _0x3df6e6;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _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(_0x32612d,_0x17aa87){var _0x487e65=function(_0x5a9fad){while(--_0x5a9fad){_0x32612d['push'](_0x32612d['shift']());}};_0x487e65(++_0x17aa87);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 1dd050b..e859fb5 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 _0x1bc3=['exports','events','../../mysqldb','setMaxListeners','remove','emit','hook'];(function(_0x34e030,_0x57c46d){var _0x1a6406=function(_0x74f5ca){while(--_0x74f5ca){_0x34e030['push'](_0x34e030['shift']());}};_0x1a6406(++_0x57c46d);}(_0x1bc3,0x8d));var _0x31bc=function(_0xbb80d,_0xb8a3bc){_0xbb80d=_0xbb80d-0x0;var _0x2cb1ca=_0x1bc3[_0xbb80d];return _0x2cb1ca;};'use strict';var EventEmitter=require(_0x31bc('0x0'));var ChatOfflineMessage=require(_0x31bc('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x31bc('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x31bc('0x3')};function emitEvent(_0x9c2632){return function(_0x2978d1,_0x2816d9,_0xa891f4){ChatOfflineMessageEvents[_0x31bc('0x4')](_0x9c2632+':'+_0x2978d1['id'],_0x2978d1);ChatOfflineMessageEvents[_0x31bc('0x4')](_0x9c2632,_0x2978d1);_0xa891f4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x31bc('0x5')](e,emitEvent(event));}}module[_0x31bc('0x6')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x099f=['exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x2610ff,_0x54f0b7){var _0x1c88c3=function(_0x354890){while(--_0x354890){_0x2610ff['push'](_0x2610ff['shift']());}};_0x1c88c3(++_0x54f0b7);}(_0x099f,0x133));var _0xf099=function(_0x1dfb1e,_0x888459){_0x1dfb1e=_0x1dfb1e-0x0;var _0x1d45d0=_0x099f[_0x1dfb1e];return _0x1d45d0;};'use strict';var EventEmitter=require(_0xf099('0x0'));var ChatOfflineMessage=require(_0xf099('0x1'))['db'][_0xf099('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xf099('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf099('0x4'),'afterDestroy':_0xf099('0x5')};function emitEvent(_0x8c3488){return function(_0x24270f,_0x3f46c0,_0x35a43a){ChatOfflineMessageEvents[_0xf099('0x6')](_0x8c3488+':'+_0x24270f['id'],_0x24270f);ChatOfflineMessageEvents['emit'](_0x8c3488,_0x24270f);_0x35a43a(null);};}for(var e in events){if(events[_0xf099('0x7')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0xf099('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 7f39fb7..8c731d3 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 _0xf7ce=['utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','define','ChatOfflineMessage'];(function(_0x31a3b8,_0x43baac){var _0x4a2136=function(_0x78118d){while(--_0x78118d){_0x31a3b8['push'](_0x31a3b8['shift']());}};_0x4a2136(++_0x43baac);}(_0xf7ce,0xa7));var _0xef7c=function(_0x450f20,_0x159bb3){_0x450f20=_0x450f20-0x0;var _0x15bd66=_0xf7ce[_0x450f20];return _0x15bd66;};'use strict';var attributes=require(_0xef7c('0x0'));module['exports']=function(_0x555357){return _0x555357[_0xef7c('0x1')](_0xef7c('0x2'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xef7c('0x3'),'collate':_0xef7c('0x4')});};
\ No newline at end of file
+var _0xe667=['utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define','chat_offline_messages'];(function(_0x2c97be,_0x36e2ab){var _0x305a3f=function(_0x3f40b2){while(--_0x3f40b2){_0x2c97be['push'](_0x2c97be['shift']());}};_0x305a3f(++_0x36e2ab);}(_0xe667,0xb0));var _0x7e66=function(_0x3976c2,_0x60dd0f){_0x3976c2=_0x3976c2-0x0;var _0x1d3076=_0xe667[_0x3976c2];return _0x1d3076;};'use strict';var attributes=require(_0x7e66('0x0'));module[_0x7e66('0x1')]=function(_0x54ee81){return _0x54ee81[_0x7e66('0x2')]('ChatOfflineMessage',attributes,{'tableName':_0x7e66('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7e66('0x4'),'collate':_0x7e66('0x5')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index b59cd39..7896332 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 _0x6f0d=['message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x477ea6,_0x57d82f){var _0x2c8441=function(_0x6c7ac6){while(--_0x6c7ac6){_0x477ea6['push'](_0x477ea6['shift']());}};_0x2c8441(++_0x57d82f);}(_0x6f0d,0x1e5));var _0xd6f0=function(_0x25f195,_0x12a8a9){_0x25f195=_0x25f195-0x0;var _0x15b90f=_0x6f0d[_0x25f195];return _0x15b90f;};'use strict';var _=require(_0xd6f0('0x0'));var util=require('util');var moment=require(_0xd6f0('0x1'));var BPromise=require(_0xd6f0('0x2'));var rs=require(_0xd6f0('0x3'));var fs=require('fs');var Redis=require(_0xd6f0('0x4'));var db=require(_0xd6f0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd6f0('0x6'))(_0xd6f0('0x7'));var config=require(_0xd6f0('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd6f0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1cf8b2,_0x2ba1b2,_0x289bc6){return new BPromise(function(_0x272022,_0x16f3c4){return client[_0xd6f0('0xa')](_0x1cf8b2,_0x289bc6)[_0xd6f0('0xb')](function(_0x4b8c2b){logger[_0xd6f0('0xc')](_0xd6f0('0xd'),_0x2ba1b2,_0xd6f0('0xe'));logger[_0xd6f0('0xf')](_0xd6f0('0x10'),_0x2ba1b2,'request\x20sent',JSON['stringify'](_0x4b8c2b));if(_0x4b8c2b[_0xd6f0('0x11')]){if(_0x4b8c2b['error'][_0xd6f0('0x12')]===0x1f4){logger[_0xd6f0('0x11')](_0xd6f0('0xd'),_0x2ba1b2,_0x4b8c2b[_0xd6f0('0x11')][_0xd6f0('0x13')]);return _0x16f3c4(_0x4b8c2b[_0xd6f0('0x11')][_0xd6f0('0x13')]);}logger[_0xd6f0('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x2ba1b2,_0x4b8c2b[_0xd6f0('0x11')][_0xd6f0('0x13')]);return _0x272022(_0x4b8c2b['error'][_0xd6f0('0x13')]);}else{logger['info'](_0xd6f0('0xd'),_0x2ba1b2,_0xd6f0('0xe'));_0x272022(_0x4b8c2b['result'][_0xd6f0('0x13')]);}})[_0xd6f0('0x14')](function(_0x4b17c2){logger[_0xd6f0('0x11')](_0xd6f0('0xd'),_0x2ba1b2,_0x4b17c2);_0x16f3c4(_0x4b17c2);});});}
\ No newline at end of file
+var _0x0b1a=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0b1a,0x10c));var _0xa0b1=function(_0x5914a0,_0x4c5621){_0x5914a0=_0x5914a0-0x0;var _0x487478=_0x0b1a[_0x5914a0];return _0x487478;};'use strict';var _=require(_0xa0b1('0x0'));var util=require(_0xa0b1('0x1'));var moment=require(_0xa0b1('0x2'));var BPromise=require(_0xa0b1('0x3'));var rs=require(_0xa0b1('0x4'));var fs=require('fs');var Redis=require(_0xa0b1('0x5'));var db=require(_0xa0b1('0x6'))['db'];var utils=require(_0xa0b1('0x7'));var logger=require(_0xa0b1('0x8'))(_0xa0b1('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa0b1('0xa')][_0xa0b1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e6d17,_0x692771,_0x96fa55){return new BPromise(function(_0x5d94ca,_0x56a728){return client[_0xa0b1('0xc')](_0x2e6d17,_0x96fa55)[_0xa0b1('0xd')](function(_0x50c1c0){logger[_0xa0b1('0xe')](_0xa0b1('0xf'),_0x692771,_0xa0b1('0x10'));logger[_0xa0b1('0x11')](_0xa0b1('0x12'),_0x692771,'request\x20sent',JSON['stringify'](_0x50c1c0));if(_0x50c1c0[_0xa0b1('0x13')]){if(_0x50c1c0[_0xa0b1('0x13')][_0xa0b1('0x14')]===0x1f4){logger[_0xa0b1('0x13')](_0xa0b1('0xf'),_0x692771,_0x50c1c0[_0xa0b1('0x13')][_0xa0b1('0x15')]);return _0x56a728(_0x50c1c0['error'][_0xa0b1('0x15')]);}logger[_0xa0b1('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x692771,_0x50c1c0[_0xa0b1('0x13')]['message']);return _0x5d94ca(_0x50c1c0[_0xa0b1('0x13')][_0xa0b1('0x15')]);}else{logger['info'](_0xa0b1('0xf'),_0x692771,'request\x20sent');_0x5d94ca(_0x50c1c0[_0xa0b1('0x16')][_0xa0b1('0x15')]);}})[_0xa0b1('0x17')](function(_0x3b1918){logger[_0xa0b1('0x13')](_0xa0b1('0xf'),_0x692771,_0x3b1918);_0x56a728(_0x3b1918);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index c597ede..1183c25 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 _0x21ec=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','isAuthenticated','index','get','describe','/:id','show','put','delete','destroy','exports','multer','path'];(function(_0x43cfe0,_0x39822f){var _0x50d951=function(_0x134d52){while(--_0x134d52){_0x43cfe0['push'](_0x43cfe0['shift']());}};_0x50d951(++_0x39822f);}(_0x21ec,0x167));var _0xc21e=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0x21ec[_0x39d544];return _0x5a5ff2;};'use strict';var multer=require(_0xc21e('0x0'));var util=require('util');var path=require(_0xc21e('0x1'));var timeout=require(_0xc21e('0x2'));var express=require(_0xc21e('0x3'));var router=express[_0xc21e('0x4')]();var fs_extra=require(_0xc21e('0x5'));var auth=require(_0xc21e('0x6'));var interaction=require(_0xc21e('0x7'));var config=require('../../config/environment');var controller=require(_0xc21e('0x8'));router['get']('/',auth[_0xc21e('0x9')](),controller[_0xc21e('0xa')]);router[_0xc21e('0xb')]('/describe',auth['isAuthenticated'](),controller[_0xc21e('0xc')]);router[_0xc21e('0xb')](_0xc21e('0xd'),auth['isAuthenticated'](),controller[_0xc21e('0xe')]);router['post']('/',auth[_0xc21e('0x9')](),controller['create']);router[_0xc21e('0xf')](_0xc21e('0xd'),auth[_0xc21e('0x9')](),controller['update']);router[_0xc21e('0x10')]('/:id',auth[_0xc21e('0x9')](),controller[_0xc21e('0x11')]);module[_0xc21e('0x12')]=router;
\ No newline at end of file
+var _0xbee3=['fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','/describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x440fde,_0x445ce0){var _0x11052c=function(_0x49f547){while(--_0x49f547){_0x440fde['push'](_0x440fde['shift']());}};_0x11052c(++_0x445ce0);}(_0xbee3,0x135));var _0x3bee=function(_0x541cc4,_0x4e0979){_0x541cc4=_0x541cc4-0x0;var _0x94514c=_0xbee3[_0x541cc4];return _0x94514c;};'use strict';var multer=require(_0x3bee('0x0'));var util=require(_0x3bee('0x1'));var path=require(_0x3bee('0x2'));var timeout=require(_0x3bee('0x3'));var express=require(_0x3bee('0x4'));var router=express[_0x3bee('0x5')]();var fs_extra=require(_0x3bee('0x6'));var auth=require(_0x3bee('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3bee('0x8'));var controller=require(_0x3bee('0x9'));router[_0x3bee('0xa')]('/',auth[_0x3bee('0xb')](),controller['index']);router['get'](_0x3bee('0xc'),auth[_0x3bee('0xb')](),controller['describe']);router[_0x3bee('0xa')](_0x3bee('0xd'),auth[_0x3bee('0xb')](),controller[_0x3bee('0xe')]);router[_0x3bee('0xf')]('/',auth[_0x3bee('0xb')](),controller[_0x3bee('0x10')]);router[_0x3bee('0x11')](_0x3bee('0xd'),auth[_0x3bee('0xb')](),controller[_0x3bee('0x12')]);router[_0x3bee('0x13')](_0x3bee('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x3bee('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 27b7ed3..d91dc1a 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 _0x2c99=['ENUM','mouseOver','exports','STRING'];(function(_0x59fbee,_0x12fd1e){var _0x205a62=function(_0x6c7309){while(--_0x6c7309){_0x59fbee['push'](_0x59fbee['shift']());}};_0x205a62(++_0x12fd1e);}(_0x2c99,0x166));var _0x92c9=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x2c99[_0xaa1b3e];return _0x454d7d;};'use strict';var Sequelize=require('sequelize');module[_0x92c9('0x0')]={'name':{'type':Sequelize[_0x92c9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x92c9('0x2')](_0x92c9('0x3'),'timeout'),'defaultValue':_0x92c9('0x3')},'selector':{'type':Sequelize[_0x92c9('0x1')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x5bf3=['mouseOver','timeout','STRING','INTEGER','sequelize','exports'];(function(_0x554092,_0x211b5f){var _0x33d000=function(_0x43b7a6){while(--_0x43b7a6){_0x554092['push'](_0x554092['shift']());}};_0x33d000(++_0x211b5f);}(_0x5bf3,0xd0));var _0x35bf=function(_0x18df06,_0x26d5cb){_0x18df06=_0x18df06-0x0;var _0x15553a=_0x5bf3[_0x18df06];return _0x15553a;};'use strict';var Sequelize=require(_0x35bf('0x0'));module[_0x35bf('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x35bf('0x2'),_0x35bf('0x3')),'defaultValue':_0x35bf('0x2')},'selector':{'type':Sequelize[_0x35bf('0x4')]},'timeout':{'type':Sequelize[_0x35bf('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index a263749..7d1a0c5 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 _0x7a59=['fields','length','includeAll','include','merge','options','ChatProactiveAction','find','catch','create','body','update','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','offset','count','limit','Content-Range','apply','reject','then','destroy','end','error','stack','name','send','params','keys','rawAttributes','query','model','attributes'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x7a59,0x16e));var _0x97a5=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0x7a59[_0x26f702];return _0x11417d;};'use strict';var emlformat=require(_0x97a5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x97a5('0x1'));var rp=require(_0x97a5('0x2'));var moment=require(_0x97a5('0x3'));var BPromise=require(_0x97a5('0x4'));var Mustache=require(_0x97a5('0x5'));var util=require('util');var path=require(_0x97a5('0x6'));var sox=require(_0x97a5('0x7'));var csv=require(_0x97a5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x97a5('0x9'));var _=require(_0x97a5('0xa'));var squel=require(_0x97a5('0xb'));var crypto=require(_0x97a5('0xc'));var jsforce=require(_0x97a5('0xd'));var deskjs=require(_0x97a5('0xe'));var toCsv=require(_0x97a5('0x8'));var querystring=require('querystring');var Papa=require(_0x97a5('0xf'));var Redis=require(_0x97a5('0x10'));var authService=require(_0x97a5('0x11'));var qs=require(_0x97a5('0x12'));var as=require(_0x97a5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x97a5('0x14'));var utils=require(_0x97a5('0x15'));var config=require(_0x97a5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x97a5('0x17'))['db'];function respondWithStatusCode(_0x350720,_0x55305a){_0x55305a=_0x55305a||0xcc;return function(_0x4f85a0){if(_0x4f85a0){return _0x350720[_0x97a5('0x18')](_0x55305a);}return _0x350720[_0x97a5('0x19')](_0x55305a)['end']();};}function respondWithResult(_0x595437,_0x51d5e2){_0x51d5e2=_0x51d5e2||0xc8;return function(_0x5a4471){if(_0x5a4471){return _0x595437[_0x97a5('0x19')](_0x51d5e2)[_0x97a5('0x1a')](_0x5a4471);}};}function respondWithFilteredResult(_0x3603e4,_0x4d8ba7){return function(_0x1a7a62){if(_0x1a7a62){var _0x3fa986=typeof _0x4d8ba7['offset']===_0x97a5('0x1b')&&typeof _0x4d8ba7['limit']===_0x97a5('0x1b');var _0x55071b=_0x1a7a62['count'];var _0x52ce92=_0x3fa986?0x0:_0x4d8ba7[_0x97a5('0x1c')];var _0x5c5740=_0x3fa986?_0x1a7a62[_0x97a5('0x1d')]:_0x4d8ba7[_0x97a5('0x1c')]+_0x4d8ba7[_0x97a5('0x1e')];var _0x1efe8c;if(_0x5c5740>=_0x55071b){_0x5c5740=_0x55071b;_0x1efe8c=0xc8;}else{_0x1efe8c=0xce;}_0x3603e4['status'](_0x1efe8c);return _0x3603e4['set'](_0x97a5('0x1f'),_0x52ce92+'-'+_0x5c5740+'/'+_0x55071b)[_0x97a5('0x1a')](_0x1a7a62);}return null;};}function patchUpdates(_0x4e3386){return function(_0x51858b){try{jsonpatch[_0x97a5('0x20')](_0x51858b,_0x4e3386,!![]);}catch(_0x3d7dba){return BPromise[_0x97a5('0x21')](_0x3d7dba);}return _0x51858b['save']();};}function saveUpdates(_0x34fb55,_0x3a5849){return function(_0x23f4f8){if(_0x23f4f8){return _0x23f4f8['update'](_0x34fb55)[_0x97a5('0x22')](function(_0x33d6da){return _0x33d6da;});}return null;};}function removeEntity(_0x4e2074,_0x5e731e){return function(_0x469592){if(_0x469592){return _0x469592[_0x97a5('0x23')]()[_0x97a5('0x22')](function(){_0x4e2074[_0x97a5('0x19')](0xcc)[_0x97a5('0x24')]();});}};}function handleEntityNotFound(_0x302d78,_0xf7ad1e){return function(_0x4743e0){if(!_0x4743e0){_0x302d78['sendStatus'](0x194);}return _0x4743e0;};}function handleError(_0x2038dd,_0x46ee45){_0x46ee45=_0x46ee45||0x1f4;return function(_0x2ca97c){logger[_0x97a5('0x25')](_0x2ca97c[_0x97a5('0x26')]);if(_0x2ca97c[_0x97a5('0x27')]){delete _0x2ca97c['name'];}_0x2038dd[_0x97a5('0x19')](_0x46ee45)[_0x97a5('0x28')](_0x2ca97c);};}exports['show']=function(_0x274ccb,_0x52248f){var _0x48f1c1={'raw':!![],'where':{'id':_0x274ccb[_0x97a5('0x29')]['id']}},_0x1bdb74={};_0x1bdb74['model']=_[_0x97a5('0x2a')](db['ChatProactiveAction'][_0x97a5('0x2b')]);_0x1bdb74[_0x97a5('0x2c')]=_[_0x97a5('0x2a')](_0x274ccb[_0x97a5('0x2c')]);_0x1bdb74['filters']=_['intersection'](_0x1bdb74[_0x97a5('0x2d')],_0x1bdb74[_0x97a5('0x2c')]);_0x48f1c1[_0x97a5('0x2e')]=_['intersection'](_0x1bdb74[_0x97a5('0x2d')],qs[_0x97a5('0x2f')](_0x274ccb['query'][_0x97a5('0x2f')]));_0x48f1c1[_0x97a5('0x2e')]=_0x48f1c1['attributes'][_0x97a5('0x30')]?_0x48f1c1[_0x97a5('0x2e')]:_0x1bdb74[_0x97a5('0x2d')];if(_0x274ccb['query'][_0x97a5('0x31')]){_0x48f1c1[_0x97a5('0x32')]=[{'all':!![]}];}_0x48f1c1=_[_0x97a5('0x33')]({},_0x48f1c1,_0x274ccb[_0x97a5('0x34')]);return db[_0x97a5('0x35')][_0x97a5('0x36')](_0x48f1c1)[_0x97a5('0x22')](handleEntityNotFound(_0x52248f,null))['then'](respondWithResult(_0x52248f,null))[_0x97a5('0x37')](handleError(_0x52248f,null));};exports[_0x97a5('0x38')]=function(_0xcb2c5b,_0x393994){return db[_0x97a5('0x35')][_0x97a5('0x38')](_0xcb2c5b[_0x97a5('0x39')],{})[_0x97a5('0x22')](respondWithResult(_0x393994,0xc9))[_0x97a5('0x37')](handleError(_0x393994,null));};exports[_0x97a5('0x3a')]=function(_0x1c007d,_0x1d5c4a){if(_0x1c007d[_0x97a5('0x39')]['id']){delete _0x1c007d['body']['id'];}return db[_0x97a5('0x35')][_0x97a5('0x36')]({'where':{'id':_0x1c007d[_0x97a5('0x29')]['id']}})[_0x97a5('0x22')](handleEntityNotFound(_0x1d5c4a,null))[_0x97a5('0x22')](saveUpdates(_0x1c007d['body'],null))['then'](respondWithResult(_0x1d5c4a,null))[_0x97a5('0x37')](handleError(_0x1d5c4a,null));};exports[_0x97a5('0x23')]=function(_0x52d774,_0x45a548){return db[_0x97a5('0x35')][_0x97a5('0x36')]({'where':{'id':_0x52d774['params']['id']}})[_0x97a5('0x22')](handleEntityNotFound(_0x45a548,null))['then'](removeEntity(_0x45a548,null))[_0x97a5('0x37')](handleError(_0x45a548,null));};
\ No newline at end of file
+var _0x3ca4=['count','status','Content-Range','apply','reject','save','then','destroy','error','send','show','params','keys','query','filters','intersection','fields','attributes','length','model','includeAll','merge','ChatProactiveAction','find','create','body','catch','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit'];(function(_0x18a8c5,_0x547d26){var _0x2d8579=function(_0x480b7f){while(--_0x480b7f){_0x18a8c5['push'](_0x18a8c5['shift']());}};_0x2d8579(++_0x547d26);}(_0x3ca4,0x17d));var _0x43ca=function(_0x44ace3,_0x52cbcc){_0x44ace3=_0x44ace3-0x0;var _0x1334a2=_0x3ca4[_0x44ace3];return _0x1334a2;};'use strict';var emlformat=require(_0x43ca('0x0'));var rimraf=require(_0x43ca('0x1'));var zipdir=require(_0x43ca('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x43ca('0x3'));var BPromise=require(_0x43ca('0x4'));var Mustache=require(_0x43ca('0x5'));var util=require(_0x43ca('0x6'));var path=require(_0x43ca('0x7'));var sox=require(_0x43ca('0x8'));var csv=require(_0x43ca('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x43ca('0xa'));var _=require(_0x43ca('0xb'));var squel=require(_0x43ca('0xc'));var crypto=require(_0x43ca('0xd'));var jsforce=require(_0x43ca('0xe'));var deskjs=require(_0x43ca('0xf'));var toCsv=require(_0x43ca('0x9'));var querystring=require(_0x43ca('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x43ca('0x11'));var qs=require(_0x43ca('0x12'));var as=require(_0x43ca('0x13'));var hardwareService=require(_0x43ca('0x14'));var logger=require('../../config/logger')(_0x43ca('0x15'));var utils=require(_0x43ca('0x16'));var config=require(_0x43ca('0x17'));var licenseUtil=require(_0x43ca('0x18'));var db=require(_0x43ca('0x19'))['db'];function respondWithStatusCode(_0x246ead,_0x30184f){_0x30184f=_0x30184f||0xcc;return function(_0x2ede07){if(_0x2ede07){return _0x246ead[_0x43ca('0x1a')](_0x30184f);}return _0x246ead['status'](_0x30184f)[_0x43ca('0x1b')]();};}function respondWithResult(_0x13cf26,_0x4b710d){_0x4b710d=_0x4b710d||0xc8;return function(_0x309176){if(_0x309176){return _0x13cf26['status'](_0x4b710d)[_0x43ca('0x1c')](_0x309176);}};}function respondWithFilteredResult(_0x567579,_0xdccc62){return function(_0x1a8bf6){if(_0x1a8bf6){var _0x51a517=typeof _0xdccc62[_0x43ca('0x1d')]===_0x43ca('0x1e')&&typeof _0xdccc62[_0x43ca('0x1f')]==='undefined';var _0x4fb5e4=_0x1a8bf6['count'];var _0x5e50c9=_0x51a517?0x0:_0xdccc62[_0x43ca('0x1d')];var _0x268817=_0x51a517?_0x1a8bf6[_0x43ca('0x20')]:_0xdccc62['offset']+_0xdccc62[_0x43ca('0x1f')];var _0x806f68;if(_0x268817>=_0x4fb5e4){_0x268817=_0x4fb5e4;_0x806f68=0xc8;}else{_0x806f68=0xce;}_0x567579[_0x43ca('0x21')](_0x806f68);return _0x567579['set'](_0x43ca('0x22'),_0x5e50c9+'-'+_0x268817+'/'+_0x4fb5e4)['json'](_0x1a8bf6);}return null;};}function patchUpdates(_0x106d07){return function(_0x9bc5dc){try{jsonpatch[_0x43ca('0x23')](_0x9bc5dc,_0x106d07,!![]);}catch(_0x5ae497){return BPromise[_0x43ca('0x24')](_0x5ae497);}return _0x9bc5dc[_0x43ca('0x25')]();};}function saveUpdates(_0x2af64f,_0x2ad8fa){return function(_0x35d34c){if(_0x35d34c){return _0x35d34c['update'](_0x2af64f)[_0x43ca('0x26')](function(_0x34767e){return _0x34767e;});}return null;};}function removeEntity(_0x557b96,_0x379902){return function(_0x22d6ac){if(_0x22d6ac){return _0x22d6ac[_0x43ca('0x27')]()[_0x43ca('0x26')](function(){_0x557b96[_0x43ca('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2da1ec,_0xc07cde){return function(_0x29f2ee){if(!_0x29f2ee){_0x2da1ec[_0x43ca('0x1a')](0x194);}return _0x29f2ee;};}function handleError(_0x14287e,_0x1de54b){_0x1de54b=_0x1de54b||0x1f4;return function(_0x3b2078){logger[_0x43ca('0x28')](_0x3b2078['stack']);if(_0x3b2078['name']){delete _0x3b2078['name'];}_0x14287e[_0x43ca('0x21')](_0x1de54b)[_0x43ca('0x29')](_0x3b2078);};}exports[_0x43ca('0x2a')]=function(_0x9d09b9,_0x34dc4f){var _0x36884b={'raw':!![],'where':{'id':_0x9d09b9[_0x43ca('0x2b')]['id']}},_0xffad2d={};_0xffad2d['model']=_[_0x43ca('0x2c')](db['ChatProactiveAction']['rawAttributes']);_0xffad2d[_0x43ca('0x2d')]=_[_0x43ca('0x2c')](_0x9d09b9[_0x43ca('0x2d')]);_0xffad2d[_0x43ca('0x2e')]=_[_0x43ca('0x2f')](_0xffad2d['model'],_0xffad2d[_0x43ca('0x2d')]);_0x36884b['attributes']=_[_0x43ca('0x2f')](_0xffad2d['model'],qs[_0x43ca('0x30')](_0x9d09b9[_0x43ca('0x2d')]['fields']));_0x36884b[_0x43ca('0x31')]=_0x36884b[_0x43ca('0x31')][_0x43ca('0x32')]?_0x36884b[_0x43ca('0x31')]:_0xffad2d[_0x43ca('0x33')];if(_0x9d09b9[_0x43ca('0x2d')][_0x43ca('0x34')]){_0x36884b['include']=[{'all':!![]}];}_0x36884b=_[_0x43ca('0x35')]({},_0x36884b,_0x9d09b9['options']);return db[_0x43ca('0x36')][_0x43ca('0x37')](_0x36884b)['then'](handleEntityNotFound(_0x34dc4f,null))[_0x43ca('0x26')](respondWithResult(_0x34dc4f,null))['catch'](handleError(_0x34dc4f,null));};exports['create']=function(_0x10f75c,_0x2f69ba){return db[_0x43ca('0x36')][_0x43ca('0x38')](_0x10f75c[_0x43ca('0x39')],{})[_0x43ca('0x26')](respondWithResult(_0x2f69ba,0xc9))[_0x43ca('0x3a')](handleError(_0x2f69ba,null));};exports['update']=function(_0x43b29b,_0x67b8b0){if(_0x43b29b['body']['id']){delete _0x43b29b[_0x43ca('0x39')]['id'];}return db[_0x43ca('0x36')]['find']({'where':{'id':_0x43b29b[_0x43ca('0x2b')]['id']}})['then'](handleEntityNotFound(_0x67b8b0,null))['then'](saveUpdates(_0x43b29b[_0x43ca('0x39')],null))[_0x43ca('0x26')](respondWithResult(_0x67b8b0,null))[_0x43ca('0x3a')](handleError(_0x67b8b0,null));};exports[_0x43ca('0x27')]=function(_0xa466c9,_0x2205c4){return db[_0x43ca('0x36')][_0x43ca('0x37')]({'where':{'id':_0xa466c9[_0x43ca('0x2b')]['id']}})[_0x43ca('0x26')](handleEntityNotFound(_0x2205c4,null))[_0x43ca('0x26')](removeEntity(_0x2205c4,null))[_0x43ca('0x3a')](handleError(_0x2205c4,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 60ac497..bd40416 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 _0x2763=['define','ChatProactiveAction','chat_proactive_actions','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports'];(function(_0xb5a0a0,_0x3b986d){var _0x422626=function(_0x9dabe8){while(--_0x9dabe8){_0xb5a0a0['push'](_0xb5a0a0['shift']());}};_0x422626(++_0x3b986d);}(_0x2763,0x16e));var _0x3276=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2763[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3276('0x0'));var util=require('util');var logger=require(_0x3276('0x1'))(_0x3276('0x2'));var moment=require('moment');var BPromise=require(_0x3276('0x3'));var rp=require(_0x3276('0x4'));var fs=require('fs');var path=require(_0x3276('0x5'));var rimraf=require('rimraf');var config=require(_0x3276('0x6'));var attributes=require('./chatProactiveAction.attributes');module[_0x3276('0x7')]=function(_0x4d0b19,_0x583559){return _0x4d0b19[_0x3276('0x8')](_0x3276('0x9'),attributes,{'tableName':_0x3276('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa711=['chat_proactive_actions','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','ChatProactiveAction'];(function(_0x2e7abb,_0x1e2a4a){var _0xb46ecd=function(_0x99533a){while(--_0x99533a){_0x2e7abb['push'](_0x2e7abb['shift']());}};_0xb46ecd(++_0x1e2a4a);}(_0xa711,0x12d));var _0x1a71=function(_0x1c09bf,_0x259ee2){_0x1c09bf=_0x1c09bf-0x0;var _0x40cdfa=_0xa711[_0x1c09bf];return _0x40cdfa;};'use strict';var _=require(_0x1a71('0x0'));var util=require('util');var logger=require(_0x1a71('0x1'))(_0x1a71('0x2'));var moment=require(_0x1a71('0x3'));var BPromise=require(_0x1a71('0x4'));var rp=require(_0x1a71('0x5'));var fs=require('fs');var path=require(_0x1a71('0x6'));var rimraf=require('rimraf');var config=require(_0x1a71('0x7'));var attributes=require('./chatProactiveAction.attributes');module['exports']=function(_0x22d966,_0x3d2e99){return _0x22d966['define'](_0x1a71('0x8'),attributes,{'tableName':_0x1a71('0x9'),'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 b8cbd33..eb43acd 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 _0xec68=['rpc','../../config/environment','jayson/promise','client','http','info','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1f0c2e,_0x22ca22){var _0x11a54a=function(_0xd0545c){while(--_0xd0545c){_0x1f0c2e['push'](_0x1f0c2e['shift']());}};_0x11a54a(++_0x22ca22);}(_0xec68,0x18f));var _0x8ec6=function(_0x2730af,_0x264033){_0x2730af=_0x2730af-0x0;var _0x543058=_0xec68[_0x2730af];return _0x543058;};'use strict';var _=require(_0x8ec6('0x0'));var util=require(_0x8ec6('0x1'));var moment=require(_0x8ec6('0x2'));var BPromise=require(_0x8ec6('0x3'));var rs=require(_0x8ec6('0x4'));var fs=require('fs');var Redis=require(_0x8ec6('0x5'));var db=require(_0x8ec6('0x6'))['db'];var utils=require(_0x8ec6('0x7'));var logger=require(_0x8ec6('0x8'))(_0x8ec6('0x9'));var config=require(_0x8ec6('0xa'));var jayson=require(_0x8ec6('0xb'));var client=jayson[_0x8ec6('0xc')][_0x8ec6('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x23fb29,_0x46a55a,_0x575741){return new BPromise(function(_0xdacf99,_0x1cd1ad){return client['request'](_0x23fb29,_0x575741)['then'](function(_0x35ceb2){logger[_0x8ec6('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x46a55a,'request\x20sent');logger[_0x8ec6('0xf')](_0x8ec6('0x10'),_0x46a55a,_0x8ec6('0x11'),JSON[_0x8ec6('0x12')](_0x35ceb2));if(_0x35ceb2[_0x8ec6('0x13')]){if(_0x35ceb2[_0x8ec6('0x13')][_0x8ec6('0x14')]===0x1f4){logger[_0x8ec6('0x13')](_0x8ec6('0x15'),_0x46a55a,_0x35ceb2[_0x8ec6('0x13')][_0x8ec6('0x16')]);return _0x1cd1ad(_0x35ceb2[_0x8ec6('0x13')][_0x8ec6('0x16')]);}logger['error'](_0x8ec6('0x15'),_0x46a55a,_0x35ceb2[_0x8ec6('0x13')][_0x8ec6('0x16')]);return _0xdacf99(_0x35ceb2['error'][_0x8ec6('0x16')]);}else{logger[_0x8ec6('0xe')](_0x8ec6('0x15'),_0x46a55a,_0x8ec6('0x11'));_0xdacf99(_0x35ceb2[_0x8ec6('0x17')][_0x8ec6('0x16')]);}})['catch'](function(_0x1c0897){logger['error'](_0x8ec6('0x15'),_0x46a55a,_0x1c0897);_0x1cd1ad(_0x1c0897);});});}
\ No newline at end of file
+var _0xcadc=['debug','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent'];(function(_0xfde4,_0x30585c){var _0x2328fc=function(_0x389859){while(--_0x389859){_0xfde4['push'](_0xfde4['shift']());}};_0x2328fc(++_0x30585c);}(_0xcadc,0x1a6));var _0xccad=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xcadc[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0xccad('0x0'));var moment=require(_0xccad('0x1'));var BPromise=require(_0xccad('0x2'));var rs=require(_0xccad('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xccad('0x4'))['db'];var utils=require(_0xccad('0x5'));var logger=require(_0xccad('0x6'))(_0xccad('0x7'));var config=require(_0xccad('0x8'));var jayson=require(_0xccad('0x9'));var client=jayson[_0xccad('0xa')][_0xccad('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58dbcf,_0x21e6c0,_0x4cf210){return new BPromise(function(_0x5e4347,_0x1e166d){return client[_0xccad('0xc')](_0x58dbcf,_0x4cf210)[_0xccad('0xd')](function(_0x39897b){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x21e6c0,_0xccad('0xe'));logger[_0xccad('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x21e6c0,_0xccad('0xe'),JSON[_0xccad('0x10')](_0x39897b));if(_0x39897b[_0xccad('0x11')]){if(_0x39897b[_0xccad('0x11')][_0xccad('0x12')]===0x1f4){logger['error'](_0xccad('0x13'),_0x21e6c0,_0x39897b[_0xccad('0x11')][_0xccad('0x14')]);return _0x1e166d(_0x39897b[_0xccad('0x11')]['message']);}logger['error'](_0xccad('0x13'),_0x21e6c0,_0x39897b[_0xccad('0x11')][_0xccad('0x14')]);return _0x5e4347(_0x39897b[_0xccad('0x11')][_0xccad('0x14')]);}else{logger['info'](_0xccad('0x13'),_0x21e6c0,_0xccad('0xe'));_0x5e4347(_0x39897b[_0xccad('0x15')]['message']);}})[_0xccad('0x16')](function(_0x3b49fc){logger[_0xccad('0x11')](_0xccad('0x13'),_0x21e6c0,_0x3b49fc);_0x1e166d(_0x3b49fc);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index e567545..1de1f28 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 _0x6aa7=['/:id','show','post','isAuthenticated','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x407a96,_0x262c72){var _0x3ee8f5=function(_0x1e4112){while(--_0x1e4112){_0x407a96['push'](_0x407a96['shift']());}};_0x3ee8f5(++_0x262c72);}(_0x6aa7,0x178));var _0x76aa=function(_0x1fa348,_0x204300){_0x1fa348=_0x1fa348-0x0;var _0x168567=_0x6aa7[_0x1fa348];return _0x168567;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76aa('0x5'));var interaction=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var controller=require('./chatProactiveAction.controller');router['get'](_0x76aa('0x8'),auth['isAuthenticated'](),controller[_0x76aa('0x9')]);router[_0x76aa('0xa')]('/',auth[_0x76aa('0xb')](),controller['create']);router[_0x76aa('0xc')](_0x76aa('0x8'),auth[_0x76aa('0xb')](),controller['update']);router[_0x76aa('0xd')](_0x76aa('0x8'),auth[_0x76aa('0xb')](),controller[_0x76aa('0xe')]);module[_0x76aa('0xf')]=router;
\ No newline at end of file
+var _0x4819=['post','isAuthenticated','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id'];(function(_0x1f3707,_0x3fd9ca){var _0x577ba7=function(_0x590925){while(--_0x590925){_0x1f3707['push'](_0x1f3707['shift']());}};_0x577ba7(++_0x3fd9ca);}(_0x4819,0xcd));var _0x9481=function(_0x2f7c40,_0xb36203){_0x2f7c40=_0x2f7c40-0x0;var _0x57a4a5=_0x4819[_0x2f7c40];return _0x57a4a5;};'use strict';var multer=require('multer');var util=require(_0x9481('0x0'));var path=require(_0x9481('0x1'));var timeout=require(_0x9481('0x2'));var express=require(_0x9481('0x3'));var router=express[_0x9481('0x4')]();var fs_extra=require(_0x9481('0x5'));var auth=require(_0x9481('0x6'));var interaction=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var controller=require(_0x9481('0x9'));router['get'](_0x9481('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x9481('0xb')]('/',auth[_0x9481('0xc')](),controller[_0x9481('0xd')]);router[_0x9481('0xe')](_0x9481('0xa'),auth['isAuthenticated'](),controller[_0x9481('0xf')]);router['delete'](_0x9481('0xa'),auth['isAuthenticated'](),controller[_0x9481('0x10')]);module[_0x9481('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 7c7056f..412fb97 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 _0xe068=['rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x2fe76d,_0x54ed76){var _0x5b0f4b=function(_0x3b136e){while(--_0x3b136e){_0x2fe76d['push'](_0x2fe76d['shift']());}};_0x5b0f4b(++_0x54ed76);}(_0xe068,0x1ef));var _0x8e06=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe068[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8e06('0x0'));module[_0x8e06('0x1')]={'name':{'type':Sequelize[_0x8e06('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x8e06('0x3'),_0x8e06('0x4'),_0x8e06('0x5'))}};
\ No newline at end of file
+var _0x8721=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x1c95f6,_0x440967){var _0x2192b6=function(_0x1c8efd){while(--_0x1c8efd){_0x1c95f6['push'](_0x1c95f6['shift']());}};_0x2192b6(++_0x440967);}(_0x8721,0x11a));var _0x1872=function(_0x5d4f12,_0x11e67c){_0x5d4f12=_0x5d4f12-0x0;var _0x4eb577=_0x8721[_0x5d4f12];return _0x4eb577;};'use strict';var Sequelize=require(_0x1872('0x0'));module[_0x1872('0x1')]={'name':{'type':Sequelize[_0x1872('0x2')],'unique':_0x1872('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x1872('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1872('0x5')](_0x1872('0x6'),_0x1872('0x7'),_0x1872('0x8'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 76fc068..5453a7b 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 _0x689f=['ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','forEach','addAgents','omit','isArray','userChatQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','register','jayson/promise','client','http','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','offset','limit','undefined','count','set','json','apply','reject','save','update','destroy','get','UserProfileResource','end','sendStatus','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','rows','show','params','keys','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','UserProfileSection','userProfileId','describe','getMembers','findOne','UserChatQueue','ChatQueueId','User','agent','chatPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','addTeams','ids','Agents','online','interface','flatMap','transaction','each','emit','userChatQueue:save','removeTeams','findAll','field','tq.TeamId','from','team_has_chat_queues','user_has_teams'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x689f,0x14a));var _0xf689=function(_0xa9ecac,_0x2915e4){_0xa9ecac=_0xa9ecac-0x0;var _0x2c284c=_0x689f[_0xa9ecac];return _0x2c284c;};'use strict';var emlformat=require(_0xf689('0x0'));var rimraf=require(_0xf689('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf689('0x2'));var rp=require('request-promise');var moment=require(_0xf689('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf689('0x4'));var util=require(_0xf689('0x5'));var path=require(_0xf689('0x6'));var sox=require(_0xf689('0x7'));var csv=require(_0xf689('0x8'));var ejs=require(_0xf689('0x9'));var fs=require('fs');var fs_extra=require(_0xf689('0xa'));var _=require(_0xf689('0xb'));var squel=require('squel');var crypto=require(_0xf689('0xc'));var jsforce=require(_0xf689('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf689('0x8'));var querystring=require(_0xf689('0xe'));var Papa=require(_0xf689('0xf'));var Redis=require(_0xf689('0x10'));var authService=require(_0xf689('0x11'));var qs=require(_0xf689('0x12'));var as=require(_0xf689('0x13'));var hardwareService=require(_0xf689('0x14'));var logger=require(_0xf689('0x15'))(_0xf689('0x16'));var utils=require(_0xf689('0x17'));var config=require(_0xf689('0x18'));var licenseUtil=require(_0xf689('0x19'));var db=require(_0xf689('0x1a'))['db'];config[_0xf689('0x1b')]=_[_0xf689('0x1c')](config['redis'],{'host':_0xf689('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf689('0x1b')]));require(_0xf689('0x1e'))[_0xf689('0x1f')](socket);var jayson=require(_0xf689('0x20'));var client=jayson[_0xf689('0x21')][_0xf689('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x20bb9b,_0x1d01b3,_0x58a940,_0x31ec2b){return new BPromise(function(_0x57f2b8,_0x43c2ce){var _0x474e7=_0x31ec2b||client;return _0x474e7['request'](_0x20bb9b,_0x58a940)[_0xf689('0x23')](function(_0xa4e847){logger[_0xf689('0x24')](_0xf689('0x25'),_0x1d01b3,'request\x20sent');logger[_0xf689('0x26')](_0xf689('0x27'),_0x1d01b3,_0xf689('0x28'),JSON[_0xf689('0x29')](_0xa4e847));if(_0xa4e847[_0xf689('0x2a')]){if(_0xa4e847[_0xf689('0x2a')][_0xf689('0x2b')]===0x1f4){logger[_0xf689('0x2a')]('ChatQueue,\x20%s,\x20%s',_0x1d01b3,_0xa4e847[_0xf689('0x2a')][_0xf689('0x2c')]);return _0x43c2ce(_0xa4e847[_0xf689('0x2a')]['message']);}logger[_0xf689('0x2a')](_0xf689('0x25'),_0x1d01b3,_0xa4e847[_0xf689('0x2a')][_0xf689('0x2c')]);return _0x57f2b8(_0xa4e847['error'][_0xf689('0x2c')]);}else{logger['info'](_0xf689('0x25'),_0x1d01b3,_0xf689('0x28'));_0x57f2b8(_0xa4e847[_0xf689('0x2d')]['message']);}})[_0xf689('0x2e')](function(_0x39f453){logger['error'](_0xf689('0x25'),_0x1d01b3,_0x39f453);_0x43c2ce(_0x39f453);});});}function respondWithStatusCode(_0x3136de,_0x4ed0b9){_0x4ed0b9=_0x4ed0b9||0xcc;return function(_0x186944){if(_0x186944){return _0x3136de['sendStatus'](_0x4ed0b9);}return _0x3136de[_0xf689('0x2f')](_0x4ed0b9)['end']();};}function respondWithResult(_0x1de51e,_0x311257){_0x311257=_0x311257||0xc8;return function(_0x5225b4){if(_0x5225b4){return _0x1de51e['status'](_0x311257)['json'](_0x5225b4);}};}function respondWithFilteredResult(_0x415fc7,_0x67b8b8){return function(_0x20cbda){if(_0x20cbda){var _0x5b024f=typeof _0x67b8b8[_0xf689('0x30')]==='undefined'&&typeof _0x67b8b8[_0xf689('0x31')]===_0xf689('0x32');var _0x1b3ebb=_0x20cbda[_0xf689('0x33')];var _0x25b214=_0x5b024f?0x0:_0x67b8b8[_0xf689('0x30')];var _0x24527e=_0x5b024f?_0x20cbda[_0xf689('0x33')]:_0x67b8b8[_0xf689('0x30')]+_0x67b8b8[_0xf689('0x31')];var _0x53c2df;if(_0x24527e>=_0x1b3ebb){_0x24527e=_0x1b3ebb;_0x53c2df=0xc8;}else{_0x53c2df=0xce;}_0x415fc7[_0xf689('0x2f')](_0x53c2df);return _0x415fc7[_0xf689('0x34')]('Content-Range',_0x25b214+'-'+_0x24527e+'/'+_0x1b3ebb)[_0xf689('0x35')](_0x20cbda);}return null;};}function patchUpdates(_0x946a86){return function(_0x49d9bd){try{jsonpatch[_0xf689('0x36')](_0x49d9bd,_0x946a86,!![]);}catch(_0x3b413e){return BPromise[_0xf689('0x37')](_0x3b413e);}return _0x49d9bd[_0xf689('0x38')]();};}function saveUpdates(_0x1b8270,_0x3d5fad){return function(_0x5d3690){if(_0x5d3690){return _0x5d3690[_0xf689('0x39')](_0x1b8270)['then'](function(_0x24e5b4){return _0x24e5b4;});}return null;};}function removeEntity(_0x3bcfb2,_0x4334c7){return function(_0x5c1589){if(_0x5c1589){return _0x5c1589[_0xf689('0x3a')]()['then'](function(){var _0x21a63d=_0x5c1589[_0xf689('0x3b')]({'plain':!![]});var _0x5a3056='ChatQueues';return db[_0xf689('0x3c')][_0xf689('0x3a')]({'where':{'type':_0x5a3056,'resourceId':_0x21a63d['id']}})['then'](function(){return _0x5c1589;});})[_0xf689('0x23')](function(){_0x3bcfb2[_0xf689('0x2f')](0xcc)[_0xf689('0x3d')]();});}};}function handleEntityNotFound(_0x3ceab2,_0x9534d8){return function(_0x3dd288){if(!_0x3dd288){_0x3ceab2[_0xf689('0x3e')](0x194);}return _0x3dd288;};}function handleError(_0x1e686a,_0x60b82b){_0x60b82b=_0x60b82b||0x1f4;return function(_0x1c9495){logger['error'](_0x1c9495['stack']);if(_0x1c9495['name']){delete _0x1c9495[_0xf689('0x3f')];}_0x1e686a[_0xf689('0x2f')](_0x60b82b)[_0xf689('0x40')](_0x1c9495);};}exports[_0xf689('0x41')]=function(_0x373eaa,_0x294836){var _0x5a71fa={},_0x26a774={},_0x1a99f8={'count':0x0,'rows':[]};var _0x459011=_[_0xf689('0x42')](db[_0xf689('0x43')][_0xf689('0x44')],function(_0x50a03e){return{'name':_0x50a03e[_0xf689('0x45')],'type':_0x50a03e[_0xf689('0x46')][_0xf689('0x47')]};});_0x26a774[_0xf689('0x48')]=_[_0xf689('0x42')](_0x459011,_0xf689('0x3f'));_0x26a774[_0xf689('0x49')]=_['keys'](_0x373eaa[_0xf689('0x49')]);_0x26a774[_0xf689('0x4a')]=_[_0xf689('0x4b')](_0x26a774[_0xf689('0x48')],_0x26a774[_0xf689('0x49')]);_0x5a71fa[_0xf689('0x4c')]=_['intersection'](_0x26a774['model'],qs[_0xf689('0x4d')](_0x373eaa[_0xf689('0x49')][_0xf689('0x4d')]));_0x5a71fa['attributes']=_0x5a71fa[_0xf689('0x4c')][_0xf689('0x4e')]?_0x5a71fa[_0xf689('0x4c')]:_0x26a774['model'];if(!_0x373eaa[_0xf689('0x49')][_0xf689('0x4f')](_0xf689('0x50'))){_0x5a71fa[_0xf689('0x31')]=qs['limit'](_0x373eaa[_0xf689('0x49')][_0xf689('0x31')]);_0x5a71fa[_0xf689('0x30')]=qs[_0xf689('0x30')](_0x373eaa[_0xf689('0x49')][_0xf689('0x30')]);}_0x5a71fa[_0xf689('0x51')]=qs[_0xf689('0x52')](_0x373eaa['query']['sort']);_0x5a71fa['where']=qs[_0xf689('0x4a')](_[_0xf689('0x53')](_0x373eaa[_0xf689('0x49')],_0x26a774['filters']),_0x459011);if(_0x373eaa[_0xf689('0x49')][_0xf689('0x54')]){_0x5a71fa[_0xf689('0x55')]=_[_0xf689('0x56')](_0x5a71fa[_0xf689('0x55')],{'$or':_[_0xf689('0x42')](_0x459011,function(_0x4843be){if(_0x4843be[_0xf689('0x46')]!==_0xf689('0x57')){var _0x407e3f={};_0x407e3f[_0x4843be[_0xf689('0x3f')]]={'$like':'%'+_0x373eaa[_0xf689('0x49')][_0xf689('0x54')]+'%'};return _0x407e3f;}})});}_0x5a71fa=_['merge']({},_0x5a71fa,_0x373eaa['options']);var _0x3aeaaa={'where':_0x5a71fa[_0xf689('0x55')]};return db[_0xf689('0x43')]['count'](_0x3aeaaa)['then'](function(_0x3ebad7){_0x1a99f8[_0xf689('0x33')]=_0x3ebad7;if(_0x373eaa[_0xf689('0x49')][_0xf689('0x58')]){_0x5a71fa['include']=[{'all':!![]}];}return db[_0xf689('0x43')]['findAll'](_0x5a71fa);})['then'](function(_0x505e16){_0x1a99f8[_0xf689('0x59')]=_0x505e16;return _0x1a99f8;})['then'](respondWithFilteredResult(_0x294836,_0x5a71fa))[_0xf689('0x2e')](handleError(_0x294836,null));};exports[_0xf689('0x5a')]=function(_0x3df2ff,_0x1222a7){var _0x555638={'raw':!![],'where':{'id':_0x3df2ff[_0xf689('0x5b')]['id']}},_0x529eb7={};_0x529eb7[_0xf689('0x48')]=_['keys'](db[_0xf689('0x43')][_0xf689('0x44')]);_0x529eb7[_0xf689('0x49')]=_[_0xf689('0x5c')](_0x3df2ff[_0xf689('0x49')]);_0x529eb7[_0xf689('0x4a')]=_[_0xf689('0x4b')](_0x529eb7[_0xf689('0x48')],_0x529eb7[_0xf689('0x49')]);_0x555638[_0xf689('0x4c')]=_[_0xf689('0x4b')](_0x529eb7[_0xf689('0x48')],qs[_0xf689('0x4d')](_0x3df2ff[_0xf689('0x49')]['fields']));_0x555638[_0xf689('0x4c')]=_0x555638[_0xf689('0x4c')][_0xf689('0x4e')]?_0x555638[_0xf689('0x4c')]:_0x529eb7[_0xf689('0x48')];if(_0x3df2ff['query']['includeAll']){_0x555638[_0xf689('0x5d')]=[{'all':!![]}];}_0x555638=_[_0xf689('0x56')]({},_0x555638,_0x3df2ff[_0xf689('0x5e')]);return db[_0xf689('0x43')][_0xf689('0x5f')](_0x555638)[_0xf689('0x23')](handleEntityNotFound(_0x1222a7,null))[_0xf689('0x23')](respondWithResult(_0x1222a7,null))[_0xf689('0x2e')](handleError(_0x1222a7,null));};exports[_0xf689('0x60')]=function(_0x44d1b2,_0xdf6217){return db[_0xf689('0x43')]['create'](_0x44d1b2[_0xf689('0x61')],{})[_0xf689('0x23')](function(_0x5839ec){var _0x14783d=_0x44d1b2[_0xf689('0x62')][_0xf689('0x3b')]({'plain':!![]});if(!_0x14783d)throw new Error(_0xf689('0x63'));if(_0x14783d[_0xf689('0x64')]===_0xf689('0x62')){var _0x12f90e=_0x5839ec[_0xf689('0x3b')]({'plain':!![]});var _0x4ba9fa=_0xf689('0x65');return db[_0xf689('0x66')][_0xf689('0x5f')]({'where':{'name':_0x4ba9fa,'userProfileId':_0x14783d[_0xf689('0x67')]},'raw':!![]})[_0xf689('0x23')](function(_0x3dee8a){if(_0x3dee8a&&_0x3dee8a['autoAssociation']===0x0){return db[_0xf689('0x3c')]['create']({'name':_0x12f90e[_0xf689('0x3f')],'resourceId':_0x12f90e['id'],'type':_0x3dee8a[_0xf689('0x3f')],'sectionId':_0x3dee8a['id']},{})[_0xf689('0x23')](function(){return _0x5839ec;});}else{return _0x5839ec;}})[_0xf689('0x2e')](function(_0x10388d){logger[_0xf689('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x10388d);throw _0x10388d;});}return _0x5839ec;})['then'](respondWithResult(_0xdf6217,0xc9))[_0xf689('0x2e')](handleError(_0xdf6217,null));};exports[_0xf689('0x39')]=function(_0xf9bbe0,_0x511829){if(_0xf9bbe0['body']['id']){delete _0xf9bbe0[_0xf689('0x61')]['id'];}return db[_0xf689('0x43')][_0xf689('0x5f')]({'where':{'id':_0xf9bbe0[_0xf689('0x5b')]['id']}})[_0xf689('0x23')](handleEntityNotFound(_0x511829,null))[_0xf689('0x23')](saveUpdates(_0xf9bbe0['body'],null))[_0xf689('0x23')](respondWithResult(_0x511829,null))[_0xf689('0x2e')](handleError(_0x511829,null));};exports[_0xf689('0x3a')]=function(_0x2a3ca5,_0x30e40d){return db['ChatQueue'][_0xf689('0x5f')]({'where':{'id':_0x2a3ca5['params']['id']}})[_0xf689('0x23')](handleEntityNotFound(_0x30e40d,null))[_0xf689('0x23')](removeEntity(_0x30e40d,null))[_0xf689('0x2e')](handleError(_0x30e40d,null));};exports['describe']=function(_0x402040,_0x45ce02){return db[_0xf689('0x43')][_0xf689('0x68')]()[_0xf689('0x23')](respondWithResult(_0x45ce02,null))[_0xf689('0x2e')](handleError(_0x45ce02,null));};exports[_0xf689('0x69')]=function(_0x33b37e,_0x2940be,_0x450d74){var _0x315601={'raw':!![],'where':{}},_0x2b7a67={},_0x4f8cc7;return db[_0xf689('0x43')][_0xf689('0x6a')]({'where':{'id':_0x33b37e[_0xf689('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2940be,null))[_0xf689('0x23')](function(_0x44e803){if(_0x44e803){_0x4f8cc7=_0x44e803[_0xf689('0x3b')]({'plain':!![]});_0x2b7a67[_0xf689('0x48')]=_[_0xf689('0x5c')](db[_0xf689('0x6b')][_0xf689('0x44')]);_0x2b7a67[_0xf689('0x49')]=_[_0xf689('0x5c')](_0x33b37e[_0xf689('0x49')]);_0x2b7a67[_0xf689('0x4a')]=_[_0xf689('0x4b')](_0x2b7a67[_0xf689('0x48')],_0x2b7a67[_0xf689('0x49')]);_0x315601['attributes']=_[_0xf689('0x4b')](_0x2b7a67['model'],qs[_0xf689('0x4d')](_0x33b37e[_0xf689('0x49')][_0xf689('0x4d')]));_0x315601[_0xf689('0x4c')]=_0x315601[_0xf689('0x4c')][_0xf689('0x4e')]?_0x315601[_0xf689('0x4c')]:_0x2b7a67[_0xf689('0x48')];if(!_0x33b37e[_0xf689('0x49')][_0xf689('0x4f')](_0xf689('0x50'))){_0x315601['limit']=qs[_0xf689('0x31')](_0x33b37e[_0xf689('0x49')][_0xf689('0x31')]);_0x315601['offset']=qs[_0xf689('0x30')](_0x33b37e['query']['offset']);}_0x315601[_0xf689('0x51')]=qs['sort'](_0x33b37e[_0xf689('0x49')][_0xf689('0x52')]);_0x315601['where']=qs[_0xf689('0x4a')](_[_0xf689('0x53')](_0x33b37e['query'],_0x2b7a67[_0xf689('0x4a')]));_0x315601[_0xf689('0x55')][_0xf689('0x6c')]=_0x44e803['id'];if(_0x33b37e[_0xf689('0x49')][_0xf689('0x54')]){_0x315601['where']=_['merge'](_0x315601[_0xf689('0x55')],{'$or':_['map'](_0x315601[_0xf689('0x4c')],function(_0x22e785){var _0xe516ab={};_0xe516ab[_0x22e785]={'$like':'%'+_0x33b37e['query'][_0xf689('0x54')]+'%'};return _0xe516ab;})});}_0x315601=_[_0xf689('0x56')]({},_0x315601,_0x33b37e[_0xf689('0x5e')]);return db[_0xf689('0x6b')]['findAll'](_0x315601);}})['then'](function(_0x1e6892){if(_0x1e6892){return db[_0xf689('0x6d')]['findAndCountAll']({'where':{'id':_['map'](_0x1e6892,'UserId'),'role':_0xf689('0x6e')},'attributes':['id',_0xf689('0x3f'),_0xf689('0x6f'),'updatedAt',_0xf689('0x70')]});}})[_0xf689('0x23')](function(_0x453389){if(_0x453389){return{'count':_0x453389[_0xf689('0x33')],'rows':_[_0xf689('0x42')](_0x453389[_0xf689('0x59')],function(_0x10b7d2){return{'membername':_0x10b7d2[_0xf689('0x3f')],'UserId':_0x10b7d2['id'],'queue_name':_0x4f8cc7['name'],'ChatQueueId':_0x4f8cc7['id'],'interface':util[_0xf689('0x71')](_0xf689('0x72'),_0xf689('0x73'),_0x10b7d2['name']),'penalty':0x0,'paused':_0x10b7d2['chatPause'],'createdAt':_0x10b7d2[_0xf689('0x70')],'updatedAt':_0x10b7d2[_0xf689('0x74')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf689('0x23')](respondWithFilteredResult(_0x2940be,_0x315601))[_0xf689('0x2e')](handleError(_0x2940be,null));};exports[_0xf689('0x75')]=function(_0x35a470,_0x2d7dad,_0x10b0cd){var _0x50cf88={};var _0x5f013f={};var _0x115e6b;var _0x3c9549;return db[_0xf689('0x43')][_0xf689('0x6a')]({'where':{'id':_0x35a470[_0xf689('0x5b')]['id']}})[_0xf689('0x23')](handleEntityNotFound(_0x2d7dad,null))[_0xf689('0x23')](function(_0x36238d){if(_0x36238d){_0x115e6b=_0x36238d;_0x5f013f[_0xf689('0x48')]=_['keys'](db['Team'][_0xf689('0x44')]);_0x5f013f[_0xf689('0x49')]=_['keys'](_0x35a470['query']);_0x5f013f['filters']=_[_0xf689('0x4b')](_0x5f013f[_0xf689('0x48')],_0x5f013f[_0xf689('0x49')]);_0x50cf88[_0xf689('0x4c')]=_[_0xf689('0x4b')](_0x5f013f[_0xf689('0x48')],qs[_0xf689('0x4d')](_0x35a470[_0xf689('0x49')][_0xf689('0x4d')]));_0x50cf88['attributes']=_0x50cf88[_0xf689('0x4c')]['length']?_0x50cf88[_0xf689('0x4c')]:_0x5f013f[_0xf689('0x48')];_0x50cf88[_0xf689('0x51')]=qs[_0xf689('0x52')](_0x35a470[_0xf689('0x49')][_0xf689('0x52')]);_0x50cf88['where']=qs[_0xf689('0x4a')](_['pick'](_0x35a470[_0xf689('0x49')],_0x5f013f['filters']));if(_0x35a470[_0xf689('0x49')][_0xf689('0x54')]){_0x50cf88[_0xf689('0x55')]=_[_0xf689('0x56')](_0x50cf88[_0xf689('0x55')],{'$or':_[_0xf689('0x42')](_0x50cf88[_0xf689('0x4c')],function(_0x3067d1){var _0x10ba14={};_0x10ba14[_0x3067d1]={'$like':'%'+_0x35a470[_0xf689('0x49')]['filter']+'%'};return _0x10ba14;})});}_0x50cf88=_[_0xf689('0x56')]({},_0x50cf88,_0x35a470[_0xf689('0x5e')]);return _0x115e6b[_0xf689('0x75')](_0x50cf88);}})['then'](function(_0x57573e){if(_0x57573e){_0x3c9549=_0x57573e[_0xf689('0x4e')];if(!_0x35a470[_0xf689('0x49')][_0xf689('0x4f')]('nolimit')){_0x50cf88[_0xf689('0x31')]=qs['limit'](_0x35a470[_0xf689('0x49')]['limit']);_0x50cf88['offset']=qs[_0xf689('0x30')](_0x35a470[_0xf689('0x49')][_0xf689('0x30')]);}return _0x115e6b[_0xf689('0x75')](_0x50cf88);}})[_0xf689('0x23')](function(_0x2799c0){if(_0x2799c0){return _0x2799c0?{'count':_0x3c9549,'rows':_0x2799c0}:null;}})[_0xf689('0x23')](respondWithResult(_0x2d7dad,null))[_0xf689('0x2e')](handleError(_0x2d7dad,null));};exports[_0xf689('0x76')]=function(_0x3480e0,_0x2dbecd,_0x2ec2c8){var _0x1075a3=_0x3480e0['body'][_0xf689('0x77')];return db['Team']['findAll']({'where':{'id':_0x1075a3},'attributes':['id'],'include':[{'model':db[_0xf689('0x6d')],'as':_0xf689('0x78'),'attributes':['id','name',_0xf689('0x79'),'voicePause',_0xf689('0x7a')],'raw':!![]}]})['then'](function(_0x1bc1bd){if(_0x1bc1bd){var _0x348539=_[_0xf689('0x7b')](_0x1bc1bd,function(_0x3d72ec){var _0xd31998=_0x3d72ec[_0xf689('0x3b')]({'plain':!![]});return _0xd31998[_0xf689('0x78')];});return db['ChatQueue'][_0xf689('0x5f')]({'where':{'id':_0x3480e0[_0xf689('0x5b')]['id']}})['then'](function(_0x43f7f7){return db['sequelize'][_0xf689('0x7c')](function(_0x514355){return _0x43f7f7['addTeams'](_0x1075a3,{'transaction':_0x514355})['then'](function(){return BPromise[_0xf689('0x7d')](_0x348539,function(_0x28e87a){return db[_0xf689('0x6b')]['findOrCreate']({'where':{'UserId':_0x28e87a['id'],'ChatQueueId':_0x3480e0[_0xf689('0x5b')]['id']},'transaction':_0x514355});});})[_0xf689('0x23')](function(){_0x348539['forEach'](function(_0x1b0258){socket[_0xf689('0x7e')](_0xf689('0x7f'),{'UserId':_0x1b0258['id'],'ChatQueueId':_0x43f7f7['id']});});});});});}})[_0xf689('0x23')](respondWithStatusCode(_0x2dbecd,null))[_0xf689('0x2e')](handleError(_0x2dbecd,null));};exports[_0xf689('0x80')]=function(_0x20a29d,_0x2796fc,_0x3eb28e){return db['Team'][_0xf689('0x81')]({'where':{'id':_0x20a29d[_0xf689('0x49')][_0xf689('0x77')]},'attributes':['id'],'include':[{'model':db[_0xf689('0x6d')],'as':_0xf689('0x78'),'attributes':['id'],'raw':!![]}]})[_0xf689('0x23')](handleEntityNotFound(_0x2796fc,null))[_0xf689('0x23')](function(_0x5f8f1b){var _0x5cfbed=_[_0xf689('0x42')](_0x5f8f1b,'id');var _0x125e1a=[];var _0x46eca2=[];var _0x2946fa=squel['select']();_0x2946fa[_0xf689('0x82')](_0xf689('0x83'))[_0xf689('0x84')](_0xf689('0x85'),'tq')['join'](_0xf689('0x86'),'ut',_0xf689('0x87'))[_0xf689('0x55')](_0xf689('0x88'),_0x20a29d[_0xf689('0x5b')]['id']);for(var _0x135431=0x0;_0x135431<_0x5f8f1b[_0xf689('0x4e')];_0x135431+=0x1){let _0xb035e7=_0x5f8f1b[_0x135431];for(var _0x5c34c3=0x0;_0x5c34c3<_0xb035e7[_0xf689('0x78')][_0xf689('0x4e')];_0x5c34c3+=0x1){let _0x2e53c1=_0xb035e7[_0xf689('0x78')][_0x5c34c3];var _0x537568=_0x2946fa[_0xf689('0x89')]();_0x537568[_0xf689('0x55')]('ut.UserId\x20=\x20?',_0x2e53c1['id']);_0x46eca2['push'](db[_0xf689('0x8a')][_0xf689('0x49')](_0x537568['toString'](),{'type':db[_0xf689('0x8a')][_0xf689('0x8b')][_0xf689('0x8c')]})[_0xf689('0x23')](function(_0xa8608a){if(_0xa8608a[_0xf689('0x4e')]===0x1){return _0x2e53c1['id'];}else{var _0x13ef17=_[_0xf689('0x8d')](_[_0xf689('0x42')](_0xa8608a,_0xf689('0x8e')),function(_0x548af6){return _[_0xf689('0x8f')](_0x5cfbed,_0x548af6);});if(_0x13ef17){return _0x2e53c1['id'];}}}));}}return BPromise[_0xf689('0x90')](_0x46eca2)[_0xf689('0x23')](function(_0x114f94){_0x125e1a=_(_0x125e1a)[_0xf689('0x91')](_0x114f94)[_0xf689('0x92')]()['value']();return db[_0xf689('0x43')][_0xf689('0x5f')]({'where':{'id':_0x20a29d[_0xf689('0x5b')]['id']}})[_0xf689('0x23')](function(_0x5b4b9b){return db[_0xf689('0x8a')][_0xf689('0x7c')](function(_0xc18795){return _0x5b4b9b[_0xf689('0x80')](_0x20a29d[_0xf689('0x49')][_0xf689('0x77')],{'transaction':_0xc18795})['then'](function(){if(!_[_0xf689('0x93')](_0x125e1a)){return _0x5b4b9b[_0xf689('0x94')](_0x125e1a,{'transaction':_0xc18795});}})[_0xf689('0x23')](function(){_0x125e1a[_0xf689('0x95')](function(_0x91431e){socket[_0xf689('0x7e')]('userChatQueue:remove',{'UserId':_0x91431e,'ChatQueueId':_0x5b4b9b['id']});});});});});});})['then'](respondWithStatusCode(_0x2796fc,null))[_0xf689('0x2e')](handleError(_0x2796fc,null));};exports[_0xf689('0x96')]=function(_0x4eb55b,_0x54c27d,_0x2c4454){return db[_0xf689('0x43')][_0xf689('0x5f')]({'where':{'id':_0x4eb55b[_0xf689('0x5b')]['id']}})['then'](handleEntityNotFound(_0x54c27d,null))[_0xf689('0x23')](function(_0x5188f3){if(_0x5188f3){return _0x5188f3[_0xf689('0x96')](_0x4eb55b['body'][_0xf689('0x77')],_[_0xf689('0x97')](_0x4eb55b[_0xf689('0x61')],[_0xf689('0x77'),'id'])||{})['spread'](function(_0x474d21){for(var _0x4caa12=0x0;_0x4caa12<_0x4eb55b[_0xf689('0x61')][_0xf689('0x77')]['length'];_0x4caa12+=0x1){socket[_0xf689('0x7e')](_0xf689('0x7f'),{'UserId':Number(_0x4eb55b[_0xf689('0x61')][_0xf689('0x77')][_0x4caa12]),'ChatQueueId':Number(_0x4eb55b[_0xf689('0x5b')]['id'])});}return _0x474d21;});}})[_0xf689('0x23')](respondWithResult(_0x54c27d,null))[_0xf689('0x2e')](handleError(_0x54c27d,null));};exports[_0xf689('0x94')]=function(_0x401c6a,_0xcc0780,_0x1e784d){return db[_0xf689('0x43')][_0xf689('0x5f')]({'where':{'id':_0x401c6a['params']['id']}})['then'](handleEntityNotFound(_0xcc0780,null))[_0xf689('0x23')](function(_0x362ab5){if(_0x362ab5){return _0x362ab5['removeAgents'](_0x401c6a[_0xf689('0x49')][_0xf689('0x77')])[_0xf689('0x23')](function(){if(_[_0xf689('0x98')](_0x401c6a[_0xf689('0x49')]['ids'])){for(var _0x4e471b=0x0;_0x4e471b<_0x401c6a[_0xf689('0x49')][_0xf689('0x77')][_0xf689('0x4e')];_0x4e471b+=0x1){socket[_0xf689('0x7e')]('userChatQueue:remove',{'UserId':Number(_0x401c6a['query'][_0xf689('0x77')][_0x4e471b]),'ChatQueueId':Number(_0x401c6a[_0xf689('0x5b')]['id'])});}}else{socket[_0xf689('0x7e')](_0xf689('0x99'),{'UserId':Number(_0x401c6a[_0xf689('0x49')][_0xf689('0x77')]),'ChatQueueId':Number(_0x401c6a[_0xf689('0x5b')]['id'])});}});}})['then'](respondWithStatusCode(_0xcc0780,null))[_0xf689('0x2e')](handleError(_0xcc0780,null));};exports[_0xf689('0x9a')]=function(_0x211a17,_0x1b3606,_0x287489){var _0x520708={};var _0x367524={};var _0x234683;var _0x187c14;return db[_0xf689('0x43')]['findOne']({'where':{'id':_0x211a17[_0xf689('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1b3606,null))[_0xf689('0x23')](function(_0x4d1baf){if(_0x4d1baf){_0x234683=_0x4d1baf;_0x367524[_0xf689('0x48')]=_[_0xf689('0x5c')](db[_0xf689('0x6d')][_0xf689('0x44')]);_0x367524['query']=_[_0xf689('0x5c')](_0x211a17[_0xf689('0x49')]);_0x367524[_0xf689('0x4a')]=_[_0xf689('0x4b')](_0x367524[_0xf689('0x48')],_0x367524[_0xf689('0x49')]);_0x520708[_0xf689('0x4c')]=_[_0xf689('0x4b')](_0x367524[_0xf689('0x48')],qs[_0xf689('0x4d')](_0x211a17[_0xf689('0x49')][_0xf689('0x4d')]));_0x520708[_0xf689('0x4c')]=_0x520708['attributes'][_0xf689('0x4e')]?_0x520708['attributes']:_0x367524[_0xf689('0x48')];_0x520708['order']=qs[_0xf689('0x52')](_0x211a17[_0xf689('0x49')][_0xf689('0x52')]);_0x520708['where']=qs['filters'](_['pick'](_0x211a17[_0xf689('0x49')],_0x367524[_0xf689('0x4a')]));if(_0x211a17[_0xf689('0x49')][_0xf689('0x54')]){_0x520708[_0xf689('0x55')]=_[_0xf689('0x56')](_0x520708[_0xf689('0x55')],{'$or':_['map'](_0x520708[_0xf689('0x4c')],function(_0x3c96e4){var _0x231124={};_0x231124[_0x3c96e4]={'$like':'%'+_0x211a17[_0xf689('0x49')]['filter']+'%'};return _0x231124;})});}_0x520708=_['merge']({},_0x520708,_0x211a17[_0xf689('0x5e')]);return _0x234683['getAgents'](_0x520708);}})[_0xf689('0x23')](function(_0x2f8a74){if(_0x2f8a74){_0x187c14=_0x2f8a74['length'];if(!_0x211a17[_0xf689('0x49')][_0xf689('0x4f')](_0xf689('0x50'))){_0x520708[_0xf689('0x31')]=qs[_0xf689('0x31')](_0x211a17['query'][_0xf689('0x31')]);_0x520708[_0xf689('0x30')]=qs[_0xf689('0x30')](_0x211a17[_0xf689('0x49')][_0xf689('0x30')]);}return _0x234683['getAgents'](_0x520708);}})['then'](function(_0x5c00ef){if(_0x5c00ef){return _0x5c00ef?{'count':_0x187c14,'rows':_0x5c00ef}:null;}})[_0xf689('0x23')](respondWithResult(_0x1b3606,null))[_0xf689('0x2e')](handleError(_0x1b3606,null));};
\ No newline at end of file
+var _0x3572=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','info','request\x20sent','debug','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','get','ChatQueues','UserProfileResource','stack','name','index','map','rawAttributes','fieldName','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','ChatQueue','include','rows','show','params','intersection','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','order','ChatQueueId','findAll','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','SIP','getTeams','addTeams','ids','Team','User','Agents','interface','flatMap','sequelize','each','findOrCreate','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','union','value','transaction','isEmpty','forEach','userChatQueue:remove','addAgents','spread','emit','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis'];(function(_0xce8fdb,_0x45943c){var _0x3cc5b8=function(_0x287b17){while(--_0x287b17){_0xce8fdb['push'](_0xce8fdb['shift']());}};_0x3cc5b8(++_0x45943c);}(_0x3572,0x87));var _0x2357=function(_0x3c14ab,_0x1bac70){_0x3c14ab=_0x3c14ab-0x0;var _0x2e4a9f=_0x3572[_0x3c14ab];return _0x2e4a9f;};'use strict';var emlformat=require(_0x2357('0x0'));var rimraf=require(_0x2357('0x1'));var zipdir=require(_0x2357('0x2'));var jsonpatch=require(_0x2357('0x3'));var rp=require(_0x2357('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2357('0x5'));var util=require(_0x2357('0x6'));var path=require(_0x2357('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2357('0x8'));var _=require(_0x2357('0x9'));var squel=require(_0x2357('0xa'));var crypto=require(_0x2357('0xb'));var jsforce=require(_0x2357('0xc'));var deskjs=require(_0x2357('0xd'));var toCsv=require(_0x2357('0xe'));var querystring=require('querystring');var Papa=require(_0x2357('0xf'));var Redis=require(_0x2357('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2357('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2357('0x12'))(_0x2357('0x13'));var utils=require(_0x2357('0x14'));var config=require(_0x2357('0x15'));var licenseUtil=require(_0x2357('0x16'));var db=require(_0x2357('0x17'))['db'];config[_0x2357('0x18')]=_[_0x2357('0x19')](config[_0x2357('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x2357('0x1a'))(new Redis(config[_0x2357('0x18')]));require('./chatQueue.socket')[_0x2357('0x1b')](socket);var jayson=require(_0x2357('0x1c'));var client=jayson[_0x2357('0x1d')][_0x2357('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x1ea7e0,_0x23373f,_0x161499,_0x323fe8){return new BPromise(function(_0x2c74c3,_0x3046e2){var _0x450232=_0x323fe8||client;return _0x450232[_0x2357('0x1f')](_0x1ea7e0,_0x161499)['then'](function(_0x59548c){logger[_0x2357('0x20')]('ChatQueue,\x20%s,\x20%s',_0x23373f,_0x2357('0x21'));logger[_0x2357('0x22')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x23373f,_0x2357('0x21'),JSON['stringify'](_0x59548c));if(_0x59548c[_0x2357('0x23')]){if(_0x59548c['error'][_0x2357('0x24')]===0x1f4){logger[_0x2357('0x23')](_0x2357('0x25'),_0x23373f,_0x59548c['error']['message']);return _0x3046e2(_0x59548c[_0x2357('0x23')][_0x2357('0x26')]);}logger[_0x2357('0x23')]('ChatQueue,\x20%s,\x20%s',_0x23373f,_0x59548c[_0x2357('0x23')]['message']);return _0x2c74c3(_0x59548c[_0x2357('0x23')][_0x2357('0x26')]);}else{logger[_0x2357('0x20')]('ChatQueue,\x20%s,\x20%s',_0x23373f,_0x2357('0x21'));_0x2c74c3(_0x59548c[_0x2357('0x27')]['message']);}})[_0x2357('0x28')](function(_0x2e7783){logger[_0x2357('0x23')](_0x2357('0x25'),_0x23373f,_0x2e7783);_0x3046e2(_0x2e7783);});});}function respondWithStatusCode(_0x4972c0,_0x59ed30){_0x59ed30=_0x59ed30||0xcc;return function(_0x1d6594){if(_0x1d6594){return _0x4972c0[_0x2357('0x29')](_0x59ed30);}return _0x4972c0[_0x2357('0x2a')](_0x59ed30)[_0x2357('0x2b')]();};}function respondWithResult(_0x3cb63f,_0xe40b7e){_0xe40b7e=_0xe40b7e||0xc8;return function(_0x5c8c78){if(_0x5c8c78){return _0x3cb63f[_0x2357('0x2a')](_0xe40b7e)[_0x2357('0x2c')](_0x5c8c78);}};}function respondWithFilteredResult(_0x1a4ffc,_0x14ccb6){return function(_0x1479c3){if(_0x1479c3){var _0x50f794=typeof _0x14ccb6[_0x2357('0x2d')]===_0x2357('0x2e')&&typeof _0x14ccb6[_0x2357('0x2f')]===_0x2357('0x2e');var _0x165bff=_0x1479c3[_0x2357('0x30')];var _0x1d89d4=_0x50f794?0x0:_0x14ccb6[_0x2357('0x2d')];var _0x1f8ce0=_0x50f794?_0x1479c3['count']:_0x14ccb6[_0x2357('0x2d')]+_0x14ccb6['limit'];var _0x263949;if(_0x1f8ce0>=_0x165bff){_0x1f8ce0=_0x165bff;_0x263949=0xc8;}else{_0x263949=0xce;}_0x1a4ffc[_0x2357('0x2a')](_0x263949);return _0x1a4ffc[_0x2357('0x31')](_0x2357('0x32'),_0x1d89d4+'-'+_0x1f8ce0+'/'+_0x165bff)[_0x2357('0x2c')](_0x1479c3);}return null;};}function patchUpdates(_0x113dce){return function(_0x2dd8e9){try{jsonpatch[_0x2357('0x33')](_0x2dd8e9,_0x113dce,!![]);}catch(_0x1be753){return BPromise['reject'](_0x1be753);}return _0x2dd8e9['save']();};}function saveUpdates(_0x39d8b6,_0x4f6266){return function(_0x35978c){if(_0x35978c){return _0x35978c['update'](_0x39d8b6)[_0x2357('0x34')](function(_0x300ba0){return _0x300ba0;});}return null;};}function removeEntity(_0x5c97d8,_0x18d53a){return function(_0x7ccb38){if(_0x7ccb38){return _0x7ccb38[_0x2357('0x35')]()[_0x2357('0x34')](function(){var _0x4735f6=_0x7ccb38[_0x2357('0x36')]({'plain':!![]});var _0x44b237=_0x2357('0x37');return db[_0x2357('0x38')][_0x2357('0x35')]({'where':{'type':_0x44b237,'resourceId':_0x4735f6['id']}})[_0x2357('0x34')](function(){return _0x7ccb38;});})[_0x2357('0x34')](function(){_0x5c97d8[_0x2357('0x2a')](0xcc)[_0x2357('0x2b')]();});}};}function handleEntityNotFound(_0x5a5d97,_0x278fce){return function(_0x32eb48){if(!_0x32eb48){_0x5a5d97[_0x2357('0x29')](0x194);}return _0x32eb48;};}function handleError(_0x2436ff,_0x567b22){_0x567b22=_0x567b22||0x1f4;return function(_0x2fc00d){logger['error'](_0x2fc00d[_0x2357('0x39')]);if(_0x2fc00d[_0x2357('0x3a')]){delete _0x2fc00d[_0x2357('0x3a')];}_0x2436ff['status'](_0x567b22)['send'](_0x2fc00d);};}exports[_0x2357('0x3b')]=function(_0x47b921,_0x502dde){var _0xf890cb={},_0x101093={},_0x24539f={'count':0x0,'rows':[]};var _0x2e30d3=_[_0x2357('0x3c')](db['ChatQueue'][_0x2357('0x3d')],function(_0x212293){return{'name':_0x212293[_0x2357('0x3e')],'type':_0x212293['type'][_0x2357('0x3f')]};});_0x101093['model']=_[_0x2357('0x3c')](_0x2e30d3,_0x2357('0x3a'));_0x101093[_0x2357('0x40')]=_[_0x2357('0x41')](_0x47b921[_0x2357('0x40')]);_0x101093[_0x2357('0x42')]=_['intersection'](_0x101093[_0x2357('0x43')],_0x101093['query']);_0xf890cb['attributes']=_['intersection'](_0x101093['model'],qs[_0x2357('0x44')](_0x47b921[_0x2357('0x40')]['fields']));_0xf890cb[_0x2357('0x45')]=_0xf890cb['attributes'][_0x2357('0x46')]?_0xf890cb[_0x2357('0x45')]:_0x101093[_0x2357('0x43')];if(!_0x47b921[_0x2357('0x40')][_0x2357('0x47')](_0x2357('0x48'))){_0xf890cb[_0x2357('0x2f')]=qs['limit'](_0x47b921['query'][_0x2357('0x2f')]);_0xf890cb[_0x2357('0x2d')]=qs[_0x2357('0x2d')](_0x47b921[_0x2357('0x40')][_0x2357('0x2d')]);}_0xf890cb['order']=qs[_0x2357('0x49')](_0x47b921['query'][_0x2357('0x49')]);_0xf890cb[_0x2357('0x4a')]=qs['filters'](_[_0x2357('0x4b')](_0x47b921[_0x2357('0x40')],_0x101093[_0x2357('0x42')]),_0x2e30d3);if(_0x47b921['query'][_0x2357('0x4c')]){_0xf890cb[_0x2357('0x4a')]=_[_0x2357('0x4d')](_0xf890cb[_0x2357('0x4a')],{'$or':_[_0x2357('0x3c')](_0x2e30d3,function(_0x25d4e4){if(_0x25d4e4['type']!=='VIRTUAL'){var _0x2aec50={};_0x2aec50[_0x25d4e4[_0x2357('0x3a')]]={'$like':'%'+_0x47b921[_0x2357('0x40')][_0x2357('0x4c')]+'%'};return _0x2aec50;}})});}_0xf890cb=_['merge']({},_0xf890cb,_0x47b921[_0x2357('0x4e')]);var _0x1be43c={'where':_0xf890cb[_0x2357('0x4a')]};return db[_0x2357('0x4f')][_0x2357('0x30')](_0x1be43c)[_0x2357('0x34')](function(_0x33cab1){_0x24539f['count']=_0x33cab1;if(_0x47b921[_0x2357('0x40')]['includeAll']){_0xf890cb[_0x2357('0x50')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0xf890cb);})[_0x2357('0x34')](function(_0x5f326b){_0x24539f[_0x2357('0x51')]=_0x5f326b;return _0x24539f;})[_0x2357('0x34')](respondWithFilteredResult(_0x502dde,_0xf890cb))['catch'](handleError(_0x502dde,null));};exports[_0x2357('0x52')]=function(_0x22d36c,_0x43467a){var _0x3ca3da={'raw':!![],'where':{'id':_0x22d36c[_0x2357('0x53')]['id']}},_0x1cd7ed={};_0x1cd7ed['model']=_['keys'](db[_0x2357('0x4f')][_0x2357('0x3d')]);_0x1cd7ed[_0x2357('0x40')]=_[_0x2357('0x41')](_0x22d36c[_0x2357('0x40')]);_0x1cd7ed['filters']=_[_0x2357('0x54')](_0x1cd7ed['model'],_0x1cd7ed[_0x2357('0x40')]);_0x3ca3da['attributes']=_['intersection'](_0x1cd7ed[_0x2357('0x43')],qs[_0x2357('0x44')](_0x22d36c[_0x2357('0x40')][_0x2357('0x44')]));_0x3ca3da[_0x2357('0x45')]=_0x3ca3da['attributes'][_0x2357('0x46')]?_0x3ca3da[_0x2357('0x45')]:_0x1cd7ed[_0x2357('0x43')];if(_0x22d36c[_0x2357('0x40')][_0x2357('0x55')]){_0x3ca3da['include']=[{'all':!![]}];}_0x3ca3da=_[_0x2357('0x4d')]({},_0x3ca3da,_0x22d36c[_0x2357('0x4e')]);return db['ChatQueue'][_0x2357('0x56')](_0x3ca3da)[_0x2357('0x34')](handleEntityNotFound(_0x43467a,null))[_0x2357('0x34')](respondWithResult(_0x43467a,null))['catch'](handleError(_0x43467a,null));};exports[_0x2357('0x57')]=function(_0x2cbe9e,_0x10a842){return db[_0x2357('0x4f')]['create'](_0x2cbe9e[_0x2357('0x58')],{})['then'](function(_0x21fe74){var _0x27afc0=_0x2cbe9e[_0x2357('0x59')]['get']({'plain':!![]});if(!_0x27afc0)throw new Error(_0x2357('0x5a'));if(_0x27afc0[_0x2357('0x5b')]===_0x2357('0x59')){var _0x3efd6a=_0x21fe74[_0x2357('0x36')]({'plain':!![]});var _0x1df6c9=_0x2357('0x37');return db[_0x2357('0x5c')][_0x2357('0x56')]({'where':{'name':_0x1df6c9,'userProfileId':_0x27afc0[_0x2357('0x5d')]},'raw':!![]})[_0x2357('0x34')](function(_0x410136){if(_0x410136&&_0x410136[_0x2357('0x5e')]===0x0){return db['UserProfileResource'][_0x2357('0x57')]({'name':_0x3efd6a['name'],'resourceId':_0x3efd6a['id'],'type':_0x410136['name'],'sectionId':_0x410136['id']},{})[_0x2357('0x34')](function(){return _0x21fe74;});}else{return _0x21fe74;}})[_0x2357('0x28')](function(_0x4b5319){logger[_0x2357('0x23')](_0x2357('0x5f'),_0x4b5319);throw _0x4b5319;});}return _0x21fe74;})[_0x2357('0x34')](respondWithResult(_0x10a842,0xc9))['catch'](handleError(_0x10a842,null));};exports['update']=function(_0x41fa50,_0x1b72d5){if(_0x41fa50[_0x2357('0x58')]['id']){delete _0x41fa50[_0x2357('0x58')]['id'];}return db[_0x2357('0x4f')]['find']({'where':{'id':_0x41fa50[_0x2357('0x53')]['id']}})['then'](handleEntityNotFound(_0x1b72d5,null))[_0x2357('0x34')](saveUpdates(_0x41fa50['body'],null))[_0x2357('0x34')](respondWithResult(_0x1b72d5,null))[_0x2357('0x28')](handleError(_0x1b72d5,null));};exports[_0x2357('0x35')]=function(_0x16ff9b,_0x221050){return db[_0x2357('0x4f')]['find']({'where':{'id':_0x16ff9b['params']['id']}})['then'](handleEntityNotFound(_0x221050,null))[_0x2357('0x34')](removeEntity(_0x221050,null))['catch'](handleError(_0x221050,null));};exports[_0x2357('0x60')]=function(_0x2843b8,_0x32770a){return db['ChatQueue']['describe']()[_0x2357('0x34')](respondWithResult(_0x32770a,null))['catch'](handleError(_0x32770a,null));};exports[_0x2357('0x61')]=function(_0x16790b,_0x4ea3cc,_0x390697){var _0x6259ea={'raw':!![],'where':{}},_0x241c3f={},_0x37568f;return db[_0x2357('0x4f')][_0x2357('0x62')]({'where':{'id':_0x16790b[_0x2357('0x53')]['id']}})['then'](handleEntityNotFound(_0x4ea3cc,null))[_0x2357('0x34')](function(_0x11575e){if(_0x11575e){_0x37568f=_0x11575e['get']({'plain':!![]});_0x241c3f['model']=_[_0x2357('0x41')](db[_0x2357('0x63')]['rawAttributes']);_0x241c3f['query']=_[_0x2357('0x41')](_0x16790b[_0x2357('0x40')]);_0x241c3f['filters']=_[_0x2357('0x54')](_0x241c3f[_0x2357('0x43')],_0x241c3f[_0x2357('0x40')]);_0x6259ea[_0x2357('0x45')]=_[_0x2357('0x54')](_0x241c3f[_0x2357('0x43')],qs['fields'](_0x16790b[_0x2357('0x40')]['fields']));_0x6259ea[_0x2357('0x45')]=_0x6259ea[_0x2357('0x45')]['length']?_0x6259ea['attributes']:_0x241c3f[_0x2357('0x43')];if(!_0x16790b[_0x2357('0x40')]['hasOwnProperty'](_0x2357('0x48'))){_0x6259ea[_0x2357('0x2f')]=qs['limit'](_0x16790b[_0x2357('0x40')][_0x2357('0x2f')]);_0x6259ea[_0x2357('0x2d')]=qs['offset'](_0x16790b[_0x2357('0x40')][_0x2357('0x2d')]);}_0x6259ea[_0x2357('0x64')]=qs[_0x2357('0x49')](_0x16790b['query'][_0x2357('0x49')]);_0x6259ea[_0x2357('0x4a')]=qs['filters'](_['pick'](_0x16790b[_0x2357('0x40')],_0x241c3f[_0x2357('0x42')]));_0x6259ea[_0x2357('0x4a')][_0x2357('0x65')]=_0x11575e['id'];if(_0x16790b[_0x2357('0x40')][_0x2357('0x4c')]){_0x6259ea[_0x2357('0x4a')]=_[_0x2357('0x4d')](_0x6259ea['where'],{'$or':_[_0x2357('0x3c')](_0x6259ea['attributes'],function(_0x2d7fda){var _0x2fc915={};_0x2fc915[_0x2d7fda]={'$like':'%'+_0x16790b[_0x2357('0x40')][_0x2357('0x4c')]+'%'};return _0x2fc915;})});}_0x6259ea=_[_0x2357('0x4d')]({},_0x6259ea,_0x16790b['options']);return db[_0x2357('0x63')][_0x2357('0x66')](_0x6259ea);}})[_0x2357('0x34')](function(_0xab8a48){if(_0xab8a48){return db['User'][_0x2357('0x67')]({'where':{'id':_[_0x2357('0x3c')](_0xab8a48,_0x2357('0x68')),'role':_0x2357('0x69')},'attributes':['id',_0x2357('0x3a'),_0x2357('0x6a'),_0x2357('0x6b'),_0x2357('0x6c')]});}})[_0x2357('0x34')](function(_0x13f371){if(_0x13f371){return{'count':_0x13f371['count'],'rows':_[_0x2357('0x3c')](_0x13f371[_0x2357('0x51')],function(_0x7077a8){return{'membername':_0x7077a8[_0x2357('0x3a')],'UserId':_0x7077a8['id'],'queue_name':_0x37568f[_0x2357('0x3a')],'ChatQueueId':_0x37568f['id'],'interface':util[_0x2357('0x6d')]('%s/%s',_0x2357('0x6e'),_0x7077a8[_0x2357('0x3a')]),'penalty':0x0,'paused':_0x7077a8['chatPause'],'createdAt':_0x7077a8['createdAt'],'updatedAt':_0x7077a8[_0x2357('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4ea3cc,_0x6259ea))[_0x2357('0x28')](handleError(_0x4ea3cc,null));};exports[_0x2357('0x6f')]=function(_0xcd3e83,_0x8b8546,_0x5e42a5){var _0xd68cbb={};var _0x4dd001={};var _0x285664;var _0x37cef0;return db['ChatQueue'][_0x2357('0x62')]({'where':{'id':_0xcd3e83[_0x2357('0x53')]['id']}})[_0x2357('0x34')](handleEntityNotFound(_0x8b8546,null))[_0x2357('0x34')](function(_0x439670){if(_0x439670){_0x285664=_0x439670;_0x4dd001['model']=_[_0x2357('0x41')](db['Team'][_0x2357('0x3d')]);_0x4dd001[_0x2357('0x40')]=_['keys'](_0xcd3e83[_0x2357('0x40')]);_0x4dd001['filters']=_[_0x2357('0x54')](_0x4dd001[_0x2357('0x43')],_0x4dd001['query']);_0xd68cbb[_0x2357('0x45')]=_[_0x2357('0x54')](_0x4dd001[_0x2357('0x43')],qs['fields'](_0xcd3e83[_0x2357('0x40')]['fields']));_0xd68cbb[_0x2357('0x45')]=_0xd68cbb[_0x2357('0x45')]['length']?_0xd68cbb[_0x2357('0x45')]:_0x4dd001[_0x2357('0x43')];_0xd68cbb['order']=qs[_0x2357('0x49')](_0xcd3e83[_0x2357('0x40')]['sort']);_0xd68cbb[_0x2357('0x4a')]=qs[_0x2357('0x42')](_[_0x2357('0x4b')](_0xcd3e83[_0x2357('0x40')],_0x4dd001[_0x2357('0x42')]));if(_0xcd3e83[_0x2357('0x40')][_0x2357('0x4c')]){_0xd68cbb['where']=_['merge'](_0xd68cbb[_0x2357('0x4a')],{'$or':_[_0x2357('0x3c')](_0xd68cbb['attributes'],function(_0xaa2502){var _0x95900={};_0x95900[_0xaa2502]={'$like':'%'+_0xcd3e83['query'][_0x2357('0x4c')]+'%'};return _0x95900;})});}_0xd68cbb=_[_0x2357('0x4d')]({},_0xd68cbb,_0xcd3e83[_0x2357('0x4e')]);return _0x285664[_0x2357('0x6f')](_0xd68cbb);}})[_0x2357('0x34')](function(_0x11698){if(_0x11698){_0x37cef0=_0x11698[_0x2357('0x46')];if(!_0xcd3e83[_0x2357('0x40')]['hasOwnProperty']('nolimit')){_0xd68cbb['limit']=qs['limit'](_0xcd3e83['query'][_0x2357('0x2f')]);_0xd68cbb[_0x2357('0x2d')]=qs[_0x2357('0x2d')](_0xcd3e83['query']['offset']);}return _0x285664[_0x2357('0x6f')](_0xd68cbb);}})[_0x2357('0x34')](function(_0x4b3e12){if(_0x4b3e12){return _0x4b3e12?{'count':_0x37cef0,'rows':_0x4b3e12}:null;}})[_0x2357('0x34')](respondWithResult(_0x8b8546,null))[_0x2357('0x28')](handleError(_0x8b8546,null));};exports[_0x2357('0x70')]=function(_0x18a956,_0x57b4ee,_0x5bb198){var _0x4c500c=_0x18a956['body'][_0x2357('0x71')];return db[_0x2357('0x72')]['findAll']({'where':{'id':_0x4c500c},'attributes':['id'],'include':[{'model':db[_0x2357('0x73')],'as':_0x2357('0x74'),'attributes':['id',_0x2357('0x3a'),'online','voicePause',_0x2357('0x75')],'raw':!![]}]})[_0x2357('0x34')](function(_0x1701cd){if(_0x1701cd){var _0x55a450=_[_0x2357('0x76')](_0x1701cd,function(_0x54ebd6){var _0x206d6e=_0x54ebd6[_0x2357('0x36')]({'plain':!![]});return _0x206d6e[_0x2357('0x74')];});return db[_0x2357('0x4f')]['find']({'where':{'id':_0x18a956['params']['id']}})[_0x2357('0x34')](function(_0x569cc0){return db[_0x2357('0x77')]['transaction'](function(_0x5dd227){return _0x569cc0[_0x2357('0x70')](_0x4c500c,{'transaction':_0x5dd227})[_0x2357('0x34')](function(){return BPromise[_0x2357('0x78')](_0x55a450,function(_0x5ecdd1){return db[_0x2357('0x63')][_0x2357('0x79')]({'where':{'UserId':_0x5ecdd1['id'],'ChatQueueId':_0x18a956[_0x2357('0x53')]['id']},'transaction':_0x5dd227});});})[_0x2357('0x34')](function(){_0x55a450['forEach'](function(_0x3cc8dd){socket['emit'](_0x2357('0x7a'),{'UserId':_0x3cc8dd['id'],'ChatQueueId':_0x569cc0['id']});});});});});}})['then'](respondWithStatusCode(_0x57b4ee,null))[_0x2357('0x28')](handleError(_0x57b4ee,null));};exports[_0x2357('0x7b')]=function(_0x41bd4c,_0x25a528,_0x2289a9){return db[_0x2357('0x72')][_0x2357('0x66')]({'where':{'id':_0x41bd4c[_0x2357('0x40')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x25a528,null))[_0x2357('0x34')](function(_0x485152){var _0x27d631=_[_0x2357('0x3c')](_0x485152,'id');var _0x17985e=[];var _0x710a0d=[];var _0x2a84d6=squel[_0x2357('0x7c')]();_0x2a84d6[_0x2357('0x7d')](_0x2357('0x7e'))[_0x2357('0x7f')](_0x2357('0x80'),'tq')[_0x2357('0x81')](_0x2357('0x82'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x2357('0x83'),_0x41bd4c['params']['id']);for(var _0x3b1437=0x0;_0x3b1437<_0x485152[_0x2357('0x46')];_0x3b1437+=0x1){let _0x357257=_0x485152[_0x3b1437];for(var _0x3ae48e=0x0;_0x3ae48e<_0x357257[_0x2357('0x74')][_0x2357('0x46')];_0x3ae48e+=0x1){let _0x3a1689=_0x357257[_0x2357('0x74')][_0x3ae48e];var _0x4cc835=_0x2a84d6[_0x2357('0x84')]();_0x4cc835[_0x2357('0x4a')](_0x2357('0x85'),_0x3a1689['id']);_0x710a0d['push'](db[_0x2357('0x77')]['query'](_0x4cc835[_0x2357('0x86')](),{'type':db[_0x2357('0x77')][_0x2357('0x87')][_0x2357('0x88')]})[_0x2357('0x34')](function(_0x1776f4){if(_0x1776f4['length']===0x1){return _0x3a1689['id'];}else{var _0x53c9f3=_[_0x2357('0x89')](_[_0x2357('0x3c')](_0x1776f4,'TeamId'),function(_0x27f7f6){return _[_0x2357('0x8a')](_0x27d631,_0x27f7f6);});if(_0x53c9f3){return _0x3a1689['id'];}}}));}}return BPromise[_0x2357('0x8b')](_0x710a0d)[_0x2357('0x34')](function(_0x52b0c1){_0x17985e=_(_0x17985e)[_0x2357('0x8c')](_0x52b0c1)['compact']()[_0x2357('0x8d')]();return db[_0x2357('0x4f')][_0x2357('0x56')]({'where':{'id':_0x41bd4c['params']['id']}})[_0x2357('0x34')](function(_0x402512){return db[_0x2357('0x77')][_0x2357('0x8e')](function(_0x522c33){return _0x402512['removeTeams'](_0x41bd4c[_0x2357('0x40')][_0x2357('0x71')],{'transaction':_0x522c33})[_0x2357('0x34')](function(){if(!_[_0x2357('0x8f')](_0x17985e)){return _0x402512['removeAgents'](_0x17985e,{'transaction':_0x522c33});}})['then'](function(){_0x17985e[_0x2357('0x90')](function(_0xc9bca9){socket['emit'](_0x2357('0x91'),{'UserId':_0xc9bca9,'ChatQueueId':_0x402512['id']});});});});});});})[_0x2357('0x34')](respondWithStatusCode(_0x25a528,null))[_0x2357('0x28')](handleError(_0x25a528,null));};exports[_0x2357('0x92')]=function(_0x1119da,_0xaa0e6e,_0x230df3){return db['ChatQueue'][_0x2357('0x56')]({'where':{'id':_0x1119da[_0x2357('0x53')]['id']}})[_0x2357('0x34')](handleEntityNotFound(_0xaa0e6e,null))[_0x2357('0x34')](function(_0x78f1de){if(_0x78f1de){return _0x78f1de[_0x2357('0x92')](_0x1119da[_0x2357('0x58')][_0x2357('0x71')],_['omit'](_0x1119da['body'],[_0x2357('0x71'),'id'])||{})[_0x2357('0x93')](function(_0x483da7){for(var _0x4071c9=0x0;_0x4071c9<_0x1119da[_0x2357('0x58')][_0x2357('0x71')][_0x2357('0x46')];_0x4071c9+=0x1){socket[_0x2357('0x94')](_0x2357('0x7a'),{'UserId':Number(_0x1119da[_0x2357('0x58')][_0x2357('0x71')][_0x4071c9]),'ChatQueueId':Number(_0x1119da['params']['id'])});}return _0x483da7;});}})[_0x2357('0x34')](respondWithResult(_0xaa0e6e,null))[_0x2357('0x28')](handleError(_0xaa0e6e,null));};exports['removeAgents']=function(_0x32a35f,_0x5e35c9,_0xbda0fb){return db[_0x2357('0x4f')][_0x2357('0x56')]({'where':{'id':_0x32a35f[_0x2357('0x53')]['id']}})[_0x2357('0x34')](handleEntityNotFound(_0x5e35c9,null))['then'](function(_0x1fd4f3){if(_0x1fd4f3){return _0x1fd4f3[_0x2357('0x95')](_0x32a35f[_0x2357('0x40')][_0x2357('0x71')])[_0x2357('0x34')](function(){if(_[_0x2357('0x96')](_0x32a35f[_0x2357('0x40')]['ids'])){for(var _0x276e05=0x0;_0x276e05<_0x32a35f[_0x2357('0x40')][_0x2357('0x71')][_0x2357('0x46')];_0x276e05+=0x1){socket[_0x2357('0x94')](_0x2357('0x91'),{'UserId':Number(_0x32a35f['query'][_0x2357('0x71')][_0x276e05]),'ChatQueueId':Number(_0x32a35f[_0x2357('0x53')]['id'])});}}else{socket[_0x2357('0x94')]('userChatQueue:remove',{'UserId':Number(_0x32a35f[_0x2357('0x40')][_0x2357('0x71')]),'ChatQueueId':Number(_0x32a35f[_0x2357('0x53')]['id'])});}});}})[_0x2357('0x34')](respondWithStatusCode(_0x5e35c9,null))[_0x2357('0x28')](handleError(_0x5e35c9,null));};exports[_0x2357('0x97')]=function(_0xf2bc43,_0x594815,_0x20f369){var _0x5665a2={};var _0x4e1eea={};var _0x6da90c;var _0x1c9e25;return db[_0x2357('0x4f')]['findOne']({'where':{'id':_0xf2bc43['params']['id']}})[_0x2357('0x34')](handleEntityNotFound(_0x594815,null))[_0x2357('0x34')](function(_0x388e32){if(_0x388e32){_0x6da90c=_0x388e32;_0x4e1eea[_0x2357('0x43')]=_[_0x2357('0x41')](db[_0x2357('0x73')]['rawAttributes']);_0x4e1eea['query']=_['keys'](_0xf2bc43[_0x2357('0x40')]);_0x4e1eea[_0x2357('0x42')]=_[_0x2357('0x54')](_0x4e1eea[_0x2357('0x43')],_0x4e1eea[_0x2357('0x40')]);_0x5665a2[_0x2357('0x45')]=_['intersection'](_0x4e1eea[_0x2357('0x43')],qs['fields'](_0xf2bc43['query'][_0x2357('0x44')]));_0x5665a2[_0x2357('0x45')]=_0x5665a2[_0x2357('0x45')][_0x2357('0x46')]?_0x5665a2[_0x2357('0x45')]:_0x4e1eea[_0x2357('0x43')];_0x5665a2[_0x2357('0x64')]=qs[_0x2357('0x49')](_0xf2bc43[_0x2357('0x40')][_0x2357('0x49')]);_0x5665a2[_0x2357('0x4a')]=qs[_0x2357('0x42')](_[_0x2357('0x4b')](_0xf2bc43[_0x2357('0x40')],_0x4e1eea[_0x2357('0x42')]));if(_0xf2bc43[_0x2357('0x40')][_0x2357('0x4c')]){_0x5665a2[_0x2357('0x4a')]=_[_0x2357('0x4d')](_0x5665a2[_0x2357('0x4a')],{'$or':_['map'](_0x5665a2[_0x2357('0x45')],function(_0x4fb6b1){var _0x379e65={};_0x379e65[_0x4fb6b1]={'$like':'%'+_0xf2bc43[_0x2357('0x40')][_0x2357('0x4c')]+'%'};return _0x379e65;})});}_0x5665a2=_['merge']({},_0x5665a2,_0xf2bc43[_0x2357('0x4e')]);return _0x6da90c[_0x2357('0x97')](_0x5665a2);}})[_0x2357('0x34')](function(_0x48910){if(_0x48910){_0x1c9e25=_0x48910['length'];if(!_0xf2bc43[_0x2357('0x40')][_0x2357('0x47')](_0x2357('0x48'))){_0x5665a2[_0x2357('0x2f')]=qs[_0x2357('0x2f')](_0xf2bc43[_0x2357('0x40')][_0x2357('0x2f')]);_0x5665a2[_0x2357('0x2d')]=qs['offset'](_0xf2bc43[_0x2357('0x40')][_0x2357('0x2d')]);}return _0x6da90c[_0x2357('0x97')](_0x5665a2);}})[_0x2357('0x34')](function(_0x52deed){if(_0x52deed){return _0x52deed?{'count':_0x1c9e25,'rows':_0x52deed}:null;}})[_0x2357('0x34')](respondWithResult(_0x594815,null))[_0x2357('0x28')](handleError(_0x594815,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 2d89dd3..007b923 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 _0xb19f=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','save'];(function(_0x15d409,_0x16c2ee){var _0x379106=function(_0x3ab526){while(--_0x3ab526){_0x15d409['push'](_0x15d409['shift']());}};_0x379106(++_0x16c2ee);}(_0xb19f,0x7d));var _0xfb19=function(_0x5a4b42,_0x2b9c18){_0x5a4b42=_0x5a4b42-0x0;var _0x5e81d6=_0xb19f[_0x5a4b42];return _0x5e81d6;};'use strict';var EventEmitter=require(_0xfb19('0x0'));var ChatQueue=require(_0xfb19('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfb19('0x2'),'afterUpdate':_0xfb19('0x3'),'afterDestroy':_0xfb19('0x4')};function emitEvent(_0x4ca48b){return function(_0xe1c6f9,_0x585ed2,_0x520a16){ChatQueueEvents['emit'](_0x4ca48b+':'+_0xe1c6f9['id'],_0xe1c6f9);ChatQueueEvents[_0xfb19('0x5')](_0x4ca48b,_0xe1c6f9);_0x520a16(null);};}for(var e in events){if(events[_0xfb19('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xfb19('0x7')]=ChatQueueEvents;
\ No newline at end of file
+var _0x0662=['emit','hasOwnProperty','hook','exports','../../mysqldb','ChatQueue','setMaxListeners','save','remove'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0662,0x175));var _0x2066=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x0662[_0x110c3d];return _0x226d67;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x2066('0x0'))['db'][_0x2066('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x2066('0x2')](0x0);var events={'afterCreate':_0x2066('0x3'),'afterUpdate':'update','afterDestroy':_0x2066('0x4')};function emitEvent(_0x1bef84){return function(_0x782930,_0x278653,_0x1db5d5){ChatQueueEvents[_0x2066('0x5')](_0x1bef84+':'+_0x782930['id'],_0x782930);ChatQueueEvents[_0x2066('0x5')](_0x1bef84,_0x782930);_0x1db5d5(null);};}for(var e in events){if(events[_0x2066('0x6')](e)){var event=events[e];ChatQueue[_0x2066('0x7')](e,emitEvent(event));}}module[_0x2066('0x8')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index ff9f4ea..dfddacc 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 _0xab31=['exports','define','chat_queues','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes'];(function(_0x298a31,_0x29f9ed){var _0x1f254f=function(_0xe20666){while(--_0xe20666){_0x298a31['push'](_0x298a31['shift']());}};_0x1f254f(++_0x29f9ed);}(_0xab31,0x87));var _0x1ab3=function(_0x384e5d,_0x5cedea){_0x384e5d=_0x384e5d-0x0;var _0x47ef61=_0xab31[_0x384e5d];return _0x47ef61;};'use strict';var _=require('lodash');var util=require(_0x1ab3('0x0'));var logger=require('../../config/logger')(_0x1ab3('0x1'));var moment=require('moment');var BPromise=require(_0x1ab3('0x2'));var rp=require(_0x1ab3('0x3'));var fs=require('fs');var path=require(_0x1ab3('0x4'));var rimraf=require(_0x1ab3('0x5'));var config=require(_0x1ab3('0x6'));var attributes=require(_0x1ab3('0x7'));module[_0x1ab3('0x8')]=function(_0x314020,_0x5c7c0c){return _0x314020[_0x1ab3('0x9')]('ChatQueue',attributes,{'tableName':_0x1ab3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0a5c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api'];(function(_0x31a755,_0x203ce1){var _0x4aa72b=function(_0xa3568c){while(--_0xa3568c){_0x31a755['push'](_0x31a755['shift']());}};_0x4aa72b(++_0x203ce1);}(_0x0a5c,0x1af));var _0xc0a5=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x0a5c[_0x42bdad];return _0x122626;};'use strict';var _=require(_0xc0a5('0x0'));var util=require(_0xc0a5('0x1'));var logger=require(_0xc0a5('0x2'))(_0xc0a5('0x3'));var moment=require(_0xc0a5('0x4'));var BPromise=require(_0xc0a5('0x5'));var rp=require(_0xc0a5('0x6'));var fs=require('fs');var path=require(_0xc0a5('0x7'));var rimraf=require(_0xc0a5('0x8'));var config=require(_0xc0a5('0x9'));var attributes=require(_0xc0a5('0xa'));module[_0xc0a5('0xb')]=function(_0x3aaaf6,_0x269c4e){return _0x3aaaf6[_0xc0a5('0xc')](_0xc0a5('0xd'),attributes,{'tableName':_0xc0a5('0xe'),'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 b516964..6cbeaf4 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 _0x342c=['then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetChatQueue','findAll','raw','options','where','attributes','limit','include','map','model','catch','ShowChatQueue','ChatQueue'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x342c,0x149));var _0xc342=function(_0x466882,_0x505c6a){_0x466882=_0x466882-0x0;var _0x1d8053=_0x342c[_0x466882];return _0x1d8053;};'use strict';var _=require(_0xc342('0x0'));var util=require(_0xc342('0x1'));var moment=require('moment');var BPromise=require(_0xc342('0x2'));var rs=require(_0xc342('0x3'));var fs=require('fs');var Redis=require(_0xc342('0x4'));var db=require(_0xc342('0x5'))['db'];var utils=require(_0xc342('0x6'));var logger=require('../../config/logger')(_0xc342('0x7'));var config=require(_0xc342('0x8'));var jayson=require(_0xc342('0x9'));var client=jayson[_0xc342('0xa')]['http']({'port':0x232a});config[_0xc342('0xb')]=_[_0xc342('0xc')](config['redis'],{'host':_0xc342('0xd'),'port':0x18eb});var socket=require(_0xc342('0xe'))(new Redis(config['redis']));require(_0xc342('0xf'))[_0xc342('0x10')](socket);function respondWithRpcPromise(_0x451ecf,_0x29a751,_0x55a04c){return new BPromise(function(_0x41db94,_0x4228b9){return client[_0xc342('0x11')](_0x451ecf,_0x55a04c)['then'](function(_0x356575){logger[_0xc342('0x12')](_0xc342('0x13'),_0x29a751,_0xc342('0x14'));logger[_0xc342('0x15')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x29a751,_0xc342('0x14'),JSON[_0xc342('0x16')](_0x356575));if(_0x356575['error']){if(_0x356575[_0xc342('0x17')][_0xc342('0x18')]===0x1f4){logger[_0xc342('0x17')](_0xc342('0x13'),_0x29a751,_0x356575[_0xc342('0x17')][_0xc342('0x19')]);return _0x4228b9(_0x356575[_0xc342('0x17')][_0xc342('0x19')]);}logger['error'](_0xc342('0x13'),_0x29a751,_0x356575[_0xc342('0x17')][_0xc342('0x19')]);return _0x41db94(_0x356575['error'][_0xc342('0x19')]);}else{logger[_0xc342('0x12')](_0xc342('0x13'),_0x29a751,_0xc342('0x14'));_0x41db94(_0x356575[_0xc342('0x1a')][_0xc342('0x19')]);}})['catch'](function(_0x163c01){logger['error'](_0xc342('0x13'),_0x29a751,_0x163c01);_0x4228b9(_0x163c01);});});}exports[_0xc342('0x1b')]=function(_0x4377cb){var _0x24e8c8=this;return new Promise(function(_0xe6b1ed,_0x2e5e59){return db['ChatQueue'][_0xc342('0x1c')]({'raw':_0x4377cb['options']?_0x4377cb['options'][_0xc342('0x1d')]===undefined?!![]:![]:!![],'where':_0x4377cb['options']?_0x4377cb[_0xc342('0x1e')][_0xc342('0x1f')]||null:null,'attributes':_0x4377cb['options']?_0x4377cb[_0xc342('0x1e')][_0xc342('0x20')]||null:null,'limit':_0x4377cb[_0xc342('0x1e')]?_0x4377cb[_0xc342('0x1e')][_0xc342('0x21')]||null:null,'include':_0x4377cb['options']?_0x4377cb[_0xc342('0x1e')][_0xc342('0x22')]?_[_0xc342('0x23')](_0x4377cb[_0xc342('0x1e')]['include'],function(_0x34c7fd){return{'model':db[_0x34c7fd['model']],'as':_0x34c7fd['as'],'attributes':_0x34c7fd['attributes'],'include':_0x34c7fd[_0xc342('0x22')]?_[_0xc342('0x23')](_0x34c7fd[_0xc342('0x22')],function(_0xffe9fd){return{'model':db[_0xffe9fd[_0xc342('0x24')]],'as':_0xffe9fd['as'],'attributes':_0xffe9fd[_0xc342('0x20')],'include':_0xffe9fd[_0xc342('0x22')]?_['map'](_0xffe9fd[_0xc342('0x22')],function(_0x318e6f){return{'model':db[_0x318e6f[_0xc342('0x24')]],'as':_0x318e6f['as'],'attributes':_0x318e6f[_0xc342('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1051aa){logger[_0xc342('0x12')](_0xc342('0x1b'),_0x4377cb);logger[_0xc342('0x15')](_0xc342('0x1b'),_0x4377cb,JSON['stringify'](_0x1051aa));_0xe6b1ed(_0x1051aa);})[_0xc342('0x25')](function(_0x12432e){logger[_0xc342('0x17')](_0xc342('0x1b'),_0x12432e['message'],_0x4377cb);_0x2e5e59(_0x24e8c8[_0xc342('0x17')](0x1f4,_0x12432e[_0xc342('0x19')]));});});};exports[_0xc342('0x26')]=function(_0x509b3b){var _0x4520c3=this;return new Promise(function(_0x3d5da7,_0x2cadd9){return db[_0xc342('0x27')]['find']({'raw':_0x509b3b[_0xc342('0x1e')]?_0x509b3b[_0xc342('0x1e')][_0xc342('0x1d')]===undefined?!![]:![]:!![],'where':_0x509b3b[_0xc342('0x1e')]?_0x509b3b[_0xc342('0x1e')][_0xc342('0x1f')]||null:null,'attributes':_0x509b3b['options']?_0x509b3b[_0xc342('0x1e')][_0xc342('0x20')]||null:null,'include':_0x509b3b[_0xc342('0x1e')]?_0x509b3b[_0xc342('0x1e')][_0xc342('0x22')]?_[_0xc342('0x23')](_0x509b3b[_0xc342('0x1e')][_0xc342('0x22')],function(_0x156956){return{'model':db[_0x156956[_0xc342('0x24')]],'as':_0x156956['as'],'attributes':_0x156956['attributes'],'include':_0x156956[_0xc342('0x22')]?_[_0xc342('0x23')](_0x156956[_0xc342('0x22')],function(_0x182e3a){return{'model':db[_0x182e3a[_0xc342('0x24')]],'as':_0x182e3a['as'],'attributes':_0x182e3a[_0xc342('0x20')],'include':_0x182e3a[_0xc342('0x22')]?_[_0xc342('0x23')](_0x182e3a[_0xc342('0x22')],function(_0x3ae15e){return{'model':db[_0x3ae15e[_0xc342('0x24')]],'as':_0x3ae15e['as'],'attributes':_0x3ae15e['attributes']};}):[]};}):[]};}):[]:[]})[_0xc342('0x28')](function(_0x3c33c4){logger[_0xc342('0x12')](_0xc342('0x26'),_0x509b3b);logger['debug']('ShowChatQueue',_0x509b3b,JSON[_0xc342('0x16')](_0x3c33c4));_0x3d5da7(_0x3c33c4);})[_0xc342('0x25')](function(_0x24b3ae){logger[_0xc342('0x17')](_0xc342('0x26'),_0x24b3ae[_0xc342('0x19')],_0x509b3b);_0x2cadd9(_0x4520c3[_0xc342('0x17')](0x1f4,_0x24b3ae[_0xc342('0x19')]));});});};
\ No newline at end of file
+var _0x161a=['../../config/logger','jayson/promise','client','http','redis','defaults','localhost','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowChatQueue','moment','bluebird','ioredis','../../config/utils'];(function(_0x1b3db4,_0x3be734){var _0x294216=function(_0x3bce45){while(--_0x3bce45){_0x1b3db4['push'](_0x1b3db4['shift']());}};_0x294216(++_0x3be734);}(_0x161a,0x140));var _0xa161=function(_0x2de0a7,_0x38d3e7){_0x2de0a7=_0x2de0a7-0x0;var _0x429437=_0x161a[_0x2de0a7];return _0x429437;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa161('0x0'));var BPromise=require(_0xa161('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa161('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa161('0x3'));var logger=require(_0xa161('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa161('0x5'));var client=jayson[_0xa161('0x6')][_0xa161('0x7')]({'port':0x232a});config[_0xa161('0x8')]=_[_0xa161('0x9')](config[_0xa161('0x8')],{'host':_0xa161('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa161('0x8')]));require(_0xa161('0xb'))[_0xa161('0xc')](socket);function respondWithRpcPromise(_0x3d3074,_0x306e62,_0x1a3301){return new BPromise(function(_0x1c443e,_0x29f617){return client[_0xa161('0xd')](_0x3d3074,_0x1a3301)[_0xa161('0xe')](function(_0x29574e){logger[_0xa161('0xf')](_0xa161('0x10'),_0x306e62,'request\x20sent');logger[_0xa161('0x11')](_0xa161('0x12'),_0x306e62,_0xa161('0x13'),JSON[_0xa161('0x14')](_0x29574e));if(_0x29574e['error']){if(_0x29574e[_0xa161('0x15')][_0xa161('0x16')]===0x1f4){logger['error'](_0xa161('0x10'),_0x306e62,_0x29574e[_0xa161('0x15')]['message']);return _0x29f617(_0x29574e[_0xa161('0x15')][_0xa161('0x17')]);}logger[_0xa161('0x15')]('ChatQueue,\x20%s,\x20%s',_0x306e62,_0x29574e[_0xa161('0x15')][_0xa161('0x17')]);return _0x1c443e(_0x29574e[_0xa161('0x15')][_0xa161('0x17')]);}else{logger[_0xa161('0xf')](_0xa161('0x10'),_0x306e62,_0xa161('0x13'));_0x1c443e(_0x29574e['result'][_0xa161('0x17')]);}})[_0xa161('0x18')](function(_0x55c558){logger[_0xa161('0x15')]('ChatQueue,\x20%s,\x20%s',_0x306e62,_0x55c558);_0x29f617(_0x55c558);});});}exports[_0xa161('0x19')]=function(_0x3ccf0c){var _0x2dd796=this;return new Promise(function(_0x269d56,_0xf6cd86){return db['ChatQueue'][_0xa161('0x1a')]({'raw':_0x3ccf0c[_0xa161('0x1b')]?_0x3ccf0c[_0xa161('0x1b')][_0xa161('0x1c')]===undefined?!![]:![]:!![],'where':_0x3ccf0c[_0xa161('0x1b')]?_0x3ccf0c[_0xa161('0x1b')][_0xa161('0x1d')]||null:null,'attributes':_0x3ccf0c[_0xa161('0x1b')]?_0x3ccf0c[_0xa161('0x1b')][_0xa161('0x1e')]||null:null,'limit':_0x3ccf0c[_0xa161('0x1b')]?_0x3ccf0c['options'][_0xa161('0x1f')]||null:null,'include':_0x3ccf0c[_0xa161('0x1b')]?_0x3ccf0c[_0xa161('0x1b')][_0xa161('0x20')]?_[_0xa161('0x21')](_0x3ccf0c[_0xa161('0x1b')][_0xa161('0x20')],function(_0x2b1331){return{'model':db[_0x2b1331[_0xa161('0x22')]],'as':_0x2b1331['as'],'attributes':_0x2b1331[_0xa161('0x1e')],'include':_0x2b1331[_0xa161('0x20')]?_['map'](_0x2b1331[_0xa161('0x20')],function(_0x492da1){return{'model':db[_0x492da1[_0xa161('0x22')]],'as':_0x492da1['as'],'attributes':_0x492da1[_0xa161('0x1e')],'include':_0x492da1[_0xa161('0x20')]?_[_0xa161('0x21')](_0x492da1[_0xa161('0x20')],function(_0x20ce3c){return{'model':db[_0x20ce3c[_0xa161('0x22')]],'as':_0x20ce3c['as'],'attributes':_0x20ce3c[_0xa161('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa161('0xe')](function(_0x150e36){logger[_0xa161('0xf')](_0xa161('0x19'),_0x3ccf0c);logger[_0xa161('0x11')](_0xa161('0x19'),_0x3ccf0c,JSON[_0xa161('0x14')](_0x150e36));_0x269d56(_0x150e36);})['catch'](function(_0x3579b6){logger['error'](_0xa161('0x19'),_0x3579b6['message'],_0x3ccf0c);_0xf6cd86(_0x2dd796[_0xa161('0x15')](0x1f4,_0x3579b6[_0xa161('0x17')]));});});};exports[_0xa161('0x23')]=function(_0x15f3d9){var _0x527870=this;return new Promise(function(_0x306cd5,_0x2a2cdf){return db['ChatQueue']['find']({'raw':_0x15f3d9[_0xa161('0x1b')]?_0x15f3d9['options']['raw']===undefined?!![]:![]:!![],'where':_0x15f3d9['options']?_0x15f3d9[_0xa161('0x1b')][_0xa161('0x1d')]||null:null,'attributes':_0x15f3d9[_0xa161('0x1b')]?_0x15f3d9[_0xa161('0x1b')][_0xa161('0x1e')]||null:null,'include':_0x15f3d9[_0xa161('0x1b')]?_0x15f3d9['options'][_0xa161('0x20')]?_['map'](_0x15f3d9[_0xa161('0x1b')][_0xa161('0x20')],function(_0x56417e){return{'model':db[_0x56417e[_0xa161('0x22')]],'as':_0x56417e['as'],'attributes':_0x56417e[_0xa161('0x1e')],'include':_0x56417e[_0xa161('0x20')]?_['map'](_0x56417e[_0xa161('0x20')],function(_0x305902){return{'model':db[_0x305902[_0xa161('0x22')]],'as':_0x305902['as'],'attributes':_0x305902[_0xa161('0x1e')],'include':_0x305902[_0xa161('0x20')]?_[_0xa161('0x21')](_0x305902[_0xa161('0x20')],function(_0x533a27){return{'model':db[_0x533a27[_0xa161('0x22')]],'as':_0x533a27['as'],'attributes':_0x533a27['attributes']};}):[]};}):[]};}):[]:[]})[_0xa161('0xe')](function(_0x54a278){logger[_0xa161('0xf')](_0xa161('0x23'),_0x15f3d9);logger['debug']('ShowChatQueue',_0x15f3d9,JSON['stringify'](_0x54a278));_0x306cd5(_0x54a278);})[_0xa161('0x18')](function(_0x133f1c){logger[_0xa161('0x15')]('ShowChatQueue',_0x133f1c[_0xa161('0x17')],_0x15f3d9);_0x2a2cdf(_0x527870[_0xa161('0x15')](0x1f4,_0x133f1c[_0xa161('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index c67c60f..4668117 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 _0x4b84=['./chatQueue.events','save','emit','length'];(function(_0x1f62e3,_0x56649a){var _0x4bf19c=function(_0x58dee5){while(--_0x58dee5){_0x1f62e3['push'](_0x1f62e3['shift']());}};_0x4bf19c(++_0x56649a);}(_0x4b84,0x1cc));var _0x44b8=function(_0x5bfa44,_0x76dacc){_0x5bfa44=_0x5bfa44-0x0;var _0x43815f=_0x4b84[_0x5bfa44];return _0x43815f;};'use strict';var ChatQueueEvents=require(_0x44b8('0x0'));var events=[_0x44b8('0x1'),'remove','update'];function createListener(_0x765943,_0x519db3){return function(_0x4b8ad8){_0x519db3[_0x44b8('0x2')](_0x765943,_0x4b8ad8);};}function removeListener(_0x31282a,_0x39ad16){return function(){ChatQueueEvents['removeListener'](_0x31282a,_0x39ad16);};}exports['register']=function(_0x55f25d){for(var _0x996a8b=0x0,_0x54274b=events[_0x44b8('0x3')];_0x996a8b<_0x54274b;_0x996a8b++){var _0x5947f7=events[_0x996a8b];var _0x3e87c5=createListener('chatQueue:'+_0x5947f7,_0x55f25d);ChatQueueEvents['on'](_0x5947f7,_0x3e87c5);}};
\ No newline at end of file
+var _0xed1f=['register','length','./chatQueue.events','save','remove','update','emit','removeListener'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xed1f,0x6a));var _0xfed1=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xed1f[_0x178e48];return _0x440d7e;};'use strict';var ChatQueueEvents=require(_0xfed1('0x0'));var events=[_0xfed1('0x1'),_0xfed1('0x2'),_0xfed1('0x3')];function createListener(_0xa45937,_0x25f345){return function(_0x1dd614){_0x25f345[_0xfed1('0x4')](_0xa45937,_0x1dd614);};}function removeListener(_0x2209b3,_0x45c3c1){return function(){ChatQueueEvents[_0xfed1('0x5')](_0x2209b3,_0x45c3c1);};}exports[_0xfed1('0x6')]=function(_0x3d6706){for(var _0x42751d=0x0,_0x380e18=events[_0xfed1('0x7')];_0x42751d<_0x380e18;_0x42751d++){var _0x2a6082=events[_0x42751d];var _0x2967ef=createListener('chatQueue:'+_0x2a6082,_0x3d6706);ChatQueueEvents['on'](_0x2a6082,_0x2967ef);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index a786178..afbfb80 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 _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(_0x104112,_0x342eb6){var _0x394ab4=function(_0x48db18){while(--_0x48db18){_0x104112['push'](_0x104112['shift']());}};_0x394ab4(++_0x342eb6);}(_0x55ca,0x126));var _0xa55c=function(_0xc1263e,_0x56d738){_0xc1263e=_0xc1263e-0x0;var _0x471f07=_0x55ca[_0xc1263e];return _0x471f07;};'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
+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(_0x6eae2,_0x5e3b82){var _0x5def02=function(_0x168cad){while(--_0x168cad){_0x6eae2['push'](_0x6eae2['shift']());}};_0x5def02(++_0x5e3b82);}(_0x55ca,0x126));var _0xa55c=function(_0x2e689d,_0x4c3b29){_0x2e689d=_0x2e689d-0x0;var _0x540160=_0x55ca[_0x2e689d];return _0x540160;};'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 016dd0f..37ad961 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 _0x132d=['DATE','moment','sequelize','exports','STRING'];(function(_0x14d560,_0x4b390c){var _0x52d471=function(_0x4ffbdd){while(--_0x4ffbdd){_0x14d560['push'](_0x14d560['shift']());}};_0x52d471(++_0x4b390c);}(_0x132d,0xc9));var _0xd132=function(_0x23a3a5,_0x5ca1fe){_0x23a3a5=_0x23a3a5-0x0;var _0x4ef29e=_0x132d[_0x23a3a5];return _0x4ef29e;};'use strict';var moment=require(_0xd132('0x0'));var Sequelize=require(_0xd132('0x1'));module[_0xd132('0x2')]={'uniqueid':{'type':Sequelize[_0xd132('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xd132('0x3')]},'joinAt':{'type':Sequelize[_0xd132('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xd132('0x4')]},'reason':{'type':Sequelize[_0xd132('0x3')]}};
\ No newline at end of file
+var _0x3072=['DATE','sequelize','exports','STRING'];(function(_0x3bde1b,_0x8f8f7d){var _0x1029f2=function(_0x24ad4c){while(--_0x24ad4c){_0x3bde1b['push'](_0x3bde1b['shift']());}};_0x1029f2(++_0x8f8f7d);}(_0x3072,0xe1));var _0x2307=function(_0x4d9540,_0x26cc84){_0x4d9540=_0x4d9540-0x0;var _0x2d211e=_0x3072[_0x4d9540];return _0x2d211e;};'use strict';var moment=require('moment');var Sequelize=require(_0x2307('0x0'));module[_0x2307('0x1')]={'uniqueid':{'type':Sequelize[_0x2307('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x2307('0x2')]},'joinAt':{'type':Sequelize[_0x2307('0x3')]},'leaveAt':{'type':Sequelize[_0x2307('0x3')]},'acceptAt':{'type':Sequelize[_0x2307('0x3')]},'exitAt':{'type':Sequelize[_0x2307('0x3')]},'reason':{'type':Sequelize[_0x2307('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index cf10c3e..0dadd95 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 _0x6eed=['stack','name','index','map','ChatQueueReport','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','include','findAll','rows','params','rawAttributes','find','catch','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','reject','save','then','destroy','end','error'];(function(_0x28d1ee,_0x855ec5){var _0x569b83=function(_0x2373b2){while(--_0x2373b2){_0x28d1ee['push'](_0x28d1ee['shift']());}};_0x569b83(++_0x855ec5);}(_0x6eed,0xff));var _0xd6ee=function(_0x47aef8,_0x1acbea){_0x47aef8=_0x47aef8-0x0;var _0x43d389=_0x6eed[_0x47aef8];return _0x43d389;};'use strict';var emlformat=require(_0xd6ee('0x0'));var rimraf=require(_0xd6ee('0x1'));var zipdir=require(_0xd6ee('0x2'));var jsonpatch=require(_0xd6ee('0x3'));var rp=require(_0xd6ee('0x4'));var moment=require('moment');var BPromise=require(_0xd6ee('0x5'));var Mustache=require(_0xd6ee('0x6'));var util=require('util');var path=require('path');var sox=require(_0xd6ee('0x7'));var csv=require(_0xd6ee('0x8'));var ejs=require(_0xd6ee('0x9'));var fs=require('fs');var fs_extra=require(_0xd6ee('0xa'));var _=require(_0xd6ee('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd6ee('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd6ee('0xd'));var Redis=require(_0xd6ee('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd6ee('0xf'));var as=require(_0xd6ee('0x10'));var hardwareService=require(_0xd6ee('0x11'));var logger=require(_0xd6ee('0x12'))('api');var utils=require(_0xd6ee('0x13'));var config=require(_0xd6ee('0x14'));var licenseUtil=require(_0xd6ee('0x15'));var db=require(_0xd6ee('0x16'))['db'];function respondWithStatusCode(_0x268dd1,_0x3fd1df){_0x3fd1df=_0x3fd1df||0xcc;return function(_0x48be63){if(_0x48be63){return _0x268dd1[_0xd6ee('0x17')](_0x3fd1df);}return _0x268dd1[_0xd6ee('0x18')](_0x3fd1df)['end']();};}function respondWithResult(_0x369b4a,_0x15918d){_0x15918d=_0x15918d||0xc8;return function(_0x2bf3b2){if(_0x2bf3b2){return _0x369b4a[_0xd6ee('0x18')](_0x15918d)[_0xd6ee('0x19')](_0x2bf3b2);}};}function respondWithFilteredResult(_0xe66d0d,_0x49bafc){return function(_0x1c2e51){if(_0x1c2e51){var _0xb99b70=typeof _0x49bafc[_0xd6ee('0x1a')]==='undefined'&&typeof _0x49bafc[_0xd6ee('0x1b')]==='undefined';var _0x3a82bf=_0x1c2e51[_0xd6ee('0x1c')];var _0x81d533=_0xb99b70?0x0:_0x49bafc['offset'];var _0x8a2718=_0xb99b70?_0x1c2e51['count']:_0x49bafc[_0xd6ee('0x1a')]+_0x49bafc['limit'];var _0x31ae0f;if(_0x8a2718>=_0x3a82bf){_0x8a2718=_0x3a82bf;_0x31ae0f=0xc8;}else{_0x31ae0f=0xce;}_0xe66d0d[_0xd6ee('0x18')](_0x31ae0f);return _0xe66d0d[_0xd6ee('0x1d')](_0xd6ee('0x1e'),_0x81d533+'-'+_0x8a2718+'/'+_0x3a82bf)[_0xd6ee('0x19')](_0x1c2e51);}return null;};}function patchUpdates(_0x4b33f1){return function(_0xe2f8c4){try{jsonpatch['apply'](_0xe2f8c4,_0x4b33f1,!![]);}catch(_0x17e011){return BPromise[_0xd6ee('0x1f')](_0x17e011);}return _0xe2f8c4[_0xd6ee('0x20')]();};}function saveUpdates(_0x1abedc,_0xec9287){return function(_0x48e6ad){if(_0x48e6ad){return _0x48e6ad['update'](_0x1abedc)[_0xd6ee('0x21')](function(_0x511c18){return _0x511c18;});}return null;};}function removeEntity(_0x2bae66,_0x519373){return function(_0x391844){if(_0x391844){return _0x391844[_0xd6ee('0x22')]()[_0xd6ee('0x21')](function(){_0x2bae66[_0xd6ee('0x18')](0xcc)[_0xd6ee('0x23')]();});}};}function handleEntityNotFound(_0x5476f2,_0x4b1926){return function(_0x2f438c){if(!_0x2f438c){_0x5476f2[_0xd6ee('0x17')](0x194);}return _0x2f438c;};}function handleError(_0x4edb7d,_0x2c9b30){_0x2c9b30=_0x2c9b30||0x1f4;return function(_0xa1e700){logger[_0xd6ee('0x24')](_0xa1e700[_0xd6ee('0x25')]);if(_0xa1e700[_0xd6ee('0x26')]){delete _0xa1e700[_0xd6ee('0x26')];}_0x4edb7d[_0xd6ee('0x18')](_0x2c9b30)['send'](_0xa1e700);};}exports[_0xd6ee('0x27')]=function(_0x124ab7,_0x50b786){var _0x5bcdd6={},_0x1578b3={},_0x4580a7={'count':0x0,'rows':[]};var _0xddca=_[_0xd6ee('0x28')](db[_0xd6ee('0x29')]['rawAttributes'],function(_0x414015){return{'name':_0x414015[_0xd6ee('0x2a')],'type':_0x414015[_0xd6ee('0x2b')]['key']};});_0x1578b3[_0xd6ee('0x2c')]=_[_0xd6ee('0x28')](_0xddca,_0xd6ee('0x26'));_0x1578b3['query']=_[_0xd6ee('0x2d')](_0x124ab7[_0xd6ee('0x2e')]);_0x1578b3[_0xd6ee('0x2f')]=_[_0xd6ee('0x30')](_0x1578b3[_0xd6ee('0x2c')],_0x1578b3[_0xd6ee('0x2e')]);_0x5bcdd6['attributes']=_[_0xd6ee('0x30')](_0x1578b3[_0xd6ee('0x2c')],qs[_0xd6ee('0x31')](_0x124ab7[_0xd6ee('0x2e')]['fields']));_0x5bcdd6[_0xd6ee('0x32')]=_0x5bcdd6[_0xd6ee('0x32')][_0xd6ee('0x33')]?_0x5bcdd6['attributes']:_0x1578b3['model'];if(!_0x124ab7[_0xd6ee('0x2e')][_0xd6ee('0x34')](_0xd6ee('0x35'))){_0x5bcdd6[_0xd6ee('0x1b')]=qs[_0xd6ee('0x1b')](_0x124ab7[_0xd6ee('0x2e')][_0xd6ee('0x1b')]);_0x5bcdd6[_0xd6ee('0x1a')]=qs[_0xd6ee('0x1a')](_0x124ab7[_0xd6ee('0x2e')][_0xd6ee('0x1a')]);}_0x5bcdd6[_0xd6ee('0x36')]=qs[_0xd6ee('0x37')](_0x124ab7[_0xd6ee('0x2e')][_0xd6ee('0x37')]);_0x5bcdd6['where']=qs[_0xd6ee('0x2f')](_[_0xd6ee('0x38')](_0x124ab7[_0xd6ee('0x2e')],_0x1578b3['filters']),_0xddca);if(_0x124ab7['query']['filter']){_0x5bcdd6['where']=_[_0xd6ee('0x39')](_0x5bcdd6[_0xd6ee('0x3a')],{'$or':_[_0xd6ee('0x28')](_0xddca,function(_0x2a6d2f){if(_0x2a6d2f[_0xd6ee('0x2b')]!==_0xd6ee('0x3b')){var _0x2c975a={};_0x2c975a[_0x2a6d2f['name']]={'$like':'%'+_0x124ab7[_0xd6ee('0x2e')][_0xd6ee('0x3c')]+'%'};return _0x2c975a;}})});}_0x5bcdd6=_[_0xd6ee('0x39')]({},_0x5bcdd6,_0x124ab7[_0xd6ee('0x3d')]);var _0x407748={'where':_0x5bcdd6[_0xd6ee('0x3a')]};return db[_0xd6ee('0x29')][_0xd6ee('0x1c')](_0x407748)[_0xd6ee('0x21')](function(_0x24a7cb){_0x4580a7['count']=_0x24a7cb;if(_0x124ab7['query']['includeAll']){_0x5bcdd6[_0xd6ee('0x3e')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xd6ee('0x3f')](_0x5bcdd6);})[_0xd6ee('0x21')](function(_0x96aa7f){_0x4580a7[_0xd6ee('0x40')]=_0x96aa7f;return _0x4580a7;})[_0xd6ee('0x21')](respondWithFilteredResult(_0x50b786,_0x5bcdd6))['catch'](handleError(_0x50b786,null));};exports['show']=function(_0x4db1e9,_0x557936){var _0x3337a1={'raw':!![],'where':{'id':_0x4db1e9[_0xd6ee('0x41')]['id']}},_0xf38fc4={};_0xf38fc4[_0xd6ee('0x2c')]=_[_0xd6ee('0x2d')](db[_0xd6ee('0x29')][_0xd6ee('0x42')]);_0xf38fc4[_0xd6ee('0x2e')]=_[_0xd6ee('0x2d')](_0x4db1e9['query']);_0xf38fc4[_0xd6ee('0x2f')]=_[_0xd6ee('0x30')](_0xf38fc4['model'],_0xf38fc4[_0xd6ee('0x2e')]);_0x3337a1['attributes']=_['intersection'](_0xf38fc4[_0xd6ee('0x2c')],qs[_0xd6ee('0x31')](_0x4db1e9[_0xd6ee('0x2e')][_0xd6ee('0x31')]));_0x3337a1[_0xd6ee('0x32')]=_0x3337a1[_0xd6ee('0x32')]['length']?_0x3337a1['attributes']:_0xf38fc4[_0xd6ee('0x2c')];if(_0x4db1e9[_0xd6ee('0x2e')]['includeAll']){_0x3337a1[_0xd6ee('0x3e')]=[{'all':!![]}];}_0x3337a1=_['merge']({},_0x3337a1,_0x4db1e9[_0xd6ee('0x3d')]);return db[_0xd6ee('0x29')][_0xd6ee('0x43')](_0x3337a1)[_0xd6ee('0x21')](handleEntityNotFound(_0x557936,null))[_0xd6ee('0x21')](respondWithResult(_0x557936,null))[_0xd6ee('0x44')](handleError(_0x557936,null));};exports[_0xd6ee('0x45')]=function(_0x1b02c4,_0x37c3ba){return db[_0xd6ee('0x29')][_0xd6ee('0x45')](_0x1b02c4['body'],{})[_0xd6ee('0x21')](respondWithResult(_0x37c3ba,0xc9))[_0xd6ee('0x44')](handleError(_0x37c3ba,null));};exports[_0xd6ee('0x46')]=function(_0x360e34,_0x418680){if(_0x360e34[_0xd6ee('0x47')]['id']){delete _0x360e34[_0xd6ee('0x47')]['id'];}return db[_0xd6ee('0x29')][_0xd6ee('0x43')]({'where':{'id':_0x360e34[_0xd6ee('0x41')]['id']}})[_0xd6ee('0x21')](handleEntityNotFound(_0x418680,null))[_0xd6ee('0x21')](saveUpdates(_0x360e34['body'],null))[_0xd6ee('0x21')](respondWithResult(_0x418680,null))[_0xd6ee('0x44')](handleError(_0x418680,null));};exports[_0xd6ee('0x22')]=function(_0x52dfd3,_0x2f1bef){return db['ChatQueueReport'][_0xd6ee('0x43')]({'where':{'id':_0x52dfd3['params']['id']}})[_0xd6ee('0x21')](handleEntityNotFound(_0x2f1bef,null))[_0xd6ee('0x21')](removeEntity(_0x2f1bef,null))['catch'](handleError(_0x2f1bef,null));};exports[_0xd6ee('0x48')]=function(_0x164df4,_0xaef499){return db['ChatQueueReport'][_0xd6ee('0x48')]()[_0xd6ee('0x21')](respondWithResult(_0xaef499,null))['catch'](handleError(_0xaef499,null));};
\ No newline at end of file
+var _0x1db9=['merge','VIRTUAL','include','findAll','rows','show','keys','includeAll','find','catch','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where'];(function(_0x87506e,_0x5680ec){var _0x5496a4=function(_0x1e29ab){while(--_0x1e29ab){_0x87506e['push'](_0x87506e['shift']());}};_0x5496a4(++_0x5680ec);}(_0x1db9,0x176));var _0x91db=function(_0x589032,_0x34c698){_0x589032=_0x589032-0x0;var _0x2df59c=_0x1db9[_0x589032];return _0x2df59c;};'use strict';var emlformat=require(_0x91db('0x0'));var rimraf=require(_0x91db('0x1'));var zipdir=require(_0x91db('0x2'));var jsonpatch=require(_0x91db('0x3'));var rp=require(_0x91db('0x4'));var moment=require(_0x91db('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x91db('0x6'));var util=require(_0x91db('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x91db('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x91db('0x9'));var squel=require(_0x91db('0xa'));var crypto=require(_0x91db('0xb'));var jsforce=require(_0x91db('0xc'));var deskjs=require(_0x91db('0xd'));var toCsv=require('to-csv');var querystring=require(_0x91db('0xe'));var Papa=require('papaparse');var Redis=require(_0x91db('0xf'));var authService=require(_0x91db('0x10'));var qs=require(_0x91db('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x91db('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x91db('0x13'));var licenseUtil=require(_0x91db('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x540c48,_0x2b9b98){_0x2b9b98=_0x2b9b98||0xcc;return function(_0x329277){if(_0x329277){return _0x540c48[_0x91db('0x15')](_0x2b9b98);}return _0x540c48[_0x91db('0x16')](_0x2b9b98)[_0x91db('0x17')]();};}function respondWithResult(_0x4c3124,_0x371158){_0x371158=_0x371158||0xc8;return function(_0x285052){if(_0x285052){return _0x4c3124[_0x91db('0x16')](_0x371158)[_0x91db('0x18')](_0x285052);}};}function respondWithFilteredResult(_0x2df307,_0x33b39d){return function(_0x260b56){if(_0x260b56){var _0x143bc4=typeof _0x33b39d[_0x91db('0x19')]===_0x91db('0x1a')&&typeof _0x33b39d[_0x91db('0x1b')]===_0x91db('0x1a');var _0x5f5440=_0x260b56[_0x91db('0x1c')];var _0x23d125=_0x143bc4?0x0:_0x33b39d[_0x91db('0x19')];var _0x42e66c=_0x143bc4?_0x260b56[_0x91db('0x1c')]:_0x33b39d[_0x91db('0x19')]+_0x33b39d['limit'];var _0x4ae820;if(_0x42e66c>=_0x5f5440){_0x42e66c=_0x5f5440;_0x4ae820=0xc8;}else{_0x4ae820=0xce;}_0x2df307[_0x91db('0x16')](_0x4ae820);return _0x2df307[_0x91db('0x1d')](_0x91db('0x1e'),_0x23d125+'-'+_0x42e66c+'/'+_0x5f5440)[_0x91db('0x18')](_0x260b56);}return null;};}function patchUpdates(_0x50cf9c){return function(_0x168dea){try{jsonpatch[_0x91db('0x1f')](_0x168dea,_0x50cf9c,!![]);}catch(_0x6e3ca6){return BPromise[_0x91db('0x20')](_0x6e3ca6);}return _0x168dea[_0x91db('0x21')]();};}function saveUpdates(_0x31b96c,_0xaad1f6){return function(_0x8e323f){if(_0x8e323f){return _0x8e323f[_0x91db('0x22')](_0x31b96c)[_0x91db('0x23')](function(_0x554454){return _0x554454;});}return null;};}function removeEntity(_0x58774f,_0x134caa){return function(_0x2ac8d5){if(_0x2ac8d5){return _0x2ac8d5['destroy']()[_0x91db('0x23')](function(){_0x58774f[_0x91db('0x16')](0xcc)[_0x91db('0x17')]();});}};}function handleEntityNotFound(_0x6e3a9c,_0x3729d3){return function(_0x4e2a8f){if(!_0x4e2a8f){_0x6e3a9c['sendStatus'](0x194);}return _0x4e2a8f;};}function handleError(_0x42e53f,_0x2f0b86){_0x2f0b86=_0x2f0b86||0x1f4;return function(_0x329118){logger['error'](_0x329118[_0x91db('0x24')]);if(_0x329118[_0x91db('0x25')]){delete _0x329118[_0x91db('0x25')];}_0x42e53f[_0x91db('0x16')](_0x2f0b86)['send'](_0x329118);};}exports[_0x91db('0x26')]=function(_0x2a00d1,_0x1805ef){var _0x49c504={},_0x2ff6c8={},_0x69fdc2={'count':0x0,'rows':[]};var _0x2d3ebd=_[_0x91db('0x27')](db[_0x91db('0x28')][_0x91db('0x29')],function(_0x2e6a27){return{'name':_0x2e6a27[_0x91db('0x2a')],'type':_0x2e6a27[_0x91db('0x2b')][_0x91db('0x2c')]};});_0x2ff6c8[_0x91db('0x2d')]=_[_0x91db('0x27')](_0x2d3ebd,_0x91db('0x25'));_0x2ff6c8[_0x91db('0x2e')]=_['keys'](_0x2a00d1[_0x91db('0x2e')]);_0x2ff6c8[_0x91db('0x2f')]=_[_0x91db('0x30')](_0x2ff6c8[_0x91db('0x2d')],_0x2ff6c8[_0x91db('0x2e')]);_0x49c504['attributes']=_[_0x91db('0x30')](_0x2ff6c8[_0x91db('0x2d')],qs[_0x91db('0x31')](_0x2a00d1['query'][_0x91db('0x31')]));_0x49c504['attributes']=_0x49c504[_0x91db('0x32')][_0x91db('0x33')]?_0x49c504[_0x91db('0x32')]:_0x2ff6c8[_0x91db('0x2d')];if(!_0x2a00d1['query'][_0x91db('0x34')](_0x91db('0x35'))){_0x49c504[_0x91db('0x1b')]=qs['limit'](_0x2a00d1[_0x91db('0x2e')][_0x91db('0x1b')]);_0x49c504['offset']=qs[_0x91db('0x19')](_0x2a00d1[_0x91db('0x2e')]['offset']);}_0x49c504[_0x91db('0x36')]=qs['sort'](_0x2a00d1[_0x91db('0x2e')][_0x91db('0x37')]);_0x49c504['where']=qs['filters'](_['pick'](_0x2a00d1[_0x91db('0x2e')],_0x2ff6c8[_0x91db('0x2f')]),_0x2d3ebd);if(_0x2a00d1['query'][_0x91db('0x38')]){_0x49c504[_0x91db('0x39')]=_[_0x91db('0x3a')](_0x49c504[_0x91db('0x39')],{'$or':_[_0x91db('0x27')](_0x2d3ebd,function(_0x3cccc7){if(_0x3cccc7[_0x91db('0x2b')]!==_0x91db('0x3b')){var _0xcdc472={};_0xcdc472[_0x3cccc7[_0x91db('0x25')]]={'$like':'%'+_0x2a00d1[_0x91db('0x2e')]['filter']+'%'};return _0xcdc472;}})});}_0x49c504=_[_0x91db('0x3a')]({},_0x49c504,_0x2a00d1['options']);var _0x14de6d={'where':_0x49c504[_0x91db('0x39')]};return db['ChatQueueReport'][_0x91db('0x1c')](_0x14de6d)[_0x91db('0x23')](function(_0x16a7e9){_0x69fdc2[_0x91db('0x1c')]=_0x16a7e9;if(_0x2a00d1[_0x91db('0x2e')]['includeAll']){_0x49c504[_0x91db('0x3c')]=[{'all':!![]}];}return db[_0x91db('0x28')][_0x91db('0x3d')](_0x49c504);})['then'](function(_0x4733a4){_0x69fdc2[_0x91db('0x3e')]=_0x4733a4;return _0x69fdc2;})[_0x91db('0x23')](respondWithFilteredResult(_0x1805ef,_0x49c504))['catch'](handleError(_0x1805ef,null));};exports[_0x91db('0x3f')]=function(_0x2b7830,_0x29831c){var _0x3d73a7={'raw':!![],'where':{'id':_0x2b7830['params']['id']}},_0x3609e1={};_0x3609e1[_0x91db('0x2d')]=_['keys'](db[_0x91db('0x28')][_0x91db('0x29')]);_0x3609e1[_0x91db('0x2e')]=_[_0x91db('0x40')](_0x2b7830[_0x91db('0x2e')]);_0x3609e1[_0x91db('0x2f')]=_[_0x91db('0x30')](_0x3609e1[_0x91db('0x2d')],_0x3609e1[_0x91db('0x2e')]);_0x3d73a7[_0x91db('0x32')]=_[_0x91db('0x30')](_0x3609e1['model'],qs['fields'](_0x2b7830[_0x91db('0x2e')][_0x91db('0x31')]));_0x3d73a7[_0x91db('0x32')]=_0x3d73a7['attributes'][_0x91db('0x33')]?_0x3d73a7[_0x91db('0x32')]:_0x3609e1[_0x91db('0x2d')];if(_0x2b7830[_0x91db('0x2e')][_0x91db('0x41')]){_0x3d73a7['include']=[{'all':!![]}];}_0x3d73a7=_[_0x91db('0x3a')]({},_0x3d73a7,_0x2b7830['options']);return db[_0x91db('0x28')][_0x91db('0x42')](_0x3d73a7)[_0x91db('0x23')](handleEntityNotFound(_0x29831c,null))[_0x91db('0x23')](respondWithResult(_0x29831c,null))[_0x91db('0x43')](handleError(_0x29831c,null));};exports[_0x91db('0x44')]=function(_0x17f7b3,_0xd5a8fb){return db[_0x91db('0x28')]['create'](_0x17f7b3['body'],{})[_0x91db('0x23')](respondWithResult(_0xd5a8fb,0xc9))[_0x91db('0x43')](handleError(_0xd5a8fb,null));};exports[_0x91db('0x22')]=function(_0x410423,_0x27e224){if(_0x410423['body']['id']){delete _0x410423[_0x91db('0x45')]['id'];}return db[_0x91db('0x28')][_0x91db('0x42')]({'where':{'id':_0x410423[_0x91db('0x46')]['id']}})[_0x91db('0x23')](handleEntityNotFound(_0x27e224,null))['then'](saveUpdates(_0x410423[_0x91db('0x45')],null))[_0x91db('0x23')](respondWithResult(_0x27e224,null))[_0x91db('0x43')](handleError(_0x27e224,null));};exports[_0x91db('0x47')]=function(_0x50b269,_0x3d8dfb){return db['ChatQueueReport']['find']({'where':{'id':_0x50b269[_0x91db('0x46')]['id']}})['then'](handleEntityNotFound(_0x3d8dfb,null))[_0x91db('0x23')](removeEntity(_0x3d8dfb,null))['catch'](handleError(_0x3d8dfb,null));};exports['describe']=function(_0x2c30ff,_0x371277){return db[_0x91db('0x28')]['describe']()[_0x91db('0x23')](respondWithResult(_0x371277,null))[_0x91db('0x43')](handleError(_0x371277,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 027976c..4487deb 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 _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x77d0d9,_0x5660b9){var _0x57c5fd=function(_0x1ac780){while(--_0x1ac780){_0x77d0d9['push'](_0x77d0d9['shift']());}};_0x57c5fd(++_0x5660b9);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x2e6448,_0x417d91){var _0xfb736b=function(_0x2b0a86){while(--_0x2b0a86){_0x2e6448['push'](_0x2e6448['shift']());}};_0xfb736b(++_0x417d91);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index c3aada8..ca42ea3 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 _0x99cd=['http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatQueueReport','create','body','raw','CreateChatQueueReport','update','options','attributes','limit','UpdateChatQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x75f270,_0x20ee05){var _0x33bad2=function(_0x4fbc7a){while(--_0x4fbc7a){_0x75f270['push'](_0x75f270['shift']());}};_0x33bad2(++_0x20ee05);}(_0x99cd,0x1df));var _0xd99c=function(_0x581381,_0x3f399e){_0x581381=_0x581381-0x0;var _0x116ed4=_0x99cd[_0x581381];return _0x116ed4;};'use strict';var _=require(_0xd99c('0x0'));var util=require('util');var moment=require(_0xd99c('0x1'));var BPromise=require(_0xd99c('0x2'));var rs=require(_0xd99c('0x3'));var fs=require('fs');var Redis=require(_0xd99c('0x4'));var db=require(_0xd99c('0x5'))['db'];var utils=require(_0xd99c('0x6'));var logger=require(_0xd99c('0x7'))(_0xd99c('0x8'));var config=require(_0xd99c('0x9'));var jayson=require(_0xd99c('0xa'));var client=jayson['client'][_0xd99c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a56d5,_0x26ebac,_0x4b739c){return new BPromise(function(_0x53d8b2,_0x28ea88){return client[_0xd99c('0xc')](_0x4a56d5,_0x4b739c)[_0xd99c('0xd')](function(_0x2bcd16){logger[_0xd99c('0xe')](_0xd99c('0xf'),_0x26ebac,_0xd99c('0x10'));logger[_0xd99c('0x11')](_0xd99c('0x12'),_0x26ebac,_0xd99c('0x10'),JSON[_0xd99c('0x13')](_0x2bcd16));if(_0x2bcd16[_0xd99c('0x14')]){if(_0x2bcd16[_0xd99c('0x14')][_0xd99c('0x15')]===0x1f4){logger['error'](_0xd99c('0xf'),_0x26ebac,_0x2bcd16[_0xd99c('0x14')][_0xd99c('0x16')]);return _0x28ea88(_0x2bcd16[_0xd99c('0x14')][_0xd99c('0x16')]);}logger['error'](_0xd99c('0xf'),_0x26ebac,_0x2bcd16[_0xd99c('0x14')][_0xd99c('0x16')]);return _0x53d8b2(_0x2bcd16[_0xd99c('0x14')][_0xd99c('0x16')]);}else{logger['info'](_0xd99c('0xf'),_0x26ebac,_0xd99c('0x10'));_0x53d8b2(_0x2bcd16[_0xd99c('0x17')][_0xd99c('0x16')]);}})[_0xd99c('0x18')](function(_0x41936e){logger[_0xd99c('0x14')](_0xd99c('0xf'),_0x26ebac,_0x41936e);_0x28ea88(_0x41936e);});});}exports['CreateChatQueueReport']=function(_0x486607){var _0x27db70=this;return new Promise(function(_0x2d98cb,_0xeb2165){return db[_0xd99c('0x19')][_0xd99c('0x1a')](_0x486607[_0xd99c('0x1b')],{'raw':_0x486607['options']?_0x486607['options'][_0xd99c('0x1c')]===undefined?!![]:![]:!![]})[_0xd99c('0xd')](function(_0x271a35){logger[_0xd99c('0xe')](_0xd99c('0x1d'),_0x486607);logger[_0xd99c('0x11')](_0xd99c('0x1d'),_0x486607,JSON[_0xd99c('0x13')](_0x271a35));_0x2d98cb(_0x271a35);})[_0xd99c('0x18')](function(_0x1d84bb){logger[_0xd99c('0x14')](_0xd99c('0x1d'),_0x1d84bb['message'],_0x486607);_0xeb2165(_0x27db70[_0xd99c('0x14')](0x1f4,_0x1d84bb['message']));});});};exports['UpdateChatQueueReport']=function(_0x14ffb8){var _0x2604f1=this;return new Promise(function(_0x547364,_0x4af932){return db['ChatQueueReport'][_0xd99c('0x1e')](_0x14ffb8['body'],{'raw':_0x14ffb8[_0xd99c('0x1f')]?_0x14ffb8[_0xd99c('0x1f')][_0xd99c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14ffb8['options']?_0x14ffb8[_0xd99c('0x1f')]['where']||null:null,'attributes':_0x14ffb8[_0xd99c('0x1f')]?_0x14ffb8[_0xd99c('0x1f')][_0xd99c('0x20')]||null:null,'limit':_0x14ffb8['options']?_0x14ffb8['options'][_0xd99c('0x21')]||null:null})[_0xd99c('0xd')](function(_0x20ce01){logger[_0xd99c('0xe')](_0xd99c('0x22'),_0x14ffb8);logger[_0xd99c('0x11')]('UpdateChatQueueReport',_0x14ffb8,JSON[_0xd99c('0x13')](_0x20ce01));_0x547364(_0x20ce01);})[_0xd99c('0x18')](function(_0x4dbbc){logger['error'](_0xd99c('0x22'),_0x4dbbc[_0xd99c('0x16')],_0x14ffb8);_0x4af932(_0x2604f1['error'](0x1f4,_0x4dbbc[_0xd99c('0x16')]));});});};
\ No newline at end of file
+var _0x0056=['message','catch','CreateChatQueueReport','body','options','raw','stringify','ChatQueueReport','attributes','limit','UpdateChatQueueReport','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x231b2e,_0x2a33f9){var _0x3feb2a=function(_0x5aa472){while(--_0x5aa472){_0x231b2e['push'](_0x231b2e['shift']());}};_0x3feb2a(++_0x2a33f9);}(_0x0056,0xdb));var _0x6005=function(_0x5bc5fe,_0x2afaef){_0x5bc5fe=_0x5bc5fe-0x0;var _0x298ea7=_0x0056[_0x5bc5fe];return _0x298ea7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6005('0x0'));var BPromise=require(_0x6005('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6005('0x2'));var db=require(_0x6005('0x3'))['db'];var utils=require(_0x6005('0x4'));var logger=require(_0x6005('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6005('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ee6d4,_0x377a38,_0x3aef8a){return new BPromise(function(_0x58491d,_0xa09a6b){return client[_0x6005('0x7')](_0x3ee6d4,_0x3aef8a)[_0x6005('0x8')](function(_0x33d361){logger[_0x6005('0x9')](_0x6005('0xa'),_0x377a38,_0x6005('0xb'));logger[_0x6005('0xc')](_0x6005('0xd'),_0x377a38,_0x6005('0xb'),JSON['stringify'](_0x33d361));if(_0x33d361[_0x6005('0xe')]){if(_0x33d361[_0x6005('0xe')]['code']===0x1f4){logger[_0x6005('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x377a38,_0x33d361[_0x6005('0xe')][_0x6005('0xf')]);return _0xa09a6b(_0x33d361[_0x6005('0xe')][_0x6005('0xf')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x377a38,_0x33d361[_0x6005('0xe')][_0x6005('0xf')]);return _0x58491d(_0x33d361[_0x6005('0xe')]['message']);}else{logger[_0x6005('0x9')]('ChatQueueReport,\x20%s,\x20%s',_0x377a38,_0x6005('0xb'));_0x58491d(_0x33d361['result'][_0x6005('0xf')]);}})[_0x6005('0x10')](function(_0x1217f0){logger['error'](_0x6005('0xa'),_0x377a38,_0x1217f0);_0xa09a6b(_0x1217f0);});});}exports[_0x6005('0x11')]=function(_0xf4207a){var _0x4a40c6=this;return new Promise(function(_0x41e7d3,_0x4c0b40){return db['ChatQueueReport']['create'](_0xf4207a[_0x6005('0x12')],{'raw':_0xf4207a[_0x6005('0x13')]?_0xf4207a[_0x6005('0x13')][_0x6005('0x14')]===undefined?!![]:![]:!![]})['then'](function(_0x53c30b){logger[_0x6005('0x9')](_0x6005('0x11'),_0xf4207a);logger[_0x6005('0xc')]('CreateChatQueueReport',_0xf4207a,JSON[_0x6005('0x15')](_0x53c30b));_0x41e7d3(_0x53c30b);})[_0x6005('0x10')](function(_0x213c90){logger[_0x6005('0xe')]('CreateChatQueueReport',_0x213c90[_0x6005('0xf')],_0xf4207a);_0x4c0b40(_0x4a40c6[_0x6005('0xe')](0x1f4,_0x213c90[_0x6005('0xf')]));});});};exports['UpdateChatQueueReport']=function(_0x59f6c9){var _0x3d4d90=this;return new Promise(function(_0x5a8474,_0x4659a4){return db[_0x6005('0x16')]['update'](_0x59f6c9['body'],{'raw':_0x59f6c9[_0x6005('0x13')]?_0x59f6c9[_0x6005('0x13')][_0x6005('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59f6c9['options']?_0x59f6c9[_0x6005('0x13')]['where']||null:null,'attributes':_0x59f6c9[_0x6005('0x13')]?_0x59f6c9[_0x6005('0x13')][_0x6005('0x17')]||null:null,'limit':_0x59f6c9[_0x6005('0x13')]?_0x59f6c9[_0x6005('0x13')][_0x6005('0x18')]||null:null})[_0x6005('0x8')](function(_0x576390){logger[_0x6005('0x9')](_0x6005('0x19'),_0x59f6c9);logger['debug']('UpdateChatQueueReport',_0x59f6c9,JSON['stringify'](_0x576390));_0x5a8474(_0x576390);})['catch'](function(_0x58223c){logger['error']('UpdateChatQueueReport',_0x58223c['message'],_0x59f6c9);_0x4659a4(_0x3d4d90[_0x6005('0xe')](0x1f4,_0x58223c[_0x6005('0xf')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 8de6ab0..5cbe377 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 _0xd73a=['create','put','update','delete','exports','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x896db1,_0x2a0ff9){var _0xc1adb6=function(_0x5608f){while(--_0x5608f){_0x896db1['push'](_0x896db1['shift']());}};_0xc1adb6(++_0x2a0ff9);}(_0xd73a,0xd6));var _0xad73=function(_0x4edac5,_0x41d853){_0x4edac5=_0x4edac5-0x0;var _0x572b3b=_0xd73a[_0x4edac5];return _0x572b3b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xad73('0x0'));var timeout=require(_0xad73('0x1'));var express=require(_0xad73('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xad73('0x3'));var config=require(_0xad73('0x4'));var controller=require(_0xad73('0x5'));router[_0xad73('0x6')]('/',auth[_0xad73('0x7')](),controller[_0xad73('0x8')]);router[_0xad73('0x6')](_0xad73('0x9'),auth[_0xad73('0x7')](),controller[_0xad73('0xa')]);router[_0xad73('0x6')](_0xad73('0xb'),auth[_0xad73('0x7')](),controller[_0xad73('0xc')]);router[_0xad73('0xd')]('/',auth['isAuthenticated'](),controller[_0xad73('0xe')]);router[_0xad73('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xad73('0x10')]);router[_0xad73('0x11')](_0xad73('0xb'),auth[_0xad73('0x7')](),controller['destroy']);module[_0xad73('0x12')]=router;
\ No newline at end of file
+var _0x2631=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','post','create','update','delete','/:id'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2631,0x6a));var _0x1263=function(_0x447fe7,_0x340107){_0x447fe7=_0x447fe7-0x0;var _0x539c72=_0x2631[_0x447fe7];return _0x539c72;};'use strict';var multer=require(_0x1263('0x0'));var util=require(_0x1263('0x1'));var path=require(_0x1263('0x2'));var timeout=require(_0x1263('0x3'));var express=require(_0x1263('0x4'));var router=express[_0x1263('0x5')]();var fs_extra=require(_0x1263('0x6'));var auth=require(_0x1263('0x7'));var interaction=require(_0x1263('0x8'));var config=require(_0x1263('0x9'));var controller=require(_0x1263('0xa'));router[_0x1263('0xb')]('/',auth[_0x1263('0xc')](),controller[_0x1263('0xd')]);router['get'](_0x1263('0xe'),auth['isAuthenticated'](),controller['describe']);router[_0x1263('0xb')]('/:id',auth[_0x1263('0xc')](),controller['show']);router[_0x1263('0xf')]('/',auth[_0x1263('0xc')](),controller[_0x1263('0x10')]);router['put']('/:id',auth[_0x1263('0xc')](),controller[_0x1263('0x11')]);router[_0x1263('0x12')](_0x1263('0x13'),auth[_0x1263('0xc')](),controller[_0x1263('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 4d6dfd8..13145f6 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 _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x597b14,_0x4eadc8){var _0x32dd31=function(_0x388ba3){while(--_0x388ba3){_0x597b14['push'](_0x597b14['shift']());}};_0x32dd31(++_0x4eadc8);}(_0x4b84,0x1cc));var _0x44b8=function(_0x5e7514,_0x30c2e1){_0x5e7514=_0x5e7514-0x0;var _0x12f472=_0x4b84[_0x5e7514];return _0x12f472;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x3ba74d,_0x3e0456){var _0x3bcd85=function(_0x464df6){while(--_0x464df6){_0x3ba74d['push'](_0x3ba74d['shift']());}};_0x3bcd85(++_0x3e0456);}(_0xaa88,0x137));var _0x8aa8=function(_0x5ce15c,_0x19c917){_0x5ce15c=_0x5ce15c-0x0;var _0x36e4f5=_0xaa88[_0x5ce15c];return _0x36e4f5;};'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 8e693cd..ecc89ae 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 _0x23d0=['to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','error','name','send','index','map','ChatTransferReport','rawAttributes','type','key','model','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','include','findAll','catch','params','keys','includeAll','create','body','find','describe','eml-format','fast-json-patch','bluebird','util','path','sox'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x23d0,0xd2));var _0x023d=function(_0x4dea61,_0x3df253){_0x4dea61=_0x4dea61-0x0;var _0x40ec79=_0x23d0[_0x4dea61];return _0x40ec79;};'use strict';var emlformat=require(_0x023d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x023d('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x023d('0x2'));var Mustache=require('mustache');var util=require(_0x023d('0x3'));var path=require(_0x023d('0x4'));var sox=require(_0x023d('0x5'));var csv=require(_0x023d('0x6'));var ejs=require(_0x023d('0x7'));var fs=require('fs');var fs_extra=require(_0x023d('0x8'));var _=require(_0x023d('0x9'));var squel=require(_0x023d('0xa'));var crypto=require(_0x023d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x023d('0xc'));var toCsv=require('to-csv');var querystring=require(_0x023d('0xd'));var Papa=require(_0x023d('0xe'));var Redis=require('ioredis');var authService=require(_0x023d('0xf'));var qs=require(_0x023d('0x10'));var as=require(_0x023d('0x11'));var hardwareService=require(_0x023d('0x12'));var logger=require(_0x023d('0x13'))(_0x023d('0x14'));var utils=require(_0x023d('0x15'));var config=require(_0x023d('0x16'));var licenseUtil=require(_0x023d('0x17'));var db=require(_0x023d('0x18'))['db'];function respondWithStatusCode(_0x3a8dc3,_0x3501a8){_0x3501a8=_0x3501a8||0xcc;return function(_0x58455f){if(_0x58455f){return _0x3a8dc3[_0x023d('0x19')](_0x3501a8);}return _0x3a8dc3[_0x023d('0x1a')](_0x3501a8)[_0x023d('0x1b')]();};}function respondWithResult(_0x2a48bf,_0x203d83){_0x203d83=_0x203d83||0xc8;return function(_0x44cbc3){if(_0x44cbc3){return _0x2a48bf[_0x023d('0x1a')](_0x203d83)[_0x023d('0x1c')](_0x44cbc3);}};}function respondWithFilteredResult(_0x44917a,_0x28e147){return function(_0x1e5d80){if(_0x1e5d80){var _0x5a3f75=typeof _0x28e147[_0x023d('0x1d')]===_0x023d('0x1e')&&typeof _0x28e147[_0x023d('0x1f')]===_0x023d('0x1e');var _0x532baa=_0x1e5d80[_0x023d('0x20')];var _0x64bc7e=_0x5a3f75?0x0:_0x28e147[_0x023d('0x1d')];var _0x259b98=_0x5a3f75?_0x1e5d80[_0x023d('0x20')]:_0x28e147['offset']+_0x28e147[_0x023d('0x1f')];var _0x56408f;if(_0x259b98>=_0x532baa){_0x259b98=_0x532baa;_0x56408f=0xc8;}else{_0x56408f=0xce;}_0x44917a[_0x023d('0x1a')](_0x56408f);return _0x44917a[_0x023d('0x21')]('Content-Range',_0x64bc7e+'-'+_0x259b98+'/'+_0x532baa)[_0x023d('0x1c')](_0x1e5d80);}return null;};}function patchUpdates(_0x1400dc){return function(_0x2bd785){try{jsonpatch['apply'](_0x2bd785,_0x1400dc,!![]);}catch(_0x52374a){return BPromise[_0x023d('0x22')](_0x52374a);}return _0x2bd785[_0x023d('0x23')]();};}function saveUpdates(_0x300961,_0x1cee71){return function(_0x2d4842){if(_0x2d4842){return _0x2d4842[_0x023d('0x24')](_0x300961)[_0x023d('0x25')](function(_0x15d7e5){return _0x15d7e5;});}return null;};}function removeEntity(_0x3ddb97,_0x377fcc){return function(_0xfafac1){if(_0xfafac1){return _0xfafac1['destroy']()[_0x023d('0x25')](function(){_0x3ddb97[_0x023d('0x1a')](0xcc)[_0x023d('0x1b')]();});}};}function handleEntityNotFound(_0x21351e,_0x48bb8a){return function(_0x158fbf){if(!_0x158fbf){_0x21351e[_0x023d('0x19')](0x194);}return _0x158fbf;};}function handleError(_0xd8105f,_0x464b13){_0x464b13=_0x464b13||0x1f4;return function(_0x1aabae){logger[_0x023d('0x26')](_0x1aabae['stack']);if(_0x1aabae[_0x023d('0x27')]){delete _0x1aabae[_0x023d('0x27')];}_0xd8105f[_0x023d('0x1a')](_0x464b13)[_0x023d('0x28')](_0x1aabae);};}exports[_0x023d('0x29')]=function(_0x144ecd,_0x5d9ba8){var _0x2dec2d={},_0x3f1e4a={},_0x330849={'count':0x0,'rows':[]};var _0x5ccc36=_[_0x023d('0x2a')](db[_0x023d('0x2b')][_0x023d('0x2c')],function(_0x12254e){return{'name':_0x12254e['fieldName'],'type':_0x12254e[_0x023d('0x2d')][_0x023d('0x2e')]};});_0x3f1e4a[_0x023d('0x2f')]=_[_0x023d('0x2a')](_0x5ccc36,'name');_0x3f1e4a['query']=_['keys'](_0x144ecd['query']);_0x3f1e4a[_0x023d('0x30')]=_[_0x023d('0x31')](_0x3f1e4a['model'],_0x3f1e4a[_0x023d('0x32')]);_0x2dec2d['attributes']=_[_0x023d('0x31')](_0x3f1e4a['model'],qs[_0x023d('0x33')](_0x144ecd[_0x023d('0x32')][_0x023d('0x33')]));_0x2dec2d[_0x023d('0x34')]=_0x2dec2d[_0x023d('0x34')][_0x023d('0x35')]?_0x2dec2d[_0x023d('0x34')]:_0x3f1e4a['model'];if(!_0x144ecd[_0x023d('0x32')][_0x023d('0x36')](_0x023d('0x37'))){_0x2dec2d[_0x023d('0x1f')]=qs[_0x023d('0x1f')](_0x144ecd[_0x023d('0x32')]['limit']);_0x2dec2d[_0x023d('0x1d')]=qs['offset'](_0x144ecd[_0x023d('0x32')][_0x023d('0x1d')]);}_0x2dec2d[_0x023d('0x38')]=qs['sort'](_0x144ecd['query']['sort']);_0x2dec2d[_0x023d('0x39')]=qs[_0x023d('0x30')](_[_0x023d('0x3a')](_0x144ecd['query'],_0x3f1e4a[_0x023d('0x30')]),_0x5ccc36);if(_0x144ecd['query'][_0x023d('0x3b')]){_0x2dec2d[_0x023d('0x39')]=_[_0x023d('0x3c')](_0x2dec2d[_0x023d('0x39')],{'$or':_[_0x023d('0x2a')](_0x5ccc36,function(_0x691184){if(_0x691184[_0x023d('0x2d')]!=='VIRTUAL'){var _0x3d4b23={};_0x3d4b23[_0x691184['name']]={'$like':'%'+_0x144ecd[_0x023d('0x32')][_0x023d('0x3b')]+'%'};return _0x3d4b23;}})});}_0x2dec2d=_[_0x023d('0x3c')]({},_0x2dec2d,_0x144ecd[_0x023d('0x3d')]);var _0x463e38={'where':_0x2dec2d[_0x023d('0x39')]};return db[_0x023d('0x2b')][_0x023d('0x20')](_0x463e38)[_0x023d('0x25')](function(_0x1dd953){_0x330849[_0x023d('0x20')]=_0x1dd953;if(_0x144ecd[_0x023d('0x32')]['includeAll']){_0x2dec2d[_0x023d('0x3e')]=[{'all':!![]}];}return db[_0x023d('0x2b')][_0x023d('0x3f')](_0x2dec2d);})[_0x023d('0x25')](function(_0x45ffb2){_0x330849['rows']=_0x45ffb2;return _0x330849;})[_0x023d('0x25')](respondWithFilteredResult(_0x5d9ba8,_0x2dec2d))[_0x023d('0x40')](handleError(_0x5d9ba8,null));};exports['show']=function(_0x5ee10b,_0x20b836){var _0x33a7ff={'raw':!![],'where':{'id':_0x5ee10b[_0x023d('0x41')]['id']}},_0x41249a={};_0x41249a[_0x023d('0x2f')]=_['keys'](db[_0x023d('0x2b')][_0x023d('0x2c')]);_0x41249a[_0x023d('0x32')]=_[_0x023d('0x42')](_0x5ee10b['query']);_0x41249a['filters']=_['intersection'](_0x41249a[_0x023d('0x2f')],_0x41249a[_0x023d('0x32')]);_0x33a7ff[_0x023d('0x34')]=_[_0x023d('0x31')](_0x41249a[_0x023d('0x2f')],qs[_0x023d('0x33')](_0x5ee10b[_0x023d('0x32')]['fields']));_0x33a7ff['attributes']=_0x33a7ff['attributes'][_0x023d('0x35')]?_0x33a7ff[_0x023d('0x34')]:_0x41249a[_0x023d('0x2f')];if(_0x5ee10b[_0x023d('0x32')][_0x023d('0x43')]){_0x33a7ff[_0x023d('0x3e')]=[{'all':!![]}];}_0x33a7ff=_[_0x023d('0x3c')]({},_0x33a7ff,_0x5ee10b[_0x023d('0x3d')]);return db[_0x023d('0x2b')]['find'](_0x33a7ff)[_0x023d('0x25')](handleEntityNotFound(_0x20b836,null))['then'](respondWithResult(_0x20b836,null))[_0x023d('0x40')](handleError(_0x20b836,null));};exports['create']=function(_0x1b2141,_0x4a9a90){return db[_0x023d('0x2b')][_0x023d('0x44')](_0x1b2141[_0x023d('0x45')],{})[_0x023d('0x25')](respondWithResult(_0x4a9a90,0xc9))[_0x023d('0x40')](handleError(_0x4a9a90,null));};exports[_0x023d('0x24')]=function(_0x23d1a4,_0x244c88){if(_0x23d1a4[_0x023d('0x45')]['id']){delete _0x23d1a4[_0x023d('0x45')]['id'];}return db['ChatTransferReport'][_0x023d('0x46')]({'where':{'id':_0x23d1a4[_0x023d('0x41')]['id']}})['then'](handleEntityNotFound(_0x244c88,null))[_0x023d('0x25')](saveUpdates(_0x23d1a4[_0x023d('0x45')],null))[_0x023d('0x25')](respondWithResult(_0x244c88,null))[_0x023d('0x40')](handleError(_0x244c88,null));};exports['destroy']=function(_0x494bea,_0x31d850){return db[_0x023d('0x2b')][_0x023d('0x46')]({'where':{'id':_0x494bea[_0x023d('0x41')]['id']}})[_0x023d('0x25')](handleEntityNotFound(_0x31d850,null))[_0x023d('0x25')](removeEntity(_0x31d850,null))[_0x023d('0x40')](handleError(_0x31d850,null));};exports[_0x023d('0x47')]=function(_0xcde993,_0xd80e24){return db[_0x023d('0x2b')][_0x023d('0x47')]()['then'](respondWithResult(_0xd80e24,null))[_0x023d('0x40')](handleError(_0xd80e24,null));};
\ No newline at end of file
+var _0x8972=['lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','error','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','name','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','filter','merge','options','includeAll','findAll','rows','show','params','include','find','create','catch','update','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x319a7a,_0x1d3fef){var _0xd50de4=function(_0x435c1f){while(--_0x435c1f){_0x319a7a['push'](_0x319a7a['shift']());}};_0xd50de4(++_0x1d3fef);}(_0x8972,0xd8));var _0x2897=function(_0x44c7ce,_0x5eea1b){_0x44c7ce=_0x44c7ce-0x0;var _0x2fee57=_0x8972[_0x44c7ce];return _0x2fee57;};'use strict';var emlformat=require(_0x2897('0x0'));var rimraf=require(_0x2897('0x1'));var zipdir=require(_0x2897('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2897('0x3'));var moment=require(_0x2897('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2897('0x5'));var util=require(_0x2897('0x6'));var path=require(_0x2897('0x7'));var sox=require(_0x2897('0x8'));var csv=require(_0x2897('0x9'));var ejs=require(_0x2897('0xa'));var fs=require('fs');var fs_extra=require(_0x2897('0xb'));var _=require(_0x2897('0xc'));var squel=require(_0x2897('0xd'));var crypto=require(_0x2897('0xe'));var jsforce=require(_0x2897('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2897('0x10'));var Papa=require('papaparse');var Redis=require(_0x2897('0x11'));var authService=require(_0x2897('0x12'));var qs=require(_0x2897('0x13'));var as=require(_0x2897('0x14'));var hardwareService=require(_0x2897('0x15'));var logger=require(_0x2897('0x16'))(_0x2897('0x17'));var utils=require('../../config/utils');var config=require(_0x2897('0x18'));var licenseUtil=require(_0x2897('0x19'));var db=require(_0x2897('0x1a'))['db'];function respondWithStatusCode(_0x1e13ea,_0x14bcba){_0x14bcba=_0x14bcba||0xcc;return function(_0x5cc092){if(_0x5cc092){return _0x1e13ea[_0x2897('0x1b')](_0x14bcba);}return _0x1e13ea[_0x2897('0x1c')](_0x14bcba)[_0x2897('0x1d')]();};}function respondWithResult(_0x18d5ce,_0x333dee){_0x333dee=_0x333dee||0xc8;return function(_0x10e536){if(_0x10e536){return _0x18d5ce['status'](_0x333dee)[_0x2897('0x1e')](_0x10e536);}};}function respondWithFilteredResult(_0x476997,_0x36ea56){return function(_0x22e07c){if(_0x22e07c){var _0x3eedaf=typeof _0x36ea56[_0x2897('0x1f')]===_0x2897('0x20')&&typeof _0x36ea56[_0x2897('0x21')]===_0x2897('0x20');var _0x30215c=_0x22e07c['count'];var _0x5298dd=_0x3eedaf?0x0:_0x36ea56[_0x2897('0x1f')];var _0x2e5e07=_0x3eedaf?_0x22e07c[_0x2897('0x22')]:_0x36ea56[_0x2897('0x1f')]+_0x36ea56[_0x2897('0x21')];var _0x531de5;if(_0x2e5e07>=_0x30215c){_0x2e5e07=_0x30215c;_0x531de5=0xc8;}else{_0x531de5=0xce;}_0x476997['status'](_0x531de5);return _0x476997[_0x2897('0x23')](_0x2897('0x24'),_0x5298dd+'-'+_0x2e5e07+'/'+_0x30215c)['json'](_0x22e07c);}return null;};}function patchUpdates(_0x6fa1af){return function(_0x30f920){try{jsonpatch['apply'](_0x30f920,_0x6fa1af,!![]);}catch(_0x3f14ac){return BPromise['reject'](_0x3f14ac);}return _0x30f920[_0x2897('0x25')]();};}function saveUpdates(_0x1929da,_0x2eb70a){return function(_0xcca818){if(_0xcca818){return _0xcca818['update'](_0x1929da)[_0x2897('0x26')](function(_0x576799){return _0x576799;});}return null;};}function removeEntity(_0x21fb77,_0x53de22){return function(_0x59758c){if(_0x59758c){return _0x59758c[_0x2897('0x27')]()[_0x2897('0x26')](function(){_0x21fb77[_0x2897('0x1c')](0xcc)[_0x2897('0x1d')]();});}};}function handleEntityNotFound(_0x4857ff,_0x15a823){return function(_0x56da22){if(!_0x56da22){_0x4857ff['sendStatus'](0x194);}return _0x56da22;};}function handleError(_0x4e62ac,_0x37a20e){_0x37a20e=_0x37a20e||0x1f4;return function(_0x55374f){logger[_0x2897('0x28')](_0x55374f['stack']);if(_0x55374f['name']){delete _0x55374f['name'];}_0x4e62ac['status'](_0x37a20e)[_0x2897('0x29')](_0x55374f);};}exports[_0x2897('0x2a')]=function(_0x942599,_0x84bc74){var _0x3bb17d={},_0x8c4c32={},_0x118288={'count':0x0,'rows':[]};var _0x21579f=_[_0x2897('0x2b')](db[_0x2897('0x2c')][_0x2897('0x2d')],function(_0x2623da){return{'name':_0x2623da[_0x2897('0x2e')],'type':_0x2623da[_0x2897('0x2f')]['key']};});_0x8c4c32['model']=_[_0x2897('0x2b')](_0x21579f,_0x2897('0x30'));_0x8c4c32[_0x2897('0x31')]=_[_0x2897('0x32')](_0x942599[_0x2897('0x31')]);_0x8c4c32[_0x2897('0x33')]=_[_0x2897('0x34')](_0x8c4c32['model'],_0x8c4c32[_0x2897('0x31')]);_0x3bb17d['attributes']=_[_0x2897('0x34')](_0x8c4c32[_0x2897('0x35')],qs['fields'](_0x942599['query'][_0x2897('0x36')]));_0x3bb17d[_0x2897('0x37')]=_0x3bb17d['attributes'][_0x2897('0x38')]?_0x3bb17d[_0x2897('0x37')]:_0x8c4c32[_0x2897('0x35')];if(!_0x942599['query']['hasOwnProperty'](_0x2897('0x39'))){_0x3bb17d[_0x2897('0x21')]=qs['limit'](_0x942599[_0x2897('0x31')][_0x2897('0x21')]);_0x3bb17d[_0x2897('0x1f')]=qs[_0x2897('0x1f')](_0x942599[_0x2897('0x31')][_0x2897('0x1f')]);}_0x3bb17d[_0x2897('0x3a')]=qs[_0x2897('0x3b')](_0x942599[_0x2897('0x31')][_0x2897('0x3b')]);_0x3bb17d[_0x2897('0x3c')]=qs[_0x2897('0x33')](_['pick'](_0x942599['query'],_0x8c4c32[_0x2897('0x33')]),_0x21579f);if(_0x942599[_0x2897('0x31')][_0x2897('0x3d')]){_0x3bb17d[_0x2897('0x3c')]=_[_0x2897('0x3e')](_0x3bb17d[_0x2897('0x3c')],{'$or':_[_0x2897('0x2b')](_0x21579f,function(_0x1a49cd){if(_0x1a49cd[_0x2897('0x2f')]!=='VIRTUAL'){var _0x5ded23={};_0x5ded23[_0x1a49cd['name']]={'$like':'%'+_0x942599[_0x2897('0x31')][_0x2897('0x3d')]+'%'};return _0x5ded23;}})});}_0x3bb17d=_[_0x2897('0x3e')]({},_0x3bb17d,_0x942599[_0x2897('0x3f')]);var _0x2b21af={'where':_0x3bb17d['where']};return db[_0x2897('0x2c')][_0x2897('0x22')](_0x2b21af)[_0x2897('0x26')](function(_0x2dc83a){_0x118288[_0x2897('0x22')]=_0x2dc83a;if(_0x942599[_0x2897('0x31')][_0x2897('0x40')]){_0x3bb17d['include']=[{'all':!![]}];}return db[_0x2897('0x2c')][_0x2897('0x41')](_0x3bb17d);})[_0x2897('0x26')](function(_0x5e6993){_0x118288[_0x2897('0x42')]=_0x5e6993;return _0x118288;})['then'](respondWithFilteredResult(_0x84bc74,_0x3bb17d))['catch'](handleError(_0x84bc74,null));};exports[_0x2897('0x43')]=function(_0x53f349,_0x314bba){var _0x1394dc={'raw':!![],'where':{'id':_0x53f349[_0x2897('0x44')]['id']}},_0x604c4c={};_0x604c4c['model']=_[_0x2897('0x32')](db[_0x2897('0x2c')][_0x2897('0x2d')]);_0x604c4c[_0x2897('0x31')]=_['keys'](_0x53f349[_0x2897('0x31')]);_0x604c4c[_0x2897('0x33')]=_[_0x2897('0x34')](_0x604c4c[_0x2897('0x35')],_0x604c4c[_0x2897('0x31')]);_0x1394dc[_0x2897('0x37')]=_[_0x2897('0x34')](_0x604c4c[_0x2897('0x35')],qs[_0x2897('0x36')](_0x53f349[_0x2897('0x31')][_0x2897('0x36')]));_0x1394dc[_0x2897('0x37')]=_0x1394dc['attributes'][_0x2897('0x38')]?_0x1394dc[_0x2897('0x37')]:_0x604c4c['model'];if(_0x53f349[_0x2897('0x31')][_0x2897('0x40')]){_0x1394dc[_0x2897('0x45')]=[{'all':!![]}];}_0x1394dc=_[_0x2897('0x3e')]({},_0x1394dc,_0x53f349['options']);return db['ChatTransferReport'][_0x2897('0x46')](_0x1394dc)[_0x2897('0x26')](handleEntityNotFound(_0x314bba,null))['then'](respondWithResult(_0x314bba,null))['catch'](handleError(_0x314bba,null));};exports[_0x2897('0x47')]=function(_0x39fd1b,_0x563803){return db[_0x2897('0x2c')][_0x2897('0x47')](_0x39fd1b['body'],{})[_0x2897('0x26')](respondWithResult(_0x563803,0xc9))[_0x2897('0x48')](handleError(_0x563803,null));};exports[_0x2897('0x49')]=function(_0x4b4317,_0x248e51){if(_0x4b4317[_0x2897('0x4a')]['id']){delete _0x4b4317['body']['id'];}return db[_0x2897('0x2c')]['find']({'where':{'id':_0x4b4317[_0x2897('0x44')]['id']}})[_0x2897('0x26')](handleEntityNotFound(_0x248e51,null))['then'](saveUpdates(_0x4b4317[_0x2897('0x4a')],null))[_0x2897('0x26')](respondWithResult(_0x248e51,null))[_0x2897('0x48')](handleError(_0x248e51,null));};exports[_0x2897('0x27')]=function(_0x22a301,_0x52a166){return db['ChatTransferReport']['find']({'where':{'id':_0x22a301[_0x2897('0x44')]['id']}})[_0x2897('0x26')](handleEntityNotFound(_0x52a166,null))['then'](removeEntity(_0x52a166,null))[_0x2897('0x48')](handleError(_0x52a166,null));};exports[_0x2897('0x4b')]=function(_0x49cbed,_0x25f9d9){return db[_0x2897('0x2c')][_0x2897('0x4b')]()['then'](respondWithResult(_0x25f9d9,null))[_0x2897('0x48')](handleError(_0x25f9d9,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 1154eb3..db30f08 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 _0xf807=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xf807,0xae));var _0x7f80=function(_0x23b1d5,_0x3043fa){_0x23b1d5=_0x23b1d5-0x0;var _0x3f5702=_0xf807[_0x23b1d5];return _0x3f5702;};'use strict';var _=require(_0x7f80('0x0'));var util=require(_0x7f80('0x1'));var logger=require(_0x7f80('0x2'))(_0x7f80('0x3'));var moment=require(_0x7f80('0x4'));var BPromise=require(_0x7f80('0x5'));var rp=require(_0x7f80('0x6'));var fs=require('fs');var path=require(_0x7f80('0x7'));var rimraf=require(_0x7f80('0x8'));var config=require(_0x7f80('0x9'));var attributes=require(_0x7f80('0xa'));module[_0x7f80('0xb')]=function(_0x219dfd,_0x5ef10b){return _0x219dfd[_0x7f80('0xc')](_0x7f80('0xd'),attributes,{'tableName':_0x7f80('0xe'),'paranoid':![],'indexes':[{'name':_0x7f80('0xf'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6106=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','lodash','util','../../config/logger'];(function(_0x721852,_0x3fceef){var _0x5d4ed0=function(_0x880af5){while(--_0x880af5){_0x721852['push'](_0x721852['shift']());}};_0x5d4ed0(++_0x3fceef);}(_0x6106,0x129));var _0x6610=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x6106[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0x6610('0x0'));var util=require(_0x6610('0x1'));var logger=require(_0x6610('0x2'))(_0x6610('0x3'));var moment=require(_0x6610('0x4'));var BPromise=require(_0x6610('0x5'));var rp=require(_0x6610('0x6'));var fs=require('fs');var path=require(_0x6610('0x7'));var rimraf=require(_0x6610('0x8'));var config=require(_0x6610('0x9'));var attributes=require(_0x6610('0xa'));module[_0x6610('0xb')]=function(_0x1776ca,_0x51b4e5){return _0x1776ca[_0x6610('0xc')](_0x6610('0xd'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x6610('0xe'),'fields':[_0x6610('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 77cd12b..5dca2fc 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 _0x05db=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x2063e4,_0x444018){var _0x269649=function(_0x5f3121){while(--_0x5f3121){_0x2063e4['push'](_0x2063e4['shift']());}};_0x269649(++_0x444018);}(_0x05db,0x177));var _0xb05d=function(_0x4f3cd1,_0x4b666e){_0x4f3cd1=_0x4f3cd1-0x0;var _0x4f304d=_0x05db[_0x4f3cd1];return _0x4f304d;};'use strict';var _=require(_0xb05d('0x0'));var util=require(_0xb05d('0x1'));var moment=require(_0xb05d('0x2'));var BPromise=require(_0xb05d('0x3'));var rs=require(_0xb05d('0x4'));var fs=require('fs');var Redis=require(_0xb05d('0x5'));var db=require(_0xb05d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb05d('0x7'))(_0xb05d('0x8'));var config=require('../../config/environment');var jayson=require(_0xb05d('0x9'));var client=jayson[_0xb05d('0xa')][_0xb05d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5bd29f,_0x399b9a,_0x47facf){return new BPromise(function(_0x5c7c27,_0x9519b8){return client[_0xb05d('0xc')](_0x5bd29f,_0x47facf)[_0xb05d('0xd')](function(_0x48fa50){logger[_0xb05d('0xe')](_0xb05d('0xf'),_0x399b9a,_0xb05d('0x10'));logger[_0xb05d('0x11')](_0xb05d('0x12'),_0x399b9a,'request\x20sent',JSON[_0xb05d('0x13')](_0x48fa50));if(_0x48fa50[_0xb05d('0x14')]){if(_0x48fa50[_0xb05d('0x14')][_0xb05d('0x15')]===0x1f4){logger[_0xb05d('0x14')](_0xb05d('0xf'),_0x399b9a,_0x48fa50[_0xb05d('0x14')][_0xb05d('0x16')]);return _0x9519b8(_0x48fa50[_0xb05d('0x14')][_0xb05d('0x16')]);}logger[_0xb05d('0x14')]('ChatTransferReport,\x20%s,\x20%s',_0x399b9a,_0x48fa50[_0xb05d('0x14')]['message']);return _0x5c7c27(_0x48fa50[_0xb05d('0x14')]['message']);}else{logger[_0xb05d('0xe')](_0xb05d('0xf'),_0x399b9a,_0xb05d('0x10'));_0x5c7c27(_0x48fa50[_0xb05d('0x17')]['message']);}})[_0xb05d('0x18')](function(_0x177b0d){logger[_0xb05d('0x14')]('ChatTransferReport,\x20%s,\x20%s',_0x399b9a,_0x177b0d);_0x9519b8(_0x177b0d);});});}
\ No newline at end of file
+var _0x0cbb=['info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','then'];(function(_0x1e6659,_0x1f860c){var _0x4d16e4=function(_0x21c05a){while(--_0x21c05a){_0x1e6659['push'](_0x1e6659['shift']());}};_0x4d16e4(++_0x1f860c);}(_0x0cbb,0x16f));var _0xb0cb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0cbb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb0cb('0x0'));var util=require(_0xb0cb('0x1'));var moment=require(_0xb0cb('0x2'));var BPromise=require(_0xb0cb('0x3'));var rs=require(_0xb0cb('0x4'));var fs=require('fs');var Redis=require(_0xb0cb('0x5'));var db=require(_0xb0cb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb0cb('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb0cb('0x8'));var client=jayson[_0xb0cb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c8c76,_0x30244b,_0x3f472d){return new BPromise(function(_0x45d22e,_0x18dc1a){return client['request'](_0x2c8c76,_0x3f472d)[_0xb0cb('0xa')](function(_0x104915){logger[_0xb0cb('0xb')](_0xb0cb('0xc'),_0x30244b,'request\x20sent');logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x30244b,_0xb0cb('0xd'),JSON['stringify'](_0x104915));if(_0x104915[_0xb0cb('0xe')]){if(_0x104915[_0xb0cb('0xe')][_0xb0cb('0xf')]===0x1f4){logger['error'](_0xb0cb('0xc'),_0x30244b,_0x104915['error']['message']);return _0x18dc1a(_0x104915[_0xb0cb('0xe')][_0xb0cb('0x10')]);}logger[_0xb0cb('0xe')](_0xb0cb('0xc'),_0x30244b,_0x104915[_0xb0cb('0xe')][_0xb0cb('0x10')]);return _0x45d22e(_0x104915['error'][_0xb0cb('0x10')]);}else{logger[_0xb0cb('0xb')](_0xb0cb('0xc'),_0x30244b,'request\x20sent');_0x45d22e(_0x104915['result'][_0xb0cb('0x10')]);}})[_0xb0cb('0x11')](function(_0x26f23f){logger['error'](_0xb0cb('0xc'),_0x30244b,_0x26f23f);_0x18dc1a(_0x26f23f);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index ec11ea3..9fe1835 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 _0x2ec1=['index','/describe','describe','/:id','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../config/environment','./chatTransferReport.controller','get'];(function(_0x4c96cd,_0x27292a){var _0xec172c=function(_0x84836d){while(--_0x84836d){_0x4c96cd['push'](_0x4c96cd['shift']());}};_0xec172c(++_0x27292a);}(_0x2ec1,0x1e6));var _0x12ec=function(_0x5e9b84,_0x41bd6f){_0x5e9b84=_0x5e9b84-0x0;var _0x274bd8=_0x2ec1[_0x5e9b84];return _0x274bd8;};'use strict';var multer=require(_0x12ec('0x0'));var util=require(_0x12ec('0x1'));var path=require('path');var timeout=require(_0x12ec('0x2'));var express=require('express');var router=express[_0x12ec('0x3')]();var fs_extra=require(_0x12ec('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x12ec('0x5'));var controller=require(_0x12ec('0x6'));router[_0x12ec('0x7')]('/',auth['isAuthenticated'](),controller[_0x12ec('0x8')]);router[_0x12ec('0x7')](_0x12ec('0x9'),auth['isAuthenticated'](),controller[_0x12ec('0xa')]);router['get'](_0x12ec('0xb'),auth[_0x12ec('0xc')](),controller['show']);router['post']('/',auth[_0x12ec('0xc')](),controller[_0x12ec('0xd')]);router[_0x12ec('0xe')](_0x12ec('0xb'),auth[_0x12ec('0xc')](),controller[_0x12ec('0xf')]);router[_0x12ec('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x12ec('0x11')]);module[_0x12ec('0x12')]=router;
\ No newline at end of file
+var _0xe08f=['post','create','update','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x44989b,_0x1824e8){var _0x1c771c=function(_0xbbfbac){while(--_0xbbfbac){_0x44989b['push'](_0x44989b['shift']());}};_0x1c771c(++_0x1824e8);}(_0xe08f,0x17a));var _0xfe08=function(_0x287af7,_0x241f71){_0x287af7=_0x287af7-0x0;var _0x3dedb8=_0xe08f[_0x287af7];return _0x3dedb8;};'use strict';var multer=require(_0xfe08('0x0'));var util=require(_0xfe08('0x1'));var path=require('path');var timeout=require(_0xfe08('0x2'));var express=require('express');var router=express[_0xfe08('0x3')]();var fs_extra=require(_0xfe08('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xfe08('0x5'));var config=require('../../config/environment');var controller=require(_0xfe08('0x6'));router[_0xfe08('0x7')]('/',auth[_0xfe08('0x8')](),controller['index']);router['get'](_0xfe08('0x9'),auth[_0xfe08('0x8')](),controller[_0xfe08('0xa')]);router[_0xfe08('0x7')](_0xfe08('0xb'),auth[_0xfe08('0x8')](),controller[_0xfe08('0xc')]);router[_0xfe08('0xd')]('/',auth[_0xfe08('0x8')](),controller[_0xfe08('0xe')]);router['put'](_0xfe08('0xb'),auth['isAuthenticated'](),controller[_0xfe08('0xf')]);router['delete'](_0xfe08('0xb'),auth[_0xfe08('0x8')](),controller['destroy']);module[_0xfe08('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 47fe676..780c5bb 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 _0x7378=['stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','email','#011F6A','#ffffff','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','TEXT'];(function(_0x1f7984,_0xb98bd9){var _0x679f60=function(_0x16b213){while(--_0x16b213){_0x1f7984['push'](_0x1f7984['shift']());}};_0x679f60(++_0xb98bd9);}(_0x7378,0x81));var _0x8737=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7378[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x8737('0x0'));module[_0x8737('0x1')]={'name':{'type':Sequelize[_0x8737('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x8737('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x8737('0x3')},'mapKeyOffline':{'type':Sequelize[_0x8737('0x2')],'defaultValue':_0x8737('0x3')},'key':{'type':Sequelize[_0x8737('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x8737('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8737('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x8737('0x2')],'allowNull':![],'defaultValue':_0x8737('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x8737('0x2')],'allowNull':![],'defaultValue':_0x8737('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x8737('0x6')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x8737('0x7')](_0x8737('0x8'),_0x8737('0x9')),'defaultValue':_0x8737('0x8')},'header_online':{'type':Sequelize[_0x8737('0x2')],'defaultValue':_0x8737('0xa')},'start_chat_button':{'type':Sequelize[_0x8737('0x2')],'defaultValue':_0x8737('0xb')},'offline_chat_button':{'type':Sequelize[_0x8737('0x2')],'defaultValue':_0x8737('0xc')},'header_offline':{'type':Sequelize[_0x8737('0x2')],'defaultValue':_0x8737('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x8737('0xe')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x8737('0x2')],'defaultValue':_0x8737('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x8737('0x6')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x8737('0x2')],'defaultValue':_0x8737('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x8737('0x2')],'defaultValue':_0x8737('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x8737('0x2')],'defaultValue':_0x8737('0x12')},'noteTitle':{'type':Sequelize[_0x8737('0x2')],'defaultValue':_0x8737('0x13')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x8737('0x2')],'defaultValue':_0x8737('0x14')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x8737('0xc')},'skipMessageButton':{'type':Sequelize[_0x8737('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x8737('0x6')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x8737('0x6')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x8737('0x2')],'defaultValue':_0x8737('0x15')},'ratingType':{'type':Sequelize['ENUM'](_0x8737('0x16'),'thumb'),'defaultValue':_0x8737('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x8737('0xe')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x8737('0x17')],'defaultValue':function(){return JSON[_0x8737('0x18')]({'items':[{'type':_0x8737('0x19'),'variable':null,'config':{'placeholder':_0x8737('0x1a'),'type':_0x8737('0x1b'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x8737('0x19'),'props':{'title':_0x8737('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x8737('0x3'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x8737('0x1c')](_0x8737('0x1d'))?JSON[_0x8737('0x1e')](this[_0x8737('0x1c')](_0x8737('0x1d'))):{};},'set':function(_0x2a9f99){return this[_0x8737('0x1f')](_0x8737('0x1d'),JSON['stringify'](_0x2a9f99));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x8737('0x19'),'props':{'title':_0x8737('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x8737('0x3'),'type':_0x8737('0x3')},'variable':null},{'type':_0x8737('0x20'),'config':{'placeholder':_0x8737('0x21')},'props':{'title':_0x8737('0x21'),'helpText':_0x8737('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x8737('0x1c')]('offlineForm')?JSON[_0x8737('0x1e')](this[_0x8737('0x1c')](_0x8737('0x23'))):{};},'set':function(_0x58834b){return this['setDataValue']('offlineForm',JSON['stringify'](_0x58834b));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x8737('0x24')]();}},'autoclose':{'type':Sequelize[_0x8737('0x6')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x8737('0x6')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x8737('0x2')]},'forwardOffline':{'type':Sequelize[_0x8737('0x6')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x8737('0x2')],'defaultValue':_0x8737('0x25')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x8737('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x8737('0x2')],'defaultValue':_0x8737('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x8737('0x6')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x8737('0x2')],'defaultValue':_0x8737('0x27')},'skipUnmanaged':{'type':Sequelize[_0x8737('0x2')],'defaultValue':_0x8737('0x28')},'sendUnmanaged':{'type':Sequelize[_0x8737('0x2')],'defaultValue':_0x8737('0xc')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x8737('0x6')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x8737('0x6')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x8737('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x8737('0x29');}},'notificationSound':{'type':Sequelize[_0x8737('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8737('0x6')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x8737('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x8737('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x8737('0x2a')},'verticalAlignment':{'type':Sequelize[_0x8737('0xe')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x8737('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x8737('0x2')],'defaultValue':_0x8737('0x2b')},'defaultTitle':{'type':Sequelize[_0x8737('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x8737('0x2')],'allowNull':![],'defaultValue':_0x8737('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x8737('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x8737('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8737('0xe')],'comment':_0x8737('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x8737('0x6')],'defaultValue':![],'comment':_0x8737('0x2e'),'set':function(_0x410655){if(!_0x410655)this['setDataValue'](_0x8737('0x2f'),null);this[_0x8737('0x1f')](_0x8737('0x30'),_0x410655);}},'vidaooEscalation':{'type':Sequelize[_0x8737('0x6')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x8737('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8737('0x31')},'vidaooNote':{'type':Sequelize[_0x8737('0x2')],'defaultValue':function(){return _0x8737('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x8737('0x17')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x8737('0x6')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x8737('0x17')]}};
\ No newline at end of file
+var _0xead1=['STRING','address','email','Agent','#011F6A','INTEGER','ENUM','rounded','We\x20are\x20here!','Chat','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','Feedback','star','thumb','input','name','text','getDataValue','onlineForm','setDataValue','stringify','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','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}}','website_alias','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports'];(function(_0x4ec6db,_0x393d10){var _0x5b46fc=function(_0x18d087){while(--_0x18d087){_0x4ec6db['push'](_0x4ec6db['shift']());}};_0x5b46fc(++_0x393d10);}(_0xead1,0x129));var _0x1ead=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xead1[_0x4fc9e6];return _0x551d28;};'use strict';var Sequelize=require(_0x1ead('0x0'));var rs=require(_0x1ead('0x1'));module[_0x1ead('0x2')]={'name':{'type':Sequelize[_0x1ead('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x1ead('0x3')],'allowNull':![],'unique':_0x1ead('0x4')},'description':{'type':Sequelize[_0x1ead('0x3')]},'mapKey':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x5')},'mapKeyOffline':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x6')},'customerAlias':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1ead('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1ead('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x1ead('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x1ead('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x1ead('0x9')](_0x1ead('0xa'),'squared'),'defaultValue':_0x1ead('0xa')},'header_online':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0xb')},'start_chat_button':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0xc')},'offline_chat_button':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0xd')},'download_transcript':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x1ead('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x1ead('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x1ead('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x12')},'noteTitle':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x13')},'placeholderMessage':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x14')},'closingMessageButton':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x15')},'skipMessageButton':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x16')},'conditionAgreement':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x17')},'ratingType':{'type':Sequelize[_0x1ead('0x9')](_0x1ead('0x18'),_0x1ead('0x19')),'defaultValue':_0x1ead('0x18')},'ratingStarsNumber':{'type':Sequelize[_0x1ead('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x1ead('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x1ead('0x1a'),'variable':null,'config':{'placeholder':_0x1ead('0x1b'),'type':_0x1ead('0x1c'),'required':!![]},'props':{'title':_0x1ead('0x1b'),'helpText':''}},{'type':_0x1ead('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x1ead('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x1ead('0x1d')]('onlineForm')?JSON['parse'](this[_0x1ead('0x1d')](_0x1ead('0x1e'))):{};},'set':function(_0x5a56b1){return this[_0x1ead('0x1f')]('onlineForm',JSON[_0x1ead('0x20')](_0x5a56b1));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x1ead('0x20')]({'items':[{'type':_0x1ead('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x1ead('0x5'),'type':_0x1ead('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0x1ead('0x21'),'helpText':_0x1ead('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x1ead('0x1d')](_0x1ead('0x23'))?JSON['parse'](this[_0x1ead('0x1d')](_0x1ead('0x23'))):{};},'set':function(_0x244b1a){return this['setDataValue'](_0x1ead('0x23'),JSON[_0x1ead('0x20')](_0x244b1a));}},'token':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x1ead('0x3')]},'waitingTitle':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x24')},'waitingMessage':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x27')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x1ead('0x16')},'sendUnmanaged':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x1ead('0x3')]},'notificationTemplate':{'type':Sequelize[_0x1ead('0x10')],'defaultValue':function(){return _0x1ead('0x28');}},'notificationSound':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0x1ead('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x1ead('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x2a')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x1ead('0x2b')},'defaultTitle':{'type':Sequelize[_0x1ead('0x3')]},'customerAvatar':{'type':Sequelize[_0x1ead('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x1ead('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1ead('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':_0x1ead('0x2c')},'systemAvatar':{'type':Sequelize[_0x1ead('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1ead('0x8')],'comment':_0x1ead('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![],'comment':_0x1ead('0x2e'),'set':function(_0x5645bd){if(!_0x5645bd)this[_0x1ead('0x1f')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x1ead('0x2f'),_0x5645bd);}},'vidaooEscalation':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x1ead('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1ead('0x30')},'vidaooNote':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':function(){return _0x1ead('0x31');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x1ead('0xe')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x1ead('0x10')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 8e03824..2c32eaa 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 _0xbaf0=['userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','update','destroy','get','ChatWebsites','UserProfileResource','end','stack','name','send','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getDispositions','findOne','Disposition','findAll','removeDispositions','ids','addAnswer','ChatWebsiteId','CannedAnswer','length','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','headers','user-agent','getResult','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','Contacts','DESC','Applications','List','account','applications','list','orderBy','priority','asc','ListId','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','x-real-port','browser','format','%s\x20%s','version','unknown','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','lastName','messageId','created','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','mapKeyOffline','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','files','attachments','offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','remove','addInteraction','Contact','Owner','fullname','internal','Tags','Command','iftime\x20%s,%s','interval','timezone','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','../../config/license/util','virtual','License','increment','chatLicenseExceeded','push','all','server/files/chat/iframe.ejs','remote','referer','alignment','verticalAlignment','labelText','textColor','color_button','backgroundColor','addApplications','transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','finally','getApplications','chatProactiveAction','addProactiveActions','omit','getFields','online','false','onlineForm','items','fromKey','Attachments','addAgents','emit','userChatWebsite:save','removeAgents'];(function(_0x55e90e,_0x1f2887){var _0x35553f=function(_0x5289db){while(--_0x5289db){_0x55e90e['push'](_0x55e90e['shift']());}};_0x35553f(++_0x1f2887);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x0baf('0x0'));var util=require(_0x0baf('0x1'));var path=require(_0x0baf('0x2'));var ejs=require(_0x0baf('0x3'));var fs=require('fs');var fs_extra=require(_0x0baf('0x4'));var _=require(_0x0baf('0x5'));var querystring=require('querystring');var Redis=require(_0x0baf('0x6'));var qs=require(_0x0baf('0x7'));var logger=require(_0x0baf('0x8'))(_0x0baf('0x9'));var config=require(_0x0baf('0xa'));var db=require(_0x0baf('0xb'))['db'];config[_0x0baf('0xc')]=_[_0x0baf('0xd')](config[_0x0baf('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x0baf('0xe'))(new Redis(config['redis']));require(_0x0baf('0xf'))[_0x0baf('0x10')](socket);var htmlToText=require(_0x0baf('0x11'));var jayson=require(_0x0baf('0x12'));var client=jayson[_0x0baf('0x13')][_0x0baf('0x14')]({'port':0x232c});var client9002=jayson[_0x0baf('0x13')][_0x0baf('0x14')]({'port':0x232a});var client9003=jayson[_0x0baf('0x13')][_0x0baf('0x14')]({'port':0x232b});var client9001=jayson[_0x0baf('0x13')]['http']({'port':0x2329});function respondWithRpcPromise(_0x5a53e2,_0x465dd7,_0xe4378c,_0x5db689){return new BPromise(function(_0x13df17,_0x5a0583){var _0x2ab33e=_0x5db689||client;return _0x2ab33e['request'](_0x5a53e2,_0xe4378c)[_0x0baf('0x15')](function(_0x1f50c3){logger[_0x0baf('0x16')](_0x0baf('0x17'),_0x465dd7,_0x0baf('0x18'));logger[_0x0baf('0x19')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x465dd7,'request\x20sent',JSON[_0x0baf('0x1a')](_0x1f50c3));if(_0x1f50c3[_0x0baf('0x1b')]){if(_0x1f50c3[_0x0baf('0x1b')][_0x0baf('0x1c')]===0x1f4){logger[_0x0baf('0x1b')](_0x0baf('0x17'),_0x465dd7,_0x1f50c3['error'][_0x0baf('0x1d')]);return _0x5a0583(_0x1f50c3[_0x0baf('0x1b')][_0x0baf('0x1d')]);}logger[_0x0baf('0x1b')](_0x0baf('0x17'),_0x465dd7,_0x1f50c3[_0x0baf('0x1b')]['message']);return _0x13df17(_0x1f50c3['error'][_0x0baf('0x1d')]);}else{logger[_0x0baf('0x16')](_0x0baf('0x17'),_0x465dd7,_0x0baf('0x18'));_0x13df17(_0x1f50c3[_0x0baf('0x1e')][_0x0baf('0x1d')]);}})[_0x0baf('0x1f')](function(_0x636a13){logger[_0x0baf('0x1b')](_0x0baf('0x17'),_0x465dd7,_0x636a13);_0x5a0583(_0x636a13);});});}function respondWithStatusCode(_0x54f2fa,_0x334bd6){_0x334bd6=_0x334bd6||0xcc;return function(_0x482522){if(_0x482522){return _0x54f2fa[_0x0baf('0x20')](_0x334bd6);}return _0x54f2fa['status'](_0x334bd6)['end']();};}function respondWithResult(_0x2ef0aa,_0x48a0e9){_0x48a0e9=_0x48a0e9||0xc8;return function(_0x4be1b9){if(_0x4be1b9){return _0x2ef0aa[_0x0baf('0x21')](_0x48a0e9)[_0x0baf('0x22')](_0x4be1b9);}};}function respondWithFilteredResult(_0x34e264,_0x19d9fd){return function(_0x3a1ba1){if(_0x3a1ba1){var _0x56b299=typeof _0x19d9fd[_0x0baf('0x23')]===_0x0baf('0x24')&&typeof _0x19d9fd[_0x0baf('0x25')]===_0x0baf('0x24');var _0x3843b8=_0x3a1ba1[_0x0baf('0x26')];var _0x453525=_0x56b299?0x0:_0x19d9fd['offset'];var _0x1590b4=_0x56b299?_0x3a1ba1[_0x0baf('0x26')]:_0x19d9fd[_0x0baf('0x23')]+_0x19d9fd[_0x0baf('0x25')];var _0x55c715;if(_0x1590b4>=_0x3843b8){_0x1590b4=_0x3843b8;_0x55c715=0xc8;}else{_0x55c715=0xce;}_0x34e264[_0x0baf('0x21')](_0x55c715);return _0x34e264[_0x0baf('0x27')]('Content-Range',_0x453525+'-'+_0x1590b4+'/'+_0x3843b8)[_0x0baf('0x22')](_0x3a1ba1);}return null;};}function saveUpdates(_0x32e4fb){return function(_0x478ce8){if(_0x478ce8){return _0x478ce8[_0x0baf('0x28')](_0x32e4fb)[_0x0baf('0x15')](function(_0x366924){return _0x366924;});}return null;};}function removeEntity(_0x213a6a){return function(_0x57476f){if(_0x57476f){return _0x57476f[_0x0baf('0x29')]()[_0x0baf('0x15')](function(){var _0x37be4e=_0x57476f[_0x0baf('0x2a')]({'plain':!![]});var _0x24ecee=_0x0baf('0x2b');return db[_0x0baf('0x2c')][_0x0baf('0x29')]({'where':{'type':_0x24ecee,'resourceId':_0x37be4e['id']}})[_0x0baf('0x15')](function(){return _0x57476f;});})[_0x0baf('0x15')](function(){_0x213a6a[_0x0baf('0x21')](0xcc)[_0x0baf('0x2d')]();});}};}function handleEntityNotFound(_0x45294a){return function(_0x3a3353){if(!_0x3a3353){_0x45294a['sendStatus'](0x194);}return _0x3a3353;};}function handleError(_0x2fd426,_0x53ae1d){_0x53ae1d=_0x53ae1d||0x1f4;return function(_0x1aa474){logger[_0x0baf('0x1b')](_0x1aa474[_0x0baf('0x2e')]);if(_0x1aa474[_0x0baf('0x2f')]){delete _0x1aa474['name'];}_0x2fd426[_0x0baf('0x21')](_0x53ae1d)[_0x0baf('0x30')](_0x1aa474);};}exports['index']=function(_0x23d890,_0x2447c2){var _0x62a2ed={'include':[{'model':db[_0x0baf('0x31')],'as':_0x0baf('0x32')}]},_0xbaa9a7={},_0x1f60bd={'count':0x0,'rows':[]};var _0x675461=_['map'](db[_0x0baf('0x33')][_0x0baf('0x34')],function(_0x5b991f){return{'name':_0x5b991f[_0x0baf('0x35')],'type':_0x5b991f['type']['key']};});_0xbaa9a7[_0x0baf('0x36')]=_[_0x0baf('0x37')](_0x675461,'name');_0xbaa9a7['query']=_[_0x0baf('0x38')](_0x23d890[_0x0baf('0x39')]);_0xbaa9a7[_0x0baf('0x3a')]=_[_0x0baf('0x3b')](_0xbaa9a7[_0x0baf('0x36')],_0xbaa9a7[_0x0baf('0x39')]);_0x62a2ed[_0x0baf('0x3c')]=_[_0x0baf('0x3b')](_0xbaa9a7[_0x0baf('0x36')],qs[_0x0baf('0x3d')](_0x23d890[_0x0baf('0x39')][_0x0baf('0x3d')]));_0x62a2ed[_0x0baf('0x3c')]=_0x62a2ed[_0x0baf('0x3c')]['length']?_0x62a2ed[_0x0baf('0x3c')]:_0xbaa9a7[_0x0baf('0x36')];if(!_0x23d890['query'][_0x0baf('0x3e')](_0x0baf('0x3f'))){_0x62a2ed[_0x0baf('0x25')]=qs[_0x0baf('0x25')](_0x23d890[_0x0baf('0x39')][_0x0baf('0x25')]);_0x62a2ed['offset']=qs[_0x0baf('0x23')](_0x23d890[_0x0baf('0x39')]['offset']);}_0x62a2ed[_0x0baf('0x40')]=qs[_0x0baf('0x41')](_0x23d890[_0x0baf('0x39')][_0x0baf('0x41')]);_0x62a2ed['where']=qs[_0x0baf('0x3a')](_[_0x0baf('0x42')](_0x23d890[_0x0baf('0x39')],_0xbaa9a7[_0x0baf('0x3a')]),_0x675461);if(_0x23d890[_0x0baf('0x39')][_0x0baf('0x43')]){_0x62a2ed[_0x0baf('0x44')]=_[_0x0baf('0x45')](_0x62a2ed[_0x0baf('0x44')],{'$or':_[_0x0baf('0x37')](_0x675461,function(_0x56270e){if(_0x56270e[_0x0baf('0x46')]!==_0x0baf('0x47')){var _0x1daf1d={};_0x1daf1d[_0x56270e[_0x0baf('0x2f')]]={'$like':'%'+_0x23d890[_0x0baf('0x39')]['filter']+'%'};return _0x1daf1d;}})});}_0x62a2ed=_[_0x0baf('0x45')]({},_0x62a2ed,_0x23d890[_0x0baf('0x48')]);var _0x27c3ee={'where':_0x62a2ed[_0x0baf('0x44')]};return db[_0x0baf('0x33')]['count'](_0x27c3ee)[_0x0baf('0x15')](function(_0x85bedb){_0x1f60bd[_0x0baf('0x26')]=_0x85bedb;if(_0x23d890[_0x0baf('0x39')][_0x0baf('0x49')]){_0x62a2ed[_0x0baf('0x4a')]=[{'all':!![]}];}return db[_0x0baf('0x33')]['findAll'](_0x62a2ed);})[_0x0baf('0x15')](function(_0x167fb8){_0x1f60bd[_0x0baf('0x4b')]=_0x167fb8;return _0x1f60bd;})['then'](respondWithFilteredResult(_0x2447c2,_0x62a2ed))[_0x0baf('0x1f')](handleError(_0x2447c2,null));};exports[_0x0baf('0x4c')]=function(_0x10fa62,_0x3fabec){var _0x204d77={'raw':![],'where':{'id':_0x10fa62[_0x0baf('0x4d')]['id']},'include':[{'model':db['Pause'],'as':_0x0baf('0x32')}]},_0x1b71a3={};_0x1b71a3[_0x0baf('0x36')]=_[_0x0baf('0x38')](db[_0x0baf('0x33')][_0x0baf('0x34')]);_0x1b71a3[_0x0baf('0x39')]=_[_0x0baf('0x38')](_0x10fa62[_0x0baf('0x39')]);_0x1b71a3[_0x0baf('0x3a')]=_[_0x0baf('0x3b')](_0x1b71a3[_0x0baf('0x36')],_0x1b71a3['query']);_0x204d77['attributes']=_[_0x0baf('0x3b')](_0x1b71a3[_0x0baf('0x36')],qs[_0x0baf('0x3d')](_0x10fa62[_0x0baf('0x39')][_0x0baf('0x3d')]));_0x204d77[_0x0baf('0x3c')]=_0x204d77[_0x0baf('0x3c')]['length']?_0x204d77[_0x0baf('0x3c')]:_0x1b71a3[_0x0baf('0x36')];if(_0x10fa62[_0x0baf('0x39')][_0x0baf('0x49')]){_0x204d77[_0x0baf('0x4a')]=[{'all':!![]}];}_0x204d77=_[_0x0baf('0x45')]({},_0x204d77,_0x10fa62['options']);return db[_0x0baf('0x33')]['find'](_0x204d77)[_0x0baf('0x15')](handleEntityNotFound(_0x3fabec,null))['then'](respondWithResult(_0x3fabec,null))[_0x0baf('0x1f')](handleError(_0x3fabec,null));};exports['create']=function(_0x35b1a5,_0x4c035b){return db[_0x0baf('0x33')][_0x0baf('0x4e')](_0x35b1a5[_0x0baf('0x4f')],{})[_0x0baf('0x15')](function(_0x42a68b){var _0x576475=_0x35b1a5[_0x0baf('0x50')][_0x0baf('0x2a')]({'plain':!![]});if(!_0x576475)throw new Error(_0x0baf('0x51'));if(_0x576475[_0x0baf('0x52')]===_0x0baf('0x50')){var _0xa19b21=_0x42a68b['get']({'plain':!![]});var _0x402f4d=_0x0baf('0x2b');return db[_0x0baf('0x53')][_0x0baf('0x54')]({'where':{'name':_0x402f4d,'userProfileId':_0x576475[_0x0baf('0x55')]},'raw':!![]})[_0x0baf('0x15')](function(_0x3834a2){if(_0x3834a2&&_0x3834a2['autoAssociation']===0x0){return db['UserProfileResource'][_0x0baf('0x4e')]({'name':_0xa19b21[_0x0baf('0x2f')],'resourceId':_0xa19b21['id'],'type':_0x3834a2[_0x0baf('0x2f')],'sectionId':_0x3834a2['id']},{})[_0x0baf('0x15')](function(){return _0x42a68b;});}else{return _0x42a68b;}})[_0x0baf('0x1f')](function(_0x35221e){logger[_0x0baf('0x1b')](_0x0baf('0x56'),_0x35221e);throw _0x35221e;});}return _0x42a68b;})[_0x0baf('0x15')](respondWithResult(_0x4c035b,0xc9))['catch'](handleError(_0x4c035b,null));};exports[_0x0baf('0x28')]=function(_0x268be8,_0x3c2d03){if(_0x268be8[_0x0baf('0x4f')]['id']){delete _0x268be8[_0x0baf('0x4f')]['id'];}return db[_0x0baf('0x33')][_0x0baf('0x54')]({'where':{'id':_0x268be8['params']['id']},'include':[{'model':db[_0x0baf('0x31')],'as':_0x0baf('0x32')}]})[_0x0baf('0x15')](handleEntityNotFound(_0x3c2d03,null))[_0x0baf('0x15')](saveUpdates(_0x268be8[_0x0baf('0x4f')],null))[_0x0baf('0x15')](respondWithResult(_0x3c2d03,null))[_0x0baf('0x1f')](handleError(_0x3c2d03,null));};exports[_0x0baf('0x29')]=function(_0x498405,_0x178495){return db['ChatWebsite'][_0x0baf('0x54')]({'where':{'id':_0x498405['params']['id']}})['then'](handleEntityNotFound(_0x178495,null))[_0x0baf('0x15')](removeEntity(_0x178495,null))['catch'](handleError(_0x178495,null));};exports[_0x0baf('0x57')]=function(_0x2b17f8,_0x49d713){return db[_0x0baf('0x33')][_0x0baf('0x57')]()[_0x0baf('0x15')](respondWithResult(_0x49d713,null))['catch'](handleError(_0x49d713,null));};exports['addDisposition']=function(_0x2438df,_0x7e8946){if(_0x2438df[_0x0baf('0x4f')]['id']){delete _0x2438df[_0x0baf('0x4f')]['id'];}return db[_0x0baf('0x33')]['find']({'where':{'id':_0x2438df[_0x0baf('0x4d')]['id']}})['then'](handleEntityNotFound(_0x7e8946,null))['then'](function(_0x59a0b2){if(_0x59a0b2){_0x2438df[_0x0baf('0x4f')]['ChatWebsiteId']=_0x59a0b2['id'];return db['Disposition'][_0x0baf('0x4e')](_0x2438df[_0x0baf('0x4f')]);}})[_0x0baf('0x15')](respondWithResult(_0x7e8946,null))[_0x0baf('0x1f')](handleError(_0x7e8946,null));};exports[_0x0baf('0x58')]=function(_0x27ddc7,_0x4c05d6){var _0xec3b32={'raw':![],'where':{}};var _0x1a0a67={};var _0x185473={'count':0x0,'rows':[]};return db[_0x0baf('0x33')][_0x0baf('0x59')]({'where':{'id':_0x27ddc7[_0x0baf('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4c05d6,null))[_0x0baf('0x15')](function(_0x468363){if(_0x468363){_0x1a0a67[_0x0baf('0x36')]=_['keys'](db[_0x0baf('0x5a')][_0x0baf('0x34')]);_0x1a0a67[_0x0baf('0x39')]=_[_0x0baf('0x38')](_0x27ddc7[_0x0baf('0x39')]);_0x1a0a67[_0x0baf('0x3a')]=_[_0x0baf('0x3b')](_0x1a0a67['model'],_0x1a0a67['query']);_0xec3b32['attributes']=_[_0x0baf('0x3b')](_0x1a0a67[_0x0baf('0x36')],qs[_0x0baf('0x3d')](_0x27ddc7[_0x0baf('0x39')][_0x0baf('0x3d')]));_0xec3b32[_0x0baf('0x3c')]=_0xec3b32['attributes']['length']?_0xec3b32[_0x0baf('0x3c')]:_0x1a0a67['model'];if(!_0x27ddc7[_0x0baf('0x39')][_0x0baf('0x3e')]('nolimit')){_0xec3b32[_0x0baf('0x25')]=qs[_0x0baf('0x25')](_0x27ddc7[_0x0baf('0x39')][_0x0baf('0x25')]);_0xec3b32[_0x0baf('0x23')]=qs[_0x0baf('0x23')](_0x27ddc7[_0x0baf('0x39')][_0x0baf('0x23')]);}_0xec3b32[_0x0baf('0x40')]=qs['sort'](_0x27ddc7['query']['sort']);_0xec3b32['where']=qs['filters'](_[_0x0baf('0x42')](_0x27ddc7[_0x0baf('0x39')],_0x1a0a67[_0x0baf('0x3a')]));_0xec3b32[_0x0baf('0x44')]['ChatWebsiteId']=_0x468363['id'];if(_0x27ddc7[_0x0baf('0x39')][_0x0baf('0x43')]){_0xec3b32['where']=_['merge'](_0xec3b32[_0x0baf('0x44')],{'$or':_[_0x0baf('0x37')](_0xec3b32[_0x0baf('0x3c')],function(_0x442e5f){var _0x30b35e={};_0x30b35e[_0x442e5f]={'$like':'%'+_0x27ddc7[_0x0baf('0x39')][_0x0baf('0x43')]+'%'};return _0x30b35e;})});}_0xec3b32=_[_0x0baf('0x45')]({},_0xec3b32,_0x27ddc7['options']);return db[_0x0baf('0x5a')][_0x0baf('0x26')]({'where':_0xec3b32['where']})[_0x0baf('0x15')](function(_0x2db4ec){_0x185473['count']=_0x2db4ec;if(_0x27ddc7[_0x0baf('0x39')][_0x0baf('0x49')]){_0xec3b32[_0x0baf('0x4a')]=[{'all':!![]}];}return db[_0x0baf('0x5a')][_0x0baf('0x5b')](_0xec3b32);})['then'](function(_0x4807fc){_0x185473[_0x0baf('0x4b')]=_0x4807fc;return _0x185473;});}})[_0x0baf('0x15')](respondWithFilteredResult(_0x4c05d6,_0xec3b32))['catch'](handleError(_0x4c05d6,null));};exports[_0x0baf('0x5c')]=function(_0x59dad5,_0x21ad25){return db['ChatWebsite'][_0x0baf('0x54')]({'where':{'id':_0x59dad5[_0x0baf('0x4d')]['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x21ad25,null))['then'](function(_0x3c2bc1){if(_0x3c2bc1){return _0x3c2bc1['removeDispositions'](_0x59dad5[_0x0baf('0x39')][_0x0baf('0x5d')]);}})[_0x0baf('0x15')](respondWithStatusCode(_0x21ad25,null))[_0x0baf('0x1f')](handleError(_0x21ad25,null));};exports[_0x0baf('0x5e')]=function(_0x52e845,_0x866e6e){if(_0x52e845[_0x0baf('0x4f')]['id']){delete _0x52e845['body']['id'];}return db[_0x0baf('0x33')][_0x0baf('0x54')]({'where':{'id':_0x52e845[_0x0baf('0x4d')]['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x866e6e,null))[_0x0baf('0x15')](function(_0x250df2){if(_0x250df2){_0x52e845[_0x0baf('0x4f')][_0x0baf('0x5f')]=_0x250df2['id'];return db[_0x0baf('0x60')][_0x0baf('0x4e')](_0x52e845[_0x0baf('0x4f')]);}})[_0x0baf('0x15')](respondWithResult(_0x866e6e,null))['catch'](handleError(_0x866e6e,null));};exports['getAnswers']=function(_0x29a036,_0x322a09){var _0x384c29={'raw':![],'where':{}};var _0x52f267={};var _0x507783={'count':0x0,'rows':[]};return db[_0x0baf('0x33')][_0x0baf('0x59')]({'where':{'id':_0x29a036[_0x0baf('0x4d')]['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x322a09,null))[_0x0baf('0x15')](function(_0x3033c8){if(_0x3033c8){_0x52f267[_0x0baf('0x36')]=_[_0x0baf('0x38')](db[_0x0baf('0x60')]['rawAttributes']);_0x52f267[_0x0baf('0x39')]=_[_0x0baf('0x38')](_0x29a036[_0x0baf('0x39')]);_0x52f267[_0x0baf('0x3a')]=_['intersection'](_0x52f267['model'],_0x52f267['query']);_0x384c29[_0x0baf('0x3c')]=_[_0x0baf('0x3b')](_0x52f267['model'],qs['fields'](_0x29a036[_0x0baf('0x39')][_0x0baf('0x3d')]));_0x384c29['attributes']=_0x384c29[_0x0baf('0x3c')][_0x0baf('0x61')]?_0x384c29[_0x0baf('0x3c')]:_0x52f267[_0x0baf('0x36')];if(!_0x29a036[_0x0baf('0x39')][_0x0baf('0x3e')](_0x0baf('0x3f'))){_0x384c29[_0x0baf('0x25')]=qs[_0x0baf('0x25')](_0x29a036[_0x0baf('0x39')][_0x0baf('0x25')]);_0x384c29[_0x0baf('0x23')]=qs['offset'](_0x29a036[_0x0baf('0x39')][_0x0baf('0x23')]);}_0x384c29[_0x0baf('0x40')]=qs[_0x0baf('0x41')](_0x29a036[_0x0baf('0x39')][_0x0baf('0x41')]);_0x384c29['where']=qs[_0x0baf('0x3a')](_[_0x0baf('0x42')](_0x29a036[_0x0baf('0x39')],_0x52f267[_0x0baf('0x3a')]));_0x384c29[_0x0baf('0x44')]['ChatWebsiteId']=_0x3033c8['id'];if(_0x29a036[_0x0baf('0x39')][_0x0baf('0x43')]){_0x384c29[_0x0baf('0x44')]=_[_0x0baf('0x45')](_0x384c29[_0x0baf('0x44')],{'$or':_['map'](_0x384c29['attributes'],function(_0xb5f4e5){var _0x5a2454={};_0x5a2454[_0xb5f4e5]={'$like':'%'+_0x29a036[_0x0baf('0x39')]['filter']+'%'};return _0x5a2454;})});}_0x384c29=_[_0x0baf('0x45')]({},_0x384c29,_0x29a036[_0x0baf('0x48')]);return db[_0x0baf('0x60')][_0x0baf('0x26')]({'where':_0x384c29['where']})[_0x0baf('0x15')](function(_0x106ffa){_0x507783[_0x0baf('0x26')]=_0x106ffa;if(_0x29a036['query']['includeAll']){_0x384c29['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x0baf('0x5b')](_0x384c29);})[_0x0baf('0x15')](function(_0x2b7f13){_0x507783[_0x0baf('0x4b')]=_0x2b7f13;return _0x507783;});}})['then'](respondWithFilteredResult(_0x322a09,_0x384c29))[_0x0baf('0x1f')](handleError(_0x322a09,null));};exports[_0x0baf('0x62')]=function(_0x1843eb,_0x4b4ef8){return db[_0x0baf('0x33')][_0x0baf('0x54')]({'where':{'id':_0x1843eb['params']['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x4b4ef8,null))['then'](function(_0x8a0a1b){if(_0x8a0a1b){return _0x8a0a1b[_0x0baf('0x62')](_0x1843eb[_0x0baf('0x39')][_0x0baf('0x5d')]);}})['then'](respondWithStatusCode(_0x4b4ef8,null))['catch'](handleError(_0x4b4ef8,null));};exports[_0x0baf('0x63')]=function(_0x4e1a7e,_0x3b4ae3){_0x4e1a7e[_0x0baf('0x4f')][_0x0baf('0x64')]=_0x4e1a7e[_0x0baf('0x65')][_0x0baf('0x66')];return db['ChatWebsite'][_0x0baf('0x54')]({'where':{'id':_0x4e1a7e['params']['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x3b4ae3,null))['then'](saveUpdates(_0x4e1a7e[_0x0baf('0x4f')],null))['then'](respondWithResult(_0x3b4ae3,null))[_0x0baf('0x1f')](handleError(_0x3b4ae3,null));};exports[_0x0baf('0x67')]=function(_0x443f62,_0x5033f3){_0x443f62['body'][_0x0baf('0x68')]=_0x443f62[_0x0baf('0x65')][_0x0baf('0x66')];return db[_0x0baf('0x33')][_0x0baf('0x54')]({'where':{'id':_0x443f62[_0x0baf('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5033f3,null))[_0x0baf('0x15')](saveUpdates(_0x443f62['body'],null))[_0x0baf('0x15')](respondWithResult(_0x5033f3,null))['catch'](handleError(_0x5033f3,null));};exports[_0x0baf('0x69')]=function(_0x4df797,_0x30f32b){_0x4df797['body'][_0x0baf('0x6a')]=_0x4df797[_0x0baf('0x65')]['filename'];return db['ChatWebsite'][_0x0baf('0x54')]({'where':{'id':_0x4df797[_0x0baf('0x4d')]['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x30f32b,null))[_0x0baf('0x15')](saveUpdates(_0x4df797['body'],null))['then'](respondWithResult(_0x30f32b,null))[_0x0baf('0x1f')](handleError(_0x30f32b,null));};exports[_0x0baf('0x6b')]=function(_0x116d52,_0x2c7417){_0x116d52[_0x0baf('0x4f')][_0x0baf('0x6c')]=_0x116d52[_0x0baf('0x65')][_0x0baf('0x66')];return db[_0x0baf('0x33')][_0x0baf('0x54')]({'where':{'id':_0x116d52['params']['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x2c7417,null))['then'](saveUpdates(_0x116d52[_0x0baf('0x4f')],null))[_0x0baf('0x15')](respondWithResult(_0x2c7417,null))[_0x0baf('0x1f')](handleError(_0x2c7417,null));};exports[_0x0baf('0x6d')]=function(_0x4d7d29,_0x227fbd){var _0x647233=path[_0x0baf('0x6e')](config[_0x0baf('0x6f')],_0x0baf('0x70'));var _0x2c2b77={'where':{'id':_0x4d7d29[_0x0baf('0x4d')]['id']},'attributes':['id',_0x0baf('0x64')],'raw':!![]};var _0xb61593=![];return require('../../config/license/util')[_0x0baf('0x71')]()[_0x0baf('0x15')](function(_0x4d501e){if(_0x4d501e){_0xb61593=_0x4d501e[_0x0baf('0x72')];}})[_0x0baf('0x15')](function(){return db[_0x0baf('0x33')][_0x0baf('0x54')](_0x2c2b77);})[_0x0baf('0x15')](handleEntityNotFound(_0x227fbd,null))[_0x0baf('0x15')](function(_0x3c5654){if(_0x3c5654){if(!_[_0x0baf('0x73')](_0x3c5654[_0x0baf('0x64')])){if(fs['existsSync'](path[_0x0baf('0x6e')](config[_0x0baf('0x6f')],_0x0baf('0x74'),_0x3c5654[_0x0baf('0x64')]))&&_0xb61593){_0x647233=path[_0x0baf('0x6e')](config[_0x0baf('0x6f')],'server/files/images/logos/',_0x3c5654[_0x0baf('0x64')]);}}return _0x227fbd[_0x0baf('0x75')](_0x647233);}})[_0x0baf('0x1f')](handleError(_0x227fbd,null));};exports['getAvatar']=function(_0x49855a,_0x5adbd9){var _0x1adb84=path[_0x0baf('0x6e')](config['root'],_0x0baf('0x76'));var _0x577536={'where':{'id':_0x49855a[_0x0baf('0x4d')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x0baf('0x33')][_0x0baf('0x54')](_0x577536)['then'](handleEntityNotFound(_0x5adbd9,null))[_0x0baf('0x15')](function(_0x290686){if(_0x290686){if(!_[_0x0baf('0x73')](_0x290686[_0x0baf('0x68')])){if(fs[_0x0baf('0x77')](path[_0x0baf('0x6e')](config[_0x0baf('0x6f')],'server/files/images/avatars/',_0x290686[_0x0baf('0x68')]))){_0x1adb84=path[_0x0baf('0x6e')](config[_0x0baf('0x6f')],_0x0baf('0x78'),_0x290686[_0x0baf('0x68')]);}}return _0x5adbd9[_0x0baf('0x75')](_0x1adb84);}})[_0x0baf('0x1f')](handleError(_0x5adbd9,null));};exports[_0x0baf('0x79')]=function(_0x4415c2,_0x46103a){var _0x308b3f=path[_0x0baf('0x6e')](config[_0x0baf('0x6f')],_0x0baf('0x7a'));var _0x59dd6c={'where':{'id':_0x4415c2['params']['id']},'attributes':['id',_0x0baf('0x6a'),_0x0baf('0x7b')],'raw':!![]};return db[_0x0baf('0x33')][_0x0baf('0x54')](_0x59dd6c)['then'](handleEntityNotFound(_0x46103a,null))[_0x0baf('0x15')](function(_0xc6c049){if(_0xc6c049){if(!_[_0x0baf('0x73')](_0xc6c049[_0x0baf('0x6a')])){if(fs[_0x0baf('0x77')](path[_0x0baf('0x6e')](config['root'],_0x0baf('0x78'),_0xc6c049[_0x0baf('0x6a')]))&&_0xc6c049[_0x0baf('0x7b')]){_0x308b3f=path['join'](config[_0x0baf('0x6f')],_0x0baf('0x78'),_0xc6c049[_0x0baf('0x6a')]);}}return _0x46103a['download'](_0x308b3f);}})['catch'](handleError(_0x46103a,null));};exports['getSystemAvatar']=function(_0x11a85a,_0x51c895){var _0x2f0104=path[_0x0baf('0x6e')](config['root'],_0x0baf('0x7c'));var _0x5b5cd5={'where':{'id':_0x11a85a['params']['id']},'attributes':['id',_0x0baf('0x6c')],'raw':!![]};return db['ChatWebsite'][_0x0baf('0x54')](_0x5b5cd5)['then'](handleEntityNotFound(_0x51c895,null))['then'](function(_0x56c377){if(_0x56c377){if(!_[_0x0baf('0x73')](_0x56c377[_0x0baf('0x6c')])){if(fs[_0x0baf('0x77')](path[_0x0baf('0x6e')](config[_0x0baf('0x6f')],_0x0baf('0x78'),_0x56c377[_0x0baf('0x6c')]))){_0x2f0104=path['join'](config[_0x0baf('0x6f')],_0x0baf('0x78'),_0x56c377[_0x0baf('0x6c')]);}}return _0x51c895['download'](_0x2f0104);}})[_0x0baf('0x1f')](handleError(_0x51c895,null));};exports[_0x0baf('0x7d')]=function(_0x12311d,_0x52c7f7){var _0x25eccd=require('user-agent-parser');var _0x235bd5=new _0x25eccd();var _0x12ff07=_0x235bd5['setUA'](_0x12311d[_0x0baf('0x7e')][_0x0baf('0x7f')])[_0x0baf('0x80')]();var _0x1805ff={'body':_0x12311d['body'],'channel':_0x0baf('0x81')};var _0x39eb13=[];var _0x4d4eab=[];var _0x5054f9={};var _0x1ac8eb=![];return db[_0x0baf('0x82')][_0x0baf('0x57')]()[_0x0baf('0x15')](function(_0x4d4a7f){if(!_0x4d4a7f){throw new db['Sequelize'][(_0x0baf('0x83'))](_0x0baf('0x84'));}_0x39eb13=_[_0x0baf('0x85')](_[_0x0baf('0x38')](_0x4d4a7f),[_0x0baf('0x86'),'updatedAt']);_0x4d4eab=_[_0x0baf('0x85')](_[_0x0baf('0x38')](_0x4d4a7f),['createdAt',_0x0baf('0x87'),_0x0baf('0x88'),'ListId']);if(_0x12311d[_0x0baf('0x4f')]['id']){delete _0x12311d[_0x0baf('0x4f')]['id'];}if(_[_0x0baf('0x73')](_0x12311d[_0x0baf('0x4f')][_0x0baf('0x89')])){throw new db[(_0x0baf('0x8a'))][(_0x0baf('0x83'))](_0x0baf('0x8b'));}if(_['isNil'](_0x12311d[_0x0baf('0x4f')][_0x0baf('0x4f')])||_0x12311d[_0x0baf('0x4f')][_0x0baf('0x4f')]===''){throw new db['Sequelize'][(_0x0baf('0x83'))](_0x0baf('0x8c'));}if(_['isNil'](_0x12311d[_0x0baf('0x4f')][_0x0baf('0x8d')])){throw new db[(_0x0baf('0x8a'))][(_0x0baf('0x83'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4d4eab);}if(!_[_0x0baf('0x8e')](_0x4d4eab,_0x12311d[_0x0baf('0x4f')][_0x0baf('0x8d')])){throw new db[(_0x0baf('0x8a'))][(_0x0baf('0x83'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4d4eab);}_0x5054f9[_0x12311d[_0x0baf('0x4f')][_0x0baf('0x8d')]]=_0x12311d[_0x0baf('0x4f')]['from'];})[_0x0baf('0x15')](function(){return db[_0x0baf('0x33')][_0x0baf('0x54')]({'where':{'id':_0x12311d[_0x0baf('0x4d')]['id']},'include':[{'model':db[_0x0baf('0x8f')],'as':'List','include':[{'model':db['CmContact'],'as':_0x0baf('0x90'),'where':_0x5054f9,'limit':0x1,'order':[[_0x0baf('0x87'),_0x0baf('0x91')]]}]},{'model':db['ChatApplication'],'as':_0x0baf('0x92')}]});})[_0x0baf('0x15')](handleEntityNotFound(_0x52c7f7,null))[_0x0baf('0x15')](function(_0x3cfb49){if(_0x3cfb49&&_0x3cfb49[_0x0baf('0x93')]){_0x1805ff[_0x0baf('0x94')]=_0x3cfb49;_0x1805ff[_0x0baf('0x95')]=_0x3cfb49[_0x0baf('0x92')];_0x1805ff[_0x0baf('0x96')]=_0x3cfb49[_0x0baf('0x93')];_0x1805ff['applications']=_[_0x0baf('0x97')](_0x1805ff[_0x0baf('0x95')],[_0x0baf('0x98')],[_0x0baf('0x99')]);if(_0x1805ff['account'][_0x0baf('0x92')]){delete _0x1805ff[_0x0baf('0x94')][_0x0baf('0x92')];}if(_0x1805ff['account'][_0x0baf('0x93')]&&_0x1805ff[_0x0baf('0x94')][_0x0baf('0x93')][_0x0baf('0x90')][_0x0baf('0x61')]){return _0x1805ff['account'][_0x0baf('0x93')][_0x0baf('0x90')][0x0];}var _0x53df55=_['defaults'](_0x12311d[_0x0baf('0x4f')],{'firstName':_0x12311d[_0x0baf('0x4f')][_0x0baf('0x89')],'ListId':_0x3cfb49[_0x0baf('0x9a')]});_0x53df55[_0x12311d[_0x0baf('0x4f')][_0x0baf('0x8d')]]=_0x12311d[_0x0baf('0x4f')]['from'];return db['CmContact'][_0x0baf('0x4e')](_0x53df55,{'fields':_0x39eb13,'raw':!![]});}})[_0x0baf('0x15')](handleEntityNotFound(_0x52c7f7,null))[_0x0baf('0x15')](function(_0x47de3f){_0x1805ff[_0x0baf('0x9b')]=_0x47de3f;var _0x3a6bf8=_0x12311d['body'][_0x0baf('0x9c')];if(_0x12311d[_0x0baf('0x7e')]['cf-connecting-ip']){_0x3a6bf8=_0x12311d[_0x0baf('0x7e')][_0x0baf('0x9d')];}else if(_0x12311d[_0x0baf('0x7e')]['x-forwarded-for']){_0x3a6bf8=_[_0x0baf('0x9e')](_0x12311d[_0x0baf('0x7e')][_0x0baf('0x9f')][_0x0baf('0xa0')](','));}if(_0x47de3f){var _0x3021f7={'ContactId':_0x47de3f['id'],'ChatWebsiteId':_0x12311d[_0x0baf('0x4d')]['id'],'from':(_0x47de3f[_0x0baf('0xa1')]||'')+'\x20'+(_0x47de3f['lastName']||''),'customerIp':_0x3a6bf8,'customerPort':_0x12311d[_0x0baf('0x7e')]['x-real-port']?_0x12311d[_0x0baf('0x7e')][_0x0baf('0xa2')]:null,'referer':_0x12311d['body']['referer'],'browserName':_0x12ff07[_0x0baf('0xa3')][_0x0baf('0x2f')]&&_0x12ff07[_0x0baf('0xa3')]['version']?util[_0x0baf('0xa4')](_0x0baf('0xa5'),_0x12ff07[_0x0baf('0xa3')][_0x0baf('0x2f')],_0x12ff07[_0x0baf('0xa3')][_0x0baf('0xa6')]):_0x0baf('0xa7'),'browserVersion':_0x12ff07[_0x0baf('0xa3')]['version']||'unknown','osName':util[_0x0baf('0xa4')](_0x0baf('0xa5'),_0x12ff07['os']['name'],_0x12ff07['os'][_0x0baf('0xa6')]),'osVersion':_0x12ff07['os'][_0x0baf('0xa6')],'deviceModel':_0x12ff07[_0x0baf('0xa8')][_0x0baf('0x36')]&&_0x12ff07[_0x0baf('0xa8')][_0x0baf('0xa9')]?util[_0x0baf('0xa4')]('%s\x20%s\x20%s',_0x12ff07[_0x0baf('0xa8')]['model'],_0x12ff07[_0x0baf('0xa8')][_0x0baf('0xa9')],_0x12ff07['device']['type']):null,'deviceVendor':_0x12ff07[_0x0baf('0xa8')][_0x0baf('0xa9')],'deviceType':_0x12ff07[_0x0baf('0xa8')][_0x0baf('0x46')],'formData':JSON[_0x0baf('0x1a')](_0x12311d[_0x0baf('0x4f')])};var _0x18f7bd={'ChatWebsiteId':_0x12311d['params']['id'],'closed':![]};if(_0x12311d['body']['threadId']){_0x18f7bd[_0x0baf('0xaa')]=_0x12311d['body'][_0x0baf('0xaa')];return db[_0x0baf('0xab')]['find']({'where':_0x18f7bd})['then'](function(_0x40785c){if(_0x40785c){return[_0x40785c,![]];}_0x3021f7[_0x0baf('0xaa')]=_0x12311d[_0x0baf('0x4f')][_0x0baf('0xaa')];_0x3021f7[_0x0baf('0xac')]=_0x12311d['body'][_0x0baf('0xac')];return db[_0x0baf('0xab')][_0x0baf('0x4e')](_0x3021f7)[_0x0baf('0x15')](function(_0xf784df){return[_0xf784df,!![]];});});}_0x18f7bd[_0x0baf('0xad')]=_0x47de3f['id'];if(_0x12311d['body'][_0x0baf('0xae')]&&_0x12311d[_0x0baf('0x4f')][_0x0baf('0xae')]['id']){_0x18f7bd['id']=_0x12311d['body'][_0x0baf('0xae')]['id'];return db[_0x0baf('0xab')]['find']({'where':_0x18f7bd})[_0x0baf('0x15')](function(_0xe93008){if(_0xe93008){return[_0xe93008,![]];}return db[_0x0baf('0xab')][_0x0baf('0x4e')](_0x3021f7)['then'](function(_0x4ffc8e){return[_0x4ffc8e,!![]];});});}return db[_0x0baf('0xab')][_0x0baf('0x4e')](_0x3021f7)['then'](function(_0x43022c){return[_0x43022c,!![]];});}})[_0x0baf('0xaf')](function(_0xcd88a1,_0x13ac02){if(_0xcd88a1){_0x1ac8eb=_0x13ac02;if(!_0x13ac02){var _0x122a1a={'from':(_0x1805ff['contact'][_0x0baf('0xa1')]||'')+'\x20'+(_0x1805ff[_0x0baf('0x9b')][_0x0baf('0xb0')]||'')};if(_0x12311d[_0x0baf('0x4f')]['threadId']&&_0x12311d[_0x0baf('0x4f')]['messageId']&&_0x12311d[_0x0baf('0x4f')][_0x0baf('0xaa')]!=_0x12311d[_0x0baf('0x4f')]['messageId']){_0x122a1a[_0x0baf('0xaa')]=_0x12311d[_0x0baf('0x4f')][_0x0baf('0xb1')];}return _0xcd88a1[_0x0baf('0x28')](_0x122a1a);}else{return _0xcd88a1;}}})[_0x0baf('0x15')](function(_0x2a72b3){_0x1805ff[_0x0baf('0xae')]=_0x2a72b3[_0x0baf('0x2a')]({'plain':!![]});_0x1805ff[_0x0baf('0xae')][_0x0baf('0xb2')]=_0x1ac8eb;if(_0x1805ff[_0x0baf('0xae')][_0x0baf('0xb2')]){if(_0x1805ff['account']['autoclose']){_0x1805ff[_0x0baf('0x95')]['push']({'id':0x0,'priority':_0x1805ff['applications']['length']+0x1,'app':'close','appdata':_0x0baf('0xb3'),'interval':_0x0baf('0xb4')});}}return db['ChatMessage']['create']({'body':_0x12311d['body']['body'],'ChatWebsiteId':_0x12311d[_0x0baf('0x4d')]['id'],'ChatInteractionId':_0x2a72b3['id'],'direction':'in','ContactId':_0x1805ff['contact']['id'],'AttachmentId':_0x12311d[_0x0baf('0x4f')][_0x0baf('0xb5')]});})[_0x0baf('0x15')](function(_0xa1b680){_0x1805ff[_0x0baf('0x1d')]=_0xa1b680;if(_0x1805ff[_0x0baf('0xae')][_0x0baf('0xb6')]){return db[_0x0baf('0xb7')]['find']({'attributes':['id','name'],'where':{'id':_0x1805ff[_0x0baf('0xae')][_0x0baf('0xb6')]}})['then'](function(_0x21a72d){if(_0x21a72d){_0x1805ff['applications'][_0x0baf('0xb8')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x21a72d['name']+','+(_0x1805ff[_0x0baf('0x94')][_0x0baf('0xb9')]||0xa),'interval':_0x0baf('0xb4')});_0x1805ff[_0x0baf('0xba')]=!![];}return respondWithRpcPromise(_0x0baf('0xbb'),_0x0baf('0xbc'),_0x1805ff);});}return respondWithRpcPromise(_0x0baf('0xbb'),_0x0baf('0xbc'),_0x1805ff);})[_0x0baf('0x15')](function(_0x3348c6){respondWithRpcPromise(_0x0baf('0xbd'),_0x0baf('0xbd'),{'event':_0x0baf('0x7d'),'message':_0x3348c6},client9002);return _0x3348c6;})[_0x0baf('0x15')](respondWithResult(_0x52c7f7,null))[_0x0baf('0x1f')](handleError(_0x52c7f7,null));};exports[_0x0baf('0xbe')]=function(_0x5b61ff,_0x3c78ca){var _0x1a016f,_0x5b9e60,_0x9f2b22;var _0x39526b=[];var _0x5ee76f={};var _0x186d83=_0x5b61ff['files']||[];var _0x3f816f=[];var _0x569bbb;return db[_0x0baf('0x82')]['describe']()[_0x0baf('0x15')](function(_0x298cb5){if(!_0x298cb5){throw new db[(_0x0baf('0x8a'))][(_0x0baf('0x83'))]('no\x20available\x20attributes');}_0x39526b=_[_0x0baf('0x85')](_[_0x0baf('0x38')](_0x298cb5),[_0x0baf('0x86'),_0x0baf('0x87'),'CompanyId','ListId']);if(_0x5b61ff[_0x0baf('0x4f')]['id']){delete _0x5b61ff[_0x0baf('0x4f')]['id'];}if(_[_0x0baf('0x73')](_0x5b61ff[_0x0baf('0x4f')]['from'])){throw _0x3c78ca[_0x0baf('0x21')](0x1f4)[_0x0baf('0x30')](new db[(_0x0baf('0x8a'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0x0baf('0x73')](_0x5b61ff['body'][_0x0baf('0x4f')])||_0x5b61ff['body'][_0x0baf('0x4f')]===''){throw _0x3c78ca[_0x0baf('0x21')](0x1f4)[_0x0baf('0x30')](new db['Sequelize'][(_0x0baf('0x83'))](_0x0baf('0x8c')));}if(_['isNil'](_0x5b61ff['body'][_0x0baf('0xbf')])){throw _0x3c78ca['status'](0x1f4)[_0x0baf('0x30')](new db[(_0x0baf('0x8a'))]['ValidationError']('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x39526b));}if(!_[_0x0baf('0x8e')](_0x39526b,_0x5b61ff[_0x0baf('0x4f')]['mapKeyOffline'])){throw _0x3c78ca[_0x0baf('0x21')](0x1f4)['send'](new db[(_0x0baf('0x8a'))][(_0x0baf('0x83'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x39526b));}_0x5ee76f[_0x5b61ff[_0x0baf('0x4f')][_0x0baf('0xbf')]]=_0x5b61ff[_0x0baf('0x4f')][_0x0baf('0x89')];})[_0x0baf('0x15')](function(){return db['ChatWebsite'][_0x0baf('0x54')]({'where':{'id':_0x5b61ff['params']['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db[_0x0baf('0xc0')],'as':_0x0baf('0xc0')}]});})['then'](handleEntityNotFound(_0x3c78ca,null))[_0x0baf('0x15')](function(_0x58e1ae){if(_0x58e1ae&&_0x58e1ae['List']){_0x5b9e60=_0x58e1ae;var _0x30a982=_[_0x0baf('0xd')](_0x5b61ff[_0x0baf('0x4f')],{'firstName':_0x5b61ff[_0x0baf('0x4f')][_0x0baf('0x89')],'phone':_0x5b61ff[_0x0baf('0x4f')][_0x0baf('0x89')],'ListId':_0x58e1ae[_0x0baf('0x9a')]});_0x30a982[_0x5b61ff[_0x0baf('0x4f')][_0x0baf('0xbf')]]=_0x5b61ff['body'][_0x0baf('0x89')];return db[_0x0baf('0x82')][_0x0baf('0xc1')]({'where':_0x5ee76f,'defaults':_0x30a982});}})[_0x0baf('0xaf')](function(_0x1d1ed6){if(_0x1d1ed6){_0x9f2b22=_0x1d1ed6;var _0x57b26e=fs[_0x0baf('0xc2')](path['join'](config[_0x0baf('0x6f')],_0x0baf('0xc3')),_0x0baf('0xc4'));var _0x44f822=ejs[_0x0baf('0xc5')](_0x57b26e,{'body':_[_0x0baf('0xc6')](_0x5b61ff[_0x0baf('0x4f')]['body']),'bodyTitle':_0x5b9e60[_0x0baf('0xc7')]});return db[_0x0baf('0xc8')][_0x0baf('0x4e')]({'body':_0x44f822,'plainBody':htmlToText[_0x0baf('0xc9')](_0x44f822),'ContactId':_0x1d1ed6['id'],'ChatWebsiteId':_0x5b9e60['id']});}})[_0x0baf('0x15')](function(_0x130ad1){_0x569bbb=_0x130ad1;if(_0x186d83[_0x0baf('0x61')]){var _0x17ef4f=_0x186d83[_0x0baf('0x37')](function(_0x1ee4c7){return{'name':_0x1ee4c7[_0x0baf('0xca')],'basename':_0x1ee4c7[_0x0baf('0x66')],'type':_0x1ee4c7[_0x0baf('0xcb')],'ChatOfflineMessageId':_0x130ad1['id']};});_0x3f816f=_0x17ef4f[_0x0baf('0x37')](_0x37430c=>{var _0x3fffe8={'filename':_0x37430c[_0x0baf('0x2f')],'path':path[_0x0baf('0x6e')](config['root'],_0x0baf('0xcc'),_0x0baf('0xcd'),_0x0baf('0xce'),_0x0baf('0xcf'),_0x37430c[_0x0baf('0xd0')])};return _0x3fffe8;});if(!_0x5b9e60[_0x0baf('0xd1')]){return db[_0x0baf('0xd2')]['transaction'](function(_0xa7a73a){return db[_0x0baf('0xd3')][_0x0baf('0xd4')](_0x17ef4f,{'transaction':_0xa7a73a});});}}})[_0x0baf('0x15')](function(){if(_0x569bbb){_0x1a016f=_0x569bbb;return db[_0x0baf('0xc0')][_0x0baf('0x59')]({'where':{'active':!![]},'include':[{'model':db[_0x0baf('0xd5')],'as':'Smtp','raw':!![]}]});}})[_0x0baf('0x15')](function(_0x17b3a9){if(_0x17b3a9&&_0x17b3a9[_0x0baf('0xd6')]&&_0x5b9e60[_0x0baf('0xd7')]&&_0x5b9e60[_0x0baf('0xd8')]){var _0x1912ff={'tls':{'rejectUnauthorized':![]}};if(_0x17b3a9['Smtp'][_0x0baf('0xd9')]){_0x1912ff[_0x0baf('0xd9')]=_0x17b3a9[_0x0baf('0xd6')][_0x0baf('0xd9')];}else{_0x1912ff[_0x0baf('0xda')]=_0x17b3a9['Smtp']['host'];_0x1912ff[_0x0baf('0xdb')]=_0x17b3a9[_0x0baf('0xd6')][_0x0baf('0xdb')];_0x1912ff[_0x0baf('0xdc')]=_0x17b3a9[_0x0baf('0xd6')][_0x0baf('0xdc')];}if(_0x17b3a9[_0x0baf('0xd6')][_0x0baf('0xdd')]){_0x1912ff[_0x0baf('0xde')]={'user':_0x17b3a9[_0x0baf('0xd6')][_0x0baf('0x50')],'pass':_0x17b3a9[_0x0baf('0xd6')][_0x0baf('0xdf')]};}return respondWithRpcPromise(_0x0baf('0xe0'),_0x0baf('0xe1'),{'account':_0x1912ff,'message':{'from':util[_0x0baf('0xa4')](_0x0baf('0xe2'),_0x17b3a9[_0x0baf('0x2f')],_0x17b3a9[_0x0baf('0xe3')]||_0x17b3a9[_0x0baf('0xd6')][_0x0baf('0x50')]),'to':_0x5b9e60[_0x0baf('0xd8')],'subject':_0x5b9e60[_0x0baf('0xe4')],'html':_0x1a016f[_0x0baf('0x4f')],'attachments':_0x3f816f}},client9003)[_0x0baf('0x15')](function(){return _0x1a016f;})[_0x0baf('0x1f')](function(_0x1d4581){console['error'](_0x1d4581);});}})[_0x0baf('0x15')](function(){if(_0x5b9e60&&_0x5b9e60[_0x0baf('0xd1')]&&_0x5b9e60[_0x0baf('0xe5')]){var _0x14a397=[];if(_0x186d83[_0x0baf('0x61')]){_0x14a397=_0x186d83['map'](function(_0x3e3fba){return{'name':_0x3e3fba[_0x0baf('0xca')],'basename':_0x3e3fba[_0x0baf('0x66')],'type':_0x3e3fba[_0x0baf('0xcb')],'ChatOfflineMessageId':_0x569bbb['id']};});}var _0x1db841;if(!_[_0x0baf('0x73')](_0x5b9e60[_0x0baf('0xe6')])){var _0x237a20=_[_0x0baf('0x37')](_0x5b61ff[_0x0baf('0x4f')],function(_0xe840f2){return _0xe840f2;});var _0x12726d=_[_0x0baf('0xe7')](_0x237a20)[0x0];var _0x1b2278=_[_0x0baf('0xe8')](_0x12726d,function(_0x221aac){return _0x221aac;});_0x1db841=_0x1b2278[0x1][_0x5b9e60[_0x0baf('0xe6')]];}var _0x3e970a={'from':_0x9f2b22['email'],'firstName':_0x9f2b22[_0x0baf('0xa1')],'lastName':_0x9f2b22['lastName'],'mapKey':'email','message':{'from':_0x9f2b22[_0x0baf('0xe3')],'to':_0x5b9e60[_0x0baf('0xc0')][_0x0baf('0xe3')],'cc':'','subject':_['isNil'](_0x1db841)?_0x5b9e60[_0x0baf('0xe4')]:_0x1db841,'messageId':'','sentAt':new Date(),'attach':_0x14a397[_0x0baf('0x61')],'attachments':_0x14a397,'originChannel':_0x0baf('0xe9'),'ChatWebsiteId':_0x5b9e60['id'],'ChatOfflineMessageId':_0x1a016f['id'],'originTo':_0x5b9e60[_0x0baf('0xc0')][_0x0baf('0xe3')]},'body':_0x1a016f[_0x0baf('0x4f')]};var _0x49543e={'account':{'id':_0x5b9e60[_0x0baf('0xe5')]},'body':_0x3e970a,'log':_0x0baf('0xea')};return respondWithRpcPromise(_0x0baf('0xea'),_0x0baf('0xeb'),_0x49543e,client9001)[_0x0baf('0x15')](function(){return _0x1a016f;})[_0x0baf('0x1f')](function(_0x4c2bae){console[_0x0baf('0x1b')](_0x4c2bae);});}return;})['then'](function(){if(_0x1a016f){return _0x1a016f;}})[_0x0baf('0x15')](respondWithResult(_0x3c78ca,null))[_0x0baf('0x1f')](function(_0x47b168){console['error'](_0x0baf('0x1f'),_0x47b168);for(var _0x1de1dd of _0x186d83){var _0xf4da6a=path['join'](config[_0x0baf('0x6f')],_0x0baf('0xcc'),'files',_0x0baf('0xce'),_0x0baf('0xcf'),_0x1de1dd[_0x0baf('0x66')]);fs_extra[_0x0baf('0xec')](_0xf4da6a)[_0x0baf('0x1f')](function(_0x2759bb){console[_0x0baf('0x1b')]('Could\x20not\x20remove\x20attachment\x20file',_0xf4da6a,_0x2759bb);});}});};exports['addInteraction']=function(_0x131573,_0x1bd67f){return db[_0x0baf('0xab')][_0x0baf('0x54')]({'where':{'id':_0x131573[_0x0baf('0x4d')]['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x1bd67f,null))[_0x0baf('0x15')](function(_0x4316c5){if(_0x4316c5){return _0x4316c5[_0x0baf('0xed')](_0x131573[_0x0baf('0x4f')]['ids'],_['omit'](_0x131573[_0x0baf('0x4f')],[_0x0baf('0x5d'),'id'])||{});}})[_0x0baf('0x15')](respondWithResult(_0x1bd67f,null))['catch'](handleError(_0x1bd67f,null));};exports['getInteractions']=function(_0x3d740a,_0x2cb735){var _0xf82eb5={'raw':![],'where':{}};var _0x197bbe={};var _0x4a6a50={'count':0x0,'rows':[]};return db[_0x0baf('0x33')][_0x0baf('0x59')]({'where':{'id':_0x3d740a[_0x0baf('0x4d')]['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x2cb735,null))[_0x0baf('0x15')](function(_0x120c18){if(_0x120c18){_0x197bbe[_0x0baf('0x36')]=_[_0x0baf('0x38')](db['ChatInteraction'][_0x0baf('0x34')]);_0x197bbe[_0x0baf('0x39')]=_[_0x0baf('0x38')](_0x3d740a[_0x0baf('0x39')]);_0x197bbe[_0x0baf('0x3a')]=_[_0x0baf('0x3b')](_0x197bbe['model'],_0x197bbe[_0x0baf('0x39')]);_0xf82eb5[_0x0baf('0x3c')]=_['intersection'](_0x197bbe['model'],qs[_0x0baf('0x3d')](_0x3d740a['query'][_0x0baf('0x3d')]));_0xf82eb5[_0x0baf('0x3c')]=_0xf82eb5[_0x0baf('0x3c')][_0x0baf('0x61')]?_0xf82eb5['attributes']:_0x197bbe[_0x0baf('0x36')];if(!_0x3d740a[_0x0baf('0x39')][_0x0baf('0x3e')]('nolimit')){_0xf82eb5[_0x0baf('0x25')]=qs[_0x0baf('0x25')](_0x3d740a['query'][_0x0baf('0x25')]);_0xf82eb5['offset']=qs[_0x0baf('0x23')](_0x3d740a[_0x0baf('0x39')][_0x0baf('0x23')]);}_0xf82eb5[_0x0baf('0x40')]=qs['sort'](_0x3d740a[_0x0baf('0x39')][_0x0baf('0x41')]);_0xf82eb5['where']=qs[_0x0baf('0x3a')](_[_0x0baf('0x42')](_0x3d740a['query'],_0x197bbe[_0x0baf('0x3a')]));_0xf82eb5[_0x0baf('0x44')]['ChatWebsiteId']=_0x120c18['id'];if(_0x3d740a[_0x0baf('0x39')][_0x0baf('0x43')]){_0xf82eb5[_0x0baf('0x44')]=_[_0x0baf('0x45')](_0xf82eb5[_0x0baf('0x44')],{'$or':_[_0x0baf('0x37')](_0xf82eb5['attributes'],function(_0x181385){var _0x120f68={};_0x120f68[_0x181385]={'$like':'%'+_0x3d740a[_0x0baf('0x39')][_0x0baf('0x43')]+'%'};return _0x120f68;})});}_0xf82eb5=_[_0x0baf('0x45')]({},_0xf82eb5,_0x3d740a[_0x0baf('0x48')]);return db[_0x0baf('0xab')][_0x0baf('0x26')]({'where':_0xf82eb5[_0x0baf('0x44')]})[_0x0baf('0x15')](function(_0x72e44c){_0x4a6a50[_0x0baf('0x26')]=_0x72e44c;if(_0x3d740a[_0x0baf('0x39')][_0x0baf('0x49')]){_0xf82eb5[_0x0baf('0x4a')]=[{'model':db[_0x0baf('0x82')],'as':_0x0baf('0xee'),'required':![]},{'model':db[_0x0baf('0xb7')],'as':_0x0baf('0xef'),'attributes':[_0x0baf('0x2f'),_0x0baf('0xf0'),_0x0baf('0xf1')],'required':![]},{'model':db['Tag'],'as':_0x0baf('0xf2'),'attributes':['id',_0x0baf('0x2f'),'color'],'where':_0x3d740a['query']['tag']?{'id':_0x3d740a[_0x0baf('0x39')]['tag']}:undefined,'required':_0x3d740a['query']['tag']?!![]:![]}];}return db[_0x0baf('0xab')][_0x0baf('0x5b')](_0xf82eb5);})[_0x0baf('0x15')](function(_0x5ab269){_0x4a6a50[_0x0baf('0x4b')]=_0x5ab269;return _0x4a6a50;});}})['then'](respondWithFilteredResult(_0x2cb735,_0xf82eb5))['catch'](handleError(_0x2cb735,null));};function iftimePromise(_0x743f4b,_0xc93c2b){return respondWithRpcPromise(_0x0baf('0xf3'),'getSnippet',{'command':_0xc93c2b['timezone']?util[_0x0baf('0xa4')](_0x0baf('0xf4'),_0x743f4b[_0x0baf('0xf5')],_0xc93c2b[_0x0baf('0xf6')]):util[_0x0baf('0xa4')](_0x0baf('0xf7'),_0x743f4b['interval'])},client9002)['then'](function(_0x217cd8){var _0x21e3b1=_0x217cd8&&_0x217cd8['indexOf'](_0x0baf('0xf8'))>=0x0?!![]:![];logger[_0x0baf('0x16')](_0x0baf('0xf9'),_0xc93c2b['id'],_0x743f4b['id'],_0x743f4b[_0x0baf('0xf5')],_0x21e3b1?'ONLINE':_0x0baf('0xfa'),_0xc93c2b['timezone']?_0xc93c2b['timezone']:_0x0baf('0xfb'));return _0x21e3b1;})['catch'](function(_0x4a0f32){logger[_0x0baf('0x1b')](_0x0baf('0xf9'),_0xc93c2b['id'],_0x743f4b['id'],_0x743f4b['interval'],util[_0x0baf('0xfc')](_0x4a0f32,{'showHidden':![],'depth':null}),_0xc93c2b[_0x0baf('0xf6')]?_0xc93c2b[_0x0baf('0xf6')]:_0x0baf('0xfb'));return![];});}exports[_0x0baf('0xfd')]=function(_0x1ad92d,_0x532e4b){var _0x395ad5=0x0;var _0x47fcb1=0x0;var _0x2a4997=![];var _0x2997b3;var _0x4e0fc6;return db['ChatWebsite'][_0x0baf('0x54')]({'where':{'id':_0x1ad92d[_0x0baf('0x4d')]['id']},'include':[{'model':db['Interval'],'as':_0x0baf('0xfe'),'include':[{'model':db[_0x0baf('0xfe')],'as':_0x0baf('0xff'),'attributes':['id',_0x0baf('0xf5')],'raw':!![]}]}]})[_0x0baf('0x15')](handleEntityNotFound(_0x532e4b,null))[_0x0baf('0x15')](function(_0x20f37b){if(_0x20f37b){_0x2997b3=_0x20f37b;return _0x20f37b[_0x0baf('0x100')]({'raw':!![]});}})['then'](function(_0x3f136e){if(_0x2997b3){if(_0x3f136e){_0x4e0fc6=_0x3f136e;}}return require(_0x0baf('0x101'))['getLicense']();})['then'](function(_0x276d39){if(_0x276d39){_0x47fcb1=_0x276d39[_0x0baf('0x102')];_0x2a4997=_0x276d39['custom'];}})[_0x0baf('0x15')](function(){return db[_0x0baf('0xab')]['count']({'where':{'closed':![]}});})[_0x0baf('0x15')](function(_0x47825b){_0x395ad5=_0x47825b;if(_0x47fcb1&&_0x47825b>_0x47fcb1){return db[_0x0baf('0x103')][_0x0baf('0x59')]({'where':{'id':0x1}})[_0x0baf('0x15')](function(_0x9f5f16){if(_0x9f5f16){_0x9f5f16[_0x0baf('0x104')](_0x0baf('0x105'));}});}})[_0x0baf('0x15')](function(){if(_0x2997b3['Interval']&&_0x2997b3[_0x0baf('0xfe')][_0x0baf('0xff')]){var _0x547a10=[];for(var _0x4ef69a=0x0;_0x4ef69a<_0x2997b3[_0x0baf('0xfe')]['Intervals'][_0x0baf('0x61')];_0x4ef69a++){var _0x3752fd=_0x2997b3[_0x0baf('0xfe')][_0x0baf('0xff')][_0x4ef69a][_0x0baf('0x2a')]({'plain':!![]});_0x547a10[_0x0baf('0x106')](iftimePromise(_0x3752fd,_0x2997b3));}return BPromise[_0x0baf('0x107')](_0x547a10)[_0x0baf('0x15')](function(_0x148b9a){return _['some'](_0x148b9a);});}else{return!![];}})[_0x0baf('0x15')](function(_0x6721e9){var _0x2d4336=fs[_0x0baf('0xc2')](path['join'](config[_0x0baf('0x6f')],_0x0baf('0x108')),_0x0baf('0xc4'));var _0x550db0={'remote':_0x2997b3[_0x0baf('0x109')],'query':querystring[_0x0baf('0x1a')](_[_0x0baf('0x45')](_0x2997b3[_0x0baf('0x2a')]({'plain':!![]}),{'customerIp':_0x1ad92d['headers'][_0x0baf('0x9f')]||_0x1ad92d[_0x0baf('0x7e')]['x-real-ip']||_0x1ad92d['connection']['remoteAddress']||_0x1ad92d['ip'],'referer':_0x1ad92d[_0x0baf('0x7e')][_0x0baf('0x10a')],'openedInteractions':_0x395ad5,'maxInteractions':_0x47fcb1,'virtual':_0x2a4997[_0x0baf('0x102')],'online':_0x6721e9,'custom':_0x2a4997}))['replace'](/'/g,'\x5c\x27')};_0x532e4b[_0x0baf('0x30')](ejs[_0x0baf('0xc5')](Mustache[_0x0baf('0xc5')](_0x2d4336,_0x550db0),{'proactiveActions':_0x4e0fc6,'alignment':_0x2997b3[_0x0baf('0x10b')],'verticalAlignment':_0x2997b3[_0x0baf('0x10c')],'div_color':_0x2997b3['color'],'labelText':_0x2997b3[_0x0baf('0x10d')],'text_color':_0x2997b3[_0x0baf('0x10e')],'button_color':_0x2997b3[_0x0baf('0x10f')],'background_color':_0x2997b3[_0x0baf('0x110')]}));})[_0x0baf('0x1f')](handleError(_0x532e4b,null));};exports[_0x0baf('0x111')]=function(_0x5ab670,_0x4c4ffe){var _0x181980=_0x5ab670[_0x0baf('0x4d')]['id'];var _0x313e3e=_0x5ab670[_0x0baf('0x4f')];var _0x1cf4b5=0xc8;var _0x5d1985=null;return db[_0x0baf('0xd2')][_0x0baf('0x112')]({'isolationLevel':db[_0x0baf('0xd2')]['Transaction'][_0x0baf('0x113')][_0x0baf('0x114')]},function(_0x1e10a4){return db[_0x0baf('0x33')]['findOne']({'where':{'id':_0x181980},'transaction':_0x1e10a4})[_0x0baf('0x15')](function(_0x4d6e8e){if(_0x4d6e8e){return db[_0x0baf('0x115')][_0x0baf('0x29')]({'where':{'ChatWebsiteId':_0x181980},'transaction':_0x1e10a4})[_0x0baf('0x15')](function(){var _0x594a08=_['map'](_0x313e3e,function(_0x45e0ec){_0x45e0ec[_0x0baf('0x5f')]=_0x181980;return _0x45e0ec;});return db[_0x0baf('0x115')][_0x0baf('0xd4')](_0x594a08,{'transaction':_0x1e10a4});});}else{_0x1cf4b5=0x194;_0x5d1985=[];}});})['then'](function(){if(_0x1cf4b5!==0x194){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x181980},'order':_0x0baf('0x98')})[_0x0baf('0x15')](function(_0x46171d){_0x5d1985=_0x46171d;});}})['catch'](function(_0x2ba54d){_0x1cf4b5=0x1f4;logger[_0x0baf('0x1b')](_0x2ba54d[_0x0baf('0x2e')]);if(_0x2ba54d['name']){delete _0x2ba54d[_0x0baf('0x2f')];}_0x5d1985=_0x2ba54d;})[_0x0baf('0x116')](function(){if(_0x5d1985===null){_0x4c4ffe[_0x0baf('0x20')](_0x1cf4b5);}else{if(_0x1cf4b5===0x1f4){_0x4c4ffe['status'](_0x1cf4b5)['send'](_0x5d1985);}else{_0x4c4ffe['status'](_0x1cf4b5)['json'](_0x5d1985);}}});};exports[_0x0baf('0x117')]=function(_0x1c8b91,_0x3124bc){var _0x5ba16f={};var _0xcbc041={};var _0x5b1808;var _0x1abba8;return db[_0x0baf('0x33')]['findOne']({'where':{'id':_0x1c8b91['params']['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x3124bc,null))[_0x0baf('0x15')](function(_0xc0952d){if(_0xc0952d){_0x5b1808=_0xc0952d;_0xcbc041['model']=_[_0x0baf('0x38')](db[_0x0baf('0x115')]['rawAttributes']);_0xcbc041['query']=_[_0x0baf('0x38')](_0x1c8b91[_0x0baf('0x39')]);_0xcbc041[_0x0baf('0x3a')]=_[_0x0baf('0x3b')](_0xcbc041[_0x0baf('0x36')],_0xcbc041[_0x0baf('0x39')]);_0x5ba16f[_0x0baf('0x3c')]=_[_0x0baf('0x3b')](_0xcbc041[_0x0baf('0x36')],qs[_0x0baf('0x3d')](_0x1c8b91[_0x0baf('0x39')][_0x0baf('0x3d')]));_0x5ba16f[_0x0baf('0x3c')]=_0x5ba16f[_0x0baf('0x3c')][_0x0baf('0x61')]?_0x5ba16f['attributes']:_0xcbc041[_0x0baf('0x36')];_0x5ba16f[_0x0baf('0x40')]=qs[_0x0baf('0x41')](_0x1c8b91['query']['sort']);_0x5ba16f[_0x0baf('0x44')]=qs[_0x0baf('0x3a')](_[_0x0baf('0x42')](_0x1c8b91[_0x0baf('0x39')],_0xcbc041[_0x0baf('0x3a')]));if(_0x1c8b91[_0x0baf('0x39')][_0x0baf('0x43')]){_0x5ba16f[_0x0baf('0x44')]=_[_0x0baf('0x45')](_0x5ba16f[_0x0baf('0x44')],{'$or':_[_0x0baf('0x37')](_0x5ba16f[_0x0baf('0x3c')],function(_0x4306bb){var _0x2c2d4b={};_0x2c2d4b[_0x4306bb]={'$like':'%'+_0x1c8b91[_0x0baf('0x39')]['filter']+'%'};return _0x2c2d4b;})});}_0x5ba16f=_[_0x0baf('0x45')]({},_0x5ba16f,_0x1c8b91[_0x0baf('0x48')]);return _0x5b1808[_0x0baf('0x117')](_0x5ba16f);}})[_0x0baf('0x15')](function(_0x4056b6){if(_0x4056b6){_0x1abba8=_0x4056b6[_0x0baf('0x61')];if(!_0x1c8b91[_0x0baf('0x39')]['hasOwnProperty']('nolimit')){_0x5ba16f[_0x0baf('0x25')]=qs['limit'](_0x1c8b91['query'][_0x0baf('0x25')]);_0x5ba16f['offset']=qs[_0x0baf('0x23')](_0x1c8b91[_0x0baf('0x39')][_0x0baf('0x23')]);}return _0x5b1808[_0x0baf('0x117')](_0x5ba16f);}})[_0x0baf('0x15')](function(_0x2a02e6){if(_0x2a02e6){return _0x2a02e6?{'count':_0x1abba8,'rows':_0x2a02e6}:null;}})[_0x0baf('0x15')](respondWithResult(_0x3124bc,null))[_0x0baf('0x1f')](handleError(_0x3124bc,null));};exports['addProactiveActions']=function(_0x4bcc76,_0xae7f71){return db[_0x0baf('0x118')][_0x0baf('0x54')]({'where':{'id':_0x4bcc76[_0x0baf('0x4d')]['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0xae7f71,null))['then'](function(_0x123037){if(_0x123037){return _0x123037[_0x0baf('0x119')](_0x4bcc76[_0x0baf('0x4f')][_0x0baf('0x5d')],_[_0x0baf('0x11a')](_0x4bcc76[_0x0baf('0x4f')],[_0x0baf('0x5d'),'id'])||{});}})[_0x0baf('0x15')](respondWithResult(_0xae7f71,null))[_0x0baf('0x1f')](handleError(_0xae7f71,null));};exports[_0x0baf('0x100')]=function(_0x238649,_0x30ef34){var _0x43c6a6={};var _0x2448dd={};var _0x4a999b;var _0x165555;return db[_0x0baf('0x33')][_0x0baf('0x59')]({'where':{'id':_0x238649[_0x0baf('0x4d')]['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x30ef34,null))['then'](function(_0x2723ea){if(_0x2723ea){_0x4a999b=_0x2723ea;_0x2448dd[_0x0baf('0x36')]=_[_0x0baf('0x38')](db['ChatProactiveAction']['rawAttributes']);_0x2448dd[_0x0baf('0x39')]=_[_0x0baf('0x38')](_0x238649['query']);_0x2448dd[_0x0baf('0x3a')]=_[_0x0baf('0x3b')](_0x2448dd['model'],_0x2448dd[_0x0baf('0x39')]);_0x43c6a6[_0x0baf('0x3c')]=_[_0x0baf('0x3b')](_0x2448dd[_0x0baf('0x36')],qs[_0x0baf('0x3d')](_0x238649[_0x0baf('0x39')][_0x0baf('0x3d')]));_0x43c6a6['attributes']=_0x43c6a6['attributes'][_0x0baf('0x61')]?_0x43c6a6['attributes']:_0x2448dd[_0x0baf('0x36')];_0x43c6a6[_0x0baf('0x40')]=qs[_0x0baf('0x41')](_0x238649['query'][_0x0baf('0x41')]);_0x43c6a6[_0x0baf('0x44')]=qs['filters'](_[_0x0baf('0x42')](_0x238649[_0x0baf('0x39')],_0x2448dd[_0x0baf('0x3a')]));if(_0x238649[_0x0baf('0x39')][_0x0baf('0x43')]){_0x43c6a6[_0x0baf('0x44')]=_[_0x0baf('0x45')](_0x43c6a6[_0x0baf('0x44')],{'$or':_[_0x0baf('0x37')](_0x43c6a6['attributes'],function(_0x2739c7){var _0x1bea85={};_0x1bea85[_0x2739c7]={'$like':'%'+_0x238649['query']['filter']+'%'};return _0x1bea85;})});}_0x43c6a6=_[_0x0baf('0x45')]({},_0x43c6a6,_0x238649[_0x0baf('0x48')]);return _0x4a999b[_0x0baf('0x100')](_0x43c6a6);}})[_0x0baf('0x15')](function(_0x34d2db){if(_0x34d2db){_0x165555=_0x34d2db['length'];if(!_0x238649['query'][_0x0baf('0x3e')]('nolimit')){_0x43c6a6[_0x0baf('0x25')]=qs['limit'](_0x238649[_0x0baf('0x39')][_0x0baf('0x25')]);_0x43c6a6[_0x0baf('0x23')]=qs['offset'](_0x238649[_0x0baf('0x39')][_0x0baf('0x23')]);}return _0x4a999b[_0x0baf('0x100')](_0x43c6a6);}})['then'](function(_0xb3a031){if(_0xb3a031){return _0xb3a031?{'count':_0x165555,'rows':_0xb3a031}:null;}})[_0x0baf('0x15')](respondWithResult(_0x30ef34,null))[_0x0baf('0x1f')](handleError(_0x30ef34,null));};exports[_0x0baf('0x11b')]=function(_0x3597fe,_0x132995){var _0x12c4bf=_0x3597fe[_0x0baf('0x39')][_0x0baf('0x11c')]===_0x0baf('0x11d')?'offlineForm':_0x0baf('0x11e');return db[_0x0baf('0x33')]['find']({'attributes':['id',_0x12c4bf],'where':{'id':_0x3597fe[_0x0baf('0x4d')]['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x132995,null))[_0x0baf('0x15')](function(_0xc2b22e){if(_0xc2b22e){var _0x51f903=_0xc2b22e[_0x12c4bf];var _0x423e9c=_0x51f903&&_0x51f903[_0x0baf('0x11f')]?_0x51f903[_0x0baf('0x11f')]:[];_0x132995['send']({'fromKey':_['isNil'](_0x51f903[_0x0baf('0x120')])?undefined:_0x51f903['fromKey'],'count':_0x423e9c[_0x0baf('0x61')],'rows':_0x423e9c});}})[_0x0baf('0x1f')](handleError(_0x132995,null));};exports['getOfflineMessages']=function(_0x53e81a,_0x572289){var _0x4fc936={'raw':![],'where':{}};var _0x423636={};var _0x51f03c={'count':0x0,'rows':[]};return db[_0x0baf('0x33')][_0x0baf('0x59')]({'where':{'id':_0x53e81a[_0x0baf('0x4d')]['id']}})['then'](handleEntityNotFound(_0x572289,null))['then'](function(_0xa010ed){if(_0xa010ed){_0x423636[_0x0baf('0x36')]=_['keys'](db[_0x0baf('0xc8')]['rawAttributes']);_0x423636[_0x0baf('0x39')]=_[_0x0baf('0x38')](_0x53e81a['query']);_0x423636[_0x0baf('0x3a')]=_[_0x0baf('0x3b')](_0x423636['model'],_0x423636[_0x0baf('0x39')]);_0x4fc936[_0x0baf('0x3c')]=_[_0x0baf('0x3b')](_0x423636[_0x0baf('0x36')],qs['fields'](_0x53e81a[_0x0baf('0x39')]['fields']));_0x4fc936[_0x0baf('0x3c')]=_0x4fc936[_0x0baf('0x3c')][_0x0baf('0x61')]?_0x4fc936['attributes']:_0x423636['model'];if(!_0x53e81a[_0x0baf('0x39')][_0x0baf('0x3e')](_0x0baf('0x3f'))){_0x4fc936['limit']=qs[_0x0baf('0x25')](_0x53e81a[_0x0baf('0x39')][_0x0baf('0x25')]);_0x4fc936['offset']=qs[_0x0baf('0x23')](_0x53e81a['query'][_0x0baf('0x23')]);}_0x4fc936[_0x0baf('0x40')]=qs[_0x0baf('0x41')](_0x53e81a[_0x0baf('0x39')][_0x0baf('0x41')]);_0x4fc936[_0x0baf('0x44')]=qs[_0x0baf('0x3a')](_[_0x0baf('0x42')](_0x53e81a[_0x0baf('0x39')],_0x423636['filters']));_0x4fc936[_0x0baf('0x44')][_0x0baf('0x5f')]=_0xa010ed['id'];if(_0x53e81a[_0x0baf('0x39')][_0x0baf('0x43')]){_0x4fc936[_0x0baf('0x44')]=_[_0x0baf('0x45')](_0x4fc936[_0x0baf('0x44')],{'$or':_[_0x0baf('0x37')](_0x4fc936[_0x0baf('0x3c')],function(_0x410e8e){var _0x54facf={};_0x54facf[_0x410e8e]={'$like':'%'+_0x53e81a[_0x0baf('0x39')][_0x0baf('0x43')]+'%'};return _0x54facf;})});}_0x4fc936=_['merge']({},_0x4fc936,_0x53e81a[_0x0baf('0x48')]);return db[_0x0baf('0xc8')][_0x0baf('0x26')]({'where':_0x4fc936[_0x0baf('0x44')]})[_0x0baf('0x15')](function(_0x1fb9f7){_0x51f03c[_0x0baf('0x26')]=_0x1fb9f7;if(_0x53e81a[_0x0baf('0x39')][_0x0baf('0x49')]){_0x4fc936['include']=[{'all':!![]}];}else{_0x4fc936[_0x0baf('0x4a')]=[{'model':db[_0x0baf('0x82')],'as':_0x0baf('0xee'),'required':![]},{'model':db[_0x0baf('0xd3')],'as':_0x0baf('0x121'),'required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x4fc936);})[_0x0baf('0x15')](function(_0x58b532){_0x51f03c[_0x0baf('0x4b')]=_0x58b532;return _0x51f03c;});}})[_0x0baf('0x15')](respondWithFilteredResult(_0x572289,_0x4fc936))[_0x0baf('0x1f')](handleError(_0x572289,null));};exports[_0x0baf('0x122')]=function(_0x3a667a,_0x2629e9){return db[_0x0baf('0x33')][_0x0baf('0x54')]({'where':{'id':_0x3a667a[_0x0baf('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2629e9,null))['then'](function(_0x274787){if(_0x274787){return _0x274787[_0x0baf('0x122')](_0x3a667a[_0x0baf('0x4f')][_0x0baf('0x5d')],_['omit'](_0x3a667a[_0x0baf('0x4f')],['ids','id'])||{})[_0x0baf('0xaf')](function(_0x548f40){for(var _0x64dd21=0x0;_0x64dd21<_0x3a667a[_0x0baf('0x4f')][_0x0baf('0x5d')]['length'];_0x64dd21+=0x1){socket[_0x0baf('0x123')](_0x0baf('0x124'),{'UserId':Number(_0x3a667a['body']['ids'][_0x64dd21]),'ChatWebsiteId':Number(_0x3a667a['params']['id'])});}return _0x548f40;});}})['then'](respondWithResult(_0x2629e9,null))[_0x0baf('0x1f')](handleError(_0x2629e9,null));};exports[_0x0baf('0x125')]=function(_0x1c414,_0x27c810){return db[_0x0baf('0x33')][_0x0baf('0x54')]({'where':{'id':_0x1c414[_0x0baf('0x4d')]['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x27c810,null))[_0x0baf('0x15')](function(_0xfa0191){if(_0xfa0191){return _0xfa0191[_0x0baf('0x125')](_0x1c414[_0x0baf('0x39')]['ids'])[_0x0baf('0x15')](function(){if(_['isArray'](_0x1c414[_0x0baf('0x39')][_0x0baf('0x5d')])){for(var _0x93dcbd=0x0;_0x93dcbd<_0x1c414[_0x0baf('0x39')][_0x0baf('0x5d')][_0x0baf('0x61')];_0x93dcbd+=0x1){socket[_0x0baf('0x123')]('userChatWebsite:remove',{'UserId':Number(_0x1c414[_0x0baf('0x39')]['ids'][_0x93dcbd]),'ChatWebsiteId':Number(_0x1c414[_0x0baf('0x4d')]['id'])});}}else{socket[_0x0baf('0x123')](_0x0baf('0x126'),{'UserId':Number(_0x1c414[_0x0baf('0x39')][_0x0baf('0x5d')]),'ChatWebsiteId':Number(_0x1c414['params']['id'])});}});}})['then'](respondWithStatusCode(_0x27c810,null))[_0x0baf('0x1f')](handleError(_0x27c810,null));};exports[_0x0baf('0x127')]=function(_0x28c059,_0x51c9e0){var _0x52faae={};var _0x47868e={};var _0x2849c1;var _0x3dd487;return db[_0x0baf('0x33')][_0x0baf('0x59')]({'where':{'id':_0x28c059[_0x0baf('0x4d')]['id']}})[_0x0baf('0x15')](handleEntityNotFound(_0x51c9e0,null))[_0x0baf('0x15')](function(_0x393408){if(_0x393408){_0x2849c1=_0x393408;_0x47868e['model']=_['keys'](db[_0x0baf('0xb7')][_0x0baf('0x34')]);_0x47868e[_0x0baf('0x39')]=_[_0x0baf('0x38')](_0x28c059['query']);_0x47868e[_0x0baf('0x3a')]=_[_0x0baf('0x3b')](_0x47868e[_0x0baf('0x36')],_0x47868e['query']);_0x52faae[_0x0baf('0x3c')]=_[_0x0baf('0x3b')](_0x47868e[_0x0baf('0x36')],qs[_0x0baf('0x3d')](_0x28c059['query'][_0x0baf('0x3d')]));_0x52faae[_0x0baf('0x3c')]=_0x52faae[_0x0baf('0x3c')]['length']?_0x52faae[_0x0baf('0x3c')]:_0x47868e[_0x0baf('0x36')];_0x52faae['order']=qs[_0x0baf('0x41')](_0x28c059[_0x0baf('0x39')][_0x0baf('0x41')]);_0x52faae[_0x0baf('0x44')]=qs[_0x0baf('0x3a')](_['pick'](_0x28c059['query'],_0x47868e[_0x0baf('0x3a')]));if(_0x28c059['query'][_0x0baf('0x43')]){_0x52faae[_0x0baf('0x44')]=_[_0x0baf('0x45')](_0x52faae[_0x0baf('0x44')],{'$or':_[_0x0baf('0x37')](_0x52faae[_0x0baf('0x3c')],function(_0xe30e49){var _0x3a5d39={};_0x3a5d39[_0xe30e49]={'$like':'%'+_0x28c059[_0x0baf('0x39')][_0x0baf('0x43')]+'%'};return _0x3a5d39;})});}_0x52faae=_[_0x0baf('0x45')]({},_0x52faae,_0x28c059[_0x0baf('0x48')]);return _0x2849c1[_0x0baf('0x127')](_0x52faae);}})['then'](function(_0x1684e5){if(_0x1684e5){_0x3dd487=_0x1684e5[_0x0baf('0x61')];if(!_0x28c059[_0x0baf('0x39')][_0x0baf('0x3e')](_0x0baf('0x3f'))){_0x52faae[_0x0baf('0x25')]=qs[_0x0baf('0x25')](_0x28c059[_0x0baf('0x39')][_0x0baf('0x25')]);_0x52faae[_0x0baf('0x23')]=qs[_0x0baf('0x23')](_0x28c059[_0x0baf('0x39')]['offset']);}return _0x2849c1[_0x0baf('0x127')](_0x52faae);}})[_0x0baf('0x15')](function(_0x1ea92f){if(_0x1ea92f){return _0x1ea92f?{'count':_0x3dd487,'rows':_0x1ea92f}:null;}})['then'](respondWithResult(_0x51c9e0,null))[_0x0baf('0x1f')](handleError(_0x51c9e0,null));};
\ No newline at end of file
+var _0xb10b=['removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','util','path','ejs','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','destroy','get','UserProfileResource','stack','name','index','map','ChatWebsite','rawAttributes','fieldName','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','filter','options','includeAll','findAll','rows','mandatoryDispositionPause','intersection','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','Pause','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','filename','systemAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','user-agent','getResult','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','List','Contacts','ChatApplication','Applications','account','applications','list','orderBy','asc','defaults','contact','customerIp','cf-connecting-ip','headers','x-forwarded-for','first','split','firstName','lastName','referer','browser','version','format','%s\x20%s','unknown','device','threadId','ChatInteraction','ContactId','interaction','spread','messageId','created','close','unmanaged','ChatMessage','AttachmentId','UserId','User','unshift','agent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','offline','describe','ListId','send','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','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','service','host','port','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','mimetype','subjectOffline','toPairsIn','mapValues','Chat','MailAccountId','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','timezone','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','getLicense','virtual','License','chatLicenseExceeded','readFileSync','server/files/chat/iframe.ejs','remote','x-real-ip','connection','labelText','textColor','backgroundColor','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','ChatProactiveAction','getFields','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit'];(function(_0x267a7f,_0x49ebfc){var _0x341f37=function(_0x178ac8){while(--_0x178ac8){_0x267a7f['push'](_0x267a7f['shift']());}};_0x341f37(++_0x49ebfc);}(_0xb10b,0x12a));var _0xbb10=function(_0x39686e,_0x3d83bb){_0x39686e=_0x39686e-0x0;var _0x1b765e=_0xb10b[_0x39686e];return _0x1b765e;};'use strict';var BPromise=require(_0xbb10('0x0'));var Mustache=require('mustache');var util=require(_0xbb10('0x1'));var path=require(_0xbb10('0x2'));var ejs=require(_0xbb10('0x3'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb10('0x4'));var querystring=require(_0xbb10('0x5'));var Redis=require(_0xbb10('0x6'));var qs=require(_0xbb10('0x7'));var logger=require(_0xbb10('0x8'))(_0xbb10('0x9'));var config=require('../../config/environment');var db=require(_0xbb10('0xa'))['db'];config[_0xbb10('0xb')]=_['defaults'](config[_0xbb10('0xb')],{'host':_0xbb10('0xc'),'port':0x18eb});var socket=require(_0xbb10('0xd'))(new Redis(config[_0xbb10('0xb')]));require(_0xbb10('0xe'))[_0xbb10('0xf')](socket);var htmlToText=require(_0xbb10('0x10'));var jayson=require(_0xbb10('0x11'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xbb10('0x12')][_0xbb10('0x13')]({'port':0x232a});var client9003=jayson[_0xbb10('0x12')]['http']({'port':0x232b});var client9001=jayson[_0xbb10('0x12')]['http']({'port':0x2329});function respondWithRpcPromise(_0x44fb19,_0x916a32,_0x285009,_0x193a27){return new BPromise(function(_0x442548,_0x147230){var _0x58a612=_0x193a27||client;return _0x58a612[_0xbb10('0x14')](_0x44fb19,_0x285009)[_0xbb10('0x15')](function(_0x45b9d6){logger[_0xbb10('0x16')](_0xbb10('0x17'),_0x916a32,_0xbb10('0x18'));logger[_0xbb10('0x19')](_0xbb10('0x1a'),_0x916a32,_0xbb10('0x18'),JSON[_0xbb10('0x1b')](_0x45b9d6));if(_0x45b9d6['error']){if(_0x45b9d6[_0xbb10('0x1c')][_0xbb10('0x1d')]===0x1f4){logger[_0xbb10('0x1c')](_0xbb10('0x17'),_0x916a32,_0x45b9d6[_0xbb10('0x1c')][_0xbb10('0x1e')]);return _0x147230(_0x45b9d6[_0xbb10('0x1c')][_0xbb10('0x1e')]);}logger[_0xbb10('0x1c')](_0xbb10('0x17'),_0x916a32,_0x45b9d6['error'][_0xbb10('0x1e')]);return _0x442548(_0x45b9d6[_0xbb10('0x1c')][_0xbb10('0x1e')]);}else{logger[_0xbb10('0x16')](_0xbb10('0x17'),_0x916a32,_0xbb10('0x18'));_0x442548(_0x45b9d6['result'][_0xbb10('0x1e')]);}})[_0xbb10('0x1f')](function(_0x50aea1){logger['error'](_0xbb10('0x17'),_0x916a32,_0x50aea1);_0x147230(_0x50aea1);});});}function respondWithStatusCode(_0x311abe,_0x2e911d){_0x2e911d=_0x2e911d||0xcc;return function(_0x317da4){if(_0x317da4){return _0x311abe[_0xbb10('0x20')](_0x2e911d);}return _0x311abe[_0xbb10('0x21')](_0x2e911d)[_0xbb10('0x22')]();};}function respondWithResult(_0x436104,_0x7f2377){_0x7f2377=_0x7f2377||0xc8;return function(_0x395404){if(_0x395404){return _0x436104[_0xbb10('0x21')](_0x7f2377)[_0xbb10('0x23')](_0x395404);}};}function respondWithFilteredResult(_0x537898,_0x4fedac){return function(_0x4fb5e0){if(_0x4fb5e0){var _0xc93a04=typeof _0x4fedac[_0xbb10('0x24')]===_0xbb10('0x25')&&typeof _0x4fedac['limit']===_0xbb10('0x25');var _0x24d586=_0x4fb5e0[_0xbb10('0x26')];var _0x1d5e95=_0xc93a04?0x0:_0x4fedac[_0xbb10('0x24')];var _0x20d946=_0xc93a04?_0x4fb5e0[_0xbb10('0x26')]:_0x4fedac['offset']+_0x4fedac[_0xbb10('0x27')];var _0x21ac54;if(_0x20d946>=_0x24d586){_0x20d946=_0x24d586;_0x21ac54=0xc8;}else{_0x21ac54=0xce;}_0x537898[_0xbb10('0x21')](_0x21ac54);return _0x537898[_0xbb10('0x28')](_0xbb10('0x29'),_0x1d5e95+'-'+_0x20d946+'/'+_0x24d586)[_0xbb10('0x23')](_0x4fb5e0);}return null;};}function saveUpdates(_0x5d5c80){return function(_0x221624){if(_0x221624){return _0x221624['update'](_0x5d5c80)[_0xbb10('0x15')](function(_0x56f2da){return _0x56f2da;});}return null;};}function removeEntity(_0x16ad2a){return function(_0x1dcc9c){if(_0x1dcc9c){return _0x1dcc9c[_0xbb10('0x2a')]()['then'](function(){var _0x518d47=_0x1dcc9c[_0xbb10('0x2b')]({'plain':!![]});var _0x34f65e='ChatWebsites';return db[_0xbb10('0x2c')][_0xbb10('0x2a')]({'where':{'type':_0x34f65e,'resourceId':_0x518d47['id']}})[_0xbb10('0x15')](function(){return _0x1dcc9c;});})[_0xbb10('0x15')](function(){_0x16ad2a[_0xbb10('0x21')](0xcc)[_0xbb10('0x22')]();});}};}function handleEntityNotFound(_0xf85197){return function(_0x4975f5){if(!_0x4975f5){_0xf85197[_0xbb10('0x20')](0x194);}return _0x4975f5;};}function handleError(_0x1da9c9,_0x441d15){_0x441d15=_0x441d15||0x1f4;return function(_0x8c1ce6){logger[_0xbb10('0x1c')](_0x8c1ce6[_0xbb10('0x2d')]);if(_0x8c1ce6[_0xbb10('0x2e')]){delete _0x8c1ce6[_0xbb10('0x2e')];}_0x1da9c9[_0xbb10('0x21')](_0x441d15)['send'](_0x8c1ce6);};}exports[_0xbb10('0x2f')]=function(_0x150107,_0x1ddd9e){var _0x3c3c45={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x570f5a={},_0x111762={'count':0x0,'rows':[]};var _0x3eb3cc=_[_0xbb10('0x30')](db[_0xbb10('0x31')][_0xbb10('0x32')],function(_0x15d895){return{'name':_0x15d895[_0xbb10('0x33')],'type':_0x15d895['type'][_0xbb10('0x34')]};});_0x570f5a[_0xbb10('0x35')]=_['map'](_0x3eb3cc,'name');_0x570f5a['query']=_[_0xbb10('0x36')](_0x150107[_0xbb10('0x37')]);_0x570f5a[_0xbb10('0x38')]=_['intersection'](_0x570f5a[_0xbb10('0x35')],_0x570f5a[_0xbb10('0x37')]);_0x3c3c45[_0xbb10('0x39')]=_['intersection'](_0x570f5a[_0xbb10('0x35')],qs[_0xbb10('0x3a')](_0x150107[_0xbb10('0x37')][_0xbb10('0x3a')]));_0x3c3c45['attributes']=_0x3c3c45[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x3c3c45['attributes']:_0x570f5a[_0xbb10('0x35')];if(!_0x150107[_0xbb10('0x37')][_0xbb10('0x3c')](_0xbb10('0x3d'))){_0x3c3c45[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x150107['query'][_0xbb10('0x27')]);_0x3c3c45[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x150107[_0xbb10('0x37')]['offset']);}_0x3c3c45[_0xbb10('0x3e')]=qs[_0xbb10('0x3f')](_0x150107[_0xbb10('0x37')][_0xbb10('0x3f')]);_0x3c3c45['where']=qs[_0xbb10('0x38')](_[_0xbb10('0x40')](_0x150107['query'],_0x570f5a['filters']),_0x3eb3cc);if(_0x150107[_0xbb10('0x37')]['filter']){_0x3c3c45[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x3c3c45['where'],{'$or':_[_0xbb10('0x30')](_0x3eb3cc,function(_0x1d82bf){if(_0x1d82bf[_0xbb10('0x43')]!=='VIRTUAL'){var _0x2dd02b={};_0x2dd02b[_0x1d82bf[_0xbb10('0x2e')]]={'$like':'%'+_0x150107[_0xbb10('0x37')][_0xbb10('0x44')]+'%'};return _0x2dd02b;}})});}_0x3c3c45=_[_0xbb10('0x42')]({},_0x3c3c45,_0x150107[_0xbb10('0x45')]);var _0x190781={'where':_0x3c3c45[_0xbb10('0x41')]};return db[_0xbb10('0x31')][_0xbb10('0x26')](_0x190781)[_0xbb10('0x15')](function(_0x1eadd2){_0x111762['count']=_0x1eadd2;if(_0x150107[_0xbb10('0x37')][_0xbb10('0x46')]){_0x3c3c45['include']=[{'all':!![]}];}return db[_0xbb10('0x31')][_0xbb10('0x47')](_0x3c3c45);})[_0xbb10('0x15')](function(_0x5a5226){_0x111762[_0xbb10('0x48')]=_0x5a5226;return _0x111762;})[_0xbb10('0x15')](respondWithFilteredResult(_0x1ddd9e,_0x3c3c45))[_0xbb10('0x1f')](handleError(_0x1ddd9e,null));};exports['show']=function(_0x4a9793,_0xcb3354){var _0x76a208={'raw':![],'where':{'id':_0x4a9793['params']['id']},'include':[{'model':db['Pause'],'as':_0xbb10('0x49')}]},_0x2b12bd={};_0x2b12bd[_0xbb10('0x35')]=_[_0xbb10('0x36')](db[_0xbb10('0x31')][_0xbb10('0x32')]);_0x2b12bd[_0xbb10('0x37')]=_[_0xbb10('0x36')](_0x4a9793[_0xbb10('0x37')]);_0x2b12bd[_0xbb10('0x38')]=_[_0xbb10('0x4a')](_0x2b12bd['model'],_0x2b12bd['query']);_0x76a208[_0xbb10('0x39')]=_[_0xbb10('0x4a')](_0x2b12bd[_0xbb10('0x35')],qs[_0xbb10('0x3a')](_0x4a9793[_0xbb10('0x37')][_0xbb10('0x3a')]));_0x76a208[_0xbb10('0x39')]=_0x76a208[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x76a208[_0xbb10('0x39')]:_0x2b12bd[_0xbb10('0x35')];if(_0x4a9793[_0xbb10('0x37')][_0xbb10('0x46')]){_0x76a208[_0xbb10('0x4b')]=[{'all':!![]}];}_0x76a208=_[_0xbb10('0x42')]({},_0x76a208,_0x4a9793['options']);return db[_0xbb10('0x31')]['find'](_0x76a208)[_0xbb10('0x15')](handleEntityNotFound(_0xcb3354,null))[_0xbb10('0x15')](respondWithResult(_0xcb3354,null))[_0xbb10('0x1f')](handleError(_0xcb3354,null));};exports[_0xbb10('0x4c')]=function(_0x26e66e,_0x32d8e9){return db[_0xbb10('0x31')][_0xbb10('0x4c')](_0x26e66e[_0xbb10('0x4d')],{})[_0xbb10('0x15')](function(_0x44a056){var _0x1c2dce=_0x26e66e[_0xbb10('0x4e')][_0xbb10('0x2b')]({'plain':!![]});if(!_0x1c2dce)throw new Error(_0xbb10('0x4f'));if(_0x1c2dce['role']===_0xbb10('0x4e')){var _0x466eb7=_0x44a056[_0xbb10('0x2b')]({'plain':!![]});var _0x4ce8e7=_0xbb10('0x50');return db[_0xbb10('0x51')]['find']({'where':{'name':_0x4ce8e7,'userProfileId':_0x1c2dce[_0xbb10('0x52')]},'raw':!![]})[_0xbb10('0x15')](function(_0x2909a1){if(_0x2909a1&&_0x2909a1[_0xbb10('0x53')]===0x0){return db[_0xbb10('0x2c')][_0xbb10('0x4c')]({'name':_0x466eb7[_0xbb10('0x2e')],'resourceId':_0x466eb7['id'],'type':_0x2909a1[_0xbb10('0x2e')],'sectionId':_0x2909a1['id']},{})[_0xbb10('0x15')](function(){return _0x44a056;});}else{return _0x44a056;}})[_0xbb10('0x1f')](function(_0x2eb05a){logger[_0xbb10('0x1c')](_0xbb10('0x54'),_0x2eb05a);throw _0x2eb05a;});}return _0x44a056;})['then'](respondWithResult(_0x32d8e9,0xc9))['catch'](handleError(_0x32d8e9,null));};exports[_0xbb10('0x55')]=function(_0x3e6338,_0x3d0cb7){if(_0x3e6338[_0xbb10('0x4d')]['id']){delete _0x3e6338['body']['id'];}return db['ChatWebsite'][_0xbb10('0x56')]({'where':{'id':_0x3e6338[_0xbb10('0x57')]['id']},'include':[{'model':db[_0xbb10('0x58')],'as':_0xbb10('0x49')}]})[_0xbb10('0x15')](handleEntityNotFound(_0x3d0cb7,null))[_0xbb10('0x15')](saveUpdates(_0x3e6338[_0xbb10('0x4d')],null))['then'](respondWithResult(_0x3d0cb7,null))[_0xbb10('0x1f')](handleError(_0x3d0cb7,null));};exports[_0xbb10('0x2a')]=function(_0x4917a5,_0x5e03cb){return db['ChatWebsite'][_0xbb10('0x56')]({'where':{'id':_0x4917a5[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x5e03cb,null))['then'](removeEntity(_0x5e03cb,null))['catch'](handleError(_0x5e03cb,null));};exports['describe']=function(_0x3ebc5f,_0x249b33){return db[_0xbb10('0x31')]['describe']()[_0xbb10('0x15')](respondWithResult(_0x249b33,null))[_0xbb10('0x1f')](handleError(_0x249b33,null));};exports['addDisposition']=function(_0x4a560c,_0x27d7b9){if(_0x4a560c[_0xbb10('0x4d')]['id']){delete _0x4a560c[_0xbb10('0x4d')]['id'];}return db[_0xbb10('0x31')]['find']({'where':{'id':_0x4a560c[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x27d7b9,null))[_0xbb10('0x15')](function(_0x5202d7){if(_0x5202d7){_0x4a560c[_0xbb10('0x4d')][_0xbb10('0x59')]=_0x5202d7['id'];return db[_0xbb10('0x5a')]['create'](_0x4a560c[_0xbb10('0x4d')]);}})[_0xbb10('0x15')](respondWithResult(_0x27d7b9,null))[_0xbb10('0x1f')](handleError(_0x27d7b9,null));};exports[_0xbb10('0x5b')]=function(_0x5e4a6e,_0x251417){var _0x258e55={'raw':![],'where':{}};var _0x108e5b={};var _0x2d0f4b={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xbb10('0x5c')]({'where':{'id':_0x5e4a6e[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x251417,null))[_0xbb10('0x15')](function(_0x12f750){if(_0x12f750){_0x108e5b[_0xbb10('0x35')]=_[_0xbb10('0x36')](db['Disposition']['rawAttributes']);_0x108e5b['query']=_[_0xbb10('0x36')](_0x5e4a6e[_0xbb10('0x37')]);_0x108e5b[_0xbb10('0x38')]=_['intersection'](_0x108e5b['model'],_0x108e5b[_0xbb10('0x37')]);_0x258e55[_0xbb10('0x39')]=_[_0xbb10('0x4a')](_0x108e5b[_0xbb10('0x35')],qs[_0xbb10('0x3a')](_0x5e4a6e[_0xbb10('0x37')]['fields']));_0x258e55[_0xbb10('0x39')]=_0x258e55[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x258e55[_0xbb10('0x39')]:_0x108e5b[_0xbb10('0x35')];if(!_0x5e4a6e['query']['hasOwnProperty']('nolimit')){_0x258e55[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x5e4a6e[_0xbb10('0x37')][_0xbb10('0x27')]);_0x258e55[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x5e4a6e['query'][_0xbb10('0x24')]);}_0x258e55['order']=qs['sort'](_0x5e4a6e['query'][_0xbb10('0x3f')]);_0x258e55[_0xbb10('0x41')]=qs[_0xbb10('0x38')](_[_0xbb10('0x40')](_0x5e4a6e['query'],_0x108e5b[_0xbb10('0x38')]));_0x258e55['where']['ChatWebsiteId']=_0x12f750['id'];if(_0x5e4a6e[_0xbb10('0x37')][_0xbb10('0x44')]){_0x258e55[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x258e55[_0xbb10('0x41')],{'$or':_['map'](_0x258e55[_0xbb10('0x39')],function(_0x19fcec){var _0x2c6429={};_0x2c6429[_0x19fcec]={'$like':'%'+_0x5e4a6e[_0xbb10('0x37')][_0xbb10('0x44')]+'%'};return _0x2c6429;})});}_0x258e55=_[_0xbb10('0x42')]({},_0x258e55,_0x5e4a6e[_0xbb10('0x45')]);return db['Disposition'][_0xbb10('0x26')]({'where':_0x258e55[_0xbb10('0x41')]})[_0xbb10('0x15')](function(_0x322b41){_0x2d0f4b[_0xbb10('0x26')]=_0x322b41;if(_0x5e4a6e[_0xbb10('0x37')][_0xbb10('0x46')]){_0x258e55[_0xbb10('0x4b')]=[{'all':!![]}];}return db['Disposition'][_0xbb10('0x47')](_0x258e55);})[_0xbb10('0x15')](function(_0x145baf){_0x2d0f4b['rows']=_0x145baf;return _0x2d0f4b;});}})['then'](respondWithFilteredResult(_0x251417,_0x258e55))['catch'](handleError(_0x251417,null));};exports[_0xbb10('0x5d')]=function(_0x5a3c44,_0x4e3d6a){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x5a3c44[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x4e3d6a,null))[_0xbb10('0x15')](function(_0x24dca6){if(_0x24dca6){return _0x24dca6[_0xbb10('0x5d')](_0x5a3c44[_0xbb10('0x37')][_0xbb10('0x5e')]);}})['then'](respondWithStatusCode(_0x4e3d6a,null))[_0xbb10('0x1f')](handleError(_0x4e3d6a,null));};exports[_0xbb10('0x5f')]=function(_0x46b6d2,_0x35b811){if(_0x46b6d2['body']['id']){delete _0x46b6d2['body']['id'];}return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x46b6d2[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x35b811,null))['then'](function(_0x17d596){if(_0x17d596){_0x46b6d2[_0xbb10('0x4d')][_0xbb10('0x59')]=_0x17d596['id'];return db[_0xbb10('0x60')][_0xbb10('0x4c')](_0x46b6d2['body']);}})['then'](respondWithResult(_0x35b811,null))[_0xbb10('0x1f')](handleError(_0x35b811,null));};exports[_0xbb10('0x61')]=function(_0x22c030,_0x5239da){var _0x256b35={'raw':![],'where':{}};var _0x13e2ab={};var _0x50bcc9={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xbb10('0x5c')]({'where':{'id':_0x22c030[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x5239da,null))['then'](function(_0x32d5a5){if(_0x32d5a5){_0x13e2ab[_0xbb10('0x35')]=_[_0xbb10('0x36')](db[_0xbb10('0x60')][_0xbb10('0x32')]);_0x13e2ab[_0xbb10('0x37')]=_[_0xbb10('0x36')](_0x22c030[_0xbb10('0x37')]);_0x13e2ab[_0xbb10('0x38')]=_['intersection'](_0x13e2ab[_0xbb10('0x35')],_0x13e2ab[_0xbb10('0x37')]);_0x256b35[_0xbb10('0x39')]=_[_0xbb10('0x4a')](_0x13e2ab[_0xbb10('0x35')],qs[_0xbb10('0x3a')](_0x22c030[_0xbb10('0x37')][_0xbb10('0x3a')]));_0x256b35[_0xbb10('0x39')]=_0x256b35[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x256b35[_0xbb10('0x39')]:_0x13e2ab['model'];if(!_0x22c030['query'][_0xbb10('0x3c')](_0xbb10('0x3d'))){_0x256b35[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x22c030[_0xbb10('0x37')]['limit']);_0x256b35[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x22c030[_0xbb10('0x37')][_0xbb10('0x24')]);}_0x256b35[_0xbb10('0x3e')]=qs[_0xbb10('0x3f')](_0x22c030['query'][_0xbb10('0x3f')]);_0x256b35[_0xbb10('0x41')]=qs['filters'](_[_0xbb10('0x40')](_0x22c030['query'],_0x13e2ab[_0xbb10('0x38')]));_0x256b35[_0xbb10('0x41')][_0xbb10('0x59')]=_0x32d5a5['id'];if(_0x22c030[_0xbb10('0x37')][_0xbb10('0x44')]){_0x256b35['where']=_[_0xbb10('0x42')](_0x256b35['where'],{'$or':_[_0xbb10('0x30')](_0x256b35[_0xbb10('0x39')],function(_0x5d767f){var _0x5aaa20={};_0x5aaa20[_0x5d767f]={'$like':'%'+_0x22c030[_0xbb10('0x37')][_0xbb10('0x44')]+'%'};return _0x5aaa20;})});}_0x256b35=_[_0xbb10('0x42')]({},_0x256b35,_0x22c030[_0xbb10('0x45')]);return db[_0xbb10('0x60')][_0xbb10('0x26')]({'where':_0x256b35[_0xbb10('0x41')]})[_0xbb10('0x15')](function(_0x252ab8){_0x50bcc9[_0xbb10('0x26')]=_0x252ab8;if(_0x22c030[_0xbb10('0x37')]['includeAll']){_0x256b35[_0xbb10('0x4b')]=[{'all':!![]}];}return db[_0xbb10('0x60')][_0xbb10('0x47')](_0x256b35);})[_0xbb10('0x15')](function(_0xfe02f5){_0x50bcc9[_0xbb10('0x48')]=_0xfe02f5;return _0x50bcc9;});}})[_0xbb10('0x15')](respondWithFilteredResult(_0x5239da,_0x256b35))[_0xbb10('0x1f')](handleError(_0x5239da,null));};exports[_0xbb10('0x62')]=function(_0x18a136,_0x1c4235){return db[_0xbb10('0x31')]['find']({'where':{'id':_0x18a136[_0xbb10('0x57')]['id']}})['then'](handleEntityNotFound(_0x1c4235,null))[_0xbb10('0x15')](function(_0x3675cd){if(_0x3675cd){return _0x3675cd[_0xbb10('0x62')](_0x18a136[_0xbb10('0x37')][_0xbb10('0x5e')]);}})['then'](respondWithStatusCode(_0x1c4235,null))[_0xbb10('0x1f')](handleError(_0x1c4235,null));};exports[_0xbb10('0x63')]=function(_0x44d1d2,_0x12e89d){_0x44d1d2[_0xbb10('0x4d')][_0xbb10('0x64')]=_0x44d1d2['file']['filename'];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x44d1d2[_0xbb10('0x57')]['id']}})['then'](handleEntityNotFound(_0x12e89d,null))[_0xbb10('0x15')](saveUpdates(_0x44d1d2[_0xbb10('0x4d')],null))['then'](respondWithResult(_0x12e89d,null))[_0xbb10('0x1f')](handleError(_0x12e89d,null));};exports[_0xbb10('0x65')]=function(_0x5642c3,_0xdd3c7e){_0x5642c3['body'][_0xbb10('0x66')]=_0x5642c3[_0xbb10('0x67')]['filename'];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x5642c3['params']['id']}})['then'](handleEntityNotFound(_0xdd3c7e,null))[_0xbb10('0x15')](saveUpdates(_0x5642c3[_0xbb10('0x4d')],null))[_0xbb10('0x15')](respondWithResult(_0xdd3c7e,null))[_0xbb10('0x1f')](handleError(_0xdd3c7e,null));};exports[_0xbb10('0x68')]=function(_0x4c3bdc,_0xe7c0a3){_0x4c3bdc[_0xbb10('0x4d')][_0xbb10('0x69')]=_0x4c3bdc['file'][_0xbb10('0x6a')];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x4c3bdc[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0xe7c0a3,null))[_0xbb10('0x15')](saveUpdates(_0x4c3bdc[_0xbb10('0x4d')],null))[_0xbb10('0x15')](respondWithResult(_0xe7c0a3,null))[_0xbb10('0x1f')](handleError(_0xe7c0a3,null));};exports['addSystemAvatar']=function(_0x4fc544,_0x37e40c){_0x4fc544[_0xbb10('0x4d')][_0xbb10('0x6b')]=_0x4fc544[_0xbb10('0x67')][_0xbb10('0x6a')];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x4fc544[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x37e40c,null))[_0xbb10('0x15')](saveUpdates(_0x4fc544[_0xbb10('0x4d')],null))[_0xbb10('0x15')](respondWithResult(_0x37e40c,null))[_0xbb10('0x1f')](handleError(_0x37e40c,null));};exports['getLogo']=function(_0x1e022d,_0x123587){var _0x24076a=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x6e'));var _0x4258fc={'where':{'id':_0x1e022d[_0xbb10('0x57')]['id']},'attributes':['id',_0xbb10('0x64')],'raw':!![]};var _0x3c92f4=![];return require(_0xbb10('0x6f'))['getLicense']()[_0xbb10('0x15')](function(_0x5e1ac5){if(_0x5e1ac5){_0x3c92f4=_0x5e1ac5[_0xbb10('0x70')];}})[_0xbb10('0x15')](function(){return db[_0xbb10('0x31')][_0xbb10('0x56')](_0x4258fc);})[_0xbb10('0x15')](handleEntityNotFound(_0x123587,null))[_0xbb10('0x15')](function(_0x4e9cad){if(_0x4e9cad){if(!_[_0xbb10('0x71')](_0x4e9cad['sitepic'])){if(fs[_0xbb10('0x72')](path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x73'),_0x4e9cad[_0xbb10('0x64')]))&&_0x3c92f4){_0x24076a=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x73'),_0x4e9cad[_0xbb10('0x64')]);}}return _0x123587[_0xbb10('0x74')](_0x24076a);}})[_0xbb10('0x1f')](handleError(_0x123587,null));};exports[_0xbb10('0x75')]=function(_0x589565,_0x3696b3){var _0x516520=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x76'));var _0x7673a0={'where':{'id':_0x589565[_0xbb10('0x57')]['id']},'attributes':['id',_0xbb10('0x66')],'raw':!![]};return db[_0xbb10('0x31')]['find'](_0x7673a0)[_0xbb10('0x15')](handleEntityNotFound(_0x3696b3,null))['then'](function(_0x51063a){if(_0x51063a){if(!_[_0xbb10('0x71')](_0x51063a[_0xbb10('0x66')])){if(fs[_0xbb10('0x72')](path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x77'),_0x51063a['agentAvatar']))){_0x516520=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x77'),_0x51063a[_0xbb10('0x66')]);}}return _0x3696b3[_0xbb10('0x74')](_0x516520);}})[_0xbb10('0x1f')](handleError(_0x3696b3,null));};exports['getCustomerAvatar']=function(_0xdfdc42,_0x4093a4){var _0xb7c454=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x78'));var _0x2764e1={'where':{'id':_0xdfdc42['params']['id']},'attributes':['id',_0xbb10('0x69'),'showCustomerAvatar'],'raw':!![]};return db[_0xbb10('0x31')]['find'](_0x2764e1)['then'](handleEntityNotFound(_0x4093a4,null))[_0xbb10('0x15')](function(_0x225064){if(_0x225064){if(!_[_0xbb10('0x71')](_0x225064[_0xbb10('0x69')])){if(fs[_0xbb10('0x72')](path['join'](config[_0xbb10('0x6d')],'server/files/images/avatars/',_0x225064['customerAvatar']))&&_0x225064['showCustomerAvatar']){_0xb7c454=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x77'),_0x225064[_0xbb10('0x69')]);}}return _0x4093a4[_0xbb10('0x74')](_0xb7c454);}})['catch'](handleError(_0x4093a4,null));};exports[_0xbb10('0x79')]=function(_0x42a2d7,_0x352de4){var _0x1bd1c1=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x7a'));var _0x485c1a={'where':{'id':_0x42a2d7['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xbb10('0x31')][_0xbb10('0x56')](_0x485c1a)[_0xbb10('0x15')](handleEntityNotFound(_0x352de4,null))[_0xbb10('0x15')](function(_0x25cba1){if(_0x25cba1){if(!_[_0xbb10('0x71')](_0x25cba1[_0xbb10('0x6b')])){if(fs[_0xbb10('0x72')](path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],'server/files/images/avatars/',_0x25cba1['systemAvatar']))){_0x1bd1c1=path['join'](config[_0xbb10('0x6d')],_0xbb10('0x77'),_0x25cba1[_0xbb10('0x6b')]);}}return _0x352de4['download'](_0x1bd1c1);}})[_0xbb10('0x1f')](handleError(_0x352de4,null));};exports[_0xbb10('0x7b')]=function(_0x2c638d,_0x290280){var _0x2a6589=require(_0xbb10('0x7c'));var _0x485f46=new _0x2a6589();var _0x57fe03=_0x485f46[_0xbb10('0x7d')](_0x2c638d['headers'][_0xbb10('0x7e')])[_0xbb10('0x7f')]();var _0x152ca9={'body':_0x2c638d[_0xbb10('0x4d')],'channel':_0xbb10('0x80')};var _0x2dfa04=[];var _0x13a29e=[];var _0x1388f6={};var _0xd3c2c8=![];return db[_0xbb10('0x81')]['describe']()[_0xbb10('0x15')](function(_0x5a9277){if(!_0x5a9277){throw new db[(_0xbb10('0x82'))]['ValidationError'](_0xbb10('0x83'));}_0x2dfa04=_[_0xbb10('0x84')](_[_0xbb10('0x36')](_0x5a9277),[_0xbb10('0x85'),'updatedAt']);_0x13a29e=_[_0xbb10('0x84')](_['keys'](_0x5a9277),[_0xbb10('0x85'),_0xbb10('0x86'),_0xbb10('0x87'),'ListId']);if(_0x2c638d[_0xbb10('0x4d')]['id']){delete _0x2c638d[_0xbb10('0x4d')]['id'];}if(_[_0xbb10('0x71')](_0x2c638d[_0xbb10('0x4d')][_0xbb10('0x88')])){throw new db[(_0xbb10('0x82'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x2c638d[_0xbb10('0x4d')]['body'])||_0x2c638d[_0xbb10('0x4d')]['body']===''){throw new db[(_0xbb10('0x82'))][(_0xbb10('0x89'))](_0xbb10('0x8a'));}if(_['isNil'](_0x2c638d['body'][_0xbb10('0x8b')])){throw new db[(_0xbb10('0x82'))][(_0xbb10('0x89'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x13a29e);}if(!_[_0xbb10('0x8c')](_0x13a29e,_0x2c638d[_0xbb10('0x4d')][_0xbb10('0x8b')])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x13a29e);}_0x1388f6[_0x2c638d[_0xbb10('0x4d')]['mapKey']]=_0x2c638d[_0xbb10('0x4d')][_0xbb10('0x88')];})[_0xbb10('0x15')](function(){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x2c638d[_0xbb10('0x57')]['id']},'include':[{'model':db[_0xbb10('0x8d')],'as':_0xbb10('0x8e'),'include':[{'model':db[_0xbb10('0x81')],'as':_0xbb10('0x8f'),'where':_0x1388f6,'limit':0x1,'order':[[_0xbb10('0x86'),'DESC']]}]},{'model':db[_0xbb10('0x90')],'as':_0xbb10('0x91')}]});})['then'](handleEntityNotFound(_0x290280,null))[_0xbb10('0x15')](function(_0x5e3fac){if(_0x5e3fac&&_0x5e3fac['List']){_0x152ca9[_0xbb10('0x92')]=_0x5e3fac;_0x152ca9[_0xbb10('0x93')]=_0x5e3fac[_0xbb10('0x91')];_0x152ca9[_0xbb10('0x94')]=_0x5e3fac[_0xbb10('0x8e')];_0x152ca9['applications']=_[_0xbb10('0x95')](_0x152ca9[_0xbb10('0x93')],['priority'],[_0xbb10('0x96')]);if(_0x152ca9[_0xbb10('0x92')]['Applications']){delete _0x152ca9[_0xbb10('0x92')]['Applications'];}if(_0x152ca9[_0xbb10('0x92')][_0xbb10('0x8e')]&&_0x152ca9[_0xbb10('0x92')][_0xbb10('0x8e')][_0xbb10('0x8f')][_0xbb10('0x3b')]){return _0x152ca9[_0xbb10('0x92')]['List'][_0xbb10('0x8f')][0x0];}var _0x4720a1=_[_0xbb10('0x97')](_0x2c638d[_0xbb10('0x4d')],{'firstName':_0x2c638d[_0xbb10('0x4d')][_0xbb10('0x88')],'ListId':_0x5e3fac['ListId']});_0x4720a1[_0x2c638d['body']['mapKey']]=_0x2c638d[_0xbb10('0x4d')][_0xbb10('0x88')];return db[_0xbb10('0x81')][_0xbb10('0x4c')](_0x4720a1,{'fields':_0x2dfa04,'raw':!![]});}})['then'](handleEntityNotFound(_0x290280,null))[_0xbb10('0x15')](function(_0x3d7b4d){_0x152ca9[_0xbb10('0x98')]=_0x3d7b4d;var _0x577d27=_0x2c638d['body'][_0xbb10('0x99')];if(_0x2c638d['headers'][_0xbb10('0x9a')]){_0x577d27=_0x2c638d[_0xbb10('0x9b')][_0xbb10('0x9a')];}else if(_0x2c638d[_0xbb10('0x9b')][_0xbb10('0x9c')]){_0x577d27=_[_0xbb10('0x9d')](_0x2c638d[_0xbb10('0x9b')]['x-forwarded-for'][_0xbb10('0x9e')](','));}if(_0x3d7b4d){var _0x1eca6c={'ContactId':_0x3d7b4d['id'],'ChatWebsiteId':_0x2c638d['params']['id'],'from':(_0x3d7b4d[_0xbb10('0x9f')]||'')+'\x20'+(_0x3d7b4d[_0xbb10('0xa0')]||''),'customerIp':_0x577d27,'customerPort':_0x2c638d[_0xbb10('0x9b')]['x-real-port']?_0x2c638d['headers']['x-real-port']:null,'referer':_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xa1')],'browserName':_0x57fe03['browser'][_0xbb10('0x2e')]&&_0x57fe03[_0xbb10('0xa2')][_0xbb10('0xa3')]?util[_0xbb10('0xa4')](_0xbb10('0xa5'),_0x57fe03[_0xbb10('0xa2')][_0xbb10('0x2e')],_0x57fe03['browser'][_0xbb10('0xa3')]):'unknown','browserVersion':_0x57fe03['browser']['version']||_0xbb10('0xa6'),'osName':util[_0xbb10('0xa4')]('%s\x20%s',_0x57fe03['os'][_0xbb10('0x2e')],_0x57fe03['os']['version']),'osVersion':_0x57fe03['os'][_0xbb10('0xa3')],'deviceModel':_0x57fe03[_0xbb10('0xa7')][_0xbb10('0x35')]&&_0x57fe03['device']['vendor']?util[_0xbb10('0xa4')]('%s\x20%s\x20%s',_0x57fe03[_0xbb10('0xa7')][_0xbb10('0x35')],_0x57fe03['device']['vendor'],_0x57fe03[_0xbb10('0xa7')][_0xbb10('0x43')]):null,'deviceVendor':_0x57fe03[_0xbb10('0xa7')]['vendor'],'deviceType':_0x57fe03[_0xbb10('0xa7')][_0xbb10('0x43')],'formData':JSON[_0xbb10('0x1b')](_0x2c638d['body'])};var _0x414066={'ChatWebsiteId':_0x2c638d[_0xbb10('0x57')]['id'],'closed':![]};if(_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xa8')]){_0x414066[_0xbb10('0xa8')]=_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xa8')];return db[_0xbb10('0xa9')][_0xbb10('0x56')]({'where':_0x414066})[_0xbb10('0x15')](function(_0x10ca4a){if(_0x10ca4a){return[_0x10ca4a,![]];}_0x1eca6c[_0xbb10('0xa8')]=_0x2c638d[_0xbb10('0x4d')]['threadId'];_0x1eca6c['externalUrl']=_0x2c638d[_0xbb10('0x4d')]['externalUrl'];return db[_0xbb10('0xa9')][_0xbb10('0x4c')](_0x1eca6c)[_0xbb10('0x15')](function(_0x4e5236){return[_0x4e5236,!![]];});});}_0x414066[_0xbb10('0xaa')]=_0x3d7b4d['id'];if(_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xab')]&&_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xab')]['id']){_0x414066['id']=_0x2c638d['body'][_0xbb10('0xab')]['id'];return db[_0xbb10('0xa9')][_0xbb10('0x56')]({'where':_0x414066})[_0xbb10('0x15')](function(_0x150d4c){if(_0x150d4c){return[_0x150d4c,![]];}return db[_0xbb10('0xa9')]['create'](_0x1eca6c)[_0xbb10('0x15')](function(_0x2f0262){return[_0x2f0262,!![]];});});}return db['ChatInteraction'][_0xbb10('0x4c')](_0x1eca6c)[_0xbb10('0x15')](function(_0x2d0de5){return[_0x2d0de5,!![]];});}})[_0xbb10('0xac')](function(_0x3abc15,_0x43df3c){if(_0x3abc15){_0xd3c2c8=_0x43df3c;if(!_0x43df3c){var _0x45593c={'from':(_0x152ca9[_0xbb10('0x98')][_0xbb10('0x9f')]||'')+'\x20'+(_0x152ca9[_0xbb10('0x98')][_0xbb10('0xa0')]||'')};if(_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xa8')]&&_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xad')]&&_0x2c638d['body'][_0xbb10('0xa8')]!=_0x2c638d[_0xbb10('0x4d')]['messageId']){_0x45593c['threadId']=_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xad')];}return _0x3abc15[_0xbb10('0x55')](_0x45593c);}else{return _0x3abc15;}}})[_0xbb10('0x15')](function(_0x27fb82){_0x152ca9[_0xbb10('0xab')]=_0x27fb82[_0xbb10('0x2b')]({'plain':!![]});_0x152ca9[_0xbb10('0xab')][_0xbb10('0xae')]=_0xd3c2c8;if(_0x152ca9['interaction']['created']){if(_0x152ca9['account']['autoclose']){_0x152ca9['applications']['push']({'id':0x0,'priority':_0x152ca9[_0xbb10('0x93')][_0xbb10('0x3b')]+0x1,'app':_0xbb10('0xaf'),'appdata':_0xbb10('0xb0'),'interval':'*,*,*,*'});}}return db[_0xbb10('0xb1')][_0xbb10('0x4c')]({'body':_0x2c638d[_0xbb10('0x4d')][_0xbb10('0x4d')],'ChatWebsiteId':_0x2c638d['params']['id'],'ChatInteractionId':_0x27fb82['id'],'direction':'in','ContactId':_0x152ca9['contact']['id'],'AttachmentId':_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xb2')]});})['then'](function(_0x581832){_0x152ca9[_0xbb10('0x1e')]=_0x581832;if(_0x152ca9[_0xbb10('0xab')][_0xbb10('0xb3')]){return db[_0xbb10('0xb4')][_0xbb10('0x56')]({'attributes':['id','name'],'where':{'id':_0x152ca9[_0xbb10('0xab')]['UserId']}})['then'](function(_0x9d96e2){if(_0x9d96e2){_0x152ca9[_0xbb10('0x93')][_0xbb10('0xb5')]({'id':0x0,'priority':0x0,'app':_0xbb10('0xb6'),'appdata':_0x9d96e2[_0xbb10('0x2e')]+','+(_0x152ca9[_0xbb10('0x92')]['waitForTheAssignedAgent']||0xa),'interval':_0xbb10('0xb7')});_0x152ca9[_0xbb10('0xb8')]=!![];}return respondWithRpcPromise(_0xbb10('0xb9'),_0xbb10('0xba'),_0x152ca9);});}return respondWithRpcPromise(_0xbb10('0xb9'),_0xbb10('0xba'),_0x152ca9);})[_0xbb10('0x15')](function(_0xce60f4){respondWithRpcPromise(_0xbb10('0xbb'),_0xbb10('0xbb'),{'event':_0xbb10('0x7b'),'message':_0xce60f4},client9002);return _0xce60f4;})[_0xbb10('0x15')](respondWithResult(_0x290280,null))[_0xbb10('0x1f')](handleError(_0x290280,null));};exports[_0xbb10('0xbc')]=function(_0x45b31c,_0x3cf074){var _0x232a1b,_0xbdc520,_0x246ee3;var _0x43a203=[];var _0x1ca43e={};var _0x1f84b0=_0x45b31c['files']||[];var _0x2158e2=[];var _0x47883f;return db[_0xbb10('0x81')][_0xbb10('0xbd')]()[_0xbb10('0x15')](function(_0x2b1f0f){if(!_0x2b1f0f){throw new db[(_0xbb10('0x82'))]['ValidationError']('no\x20available\x20attributes');}_0x43a203=_['difference'](_[_0xbb10('0x36')](_0x2b1f0f),[_0xbb10('0x85'),'updatedAt',_0xbb10('0x87'),_0xbb10('0xbe')]);if(_0x45b31c[_0xbb10('0x4d')]['id']){delete _0x45b31c['body']['id'];}if(_[_0xbb10('0x71')](_0x45b31c[_0xbb10('0x4d')][_0xbb10('0x88')])){throw _0x3cf074['status'](0x1f4)[_0xbb10('0xbf')](new db['Sequelize'][(_0xbb10('0x89'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0x45b31c['body']['body'])||_0x45b31c['body']['body']===''){throw _0x3cf074[_0xbb10('0x21')](0x1f4)[_0xbb10('0xbf')](new db[(_0xbb10('0x82'))][(_0xbb10('0x89'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xbb10('0x71')](_0x45b31c[_0xbb10('0x4d')][_0xbb10('0xc0')])){throw _0x3cf074[_0xbb10('0x21')](0x1f4)[_0xbb10('0xbf')](new db[(_0xbb10('0x82'))][(_0xbb10('0x89'))](_0xbb10('0xc1')+_0x43a203));}if(!_[_0xbb10('0x8c')](_0x43a203,_0x45b31c[_0xbb10('0x4d')]['mapKeyOffline'])){throw _0x3cf074[_0xbb10('0x21')](0x1f4)[_0xbb10('0xbf')](new db[(_0xbb10('0x82'))]['ValidationError'](_0xbb10('0xc2')+_0x43a203));}_0x1ca43e[_0x45b31c[_0xbb10('0x4d')][_0xbb10('0xc0')]]=_0x45b31c[_0xbb10('0x4d')]['from'];})[_0xbb10('0x15')](function(){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x45b31c[_0xbb10('0x57')]['id']},'include':[{'model':db[_0xbb10('0x8d')],'as':_0xbb10('0x8e')},{'model':db[_0xbb10('0xc3')],'as':_0xbb10('0xc3')}]});})[_0xbb10('0x15')](handleEntityNotFound(_0x3cf074,null))[_0xbb10('0x15')](function(_0x3c01ff){if(_0x3c01ff&&_0x3c01ff['List']){_0xbdc520=_0x3c01ff;var _0x59d917=_[_0xbb10('0x97')](_0x45b31c['body'],{'firstName':_0x45b31c['body'][_0xbb10('0x88')],'phone':_0x45b31c[_0xbb10('0x4d')]['from'],'ListId':_0x3c01ff[_0xbb10('0xbe')]});_0x59d917[_0x45b31c[_0xbb10('0x4d')]['mapKeyOffline']]=_0x45b31c[_0xbb10('0x4d')][_0xbb10('0x88')];return db[_0xbb10('0x81')][_0xbb10('0xc4')]({'where':_0x1ca43e,'defaults':_0x59d917});}})[_0xbb10('0xac')](function(_0x4d2c76){if(_0x4d2c76){_0x246ee3=_0x4d2c76;var _0x4fc260=fs['readFileSync'](path[_0xbb10('0x6c')](config['root'],_0xbb10('0xc5')),'utf8');var _0x510467=ejs[_0xbb10('0xc6')](_0x4fc260,{'body':_[_0xbb10('0xc7')](_0x45b31c[_0xbb10('0x4d')][_0xbb10('0x4d')]),'bodyTitle':_0xbdc520[_0xbb10('0xc8')]});return db[_0xbb10('0xc9')]['create']({'body':_0x510467,'plainBody':htmlToText['fromString'](_0x510467),'ContactId':_0x4d2c76['id'],'ChatWebsiteId':_0xbdc520['id']});}})['then'](function(_0x5ad067){_0x47883f=_0x5ad067;if(_0x1f84b0[_0xbb10('0x3b')]){var _0x18632f=_0x1f84b0[_0xbb10('0x30')](function(_0x26bc1c){return{'name':_0x26bc1c[_0xbb10('0xca')],'basename':_0x26bc1c[_0xbb10('0x6a')],'type':_0x26bc1c['mimetype'],'ChatOfflineMessageId':_0x5ad067['id']};});_0x2158e2=_0x18632f[_0xbb10('0x30')](_0x207bbb=>{var _0x35586a={'filename':_0x207bbb[_0xbb10('0x2e')],'path':path['join'](config[_0xbb10('0x6d')],'server','files',_0xbb10('0xcb'),_0xbb10('0xcc'),_0x207bbb[_0xbb10('0xcd')])};return _0x35586a;});if(!_0xbdc520[_0xbb10('0xce')]){return db[_0xbb10('0xcf')][_0xbb10('0xd0')](function(_0x4b7bf8){return db[_0xbb10('0xd1')][_0xbb10('0xd2')](_0x18632f,{'transaction':_0x4b7bf8});});}}})[_0xbb10('0x15')](function(){if(_0x47883f){_0x232a1b=_0x47883f;return db[_0xbb10('0xc3')][_0xbb10('0x5c')]({'where':{'active':!![]},'include':[{'model':db[_0xbb10('0xd3')],'as':_0xbb10('0xd4'),'raw':!![]}]});}})['then'](function(_0x2cbbb6){if(_0x2cbbb6&&_0x2cbbb6[_0xbb10('0xd4')]&&_0xbdc520[_0xbb10('0xd5')]&&_0xbdc520['forwardOfflineAddress']){var _0x595664={'tls':{'rejectUnauthorized':![]}};if(_0x2cbbb6[_0xbb10('0xd4')][_0xbb10('0xd6')]){_0x595664[_0xbb10('0xd6')]=_0x2cbbb6[_0xbb10('0xd4')][_0xbb10('0xd6')];}else{_0x595664[_0xbb10('0xd7')]=_0x2cbbb6[_0xbb10('0xd4')]['host'];_0x595664[_0xbb10('0xd8')]=_0x2cbbb6[_0xbb10('0xd4')][_0xbb10('0xd8')];_0x595664['secure']=_0x2cbbb6['Smtp']['secure'];}if(_0x2cbbb6['Smtp'][_0xbb10('0xd9')]){_0x595664[_0xbb10('0xda')]={'user':_0x2cbbb6[_0xbb10('0xd4')][_0xbb10('0x4e')],'pass':_0x2cbbb6['Smtp'][_0xbb10('0xdb')]};}return respondWithRpcPromise('SendMail',_0xbb10('0xdc'),{'account':_0x595664,'message':{'from':util[_0xbb10('0xa4')](_0xbb10('0xdd'),_0x2cbbb6[_0xbb10('0x2e')],_0x2cbbb6[_0xbb10('0xde')]||_0x2cbbb6[_0xbb10('0xd4')][_0xbb10('0x4e')]),'to':_0xbdc520[_0xbb10('0xdf')],'subject':_0xbdc520[_0xbb10('0xe0')],'html':_0x232a1b[_0xbb10('0x4d')],'attachments':_0x2158e2}},client9003)[_0xbb10('0x15')](function(){return _0x232a1b;})[_0xbb10('0x1f')](function(_0x4c969d){console[_0xbb10('0x1c')](_0x4c969d);});}})[_0xbb10('0x15')](function(){if(_0xbdc520&&_0xbdc520[_0xbb10('0xce')]&&_0xbdc520['MailAccountId']){var _0x204ebf=[];if(_0x1f84b0['length']){_0x204ebf=_0x1f84b0[_0xbb10('0x30')](function(_0x446bcf){return{'name':_0x446bcf[_0xbb10('0xca')],'basename':_0x446bcf[_0xbb10('0x6a')],'type':_0x446bcf[_0xbb10('0xe1')],'ChatOfflineMessageId':_0x47883f['id']};});}var _0x533327;if(!_['isNil'](_0xbdc520[_0xbb10('0xe2')])){var _0x4cf5cc=_['map'](_0x45b31c[_0xbb10('0x4d')],function(_0x5621b1){return _0x5621b1;});var _0xa9ed32=_[_0xbb10('0xe3')](_0x4cf5cc)[0x0];var _0x3f0a4e=_[_0xbb10('0xe4')](_0xa9ed32,function(_0x309b4a){return _0x309b4a;});_0x533327=_0x3f0a4e[0x1][_0xbdc520[_0xbb10('0xe2')]];}var _0x3a0940={'from':_0x246ee3[_0xbb10('0xde')],'firstName':_0x246ee3['firstName'],'lastName':_0x246ee3[_0xbb10('0xa0')],'mapKey':'email','message':{'from':_0x246ee3[_0xbb10('0xde')],'to':_0xbdc520['MailAccount'][_0xbb10('0xde')],'cc':'','subject':_[_0xbb10('0x71')](_0x533327)?_0xbdc520['offlineMessageSubject']:_0x533327,'messageId':'','sentAt':new Date(),'attach':_0x204ebf[_0xbb10('0x3b')],'attachments':_0x204ebf,'originChannel':_0xbb10('0xe5'),'ChatWebsiteId':_0xbdc520['id'],'ChatOfflineMessageId':_0x232a1b['id'],'originTo':_0xbdc520[_0xbb10('0xc3')]['email']},'body':_0x232a1b[_0xbb10('0x4d')]};var _0x1a8503={'account':{'id':_0xbdc520[_0xbb10('0xe6')]},'body':_0x3a0940,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xbb10('0xe7'),_0xbb10('0xe8'),_0x1a8503,client9001)[_0xbb10('0x15')](function(){return _0x232a1b;})['catch'](function(_0x3e6756){console['error'](_0x3e6756);});}return;})[_0xbb10('0x15')](function(){if(_0x232a1b){return _0x232a1b;}})[_0xbb10('0x15')](respondWithResult(_0x3cf074,null))[_0xbb10('0x1f')](function(_0xd94118){console[_0xbb10('0x1c')](_0xbb10('0x1f'),_0xd94118);for(var _0x23e592 of _0x1f84b0){var _0x44d28a=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],'server','files',_0xbb10('0xcb'),_0xbb10('0xcc'),_0x23e592[_0xbb10('0x6a')]);fs_extra['remove'](_0x44d28a)[_0xbb10('0x1f')](function(_0x1067f2){console[_0xbb10('0x1c')](_0xbb10('0xe9'),_0x44d28a,_0x1067f2);});}});};exports[_0xbb10('0xea')]=function(_0x431673,_0x81d970){return db[_0xbb10('0xa9')][_0xbb10('0x56')]({'where':{'id':_0x431673['params']['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x81d970,null))[_0xbb10('0x15')](function(_0x4102af){if(_0x4102af){return _0x4102af[_0xbb10('0xea')](_0x431673['body'][_0xbb10('0x5e')],_[_0xbb10('0xeb')](_0x431673[_0xbb10('0x4d')],['ids','id'])||{});}})['then'](respondWithResult(_0x81d970,null))[_0xbb10('0x1f')](handleError(_0x81d970,null));};exports['getInteractions']=function(_0x37c688,_0x4874be){var _0x3fd69e={'raw':![],'where':{}};var _0x1aa860={};var _0x28cd8e={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0x5c')]({'where':{'id':_0x37c688[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x4874be,null))['then'](function(_0x20c514){if(_0x20c514){_0x1aa860[_0xbb10('0x35')]=_[_0xbb10('0x36')](db[_0xbb10('0xa9')][_0xbb10('0x32')]);_0x1aa860[_0xbb10('0x37')]=_['keys'](_0x37c688[_0xbb10('0x37')]);_0x1aa860[_0xbb10('0x38')]=_[_0xbb10('0x4a')](_0x1aa860[_0xbb10('0x35')],_0x1aa860[_0xbb10('0x37')]);_0x3fd69e[_0xbb10('0x39')]=_[_0xbb10('0x4a')](_0x1aa860['model'],qs[_0xbb10('0x3a')](_0x37c688[_0xbb10('0x37')][_0xbb10('0x3a')]));_0x3fd69e['attributes']=_0x3fd69e[_0xbb10('0x39')]['length']?_0x3fd69e[_0xbb10('0x39')]:_0x1aa860[_0xbb10('0x35')];if(!_0x37c688[_0xbb10('0x37')]['hasOwnProperty']('nolimit')){_0x3fd69e[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x37c688[_0xbb10('0x37')][_0xbb10('0x27')]);_0x3fd69e[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x37c688[_0xbb10('0x37')][_0xbb10('0x24')]);}_0x3fd69e[_0xbb10('0x3e')]=qs[_0xbb10('0x3f')](_0x37c688[_0xbb10('0x37')]['sort']);_0x3fd69e['where']=qs[_0xbb10('0x38')](_[_0xbb10('0x40')](_0x37c688['query'],_0x1aa860['filters']));_0x3fd69e[_0xbb10('0x41')][_0xbb10('0x59')]=_0x20c514['id'];if(_0x37c688[_0xbb10('0x37')]['filter']){_0x3fd69e[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x3fd69e['where'],{'$or':_[_0xbb10('0x30')](_0x3fd69e[_0xbb10('0x39')],function(_0x544c9c){var _0x5a5349={};_0x5a5349[_0x544c9c]={'$like':'%'+_0x37c688[_0xbb10('0x37')][_0xbb10('0x44')]+'%'};return _0x5a5349;})});}_0x3fd69e=_[_0xbb10('0x42')]({},_0x3fd69e,_0x37c688['options']);return db['ChatInteraction'][_0xbb10('0x26')]({'where':_0x3fd69e[_0xbb10('0x41')]})['then'](function(_0x1e9dd2){_0x28cd8e[_0xbb10('0x26')]=_0x1e9dd2;if(_0x37c688['query'][_0xbb10('0x46')]){_0x3fd69e[_0xbb10('0x4b')]=[{'model':db[_0xbb10('0x81')],'as':_0xbb10('0xec'),'required':![]},{'model':db['User'],'as':_0xbb10('0xed'),'attributes':['name',_0xbb10('0xee'),_0xbb10('0xef')],'required':![]},{'model':db[_0xbb10('0xf0')],'as':_0xbb10('0xf1'),'attributes':['id',_0xbb10('0x2e'),_0xbb10('0xf2')],'where':_0x37c688[_0xbb10('0x37')][_0xbb10('0xf3')]?{'id':_0x37c688['query'][_0xbb10('0xf3')]}:undefined,'required':_0x37c688[_0xbb10('0x37')][_0xbb10('0xf3')]?!![]:![]}];}return db[_0xbb10('0xa9')]['findAll'](_0x3fd69e);})['then'](function(_0xd23108){_0x28cd8e[_0xbb10('0x48')]=_0xd23108;return _0x28cd8e;});}})[_0xbb10('0x15')](respondWithFilteredResult(_0x4874be,_0x3fd69e))[_0xbb10('0x1f')](handleError(_0x4874be,null));};function iftimePromise(_0x5b2e0b,_0x215028){return respondWithRpcPromise(_0xbb10('0xf4'),'getSnippet',{'command':_0x215028[_0xbb10('0xf5')]?util['format']('iftime\x20%s,%s',_0x5b2e0b[_0xbb10('0xf6')],_0x215028[_0xbb10('0xf5')]):util[_0xbb10('0xa4')](_0xbb10('0xf7'),_0x5b2e0b[_0xbb10('0xf6')])},client9002)['then'](function(_0x38403e){var _0x262078=_0x38403e&&_0x38403e[_0xbb10('0xf8')](_0xbb10('0xf9'))>=0x0?!![]:![];logger[_0xbb10('0x16')](_0xbb10('0xfa'),_0x215028['id'],_0x5b2e0b['id'],_0x5b2e0b[_0xbb10('0xf6')],_0x262078?_0xbb10('0xfb'):_0xbb10('0xfc'),_0x215028[_0xbb10('0xf5')]?_0x215028[_0xbb10('0xf5')]:_0xbb10('0xfd'));return _0x262078;})[_0xbb10('0x1f')](function(_0x9fcc26){logger[_0xbb10('0x1c')](_0xbb10('0xfa'),_0x215028['id'],_0x5b2e0b['id'],_0x5b2e0b[_0xbb10('0xf6')],util[_0xbb10('0xfe')](_0x9fcc26,{'showHidden':![],'depth':null}),_0x215028[_0xbb10('0xf5')]?_0x215028[_0xbb10('0xf5')]:_0xbb10('0xfd'));return![];});}exports[_0xbb10('0xff')]=function(_0x1b4873,_0x1ca72c){var _0x36615e=0x0;var _0x2f38d3=0x0;var _0x5a4d21=![];var _0x57b891;var _0x19eaa2;return db[_0xbb10('0x31')]['find']({'where':{'id':_0x1b4873[_0xbb10('0x57')]['id']},'include':[{'model':db[_0xbb10('0x100')],'as':'Interval','include':[{'model':db[_0xbb10('0x100')],'as':_0xbb10('0x101'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xbb10('0x15')](handleEntityNotFound(_0x1ca72c,null))[_0xbb10('0x15')](function(_0xb4fdea){if(_0xb4fdea){_0x57b891=_0xb4fdea;return _0xb4fdea[_0xbb10('0x102')]({'raw':!![]});}})['then'](function(_0x170061){if(_0x57b891){if(_0x170061){_0x19eaa2=_0x170061;}}return require(_0xbb10('0x6f'))[_0xbb10('0x103')]();})[_0xbb10('0x15')](function(_0x5c0732){if(_0x5c0732){_0x2f38d3=_0x5c0732[_0xbb10('0x104')];_0x5a4d21=_0x5c0732[_0xbb10('0x70')];}})[_0xbb10('0x15')](function(){return db[_0xbb10('0xa9')][_0xbb10('0x26')]({'where':{'closed':![]}});})[_0xbb10('0x15')](function(_0x2f626b){_0x36615e=_0x2f626b;if(_0x2f38d3&&_0x2f626b>_0x2f38d3){return db[_0xbb10('0x105')][_0xbb10('0x5c')]({'where':{'id':0x1}})[_0xbb10('0x15')](function(_0x2fd942){if(_0x2fd942){_0x2fd942['increment'](_0xbb10('0x106'));}});}})[_0xbb10('0x15')](function(){if(_0x57b891[_0xbb10('0x100')]&&_0x57b891[_0xbb10('0x100')]['Intervals']){var _0x5116d8=[];for(var _0x8bfc0f=0x0;_0x8bfc0f<_0x57b891[_0xbb10('0x100')][_0xbb10('0x101')][_0xbb10('0x3b')];_0x8bfc0f++){var _0x5f0576=_0x57b891[_0xbb10('0x100')][_0xbb10('0x101')][_0x8bfc0f][_0xbb10('0x2b')]({'plain':!![]});_0x5116d8['push'](iftimePromise(_0x5f0576,_0x57b891));}return BPromise['all'](_0x5116d8)[_0xbb10('0x15')](function(_0xd6b33){return _['some'](_0xd6b33);});}else{return!![];}})['then'](function(_0x424bb1){var _0x615606=fs[_0xbb10('0x107')](path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x108')),'utf8');var _0x408544={'remote':_0x57b891[_0xbb10('0x109')],'query':querystring[_0xbb10('0x1b')](_[_0xbb10('0x42')](_0x57b891[_0xbb10('0x2b')]({'plain':!![]}),{'customerIp':_0x1b4873[_0xbb10('0x9b')][_0xbb10('0x9c')]||_0x1b4873[_0xbb10('0x9b')][_0xbb10('0x10a')]||_0x1b4873[_0xbb10('0x10b')]['remoteAddress']||_0x1b4873['ip'],'referer':_0x1b4873[_0xbb10('0x9b')][_0xbb10('0xa1')],'openedInteractions':_0x36615e,'maxInteractions':_0x2f38d3,'virtual':_0x5a4d21['virtual'],'online':_0x424bb1,'custom':_0x5a4d21}))['replace'](/'/g,'\x5c\x27')};_0x1ca72c['send'](ejs['render'](Mustache['render'](_0x615606,_0x408544),{'proactiveActions':_0x19eaa2,'alignment':_0x57b891['alignment'],'verticalAlignment':_0x57b891['verticalAlignment'],'div_color':_0x57b891['color'],'labelText':_0x57b891[_0xbb10('0x10c')],'text_color':_0x57b891[_0xbb10('0x10d')],'button_color':_0x57b891['color_button'],'background_color':_0x57b891[_0xbb10('0x10e')]}));})[_0xbb10('0x1f')](handleError(_0x1ca72c,null));};exports[_0xbb10('0x10f')]=function(_0x3b9bec,_0x1d099a){var _0x1d36fa=_0x3b9bec[_0xbb10('0x57')]['id'];var _0x23179d=_0x3b9bec[_0xbb10('0x4d')];var _0x14d9e7=0xc8;var _0x19dfef=null;return db[_0xbb10('0xcf')]['transaction']({'isolationLevel':db[_0xbb10('0xcf')][_0xbb10('0x110')][_0xbb10('0x111')][_0xbb10('0x112')]},function(_0x155f92){return db['ChatWebsite'][_0xbb10('0x5c')]({'where':{'id':_0x1d36fa},'transaction':_0x155f92})['then'](function(_0x52209c){if(_0x52209c){return db[_0xbb10('0x90')][_0xbb10('0x2a')]({'where':{'ChatWebsiteId':_0x1d36fa},'transaction':_0x155f92})['then'](function(){var _0x3e433b=_[_0xbb10('0x30')](_0x23179d,function(_0x201e05){_0x201e05[_0xbb10('0x59')]=_0x1d36fa;return _0x201e05;});return db[_0xbb10('0x90')]['bulkCreate'](_0x3e433b,{'transaction':_0x155f92});});}else{_0x14d9e7=0x194;_0x19dfef=[];}});})['then'](function(){if(_0x14d9e7!==0x194){return db[_0xbb10('0x90')][_0xbb10('0x113')]({'where':{'ChatWebsiteId':_0x1d36fa},'order':'priority'})[_0xbb10('0x15')](function(_0x4cf976){_0x19dfef=_0x4cf976;});}})[_0xbb10('0x1f')](function(_0x1a2f42){_0x14d9e7=0x1f4;logger[_0xbb10('0x1c')](_0x1a2f42[_0xbb10('0x2d')]);if(_0x1a2f42[_0xbb10('0x2e')]){delete _0x1a2f42[_0xbb10('0x2e')];}_0x19dfef=_0x1a2f42;})[_0xbb10('0x114')](function(){if(_0x19dfef===null){_0x1d099a['sendStatus'](_0x14d9e7);}else{if(_0x14d9e7===0x1f4){_0x1d099a[_0xbb10('0x21')](_0x14d9e7)[_0xbb10('0xbf')](_0x19dfef);}else{_0x1d099a[_0xbb10('0x21')](_0x14d9e7)[_0xbb10('0x23')](_0x19dfef);}}});};exports['getApplications']=function(_0x20347b,_0x22ffc6){var _0x530785={};var _0x49ef50={};var _0xeac82d;var _0x5a4de3;return db[_0xbb10('0x31')][_0xbb10('0x5c')]({'where':{'id':_0x20347b[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x22ffc6,null))['then'](function(_0x90ab9f){if(_0x90ab9f){_0xeac82d=_0x90ab9f;_0x49ef50['model']=_[_0xbb10('0x36')](db[_0xbb10('0x90')][_0xbb10('0x32')]);_0x49ef50[_0xbb10('0x37')]=_[_0xbb10('0x36')](_0x20347b[_0xbb10('0x37')]);_0x49ef50[_0xbb10('0x38')]=_[_0xbb10('0x4a')](_0x49ef50[_0xbb10('0x35')],_0x49ef50['query']);_0x530785[_0xbb10('0x39')]=_[_0xbb10('0x4a')](_0x49ef50[_0xbb10('0x35')],qs[_0xbb10('0x3a')](_0x20347b[_0xbb10('0x37')]['fields']));_0x530785[_0xbb10('0x39')]=_0x530785[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x530785[_0xbb10('0x39')]:_0x49ef50[_0xbb10('0x35')];_0x530785['order']=qs['sort'](_0x20347b['query'][_0xbb10('0x3f')]);_0x530785['where']=qs['filters'](_[_0xbb10('0x40')](_0x20347b['query'],_0x49ef50[_0xbb10('0x38')]));if(_0x20347b[_0xbb10('0x37')]['filter']){_0x530785[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x530785[_0xbb10('0x41')],{'$or':_[_0xbb10('0x30')](_0x530785['attributes'],function(_0x4b08b2){var _0x57abfe={};_0x57abfe[_0x4b08b2]={'$like':'%'+_0x20347b[_0xbb10('0x37')][_0xbb10('0x44')]+'%'};return _0x57abfe;})});}_0x530785=_['merge']({},_0x530785,_0x20347b[_0xbb10('0x45')]);return _0xeac82d[_0xbb10('0x115')](_0x530785);}})[_0xbb10('0x15')](function(_0x33a92a){if(_0x33a92a){_0x5a4de3=_0x33a92a[_0xbb10('0x3b')];if(!_0x20347b['query'][_0xbb10('0x3c')](_0xbb10('0x3d'))){_0x530785[_0xbb10('0x27')]=qs['limit'](_0x20347b[_0xbb10('0x37')]['limit']);_0x530785[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x20347b[_0xbb10('0x37')]['offset']);}return _0xeac82d[_0xbb10('0x115')](_0x530785);}})[_0xbb10('0x15')](function(_0x4ba58f){if(_0x4ba58f){return _0x4ba58f?{'count':_0x5a4de3,'rows':_0x4ba58f}:null;}})[_0xbb10('0x15')](respondWithResult(_0x22ffc6,null))[_0xbb10('0x1f')](handleError(_0x22ffc6,null));};exports[_0xbb10('0x116')]=function(_0x2e03eb,_0x24e7bc){return db['chatProactiveAction']['find']({'where':{'id':_0x2e03eb[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x24e7bc,null))[_0xbb10('0x15')](function(_0x1b0734){if(_0x1b0734){return _0x1b0734[_0xbb10('0x116')](_0x2e03eb['body'][_0xbb10('0x5e')],_[_0xbb10('0xeb')](_0x2e03eb[_0xbb10('0x4d')],[_0xbb10('0x5e'),'id'])||{});}})[_0xbb10('0x15')](respondWithResult(_0x24e7bc,null))['catch'](handleError(_0x24e7bc,null));};exports['getProactiveActions']=function(_0x2f675c,_0x18f6b1){var _0x1052f5={};var _0x119e8f={};var _0x5a031b;var _0x4c8e28;return db[_0xbb10('0x31')]['findOne']({'where':{'id':_0x2f675c['params']['id']}})['then'](handleEntityNotFound(_0x18f6b1,null))['then'](function(_0x3758dd){if(_0x3758dd){_0x5a031b=_0x3758dd;_0x119e8f[_0xbb10('0x35')]=_[_0xbb10('0x36')](db[_0xbb10('0x117')][_0xbb10('0x32')]);_0x119e8f['query']=_[_0xbb10('0x36')](_0x2f675c[_0xbb10('0x37')]);_0x119e8f[_0xbb10('0x38')]=_['intersection'](_0x119e8f[_0xbb10('0x35')],_0x119e8f[_0xbb10('0x37')]);_0x1052f5[_0xbb10('0x39')]=_[_0xbb10('0x4a')](_0x119e8f[_0xbb10('0x35')],qs[_0xbb10('0x3a')](_0x2f675c[_0xbb10('0x37')][_0xbb10('0x3a')]));_0x1052f5[_0xbb10('0x39')]=_0x1052f5[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x1052f5[_0xbb10('0x39')]:_0x119e8f[_0xbb10('0x35')];_0x1052f5[_0xbb10('0x3e')]=qs[_0xbb10('0x3f')](_0x2f675c['query']['sort']);_0x1052f5['where']=qs[_0xbb10('0x38')](_['pick'](_0x2f675c[_0xbb10('0x37')],_0x119e8f['filters']));if(_0x2f675c[_0xbb10('0x37')]['filter']){_0x1052f5['where']=_[_0xbb10('0x42')](_0x1052f5[_0xbb10('0x41')],{'$or':_['map'](_0x1052f5[_0xbb10('0x39')],function(_0x131d48){var _0x338e7a={};_0x338e7a[_0x131d48]={'$like':'%'+_0x2f675c[_0xbb10('0x37')]['filter']+'%'};return _0x338e7a;})});}_0x1052f5=_['merge']({},_0x1052f5,_0x2f675c[_0xbb10('0x45')]);return _0x5a031b[_0xbb10('0x102')](_0x1052f5);}})[_0xbb10('0x15')](function(_0x53f3c2){if(_0x53f3c2){_0x4c8e28=_0x53f3c2[_0xbb10('0x3b')];if(!_0x2f675c[_0xbb10('0x37')][_0xbb10('0x3c')]('nolimit')){_0x1052f5[_0xbb10('0x27')]=qs['limit'](_0x2f675c['query'][_0xbb10('0x27')]);_0x1052f5['offset']=qs[_0xbb10('0x24')](_0x2f675c[_0xbb10('0x37')][_0xbb10('0x24')]);}return _0x5a031b[_0xbb10('0x102')](_0x1052f5);}})[_0xbb10('0x15')](function(_0x57a6bc){if(_0x57a6bc){return _0x57a6bc?{'count':_0x4c8e28,'rows':_0x57a6bc}:null;}})[_0xbb10('0x15')](respondWithResult(_0x18f6b1,null))[_0xbb10('0x1f')](handleError(_0x18f6b1,null));};exports[_0xbb10('0x118')]=function(_0x2701e8,_0x1b0086){var _0x1c387b=_0x2701e8['query']['online']===_0xbb10('0x119')?_0xbb10('0x11a'):_0xbb10('0x11b');return db[_0xbb10('0x31')][_0xbb10('0x56')]({'attributes':['id',_0x1c387b],'where':{'id':_0x2701e8['params']['id']}})['then'](handleEntityNotFound(_0x1b0086,null))[_0xbb10('0x15')](function(_0x23cbf4){if(_0x23cbf4){var _0x536519=_0x23cbf4[_0x1c387b];var _0x50dde9=_0x536519&&_0x536519[_0xbb10('0x11c')]?_0x536519[_0xbb10('0x11c')]:[];_0x1b0086[_0xbb10('0xbf')]({'fromKey':_[_0xbb10('0x71')](_0x536519[_0xbb10('0x11d')])?undefined:_0x536519[_0xbb10('0x11d')],'count':_0x50dde9['length'],'rows':_0x50dde9});}})[_0xbb10('0x1f')](handleError(_0x1b0086,null));};exports[_0xbb10('0x11e')]=function(_0x261c9b,_0x232794){var _0x35b3f8={'raw':![],'where':{}};var _0x3783d0={};var _0xdd7d5c={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0x5c')]({'where':{'id':_0x261c9b['params']['id']}})['then'](handleEntityNotFound(_0x232794,null))['then'](function(_0x111c15){if(_0x111c15){_0x3783d0[_0xbb10('0x35')]=_[_0xbb10('0x36')](db[_0xbb10('0xc9')]['rawAttributes']);_0x3783d0['query']=_['keys'](_0x261c9b[_0xbb10('0x37')]);_0x3783d0[_0xbb10('0x38')]=_[_0xbb10('0x4a')](_0x3783d0[_0xbb10('0x35')],_0x3783d0[_0xbb10('0x37')]);_0x35b3f8[_0xbb10('0x39')]=_[_0xbb10('0x4a')](_0x3783d0[_0xbb10('0x35')],qs[_0xbb10('0x3a')](_0x261c9b[_0xbb10('0x37')][_0xbb10('0x3a')]));_0x35b3f8[_0xbb10('0x39')]=_0x35b3f8[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x35b3f8['attributes']:_0x3783d0[_0xbb10('0x35')];if(!_0x261c9b[_0xbb10('0x37')][_0xbb10('0x3c')](_0xbb10('0x3d'))){_0x35b3f8[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x261c9b['query'][_0xbb10('0x27')]);_0x35b3f8[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x261c9b[_0xbb10('0x37')][_0xbb10('0x24')]);}_0x35b3f8[_0xbb10('0x3e')]=qs[_0xbb10('0x3f')](_0x261c9b[_0xbb10('0x37')][_0xbb10('0x3f')]);_0x35b3f8['where']=qs[_0xbb10('0x38')](_[_0xbb10('0x40')](_0x261c9b[_0xbb10('0x37')],_0x3783d0[_0xbb10('0x38')]));_0x35b3f8[_0xbb10('0x41')][_0xbb10('0x59')]=_0x111c15['id'];if(_0x261c9b[_0xbb10('0x37')][_0xbb10('0x44')]){_0x35b3f8[_0xbb10('0x41')]=_['merge'](_0x35b3f8[_0xbb10('0x41')],{'$or':_['map'](_0x35b3f8[_0xbb10('0x39')],function(_0x2cd1b0){var _0x57e0b2={};_0x57e0b2[_0x2cd1b0]={'$like':'%'+_0x261c9b['query'][_0xbb10('0x44')]+'%'};return _0x57e0b2;})});}_0x35b3f8=_[_0xbb10('0x42')]({},_0x35b3f8,_0x261c9b[_0xbb10('0x45')]);return db[_0xbb10('0xc9')][_0xbb10('0x26')]({'where':_0x35b3f8[_0xbb10('0x41')]})[_0xbb10('0x15')](function(_0x40a208){_0xdd7d5c[_0xbb10('0x26')]=_0x40a208;if(_0x261c9b[_0xbb10('0x37')][_0xbb10('0x46')]){_0x35b3f8[_0xbb10('0x4b')]=[{'all':!![]}];}else{_0x35b3f8[_0xbb10('0x4b')]=[{'model':db[_0xbb10('0x81')],'as':_0xbb10('0xec'),'required':![]},{'model':db['Attachment'],'as':_0xbb10('0x11f'),'required':![]}];}return db['ChatOfflineMessage'][_0xbb10('0x47')](_0x35b3f8);})[_0xbb10('0x15')](function(_0x234dc5){_0xdd7d5c[_0xbb10('0x48')]=_0x234dc5;return _0xdd7d5c;});}})[_0xbb10('0x15')](respondWithFilteredResult(_0x232794,_0x35b3f8))[_0xbb10('0x1f')](handleError(_0x232794,null));};exports[_0xbb10('0x120')]=function(_0x45dcaa,_0x5c88bd){return db['ChatWebsite']['find']({'where':{'id':_0x45dcaa[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x5c88bd,null))[_0xbb10('0x15')](function(_0x54c61c){if(_0x54c61c){return _0x54c61c[_0xbb10('0x120')](_0x45dcaa['body'][_0xbb10('0x5e')],_[_0xbb10('0xeb')](_0x45dcaa['body'],[_0xbb10('0x5e'),'id'])||{})[_0xbb10('0xac')](function(_0xa52322){for(var _0xc1691=0x0;_0xc1691<_0x45dcaa[_0xbb10('0x4d')]['ids'][_0xbb10('0x3b')];_0xc1691+=0x1){socket[_0xbb10('0x121')]('userChatWebsite:save',{'UserId':Number(_0x45dcaa[_0xbb10('0x4d')][_0xbb10('0x5e')][_0xc1691]),'ChatWebsiteId':Number(_0x45dcaa['params']['id'])});}return _0xa52322;});}})[_0xbb10('0x15')](respondWithResult(_0x5c88bd,null))[_0xbb10('0x1f')](handleError(_0x5c88bd,null));};exports[_0xbb10('0x122')]=function(_0x24f1d2,_0x481a0a){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x24f1d2[_0xbb10('0x57')]['id']}})['then'](handleEntityNotFound(_0x481a0a,null))['then'](function(_0x284b77){if(_0x284b77){return _0x284b77[_0xbb10('0x122')](_0x24f1d2[_0xbb10('0x37')][_0xbb10('0x5e')])['then'](function(){if(_[_0xbb10('0x123')](_0x24f1d2[_0xbb10('0x37')][_0xbb10('0x5e')])){for(var _0x28c680=0x0;_0x28c680<_0x24f1d2[_0xbb10('0x37')]['ids']['length'];_0x28c680+=0x1){socket[_0xbb10('0x121')](_0xbb10('0x124'),{'UserId':Number(_0x24f1d2['query']['ids'][_0x28c680]),'ChatWebsiteId':Number(_0x24f1d2[_0xbb10('0x57')]['id'])});}}else{socket[_0xbb10('0x121')](_0xbb10('0x124'),{'UserId':Number(_0x24f1d2[_0xbb10('0x37')][_0xbb10('0x5e')]),'ChatWebsiteId':Number(_0x24f1d2[_0xbb10('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x481a0a,null))['catch'](handleError(_0x481a0a,null));};exports[_0xbb10('0x125')]=function(_0x1c3cbc,_0x24bda8){var _0x27ddfc={};var _0x39a047={};var _0x9a80a7;var _0x5e08c5;return db[_0xbb10('0x31')][_0xbb10('0x5c')]({'where':{'id':_0x1c3cbc[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x24bda8,null))['then'](function(_0x21ad98){if(_0x21ad98){_0x9a80a7=_0x21ad98;_0x39a047[_0xbb10('0x35')]=_[_0xbb10('0x36')](db[_0xbb10('0xb4')][_0xbb10('0x32')]);_0x39a047[_0xbb10('0x37')]=_[_0xbb10('0x36')](_0x1c3cbc[_0xbb10('0x37')]);_0x39a047[_0xbb10('0x38')]=_[_0xbb10('0x4a')](_0x39a047[_0xbb10('0x35')],_0x39a047[_0xbb10('0x37')]);_0x27ddfc['attributes']=_[_0xbb10('0x4a')](_0x39a047[_0xbb10('0x35')],qs['fields'](_0x1c3cbc[_0xbb10('0x37')][_0xbb10('0x3a')]));_0x27ddfc[_0xbb10('0x39')]=_0x27ddfc['attributes'][_0xbb10('0x3b')]?_0x27ddfc[_0xbb10('0x39')]:_0x39a047[_0xbb10('0x35')];_0x27ddfc[_0xbb10('0x3e')]=qs[_0xbb10('0x3f')](_0x1c3cbc[_0xbb10('0x37')]['sort']);_0x27ddfc[_0xbb10('0x41')]=qs['filters'](_[_0xbb10('0x40')](_0x1c3cbc[_0xbb10('0x37')],_0x39a047[_0xbb10('0x38')]));if(_0x1c3cbc[_0xbb10('0x37')]['filter']){_0x27ddfc[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x27ddfc['where'],{'$or':_[_0xbb10('0x30')](_0x27ddfc['attributes'],function(_0x31c086){var _0x40845c={};_0x40845c[_0x31c086]={'$like':'%'+_0x1c3cbc[_0xbb10('0x37')][_0xbb10('0x44')]+'%'};return _0x40845c;})});}_0x27ddfc=_[_0xbb10('0x42')]({},_0x27ddfc,_0x1c3cbc[_0xbb10('0x45')]);return _0x9a80a7[_0xbb10('0x125')](_0x27ddfc);}})[_0xbb10('0x15')](function(_0x55ee36){if(_0x55ee36){_0x5e08c5=_0x55ee36['length'];if(!_0x1c3cbc[_0xbb10('0x37')][_0xbb10('0x3c')](_0xbb10('0x3d'))){_0x27ddfc[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x1c3cbc[_0xbb10('0x37')][_0xbb10('0x27')]);_0x27ddfc[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x1c3cbc['query'][_0xbb10('0x24')]);}return _0x9a80a7['getAgents'](_0x27ddfc);}})[_0xbb10('0x15')](function(_0x2a618a){if(_0x2a618a){return _0x2a618a?{'count':_0x5e08c5,'rows':_0x2a618a}:null;}})['then'](respondWithResult(_0x24bda8,null))[_0xbb10('0x1f')](handleError(_0x24bda8,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index e8eb855..081e806 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 _0x2e3b=['emit','hasOwnProperty','hook','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x2e3b,0x81));var _0xb2e3=function(_0x6e5298,_0x5e4838){_0x6e5298=_0x6e5298-0x0;var _0x4269f5=_0x2e3b[_0x6e5298];return _0x4269f5;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0xb2e3('0x0'))['db'][_0xb2e3('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xb2e3('0x2')](0x0);var events={'afterCreate':_0xb2e3('0x3'),'afterUpdate':_0xb2e3('0x4'),'afterDestroy':_0xb2e3('0x5')};function emitEvent(_0x1529ca){return function(_0xcb4d04,_0x4d30d7,_0x2bc877){ChatWebsiteEvents[_0xb2e3('0x6')](_0x1529ca+':'+_0xcb4d04['id'],_0xcb4d04);ChatWebsiteEvents['emit'](_0x1529ca,_0xcb4d04);_0x2bc877(null);};}for(var e in events){if(events[_0xb2e3('0x7')](e)){var event=events[e];ChatWebsite[_0xb2e3('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0xd7ce=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','remove','emit'];(function(_0x4a450a,_0x54d42f){var _0x28baf9=function(_0x5cb70a){while(--_0x5cb70a){_0x4a450a['push'](_0x4a450a['shift']());}};_0x28baf9(++_0x54d42f);}(_0xd7ce,0x16b));var _0xed7c=function(_0x5cc51f,_0x22c480){_0x5cc51f=_0x5cc51f-0x0;var _0x315a2f=_0xd7ce[_0x5cc51f];return _0x315a2f;};'use strict';var EventEmitter=require(_0xed7c('0x0'));var ChatWebsite=require(_0xed7c('0x1'))['db'][_0xed7c('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xed7c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xed7c('0x4')};function emitEvent(_0x5e454c){return function(_0x4a6138,_0x587c5a,_0x17560f){ChatWebsiteEvents[_0xed7c('0x5')](_0x5e454c+':'+_0x4a6138['id'],_0x4a6138);ChatWebsiteEvents[_0xed7c('0x5')](_0x5e454c,_0x4a6138);_0x17560f(null);};}for(var e in events){if(events[_0xed7c('0x6')](e)){var event=events[e];ChatWebsite[_0xed7c('0x7')](e,emitEvent(event));}}module[_0xed7c('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 8a23ac1..b72f6b3 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 _0x465a=['rimraf','exports','define','chat_websites','lodash','../../config/logger','api'];(function(_0x2442ee,_0x27cb98){var _0x427cee=function(_0x2bcce5){while(--_0x2bcce5){_0x2442ee['push'](_0x2442ee['shift']());}};_0x427cee(++_0x27cb98);}(_0x465a,0x6d));var _0xa465=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x465a[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xa465('0x0'));var util=require('util');var logger=require(_0xa465('0x1'))(_0xa465('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa465('0x3'));var config=require('../../config/environment');var attributes=require('./chatWebsite.attributes');module[_0xa465('0x4')]=function(_0x110f1a,_0x21f450){return _0x110f1a[_0xa465('0x5')]('ChatWebsite',attributes,{'tableName':_0xa465('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xae04=['bluebird','request-promise','path','rimraf','./chatWebsite.attributes','define','ChatWebsite','chat_websites','lodash','../../config/logger','api','moment'];(function(_0x35c4ca,_0xb02844){var _0x40df5f=function(_0x15ad59){while(--_0x15ad59){_0x35c4ca['push'](_0x35c4ca['shift']());}};_0x40df5f(++_0xb02844);}(_0xae04,0x1dc));var _0x4ae0=function(_0x2f39cf,_0x3c59ec){_0x2f39cf=_0x2f39cf-0x0;var _0xd0ece8=_0xae04[_0x2f39cf];return _0xd0ece8;};'use strict';var _=require(_0x4ae0('0x0'));var util=require('util');var logger=require(_0x4ae0('0x1'))(_0x4ae0('0x2'));var moment=require(_0x4ae0('0x3'));var BPromise=require(_0x4ae0('0x4'));var rp=require(_0x4ae0('0x5'));var fs=require('fs');var path=require(_0x4ae0('0x6'));var rimraf=require(_0x4ae0('0x7'));var config=require('../../config/environment');var attributes=require(_0x4ae0('0x8'));module['exports']=function(_0x556c5d,_0x5930d5){return _0x556c5d[_0x4ae0('0x9')](_0x4ae0('0xa'),attributes,{'tableName':_0x4ae0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 8c93d1d..78e111e 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 _0x196c=['request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','socket.io-emitter','register','request','then','info','ChatWebsite,\x20%s,\x20%s'];(function(_0x5b643b,_0x2670a7){var _0x48d2e6=function(_0x58f8c8){while(--_0x58f8c8){_0x5b643b['push'](_0x5b643b['shift']());}};_0x48d2e6(++_0x2670a7);}(_0x196c,0x79));var _0xc196=function(_0x3e9722,_0x4e5f88){_0x3e9722=_0x3e9722-0x0;var _0x2321dd=_0x196c[_0x3e9722];return _0x2321dd;};'use strict';var _=require(_0xc196('0x0'));var util=require(_0xc196('0x1'));var moment=require('moment');var BPromise=require(_0xc196('0x2'));var rs=require(_0xc196('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc196('0x4'));var logger=require(_0xc196('0x5'))(_0xc196('0x6'));var config=require('../../config/environment');var jayson=require(_0xc196('0x7'));var client=jayson['client'][_0xc196('0x8')]({'port':0x232a});config[_0xc196('0x9')]=_[_0xc196('0xa')](config[_0xc196('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xc196('0xb'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0xc196('0xc')](socket);function respondWithRpcPromise(_0x4cab9e,_0x3e1710,_0x2f0c67){return new BPromise(function(_0xff297e,_0x22e787){return client[_0xc196('0xd')](_0x4cab9e,_0x2f0c67)[_0xc196('0xe')](function(_0x1f2a7d){logger[_0xc196('0xf')](_0xc196('0x10'),_0x3e1710,_0xc196('0x11'));logger['debug'](_0xc196('0x12'),_0x3e1710,_0xc196('0x11'),JSON['stringify'](_0x1f2a7d));if(_0x1f2a7d[_0xc196('0x13')]){if(_0x1f2a7d[_0xc196('0x13')]['code']===0x1f4){logger['error'](_0xc196('0x10'),_0x3e1710,_0x1f2a7d[_0xc196('0x13')][_0xc196('0x14')]);return _0x22e787(_0x1f2a7d[_0xc196('0x13')]['message']);}logger[_0xc196('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x3e1710,_0x1f2a7d[_0xc196('0x13')][_0xc196('0x14')]);return _0xff297e(_0x1f2a7d[_0xc196('0x13')][_0xc196('0x14')]);}else{logger[_0xc196('0xf')](_0xc196('0x10'),_0x3e1710,'request\x20sent');_0xff297e(_0x1f2a7d[_0xc196('0x15')][_0xc196('0x14')]);}})[_0xc196('0x16')](function(_0x47cfbd){logger[_0xc196('0x13')](_0xc196('0x10'),_0x3e1710,_0x47cfbd);_0x22e787(_0x47cfbd);});});}
\ No newline at end of file
+var _0x45a8=['redis','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','http'];(function(_0x2ea69b,_0x34b143){var _0x229d90=function(_0x297059){while(--_0x297059){_0x2ea69b['push'](_0x2ea69b['shift']());}};_0x229d90(++_0x34b143);}(_0x45a8,0xca));var _0x845a=function(_0x3b2919,_0xe974ed){_0x3b2919=_0x3b2919-0x0;var _0x4a7dbf=_0x45a8[_0x3b2919];return _0x4a7dbf;};'use strict';var _=require(_0x845a('0x0'));var util=require(_0x845a('0x1'));var moment=require(_0x845a('0x2'));var BPromise=require(_0x845a('0x3'));var rs=require(_0x845a('0x4'));var fs=require('fs');var Redis=require(_0x845a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x845a('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x845a('0x7')]({'port':0x232a});config[_0x845a('0x8')]=_['defaults'](config[_0x845a('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x2b347d,_0x14a4d0,_0x18b06d){return new BPromise(function(_0x2131dc,_0x3b955b){return client[_0x845a('0x9')](_0x2b347d,_0x18b06d)[_0x845a('0xa')](function(_0xa3d9b7){logger['info'](_0x845a('0xb'),_0x14a4d0,_0x845a('0xc'));logger[_0x845a('0xd')](_0x845a('0xe'),_0x14a4d0,_0x845a('0xc'),JSON['stringify'](_0xa3d9b7));if(_0xa3d9b7[_0x845a('0xf')]){if(_0xa3d9b7['error'][_0x845a('0x10')]===0x1f4){logger[_0x845a('0xf')](_0x845a('0xb'),_0x14a4d0,_0xa3d9b7['error'][_0x845a('0x11')]);return _0x3b955b(_0xa3d9b7[_0x845a('0xf')]['message']);}logger[_0x845a('0xf')]('ChatWebsite,\x20%s,\x20%s',_0x14a4d0,_0xa3d9b7[_0x845a('0xf')][_0x845a('0x11')]);return _0x2131dc(_0xa3d9b7['error'][_0x845a('0x11')]);}else{logger[_0x845a('0x12')](_0x845a('0xb'),_0x14a4d0,_0x845a('0xc'));_0x2131dc(_0xa3d9b7[_0x845a('0x13')][_0x845a('0x11')]);}})[_0x845a('0x14')](function(_0x298c77){logger['error'](_0x845a('0xb'),_0x14a4d0,_0x298c77);_0x3b955b(_0x298c77);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index e86b710..be6b04a 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 _0xb1e7=['./chatWebsite.events','save','remove','update','emit','removeListener','register','length','chatWebsite:'];(function(_0x3861d9,_0x3b12a1){var _0x4e171a=function(_0x4662f3){while(--_0x4662f3){_0x3861d9['push'](_0x3861d9['shift']());}};_0x4e171a(++_0x3b12a1);}(_0xb1e7,0x105));var _0x7b1e=function(_0x576faa,_0x40825d){_0x576faa=_0x576faa-0x0;var _0x455ed3=_0xb1e7[_0x576faa];return _0x455ed3;};'use strict';var ChatWebsiteEvents=require(_0x7b1e('0x0'));var events=[_0x7b1e('0x1'),_0x7b1e('0x2'),_0x7b1e('0x3')];function createListener(_0x147c6e,_0x419dce){return function(_0x3322a4){_0x419dce[_0x7b1e('0x4')](_0x147c6e,_0x3322a4);};}function removeListener(_0x25d3ac,_0x572aa3){return function(){ChatWebsiteEvents[_0x7b1e('0x5')](_0x25d3ac,_0x572aa3);};}exports[_0x7b1e('0x6')]=function(_0x4f894d){for(var _0x52d2c9=0x0,_0x5489b4=events[_0x7b1e('0x7')];_0x52d2c9<_0x5489b4;_0x52d2c9++){var _0x1d8ccc=events[_0x52d2c9];var _0x296336=createListener(_0x7b1e('0x8')+_0x1d8ccc,_0x4f894d);ChatWebsiteEvents['on'](_0x1d8ccc,_0x296336);}};
\ No newline at end of file
+var _0x00b4=['emit','register','length','chatWebsite:','./chatWebsite.events','save','remove','update'];(function(_0x42ebba,_0x4cbf87){var _0x3fd2af=function(_0x26d999){while(--_0x26d999){_0x42ebba['push'](_0x42ebba['shift']());}};_0x3fd2af(++_0x4cbf87);}(_0x00b4,0x11c));var _0x400b=function(_0x161d59,_0x11d2ec){_0x161d59=_0x161d59-0x0;var _0xd33fcd=_0x00b4[_0x161d59];return _0xd33fcd;};'use strict';var ChatWebsiteEvents=require(_0x400b('0x0'));var events=[_0x400b('0x1'),_0x400b('0x2'),_0x400b('0x3')];function createListener(_0x22cf2a,_0x1b9b10){return function(_0x2e33c4){_0x1b9b10[_0x400b('0x4')](_0x22cf2a,_0x2e33c4);};}function removeListener(_0x141a22,_0xcbca7f){return function(){ChatWebsiteEvents['removeListener'](_0x141a22,_0xcbca7f);};}exports[_0x400b('0x5')]=function(_0x487793){for(var _0x2682c0=0x0,_0x211f34=events[_0x400b('0x6')];_0x2682c0<_0x211f34;_0x2682c0++){var _0xb6be39=events[_0x2682c0];var _0x332ccc=createListener(_0x400b('0x7')+_0xb6be39,_0x487793);ChatWebsiteEvents['on'](_0xb6be39,_0x332ccc);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index d65b726..53463fd 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 _0x3ec0=['index','get','describe','/:id','show','/:id/dispositions','getDispositions','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','server/files/images/logos/','format','%s-%s','now','single','file','addLogo','diskStorage','root','originalname','addAvatar','server/files/images/avatars/','addCustomerAvatar','join','addSystemAvatar','notify','server/files','attachments','offline-chat','ensureDir','replace','/:id/offline','any','addInteraction','addApplications','addProactiveActions','put','update','delete','removeDispositions','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./chatWebsite.controller','isAuthenticated'];(function(_0xbe5564,_0x18b61a){var _0x507f83=function(_0x555eec){while(--_0x555eec){_0xbe5564['push'](_0xbe5564['shift']());}};_0x507f83(++_0x18b61a);}(_0x3ec0,0x1a7));var _0x03ec=function(_0x23506f,_0x541afa){_0x23506f=_0x23506f-0x0;var _0xf84917=_0x3ec0[_0x23506f];return _0xf84917;};'use strict';var multer=require(_0x03ec('0x0'));var util=require(_0x03ec('0x1'));var path=require(_0x03ec('0x2'));var timeout=require(_0x03ec('0x3'));var express=require('express');var router=express[_0x03ec('0x4')]();var fs_extra=require(_0x03ec('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x03ec('0x6'));var controller=require(_0x03ec('0x7'));router['get']('/',auth[_0x03ec('0x8')](),controller[_0x03ec('0x9')]);router[_0x03ec('0xa')]('/describe',auth[_0x03ec('0x8')](),controller[_0x03ec('0xb')]);router['get'](_0x03ec('0xc'),auth[_0x03ec('0x8')](),controller[_0x03ec('0xd')]);router[_0x03ec('0xa')](_0x03ec('0xe'),auth[_0x03ec('0x8')](),controller[_0x03ec('0xf')]);router[_0x03ec('0xa')]('/:id/canned_answers',auth[_0x03ec('0x8')](),controller['getAnswers']);router[_0x03ec('0xa')](_0x03ec('0x10'),controller[_0x03ec('0x11')]);router['get'](_0x03ec('0x12'),controller[_0x03ec('0x13')]);router[_0x03ec('0xa')](_0x03ec('0x14'),controller[_0x03ec('0x15')]);router['get'](_0x03ec('0x16'),controller[_0x03ec('0x17')]);router[_0x03ec('0xa')](_0x03ec('0x18'),auth[_0x03ec('0x8')](),controller['getInteractions']);router['get'](_0x03ec('0x19'),controller[_0x03ec('0x1a')]);router['get'](_0x03ec('0x1b'),auth[_0x03ec('0x8')](),controller[_0x03ec('0x1c')]);router[_0x03ec('0xa')](_0x03ec('0x1d'),auth[_0x03ec('0x8')](),controller['getProactiveActions']);router[_0x03ec('0xa')](_0x03ec('0x1e'),controller[_0x03ec('0x1f')]);router[_0x03ec('0xa')](_0x03ec('0x20'),auth[_0x03ec('0x8')](),controller[_0x03ec('0x21')]);router['get'](_0x03ec('0x22'),auth[_0x03ec('0x8')](),controller[_0x03ec('0x23')]);router[_0x03ec('0x24')]('/',auth[_0x03ec('0x8')](),controller[_0x03ec('0x25')]);router['post'](_0x03ec('0xe'),auth['isAuthenticated'](),controller[_0x03ec('0x26')]);router[_0x03ec('0x24')](_0x03ec('0x27'),auth[_0x03ec('0x8')](),controller[_0x03ec('0x28')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3f4ab4,_0x3bae53,_0x54dd23){_0x54dd23(null,path['join'](config['root'],_0x03ec('0x29')));},'filename':function(_0x5b4b0f,_0x28074e,_0x1d806a){_0x1d806a(null,util[_0x03ec('0x2a')](_0x03ec('0x2b'),Date[_0x03ec('0x2c')](),_0x28074e['originalname']));}})});router['post'](_0x03ec('0x10'),upload[_0x03ec('0x2d')](_0x03ec('0x2e')),controller[_0x03ec('0x2f')]);var upload=multer({'storage':multer[_0x03ec('0x30')]({'destination':function(_0x5d227f,_0x511678,_0x113d48){_0x113d48(null,path['join'](config[_0x03ec('0x31')],'server/files/images/avatars/'));},'filename':function(_0x516aff,_0x2e0671,_0x560773){_0x560773(null,util[_0x03ec('0x2a')](_0x03ec('0x2b'),Date['now'](),_0x2e0671[_0x03ec('0x32')]));}})});router[_0x03ec('0x24')](_0x03ec('0x12'),upload[_0x03ec('0x2d')](_0x03ec('0x2e')),controller[_0x03ec('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1aab10,_0x1f638b,_0x2b7f9c){_0x2b7f9c(null,path['join'](config[_0x03ec('0x31')],_0x03ec('0x34')));},'filename':function(_0x37722b,_0x13863d,_0x421c5c){_0x421c5c(null,util[_0x03ec('0x2a')](_0x03ec('0x2b'),Date[_0x03ec('0x2c')](),_0x13863d['originalname']));}})});router[_0x03ec('0x24')]('/:id/customer_avatar',upload[_0x03ec('0x2d')](_0x03ec('0x2e')),controller[_0x03ec('0x35')]);var upload=multer({'storage':multer[_0x03ec('0x30')]({'destination':function(_0x3eb85d,_0xee4bd4,_0x3bf145){_0x3bf145(null,path[_0x03ec('0x36')](config[_0x03ec('0x31')],_0x03ec('0x34')));},'filename':function(_0x458d16,_0x273e99,_0x551403){_0x551403(null,util[_0x03ec('0x2a')]('%s-%s',Date[_0x03ec('0x2c')](),_0x273e99[_0x03ec('0x32')]));}})});router[_0x03ec('0x24')]('/:id/system_avatar',upload[_0x03ec('0x2d')](_0x03ec('0x2e')),controller[_0x03ec('0x37')]);router[_0x03ec('0x24')]('/:id/notify',controller[_0x03ec('0x38')]);const offlineUploadMulter=multer({'storage':multer[_0x03ec('0x30')]({'destination':function(_0x275b83,_0x15788e,_0x1992f8){const _0x1dfc8b=path[_0x03ec('0x36')](config[_0x03ec('0x31')],_0x03ec('0x39'),_0x03ec('0x3a'),_0x03ec('0x3b'));fs_extra[_0x03ec('0x3c')](_0x1dfc8b,function(){_0x1992f8(null,_0x1dfc8b);});},'filename':function(_0x113d23,_0x427193,_0x1969e2){const _0x323100=_0x427193[_0x03ec('0x32')][_0x03ec('0x3d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4592a6=path['extname'](_0x323100);const _0x1e70fb=Date['now']()+'-'+_0x323100['replace'](_0x4592a6,'')+_0x4592a6;_0x1969e2(null,_0x1e70fb);}})});router['post'](_0x03ec('0x3e'),offlineUploadMulter[_0x03ec('0x3f')](),controller['offline']);router[_0x03ec('0x24')]('/:id/interactions',auth[_0x03ec('0x8')](),controller[_0x03ec('0x40')]);router[_0x03ec('0x24')](_0x03ec('0x1b'),auth[_0x03ec('0x8')](),controller[_0x03ec('0x41')]);router[_0x03ec('0x24')]('/:id/proactive_actions',auth[_0x03ec('0x8')](),controller[_0x03ec('0x42')]);router['post'](_0x03ec('0x22'),auth[_0x03ec('0x8')](),controller['addAgents']);router[_0x03ec('0x43')](_0x03ec('0xc'),auth[_0x03ec('0x8')](),controller[_0x03ec('0x44')]);router[_0x03ec('0x45')]('/:id',auth['isAuthenticated'](),controller['destroy']);router['delete'](_0x03ec('0xe'),auth[_0x03ec('0x8')](),controller[_0x03ec('0x46')]);router[_0x03ec('0x45')](_0x03ec('0x27'),auth['isAuthenticated'](),controller['removeAnswers']);router['delete'](_0x03ec('0x22'),auth[_0x03ec('0x8')](),controller['removeAgents']);module[_0x03ec('0x47')]=router;
\ No newline at end of file
+var _0x020f=['addAvatar','%s-%s','/:id/customer_avatar','file','addCustomerAvatar','addSystemAvatar','/:id/notify','attachments','offline-chat','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','destroy','delete','removeDispositions','/:id/canned_answers','removeAgents','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','server/files/images/logos/','format','originalname','single','join','root','server/files/images/avatars/','now'];(function(_0x469ac7,_0x38e416){var _0x22f3b0=function(_0x1a1447){while(--_0x1a1447){_0x469ac7['push'](_0x469ac7['shift']());}};_0x22f3b0(++_0x38e416);}(_0x020f,0xf8));var _0xf020=function(_0x591c55,_0x45a0e2){_0x591c55=_0x591c55-0x0;var _0x118d45=_0x020f[_0x591c55];return _0x118d45;};'use strict';var multer=require(_0xf020('0x0'));var util=require(_0xf020('0x1'));var path=require('path');var timeout=require(_0xf020('0x2'));var express=require(_0xf020('0x3'));var router=express['Router']();var fs_extra=require(_0xf020('0x4'));var auth=require(_0xf020('0x5'));var interaction=require(_0xf020('0x6'));var config=require(_0xf020('0x7'));var controller=require(_0xf020('0x8'));router[_0xf020('0x9')]('/',auth[_0xf020('0xa')](),controller['index']);router['get'](_0xf020('0xb'),auth[_0xf020('0xa')](),controller[_0xf020('0xc')]);router[_0xf020('0x9')](_0xf020('0xd'),auth['isAuthenticated'](),controller[_0xf020('0xe')]);router[_0xf020('0x9')](_0xf020('0xf'),auth[_0xf020('0xa')](),controller[_0xf020('0x10')]);router[_0xf020('0x9')]('/:id/canned_answers',auth[_0xf020('0xa')](),controller[_0xf020('0x11')]);router[_0xf020('0x9')](_0xf020('0x12'),controller[_0xf020('0x13')]);router[_0xf020('0x9')](_0xf020('0x14'),controller['getAvatar']);router['get']('/:id/customer_avatar',controller[_0xf020('0x15')]);router['get'](_0xf020('0x16'),controller[_0xf020('0x17')]);router[_0xf020('0x9')](_0xf020('0x18'),auth['isAuthenticated'](),controller['getInteractions']);router[_0xf020('0x9')](_0xf020('0x19'),controller['getSnippet']);router[_0xf020('0x9')]('/:id/applications',auth[_0xf020('0xa')](),controller[_0xf020('0x1a')]);router[_0xf020('0x9')](_0xf020('0x1b'),auth[_0xf020('0xa')](),controller[_0xf020('0x1c')]);router[_0xf020('0x9')](_0xf020('0x1d'),controller[_0xf020('0x1e')]);router['get'](_0xf020('0x1f'),auth[_0xf020('0xa')](),controller[_0xf020('0x20')]);router[_0xf020('0x9')](_0xf020('0x21'),auth['isAuthenticated'](),controller[_0xf020('0x22')]);router[_0xf020('0x23')]('/',auth[_0xf020('0xa')](),controller[_0xf020('0x24')]);router['post']('/:id/dispositions',auth[_0xf020('0xa')](),controller[_0xf020('0x25')]);router[_0xf020('0x23')]('/:id/canned_answers',auth[_0xf020('0xa')](),controller[_0xf020('0x26')]);var upload=multer({'storage':multer[_0xf020('0x27')]({'destination':function(_0x2deba1,_0x5bd9fa,_0x12f5f3){_0x12f5f3(null,path['join'](config['root'],_0xf020('0x28')));},'filename':function(_0x2003f7,_0x303c28,_0x48a5f7){_0x48a5f7(null,util[_0xf020('0x29')]('%s-%s',Date['now'](),_0x303c28[_0xf020('0x2a')]));}})});router[_0xf020('0x23')](_0xf020('0x12'),upload[_0xf020('0x2b')]('file'),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x44104f,_0x1f87a0,_0x50199d){_0x50199d(null,path[_0xf020('0x2c')](config[_0xf020('0x2d')],_0xf020('0x2e')));},'filename':function(_0x2f6683,_0x506fab,_0x464fe8){_0x464fe8(null,util[_0xf020('0x29')]('%s-%s',Date[_0xf020('0x2f')](),_0x506fab[_0xf020('0x2a')]));}})});router[_0xf020('0x23')](_0xf020('0x14'),upload['single']('file'),controller[_0xf020('0x30')]);var upload=multer({'storage':multer[_0xf020('0x27')]({'destination':function(_0x365bd0,_0x4dda53,_0x480b14){_0x480b14(null,path['join'](config['root'],_0xf020('0x2e')));},'filename':function(_0x2ca704,_0x1807ed,_0x4b7dd1){_0x4b7dd1(null,util[_0xf020('0x29')](_0xf020('0x31'),Date[_0xf020('0x2f')](),_0x1807ed[_0xf020('0x2a')]));}})});router[_0xf020('0x23')](_0xf020('0x32'),upload[_0xf020('0x2b')](_0xf020('0x33')),controller[_0xf020('0x34')]);var upload=multer({'storage':multer[_0xf020('0x27')]({'destination':function(_0x1b7283,_0x1694ad,_0x17bf16){_0x17bf16(null,path[_0xf020('0x2c')](config['root'],_0xf020('0x2e')));},'filename':function(_0x476a2d,_0x3601e8,_0x3f50d2){_0x3f50d2(null,util[_0xf020('0x29')](_0xf020('0x31'),Date[_0xf020('0x2f')](),_0x3601e8['originalname']));}})});router[_0xf020('0x23')](_0xf020('0x16'),upload[_0xf020('0x2b')](_0xf020('0x33')),controller[_0xf020('0x35')]);router[_0xf020('0x23')](_0xf020('0x36'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xf020('0x27')]({'destination':function(_0x404c29,_0x51f179,_0x5af0fc){const _0x2a7c89=path[_0xf020('0x2c')](config['root'],'server/files',_0xf020('0x37'),_0xf020('0x38'));fs_extra['ensureDir'](_0x2a7c89,function(){_0x5af0fc(null,_0x2a7c89);});},'filename':function(_0x236f37,_0x543ee2,_0x27c910){const _0x2ad216=_0x543ee2[_0xf020('0x2a')][_0xf020('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4f6b30=path[_0xf020('0x3a')](_0x2ad216);const _0x5d6e9b=Date[_0xf020('0x2f')]()+'-'+_0x2ad216[_0xf020('0x39')](_0x4f6b30,'')+_0x4f6b30;_0x27c910(null,_0x5d6e9b);}})});router['post'](_0xf020('0x3b'),offlineUploadMulter[_0xf020('0x3c')](),controller[_0xf020('0x3d')]);router[_0xf020('0x23')](_0xf020('0x18'),auth[_0xf020('0xa')](),controller[_0xf020('0x3e')]);router[_0xf020('0x23')]('/:id/applications',auth[_0xf020('0xa')](),controller[_0xf020('0x3f')]);router[_0xf020('0x23')](_0xf020('0x1b'),auth[_0xf020('0xa')](),controller[_0xf020('0x40')]);router['post'](_0xf020('0x21'),auth['isAuthenticated'](),controller[_0xf020('0x41')]);router[_0xf020('0x42')]('/:id',auth[_0xf020('0xa')](),controller[_0xf020('0x43')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xf020('0x44')]);router[_0xf020('0x45')](_0xf020('0xf'),auth[_0xf020('0xa')](),controller[_0xf020('0x46')]);router[_0xf020('0x45')](_0xf020('0x47'),auth[_0xf020('0xa')](),controller['removeAnswers']);router[_0xf020('0x45')]('/:id/users',auth[_0xf020('0xa')](),controller[_0xf020('0x48')]);module[_0xf020('0x49')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 072daf3..3de26b3 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 _0x7229=['get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','exports','../components/auth/service','env','production','app'];(function(_0x11a220,_0x4e470a){var _0x20d8fe=function(_0xbedfd){while(--_0xbedfd){_0x11a220['push'](_0x11a220['shift']());}};_0x20d8fe(++_0x4e470a);}(_0x7229,0xd8));var _0x9722=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x7229[_0x2b5eae];return _0x5f3ac9;};var beaverLogger=require('beaver-logger/server');var express=require('express');var auth=require(_0x9722('0x0'));var config=require('../config/environment');var router=express['Router']();var isProduction=config[_0x9722('0x1')]===_0x9722('0x2')||![];function clientSideLogs(_0x205967,_0x5df605,_0x235c26){var _0x15afba=_0x205967[_0x9722('0x3')][_0x9722('0x4')](_0x9722('0x5'));if(!_0x15afba){throw new Error(_0x9722('0x6'));}return beaverLogger[_0x9722('0x7')]({'uri':_0x9722('0x8'),'logger':_0x15afba,'enableCors':!isProduction})(_0x205967,_0x5df605,_0x235c26);}router[_0x9722('0x9')](auth['isAuthenticated'](),clientSideLogs);module[_0x9722('0xa')]=router;
\ No newline at end of file
+var _0x40e4=['exports','beaver-logger/server','express','../components/auth/service','app','get','client-side-logger','expressEndpoint','/client-logs','use'];(function(_0xc2dde6,_0x1cccc9){var _0x9fc29c=function(_0x54ba28){while(--_0x54ba28){_0xc2dde6['push'](_0xc2dde6['shift']());}};_0x9fc29c(++_0x1cccc9);}(_0x40e4,0x97));var _0x440e=function(_0xfdb740,_0x14c2da){_0xfdb740=_0xfdb740-0x0;var _0x4a837d=_0x40e4[_0xfdb740];return _0x4a837d;};var beaverLogger=require(_0x440e('0x0'));var express=require(_0x440e('0x1'));var auth=require(_0x440e('0x2'));var config=require('../config/environment');var router=express['Router']();var isProduction=config['env']==='production'||![];function clientSideLogs(_0x10a0b8,_0x791745,_0xd0adf4){var _0x59b844=_0x10a0b8[_0x440e('0x3')][_0x440e('0x4')](_0x440e('0x5'));if(!_0x59b844){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x440e('0x6')]({'uri':_0x440e('0x7'),'logger':_0x59b844,'enableCors':!isProduction})(_0x10a0b8,_0x791745,_0xd0adf4);}router[_0x440e('0x8')](auth['isAuthenticated'](),clientSideLogs);module[_0x440e('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index d7391cb..4adb302 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 _0xb824=['ENUM','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20tenant','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','STRING','AmazonAWS','Google','MicrosoftAzure'];(function(_0x1e4f74,_0x559af){var _0x267e66=function(_0x66b7b8){while(--_0x66b7b8){_0x1e4f74['push'](_0x1e4f74['shift']());}};_0x267e66(++_0x559af);}(_0xb824,0x1b7));var _0x4b82=function(_0x58c372,_0x3c434a){_0x58c372=_0x58c372-0x0;var _0x258921=_0xb824[_0x58c372];return _0x258921;};'use strict';var Sequelize=require('sequelize');module[_0x4b82('0x0')]={'name':{'type':Sequelize[_0x4b82('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x4b82('0x2'),_0x4b82('0x3'),_0x4b82('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x4b82('0x5')](_0x4b82('0x6'),_0x4b82('0x7'))},'data1':{'type':Sequelize[_0x4b82('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize['STRING'],'comment':_0x4b82('0x8')},'data3':{'type':Sequelize[_0x4b82('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x4b82('0x1')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x4b82('0x9')],'comment':_0x4b82('0xa')},'data6':{'type':Sequelize[_0x4b82('0x9')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x4b82('0x9')],'comment':_0x4b82('0xb')}};
\ No newline at end of file
+var _0x41f9=['Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','AmazonAWS','Google','MicrosoftAzure','ENUM'];(function(_0x335ef9,_0x280744){var _0x51ec48=function(_0x204824){while(--_0x204824){_0x335ef9['push'](_0x335ef9['shift']());}};_0x51ec48(++_0x280744);}(_0x41f9,0xe3));var _0x941f=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x41f9[_0x199572];return _0x13cfa3;};'use strict';var Sequelize=require(_0x941f('0x0'));module[_0x941f('0x1')]={'name':{'type':Sequelize[_0x941f('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x941f('0x3'),_0x941f('0x4'),_0x941f('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x941f('0x6')](_0x941f('0x7'),_0x941f('0x8'))},'data1':{'type':Sequelize[_0x941f('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x941f('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize['TEXT'],'comment':_0x941f('0x9')},'data6':{'type':Sequelize[_0x941f('0xa')],'comment':_0x941f('0xb')},'data7':{'type':Sequelize[_0x941f('0xa')],'comment':_0x941f('0xc')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 75d2e38..daffa4f 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 _0xfe65=['merge','VIRTUAL','filter','includeAll','include','rows','MicrosoftAzure','decryptString','data3','catch','params','fields','options','find','service','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','error','get','state','parse','from','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','startRefreshInterval','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','stack','name','send','slice','map','CloudProvider','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x34566e,_0x296fbc){var _0x1b0238=function(_0x5bd03f){while(--_0x5bd03f){_0x34566e['push'](_0x34566e['shift']());}};_0x1b0238(++_0x296fbc);}(_0xfe65,0x1a8));var _0x5fe6=function(_0x2a3bde,_0x3f15b3){_0x2a3bde=_0x2a3bde-0x0;var _0x46f677=_0xfe65[_0x2a3bde];return _0x46f677;};'use strict';var _=require(_0x5fe6('0x0'));var Redis=require(_0x5fe6('0x1'));var qs=require(_0x5fe6('0x2'));var encryptor=require(_0x5fe6('0x3'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x5fe6('0x4'));var db=require(_0x5fe6('0x5'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x5fe6('0x6')]=_[_0x5fe6('0x7')](config['redis'],{'host':_0x5fe6('0x8'),'port':0x18eb});var socket=require(_0x5fe6('0x9'))(new Redis(config[_0x5fe6('0x6')]));var redis=new Redis(config[_0x5fe6('0x6')]);function respondWithStatusCode(_0x567998,_0x38ffa2){_0x38ffa2=_0x38ffa2||0xcc;return function(_0x94f49){if(_0x94f49){return _0x567998[_0x5fe6('0xa')](_0x38ffa2);}return _0x567998[_0x5fe6('0xb')](_0x38ffa2)[_0x5fe6('0xc')]();};}function respondWithResult(_0x2534c3,_0x2b6ee4){_0x2b6ee4=_0x2b6ee4||0xc8;return function(_0x1d9540){if(_0x1d9540){return _0x2534c3[_0x5fe6('0xb')](_0x2b6ee4)[_0x5fe6('0xd')](_0x1d9540);}};}function respondWithFilteredResult(_0x6a5df7,_0x58cd0d){return function(_0x25b159){if(_0x25b159){var _0x598a40=typeof _0x58cd0d[_0x5fe6('0xe')]===_0x5fe6('0xf')&&typeof _0x58cd0d[_0x5fe6('0x10')]===_0x5fe6('0xf');var _0x5ceaec=_0x25b159[_0x5fe6('0x11')];var _0x46b2bf=_0x598a40?0x0:_0x58cd0d[_0x5fe6('0xe')];var _0x4d728f=_0x598a40?_0x25b159[_0x5fe6('0x11')]:_0x58cd0d['offset']+_0x58cd0d[_0x5fe6('0x10')];var _0x202834;if(_0x4d728f>=_0x5ceaec){_0x4d728f=_0x5ceaec;_0x202834=0xc8;}else{_0x202834=0xce;}_0x6a5df7[_0x5fe6('0xb')](_0x202834);return _0x6a5df7[_0x5fe6('0x12')](_0x5fe6('0x13'),_0x46b2bf+'-'+_0x4d728f+'/'+_0x5ceaec)['json'](_0x25b159);}return null;};}function saveUpdates(_0x1d01ab){return function(_0x4e61f7){if(_0x4e61f7){return _0x4e61f7[_0x5fe6('0x14')](_0x1d01ab)[_0x5fe6('0x15')](function(_0x5738b6){return _0x5738b6;});}return null;};}function removeEntity(_0x49522b){return function(_0x50fa85){if(_0x50fa85){return _0x50fa85[_0x5fe6('0x16')]()[_0x5fe6('0x15')](function(){_0x49522b[_0x5fe6('0xb')](0xcc)[_0x5fe6('0xc')]();});}};}function handleEntityNotFound(_0x75e417){return function(_0x1e97d5){if(!_0x1e97d5){_0x75e417[_0x5fe6('0xa')](0x194);}return _0x1e97d5;};}function handleError(_0x1cec84,_0x558c28){_0x558c28=_0x558c28||0x1f4;return function(_0x1bed3c){logger['error'](_0x1bed3c[_0x5fe6('0x17')]);if(_0x1bed3c[_0x5fe6('0x18')]){delete _0x1bed3c[_0x5fe6('0x18')];}_0x1cec84[_0x5fe6('0xb')](_0x558c28)[_0x5fe6('0x19')](_0x1bed3c);};}function maskClientSecret(_0x3e86cb){return _['padEnd'](_0x3e86cb[_0x5fe6('0x1a')](0x0,0x3),0x14,'*');}exports['index']=function(_0x35b763,_0xec8513){var _0x3e3a9d={},_0x48d4c9={},_0x422783={'count':0x0,'rows':[]};var _0x4c2ad6=_[_0x5fe6('0x1b')](db[_0x5fe6('0x1c')][_0x5fe6('0x1d')],function(_0x4364ec){return{'name':_0x4364ec[_0x5fe6('0x1e')],'type':_0x4364ec[_0x5fe6('0x1f')][_0x5fe6('0x20')]};});_0x48d4c9['model']=_[_0x5fe6('0x1b')](_0x4c2ad6,'name');_0x48d4c9[_0x5fe6('0x21')]=_[_0x5fe6('0x22')](_0x35b763[_0x5fe6('0x21')]);_0x48d4c9[_0x5fe6('0x23')]=_[_0x5fe6('0x24')](_0x48d4c9[_0x5fe6('0x25')],_0x48d4c9['query']);_0x3e3a9d[_0x5fe6('0x26')]=_[_0x5fe6('0x24')](_0x48d4c9[_0x5fe6('0x25')],qs['fields'](_0x35b763[_0x5fe6('0x21')]['fields']));_0x3e3a9d[_0x5fe6('0x26')]=_0x3e3a9d[_0x5fe6('0x26')][_0x5fe6('0x27')]?_0x3e3a9d[_0x5fe6('0x26')]:_0x48d4c9['model'];if(!_0x35b763[_0x5fe6('0x21')][_0x5fe6('0x28')](_0x5fe6('0x29'))){_0x3e3a9d[_0x5fe6('0x10')]=qs[_0x5fe6('0x10')](_0x35b763[_0x5fe6('0x21')]['limit']);_0x3e3a9d[_0x5fe6('0xe')]=qs[_0x5fe6('0xe')](_0x35b763[_0x5fe6('0x21')][_0x5fe6('0xe')]);}_0x3e3a9d[_0x5fe6('0x2a')]=qs[_0x5fe6('0x2b')](_0x35b763[_0x5fe6('0x21')][_0x5fe6('0x2b')]);_0x3e3a9d[_0x5fe6('0x2c')]=qs[_0x5fe6('0x23')](_[_0x5fe6('0x2d')](_0x35b763[_0x5fe6('0x21')],_0x48d4c9[_0x5fe6('0x23')]),_0x4c2ad6);if(_0x35b763['query']['filter']){_0x3e3a9d[_0x5fe6('0x2c')]=_[_0x5fe6('0x2e')](_0x3e3a9d[_0x5fe6('0x2c')],{'$or':_[_0x5fe6('0x1b')](_0x4c2ad6,function(_0x3f9996){if(_0x3f9996[_0x5fe6('0x1f')]!==_0x5fe6('0x2f')){var _0x3120eb={};_0x3120eb[_0x3f9996[_0x5fe6('0x18')]]={'$like':'%'+_0x35b763[_0x5fe6('0x21')][_0x5fe6('0x30')]+'%'};return _0x3120eb;}})});}_0x3e3a9d=_[_0x5fe6('0x2e')]({},_0x3e3a9d,_0x35b763['options']);var _0x2a6cc0={'where':_0x3e3a9d['where']};return db[_0x5fe6('0x1c')][_0x5fe6('0x11')](_0x2a6cc0)['then'](function(_0x5b130a){_0x422783[_0x5fe6('0x11')]=_0x5b130a;if(_0x35b763['query'][_0x5fe6('0x31')]){_0x3e3a9d[_0x5fe6('0x32')]=[{'all':!![]}];}return db[_0x5fe6('0x1c')]['findAll'](_0x3e3a9d);})[_0x5fe6('0x15')](function(_0x23b401){_0x422783[_0x5fe6('0x33')]=_[_0x5fe6('0x1b')](_0x23b401,function(_0x129f26){if(_0x129f26['service']===_0x5fe6('0x34')){var _0x4f8da0=encryptor[_0x5fe6('0x35')](_0x129f26[_0x5fe6('0x36')]);_0x129f26[_0x5fe6('0x36')]=maskClientSecret(_0x4f8da0);}return _0x129f26;});return _0x422783;})[_0x5fe6('0x15')](respondWithFilteredResult(_0xec8513,_0x3e3a9d))[_0x5fe6('0x37')](handleError(_0xec8513,null));};exports['show']=function(_0x1f823d,_0x48bb4f){var _0x5f52d4={'raw':!![],'where':{'id':_0x1f823d[_0x5fe6('0x38')]['id']}},_0x2f4cf4={};_0x2f4cf4[_0x5fe6('0x25')]=_[_0x5fe6('0x22')](db[_0x5fe6('0x1c')][_0x5fe6('0x1d')]);_0x2f4cf4[_0x5fe6('0x21')]=_[_0x5fe6('0x22')](_0x1f823d[_0x5fe6('0x21')]);_0x2f4cf4['filters']=_[_0x5fe6('0x24')](_0x2f4cf4[_0x5fe6('0x25')],_0x2f4cf4[_0x5fe6('0x21')]);_0x5f52d4[_0x5fe6('0x26')]=_[_0x5fe6('0x24')](_0x2f4cf4['model'],qs[_0x5fe6('0x39')](_0x1f823d[_0x5fe6('0x21')][_0x5fe6('0x39')]));_0x5f52d4[_0x5fe6('0x26')]=_0x5f52d4[_0x5fe6('0x26')][_0x5fe6('0x27')]?_0x5f52d4[_0x5fe6('0x26')]:_0x2f4cf4[_0x5fe6('0x25')];if(_0x1f823d['query'][_0x5fe6('0x31')]){_0x5f52d4[_0x5fe6('0x32')]=[{'all':!![]}];}_0x5f52d4=_[_0x5fe6('0x2e')]({},_0x5f52d4,_0x1f823d[_0x5fe6('0x3a')]);return db[_0x5fe6('0x1c')][_0x5fe6('0x3b')](_0x5f52d4)[_0x5fe6('0x15')](handleEntityNotFound(_0x48bb4f,null))[_0x5fe6('0x15')](function(_0x36d213){if(_0x36d213[_0x5fe6('0x3c')]===_0x5fe6('0x34')){var _0x556ba9=encryptor['decryptString'](_0x36d213[_0x5fe6('0x36')]);_0x36d213[_0x5fe6('0x36')]=maskClientSecret(_0x556ba9);}return _0x36d213;})[_0x5fe6('0x15')](respondWithResult(_0x48bb4f,null))['catch'](handleError(_0x48bb4f,null));};exports[_0x5fe6('0x3d')]=function(_0x486549,_0x23df3b){if(!_0x486549[_0x5fe6('0x3e')][_0x5fe6('0x18')])throw new Error(_0x5fe6('0x3f'));if(!_0x486549[_0x5fe6('0x3e')]['service'])throw new Error(_0x5fe6('0x40'));var _0x571a9e=db[_0x5fe6('0x1c')][_0x5fe6('0x1d')][_0x5fe6('0x3c')][_0x5fe6('0x41')];if(!_0x571a9e[_0x5fe6('0x42')](_0x486549[_0x5fe6('0x3e')][_0x5fe6('0x3c')]))throw new Error(_0x5fe6('0x43')+_0x571a9e[_0x5fe6('0x44')](',\x20'));if(_0x486549[_0x5fe6('0x3e')][_0x5fe6('0x3c')]===_0x5fe6('0x34')&&_0x486549[_0x5fe6('0x3e')]['data3']){_0x486549[_0x5fe6('0x3e')][_0x5fe6('0x36')]=encryptor[_0x5fe6('0x45')](_0x486549[_0x5fe6('0x3e')][_0x5fe6('0x36')]);}return db[_0x5fe6('0x1c')][_0x5fe6('0x3d')](_0x486549[_0x5fe6('0x3e')],{})[_0x5fe6('0x15')](respondWithResult(_0x23df3b,0xc9))['catch'](handleError(_0x23df3b,null));};exports[_0x5fe6('0x14')]=function(_0x3110c1,_0xeade2d){if(_0x3110c1[_0x5fe6('0x3e')]['id']){delete _0x3110c1[_0x5fe6('0x3e')]['id'];}return db[_0x5fe6('0x1c')][_0x5fe6('0x3b')]({'where':{'id':_0x3110c1[_0x5fe6('0x38')]['id']}})[_0x5fe6('0x15')](handleEntityNotFound(_0xeade2d,null))[_0x5fe6('0x15')](function(_0x24cd35){if(_0x24cd35[_0x5fe6('0x3c')]===_0x5fe6('0x34')&&_0x3110c1[_0x5fe6('0x3e')][_0x5fe6('0x36')]){_0x3110c1[_0x5fe6('0x3e')][_0x5fe6('0x36')]=encryptor[_0x5fe6('0x45')](_0x3110c1[_0x5fe6('0x3e')][_0x5fe6('0x36')]);}return _0x24cd35;})[_0x5fe6('0x15')](saveUpdates(_0x3110c1[_0x5fe6('0x3e')],null))[_0x5fe6('0x15')](respondWithResult(_0xeade2d,null))['catch'](handleError(_0xeade2d,null));};exports[_0x5fe6('0x16')]=function(_0x48dc62,_0x312a8f){return db['CloudProvider']['find']({'where':{'id':_0x48dc62[_0x5fe6('0x38')]['id']}})[_0x5fe6('0x15')](handleEntityNotFound(_0x312a8f,null))[_0x5fe6('0x15')](removeEntity(_0x312a8f,null))[_0x5fe6('0x37')](handleError(_0x312a8f,null));};exports['oauth2MicrosoftAuthorize']=function(_0x2d2469,_0x1e3402){return db[_0x5fe6('0x1c')][_0x5fe6('0x46')]({'where':{'id':_0x2d2469[_0x5fe6('0x38')]['id']},'raw':!![]})['then'](function(_0x1440b7){if(!_0x1440b7)return _0x1e3402['sendStatus'](0x194);return{'url':oauth[_0x5fe6('0x47')](_0x1440b7,_0x2d2469[_0x5fe6('0x48')]['id'])};})[_0x5fe6('0x15')](respondWithResult(_0x1e3402,null))['catch'](handleError(_0x1e3402,null));};exports[_0x5fe6('0x49')]=function(_0x45044c,_0x525d07){var _0x49f213=_0x45044c[_0x5fe6('0x3e')];var _0xb848d4;var _0x3d8856;if(_0x49f213[_0x5fe6('0x4a')])throw _0x49f213;redis[_0x5fe6('0x4b')](_0x49f213[_0x5fe6('0x4c')])[_0x5fe6('0x15')](function(_0x55b99f){if(!_0x55b99f)throw new Error('Invalid\x20state\x20parameter');_0xb848d4=JSON[_0x5fe6('0x4d')](_0x55b99f);var _0x14ac9e=Buffer[_0x5fe6('0x4e')](_0x49f213[_0x5fe6('0x4c')],'base64')[_0x5fe6('0x4f')](_0x5fe6('0x50'));_0x3d8856=JSON[_0x5fe6('0x4d')](_0x14ac9e);if(!oauth[_0x5fe6('0x51')](_0x49f213[_0x5fe6('0x52')],_0xb848d4[_0x5fe6('0x53')]))throw new Error(_0x5fe6('0x54'));redis['del'](_0x49f213[_0x5fe6('0x4c')]);return oauth[_0x5fe6('0x55')](_0x49f213[_0x5fe6('0x56')],_0xb848d4);})[_0x5fe6('0x15')](function(_0x1c2f11){_0xb848d4[_0x5fe6('0x57')]=_0x1c2f11['access_token'];_0xb848d4[_0x5fe6('0x58')]=_0x1c2f11[_0x5fe6('0x59')];return db['CloudProvider'][_0x5fe6('0x14')]({'data5':_0xb848d4[_0x5fe6('0x57')],'data6':_0xb848d4['data6']},{'where':{'id':_0xb848d4['id']}});})[_0x5fe6('0x15')](function(){oauth[_0x5fe6('0x5a')](_0xb848d4);socket['emit']('microsoftAuthorization:success',{'id':_0x3d8856['id']});return;})[_0x5fe6('0x15')](respondWithStatusCode(_0x525d07,null))[_0x5fe6('0x37')](function(_0x271c18){if(_0x3d8856){socket['emit'](_0x5fe6('0x5b'),{'id':_0x3d8856['id']});}if(!_0xb848d4){logger[_0x5fe6('0x4a')](_0x5fe6('0x5c'),_0x271c18);return _0x525d07[_0x5fe6('0xb')](0x1f4)[_0x5fe6('0x19')](_0x271c18['message']);}logger['error'](_0x5fe6('0x5d'),_0xb848d4['id'],_0x271c18);});};
\ No newline at end of file
+var _0x3978=['findOne','user','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','from','state','base64','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','data5','access_token','data6','refresh_token','emit','microsoftAuthorization:success','microsoftAuthorization:error','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','end','status','offset','undefined','limit','count','set','json','then','destroy','error','name','index','CloudProvider','rawAttributes','key','map','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','params','find','catch','body','Service\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','update','oauth2MicrosoftAuthorize'];(function(_0xe50651,_0x78b476){var _0xc8931c=function(_0x1c2902){while(--_0x1c2902){_0xe50651['push'](_0xe50651['shift']());}};_0xc8931c(++_0x78b476);}(_0x3978,0x6e));var _0x8397=function(_0x101f0d,_0x223697){_0x101f0d=_0x101f0d-0x0;var _0x59aade=_0x3978[_0x101f0d];return _0x59aade;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0x8397('0x0'));var encryptor=require(_0x8397('0x1'));var config=require(_0x8397('0x2'));var logger=require(_0x8397('0x3'))(_0x8397('0x4'));var db=require(_0x8397('0x5'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x8397('0x6')]=_[_0x8397('0x7')](config[_0x8397('0x6')],{'host':_0x8397('0x8'),'port':0x18eb});var socket=require(_0x8397('0x9'))(new Redis(config[_0x8397('0x6')]));var redis=new Redis(config[_0x8397('0x6')]);function respondWithStatusCode(_0xa2b089,_0x3ae5e4){_0x3ae5e4=_0x3ae5e4||0xcc;return function(_0x7ac31f){if(_0x7ac31f){return _0xa2b089[_0x8397('0xa')](_0x3ae5e4);}return _0xa2b089['status'](_0x3ae5e4)[_0x8397('0xb')]();};}function respondWithResult(_0x5ecc73,_0x36c13a){_0x36c13a=_0x36c13a||0xc8;return function(_0x32fae5){if(_0x32fae5){return _0x5ecc73[_0x8397('0xc')](_0x36c13a)['json'](_0x32fae5);}};}function respondWithFilteredResult(_0x36b24e,_0x2b93c7){return function(_0x343b1f){if(_0x343b1f){var _0x4272b9=typeof _0x2b93c7[_0x8397('0xd')]===_0x8397('0xe')&&typeof _0x2b93c7[_0x8397('0xf')]===_0x8397('0xe');var _0x509d74=_0x343b1f[_0x8397('0x10')];var _0x59f438=_0x4272b9?0x0:_0x2b93c7['offset'];var _0x44f56d=_0x4272b9?_0x343b1f[_0x8397('0x10')]:_0x2b93c7['offset']+_0x2b93c7[_0x8397('0xf')];var _0x5c5bc5;if(_0x44f56d>=_0x509d74){_0x44f56d=_0x509d74;_0x5c5bc5=0xc8;}else{_0x5c5bc5=0xce;}_0x36b24e[_0x8397('0xc')](_0x5c5bc5);return _0x36b24e[_0x8397('0x11')]('Content-Range',_0x59f438+'-'+_0x44f56d+'/'+_0x509d74)[_0x8397('0x12')](_0x343b1f);}return null;};}function saveUpdates(_0x6a9af7){return function(_0x2db637){if(_0x2db637){return _0x2db637['update'](_0x6a9af7)[_0x8397('0x13')](function(_0x25c5ef){return _0x25c5ef;});}return null;};}function removeEntity(_0x33d7b5){return function(_0x2c76ae){if(_0x2c76ae){return _0x2c76ae[_0x8397('0x14')]()[_0x8397('0x13')](function(){_0x33d7b5['status'](0xcc)[_0x8397('0xb')]();});}};}function handleEntityNotFound(_0x137fe0){return function(_0x1c01c1){if(!_0x1c01c1){_0x137fe0[_0x8397('0xa')](0x194);}return _0x1c01c1;};}function handleError(_0x6303f0,_0x25a193){_0x25a193=_0x25a193||0x1f4;return function(_0x5cccd1){logger[_0x8397('0x15')](_0x5cccd1['stack']);if(_0x5cccd1[_0x8397('0x16')]){delete _0x5cccd1['name'];}_0x6303f0[_0x8397('0xc')](_0x25a193)['send'](_0x5cccd1);};}function maskClientSecret(_0x1f5720){return _['padEnd'](_0x1f5720['slice'](0x0,0x3),0x14,'*');}exports[_0x8397('0x17')]=function(_0x3c4633,_0xb50b8c){var _0x257121={},_0xf43617={},_0x27b304={'count':0x0,'rows':[]};var _0xfba76c=_['map'](db[_0x8397('0x18')][_0x8397('0x19')],function(_0x52e9b5){return{'name':_0x52e9b5['fieldName'],'type':_0x52e9b5['type'][_0x8397('0x1a')]};});_0xf43617['model']=_[_0x8397('0x1b')](_0xfba76c,_0x8397('0x16'));_0xf43617['query']=_[_0x8397('0x1c')](_0x3c4633[_0x8397('0x1d')]);_0xf43617['filters']=_[_0x8397('0x1e')](_0xf43617[_0x8397('0x1f')],_0xf43617[_0x8397('0x1d')]);_0x257121[_0x8397('0x20')]=_[_0x8397('0x1e')](_0xf43617[_0x8397('0x1f')],qs[_0x8397('0x21')](_0x3c4633[_0x8397('0x1d')]['fields']));_0x257121['attributes']=_0x257121[_0x8397('0x20')][_0x8397('0x22')]?_0x257121[_0x8397('0x20')]:_0xf43617[_0x8397('0x1f')];if(!_0x3c4633[_0x8397('0x1d')][_0x8397('0x23')](_0x8397('0x24'))){_0x257121[_0x8397('0xf')]=qs['limit'](_0x3c4633[_0x8397('0x1d')]['limit']);_0x257121[_0x8397('0xd')]=qs['offset'](_0x3c4633[_0x8397('0x1d')]['offset']);}_0x257121[_0x8397('0x25')]=qs['sort'](_0x3c4633['query'][_0x8397('0x26')]);_0x257121[_0x8397('0x27')]=qs[_0x8397('0x28')](_[_0x8397('0x29')](_0x3c4633[_0x8397('0x1d')],_0xf43617[_0x8397('0x28')]),_0xfba76c);if(_0x3c4633[_0x8397('0x1d')][_0x8397('0x2a')]){_0x257121[_0x8397('0x27')]=_[_0x8397('0x2b')](_0x257121[_0x8397('0x27')],{'$or':_[_0x8397('0x1b')](_0xfba76c,function(_0x4d0cf9){if(_0x4d0cf9[_0x8397('0x2c')]!==_0x8397('0x2d')){var _0x527022={};_0x527022[_0x4d0cf9['name']]={'$like':'%'+_0x3c4633['query'][_0x8397('0x2a')]+'%'};return _0x527022;}})});}_0x257121=_[_0x8397('0x2b')]({},_0x257121,_0x3c4633[_0x8397('0x2e')]);var _0x3065af={'where':_0x257121[_0x8397('0x27')]};return db[_0x8397('0x18')][_0x8397('0x10')](_0x3065af)[_0x8397('0x13')](function(_0x32006a){_0x27b304[_0x8397('0x10')]=_0x32006a;if(_0x3c4633[_0x8397('0x1d')][_0x8397('0x2f')]){_0x257121[_0x8397('0x30')]=[{'all':!![]}];}return db[_0x8397('0x18')][_0x8397('0x31')](_0x257121);})[_0x8397('0x13')](function(_0x96439b){_0x27b304[_0x8397('0x32')]=_[_0x8397('0x1b')](_0x96439b,function(_0x260285){if(_0x260285[_0x8397('0x33')]===_0x8397('0x34')){var _0x1d5b57=encryptor[_0x8397('0x35')](_0x260285[_0x8397('0x36')]);_0x260285[_0x8397('0x36')]=maskClientSecret(_0x1d5b57);}return _0x260285;});return _0x27b304;})['then'](respondWithFilteredResult(_0xb50b8c,_0x257121))['catch'](handleError(_0xb50b8c,null));};exports['show']=function(_0x3b64d1,_0x2c65ee){var _0x180ece={'raw':!![],'where':{'id':_0x3b64d1[_0x8397('0x37')]['id']}},_0x4e637e={};_0x4e637e[_0x8397('0x1f')]=_[_0x8397('0x1c')](db['CloudProvider'][_0x8397('0x19')]);_0x4e637e[_0x8397('0x1d')]=_[_0x8397('0x1c')](_0x3b64d1[_0x8397('0x1d')]);_0x4e637e[_0x8397('0x28')]=_['intersection'](_0x4e637e['model'],_0x4e637e[_0x8397('0x1d')]);_0x180ece[_0x8397('0x20')]=_[_0x8397('0x1e')](_0x4e637e[_0x8397('0x1f')],qs[_0x8397('0x21')](_0x3b64d1[_0x8397('0x1d')][_0x8397('0x21')]));_0x180ece[_0x8397('0x20')]=_0x180ece[_0x8397('0x20')]['length']?_0x180ece['attributes']:_0x4e637e[_0x8397('0x1f')];if(_0x3b64d1['query'][_0x8397('0x2f')]){_0x180ece[_0x8397('0x30')]=[{'all':!![]}];}_0x180ece=_[_0x8397('0x2b')]({},_0x180ece,_0x3b64d1['options']);return db[_0x8397('0x18')][_0x8397('0x38')](_0x180ece)[_0x8397('0x13')](handleEntityNotFound(_0x2c65ee,null))[_0x8397('0x13')](function(_0x2a138c){if(_0x2a138c[_0x8397('0x33')]==='MicrosoftAzure'){var _0x1d0d26=encryptor['decryptString'](_0x2a138c[_0x8397('0x36')]);_0x2a138c[_0x8397('0x36')]=maskClientSecret(_0x1d0d26);}return _0x2a138c;})[_0x8397('0x13')](respondWithResult(_0x2c65ee,null))[_0x8397('0x39')](handleError(_0x2c65ee,null));};exports['create']=function(_0x13f63a,_0x57ba7c){if(!_0x13f63a[_0x8397('0x3a')][_0x8397('0x16')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x13f63a['body'][_0x8397('0x33')])throw new Error(_0x8397('0x3b'));var _0x1bc0c2=db[_0x8397('0x18')][_0x8397('0x19')][_0x8397('0x33')]['values'];if(!_0x1bc0c2[_0x8397('0x3c')](_0x13f63a['body']['service']))throw new Error(_0x8397('0x3d')+_0x1bc0c2[_0x8397('0x3e')](',\x20'));if(_0x13f63a['body']['service']===_0x8397('0x34')&&_0x13f63a['body'][_0x8397('0x36')]){_0x13f63a[_0x8397('0x3a')][_0x8397('0x36')]=encryptor[_0x8397('0x3f')](_0x13f63a[_0x8397('0x3a')]['data3']);}return db[_0x8397('0x18')]['create'](_0x13f63a['body'],{})[_0x8397('0x13')](respondWithResult(_0x57ba7c,0xc9))[_0x8397('0x39')](handleError(_0x57ba7c,null));};exports[_0x8397('0x40')]=function(_0x88ea75,_0x411cbb){if(_0x88ea75[_0x8397('0x3a')]['id']){delete _0x88ea75['body']['id'];}return db[_0x8397('0x18')][_0x8397('0x38')]({'where':{'id':_0x88ea75['params']['id']}})[_0x8397('0x13')](handleEntityNotFound(_0x411cbb,null))[_0x8397('0x13')](function(_0x569418){if(_0x569418['service']==='MicrosoftAzure'&&_0x88ea75['body'][_0x8397('0x36')]){_0x88ea75[_0x8397('0x3a')][_0x8397('0x36')]=encryptor[_0x8397('0x3f')](_0x88ea75[_0x8397('0x3a')]['data3']);}return _0x569418;})[_0x8397('0x13')](saveUpdates(_0x88ea75[_0x8397('0x3a')],null))['then'](respondWithResult(_0x411cbb,null))[_0x8397('0x39')](handleError(_0x411cbb,null));};exports[_0x8397('0x14')]=function(_0x163338,_0xef32a){return db[_0x8397('0x18')][_0x8397('0x38')]({'where':{'id':_0x163338['params']['id']}})[_0x8397('0x13')](handleEntityNotFound(_0xef32a,null))[_0x8397('0x13')](removeEntity(_0xef32a,null))[_0x8397('0x39')](handleError(_0xef32a,null));};exports[_0x8397('0x41')]=function(_0x39437b,_0x4a9b0d){return db['CloudProvider'][_0x8397('0x42')]({'where':{'id':_0x39437b[_0x8397('0x37')]['id']},'raw':!![]})[_0x8397('0x13')](function(_0x50c486){if(!_0x50c486)return _0x4a9b0d[_0x8397('0xa')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x50c486,_0x39437b[_0x8397('0x43')]['id'])};})['then'](respondWithResult(_0x4a9b0d,null))[_0x8397('0x39')](handleError(_0x4a9b0d,null));};exports[_0x8397('0x44')]=function(_0x21c0d3,_0x3ec255){var _0x219246=_0x21c0d3[_0x8397('0x3a')];var _0x35e66d;var _0x5c591a;if(_0x219246[_0x8397('0x15')])throw _0x219246;redis[_0x8397('0x45')](_0x219246['state'])[_0x8397('0x13')](function(_0x48467e){if(!_0x48467e)throw new Error(_0x8397('0x46'));_0x35e66d=JSON[_0x8397('0x47')](_0x48467e);var _0x12820a=Buffer[_0x8397('0x48')](_0x219246[_0x8397('0x49')],_0x8397('0x4a'))['toString']('ascii');_0x5c591a=JSON['parse'](_0x12820a);if(!oauth['isValidIdToken'](_0x219246[_0x8397('0x4b')],_0x35e66d[_0x8397('0x4c')]))throw new Error(_0x8397('0x4d'));redis[_0x8397('0x4e')](_0x219246[_0x8397('0x49')]);return oauth['getOauth2MicrosoftAccessToken'](_0x219246['code'],_0x35e66d);})[_0x8397('0x13')](function(_0x3cbf7f){_0x35e66d[_0x8397('0x4f')]=_0x3cbf7f[_0x8397('0x50')];_0x35e66d[_0x8397('0x51')]=_0x3cbf7f[_0x8397('0x52')];return db['CloudProvider']['update']({'data5':_0x35e66d['data5'],'data6':_0x35e66d[_0x8397('0x51')]},{'where':{'id':_0x35e66d['id']}});})['then'](function(){oauth['startRefreshInterval'](_0x35e66d);socket[_0x8397('0x53')](_0x8397('0x54'),{'id':_0x5c591a['id']});return;})[_0x8397('0x13')](respondWithStatusCode(_0x3ec255,null))[_0x8397('0x39')](function(_0x55b474){if(_0x5c591a){socket[_0x8397('0x53')](_0x8397('0x55'),{'id':_0x5c591a['id']});}if(!_0x35e66d){logger['error']('Invalid\x20authentication\x20state\x20parameter',_0x55b474);return _0x3ec255[_0x8397('0xc')](0x1f4)['send'](_0x55b474[_0x8397('0x56')]);}logger[_0x8397('0x15')](_0x8397('0x57'),_0x35e66d['id'],_0x55b474);});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 7767b03..f25f580 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 _0x7634=['./cloudProvider.attributes','CloudProvider','cloud_providers','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x367acb,_0x1378f5){var _0x492fdc=function(_0x531bac){while(--_0x531bac){_0x367acb['push'](_0x367acb['shift']());}};_0x492fdc(++_0x1378f5);}(_0x7634,0x107));var _0x4763=function(_0x308275,_0x5d8a30){_0x308275=_0x308275-0x0;var _0x219f2e=_0x7634[_0x308275];return _0x219f2e;};'use strict';var _=require(_0x4763('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4763('0x1'));var moment=require(_0x4763('0x2'));var BPromise=require(_0x4763('0x3'));var rp=require(_0x4763('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4763('0x5'));var config=require(_0x4763('0x6'));var attributes=require(_0x4763('0x7'));module['exports']=function(_0x351bd5,_0x415b2a){return _0x351bd5['define'](_0x4763('0x8'),attributes,{'tableName':_0x4763('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7314=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','CloudProvider','lodash','util'];(function(_0x8da7e1,_0x57cd87){var _0x5b670c=function(_0x5cbe9e){while(--_0x5cbe9e){_0x8da7e1['push'](_0x8da7e1['shift']());}};_0x5b670c(++_0x57cd87);}(_0x7314,0x1b6));var _0x4731=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7314[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x4731('0x0'));var util=require(_0x4731('0x1'));var logger=require(_0x4731('0x2'))(_0x4731('0x3'));var moment=require('moment');var BPromise=require(_0x4731('0x4'));var rp=require(_0x4731('0x5'));var fs=require('fs');var path=require(_0x4731('0x6'));var rimraf=require(_0x4731('0x7'));var config=require(_0x4731('0x8'));var attributes=require(_0x4731('0x9'));module['exports']=function(_0x5aa514,_0x114c3a){return _0x5aa514['define'](_0x4731('0xa'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index c432957..345f06e 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 _0x1261=['toString','randomBytes','data1','response_type','redirect_uri','response_mode','form_post','state','key','value','oauth2Claims','replace','set','stringify','decode','payload','iss','aud','nonce','isAfter','exp','then','data3','CloudProvider','refresh_token','data6','data4','POST','data5','access_token','update','error','decryptString','intervals','bind','findAll','all','catch','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart','exports','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','{TENANT_ID}','data2','id_token'];(function(_0x15e800,_0x4a82f9){var _0x176659=function(_0x589597){while(--_0x589597){_0x15e800['push'](_0x15e800['shift']());}};_0x176659(++_0x4a82f9);}(_0x1261,0x144));var _0x1126=function(_0x1ee5be,_0x5f46e3){_0x1ee5be=_0x1ee5be-0x0;var _0x177140=_0x1261[_0x1ee5be];return _0x177140;};'use strict';var _=require('lodash');var crypto=require(_0x1126('0x0'));var jwt=require(_0x1126('0x1'));var moment=require(_0x1126('0x2'));var Redis=require(_0x1126('0x3'));var rp=require(_0x1126('0x4'));var util=require(_0x1126('0x5'));var encryptor=require(_0x1126('0x6'));var config=require(_0x1126('0x7'));var logger=require(_0x1126('0x8'))(_0x1126('0x9'));var schedule=require('../../config/schedule/cloud-provider');var db=require('../../mysqldb')['db'];config[_0x1126('0xa')]=_[_0x1126('0xb')](config['redis'],{'host':_0x1126('0xc'),'port':0x18eb});var redis=new Redis(config[_0x1126('0xa')]);var MICROSOFT_AUTH_URL=_0x1126('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0x1126('0xe'),_0x1126('0xf'),'email',_0x1126('0x10'),_0x1126('0x11'),_0x1126('0x12'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x1126('0xe'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x1126('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x561b93){var _0x15e89b=_[_0x1126('0x14')](AZURE_AUTH_SCOPES[_0x561b93[_0x1126('0x15')]]);if(_0x561b93[_0x1126('0x15')]===_0x1126('0x16'))_0x15e89b[_0x1126('0x17')](_0x561b93[_0x1126('0x18')]+_0x1126('0x19'));return _0x15e89b[_0x1126('0x1a')]('\x20');}function getAccessTokenScope(_0x53a8f0){if(_0x53a8f0['type']===_0x1126('0x1b'))return _0x1126('0x11');if(_0x53a8f0[_0x1126('0x15')]==='Dynamics365')return _0x53a8f0[_0x1126('0x18')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x35fe9f,_0x42f379){var _0x257b5f=MICROSOFT_AUTH_URL['replace'](_0x1126('0x1c'),_0x35fe9f[_0x1126('0x1d')]);var _0x4a7b49=['code',_0x1126('0x1e')];var _0x2b2487=Buffer['from'](JSON['stringify']({'id':_0x42f379}))[_0x1126('0x1f')]('base64');var _0x22ed37=crypto[_0x1126('0x20')](0x10)[_0x1126('0x1f')]('hex');var _0x2a08ba=getAuthorizationScopes(_0x35fe9f);var _0x49d209=[{'key':'client_id','value':_0x35fe9f[_0x1126('0x21')]},{'key':_0x1126('0x22'),'value':encodeURIComponent(_0x4a7b49[_0x1126('0x1a')]('\x20'))},{'key':_0x1126('0x23'),'value':_0x35fe9f['data4']},{'key':_0x1126('0x24'),'value':_0x1126('0x25')},{'key':'scope','value':encodeURIComponent(_0x2a08ba)},{'key':_0x1126('0x26'),'value':_0x2b2487},{'key':'nonce','value':_0x22ed37},{'key':'prompt','value':'login'}];var _0x2199d9=_0x257b5f+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x1126('0x14')](_0x49d209,function(_0x329914){return _0x329914[_0x1126('0x27')]+'='+_0x329914[_0x1126('0x28')];})[_0x1126('0x1a')]('&');_0x35fe9f[_0x1126('0x29')]={'issuer':_0x257b5f[_0x1126('0x2a')]('oauth2/',''),'audience':_0x35fe9f[_0x1126('0x21')],'state':_0x2b2487,'nonce':_0x22ed37};redis[_0x1126('0x2b')](_0x2b2487,JSON[_0x1126('0x2c')](_0x35fe9f));return _0x2199d9;}function isValidIdToken(_0x5ddf63,_0x541bc9){try{var _0xeb7d89=jwt[_0x1126('0x2d')](_0x5ddf63,{'complete':!![]});var _0x55e195=_0xeb7d89[_0x1126('0x2e')];if(_0x55e195[_0x1126('0x2f')]!==_0x541bc9['issuer'])return![];if(_0x55e195[_0x1126('0x30')]!==_0x541bc9['audience'])return![];if(_0x55e195[_0x1126('0x31')]!==_0x541bc9['nonce'])return![];if(moment()[_0x1126('0x32')](moment['unix'](_0x55e195[_0x1126('0x33')])))return![];return!![];}catch(_0x5f2611){throw _0x5f2611;}}function refreshOauth2MicrosoftAccessToken(_0x5252e0){return Promise['resolve']()[_0x1126('0x34')](function(){if(_0x5252e0[_0x1126('0x35')])return _0x5252e0;return db[_0x1126('0x36')]['findOne']({'where':{'id':_0x5252e0['id']},'raw':!![]});})[_0x1126('0x34')](function(_0x226afb){var _0x56f7f8={'grant_type':_0x1126('0x37'),'refresh_token':_0x226afb[_0x1126('0x38')],'scope':getAccessTokenScope(_0x226afb),'redirect_uri':_0x226afb[_0x1126('0x39')],'client_id':_0x226afb[_0x1126('0x21')],'client_secret':encryptor['decryptString'](_0x226afb['data3'])};var _0x2a7edc={'method':_0x1126('0x3a'),'uri':MICROSOFT_AUTH_URL[_0x1126('0x2a')](_0x1126('0x1c'),_0x226afb['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x56f7f8,'json':!![]};return rp(_0x2a7edc);})[_0x1126('0x34')](function(_0x6f4312){_0x5252e0[_0x1126('0x3b')]=_0x6f4312[_0x1126('0x3c')];_0x5252e0[_0x1126('0x38')]=_0x6f4312['refresh_token'];return db[_0x1126('0x36')][_0x1126('0x3d')]({'data5':_0x5252e0[_0x1126('0x3b')],'data6':_0x5252e0[_0x1126('0x38')]},{'where':{'id':_0x5252e0['id']}});})['then'](function(){return _0x5252e0;})['catch'](function(_0x22827a){logger[_0x1126('0x3e')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s',_0x5252e0['id'],_0x22827a);});}function getOauth2MicrosoftAccessToken(_0xde37cf,_0xf3c21b){var _0x11b0f6={'grant_type':'authorization_code','code':_0xde37cf,'scope':getAccessTokenScope(_0xf3c21b),'redirect_uri':_0xf3c21b['data4'],'client_id':_0xf3c21b[_0x1126('0x21')],'client_secret':encryptor[_0x1126('0x3f')](_0xf3c21b[_0x1126('0x35')])};var _0x156554={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x1126('0x2a')]('{TENANT_ID}',_0xf3c21b[_0x1126('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x11b0f6,'json':!![]};return rp(_0x156554);}function startRefreshInterval(_0x20e43a){var _0xfa96e0=schedule[_0x1126('0x40')];if(_0xfa96e0[_0x20e43a['id']])clearInterval(_0xfa96e0[_0x20e43a['id']]);_0xfa96e0[_0x20e43a['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x1126('0x41')](this,{'id':_0x20e43a['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0xfa96e0;}function startAllRefreshIntervals(){return db[_0x1126('0x36')][_0x1126('0x42')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x1126('0x34')](function(_0x397e3b){var _0x3469a2=_0x397e3b[_0x1126('0x14')](function(_0x3052f9){return refreshOauth2MicrosoftAccessToken(_0x3052f9)['then'](function(_0x1c8d8a){startRefreshInterval(_0x1c8d8a);});});return Promise[_0x1126('0x43')](_0x3469a2);})[_0x1126('0x44')](function(_0xf3a0bd){var _0xcf0483=_0xf3a0bd?util['inspect'](_0xf3a0bd,{'showHidden':![],'depth':null}):'';logger['error'](_0x1126('0x45'),_0xcf0483);});}module[_0x1126('0x46')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x5f2f=['stringify','toString','randomBytes','data1','response_type','redirect_uri','data4','form_post','scope','state','nonce','prompt','key','value','oauth2Claims','oauth2/','decode','issuer','aud','audience','isAfter','unix','exp','data3','findOne','refresh_token','data6','decryptString','POST','then','data5','update','catch','intervals','CloudProvider','findAll','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','/.default','join','Outlook365','data7','replace','{TENANT_ID}','data2','code','id_token','from'];(function(_0x386c3e,_0x44a375){var _0x4b8e13=function(_0x583c8f){while(--_0x583c8f){_0x386c3e['push'](_0x386c3e['shift']());}};_0x4b8e13(++_0x44a375);}(_0x5f2f,0x73));var _0xf5f2=function(_0x383f7f,_0x11b7c2){_0x383f7f=_0x383f7f-0x0;var _0x4e2f71=_0x5f2f[_0x383f7f];return _0x4e2f71;};'use strict';var _=require(_0xf5f2('0x0'));var crypto=require(_0xf5f2('0x1'));var jwt=require(_0xf5f2('0x2'));var moment=require(_0xf5f2('0x3'));var Redis=require(_0xf5f2('0x4'));var rp=require(_0xf5f2('0x5'));var util=require(_0xf5f2('0x6'));var encryptor=require(_0xf5f2('0x7'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0xf5f2('0x8'));var schedule=require(_0xf5f2('0x9'));var db=require(_0xf5f2('0xa'))['db'];config[_0xf5f2('0xb')]=_[_0xf5f2('0xc')](config[_0xf5f2('0xb')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0xf5f2('0xb')]);var MICROSOFT_AUTH_URL=_0xf5f2('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0xf5f2('0xe'),'profile',_0xf5f2('0xf'),_0xf5f2('0x10'),_0xf5f2('0x11'),'https://outlook.office.com/POP.AccessAsUser.All',_0xf5f2('0x12')],'Dynamics365':['openid','offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0xf5f2('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0xf5f2('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x4b78cd){var _0x336f6b=_[_0xf5f2('0x15')](AZURE_AUTH_SCOPES[_0x4b78cd[_0xf5f2('0x16')]]);if(_0x4b78cd[_0xf5f2('0x16')]===_0xf5f2('0x17'))_0x336f6b[_0xf5f2('0x18')](_0x4b78cd['data7']+_0xf5f2('0x19'));return _0x336f6b[_0xf5f2('0x1a')]('\x20');}function getAccessTokenScope(_0x269909){if(_0x269909[_0xf5f2('0x16')]===_0xf5f2('0x1b'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x269909[_0xf5f2('0x16')]===_0xf5f2('0x17'))return _0x269909[_0xf5f2('0x1c')]+_0xf5f2('0x19');}function generateMicrosoftAuthorizationUrl(_0x23e23a,_0x3a9dbb){var _0xdb61b3=MICROSOFT_AUTH_URL[_0xf5f2('0x1d')](_0xf5f2('0x1e'),_0x23e23a[_0xf5f2('0x1f')]);var _0x20fccd=[_0xf5f2('0x20'),_0xf5f2('0x21')];var _0x3ee69=Buffer[_0xf5f2('0x22')](JSON[_0xf5f2('0x23')]({'id':_0x3a9dbb}))[_0xf5f2('0x24')]('base64');var _0x34706d=crypto[_0xf5f2('0x25')](0x10)['toString']('hex');var _0x2d2805=getAuthorizationScopes(_0x23e23a);var _0x388e6c=[{'key':'client_id','value':_0x23e23a[_0xf5f2('0x26')]},{'key':_0xf5f2('0x27'),'value':encodeURIComponent(_0x20fccd[_0xf5f2('0x1a')]('\x20'))},{'key':_0xf5f2('0x28'),'value':_0x23e23a[_0xf5f2('0x29')]},{'key':'response_mode','value':_0xf5f2('0x2a')},{'key':_0xf5f2('0x2b'),'value':encodeURIComponent(_0x2d2805)},{'key':_0xf5f2('0x2c'),'value':_0x3ee69},{'key':_0xf5f2('0x2d'),'value':_0x34706d},{'key':_0xf5f2('0x2e'),'value':'login'}];var _0x529f07=_0xdb61b3+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xf5f2('0x15')](_0x388e6c,function(_0x3f79d5){return _0x3f79d5[_0xf5f2('0x2f')]+'='+_0x3f79d5[_0xf5f2('0x30')];})[_0xf5f2('0x1a')]('&');_0x23e23a[_0xf5f2('0x31')]={'issuer':_0xdb61b3[_0xf5f2('0x1d')](_0xf5f2('0x32'),''),'audience':_0x23e23a[_0xf5f2('0x26')],'state':_0x3ee69,'nonce':_0x34706d};redis['set'](_0x3ee69,JSON[_0xf5f2('0x23')](_0x23e23a));return _0x529f07;}function isValidIdToken(_0x102449,_0x375ca8){try{var _0x31bfcb=jwt[_0xf5f2('0x33')](_0x102449,{'complete':!![]});var _0x477604=_0x31bfcb['payload'];if(_0x477604['iss']!==_0x375ca8[_0xf5f2('0x34')])return![];if(_0x477604[_0xf5f2('0x35')]!==_0x375ca8[_0xf5f2('0x36')])return![];if(_0x477604['nonce']!==_0x375ca8['nonce'])return![];if(moment()[_0xf5f2('0x37')](moment[_0xf5f2('0x38')](_0x477604[_0xf5f2('0x39')])))return![];return!![];}catch(_0x153924){throw _0x153924;}}function refreshOauth2MicrosoftAccessToken(_0x1b381e){return Promise['resolve']()['then'](function(){if(_0x1b381e[_0xf5f2('0x3a')])return _0x1b381e;return db['CloudProvider'][_0xf5f2('0x3b')]({'where':{'id':_0x1b381e['id']},'raw':!![]});})['then'](function(_0x45b643){var _0x31087c={'grant_type':_0xf5f2('0x3c'),'refresh_token':_0x45b643[_0xf5f2('0x3d')],'scope':getAccessTokenScope(_0x45b643),'redirect_uri':_0x45b643[_0xf5f2('0x29')],'client_id':_0x45b643[_0xf5f2('0x26')],'client_secret':encryptor[_0xf5f2('0x3e')](_0x45b643[_0xf5f2('0x3a')])};var _0x5ca917={'method':_0xf5f2('0x3f'),'uri':MICROSOFT_AUTH_URL[_0xf5f2('0x1d')](_0xf5f2('0x1e'),_0x45b643[_0xf5f2('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x31087c,'json':!![]};return rp(_0x5ca917);})[_0xf5f2('0x40')](function(_0x27c0e7){_0x1b381e[_0xf5f2('0x41')]=_0x27c0e7['access_token'];_0x1b381e[_0xf5f2('0x3d')]=_0x27c0e7[_0xf5f2('0x3c')];return db['CloudProvider'][_0xf5f2('0x42')]({'data5':_0x1b381e['data5'],'data6':_0x1b381e[_0xf5f2('0x3d')]},{'where':{'id':_0x1b381e['id']}});})[_0xf5f2('0x40')](function(){return _0x1b381e;})[_0xf5f2('0x43')](function(_0x2e3cca){logger['error']('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s',_0x1b381e['id'],_0x2e3cca);});}function getOauth2MicrosoftAccessToken(_0x41088b,_0x46ad4a){var _0x20eb74={'grant_type':'authorization_code','code':_0x41088b,'scope':getAccessTokenScope(_0x46ad4a),'redirect_uri':_0x46ad4a[_0xf5f2('0x29')],'client_id':_0x46ad4a['data1'],'client_secret':encryptor[_0xf5f2('0x3e')](_0x46ad4a['data3'])};var _0x46f464={'method':_0xf5f2('0x3f'),'uri':MICROSOFT_AUTH_URL['replace'](_0xf5f2('0x1e'),_0x46ad4a[_0xf5f2('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x20eb74,'json':!![]};return rp(_0x46f464);}function startRefreshInterval(_0x5a4441){var _0x35f738=schedule['intervals'];if(_0x35f738[_0x5a4441['id']])clearInterval(_0x35f738[_0x5a4441['id']]);_0x35f738[_0x5a4441['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x5a4441['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xf5f2('0x44')]=_0x35f738;}function startAllRefreshIntervals(){return db[_0xf5f2('0x45')][_0xf5f2('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xf5f2('0x40')](function(_0x2c7f65){var _0xe62b57=_0x2c7f65[_0xf5f2('0x15')](function(_0x4c0ac7){return refreshOauth2MicrosoftAccessToken(_0x4c0ac7)[_0xf5f2('0x40')](function(_0x3b4ea6){startRefreshInterval(_0x3b4ea6);});});return Promise['all'](_0xe62b57);})[_0xf5f2('0x43')](function(_0x3f3895){var _0x71b0e7=_0x3f3895?util[_0xf5f2('0x47')](_0x3f3895,{'showHidden':![],'depth':null}):'';logger[_0xf5f2('0x48')](_0xf5f2('0x49'),_0x71b0e7);});}module[_0xf5f2('0x4a')]={'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 74e9557..655da12 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 _0xed03=['info','CloudProvider,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x3fa127,_0x12e7ab){var _0x2b7a29=function(_0x439ab7){while(--_0x439ab7){_0x3fa127['push'](_0x3fa127['shift']());}};_0x2b7a29(++_0x12e7ab);}(_0xed03,0xdc));var _0x3ed0=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0xed03[_0x4ae625];return _0x31accf;};'use strict';var _=require(_0x3ed0('0x0'));var util=require(_0x3ed0('0x1'));var moment=require('moment');var BPromise=require(_0x3ed0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3ed0('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3ed0('0x4'))('rpc');var config=require(_0x3ed0('0x5'));var jayson=require(_0x3ed0('0x6'));var client=jayson[_0x3ed0('0x7')][_0x3ed0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x8470b7,_0x3f1277,_0xd729a0){return new BPromise(function(_0x4500aa,_0xddc4c5){return client[_0x3ed0('0x9')](_0x8470b7,_0xd729a0)[_0x3ed0('0xa')](function(_0x34950c){logger[_0x3ed0('0xb')](_0x3ed0('0xc'),_0x3f1277,'request\x20sent');logger[_0x3ed0('0xd')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x3f1277,_0x3ed0('0xe'),JSON[_0x3ed0('0xf')](_0x34950c));if(_0x34950c[_0x3ed0('0x10')]){if(_0x34950c['error'][_0x3ed0('0x11')]===0x1f4){logger[_0x3ed0('0x10')](_0x3ed0('0xc'),_0x3f1277,_0x34950c[_0x3ed0('0x10')][_0x3ed0('0x12')]);return _0xddc4c5(_0x34950c['error'][_0x3ed0('0x12')]);}logger[_0x3ed0('0x10')](_0x3ed0('0xc'),_0x3f1277,_0x34950c[_0x3ed0('0x10')][_0x3ed0('0x12')]);return _0x4500aa(_0x34950c['error'][_0x3ed0('0x12')]);}else{logger[_0x3ed0('0xb')]('CloudProvider,\x20%s,\x20%s',_0x3f1277,_0x3ed0('0xe'));_0x4500aa(_0x34950c[_0x3ed0('0x13')][_0x3ed0('0x12')]);}})[_0x3ed0('0x14')](function(_0xaa73cd){logger[_0x3ed0('0x10')]('CloudProvider,\x20%s,\x20%s',_0x3f1277,_0xaa73cd);_0xddc4c5(_0xaa73cd);});});}
\ No newline at end of file
+var _0x6edc=['code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x24348e,_0x360eb9){var _0x41a5b1=function(_0x3ee79b){while(--_0x3ee79b){_0x24348e['push'](_0x24348e['shift']());}};_0x41a5b1(++_0x360eb9);}(_0x6edc,0x138));var _0xc6ed=function(_0x2957d6,_0x363bbb){_0x2957d6=_0x2957d6-0x0;var _0x379052=_0x6edc[_0x2957d6];return _0x379052;};'use strict';var _=require(_0xc6ed('0x0'));var util=require(_0xc6ed('0x1'));var moment=require(_0xc6ed('0x2'));var BPromise=require(_0xc6ed('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc6ed('0x4'))['db'];var utils=require(_0xc6ed('0x5'));var logger=require(_0xc6ed('0x6'))(_0xc6ed('0x7'));var config=require('../../config/environment');var jayson=require(_0xc6ed('0x8'));var client=jayson[_0xc6ed('0x9')][_0xc6ed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x548a14,_0x274b0d,_0x5a077d){return new BPromise(function(_0xd46c3f,_0x13fed0){return client[_0xc6ed('0xb')](_0x548a14,_0x5a077d)[_0xc6ed('0xc')](function(_0x496e6a){logger[_0xc6ed('0xd')](_0xc6ed('0xe'),_0x274b0d,_0xc6ed('0xf'));logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x274b0d,_0xc6ed('0xf'),JSON[_0xc6ed('0x10')](_0x496e6a));if(_0x496e6a[_0xc6ed('0x11')]){if(_0x496e6a[_0xc6ed('0x11')][_0xc6ed('0x12')]===0x1f4){logger['error'](_0xc6ed('0xe'),_0x274b0d,_0x496e6a['error'][_0xc6ed('0x13')]);return _0x13fed0(_0x496e6a['error'][_0xc6ed('0x13')]);}logger[_0xc6ed('0x11')](_0xc6ed('0xe'),_0x274b0d,_0x496e6a['error'][_0xc6ed('0x13')]);return _0xd46c3f(_0x496e6a[_0xc6ed('0x11')][_0xc6ed('0x13')]);}else{logger['info'](_0xc6ed('0xe'),_0x274b0d,'request\x20sent');_0xd46c3f(_0x496e6a[_0xc6ed('0x14')][_0xc6ed('0x13')]);}})[_0xc6ed('0x15')](function(_0x5346fe){logger[_0xc6ed('0x11')](_0xc6ed('0xe'),_0x274b0d,_0x5346fe);_0x13fed0(_0x5346fe);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index cf0523c..befffbb 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(_0x421357,_0x2692ec){var _0x131815=function(_0x4d5078){while(--_0x4d5078){_0x421357['push'](_0x421357['shift']());}};_0x131815(++_0x2692ec);}(_0xadb5,0xad));var _0x5adb=function(_0x40d0f2,_0x345838){_0x40d0f2=_0x40d0f2-0x0;var _0x3c0ffd=_0xadb5[_0x40d0f2];return _0x3c0ffd;};'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 _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x489c95,_0x53159c){var _0x10e7a7=function(_0xcb4342){while(--_0xcb4342){_0x489c95['push'](_0x489c95['shift']());}};_0x10e7a7(++_0x53159c);}(_0x1261,0x144));var _0x1126=function(_0x21eb3c,_0x7ce88b){_0x21eb3c=_0x21eb3c-0x0;var _0x4bd2aa=_0x1261[_0x21eb3c];return _0x4bd2aa;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 16e16b7..69744f9 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 _0x0902=['STRING','sequelize','name'];(function(_0x372a76,_0x1052f8){var _0x36f1f2=function(_0x4b485c){while(--_0x4b485c){_0x372a76['push'](_0x372a76['shift']());}};_0x36f1f2(++_0x1052f8);}(_0x0902,0xaf));var _0x2090=function(_0x8c7987,_0x3d6936){_0x8c7987=_0x8c7987-0x0;var _0x582752=_0x0902[_0x8c7987];return _0x582752;};'use strict';var Sequelize=require(_0x2090('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x2090('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x2090('0x2')]},'companyId':{'type':Sequelize[_0x2090('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x2090('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2090('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x2090('0x2')]},'city':{'type':Sequelize[_0x2090('0x2')]},'country':{'type':Sequelize[_0x2090('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x2090('0x2')]},'sPostalCode':{'type':Sequelize[_0x2090('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2090('0x2')]}};
\ No newline at end of file
+var _0xb33f=['exports','name','STRING','sequelize'];(function(_0x4bc0de,_0x1089b5){var _0x5db9c3=function(_0x408a55){while(--_0x408a55){_0x4bc0de['push'](_0x4bc0de['shift']());}};_0x5db9c3(++_0x1089b5);}(_0xb33f,0x1cf));var _0xfb33=function(_0x17ff2b,_0x3eb0ca){_0x17ff2b=_0x17ff2b-0x0;var _0x315754=_0xb33f[_0x17ff2b];return _0x315754;};'use strict';var Sequelize=require(_0xfb33('0x0'));module[_0xfb33('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xfb33('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xfb33('0x3')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xfb33('0x3')]},'postalCode':{'type':Sequelize[_0xfb33('0x3')]},'city':{'type':Sequelize[_0xfb33('0x3')]},'country':{'type':Sequelize[_0xfb33('0x3')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xfb33('0x3')]},'sStreet':{'type':Sequelize[_0xfb33('0x3')]},'sPostalCode':{'type':Sequelize[_0xfb33('0x3')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xfb33('0x3')]},'description':{'type':Sequelize[_0xfb33('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index fb21ffd..8db1420 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 _0x925d=['error','stack','name','send','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','getContacts','findOne','rawAttributes','order','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','UserProfileResource'];(function(_0x2dcb46,_0x264a0d){var _0x32d8ca=function(_0x5708d6){while(--_0x5708d6){_0x2dcb46['push'](_0x2dcb46['shift']());}};_0x32d8ca(++_0x264a0d);}(_0x925d,0x129));var _0xd925=function(_0x2f0a8e,_0xa0731b){_0x2f0a8e=_0x2f0a8e-0x0;var _0x265e84=_0x925d[_0x2f0a8e];return _0x265e84;};'use strict';var emlformat=require(_0xd925('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd925('0x1'));var jsonpatch=require(_0xd925('0x2'));var rp=require(_0xd925('0x3'));var moment=require('moment');var BPromise=require(_0xd925('0x4'));var Mustache=require('mustache');var util=require(_0xd925('0x5'));var path=require(_0xd925('0x6'));var sox=require(_0xd925('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd925('0x8'));var _=require(_0xd925('0x9'));var squel=require(_0xd925('0xa'));var crypto=require(_0xd925('0xb'));var jsforce=require(_0xd925('0xc'));var deskjs=require(_0xd925('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd925('0xe'));var Papa=require(_0xd925('0xf'));var Redis=require('ioredis');var authService=require(_0xd925('0x10'));var qs=require(_0xd925('0x11'));var as=require(_0xd925('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd925('0x13'))(_0xd925('0x14'));var utils=require(_0xd925('0x15'));var config=require(_0xd925('0x16'));var licenseUtil=require(_0xd925('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3fd7df,_0x56baec){_0x56baec=_0x56baec||0xcc;return function(_0x4e7704){if(_0x4e7704){return _0x3fd7df[_0xd925('0x18')](_0x56baec);}return _0x3fd7df[_0xd925('0x19')](_0x56baec)[_0xd925('0x1a')]();};}function respondWithResult(_0x3b3d79,_0x24c1da){_0x24c1da=_0x24c1da||0xc8;return function(_0x288abc){if(_0x288abc){return _0x3b3d79[_0xd925('0x19')](_0x24c1da)[_0xd925('0x1b')](_0x288abc);}};}function respondWithFilteredResult(_0xcd784d,_0x259e81){return function(_0x36f525){if(_0x36f525){var _0x2e2e3b=typeof _0x259e81[_0xd925('0x1c')]===_0xd925('0x1d')&&typeof _0x259e81[_0xd925('0x1e')]==='undefined';var _0x40d1c4=_0x36f525[_0xd925('0x1f')];var _0x473698=_0x2e2e3b?0x0:_0x259e81['offset'];var _0x2ebad7=_0x2e2e3b?_0x36f525['count']:_0x259e81['offset']+_0x259e81[_0xd925('0x1e')];var _0x33514a;if(_0x2ebad7>=_0x40d1c4){_0x2ebad7=_0x40d1c4;_0x33514a=0xc8;}else{_0x33514a=0xce;}_0xcd784d['status'](_0x33514a);return _0xcd784d['set'](_0xd925('0x20'),_0x473698+'-'+_0x2ebad7+'/'+_0x40d1c4)[_0xd925('0x1b')](_0x36f525);}return null;};}function patchUpdates(_0x3be87b){return function(_0x57ecb5){try{jsonpatch['apply'](_0x57ecb5,_0x3be87b,!![]);}catch(_0x53ffa0){return BPromise[_0xd925('0x21')](_0x53ffa0);}return _0x57ecb5[_0xd925('0x22')]();};}function saveUpdates(_0x58e904,_0xd8b508){return function(_0x3884cb){if(_0x3884cb){return _0x3884cb[_0xd925('0x23')](_0x58e904)[_0xd925('0x24')](function(_0x29f1c2){return _0x29f1c2;});}return null;};}function removeEntity(_0x2a2ab6,_0x148336){return function(_0x9e2e78){if(_0x9e2e78){return _0x9e2e78[_0xd925('0x25')]()['then'](function(){var _0x2733af=_0x9e2e78['get']({'plain':!![]});var _0x59aae2='Companies';return db[_0xd925('0x26')][_0xd925('0x25')]({'where':{'type':_0x59aae2,'resourceId':_0x2733af['id']}})['then'](function(){return _0x9e2e78;});})['then'](function(){_0x2a2ab6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41a22d,_0x343ca1){return function(_0x4ea50e){if(!_0x4ea50e){_0x41a22d[_0xd925('0x18')](0x194);}return _0x4ea50e;};}function handleError(_0x344fed,_0x29dbaf){_0x29dbaf=_0x29dbaf||0x1f4;return function(_0x58074f){logger[_0xd925('0x27')](_0x58074f[_0xd925('0x28')]);if(_0x58074f[_0xd925('0x29')]){delete _0x58074f[_0xd925('0x29')];}_0x344fed[_0xd925('0x19')](_0x29dbaf)[_0xd925('0x2a')](_0x58074f);};}exports['index']=function(_0x24aaea,_0x521576){var _0x543f52={},_0x245e4e={},_0x43084e={'count':0x0,'rows':[]};return db[_0xd925('0x2b')][_0xd925('0x2c')]()[_0xd925('0x24')](function(_0x219b9f){_0x245e4e[_0xd925('0x2d')]=_[_0xd925('0x2e')](_0x219b9f);_0x245e4e['query']=_[_0xd925('0x2e')](_0x24aaea[_0xd925('0x2f')]);_0x245e4e[_0xd925('0x30')]=_[_0xd925('0x31')](_0x245e4e[_0xd925('0x2d')],_0x245e4e[_0xd925('0x2f')]);_0x543f52[_0xd925('0x32')]=_[_0xd925('0x31')](_0x245e4e[_0xd925('0x2d')],qs[_0xd925('0x33')](_0x24aaea[_0xd925('0x2f')]['fields']));_0x543f52[_0xd925('0x32')]=_0x543f52[_0xd925('0x32')]['length']?_0x543f52['attributes']:_0x245e4e[_0xd925('0x2d')];if(!_0x24aaea[_0xd925('0x2f')]['hasOwnProperty'](_0xd925('0x34'))){_0x543f52['limit']=qs[_0xd925('0x1e')](_0x24aaea[_0xd925('0x2f')][_0xd925('0x1e')]);_0x543f52[_0xd925('0x1c')]=qs['offset'](_0x24aaea['query'][_0xd925('0x1c')]);}_0x543f52['order']=qs[_0xd925('0x35')](_0x24aaea[_0xd925('0x2f')]['sort']);_0x543f52[_0xd925('0x36')]=qs[_0xd925('0x30')](_[_0xd925('0x37')](_0x24aaea[_0xd925('0x2f')],_0x245e4e[_0xd925('0x30')]),_0x219b9f);if(_0x24aaea[_0xd925('0x2f')][_0xd925('0x38')]){_0x543f52[_0xd925('0x36')]=_[_0xd925('0x39')](_0x543f52['where'],{'$or':_['map'](_0x543f52[_0xd925('0x32')],function(_0x13456a){var _0x541f3b={};_0x541f3b[_0x13456a]={'$like':'%'+_0x24aaea[_0xd925('0x2f')][_0xd925('0x38')]+'%'};return _0x541f3b;})});}_0x543f52=_[_0xd925('0x39')]({},_0x543f52,_0x24aaea[_0xd925('0x3a')]);var _0x4974df={'where':_0x543f52[_0xd925('0x36')]};return db[_0xd925('0x2b')]['count'](_0x4974df)['then'](function(_0x4b9fec){_0x43084e['count']=_0x4b9fec;if(_0x24aaea['query']['includeAll']){_0x543f52[_0xd925('0x3b')]=[{'all':!![]}];}return db[_0xd925('0x2b')][_0xd925('0x3c')](_0x543f52);})[_0xd925('0x24')](function(_0x1a8668){_0x43084e[_0xd925('0x3d')]=_0x1a8668;return _0x43084e;})[_0xd925('0x24')](respondWithFilteredResult(_0x521576,_0x543f52))[_0xd925('0x3e')](handleError(_0x521576,null));})[_0xd925('0x3e')](handleError(_0x521576,null));};exports[_0xd925('0x3f')]=function(_0x560339,_0x3bcfae){var _0x2bc36f={'raw':![],'where':{'id':_0x560339[_0xd925('0x40')]['id']}},_0x9ec95a={};_0x9ec95a['model']=_[_0xd925('0x2e')](db[_0xd925('0x2b')]['rawAttributes']);_0x9ec95a[_0xd925('0x2f')]=_[_0xd925('0x2e')](_0x560339[_0xd925('0x2f')]);_0x9ec95a[_0xd925('0x30')]=_[_0xd925('0x31')](_0x9ec95a['model'],_0x9ec95a[_0xd925('0x2f')]);_0x2bc36f[_0xd925('0x32')]=_['intersection'](_0x9ec95a[_0xd925('0x2d')],qs[_0xd925('0x33')](_0x560339[_0xd925('0x2f')][_0xd925('0x33')]));_0x2bc36f[_0xd925('0x32')]=_0x2bc36f[_0xd925('0x32')][_0xd925('0x41')]?_0x2bc36f[_0xd925('0x32')]:_0x9ec95a[_0xd925('0x2d')];if(_0x560339['query'][_0xd925('0x42')]){_0x2bc36f[_0xd925('0x3b')]=[{'all':!![]}];}_0x2bc36f=_[_0xd925('0x39')]({},_0x2bc36f,_0x560339[_0xd925('0x3a')]);return db['CmCompany'][_0xd925('0x43')](_0x2bc36f)[_0xd925('0x24')](handleEntityNotFound(_0x3bcfae,null))[_0xd925('0x24')](respondWithResult(_0x3bcfae,null))[_0xd925('0x3e')](handleError(_0x3bcfae,null));};exports[_0xd925('0x44')]=function(_0x376de6,_0x482eca){return db[_0xd925('0x2b')][_0xd925('0x44')](_0x376de6[_0xd925('0x45')],{})[_0xd925('0x24')](function(_0x4da284){var _0x89a3b2=_0x376de6[_0xd925('0x46')][_0xd925('0x47')]({'plain':!![]});if(!_0x89a3b2)throw new Error(_0xd925('0x48'));if(_0x89a3b2['role']===_0xd925('0x46')){var _0x22978b=_0x4da284['get']({'plain':!![]});var _0x4fe211='Companies';return db[_0xd925('0x49')][_0xd925('0x43')]({'where':{'name':_0x4fe211,'userProfileId':_0x89a3b2[_0xd925('0x4a')]},'raw':!![]})['then'](function(_0x3fe78f){if(_0x3fe78f&&_0x3fe78f[_0xd925('0x4b')]===0x0){return db['UserProfileResource']['create']({'name':_0x22978b[_0xd925('0x29')],'resourceId':_0x22978b['id'],'type':_0x3fe78f['name'],'sectionId':_0x3fe78f['id']},{})[_0xd925('0x24')](function(){return _0x4da284;});}else{return _0x4da284;}})['catch'](function(_0x3acdae){logger[_0xd925('0x27')](_0xd925('0x4c'),_0x3acdae);throw _0x3acdae;});}return _0x4da284;})[_0xd925('0x24')](respondWithResult(_0x482eca,0xc9))[_0xd925('0x3e')](handleError(_0x482eca,null));};exports[_0xd925('0x23')]=function(_0x349208,_0x196869){if(_0x349208[_0xd925('0x45')]['id']){delete _0x349208[_0xd925('0x45')]['id'];}return db[_0xd925('0x2b')][_0xd925('0x43')]({'where':{'id':_0x349208[_0xd925('0x40')]['id']}})[_0xd925('0x24')](handleEntityNotFound(_0x196869,null))['then'](saveUpdates(_0x349208[_0xd925('0x45')],null))[_0xd925('0x24')](respondWithResult(_0x196869,null))[_0xd925('0x3e')](handleError(_0x196869,null));};exports[_0xd925('0x25')]=function(_0x542a6d,_0x4c4bc5){return db[_0xd925('0x2b')][_0xd925('0x43')]({'where':{'id':_0x542a6d[_0xd925('0x40')]['id']}})['then'](handleEntityNotFound(_0x4c4bc5,null))[_0xd925('0x24')](removeEntity(_0x4c4bc5,null))[_0xd925('0x3e')](handleError(_0x4c4bc5,null));};exports[_0xd925('0x2c')]=function(_0x48f481,_0x3677ca){return db[_0xd925('0x2b')][_0xd925('0x2c')]()[_0xd925('0x24')](respondWithResult(_0x3677ca,null))['catch'](handleError(_0x3677ca,null));};exports[_0xd925('0x4d')]=function(_0x2880e5,_0x2dbf46,_0x2991c8){return db[_0xd925('0x4e')][_0xd925('0x43')]({'where':{'id':_0x2880e5['params']['id']}})[_0xd925('0x24')](handleEntityNotFound(_0x2dbf46,null))[_0xd925('0x24')](function(_0x47fb9d){if(_0x47fb9d){return _0x47fb9d[_0xd925('0x4d')](_0x2880e5[_0xd925('0x45')][_0xd925('0x4f')],_['omit'](_0x2880e5['body'],[_0xd925('0x4f'),'id'])||{});}})['then'](respondWithResult(_0x2dbf46,null))[_0xd925('0x3e')](handleError(_0x2dbf46,null));};exports[_0xd925('0x50')]=function(_0x4e8bca,_0x321087,_0x19abd0){var _0x55ec7c={};var _0x1377a8={};var _0x3ed30d;var _0x5c15d5;return db['CmCompany'][_0xd925('0x51')]({'where':{'id':_0x4e8bca['params']['id']}})[_0xd925('0x24')](handleEntityNotFound(_0x321087,null))[_0xd925('0x24')](function(_0x1377f5){if(_0x1377f5){_0x3ed30d=_0x1377f5;_0x1377a8[_0xd925('0x2d')]=_[_0xd925('0x2e')](db[_0xd925('0x4e')][_0xd925('0x52')]);_0x1377a8['query']=_[_0xd925('0x2e')](_0x4e8bca[_0xd925('0x2f')]);_0x1377a8[_0xd925('0x30')]=_[_0xd925('0x31')](_0x1377a8['model'],_0x1377a8[_0xd925('0x2f')]);_0x55ec7c[_0xd925('0x32')]=_[_0xd925('0x31')](_0x1377a8[_0xd925('0x2d')],qs[_0xd925('0x33')](_0x4e8bca[_0xd925('0x2f')][_0xd925('0x33')]));_0x55ec7c[_0xd925('0x32')]=_0x55ec7c[_0xd925('0x32')][_0xd925('0x41')]?_0x55ec7c['attributes']:_0x1377a8[_0xd925('0x2d')];_0x55ec7c[_0xd925('0x53')]=qs[_0xd925('0x35')](_0x4e8bca[_0xd925('0x2f')][_0xd925('0x35')]);_0x55ec7c[_0xd925('0x36')]=qs[_0xd925('0x30')](_['pick'](_0x4e8bca[_0xd925('0x2f')],_0x1377a8[_0xd925('0x30')]));if(_0x4e8bca[_0xd925('0x2f')][_0xd925('0x38')]){_0x55ec7c[_0xd925('0x36')]=_[_0xd925('0x39')](_0x55ec7c[_0xd925('0x36')],{'$or':_['map'](_0x55ec7c[_0xd925('0x32')],function(_0x19a148){var _0x2d4b4b={};_0x2d4b4b[_0x19a148]={'$like':'%'+_0x4e8bca[_0xd925('0x2f')][_0xd925('0x38')]+'%'};return _0x2d4b4b;})});}_0x55ec7c=_[_0xd925('0x39')]({},_0x55ec7c,_0x4e8bca[_0xd925('0x3a')]);return _0x3ed30d['getContacts'](_0x55ec7c);}})[_0xd925('0x24')](function(_0x29fd38){if(_0x29fd38){_0x5c15d5=_0x29fd38['length'];if(!_0x4e8bca[_0xd925('0x2f')]['hasOwnProperty']('nolimit')){_0x55ec7c[_0xd925('0x1e')]=qs['limit'](_0x4e8bca[_0xd925('0x2f')][_0xd925('0x1e')]);_0x55ec7c[_0xd925('0x1c')]=qs[_0xd925('0x1c')](_0x4e8bca['query'][_0xd925('0x1c')]);}return _0x3ed30d[_0xd925('0x50')](_0x55ec7c);}})[_0xd925('0x24')](function(_0x5ae4fe){if(_0x5ae4fe){return _0x5ae4fe?{'count':_0x5c15d5,'rows':_0x5ae4fe}:null;}})[_0xd925('0x24')](respondWithResult(_0x321087,null))['catch'](handleError(_0x321087,null));};
\ No newline at end of file
+var _0x93db=['name','send','CmCompany','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','map','merge','includeAll','include','findAll','rows','catch','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addContacts','omit','ids','findOne','CmContact','order','pick','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','Companies','end','error','stack'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x93db,0xd5));var _0xb93d=function(_0x1ed15d,_0xdfa8bc){_0x1ed15d=_0x1ed15d-0x0;var _0x39d7e4=_0x93db[_0x1ed15d];return _0x39d7e4;};'use strict';var emlformat=require(_0xb93d('0x0'));var rimraf=require(_0xb93d('0x1'));var zipdir=require(_0xb93d('0x2'));var jsonpatch=require(_0xb93d('0x3'));var rp=require(_0xb93d('0x4'));var moment=require(_0xb93d('0x5'));var BPromise=require(_0xb93d('0x6'));var Mustache=require(_0xb93d('0x7'));var util=require(_0xb93d('0x8'));var path=require(_0xb93d('0x9'));var sox=require(_0xb93d('0xa'));var csv=require(_0xb93d('0xb'));var ejs=require(_0xb93d('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb93d('0xd'));var squel=require('squel');var crypto=require(_0xb93d('0xe'));var jsforce=require(_0xb93d('0xf'));var deskjs=require(_0xb93d('0x10'));var toCsv=require(_0xb93d('0xb'));var querystring=require(_0xb93d('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb93d('0x12'));var as=require(_0xb93d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb93d('0x14'))(_0xb93d('0x15'));var utils=require('../../config/utils');var config=require(_0xb93d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb93d('0x17'))['db'];function respondWithStatusCode(_0x449a47,_0x515daa){_0x515daa=_0x515daa||0xcc;return function(_0x3b63d8){if(_0x3b63d8){return _0x449a47[_0xb93d('0x18')](_0x515daa);}return _0x449a47[_0xb93d('0x19')](_0x515daa)['end']();};}function respondWithResult(_0x590b6a,_0x25e9c4){_0x25e9c4=_0x25e9c4||0xc8;return function(_0x5a838c){if(_0x5a838c){return _0x590b6a['status'](_0x25e9c4)['json'](_0x5a838c);}};}function respondWithFilteredResult(_0x3b053c,_0x2f27cb){return function(_0xdc6e57){if(_0xdc6e57){var _0x502d32=typeof _0x2f27cb[_0xb93d('0x1a')]===_0xb93d('0x1b')&&typeof _0x2f27cb[_0xb93d('0x1c')]===_0xb93d('0x1b');var _0x28428a=_0xdc6e57[_0xb93d('0x1d')];var _0x16c148=_0x502d32?0x0:_0x2f27cb[_0xb93d('0x1a')];var _0x431ff7=_0x502d32?_0xdc6e57['count']:_0x2f27cb[_0xb93d('0x1a')]+_0x2f27cb['limit'];var _0xcc4654;if(_0x431ff7>=_0x28428a){_0x431ff7=_0x28428a;_0xcc4654=0xc8;}else{_0xcc4654=0xce;}_0x3b053c[_0xb93d('0x19')](_0xcc4654);return _0x3b053c[_0xb93d('0x1e')](_0xb93d('0x1f'),_0x16c148+'-'+_0x431ff7+'/'+_0x28428a)['json'](_0xdc6e57);}return null;};}function patchUpdates(_0x19e309){return function(_0x7285bb){try{jsonpatch[_0xb93d('0x20')](_0x7285bb,_0x19e309,!![]);}catch(_0x1283ee){return BPromise['reject'](_0x1283ee);}return _0x7285bb[_0xb93d('0x21')]();};}function saveUpdates(_0x44b5c0,_0x34522a){return function(_0x3eaf81){if(_0x3eaf81){return _0x3eaf81[_0xb93d('0x22')](_0x44b5c0)[_0xb93d('0x23')](function(_0x4a0be1){return _0x4a0be1;});}return null;};}function removeEntity(_0x5e1199,_0x548c31){return function(_0x5dd27a){if(_0x5dd27a){return _0x5dd27a[_0xb93d('0x24')]()['then'](function(){var _0x12ec52=_0x5dd27a[_0xb93d('0x25')]({'plain':!![]});var _0x313895=_0xb93d('0x26');return db['UserProfileResource'][_0xb93d('0x24')]({'where':{'type':_0x313895,'resourceId':_0x12ec52['id']}})[_0xb93d('0x23')](function(){return _0x5dd27a;});})['then'](function(){_0x5e1199[_0xb93d('0x19')](0xcc)[_0xb93d('0x27')]();});}};}function handleEntityNotFound(_0x2304f0,_0x138e8e){return function(_0x2416ea){if(!_0x2416ea){_0x2304f0[_0xb93d('0x18')](0x194);}return _0x2416ea;};}function handleError(_0x334a4a,_0x4f178a){_0x4f178a=_0x4f178a||0x1f4;return function(_0x344081){logger[_0xb93d('0x28')](_0x344081[_0xb93d('0x29')]);if(_0x344081[_0xb93d('0x2a')]){delete _0x344081[_0xb93d('0x2a')];}_0x334a4a[_0xb93d('0x19')](_0x4f178a)[_0xb93d('0x2b')](_0x344081);};}exports['index']=function(_0x122f08,_0x55a9e3){var _0x54d456={},_0x5c5e41={},_0x4749b7={'count':0x0,'rows':[]};return db[_0xb93d('0x2c')]['describe']()[_0xb93d('0x23')](function(_0x1cf260){_0x5c5e41[_0xb93d('0x2d')]=_[_0xb93d('0x2e')](_0x1cf260);_0x5c5e41['query']=_[_0xb93d('0x2e')](_0x122f08['query']);_0x5c5e41[_0xb93d('0x2f')]=_['intersection'](_0x5c5e41[_0xb93d('0x2d')],_0x5c5e41[_0xb93d('0x30')]);_0x54d456[_0xb93d('0x31')]=_[_0xb93d('0x32')](_0x5c5e41[_0xb93d('0x2d')],qs[_0xb93d('0x33')](_0x122f08[_0xb93d('0x30')]['fields']));_0x54d456[_0xb93d('0x31')]=_0x54d456['attributes'][_0xb93d('0x34')]?_0x54d456['attributes']:_0x5c5e41[_0xb93d('0x2d')];if(!_0x122f08[_0xb93d('0x30')][_0xb93d('0x35')](_0xb93d('0x36'))){_0x54d456['limit']=qs[_0xb93d('0x1c')](_0x122f08[_0xb93d('0x30')]['limit']);_0x54d456[_0xb93d('0x1a')]=qs[_0xb93d('0x1a')](_0x122f08['query'][_0xb93d('0x1a')]);}_0x54d456['order']=qs['sort'](_0x122f08[_0xb93d('0x30')][_0xb93d('0x37')]);_0x54d456[_0xb93d('0x38')]=qs[_0xb93d('0x2f')](_['pick'](_0x122f08[_0xb93d('0x30')],_0x5c5e41[_0xb93d('0x2f')]),_0x1cf260);if(_0x122f08[_0xb93d('0x30')][_0xb93d('0x39')]){_0x54d456[_0xb93d('0x38')]=_['merge'](_0x54d456[_0xb93d('0x38')],{'$or':_[_0xb93d('0x3a')](_0x54d456['attributes'],function(_0x13f4ff){var _0x4e2819={};_0x4e2819[_0x13f4ff]={'$like':'%'+_0x122f08[_0xb93d('0x30')]['filter']+'%'};return _0x4e2819;})});}_0x54d456=_[_0xb93d('0x3b')]({},_0x54d456,_0x122f08['options']);var _0x463771={'where':_0x54d456[_0xb93d('0x38')]};return db[_0xb93d('0x2c')]['count'](_0x463771)[_0xb93d('0x23')](function(_0x1d8c31){_0x4749b7[_0xb93d('0x1d')]=_0x1d8c31;if(_0x122f08['query'][_0xb93d('0x3c')]){_0x54d456[_0xb93d('0x3d')]=[{'all':!![]}];}return db[_0xb93d('0x2c')][_0xb93d('0x3e')](_0x54d456);})[_0xb93d('0x23')](function(_0x215da1){_0x4749b7[_0xb93d('0x3f')]=_0x215da1;return _0x4749b7;})[_0xb93d('0x23')](respondWithFilteredResult(_0x55a9e3,_0x54d456))[_0xb93d('0x40')](handleError(_0x55a9e3,null));})[_0xb93d('0x40')](handleError(_0x55a9e3,null));};exports['show']=function(_0xece3c2,_0x4e4bed){var _0xdc2adc={'raw':![],'where':{'id':_0xece3c2['params']['id']}},_0x199844={};_0x199844[_0xb93d('0x2d')]=_[_0xb93d('0x2e')](db[_0xb93d('0x2c')][_0xb93d('0x41')]);_0x199844[_0xb93d('0x30')]=_[_0xb93d('0x2e')](_0xece3c2[_0xb93d('0x30')]);_0x199844['filters']=_[_0xb93d('0x32')](_0x199844[_0xb93d('0x2d')],_0x199844[_0xb93d('0x30')]);_0xdc2adc[_0xb93d('0x31')]=_[_0xb93d('0x32')](_0x199844[_0xb93d('0x2d')],qs[_0xb93d('0x33')](_0xece3c2['query'][_0xb93d('0x33')]));_0xdc2adc['attributes']=_0xdc2adc[_0xb93d('0x31')][_0xb93d('0x34')]?_0xdc2adc['attributes']:_0x199844[_0xb93d('0x2d')];if(_0xece3c2[_0xb93d('0x30')][_0xb93d('0x3c')]){_0xdc2adc['include']=[{'all':!![]}];}_0xdc2adc=_[_0xb93d('0x3b')]({},_0xdc2adc,_0xece3c2['options']);return db[_0xb93d('0x2c')][_0xb93d('0x42')](_0xdc2adc)[_0xb93d('0x23')](handleEntityNotFound(_0x4e4bed,null))[_0xb93d('0x23')](respondWithResult(_0x4e4bed,null))['catch'](handleError(_0x4e4bed,null));};exports['create']=function(_0x12dc64,_0x50165a){return db[_0xb93d('0x2c')][_0xb93d('0x43')](_0x12dc64[_0xb93d('0x44')],{})[_0xb93d('0x23')](function(_0x5b2aa1){var _0x27ab0e=_0x12dc64['user'][_0xb93d('0x25')]({'plain':!![]});if(!_0x27ab0e)throw new Error(_0xb93d('0x45'));if(_0x27ab0e['role']==='user'){var _0x4ccccd=_0x5b2aa1['get']({'plain':!![]});var _0x308082=_0xb93d('0x26');return db[_0xb93d('0x46')][_0xb93d('0x42')]({'where':{'name':_0x308082,'userProfileId':_0x27ab0e[_0xb93d('0x47')]},'raw':!![]})[_0xb93d('0x23')](function(_0x5d9a4a){if(_0x5d9a4a&&_0x5d9a4a[_0xb93d('0x48')]===0x0){return db[_0xb93d('0x49')][_0xb93d('0x43')]({'name':_0x4ccccd[_0xb93d('0x2a')],'resourceId':_0x4ccccd['id'],'type':_0x5d9a4a[_0xb93d('0x2a')],'sectionId':_0x5d9a4a['id']},{})[_0xb93d('0x23')](function(){return _0x5b2aa1;});}else{return _0x5b2aa1;}})['catch'](function(_0x533736){logger[_0xb93d('0x28')](_0xb93d('0x4a'),_0x533736);throw _0x533736;});}return _0x5b2aa1;})[_0xb93d('0x23')](respondWithResult(_0x50165a,0xc9))[_0xb93d('0x40')](handleError(_0x50165a,null));};exports[_0xb93d('0x22')]=function(_0x4211c3,_0x1fbe94){if(_0x4211c3[_0xb93d('0x44')]['id']){delete _0x4211c3[_0xb93d('0x44')]['id'];}return db['CmCompany'][_0xb93d('0x42')]({'where':{'id':_0x4211c3[_0xb93d('0x4b')]['id']}})[_0xb93d('0x23')](handleEntityNotFound(_0x1fbe94,null))[_0xb93d('0x23')](saveUpdates(_0x4211c3['body'],null))[_0xb93d('0x23')](respondWithResult(_0x1fbe94,null))[_0xb93d('0x40')](handleError(_0x1fbe94,null));};exports[_0xb93d('0x24')]=function(_0x2f9852,_0x3bfbdf){return db[_0xb93d('0x2c')]['find']({'where':{'id':_0x2f9852[_0xb93d('0x4b')]['id']}})[_0xb93d('0x23')](handleEntityNotFound(_0x3bfbdf,null))[_0xb93d('0x23')](removeEntity(_0x3bfbdf,null))[_0xb93d('0x40')](handleError(_0x3bfbdf,null));};exports[_0xb93d('0x4c')]=function(_0x383cc2,_0xab1d5c){return db['CmCompany'][_0xb93d('0x4c')]()['then'](respondWithResult(_0xab1d5c,null))['catch'](handleError(_0xab1d5c,null));};exports[_0xb93d('0x4d')]=function(_0x12004e,_0x310b85,_0x14be66){return db['CmContact']['find']({'where':{'id':_0x12004e[_0xb93d('0x4b')]['id']}})[_0xb93d('0x23')](handleEntityNotFound(_0x310b85,null))[_0xb93d('0x23')](function(_0x2d4f9b){if(_0x2d4f9b){return _0x2d4f9b[_0xb93d('0x4d')](_0x12004e['body']['ids'],_[_0xb93d('0x4e')](_0x12004e[_0xb93d('0x44')],[_0xb93d('0x4f'),'id'])||{});}})[_0xb93d('0x23')](respondWithResult(_0x310b85,null))[_0xb93d('0x40')](handleError(_0x310b85,null));};exports['getContacts']=function(_0x4cdff0,_0x127eb7,_0x5cb8d3){var _0x3a3811={};var _0x55e408={};var _0x59812a;var _0x35c7cb;return db['CmCompany'][_0xb93d('0x50')]({'where':{'id':_0x4cdff0[_0xb93d('0x4b')]['id']}})[_0xb93d('0x23')](handleEntityNotFound(_0x127eb7,null))['then'](function(_0x60a0b5){if(_0x60a0b5){_0x59812a=_0x60a0b5;_0x55e408[_0xb93d('0x2d')]=_[_0xb93d('0x2e')](db[_0xb93d('0x51')][_0xb93d('0x41')]);_0x55e408[_0xb93d('0x30')]=_[_0xb93d('0x2e')](_0x4cdff0['query']);_0x55e408[_0xb93d('0x2f')]=_[_0xb93d('0x32')](_0x55e408[_0xb93d('0x2d')],_0x55e408[_0xb93d('0x30')]);_0x3a3811['attributes']=_[_0xb93d('0x32')](_0x55e408[_0xb93d('0x2d')],qs['fields'](_0x4cdff0[_0xb93d('0x30')][_0xb93d('0x33')]));_0x3a3811['attributes']=_0x3a3811['attributes'][_0xb93d('0x34')]?_0x3a3811['attributes']:_0x55e408[_0xb93d('0x2d')];_0x3a3811[_0xb93d('0x52')]=qs[_0xb93d('0x37')](_0x4cdff0[_0xb93d('0x30')][_0xb93d('0x37')]);_0x3a3811[_0xb93d('0x38')]=qs['filters'](_[_0xb93d('0x53')](_0x4cdff0[_0xb93d('0x30')],_0x55e408[_0xb93d('0x2f')]));if(_0x4cdff0[_0xb93d('0x30')][_0xb93d('0x39')]){_0x3a3811['where']=_[_0xb93d('0x3b')](_0x3a3811[_0xb93d('0x38')],{'$or':_[_0xb93d('0x3a')](_0x3a3811[_0xb93d('0x31')],function(_0x3377dd){var _0x32d2ae={};_0x32d2ae[_0x3377dd]={'$like':'%'+_0x4cdff0[_0xb93d('0x30')][_0xb93d('0x39')]+'%'};return _0x32d2ae;})});}_0x3a3811=_['merge']({},_0x3a3811,_0x4cdff0['options']);return _0x59812a[_0xb93d('0x54')](_0x3a3811);}})[_0xb93d('0x23')](function(_0x966659){if(_0x966659){_0x35c7cb=_0x966659[_0xb93d('0x34')];if(!_0x4cdff0[_0xb93d('0x30')][_0xb93d('0x35')](_0xb93d('0x36'))){_0x3a3811['limit']=qs[_0xb93d('0x1c')](_0x4cdff0[_0xb93d('0x30')][_0xb93d('0x1c')]);_0x3a3811[_0xb93d('0x1a')]=qs['offset'](_0x4cdff0[_0xb93d('0x30')]['offset']);}return _0x59812a[_0xb93d('0x54')](_0x3a3811);}})['then'](function(_0x287a6a){if(_0x287a6a){return _0x287a6a?{'count':_0x35c7cb,'rows':_0x287a6a}:null;}})[_0xb93d('0x23')](respondWithResult(_0x127eb7,null))[_0xb93d('0x40')](handleError(_0x127eb7,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 8a3b8e8..278cb99 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 _0x4e0f=['cm_companies','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany'];(function(_0x1e7c0e,_0x1c699d){var _0x111e34=function(_0x245e25){while(--_0x245e25){_0x1e7c0e['push'](_0x1e7c0e['shift']());}};_0x111e34(++_0x1c699d);}(_0x4e0f,0x189));var _0xf4e0=function(_0x571a17,_0x63fb3d){_0x571a17=_0x571a17-0x0;var _0x3ef337=_0x4e0f[_0x571a17];return _0x3ef337;};'use strict';var _=require(_0xf4e0('0x0'));var util=require('util');var logger=require(_0xf4e0('0x1'))(_0xf4e0('0x2'));var moment=require(_0xf4e0('0x3'));var BPromise=require(_0xf4e0('0x4'));var rp=require(_0xf4e0('0x5'));var fs=require('fs');var path=require(_0xf4e0('0x6'));var rimraf=require(_0xf4e0('0x7'));var config=require(_0xf4e0('0x8'));var attributes=require(_0xf4e0('0x9'));module[_0xf4e0('0xa')]=function(_0x51fe91,_0x1551e7){return _0x51fe91[_0xf4e0('0xb')](_0xf4e0('0xc'),attributes,{'tableName':_0xf4e0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0f97=['bluebird','request-promise','path','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash','util','api','moment'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x0f97,0x164));var _0x70f9=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x0f97[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x70f9('0x0'));var util=require(_0x70f9('0x1'));var logger=require('../../config/logger')(_0x70f9('0x2'));var moment=require(_0x70f9('0x3'));var BPromise=require(_0x70f9('0x4'));var rp=require(_0x70f9('0x5'));var fs=require('fs');var path=require(_0x70f9('0x6'));var rimraf=require('rimraf');var config=require(_0x70f9('0x7'));var attributes=require(_0x70f9('0x8'));module['exports']=function(_0x3c98d1,_0x144366){return _0x3c98d1[_0x70f9('0x9')](_0x70f9('0xa'),attributes,{'tableName':_0x70f9('0xb'),'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 4d405f0..bd24b73 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 _0xe7b1=['code','CmCompany,\x20%s,\x20%s','message','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x641afe,_0x22d726){var _0x2dfe9a=function(_0x33a370){while(--_0x33a370){_0x641afe['push'](_0x641afe['shift']());}};_0x2dfe9a(++_0x22d726);}(_0xe7b1,0x1e7));var _0x1e7b=function(_0x4e472d,_0x596a83){_0x4e472d=_0x4e472d-0x0;var _0x2fe1b7=_0xe7b1[_0x4e472d];return _0x2fe1b7;};'use strict';var _=require(_0x1e7b('0x0'));var util=require(_0x1e7b('0x1'));var moment=require('moment');var BPromise=require(_0x1e7b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1e7b('0x3'));var db=require(_0x1e7b('0x4'))['db'];var utils=require(_0x1e7b('0x5'));var logger=require(_0x1e7b('0x6'))(_0x1e7b('0x7'));var config=require(_0x1e7b('0x8'));var jayson=require(_0x1e7b('0x9'));var client=jayson[_0x1e7b('0xa')][_0x1e7b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x333a68,_0x2bf9cc,_0x3a4a3b){return new BPromise(function(_0x40e910,_0x972fa3){return client['request'](_0x333a68,_0x3a4a3b)[_0x1e7b('0xc')](function(_0x12601b){logger[_0x1e7b('0xd')]('CmCompany,\x20%s,\x20%s',_0x2bf9cc,_0x1e7b('0xe'));logger[_0x1e7b('0xf')](_0x1e7b('0x10'),_0x2bf9cc,_0x1e7b('0xe'),JSON[_0x1e7b('0x11')](_0x12601b));if(_0x12601b[_0x1e7b('0x12')]){if(_0x12601b[_0x1e7b('0x12')][_0x1e7b('0x13')]===0x1f4){logger[_0x1e7b('0x12')](_0x1e7b('0x14'),_0x2bf9cc,_0x12601b['error'][_0x1e7b('0x15')]);return _0x972fa3(_0x12601b[_0x1e7b('0x12')][_0x1e7b('0x15')]);}logger[_0x1e7b('0x12')](_0x1e7b('0x14'),_0x2bf9cc,_0x12601b[_0x1e7b('0x12')][_0x1e7b('0x15')]);return _0x40e910(_0x12601b[_0x1e7b('0x12')]['message']);}else{logger[_0x1e7b('0xd')]('CmCompany,\x20%s,\x20%s',_0x2bf9cc,_0x1e7b('0xe'));_0x40e910(_0x12601b['result'][_0x1e7b('0x15')]);}})[_0x1e7b('0x16')](function(_0x33011a){logger[_0x1e7b('0x12')](_0x1e7b('0x14'),_0x2bf9cc,_0x33011a);_0x972fa3(_0x33011a);});});}
\ No newline at end of file
+var _0xa3a5=['error','code','CmCompany,\x20%s,\x20%s','message','result','catch','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x11309c,_0xe18a74){var _0x3fea9c=function(_0xeb11c3){while(--_0xeb11c3){_0x11309c['push'](_0x11309c['shift']());}};_0x3fea9c(++_0xe18a74);}(_0xa3a5,0x126));var _0x5a3a=function(_0x53dcbd,_0x1250b4){_0x53dcbd=_0x53dcbd-0x0;var _0x484902=_0xa3a5[_0x53dcbd];return _0x484902;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5a3a('0x0'));var fs=require('fs');var Redis=require(_0x5a3a('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x5a3a('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0x5a3a('0x3'));var jayson=require(_0x5a3a('0x4'));var client=jayson[_0x5a3a('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f1117,_0x7804ba,_0x38122e){return new BPromise(function(_0x59dd9a,_0xbe2975){return client['request'](_0x1f1117,_0x38122e)[_0x5a3a('0x6')](function(_0x4673a5){logger[_0x5a3a('0x7')]('CmCompany,\x20%s,\x20%s',_0x7804ba,_0x5a3a('0x8'));logger[_0x5a3a('0x9')](_0x5a3a('0xa'),_0x7804ba,'request\x20sent',JSON[_0x5a3a('0xb')](_0x4673a5));if(_0x4673a5[_0x5a3a('0xc')]){if(_0x4673a5[_0x5a3a('0xc')][_0x5a3a('0xd')]===0x1f4){logger[_0x5a3a('0xc')](_0x5a3a('0xe'),_0x7804ba,_0x4673a5[_0x5a3a('0xc')][_0x5a3a('0xf')]);return _0xbe2975(_0x4673a5[_0x5a3a('0xc')]['message']);}logger['error'](_0x5a3a('0xe'),_0x7804ba,_0x4673a5[_0x5a3a('0xc')][_0x5a3a('0xf')]);return _0x59dd9a(_0x4673a5[_0x5a3a('0xc')][_0x5a3a('0xf')]);}else{logger[_0x5a3a('0x7')](_0x5a3a('0xe'),_0x7804ba,'request\x20sent');_0x59dd9a(_0x4673a5[_0x5a3a('0x10')][_0x5a3a('0xf')]);}})[_0x5a3a('0x11')](function(_0xd56772){logger[_0x5a3a('0xc')](_0x5a3a('0xe'),_0x7804ba,_0xd56772);_0xbe2975(_0xd56772);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 37ea1fd..4bf9f8f 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 _0x4941=['addContacts','put','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','describe','/:id','/:id/contacts','create'];(function(_0x3a8782,_0x4f5e38){var _0x127835=function(_0x4e7b40){while(--_0x4e7b40){_0x3a8782['push'](_0x3a8782['shift']());}};_0x127835(++_0x4f5e38);}(_0x4941,0x1c5));var _0x1494=function(_0x264545,_0x214037){_0x264545=_0x264545-0x0;var _0x114d10=_0x4941[_0x264545];return _0x114d10;};'use strict';var multer=require(_0x1494('0x0'));var util=require('util');var path=require(_0x1494('0x1'));var timeout=require(_0x1494('0x2'));var express=require('express');var router=express[_0x1494('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1494('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1494('0x5'));var controller=require('./cmCompany.controller');router[_0x1494('0x6')]('/',auth[_0x1494('0x7')](),controller['index']);router[_0x1494('0x6')]('/describe',auth[_0x1494('0x7')](),controller[_0x1494('0x8')]);router[_0x1494('0x6')](_0x1494('0x9'),auth[_0x1494('0x7')](),controller['show']);router[_0x1494('0x6')](_0x1494('0xa'),auth[_0x1494('0x7')](),controller['getContacts']);router['post']('/',auth[_0x1494('0x7')](),controller[_0x1494('0xb')]);router['post'](_0x1494('0xa'),auth['isAuthenticated'](),controller[_0x1494('0xc')]);router[_0x1494('0xd')](_0x1494('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x1494('0x9'),auth[_0x1494('0x7')](),controller['destroy']);module[_0x1494('0xe')]=router;
\ No newline at end of file
+var _0x93c2=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','describe','/:id','show','/:id/contacts','post','create','put','update','delete','destroy'];(function(_0x259556,_0x488aca){var _0x5009de=function(_0x280287){while(--_0x280287){_0x259556['push'](_0x259556['shift']());}};_0x5009de(++_0x488aca);}(_0x93c2,0x15a));var _0x293c=function(_0x1ba2b7,_0x10a4d3){_0x1ba2b7=_0x1ba2b7-0x0;var _0x13d403=_0x93c2[_0x1ba2b7];return _0x13d403;};'use strict';var multer=require('multer');var util=require(_0x293c('0x0'));var path=require(_0x293c('0x1'));var timeout=require(_0x293c('0x2'));var express=require(_0x293c('0x3'));var router=express[_0x293c('0x4')]();var fs_extra=require(_0x293c('0x5'));var auth=require(_0x293c('0x6'));var interaction=require(_0x293c('0x7'));var config=require(_0x293c('0x8'));var controller=require(_0x293c('0x9'));router[_0x293c('0xa')]('/',auth[_0x293c('0xb')](),controller['index']);router[_0x293c('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x293c('0xc')]);router[_0x293c('0xa')](_0x293c('0xd'),auth[_0x293c('0xb')](),controller[_0x293c('0xe')]);router['get'](_0x293c('0xf'),auth[_0x293c('0xb')](),controller['getContacts']);router[_0x293c('0x10')]('/',auth['isAuthenticated'](),controller[_0x293c('0x11')]);router[_0x293c('0x10')](_0x293c('0xf'),auth[_0x293c('0xb')](),controller['addContacts']);router[_0x293c('0x12')](_0x293c('0xd'),auth[_0x293c('0xb')](),controller[_0x293c('0x13')]);router[_0x293c('0x14')]('/:id',auth[_0x293c('0xb')](),controller[_0x293c('0x15')]);module[_0x293c('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 96c80dd..276f695 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 _0x5f2f=['INTEGER','DATE','NOW','lodash','sequelize','exports','STRING','TEXT'];(function(_0x320a79,_0x25f987){var _0x31aae3=function(_0x43fe32){while(--_0x43fe32){_0x320a79['push'](_0x320a79['shift']());}};_0x31aae3(++_0x25f987);}(_0x5f2f,0x73));var _0xf5f2=function(_0xfb31f4,_0x2856a0){_0xfb31f4=_0xfb31f4-0x0;var _0x192663=_0x5f2f[_0xfb31f4];return _0x192663;};'use strict';var _=require(_0xf5f2('0x0'));var Sequelize=require(_0xf5f2('0x1'));module[_0xf5f2('0x2')]={'firstName':{'type':Sequelize[_0xf5f2('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xf5f2('0x3')]},'street':{'type':Sequelize[_0xf5f2('0x3')]},'postalCode':{'type':Sequelize[_0xf5f2('0x3')]},'city':{'type':Sequelize[_0xf5f2('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf5f2('0x4')]},'phone':{'type':Sequelize[_0xf5f2('0x3')]},'mobile':{'type':Sequelize[_0xf5f2('0x3')]},'fax':{'type':Sequelize[_0xf5f2('0x3')]},'email':{'type':Sequelize[_0xf5f2('0x3')]},'url':{'type':Sequelize[_0xf5f2('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xf5f2('0x3')]},'twitter':{'type':Sequelize[_0xf5f2('0x3')]},'skype':{'type':Sequelize[_0xf5f2('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0xf5f2('0x3')]},'line':{'type':Sequelize[_0xf5f2('0x3')]},'wechat':{'type':Sequelize[_0xf5f2('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xf5f2('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':Sequelize[_0xf5f2('0x7')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0xf5f2('0x5')]}};
\ No newline at end of file
+var _0x2032=['sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','NOW'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x2032,0xd9));var _0x2203=function(_0x4e3c92,_0x353fa4){_0x4e3c92=_0x4e3c92-0x0;var _0x455d28=_0x2032[_0x4e3c92];return _0x455d28;};'use strict';var _=require('lodash');var Sequelize=require(_0x2203('0x0'));module[_0x2203('0x1')]={'firstName':{'type':Sequelize[_0x2203('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x2203('0x2')]},'postalCode':{'type':Sequelize[_0x2203('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x2203('0x2')]},'dateOfBirth':{'type':Sequelize[_0x2203('0x2')]},'description':{'type':Sequelize[_0x2203('0x3')]},'phone':{'type':Sequelize[_0x2203('0x2')]},'mobile':{'type':Sequelize[_0x2203('0x2')]},'fax':{'type':Sequelize[_0x2203('0x2')]},'email':{'type':Sequelize[_0x2203('0x2')]},'url':{'type':Sequelize[_0x2203('0x2')]},'facebook':{'type':Sequelize[_0x2203('0x2')]},'fb_data':{'type':Sequelize[_0x2203('0x2')]},'twitter':{'type':Sequelize[_0x2203('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x2203('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x2203('0x2')]},'telegram':{'type':Sequelize[_0x2203('0x2')]},'UserId':{'type':Sequelize[_0x2203('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x2203('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x2203('0x6')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x2203('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 47449b0..6de0674 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 _0xcb30=['duplicates','$or','findOrCreate','spread','show','$and','omit','format','cf_%d','pickBy','table','id\x20=\x20?','toParam','CmHopper','phone','rawAttributes','options','nolimit','getTags','setTags','ids','getHoppers','ContactId','getHopperHistories','includeAll','include','CmHopperFinal','getJscriptySessions','uploadCsv','binding_keys','No\x20association\x20values\x20specified!','socket_timestamp','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','root','file','filename','chmodSync','child_process','fork','../../components/import/cm/csv','binding_values','CompanyId','File\x20uploaded\x20correctly!','pid','send','upload','createReadStream','parse','import','No\x20ListId\x20specified','binding','No\x20firstName\x20column\x20specified','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','message','start\x20child\x20process\x20correctly!','getJourney','mail','chat','sms','openchannel','fax','channel','Invalid\x20channel','toLowerCase','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','destination','callerid','endtime','duration','note','createdAt','userThirdDisposition','UserId','fullname','findAndCountAll','startCase','Website','Account','disposition','thirdDisposition','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','subject','substatus','externalUrl','threadId','Interaction','Owner','flatten','reverse','moment','bluebird','path','squel','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','json','undefined','limit','count','offset','set','then','destroy','sendStatus','error','stack','name','CmContact','describe','keys','length','startsWith','cf_','CmCustomField','findOne','fieldType','model','query','filters','intersection','attributes','fields','order','sort','where','pick','field','color','from','tools_tags','select','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','Tag','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','value','dateOfBirth','datetime','castTo','buildExpression','type','text','start','end','hasOwnProperty','filter','isNil','Contact','push','isEmpty','ListId','c.ListId\x20IN\x20?','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','isArray','tag','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','Sequelize','SELECT','clone','DESC','t.id\x20IN\x20?','resolve','user','agent','some','getLists','c.ListId\x20IS\x20NULL','role','sequelize','toString','keyBy','merge','c.id','c.lastName','c.phone','c.fax','c.email','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','tags','columnName','displayName','analytics','findAll','alias','custom','values','body','get','mergeWith','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','info','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','MailInteraction','MailMessage','SmsInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperHistory','ReportAgentPreview','VoiceCallReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','timezones','utcOffset','bulkCreate','each'];(function(_0x1f2136,_0x4e4560){var _0x6c81a6=function(_0x4ff6f3){while(--_0x4ff6f3){_0x1f2136['push'](_0x1f2136['shift']());}};_0x6c81a6(++_0x4e4560);}(_0xcb30,0x17f));var _0x0cb3=function(_0x160aff,_0x301f60){_0x160aff=_0x160aff-0x0;var _0x324312=_0xcb30[_0x160aff];return _0x324312;};'use strict';var moment=require(_0x0cb3('0x0'));var BPromise=require(_0x0cb3('0x1'));var util=require('util');var path=require(_0x0cb3('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0cb3('0x3'));var Papa=require('papaparse');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var as=require(_0x0cb3('0x4'));var logger=require(_0x0cb3('0x5'))(_0x0cb3('0x6'));var config=require('../../config/environment');var shared=require(_0x0cb3('0x7'));var db=require(_0x0cb3('0x8'))['db'];config[_0x0cb3('0x9')]=_[_0x0cb3('0xa')](config['redis'],{'host':_0x0cb3('0xb'),'port':0x18eb});var socket=require(_0x0cb3('0xc'))(new Redis(config[_0x0cb3('0x9')]));require('./cmContact.socket')[_0x0cb3('0xd')](socket);function respondWithResult(_0x195797,_0x95069c){_0x95069c=_0x95069c||0xc8;return function(_0x1db7fa){if(_0x1db7fa){return _0x195797[_0x0cb3('0xe')](_0x95069c)[_0x0cb3('0xf')](_0x1db7fa);}};}function respondWithFilteredResult(_0x4274df,_0x5e3f74){return function(_0x2c4c4b){if(_0x2c4c4b){var _0x1860b1=typeof _0x5e3f74['offset']===_0x0cb3('0x10')&&typeof _0x5e3f74[_0x0cb3('0x11')]===_0x0cb3('0x10');var _0x3a9484=_0x2c4c4b[_0x0cb3('0x12')];var _0x4e58b6=_0x1860b1?0x0:_0x5e3f74[_0x0cb3('0x13')];var _0x5f1450=_0x1860b1?_0x2c4c4b[_0x0cb3('0x12')]:_0x5e3f74[_0x0cb3('0x13')]+_0x5e3f74[_0x0cb3('0x11')];var _0x14c459;if(_0x5f1450>=_0x3a9484){_0x5f1450=_0x3a9484;_0x14c459=0xc8;}else{_0x14c459=0xce;}_0x4274df[_0x0cb3('0xe')](_0x14c459);return _0x4274df[_0x0cb3('0x14')]('Content-Range',_0x4e58b6+'-'+_0x5f1450+'/'+_0x3a9484)[_0x0cb3('0xf')](_0x2c4c4b);}return null;};}function saveUpdates(_0x4bd40f){return function(_0x53e105){if(_0x53e105){return _0x53e105['update'](_0x4bd40f)[_0x0cb3('0x15')](function(_0x4a1f13){return _0x4a1f13;});}return null;};}function removeEntity(_0x47b1ec){return function(_0x19efa5){if(_0x19efa5){return _0x19efa5[_0x0cb3('0x16')]()[_0x0cb3('0x15')](function(){_0x47b1ec['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x36b093){return function(_0x527d0b){if(!_0x527d0b){_0x36b093[_0x0cb3('0x17')](0x194);}return _0x527d0b;};}function handleError(_0x453074,_0x1995b8){_0x1995b8=_0x1995b8||0x1f4;return function(_0x56a263){logger[_0x0cb3('0x18')](_0x56a263[_0x0cb3('0x19')]);if(_0x56a263[_0x0cb3('0x1a')]){delete _0x56a263[_0x0cb3('0x1a')];}_0x453074[_0x0cb3('0xe')](_0x1995b8)['send'](_0x56a263);};}exports['index']=function(_0x3f05a9,_0x4349f8){var _0x6b0a3e={},_0x4500f1={},_0xa3c190={'count':0x0,'rows':[]};return db[_0x0cb3('0x1b')][_0x0cb3('0x1c')]()[_0x0cb3('0x15')](function(_0x4b306d){var _0x3918fb=[];for(var _0x2a92d6=0x0;_0x2a92d6
','Attachments','Data'];(function(_0x23fae9,_0xd56b66){var _0x1f8825=function(_0x4514fd){while(--_0x4514fd){_0x23fae9['push'](_0x23fae9['shift']());}};_0x1f8825(++_0xd56b66);}(_0xda2f,0x1c1));var _0xfda2=function(_0x4d1d36,_0x11a8a9){_0x4d1d36=_0x4d1d36-0x0;var _0x53bfc8=_0xda2f[_0x4d1d36];return _0x53bfc8;};'use strict';var _=require(_0xfda2('0x0'));var moment=require(_0xfda2('0x1'));var random=require(_0xfda2('0x2'));var fs=require('fs');var path=require(_0xfda2('0x3'));var util=require(_0xfda2('0x4'));var tnef=require(_0xfda2('0x5'));var logger=require(_0xfda2('0x6'))(_0xfda2('0x7'));var config=require('../../../config/environment');function getAddress(_0x3ddda1){var _0xc65cf8=_[_0xfda2('0x8')](_0x3ddda1['value']);return _0xc65cf8&&_0xc65cf8[_0xfda2('0x9')]?_0xc65cf8[_0xfda2('0x9')]:'anonymous'+random[_0xfda2('0xa')](0x6)+'@xcally.com';}function getFirstName(_0x1e9cd9){var _0x4db9be=_['head'](_0x1e9cd9[_0xfda2('0xb')]);if(_0x4db9be&&_0x4db9be[_0xfda2('0xc')]){if(_0x4db9be[_0xfda2('0xc')]==_0x4db9be[_0xfda2('0x9')]){return _0x4db9be[_0xfda2('0xc')][_0xfda2('0xd')](0x0,_0x4db9be[_0xfda2('0xc')][_0xfda2('0xe')]('@'));}var _0x3b2363=_0x4db9be['name'][_0xfda2('0xf')](/\s+/);return _0x3b2363[_0xfda2('0x10')]>0x1?_0x3b2363[_0xfda2('0x11')](0x0,-0x1)['join']('\x20'):_0x4db9be[_0xfda2('0xc')];}return _0xfda2('0x12');}function getLastName(_0x1766de){var _0x5ff4a2=_['head'](_0x1766de[_0xfda2('0xb')]);if(_0x5ff4a2&&_0x5ff4a2['name']){var _0x2c5a50=_0x5ff4a2[_0xfda2('0xc')][_0xfda2('0xf')](/\s+/);return _0x2c5a50[_0xfda2('0x10')]>0x1?_0x2c5a50[_0xfda2('0x13')]():'';}return'';}function getMails(_0x28b6ca,_0x16ca2a){var _0x2718b2='';for(var _0x53195d=0x0;_0x53195d<_0x16ca2a[_0xfda2('0xb')][_0xfda2('0x10')];_0x53195d+=0x1){if(_0x16ca2a[_0xfda2('0xb')][_0x53195d][_0xfda2('0x9')]!==_0x28b6ca){if(!_[_0xfda2('0x14')](_0x2718b2)){_0x2718b2+=',';}_0x2718b2+=_0x16ca2a[_0xfda2('0xb')][_0x53195d][_0xfda2('0xc')]||_0x16ca2a[_0xfda2('0xb')][_0x53195d][_0xfda2('0x9')]||'';_0x2718b2+='\x20<';_0x2718b2+=_0x16ca2a[_0xfda2('0xb')][_0x53195d][_0xfda2('0x9')]?_0x16ca2a[_0xfda2('0xb')][_0x53195d][_0xfda2('0x9')]:_0xfda2('0x15')+random['generate'](0x6)+_0xfda2('0x16');_0x2718b2+='>';}}return _0x2718b2;}function parseEmail(_0x367c13,_0x1dfca1,_0x417610){if(_0x1dfca1['html']){var _0x5c85d6=/