From 00d9961c0cb76c0055e7a5d0864dabaa46cdafeb Mon Sep 17 00:00:00 2001
From: Andrea Amorese
Date: Fri, 10 Sep 2021 10:36:33 +0200
Subject: [PATCH] Built motion from commit e513bdb2.|2.5.345
---
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 +-
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/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 +-
.../api/cloudProvider/cloudProvider.attributes.js | 2 +-
.../api/cloudProvider/cloudProvider.controller.js | 2 +-
server/api/cloudProvider/cloudProvider.model.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.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 +-
server/api/teamVoicePrefix/index.js | 2 +-
.../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +-
.../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +-
server/api/teamVoicePrefix/teamVoicePrefix.rpc.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/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 +-
server/api/userVoicePrefix/index.js | 2 +-
.../userVoicePrefix/userVoicePrefix.attributes.js | 2 +-
.../api/userVoicePrefix/userVoicePrefix.model.js | 2 +-
server/api/userVoicePrefix/userVoicePrefix.rpc.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/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/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 +-
1155 files changed, 1155 insertions(+), 1155 deletions(-)
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 1d991f1..0c9382f 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-09-10T08:04:40.836Z",
+ "time": "2021-09-10T08:21:38.468Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 1f5a7f6..966c017 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-09-10T08:04:40.836Z",
+ "time": "2021-09-10T08:21:38.468Z",
"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 961b474..9e170bc 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 _0x7c09=['contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','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)]'];(function(_0x2a8ead,_0x595e7d){var _0x14ea81=function(_0x41c3ba){while(--_0x41c3ba){_0x2a8ead['push'](_0x2a8ead['shift']());}};_0x14ea81(++_0x595e7d);}(_0x7c09,0x102));var _0x97c0=function(_0x31ab85,_0x1a8001){_0x31ab85=_0x31ab85-0x0;var _0x5e7f39=_0x7c09[_0x31ab85];return _0x5e7f39;};'use strict';var Sequelize=require('sequelize');module[_0x97c0('0x0')]={'name':{'type':Sequelize[_0x97c0('0x1')],'get':function(_0x53ad71){return this[_0x97c0('0x2')](_0x97c0('0x3'));}},'action':{'type':Sequelize[_0x97c0('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x97c0('0x5'),_0x97c0('0x6'),_0x97c0('0x7'),_0x97c0('0x8'),'urlForward','browser','bot',_0x97c0('0x9')]],'msg':_0x97c0('0xa')}},'comment':_0x97c0('0xa')},'data1':{'type':Sequelize[_0x97c0('0x4')](0x1000),'comment':_0x97c0('0xb')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x97c0('0xc')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x97c0('0xd')},'data4':{'type':Sequelize[_0x97c0('0x4')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x97c0('0xe')},'data6':{'type':Sequelize[_0x97c0('0x4')],'comments':_0x97c0('0xf')},'data7':{'type':Sequelize[_0x97c0('0x10')],'comments':_0x97c0('0x11')}};
\ No newline at end of file
+var _0xa6b0=['integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','getDataValue','action','STRING'];(function(_0x4706a6,_0x5a1c63){var _0x1bb705=function(_0x484ebb){while(--_0x484ebb){_0x4706a6['push'](_0x4706a6['shift']());}};_0x1bb705(++_0x5a1c63);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x5a77f6,_0x177a7c){_0x5a77f6=_0x5a77f6-0x0;var _0x35ed9e=_0xa6b0[_0x5a77f6];return _0x35ed9e;};'use strict';var Sequelize=require(_0x0a6b('0x0'));module[_0x0a6b('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4e988a){return this[_0x0a6b('0x2')](_0x0a6b('0x3'));}},'action':{'type':Sequelize[_0x0a6b('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x0a6b('0x5'),_0x0a6b('0x6'),_0x0a6b('0x7'),_0x0a6b('0x8'),_0x0a6b('0x9'),_0x0a6b('0xa'),_0x0a6b('0xb')]],'msg':_0x0a6b('0xc')}},'comment':_0x0a6b('0xc')},'data1':{'type':Sequelize[_0x0a6b('0x4')](0x1000),'comment':_0x0a6b('0xd')},'data2':{'type':Sequelize[_0x0a6b('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['STRING'](0x1000),'comment':_0x0a6b('0xe')},'data4':{'type':Sequelize[_0x0a6b('0x4')](0x1000),'comments':_0x0a6b('0xf')},'data5':{'type':Sequelize[_0x0a6b('0x4')](0x1000),'comments':_0x0a6b('0x10')},'data6':{'type':Sequelize[_0x0a6b('0x4')],'comments':_0x0a6b('0x11')},'data7':{'type':Sequelize[_0x0a6b('0x12')],'comments':_0x0a6b('0x13')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index b8b21ac..dbee071 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 _0xaf5e=['rimraf','request-promise','moment','bluebird','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','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','offset','limit','undefined','count','Content-Range','apply','reject','update','then','destroy','end','stack','name','send','body','Action','find','params','catch'];(function(_0x1f339f,_0x33c107){var _0x278e86=function(_0x3f8f16){while(--_0x3f8f16){_0x1f339f['push'](_0x1f339f['shift']());}};_0x278e86(++_0x33c107);}(_0xaf5e,0x142));var _0xeaf5=function(_0x3b8a62,_0x19c90c){_0x3b8a62=_0x3b8a62-0x0;var _0x22dce3=_0xaf5e[_0x3b8a62];return _0x22dce3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeaf5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xeaf5('0x1'));var moment=require(_0xeaf5('0x2'));var BPromise=require(_0xeaf5('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xeaf5('0x4'));var sox=require(_0xeaf5('0x5'));var csv=require('to-csv');var ejs=require(_0xeaf5('0x6'));var fs=require('fs');var fs_extra=require(_0xeaf5('0x7'));var _=require('lodash');var squel=require(_0xeaf5('0x8'));var crypto=require(_0xeaf5('0x9'));var jsforce=require(_0xeaf5('0xa'));var deskjs=require(_0xeaf5('0xb'));var toCsv=require(_0xeaf5('0xc'));var querystring=require(_0xeaf5('0xd'));var Papa=require(_0xeaf5('0xe'));var Redis=require(_0xeaf5('0xf'));var authService=require(_0xeaf5('0x10'));var qs=require(_0xeaf5('0x11'));var as=require(_0xeaf5('0x12'));var hardwareService=require(_0xeaf5('0x13'));var logger=require(_0xeaf5('0x14'))('api');var utils=require(_0xeaf5('0x15'));var config=require(_0xeaf5('0x16'));var licenseUtil=require(_0xeaf5('0x17'));var db=require(_0xeaf5('0x18'))['db'];function respondWithStatusCode(_0x1d6bb5,_0x2f78fe){_0x2f78fe=_0x2f78fe||0xcc;return function(_0x4f802f){if(_0x4f802f){return _0x1d6bb5[_0xeaf5('0x19')](_0x2f78fe);}return _0x1d6bb5['status'](_0x2f78fe)['end']();};}function respondWithResult(_0x353e7a,_0x213b09){_0x213b09=_0x213b09||0xc8;return function(_0x430901){if(_0x430901){return _0x353e7a[_0xeaf5('0x1a')](_0x213b09)['json'](_0x430901);}};}function respondWithFilteredResult(_0x5354d2,_0x5d2ea9){return function(_0x472238){if(_0x472238){var _0xe4e4c7=typeof _0x5d2ea9[_0xeaf5('0x1b')]==='undefined'&&typeof _0x5d2ea9[_0xeaf5('0x1c')]===_0xeaf5('0x1d');var _0x4c985a=_0x472238[_0xeaf5('0x1e')];var _0xb7419b=_0xe4e4c7?0x0:_0x5d2ea9[_0xeaf5('0x1b')];var _0x3ae9b0=_0xe4e4c7?_0x472238[_0xeaf5('0x1e')]:_0x5d2ea9['offset']+_0x5d2ea9[_0xeaf5('0x1c')];var _0x4a8bf0;if(_0x3ae9b0>=_0x4c985a){_0x3ae9b0=_0x4c985a;_0x4a8bf0=0xc8;}else{_0x4a8bf0=0xce;}_0x5354d2['status'](_0x4a8bf0);return _0x5354d2['set'](_0xeaf5('0x1f'),_0xb7419b+'-'+_0x3ae9b0+'/'+_0x4c985a)['json'](_0x472238);}return null;};}function patchUpdates(_0x587131){return function(_0x17a4cc){try{jsonpatch[_0xeaf5('0x20')](_0x17a4cc,_0x587131,!![]);}catch(_0x2f09e0){return BPromise[_0xeaf5('0x21')](_0x2f09e0);}return _0x17a4cc['save']();};}function saveUpdates(_0x5d700f,_0x2ae0fc){return function(_0x5dcba4){if(_0x5dcba4){return _0x5dcba4[_0xeaf5('0x22')](_0x5d700f)[_0xeaf5('0x23')](function(_0x3d0afa){return _0x3d0afa;});}return null;};}function removeEntity(_0x25940a,_0x416b90){return function(_0x36155a){if(_0x36155a){return _0x36155a[_0xeaf5('0x24')]()[_0xeaf5('0x23')](function(){_0x25940a[_0xeaf5('0x1a')](0xcc)[_0xeaf5('0x25')]();});}};}function handleEntityNotFound(_0x1d8162,_0x3f594e){return function(_0x280b3a){if(!_0x280b3a){_0x1d8162[_0xeaf5('0x19')](0x194);}return _0x280b3a;};}function handleError(_0x749abd,_0x53facc){_0x53facc=_0x53facc||0x1f4;return function(_0xa57ad7){logger['error'](_0xa57ad7[_0xeaf5('0x26')]);if(_0xa57ad7[_0xeaf5('0x27')]){delete _0xa57ad7['name'];}_0x749abd['status'](_0x53facc)[_0xeaf5('0x28')](_0xa57ad7);};}exports[_0xeaf5('0x22')]=function(_0x5159be,_0x366ed1){if(_0x5159be[_0xeaf5('0x29')]['id']){delete _0x5159be[_0xeaf5('0x29')]['id'];}return db[_0xeaf5('0x2a')][_0xeaf5('0x2b')]({'where':{'id':_0x5159be['params']['id']}})['then'](handleEntityNotFound(_0x366ed1,null))[_0xeaf5('0x23')](saveUpdates(_0x5159be['body'],null))['then'](respondWithResult(_0x366ed1,null))['catch'](handleError(_0x366ed1,null));};exports[_0xeaf5('0x24')]=function(_0x46819b,_0x14a9a2){return db[_0xeaf5('0x2a')][_0xeaf5('0x2b')]({'where':{'id':_0x46819b[_0xeaf5('0x2c')]['id']}})[_0xeaf5('0x23')](handleEntityNotFound(_0x14a9a2,null))['then'](removeEntity(_0x14a9a2,null))[_0xeaf5('0x2d')](handleError(_0x14a9a2,null));};
\ No newline at end of file
+var _0x0c61=['Content-Range','save','update','then','sendStatus','error','name','send','body','Action','params','catch','destroy','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set'];(function(_0x162a5c,_0xd1056a){var _0x319be9=function(_0x537130){while(--_0x537130){_0x162a5c['push'](_0x162a5c['shift']());}};_0x319be9(++_0xd1056a);}(_0x0c61,0x16e));var _0x10c6=function(_0x295a3d,_0x56d487){_0x295a3d=_0x295a3d-0x0;var _0x23a732=_0x0c61[_0x295a3d];return _0x23a732;};'use strict';var emlformat=require(_0x10c6('0x0'));var rimraf=require(_0x10c6('0x1'));var zipdir=require(_0x10c6('0x2'));var jsonpatch=require(_0x10c6('0x3'));var rp=require('request-promise');var moment=require(_0x10c6('0x4'));var BPromise=require(_0x10c6('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x10c6('0x6'));var sox=require(_0x10c6('0x7'));var csv=require(_0x10c6('0x8'));var ejs=require(_0x10c6('0x9'));var fs=require('fs');var fs_extra=require(_0x10c6('0xa'));var _=require('lodash');var squel=require(_0x10c6('0xb'));var crypto=require(_0x10c6('0xc'));var jsforce=require(_0x10c6('0xd'));var deskjs=require(_0x10c6('0xe'));var toCsv=require(_0x10c6('0x8'));var querystring=require(_0x10c6('0xf'));var Papa=require(_0x10c6('0x10'));var Redis=require('ioredis');var authService=require(_0x10c6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x10c6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x10c6('0x13'))(_0x10c6('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x10c6('0x15'));var db=require(_0x10c6('0x16'))['db'];function respondWithStatusCode(_0x4719bb,_0x54ca05){_0x54ca05=_0x54ca05||0xcc;return function(_0x1a3522){if(_0x1a3522){return _0x4719bb['sendStatus'](_0x54ca05);}return _0x4719bb[_0x10c6('0x17')](_0x54ca05)[_0x10c6('0x18')]();};}function respondWithResult(_0x164c94,_0x529279){_0x529279=_0x529279||0xc8;return function(_0x195f63){if(_0x195f63){return _0x164c94[_0x10c6('0x17')](_0x529279)['json'](_0x195f63);}};}function respondWithFilteredResult(_0x38b979,_0x42ddd7){return function(_0x30ebee){if(_0x30ebee){var _0x295eb8=typeof _0x42ddd7[_0x10c6('0x19')]===_0x10c6('0x1a')&&typeof _0x42ddd7[_0x10c6('0x1b')]===_0x10c6('0x1a');var _0x1d0860=_0x30ebee[_0x10c6('0x1c')];var _0x1e6336=_0x295eb8?0x0:_0x42ddd7['offset'];var _0xb2020d=_0x295eb8?_0x30ebee['count']:_0x42ddd7[_0x10c6('0x19')]+_0x42ddd7[_0x10c6('0x1b')];var _0x3263c7;if(_0xb2020d>=_0x1d0860){_0xb2020d=_0x1d0860;_0x3263c7=0xc8;}else{_0x3263c7=0xce;}_0x38b979[_0x10c6('0x17')](_0x3263c7);return _0x38b979[_0x10c6('0x1d')](_0x10c6('0x1e'),_0x1e6336+'-'+_0xb2020d+'/'+_0x1d0860)['json'](_0x30ebee);}return null;};}function patchUpdates(_0x3406a6){return function(_0x34c237){try{jsonpatch['apply'](_0x34c237,_0x3406a6,!![]);}catch(_0x43fa5e){return BPromise['reject'](_0x43fa5e);}return _0x34c237[_0x10c6('0x1f')]();};}function saveUpdates(_0x8a98fb,_0x479dc8){return function(_0x2bc32c){if(_0x2bc32c){return _0x2bc32c[_0x10c6('0x20')](_0x8a98fb)['then'](function(_0x4b06d7){return _0x4b06d7;});}return null;};}function removeEntity(_0x4d9c9d,_0x596ac4){return function(_0x125405){if(_0x125405){return _0x125405['destroy']()[_0x10c6('0x21')](function(){_0x4d9c9d[_0x10c6('0x17')](0xcc)[_0x10c6('0x18')]();});}};}function handleEntityNotFound(_0x2aa401,_0x3e0ae3){return function(_0x167829){if(!_0x167829){_0x2aa401[_0x10c6('0x22')](0x194);}return _0x167829;};}function handleError(_0x41279a,_0x2907fc){_0x2907fc=_0x2907fc||0x1f4;return function(_0x2a425d){logger[_0x10c6('0x23')](_0x2a425d['stack']);if(_0x2a425d[_0x10c6('0x24')]){delete _0x2a425d['name'];}_0x41279a['status'](_0x2907fc)[_0x10c6('0x25')](_0x2a425d);};}exports[_0x10c6('0x20')]=function(_0x12e16e,_0x131874){if(_0x12e16e[_0x10c6('0x26')]['id']){delete _0x12e16e['body']['id'];}return db[_0x10c6('0x27')]['find']({'where':{'id':_0x12e16e[_0x10c6('0x28')]['id']}})[_0x10c6('0x21')](handleEntityNotFound(_0x131874,null))[_0x10c6('0x21')](saveUpdates(_0x12e16e[_0x10c6('0x26')],null))[_0x10c6('0x21')](respondWithResult(_0x131874,null))[_0x10c6('0x29')](handleError(_0x131874,null));};exports[_0x10c6('0x2a')]=function(_0x528eed,_0x2e84ee){return db[_0x10c6('0x27')][_0x10c6('0x2b')]({'where':{'id':_0x528eed[_0x10c6('0x28')]['id']}})[_0x10c6('0x21')](handleEntityNotFound(_0x2e84ee,null))[_0x10c6('0x21')](removeEntity(_0x2e84ee,null))['catch'](handleError(_0x2e84ee,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 4e3f328..3d749f5 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 _0x1872=['rimraf','../../config/environment','Action','tools_actions','lodash','util','../../config/logger','request-promise','path'];(function(_0x151002,_0x1c9af6){var _0x1a7a58=function(_0x282ec3){while(--_0x282ec3){_0x151002['push'](_0x151002['shift']());}};_0x1a7a58(++_0x1c9af6);}(_0x1872,0xa6));var _0x2187=function(_0xed01eb,_0x275edb){_0xed01eb=_0xed01eb-0x0;var _0x25b9de=_0x1872[_0xed01eb];return _0x25b9de;};'use strict';var _=require(_0x2187('0x0'));var util=require(_0x2187('0x1'));var logger=require(_0x2187('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2187('0x3'));var fs=require('fs');var path=require(_0x2187('0x4'));var rimraf=require(_0x2187('0x5'));var config=require(_0x2187('0x6'));var attributes=require('./action.attributes');module['exports']=function(_0x111d4f,_0x4135be){return _0x111d4f['define'](_0x2187('0x7'),attributes,{'tableName':_0x2187('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd7ed=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','lodash'];(function(_0xc10210,_0x38f8aa){var _0x35ee70=function(_0xdbb978){while(--_0xdbb978){_0xc10210['push'](_0xc10210['shift']());}};_0x35ee70(++_0x38f8aa);}(_0xd7ed,0x1a1));var _0xdd7e=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0xd7ed[_0x1a72f3];return _0x57ef47;};'use strict';var _=require(_0xdd7e('0x0'));var util=require('util');var logger=require(_0xdd7e('0x1'))(_0xdd7e('0x2'));var moment=require('moment');var BPromise=require(_0xdd7e('0x3'));var rp=require(_0xdd7e('0x4'));var fs=require('fs');var path=require(_0xdd7e('0x5'));var rimraf=require(_0xdd7e('0x6'));var config=require(_0xdd7e('0x7'));var attributes=require(_0xdd7e('0x8'));module[_0xdd7e('0x9')]=function(_0x3baff0,_0x46e7df){return _0x3baff0[_0xdd7e('0xa')]('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index c9d115c..c131a5f 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 _0x326f=['info','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3829e7,_0x21ea4e){var _0x30dc68=function(_0x37ca4a){while(--_0x37ca4a){_0x3829e7['push'](_0x3829e7['shift']());}};_0x30dc68(++_0x21ea4e);}(_0x326f,0xd1));var _0xf326=function(_0x4b4623,_0xb74b4d){_0x4b4623=_0x4b4623-0x0;var _0x10a138=_0x326f[_0x4b4623];return _0x10a138;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('Action,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}
\ No newline at end of file
+var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5ae4b6,_0x31540b){var _0x26ad27=function(_0x189703){while(--_0x189703){_0x5ae4b6['push'](_0x5ae4b6['shift']());}};_0x26ad27(++_0x31540b);}(_0x5fab,0x177));var _0xb5fa=function(_0x5db99b,_0xdee23a){_0x5db99b=_0x5db99b-0x0;var _0x4b2d0e=_0x5fab[_0x5db99b];return _0x4b2d0e;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index d2e496a..beac9f7 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 _0x1cb5=['../../config/environment','./action.controller','put','/:id','update','delete','isAuthenticated','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x5ee68a,_0x22c32e){var _0x16e095=function(_0x40df1e){while(--_0x40df1e){_0x5ee68a['push'](_0x5ee68a['shift']());}};_0x16e095(++_0x22c32e);}(_0x1cb5,0x79));var _0x51cb=function(_0x38ac54,_0x5cd5d6){_0x38ac54=_0x38ac54-0x0;var _0xa03d8a=_0x1cb5[_0x38ac54];return _0xa03d8a;};'use strict';var multer=require(_0x51cb('0x0'));var util=require(_0x51cb('0x1'));var path=require('path');var timeout=require(_0x51cb('0x2'));var express=require(_0x51cb('0x3'));var router=express[_0x51cb('0x4')]();var fs_extra=require(_0x51cb('0x5'));var auth=require(_0x51cb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x51cb('0x7'));var controller=require(_0x51cb('0x8'));router[_0x51cb('0x9')](_0x51cb('0xa'),auth['isAuthenticated'](),controller[_0x51cb('0xb')]);router[_0x51cb('0xc')](_0x51cb('0xa'),auth[_0x51cb('0xd')](),controller[_0x51cb('0xe')]);module[_0x51cb('0xf')]=router;
\ No newline at end of file
+var _0x19f0=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','update','delete','isAuthenticated','destroy','exports','multer','util','connect-timeout','express'];(function(_0x3715a9,_0x12efaa){var _0x249b88=function(_0x2e0ec1){while(--_0x2e0ec1){_0x3715a9['push'](_0x3715a9['shift']());}};_0x249b88(++_0x12efaa);}(_0x19f0,0x119));var _0x019f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x19f0[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x019f('0x0'));var util=require(_0x019f('0x1'));var path=require('path');var timeout=require(_0x019f('0x2'));var express=require(_0x019f('0x3'));var router=express['Router']();var fs_extra=require(_0x019f('0x4'));var auth=require(_0x019f('0x5'));var interaction=require(_0x019f('0x6'));var config=require(_0x019f('0x7'));var controller=require(_0x019f('0x8'));router['put'](_0x019f('0x9'),auth['isAuthenticated'](),controller[_0x019f('0xa')]);router[_0x019f('0xb')](_0x019f('0x9'),auth[_0x019f('0xc')](),controller[_0x019f('0xd')]);module[_0x019f('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 14c64c5..96dee0a 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 _0xee14=['STRING','TEXT'];(function(_0x15bd49,_0x5a6b04){var _0x5e5421=function(_0x1ee53d){while(--_0x1ee53d){_0x15bd49['push'](_0x15bd49['shift']());}};_0x5e5421(++_0x5a6b04);}(_0xee14,0x13a));var _0x4ee1=function(_0x25ea38,_0x3397c8){_0x25ea38=_0x25ea38-0x0;var _0x2cc556=_0xee14[_0x25ea38];return _0x2cc556;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4ee1('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x4ee1('0x0')]},'parent':{'type':Sequelize[_0x4ee1('0x0')]},'table':{'type':Sequelize[_0x4ee1('0x0')]},'conditions':{'type':Sequelize[_0x4ee1('0x1')]},'joins':{'type':Sequelize[_0x4ee1('0x1')]}};
\ No newline at end of file
+var _0x5fab=['exports','STRING','TEXT','sequelize'];(function(_0x291167,_0x482eff){var _0x102c7b=function(_0x5c2d5e){while(--_0x5c2d5e){_0x291167['push'](_0x291167['shift']());}};_0x102c7b(++_0x482eff);}(_0x5fab,0x177));var _0xb5fa=function(_0x3ebe6b,_0x50bbf7){_0x3ebe6b=_0x3ebe6b-0x0;var _0x334cfc=_0x5fab[_0x3ebe6b];return _0x334cfc;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb5fa('0x2')]},'parent':{'type':Sequelize[_0xb5fa('0x2')]},'table':{'type':Sequelize[_0xb5fa('0x2')]},'conditions':{'type':Sequelize[_0xb5fa('0x3')]},'joins':{'type':Sequelize[_0xb5fa('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index e4073b5..19ad5ae 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 _0xdb2f=['rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','table','MetricId','metric','replace','function','format','groupBy','orderBy','DESC','joins','parse','foreignTable','foreignKey','parentKey','conditions','clone','toString','sequelize','QueryTypes','SELECT','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','DATE(%s)','IS\x20NOT\x20NULL','AnalyticMetric','select','from','alias','includes','output','web','fullPath','%s-%s.%s','randomstring','generate','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','fork','../../files/reports','countTable','run','runReport','%s.%s\x20=\x20%s.%s','debug','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','fs-extra','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','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','update','then','get','CustomReports','UserProfileResource','destroy','end','stack','name','send','rawAttributes','type','key','model','map','query','keys','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticCustomReport','includeAll','include','findAll','rows','show','params','fields','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','error','find','preview','join','left_join','right_join','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'];(function(_0x395b11,_0x311cdf){var _0x4380e7=function(_0x1ab6d9){while(--_0x1ab6d9){_0x395b11['push'](_0x395b11['shift']());}};_0x4380e7(++_0x311cdf);}(_0xdb2f,0x17f));var _0xfdb2=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xdb2f[_0xa1e3e3];return _0xc980e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfdb2('0x0'));var zipdir=require(_0xfdb2('0x1'));var jsonpatch=require(_0xfdb2('0x2'));var rp=require('request-promise');var moment=require(_0xfdb2('0x3'));var BPromise=require(_0xfdb2('0x4'));var Mustache=require('mustache');var util=require(_0xfdb2('0x5'));var path=require(_0xfdb2('0x6'));var sox=require(_0xfdb2('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfdb2('0x8'));var _=require('lodash');var squel=require(_0xfdb2('0x9'));var crypto=require('crypto');var jsforce=require(_0xfdb2('0xa'));var deskjs=require(_0xfdb2('0xb'));var toCsv=require(_0xfdb2('0xc'));var querystring=require(_0xfdb2('0xd'));var Papa=require(_0xfdb2('0xe'));var Redis=require(_0xfdb2('0xf'));var authService=require(_0xfdb2('0x10'));var qs=require(_0xfdb2('0x11'));var as=require(_0xfdb2('0x12'));var hardwareService=require(_0xfdb2('0x13'));var logger=require(_0xfdb2('0x14'))(_0xfdb2('0x15'));var utils=require(_0xfdb2('0x16'));var config=require(_0xfdb2('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xfdb2('0x18'))['db'];var dbH=require(_0xfdb2('0x18'))['dbH'];function respondWithStatusCode(_0x171d22,_0x2a0a7e){_0x2a0a7e=_0x2a0a7e||0xcc;return function(_0x30dbff){if(_0x30dbff){return _0x171d22[_0xfdb2('0x19')](_0x2a0a7e);}return _0x171d22['status'](_0x2a0a7e)['end']();};}function respondWithResult(_0x86bc9a,_0x294ea8){_0x294ea8=_0x294ea8||0xc8;return function(_0x3a2ace){if(_0x3a2ace){return _0x86bc9a[_0xfdb2('0x1a')](_0x294ea8)[_0xfdb2('0x1b')](_0x3a2ace);}};}function respondWithFilteredResult(_0x2fd523,_0x9af4fa){return function(_0x2c0c33){if(_0x2c0c33){var _0x111d39=typeof _0x9af4fa[_0xfdb2('0x1c')]===_0xfdb2('0x1d')&&typeof _0x9af4fa['limit']==='undefined';var _0x1591f2=_0x2c0c33[_0xfdb2('0x1e')];var _0x2d2e1d=_0x111d39?0x0:_0x9af4fa[_0xfdb2('0x1c')];var _0x29d568=_0x111d39?_0x2c0c33['count']:_0x9af4fa[_0xfdb2('0x1c')]+_0x9af4fa[_0xfdb2('0x1f')];var _0x2ea965;if(_0x29d568>=_0x1591f2){_0x29d568=_0x1591f2;_0x2ea965=0xc8;}else{_0x2ea965=0xce;}_0x2fd523['status'](_0x2ea965);return _0x2fd523[_0xfdb2('0x20')](_0xfdb2('0x21'),_0x2d2e1d+'-'+_0x29d568+'/'+_0x1591f2)[_0xfdb2('0x1b')](_0x2c0c33);}return null;};}function patchUpdates(_0x173d0d){return function(_0x4a5809){try{jsonpatch['apply'](_0x4a5809,_0x173d0d,!![]);}catch(_0xefacf4){return BPromise['reject'](_0xefacf4);}return _0x4a5809['save']();};}function saveUpdates(_0x439108,_0xc70277){return function(_0x3d5601){if(_0x3d5601){return _0x3d5601[_0xfdb2('0x22')](_0x439108)[_0xfdb2('0x23')](function(_0xaf664c){return _0xaf664c;});}return null;};}function removeEntity(_0x115d60,_0x5bad11){return function(_0x222843){if(_0x222843){return _0x222843['destroy']()['then'](function(){var _0x5d77ad=_0x222843[_0xfdb2('0x24')]({'plain':!![]});var _0x22ee4c=_0xfdb2('0x25');return db[_0xfdb2('0x26')][_0xfdb2('0x27')]({'where':{'type':_0x22ee4c,'resourceId':_0x5d77ad['id']}})[_0xfdb2('0x23')](function(){return _0x222843;});})[_0xfdb2('0x23')](function(){_0x115d60[_0xfdb2('0x1a')](0xcc)[_0xfdb2('0x28')]();});}};}function handleEntityNotFound(_0xd92203,_0xaa7959){return function(_0x2d4065){if(!_0x2d4065){_0xd92203['sendStatus'](0x194);}return _0x2d4065;};}function handleError(_0x567a7c,_0x3dd2d9){_0x3dd2d9=_0x3dd2d9||0x1f4;return function(_0x1cd4e4){logger['error'](_0x1cd4e4[_0xfdb2('0x29')]);if(_0x1cd4e4[_0xfdb2('0x2a')]){delete _0x1cd4e4[_0xfdb2('0x2a')];}_0x567a7c[_0xfdb2('0x1a')](_0x3dd2d9)[_0xfdb2('0x2b')](_0x1cd4e4);};}exports['index']=function(_0x37fe6f,_0x67373f){var _0x4df906={},_0x1241ef={},_0xc97f03={'count':0x0,'rows':[]};var _0x1035a4=_['map'](db['AnalyticCustomReport'][_0xfdb2('0x2c')],function(_0xdbbec0){return{'name':_0xdbbec0['fieldName'],'type':_0xdbbec0[_0xfdb2('0x2d')][_0xfdb2('0x2e')]};});_0x1241ef[_0xfdb2('0x2f')]=_[_0xfdb2('0x30')](_0x1035a4,_0xfdb2('0x2a'));_0x1241ef[_0xfdb2('0x31')]=_[_0xfdb2('0x32')](_0x37fe6f[_0xfdb2('0x31')]);_0x1241ef['filters']=_['intersection'](_0x1241ef[_0xfdb2('0x2f')],_0x1241ef['query']);_0x4df906[_0xfdb2('0x33')]=_[_0xfdb2('0x34')](_0x1241ef[_0xfdb2('0x2f')],qs['fields'](_0x37fe6f[_0xfdb2('0x31')]['fields']));_0x4df906[_0xfdb2('0x33')]=_0x4df906[_0xfdb2('0x33')][_0xfdb2('0x35')]?_0x4df906['attributes']:_0x1241ef[_0xfdb2('0x2f')];if(!_0x37fe6f[_0xfdb2('0x31')][_0xfdb2('0x36')](_0xfdb2('0x37'))){_0x4df906[_0xfdb2('0x1f')]=qs[_0xfdb2('0x1f')](_0x37fe6f[_0xfdb2('0x31')][_0xfdb2('0x1f')]);_0x4df906[_0xfdb2('0x1c')]=qs[_0xfdb2('0x1c')](_0x37fe6f[_0xfdb2('0x31')][_0xfdb2('0x1c')]);}_0x4df906[_0xfdb2('0x38')]=qs['sort'](_0x37fe6f[_0xfdb2('0x31')][_0xfdb2('0x39')]);_0x4df906[_0xfdb2('0x3a')]=qs[_0xfdb2('0x3b')](_[_0xfdb2('0x3c')](_0x37fe6f[_0xfdb2('0x31')],_0x1241ef[_0xfdb2('0x3b')]),_0x1035a4);if(_0x37fe6f[_0xfdb2('0x31')][_0xfdb2('0x3d')]){_0x4df906[_0xfdb2('0x3a')]=_[_0xfdb2('0x3e')](_0x4df906[_0xfdb2('0x3a')],{'$or':_[_0xfdb2('0x30')](_0x1035a4,function(_0x3d17db){if(_0x3d17db[_0xfdb2('0x2d')]!==_0xfdb2('0x3f')){var _0x1fe7ce={};_0x1fe7ce[_0x3d17db['name']]={'$like':'%'+_0x37fe6f[_0xfdb2('0x31')]['filter']+'%'};return _0x1fe7ce;}})});}_0x4df906=_['merge']({},_0x4df906,_0x37fe6f[_0xfdb2('0x40')]);var _0x2c2613={'where':_0x4df906[_0xfdb2('0x3a')]};return db[_0xfdb2('0x41')][_0xfdb2('0x1e')](_0x2c2613)['then'](function(_0x33528b){_0xc97f03[_0xfdb2('0x1e')]=_0x33528b;if(_0x37fe6f['query'][_0xfdb2('0x42')]){_0x4df906[_0xfdb2('0x43')]=[{'all':!![]}];}return db[_0xfdb2('0x41')][_0xfdb2('0x44')](_0x4df906);})[_0xfdb2('0x23')](function(_0x1ae2ae){_0xc97f03[_0xfdb2('0x45')]=_0x1ae2ae;return _0xc97f03;})[_0xfdb2('0x23')](respondWithFilteredResult(_0x67373f,_0x4df906))['catch'](handleError(_0x67373f,null));};exports[_0xfdb2('0x46')]=function(_0xd8cac3,_0x193529){var _0x3bb043={'raw':![],'where':{'id':_0xd8cac3[_0xfdb2('0x47')]['id']}},_0x1fd5f2={};_0x1fd5f2[_0xfdb2('0x2f')]=_['keys'](db['AnalyticCustomReport'][_0xfdb2('0x2c')]);_0x1fd5f2['query']=_['keys'](_0xd8cac3[_0xfdb2('0x31')]);_0x1fd5f2['filters']=_[_0xfdb2('0x34')](_0x1fd5f2[_0xfdb2('0x2f')],_0x1fd5f2[_0xfdb2('0x31')]);_0x3bb043[_0xfdb2('0x33')]=_[_0xfdb2('0x34')](_0x1fd5f2['model'],qs[_0xfdb2('0x48')](_0xd8cac3[_0xfdb2('0x31')][_0xfdb2('0x48')]));_0x3bb043[_0xfdb2('0x33')]=_0x3bb043[_0xfdb2('0x33')][_0xfdb2('0x35')]?_0x3bb043[_0xfdb2('0x33')]:_0x1fd5f2[_0xfdb2('0x2f')];if(_0xd8cac3[_0xfdb2('0x31')][_0xfdb2('0x42')]){_0x3bb043[_0xfdb2('0x43')]=[{'all':!![]}];}_0x3bb043=_[_0xfdb2('0x3e')]({},_0x3bb043,_0xd8cac3['options']);return db[_0xfdb2('0x41')]['find'](_0x3bb043)[_0xfdb2('0x23')](handleEntityNotFound(_0x193529,null))['then'](respondWithResult(_0x193529,null))[_0xfdb2('0x49')](handleError(_0x193529,null));};exports['create']=function(_0x1bfca3,_0x18f991){return db[_0xfdb2('0x41')][_0xfdb2('0x4a')](_0x1bfca3[_0xfdb2('0x4b')],{})[_0xfdb2('0x23')](function(_0x2750c7){var _0x326935=_0x1bfca3['user'][_0xfdb2('0x24')]({'plain':!![]});if(!_0x326935)throw new Error(_0xfdb2('0x4c'));if(_0x326935[_0xfdb2('0x4d')]===_0xfdb2('0x4e')){var _0x70e6f0=_0x2750c7['get']({'plain':!![]});var _0x5b31c2='Reports';return db['UserProfileSection']['find']({'where':{'name':_0x5b31c2,'userProfileId':_0x326935['userProfileId']},'raw':!![]})[_0xfdb2('0x23')](function(_0x324331){if(_0x324331&&_0x324331[_0xfdb2('0x4f')]===0x0){return db[_0xfdb2('0x26')]['create']({'name':_0x70e6f0[_0xfdb2('0x2a')],'resourceId':_0x70e6f0['id'],'type':_0xfdb2('0x25'),'sectionId':_0x324331['id']},{})['then'](function(){return _0x2750c7;});}else{return _0x2750c7;}})[_0xfdb2('0x49')](function(_0x29e3e8){logger[_0xfdb2('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29e3e8);throw _0x29e3e8;});}return _0x2750c7;})[_0xfdb2('0x23')](respondWithResult(_0x18f991,0xc9))[_0xfdb2('0x49')](handleError(_0x18f991,null));};exports['update']=function(_0x263fa2,_0x5abc06){if(_0x263fa2[_0xfdb2('0x4b')]['id']){delete _0x263fa2[_0xfdb2('0x4b')]['id'];}return db[_0xfdb2('0x41')][_0xfdb2('0x51')]({'where':{'id':_0x263fa2[_0xfdb2('0x47')]['id']}})[_0xfdb2('0x23')](handleEntityNotFound(_0x5abc06,null))[_0xfdb2('0x23')](saveUpdates(_0x263fa2['body'],null))[_0xfdb2('0x23')](respondWithResult(_0x5abc06,null))['catch'](handleError(_0x5abc06,null));};exports['destroy']=function(_0x2cd4a4,_0x526b4f){return db[_0xfdb2('0x41')][_0xfdb2('0x51')]({'where':{'id':_0x2cd4a4[_0xfdb2('0x47')]['id']}})[_0xfdb2('0x23')](handleEntityNotFound(_0x526b4f,null))[_0xfdb2('0x23')](removeEntity(_0x526b4f,null))[_0xfdb2('0x49')](handleError(_0x526b4f,null));};exports[_0xfdb2('0x52')]=function(_0x5236d9,_0x5f0205){var _0x573307=0xa;var _0xcc9cff=[_0xfdb2('0x53'),_0xfdb2('0x54'),_0xfdb2('0x55'),'cross_join'];var _0x486d9b={'SUM':'SUM(%s)','COUNT':_0xfdb2('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xfdb2('0x57'),'MIN':_0xfdb2('0x58'),'AVG':_0xfdb2('0x59'),'GROUP_CONCAT':_0xfdb2('0x5a'),'GROUP_CONCAT ASC':_0xfdb2('0x5b'),'GROUP_CONCAT DESC':_0xfdb2('0x5c')};var _0x16284e={'SEC_TO_TIME':_0xfdb2('0x5d'),'DATE':'DATE(%s)','HOUR':_0xfdb2('0x5e'),'ROUND':_0xfdb2('0x5f'),'UNIX_TIMESTAMP':_0xfdb2('0x60')};var _0x46f5ad=function(_0x3981c1){return!_['includes']([_0xfdb2('0x61'),'IS\x20NOT\x20NULL',_0xfdb2('0x62'),_0xfdb2('0x63')],_0x3981c1);};var _0x1ad9b9=function(_0x25c0a5){if(!_0x25c0a5||!_0x25c0a5[_0xfdb2('0x64')][_0xfdb2('0x35')]){return'';}for(var _0x5bc7da='(',_0xe67cca=0x0;_0xe67cca<_0x25c0a5[_0xfdb2('0x64')][_0xfdb2('0x35')];_0xe67cca+=0x1){_0xe67cca>0x0&&(_0x5bc7da+='\x20'+_0x25c0a5[_0xfdb2('0x65')]+'\x20');_0x5bc7da+=_0x25c0a5[_0xfdb2('0x64')][_0xe67cca][_0xfdb2('0x66')]?_0x1ad9b9(_0x25c0a5[_0xfdb2('0x64')][_0xe67cca][_0xfdb2('0x66')]):_0x25c0a5[_0xfdb2('0x64')][_0xe67cca][_0xfdb2('0x67')]+'\x20'+_0x25c0a5[_0xfdb2('0x64')][_0xe67cca][_0xfdb2('0x68')]+(_0x46f5ad(_0x25c0a5['rules'][_0xe67cca]['condition'])?'\x20'+_0x25c0a5[_0xfdb2('0x64')][_0xe67cca][_0xfdb2('0x69')]:'');}return _0x5bc7da+')';};var _0x4e7b4f={'where':{'id':_0x5236d9[_0xfdb2('0x47')]['id']}},_0x1af3ea,_0x1c9fe5,_0x3f1262,_0x31bbe6,_0x5f40b7;_0x4e7b4f=_[_0xfdb2('0x3e')]({},_0x4e7b4f,_0x5236d9[_0xfdb2('0x40')]);return db['AnalyticCustomReport'][_0xfdb2('0x51')](_0x4e7b4f)[_0xfdb2('0x23')](function(_0x432a14){if(_0x432a14){_0x1af3ea=_0x432a14;return _0x432a14[_0xfdb2('0x6a')]();}return null;})[_0xfdb2('0x23')](function(_0x412fa2){if(_0x412fa2){if(!_0x412fa2['length']){throw new db[(_0xfdb2('0x6b'))][(_0xfdb2('0x6c'))](_0xfdb2('0x6d'),0x193);}_0x1c9fe5=_0x412fa2;return db['AnalyticMetric'][_0xfdb2('0x44')]({'raw':!![]});}return null;})[_0xfdb2('0x23')](function(_0x1d613a){if(_0x1d613a){_0x3f1262=_['keyBy'](_0x1d613a,'id');var _0x15bd96;var _0x35344b=squel['select']();_0x35344b['from'](_0x1af3ea[_0xfdb2('0x6e')]);for(var _0x103de3=0x0;_0x103de3<_0x1c9fe5[_0xfdb2('0x35')];_0x103de3+=0x1){_0x15bd96=_0x1c9fe5[_0x103de3][_0xfdb2('0x6f')]?_0x3f1262[_0x1c9fe5[_0x103de3]['MetricId']][_0xfdb2('0x70')]:_0x1c9fe5[_0x103de3][_0xfdb2('0x67')];_0x15bd96=_0x1c9fe5[_0x103de3]['function']?_[_0xfdb2('0x71')](_0x486d9b[_0x1c9fe5[_0x103de3][_0xfdb2('0x72')]],'%s',_0x15bd96):_0x15bd96;_0x15bd96=_0x1c9fe5[_0x103de3][_0xfdb2('0x73')]?_[_0xfdb2('0x71')](_0x16284e[_0x1c9fe5[_0x103de3]['format']],'%s',_0x15bd96):_0x15bd96;if(_0x1c9fe5[_0x103de3][_0xfdb2('0x74')]){_0x35344b[_0xfdb2('0x66')](_0x15bd96);}_0x1c9fe5[_0x103de3][_0xfdb2('0x75')]&&_0x35344b[_0xfdb2('0x38')](_0x15bd96,_0x1c9fe5[_0x103de3]['orderBy']===_0xfdb2('0x76')?![]:!![]);_0x35344b[_0xfdb2('0x67')](_0x15bd96,_0x1c9fe5[_0x103de3]['alias']||_0x15bd96);}if(_0x1af3ea[_0xfdb2('0x77')]){_0x1af3ea['joins']=JSON[_0xfdb2('0x78')](_0x1af3ea[_0xfdb2('0x77')]);for(var _0x1ed34d=0x0;_0x1ed34d<_0x1af3ea['joins'][_0xfdb2('0x35')];_0x1ed34d+=0x1){if(_0x1af3ea[_0xfdb2('0x77')][_0x1ed34d][_0xfdb2('0x2d')]&&_['includes'](_0xcc9cff,_0x1af3ea[_0xfdb2('0x77')][_0x1ed34d][_0xfdb2('0x2d')])&&_0x1af3ea[_0xfdb2('0x77')][_0x1ed34d]['parentKey']&&_0x1af3ea['joins'][_0x1ed34d][_0xfdb2('0x79')]&&_0x1af3ea[_0xfdb2('0x77')][_0x1ed34d][_0xfdb2('0x7a')]){_0x35344b[_0x1af3ea[_0xfdb2('0x77')][_0x1ed34d]['type']](_0x1af3ea[_0xfdb2('0x77')][_0x1ed34d]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1af3ea[_0xfdb2('0x6e')],_0x1af3ea[_0xfdb2('0x77')][_0x1ed34d][_0xfdb2('0x7b')],_0x1af3ea[_0xfdb2('0x77')][_0x1ed34d][_0xfdb2('0x79')],_0x1af3ea[_0xfdb2('0x77')][_0x1ed34d]['foreignKey']));}}}if(_0x1af3ea[_0xfdb2('0x7c')]){_0x1af3ea[_0xfdb2('0x7c')]=JSON[_0xfdb2('0x78')](_0x1af3ea[_0xfdb2('0x7c')]);_0x35344b[_0xfdb2('0x3a')](_0x1ad9b9(_0x1af3ea[_0xfdb2('0x7c')][_0xfdb2('0x66')]));}_0x5f40b7=_0x35344b[_0xfdb2('0x7d')]();_0x35344b[_0xfdb2('0x1f')](_0x573307);_0x35344b[_0xfdb2('0x1c')](0x0);logger['debug']('Limited\x20Query:',_0x35344b[_0xfdb2('0x7e')]());return dbH[_0xfdb2('0x7f')][_0xfdb2('0x31')](_0x35344b[_0xfdb2('0x7e')](),{'type':dbH['sequelize'][_0xfdb2('0x80')][_0xfdb2('0x81')]});}})[_0xfdb2('0x23')](respondWithResult(_0x5f0205,null))[_0xfdb2('0x49')](handleError(_0x5f0205,null));};function runReport(_0x5d75db,_0x11b6ee,_0x4b160d){var _0x8ff979=_0x11b6ee[_0xfdb2('0x2a')];var _0x7e5529=0xa;var _0x4da2d2=[_0xfdb2('0x53'),'left_join','right_join',_0xfdb2('0x82')];var _0x300462={'SUM':_0xfdb2('0x83'),'COUNT':_0xfdb2('0x56'),'COUNT DISTINCT':_0xfdb2('0x84'),'MAX':_0xfdb2('0x57'),'MIN':_0xfdb2('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xfdb2('0x5a'),'GROUP_CONCAT ASC':_0xfdb2('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x9bdc97={'SEC_TO_TIME':_0xfdb2('0x5d'),'DATE':_0xfdb2('0x85'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xfdb2('0x60')};var _0x2cd54a=function(_0x8341b8){return!_['includes']([_0xfdb2('0x61'),_0xfdb2('0x86'),'IS\x20EMPTY',_0xfdb2('0x63')],_0x8341b8);};var _0x4731b3=function(_0x57b052){if(!_0x57b052||!_0x57b052['rules'][_0xfdb2('0x35')]){return'';}for(var _0x5ba8c8='(',_0x173806=0x0;_0x173806<_0x57b052[_0xfdb2('0x64')]['length'];_0x173806+=0x1){_0x173806>0x0&&(_0x5ba8c8+='\x20'+_0x57b052[_0xfdb2('0x65')]+'\x20');_0x5ba8c8+=_0x57b052['rules'][_0x173806][_0xfdb2('0x66')]?_0x4731b3(_0x57b052[_0xfdb2('0x64')][_0x173806]['group']):_0x57b052[_0xfdb2('0x64')][_0x173806][_0xfdb2('0x67')]+'\x20'+_0x57b052[_0xfdb2('0x64')][_0x173806]['condition']+(_0x2cd54a(_0x57b052[_0xfdb2('0x64')][_0x173806][_0xfdb2('0x68')])?'\x20'+_0x57b052['rules'][_0x173806][_0xfdb2('0x69')]:'');}return _0x5ba8c8+')';};var _0x28a4df={'where':{'id':_0x5d75db['id']}},_0x649259,_0x3d48bb,_0x15c938,_0x5921fd,_0x1651f9;_0x28a4df=_[_0xfdb2('0x3e')]({},_0x28a4df,_0x4b160d);return db[_0xfdb2('0x41')][_0xfdb2('0x51')](_0x28a4df)[_0xfdb2('0x23')](function(_0x1b7d7b){if(_0x1b7d7b){_0x649259=_0x1b7d7b;return _0x1b7d7b[_0xfdb2('0x6a')]();}return null;})[_0xfdb2('0x23')](function(_0x73febf){if(_0x73febf){if(!_0x73febf[_0xfdb2('0x35')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3d48bb=_0x73febf;return db[_0xfdb2('0x87')][_0xfdb2('0x44')]({'raw':!![]});}return null;})['then'](function(_0x3cde0f){if(_0x3cde0f){_0x15c938=_['keyBy'](_0x3cde0f,'id');var _0x50ea7f;var _0x2c0551=squel[_0xfdb2('0x88')]();_0x2c0551[_0xfdb2('0x89')](_0x649259[_0xfdb2('0x6e')]);for(var _0x82d192=0x0;_0x82d192<_0x3d48bb[_0xfdb2('0x35')];_0x82d192+=0x1){_0x50ea7f=_0x3d48bb[_0x82d192][_0xfdb2('0x6f')]?_0x15c938[_0x3d48bb[_0x82d192][_0xfdb2('0x6f')]][_0xfdb2('0x70')]:_0x3d48bb[_0x82d192]['field'];_0x50ea7f=_0x3d48bb[_0x82d192][_0xfdb2('0x72')]?_[_0xfdb2('0x71')](_0x300462[_0x3d48bb[_0x82d192][_0xfdb2('0x72')]],'%s',_0x50ea7f):_0x50ea7f;_0x50ea7f=_0x3d48bb[_0x82d192]['format']?_[_0xfdb2('0x71')](_0x9bdc97[_0x3d48bb[_0x82d192][_0xfdb2('0x73')]],'%s',_0x50ea7f):_0x50ea7f;if(_0x3d48bb[_0x82d192][_0xfdb2('0x74')]){_0x2c0551[_0xfdb2('0x66')](_0x50ea7f);}_0x3d48bb[_0x82d192][_0xfdb2('0x75')]&&_0x2c0551[_0xfdb2('0x38')](_0x50ea7f,_0x3d48bb[_0x82d192][_0xfdb2('0x75')]===_0xfdb2('0x76')?![]:!![]);_0x2c0551[_0xfdb2('0x67')](_0x50ea7f,_0x3d48bb[_0x82d192][_0xfdb2('0x8a')]||_0x50ea7f);}if(_0x649259[_0xfdb2('0x77')]){_0x649259[_0xfdb2('0x77')]=JSON['parse'](_0x649259[_0xfdb2('0x77')]);for(var _0x4b1adc=0x0;_0x4b1adc<_0x649259[_0xfdb2('0x77')][_0xfdb2('0x35')];_0x4b1adc+=0x1){if(_0x649259['joins'][_0x4b1adc]['type']&&_[_0xfdb2('0x8b')](_0x4da2d2,_0x649259[_0xfdb2('0x77')][_0x4b1adc][_0xfdb2('0x2d')])&&_0x649259[_0xfdb2('0x77')][_0x4b1adc][_0xfdb2('0x7b')]&&_0x649259[_0xfdb2('0x77')][_0x4b1adc][_0xfdb2('0x79')]&&_0x649259['joins'][_0x4b1adc][_0xfdb2('0x7a')]){_0x2c0551[_0x649259[_0xfdb2('0x77')][_0x4b1adc][_0xfdb2('0x2d')]](_0x649259['joins'][_0x4b1adc][_0xfdb2('0x79')],null,util[_0xfdb2('0x73')]('%s.%s\x20=\x20%s.%s',_0x649259[_0xfdb2('0x6e')],_0x649259['joins'][_0x4b1adc][_0xfdb2('0x7b')],_0x649259['joins'][_0x4b1adc][_0xfdb2('0x79')],_0x649259[_0xfdb2('0x77')][_0x4b1adc][_0xfdb2('0x7a')]));}}}if(_0x649259[_0xfdb2('0x7c')]){_0x649259[_0xfdb2('0x7c')]=JSON[_0xfdb2('0x78')](_0x649259[_0xfdb2('0x7c')]);_0x2c0551[_0xfdb2('0x3a')](_0x4731b3(_0x649259[_0xfdb2('0x7c')]['group']));}_0x1651f9=_0x2c0551['clone']();_0x2c0551[_0xfdb2('0x1f')](_0x7e5529);_0x2c0551[_0xfdb2('0x1c')](0x0);return;}})[_0xfdb2('0x23')](function(){if(_0x11b6ee[_0xfdb2('0x8c')]===_0xfdb2('0x8d')){return null;}var _0x118876=_['merge'](_0x11b6ee,{'name':_0x11b6ee[_0xfdb2('0x8e')]||_0x11b6ee[_0xfdb2('0x2a')]||_0x649259[_0xfdb2('0x2a')],'basename':_0x8ff979,'savename':util[_0xfdb2('0x73')](_0xfdb2('0x8f'),_0x11b6ee[_0xfdb2('0x2a')]||_0x649259[_0xfdb2('0x2a')],require(_0xfdb2('0x90'))[_0xfdb2('0x91')](0x4),_0x11b6ee[_0xfdb2('0x8c')]||'csv'),'reportId':_0x649259['id'],'reportType':'custom'});return db[_0xfdb2('0x92')][_0xfdb2('0x4a')](_0x118876,{'raw':!![]});})[_0xfdb2('0x23')](function(_0xce6959){if(_0x649259['table']===_0xfdb2('0x93')){_0x1651f9['where'](_0x649259[_0xfdb2('0x6e')]+_0xfdb2('0x94'),_0x11b6ee['startDate'],_0x11b6ee[_0xfdb2('0x95')]);}else{_0x1651f9[_0xfdb2('0x3a')](_0x649259[_0xfdb2('0x6e')]+_0xfdb2('0x96'),_0x11b6ee[_0xfdb2('0x97')],_0x11b6ee[_0xfdb2('0x95')]);}if(_0xce6959){logger[_0xfdb2('0x98')](_0xfdb2('0x99'),_0x1651f9[_0xfdb2('0x7e')]());require('child_process')[_0xfdb2('0x9a')](path['join'](__dirname,'../../components/export/',_0xce6959[_0xfdb2('0x8c')]),[_0xce6959['id'],_0x1651f9[_0xfdb2('0x7e')](),path[_0xfdb2('0x53')](__dirname,_0xfdb2('0x9b'),_0xce6959['savename']),_0x8ff979]);return _0xce6959;}else{var _0x905afd=squel[_0xfdb2('0x88')]();_0x905afd[_0xfdb2('0x89')]('('+_0x1651f9['toString']()+')',_0xfdb2('0x9c'));_0x905afd[_0xfdb2('0x67')]('COUNT(*)',_0xfdb2('0x1e'));_0x1651f9['limit'](_0x11b6ee['limit']||_0x7e5529);_0x1651f9[_0xfdb2('0x1c')](_0x11b6ee['offset']||0x0);return dbH[_0xfdb2('0x7f')][_0xfdb2('0x31')](_0x905afd['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xfdb2('0x81')]})[_0xfdb2('0x23')](function(_0x4d9e12){if(!_0x4d9e12[_0xfdb2('0x35')]){_0x5921fd=0x0;}else{_0x5921fd=_0x4d9e12[0x0][_0xfdb2('0x1e')]||0x0;}return dbH[_0xfdb2('0x7f')][_0xfdb2('0x31')](_0x1651f9[_0xfdb2('0x7e')](),{'type':dbH[_0xfdb2('0x7f')][_0xfdb2('0x80')]['SELECT']});})['then'](function(_0x485aff){return{'rows':_0x485aff||[],'count':_0x5921fd};});}});}exports[_0xfdb2('0x9d')]=function(_0x478fc8,_0x116558){return runReport(_0x478fc8[_0xfdb2('0x47')],_0x478fc8[_0xfdb2('0x31')],_0x478fc8[_0xfdb2('0x40')])[_0xfdb2('0x23')](respondWithResult(_0x116558,null))[_0xfdb2('0x49')](handleError(_0x116558,null));};exports[_0xfdb2('0x9e')]=runReport;exports['query']=function(_0x58971e,_0x2f68e8){var _0x2fc1c7=0xa;var _0x8abb2e=[_0xfdb2('0x53'),_0xfdb2('0x54'),_0xfdb2('0x55'),_0xfdb2('0x82')];var _0x360d4d={'SUM':_0xfdb2('0x83'),'COUNT':_0xfdb2('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xfdb2('0x57'),'MIN':_0xfdb2('0x58'),'AVG':_0xfdb2('0x59'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xfdb2('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2a9893={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xfdb2('0x85'),'HOUR':_0xfdb2('0x5e'),'ROUND':_0xfdb2('0x5f'),'UNIX_TIMESTAMP':_0xfdb2('0x60')};var _0x99a945=function(_0x59a8cf){return!_[_0xfdb2('0x8b')](['IS\x20NULL',_0xfdb2('0x86'),_0xfdb2('0x62'),'IS\x20NOT\x20EMPTY'],_0x59a8cf);};var _0x42ce3e=function(_0x2d54c8){if(!_0x2d54c8||!_0x2d54c8[_0xfdb2('0x64')][_0xfdb2('0x35')]){return'';}for(var _0x4400b2='(',_0x13385c=0x0;_0x13385c<_0x2d54c8[_0xfdb2('0x64')][_0xfdb2('0x35')];_0x13385c+=0x1){_0x13385c>0x0&&(_0x4400b2+='\x20'+_0x2d54c8[_0xfdb2('0x65')]+'\x20');_0x4400b2+=_0x2d54c8['rules'][_0x13385c][_0xfdb2('0x66')]?_0x42ce3e(_0x2d54c8[_0xfdb2('0x64')][_0x13385c][_0xfdb2('0x66')]):_0x2d54c8[_0xfdb2('0x64')][_0x13385c]['field']+'\x20'+_0x2d54c8['rules'][_0x13385c][_0xfdb2('0x68')]+(_0x99a945(_0x2d54c8['rules'][_0x13385c]['condition'])?'\x20'+_0x2d54c8[_0xfdb2('0x64')][_0x13385c][_0xfdb2('0x69')]:'');}return _0x4400b2+')';};var _0x2dddd4={'where':{'id':_0x58971e[_0xfdb2('0x47')]['id']}},_0xb810fe,_0x57beec,_0x915636,_0x516793,_0x2b4335;_0x2dddd4=_[_0xfdb2('0x3e')]({},_0x2dddd4,_0x58971e[_0xfdb2('0x40')]);return db['AnalyticCustomReport'][_0xfdb2('0x51')](_0x2dddd4)[_0xfdb2('0x23')](function(_0x40ed7c){if(_0x40ed7c){_0xb810fe=_0x40ed7c;return _0x40ed7c['getFields']();}return null;})['then'](function(_0x21acdf){if(_0x21acdf){if(!_0x21acdf[_0xfdb2('0x35')]){throw new db['Sequelize']['ValidationErrorItem'](_0xfdb2('0x6d'),0x193);}_0x57beec=_0x21acdf;return db[_0xfdb2('0x87')][_0xfdb2('0x44')]({'raw':!![]});}return null;})[_0xfdb2('0x23')](function(_0xf0727f){if(_0xf0727f){_0x915636=_['keyBy'](_0xf0727f,'id');var _0x552694;var _0x522695=squel['select']();_0x522695['from'](_0xb810fe['table']);for(var _0x5228fb=0x0;_0x5228fb<_0x57beec[_0xfdb2('0x35')];_0x5228fb+=0x1){_0x552694=_0x57beec[_0x5228fb][_0xfdb2('0x6f')]?_0x915636[_0x57beec[_0x5228fb][_0xfdb2('0x6f')]][_0xfdb2('0x70')]:_0x57beec[_0x5228fb][_0xfdb2('0x67')];_0x552694=_0x57beec[_0x5228fb][_0xfdb2('0x72')]?_[_0xfdb2('0x71')](_0x360d4d[_0x57beec[_0x5228fb][_0xfdb2('0x72')]],'%s',_0x552694):_0x552694;_0x552694=_0x57beec[_0x5228fb][_0xfdb2('0x73')]?_[_0xfdb2('0x71')](_0x2a9893[_0x57beec[_0x5228fb][_0xfdb2('0x73')]],'%s',_0x552694):_0x552694;if(_0x57beec[_0x5228fb]['groupBy']){_0x522695['group'](_0x552694);}_0x57beec[_0x5228fb][_0xfdb2('0x75')]&&_0x522695['order'](_0x552694,_0x57beec[_0x5228fb]['orderBy']===_0xfdb2('0x76')?![]:!![]);_0x522695[_0xfdb2('0x67')](_0x552694,_0x57beec[_0x5228fb][_0xfdb2('0x8a')]||_0x552694);}if(_0xb810fe[_0xfdb2('0x77')]){_0xb810fe[_0xfdb2('0x77')]=JSON['parse'](_0xb810fe['joins']);for(var _0x12438e=0x0;_0x12438e<_0xb810fe['joins'][_0xfdb2('0x35')];_0x12438e+=0x1){if(_0xb810fe[_0xfdb2('0x77')][_0x12438e][_0xfdb2('0x2d')]&&_[_0xfdb2('0x8b')](_0x8abb2e,_0xb810fe[_0xfdb2('0x77')][_0x12438e][_0xfdb2('0x2d')])&&_0xb810fe['joins'][_0x12438e]['parentKey']&&_0xb810fe[_0xfdb2('0x77')][_0x12438e][_0xfdb2('0x79')]&&_0xb810fe[_0xfdb2('0x77')][_0x12438e][_0xfdb2('0x7a')]){_0x522695[_0xb810fe[_0xfdb2('0x77')][_0x12438e]['type']](_0xb810fe[_0xfdb2('0x77')][_0x12438e]['foreignTable'],null,util['format'](_0xfdb2('0x9f'),_0xb810fe[_0xfdb2('0x6e')],_0xb810fe[_0xfdb2('0x77')][_0x12438e][_0xfdb2('0x7b')],_0xb810fe[_0xfdb2('0x77')][_0x12438e]['foreignTable'],_0xb810fe[_0xfdb2('0x77')][_0x12438e][_0xfdb2('0x7a')]));}}}if(_0xb810fe[_0xfdb2('0x7c')]){_0xb810fe[_0xfdb2('0x7c')]=JSON['parse'](_0xb810fe['conditions']);_0x522695[_0xfdb2('0x3a')](_0x42ce3e(_0xb810fe['conditions'][_0xfdb2('0x66')]));}_0x2b4335=_0x522695[_0xfdb2('0x7d')]();_0x522695['limit'](_0x2fc1c7);_0x522695[_0xfdb2('0x1c')](0x0);logger[_0xfdb2('0xa0')]('Limited\x20Query:',_0x522695[_0xfdb2('0x7e')]());return dbH[_0xfdb2('0x7f')][_0xfdb2('0x31')](_0x522695['toString'](),{'type':dbH[_0xfdb2('0x7f')]['QueryTypes'][_0xfdb2('0x81')]});}})[_0xfdb2('0x23')](function(){return{'sql':_0x2b4335['toString']()};})['then'](respondWithResult(_0x2f68e8,null))[_0xfdb2('0x49')](handleError(_0x2f68e8,null));};
\ No newline at end of file
+var _0x48d1=['right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','MetricId','metric','replace','function','format','groupBy','orderBy','parse','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','IS\x20NOT\x20EMPTY','value','AnalyticMetric','from','DESC','alias','output','web','fullPath','%s-%s.%s','randomstring','csv','custom','AnalyticExtractedReport','cdr','endDate','startDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','then','get','CustomReports','UserProfileResource','end','error','name','index','AnalyticCustomReport','rawAttributes','fieldName','type','map','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','body','preview','left_join'];(function(_0x18e0f3,_0x90c5bf){var _0x1c50ad=function(_0x5113d9){while(--_0x5113d9){_0x18e0f3['push'](_0x18e0f3['shift']());}};_0x1c50ad(++_0x90c5bf);}(_0x48d1,0x1a2));var _0x148d=function(_0x3c717e,_0x13e9ad){_0x3c717e=_0x3c717e-0x0;var _0x2f3ca7=_0x48d1[_0x3c717e];return _0x2f3ca7;};'use strict';var emlformat=require(_0x148d('0x0'));var rimraf=require(_0x148d('0x1'));var zipdir=require(_0x148d('0x2'));var jsonpatch=require(_0x148d('0x3'));var rp=require('request-promise');var moment=require(_0x148d('0x4'));var BPromise=require(_0x148d('0x5'));var Mustache=require(_0x148d('0x6'));var util=require('util');var path=require(_0x148d('0x7'));var sox=require(_0x148d('0x8'));var csv=require(_0x148d('0x9'));var ejs=require(_0x148d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x148d('0xb'));var squel=require(_0x148d('0xc'));var crypto=require(_0x148d('0xd'));var jsforce=require(_0x148d('0xe'));var deskjs=require(_0x148d('0xf'));var toCsv=require(_0x148d('0x9'));var querystring=require('querystring');var Papa=require(_0x148d('0x10'));var Redis=require(_0x148d('0x11'));var authService=require(_0x148d('0x12'));var qs=require(_0x148d('0x13'));var as=require(_0x148d('0x14'));var hardwareService=require(_0x148d('0x15'));var logger=require(_0x148d('0x16'))('api');var utils=require(_0x148d('0x17'));var config=require(_0x148d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x148d('0x19'))['db'];var dbH=require(_0x148d('0x19'))[_0x148d('0x1a')];function respondWithStatusCode(_0x492d02,_0x1379c1){_0x1379c1=_0x1379c1||0xcc;return function(_0x4675e8){if(_0x4675e8){return _0x492d02[_0x148d('0x1b')](_0x1379c1);}return _0x492d02[_0x148d('0x1c')](_0x1379c1)['end']();};}function respondWithResult(_0x27f90b,_0x185d83){_0x185d83=_0x185d83||0xc8;return function(_0x5cbead){if(_0x5cbead){return _0x27f90b[_0x148d('0x1c')](_0x185d83)[_0x148d('0x1d')](_0x5cbead);}};}function respondWithFilteredResult(_0x9b8172,_0x5ce18a){return function(_0x48e964){if(_0x48e964){var _0x1dc110=typeof _0x5ce18a[_0x148d('0x1e')]===_0x148d('0x1f')&&typeof _0x5ce18a['limit']===_0x148d('0x1f');var _0x8df34=_0x48e964[_0x148d('0x20')];var _0xaee6a0=_0x1dc110?0x0:_0x5ce18a['offset'];var _0x13029f=_0x1dc110?_0x48e964[_0x148d('0x20')]:_0x5ce18a[_0x148d('0x1e')]+_0x5ce18a[_0x148d('0x21')];var _0x914a33;if(_0x13029f>=_0x8df34){_0x13029f=_0x8df34;_0x914a33=0xc8;}else{_0x914a33=0xce;}_0x9b8172[_0x148d('0x1c')](_0x914a33);return _0x9b8172[_0x148d('0x22')](_0x148d('0x23'),_0xaee6a0+'-'+_0x13029f+'/'+_0x8df34)[_0x148d('0x1d')](_0x48e964);}return null;};}function patchUpdates(_0x2b0494){return function(_0x1fa796){try{jsonpatch[_0x148d('0x24')](_0x1fa796,_0x2b0494,!![]);}catch(_0x10e96e){return BPromise[_0x148d('0x25')](_0x10e96e);}return _0x1fa796[_0x148d('0x26')]();};}function saveUpdates(_0x487365,_0x19f773){return function(_0x10825d){if(_0x10825d){return _0x10825d['update'](_0x487365)['then'](function(_0x52819a){return _0x52819a;});}return null;};}function removeEntity(_0x4f8ba4,_0x2a9d7e){return function(_0x3028d7){if(_0x3028d7){return _0x3028d7[_0x148d('0x27')]()[_0x148d('0x28')](function(){var _0x40e522=_0x3028d7[_0x148d('0x29')]({'plain':!![]});var _0x368513=_0x148d('0x2a');return db[_0x148d('0x2b')][_0x148d('0x27')]({'where':{'type':_0x368513,'resourceId':_0x40e522['id']}})[_0x148d('0x28')](function(){return _0x3028d7;});})[_0x148d('0x28')](function(){_0x4f8ba4[_0x148d('0x1c')](0xcc)[_0x148d('0x2c')]();});}};}function handleEntityNotFound(_0x13a41a,_0x18955c){return function(_0x2190cb){if(!_0x2190cb){_0x13a41a['sendStatus'](0x194);}return _0x2190cb;};}function handleError(_0x48a001,_0x329eda){_0x329eda=_0x329eda||0x1f4;return function(_0x4f33d7){logger[_0x148d('0x2d')](_0x4f33d7['stack']);if(_0x4f33d7[_0x148d('0x2e')]){delete _0x4f33d7['name'];}_0x48a001[_0x148d('0x1c')](_0x329eda)['send'](_0x4f33d7);};}exports[_0x148d('0x2f')]=function(_0x5a7ae8,_0x2282b6){var _0xe6f5ca={},_0x350bd4={},_0x3eb2bb={'count':0x0,'rows':[]};var _0x13283f=_['map'](db[_0x148d('0x30')][_0x148d('0x31')],function(_0x288e8c){return{'name':_0x288e8c[_0x148d('0x32')],'type':_0x288e8c[_0x148d('0x33')]['key']};});_0x350bd4['model']=_[_0x148d('0x34')](_0x13283f,'name');_0x350bd4[_0x148d('0x35')]=_[_0x148d('0x36')](_0x5a7ae8[_0x148d('0x35')]);_0x350bd4[_0x148d('0x37')]=_['intersection'](_0x350bd4[_0x148d('0x38')],_0x350bd4[_0x148d('0x35')]);_0xe6f5ca[_0x148d('0x39')]=_[_0x148d('0x3a')](_0x350bd4[_0x148d('0x38')],qs[_0x148d('0x3b')](_0x5a7ae8[_0x148d('0x35')]['fields']));_0xe6f5ca['attributes']=_0xe6f5ca[_0x148d('0x39')]['length']?_0xe6f5ca[_0x148d('0x39')]:_0x350bd4['model'];if(!_0x5a7ae8['query'][_0x148d('0x3c')](_0x148d('0x3d'))){_0xe6f5ca['limit']=qs[_0x148d('0x21')](_0x5a7ae8['query'][_0x148d('0x21')]);_0xe6f5ca['offset']=qs['offset'](_0x5a7ae8[_0x148d('0x35')][_0x148d('0x1e')]);}_0xe6f5ca[_0x148d('0x3e')]=qs[_0x148d('0x3f')](_0x5a7ae8[_0x148d('0x35')][_0x148d('0x3f')]);_0xe6f5ca[_0x148d('0x40')]=qs[_0x148d('0x37')](_[_0x148d('0x41')](_0x5a7ae8['query'],_0x350bd4[_0x148d('0x37')]),_0x13283f);if(_0x5a7ae8[_0x148d('0x35')][_0x148d('0x42')]){_0xe6f5ca[_0x148d('0x40')]=_['merge'](_0xe6f5ca[_0x148d('0x40')],{'$or':_[_0x148d('0x34')](_0x13283f,function(_0x320b81){if(_0x320b81[_0x148d('0x33')]!==_0x148d('0x43')){var _0x4d4203={};_0x4d4203[_0x320b81['name']]={'$like':'%'+_0x5a7ae8['query'][_0x148d('0x42')]+'%'};return _0x4d4203;}})});}_0xe6f5ca=_[_0x148d('0x44')]({},_0xe6f5ca,_0x5a7ae8['options']);var _0x300eae={'where':_0xe6f5ca[_0x148d('0x40')]};return db['AnalyticCustomReport']['count'](_0x300eae)['then'](function(_0x3febd0){_0x3eb2bb[_0x148d('0x20')]=_0x3febd0;if(_0x5a7ae8[_0x148d('0x35')][_0x148d('0x45')]){_0xe6f5ca[_0x148d('0x46')]=[{'all':!![]}];}return db[_0x148d('0x30')][_0x148d('0x47')](_0xe6f5ca);})[_0x148d('0x28')](function(_0x12b3da){_0x3eb2bb[_0x148d('0x48')]=_0x12b3da;return _0x3eb2bb;})[_0x148d('0x28')](respondWithFilteredResult(_0x2282b6,_0xe6f5ca))[_0x148d('0x49')](handleError(_0x2282b6,null));};exports[_0x148d('0x4a')]=function(_0x11999e,_0x4c9d59){var _0x1e0ce1={'raw':![],'where':{'id':_0x11999e[_0x148d('0x4b')]['id']}},_0x116e65={};_0x116e65[_0x148d('0x38')]=_['keys'](db[_0x148d('0x30')]['rawAttributes']);_0x116e65[_0x148d('0x35')]=_[_0x148d('0x36')](_0x11999e[_0x148d('0x35')]);_0x116e65[_0x148d('0x37')]=_['intersection'](_0x116e65[_0x148d('0x38')],_0x116e65[_0x148d('0x35')]);_0x1e0ce1[_0x148d('0x39')]=_[_0x148d('0x3a')](_0x116e65[_0x148d('0x38')],qs[_0x148d('0x3b')](_0x11999e[_0x148d('0x35')][_0x148d('0x3b')]));_0x1e0ce1[_0x148d('0x39')]=_0x1e0ce1['attributes'][_0x148d('0x4c')]?_0x1e0ce1[_0x148d('0x39')]:_0x116e65[_0x148d('0x38')];if(_0x11999e['query'][_0x148d('0x45')]){_0x1e0ce1[_0x148d('0x46')]=[{'all':!![]}];}_0x1e0ce1=_[_0x148d('0x44')]({},_0x1e0ce1,_0x11999e[_0x148d('0x4d')]);return db[_0x148d('0x30')][_0x148d('0x4e')](_0x1e0ce1)[_0x148d('0x28')](handleEntityNotFound(_0x4c9d59,null))['then'](respondWithResult(_0x4c9d59,null))[_0x148d('0x49')](handleError(_0x4c9d59,null));};exports[_0x148d('0x4f')]=function(_0xdf167a,_0x4db442){return db[_0x148d('0x30')][_0x148d('0x4f')](_0xdf167a['body'],{})[_0x148d('0x28')](function(_0x45c564){var _0xe1e577=_0xdf167a['user'][_0x148d('0x29')]({'plain':!![]});if(!_0xe1e577)throw new Error(_0x148d('0x50'));if(_0xe1e577[_0x148d('0x51')]==='user'){var _0x363db4=_0x45c564[_0x148d('0x29')]({'plain':!![]});var _0x30c532=_0x148d('0x52');return db[_0x148d('0x53')][_0x148d('0x4e')]({'where':{'name':_0x30c532,'userProfileId':_0xe1e577[_0x148d('0x54')]},'raw':!![]})[_0x148d('0x28')](function(_0x75af19){if(_0x75af19&&_0x75af19[_0x148d('0x55')]===0x0){return db[_0x148d('0x2b')][_0x148d('0x4f')]({'name':_0x363db4[_0x148d('0x2e')],'resourceId':_0x363db4['id'],'type':_0x148d('0x2a'),'sectionId':_0x75af19['id']},{})[_0x148d('0x28')](function(){return _0x45c564;});}else{return _0x45c564;}})[_0x148d('0x49')](function(_0x185c3d){logger[_0x148d('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x185c3d);throw _0x185c3d;});}return _0x45c564;})[_0x148d('0x28')](respondWithResult(_0x4db442,0xc9))[_0x148d('0x49')](handleError(_0x4db442,null));};exports['update']=function(_0x369b22,_0x582351){if(_0x369b22['body']['id']){delete _0x369b22[_0x148d('0x56')]['id'];}return db[_0x148d('0x30')][_0x148d('0x4e')]({'where':{'id':_0x369b22[_0x148d('0x4b')]['id']}})[_0x148d('0x28')](handleEntityNotFound(_0x582351,null))[_0x148d('0x28')](saveUpdates(_0x369b22[_0x148d('0x56')],null))[_0x148d('0x28')](respondWithResult(_0x582351,null))[_0x148d('0x49')](handleError(_0x582351,null));};exports[_0x148d('0x27')]=function(_0x2651f4,_0x13043f){return db[_0x148d('0x30')][_0x148d('0x4e')]({'where':{'id':_0x2651f4[_0x148d('0x4b')]['id']}})[_0x148d('0x28')](handleEntityNotFound(_0x13043f,null))[_0x148d('0x28')](removeEntity(_0x13043f,null))[_0x148d('0x49')](handleError(_0x13043f,null));};exports[_0x148d('0x57')]=function(_0x520729,_0x3d91a7){var _0x103e63=0xa;var _0x4c2d6c=['join',_0x148d('0x58'),_0x148d('0x59'),_0x148d('0x5a')];var _0x5adece={'SUM':_0x148d('0x5b'),'COUNT':_0x148d('0x5c'),'COUNT DISTINCT':_0x148d('0x5d'),'MAX':_0x148d('0x5e'),'MIN':_0x148d('0x5f'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x148d('0x60'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x26b7e2={'SEC_TO_TIME':_0x148d('0x61'),'DATE':_0x148d('0x62'),'HOUR':_0x148d('0x63'),'ROUND':_0x148d('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x378bb6=function(_0x443114){return!_[_0x148d('0x65')]([_0x148d('0x66'),_0x148d('0x67'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x443114);};var _0x3bfa93=function(_0xcaf0c8){if(!_0xcaf0c8||!_0xcaf0c8[_0x148d('0x68')][_0x148d('0x4c')]){return'';}for(var _0x1d98dd='(',_0x326f5b=0x0;_0x326f5b<_0xcaf0c8[_0x148d('0x68')]['length'];_0x326f5b+=0x1){_0x326f5b>0x0&&(_0x1d98dd+='\x20'+_0xcaf0c8[_0x148d('0x69')]+'\x20');_0x1d98dd+=_0xcaf0c8['rules'][_0x326f5b][_0x148d('0x6a')]?_0x3bfa93(_0xcaf0c8[_0x148d('0x68')][_0x326f5b]['group']):_0xcaf0c8['rules'][_0x326f5b][_0x148d('0x6b')]+'\x20'+_0xcaf0c8['rules'][_0x326f5b]['condition']+(_0x378bb6(_0xcaf0c8[_0x148d('0x68')][_0x326f5b][_0x148d('0x6c')])?'\x20'+_0xcaf0c8[_0x148d('0x68')][_0x326f5b]['value']:'');}return _0x1d98dd+')';};var _0x5c4dc0={'where':{'id':_0x520729[_0x148d('0x4b')]['id']}},_0x509a90,_0x17934b,_0x25d13f,_0x4828cd,_0x274d64;_0x5c4dc0=_[_0x148d('0x44')]({},_0x5c4dc0,_0x520729[_0x148d('0x4d')]);return db[_0x148d('0x30')]['find'](_0x5c4dc0)['then'](function(_0x50bbe4){if(_0x50bbe4){_0x509a90=_0x50bbe4;return _0x50bbe4[_0x148d('0x6d')]();}return null;})[_0x148d('0x28')](function(_0x3850fd){if(_0x3850fd){if(!_0x3850fd[_0x148d('0x4c')]){throw new db[(_0x148d('0x6e'))][(_0x148d('0x6f'))](_0x148d('0x70'),0x193);}_0x17934b=_0x3850fd;return db['AnalyticMetric'][_0x148d('0x47')]({'raw':!![]});}return null;})[_0x148d('0x28')](function(_0x59dbc9){if(_0x59dbc9){_0x25d13f=_[_0x148d('0x71')](_0x59dbc9,'id');var _0x241c36;var _0x2e6d86=squel[_0x148d('0x72')]();_0x2e6d86['from'](_0x509a90['table']);for(var _0x141ac0=0x0;_0x141ac0<_0x17934b[_0x148d('0x4c')];_0x141ac0+=0x1){_0x241c36=_0x17934b[_0x141ac0][_0x148d('0x73')]?_0x25d13f[_0x17934b[_0x141ac0]['MetricId']][_0x148d('0x74')]:_0x17934b[_0x141ac0][_0x148d('0x6b')];_0x241c36=_0x17934b[_0x141ac0]['function']?_[_0x148d('0x75')](_0x5adece[_0x17934b[_0x141ac0][_0x148d('0x76')]],'%s',_0x241c36):_0x241c36;_0x241c36=_0x17934b[_0x141ac0][_0x148d('0x77')]?_['replace'](_0x26b7e2[_0x17934b[_0x141ac0][_0x148d('0x77')]],'%s',_0x241c36):_0x241c36;if(_0x17934b[_0x141ac0][_0x148d('0x78')]){_0x2e6d86[_0x148d('0x6a')](_0x241c36);}_0x17934b[_0x141ac0]['orderBy']&&_0x2e6d86['order'](_0x241c36,_0x17934b[_0x141ac0][_0x148d('0x79')]==='DESC'?![]:!![]);_0x2e6d86[_0x148d('0x6b')](_0x241c36,_0x17934b[_0x141ac0]['alias']||_0x241c36);}if(_0x509a90['joins']){_0x509a90['joins']=JSON[_0x148d('0x7a')](_0x509a90[_0x148d('0x7b')]);for(var _0x167b81=0x0;_0x167b81<_0x509a90[_0x148d('0x7b')][_0x148d('0x4c')];_0x167b81+=0x1){if(_0x509a90[_0x148d('0x7b')][_0x167b81][_0x148d('0x33')]&&_['includes'](_0x4c2d6c,_0x509a90[_0x148d('0x7b')][_0x167b81][_0x148d('0x33')])&&_0x509a90['joins'][_0x167b81][_0x148d('0x7c')]&&_0x509a90[_0x148d('0x7b')][_0x167b81][_0x148d('0x7d')]&&_0x509a90[_0x148d('0x7b')][_0x167b81][_0x148d('0x7e')]){_0x2e6d86[_0x509a90[_0x148d('0x7b')][_0x167b81][_0x148d('0x33')]](_0x509a90['joins'][_0x167b81][_0x148d('0x7d')],null,util['format'](_0x148d('0x7f'),_0x509a90[_0x148d('0x80')],_0x509a90['joins'][_0x167b81][_0x148d('0x7c')],_0x509a90[_0x148d('0x7b')][_0x167b81][_0x148d('0x7d')],_0x509a90['joins'][_0x167b81]['foreignKey']));}}}if(_0x509a90[_0x148d('0x81')]){_0x509a90[_0x148d('0x81')]=JSON['parse'](_0x509a90[_0x148d('0x81')]);_0x2e6d86[_0x148d('0x40')](_0x3bfa93(_0x509a90[_0x148d('0x81')][_0x148d('0x6a')]));}_0x274d64=_0x2e6d86[_0x148d('0x82')]();_0x2e6d86[_0x148d('0x21')](_0x103e63);_0x2e6d86[_0x148d('0x1e')](0x0);logger[_0x148d('0x83')](_0x148d('0x84'),_0x2e6d86[_0x148d('0x85')]());return dbH[_0x148d('0x86')][_0x148d('0x35')](_0x2e6d86[_0x148d('0x85')](),{'type':dbH[_0x148d('0x86')][_0x148d('0x87')][_0x148d('0x88')]});}})[_0x148d('0x28')](respondWithResult(_0x3d91a7,null))[_0x148d('0x49')](handleError(_0x3d91a7,null));};function runReport(_0x1a5d21,_0xc2da06,_0x420472){var _0x4d8c41=_0xc2da06[_0x148d('0x2e')];var _0x2383da=0xa;var _0x30cf1c=[_0x148d('0x89'),_0x148d('0x58'),_0x148d('0x59'),_0x148d('0x5a')];var _0x579fa0={'SUM':'SUM(%s)','COUNT':_0x148d('0x5c'),'COUNT DISTINCT':_0x148d('0x5d'),'MAX':_0x148d('0x5e'),'MIN':_0x148d('0x5f'),'AVG':_0x148d('0x8a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x148d('0x8b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x236dc1={'SEC_TO_TIME':_0x148d('0x61'),'DATE':_0x148d('0x62'),'HOUR':_0x148d('0x63'),'ROUND':_0x148d('0x64'),'UNIX_TIMESTAMP':_0x148d('0x8c')};var _0x227db7=function(_0x1aa0a8){return!_[_0x148d('0x65')]([_0x148d('0x66'),_0x148d('0x67'),_0x148d('0x8d'),_0x148d('0x8e')],_0x1aa0a8);};var _0x135b72=function(_0x408833){if(!_0x408833||!_0x408833['rules'][_0x148d('0x4c')]){return'';}for(var _0x22e85c='(',_0x483931=0x0;_0x483931<_0x408833['rules'][_0x148d('0x4c')];_0x483931+=0x1){_0x483931>0x0&&(_0x22e85c+='\x20'+_0x408833['operator']+'\x20');_0x22e85c+=_0x408833[_0x148d('0x68')][_0x483931][_0x148d('0x6a')]?_0x135b72(_0x408833[_0x148d('0x68')][_0x483931][_0x148d('0x6a')]):_0x408833[_0x148d('0x68')][_0x483931][_0x148d('0x6b')]+'\x20'+_0x408833[_0x148d('0x68')][_0x483931][_0x148d('0x6c')]+(_0x227db7(_0x408833[_0x148d('0x68')][_0x483931][_0x148d('0x6c')])?'\x20'+_0x408833['rules'][_0x483931][_0x148d('0x8f')]:'');}return _0x22e85c+')';};var _0x3a7091={'where':{'id':_0x1a5d21['id']}},_0xfc8ad0,_0x54b061,_0x1c81f3,_0x5c8486,_0x19e820;_0x3a7091=_[_0x148d('0x44')]({},_0x3a7091,_0x420472);return db['AnalyticCustomReport'][_0x148d('0x4e')](_0x3a7091)[_0x148d('0x28')](function(_0x17bc13){if(_0x17bc13){_0xfc8ad0=_0x17bc13;return _0x17bc13[_0x148d('0x6d')]();}return null;})['then'](function(_0x2f6b98){if(_0x2f6b98){if(!_0x2f6b98[_0x148d('0x4c')]){throw new db[(_0x148d('0x6e'))][(_0x148d('0x6f'))](_0x148d('0x70'),0x193);}_0x54b061=_0x2f6b98;return db[_0x148d('0x90')][_0x148d('0x47')]({'raw':!![]});}return null;})[_0x148d('0x28')](function(_0x5bb641){if(_0x5bb641){_0x1c81f3=_[_0x148d('0x71')](_0x5bb641,'id');var _0x2caa26;var _0x2fcd8b=squel['select']();_0x2fcd8b[_0x148d('0x91')](_0xfc8ad0[_0x148d('0x80')]);for(var _0x4b7631=0x0;_0x4b7631<_0x54b061[_0x148d('0x4c')];_0x4b7631+=0x1){_0x2caa26=_0x54b061[_0x4b7631][_0x148d('0x73')]?_0x1c81f3[_0x54b061[_0x4b7631][_0x148d('0x73')]][_0x148d('0x74')]:_0x54b061[_0x4b7631][_0x148d('0x6b')];_0x2caa26=_0x54b061[_0x4b7631][_0x148d('0x76')]?_['replace'](_0x579fa0[_0x54b061[_0x4b7631][_0x148d('0x76')]],'%s',_0x2caa26):_0x2caa26;_0x2caa26=_0x54b061[_0x4b7631][_0x148d('0x77')]?_[_0x148d('0x75')](_0x236dc1[_0x54b061[_0x4b7631][_0x148d('0x77')]],'%s',_0x2caa26):_0x2caa26;if(_0x54b061[_0x4b7631][_0x148d('0x78')]){_0x2fcd8b[_0x148d('0x6a')](_0x2caa26);}_0x54b061[_0x4b7631][_0x148d('0x79')]&&_0x2fcd8b[_0x148d('0x3e')](_0x2caa26,_0x54b061[_0x4b7631]['orderBy']===_0x148d('0x92')?![]:!![]);_0x2fcd8b[_0x148d('0x6b')](_0x2caa26,_0x54b061[_0x4b7631][_0x148d('0x93')]||_0x2caa26);}if(_0xfc8ad0['joins']){_0xfc8ad0[_0x148d('0x7b')]=JSON[_0x148d('0x7a')](_0xfc8ad0[_0x148d('0x7b')]);for(var _0x2d73c8=0x0;_0x2d73c8<_0xfc8ad0[_0x148d('0x7b')][_0x148d('0x4c')];_0x2d73c8+=0x1){if(_0xfc8ad0[_0x148d('0x7b')][_0x2d73c8][_0x148d('0x33')]&&_['includes'](_0x30cf1c,_0xfc8ad0[_0x148d('0x7b')][_0x2d73c8][_0x148d('0x33')])&&_0xfc8ad0['joins'][_0x2d73c8][_0x148d('0x7c')]&&_0xfc8ad0['joins'][_0x2d73c8][_0x148d('0x7d')]&&_0xfc8ad0[_0x148d('0x7b')][_0x2d73c8][_0x148d('0x7e')]){_0x2fcd8b[_0xfc8ad0[_0x148d('0x7b')][_0x2d73c8][_0x148d('0x33')]](_0xfc8ad0[_0x148d('0x7b')][_0x2d73c8][_0x148d('0x7d')],null,util['format'](_0x148d('0x7f'),_0xfc8ad0[_0x148d('0x80')],_0xfc8ad0[_0x148d('0x7b')][_0x2d73c8][_0x148d('0x7c')],_0xfc8ad0['joins'][_0x2d73c8][_0x148d('0x7d')],_0xfc8ad0[_0x148d('0x7b')][_0x2d73c8]['foreignKey']));}}}if(_0xfc8ad0[_0x148d('0x81')]){_0xfc8ad0['conditions']=JSON['parse'](_0xfc8ad0[_0x148d('0x81')]);_0x2fcd8b[_0x148d('0x40')](_0x135b72(_0xfc8ad0[_0x148d('0x81')][_0x148d('0x6a')]));}_0x19e820=_0x2fcd8b[_0x148d('0x82')]();_0x2fcd8b['limit'](_0x2383da);_0x2fcd8b['offset'](0x0);return;}})['then'](function(){if(_0xc2da06[_0x148d('0x94')]===_0x148d('0x95')){return null;}var _0x3646f6=_[_0x148d('0x44')](_0xc2da06,{'name':_0xc2da06[_0x148d('0x96')]||_0xc2da06[_0x148d('0x2e')]||_0xfc8ad0['name'],'basename':_0x4d8c41,'savename':util[_0x148d('0x77')](_0x148d('0x97'),_0xc2da06[_0x148d('0x2e')]||_0xfc8ad0['name'],require(_0x148d('0x98'))['generate'](0x4),_0xc2da06[_0x148d('0x94')]||_0x148d('0x99')),'reportId':_0xfc8ad0['id'],'reportType':_0x148d('0x9a')});return db[_0x148d('0x9b')][_0x148d('0x4f')](_0x3646f6,{'raw':!![]});})[_0x148d('0x28')](function(_0x3e31d0){if(_0xfc8ad0['table']===_0x148d('0x9c')){_0x19e820['where'](_0xfc8ad0[_0x148d('0x80')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xc2da06['startDate'],_0xc2da06[_0x148d('0x9d')]);}else{_0x19e820[_0x148d('0x40')](_0xfc8ad0[_0x148d('0x80')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xc2da06[_0x148d('0x9e')],_0xc2da06['endDate']);}if(_0x3e31d0){logger[_0x148d('0x9f')]('Run\x20Query:',_0x19e820['toString']());require(_0x148d('0xa0'))[_0x148d('0xa1')](path[_0x148d('0x89')](__dirname,_0x148d('0xa2'),_0x3e31d0[_0x148d('0x94')]),[_0x3e31d0['id'],_0x19e820[_0x148d('0x85')](),path[_0x148d('0x89')](__dirname,_0x148d('0xa3'),_0x3e31d0[_0x148d('0xa4')]),_0x4d8c41]);return _0x3e31d0;}else{var _0x1aec50=squel['select']();_0x1aec50[_0x148d('0x91')]('('+_0x19e820[_0x148d('0x85')]()+')',_0x148d('0xa5'));_0x1aec50[_0x148d('0x6b')](_0x148d('0xa6'),'count');_0x19e820[_0x148d('0x21')](_0xc2da06['limit']||_0x2383da);_0x19e820[_0x148d('0x1e')](_0xc2da06[_0x148d('0x1e')]||0x0);return dbH[_0x148d('0x86')][_0x148d('0x35')](_0x1aec50['toString'](),{'type':dbH['sequelize']['QueryTypes']['SELECT']})[_0x148d('0x28')](function(_0xedfbef){if(!_0xedfbef['length']){_0x5c8486=0x0;}else{_0x5c8486=_0xedfbef[0x0]['count']||0x0;}return dbH[_0x148d('0x86')][_0x148d('0x35')](_0x19e820[_0x148d('0x85')](),{'type':dbH['sequelize'][_0x148d('0x87')]['SELECT']});})[_0x148d('0x28')](function(_0xfe18e0){return{'rows':_0xfe18e0||[],'count':_0x5c8486};});}});}exports['run']=function(_0xaf65cf,_0xa2b52f){return runReport(_0xaf65cf[_0x148d('0x4b')],_0xaf65cf[_0x148d('0x35')],_0xaf65cf[_0x148d('0x4d')])['then'](respondWithResult(_0xa2b52f,null))[_0x148d('0x49')](handleError(_0xa2b52f,null));};exports[_0x148d('0xa7')]=runReport;exports['query']=function(_0x526936,_0xb9460e){var _0x5e5e57=0xa;var _0xdc1e79=['join','left_join',_0x148d('0x59'),_0x148d('0x5a')];var _0x42183e={'SUM':_0x148d('0x5b'),'COUNT':_0x148d('0x5c'),'COUNT DISTINCT':_0x148d('0x5d'),'MAX':_0x148d('0x5e'),'MIN':_0x148d('0x5f'),'AVG':_0x148d('0x8a'),'GROUP_CONCAT':_0x148d('0x60'),'GROUP_CONCAT ASC':_0x148d('0x8b'),'GROUP_CONCAT DESC':_0x148d('0xa8')};var _0x53dcdc={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x148d('0x62'),'HOUR':_0x148d('0x63'),'ROUND':_0x148d('0x64'),'UNIX_TIMESTAMP':_0x148d('0x8c')};var _0x17c957=function(_0x232927){return!_[_0x148d('0x65')](['IS\x20NULL',_0x148d('0x67'),'IS\x20EMPTY',_0x148d('0x8e')],_0x232927);};var _0x2c94d6=function(_0xf4d63b){if(!_0xf4d63b||!_0xf4d63b[_0x148d('0x68')][_0x148d('0x4c')]){return'';}for(var _0x25176a='(',_0x304f38=0x0;_0x304f38<_0xf4d63b[_0x148d('0x68')][_0x148d('0x4c')];_0x304f38+=0x1){_0x304f38>0x0&&(_0x25176a+='\x20'+_0xf4d63b[_0x148d('0x69')]+'\x20');_0x25176a+=_0xf4d63b[_0x148d('0x68')][_0x304f38][_0x148d('0x6a')]?_0x2c94d6(_0xf4d63b[_0x148d('0x68')][_0x304f38][_0x148d('0x6a')]):_0xf4d63b[_0x148d('0x68')][_0x304f38][_0x148d('0x6b')]+'\x20'+_0xf4d63b[_0x148d('0x68')][_0x304f38][_0x148d('0x6c')]+(_0x17c957(_0xf4d63b[_0x148d('0x68')][_0x304f38]['condition'])?'\x20'+_0xf4d63b['rules'][_0x304f38][_0x148d('0x8f')]:'');}return _0x25176a+')';};var _0x3ca41a={'where':{'id':_0x526936[_0x148d('0x4b')]['id']}},_0x2891c9,_0x39873f,_0x1873de,_0x321bd4,_0x479694;_0x3ca41a=_[_0x148d('0x44')]({},_0x3ca41a,_0x526936[_0x148d('0x4d')]);return db['AnalyticCustomReport'][_0x148d('0x4e')](_0x3ca41a)['then'](function(_0x1cfdec){if(_0x1cfdec){_0x2891c9=_0x1cfdec;return _0x1cfdec[_0x148d('0x6d')]();}return null;})[_0x148d('0x28')](function(_0x2ded96){if(_0x2ded96){if(!_0x2ded96['length']){throw new db[(_0x148d('0x6e'))]['ValidationErrorItem'](_0x148d('0x70'),0x193);}_0x39873f=_0x2ded96;return db['AnalyticMetric'][_0x148d('0x47')]({'raw':!![]});}return null;})[_0x148d('0x28')](function(_0x27d563){if(_0x27d563){_0x1873de=_['keyBy'](_0x27d563,'id');var _0x45e866;var _0x4ce5b7=squel['select']();_0x4ce5b7['from'](_0x2891c9[_0x148d('0x80')]);for(var _0x131e12=0x0;_0x131e12<_0x39873f[_0x148d('0x4c')];_0x131e12+=0x1){_0x45e866=_0x39873f[_0x131e12][_0x148d('0x73')]?_0x1873de[_0x39873f[_0x131e12]['MetricId']][_0x148d('0x74')]:_0x39873f[_0x131e12][_0x148d('0x6b')];_0x45e866=_0x39873f[_0x131e12][_0x148d('0x76')]?_[_0x148d('0x75')](_0x42183e[_0x39873f[_0x131e12][_0x148d('0x76')]],'%s',_0x45e866):_0x45e866;_0x45e866=_0x39873f[_0x131e12][_0x148d('0x77')]?_[_0x148d('0x75')](_0x53dcdc[_0x39873f[_0x131e12][_0x148d('0x77')]],'%s',_0x45e866):_0x45e866;if(_0x39873f[_0x131e12][_0x148d('0x78')]){_0x4ce5b7[_0x148d('0x6a')](_0x45e866);}_0x39873f[_0x131e12][_0x148d('0x79')]&&_0x4ce5b7['order'](_0x45e866,_0x39873f[_0x131e12][_0x148d('0x79')]===_0x148d('0x92')?![]:!![]);_0x4ce5b7[_0x148d('0x6b')](_0x45e866,_0x39873f[_0x131e12][_0x148d('0x93')]||_0x45e866);}if(_0x2891c9[_0x148d('0x7b')]){_0x2891c9[_0x148d('0x7b')]=JSON['parse'](_0x2891c9[_0x148d('0x7b')]);for(var _0x13764d=0x0;_0x13764d<_0x2891c9[_0x148d('0x7b')][_0x148d('0x4c')];_0x13764d+=0x1){if(_0x2891c9[_0x148d('0x7b')][_0x13764d][_0x148d('0x33')]&&_['includes'](_0xdc1e79,_0x2891c9['joins'][_0x13764d][_0x148d('0x33')])&&_0x2891c9[_0x148d('0x7b')][_0x13764d][_0x148d('0x7c')]&&_0x2891c9[_0x148d('0x7b')][_0x13764d][_0x148d('0x7d')]&&_0x2891c9[_0x148d('0x7b')][_0x13764d][_0x148d('0x7e')]){_0x4ce5b7[_0x2891c9[_0x148d('0x7b')][_0x13764d][_0x148d('0x33')]](_0x2891c9[_0x148d('0x7b')][_0x13764d][_0x148d('0x7d')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x2891c9[_0x148d('0x80')],_0x2891c9[_0x148d('0x7b')][_0x13764d][_0x148d('0x7c')],_0x2891c9[_0x148d('0x7b')][_0x13764d][_0x148d('0x7d')],_0x2891c9[_0x148d('0x7b')][_0x13764d][_0x148d('0x7e')]));}}}if(_0x2891c9['conditions']){_0x2891c9['conditions']=JSON[_0x148d('0x7a')](_0x2891c9[_0x148d('0x81')]);_0x4ce5b7[_0x148d('0x40')](_0x2c94d6(_0x2891c9[_0x148d('0x81')][_0x148d('0x6a')]));}_0x479694=_0x4ce5b7['clone']();_0x4ce5b7['limit'](_0x5e5e57);_0x4ce5b7['offset'](0x0);logger[_0x148d('0x83')](_0x148d('0x84'),_0x4ce5b7[_0x148d('0x85')]());return dbH['sequelize'][_0x148d('0x35')](_0x4ce5b7['toString'](),{'type':dbH[_0x148d('0x86')]['QueryTypes'][_0x148d('0x88')]});}})[_0x148d('0x28')](function(){return{'sql':_0x479694[_0x148d('0x85')]()};})[_0x148d('0x28')](respondWithResult(_0xb9460e,null))[_0x148d('0x49')](handleError(_0xb9460e,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 59d5de5..747317d 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 _0xc629=['util','api','moment','path','rimraf','../../config/environment','exports','define','AnalyticCustomReport','lodash'];(function(_0x475bf1,_0x5235b6){var _0x4095d1=function(_0x30fe72){while(--_0x30fe72){_0x475bf1['push'](_0x475bf1['shift']());}};_0x4095d1(++_0x5235b6);}(_0xc629,0x153));var _0x9c62=function(_0x201309,_0x536c9d){_0x201309=_0x201309-0x0;var _0x4be513=_0xc629[_0x201309];return _0x4be513;};'use strict';var _=require(_0x9c62('0x0'));var util=require(_0x9c62('0x1'));var logger=require('../../config/logger')(_0x9c62('0x2'));var moment=require(_0x9c62('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c62('0x4'));var rimraf=require(_0x9c62('0x5'));var config=require(_0x9c62('0x6'));var attributes=require('./analyticCustomReport.attributes');module[_0x9c62('0x7')]=function(_0x4490b6,_0x2cc272){return _0x4490b6[_0x9c62('0x8')](_0x9c62('0x9'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8f55=['path','../../config/environment','./analyticCustomReport.attributes','exports','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x250c81,_0x1d0eb4){var _0x12d6fc=function(_0x5466b7){while(--_0x5466b7){_0x250c81['push'](_0x250c81['shift']());}};_0x12d6fc(++_0x1d0eb4);}(_0x8f55,0x109));var _0x58f5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8f55[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x58f5('0x0'));var util=require(_0x58f5('0x1'));var logger=require(_0x58f5('0x2'))('api');var moment=require('moment');var BPromise=require(_0x58f5('0x3'));var rp=require(_0x58f5('0x4'));var fs=require('fs');var path=require(_0x58f5('0x5'));var rimraf=require('rimraf');var config=require(_0x58f5('0x6'));var attributes=require(_0x58f5('0x7'));module[_0x58f5('0x8')]=function(_0x1563ec,_0x28db1f){return _0x1563ec['define']('AnalyticCustomReport',attributes,{'tableName':'analytics_custom_reports','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 15b0f9e..eb009d2 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 _0xe4a6=['../../config/environment','client','http','then','AnalyticCustomReport,\x20%s,\x20%s','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x25a0f0,_0x54f2d8){var _0x25846c=function(_0x443b0b){while(--_0x443b0b){_0x25a0f0['push'](_0x25a0f0['shift']());}};_0x25846c(++_0x54f2d8);}(_0xe4a6,0x141));var _0x6e4a=function(_0xdabd59,_0x55e984){_0xdabd59=_0xdabd59-0x0;var _0x4af920=_0xe4a6[_0xdabd59];return _0x4af920;};'use strict';var _=require(_0x6e4a('0x0'));var util=require(_0x6e4a('0x1'));var moment=require(_0x6e4a('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e4a('0x3'));var fs=require('fs');var Redis=require(_0x6e4a('0x4'));var db=require(_0x6e4a('0x5'))['db'];var utils=require(_0x6e4a('0x6'));var logger=require(_0x6e4a('0x7'))(_0x6e4a('0x8'));var config=require(_0x6e4a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6e4a('0xa')][_0x6e4a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d12d8,_0x58425d,_0x360375){return new BPromise(function(_0x5b1ec0,_0x3ec504){return client['request'](_0x4d12d8,_0x360375)[_0x6e4a('0xc')](function(_0x5b010f){logger['info'](_0x6e4a('0xd'),_0x58425d,'request\x20sent');logger['debug'](_0x6e4a('0xe'),_0x58425d,_0x6e4a('0xf'),JSON[_0x6e4a('0x10')](_0x5b010f));if(_0x5b010f[_0x6e4a('0x11')]){if(_0x5b010f['error']['code']===0x1f4){logger['error'](_0x6e4a('0xd'),_0x58425d,_0x5b010f[_0x6e4a('0x11')][_0x6e4a('0x12')]);return _0x3ec504(_0x5b010f[_0x6e4a('0x11')]['message']);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x58425d,_0x5b010f[_0x6e4a('0x11')][_0x6e4a('0x12')]);return _0x5b1ec0(_0x5b010f['error'][_0x6e4a('0x12')]);}else{logger[_0x6e4a('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x58425d,_0x6e4a('0xf'));_0x5b1ec0(_0x5b010f[_0x6e4a('0x14')][_0x6e4a('0x12')]);}})[_0x6e4a('0x15')](function(_0x5d0c1d){logger[_0x6e4a('0x11')](_0x6e4a('0xd'),_0x58425d,_0x5d0c1d);_0x3ec504(_0x5d0c1d);});});}
\ No newline at end of file
+var _0x3715=['info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x58be83,_0x5f5526){var _0x12dadb=function(_0x358c26){while(--_0x358c26){_0x58be83['push'](_0x58be83['shift']());}};_0x12dadb(++_0x5f5526);}(_0x3715,0xc3));var _0x5371=function(_0x3efefc,_0xf9f2e0){_0x3efefc=_0x3efefc-0x0;var _0x1cdabe=_0x3715[_0x3efefc];return _0x1cdabe;};'use strict';var _=require(_0x5371('0x0'));var util=require(_0x5371('0x1'));var moment=require(_0x5371('0x2'));var BPromise=require(_0x5371('0x3'));var rs=require(_0x5371('0x4'));var fs=require('fs');var Redis=require(_0x5371('0x5'));var db=require(_0x5371('0x6'))['db'];var utils=require(_0x5371('0x7'));var logger=require(_0x5371('0x8'))(_0x5371('0x9'));var config=require(_0x5371('0xa'));var jayson=require(_0x5371('0xb'));var client=jayson['client'][_0x5371('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x340e44,_0x5edddc,_0x426a2a){return new BPromise(function(_0x16c64a,_0x41d142){return client['request'](_0x340e44,_0x426a2a)[_0x5371('0xd')](function(_0x48b76c){logger['info'](_0x5371('0xe'),_0x5edddc,_0x5371('0xf'));logger[_0x5371('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x5edddc,_0x5371('0xf'),JSON[_0x5371('0x11')](_0x48b76c));if(_0x48b76c[_0x5371('0x12')]){if(_0x48b76c['error'][_0x5371('0x13')]===0x1f4){logger[_0x5371('0x12')](_0x5371('0xe'),_0x5edddc,_0x48b76c[_0x5371('0x12')]['message']);return _0x41d142(_0x48b76c[_0x5371('0x12')]['message']);}logger[_0x5371('0x12')](_0x5371('0xe'),_0x5edddc,_0x48b76c['error'][_0x5371('0x14')]);return _0x16c64a(_0x48b76c[_0x5371('0x12')][_0x5371('0x14')]);}else{logger[_0x5371('0x15')](_0x5371('0xe'),_0x5edddc,_0x5371('0xf'));_0x16c64a(_0x48b76c[_0x5371('0x16')]['message']);}})[_0x5371('0x17')](function(_0x3e7169){logger[_0x5371('0x12')](_0x5371('0xe'),_0x5edddc,_0x3e7169);_0x41d142(_0x3e7169);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 06eba59..4536d2c 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 _0xda74=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','/:id','get','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','delete','destroy','exports','util'];(function(_0x28e5dd,_0x46f8b9){var _0x48dda8=function(_0x420781){while(--_0x420781){_0x28e5dd['push'](_0x28e5dd['shift']());}};_0x48dda8(++_0x46f8b9);}(_0xda74,0x1f3));var _0x4da7=function(_0x26aebd,_0x156290){_0x26aebd=_0x26aebd-0x0;var _0x7fa406=_0xda74[_0x26aebd];return _0x7fa406;};'use strict';var multer=require('multer');var util=require(_0x4da7('0x0'));var path=require(_0x4da7('0x1'));var timeout=require(_0x4da7('0x2'));var express=require(_0x4da7('0x3'));var router=express[_0x4da7('0x4')]();var fs_extra=require(_0x4da7('0x5'));var auth=require(_0x4da7('0x6'));var interaction=require(_0x4da7('0x7'));var config=require(_0x4da7('0x8'));var controller=require(_0x4da7('0x9'));router['get']('/',auth[_0x4da7('0xa')](),controller['index']);router['get'](_0x4da7('0xb'),auth[_0x4da7('0xa')](),controller['show']);router[_0x4da7('0xc')](_0x4da7('0xd'),auth['isAuthenticated'](),controller[_0x4da7('0xe')]);router[_0x4da7('0xc')](_0x4da7('0xf'),auth[_0x4da7('0xa')](),controller[_0x4da7('0x10')]);router['get'](_0x4da7('0x11'),auth[_0x4da7('0xa')](),controller[_0x4da7('0x12')]);router[_0x4da7('0x13')]('/',auth[_0x4da7('0xa')](),controller[_0x4da7('0x14')]);router[_0x4da7('0x15')](_0x4da7('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x4da7('0x16')](_0x4da7('0xb'),auth[_0x4da7('0xa')](),controller[_0x4da7('0x17')]);module[_0x4da7('0x18')]=router;
\ No newline at end of file
+var _0xbca8=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','/:id/query','query','post','create','put','/:id','update','destroy','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x47a0cd,_0x223224){var _0x21ad28=function(_0x3cf29f){while(--_0x3cf29f){_0x47a0cd['push'](_0x47a0cd['shift']());}};_0x21ad28(++_0x223224);}(_0xbca8,0x1c2));var _0x8bca=function(_0x552feb,_0x41ac88){_0x552feb=_0x552feb-0x0;var _0x21324b=_0xbca8[_0x552feb];return _0x21324b;};'use strict';var multer=require(_0x8bca('0x0'));var util=require(_0x8bca('0x1'));var path=require(_0x8bca('0x2'));var timeout=require(_0x8bca('0x3'));var express=require('express');var router=express[_0x8bca('0x4')]();var fs_extra=require(_0x8bca('0x5'));var auth=require(_0x8bca('0x6'));var interaction=require(_0x8bca('0x7'));var config=require(_0x8bca('0x8'));var controller=require('./analyticCustomReport.controller');router[_0x8bca('0x9')]('/',auth[_0x8bca('0xa')](),controller[_0x8bca('0xb')]);router[_0x8bca('0x9')]('/:id',auth[_0x8bca('0xa')](),controller[_0x8bca('0xc')]);router[_0x8bca('0x9')](_0x8bca('0xd'),auth[_0x8bca('0xa')](),controller[_0x8bca('0xe')]);router[_0x8bca('0x9')](_0x8bca('0xf'),auth[_0x8bca('0xa')](),controller['run']);router['get'](_0x8bca('0x10'),auth[_0x8bca('0xa')](),controller[_0x8bca('0x11')]);router[_0x8bca('0x12')]('/',auth[_0x8bca('0xa')](),controller[_0x8bca('0x13')]);router[_0x8bca('0x14')](_0x8bca('0x15'),auth[_0x8bca('0xa')](),controller[_0x8bca('0x16')]);router['delete']('/:id',auth[_0x8bca('0xa')](),controller[_0x8bca('0x17')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 4bc4a2c..ee6aaa3 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 _0x24ca=['sequelize','STRING','TEXT'];(function(_0x5d289a,_0x352880){var _0x14bd5f=function(_0x268766){while(--_0x268766){_0x5d289a['push'](_0x5d289a['shift']());}};_0x14bd5f(++_0x352880);}(_0x24ca,0x1bc));var _0xa24c=function(_0x562f3b,_0x4c65ae){_0x562f3b=_0x562f3b-0x0;var _0x1edd55=_0x24ca[_0x562f3b];return _0x1edd55;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'name':{'type':Sequelize[_0xa24c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa24c('0x1')]},'parent':{'type':Sequelize[_0xa24c('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xa24c('0x2')]},'joins':{'type':Sequelize[_0xa24c('0x2')]}};
\ No newline at end of file
+var _0xdc97=['exports','STRING','TEXT','sequelize'];(function(_0x510b98,_0x4c4cbb){var _0x45e775=function(_0x29ec11){while(--_0x29ec11){_0x510b98['push'](_0x510b98['shift']());}};_0x45e775(++_0x4c4cbb);}(_0xdc97,0x13b));var _0x7dc9=function(_0x44cf01,_0x7d90b7){_0x44cf01=_0x44cf01-0x0;var _0x42900b=_0xdc97[_0x44cf01];return _0x42900b;};'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
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index b215286..c3fc612 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 _0x187d=['fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','limit','undefined','count','offset','set','json','save','update','then','get','destroy','error','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','keys','filters','intersection','query','fields','attributes','order','sort','filter','where','merge','options','includeAll','rows','catch','include','create','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','length','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','findAll','keyBy','from','table','MetricId','metric','replace','format','groupBy','orderBy','field','alias','joins','parse','parentKey','foreignKey','foreignTable','conditions','clone','Limited\x20Query:','toString','sequelize','SELECT','join','IS\x20EMPTY','operator','AnalyticMetric','function','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','savename','select','countTable','QueryTypes','runReport','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs'];(function(_0x4a6efd,_0x14bb86){var _0x5c915e=function(_0x463b3e){while(--_0x463b3e){_0x4a6efd['push'](_0x4a6efd['shift']());}};_0x5c915e(++_0x14bb86);}(_0x187d,0x93));var _0xd187=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x187d[_0x2cf2e9];return _0xd3670d;};'use strict';var emlformat=require(_0xd187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd187('0x1'));var jsonpatch=require(_0xd187('0x2'));var rp=require(_0xd187('0x3'));var moment=require(_0xd187('0x4'));var BPromise=require(_0xd187('0x5'));var Mustache=require(_0xd187('0x6'));var util=require('util');var path=require(_0xd187('0x7'));var sox=require(_0xd187('0x8'));var csv=require('to-csv');var ejs=require(_0xd187('0x9'));var fs=require('fs');var fs_extra=require(_0xd187('0xa'));var _=require(_0xd187('0xb'));var squel=require(_0xd187('0xc'));var crypto=require(_0xd187('0xd'));var jsforce=require(_0xd187('0xe'));var deskjs=require(_0xd187('0xf'));var toCsv=require(_0xd187('0x10'));var querystring=require('querystring');var Papa=require(_0xd187('0x11'));var Redis=require(_0xd187('0x12'));var authService=require(_0xd187('0x13'));var qs=require(_0xd187('0x14'));var as=require(_0xd187('0x15'));var hardwareService=require(_0xd187('0x16'));var logger=require('../../config/logger')(_0xd187('0x17'));var utils=require(_0xd187('0x18'));var config=require(_0xd187('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd187('0x1a'))['db'];var dbH=require(_0xd187('0x1a'))[_0xd187('0x1b')];function respondWithStatusCode(_0x59ee4a,_0x33e3d5){_0x33e3d5=_0x33e3d5||0xcc;return function(_0x18ce42){if(_0x18ce42){return _0x59ee4a[_0xd187('0x1c')](_0x33e3d5);}return _0x59ee4a[_0xd187('0x1d')](_0x33e3d5)['end']();};}function respondWithResult(_0x39a927,_0x2050d5){_0x2050d5=_0x2050d5||0xc8;return function(_0x45ab10){if(_0x45ab10){return _0x39a927[_0xd187('0x1d')](_0x2050d5)['json'](_0x45ab10);}};}function respondWithFilteredResult(_0x245d3e,_0x52a208){return function(_0x5cf218){if(_0x5cf218){var _0x40ed84=typeof _0x52a208['offset']==='undefined'&&typeof _0x52a208[_0xd187('0x1e')]===_0xd187('0x1f');var _0x374fe0=_0x5cf218[_0xd187('0x20')];var _0x21df74=_0x40ed84?0x0:_0x52a208[_0xd187('0x21')];var _0x12b388=_0x40ed84?_0x5cf218[_0xd187('0x20')]:_0x52a208[_0xd187('0x21')]+_0x52a208[_0xd187('0x1e')];var _0x170d5c;if(_0x12b388>=_0x374fe0){_0x12b388=_0x374fe0;_0x170d5c=0xc8;}else{_0x170d5c=0xce;}_0x245d3e[_0xd187('0x1d')](_0x170d5c);return _0x245d3e[_0xd187('0x22')]('Content-Range',_0x21df74+'-'+_0x12b388+'/'+_0x374fe0)[_0xd187('0x23')](_0x5cf218);}return null;};}function patchUpdates(_0x81b988){return function(_0xc5bba5){try{jsonpatch['apply'](_0xc5bba5,_0x81b988,!![]);}catch(_0x5a0360){return BPromise['reject'](_0x5a0360);}return _0xc5bba5[_0xd187('0x24')]();};}function saveUpdates(_0x33741d,_0x249a82){return function(_0x4f62c8){if(_0x4f62c8){return _0x4f62c8[_0xd187('0x25')](_0x33741d)['then'](function(_0x145771){return _0x145771;});}return null;};}function removeEntity(_0x5a7a23,_0x1047f4){return function(_0x54f340){if(_0x54f340){return _0x54f340['destroy']()[_0xd187('0x26')](function(){var _0x4d992b=_0x54f340[_0xd187('0x27')]({'plain':!![]});var _0x598aa4='DefaultReports';return db['UserProfileResource'][_0xd187('0x28')]({'where':{'type':_0x598aa4,'resourceId':_0x4d992b['id']}})[_0xd187('0x26')](function(){return _0x54f340;});})[_0xd187('0x26')](function(){_0x5a7a23[_0xd187('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a20ed,_0x2875c8){return function(_0x5c8e52){if(!_0x5c8e52){_0x2a20ed[_0xd187('0x1c')](0x194);}return _0x5c8e52;};}function handleError(_0x1c87ee,_0x34febe){_0x34febe=_0x34febe||0x1f4;return function(_0x4c50a5){logger[_0xd187('0x29')](_0x4c50a5['stack']);if(_0x4c50a5[_0xd187('0x2a')]){delete _0x4c50a5[_0xd187('0x2a')];}_0x1c87ee[_0xd187('0x1d')](_0x34febe)[_0xd187('0x2b')](_0x4c50a5);};}exports['index']=function(_0x140e54,_0xb38778){var _0x5bba10={},_0x4cc587={},_0x1a1922={'count':0x0,'rows':[]};var _0x1836cf=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x2d8843){return{'name':_0x2d8843[_0xd187('0x2f')],'type':_0x2d8843[_0xd187('0x30')]['key']};});_0x4cc587[_0xd187('0x31')]=_[_0xd187('0x2c')](_0x1836cf,_0xd187('0x2a'));_0x4cc587['query']=_[_0xd187('0x32')](_0x140e54['query']);_0x4cc587[_0xd187('0x33')]=_[_0xd187('0x34')](_0x4cc587[_0xd187('0x31')],_0x4cc587['query']);_0x5bba10['attributes']=_[_0xd187('0x34')](_0x4cc587[_0xd187('0x31')],qs['fields'](_0x140e54[_0xd187('0x35')][_0xd187('0x36')]));_0x5bba10[_0xd187('0x37')]=_0x5bba10['attributes']['length']?_0x5bba10[_0xd187('0x37')]:_0x4cc587[_0xd187('0x31')];if(!_0x140e54['query']['hasOwnProperty']('nolimit')){_0x5bba10[_0xd187('0x1e')]=qs['limit'](_0x140e54[_0xd187('0x35')][_0xd187('0x1e')]);_0x5bba10['offset']=qs[_0xd187('0x21')](_0x140e54['query'][_0xd187('0x21')]);}_0x5bba10[_0xd187('0x38')]=qs['sort'](_0x140e54[_0xd187('0x35')][_0xd187('0x39')]);_0x5bba10['where']=qs[_0xd187('0x33')](_['pick'](_0x140e54['query'],_0x4cc587[_0xd187('0x33')]),_0x1836cf);if(_0x140e54[_0xd187('0x35')][_0xd187('0x3a')]){_0x5bba10[_0xd187('0x3b')]=_[_0xd187('0x3c')](_0x5bba10['where'],{'$or':_[_0xd187('0x2c')](_0x1836cf,function(_0xe090ad){if(_0xe090ad[_0xd187('0x30')]!=='VIRTUAL'){var _0x4b121c={};_0x4b121c[_0xe090ad['name']]={'$like':'%'+_0x140e54['query'][_0xd187('0x3a')]+'%'};return _0x4b121c;}})});}_0x5bba10=_[_0xd187('0x3c')]({},_0x5bba10,_0x140e54[_0xd187('0x3d')]);var _0x367303={'where':_0x5bba10[_0xd187('0x3b')]};return db[_0xd187('0x2d')][_0xd187('0x20')](_0x367303)[_0xd187('0x26')](function(_0x526060){_0x1a1922[_0xd187('0x20')]=_0x526060;if(_0x140e54[_0xd187('0x35')][_0xd187('0x3e')]){_0x5bba10['include']=[{'all':!![]}];}return db[_0xd187('0x2d')]['findAll'](_0x5bba10);})[_0xd187('0x26')](function(_0x406d29){_0x1a1922[_0xd187('0x3f')]=_0x406d29;return _0x1a1922;})[_0xd187('0x26')](respondWithFilteredResult(_0xb38778,_0x5bba10))[_0xd187('0x40')](handleError(_0xb38778,null));};exports['show']=function(_0x3f0484,_0x3d9e60){var _0x3215b1={'raw':!![],'where':{'id':_0x3f0484['params']['id']}},_0x3fa19c={};_0x3fa19c[_0xd187('0x31')]=_[_0xd187('0x32')](db['AnalyticDefaultReport'][_0xd187('0x2e')]);_0x3fa19c[_0xd187('0x35')]=_['keys'](_0x3f0484['query']);_0x3fa19c[_0xd187('0x33')]=_[_0xd187('0x34')](_0x3fa19c['model'],_0x3fa19c['query']);_0x3215b1['attributes']=_[_0xd187('0x34')](_0x3fa19c[_0xd187('0x31')],qs[_0xd187('0x36')](_0x3f0484[_0xd187('0x35')][_0xd187('0x36')]));_0x3215b1[_0xd187('0x37')]=_0x3215b1[_0xd187('0x37')]['length']?_0x3215b1[_0xd187('0x37')]:_0x3fa19c[_0xd187('0x31')];if(_0x3f0484[_0xd187('0x35')][_0xd187('0x3e')]){_0x3215b1[_0xd187('0x41')]=[{'all':!![]}];}_0x3215b1=_[_0xd187('0x3c')]({},_0x3215b1,_0x3f0484[_0xd187('0x3d')]);return db[_0xd187('0x2d')]['find'](_0x3215b1)[_0xd187('0x26')](handleEntityNotFound(_0x3d9e60,null))[_0xd187('0x26')](respondWithResult(_0x3d9e60,null))[_0xd187('0x40')](handleError(_0x3d9e60,null));};exports[_0xd187('0x42')]=function(_0x36b99d,_0x5ad646){return db[_0xd187('0x2d')][_0xd187('0x42')](_0x36b99d['body'],{})[_0xd187('0x26')](function(_0xd9635d){var _0x55fac6=_0x36b99d['user']['get']({'plain':!![]});if(!_0x55fac6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55fac6[_0xd187('0x43')]===_0xd187('0x44')){var _0x12d448=_0xd9635d[_0xd187('0x27')]({'plain':!![]});var _0x460202=_0xd187('0x45');return db[_0xd187('0x46')]['find']({'where':{'name':_0x460202,'userProfileId':_0x55fac6[_0xd187('0x47')]},'raw':!![]})[_0xd187('0x26')](function(_0x1b12c4){if(_0x1b12c4&&_0x1b12c4[_0xd187('0x48')]===0x0){return db['UserProfileResource'][_0xd187('0x42')]({'name':_0x12d448['name'],'resourceId':_0x12d448['id'],'type':'DefaultReports','sectionId':_0x1b12c4['id']},{})[_0xd187('0x26')](function(){return _0xd9635d;});}else{return _0xd9635d;}})['catch'](function(_0x1a1252){logger[_0xd187('0x29')](_0xd187('0x49'),_0x1a1252);throw _0x1a1252;});}return _0xd9635d;})[_0xd187('0x26')](respondWithResult(_0x5ad646,0xc9))[_0xd187('0x40')](handleError(_0x5ad646,null));};exports[_0xd187('0x25')]=function(_0x3c7ba6,_0x2b4f9d){if(_0x3c7ba6[_0xd187('0x4a')]['id']){delete _0x3c7ba6['body']['id'];}return db[_0xd187('0x2d')][_0xd187('0x4b')]({'where':{'id':_0x3c7ba6['params']['id']}})[_0xd187('0x26')](handleEntityNotFound(_0x2b4f9d,null))[_0xd187('0x26')](saveUpdates(_0x3c7ba6[_0xd187('0x4a')],null))['then'](respondWithResult(_0x2b4f9d,null))[_0xd187('0x40')](handleError(_0x2b4f9d,null));};exports[_0xd187('0x28')]=function(_0x50073d,_0x457da1){return db[_0xd187('0x2d')]['find']({'where':{'id':_0x50073d[_0xd187('0x4c')]['id']}})['then'](handleEntityNotFound(_0x457da1,null))[_0xd187('0x26')](removeEntity(_0x457da1,null))[_0xd187('0x40')](handleError(_0x457da1,null));};exports[_0xd187('0x4d')]=function(_0x508866,_0x100d64){var _0x2265fb=0xa;var _0x1675d9=['join',_0xd187('0x4e'),_0xd187('0x4f'),_0xd187('0x50')];var _0x56b36b={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':_0xd187('0x53'),'MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':_0xd187('0x56'),'GROUP_CONCAT':_0xd187('0x57'),'GROUP_CONCAT ASC':_0xd187('0x58'),'GROUP_CONCAT DESC':_0xd187('0x59')};var _0x2c7dd9={'SEC_TO_TIME':_0xd187('0x5a'),'DATE':_0xd187('0x5b'),'HOUR':_0xd187('0x5c'),'ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0xaff1e6=function(_0x42fb32){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),'IS\x20EMPTY',_0xd187('0x62')],_0x42fb32);};var _0x48c82d=function(_0x13d118){if(!_0x13d118||!_0x13d118[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x4225e6='(',_0x51fbdb=0x0;_0x51fbdb<_0x13d118[_0xd187('0x63')][_0xd187('0x64')];_0x51fbdb+=0x1){_0x51fbdb>0x0&&(_0x4225e6+='\x20'+_0x13d118['operator']+'\x20');_0x4225e6+=_0x13d118['rules'][_0x51fbdb][_0xd187('0x65')]?_0x48c82d(_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x65')]):_0x13d118[_0xd187('0x63')][_0x51fbdb]['field']+'\x20'+_0x13d118[_0xd187('0x63')][_0x51fbdb]['condition']+(_0xaff1e6(_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x66')])?'\x20'+_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x67')]:'');}return _0x4225e6+')';};var _0x57cad7={'where':{'id':_0x508866['params']['id']}},_0x2409a8,_0xaea7e0,_0xd12560,_0x9e82c,_0x151f3c;_0x57cad7=_['merge']({},_0x57cad7,_0x508866[_0xd187('0x3d')]);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x57cad7)[_0xd187('0x26')](function(_0x13e05a){if(_0x13e05a){_0x2409a8=_0x13e05a;return _0x13e05a[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x1291cc){if(_0x1291cc){if(!_0x1291cc[_0xd187('0x64')]){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0xaea7e0=_0x1291cc;return db['AnalyticMetric'][_0xd187('0x6c')]({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x54e908){if(_0x54e908){_0xd12560=_[_0xd187('0x6d')](_0x54e908,'id');var _0x1a9979;var _0x4bec3e=squel['select']();_0x4bec3e[_0xd187('0x6e')](_0x2409a8[_0xd187('0x6f')]);for(var _0x2ac56f=0x0;_0x2ac56f<_0xaea7e0[_0xd187('0x64')];_0x2ac56f+=0x1){_0x1a9979=_0xaea7e0[_0x2ac56f]['MetricId']?_0xd12560[_0xaea7e0[_0x2ac56f][_0xd187('0x70')]][_0xd187('0x71')]:_0xaea7e0[_0x2ac56f]['field'];_0x1a9979=_0xaea7e0[_0x2ac56f]['function']?_[_0xd187('0x72')](_0x56b36b[_0xaea7e0[_0x2ac56f]['function']],'%s',_0x1a9979):_0x1a9979;_0x1a9979=_0xaea7e0[_0x2ac56f][_0xd187('0x73')]?_[_0xd187('0x72')](_0x2c7dd9[_0xaea7e0[_0x2ac56f]['format']],'%s',_0x1a9979):_0x1a9979;if(_0xaea7e0[_0x2ac56f][_0xd187('0x74')]){_0x4bec3e['group'](_0x1a9979);}_0xaea7e0[_0x2ac56f][_0xd187('0x75')]&&_0x4bec3e['order'](_0x1a9979,_0xaea7e0[_0x2ac56f]['orderBy']==='DESC'?![]:!![]);_0x4bec3e[_0xd187('0x76')](_0x1a9979,_0xaea7e0[_0x2ac56f][_0xd187('0x77')]||_0x1a9979);}if(_0x2409a8[_0xd187('0x78')]){_0x2409a8[_0xd187('0x78')]=JSON[_0xd187('0x79')](_0x2409a8[_0xd187('0x78')]);for(var _0x11858e=0x0;_0x11858e<_0x2409a8[_0xd187('0x78')]['length'];_0x11858e+=0x1){if(_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0x1675d9,_0x2409a8['joins'][_0x11858e][_0xd187('0x30')])&&_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7a')]&&_0x2409a8[_0xd187('0x78')][_0x11858e]['foreignTable']&&_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7b')]){_0x4bec3e[_0x2409a8['joins'][_0x11858e][_0xd187('0x30')]](_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7c')],null,util[_0xd187('0x73')]('%s.%s\x20=\x20%s.%s',_0x2409a8[_0xd187('0x6f')],_0x2409a8[_0xd187('0x78')][_0x11858e]['parentKey'],_0x2409a8[_0xd187('0x78')][_0x11858e]['foreignTable'],_0x2409a8['joins'][_0x11858e]['foreignKey']));}}}if(_0x2409a8[_0xd187('0x7d')]){_0x2409a8[_0xd187('0x7d')]=JSON[_0xd187('0x79')](_0x2409a8[_0xd187('0x7d')]);_0x4bec3e[_0xd187('0x3b')](_0x48c82d(_0x2409a8[_0xd187('0x7d')]['group']));}_0x151f3c=_0x4bec3e[_0xd187('0x7e')]();_0x4bec3e[_0xd187('0x1e')](_0x2265fb);_0x4bec3e['offset'](0x0);logger['debug'](_0xd187('0x7f'),_0x4bec3e[_0xd187('0x80')]());return dbH[_0xd187('0x81')][_0xd187('0x35')](_0x4bec3e[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')]['QueryTypes'][_0xd187('0x82')]});}})[_0xd187('0x26')](respondWithResult(_0x100d64,null))[_0xd187('0x40')](handleError(_0x100d64,null));};function runReport(_0xbc650f,_0x1da684,_0x2879ff){var _0x1982cd=_0x1da684[_0xd187('0x2a')];var _0x3d9b2f=0xa;var _0xf31fac=[_0xd187('0x83'),_0xd187('0x4e'),'right_join','cross_join'];var _0x3d7e97={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':_0xd187('0x53'),'MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xd187('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd187('0x59')};var _0x520f86={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd187('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0x1ccb17=function(_0x432995){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),_0xd187('0x84'),_0xd187('0x62')],_0x432995);};var _0x395e45=function(_0x1e8839){if(!_0x1e8839||!_0x1e8839[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x2101a3='(',_0x25fc08=0x0;_0x25fc08<_0x1e8839['rules'][_0xd187('0x64')];_0x25fc08+=0x1){_0x25fc08>0x0&&(_0x2101a3+='\x20'+_0x1e8839[_0xd187('0x85')]+'\x20');_0x2101a3+=_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x65')]?_0x395e45(_0x1e8839['rules'][_0x25fc08][_0xd187('0x65')]):_0x1e8839[_0xd187('0x63')][_0x25fc08]['field']+'\x20'+_0x1e8839['rules'][_0x25fc08][_0xd187('0x66')]+(_0x1ccb17(_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x66')])?'\x20'+_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x67')]:'');}return _0x2101a3+')';};var _0x475ea9={'where':{'id':_0xbc650f['id']}},_0x4dd0c7,_0x22900,_0x22424d,_0x5b7870,_0x3244dd;_0x475ea9=_[_0xd187('0x3c')]({},_0x475ea9,_0x2879ff);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x475ea9)['then'](function(_0x5be1c9){if(_0x5be1c9){_0x4dd0c7=_0x5be1c9;return _0x5be1c9[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x1cd0d2){if(_0x1cd0d2){if(!_0x1cd0d2['length']){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0x22900=_0x1cd0d2;return db[_0xd187('0x86')]['findAll']({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x4efb9f){if(_0x4efb9f){_0x22424d=_['keyBy'](_0x4efb9f,'id');var _0x4a9310;var _0x54bf98=squel['select']();_0x54bf98['from'](_0x4dd0c7['table']);for(var _0x323311=0x0;_0x323311<_0x22900[_0xd187('0x64')];_0x323311+=0x1){_0x4a9310=_0x22900[_0x323311]['MetricId']?_0x22424d[_0x22900[_0x323311][_0xd187('0x70')]][_0xd187('0x71')]:_0x22900[_0x323311][_0xd187('0x76')];_0x4a9310=_0x22900[_0x323311][_0xd187('0x87')]?_[_0xd187('0x72')](_0x3d7e97[_0x22900[_0x323311]['function']],'%s',_0x4a9310):_0x4a9310;_0x4a9310=_0x22900[_0x323311][_0xd187('0x73')]?_['replace'](_0x520f86[_0x22900[_0x323311][_0xd187('0x73')]],'%s',_0x4a9310):_0x4a9310;if(_0x22900[_0x323311][_0xd187('0x74')]){_0x54bf98[_0xd187('0x65')](_0x4a9310);}_0x22900[_0x323311][_0xd187('0x75')]&&_0x54bf98[_0xd187('0x38')](_0x4a9310,_0x22900[_0x323311][_0xd187('0x75')]===_0xd187('0x88')?![]:!![]);_0x54bf98['field'](_0x4a9310,_0x22900[_0x323311][_0xd187('0x77')]||_0x4a9310);}if(_0x4dd0c7[_0xd187('0x78')]){_0x4dd0c7['joins']=JSON[_0xd187('0x79')](_0x4dd0c7[_0xd187('0x78')]);for(var _0x5df926=0x0;_0x5df926<_0x4dd0c7[_0xd187('0x78')][_0xd187('0x64')];_0x5df926+=0x1){if(_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0xf31fac,_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')])&&_0x4dd0c7[_0xd187('0x78')][_0x5df926]['parentKey']&&_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7c')]&&_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7b')]){_0x54bf98[_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')]](_0x4dd0c7['joins'][_0x5df926]['foreignTable'],null,util[_0xd187('0x73')](_0xd187('0x89'),_0x4dd0c7['table'],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7a')],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7c')],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7b')]));}}}if(_0x4dd0c7['conditions']){_0x4dd0c7[_0xd187('0x7d')]=JSON[_0xd187('0x79')](_0x4dd0c7[_0xd187('0x7d')]);_0x54bf98[_0xd187('0x3b')](_0x395e45(_0x4dd0c7[_0xd187('0x7d')][_0xd187('0x65')]));}_0x3244dd=_0x54bf98[_0xd187('0x7e')]();_0x54bf98[_0xd187('0x1e')](_0x3d9b2f);_0x54bf98[_0xd187('0x21')](0x0);return;}})['then'](function(){if(_0x1da684[_0xd187('0x8a')]===_0xd187('0x8b')){return null;}var _0x25a053=_['merge'](_0x1da684,{'name':_0x1da684[_0xd187('0x8c')]||_0x1da684[_0xd187('0x2a')]||_0x4dd0c7[_0xd187('0x2a')],'basename':_0x1982cd,'savename':util[_0xd187('0x73')](_0xd187('0x8d'),_0x1da684[_0xd187('0x2a')]||_0x4dd0c7['name'],require(_0xd187('0x8e'))[_0xd187('0x8f')](0x4),_0x1da684[_0xd187('0x8a')]||'csv'),'reportId':_0x4dd0c7['id'],'reportType':_0xd187('0x90')});return db[_0xd187('0x91')][_0xd187('0x42')](_0x25a053,{'raw':!![]});})[_0xd187('0x26')](function(_0x12599e){if(_0x4dd0c7[_0xd187('0x6f')]==='cdr'){_0x3244dd[_0xd187('0x3b')](_0x4dd0c7[_0xd187('0x6f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x1da684[_0xd187('0x92')],_0x1da684[_0xd187('0x93')]);}else{_0x3244dd['where'](_0x4dd0c7[_0xd187('0x6f')]+_0xd187('0x94'),_0x1da684['startDate'],_0x1da684[_0xd187('0x93')]);}if(_0x12599e){logger[_0xd187('0x95')]('Run\x20Query:',_0x3244dd[_0xd187('0x80')]());require('child_process')[_0xd187('0x96')](path[_0xd187('0x83')](__dirname,_0xd187('0x97'),_0x12599e[_0xd187('0x8a')]),[_0x12599e['id'],_0x3244dd[_0xd187('0x80')](),path['join'](__dirname,'../../files/reports',_0x12599e[_0xd187('0x98')]),_0x1982cd]);return _0x12599e;}else{var _0x2a2c7f=squel[_0xd187('0x99')]();_0x2a2c7f[_0xd187('0x6e')]('('+_0x3244dd[_0xd187('0x80')]()+')',_0xd187('0x9a'));_0x2a2c7f[_0xd187('0x76')]('COUNT(*)',_0xd187('0x20'));_0x3244dd[_0xd187('0x1e')](_0x1da684[_0xd187('0x1e')]||_0x3d9b2f);_0x3244dd[_0xd187('0x21')](_0x1da684[_0xd187('0x21')]||0x0);return dbH[_0xd187('0x81')]['query'](_0x2a2c7f[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')][_0xd187('0x9b')][_0xd187('0x82')]})[_0xd187('0x26')](function(_0x38a7cd){if(!_0x38a7cd[_0xd187('0x64')]){_0x5b7870=0x0;}else{_0x5b7870=_0x38a7cd[0x0][_0xd187('0x20')]||0x0;}return dbH['sequelize'][_0xd187('0x35')](_0x3244dd['toString'](),{'type':dbH[_0xd187('0x81')][_0xd187('0x9b')]['SELECT']});})[_0xd187('0x26')](function(_0x254e0a){return{'rows':_0x254e0a||[],'count':_0x5b7870};});}});}exports['run']=function(_0x1776c1,_0x497a94){return runReport(_0x1776c1[_0xd187('0x4c')],_0x1776c1['query'],_0x1776c1['options'])[_0xd187('0x26')](respondWithResult(_0x497a94,null))[_0xd187('0x40')](handleError(_0x497a94,null));};exports[_0xd187('0x9c')]=runReport;exports[_0xd187('0x35')]=function(_0x568f72,_0x357526){var _0x13ee40=0xa;var _0x20c269=[_0xd187('0x83'),_0xd187('0x4e'),_0xd187('0x4f'),_0xd187('0x50')];var _0x25ff89={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':_0xd187('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd187('0x59')};var _0x28798f={'SEC_TO_TIME':_0xd187('0x5a'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0x56fcde=function(_0x37b1b0){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),'IS\x20EMPTY',_0xd187('0x62')],_0x37b1b0);};var _0x428e6c=function(_0x4524c3){if(!_0x4524c3||!_0x4524c3[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x3a2937='(',_0xf03f9a=0x0;_0xf03f9a<_0x4524c3['rules'][_0xd187('0x64')];_0xf03f9a+=0x1){_0xf03f9a>0x0&&(_0x3a2937+='\x20'+_0x4524c3['operator']+'\x20');_0x3a2937+=_0x4524c3[_0xd187('0x63')][_0xf03f9a]['group']?_0x428e6c(_0x4524c3[_0xd187('0x63')][_0xf03f9a]['group']):_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x76')]+'\x20'+_0x4524c3[_0xd187('0x63')][_0xf03f9a]['condition']+(_0x56fcde(_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x66')])?'\x20'+_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x67')]:'');}return _0x3a2937+')';};var _0x37405d={'where':{'id':_0x568f72[_0xd187('0x4c')]['id']}},_0xe84f78,_0x12b4a4,_0x3d09a6,_0x5acea7,_0x2a756f;_0x37405d=_[_0xd187('0x3c')]({},_0x37405d,_0x568f72['options']);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x37405d)[_0xd187('0x26')](function(_0x110af6){if(_0x110af6){_0xe84f78=_0x110af6;return _0x110af6[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x2e4db4){if(_0x2e4db4){if(!_0x2e4db4[_0xd187('0x64')]){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0x12b4a4=_0x2e4db4;return db['AnalyticMetric'][_0xd187('0x6c')]({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x50d5b8){if(_0x50d5b8){_0x3d09a6=_[_0xd187('0x6d')](_0x50d5b8,'id');var _0x48ef98;var _0x2008e9=squel['select']();_0x2008e9[_0xd187('0x6e')](_0xe84f78[_0xd187('0x6f')]);for(var _0x9b8840=0x0;_0x9b8840<_0x12b4a4[_0xd187('0x64')];_0x9b8840+=0x1){_0x48ef98=_0x12b4a4[_0x9b8840][_0xd187('0x70')]?_0x3d09a6[_0x12b4a4[_0x9b8840]['MetricId']][_0xd187('0x71')]:_0x12b4a4[_0x9b8840][_0xd187('0x76')];_0x48ef98=_0x12b4a4[_0x9b8840][_0xd187('0x87')]?_[_0xd187('0x72')](_0x25ff89[_0x12b4a4[_0x9b8840][_0xd187('0x87')]],'%s',_0x48ef98):_0x48ef98;_0x48ef98=_0x12b4a4[_0x9b8840]['format']?_[_0xd187('0x72')](_0x28798f[_0x12b4a4[_0x9b8840][_0xd187('0x73')]],'%s',_0x48ef98):_0x48ef98;if(_0x12b4a4[_0x9b8840][_0xd187('0x74')]){_0x2008e9['group'](_0x48ef98);}_0x12b4a4[_0x9b8840]['orderBy']&&_0x2008e9[_0xd187('0x38')](_0x48ef98,_0x12b4a4[_0x9b8840][_0xd187('0x75')]===_0xd187('0x88')?![]:!![]);_0x2008e9[_0xd187('0x76')](_0x48ef98,_0x12b4a4[_0x9b8840]['alias']||_0x48ef98);}if(_0xe84f78[_0xd187('0x78')]){_0xe84f78[_0xd187('0x78')]=JSON[_0xd187('0x79')](_0xe84f78[_0xd187('0x78')]);for(var _0x4bff96=0x0;_0x4bff96<_0xe84f78[_0xd187('0x78')]['length'];_0x4bff96+=0x1){if(_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0x20c269,_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')])&&_0xe84f78['joins'][_0x4bff96][_0xd187('0x7a')]&&_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')]&&_0xe84f78[_0xd187('0x78')][_0x4bff96]['foreignKey']){_0x2008e9[_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')]](_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')],null,util[_0xd187('0x73')](_0xd187('0x89'),_0xe84f78[_0xd187('0x6f')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7a')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7b')]));}}}if(_0xe84f78['conditions']){_0xe84f78[_0xd187('0x7d')]=JSON['parse'](_0xe84f78[_0xd187('0x7d')]);_0x2008e9['where'](_0x428e6c(_0xe84f78[_0xd187('0x7d')][_0xd187('0x65')]));}_0x2a756f=_0x2008e9[_0xd187('0x7e')]();_0x2008e9[_0xd187('0x1e')](_0x13ee40);_0x2008e9['offset'](0x0);logger['debug'](_0xd187('0x7f'),_0x2008e9[_0xd187('0x80')]());return dbH[_0xd187('0x81')][_0xd187('0x35')](_0x2008e9[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')]['QueryTypes']['SELECT']});}})[_0xd187('0x26')](function(){return{'sql':_0x2a756f[_0xd187('0x80')]()};})[_0xd187('0x26')](respondWithResult(_0x357526,null))['catch'](handleError(_0x357526,null));};
\ No newline at end of file
+var _0xba34=['save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','create','body','user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\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','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','COUNT(%s)','AVG(%s)','IS\x20NOT\x20NULL','value','order','output','%s-%s.%s','randomstring','generate','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','fork','countTable','QueryTypes','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','Please\x20insert\x20at\x20least\x20one\x20field','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','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','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject'];(function(_0x14b9ab,_0x4b5bb2){var _0x6a7e2f=function(_0x1c2870){while(--_0x1c2870){_0x14b9ab['push'](_0x14b9ab['shift']());}};_0x6a7e2f(++_0x4b5bb2);}(_0xba34,0x119));var _0x4ba3=function(_0x464ef7,_0x531fda){_0x464ef7=_0x464ef7-0x0;var _0x2ec8fa=_0xba34[_0x464ef7];return _0x2ec8fa;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];var dbH=require(_0x4ba3('0x19'))['dbH'];function respondWithStatusCode(_0x256f02,_0x4419b4){_0x4419b4=_0x4419b4||0xcc;return function(_0x29e498){if(_0x29e498){return _0x256f02[_0x4ba3('0x1a')](_0x4419b4);}return _0x256f02[_0x4ba3('0x1b')](_0x4419b4)[_0x4ba3('0x1c')]();};}function respondWithResult(_0x3a74f7,_0x12ac90){_0x12ac90=_0x12ac90||0xc8;return function(_0x1dec48){if(_0x1dec48){return _0x3a74f7[_0x4ba3('0x1b')](_0x12ac90)[_0x4ba3('0x1d')](_0x1dec48);}};}function respondWithFilteredResult(_0x301359,_0x29a9d1){return function(_0x25f584){if(_0x25f584){var _0x40e75b=typeof _0x29a9d1[_0x4ba3('0x1e')]==='undefined'&&typeof _0x29a9d1[_0x4ba3('0x1f')]===_0x4ba3('0x20');var _0x5ff7ce=_0x25f584[_0x4ba3('0x21')];var _0x556290=_0x40e75b?0x0:_0x29a9d1[_0x4ba3('0x1e')];var _0xe4eff9=_0x40e75b?_0x25f584[_0x4ba3('0x21')]:_0x29a9d1[_0x4ba3('0x1e')]+_0x29a9d1[_0x4ba3('0x1f')];var _0x125944;if(_0xe4eff9>=_0x5ff7ce){_0xe4eff9=_0x5ff7ce;_0x125944=0xc8;}else{_0x125944=0xce;}_0x301359['status'](_0x125944);return _0x301359['set'](_0x4ba3('0x22'),_0x556290+'-'+_0xe4eff9+'/'+_0x5ff7ce)['json'](_0x25f584);}return null;};}function patchUpdates(_0x18dff5){return function(_0x163967){try{jsonpatch[_0x4ba3('0x23')](_0x163967,_0x18dff5,!![]);}catch(_0xbc7023){return BPromise[_0x4ba3('0x24')](_0xbc7023);}return _0x163967[_0x4ba3('0x25')]();};}function saveUpdates(_0x4a0823,_0x143c78){return function(_0x1f87e1){if(_0x1f87e1){return _0x1f87e1['update'](_0x4a0823)[_0x4ba3('0x26')](function(_0x4ffe39){return _0x4ffe39;});}return null;};}function removeEntity(_0x1ae4de,_0x18abb3){return function(_0x11a917){if(_0x11a917){return _0x11a917[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){var _0xe29a49=_0x11a917[_0x4ba3('0x28')]({'plain':!![]});var _0xe1f7d2=_0x4ba3('0x29');return db[_0x4ba3('0x2a')]['destroy']({'where':{'type':_0xe1f7d2,'resourceId':_0xe29a49['id']}})[_0x4ba3('0x26')](function(){return _0x11a917;});})[_0x4ba3('0x26')](function(){_0x1ae4de[_0x4ba3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10537e,_0x1fe5e2){return function(_0x44d78c){if(!_0x44d78c){_0x10537e['sendStatus'](0x194);}return _0x44d78c;};}function handleError(_0x10cae6,_0x843276){_0x843276=_0x843276||0x1f4;return function(_0x34ecb4){logger[_0x4ba3('0x2b')](_0x34ecb4['stack']);if(_0x34ecb4['name']){delete _0x34ecb4[_0x4ba3('0x2c')];}_0x10cae6[_0x4ba3('0x1b')](_0x843276)[_0x4ba3('0x2d')](_0x34ecb4);};}exports[_0x4ba3('0x2e')]=function(_0x2cb5d5,_0x11f88f){var _0x48b3b7={},_0x27444b={},_0x28f36c={'count':0x0,'rows':[]};var _0x24d8fc=_[_0x4ba3('0x2f')](db[_0x4ba3('0x30')][_0x4ba3('0x31')],function(_0x457236){return{'name':_0x457236[_0x4ba3('0x32')],'type':_0x457236[_0x4ba3('0x33')][_0x4ba3('0x34')]};});_0x27444b['model']=_['map'](_0x24d8fc,'name');_0x27444b[_0x4ba3('0x35')]=_[_0x4ba3('0x36')](_0x2cb5d5[_0x4ba3('0x35')]);_0x27444b[_0x4ba3('0x37')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],_0x27444b[_0x4ba3('0x35')]);_0x48b3b7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x2cb5d5[_0x4ba3('0x35')]['fields']));_0x48b3b7[_0x4ba3('0x3a')]=_0x48b3b7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x48b3b7['attributes']:_0x27444b[_0x4ba3('0x39')];if(!_0x2cb5d5['query'][_0x4ba3('0x3d')](_0x4ba3('0x3e'))){_0x48b3b7[_0x4ba3('0x1f')]=qs[_0x4ba3('0x1f')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1f')]);_0x48b3b7['offset']=qs[_0x4ba3('0x1e')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1e')]);}_0x48b3b7['order']=qs[_0x4ba3('0x3f')](_0x2cb5d5[_0x4ba3('0x35')]['sort']);_0x48b3b7[_0x4ba3('0x40')]=qs['filters'](_['pick'](_0x2cb5d5[_0x4ba3('0x35')],_0x27444b[_0x4ba3('0x37')]),_0x24d8fc);if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x41')]){_0x48b3b7[_0x4ba3('0x40')]=_['merge'](_0x48b3b7[_0x4ba3('0x40')],{'$or':_[_0x4ba3('0x2f')](_0x24d8fc,function(_0x46d2ca){if(_0x46d2ca[_0x4ba3('0x33')]!==_0x4ba3('0x42')){var _0x2acc92={};_0x2acc92[_0x46d2ca[_0x4ba3('0x2c')]]={'$like':'%'+_0x2cb5d5[_0x4ba3('0x35')]['filter']+'%'};return _0x2acc92;}})});}_0x48b3b7=_[_0x4ba3('0x43')]({},_0x48b3b7,_0x2cb5d5[_0x4ba3('0x44')]);var _0x3cb07f={'where':_0x48b3b7[_0x4ba3('0x40')]};return db[_0x4ba3('0x30')][_0x4ba3('0x21')](_0x3cb07f)[_0x4ba3('0x26')](function(_0xdcc2a2){_0x28f36c[_0x4ba3('0x21')]=_0xdcc2a2;if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x45')]){_0x48b3b7[_0x4ba3('0x46')]=[{'all':!![]}];}return db[_0x4ba3('0x30')][_0x4ba3('0x47')](_0x48b3b7);})['then'](function(_0x5af671){_0x28f36c['rows']=_0x5af671;return _0x28f36c;})['then'](respondWithFilteredResult(_0x11f88f,_0x48b3b7))['catch'](handleError(_0x11f88f,null));};exports[_0x4ba3('0x48')]=function(_0x5c4659,_0x29e74d){var _0x5567c7={'raw':!![],'where':{'id':_0x5c4659[_0x4ba3('0x49')]['id']}},_0x53d6eb={};_0x53d6eb[_0x4ba3('0x39')]=_[_0x4ba3('0x36')](db[_0x4ba3('0x30')]['rawAttributes']);_0x53d6eb[_0x4ba3('0x35')]=_['keys'](_0x5c4659[_0x4ba3('0x35')]);_0x53d6eb['filters']=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],_0x53d6eb[_0x4ba3('0x35')]);_0x5567c7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x5c4659['query'][_0x4ba3('0x3b')]));_0x5567c7[_0x4ba3('0x3a')]=_0x5567c7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x5567c7[_0x4ba3('0x3a')]:_0x53d6eb['model'];if(_0x5c4659['query'][_0x4ba3('0x45')]){_0x5567c7[_0x4ba3('0x46')]=[{'all':!![]}];}_0x5567c7=_[_0x4ba3('0x43')]({},_0x5567c7,_0x5c4659['options']);return db[_0x4ba3('0x30')][_0x4ba3('0x4a')](_0x5567c7)[_0x4ba3('0x26')](handleEntityNotFound(_0x29e74d,null))['then'](respondWithResult(_0x29e74d,null))['catch'](handleError(_0x29e74d,null));};exports[_0x4ba3('0x4b')]=function(_0x482a83,_0x439acf){return db[_0x4ba3('0x30')][_0x4ba3('0x4b')](_0x482a83[_0x4ba3('0x4c')],{})[_0x4ba3('0x26')](function(_0x213eb0){var _0x590739=_0x482a83[_0x4ba3('0x4d')][_0x4ba3('0x28')]({'plain':!![]});if(!_0x590739)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x590739[_0x4ba3('0x4e')]===_0x4ba3('0x4d')){var _0x156c2d=_0x213eb0[_0x4ba3('0x28')]({'plain':!![]});var _0x360472='Reports';return db[_0x4ba3('0x4f')][_0x4ba3('0x4a')]({'where':{'name':_0x360472,'userProfileId':_0x590739['userProfileId']},'raw':!![]})[_0x4ba3('0x26')](function(_0x19d70f){if(_0x19d70f&&_0x19d70f[_0x4ba3('0x50')]===0x0){return db[_0x4ba3('0x2a')][_0x4ba3('0x4b')]({'name':_0x156c2d[_0x4ba3('0x2c')],'resourceId':_0x156c2d['id'],'type':_0x4ba3('0x29'),'sectionId':_0x19d70f['id']},{})[_0x4ba3('0x26')](function(){return _0x213eb0;});}else{return _0x213eb0;}})[_0x4ba3('0x51')](function(_0x428a27){logger[_0x4ba3('0x2b')](_0x4ba3('0x52'),_0x428a27);throw _0x428a27;});}return _0x213eb0;})[_0x4ba3('0x26')](respondWithResult(_0x439acf,0xc9))[_0x4ba3('0x51')](handleError(_0x439acf,null));};exports[_0x4ba3('0x53')]=function(_0x48a3d4,_0x5e7ed5){if(_0x48a3d4['body']['id']){delete _0x48a3d4[_0x4ba3('0x4c')]['id'];}return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x48a3d4[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x5e7ed5,null))['then'](saveUpdates(_0x48a3d4[_0x4ba3('0x4c')],null))[_0x4ba3('0x26')](respondWithResult(_0x5e7ed5,null))[_0x4ba3('0x51')](handleError(_0x5e7ed5,null));};exports[_0x4ba3('0x27')]=function(_0x5359d1,_0x1e83fb){return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x5359d1[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x1e83fb,null))[_0x4ba3('0x26')](removeEntity(_0x1e83fb,null))[_0x4ba3('0x51')](handleError(_0x1e83fb,null));};exports[_0x4ba3('0x54')]=function(_0x328314,_0x4fa64d){var _0x20c849=0xa;var _0x42bb4b=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x40827a={'SUM':_0x4ba3('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':_0x4ba3('0x5b'),'MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x4cc10a={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4ba3('0x62')};var _0xaef1b=function(_0x2a48fe){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),'IS\x20NOT\x20NULL',_0x4ba3('0x65'),_0x4ba3('0x66')],_0x2a48fe);};var _0x34cc21=function(_0x469ef0){if(!_0x469ef0||!_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')]){return'';}for(var _0x3fdf7f='(',_0x38699e=0x0;_0x38699e<_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')];_0x38699e+=0x1){_0x38699e>0x0&&(_0x3fdf7f+='\x20'+_0x469ef0[_0x4ba3('0x68')]+'\x20');_0x3fdf7f+=_0x469ef0['rules'][_0x38699e][_0x4ba3('0x69')]?_0x34cc21(_0x469ef0[_0x4ba3('0x67')][_0x38699e]['group']):_0x469ef0['rules'][_0x38699e][_0x4ba3('0x6a')]+'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['condition']+(_0xaef1b(_0x469ef0[_0x4ba3('0x67')][_0x38699e][_0x4ba3('0x6b')])?'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['value']:'');}return _0x3fdf7f+')';};var _0x1f5815={'where':{'id':_0x328314['params']['id']}},_0x46224,_0x1af489,_0x11209b,_0x24a75a,_0x3a4838;_0x1f5815=_[_0x4ba3('0x43')]({},_0x1f5815,_0x328314[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x1f5815)[_0x4ba3('0x26')](function(_0x2f8bcc){if(_0x2f8bcc){_0x46224=_0x2f8bcc;return _0x2f8bcc[_0x4ba3('0x6c')]();}return null;})[_0x4ba3('0x26')](function(_0x21c8b1){if(_0x21c8b1){if(!_0x21c8b1[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1af489=_0x21c8b1;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})['then'](function(_0x13ee2c){if(_0x13ee2c){_0x11209b=_[_0x4ba3('0x6f')](_0x13ee2c,'id');var _0x442d66;var _0x5c7fc2=squel[_0x4ba3('0x70')]();_0x5c7fc2[_0x4ba3('0x71')](_0x46224[_0x4ba3('0x72')]);for(var _0x5baf26=0x0;_0x5baf26<_0x1af489[_0x4ba3('0x3c')];_0x5baf26+=0x1){_0x442d66=_0x1af489[_0x5baf26]['MetricId']?_0x11209b[_0x1af489[_0x5baf26][_0x4ba3('0x73')]][_0x4ba3('0x74')]:_0x1af489[_0x5baf26]['field'];_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x40827a[_0x1af489[_0x5baf26][_0x4ba3('0x75')]],'%s',_0x442d66):_0x442d66;_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x4cc10a[_0x1af489[_0x5baf26][_0x4ba3('0x77')]],'%s',_0x442d66):_0x442d66;if(_0x1af489[_0x5baf26][_0x4ba3('0x78')]){_0x5c7fc2[_0x4ba3('0x69')](_0x442d66);}_0x1af489[_0x5baf26][_0x4ba3('0x79')]&&_0x5c7fc2['order'](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x5c7fc2[_0x4ba3('0x6a')](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x7b')]||_0x442d66);}if(_0x46224[_0x4ba3('0x7c')]){_0x46224[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x7c')]);for(var _0x365d94=0x0;_0x365d94<_0x46224[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x365d94+=0x1){if(_0x46224[_0x4ba3('0x7c')][_0x365d94]['type']&&_[_0x4ba3('0x63')](_0x42bb4b,_0x46224[_0x4ba3('0x7c')][_0x365d94]['type'])&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7e')]&&_0x46224['joins'][_0x365d94]['foreignTable']&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]){_0x5c7fc2[_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x33')]](_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x46224['table'],_0x46224[_0x4ba3('0x7c')][_0x365d94]['parentKey'],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]));}}}if(_0x46224[_0x4ba3('0x82')]){_0x46224[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x82')]);_0x5c7fc2['where'](_0x34cc21(_0x46224[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x3a4838=_0x5c7fc2[_0x4ba3('0x83')]();_0x5c7fc2['limit'](_0x20c849);_0x5c7fc2[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x5c7fc2[_0x4ba3('0x86')]());return dbH[_0x4ba3('0x87')][_0x4ba3('0x35')](_0x5c7fc2[_0x4ba3('0x86')](),{'type':dbH['sequelize']['QueryTypes'][_0x4ba3('0x88')]});}})['then'](respondWithResult(_0x4fa64d,null))[_0x4ba3('0x51')](handleError(_0x4fa64d,null));};function runReport(_0x15508f,_0x108679,_0x20f7db){var _0x5a3c63=_0x108679['name'];var _0x2d16e5=0xa;var _0x2b2132=['join',_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x1e8232={'SUM':_0x4ba3('0x59'),'COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':_0x4ba3('0x8a'),'GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x13dbc4={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5aa412=function(_0x4ec70e){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),_0x4ba3('0x65'),_0x4ba3('0x66')],_0x4ec70e);};var _0x333a97=function(_0x30d7a9){if(!_0x30d7a9||!_0x30d7a9['rules'][_0x4ba3('0x3c')]){return'';}for(var _0x4cd4a2='(',_0x31a725=0x0;_0x31a725<_0x30d7a9['rules'][_0x4ba3('0x3c')];_0x31a725+=0x1){_0x31a725>0x0&&(_0x4cd4a2+='\x20'+_0x30d7a9[_0x4ba3('0x68')]+'\x20');_0x4cd4a2+=_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x69')]?_0x333a97(_0x30d7a9[_0x4ba3('0x67')][_0x31a725]['group']):_0x30d7a9['rules'][_0x31a725][_0x4ba3('0x6a')]+'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')]+(_0x5aa412(_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')])?'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x8c')]:'');}return _0x4cd4a2+')';};var _0x3d8606={'where':{'id':_0x15508f['id']}},_0x2d00e3,_0x35441e,_0x217ea4,_0x40dcee,_0x5ea9d0;_0x3d8606=_[_0x4ba3('0x43')]({},_0x3d8606,_0x20f7db);return db['AnalyticDefaultReport'][_0x4ba3('0x4a')](_0x3d8606)[_0x4ba3('0x26')](function(_0x17b970){if(_0x17b970){_0x2d00e3=_0x17b970;return _0x17b970[_0x4ba3('0x6c')]();}return null;})['then'](function(_0x2a2dc2){if(_0x2a2dc2){if(!_0x2a2dc2[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x35441e=_0x2a2dc2;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0x3188c8){if(_0x3188c8){_0x217ea4=_['keyBy'](_0x3188c8,'id');var _0x2f793a;var _0x1194a5=squel[_0x4ba3('0x70')]();_0x1194a5[_0x4ba3('0x71')](_0x2d00e3[_0x4ba3('0x72')]);for(var _0x1e2134=0x0;_0x1e2134<_0x35441e['length'];_0x1e2134+=0x1){_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x73')]?_0x217ea4[_0x35441e[_0x1e2134]['MetricId']][_0x4ba3('0x74')]:_0x35441e[_0x1e2134][_0x4ba3('0x6a')];_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x1e8232[_0x35441e[_0x1e2134]['function']],'%s',_0x2f793a):_0x2f793a;_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x13dbc4[_0x35441e[_0x1e2134]['format']],'%s',_0x2f793a):_0x2f793a;if(_0x35441e[_0x1e2134][_0x4ba3('0x78')]){_0x1194a5['group'](_0x2f793a);}_0x35441e[_0x1e2134][_0x4ba3('0x79')]&&_0x1194a5[_0x4ba3('0x8d')](_0x2f793a,_0x35441e[_0x1e2134][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x1194a5[_0x4ba3('0x6a')](_0x2f793a,_0x35441e[_0x1e2134]['alias']||_0x2f793a);}if(_0x2d00e3['joins']){_0x2d00e3[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x7c')]);for(var _0x56244e=0x0;_0x56244e<_0x2d00e3[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x56244e+=0x1){if(_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x2b2132,_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')])&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')]&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')]&&_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x7f')]){_0x1194a5[_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')]](_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x2d00e3[_0x4ba3('0x72')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e]['foreignKey']));}}}if(_0x2d00e3['conditions']){_0x2d00e3[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x82')]);_0x1194a5[_0x4ba3('0x40')](_0x333a97(_0x2d00e3[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x5ea9d0=_0x1194a5[_0x4ba3('0x83')]();_0x1194a5['limit'](_0x2d16e5);_0x1194a5['offset'](0x0);return;}})[_0x4ba3('0x26')](function(){if(_0x108679[_0x4ba3('0x8e')]==='web'){return null;}var _0x4fb6b5=_['merge'](_0x108679,{'name':_0x108679['fullPath']||_0x108679[_0x4ba3('0x2c')]||_0x2d00e3[_0x4ba3('0x2c')],'basename':_0x5a3c63,'savename':util[_0x4ba3('0x77')](_0x4ba3('0x8f'),_0x108679[_0x4ba3('0x2c')]||_0x2d00e3['name'],require(_0x4ba3('0x90'))[_0x4ba3('0x91')](0x4),_0x108679[_0x4ba3('0x8e')]||'csv'),'reportId':_0x2d00e3['id'],'reportType':'default'});return db['AnalyticExtractedReport']['create'](_0x4fb6b5,{'raw':!![]});})[_0x4ba3('0x26')](function(_0x17d501){if(_0x2d00e3[_0x4ba3('0x72')]===_0x4ba3('0x92')){_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3['table']+_0x4ba3('0x93'),_0x108679['startDate'],_0x108679[_0x4ba3('0x94')]);}else{_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3[_0x4ba3('0x72')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x108679[_0x4ba3('0x95')],_0x108679[_0x4ba3('0x94')]);}if(_0x17d501){logger[_0x4ba3('0x96')](_0x4ba3('0x97'),_0x5ea9d0['toString']());require('child_process')[_0x4ba3('0x98')](path[_0x4ba3('0x55')](__dirname,'../../components/export/',_0x17d501[_0x4ba3('0x8e')]),[_0x17d501['id'],_0x5ea9d0['toString'](),path['join'](__dirname,'../../files/reports',_0x17d501['savename']),_0x5a3c63]);return _0x17d501;}else{var _0x2d2ca3=squel[_0x4ba3('0x70')]();_0x2d2ca3[_0x4ba3('0x71')]('('+_0x5ea9d0[_0x4ba3('0x86')]()+')',_0x4ba3('0x99'));_0x2d2ca3['field']('COUNT(*)',_0x4ba3('0x21'));_0x5ea9d0['limit'](_0x108679[_0x4ba3('0x1f')]||_0x2d16e5);_0x5ea9d0[_0x4ba3('0x1e')](_0x108679[_0x4ba3('0x1e')]||0x0);return dbH['sequelize'][_0x4ba3('0x35')](_0x2d2ca3[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]})[_0x4ba3('0x26')](function(_0xc938c){if(!_0xc938c[_0x4ba3('0x3c')]){_0x40dcee=0x0;}else{_0x40dcee=_0xc938c[0x0][_0x4ba3('0x21')]||0x0;}return dbH['sequelize']['query'](_0x5ea9d0[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]});})[_0x4ba3('0x26')](function(_0xd97c26){return{'rows':_0xd97c26||[],'count':_0x40dcee};});}});}exports['run']=function(_0x1fbdc7,_0x9e45ec){return runReport(_0x1fbdc7['params'],_0x1fbdc7[_0x4ba3('0x35')],_0x1fbdc7[_0x4ba3('0x44')])[_0x4ba3('0x26')](respondWithResult(_0x9e45ec,null))[_0x4ba3('0x51')](handleError(_0x9e45ec,null));};exports[_0x4ba3('0x9b')]=runReport;exports[_0x4ba3('0x35')]=function(_0xddfb0c,_0x41c531){var _0x25bf75=0xa;var _0x18bd77=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x2e812b={'SUM':'SUM(%s)','COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':_0x4ba3('0x9c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5dc74f={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':'DATE(%s)','HOUR':_0x4ba3('0x61'),'ROUND':_0x4ba3('0x9d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1590f0=function(_0x5efab9){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),'IS\x20EMPTY',_0x4ba3('0x66')],_0x5efab9);};var _0x4d3262=function(_0x4ad4d3){if(!_0x4ad4d3||!_0x4ad4d3[_0x4ba3('0x67')]['length']){return'';}for(var _0x4529a3='(',_0x9b9c64=0x0;_0x9b9c64<_0x4ad4d3[_0x4ba3('0x67')]['length'];_0x9b9c64+=0x1){_0x9b9c64>0x0&&(_0x4529a3+='\x20'+_0x4ad4d3['operator']+'\x20');_0x4529a3+=_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]?_0x4d3262(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]):_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64]['field']+'\x20'+_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')]+(_0x1590f0(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')])?'\x20'+_0x4ad4d3['rules'][_0x9b9c64][_0x4ba3('0x8c')]:'');}return _0x4529a3+')';};var _0x3073c5={'where':{'id':_0xddfb0c[_0x4ba3('0x49')]['id']}},_0x3d1c11,_0xa41747,_0x25c92c,_0x422a8d,_0x225746;_0x3073c5=_[_0x4ba3('0x43')]({},_0x3073c5,_0xddfb0c[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x3073c5)[_0x4ba3('0x26')](function(_0x3db4c2){if(_0x3db4c2){_0x3d1c11=_0x3db4c2;return _0x3db4c2['getFields']();}return null;})[_0x4ba3('0x26')](function(_0x4a8449){if(_0x4a8449){if(!_0x4a8449[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))](_0x4ba3('0x9e'),0x193);}_0xa41747=_0x4a8449;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0xfaf98a){if(_0xfaf98a){_0x25c92c=_['keyBy'](_0xfaf98a,'id');var _0x30c904;var _0x267801=squel[_0x4ba3('0x70')]();_0x267801[_0x4ba3('0x71')](_0x3d1c11['table']);for(var _0x1bae1b=0x0;_0x1bae1b<_0xa41747[_0x4ba3('0x3c')];_0x1bae1b+=0x1){_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x73')]?_0x25c92c[_0xa41747[_0x1bae1b][_0x4ba3('0x73')]]['metric']:_0xa41747[_0x1bae1b][_0x4ba3('0x6a')];_0x30c904=_0xa41747[_0x1bae1b]['function']?_[_0x4ba3('0x76')](_0x2e812b[_0xa41747[_0x1bae1b][_0x4ba3('0x75')]],'%s',_0x30c904):_0x30c904;_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x5dc74f[_0xa41747[_0x1bae1b]['format']],'%s',_0x30c904):_0x30c904;if(_0xa41747[_0x1bae1b]['groupBy']){_0x267801[_0x4ba3('0x69')](_0x30c904);}_0xa41747[_0x1bae1b][_0x4ba3('0x79')]&&_0x267801[_0x4ba3('0x8d')](_0x30c904,_0xa41747[_0x1bae1b]['orderBy']==='DESC'?![]:!![]);_0x267801[_0x4ba3('0x6a')](_0x30c904,_0xa41747[_0x1bae1b][_0x4ba3('0x7b')]||_0x30c904);}if(_0x3d1c11[_0x4ba3('0x7c')]){_0x3d1c11[_0x4ba3('0x7c')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x7c')]);for(var _0x2f4966=0x0;_0x2f4966<_0x3d1c11[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x2f4966+=0x1){if(_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x18bd77,_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')])&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x80')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7f')]){_0x267801[_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]](_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x3d1c11[_0x4ba3('0x72')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],_0x3d1c11['joins'][_0x2f4966][_0x4ba3('0x7f')]));}}}if(_0x3d1c11[_0x4ba3('0x82')]){_0x3d1c11[_0x4ba3('0x82')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x82')]);_0x267801[_0x4ba3('0x40')](_0x4d3262(_0x3d1c11[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x225746=_0x267801[_0x4ba3('0x83')]();_0x267801[_0x4ba3('0x1f')](_0x25bf75);_0x267801[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x267801['toString']());return dbH[_0x4ba3('0x87')]['query'](_0x267801['toString'](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')]['SELECT']});}})[_0x4ba3('0x26')](function(){return{'sql':_0x225746[_0x4ba3('0x86')]()};})[_0x4ba3('0x26')](respondWithResult(_0x41c531,null))[_0x4ba3('0x51')](handleError(_0x41c531,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 552bfb1..bbc1773 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 _0xc327=['./analyticDefaultReport.attributes','exports','define','analytics_default_reports','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x324eb1,_0x5c4bb3){var _0x51fc21=function(_0x438ca4){while(--_0x438ca4){_0x324eb1['push'](_0x324eb1['shift']());}};_0x51fc21(++_0x5c4bb3);}(_0xc327,0x88));var _0x7c32=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xc327[_0x110c3d];return _0x226d67;};'use strict';var _=require('lodash');var util=require(_0x7c32('0x0'));var logger=require(_0x7c32('0x1'))('api');var moment=require(_0x7c32('0x2'));var BPromise=require(_0x7c32('0x3'));var rp=require(_0x7c32('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7c32('0x5'));var config=require(_0x7c32('0x6'));var attributes=require(_0x7c32('0x7'));module[_0x7c32('0x8')]=function(_0xd391f5,_0xeb3fdd){return _0xd391f5[_0x7c32('0x9')]('AnalyticDefaultReport',attributes,{'tableName':_0x7c32('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8f3e=['bluebird','request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','analytics_default_reports','lodash','util','../../config/logger','moment'];(function(_0x3457b4,_0x4cd8f9){var _0xaa8fa9=function(_0x51897a){while(--_0x51897a){_0x3457b4['push'](_0x3457b4['shift']());}};_0xaa8fa9(++_0x4cd8f9);}(_0x8f3e,0x151));var _0xe8f3=function(_0x5a1f08,_0x562f85){_0x5a1f08=_0x5a1f08-0x0;var _0xdc0e08=_0x8f3e[_0x5a1f08];return _0xdc0e08;};'use strict';var _=require(_0xe8f3('0x0'));var util=require(_0xe8f3('0x1'));var logger=require(_0xe8f3('0x2'))('api');var moment=require(_0xe8f3('0x3'));var BPromise=require(_0xe8f3('0x4'));var rp=require(_0xe8f3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe8f3('0x6'));var config=require(_0xe8f3('0x7'));var attributes=require(_0xe8f3('0x8'));module[_0xe8f3('0x9')]=function(_0x1a0515,_0xf89ce){return _0x1a0515['define']('AnalyticDefaultReport',attributes,{'tableName':_0xe8f3('0xa'),'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 84999a8..43d3fa7 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 _0x7c6a=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x3ed25d,_0x6c37b2){var _0x5e0998=function(_0x3e53a4){while(--_0x3e53a4){_0x3ed25d['push'](_0x3ed25d['shift']());}};_0x5e0998(++_0x6c37b2);}(_0x7c6a,0x1c7));var _0xa7c6=function(_0x55987d,_0x49120d){_0x55987d=_0x55987d-0x0;var _0x238807=_0x7c6a[_0x55987d];return _0x238807;};'use strict';var _=require('lodash');var util=require(_0xa7c6('0x0'));var moment=require(_0xa7c6('0x1'));var BPromise=require(_0xa7c6('0x2'));var rs=require(_0xa7c6('0x3'));var fs=require('fs');var Redis=require(_0xa7c6('0x4'));var db=require(_0xa7c6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa7c6('0x6'))(_0xa7c6('0x7'));var config=require('../../config/environment');var jayson=require(_0xa7c6('0x8'));var client=jayson[_0xa7c6('0x9')][_0xa7c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54620d,_0x24b7c7,_0x2aa958){return new BPromise(function(_0x332b38,_0x1b246e){return client[_0xa7c6('0xb')](_0x54620d,_0x2aa958)[_0xa7c6('0xc')](function(_0x37eb7f){logger[_0xa7c6('0xd')](_0xa7c6('0xe'),_0x24b7c7,_0xa7c6('0xf'));logger[_0xa7c6('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x24b7c7,'request\x20sent',JSON[_0xa7c6('0x11')](_0x37eb7f));if(_0x37eb7f[_0xa7c6('0x12')]){if(_0x37eb7f[_0xa7c6('0x12')][_0xa7c6('0x13')]===0x1f4){logger[_0xa7c6('0x12')](_0xa7c6('0xe'),_0x24b7c7,_0x37eb7f['error'][_0xa7c6('0x14')]);return _0x1b246e(_0x37eb7f['error'][_0xa7c6('0x14')]);}logger[_0xa7c6('0x12')](_0xa7c6('0xe'),_0x24b7c7,_0x37eb7f[_0xa7c6('0x12')][_0xa7c6('0x14')]);return _0x332b38(_0x37eb7f[_0xa7c6('0x12')][_0xa7c6('0x14')]);}else{logger[_0xa7c6('0xd')](_0xa7c6('0xe'),_0x24b7c7,'request\x20sent');_0x332b38(_0x37eb7f[_0xa7c6('0x15')]['message']);}})[_0xa7c6('0x16')](function(_0x271500){logger[_0xa7c6('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x24b7c7,_0x271500);_0x1b246e(_0x271500);});});}
\ No newline at end of file
+var _0xe82b=['code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4a27b5,_0x4fb040){var _0x533b98=function(_0x444f4e){while(--_0x444f4e){_0x4a27b5['push'](_0x4a27b5['shift']());}};_0x533b98(++_0x4fb040);}(_0xe82b,0x9e));var _0xbe82=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xe82b[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0xbe82('0x0'));var util=require(_0xbe82('0x1'));var moment=require(_0xbe82('0x2'));var BPromise=require(_0xbe82('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbe82('0x4'));var db=require(_0xbe82('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbe82('0x6'))(_0xbe82('0x7'));var config=require('../../config/environment');var jayson=require(_0xbe82('0x8'));var client=jayson[_0xbe82('0x9')][_0xbe82('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b67b8,_0x15dc72,_0x4cb776){return new BPromise(function(_0x512ebc,_0x3dcdbc){return client[_0xbe82('0xb')](_0x2b67b8,_0x4cb776)[_0xbe82('0xc')](function(_0xec04f3){logger[_0xbe82('0xd')](_0xbe82('0xe'),_0x15dc72,_0xbe82('0xf'));logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x15dc72,_0xbe82('0xf'),JSON[_0xbe82('0x10')](_0xec04f3));if(_0xec04f3[_0xbe82('0x11')]){if(_0xec04f3[_0xbe82('0x11')][_0xbe82('0x12')]===0x1f4){logger[_0xbe82('0x11')](_0xbe82('0xe'),_0x15dc72,_0xec04f3['error']['message']);return _0x3dcdbc(_0xec04f3['error'][_0xbe82('0x13')]);}logger[_0xbe82('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x15dc72,_0xec04f3[_0xbe82('0x11')][_0xbe82('0x13')]);return _0x512ebc(_0xec04f3['error'][_0xbe82('0x13')]);}else{logger[_0xbe82('0xd')](_0xbe82('0xe'),_0x15dc72,'request\x20sent');_0x512ebc(_0xec04f3[_0xbe82('0x14')]['message']);}})[_0xbe82('0x15')](function(_0x59a14b){logger[_0xbe82('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x15dc72,_0x59a14b);_0x3dcdbc(_0x59a14b);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 0bde5d1..617a580 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 _0xef78=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','/:id/preview','preview','/:id/run','/:id/query','query','post','create','put','delete','destroy','multer'];(function(_0x345c86,_0x2b12e0){var _0x41e895=function(_0x2af8c3){while(--_0x2af8c3){_0x345c86['push'](_0x345c86['shift']());}};_0x41e895(++_0x2b12e0);}(_0xef78,0x18b));var _0x8ef7=function(_0x167945,_0x32eb98){_0x167945=_0x167945-0x0;var _0x2ece10=_0xef78[_0x167945];return _0x2ece10;};'use strict';var multer=require(_0x8ef7('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8ef7('0x1'));var express=require(_0x8ef7('0x2'));var router=express[_0x8ef7('0x3')]();var fs_extra=require(_0x8ef7('0x4'));var auth=require(_0x8ef7('0x5'));var interaction=require(_0x8ef7('0x6'));var config=require(_0x8ef7('0x7'));var controller=require('./analyticDefaultReport.controller');router[_0x8ef7('0x8')]('/',auth['isAuthenticated'](),controller[_0x8ef7('0x9')]);router['get'](_0x8ef7('0xa'),auth[_0x8ef7('0xb')](),controller['show']);router[_0x8ef7('0x8')](_0x8ef7('0xc'),auth[_0x8ef7('0xb')](),controller[_0x8ef7('0xd')]);router[_0x8ef7('0x8')](_0x8ef7('0xe'),auth[_0x8ef7('0xb')](),controller['run']);router[_0x8ef7('0x8')](_0x8ef7('0xf'),auth['isAuthenticated'](),controller[_0x8ef7('0x10')]);router[_0x8ef7('0x11')]('/',auth['isAuthenticated'](),controller[_0x8ef7('0x12')]);router[_0x8ef7('0x13')](_0x8ef7('0xa'),auth[_0x8ef7('0xb')](),controller['update']);router[_0x8ef7('0x14')](_0x8ef7('0xa'),auth[_0x8ef7('0xb')](),controller[_0x8ef7('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0xfbdf=['get','/:id','show','/:id/preview','preview','run','/:id/query','query','post','create','put','update','exports','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index'];(function(_0x1b3a09,_0x20c774){var _0x357bb8=function(_0xd7c6d2){while(--_0xd7c6d2){_0x1b3a09['push'](_0x1b3a09['shift']());}};_0x357bb8(++_0x20c774);}(_0xfbdf,0xd3));var _0xffbd=function(_0x3d784f,_0x100ef1){_0x3d784f=_0x3d784f-0x0;var _0x32340e=_0xfbdf[_0x3d784f];return _0x32340e;};'use strict';var multer=require(_0xffbd('0x0'));var util=require('util');var path=require(_0xffbd('0x1'));var timeout=require(_0xffbd('0x2'));var express=require('express');var router=express[_0xffbd('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xffbd('0x4'));var config=require(_0xffbd('0x5'));var controller=require(_0xffbd('0x6'));router['get']('/',auth[_0xffbd('0x7')](),controller[_0xffbd('0x8')]);router[_0xffbd('0x9')](_0xffbd('0xa'),auth[_0xffbd('0x7')](),controller[_0xffbd('0xb')]);router['get'](_0xffbd('0xc'),auth[_0xffbd('0x7')](),controller[_0xffbd('0xd')]);router['get']('/:id/run',auth[_0xffbd('0x7')](),controller[_0xffbd('0xe')]);router[_0xffbd('0x9')](_0xffbd('0xf'),auth[_0xffbd('0x7')](),controller[_0xffbd('0x10')]);router[_0xffbd('0x11')]('/',auth[_0xffbd('0x7')](),controller[_0xffbd('0x12')]);router[_0xffbd('0x13')](_0xffbd('0xa'),auth[_0xffbd('0x7')](),controller[_0xffbd('0x14')]);router['delete'](_0xffbd('0xa'),auth[_0xffbd('0x7')](),controller['destroy']);module[_0xffbd('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index ecfe146..732aed6 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 _0x366c=['scheduled','INTEGER','UNSIGNED','sequelize','moment','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual'];(function(_0x3902c1,_0x1c9eb2){var _0x1266cc=function(_0x50c2c5){while(--_0x50c2c5){_0x3902c1['push'](_0x3902c1['shift']());}};_0x1266cc(++_0x1c9eb2);}(_0x366c,0x189));var _0xc366=function(_0x23cbed,_0x3f2205){_0x23cbed=_0x23cbed-0x0;var _0xfd017=_0x366c[_0x23cbed];return _0xfd017;};'use strict';var Sequelize=require(_0xc366('0x0'));var moment=require(_0xc366('0x1'));module['exports']={'name':{'type':Sequelize[_0xc366('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xc366('0x3')](_0xc366('0x4'),_0xc366('0x5'),_0xc366('0x6')),'allowNull':![],'defaultValue':_0xc366('0x4')},'savename':{'type':Sequelize[_0xc366('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xc366('0x7')]},'endDate':{'type':Sequelize[_0xc366('0x7')]},'status':{'type':Sequelize[_0xc366('0x2')],'defaultValue':_0xc366('0x8')},'type':{'type':Sequelize[_0xc366('0x3')](_0xc366('0x9'),_0xc366('0xa')),'allowNull':![],'defaultValue':_0xc366('0x9')},'reportId':{'type':Sequelize[_0xc366('0xb')](0xb)[_0xc366('0xc')]},'reportType':{'type':Sequelize[_0xc366('0x2')]}};
\ No newline at end of file
+var _0x3843=['moment','exports','STRING','ENUM','csv','pdf','DATE','Loading','scheduled','INTEGER','UNSIGNED','sequelize'];(function(_0x3c9864,_0x488a3c){var _0x416dcd=function(_0x3f03d6){while(--_0x3f03d6){_0x3c9864['push'](_0x3c9864['shift']());}};_0x416dcd(++_0x488a3c);}(_0x3843,0x17f));var _0x3384=function(_0x19da64,_0x1077d){_0x19da64=_0x19da64-0x0;var _0x4fb532=_0x3843[_0x19da64];return _0x4fb532;};'use strict';var Sequelize=require(_0x3384('0x0'));var moment=require(_0x3384('0x1'));module[_0x3384('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x3384('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x3384('0x4')](_0x3384('0x5'),_0x3384('0x6'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x3384('0x7')]},'endDate':{'type':Sequelize[_0x3384('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x3384('0x8')},'type':{'type':Sequelize[_0x3384('0x4')]('manual',_0x3384('0x9')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x3384('0xa')](0xb)[_0x3384('0xb')]},'reportType':{'type':Sequelize[_0x3384('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 29a947a..dbe5759 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 _0xc052=['fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','index','map','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','AnalyticExtractedReport','includeAll','include','findAll','params','length','find','catch','create','body','user','role','ExtractedReports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','output','root','server/files/reports','savename','ValidationError','exists','join','format','basename','toLowerCase','eml-format','rimraf','zip-dir'];(function(_0x48ecd2,_0x481ad3){var _0x5a4457=function(_0xdd9abd){while(--_0xdd9abd){_0x48ecd2['push'](_0x48ecd2['shift']());}};_0x5a4457(++_0x481ad3);}(_0xc052,0xc5));var _0x2c05=function(_0x11f0ef,_0x4ea920){_0x11f0ef=_0x11f0ef-0x0;var _0x166391=_0xc052[_0x11f0ef];return _0x166391;};'use strict';var emlformat=require(_0x2c05('0x0'));var rimraf=require(_0x2c05('0x1'));var zipdir=require(_0x2c05('0x2'));var jsonpatch=require(_0x2c05('0x3'));var rp=require(_0x2c05('0x4'));var moment=require(_0x2c05('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2c05('0x6'));var util=require(_0x2c05('0x7'));var path=require(_0x2c05('0x8'));var sox=require(_0x2c05('0x9'));var csv=require('to-csv');var ejs=require(_0x2c05('0xa'));var fs=require('fs');var fs_extra=require(_0x2c05('0xb'));var _=require(_0x2c05('0xc'));var squel=require(_0x2c05('0xd'));var crypto=require(_0x2c05('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x2c05('0xf'));var toCsv=require(_0x2c05('0x10'));var querystring=require(_0x2c05('0x11'));var Papa=require(_0x2c05('0x12'));var Redis=require(_0x2c05('0x13'));var authService=require(_0x2c05('0x14'));var qs=require(_0x2c05('0x15'));var as=require(_0x2c05('0x16'));var hardwareService=require(_0x2c05('0x17'));var logger=require(_0x2c05('0x18'))(_0x2c05('0x19'));var utils=require(_0x2c05('0x1a'));var config=require(_0x2c05('0x1b'));var licenseUtil=require(_0x2c05('0x1c'));var db=require(_0x2c05('0x1d'))['db'];function respondWithStatusCode(_0x3ebd5a,_0x2102c4){_0x2102c4=_0x2102c4||0xcc;return function(_0x4dc6b2){if(_0x4dc6b2){return _0x3ebd5a[_0x2c05('0x1e')](_0x2102c4);}return _0x3ebd5a['status'](_0x2102c4)[_0x2c05('0x1f')]();};}function respondWithResult(_0x5a4c17,_0x410fcc){_0x410fcc=_0x410fcc||0xc8;return function(_0x927007){if(_0x927007){return _0x5a4c17[_0x2c05('0x20')](_0x410fcc)[_0x2c05('0x21')](_0x927007);}};}function respondWithFilteredResult(_0x2eb4da,_0x3ced6c){return function(_0x2a2e36){if(_0x2a2e36){var _0x1371b4=typeof _0x3ced6c[_0x2c05('0x22')]==='undefined'&&typeof _0x3ced6c[_0x2c05('0x23')]===_0x2c05('0x24');var _0x25fe6a=_0x2a2e36[_0x2c05('0x25')];var _0x52408a=_0x1371b4?0x0:_0x3ced6c[_0x2c05('0x22')];var _0x18bfba=_0x1371b4?_0x2a2e36[_0x2c05('0x25')]:_0x3ced6c['offset']+_0x3ced6c[_0x2c05('0x23')];var _0x300d60;if(_0x18bfba>=_0x25fe6a){_0x18bfba=_0x25fe6a;_0x300d60=0xc8;}else{_0x300d60=0xce;}_0x2eb4da[_0x2c05('0x20')](_0x300d60);return _0x2eb4da[_0x2c05('0x26')](_0x2c05('0x27'),_0x52408a+'-'+_0x18bfba+'/'+_0x25fe6a)[_0x2c05('0x21')](_0x2a2e36);}return null;};}function patchUpdates(_0x3134b){return function(_0x191a4c){try{jsonpatch[_0x2c05('0x28')](_0x191a4c,_0x3134b,!![]);}catch(_0x4d2326){return BPromise[_0x2c05('0x29')](_0x4d2326);}return _0x191a4c[_0x2c05('0x2a')]();};}function saveUpdates(_0x23af34,_0x3896da){return function(_0x37eab7){if(_0x37eab7){return _0x37eab7[_0x2c05('0x2b')](_0x23af34)[_0x2c05('0x2c')](function(_0x28d232){return _0x28d232;});}return null;};}function removeEntity(_0x39217a,_0x55e45f){return function(_0x19bfc7){if(_0x19bfc7){return _0x19bfc7['destroy']()['then'](function(){var _0x3a50f3=_0x19bfc7[_0x2c05('0x2d')]({'plain':!![]});var _0x1bff4d='ExtractedReports';return db[_0x2c05('0x2e')][_0x2c05('0x2f')]({'where':{'type':_0x1bff4d,'resourceId':_0x3a50f3['id']}})['then'](function(){return _0x19bfc7;});})['then'](function(){_0x39217a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2afbee,_0x36bc2d){return function(_0xa48c5f){if(!_0xa48c5f){_0x2afbee['sendStatus'](0x194);}return _0xa48c5f;};}function handleError(_0x2e6f6f,_0x5a1b61){_0x5a1b61=_0x5a1b61||0x1f4;return function(_0x111ec5){logger[_0x2c05('0x30')](_0x111ec5[_0x2c05('0x31')]);if(_0x111ec5['name']){delete _0x111ec5['name'];}_0x2e6f6f['status'](_0x5a1b61)['send'](_0x111ec5);};}exports[_0x2c05('0x32')]=function(_0x502a0a,_0x341a07){var _0x19137b={},_0x46d8b6={},_0x572284={'count':0x0,'rows':[]};var _0x1151b3=_[_0x2c05('0x33')](db['AnalyticExtractedReport'][_0x2c05('0x34')],function(_0x340eea){return{'name':_0x340eea[_0x2c05('0x35')],'type':_0x340eea[_0x2c05('0x36')][_0x2c05('0x37')]};});_0x46d8b6[_0x2c05('0x38')]=_[_0x2c05('0x33')](_0x1151b3,_0x2c05('0x39'));_0x46d8b6['query']=_[_0x2c05('0x3a')](_0x502a0a[_0x2c05('0x3b')]);_0x46d8b6[_0x2c05('0x3c')]=_[_0x2c05('0x3d')](_0x46d8b6['model'],_0x46d8b6[_0x2c05('0x3b')]);_0x19137b[_0x2c05('0x3e')]=_[_0x2c05('0x3d')](_0x46d8b6[_0x2c05('0x38')],qs['fields'](_0x502a0a['query'][_0x2c05('0x3f')]));_0x19137b[_0x2c05('0x3e')]=_0x19137b[_0x2c05('0x3e')]['length']?_0x19137b[_0x2c05('0x3e')]:_0x46d8b6['model'];if(!_0x502a0a['query'][_0x2c05('0x40')](_0x2c05('0x41'))){_0x19137b[_0x2c05('0x23')]=qs['limit'](_0x502a0a[_0x2c05('0x3b')]['limit']);_0x19137b[_0x2c05('0x22')]=qs[_0x2c05('0x22')](_0x502a0a[_0x2c05('0x3b')][_0x2c05('0x22')]);}_0x19137b['order']=qs[_0x2c05('0x42')](_0x502a0a[_0x2c05('0x3b')]['sort']);_0x19137b[_0x2c05('0x43')]=qs[_0x2c05('0x3c')](_['pick'](_0x502a0a[_0x2c05('0x3b')],_0x46d8b6[_0x2c05('0x3c')]),_0x1151b3);if(_0x502a0a['query'][_0x2c05('0x44')]){_0x19137b[_0x2c05('0x43')]=_[_0x2c05('0x45')](_0x19137b[_0x2c05('0x43')],{'$or':_[_0x2c05('0x33')](_0x1151b3,function(_0x500fb3){if(_0x500fb3['type']!==_0x2c05('0x46')){var _0xd210c1={};_0xd210c1[_0x500fb3[_0x2c05('0x39')]]={'$like':'%'+_0x502a0a[_0x2c05('0x3b')]['filter']+'%'};return _0xd210c1;}})});}_0x19137b=_[_0x2c05('0x45')]({},_0x19137b,_0x502a0a[_0x2c05('0x47')]);var _0xa73181={'where':_0x19137b[_0x2c05('0x43')]};return db[_0x2c05('0x48')][_0x2c05('0x25')](_0xa73181)[_0x2c05('0x2c')](function(_0x7fc80f){_0x572284['count']=_0x7fc80f;if(_0x502a0a['query'][_0x2c05('0x49')]){_0x19137b[_0x2c05('0x4a')]=[{'all':!![]}];}return db[_0x2c05('0x48')][_0x2c05('0x4b')](_0x19137b);})[_0x2c05('0x2c')](function(_0x1d787d){_0x572284['rows']=_0x1d787d;return _0x572284;})['then'](respondWithFilteredResult(_0x341a07,_0x19137b))['catch'](handleError(_0x341a07,null));};exports['show']=function(_0x2c5c5d,_0x27071c){var _0x2dff36={'raw':!![],'where':{'id':_0x2c5c5d[_0x2c05('0x4c')]['id']}},_0x4e6513={};_0x4e6513['model']=_[_0x2c05('0x3a')](db[_0x2c05('0x48')]['rawAttributes']);_0x4e6513[_0x2c05('0x3b')]=_['keys'](_0x2c5c5d[_0x2c05('0x3b')]);_0x4e6513['filters']=_[_0x2c05('0x3d')](_0x4e6513['model'],_0x4e6513['query']);_0x2dff36[_0x2c05('0x3e')]=_[_0x2c05('0x3d')](_0x4e6513[_0x2c05('0x38')],qs[_0x2c05('0x3f')](_0x2c5c5d['query'][_0x2c05('0x3f')]));_0x2dff36[_0x2c05('0x3e')]=_0x2dff36['attributes'][_0x2c05('0x4d')]?_0x2dff36[_0x2c05('0x3e')]:_0x4e6513[_0x2c05('0x38')];if(_0x2c5c5d[_0x2c05('0x3b')][_0x2c05('0x49')]){_0x2dff36[_0x2c05('0x4a')]=[{'all':!![]}];}_0x2dff36=_[_0x2c05('0x45')]({},_0x2dff36,_0x2c5c5d[_0x2c05('0x47')]);return db[_0x2c05('0x48')][_0x2c05('0x4e')](_0x2dff36)[_0x2c05('0x2c')](handleEntityNotFound(_0x27071c,null))[_0x2c05('0x2c')](respondWithResult(_0x27071c,null))[_0x2c05('0x4f')](handleError(_0x27071c,null));};exports[_0x2c05('0x50')]=function(_0x378526,_0x2e530a){return db[_0x2c05('0x48')]['create'](_0x378526[_0x2c05('0x51')],{})[_0x2c05('0x2c')](function(_0x562c6c){var _0x274c74=_0x378526[_0x2c05('0x52')][_0x2c05('0x2d')]({'plain':!![]});if(!_0x274c74)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x274c74[_0x2c05('0x53')]===_0x2c05('0x52')){var _0x38b528=_0x562c6c[_0x2c05('0x2d')]({'plain':!![]});var _0xe590c3=_0x2c05('0x54');return db[_0x2c05('0x55')][_0x2c05('0x4e')]({'where':{'name':_0xe590c3,'userProfileId':_0x274c74[_0x2c05('0x56')]},'raw':!![]})[_0x2c05('0x2c')](function(_0x2a38c0){if(_0x2a38c0&&_0x2a38c0[_0x2c05('0x57')]===0x0){return db[_0x2c05('0x2e')][_0x2c05('0x50')]({'name':_0x38b528[_0x2c05('0x39')],'resourceId':_0x38b528['id'],'type':_0x2a38c0[_0x2c05('0x39')],'sectionId':_0x2a38c0['id']},{})[_0x2c05('0x2c')](function(){return _0x562c6c;});}else{return _0x562c6c;}})[_0x2c05('0x4f')](function(_0x4cc23b){logger['error'](_0x2c05('0x58'),_0x4cc23b);throw _0x4cc23b;});}return _0x562c6c;})[_0x2c05('0x2c')](respondWithResult(_0x2e530a,0xc9))['catch'](handleError(_0x2e530a,null));};exports[_0x2c05('0x2b')]=function(_0xaceb6e,_0x3b7dc8){if(_0xaceb6e[_0x2c05('0x51')]['id']){delete _0xaceb6e[_0x2c05('0x51')]['id'];}return db[_0x2c05('0x48')][_0x2c05('0x4e')]({'where':{'id':_0xaceb6e[_0x2c05('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3b7dc8,null))[_0x2c05('0x2c')](saveUpdates(_0xaceb6e[_0x2c05('0x51')],null))['then'](respondWithResult(_0x3b7dc8,null))[_0x2c05('0x4f')](handleError(_0x3b7dc8,null));};exports[_0x2c05('0x2f')]=function(_0x1a3181,_0x31fd4b){return db[_0x2c05('0x48')]['find']({'where':{'id':_0x1a3181['params']['id']}})[_0x2c05('0x2c')](handleEntityNotFound(_0x31fd4b,null))[_0x2c05('0x2c')](removeEntity(_0x31fd4b,null))[_0x2c05('0x4f')](handleError(_0x31fd4b,null));};exports[_0x2c05('0x59')]=function(_0x463a25,_0x57ce27,_0x5bc87b){return db[_0x2c05('0x48')]['find']({'where':{'id':_0x463a25[_0x2c05('0x4c')]['id']},'attributes':[_0x2c05('0x39'),'basename','savename',_0x2c05('0x5a')],'raw':!![]})[_0x2c05('0x2c')](handleEntityNotFound(_0x57ce27,null))[_0x2c05('0x2c')](function(_0x58ac1c){if(_0x58ac1c){if(!fs['existsSync'](path['join'](config[_0x2c05('0x5b')],_0x2c05('0x5c'),_0x58ac1c[_0x2c05('0x5d')]))){throw new db['Sequelize'][(_0x2c05('0x5e'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x463a25[_0x2c05('0x3b')][_0x2c05('0x5f')]){return _0x57ce27[_0x2c05('0x1e')](0xc8);}return _0x57ce27[_0x2c05('0x59')](path[_0x2c05('0x60')](config['root'],'server/files/reports',_0x58ac1c[_0x2c05('0x5d')]),util[_0x2c05('0x61')]('%s.%s',_0x58ac1c[_0x2c05('0x62')]||_0x58ac1c[_0x2c05('0x39')],_0x58ac1c['output'][_0x2c05('0x63')]()));}})['catch'](handleError(_0x57ce27,null));};
\ No newline at end of file
+var _0x0544=['../../config/environment','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','get','ExtractedReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','params','download','basename','output','existsSync','join','root','savename','Sequelize','ValidationError','server/files/reports','format','%s.%s','toLowerCase','rimraf','zip-dir','fast-json-patch','request-promise','util','path','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x4d8710,_0x422d47){var _0x59a08f=function(_0xeba6c){while(--_0xeba6c){_0x4d8710['push'](_0x4d8710['shift']());}};_0x59a08f(++_0x422d47);}(_0x0544,0xa9));var _0x4054=function(_0x11d95f,_0x34f442){_0x11d95f=_0x11d95f-0x0;var _0x2b1a14=_0x0544[_0x11d95f];return _0x2b1a14;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4054('0x0'));var zipdir=require(_0x4054('0x1'));var jsonpatch=require(_0x4054('0x2'));var rp=require(_0x4054('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4054('0x4'));var path=require(_0x4054('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4054('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4054('0x7'));var squel=require(_0x4054('0x8'));var crypto=require('crypto');var jsforce=require(_0x4054('0x9'));var deskjs=require(_0x4054('0xa'));var toCsv=require('to-csv');var querystring=require(_0x4054('0xb'));var Papa=require('papaparse');var Redis=require(_0x4054('0xc'));var authService=require(_0x4054('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x4054('0xe'));var hardwareService=require(_0x4054('0xf'));var logger=require(_0x4054('0x10'))(_0x4054('0x11'));var utils=require(_0x4054('0x12'));var config=require(_0x4054('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12514c,_0x16c80e){_0x16c80e=_0x16c80e||0xcc;return function(_0x4bc88f){if(_0x4bc88f){return _0x12514c[_0x4054('0x14')](_0x16c80e);}return _0x12514c['status'](_0x16c80e)[_0x4054('0x15')]();};}function respondWithResult(_0x3e3e9f,_0xa50269){_0xa50269=_0xa50269||0xc8;return function(_0x32b9de){if(_0x32b9de){return _0x3e3e9f[_0x4054('0x16')](_0xa50269)[_0x4054('0x17')](_0x32b9de);}};}function respondWithFilteredResult(_0x21c119,_0x1da24e){return function(_0x14cabb){if(_0x14cabb){var _0x43edab=typeof _0x1da24e[_0x4054('0x18')]===_0x4054('0x19')&&typeof _0x1da24e[_0x4054('0x1a')]===_0x4054('0x19');var _0x181712=_0x14cabb['count'];var _0x18e3e1=_0x43edab?0x0:_0x1da24e[_0x4054('0x18')];var _0x54eea4=_0x43edab?_0x14cabb['count']:_0x1da24e[_0x4054('0x18')]+_0x1da24e[_0x4054('0x1a')];var _0x44a0ba;if(_0x54eea4>=_0x181712){_0x54eea4=_0x181712;_0x44a0ba=0xc8;}else{_0x44a0ba=0xce;}_0x21c119[_0x4054('0x16')](_0x44a0ba);return _0x21c119[_0x4054('0x1b')](_0x4054('0x1c'),_0x18e3e1+'-'+_0x54eea4+'/'+_0x181712)[_0x4054('0x17')](_0x14cabb);}return null;};}function patchUpdates(_0x5efe2b){return function(_0x3d0b84){try{jsonpatch[_0x4054('0x1d')](_0x3d0b84,_0x5efe2b,!![]);}catch(_0x3136dc){return BPromise[_0x4054('0x1e')](_0x3136dc);}return _0x3d0b84[_0x4054('0x1f')]();};}function saveUpdates(_0x2a848c,_0x4be10d){return function(_0x135425){if(_0x135425){return _0x135425[_0x4054('0x20')](_0x2a848c)[_0x4054('0x21')](function(_0x22d144){return _0x22d144;});}return null;};}function removeEntity(_0x5771ab,_0x6f88d3){return function(_0x34dcfb){if(_0x34dcfb){return _0x34dcfb['destroy']()['then'](function(){var _0x355ac3=_0x34dcfb[_0x4054('0x22')]({'plain':!![]});var _0x22b35b=_0x4054('0x23');return db[_0x4054('0x24')][_0x4054('0x25')]({'where':{'type':_0x22b35b,'resourceId':_0x355ac3['id']}})['then'](function(){return _0x34dcfb;});})[_0x4054('0x21')](function(){_0x5771ab[_0x4054('0x16')](0xcc)[_0x4054('0x15')]();});}};}function handleEntityNotFound(_0x395a57,_0x2a1e1b){return function(_0x287688){if(!_0x287688){_0x395a57['sendStatus'](0x194);}return _0x287688;};}function handleError(_0x52a21e,_0x2c2f24){_0x2c2f24=_0x2c2f24||0x1f4;return function(_0x29dbaf){logger[_0x4054('0x26')](_0x29dbaf[_0x4054('0x27')]);if(_0x29dbaf[_0x4054('0x28')]){delete _0x29dbaf[_0x4054('0x28')];}_0x52a21e[_0x4054('0x16')](_0x2c2f24)[_0x4054('0x29')](_0x29dbaf);};}exports[_0x4054('0x2a')]=function(_0x436cb2,_0x1b4d71){var _0x57d512={},_0x35b533={},_0x4a83df={'count':0x0,'rows':[]};var _0x327626=_[_0x4054('0x2b')](db[_0x4054('0x2c')][_0x4054('0x2d')],function(_0x16a91f){return{'name':_0x16a91f[_0x4054('0x2e')],'type':_0x16a91f[_0x4054('0x2f')]['key']};});_0x35b533[_0x4054('0x30')]=_[_0x4054('0x2b')](_0x327626,_0x4054('0x28'));_0x35b533[_0x4054('0x31')]=_[_0x4054('0x32')](_0x436cb2[_0x4054('0x31')]);_0x35b533[_0x4054('0x33')]=_[_0x4054('0x34')](_0x35b533[_0x4054('0x30')],_0x35b533[_0x4054('0x31')]);_0x57d512[_0x4054('0x35')]=_[_0x4054('0x34')](_0x35b533['model'],qs['fields'](_0x436cb2['query'][_0x4054('0x36')]));_0x57d512[_0x4054('0x35')]=_0x57d512['attributes'][_0x4054('0x37')]?_0x57d512['attributes']:_0x35b533[_0x4054('0x30')];if(!_0x436cb2['query'][_0x4054('0x38')](_0x4054('0x39'))){_0x57d512[_0x4054('0x1a')]=qs[_0x4054('0x1a')](_0x436cb2[_0x4054('0x31')][_0x4054('0x1a')]);_0x57d512['offset']=qs[_0x4054('0x18')](_0x436cb2['query'][_0x4054('0x18')]);}_0x57d512['order']=qs[_0x4054('0x3a')](_0x436cb2[_0x4054('0x31')][_0x4054('0x3a')]);_0x57d512[_0x4054('0x3b')]=qs[_0x4054('0x33')](_[_0x4054('0x3c')](_0x436cb2[_0x4054('0x31')],_0x35b533[_0x4054('0x33')]),_0x327626);if(_0x436cb2[_0x4054('0x31')][_0x4054('0x3d')]){_0x57d512[_0x4054('0x3b')]=_[_0x4054('0x3e')](_0x57d512[_0x4054('0x3b')],{'$or':_['map'](_0x327626,function(_0x24cab3){if(_0x24cab3['type']!==_0x4054('0x3f')){var _0x2cdf48={};_0x2cdf48[_0x24cab3[_0x4054('0x28')]]={'$like':'%'+_0x436cb2[_0x4054('0x31')]['filter']+'%'};return _0x2cdf48;}})});}_0x57d512=_['merge']({},_0x57d512,_0x436cb2[_0x4054('0x40')]);var _0x11b6a4={'where':_0x57d512[_0x4054('0x3b')]};return db[_0x4054('0x2c')][_0x4054('0x41')](_0x11b6a4)[_0x4054('0x21')](function(_0x37e278){_0x4a83df[_0x4054('0x41')]=_0x37e278;if(_0x436cb2[_0x4054('0x31')][_0x4054('0x42')]){_0x57d512['include']=[{'all':!![]}];}return db[_0x4054('0x2c')][_0x4054('0x43')](_0x57d512);})[_0x4054('0x21')](function(_0x552609){_0x4a83df[_0x4054('0x44')]=_0x552609;return _0x4a83df;})[_0x4054('0x21')](respondWithFilteredResult(_0x1b4d71,_0x57d512))[_0x4054('0x45')](handleError(_0x1b4d71,null));};exports[_0x4054('0x46')]=function(_0x109d28,_0x24b428){var _0x5c9057={'raw':!![],'where':{'id':_0x109d28['params']['id']}},_0x3906a3={};_0x3906a3['model']=_[_0x4054('0x32')](db[_0x4054('0x2c')][_0x4054('0x2d')]);_0x3906a3[_0x4054('0x31')]=_['keys'](_0x109d28['query']);_0x3906a3[_0x4054('0x33')]=_[_0x4054('0x34')](_0x3906a3[_0x4054('0x30')],_0x3906a3[_0x4054('0x31')]);_0x5c9057[_0x4054('0x35')]=_[_0x4054('0x34')](_0x3906a3[_0x4054('0x30')],qs[_0x4054('0x36')](_0x109d28[_0x4054('0x31')][_0x4054('0x36')]));_0x5c9057[_0x4054('0x35')]=_0x5c9057[_0x4054('0x35')][_0x4054('0x37')]?_0x5c9057[_0x4054('0x35')]:_0x3906a3[_0x4054('0x30')];if(_0x109d28['query'][_0x4054('0x42')]){_0x5c9057[_0x4054('0x47')]=[{'all':!![]}];}_0x5c9057=_[_0x4054('0x3e')]({},_0x5c9057,_0x109d28[_0x4054('0x40')]);return db['AnalyticExtractedReport']['find'](_0x5c9057)[_0x4054('0x21')](handleEntityNotFound(_0x24b428,null))[_0x4054('0x21')](respondWithResult(_0x24b428,null))[_0x4054('0x45')](handleError(_0x24b428,null));};exports[_0x4054('0x48')]=function(_0x2f8c35,_0xbadfdd){return db['AnalyticExtractedReport'][_0x4054('0x48')](_0x2f8c35[_0x4054('0x49')],{})[_0x4054('0x21')](function(_0x6e6e11){var _0xb44d59=_0x2f8c35[_0x4054('0x4a')][_0x4054('0x22')]({'plain':!![]});if(!_0xb44d59)throw new Error(_0x4054('0x4b'));if(_0xb44d59[_0x4054('0x4c')]===_0x4054('0x4a')){var _0x2e2436=_0x6e6e11[_0x4054('0x22')]({'plain':!![]});var _0x3ab84c=_0x4054('0x23');return db[_0x4054('0x4d')][_0x4054('0x4e')]({'where':{'name':_0x3ab84c,'userProfileId':_0xb44d59[_0x4054('0x4f')]},'raw':!![]})[_0x4054('0x21')](function(_0xaa0e56){if(_0xaa0e56&&_0xaa0e56['autoAssociation']===0x0){return db[_0x4054('0x24')][_0x4054('0x48')]({'name':_0x2e2436[_0x4054('0x28')],'resourceId':_0x2e2436['id'],'type':_0xaa0e56[_0x4054('0x28')],'sectionId':_0xaa0e56['id']},{})['then'](function(){return _0x6e6e11;});}else{return _0x6e6e11;}})[_0x4054('0x45')](function(_0x2b501e){logger[_0x4054('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b501e);throw _0x2b501e;});}return _0x6e6e11;})[_0x4054('0x21')](respondWithResult(_0xbadfdd,0xc9))[_0x4054('0x45')](handleError(_0xbadfdd,null));};exports[_0x4054('0x20')]=function(_0x214ede,_0x41cb50){if(_0x214ede[_0x4054('0x49')]['id']){delete _0x214ede['body']['id'];}return db[_0x4054('0x2c')][_0x4054('0x4e')]({'where':{'id':_0x214ede[_0x4054('0x50')]['id']}})[_0x4054('0x21')](handleEntityNotFound(_0x41cb50,null))['then'](saveUpdates(_0x214ede[_0x4054('0x49')],null))['then'](respondWithResult(_0x41cb50,null))['catch'](handleError(_0x41cb50,null));};exports['destroy']=function(_0x40107c,_0x81c10){return db[_0x4054('0x2c')][_0x4054('0x4e')]({'where':{'id':_0x40107c[_0x4054('0x50')]['id']}})[_0x4054('0x21')](handleEntityNotFound(_0x81c10,null))['then'](removeEntity(_0x81c10,null))[_0x4054('0x45')](handleError(_0x81c10,null));};exports[_0x4054('0x51')]=function(_0x2a7474,_0x58c494,_0x3e0224){return db[_0x4054('0x2c')][_0x4054('0x4e')]({'where':{'id':_0x2a7474[_0x4054('0x50')]['id']},'attributes':[_0x4054('0x28'),_0x4054('0x52'),'savename',_0x4054('0x53')],'raw':!![]})[_0x4054('0x21')](handleEntityNotFound(_0x58c494,null))['then'](function(_0x6b1965){if(_0x6b1965){if(!fs[_0x4054('0x54')](path[_0x4054('0x55')](config[_0x4054('0x56')],'server/files/reports',_0x6b1965[_0x4054('0x57')]))){throw new db[(_0x4054('0x58'))][(_0x4054('0x59'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x2a7474[_0x4054('0x31')]['exists']){return _0x58c494[_0x4054('0x14')](0xc8);}return _0x58c494[_0x4054('0x51')](path[_0x4054('0x55')](config[_0x4054('0x56')],_0x4054('0x5a'),_0x6b1965['savename']),util[_0x4054('0x5b')](_0x4054('0x5c'),_0x6b1965[_0x4054('0x52')]||_0x6b1965[_0x4054('0x28')],_0x6b1965[_0x4054('0x53')][_0x4054('0x5d')]()));}})['catch'](handleError(_0x58c494,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 7bbaf61..6fa39b5 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 _0x3883=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','lodash','util'];(function(_0x284863,_0x57e83e){var _0x4562d7=function(_0xbd103f){while(--_0xbd103f){_0x284863['push'](_0x284863['shift']());}};_0x4562d7(++_0x57e83e);}(_0x3883,0x108));var _0x3388=function(_0x4ffd7a,_0x57ae41){_0x4ffd7a=_0x4ffd7a-0x0;var _0x336ecc=_0x3883[_0x4ffd7a];return _0x336ecc;};'use strict';var _=require(_0x3388('0x0'));var util=require(_0x3388('0x1'));var logger=require(_0x3388('0x2'))(_0x3388('0x3'));var moment=require(_0x3388('0x4'));var BPromise=require(_0x3388('0x5'));var rp=require(_0x3388('0x6'));var fs=require('fs');var path=require(_0x3388('0x7'));var rimraf=require(_0x3388('0x8'));var config=require(_0x3388('0x9'));var attributes=require(_0x3388('0xa'));module[_0x3388('0xb')]=function(_0x4118b8,_0x15d917){return _0x4118b8[_0x3388('0xc')](_0x3388('0xd'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x17e8=['define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','moment','bluebird','request-promise','../../config/environment','./analyticExtractedReport.attributes','exports'];(function(_0x1d3d43,_0x26fe51){var _0x24bef2=function(_0x5d7584){while(--_0x5d7584){_0x1d3d43['push'](_0x1d3d43['shift']());}};_0x24bef2(++_0x26fe51);}(_0x17e8,0x1b0));var _0x817e=function(_0x514c1b,_0x855465){_0x514c1b=_0x514c1b-0x0;var _0x496988=_0x17e8[_0x514c1b];return _0x496988;};'use strict';var _=require(_0x817e('0x0'));var util=require('util');var logger=require(_0x817e('0x1'))('api');var moment=require(_0x817e('0x2'));var BPromise=require(_0x817e('0x3'));var rp=require(_0x817e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x817e('0x5'));var attributes=require(_0x817e('0x6'));module[_0x817e('0x7')]=function(_0x5cd417,_0x2d117a){return _0x5cd417[_0x817e('0x8')](_0x817e('0x9'),attributes,{'tableName':_0x817e('0xa'),'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 6563014..0541d28 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 _0x7f65=['AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2ef951,_0x29f086){var _0x124295=function(_0x41abd4){while(--_0x41abd4){_0x2ef951['push'](_0x2ef951['shift']());}};_0x124295(++_0x29f086);}(_0x7f65,0x91));var _0x57f6=function(_0x193634,_0xb42415){_0x193634=_0x193634-0x0;var _0x3b5955=_0x7f65[_0x193634];return _0x3b5955;};'use strict';var _=require(_0x57f6('0x0'));var util=require(_0x57f6('0x1'));var moment=require(_0x57f6('0x2'));var BPromise=require(_0x57f6('0x3'));var rs=require(_0x57f6('0x4'));var fs=require('fs');var Redis=require(_0x57f6('0x5'));var db=require(_0x57f6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x57f6('0x7'))('rpc');var config=require(_0x57f6('0x8'));var jayson=require(_0x57f6('0x9'));var client=jayson['client'][_0x57f6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa34d28,_0x2d6d12,_0xedaa76){return new BPromise(function(_0x3dcd2a,_0x3cfd38){return client[_0x57f6('0xb')](_0xa34d28,_0xedaa76)[_0x57f6('0xc')](function(_0x128fda){logger['info'](_0x57f6('0xd'),_0x2d6d12,_0x57f6('0xe'));logger[_0x57f6('0xf')](_0x57f6('0x10'),_0x2d6d12,_0x57f6('0xe'),JSON[_0x57f6('0x11')](_0x128fda));if(_0x128fda[_0x57f6('0x12')]){if(_0x128fda['error'][_0x57f6('0x13')]===0x1f4){logger[_0x57f6('0x12')](_0x57f6('0xd'),_0x2d6d12,_0x128fda[_0x57f6('0x12')][_0x57f6('0x14')]);return _0x3cfd38(_0x128fda[_0x57f6('0x12')][_0x57f6('0x14')]);}logger['error'](_0x57f6('0xd'),_0x2d6d12,_0x128fda['error'][_0x57f6('0x14')]);return _0x3dcd2a(_0x128fda['error'][_0x57f6('0x14')]);}else{logger[_0x57f6('0x15')](_0x57f6('0xd'),_0x2d6d12,'request\x20sent');_0x3dcd2a(_0x128fda['result'][_0x57f6('0x14')]);}})[_0x57f6('0x16')](function(_0x1e3290){logger[_0x57f6('0x12')](_0x57f6('0xd'),_0x2d6d12,_0x1e3290);_0x3cfd38(_0x1e3290);});});}
\ No newline at end of file
+var _0xb7d0=['debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','AnalyticExtractedReport,\x20%s,\x20%s','message','info','result','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent'];(function(_0x17a0c1,_0x2f9964){var _0x20baab=function(_0x1fdfb9){while(--_0x1fdfb9){_0x17a0c1['push'](_0x17a0c1['shift']());}};_0x20baab(++_0x2f9964);}(_0xb7d0,0x93));var _0x0b7d=function(_0x3df1c2,_0x1d32db){_0x3df1c2=_0x3df1c2-0x0;var _0x70d3e8=_0xb7d0[_0x3df1c2];return _0x70d3e8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0b7d('0x0'));var BPromise=require(_0x0b7d('0x1'));var rs=require(_0x0b7d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0b7d('0x3'))['db'];var utils=require(_0x0b7d('0x4'));var logger=require(_0x0b7d('0x5'))(_0x0b7d('0x6'));var config=require(_0x0b7d('0x7'));var jayson=require(_0x0b7d('0x8'));var client=jayson['client'][_0x0b7d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa454e6,_0x1e2245,_0xe050d7){return new BPromise(function(_0x362394,_0x31b10c){return client[_0x0b7d('0xa')](_0xa454e6,_0xe050d7)[_0x0b7d('0xb')](function(_0x4bafec){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x1e2245,_0x0b7d('0xc'));logger[_0x0b7d('0xd')](_0x0b7d('0xe'),_0x1e2245,_0x0b7d('0xc'),JSON['stringify'](_0x4bafec));if(_0x4bafec[_0x0b7d('0xf')]){if(_0x4bafec[_0x0b7d('0xf')]['code']===0x1f4){logger[_0x0b7d('0xf')](_0x0b7d('0x10'),_0x1e2245,_0x4bafec[_0x0b7d('0xf')][_0x0b7d('0x11')]);return _0x31b10c(_0x4bafec[_0x0b7d('0xf')][_0x0b7d('0x11')]);}logger[_0x0b7d('0xf')](_0x0b7d('0x10'),_0x1e2245,_0x4bafec[_0x0b7d('0xf')][_0x0b7d('0x11')]);return _0x362394(_0x4bafec[_0x0b7d('0xf')][_0x0b7d('0x11')]);}else{logger[_0x0b7d('0x12')](_0x0b7d('0x10'),_0x1e2245,_0x0b7d('0xc'));_0x362394(_0x4bafec[_0x0b7d('0x13')][_0x0b7d('0x11')]);}})['catch'](function(_0x2c0b9a){logger[_0x0b7d('0xf')](_0x0b7d('0x10'),_0x1e2245,_0x2c0b9a);_0x31b10c(_0x2c0b9a);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 91c3cb8..dce391e 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 _0x3f8c=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1edbe7,_0x140075){var _0x46f827=function(_0x4a0a95){while(--_0x4a0a95){_0x1edbe7['push'](_0x1edbe7['shift']());}};_0x46f827(++_0x140075);}(_0x3f8c,0x7a));var _0xc3f8=function(_0x404341,_0x1d23d8){_0x404341=_0x404341-0x0;var _0x578bdd=_0x3f8c[_0x404341];return _0x578bdd;};'use strict';var multer=require(_0xc3f8('0x0'));var util=require(_0xc3f8('0x1'));var path=require(_0xc3f8('0x2'));var timeout=require(_0xc3f8('0x3'));var express=require(_0xc3f8('0x4'));var router=express[_0xc3f8('0x5')]();var fs_extra=require(_0xc3f8('0x6'));var auth=require(_0xc3f8('0x7'));var interaction=require(_0xc3f8('0x8'));var config=require(_0xc3f8('0x9'));var controller=require(_0xc3f8('0xa'));router[_0xc3f8('0xb')]('/',auth[_0xc3f8('0xc')](),controller[_0xc3f8('0xd')]);router['get'](_0xc3f8('0xe'),auth['isAuthenticated'](),controller[_0xc3f8('0xf')]);router[_0xc3f8('0xb')](_0xc3f8('0x10'),auth[_0xc3f8('0xc')](),controller[_0xc3f8('0x11')]);router[_0xc3f8('0x12')]('/',auth[_0xc3f8('0xc')](),controller[_0xc3f8('0x13')]);router[_0xc3f8('0x14')](_0xc3f8('0xe'),auth['isAuthenticated'](),controller[_0xc3f8('0x15')]);router[_0xc3f8('0x16')](_0xc3f8('0xe'),auth[_0xc3f8('0xc')](),controller[_0xc3f8('0x17')]);module[_0xc3f8('0x18')]=router;
\ No newline at end of file
+var _0x0042=['put','update','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post'];(function(_0x48e9c8,_0x23f0de){var _0x456afa=function(_0x5b2fb0){while(--_0x5b2fb0){_0x48e9c8['push'](_0x48e9c8['shift']());}};_0x456afa(++_0x23f0de);}(_0x0042,0x158));var _0x2004=function(_0x4c8a8f,_0x997ef){_0x4c8a8f=_0x4c8a8f-0x0;var _0x404500=_0x0042[_0x4c8a8f];return _0x404500;};'use strict';var multer=require('multer');var util=require(_0x2004('0x0'));var path=require(_0x2004('0x1'));var timeout=require(_0x2004('0x2'));var express=require(_0x2004('0x3'));var router=express[_0x2004('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2004('0x5'));var interaction=require(_0x2004('0x6'));var config=require(_0x2004('0x7'));var controller=require('./analyticExtractedReport.controller');router[_0x2004('0x8')]('/',auth[_0x2004('0x9')](),controller[_0x2004('0xa')]);router[_0x2004('0x8')](_0x2004('0xb'),auth['isAuthenticated'](),controller[_0x2004('0xc')]);router['get'](_0x2004('0xd'),auth[_0x2004('0x9')](),controller[_0x2004('0xe')]);router[_0x2004('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2004('0x10')](_0x2004('0xb'),auth[_0x2004('0x9')](),controller[_0x2004('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x2004('0x12')]);module[_0x2004('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 4290d70..9c47ccf 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 _0x0da5=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x564b82,_0x4c0db0){var _0x4111d9=function(_0x3d0b66){while(--_0x3d0b66){_0x564b82['push'](_0x564b82['shift']());}};_0x4111d9(++_0x4c0db0);}(_0x0da5,0x18f));var _0x50da=function(_0x9c9ec2,_0x1f7eb1){_0x9c9ec2=_0x9c9ec2-0x0;var _0x1d6877=_0x0da5[_0x9c9ec2];return _0x1d6877;};'use strict';var Sequelize=require(_0x50da('0x0'));module[_0x50da('0x1')]={'field':{'type':Sequelize[_0x50da('0x2')]},'alias':{'type':Sequelize[_0x50da('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x50da('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x50da('0x3')]},'custom':{'type':Sequelize[_0x50da('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xc7f5=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0xd8d422,_0x2a29cb){var _0x554af6=function(_0x4f5385){while(--_0x4f5385){_0xd8d422['push'](_0xd8d422['shift']());}};_0x554af6(++_0x2a29cb);}(_0xc7f5,0x1ef));var _0x5c7f=function(_0x2486a4,_0x3e3650){_0x2486a4=_0x2486a4-0x0;var _0x14cf68=_0xc7f5[_0x2486a4];return _0x14cf68;};'use strict';var Sequelize=require(_0x5c7f('0x0'));module[_0x5c7f('0x1')]={'field':{'type':Sequelize[_0x5c7f('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x5c7f('0x3')]},'groupBy':{'type':Sequelize[_0x5c7f('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x5c7f('0x3')]},'custom':{'type':Sequelize[_0x5c7f('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 6bf2c16..a2ae96c 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 _0xd9e4=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','fields','find','catch','create','body','bulkCreate','update','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','error','stack','name','send','map','AnalyticFieldReport','fieldName','type','model','keys','query','filters','intersection','attributes','length'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xd9e4,0x1f4));var _0x4d9e=function(_0x2bbdc4,_0x2cb88e){_0x2bbdc4=_0x2bbdc4-0x0;var _0x482d0c=_0xd9e4[_0x2bbdc4];return _0x482d0c;};'use strict';var emlformat=require(_0x4d9e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4d9e('0x1'));var jsonpatch=require(_0x4d9e('0x2'));var rp=require(_0x4d9e('0x3'));var moment=require(_0x4d9e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4d9e('0x5'));var util=require(_0x4d9e('0x6'));var path=require(_0x4d9e('0x7'));var sox=require(_0x4d9e('0x8'));var csv=require(_0x4d9e('0x9'));var ejs=require(_0x4d9e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4d9e('0xb'));var squel=require(_0x4d9e('0xc'));var crypto=require('crypto');var jsforce=require(_0x4d9e('0xd'));var deskjs=require(_0x4d9e('0xe'));var toCsv=require(_0x4d9e('0x9'));var querystring=require('querystring');var Papa=require(_0x4d9e('0xf'));var Redis=require('ioredis');var authService=require(_0x4d9e('0x10'));var qs=require(_0x4d9e('0x11'));var as=require(_0x4d9e('0x12'));var hardwareService=require(_0x4d9e('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x4d9e('0x14'));var config=require(_0x4d9e('0x15'));var licenseUtil=require(_0x4d9e('0x16'));var db=require(_0x4d9e('0x17'))['db'];function respondWithStatusCode(_0x19a6e9,_0x3324d2){_0x3324d2=_0x3324d2||0xcc;return function(_0x26eb9b){if(_0x26eb9b){return _0x19a6e9[_0x4d9e('0x18')](_0x3324d2);}return _0x19a6e9['status'](_0x3324d2)[_0x4d9e('0x19')]();};}function respondWithResult(_0xeae0a1,_0x40fe85){_0x40fe85=_0x40fe85||0xc8;return function(_0x553155){if(_0x553155){return _0xeae0a1[_0x4d9e('0x1a')](_0x40fe85)[_0x4d9e('0x1b')](_0x553155);}};}function respondWithFilteredResult(_0x1fc925,_0xb0b1b0){return function(_0x2ee7f5){if(_0x2ee7f5){var _0x152057=typeof _0xb0b1b0[_0x4d9e('0x1c')]===_0x4d9e('0x1d')&&typeof _0xb0b1b0[_0x4d9e('0x1e')]==='undefined';var _0x369fe0=_0x2ee7f5['count'];var _0x583d50=_0x152057?0x0:_0xb0b1b0['offset'];var _0x4dcb99=_0x152057?_0x2ee7f5[_0x4d9e('0x1f')]:_0xb0b1b0[_0x4d9e('0x1c')]+_0xb0b1b0[_0x4d9e('0x1e')];var _0x2fbbe0;if(_0x4dcb99>=_0x369fe0){_0x4dcb99=_0x369fe0;_0x2fbbe0=0xc8;}else{_0x2fbbe0=0xce;}_0x1fc925['status'](_0x2fbbe0);return _0x1fc925[_0x4d9e('0x20')]('Content-Range',_0x583d50+'-'+_0x4dcb99+'/'+_0x369fe0)[_0x4d9e('0x1b')](_0x2ee7f5);}return null;};}function patchUpdates(_0x258f71){return function(_0x282d7e){try{jsonpatch[_0x4d9e('0x21')](_0x282d7e,_0x258f71,!![]);}catch(_0x3a40b8){return BPromise[_0x4d9e('0x22')](_0x3a40b8);}return _0x282d7e[_0x4d9e('0x23')]();};}function saveUpdates(_0x1b3d01,_0x34cf6a){return function(_0x35aa55){if(_0x35aa55){return _0x35aa55['update'](_0x1b3d01)[_0x4d9e('0x24')](function(_0x26b921){return _0x26b921;});}return null;};}function removeEntity(_0x564679,_0x2b1731){return function(_0x154a6e){if(_0x154a6e){return _0x154a6e[_0x4d9e('0x25')]()[_0x4d9e('0x24')](function(){_0x564679['status'](0xcc)[_0x4d9e('0x19')]();});}};}function handleEntityNotFound(_0x52acfe,_0x4984fb){return function(_0x3003e2){if(!_0x3003e2){_0x52acfe['sendStatus'](0x194);}return _0x3003e2;};}function handleError(_0x25cd21,_0x15878b){_0x15878b=_0x15878b||0x1f4;return function(_0x3aaa43){logger[_0x4d9e('0x26')](_0x3aaa43[_0x4d9e('0x27')]);if(_0x3aaa43['name']){delete _0x3aaa43[_0x4d9e('0x28')];}_0x25cd21[_0x4d9e('0x1a')](_0x15878b)[_0x4d9e('0x29')](_0x3aaa43);};}exports['index']=function(_0x5360c5,_0x3a09c0){var _0x8cd97={},_0x14c022={},_0x5d210d={'count':0x0,'rows':[]};var _0xf18497=_[_0x4d9e('0x2a')](db[_0x4d9e('0x2b')]['rawAttributes'],function(_0x1cccb0){return{'name':_0x1cccb0[_0x4d9e('0x2c')],'type':_0x1cccb0[_0x4d9e('0x2d')]['key']};});_0x14c022[_0x4d9e('0x2e')]=_[_0x4d9e('0x2a')](_0xf18497,_0x4d9e('0x28'));_0x14c022['query']=_[_0x4d9e('0x2f')](_0x5360c5[_0x4d9e('0x30')]);_0x14c022[_0x4d9e('0x31')]=_[_0x4d9e('0x32')](_0x14c022[_0x4d9e('0x2e')],_0x14c022['query']);_0x8cd97[_0x4d9e('0x33')]=_[_0x4d9e('0x32')](_0x14c022[_0x4d9e('0x2e')],qs['fields'](_0x5360c5['query']['fields']));_0x8cd97['attributes']=_0x8cd97[_0x4d9e('0x33')][_0x4d9e('0x34')]?_0x8cd97[_0x4d9e('0x33')]:_0x14c022['model'];if(!_0x5360c5[_0x4d9e('0x30')]['hasOwnProperty']('nolimit')){_0x8cd97[_0x4d9e('0x1e')]=qs['limit'](_0x5360c5[_0x4d9e('0x30')][_0x4d9e('0x1e')]);_0x8cd97[_0x4d9e('0x1c')]=qs[_0x4d9e('0x1c')](_0x5360c5[_0x4d9e('0x30')][_0x4d9e('0x1c')]);}_0x8cd97[_0x4d9e('0x35')]=qs['sort'](_0x5360c5['query'][_0x4d9e('0x36')]);_0x8cd97[_0x4d9e('0x37')]=qs[_0x4d9e('0x31')](_[_0x4d9e('0x38')](_0x5360c5['query'],_0x14c022[_0x4d9e('0x31')]),_0xf18497);if(_0x5360c5[_0x4d9e('0x30')][_0x4d9e('0x39')]){_0x8cd97[_0x4d9e('0x37')]=_[_0x4d9e('0x3a')](_0x8cd97[_0x4d9e('0x37')],{'$or':_[_0x4d9e('0x2a')](_0xf18497,function(_0x362e75){if(_0x362e75[_0x4d9e('0x2d')]!==_0x4d9e('0x3b')){var _0x1acd1c={};_0x1acd1c[_0x362e75['name']]={'$like':'%'+_0x5360c5[_0x4d9e('0x30')][_0x4d9e('0x39')]+'%'};return _0x1acd1c;}})});}_0x8cd97=_[_0x4d9e('0x3a')]({},_0x8cd97,_0x5360c5[_0x4d9e('0x3c')]);var _0x5cf4ab={'where':_0x8cd97[_0x4d9e('0x37')]};return db[_0x4d9e('0x2b')]['count'](_0x5cf4ab)[_0x4d9e('0x24')](function(_0x414b2b){_0x5d210d[_0x4d9e('0x1f')]=_0x414b2b;if(_0x5360c5[_0x4d9e('0x30')][_0x4d9e('0x3d')]){_0x8cd97[_0x4d9e('0x3e')]=[{'all':!![]}];}return db[_0x4d9e('0x2b')][_0x4d9e('0x3f')](_0x8cd97);})['then'](function(_0x418495){_0x5d210d[_0x4d9e('0x40')]=_0x418495;return _0x5d210d;})[_0x4d9e('0x24')](respondWithFilteredResult(_0x3a09c0,_0x8cd97))['catch'](handleError(_0x3a09c0,null));};exports['show']=function(_0x160bc9,_0x7dc052){var _0x232293={'raw':![],'where':{'id':_0x160bc9[_0x4d9e('0x41')]['id']}},_0x5912a0={};_0x5912a0[_0x4d9e('0x2e')]=_[_0x4d9e('0x2f')](db['AnalyticFieldReport'][_0x4d9e('0x42')]);_0x5912a0[_0x4d9e('0x30')]=_[_0x4d9e('0x2f')](_0x160bc9[_0x4d9e('0x30')]);_0x5912a0[_0x4d9e('0x31')]=_[_0x4d9e('0x32')](_0x5912a0[_0x4d9e('0x2e')],_0x5912a0[_0x4d9e('0x30')]);_0x232293['attributes']=_['intersection'](_0x5912a0[_0x4d9e('0x2e')],qs[_0x4d9e('0x43')](_0x160bc9[_0x4d9e('0x30')][_0x4d9e('0x43')]));_0x232293[_0x4d9e('0x33')]=_0x232293[_0x4d9e('0x33')][_0x4d9e('0x34')]?_0x232293[_0x4d9e('0x33')]:_0x5912a0[_0x4d9e('0x2e')];if(_0x160bc9[_0x4d9e('0x30')][_0x4d9e('0x3d')]){_0x232293['include']=[{'all':!![]}];}_0x232293=_[_0x4d9e('0x3a')]({},_0x232293,_0x160bc9[_0x4d9e('0x3c')]);return db[_0x4d9e('0x2b')][_0x4d9e('0x44')](_0x232293)[_0x4d9e('0x24')](handleEntityNotFound(_0x7dc052,null))[_0x4d9e('0x24')](respondWithResult(_0x7dc052,null))[_0x4d9e('0x45')](handleError(_0x7dc052,null));};exports[_0x4d9e('0x46')]=function(_0xb73e6a,_0x4d98fc){return db[_0x4d9e('0x2b')][_0x4d9e('0x46')](_0xb73e6a[_0x4d9e('0x47')],{})[_0x4d9e('0x24')](respondWithResult(_0x4d98fc,0xc9))[_0x4d9e('0x45')](handleError(_0x4d98fc,null));};exports[_0x4d9e('0x48')]=function(_0x5e5562,_0x162f2c){return db['AnalyticFieldReport']['bulkCreate'](_0x5e5562['body'],{'raw':![],'individualHooks':!![]})[_0x4d9e('0x24')](respondWithResult(_0x162f2c,0xc9))[_0x4d9e('0x45')](handleError(_0x162f2c,null));};exports[_0x4d9e('0x49')]=function(_0xa61d11,_0x57b3b1){if(_0xa61d11[_0x4d9e('0x47')]['id']){delete _0xa61d11['body']['id'];}return db[_0x4d9e('0x2b')][_0x4d9e('0x44')]({'where':{'id':_0xa61d11['params']['id']}})[_0x4d9e('0x24')](handleEntityNotFound(_0x57b3b1,null))['then'](saveUpdates(_0xa61d11[_0x4d9e('0x47')],null))[_0x4d9e('0x24')](respondWithResult(_0x57b3b1,null))[_0x4d9e('0x45')](handleError(_0x57b3b1,null));};exports[_0x4d9e('0x25')]=function(_0x2bfc02,_0x44fbc9){return db[_0x4d9e('0x2b')][_0x4d9e('0x44')]({'where':{'id':_0x2bfc02[_0x4d9e('0x41')]['id']}})[_0x4d9e('0x24')](handleEntityNotFound(_0x44fbc9,null))['then'](removeEntity(_0x44fbc9,null))[_0x4d9e('0x45')](handleError(_0x44fbc9,null));};exports['bulkDestroy']=function(_0x1865ab,_0x426e20){return db[_0x4d9e('0x2b')][_0x4d9e('0x25')]({'where':{'id':_0x1865ab[_0x4d9e('0x30')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x426e20,0xcc))[_0x4d9e('0x45')](handleError(_0x426e20,null));};exports[_0x4d9e('0x4a')]=function(_0x3e7675,_0x3a53a2,_0x5919e5){return db[_0x4d9e('0x4b')]['findOne']({'where':{'id':_0x3e7675[_0x4d9e('0x41')]['id']}})['then'](handleEntityNotFound(_0x3a53a2,null))[_0x4d9e('0x24')](function(_0x20ecc1){if(_0x20ecc1){return db[_0x4d9e('0x4c')][_0x4d9e('0x4d')](function(_0x371644){return db['AnalyticFieldReport'][_0x4d9e('0x25')]({'where':{'CustomReportId':_0x3e7675[_0x4d9e('0x41')]['id']},'transaction':_0x371644})[_0x4d9e('0x24')](function(_0x27fb11){var _0xf6cc07=_[_0x4d9e('0x2a')](_0x3e7675[_0x4d9e('0x47')],function(_0x44b3df){delete _0x44b3df['id'];_0x44b3df[_0x4d9e('0x4e')]=_0x3e7675[_0x4d9e('0x41')]['id'];return _0x44b3df;});return db[_0x4d9e('0x2b')][_0x4d9e('0x48')](_0xf6cc07,{'transaction':_0x371644});});})[_0x4d9e('0x24')](function(){return db['AnalyticFieldReport'][_0x4d9e('0x3f')]({'where':{'CustomReportId':_0x3e7675['params']['id']}});});}})[_0x4d9e('0x24')](respondWithResult(_0x3a53a2,null))[_0x4d9e('0x45')](handleError(_0x3a53a2,null));};
\ No newline at end of file
+var _0xdfe4=['send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','bulkCreate','bulkDestroy','ids','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','fs-extra','squel','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','error','stack'];(function(_0xe3fb5b,_0x2ee4c3){var _0x2b8d2e=function(_0x2a96f3){while(--_0x2a96f3){_0xe3fb5b['push'](_0xe3fb5b['shift']());}};_0x2b8d2e(++_0x2ee4c3);}(_0xdfe4,0x11a));var _0x4dfe=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xdfe4[_0x49ca18];return _0x145d54;};'use strict';var emlformat=require(_0x4dfe('0x0'));var rimraf=require(_0x4dfe('0x1'));var zipdir=require(_0x4dfe('0x2'));var jsonpatch=require(_0x4dfe('0x3'));var rp=require(_0x4dfe('0x4'));var moment=require('moment');var BPromise=require(_0x4dfe('0x5'));var Mustache=require(_0x4dfe('0x6'));var util=require(_0x4dfe('0x7'));var path=require(_0x4dfe('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4dfe('0x9'));var _=require('lodash');var squel=require(_0x4dfe('0xa'));var crypto=require(_0x4dfe('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4dfe('0xc'));var toCsv=require(_0x4dfe('0xd'));var querystring=require('querystring');var Papa=require(_0x4dfe('0xe'));var Redis=require('ioredis');var authService=require(_0x4dfe('0xf'));var qs=require(_0x4dfe('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4dfe('0x11'))(_0x4dfe('0x12'));var utils=require('../../config/utils');var config=require(_0x4dfe('0x13'));var licenseUtil=require(_0x4dfe('0x14'));var db=require(_0x4dfe('0x15'))['db'];function respondWithStatusCode(_0x30b342,_0x276810){_0x276810=_0x276810||0xcc;return function(_0x391490){if(_0x391490){return _0x30b342[_0x4dfe('0x16')](_0x276810);}return _0x30b342[_0x4dfe('0x17')](_0x276810)[_0x4dfe('0x18')]();};}function respondWithResult(_0x32c03a,_0x311f70){_0x311f70=_0x311f70||0xc8;return function(_0x8ce64c){if(_0x8ce64c){return _0x32c03a['status'](_0x311f70)[_0x4dfe('0x19')](_0x8ce64c);}};}function respondWithFilteredResult(_0x2ad6d9,_0x15016a){return function(_0x22e6e7){if(_0x22e6e7){var _0x4a38aa=typeof _0x15016a['offset']===_0x4dfe('0x1a')&&typeof _0x15016a[_0x4dfe('0x1b')]===_0x4dfe('0x1a');var _0x5024cd=_0x22e6e7[_0x4dfe('0x1c')];var _0x36ef8c=_0x4a38aa?0x0:_0x15016a[_0x4dfe('0x1d')];var _0x33fa93=_0x4a38aa?_0x22e6e7[_0x4dfe('0x1c')]:_0x15016a[_0x4dfe('0x1d')]+_0x15016a[_0x4dfe('0x1b')];var _0x515d89;if(_0x33fa93>=_0x5024cd){_0x33fa93=_0x5024cd;_0x515d89=0xc8;}else{_0x515d89=0xce;}_0x2ad6d9[_0x4dfe('0x17')](_0x515d89);return _0x2ad6d9[_0x4dfe('0x1e')]('Content-Range',_0x36ef8c+'-'+_0x33fa93+'/'+_0x5024cd)[_0x4dfe('0x19')](_0x22e6e7);}return null;};}function patchUpdates(_0x4bf754){return function(_0x153cf5){try{jsonpatch[_0x4dfe('0x1f')](_0x153cf5,_0x4bf754,!![]);}catch(_0x4bb43d){return BPromise['reject'](_0x4bb43d);}return _0x153cf5[_0x4dfe('0x20')]();};}function saveUpdates(_0x295e68,_0x54b9ea){return function(_0x347304){if(_0x347304){return _0x347304[_0x4dfe('0x21')](_0x295e68)[_0x4dfe('0x22')](function(_0x258415){return _0x258415;});}return null;};}function removeEntity(_0xe2fe1d,_0x5919fb){return function(_0x398fa5){if(_0x398fa5){return _0x398fa5[_0x4dfe('0x23')]()[_0x4dfe('0x22')](function(){_0xe2fe1d[_0x4dfe('0x17')](0xcc)[_0x4dfe('0x18')]();});}};}function handleEntityNotFound(_0x37c320,_0x23f22f){return function(_0x418a46){if(!_0x418a46){_0x37c320[_0x4dfe('0x16')](0x194);}return _0x418a46;};}function handleError(_0x27e269,_0x1a6044){_0x1a6044=_0x1a6044||0x1f4;return function(_0x40bd17){logger[_0x4dfe('0x24')](_0x40bd17[_0x4dfe('0x25')]);if(_0x40bd17['name']){delete _0x40bd17['name'];}_0x27e269[_0x4dfe('0x17')](_0x1a6044)[_0x4dfe('0x26')](_0x40bd17);};}exports[_0x4dfe('0x27')]=function(_0x4ea3f5,_0x5b7ea){var _0x1d08d7={},_0x26d9c5={},_0x47549c={'count':0x0,'rows':[]};var _0x4e3b9d=_[_0x4dfe('0x28')](db[_0x4dfe('0x29')][_0x4dfe('0x2a')],function(_0x3c9824){return{'name':_0x3c9824[_0x4dfe('0x2b')],'type':_0x3c9824[_0x4dfe('0x2c')][_0x4dfe('0x2d')]};});_0x26d9c5['model']=_['map'](_0x4e3b9d,_0x4dfe('0x2e'));_0x26d9c5[_0x4dfe('0x2f')]=_[_0x4dfe('0x30')](_0x4ea3f5[_0x4dfe('0x2f')]);_0x26d9c5[_0x4dfe('0x31')]=_[_0x4dfe('0x32')](_0x26d9c5[_0x4dfe('0x33')],_0x26d9c5[_0x4dfe('0x2f')]);_0x1d08d7[_0x4dfe('0x34')]=_[_0x4dfe('0x32')](_0x26d9c5[_0x4dfe('0x33')],qs[_0x4dfe('0x35')](_0x4ea3f5[_0x4dfe('0x2f')][_0x4dfe('0x35')]));_0x1d08d7[_0x4dfe('0x34')]=_0x1d08d7[_0x4dfe('0x34')]['length']?_0x1d08d7[_0x4dfe('0x34')]:_0x26d9c5[_0x4dfe('0x33')];if(!_0x4ea3f5[_0x4dfe('0x2f')][_0x4dfe('0x36')](_0x4dfe('0x37'))){_0x1d08d7[_0x4dfe('0x1b')]=qs[_0x4dfe('0x1b')](_0x4ea3f5[_0x4dfe('0x2f')][_0x4dfe('0x1b')]);_0x1d08d7[_0x4dfe('0x1d')]=qs[_0x4dfe('0x1d')](_0x4ea3f5[_0x4dfe('0x2f')][_0x4dfe('0x1d')]);}_0x1d08d7['order']=qs[_0x4dfe('0x38')](_0x4ea3f5[_0x4dfe('0x2f')][_0x4dfe('0x38')]);_0x1d08d7[_0x4dfe('0x39')]=qs[_0x4dfe('0x31')](_[_0x4dfe('0x3a')](_0x4ea3f5['query'],_0x26d9c5['filters']),_0x4e3b9d);if(_0x4ea3f5[_0x4dfe('0x2f')][_0x4dfe('0x3b')]){_0x1d08d7['where']=_[_0x4dfe('0x3c')](_0x1d08d7[_0x4dfe('0x39')],{'$or':_[_0x4dfe('0x28')](_0x4e3b9d,function(_0x2bdc79){if(_0x2bdc79[_0x4dfe('0x2c')]!==_0x4dfe('0x3d')){var _0x4c7960={};_0x4c7960[_0x2bdc79[_0x4dfe('0x2e')]]={'$like':'%'+_0x4ea3f5['query'][_0x4dfe('0x3b')]+'%'};return _0x4c7960;}})});}_0x1d08d7=_['merge']({},_0x1d08d7,_0x4ea3f5[_0x4dfe('0x3e')]);var _0x1d030a={'where':_0x1d08d7[_0x4dfe('0x39')]};return db[_0x4dfe('0x29')][_0x4dfe('0x1c')](_0x1d030a)[_0x4dfe('0x22')](function(_0x7a6421){_0x47549c[_0x4dfe('0x1c')]=_0x7a6421;if(_0x4ea3f5[_0x4dfe('0x2f')][_0x4dfe('0x3f')]){_0x1d08d7[_0x4dfe('0x40')]=[{'all':!![]}];}return db[_0x4dfe('0x29')][_0x4dfe('0x41')](_0x1d08d7);})[_0x4dfe('0x22')](function(_0x5ac233){_0x47549c[_0x4dfe('0x42')]=_0x5ac233;return _0x47549c;})[_0x4dfe('0x22')](respondWithFilteredResult(_0x5b7ea,_0x1d08d7))[_0x4dfe('0x43')](handleError(_0x5b7ea,null));};exports[_0x4dfe('0x44')]=function(_0x5bc77e,_0x22c043){var _0x309eec={'raw':![],'where':{'id':_0x5bc77e[_0x4dfe('0x45')]['id']}},_0x4bc0d5={};_0x4bc0d5[_0x4dfe('0x33')]=_['keys'](db['AnalyticFieldReport'][_0x4dfe('0x2a')]);_0x4bc0d5['query']=_[_0x4dfe('0x30')](_0x5bc77e[_0x4dfe('0x2f')]);_0x4bc0d5[_0x4dfe('0x31')]=_[_0x4dfe('0x32')](_0x4bc0d5[_0x4dfe('0x33')],_0x4bc0d5['query']);_0x309eec[_0x4dfe('0x34')]=_[_0x4dfe('0x32')](_0x4bc0d5['model'],qs['fields'](_0x5bc77e[_0x4dfe('0x2f')][_0x4dfe('0x35')]));_0x309eec[_0x4dfe('0x34')]=_0x309eec[_0x4dfe('0x34')][_0x4dfe('0x46')]?_0x309eec[_0x4dfe('0x34')]:_0x4bc0d5[_0x4dfe('0x33')];if(_0x5bc77e[_0x4dfe('0x2f')][_0x4dfe('0x3f')]){_0x309eec['include']=[{'all':!![]}];}_0x309eec=_[_0x4dfe('0x3c')]({},_0x309eec,_0x5bc77e[_0x4dfe('0x3e')]);return db[_0x4dfe('0x29')][_0x4dfe('0x47')](_0x309eec)[_0x4dfe('0x22')](handleEntityNotFound(_0x22c043,null))[_0x4dfe('0x22')](respondWithResult(_0x22c043,null))[_0x4dfe('0x43')](handleError(_0x22c043,null));};exports['create']=function(_0x4addc8,_0x23dc1b){return db[_0x4dfe('0x29')][_0x4dfe('0x48')](_0x4addc8[_0x4dfe('0x49')],{})[_0x4dfe('0x22')](respondWithResult(_0x23dc1b,0xc9))[_0x4dfe('0x43')](handleError(_0x23dc1b,null));};exports[_0x4dfe('0x4a')]=function(_0x48435b,_0x17fa03){return db['AnalyticFieldReport'][_0x4dfe('0x4a')](_0x48435b[_0x4dfe('0x49')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x17fa03,0xc9))[_0x4dfe('0x43')](handleError(_0x17fa03,null));};exports['update']=function(_0x1d6c27,_0x3bb0bb){if(_0x1d6c27[_0x4dfe('0x49')]['id']){delete _0x1d6c27[_0x4dfe('0x49')]['id'];}return db[_0x4dfe('0x29')][_0x4dfe('0x47')]({'where':{'id':_0x1d6c27[_0x4dfe('0x45')]['id']}})[_0x4dfe('0x22')](handleEntityNotFound(_0x3bb0bb,null))[_0x4dfe('0x22')](saveUpdates(_0x1d6c27['body'],null))['then'](respondWithResult(_0x3bb0bb,null))[_0x4dfe('0x43')](handleError(_0x3bb0bb,null));};exports[_0x4dfe('0x23')]=function(_0x2ab389,_0x47a857){return db[_0x4dfe('0x29')]['find']({'where':{'id':_0x2ab389['params']['id']}})[_0x4dfe('0x22')](handleEntityNotFound(_0x47a857,null))[_0x4dfe('0x22')](removeEntity(_0x47a857,null))[_0x4dfe('0x43')](handleError(_0x47a857,null));};exports[_0x4dfe('0x4b')]=function(_0x2c1337,_0x51d460){return db[_0x4dfe('0x29')]['destroy']({'where':{'id':_0x2c1337[_0x4dfe('0x2f')][_0x4dfe('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0x4dfe('0x22')](respondWithResult(_0x51d460,0xcc))[_0x4dfe('0x43')](handleError(_0x51d460,null));};exports['addFields']=function(_0x3657fc,_0x50e9e1,_0xaa0abd){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x3657fc['params']['id']}})[_0x4dfe('0x22')](handleEntityNotFound(_0x50e9e1,null))['then'](function(_0x2f999d){if(_0x2f999d){return db[_0x4dfe('0x4d')][_0x4dfe('0x4e')](function(_0x19b00b){return db['AnalyticFieldReport'][_0x4dfe('0x23')]({'where':{'CustomReportId':_0x3657fc['params']['id']},'transaction':_0x19b00b})['then'](function(_0x5e5e55){var _0x16d64e=_[_0x4dfe('0x28')](_0x3657fc['body'],function(_0x2bc798){delete _0x2bc798['id'];_0x2bc798[_0x4dfe('0x4f')]=_0x3657fc[_0x4dfe('0x45')]['id'];return _0x2bc798;});return db['AnalyticFieldReport'][_0x4dfe('0x4a')](_0x16d64e,{'transaction':_0x19b00b});});})[_0x4dfe('0x22')](function(){return db['AnalyticFieldReport'][_0x4dfe('0x41')]({'where':{'CustomReportId':_0x3657fc[_0x4dfe('0x45')]['id']}});});}})[_0x4dfe('0x22')](respondWithResult(_0x50e9e1,null))['catch'](handleError(_0x50e9e1,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 1679b6f..cbab671 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 _0x73f9=['analytics_report_fields','lodash','util','api','bluebird','request-promise','path','rimraf','define','AnalyticFieldReport'];(function(_0x4d8dc3,_0x585fd1){var _0x9b03d9=function(_0x7a31d5){while(--_0x7a31d5){_0x4d8dc3['push'](_0x4d8dc3['shift']());}};_0x9b03d9(++_0x585fd1);}(_0x73f9,0xf1));var _0x973f=function(_0x351579,_0x30565e){_0x351579=_0x351579-0x0;var _0x49f081=_0x73f9[_0x351579];return _0x49f081;};'use strict';var _=require(_0x973f('0x0'));var util=require(_0x973f('0x1'));var logger=require('../../config/logger')(_0x973f('0x2'));var moment=require('moment');var BPromise=require(_0x973f('0x3'));var rp=require(_0x973f('0x4'));var fs=require('fs');var path=require(_0x973f('0x5'));var rimraf=require(_0x973f('0x6'));var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0x1bd2ac,_0x48e3b5){return _0x1bd2ac[_0x973f('0x7')](_0x973f('0x8'),attributes,{'tableName':_0x973f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2326=['bluebird','path','rimraf','../../config/environment','exports','analytics_report_fields','lodash','util'];(function(_0x16dcd6,_0x547aa4){var _0x49fe35=function(_0x328d09){while(--_0x328d09){_0x16dcd6['push'](_0x16dcd6['shift']());}};_0x49fe35(++_0x547aa4);}(_0x2326,0x6e));var _0x6232=function(_0x7d0db5,_0x3e92e5){_0x7d0db5=_0x7d0db5-0x0;var _0x8ffb01=_0x2326[_0x7d0db5];return _0x8ffb01;};'use strict';var _=require(_0x6232('0x0'));var util=require(_0x6232('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x6232('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6232('0x3'));var rimraf=require(_0x6232('0x4'));var config=require(_0x6232('0x5'));var attributes=require('./analyticFieldReport.attributes');module[_0x6232('0x6')]=function(_0x4d4f8d,_0x426ee1){return _0x4d4f8d['define']('AnalyticFieldReport',attributes,{'tableName':_0x6232('0x7'),'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 ffba23d..10e68ef 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 _0x79f2=['info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x17d3b9,_0x168ca1){var _0x2697e4=function(_0x5ff832){while(--_0x5ff832){_0x17d3b9['push'](_0x17d3b9['shift']());}};_0x2697e4(++_0x168ca1);}(_0x79f2,0xfb));var _0x279f=function(_0x317c7a,_0x31641c){_0x317c7a=_0x317c7a-0x0;var _0x49d02f=_0x79f2[_0x317c7a];return _0x49d02f;};'use strict';var _=require(_0x279f('0x0'));var util=require(_0x279f('0x1'));var moment=require('moment');var BPromise=require(_0x279f('0x2'));var rs=require(_0x279f('0x3'));var fs=require('fs');var Redis=require(_0x279f('0x4'));var db=require(_0x279f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x279f('0x6'));var config=require(_0x279f('0x7'));var jayson=require(_0x279f('0x8'));var client=jayson[_0x279f('0x9')][_0x279f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x456d81,_0x253a59,_0x3683d6){return new BPromise(function(_0x2d9ef0,_0x180253){return client[_0x279f('0xb')](_0x456d81,_0x3683d6)[_0x279f('0xc')](function(_0x281967){logger[_0x279f('0xd')](_0x279f('0xe'),_0x253a59,_0x279f('0xf'));logger['debug'](_0x279f('0x10'),_0x253a59,_0x279f('0xf'),JSON['stringify'](_0x281967));if(_0x281967[_0x279f('0x11')]){if(_0x281967[_0x279f('0x11')][_0x279f('0x12')]===0x1f4){logger[_0x279f('0x11')](_0x279f('0xe'),_0x253a59,_0x281967['error']['message']);return _0x180253(_0x281967[_0x279f('0x11')][_0x279f('0x13')]);}logger[_0x279f('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x253a59,_0x281967[_0x279f('0x11')][_0x279f('0x13')]);return _0x2d9ef0(_0x281967['error'][_0x279f('0x13')]);}else{logger[_0x279f('0xd')](_0x279f('0xe'),_0x253a59,_0x279f('0xf'));_0x2d9ef0(_0x281967[_0x279f('0x14')][_0x279f('0x13')]);}})[_0x279f('0x15')](function(_0x57175b){logger[_0x279f('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x253a59,_0x57175b);_0x180253(_0x57175b);});});}
\ No newline at end of file
+var _0x70c1=['randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x70c1,0xcb));var _0x170c=function(_0x3364e1,_0x45966d){_0x3364e1=_0x3364e1-0x0;var _0x1e5e03=_0x70c1[_0x3364e1];return _0x1e5e03;};'use strict';var _=require(_0x170c('0x0'));var util=require(_0x170c('0x1'));var moment=require(_0x170c('0x2'));var BPromise=require(_0x170c('0x3'));var rs=require(_0x170c('0x4'));var fs=require('fs');var Redis=require(_0x170c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x170c('0x6'));var logger=require('../../config/logger')(_0x170c('0x7'));var config=require(_0x170c('0x8'));var jayson=require(_0x170c('0x9'));var client=jayson[_0x170c('0xa')][_0x170c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c8f9f,_0x25348a,_0x3ef8e4){return new BPromise(function(_0x304f2a,_0x267a7a){return client[_0x170c('0xc')](_0x3c8f9f,_0x3ef8e4)['then'](function(_0x5e9a96){logger[_0x170c('0xd')](_0x170c('0xe'),_0x25348a,'request\x20sent');logger[_0x170c('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x25348a,_0x170c('0x10'),JSON[_0x170c('0x11')](_0x5e9a96));if(_0x5e9a96[_0x170c('0x12')]){if(_0x5e9a96[_0x170c('0x12')][_0x170c('0x13')]===0x1f4){logger[_0x170c('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x25348a,_0x5e9a96[_0x170c('0x12')]['message']);return _0x267a7a(_0x5e9a96[_0x170c('0x12')][_0x170c('0x14')]);}logger[_0x170c('0x12')](_0x170c('0xe'),_0x25348a,_0x5e9a96[_0x170c('0x12')]['message']);return _0x304f2a(_0x5e9a96[_0x170c('0x12')][_0x170c('0x14')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x25348a,'request\x20sent');_0x304f2a(_0x5e9a96[_0x170c('0x15')][_0x170c('0x14')]);}})[_0x170c('0x16')](function(_0x35f205){logger[_0x170c('0x12')](_0x170c('0xe'),_0x25348a,_0x35f205);_0x267a7a(_0x35f205);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index eb73fad..f61bab1 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(_0x491784,_0x4527e8){var _0x2d6ecb=function(_0x2881e3){while(--_0x2881e3){_0x491784['push'](_0x491784['shift']());}};_0x2d6ecb(++_0x4527e8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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(_0x34f24b,_0x2eff8a){var _0x1026e1=function(_0x2993e1){while(--_0x2993e1){_0x34f24b['push'](_0x34f24b['shift']());}};_0x1026e1(++_0x2eff8a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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 0687b09..4a7a494 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 _0xc901=['STRING','sequelize','TEXT'];(function(_0x318995,_0x3c241d){var _0x512a01=function(_0x47964f){while(--_0x47964f){_0x318995['push'](_0x318995['shift']());}};_0x512a01(++_0x3c241d);}(_0xc901,0x142));var _0x1c90=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc901[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x1c90('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x1c90('0x1')]},'description':{'type':Sequelize[_0x1c90('0x2')]}};
\ No newline at end of file
+var _0x049e=['TEXT','STRING','sequelize','exports','name'];(function(_0x5cba0e,_0x4fb1a6){var _0x5e1e19=function(_0x76779c){while(--_0x76779c){_0x5cba0e['push'](_0x5cba0e['shift']());}};_0x5e1e19(++_0x4fb1a6);}(_0x049e,0x16a));var _0xe049=function(_0x55821d,_0x27a22e){_0x55821d=_0x55821d-0x0;var _0x58ea8a=_0x049e[_0x55821d];return _0x58ea8a;};'use strict';var Sequelize=require(_0xe049('0x0'));module[_0xe049('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe049('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xe049('0x3')]},'description':{'type':Sequelize[_0xe049('0x4')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 12ca2e0..9ce5042 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 _0xe14b=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','keys','length','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','params','eml-format','rimraf','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring'];(function(_0x20882a,_0xaf0f58){var _0x555dc8=function(_0x458a71){while(--_0x458a71){_0x20882a['push'](_0x20882a['shift']());}};_0x555dc8(++_0xaf0f58);}(_0xe14b,0x93));var _0xbe14=function(_0x5eedd2,_0x2da0a5){_0x5eedd2=_0x5eedd2-0x0;var _0x1719e1=_0xe14b[_0x5eedd2];return _0x1719e1;};'use strict';var emlformat=require(_0xbe14('0x0'));var rimraf=require(_0xbe14('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbe14('0x2'));var moment=require(_0xbe14('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbe14('0x4'));var util=require('util');var path=require('path');var sox=require(_0xbe14('0x5'));var csv=require(_0xbe14('0x6'));var ejs=require(_0xbe14('0x7'));var fs=require('fs');var fs_extra=require(_0xbe14('0x8'));var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var licenseUtil=require(_0xbe14('0x14'));var db=require(_0xbe14('0x15'))['db'];function respondWithStatusCode(_0x27792f,_0x3b898d){_0x3b898d=_0x3b898d||0xcc;return function(_0x23a730){if(_0x23a730){return _0x27792f[_0xbe14('0x16')](_0x3b898d);}return _0x27792f[_0xbe14('0x17')](_0x3b898d)[_0xbe14('0x18')]();};}function respondWithResult(_0x1e4826,_0x33fd54){_0x33fd54=_0x33fd54||0xc8;return function(_0x813399){if(_0x813399){return _0x1e4826['status'](_0x33fd54)['json'](_0x813399);}};}function respondWithFilteredResult(_0x3f58f5,_0x3dc4a9){return function(_0xf4ac9){if(_0xf4ac9){var _0x37ce4e=typeof _0x3dc4a9['offset']===_0xbe14('0x19')&&typeof _0x3dc4a9[_0xbe14('0x1a')]===_0xbe14('0x19');var _0x123ede=_0xf4ac9[_0xbe14('0x1b')];var _0x29ab73=_0x37ce4e?0x0:_0x3dc4a9[_0xbe14('0x1c')];var _0x5ea1f8=_0x37ce4e?_0xf4ac9[_0xbe14('0x1b')]:_0x3dc4a9[_0xbe14('0x1c')]+_0x3dc4a9[_0xbe14('0x1a')];var _0x433459;if(_0x5ea1f8>=_0x123ede){_0x5ea1f8=_0x123ede;_0x433459=0xc8;}else{_0x433459=0xce;}_0x3f58f5[_0xbe14('0x17')](_0x433459);return _0x3f58f5[_0xbe14('0x1d')]('Content-Range',_0x29ab73+'-'+_0x5ea1f8+'/'+_0x123ede)[_0xbe14('0x1e')](_0xf4ac9);}return null;};}function patchUpdates(_0x4a1bbd){return function(_0x417c8d){try{jsonpatch[_0xbe14('0x1f')](_0x417c8d,_0x4a1bbd,!![]);}catch(_0x188ec4){return BPromise['reject'](_0x188ec4);}return _0x417c8d[_0xbe14('0x20')]();};}function saveUpdates(_0x56d845,_0x3c1c85){return function(_0x56e80c){if(_0x56e80c){return _0x56e80c[_0xbe14('0x21')](_0x56d845)['then'](function(_0x274018){return _0x274018;});}return null;};}function removeEntity(_0x3d3608,_0x505dbd){return function(_0x2da350){if(_0x2da350){return _0x2da350['destroy']()[_0xbe14('0x22')](function(){var _0x4851f8=_0x2da350[_0xbe14('0x23')]({'plain':!![]});var _0x5fa043=_0xbe14('0x24');return db[_0xbe14('0x25')][_0xbe14('0x26')]({'where':{'type':_0x5fa043,'resourceId':_0x4851f8['id']}})[_0xbe14('0x22')](function(){return _0x2da350;});})['then'](function(){_0x3d3608[_0xbe14('0x17')](0xcc)[_0xbe14('0x18')]();});}};}function handleEntityNotFound(_0x391556,_0x169369){return function(_0x5dd475){if(!_0x5dd475){_0x391556[_0xbe14('0x16')](0x194);}return _0x5dd475;};}function handleError(_0x29fc64,_0x59bf34){_0x59bf34=_0x59bf34||0x1f4;return function(_0x3c3613){logger[_0xbe14('0x27')](_0x3c3613[_0xbe14('0x28')]);if(_0x3c3613[_0xbe14('0x29')]){delete _0x3c3613[_0xbe14('0x29')];}_0x29fc64[_0xbe14('0x17')](_0x59bf34)[_0xbe14('0x2a')](_0x3c3613);};}exports[_0xbe14('0x2b')]=function(_0x4168c8,_0x16a159){var _0x40538f={},_0x3bf43c={},_0x39dc0a={'count':0x0,'rows':[]};var _0x10ae36=_[_0xbe14('0x2c')](db[_0xbe14('0x2d')][_0xbe14('0x2e')],function(_0x2ff48e){return{'name':_0x2ff48e[_0xbe14('0x2f')],'type':_0x2ff48e[_0xbe14('0x30')]['key']};});_0x3bf43c[_0xbe14('0x31')]=_['map'](_0x10ae36,'name');_0x3bf43c[_0xbe14('0x32')]=_['keys'](_0x4168c8[_0xbe14('0x32')]);_0x3bf43c[_0xbe14('0x33')]=_['intersection'](_0x3bf43c['model'],_0x3bf43c['query']);_0x40538f[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x3bf43c['model'],qs[_0xbe14('0x36')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x36')]));_0x40538f[_0xbe14('0x34')]=_0x40538f[_0xbe14('0x34')]['length']?_0x40538f['attributes']:_0x3bf43c[_0xbe14('0x31')];if(!_0x4168c8['query']['hasOwnProperty']('nolimit')){_0x40538f[_0xbe14('0x1a')]=qs[_0xbe14('0x1a')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1a')]);_0x40538f[_0xbe14('0x1c')]=qs[_0xbe14('0x1c')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1c')]);}_0x40538f[_0xbe14('0x37')]=qs[_0xbe14('0x38')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x38')]);_0x40538f['where']=qs['filters'](_[_0xbe14('0x39')](_0x4168c8[_0xbe14('0x32')],_0x3bf43c[_0xbe14('0x33')]),_0x10ae36);if(_0x4168c8['query'][_0xbe14('0x3a')]){_0x40538f[_0xbe14('0x3b')]=_[_0xbe14('0x3c')](_0x40538f[_0xbe14('0x3b')],{'$or':_[_0xbe14('0x2c')](_0x10ae36,function(_0x25ee1f){if(_0x25ee1f[_0xbe14('0x30')]!==_0xbe14('0x3d')){var _0x1b2608={};_0x1b2608[_0x25ee1f['name']]={'$like':'%'+_0x4168c8[_0xbe14('0x32')][_0xbe14('0x3a')]+'%'};return _0x1b2608;}})});}_0x40538f=_[_0xbe14('0x3c')]({},_0x40538f,_0x4168c8[_0xbe14('0x3e')]);var _0x3287b9={'where':_0x40538f[_0xbe14('0x3b')]};return db['AnalyticMetric'][_0xbe14('0x1b')](_0x3287b9)[_0xbe14('0x22')](function(_0x1220c9){_0x39dc0a[_0xbe14('0x1b')]=_0x1220c9;if(_0x4168c8['query']['includeAll']){_0x40538f[_0xbe14('0x3f')]=[{'all':!![]}];}return db[_0xbe14('0x2d')][_0xbe14('0x40')](_0x40538f);})['then'](function(_0x5d5318){_0x39dc0a[_0xbe14('0x41')]=_0x5d5318;return _0x39dc0a;})['then'](respondWithFilteredResult(_0x16a159,_0x40538f))['catch'](handleError(_0x16a159,null));};exports[_0xbe14('0x42')]=function(_0x1f0355,_0x8216c3){var _0x5051e4={'raw':!![],'where':{'id':_0x1f0355['params']['id']}},_0x558525={};_0x558525[_0xbe14('0x31')]=_[_0xbe14('0x43')](db[_0xbe14('0x2d')]['rawAttributes']);_0x558525[_0xbe14('0x32')]=_[_0xbe14('0x43')](_0x1f0355[_0xbe14('0x32')]);_0x558525[_0xbe14('0x33')]=_['intersection'](_0x558525['model'],_0x558525[_0xbe14('0x32')]);_0x5051e4[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x558525[_0xbe14('0x31')],qs[_0xbe14('0x36')](_0x1f0355['query']['fields']));_0x5051e4[_0xbe14('0x34')]=_0x5051e4[_0xbe14('0x34')][_0xbe14('0x44')]?_0x5051e4[_0xbe14('0x34')]:_0x558525['model'];if(_0x1f0355[_0xbe14('0x32')][_0xbe14('0x45')]){_0x5051e4['include']=[{'all':!![]}];}_0x5051e4=_[_0xbe14('0x3c')]({},_0x5051e4,_0x1f0355[_0xbe14('0x3e')]);return db[_0xbe14('0x2d')][_0xbe14('0x46')](_0x5051e4)['then'](handleEntityNotFound(_0x8216c3,null))['then'](respondWithResult(_0x8216c3,null))[_0xbe14('0x47')](handleError(_0x8216c3,null));};exports[_0xbe14('0x48')]=function(_0x4a1a37,_0x5acf90){return db[_0xbe14('0x2d')][_0xbe14('0x48')](_0x4a1a37[_0xbe14('0x49')],{})[_0xbe14('0x22')](function(_0xdbc6e1){var _0xd04fd5=_0x4a1a37[_0xbe14('0x4a')]['get']({'plain':!![]});if(!_0xd04fd5)throw new Error(_0xbe14('0x4b'));if(_0xd04fd5[_0xbe14('0x4c')]===_0xbe14('0x4a')){var _0x22b1f8=_0xdbc6e1[_0xbe14('0x23')]({'plain':!![]});var _0x494c32=_0xbe14('0x24');return db[_0xbe14('0x4d')][_0xbe14('0x46')]({'where':{'name':_0x494c32,'userProfileId':_0xd04fd5[_0xbe14('0x4e')]},'raw':!![]})[_0xbe14('0x22')](function(_0x2dbeb1){if(_0x2dbeb1&&_0x2dbeb1['autoAssociation']===0x0){return db['UserProfileResource'][_0xbe14('0x48')]({'name':_0x22b1f8[_0xbe14('0x29')],'resourceId':_0x22b1f8['id'],'type':_0x2dbeb1[_0xbe14('0x29')],'sectionId':_0x2dbeb1['id']},{})['then'](function(){return _0xdbc6e1;});}else{return _0xdbc6e1;}})['catch'](function(_0x44fe0d){logger[_0xbe14('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44fe0d);throw _0x44fe0d;});}return _0xdbc6e1;})[_0xbe14('0x22')](respondWithResult(_0x5acf90,0xc9))[_0xbe14('0x47')](handleError(_0x5acf90,null));};exports['update']=function(_0x28f995,_0x4a40d2){if(_0x28f995[_0xbe14('0x49')]['id']){delete _0x28f995[_0xbe14('0x49')]['id'];}return db[_0xbe14('0x2d')]['find']({'where':{'id':_0x28f995[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4a40d2,null))['then'](saveUpdates(_0x28f995[_0xbe14('0x49')],null))[_0xbe14('0x22')](respondWithResult(_0x4a40d2,null))[_0xbe14('0x47')](handleError(_0x4a40d2,null));};exports[_0xbe14('0x26')]=function(_0x49322f,_0x4f06a3){return db[_0xbe14('0x2d')][_0xbe14('0x46')]({'where':{'id':_0x49322f[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4f06a3,null))[_0xbe14('0x22')](removeEntity(_0x4f06a3,null))[_0xbe14('0x47')](handleError(_0x4f06a3,null));};
\ No newline at end of file
+var _0xdc97=['mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','get','destroy','sendStatus','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','findAll','rows','catch','params','keys','fields','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir','request-promise','bluebird'];(function(_0x1fca66,_0xa168ce){var _0x3e7c8d=function(_0x496bc0){while(--_0x496bc0){_0x1fca66['push'](_0x1fca66['shift']());}};_0x3e7c8d(++_0xa168ce);}(_0xdc97,0x13b));var _0x7dc9=function(_0x1b7d07,_0x14eb85){_0x1b7d07=_0x1b7d07-0x0;var _0x3de54e=_0xdc97[_0x1b7d07];return _0x3de54e;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xcc;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['sendStatus'](_0x94c75a);}return _0x599ef1[_0x7dc9('0x16')](_0x94c75a)[_0x7dc9('0x17')]();};}function respondWithResult(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0xc8;return function(_0x31d43d){if(_0x31d43d){return _0xaadf2[_0x7dc9('0x16')](_0xf37bc7)['json'](_0x31d43d);}};}function respondWithFilteredResult(_0x3a54f2,_0x278191){return function(_0x1b0aa1){if(_0x1b0aa1){var _0x442819=typeof _0x278191[_0x7dc9('0x18')]===_0x7dc9('0x19')&&typeof _0x278191[_0x7dc9('0x1a')]===_0x7dc9('0x19');var _0x4778d5=_0x1b0aa1['count'];var _0x22577e=_0x442819?0x0:_0x278191['offset'];var _0x1f5906=_0x442819?_0x1b0aa1[_0x7dc9('0x1b')]:_0x278191['offset']+_0x278191[_0x7dc9('0x1a')];var _0x3b738a;if(_0x1f5906>=_0x4778d5){_0x1f5906=_0x4778d5;_0x3b738a=0xc8;}else{_0x3b738a=0xce;}_0x3a54f2[_0x7dc9('0x16')](_0x3b738a);return _0x3a54f2[_0x7dc9('0x1c')](_0x7dc9('0x1d'),_0x22577e+'-'+_0x1f5906+'/'+_0x4778d5)[_0x7dc9('0x1e')](_0x1b0aa1);}return null;};}function patchUpdates(_0x2dad65){return function(_0x2895f5){try{jsonpatch[_0x7dc9('0x1f')](_0x2895f5,_0x2dad65,!![]);}catch(_0x2b38d6){return BPromise['reject'](_0x2b38d6);}return _0x2895f5['save']();};}function saveUpdates(_0x12954f,_0x5981e2){return function(_0x596e0f){if(_0x596e0f){return _0x596e0f[_0x7dc9('0x20')](_0x12954f)[_0x7dc9('0x21')](function(_0x5e9525){return _0x5e9525;});}return null;};}function removeEntity(_0xffc080,_0x43d31f){return function(_0x41110a){if(_0x41110a){return _0x41110a['destroy']()[_0x7dc9('0x21')](function(){var _0x1e3a8d=_0x41110a[_0x7dc9('0x22')]({'plain':!![]});var _0x55a482='Metrics';return db['UserProfileResource'][_0x7dc9('0x23')]({'where':{'type':_0x55a482,'resourceId':_0x1e3a8d['id']}})[_0x7dc9('0x21')](function(){return _0x41110a;});})['then'](function(){_0xffc080['status'](0xcc)[_0x7dc9('0x17')]();});}};}function handleEntityNotFound(_0x5afb7d,_0x2d22eb){return function(_0x1c690b){if(!_0x1c690b){_0x5afb7d[_0x7dc9('0x24')](0x194);}return _0x1c690b;};}function handleError(_0x3e4102,_0xa2aaa9){_0xa2aaa9=_0xa2aaa9||0x1f4;return function(_0x450124){logger[_0x7dc9('0x25')](_0x450124[_0x7dc9('0x26')]);if(_0x450124[_0x7dc9('0x27')]){delete _0x450124[_0x7dc9('0x27')];}_0x3e4102[_0x7dc9('0x16')](_0xa2aaa9)[_0x7dc9('0x28')](_0x450124);};}exports['index']=function(_0x4e929c,_0x513dd6){var _0x49a4a5={},_0x4a68f0={},_0x553a03={'count':0x0,'rows':[]};var _0x58c4e8=_['map'](db[_0x7dc9('0x29')][_0x7dc9('0x2a')],function(_0x29dcef){return{'name':_0x29dcef[_0x7dc9('0x2b')],'type':_0x29dcef[_0x7dc9('0x2c')][_0x7dc9('0x2d')]};});_0x4a68f0['model']=_['map'](_0x58c4e8,'name');_0x4a68f0[_0x7dc9('0x2e')]=_['keys'](_0x4e929c[_0x7dc9('0x2e')]);_0x4a68f0[_0x7dc9('0x2f')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],_0x4a68f0[_0x7dc9('0x2e')]);_0x49a4a5[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],qs['fields'](_0x4e929c[_0x7dc9('0x2e')]['fields']));_0x49a4a5[_0x7dc9('0x32')]=_0x49a4a5[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x49a4a5[_0x7dc9('0x32')]:_0x4a68f0['model'];if(!_0x4e929c[_0x7dc9('0x2e')]['hasOwnProperty'](_0x7dc9('0x34'))){_0x49a4a5['limit']=qs['limit'](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x1a')]);_0x49a4a5[_0x7dc9('0x18')]=qs[_0x7dc9('0x18')](_0x4e929c['query'][_0x7dc9('0x18')]);}_0x49a4a5[_0x7dc9('0x35')]=qs[_0x7dc9('0x36')](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x36')]);_0x49a4a5[_0x7dc9('0x37')]=qs[_0x7dc9('0x2f')](_[_0x7dc9('0x38')](_0x4e929c[_0x7dc9('0x2e')],_0x4a68f0[_0x7dc9('0x2f')]),_0x58c4e8);if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]){_0x49a4a5['where']=_[_0x7dc9('0x3a')](_0x49a4a5[_0x7dc9('0x37')],{'$or':_[_0x7dc9('0x3b')](_0x58c4e8,function(_0xfd2612){if(_0xfd2612['type']!==_0x7dc9('0x3c')){var _0x89db0e={};_0x89db0e[_0xfd2612[_0x7dc9('0x27')]]={'$like':'%'+_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]+'%'};return _0x89db0e;}})});}_0x49a4a5=_[_0x7dc9('0x3a')]({},_0x49a4a5,_0x4e929c['options']);var _0x553230={'where':_0x49a4a5[_0x7dc9('0x37')]};return db[_0x7dc9('0x29')]['count'](_0x553230)[_0x7dc9('0x21')](function(_0x4a37ec){_0x553a03[_0x7dc9('0x1b')]=_0x4a37ec;if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x3d')]){_0x49a4a5['include']=[{'all':!![]}];}return db[_0x7dc9('0x29')][_0x7dc9('0x3e')](_0x49a4a5);})[_0x7dc9('0x21')](function(_0x95513c){_0x553a03[_0x7dc9('0x3f')]=_0x95513c;return _0x553a03;})[_0x7dc9('0x21')](respondWithFilteredResult(_0x513dd6,_0x49a4a5))[_0x7dc9('0x40')](handleError(_0x513dd6,null));};exports['show']=function(_0x187aa6,_0x4f29b2){var _0x52d883={'raw':!![],'where':{'id':_0x187aa6[_0x7dc9('0x41')]['id']}},_0xcced6c={};_0xcced6c[_0x7dc9('0x31')]=_[_0x7dc9('0x42')](db[_0x7dc9('0x29')][_0x7dc9('0x2a')]);_0xcced6c[_0x7dc9('0x2e')]=_[_0x7dc9('0x42')](_0x187aa6[_0x7dc9('0x2e')]);_0xcced6c['filters']=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],_0xcced6c[_0x7dc9('0x2e')]);_0x52d883[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],qs['fields'](_0x187aa6[_0x7dc9('0x2e')][_0x7dc9('0x43')]));_0x52d883['attributes']=_0x52d883[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x52d883[_0x7dc9('0x32')]:_0xcced6c['model'];if(_0x187aa6[_0x7dc9('0x2e')]['includeAll']){_0x52d883['include']=[{'all':!![]}];}_0x52d883=_[_0x7dc9('0x3a')]({},_0x52d883,_0x187aa6[_0x7dc9('0x44')]);return db[_0x7dc9('0x29')]['find'](_0x52d883)['then'](handleEntityNotFound(_0x4f29b2,null))[_0x7dc9('0x21')](respondWithResult(_0x4f29b2,null))['catch'](handleError(_0x4f29b2,null));};exports[_0x7dc9('0x45')]=function(_0x4ab558,_0x5e2d59){return db[_0x7dc9('0x29')][_0x7dc9('0x45')](_0x4ab558[_0x7dc9('0x46')],{})[_0x7dc9('0x21')](function(_0x414bf4){var _0x113087=_0x4ab558[_0x7dc9('0x47')][_0x7dc9('0x22')]({'plain':!![]});if(!_0x113087)throw new Error(_0x7dc9('0x48'));if(_0x113087[_0x7dc9('0x49')]===_0x7dc9('0x47')){var _0x13580b=_0x414bf4[_0x7dc9('0x22')]({'plain':!![]});var _0x59be9b=_0x7dc9('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x59be9b,'userProfileId':_0x113087[_0x7dc9('0x4b')]},'raw':!![]})[_0x7dc9('0x21')](function(_0x40e382){if(_0x40e382&&_0x40e382[_0x7dc9('0x4c')]===0x0){return db[_0x7dc9('0x4d')]['create']({'name':_0x13580b[_0x7dc9('0x27')],'resourceId':_0x13580b['id'],'type':_0x40e382[_0x7dc9('0x27')],'sectionId':_0x40e382['id']},{})[_0x7dc9('0x21')](function(){return _0x414bf4;});}else{return _0x414bf4;}})['catch'](function(_0x341909){logger[_0x7dc9('0x25')](_0x7dc9('0x4e'),_0x341909);throw _0x341909;});}return _0x414bf4;})[_0x7dc9('0x21')](respondWithResult(_0x5e2d59,0xc9))[_0x7dc9('0x40')](handleError(_0x5e2d59,null));};exports[_0x7dc9('0x20')]=function(_0x593132,_0x366b8b){if(_0x593132[_0x7dc9('0x46')]['id']){delete _0x593132[_0x7dc9('0x46')]['id'];}return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x593132[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x366b8b,null))[_0x7dc9('0x21')](saveUpdates(_0x593132[_0x7dc9('0x46')],null))[_0x7dc9('0x21')](respondWithResult(_0x366b8b,null))[_0x7dc9('0x40')](handleError(_0x366b8b,null));};exports[_0x7dc9('0x23')]=function(_0x4fec6e,_0x1767b6){return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x4fec6e[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x1767b6,null))['then'](removeEntity(_0x1767b6,null))[_0x7dc9('0x40')](handleError(_0x1767b6,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index bf1eee9..7d0cd84 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 _0x7c1a=['rimraf','./analyticMetric.attributes','define','AnalyticMetric','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x7c1a,0x159));var _0xa7c1=function(_0x11af43,_0x26badb){_0x11af43=_0x11af43-0x0;var _0xc26d1=_0x7c1a[_0x11af43];return _0xc26d1;};'use strict';var _=require(_0xa7c1('0x0'));var util=require(_0xa7c1('0x1'));var logger=require(_0xa7c1('0x2'))(_0xa7c1('0x3'));var moment=require(_0xa7c1('0x4'));var BPromise=require(_0xa7c1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa7c1('0x6'));var rimraf=require(_0xa7c1('0x7'));var config=require('../../config/environment');var attributes=require(_0xa7c1('0x8'));module['exports']=function(_0x3c8e8d,_0xa10122){return _0x3c8e8d[_0xa7c1('0x9')](_0xa7c1('0xa'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9303=['api','bluebird','rimraf','../../config/environment','./analyticMetric.attributes','exports','analytics_metrics','lodash'];(function(_0x514a08,_0x28a8c7){var _0x8da53a=function(_0x547f09){while(--_0x547f09){_0x514a08['push'](_0x514a08['shift']());}};_0x8da53a(++_0x28a8c7);}(_0x9303,0xd7));var _0x3930=function(_0x3d0240,_0x21509a){_0x3d0240=_0x3d0240-0x0;var _0xdf8a7d=_0x9303[_0x3d0240];return _0xdf8a7d;};'use strict';var _=require(_0x3930('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3930('0x1'));var moment=require('moment');var BPromise=require(_0x3930('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3930('0x3'));var config=require(_0x3930('0x4'));var attributes=require(_0x3930('0x5'));module[_0x3930('0x6')]=function(_0x57e19d,_0x44949e){return _0x57e19d['define']('AnalyticMetric',attributes,{'tableName':_0x3930('0x7'),'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 25ccc89..77a5cc1 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 _0xfbf5=['../../config/environment','client','http','request','then','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x57bafc,_0x5b6f89){var _0x3e1d7c=function(_0x210b09){while(--_0x210b09){_0x57bafc['push'](_0x57bafc['shift']());}};_0x3e1d7c(++_0x5b6f89);}(_0xfbf5,0xe7));var _0x5fbf=function(_0x293045,_0x27074d){_0x293045=_0x293045-0x0;var _0x3e2788=_0xfbf5[_0x293045];return _0x3e2788;};'use strict';var _=require(_0x5fbf('0x0'));var util=require(_0x5fbf('0x1'));var moment=require(_0x5fbf('0x2'));var BPromise=require(_0x5fbf('0x3'));var rs=require(_0x5fbf('0x4'));var fs=require('fs');var Redis=require(_0x5fbf('0x5'));var db=require(_0x5fbf('0x6'))['db'];var utils=require(_0x5fbf('0x7'));var logger=require(_0x5fbf('0x8'))('rpc');var config=require(_0x5fbf('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5fbf('0xa')][_0x5fbf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x387772,_0x520095,_0x1efc61){return new BPromise(function(_0x14acef,_0xc06237){return client[_0x5fbf('0xc')](_0x387772,_0x1efc61)[_0x5fbf('0xd')](function(_0x2fadb6){logger['info'](_0x5fbf('0xe'),_0x520095,'request\x20sent');logger[_0x5fbf('0xf')](_0x5fbf('0x10'),_0x520095,_0x5fbf('0x11'),JSON[_0x5fbf('0x12')](_0x2fadb6));if(_0x2fadb6[_0x5fbf('0x13')]){if(_0x2fadb6[_0x5fbf('0x13')][_0x5fbf('0x14')]===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x520095,_0x2fadb6[_0x5fbf('0x13')]['message']);return _0xc06237(_0x2fadb6[_0x5fbf('0x13')][_0x5fbf('0x15')]);}logger[_0x5fbf('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x520095,_0x2fadb6['error'][_0x5fbf('0x15')]);return _0x14acef(_0x2fadb6[_0x5fbf('0x13')][_0x5fbf('0x15')]);}else{logger[_0x5fbf('0x16')](_0x5fbf('0xe'),_0x520095,'request\x20sent');_0x14acef(_0x2fadb6['result'][_0x5fbf('0x15')]);}})[_0x5fbf('0x17')](function(_0x24af29){logger[_0x5fbf('0x13')](_0x5fbf('0xe'),_0x520095,_0x24af29);_0xc06237(_0x24af29);});});}
\ No newline at end of file
+var _0xc72c=['debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xc72c,0x119));var _0xcc72=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xc72c[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0xcc72('0x0'));var util=require('util');var moment=require(_0xcc72('0x1'));var BPromise=require(_0xcc72('0x2'));var rs=require(_0xcc72('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcc72('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcc72('0x5'))(_0xcc72('0x6'));var config=require(_0xcc72('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcc72('0x8')][_0xcc72('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x570b04,_0x2f5728,_0x282c6b){return new BPromise(function(_0x2d302b,_0x3cee4f){return client[_0xcc72('0xa')](_0x570b04,_0x282c6b)[_0xcc72('0xb')](function(_0x4306f5){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x2f5728,_0xcc72('0xc'));logger[_0xcc72('0xd')](_0xcc72('0xe'),_0x2f5728,_0xcc72('0xc'),JSON[_0xcc72('0xf')](_0x4306f5));if(_0x4306f5['error']){if(_0x4306f5[_0xcc72('0x10')][_0xcc72('0x11')]===0x1f4){logger[_0xcc72('0x10')](_0xcc72('0x12'),_0x2f5728,_0x4306f5['error'][_0xcc72('0x13')]);return _0x3cee4f(_0x4306f5[_0xcc72('0x10')]['message']);}logger[_0xcc72('0x10')](_0xcc72('0x12'),_0x2f5728,_0x4306f5['error'][_0xcc72('0x13')]);return _0x2d302b(_0x4306f5[_0xcc72('0x10')][_0xcc72('0x13')]);}else{logger['info'](_0xcc72('0x12'),_0x2f5728,_0xcc72('0xc'));_0x2d302b(_0x4306f5[_0xcc72('0x14')][_0xcc72('0x13')]);}})['catch'](function(_0x20518a){logger[_0xcc72('0x10')](_0xcc72('0x12'),_0x2f5728,_0x20518a);_0x3cee4f(_0x20518a);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 32d4fc7..e17ed57 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 _0x51f2=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','index','show','post','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x51f2,0xeb));var _0x251f=function(_0x3bd53a,_0x134fbb){_0x3bd53a=_0x3bd53a-0x0;var _0x363152=_0x51f2[_0x3bd53a];return _0x363152;};'use strict';var multer=require(_0x251f('0x0'));var util=require(_0x251f('0x1'));var path=require(_0x251f('0x2'));var timeout=require(_0x251f('0x3'));var express=require(_0x251f('0x4'));var router=express[_0x251f('0x5')]();var fs_extra=require(_0x251f('0x6'));var auth=require(_0x251f('0x7'));var interaction=require(_0x251f('0x8'));var config=require('../../config/environment');var controller=require(_0x251f('0x9'));router[_0x251f('0xa')]('/',auth[_0x251f('0xb')](),controller[_0x251f('0xc')]);router[_0x251f('0xa')]('/:id',auth[_0x251f('0xb')](),controller[_0x251f('0xd')]);router[_0x251f('0xe')]('/',auth[_0x251f('0xb')](),controller['create']);router[_0x251f('0xf')](_0x251f('0x10'),auth[_0x251f('0xb')](),controller[_0x251f('0x11')]);router['delete'](_0x251f('0x10'),auth[_0x251f('0xb')](),controller[_0x251f('0x12')]);module[_0x251f('0x13')]=router;
\ No newline at end of file
+var _0xa423=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show'];(function(_0x2d9881,_0x450fab){var _0x144e1e=function(_0x51ff65){while(--_0x51ff65){_0x2d9881['push'](_0x2d9881['shift']());}};_0x144e1e(++_0x450fab);}(_0xa423,0x16c));var _0x3a42=function(_0x5a3ba1,_0x23c154){_0x5a3ba1=_0x5a3ba1-0x0;var _0x5dcc34=_0xa423[_0x5a3ba1];return _0x5dcc34;};'use strict';var multer=require(_0x3a42('0x0'));var util=require(_0x3a42('0x1'));var path=require(_0x3a42('0x2'));var timeout=require(_0x3a42('0x3'));var express=require(_0x3a42('0x4'));var router=express['Router']();var fs_extra=require(_0x3a42('0x5'));var auth=require(_0x3a42('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3a42('0x7'));var controller=require(_0x3a42('0x8'));router[_0x3a42('0x9')]('/',auth[_0x3a42('0xa')](),controller[_0x3a42('0xb')]);router['get'](_0x3a42('0xc'),auth[_0x3a42('0xa')](),controller[_0x3a42('0xd')]);router[_0x3a42('0xe')]('/',auth[_0x3a42('0xa')](),controller[_0x3a42('0xf')]);router[_0x3a42('0x10')](_0x3a42('0xc'),auth[_0x3a42('0xa')](),controller[_0x3a42('0x11')]);router[_0x3a42('0x12')]('/:id',auth[_0x3a42('0xa')](),controller[_0x3a42('0x13')]);module[_0x3a42('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 07ae6eb..31ce2a9 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 _0xb7a9=['sequelize','exports','TEXT'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xb7a9,0x9c));var _0x9b7a=function(_0x22c14b,_0x1bfd98){_0x22c14b=_0x22c14b-0x0;var _0x198e98=_0xb7a9[_0x22c14b];return _0x198e98;};'use strict';var Sequelize=require(_0x9b7a('0x0'));module[_0x9b7a('0x1')]={'tree':{'type':Sequelize[_0x9b7a('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x6104=['exports','TEXT'];(function(_0x4d2cfd,_0x4e3fc0){var _0x50cff9=function(_0xc35646){while(--_0xc35646){_0x4d2cfd['push'](_0x4d2cfd['shift']());}};_0x50cff9(++_0x4e3fc0);}(_0x6104,0x19c));var _0x4610=function(_0x221978,_0x6cb2d5){_0x221978=_0x221978-0x0;var _0x5be5b2=_0x6104[_0x221978];return _0x5be5b2;};'use strict';var Sequelize=require('sequelize');module[_0x4610('0x0')]={'tree':{'type':Sequelize[_0x4610('0x1')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 2789122..0994c89 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 _0x1100=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','AnalyticTreeReport','rows','catch','params','options','find','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x20b082,_0x1d2498){var _0x3ce60f=function(_0x93c5df){while(--_0x93c5df){_0x20b082['push'](_0x20b082['shift']());}};_0x3ce60f(++_0x1d2498);}(_0x1100,0x1c0));var _0x0110=function(_0x526a80,_0x25fd97){_0x526a80=_0x526a80-0x0;var _0x4d5e2a=_0x1100[_0x526a80];return _0x4d5e2a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0110('0x0'));var jsonpatch=require(_0x0110('0x1'));var rp=require(_0x0110('0x2'));var moment=require(_0x0110('0x3'));var BPromise=require(_0x0110('0x4'));var Mustache=require(_0x0110('0x5'));var util=require(_0x0110('0x6'));var path=require(_0x0110('0x7'));var sox=require(_0x0110('0x8'));var csv=require(_0x0110('0x9'));var ejs=require(_0x0110('0xa'));var fs=require('fs');var fs_extra=require(_0x0110('0xb'));var _=require(_0x0110('0xc'));var squel=require(_0x0110('0xd'));var crypto=require(_0x0110('0xe'));var jsforce=require(_0x0110('0xf'));var deskjs=require(_0x0110('0x10'));var toCsv=require(_0x0110('0x9'));var querystring=require(_0x0110('0x11'));var Papa=require(_0x0110('0x12'));var Redis=require(_0x0110('0x13'));var authService=require(_0x0110('0x14'));var qs=require(_0x0110('0x15'));var as=require(_0x0110('0x16'));var hardwareService=require(_0x0110('0x17'));var logger=require(_0x0110('0x18'))(_0x0110('0x19'));var utils=require(_0x0110('0x1a'));var config=require(_0x0110('0x1b'));var licenseUtil=require(_0x0110('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1240c2,_0x45609f){_0x45609f=_0x45609f||0xcc;return function(_0x3e534b){if(_0x3e534b){return _0x1240c2[_0x0110('0x1d')](_0x45609f);}return _0x1240c2[_0x0110('0x1e')](_0x45609f)[_0x0110('0x1f')]();};}function respondWithResult(_0x175e4f,_0x5f5941){_0x5f5941=_0x5f5941||0xc8;return function(_0x231c6f){if(_0x231c6f){return _0x175e4f['status'](_0x5f5941)[_0x0110('0x20')](_0x231c6f);}};}function respondWithFilteredResult(_0x290a12,_0x17e7b3){return function(_0x2e5eaf){if(_0x2e5eaf){var _0x218a19=typeof _0x17e7b3[_0x0110('0x21')]===_0x0110('0x22')&&typeof _0x17e7b3[_0x0110('0x23')]==='undefined';var _0x97075d=_0x2e5eaf['count'];var _0x2bb1de=_0x218a19?0x0:_0x17e7b3[_0x0110('0x21')];var _0x39e034=_0x218a19?_0x2e5eaf[_0x0110('0x24')]:_0x17e7b3['offset']+_0x17e7b3['limit'];var _0x2e5f96;if(_0x39e034>=_0x97075d){_0x39e034=_0x97075d;_0x2e5f96=0xc8;}else{_0x2e5f96=0xce;}_0x290a12['status'](_0x2e5f96);return _0x290a12[_0x0110('0x25')](_0x0110('0x26'),_0x2bb1de+'-'+_0x39e034+'/'+_0x97075d)[_0x0110('0x20')](_0x2e5eaf);}return null;};}function patchUpdates(_0x5390fa){return function(_0x55d425){try{jsonpatch['apply'](_0x55d425,_0x5390fa,!![]);}catch(_0x599427){return BPromise[_0x0110('0x27')](_0x599427);}return _0x55d425['save']();};}function saveUpdates(_0x3af265,_0x3f285e){return function(_0x27677){if(_0x27677){return _0x27677[_0x0110('0x28')](_0x3af265)[_0x0110('0x29')](function(_0x290c46){return _0x290c46;});}return null;};}function removeEntity(_0x4b8609,_0x54cd91){return function(_0x4f6cfa){if(_0x4f6cfa){return _0x4f6cfa[_0x0110('0x2a')]()['then'](function(){_0x4b8609[_0x0110('0x1e')](0xcc)[_0x0110('0x1f')]();});}};}function handleEntityNotFound(_0x3cc04a,_0x4d0a1d){return function(_0x2a7031){if(!_0x2a7031){_0x3cc04a[_0x0110('0x1d')](0x194);}return _0x2a7031;};}function handleError(_0x1fa22c,_0x55c47f){_0x55c47f=_0x55c47f||0x1f4;return function(_0x4f1f73){logger[_0x0110('0x2b')](_0x4f1f73[_0x0110('0x2c')]);if(_0x4f1f73[_0x0110('0x2d')]){delete _0x4f1f73[_0x0110('0x2d')];}_0x1fa22c[_0x0110('0x1e')](_0x55c47f)[_0x0110('0x2e')](_0x4f1f73);};}exports['index']=function(_0x56b918,_0x10bd8a){var _0x52e95a={},_0x3f1b67={},_0x64a9f3={'count':0x0,'rows':[]};var _0x367391=_[_0x0110('0x2f')](db['AnalyticTreeReport'][_0x0110('0x30')],function(_0x3f1b0b){return{'name':_0x3f1b0b[_0x0110('0x31')],'type':_0x3f1b0b[_0x0110('0x32')][_0x0110('0x33')]};});_0x3f1b67['model']=_[_0x0110('0x2f')](_0x367391,_0x0110('0x2d'));_0x3f1b67[_0x0110('0x34')]=_[_0x0110('0x35')](_0x56b918[_0x0110('0x34')]);_0x3f1b67[_0x0110('0x36')]=_[_0x0110('0x37')](_0x3f1b67['model'],_0x3f1b67[_0x0110('0x34')]);_0x52e95a[_0x0110('0x38')]=_['intersection'](_0x3f1b67[_0x0110('0x39')],qs[_0x0110('0x3a')](_0x56b918[_0x0110('0x34')][_0x0110('0x3a')]));_0x52e95a[_0x0110('0x38')]=_0x52e95a[_0x0110('0x38')][_0x0110('0x3b')]?_0x52e95a[_0x0110('0x38')]:_0x3f1b67[_0x0110('0x39')];if(!_0x56b918[_0x0110('0x34')][_0x0110('0x3c')](_0x0110('0x3d'))){_0x52e95a[_0x0110('0x23')]=qs[_0x0110('0x23')](_0x56b918[_0x0110('0x34')][_0x0110('0x23')]);_0x52e95a[_0x0110('0x21')]=qs['offset'](_0x56b918[_0x0110('0x34')][_0x0110('0x21')]);}_0x52e95a[_0x0110('0x3e')]=qs[_0x0110('0x3f')](_0x56b918[_0x0110('0x34')]['sort']);_0x52e95a['where']=qs[_0x0110('0x36')](_[_0x0110('0x40')](_0x56b918['query'],_0x3f1b67[_0x0110('0x36')]),_0x367391);if(_0x56b918[_0x0110('0x34')][_0x0110('0x41')]){_0x52e95a[_0x0110('0x42')]=_[_0x0110('0x43')](_0x52e95a[_0x0110('0x42')],{'$or':_[_0x0110('0x2f')](_0x367391,function(_0x59c7f6){if(_0x59c7f6[_0x0110('0x32')]!==_0x0110('0x44')){var _0x1c1f9c={};_0x1c1f9c[_0x59c7f6[_0x0110('0x2d')]]={'$like':'%'+_0x56b918['query'][_0x0110('0x41')]+'%'};return _0x1c1f9c;}})});}_0x52e95a=_[_0x0110('0x43')]({},_0x52e95a,_0x56b918['options']);var _0x316497={'where':_0x52e95a['where']};return db['AnalyticTreeReport'][_0x0110('0x24')](_0x316497)[_0x0110('0x29')](function(_0x428d2f){_0x64a9f3[_0x0110('0x24')]=_0x428d2f;if(_0x56b918['query'][_0x0110('0x45')]){_0x52e95a[_0x0110('0x46')]=[{'all':!![]}];}return db[_0x0110('0x47')]['findAll'](_0x52e95a);})[_0x0110('0x29')](function(_0x4a9289){_0x64a9f3[_0x0110('0x48')]=_0x4a9289;return _0x64a9f3;})[_0x0110('0x29')](respondWithFilteredResult(_0x10bd8a,_0x52e95a))[_0x0110('0x49')](handleError(_0x10bd8a,null));};exports['show']=function(_0x532b95,_0x287435){var _0x5f5758={'raw':!![],'where':{'id':_0x532b95[_0x0110('0x4a')]['id']}},_0xf47389={};_0xf47389['model']=_[_0x0110('0x35')](db[_0x0110('0x47')][_0x0110('0x30')]);_0xf47389[_0x0110('0x34')]=_['keys'](_0x532b95['query']);_0xf47389[_0x0110('0x36')]=_[_0x0110('0x37')](_0xf47389[_0x0110('0x39')],_0xf47389[_0x0110('0x34')]);_0x5f5758[_0x0110('0x38')]=_[_0x0110('0x37')](_0xf47389[_0x0110('0x39')],qs[_0x0110('0x3a')](_0x532b95[_0x0110('0x34')][_0x0110('0x3a')]));_0x5f5758[_0x0110('0x38')]=_0x5f5758['attributes'][_0x0110('0x3b')]?_0x5f5758[_0x0110('0x38')]:_0xf47389[_0x0110('0x39')];if(_0x532b95[_0x0110('0x34')]['includeAll']){_0x5f5758[_0x0110('0x46')]=[{'all':!![]}];}_0x5f5758=_[_0x0110('0x43')]({},_0x5f5758,_0x532b95[_0x0110('0x4b')]);return db[_0x0110('0x47')][_0x0110('0x4c')](_0x5f5758)[_0x0110('0x29')](handleEntityNotFound(_0x287435,null))[_0x0110('0x29')](respondWithResult(_0x287435,null))[_0x0110('0x49')](handleError(_0x287435,null));};exports['create']=function(_0x2c33b5,_0x14836c){return db[_0x0110('0x47')]['create'](_0x2c33b5[_0x0110('0x4d')],{})[_0x0110('0x29')](respondWithResult(_0x14836c,0xc9))[_0x0110('0x49')](handleError(_0x14836c,null));};exports[_0x0110('0x28')]=function(_0x3bdda7,_0x42fa4d){if(_0x3bdda7[_0x0110('0x4d')]['id']){delete _0x3bdda7['body']['id'];}return db[_0x0110('0x47')][_0x0110('0x4c')]({'where':{'id':_0x3bdda7[_0x0110('0x4a')]['id']}})[_0x0110('0x29')](handleEntityNotFound(_0x42fa4d,null))[_0x0110('0x29')](saveUpdates(_0x3bdda7[_0x0110('0x4d')],null))[_0x0110('0x29')](respondWithResult(_0x42fa4d,null))[_0x0110('0x49')](handleError(_0x42fa4d,null));};exports[_0x0110('0x2a')]=function(_0x2be901,_0x8364ec){return db[_0x0110('0x47')][_0x0110('0x4c')]({'where':{'id':_0x2be901[_0x0110('0x4a')]['id']}})[_0x0110('0x29')](handleEntityNotFound(_0x8364ec,null))[_0x0110('0x29')](removeEntity(_0x8364ec,null))[_0x0110('0x49')](handleError(_0x8364ec,null));};
\ No newline at end of file
+var _0x53e8=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','error','stack','name','send','index','AnalyticTreeReport','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','include','find','catch','create','body','eml-format','fast-json-patch','request-promise','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service'];(function(_0x2a789c,_0xa0544e){var _0x3a6503=function(_0xf7f1c0){while(--_0xf7f1c0){_0x2a789c['push'](_0x2a789c['shift']());}};_0x3a6503(++_0xa0544e);}(_0x53e8,0x1e8));var _0x853e=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x53e8[_0xe66cf2];return _0x2d84e7;};'use strict';var emlformat=require(_0x853e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x853e('0x1'));var rp=require(_0x853e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x853e('0x3'));var util=require(_0x853e('0x4'));var path=require(_0x853e('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x853e('0x6'));var fs=require('fs');var fs_extra=require(_0x853e('0x7'));var _=require(_0x853e('0x8'));var squel=require(_0x853e('0x9'));var crypto=require(_0x853e('0xa'));var jsforce=require(_0x853e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x853e('0xc'));var querystring=require('querystring');var Papa=require(_0x853e('0xd'));var Redis=require(_0x853e('0xe'));var authService=require(_0x853e('0xf'));var qs=require(_0x853e('0x10'));var as=require(_0x853e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x853e('0x12'))(_0x853e('0x13'));var utils=require(_0x853e('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x853e('0x15'))['db'];function respondWithStatusCode(_0x1a5a65,_0x848f1d){_0x848f1d=_0x848f1d||0xcc;return function(_0x4a29dd){if(_0x4a29dd){return _0x1a5a65[_0x853e('0x16')](_0x848f1d);}return _0x1a5a65['status'](_0x848f1d)[_0x853e('0x17')]();};}function respondWithResult(_0x59730a,_0x29c2ba){_0x29c2ba=_0x29c2ba||0xc8;return function(_0xcfff5c){if(_0xcfff5c){return _0x59730a[_0x853e('0x18')](_0x29c2ba)['json'](_0xcfff5c);}};}function respondWithFilteredResult(_0xe06b97,_0x424d6d){return function(_0xb15a9){if(_0xb15a9){var _0x50049e=typeof _0x424d6d[_0x853e('0x19')]===_0x853e('0x1a')&&typeof _0x424d6d[_0x853e('0x1b')]===_0x853e('0x1a');var _0x52d761=_0xb15a9['count'];var _0x4af67e=_0x50049e?0x0:_0x424d6d[_0x853e('0x19')];var _0x5edd52=_0x50049e?_0xb15a9[_0x853e('0x1c')]:_0x424d6d[_0x853e('0x19')]+_0x424d6d[_0x853e('0x1b')];var _0x2da307;if(_0x5edd52>=_0x52d761){_0x5edd52=_0x52d761;_0x2da307=0xc8;}else{_0x2da307=0xce;}_0xe06b97[_0x853e('0x18')](_0x2da307);return _0xe06b97[_0x853e('0x1d')]('Content-Range',_0x4af67e+'-'+_0x5edd52+'/'+_0x52d761)[_0x853e('0x1e')](_0xb15a9);}return null;};}function patchUpdates(_0x2f7eaa){return function(_0x452fa7){try{jsonpatch[_0x853e('0x1f')](_0x452fa7,_0x2f7eaa,!![]);}catch(_0x1766f5){return BPromise[_0x853e('0x20')](_0x1766f5);}return _0x452fa7[_0x853e('0x21')]();};}function saveUpdates(_0x139b67,_0x243b7c){return function(_0x4b9110){if(_0x4b9110){return _0x4b9110[_0x853e('0x22')](_0x139b67)[_0x853e('0x23')](function(_0x4e9bfc){return _0x4e9bfc;});}return null;};}function removeEntity(_0x467323,_0x227123){return function(_0x38ae8d){if(_0x38ae8d){return _0x38ae8d['destroy']()[_0x853e('0x23')](function(){_0x467323[_0x853e('0x18')](0xcc)[_0x853e('0x17')]();});}};}function handleEntityNotFound(_0x2eb88f,_0x30b208){return function(_0xe71bcf){if(!_0xe71bcf){_0x2eb88f[_0x853e('0x16')](0x194);}return _0xe71bcf;};}function handleError(_0x590cb8,_0x579621){_0x579621=_0x579621||0x1f4;return function(_0x5e52c9){logger[_0x853e('0x24')](_0x5e52c9[_0x853e('0x25')]);if(_0x5e52c9[_0x853e('0x26')]){delete _0x5e52c9[_0x853e('0x26')];}_0x590cb8[_0x853e('0x18')](_0x579621)[_0x853e('0x27')](_0x5e52c9);};}exports[_0x853e('0x28')]=function(_0x94a1a7,_0x15d07f){var _0x4be701={},_0x2e7af6={},_0x3a8e2e={'count':0x0,'rows':[]};var _0x18148d=_['map'](db[_0x853e('0x29')][_0x853e('0x2a')],function(_0x5467be){return{'name':_0x5467be[_0x853e('0x2b')],'type':_0x5467be[_0x853e('0x2c')]['key']};});_0x2e7af6[_0x853e('0x2d')]=_[_0x853e('0x2e')](_0x18148d,_0x853e('0x26'));_0x2e7af6[_0x853e('0x2f')]=_['keys'](_0x94a1a7['query']);_0x2e7af6[_0x853e('0x30')]=_[_0x853e('0x31')](_0x2e7af6[_0x853e('0x2d')],_0x2e7af6[_0x853e('0x2f')]);_0x4be701[_0x853e('0x32')]=_[_0x853e('0x31')](_0x2e7af6[_0x853e('0x2d')],qs['fields'](_0x94a1a7[_0x853e('0x2f')][_0x853e('0x33')]));_0x4be701['attributes']=_0x4be701[_0x853e('0x32')][_0x853e('0x34')]?_0x4be701[_0x853e('0x32')]:_0x2e7af6[_0x853e('0x2d')];if(!_0x94a1a7[_0x853e('0x2f')][_0x853e('0x35')]('nolimit')){_0x4be701[_0x853e('0x1b')]=qs[_0x853e('0x1b')](_0x94a1a7[_0x853e('0x2f')][_0x853e('0x1b')]);_0x4be701['offset']=qs[_0x853e('0x19')](_0x94a1a7[_0x853e('0x2f')][_0x853e('0x19')]);}_0x4be701['order']=qs[_0x853e('0x36')](_0x94a1a7[_0x853e('0x2f')][_0x853e('0x36')]);_0x4be701[_0x853e('0x37')]=qs[_0x853e('0x30')](_[_0x853e('0x38')](_0x94a1a7[_0x853e('0x2f')],_0x2e7af6[_0x853e('0x30')]),_0x18148d);if(_0x94a1a7[_0x853e('0x2f')][_0x853e('0x39')]){_0x4be701['where']=_[_0x853e('0x3a')](_0x4be701[_0x853e('0x37')],{'$or':_[_0x853e('0x2e')](_0x18148d,function(_0x1d0597){if(_0x1d0597['type']!==_0x853e('0x3b')){var _0x546d5b={};_0x546d5b[_0x1d0597[_0x853e('0x26')]]={'$like':'%'+_0x94a1a7[_0x853e('0x2f')][_0x853e('0x39')]+'%'};return _0x546d5b;}})});}_0x4be701=_[_0x853e('0x3a')]({},_0x4be701,_0x94a1a7[_0x853e('0x3c')]);var _0x2079b0={'where':_0x4be701['where']};return db['AnalyticTreeReport'][_0x853e('0x1c')](_0x2079b0)['then'](function(_0x124ed5){_0x3a8e2e[_0x853e('0x1c')]=_0x124ed5;if(_0x94a1a7[_0x853e('0x2f')][_0x853e('0x3d')]){_0x4be701['include']=[{'all':!![]}];}return db[_0x853e('0x29')][_0x853e('0x3e')](_0x4be701);})[_0x853e('0x23')](function(_0x230676){_0x3a8e2e[_0x853e('0x3f')]=_0x230676;return _0x3a8e2e;})[_0x853e('0x23')](respondWithFilteredResult(_0x15d07f,_0x4be701))['catch'](handleError(_0x15d07f,null));};exports[_0x853e('0x40')]=function(_0x5f0b9d,_0x2b679a){var _0xc206cc={'raw':!![],'where':{'id':_0x5f0b9d[_0x853e('0x41')]['id']}},_0x4443a6={};_0x4443a6['model']=_[_0x853e('0x42')](db[_0x853e('0x29')][_0x853e('0x2a')]);_0x4443a6['query']=_[_0x853e('0x42')](_0x5f0b9d[_0x853e('0x2f')]);_0x4443a6['filters']=_[_0x853e('0x31')](_0x4443a6['model'],_0x4443a6[_0x853e('0x2f')]);_0xc206cc['attributes']=_[_0x853e('0x31')](_0x4443a6['model'],qs[_0x853e('0x33')](_0x5f0b9d['query']['fields']));_0xc206cc[_0x853e('0x32')]=_0xc206cc[_0x853e('0x32')][_0x853e('0x34')]?_0xc206cc[_0x853e('0x32')]:_0x4443a6[_0x853e('0x2d')];if(_0x5f0b9d['query'][_0x853e('0x3d')]){_0xc206cc[_0x853e('0x43')]=[{'all':!![]}];}_0xc206cc=_[_0x853e('0x3a')]({},_0xc206cc,_0x5f0b9d[_0x853e('0x3c')]);return db['AnalyticTreeReport'][_0x853e('0x44')](_0xc206cc)['then'](handleEntityNotFound(_0x2b679a,null))['then'](respondWithResult(_0x2b679a,null))[_0x853e('0x45')](handleError(_0x2b679a,null));};exports['create']=function(_0x41d778,_0xd2a3fb){return db['AnalyticTreeReport'][_0x853e('0x46')](_0x41d778[_0x853e('0x47')],{})[_0x853e('0x23')](respondWithResult(_0xd2a3fb,0xc9))[_0x853e('0x45')](handleError(_0xd2a3fb,null));};exports[_0x853e('0x22')]=function(_0xefb813,_0x4e3453){if(_0xefb813['body']['id']){delete _0xefb813[_0x853e('0x47')]['id'];}return db[_0x853e('0x29')][_0x853e('0x44')]({'where':{'id':_0xefb813[_0x853e('0x41')]['id']}})[_0x853e('0x23')](handleEntityNotFound(_0x4e3453,null))[_0x853e('0x23')](saveUpdates(_0xefb813['body'],null))['then'](respondWithResult(_0x4e3453,null))[_0x853e('0x45')](handleError(_0x4e3453,null));};exports['destroy']=function(_0x20b31d,_0x32bef6){return db['AnalyticTreeReport'][_0x853e('0x44')]({'where':{'id':_0x20b31d[_0x853e('0x41')]['id']}})[_0x853e('0x23')](handleEntityNotFound(_0x32bef6,null))[_0x853e('0x23')](removeEntity(_0x32bef6,null))[_0x853e('0x45')](handleError(_0x32bef6,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index d073c75..a6fe75e 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 _0x294a=['request-promise','path','rimraf','../../config/environment','exports','define','AnalyticTreeReport','lodash','../../config/logger','api','moment'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x294a,0x1d5));var _0xa294=function(_0x11314c,_0x2ca8d7){_0x11314c=_0x11314c-0x0;var _0x12cb4a=_0x294a[_0x11314c];return _0x12cb4a;};'use strict';var _=require(_0xa294('0x0'));var util=require('util');var logger=require(_0xa294('0x1'))(_0xa294('0x2'));var moment=require(_0xa294('0x3'));var BPromise=require('bluebird');var rp=require(_0xa294('0x4'));var fs=require('fs');var path=require(_0xa294('0x5'));var rimraf=require(_0xa294('0x6'));var config=require(_0xa294('0x7'));var attributes=require('./analyticTreeReport.attributes');module[_0xa294('0x8')]=function(_0x518a5f,_0x2dbecb){return _0x518a5f[_0xa294('0x9')](_0xa294('0xa'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc472=['AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define'];(function(_0x2e6d10,_0x5131fc){var _0x1e2581=function(_0x557cea){while(--_0x557cea){_0x2e6d10['push'](_0x2e6d10['shift']());}};_0x1e2581(++_0x5131fc);}(_0xc472,0x1b4));var _0x2c47=function(_0x428774,_0x383962){_0x428774=_0x428774-0x0;var _0x53a01c=_0xc472[_0x428774];return _0x53a01c;};'use strict';var _=require(_0x2c47('0x0'));var util=require('util');var logger=require(_0x2c47('0x1'))(_0x2c47('0x2'));var moment=require(_0x2c47('0x3'));var BPromise=require(_0x2c47('0x4'));var rp=require(_0x2c47('0x5'));var fs=require('fs');var path=require(_0x2c47('0x6'));var rimraf=require(_0x2c47('0x7'));var config=require(_0x2c47('0x8'));var attributes=require(_0x2c47('0x9'));module[_0x2c47('0xa')]=function(_0x2c4e5b,_0x32d65d){return _0x2c4e5b[_0x2c47('0xb')](_0x2c47('0xc'),attributes,{'tableName':_0x2c47('0xd'),'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 22bbb0a..5ced29a 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 _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x8e98c5,_0x579fd5){var _0x3201a6=function(_0x1e0fe1){while(--_0x1e0fe1){_0x8e98c5['push'](_0x8e98c5['shift']());}};_0x3201a6(++_0x579fd5);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5f66[_0x5f0089];return _0x193892;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});}
\ No newline at end of file
+var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x11d0d5,_0x1d49dc){_0x11d0d5=_0x11d0d5-0x0;var _0x1c9fea=_0x7a54[_0x11d0d5];return _0x1c9fea;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 7ae516b..09e2395 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 _0x0498=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','update','delete','destroy','multer','util','connect-timeout'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0498,0x10d));var _0x8049=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x0498[_0x263a74];return _0x2aa86c;};'use strict';var multer=require(_0x8049('0x0'));var util=require(_0x8049('0x1'));var path=require('path');var timeout=require(_0x8049('0x2'));var express=require(_0x8049('0x3'));var router=express[_0x8049('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8049('0x5'));var interaction=require(_0x8049('0x6'));var config=require(_0x8049('0x7'));var controller=require('./analyticTreeReport.controller');router[_0x8049('0x8')]('/',auth[_0x8049('0x9')](),controller[_0x8049('0xa')]);router['get'](_0x8049('0xb'),auth[_0x8049('0x9')](),controller[_0x8049('0xc')]);router[_0x8049('0xd')]('/',auth[_0x8049('0x9')](),controller['create']);router['put']('/:id',auth[_0x8049('0x9')](),controller[_0x8049('0xe')]);router[_0x8049('0xf')](_0x8049('0xb'),auth[_0x8049('0x9')](),controller[_0x8049('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x3d3d=['update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x5de823,_0x4cb43f){var _0x4e2eba=function(_0x16fc9f){while(--_0x16fc9f){_0x5de823['push'](_0x5de823['shift']());}};_0x4e2eba(++_0x4cb43f);}(_0x3d3d,0x1bc));var _0xd3d3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3d3d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xd3d3('0x0'));var path=require(_0xd3d3('0x1'));var timeout=require(_0xd3d3('0x2'));var express=require(_0xd3d3('0x3'));var router=express[_0xd3d3('0x4')]();var fs_extra=require(_0xd3d3('0x5'));var auth=require(_0xd3d3('0x6'));var interaction=require(_0xd3d3('0x7'));var config=require(_0xd3d3('0x8'));var controller=require(_0xd3d3('0x9'));router[_0xd3d3('0xa')]('/',auth[_0xd3d3('0xb')](),controller[_0xd3d3('0xc')]);router[_0xd3d3('0xa')](_0xd3d3('0xd'),auth['isAuthenticated'](),controller[_0xd3d3('0xe')]);router[_0xd3d3('0xf')]('/',auth['isAuthenticated'](),controller[_0xd3d3('0x10')]);router[_0xd3d3('0x11')]('/:id',auth[_0xd3d3('0xb')](),controller[_0xd3d3('0x12')]);router['delete'](_0xd3d3('0xd'),auth[_0xd3d3('0xb')](),controller[_0xd3d3('0x13')]);module[_0xd3d3('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index aa489ac..02e15ae 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 _0x684c=['sequelize','exports','STRING'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x684c,0x1b3));var _0xc684=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x684c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc684('0x0'));module[_0xc684('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xc684('0x2')]},'type':{'type':Sequelize[_0xc684('0x2')]}};
\ No newline at end of file
+var _0xdb4b=['STRING','exports'];(function(_0x34226f,_0x1cd113){var _0x1bf7dc=function(_0x145ecd){while(--_0x145ecd){_0x34226f['push'](_0x34226f['shift']());}};_0x1bf7dc(++_0x1cd113);}(_0xdb4b,0xd7));var _0xbdb4=function(_0x17406e,_0x1049fd){_0x17406e=_0x17406e-0x0;var _0x2bfc5a=_0xdb4b[_0x17406e];return _0x2bfc5a;};'use strict';var Sequelize=require('sequelize');module[_0xbdb4('0x0')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xbdb4('0x1')]},'type':{'type':Sequelize[_0xbdb4('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 9e06519..5cf6bc3 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 _0x74e5=['omit','createdAt','body','file','originalname','filename','mimetype','create','download','findOne','root','server/files/attachments/','join','offline-chat/','basename','zip-dir','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','name','send','map','Attachment','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','keys','find','clone','params','get'];(function(_0x12742e,_0x43f6fa){var _0x173452=function(_0x500743){while(--_0x500743){_0x12742e['push'](_0x12742e['shift']());}};_0x173452(++_0x43f6fa);}(_0x74e5,0x167));var _0x574e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x74e5[_0x13ea00];return _0x1f7347;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x574e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x574e('0x1'));var moment=require(_0x574e('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x574e('0x3'));var util=require(_0x574e('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x574e('0x5'));var ejs=require(_0x574e('0x6'));var fs=require('fs');var fs_extra=require(_0x574e('0x7'));var _=require('lodash');var squel=require(_0x574e('0x8'));var crypto=require('crypto');var jsforce=require(_0x574e('0x9'));var deskjs=require(_0x574e('0xa'));var toCsv=require(_0x574e('0x5'));var querystring=require(_0x574e('0xb'));var Papa=require(_0x574e('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x574e('0xd'));var as=require(_0x574e('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x574e('0xf'))(_0x574e('0x10'));var utils=require(_0x574e('0x11'));var config=require(_0x574e('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x574e('0x13'))['db'];function respondWithStatusCode(_0x34cd1f,_0x4e8935){_0x4e8935=_0x4e8935||0xcc;return function(_0x3c7c61){if(_0x3c7c61){return _0x34cd1f[_0x574e('0x14')](_0x4e8935);}return _0x34cd1f[_0x574e('0x15')](_0x4e8935)['end']();};}function respondWithResult(_0x24d421,_0x251e79){_0x251e79=_0x251e79||0xc8;return function(_0x4def2a){if(_0x4def2a){return _0x24d421[_0x574e('0x15')](_0x251e79)[_0x574e('0x16')](_0x4def2a);}};}function respondWithFilteredResult(_0xde4a72,_0x33e909){return function(_0x67aca5){if(_0x67aca5){var _0xe50c39=typeof _0x33e909[_0x574e('0x17')]===_0x574e('0x18')&&typeof _0x33e909[_0x574e('0x19')]==='undefined';var _0x244a14=_0x67aca5[_0x574e('0x1a')];var _0x5e96a7=_0xe50c39?0x0:_0x33e909[_0x574e('0x17')];var _0x1721ba=_0xe50c39?_0x67aca5[_0x574e('0x1a')]:_0x33e909[_0x574e('0x17')]+_0x33e909[_0x574e('0x19')];var _0x3953c8;if(_0x1721ba>=_0x244a14){_0x1721ba=_0x244a14;_0x3953c8=0xc8;}else{_0x3953c8=0xce;}_0xde4a72['status'](_0x3953c8);return _0xde4a72[_0x574e('0x1b')](_0x574e('0x1c'),_0x5e96a7+'-'+_0x1721ba+'/'+_0x244a14)[_0x574e('0x16')](_0x67aca5);}return null;};}function patchUpdates(_0x5c85b8){return function(_0x33214f){try{jsonpatch[_0x574e('0x1d')](_0x33214f,_0x5c85b8,!![]);}catch(_0x28cfc0){return BPromise[_0x574e('0x1e')](_0x28cfc0);}return _0x33214f[_0x574e('0x1f')]();};}function saveUpdates(_0x306adf,_0x9a4e10){return function(_0xdf519c){if(_0xdf519c){return _0xdf519c[_0x574e('0x20')](_0x306adf)[_0x574e('0x21')](function(_0x4b56f2){return _0x4b56f2;});}return null;};}function removeEntity(_0x3f9715,_0x1f624c){return function(_0x5033c){if(_0x5033c){return _0x5033c['destroy']()[_0x574e('0x21')](function(){_0x3f9715[_0x574e('0x15')](0xcc)[_0x574e('0x22')]();});}};}function handleEntityNotFound(_0x4aaac8,_0x31db55){return function(_0x5b8b3e){if(!_0x5b8b3e){_0x4aaac8[_0x574e('0x14')](0x194);}return _0x5b8b3e;};}function handleError(_0x565e5b,_0x48cbbe){_0x48cbbe=_0x48cbbe||0x1f4;return function(_0x5261d4){logger[_0x574e('0x23')](_0x5261d4['stack']);if(_0x5261d4[_0x574e('0x24')]){delete _0x5261d4['name'];}_0x565e5b['status'](_0x48cbbe)[_0x574e('0x25')](_0x5261d4);};}exports['index']=function(_0x4e68db,_0x8e45a2){var _0x4ed9b1={},_0x41baaf={},_0x165727={'count':0x0,'rows':[]};var _0x5485b4=_[_0x574e('0x26')](db[_0x574e('0x27')][_0x574e('0x28')],function(_0x4fd50f){return{'name':_0x4fd50f[_0x574e('0x29')],'type':_0x4fd50f[_0x574e('0x2a')]['key']};});_0x41baaf[_0x574e('0x2b')]=_[_0x574e('0x26')](_0x5485b4,_0x574e('0x24'));_0x41baaf['query']=_['keys'](_0x4e68db[_0x574e('0x2c')]);_0x41baaf[_0x574e('0x2d')]=_['intersection'](_0x41baaf[_0x574e('0x2b')],_0x41baaf[_0x574e('0x2c')]);_0x4ed9b1[_0x574e('0x2e')]=_[_0x574e('0x2f')](_0x41baaf[_0x574e('0x2b')],qs[_0x574e('0x30')](_0x4e68db['query'][_0x574e('0x30')]));_0x4ed9b1[_0x574e('0x2e')]=_0x4ed9b1['attributes'][_0x574e('0x31')]?_0x4ed9b1[_0x574e('0x2e')]:_0x41baaf['model'];if(!_0x4e68db[_0x574e('0x2c')][_0x574e('0x32')](_0x574e('0x33'))){_0x4ed9b1[_0x574e('0x19')]=qs[_0x574e('0x19')](_0x4e68db[_0x574e('0x2c')][_0x574e('0x19')]);_0x4ed9b1['offset']=qs['offset'](_0x4e68db[_0x574e('0x2c')][_0x574e('0x17')]);}_0x4ed9b1[_0x574e('0x34')]=qs[_0x574e('0x35')](_0x4e68db[_0x574e('0x2c')]['sort']);_0x4ed9b1[_0x574e('0x36')]=qs[_0x574e('0x2d')](_[_0x574e('0x37')](_0x4e68db[_0x574e('0x2c')],_0x41baaf[_0x574e('0x2d')]),_0x5485b4);if(_0x4e68db[_0x574e('0x2c')][_0x574e('0x38')]){_0x4ed9b1[_0x574e('0x36')]=_['merge'](_0x4ed9b1['where'],{'$or':_['map'](_0x5485b4,function(_0x301965){if(_0x301965[_0x574e('0x2a')]!==_0x574e('0x39')){var _0x367ab9={};_0x367ab9[_0x301965['name']]={'$like':'%'+_0x4e68db[_0x574e('0x2c')]['filter']+'%'};return _0x367ab9;}})});}_0x4ed9b1=_[_0x574e('0x3a')]({},_0x4ed9b1,_0x4e68db[_0x574e('0x3b')]);var _0x34c991={'where':_0x4ed9b1[_0x574e('0x36')]};return db[_0x574e('0x27')][_0x574e('0x1a')](_0x34c991)[_0x574e('0x21')](function(_0x550c67){_0x165727[_0x574e('0x1a')]=_0x550c67;if(_0x4e68db[_0x574e('0x2c')][_0x574e('0x3c')]){_0x4ed9b1[_0x574e('0x3d')]=[{'all':!![]}];}return db['Attachment'][_0x574e('0x3e')](_0x4ed9b1);})[_0x574e('0x21')](function(_0x1ec85b){_0x165727[_0x574e('0x3f')]=_0x1ec85b;return _0x165727;})[_0x574e('0x21')](respondWithFilteredResult(_0x8e45a2,_0x4ed9b1))[_0x574e('0x40')](handleError(_0x8e45a2,null));};exports[_0x574e('0x41')]=function(_0x5b05b9,_0x584fea){var _0xe9c5e0={'raw':!![],'where':{'id':_0x5b05b9['params']['id']}},_0x56b742={};_0x56b742[_0x574e('0x2b')]=_['keys'](db[_0x574e('0x27')][_0x574e('0x28')]);_0x56b742[_0x574e('0x2c')]=_[_0x574e('0x42')](_0x5b05b9[_0x574e('0x2c')]);_0x56b742['filters']=_[_0x574e('0x2f')](_0x56b742['model'],_0x56b742['query']);_0xe9c5e0['attributes']=_[_0x574e('0x2f')](_0x56b742[_0x574e('0x2b')],qs[_0x574e('0x30')](_0x5b05b9[_0x574e('0x2c')][_0x574e('0x30')]));_0xe9c5e0['attributes']=_0xe9c5e0[_0x574e('0x2e')][_0x574e('0x31')]?_0xe9c5e0['attributes']:_0x56b742[_0x574e('0x2b')];if(_0x5b05b9[_0x574e('0x2c')][_0x574e('0x3c')]){_0xe9c5e0[_0x574e('0x3d')]=[{'all':!![]}];}_0xe9c5e0=_[_0x574e('0x3a')]({},_0xe9c5e0,_0x5b05b9[_0x574e('0x3b')]);return db[_0x574e('0x27')][_0x574e('0x43')](_0xe9c5e0)['then'](handleEntityNotFound(_0x584fea,null))['then'](respondWithResult(_0x584fea,null))[_0x574e('0x40')](handleError(_0x584fea,null));};exports[_0x574e('0x44')]=function(_0xf4b0ab,_0x19be55){var _0x12863a={'where':{'id':_0xf4b0ab[_0x574e('0x45')]['id']}},_0x48728d={};_0x48728d[_0x574e('0x2b')]=_[_0x574e('0x42')](db['Attachment'][_0x574e('0x28')]);_0x12863a['attributes']=_[_0x574e('0x2f')](_0x48728d[_0x574e('0x2b')],qs['fields'](_0xf4b0ab[_0x574e('0x2c')][_0x574e('0x30')]));_0x12863a[_0x574e('0x2e')]=_0x12863a[_0x574e('0x2e')][_0x574e('0x31')]?_0x12863a[_0x574e('0x2e')]:_0x48728d[_0x574e('0x2b')];if(_0xf4b0ab[_0x574e('0x2c')][_0x574e('0x3c')]){_0x12863a[_0x574e('0x3d')]=[{'all':!![]}];}_0x12863a=_[_0x574e('0x3a')]({},_0x12863a,_0xf4b0ab[_0x574e('0x3b')]);return db[_0x574e('0x27')][_0x574e('0x43')](_0x12863a)[_0x574e('0x21')](handleEntityNotFound(_0x19be55,null))[_0x574e('0x21')](function(_0x1d6985){if(_0x1d6985){var _0x47163c=_0x1d6985[_0x574e('0x46')]({'plain':!![]});_0x47163c=qs[_0x574e('0x47')](_0x47163c,['id',_0x574e('0x48'),'updatedAt']);_0xf4b0ab[_0x574e('0x49')]=_['omit'](_0xf4b0ab[_0x574e('0x49')],['id','createdAt','updatedAt']);return db[_0x574e('0x27')]['create'](_[_0x574e('0x3a')](_0x47163c,_0xf4b0ab[_0x574e('0x49')]),{'include':_0xf4b0ab[_0x574e('0x2c')][_0x574e('0x3c')]?[{'all':!![]}]:undefined});}})[_0x574e('0x21')](respondWithResult(_0x19be55,0xc9))[_0x574e('0x40')](handleError(_0x19be55,null));};exports[_0x574e('0x20')]=function(_0x1f04d8,_0x3ddf8b){if(_0x1f04d8[_0x574e('0x49')]['id']){delete _0x1f04d8[_0x574e('0x49')]['id'];}return db['Attachment']['find']({'where':{'id':_0x1f04d8['params']['id']}})[_0x574e('0x21')](handleEntityNotFound(_0x3ddf8b,null))[_0x574e('0x21')](saveUpdates(_0x1f04d8[_0x574e('0x49')],null))[_0x574e('0x21')](respondWithResult(_0x3ddf8b,null))['catch'](handleError(_0x3ddf8b,null));};exports['destroy']=function(_0x2ebb05,_0x547406){return db['Attachment']['find']({'where':{'id':_0x2ebb05[_0x574e('0x45')]['id']}})['then'](handleEntityNotFound(_0x547406,null))[_0x574e('0x21')](removeEntity(_0x547406,null))[_0x574e('0x40')](handleError(_0x547406,null));};exports['create']=function(_0x3b1aff,_0x4fb517,_0x3458d9){_0x3b1aff[_0x574e('0x49')]['name']=_0x3b1aff[_0x574e('0x4a')][_0x574e('0x4b')];_0x3b1aff[_0x574e('0x49')]['basename']=_0x3b1aff[_0x574e('0x4a')][_0x574e('0x4c')];_0x3b1aff[_0x574e('0x49')][_0x574e('0x2a')]=_0x3b1aff[_0x574e('0x4a')][_0x574e('0x4d')];return db[_0x574e('0x27')][_0x574e('0x4e')](_0x3b1aff[_0x574e('0x49')])[_0x574e('0x21')](respondWithResult(_0x4fb517,0xc9))[_0x574e('0x40')](handleError(_0x4fb517,null));};exports[_0x574e('0x4f')]=function(_0x36e6d8,_0x388a80,_0x4d62cf){return db['Attachment'][_0x574e('0x50')]({'where':{'id':_0x36e6d8[_0x574e('0x45')]['id']},'raw':!![]})[_0x574e('0x21')](handleEntityNotFound(_0x388a80,null))[_0x574e('0x21')](function(_0x8413f5){if(_0x8413f5){var _0x32352e=_0x8413f5['ChatOfflineMessageId']!==null;var _0x73e79f=path['join'](config[_0x574e('0x51')],_0x574e('0x52'));if(_0x32352e){_0x73e79f=path[_0x574e('0x53')](_0x73e79f,_0x574e('0x54'));}var _0x10c14a=path[_0x574e('0x53')](_0x73e79f,_0x8413f5[_0x574e('0x55')]);return _0x388a80['download'](_0x10c14a);}})['catch'](handleError(_0x388a80,null));};
\ No newline at end of file
+var _0xe259=['destroy','stack','name','index','map','Attachment','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','keys','rawAttributes','include','find','catch','clone','params','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','save','then'];(function(_0x196119,_0x4108de){var _0xa3ddce=function(_0x2c618a){while(--_0x2c618a){_0x196119['push'](_0x196119['shift']());}};_0xa3ddce(++_0x4108de);}(_0xe259,0x18c));var _0x9e25=function(_0x1da009,_0x43bbb0){_0x1da009=_0x1da009-0x0;var _0x48c764=_0xe259[_0x1da009];return _0x48c764;};'use strict';var emlformat=require(_0x9e25('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9e25('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9e25('0x2'));var moment=require(_0x9e25('0x3'));var BPromise=require(_0x9e25('0x4'));var Mustache=require(_0x9e25('0x5'));var util=require('util');var path=require(_0x9e25('0x6'));var sox=require(_0x9e25('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9e25('0x8'));var squel=require('squel');var crypto=require(_0x9e25('0x9'));var jsforce=require(_0x9e25('0xa'));var deskjs=require(_0x9e25('0xb'));var toCsv=require(_0x9e25('0xc'));var querystring=require(_0x9e25('0xd'));var Papa=require(_0x9e25('0xe'));var Redis=require(_0x9e25('0xf'));var authService=require(_0x9e25('0x10'));var qs=require(_0x9e25('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9e25('0x12'));var logger=require(_0x9e25('0x13'))(_0x9e25('0x14'));var utils=require(_0x9e25('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9e25('0x16'));var db=require(_0x9e25('0x17'))['db'];function respondWithStatusCode(_0x257c1b,_0x5bfadc){_0x5bfadc=_0x5bfadc||0xcc;return function(_0x3397ad){if(_0x3397ad){return _0x257c1b['sendStatus'](_0x5bfadc);}return _0x257c1b[_0x9e25('0x18')](_0x5bfadc)[_0x9e25('0x19')]();};}function respondWithResult(_0x15a25a,_0x4bff71){_0x4bff71=_0x4bff71||0xc8;return function(_0x4e4850){if(_0x4e4850){return _0x15a25a[_0x9e25('0x18')](_0x4bff71)[_0x9e25('0x1a')](_0x4e4850);}};}function respondWithFilteredResult(_0x11288d,_0x1d1d59){return function(_0x563c31){if(_0x563c31){var _0x16c439=typeof _0x1d1d59[_0x9e25('0x1b')]==='undefined'&&typeof _0x1d1d59[_0x9e25('0x1c')]===_0x9e25('0x1d');var _0x5cd831=_0x563c31[_0x9e25('0x1e')];var _0x4f916a=_0x16c439?0x0:_0x1d1d59[_0x9e25('0x1b')];var _0x12618a=_0x16c439?_0x563c31[_0x9e25('0x1e')]:_0x1d1d59['offset']+_0x1d1d59['limit'];var _0x4f26ee;if(_0x12618a>=_0x5cd831){_0x12618a=_0x5cd831;_0x4f26ee=0xc8;}else{_0x4f26ee=0xce;}_0x11288d[_0x9e25('0x18')](_0x4f26ee);return _0x11288d['set'](_0x9e25('0x1f'),_0x4f916a+'-'+_0x12618a+'/'+_0x5cd831)['json'](_0x563c31);}return null;};}function patchUpdates(_0x23579c){return function(_0x2ddd61){try{jsonpatch['apply'](_0x2ddd61,_0x23579c,!![]);}catch(_0x267d5b){return BPromise['reject'](_0x267d5b);}return _0x2ddd61[_0x9e25('0x20')]();};}function saveUpdates(_0x551cce,_0x59f9e4){return function(_0xbfecb6){if(_0xbfecb6){return _0xbfecb6['update'](_0x551cce)[_0x9e25('0x21')](function(_0x5f1ba5){return _0x5f1ba5;});}return null;};}function removeEntity(_0x2379a7,_0x57a05c){return function(_0x2b9e69){if(_0x2b9e69){return _0x2b9e69[_0x9e25('0x22')]()['then'](function(){_0x2379a7[_0x9e25('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50db61,_0x4711ca){return function(_0x228424){if(!_0x228424){_0x50db61['sendStatus'](0x194);}return _0x228424;};}function handleError(_0x3c64fe,_0x1249ff){_0x1249ff=_0x1249ff||0x1f4;return function(_0x1dabe3){logger['error'](_0x1dabe3[_0x9e25('0x23')]);if(_0x1dabe3[_0x9e25('0x24')]){delete _0x1dabe3[_0x9e25('0x24')];}_0x3c64fe[_0x9e25('0x18')](_0x1249ff)['send'](_0x1dabe3);};}exports[_0x9e25('0x25')]=function(_0x2c9dd2,_0x23112b){var _0xe690f7={},_0xaabbc2={},_0x319250={'count':0x0,'rows':[]};var _0x5620ce=_[_0x9e25('0x26')](db[_0x9e25('0x27')]['rawAttributes'],function(_0x47538e){return{'name':_0x47538e['fieldName'],'type':_0x47538e[_0x9e25('0x28')][_0x9e25('0x29')]};});_0xaabbc2[_0x9e25('0x2a')]=_['map'](_0x5620ce,_0x9e25('0x24'));_0xaabbc2['query']=_['keys'](_0x2c9dd2[_0x9e25('0x2b')]);_0xaabbc2[_0x9e25('0x2c')]=_[_0x9e25('0x2d')](_0xaabbc2[_0x9e25('0x2a')],_0xaabbc2[_0x9e25('0x2b')]);_0xe690f7[_0x9e25('0x2e')]=_[_0x9e25('0x2d')](_0xaabbc2['model'],qs[_0x9e25('0x2f')](_0x2c9dd2[_0x9e25('0x2b')][_0x9e25('0x2f')]));_0xe690f7[_0x9e25('0x2e')]=_0xe690f7[_0x9e25('0x2e')][_0x9e25('0x30')]?_0xe690f7['attributes']:_0xaabbc2['model'];if(!_0x2c9dd2[_0x9e25('0x2b')][_0x9e25('0x31')](_0x9e25('0x32'))){_0xe690f7['limit']=qs[_0x9e25('0x1c')](_0x2c9dd2[_0x9e25('0x2b')][_0x9e25('0x1c')]);_0xe690f7[_0x9e25('0x1b')]=qs['offset'](_0x2c9dd2[_0x9e25('0x2b')][_0x9e25('0x1b')]);}_0xe690f7[_0x9e25('0x33')]=qs['sort'](_0x2c9dd2[_0x9e25('0x2b')][_0x9e25('0x34')]);_0xe690f7['where']=qs[_0x9e25('0x2c')](_[_0x9e25('0x35')](_0x2c9dd2[_0x9e25('0x2b')],_0xaabbc2[_0x9e25('0x2c')]),_0x5620ce);if(_0x2c9dd2[_0x9e25('0x2b')][_0x9e25('0x36')]){_0xe690f7[_0x9e25('0x37')]=_[_0x9e25('0x38')](_0xe690f7[_0x9e25('0x37')],{'$or':_[_0x9e25('0x26')](_0x5620ce,function(_0x2a3046){if(_0x2a3046[_0x9e25('0x28')]!==_0x9e25('0x39')){var _0x43aa39={};_0x43aa39[_0x2a3046[_0x9e25('0x24')]]={'$like':'%'+_0x2c9dd2[_0x9e25('0x2b')][_0x9e25('0x36')]+'%'};return _0x43aa39;}})});}_0xe690f7=_[_0x9e25('0x38')]({},_0xe690f7,_0x2c9dd2[_0x9e25('0x3a')]);var _0x51d556={'where':_0xe690f7[_0x9e25('0x37')]};return db[_0x9e25('0x27')][_0x9e25('0x1e')](_0x51d556)['then'](function(_0x17774d){_0x319250[_0x9e25('0x1e')]=_0x17774d;if(_0x2c9dd2[_0x9e25('0x2b')][_0x9e25('0x3b')]){_0xe690f7['include']=[{'all':!![]}];}return db[_0x9e25('0x27')][_0x9e25('0x3c')](_0xe690f7);})[_0x9e25('0x21')](function(_0x18d905){_0x319250[_0x9e25('0x3d')]=_0x18d905;return _0x319250;})[_0x9e25('0x21')](respondWithFilteredResult(_0x23112b,_0xe690f7))['catch'](handleError(_0x23112b,null));};exports['show']=function(_0x2c27c7,_0x365a6b){var _0x1b4710={'raw':!![],'where':{'id':_0x2c27c7['params']['id']}},_0x6f270c={};_0x6f270c[_0x9e25('0x2a')]=_[_0x9e25('0x3e')](db['Attachment'][_0x9e25('0x3f')]);_0x6f270c[_0x9e25('0x2b')]=_[_0x9e25('0x3e')](_0x2c27c7[_0x9e25('0x2b')]);_0x6f270c[_0x9e25('0x2c')]=_[_0x9e25('0x2d')](_0x6f270c[_0x9e25('0x2a')],_0x6f270c[_0x9e25('0x2b')]);_0x1b4710[_0x9e25('0x2e')]=_[_0x9e25('0x2d')](_0x6f270c[_0x9e25('0x2a')],qs[_0x9e25('0x2f')](_0x2c27c7[_0x9e25('0x2b')][_0x9e25('0x2f')]));_0x1b4710[_0x9e25('0x2e')]=_0x1b4710[_0x9e25('0x2e')][_0x9e25('0x30')]?_0x1b4710[_0x9e25('0x2e')]:_0x6f270c[_0x9e25('0x2a')];if(_0x2c27c7[_0x9e25('0x2b')]['includeAll']){_0x1b4710[_0x9e25('0x40')]=[{'all':!![]}];}_0x1b4710=_[_0x9e25('0x38')]({},_0x1b4710,_0x2c27c7[_0x9e25('0x3a')]);return db[_0x9e25('0x27')][_0x9e25('0x41')](_0x1b4710)['then'](handleEntityNotFound(_0x365a6b,null))[_0x9e25('0x21')](respondWithResult(_0x365a6b,null))[_0x9e25('0x42')](handleError(_0x365a6b,null));};exports[_0x9e25('0x43')]=function(_0x26ca38,_0x1d462a){var _0x57011d={'where':{'id':_0x26ca38[_0x9e25('0x44')]['id']}},_0x33ec5d={};_0x33ec5d[_0x9e25('0x2a')]=_['keys'](db['Attachment'][_0x9e25('0x3f')]);_0x57011d[_0x9e25('0x2e')]=_[_0x9e25('0x2d')](_0x33ec5d[_0x9e25('0x2a')],qs[_0x9e25('0x2f')](_0x26ca38[_0x9e25('0x2b')]['fields']));_0x57011d[_0x9e25('0x2e')]=_0x57011d[_0x9e25('0x2e')][_0x9e25('0x30')]?_0x57011d[_0x9e25('0x2e')]:_0x33ec5d['model'];if(_0x26ca38[_0x9e25('0x2b')][_0x9e25('0x3b')]){_0x57011d[_0x9e25('0x40')]=[{'all':!![]}];}_0x57011d=_[_0x9e25('0x38')]({},_0x57011d,_0x26ca38[_0x9e25('0x3a')]);return db[_0x9e25('0x27')]['find'](_0x57011d)['then'](handleEntityNotFound(_0x1d462a,null))[_0x9e25('0x21')](function(_0x53764c){if(_0x53764c){var _0x3a1baa=_0x53764c[_0x9e25('0x45')]({'plain':!![]});_0x3a1baa=qs[_0x9e25('0x46')](_0x3a1baa,['id',_0x9e25('0x47'),_0x9e25('0x48')]);_0x26ca38[_0x9e25('0x49')]=_['omit'](_0x26ca38[_0x9e25('0x49')],['id',_0x9e25('0x47'),_0x9e25('0x48')]);return db[_0x9e25('0x27')]['create'](_[_0x9e25('0x38')](_0x3a1baa,_0x26ca38['body']),{'include':_0x26ca38[_0x9e25('0x2b')]['includeAll']?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x1d462a,0xc9))[_0x9e25('0x42')](handleError(_0x1d462a,null));};exports['update']=function(_0x557991,_0xd76c49){if(_0x557991[_0x9e25('0x49')]['id']){delete _0x557991[_0x9e25('0x49')]['id'];}return db[_0x9e25('0x27')][_0x9e25('0x41')]({'where':{'id':_0x557991[_0x9e25('0x44')]['id']}})['then'](handleEntityNotFound(_0xd76c49,null))[_0x9e25('0x21')](saveUpdates(_0x557991[_0x9e25('0x49')],null))[_0x9e25('0x21')](respondWithResult(_0xd76c49,null))[_0x9e25('0x42')](handleError(_0xd76c49,null));};exports[_0x9e25('0x22')]=function(_0x5c21bf,_0x490f00){return db[_0x9e25('0x27')][_0x9e25('0x41')]({'where':{'id':_0x5c21bf[_0x9e25('0x44')]['id']}})[_0x9e25('0x21')](handleEntityNotFound(_0x490f00,null))[_0x9e25('0x21')](removeEntity(_0x490f00,null))[_0x9e25('0x42')](handleError(_0x490f00,null));};exports[_0x9e25('0x4a')]=function(_0x15d484,_0x4a76b8,_0x203168){_0x15d484[_0x9e25('0x49')][_0x9e25('0x24')]=_0x15d484[_0x9e25('0x4b')][_0x9e25('0x4c')];_0x15d484[_0x9e25('0x49')][_0x9e25('0x4d')]=_0x15d484[_0x9e25('0x4b')][_0x9e25('0x4e')];_0x15d484[_0x9e25('0x49')][_0x9e25('0x28')]=_0x15d484[_0x9e25('0x4b')][_0x9e25('0x4f')];return db[_0x9e25('0x27')][_0x9e25('0x4a')](_0x15d484['body'])[_0x9e25('0x21')](respondWithResult(_0x4a76b8,0xc9))[_0x9e25('0x42')](handleError(_0x4a76b8,null));};exports[_0x9e25('0x50')]=function(_0x45d172,_0x1f30ea,_0x5b52d5){return db['Attachment'][_0x9e25('0x51')]({'where':{'id':_0x45d172['params']['id']},'raw':!![]})[_0x9e25('0x21')](handleEntityNotFound(_0x1f30ea,null))[_0x9e25('0x21')](function(_0xc1367){if(_0xc1367){var _0x382a39=_0xc1367[_0x9e25('0x52')]!==null;var _0x4a7185=path[_0x9e25('0x53')](config['root'],_0x9e25('0x54'));if(_0x382a39){_0x4a7185=path['join'](_0x4a7185,_0x9e25('0x55'));}var _0x2c2e70=path[_0x9e25('0x53')](_0x4a7185,_0xc1367[_0x9e25('0x4d')]);return _0x1f30ea['download'](_0x2c2e70);}})[_0x9e25('0x42')](handleError(_0x1f30ea,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 541f0c7..25a0c28 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 _0xfab5=['Attachment','attachments','lodash','util','api','moment','bluebird','../../config/environment','./attachment.attributes','exports','define'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xfab5,0x86));var _0x5fab=function(_0x1786a6,_0x134d37){_0x1786a6=_0x1786a6-0x0;var _0x560522=_0xfab5[_0x1786a6];return _0x560522;};'use strict';var _=require(_0x5fab('0x0'));var util=require(_0x5fab('0x1'));var logger=require('../../config/logger')(_0x5fab('0x2'));var moment=require(_0x5fab('0x3'));var BPromise=require(_0x5fab('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5fab('0x5'));var attributes=require(_0x5fab('0x6'));module[_0x5fab('0x7')]=function(_0x1758a5,_0x49e537){return _0x1758a5[_0x5fab('0x8')](_0x5fab('0x9'),attributes,{'tableName':_0x5fab('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2909=['../../config/logger','api','bluebird','request-promise','../../config/environment','./attachment.attributes','exports','define','attachments','lodash'];(function(_0x496139,_0x4b7517){var _0x4a7d3e=function(_0x9637ba){while(--_0x9637ba){_0x496139['push'](_0x496139['shift']());}};_0x4a7d3e(++_0x4b7517);}(_0x2909,0x1ad));var _0x9290=function(_0xcdf363,_0x5223c5){_0xcdf363=_0xcdf363-0x0;var _0x2377f4=_0x2909[_0xcdf363];return _0x2377f4;};'use strict';var _=require(_0x9290('0x0'));var util=require('util');var logger=require(_0x9290('0x1'))(_0x9290('0x2'));var moment=require('moment');var BPromise=require(_0x9290('0x3'));var rp=require(_0x9290('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9290('0x5'));var attributes=require(_0x9290('0x6'));module[_0x9290('0x7')]=function(_0x3c2e0b,_0x388c9f){return _0x3c2e0b[_0x9290('0x8')]('Attachment',attributes,{'tableName':_0x9290('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index dca3090..7391e4d 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 _0xaa88=['debug','Attachment,\x20%s,\x20%s,\x20%s','error','Attachment,\x20%s,\x20%s','message','result','catch','create','body','options','CreateAttachment','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent'];(function(_0x8562c2,_0x1dc62f){var _0x539595=function(_0x449c6){while(--_0x449c6){_0x8562c2['push'](_0x8562c2['shift']());}};_0x539595(++_0x1dc62f);}(_0xaa88,0x137));var _0x8aa8=function(_0x34b821,_0x504e55){_0x34b821=_0x34b821-0x0;var _0x5e00a0=_0xaa88[_0x34b821];return _0x5e00a0;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('Attachment,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('Attachment,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('Attachment,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});}exports['CreateAttachment']=function(_0x2c1b9a){var _0x49d80d=this;return new Promise(function(_0x557adc,_0xab7af5){return db['Attachment'][_0x8aa8('0x15')](_0x2c1b9a[_0x8aa8('0x16')],{'raw':_0x2c1b9a[_0x8aa8('0x17')]?_0x2c1b9a[_0x8aa8('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x8aa8('0xb')](function(_0x36c445){logger[_0x8aa8('0xc')](_0x8aa8('0x18'),_0x2c1b9a);logger[_0x8aa8('0xe')](_0x8aa8('0x18'),_0x2c1b9a,JSON['stringify'](_0x36c445));_0x557adc(_0x36c445);})[_0x8aa8('0x14')](function(_0x4cc455){logger[_0x8aa8('0x10')]('CreateAttachment',_0x4cc455[_0x8aa8('0x12')],_0x2c1b9a);_0xab7af5(_0x49d80d['error'](0x1f4,_0x4cc455[_0x8aa8('0x12')]));});});};
\ No newline at end of file
+var _0x31c2=['CreateAttachment','stringify','lodash','bluebird','randomstring','../../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','catch','Attachment','create','body','options','raw'];(function(_0x12d013,_0x286e4c){var _0x54220c=function(_0x31d518){while(--_0x31d518){_0x12d013['push'](_0x12d013['shift']());}};_0x54220c(++_0x286e4c);}(_0x31c2,0x98));var _0x231c=function(_0x3c1a96,_0x1c9c14){_0x3c1a96=_0x3c1a96-0x0;var _0x18f552=_0x31c2[_0x3c1a96];return _0x18f552;};'use strict';var _=require(_0x231c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x231c('0x1'));var rs=require(_0x231c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x231c('0x3'))['db'];var utils=require(_0x231c('0x4'));var logger=require(_0x231c('0x5'))(_0x231c('0x6'));var config=require(_0x231c('0x7'));var jayson=require(_0x231c('0x8'));var client=jayson[_0x231c('0x9')][_0x231c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5afc76,_0x1e3997,_0x4fd8b8){return new BPromise(function(_0x3dfccb,_0x396da8){return client[_0x231c('0xb')](_0x5afc76,_0x4fd8b8)[_0x231c('0xc')](function(_0x4cd3b8){logger[_0x231c('0xd')](_0x231c('0xe'),_0x1e3997,_0x231c('0xf'));logger[_0x231c('0x10')](_0x231c('0x11'),_0x1e3997,_0x231c('0xf'),JSON['stringify'](_0x4cd3b8));if(_0x4cd3b8['error']){if(_0x4cd3b8['error'][_0x231c('0x12')]===0x1f4){logger[_0x231c('0x13')](_0x231c('0xe'),_0x1e3997,_0x4cd3b8[_0x231c('0x13')][_0x231c('0x14')]);return _0x396da8(_0x4cd3b8[_0x231c('0x13')][_0x231c('0x14')]);}logger[_0x231c('0x13')](_0x231c('0xe'),_0x1e3997,_0x4cd3b8[_0x231c('0x13')][_0x231c('0x14')]);return _0x3dfccb(_0x4cd3b8[_0x231c('0x13')][_0x231c('0x14')]);}else{logger[_0x231c('0xd')]('Attachment,\x20%s,\x20%s',_0x1e3997,_0x231c('0xf'));_0x3dfccb(_0x4cd3b8[_0x231c('0x15')][_0x231c('0x14')]);}})[_0x231c('0x16')](function(_0x40f4f6){logger['error'](_0x231c('0xe'),_0x1e3997,_0x40f4f6);_0x396da8(_0x40f4f6);});});}exports['CreateAttachment']=function(_0x1d48e3){var _0x59282c=this;return new Promise(function(_0x286148,_0x34f391){return db[_0x231c('0x17')][_0x231c('0x18')](_0x1d48e3[_0x231c('0x19')],{'raw':_0x1d48e3[_0x231c('0x1a')]?_0x1d48e3[_0x231c('0x1a')][_0x231c('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x29a94){logger[_0x231c('0xd')](_0x231c('0x1c'),_0x1d48e3);logger['debug']('CreateAttachment',_0x1d48e3,JSON[_0x231c('0x1d')](_0x29a94));_0x286148(_0x29a94);})[_0x231c('0x16')](function(_0x3bd9ed){logger['error'](_0x231c('0x1c'),_0x3bd9ed['message'],_0x1d48e3);_0x34f391(_0x59282c[_0x231c('0x13')](0x1f4,_0x3bd9ed[_0x231c('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index c3dc9ab..7d333e7 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 _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x3f54ae,_0x59fe1d){var _0x36c653=function(_0x4a2d27){while(--_0x4a2d27){_0x3f54ae['push'](_0x3f54ae['shift']());}};_0x36c653(++_0x59fe1d);}(_0xb10b,0x12a));var _0xbb10=function(_0x11bee4,_0x117d71){_0x11bee4=_0x11bee4-0x0;var _0x110e2a=_0xb10b[_0x11bee4];return _0x110e2a;};'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')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=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(_0x16ffb8,_0x1475f5){var _0x7a2f42=function(_0x26d77e){while(--_0x26d77e){_0x16ffb8['push'](_0x16ffb8['shift']());}};_0x7a2f42(++_0x1475f5);}(_0x2032,0xd9));var _0x2203=function(_0x26f715,_0x9ea6db){_0x26f715=_0x26f715-0x0;var _0x3633a0=_0x2032[_0x26f715];return _0x3633a0;};'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/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 87b7a63..2d2d5b6 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 _0x3c2b=['blocked','blockedAt','minutes','clearBlockUser','getLicense','catch','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../components/auth/service','signToken','login','authenticate','google','/login','profile','email','callback','use','clientID','clientSecret','secret','callbackURL','Setting','blockDuration','then','User','find','map','emails','value','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x4d05aa,_0x2131e4){var _0x4ef117=function(_0x230f03){while(--_0x230f03){_0x4d05aa['push'](_0x4d05aa['shift']());}};_0x4ef117(++_0x2131e4);}(_0x3c2b,0x187));var _0xb3c2=function(_0x65fd92,_0x17a418){_0x65fd92=_0x65fd92-0x0;var _0x372735=_0x3c2b[_0x65fd92];return _0x372735;};'use strict';var _=require('lodash');var passport=require(_0xb3c2('0x0'));var GoogleStrategy=require(_0xb3c2('0x1'))[_0xb3c2('0x2')];var moment=require(_0xb3c2('0x3'));var db=require(_0xb3c2('0x4'))['db'];var config=require('../../config/environment');var signToken=require(_0xb3c2('0x5'))[_0xb3c2('0x6')];var utils=require('../../config/utils');exports[_0xb3c2('0x7')]=passport[_0xb3c2('0x8')](_0xb3c2('0x9'),{'failureRedirect':_0xb3c2('0xa'),'scope':[_0xb3c2('0xb'),_0xb3c2('0xc')],'session':![]});exports[_0xb3c2('0xd')]=passport['authenticate'](_0xb3c2('0x9'),{'failureRedirect':'/login','session':![]});passport[_0xb3c2('0xe')](new GoogleStrategy({'clientID':config[_0xb3c2('0x9')]?config[_0xb3c2('0x9')][_0xb3c2('0xf')]:'id','clientSecret':config[_0xb3c2('0x9')]?config['google'][_0xb3c2('0x10')]:_0xb3c2('0x11'),'callbackURL':config[_0xb3c2('0x9')]?config[_0xb3c2('0x9')][_0xb3c2('0x12')]:''},function(_0x236771,_0x106eac,_0x25a5ef,_0xcb76d2){var _0x5e8c7b,_0x4ca3f3;return db[_0xb3c2('0x13')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xb3c2('0x14')],'raw':!![]})[_0xb3c2('0x15')](function(_0x5b9fed){_0x5e8c7b=_0x5b9fed;return db[_0xb3c2('0x16')][_0xb3c2('0x17')]({'where':{'email':_[_0xb3c2('0x18')](_0x25a5ef[_0xb3c2('0x19')],_0xb3c2('0x1a')),'role':{'$or':['admin','user',_0xb3c2('0x1b')]}}});})[_0xb3c2('0x15')](function(_0x4982ea){_0x4ca3f3=_0x4982ea;if(_0x4ca3f3){if(_0x4ca3f3['disabled']){return _0xcb76d2(_0xb3c2('0x1c'));}else if(_0x5e8c7b['blockDuration']>0x0){if(_0x4ca3f3[_0xb3c2('0x1d')]){if(moment(_0x4ca3f3[_0xb3c2('0x1e')])['add'](_0x5e8c7b[_0xb3c2('0x14')],_0xb3c2('0x1f'))>moment()){return _0xcb76d2(_0xb3c2('0x1c'));}else{return utils[_0xb3c2('0x20')](_0x4ca3f3,0x0,![],null)['then'](function(){return utils['getLicense'](_0x4ca3f3);})['then'](function(){return _0xcb76d2(null,_0x4ca3f3);});}}else{return utils['getLicense'](_0x4ca3f3)[_0xb3c2('0x15')](function(){return _0xcb76d2(null,_0x4ca3f3);});}}else{return utils[_0xb3c2('0x21')](_0x4ca3f3)[_0xb3c2('0x15')](function(){return _0xcb76d2(null,_0x4ca3f3);});}}return _0xcb76d2(_0xb3c2('0x1c'));})[_0xb3c2('0x22')](function(_0x377308){_0xcb76d2(_0x377308);});}));
\ No newline at end of file
+var _0x82fa=['admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','add','minutes','clearBlockUser','lodash','passport-google-oauth20','Strategy','../../mysqldb','../../config/environment','../../components/auth/service','../../config/utils','login','authenticate','/login','email','callback','google','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','then','User','emails','value'];(function(_0x52c907,_0x5bb5cb){var _0x568c5a=function(_0x58580e){while(--_0x58580e){_0x52c907['push'](_0x52c907['shift']());}};_0x568c5a(++_0x5bb5cb);}(_0x82fa,0x11a));var _0xa82f=function(_0xda3a40,_0x5cf8c1){_0xda3a40=_0xda3a40-0x0;var _0x1e81f1=_0x82fa[_0xda3a40];return _0x1e81f1;};'use strict';var _=require(_0xa82f('0x0'));var passport=require('passport');var GoogleStrategy=require(_0xa82f('0x1'))[_0xa82f('0x2')];var moment=require('moment');var db=require(_0xa82f('0x3'))['db'];var config=require(_0xa82f('0x4'));var signToken=require(_0xa82f('0x5'))['signToken'];var utils=require(_0xa82f('0x6'));exports[_0xa82f('0x7')]=passport[_0xa82f('0x8')]('google',{'failureRedirect':_0xa82f('0x9'),'scope':['profile',_0xa82f('0xa')],'session':![]});exports[_0xa82f('0xb')]=passport[_0xa82f('0x8')](_0xa82f('0xc'),{'failureRedirect':_0xa82f('0x9'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0xa82f('0xc')]?config['google'][_0xa82f('0xd')]:'id','clientSecret':config[_0xa82f('0xc')]?config['google'][_0xa82f('0xe')]:_0xa82f('0xf'),'callbackURL':config[_0xa82f('0xc')]?config[_0xa82f('0xc')][_0xa82f('0x10')]:''},function(_0x437bc2,_0x11de35,_0x3ae661,_0x3b078a){var _0x4f39e7,_0x2beee7;return db[_0xa82f('0x11')][_0xa82f('0x12')]({'where':{'id':0x1},'attributes':[_0xa82f('0x13'),'blockDuration'],'raw':!![]})[_0xa82f('0x14')](function(_0x536825){_0x4f39e7=_0x536825;return db[_0xa82f('0x15')]['find']({'where':{'email':_['map'](_0x3ae661[_0xa82f('0x16')],_0xa82f('0x17')),'role':{'$or':[_0xa82f('0x18'),_0xa82f('0x19'),_0xa82f('0x1a')]}}});})['then'](function(_0x286d48){_0x2beee7=_0x286d48;if(_0x2beee7){if(_0x2beee7[_0xa82f('0x1b')]){return _0x3b078a(_0xa82f('0x1c'));}else if(_0x4f39e7[_0xa82f('0x1d')]>0x0){if(_0x2beee7[_0xa82f('0x1e')]){if(moment(_0x2beee7['blockedAt'])[_0xa82f('0x1f')](_0x4f39e7[_0xa82f('0x1d')],_0xa82f('0x20'))>moment()){return _0x3b078a('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0xa82f('0x21')](_0x2beee7,0x0,![],null)[_0xa82f('0x14')](function(){return utils['getLicense'](_0x2beee7);})['then'](function(){return _0x3b078a(null,_0x2beee7);});}}else{return utils['getLicense'](_0x2beee7)[_0xa82f('0x14')](function(){return _0x3b078a(null,_0x2beee7);});}}else{return utils['getLicense'](_0x2beee7)[_0xa82f('0x14')](function(){return _0x3b078a(null,_0x2beee7);});}}return _0x3b078a(_0xa82f('0x1c'));})['catch'](function(_0x581d5f){_0x3b078a(_0x581d5f);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index e10ad63..56c261e 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 _0x92e8=['./authGoogle.controller','../../components/auth/service','get','login','/callback','callback','exports','express'];(function(_0x18c190,_0x83ac33){var _0x337854=function(_0x3ed18e){while(--_0x3ed18e){_0x18c190['push'](_0x18c190['shift']());}};_0x337854(++_0x83ac33);}(_0x92e8,0x7f));var _0x892e=function(_0x3e8270,_0x293590){_0x3e8270=_0x3e8270-0x0;var _0x1ccde9=_0x92e8[_0x3e8270];return _0x1ccde9;};'use strict';var express=require(_0x892e('0x0'));var passport=require('passport');var router=express['Router']();var controller=require(_0x892e('0x1'));var userController=require('../user/user.controller.js');var authService=require(_0x892e('0x2'));router[_0x892e('0x3')]('/',controller[_0x892e('0x4')]);router[_0x892e('0x3')](_0x892e('0x5'),controller[_0x892e('0x6')],authService['isMiddleware'],userController[_0x892e('0x4')],authService['setTokenCookie']);module[_0x892e('0x7')]=router;
\ No newline at end of file
+var _0xbe49=['passport','Router','./authGoogle.controller','../user/user.controller.js','get','/callback','callback','login','exports','express'];(function(_0x42c809,_0x5860eb){var _0x37f369=function(_0x228326){while(--_0x228326){_0x42c809['push'](_0x42c809['shift']());}};_0x37f369(++_0x5860eb);}(_0xbe49,0x135));var _0x9be4=function(_0x182188,_0x5026a8){_0x182188=_0x182188-0x0;var _0x2beaa4=_0xbe49[_0x182188];return _0x2beaa4;};'use strict';var express=require(_0x9be4('0x0'));var passport=require(_0x9be4('0x1'));var router=express[_0x9be4('0x2')]();var controller=require(_0x9be4('0x3'));var userController=require(_0x9be4('0x4'));var authService=require('../../components/auth/service');router[_0x9be4('0x5')]('/',controller['login']);router['get'](_0x9be4('0x6'),controller[_0x9be4('0x7')],authService['isMiddleware'],userController[_0x9be4('0x8')],authService['setTokenCookie']);module[_0x9be4('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 646a078..8ef9a25 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 _0x8f12=['MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','Smtp','host','port','secure','authentication','auth','pass','merge','format','user','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','forgot','Email\x20parameter\x20is\x20missing','body','resetPasswordToken','resetPasswordExpires','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','find','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','previousPasswords','save','Password\x20reset!','use','User','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','password','salt','role','disabled','blocked','blockedAt','admin','agent','then','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','clearBlockUser','minutes','getLicense','catch','MailAccount','email'];(function(_0x4720ae,_0x9938da){var _0x361af7=function(_0x1e24b8){while(--_0x1e24b8){_0x4720ae['push'](_0x4720ae['shift']());}};_0x361af7(++_0x9938da);}(_0x8f12,0x122));var _0x28f1=function(_0x578e76,_0x2047bb){_0x578e76=_0x578e76-0x0;var _0x26e58b=_0x8f12[_0x578e76];return _0x26e58b;};'use strict';var util=require('util');var passport=require(_0x28f1('0x0'));var LocalStrategy=require(_0x28f1('0x1'))[_0x28f1('0x2')];var jayson=require(_0x28f1('0x3'));var _=require(_0x28f1('0x4'));var rs=require(_0x28f1('0x5'));var moment=require(_0x28f1('0x6'));var db=require(_0x28f1('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x28f1('0x8'));var client=jayson[_0x28f1('0x9')][_0x28f1('0xa')]({'port':0x232b});function localAuthenticate(_0x447fdf,_0x105fb0,_0x3d1e33,_0x1304ea){var _0x305ca8,_0x536891;return db[_0x28f1('0xb')][_0x28f1('0xc')]({'where':{'id':0x1},'attributes':[_0x28f1('0xd'),_0x28f1('0xe')],'raw':!![]})['then'](function(_0x26bbef){_0x305ca8=_0x26bbef;return _0x447fdf[_0x28f1('0xc')]({'attributes':['id','name',_0x28f1('0xf'),_0x28f1('0x10'),_0x28f1('0x11'),_0x28f1('0x12'),_0x28f1('0x13'),_0x28f1('0x14'),'loginAttempts'],'where':{'name':_0x105fb0,'role':{'$or':[_0x28f1('0x15'),'user',_0x28f1('0x16')]}}});})[_0x28f1('0x17')](function(_0x5875d0){if(!_0x5875d0||_0x5875d0&&_0x5875d0[_0x28f1('0x18')]!==_0x105fb0){throw new Error(_0x28f1('0x19'));}else{_0x536891=_0x5875d0;return _0x536891;}})[_0x28f1('0x17')](function(){_0x536891[_0x28f1('0x1a')](_0x3d1e33,function(_0x94bbe0,_0x259031){var _0x4c8432=_0x536891['loginAttempts']+0x1;if(_0x94bbe0){return _0x1304ea(_0x94bbe0);}else if(!_0x259031){if(_0x536891[_0x28f1('0x12')]){return _0x1304ea(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x305ca8[_0x28f1('0xd')]>0x0){if(_0x536891[_0x28f1('0x13')]){if(_0x305ca8[_0x28f1('0xe')]>0x0){if(moment(_0x536891[_0x28f1('0x14')])[_0x28f1('0x1b')](_0x305ca8['blockDuration'],'minutes')>moment()){return _0x1304ea(null,![],{'message':_0x28f1('0x19')});}else{return utils[_0x28f1('0x1c')](_0x536891,_0x4c8432,![],null)['then'](function(){return _0x1304ea(null,![],{'message':_0x28f1('0x19')});});}}else{return _0x1304ea(null,![],{'message':_0x28f1('0x19')});}}else{if(_0x4c8432>=_0x305ca8[_0x28f1('0xd')]){return utils[_0x28f1('0x1c')](_0x536891,0x0,!![],moment())[_0x28f1('0x17')](function(){return _0x1304ea(null,![],{'message':_0x28f1('0x19')});});}else{return utils[_0x28f1('0x1c')](_0x536891,_0x4c8432,![],null)['then'](function(){return _0x1304ea(null,![],{'message':_0x28f1('0x19')});});}}}else{return _0x1304ea(null,![],{'message':_0x28f1('0x19')});}}else{if(_0x536891['disabled']){return _0x1304ea(null,![],{'message':_0x28f1('0x19')});}else if(_0x305ca8[_0x28f1('0xd')]>0x0){if(_0x536891[_0x28f1('0x13')]){if(_0x305ca8['blockDuration']>0x0){if(moment(_0x536891[_0x28f1('0x14')])[_0x28f1('0x1b')](_0x305ca8['blockDuration'],_0x28f1('0x1d'))>moment()){return _0x1304ea(null,![],{'message':_0x28f1('0x19')});}else{return utils[_0x28f1('0x1c')](_0x536891,0x0,![],null)[_0x28f1('0x17')](function(){return utils[_0x28f1('0x1e')](_0x536891);})[_0x28f1('0x17')](function(){return _0x1304ea(null,_0x536891);});}}else{return _0x1304ea(null,![],{'message':_0x28f1('0x19')});}}else{return utils[_0x28f1('0x1c')](_0x536891,0x0,![],null)['then'](function(){return utils[_0x28f1('0x1e')](_0x536891);})[_0x28f1('0x17')](function(){return _0x1304ea(null,_0x536891);})[_0x28f1('0x1f')](function(_0x2b260a){return _0x1304ea(null,![],_0x2b260a);});}}else{if(_0x536891[_0x28f1('0x13')]){return _0x1304ea(null,![],{'message':_0x28f1('0x19')});}else{return utils['getLicense'](_0x536891)[_0x28f1('0x17')](function(){return _0x1304ea(null,_0x536891);});}}}});})[_0x28f1('0x1f')](function(_0x3aa1a1){return _0x1304ea(null,![],_0x3aa1a1);});}function sendServiceMail(_0xdd00e0){return db[_0x28f1('0x20')]['find']({'where':{'service':!![]},'attributes':['id',_0x28f1('0x18'),_0x28f1('0x21')],'include':[{'model':db[_0x28f1('0x22')],'as':'Smtp'}]})[_0x28f1('0x17')](function(_0x2453ff){if(!_0x2453ff){throw new Error(_0x28f1('0x23'));}var _0x72d83a={'tls':{'rejectUnauthorized':![]}};if(_0x2453ff['Smtp'][_0x28f1('0x24')]){_0x72d83a[_0x28f1('0x24')]=_0x2453ff[_0x28f1('0x25')][_0x28f1('0x24')];}else{_0x72d83a[_0x28f1('0x26')]=_0x2453ff[_0x28f1('0x25')]['host'];_0x72d83a[_0x28f1('0x27')]=_0x2453ff['Smtp'][_0x28f1('0x27')];_0x72d83a[_0x28f1('0x28')]=_0x2453ff[_0x28f1('0x25')][_0x28f1('0x28')];}if(_0x2453ff[_0x28f1('0x25')][_0x28f1('0x29')]){_0x72d83a[_0x28f1('0x2a')]={'user':_0x2453ff['Smtp']['user'],'pass':_0x2453ff['Smtp'][_0x28f1('0x2b')]};}var _0x3af1da={'account':_0x72d83a,'message':_[_0x28f1('0x2c')]({'from':util[_0x28f1('0x2d')]('\x22%s\x22\x20<%s>',_0x2453ff[_0x28f1('0x18')],_0x2453ff[_0x28f1('0x21')]||_0x2453ff[_0x28f1('0x25')][_0x28f1('0x2e')])},_0xdd00e0)};return client[_0x28f1('0x2f')]('SendMail',_0x3af1da);})[_0x28f1('0x17')](function(_0x18713d){if(_0x18713d[_0x28f1('0x30')]){throw new Error(util['format'](_0x28f1('0x31'),_0x18713d[_0x28f1('0x30')][_0x28f1('0x32')]||JSON[_0x28f1('0x33')](_0x18713d[_0x28f1('0x30')])));}return!![];});}function handleError(_0x521967,_0xdb49e,_0x160efb){return _0x521967[_0x28f1('0x34')](_0xdb49e||0x1f4)[_0x28f1('0x35')]({'message':_0x160efb?_0x160efb[_0x28f1('0x32')]||_0x160efb:''});}exports[_0x28f1('0x36')]=function(_0x9d4b88,_0x34ae41,_0x1ac46c){passport[_0x28f1('0x1a')]('local',function(_0x1a52c8,_0xbc9d9c,_0x189ac6){var _0x3774be=_0x1a52c8||_0x189ac6;if(_0x3774be){return handleError(_0x34ae41,0x191,_0x3774be);}if(!_0xbc9d9c){return handleError(_0x34ae41,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x4e87ef={'payload':{'id':_0xbc9d9c['id'],'role':_0xbc9d9c[_0x28f1('0x11')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x4e87ef)[_0x28f1('0x17')](function(_0x30a4b4){_0x34ae41['json']({'id':_0xbc9d9c['id'],'token':_0x30a4b4,'statusCall':'','isAlreadyLogged':_0xbc9d9c['online']});});}})(_0x9d4b88,_0x34ae41,_0x1ac46c);};exports[_0x28f1('0x37')]=function(_0x260d5c,_0x23eee6,_0x2e3ee0){if(!_0x260d5c['body'][_0x28f1('0x21')]){return handleError(_0x23eee6,0x1f4,{'message':_0x28f1('0x38')});}var _0x202bc1=rs['generate']();_0x260d5c[_0x28f1('0x39')][_0x28f1('0x21')]=_0x260d5c['body'][_0x28f1('0x21')]['trim']()['toLowerCase']();var _0x1dd18b;return db[_0x28f1('0xb')][_0x28f1('0xc')]({'where':{'id':0x1},'attributes':[_0x28f1('0xd'),'blockDuration'],'raw':!![]})[_0x28f1('0x17')](function(_0x3e6aaf){_0x1dd18b=_0x3e6aaf;return db['User']['find']({'where':{'email':_0x260d5c[_0x28f1('0x39')][_0x28f1('0x21')]}});})[_0x28f1('0x17')](function(_0x4df28d){if(!_0x4df28d){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x4df28d[_0x28f1('0x12')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x4df28d[_0x28f1('0x13')]){if(moment(_0x4df28d[_0x28f1('0x14')])[_0x28f1('0x1b')](_0x1dd18b['blockDuration'],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x4df28d[_0x28f1('0x13')]=![];_0x4df28d[_0x28f1('0x14')]=null;}}_0x4df28d[_0x28f1('0x3a')]=_0x202bc1;_0x4df28d[_0x28f1('0x3b')]=Date['now']()+0x36ee80;return _0x4df28d['save']();})[_0x28f1('0x17')](function(){return sendServiceMail({'to':_0x260d5c[_0x28f1('0x39')]['email'],'subject':_0x28f1('0x3c'),'text':_0x28f1('0x3d')+_0x28f1('0x3e')+_0x28f1('0x3f')+_0x260d5c[_0x28f1('0x40')]['host']+'/reset/'+_0x202bc1+'\x0a\x0a'+_0x28f1('0x41')});})[_0x28f1('0x17')](function(){_0x23eee6[_0x28f1('0x34')](0xc8)['send']({'message':_0x28f1('0x42')});})['catch'](function(_0x58064a){return handleError(_0x23eee6,0x1f4,_0x58064a);});};exports[_0x28f1('0x43')]=function(_0x47dfb4,_0x1a8b40,_0x19eee8){return db['User'][_0x28f1('0x44')]({'where':{'resetPasswordToken':_0x47dfb4['params'][_0x28f1('0x45')],'resetPasswordExpires':{'$gt':Date[_0x28f1('0x46')]()}}})[_0x28f1('0x17')](function(_0x5ce06e){if(!_0x5ce06e){throw new Error(_0x28f1('0x47'));}return db[_0x28f1('0xb')]['findOne']({'attributes':['id',_0x28f1('0x48'),'enforcePasswordHistory',_0x28f1('0x49')]})[_0x28f1('0x17')](function(_0x360579){if(_0x360579[_0x28f1('0x48')])authService[_0x28f1('0x4a')](_0x47dfb4['body'][_0x28f1('0xf')]);if(!_0x360579[_0x28f1('0x4b')]||!_0x5ce06e[_0x28f1('0x4c')])return _0x5ce06e;authService['validatePasswordHistory'](_0x47dfb4[_0x28f1('0x39')]['password'],_0x5ce06e[_0x28f1('0x4c')],_0x360579['passwordHistoryLimit']);return _0x5ce06e;})[_0x28f1('0x17')](function(){_0x5ce06e[_0x28f1('0xf')]=_0x47dfb4[_0x28f1('0x39')]['password'];_0x5ce06e[_0x28f1('0x3a')]=null;_0x5ce06e[_0x28f1('0x3b')]=null;return _0x5ce06e[_0x28f1('0x4d')]();});})[_0x28f1('0x17')](function(){_0x1a8b40[_0x28f1('0x34')](0xc8)[_0x28f1('0x35')]({'message':_0x28f1('0x4e')});})[_0x28f1('0x1f')](function(_0x336c87){return handleError(_0x1a8b40,0x1f4,_0x336c87);});};passport[_0x28f1('0x4f')](new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x34a66a,_0x1dda57,_0x35473d){return localAuthenticate(db[_0x28f1('0x50')],_0x34a66a,_0x1dda57,_0x35473d);}));
\ No newline at end of file
+var _0x275c=['User','params','token','now','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','save','send','Password\x20reset!','use','util','passport','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','blocked','minutes','clearBlockUser','blockedAt','add','getLicense','MailAccount','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','merge','\x22%s\x22\x20<%s>','request','SendMail','error','message','stringify','status','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','Reset\x20Email\x20sent!','catch','reset'];(function(_0x25248b,_0x3c8491){var _0x509939=function(_0x457a27){while(--_0x457a27){_0x25248b['push'](_0x25248b['shift']());}};_0x509939(++_0x3c8491);}(_0x275c,0x1d0));var _0xc275=function(_0x1db10f,_0x2656ba){_0x1db10f=_0x1db10f-0x0;var _0x2f6647=_0x275c[_0x1db10f];return _0x2f6647;};'use strict';var util=require(_0xc275('0x0'));var passport=require(_0xc275('0x1'));var LocalStrategy=require('passport-local')[_0xc275('0x2')];var jayson=require(_0xc275('0x3'));var _=require(_0xc275('0x4'));var rs=require(_0xc275('0x5'));var moment=require('moment');var db=require(_0xc275('0x6'))['db'];var authService=require(_0xc275('0x7'));var utils=require(_0xc275('0x8'));var client=jayson[_0xc275('0x9')][_0xc275('0xa')]({'port':0x232b});function localAuthenticate(_0x32ea60,_0x26077d,_0x59661c,_0x46fc42){var _0x454c9d,_0x452dbe;return db[_0xc275('0xb')][_0xc275('0xc')]({'where':{'id':0x1},'attributes':[_0xc275('0xd'),_0xc275('0xe')],'raw':!![]})[_0xc275('0xf')](function(_0x4db474){_0x454c9d=_0x4db474;return _0x32ea60[_0xc275('0xc')]({'attributes':['id',_0xc275('0x10'),_0xc275('0x11'),_0xc275('0x12'),_0xc275('0x13'),_0xc275('0x14'),'blocked','blockedAt','loginAttempts'],'where':{'name':_0x26077d,'role':{'$or':[_0xc275('0x15'),_0xc275('0x16'),_0xc275('0x17')]}}});})[_0xc275('0xf')](function(_0x4958a9){if(!_0x4958a9||_0x4958a9&&_0x4958a9['name']!==_0x26077d){throw new Error(_0xc275('0x18'));}else{_0x452dbe=_0x4958a9;return _0x452dbe;}})[_0xc275('0xf')](function(){_0x452dbe[_0xc275('0x19')](_0x59661c,function(_0x3dce3a,_0x38fad2){var _0x27080d=_0x452dbe[_0xc275('0x1a')]+0x1;if(_0x3dce3a){return _0x46fc42(_0x3dce3a);}else if(!_0x38fad2){if(_0x452dbe[_0xc275('0x14')]){return _0x46fc42(null,![],{'message':_0xc275('0x18')});}else if(_0x454c9d[_0xc275('0xd')]>0x0){if(_0x452dbe[_0xc275('0x1b')]){if(_0x454c9d[_0xc275('0xe')]>0x0){if(moment(_0x452dbe['blockedAt'])['add'](_0x454c9d[_0xc275('0xe')],_0xc275('0x1c'))>moment()){return _0x46fc42(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x452dbe,_0x27080d,![],null)[_0xc275('0xf')](function(){return _0x46fc42(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x46fc42(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x27080d>=_0x454c9d['allowedLoginAttempts']){return utils['clearBlockUser'](_0x452dbe,0x0,!![],moment())[_0xc275('0xf')](function(){return _0x46fc42(null,![],{'message':_0xc275('0x18')});});}else{return utils[_0xc275('0x1d')](_0x452dbe,_0x27080d,![],null)[_0xc275('0xf')](function(){return _0x46fc42(null,![],{'message':_0xc275('0x18')});});}}}else{return _0x46fc42(null,![],{'message':_0xc275('0x18')});}}else{if(_0x452dbe['disabled']){return _0x46fc42(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x454c9d[_0xc275('0xd')]>0x0){if(_0x452dbe[_0xc275('0x1b')]){if(_0x454c9d[_0xc275('0xe')]>0x0){if(moment(_0x452dbe[_0xc275('0x1e')])[_0xc275('0x1f')](_0x454c9d[_0xc275('0xe')],_0xc275('0x1c'))>moment()){return _0x46fc42(null,![],{'message':_0xc275('0x18')});}else{return utils[_0xc275('0x1d')](_0x452dbe,0x0,![],null)['then'](function(){return utils[_0xc275('0x20')](_0x452dbe);})[_0xc275('0xf')](function(){return _0x46fc42(null,_0x452dbe);});}}else{return _0x46fc42(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xc275('0x1d')](_0x452dbe,0x0,![],null)[_0xc275('0xf')](function(){return utils[_0xc275('0x20')](_0x452dbe);})[_0xc275('0xf')](function(){return _0x46fc42(null,_0x452dbe);})['catch'](function(_0x16ed9a){return _0x46fc42(null,![],_0x16ed9a);});}}else{if(_0x452dbe[_0xc275('0x1b')]){return _0x46fc42(null,![],{'message':_0xc275('0x18')});}else{return utils['getLicense'](_0x452dbe)[_0xc275('0xf')](function(){return _0x46fc42(null,_0x452dbe);});}}}});})['catch'](function(_0x31f611){return _0x46fc42(null,![],_0x31f611);});}function sendServiceMail(_0x3f8455){return db[_0xc275('0x21')][_0xc275('0x22')]({'where':{'service':!![]},'attributes':['id',_0xc275('0x10'),_0xc275('0x23')],'include':[{'model':db['MailServerOut'],'as':_0xc275('0x24')}]})[_0xc275('0xf')](function(_0xd4f14f){if(!_0xd4f14f){throw new Error(_0xc275('0x25'));}var _0x142ede={'tls':{'rejectUnauthorized':![]}};if(_0xd4f14f[_0xc275('0x24')][_0xc275('0x26')]){_0x142ede['service']=_0xd4f14f[_0xc275('0x24')][_0xc275('0x26')];}else{_0x142ede[_0xc275('0x27')]=_0xd4f14f['Smtp'][_0xc275('0x27')];_0x142ede[_0xc275('0x28')]=_0xd4f14f['Smtp'][_0xc275('0x28')];_0x142ede[_0xc275('0x29')]=_0xd4f14f[_0xc275('0x24')][_0xc275('0x29')];}if(_0xd4f14f['Smtp'][_0xc275('0x2a')]){_0x142ede[_0xc275('0x2b')]={'user':_0xd4f14f[_0xc275('0x24')][_0xc275('0x16')],'pass':_0xd4f14f[_0xc275('0x24')][_0xc275('0x2c')]};}var _0x53411c={'account':_0x142ede,'message':_[_0xc275('0x2d')]({'from':util['format'](_0xc275('0x2e'),_0xd4f14f[_0xc275('0x10')],_0xd4f14f[_0xc275('0x23')]||_0xd4f14f[_0xc275('0x24')][_0xc275('0x16')])},_0x3f8455)};return client[_0xc275('0x2f')](_0xc275('0x30'),_0x53411c);})[_0xc275('0xf')](function(_0x525a1f){if(_0x525a1f['error']){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x525a1f[_0xc275('0x31')][_0xc275('0x32')]||JSON[_0xc275('0x33')](_0x525a1f['error'])));}return!![];});}function handleError(_0x46c1c0,_0x938174,_0x19a773){return _0x46c1c0[_0xc275('0x34')](_0x938174||0x1f4)['send']({'message':_0x19a773?_0x19a773[_0xc275('0x32')]||_0x19a773:''});}exports[_0xc275('0x35')]=function(_0x3a1f13,_0x317610,_0x51ac97){passport[_0xc275('0x19')](_0xc275('0x36'),function(_0x25a019,_0x35cd39,_0x40102f){var _0x3d65ed=_0x25a019||_0x40102f;if(_0x3d65ed){return handleError(_0x317610,0x191,_0x3d65ed);}if(!_0x35cd39){return handleError(_0x317610,0x194,{'message':_0xc275('0x37')});}else{var _0x4538c7={'payload':{'id':_0x35cd39['id'],'role':_0x35cd39['role']},'options':{'expiresIn':0x15180}};return authService[_0xc275('0x38')](_0x4538c7)[_0xc275('0xf')](function(_0x89e498){_0x317610[_0xc275('0x39')]({'id':_0x35cd39['id'],'token':_0x89e498,'statusCall':'','isAlreadyLogged':_0x35cd39['online']});});}})(_0x3a1f13,_0x317610,_0x51ac97);};exports[_0xc275('0x3a')]=function(_0x23a39a,_0x1f760d,_0x2f46a0){if(!_0x23a39a[_0xc275('0x3b')]['email']){return handleError(_0x1f760d,0x1f4,{'message':_0xc275('0x3c')});}var _0x3fd83c=rs[_0xc275('0x3d')]();_0x23a39a['body'][_0xc275('0x23')]=_0x23a39a[_0xc275('0x3b')][_0xc275('0x23')][_0xc275('0x3e')]()['toLowerCase']();var _0x45601a;return db[_0xc275('0xb')][_0xc275('0xc')]({'where':{'id':0x1},'attributes':[_0xc275('0xd'),'blockDuration'],'raw':!![]})[_0xc275('0xf')](function(_0x209d8d){_0x45601a=_0x209d8d;return db['User'][_0xc275('0x22')]({'where':{'email':_0x23a39a[_0xc275('0x3b')]['email']}});})[_0xc275('0xf')](function(_0x156131){if(!_0x156131){throw new Error(_0xc275('0x3f'));}if(_0x156131['disabled']){throw new Error(_0xc275('0x40'));}if(_0x156131['blocked']){if(moment(_0x156131[_0xc275('0x1e')])['add'](_0x45601a[_0xc275('0xe')],_0xc275('0x1c'))>moment()){throw new Error(_0xc275('0x41'));}else{_0x156131[_0xc275('0x1b')]=![];_0x156131[_0xc275('0x1e')]=null;}}_0x156131[_0xc275('0x42')]=_0x3fd83c;_0x156131['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x156131['save']();})[_0xc275('0xf')](function(){return sendServiceMail({'to':_0x23a39a[_0xc275('0x3b')][_0xc275('0x23')],'subject':_0xc275('0x43'),'text':_0xc275('0x44')+_0xc275('0x45')+_0xc275('0x46')+_0x23a39a[_0xc275('0x47')]['host']+_0xc275('0x48')+_0x3fd83c+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xc275('0xf')](function(){_0x1f760d['status'](0xc8)['send']({'message':_0xc275('0x49')});})[_0xc275('0x4a')](function(_0x1e27ef){return handleError(_0x1f760d,0x1f4,_0x1e27ef);});};exports[_0xc275('0x4b')]=function(_0x7baaea,_0x1d1821,_0x331a7a){return db[_0xc275('0x4c')][_0xc275('0x22')]({'where':{'resetPasswordToken':_0x7baaea[_0xc275('0x4d')][_0xc275('0x4e')],'resetPasswordExpires':{'$gt':Date[_0xc275('0x4f')]()}}})[_0xc275('0xf')](function(_0x4773d5){if(!_0x4773d5){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xc275('0xb')][_0xc275('0xc')]({'attributes':['id',_0xc275('0x50'),_0xc275('0x51'),_0xc275('0x52')]})[_0xc275('0xf')](function(_0x3bb060){if(_0x3bb060[_0xc275('0x50')])authService[_0xc275('0x53')](_0x7baaea[_0xc275('0x3b')][_0xc275('0x11')]);if(!_0x3bb060[_0xc275('0x51')]||!_0x4773d5[_0xc275('0x54')])return _0x4773d5;authService[_0xc275('0x55')](_0x7baaea[_0xc275('0x3b')]['password'],_0x4773d5[_0xc275('0x54')],_0x3bb060[_0xc275('0x52')]);return _0x4773d5;})[_0xc275('0xf')](function(){_0x4773d5[_0xc275('0x11')]=_0x7baaea[_0xc275('0x3b')][_0xc275('0x11')];_0x4773d5['resetPasswordToken']=null;_0x4773d5['resetPasswordExpires']=null;return _0x4773d5[_0xc275('0x56')]();});})[_0xc275('0xf')](function(){_0x1d1821[_0xc275('0x34')](0xc8)[_0xc275('0x57')]({'message':_0xc275('0x58')});})[_0xc275('0x4a')](function(_0x43007b){return handleError(_0x1d1821,0x1f4,_0x43007b);});};passport[_0xc275('0x59')](new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0xcfc9fb,_0x34ed73,_0x205ab0){return localAuthenticate(db[_0xc275('0x4c')],_0xcfc9fb,_0x34ed73,_0x205ab0);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 178c0ed..646562e 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 _0x68b9=['login','/forgot','/reset/:token','reset','exports','express','Router','./authLocal.controller','post'];(function(_0x126977,_0x25df7f){var _0x15e83e=function(_0xcaa3b9){while(--_0xcaa3b9){_0x126977['push'](_0x126977['shift']());}};_0x15e83e(++_0x25df7f);}(_0x68b9,0x11c));var _0x968b=function(_0x38854e,_0x23cbc9){_0x38854e=_0x38854e-0x0;var _0x3f8415=_0x68b9[_0x38854e];return _0x3f8415;};'use strict';var express=require(_0x968b('0x0'));var router=express[_0x968b('0x1')]();var controller=require(_0x968b('0x2'));router[_0x968b('0x3')]('/',controller[_0x968b('0x4')]);router[_0x968b('0x3')](_0x968b('0x5'),controller['forgot']);router[_0x968b('0x3')](_0x968b('0x6'),controller[_0x968b('0x7')]);module[_0x968b('0x8')]=router;
\ No newline at end of file
+var _0xe6e8=['/reset/:token','reset','exports','express','Router','post','login','/forgot'];(function(_0x53ab25,_0x1a59bd){var _0x5842c3=function(_0x4fed30){while(--_0x4fed30){_0x53ab25['push'](_0x53ab25['shift']());}};_0x5842c3(++_0x1a59bd);}(_0xe6e8,0x1ab));var _0x8e6e=function(_0x579613,_0x25489b){_0x579613=_0x579613-0x0;var _0x2131ef=_0xe6e8[_0x579613];return _0x2131ef;};'use strict';var express=require(_0x8e6e('0x0'));var router=express[_0x8e6e('0x1')]();var controller=require('./authLocal.controller');router[_0x8e6e('0x2')]('/',controller[_0x8e6e('0x3')]);router[_0x8e6e('0x2')](_0x8e6e('0x4'),controller['forgot']);router[_0x8e6e('0x2')](_0x8e6e('0x5'),controller[_0x8e6e('0x6')]);module[_0x8e6e('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 1030d9b..d64b641 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 _0x4db5=['INTEGER','sequelize','exports','STRING'];(function(_0x141f75,_0x1711bb){var _0xcf3bd5=function(_0x6f9b95){while(--_0x6f9b95){_0x141f75['push'](_0x141f75['shift']());}};_0xcf3bd5(++_0x1711bb);}(_0x4db5,0x185));var _0x54db=function(_0x119d2b,_0x45f45e){_0x119d2b=_0x119d2b-0x0;var _0x3d94b8=_0x4db5[_0x119d2b];return _0x3d94b8;};'use strict';var Sequelize=require(_0x54db('0x0'));module[_0x54db('0x1')]={'name':{'type':Sequelize[_0x54db('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x54db('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x54db('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xa948=['STRING','BOOLEAN','INTEGER'];(function(_0x47e42c,_0x903f64){var _0x5abbbd=function(_0x5891a7){while(--_0x5891a7){_0x47e42c['push'](_0x47e42c['shift']());}};_0x5abbbd(++_0x903f64);}(_0xa948,0x1e0));var _0x8a94=function(_0x3b2244,_0x54873f){_0x3b2244=_0x3b2244-0x0;var _0x2dcc14=_0xa948[_0x3b2244];return _0x2dcc14;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8a94('0x0')],'allowNull':![]},'channel':{'type':Sequelize[_0x8a94('0x0')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x8a94('0x1')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x8a94('0x2')],'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 9474ac6..4c13d4c 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 _0x2594=['sort','where','filter','merge','type','VIRTUAL','options','Automation','include','findAll','catch','show','rawAttributes','includeAll','create','body','update','find','params','destroy','addConditions','Condition','ids','getConditions','findOne','pick','nolimit','Action','addActions','omit','getActions','hasOwnProperty','rimraf','zip-dir','fast-json-patch','mustache','util','sox','fs-extra','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','then','end','error','stack','name','send','index','fieldName','key','query','keys','filters','intersection','fields','attributes','length','model','order'];(function(_0x41e039,_0x1c2b1f){var _0x13757b=function(_0x147ae3){while(--_0x147ae3){_0x41e039['push'](_0x41e039['shift']());}};_0x13757b(++_0x1c2b1f);}(_0x2594,0x119));var _0x4259=function(_0x51e8da,_0x540e25){_0x51e8da=_0x51e8da-0x0;var _0x12c3f2=_0x2594[_0x51e8da];return _0x12c3f2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4259('0x0'));var zipdir=require(_0x4259('0x1'));var jsonpatch=require(_0x4259('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4259('0x3'));var util=require(_0x4259('0x4'));var path=require('path');var sox=require(_0x4259('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4259('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4259('0x7'));var deskjs=require(_0x4259('0x8'));var toCsv=require(_0x4259('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4259('0xa'));var authService=require(_0x4259('0xb'));var qs=require(_0x4259('0xc'));var as=require(_0x4259('0xd'));var hardwareService=require(_0x4259('0xe'));var logger=require(_0x4259('0xf'))(_0x4259('0x10'));var utils=require(_0x4259('0x11'));var config=require(_0x4259('0x12'));var licenseUtil=require(_0x4259('0x13'));var db=require(_0x4259('0x14'))['db'];function respondWithStatusCode(_0x244268,_0x5530b7){_0x5530b7=_0x5530b7||0xcc;return function(_0x5d496){if(_0x5d496){return _0x244268[_0x4259('0x15')](_0x5530b7);}return _0x244268[_0x4259('0x16')](_0x5530b7)['end']();};}function respondWithResult(_0x83ecf,_0x28fb2b){_0x28fb2b=_0x28fb2b||0xc8;return function(_0x2f8f1e){if(_0x2f8f1e){return _0x83ecf[_0x4259('0x16')](_0x28fb2b)['json'](_0x2f8f1e);}};}function respondWithFilteredResult(_0x2947db,_0x1a08ca){return function(_0x5ce302){if(_0x5ce302){var _0x4166ab=typeof _0x1a08ca[_0x4259('0x17')]==='undefined'&&typeof _0x1a08ca[_0x4259('0x18')]===_0x4259('0x19');var _0x255e02=_0x5ce302[_0x4259('0x1a')];var _0x4a131e=_0x4166ab?0x0:_0x1a08ca[_0x4259('0x17')];var _0x22c04c=_0x4166ab?_0x5ce302['count']:_0x1a08ca[_0x4259('0x17')]+_0x1a08ca[_0x4259('0x18')];var _0x33edee;if(_0x22c04c>=_0x255e02){_0x22c04c=_0x255e02;_0x33edee=0xc8;}else{_0x33edee=0xce;}_0x2947db[_0x4259('0x16')](_0x33edee);return _0x2947db[_0x4259('0x1b')](_0x4259('0x1c'),_0x4a131e+'-'+_0x22c04c+'/'+_0x255e02)[_0x4259('0x1d')](_0x5ce302);}return null;};}function patchUpdates(_0x3dd6f8){return function(_0x419b51){try{jsonpatch[_0x4259('0x1e')](_0x419b51,_0x3dd6f8,!![]);}catch(_0x391ff5){return BPromise[_0x4259('0x1f')](_0x391ff5);}return _0x419b51[_0x4259('0x20')]();};}function saveUpdates(_0x466c58,_0x22a182){return function(_0x3e0727){if(_0x3e0727){return _0x3e0727['update'](_0x466c58)['then'](function(_0x2867d1){return _0x2867d1;});}return null;};}function removeEntity(_0x2dba49,_0x37ee4b){return function(_0x42825a){if(_0x42825a){return _0x42825a['destroy']()[_0x4259('0x21')](function(){_0x2dba49[_0x4259('0x16')](0xcc)[_0x4259('0x22')]();});}};}function handleEntityNotFound(_0x20f236,_0x10be66){return function(_0x50b4ee){if(!_0x50b4ee){_0x20f236[_0x4259('0x15')](0x194);}return _0x50b4ee;};}function handleError(_0x46083b,_0x92d306){_0x92d306=_0x92d306||0x1f4;return function(_0x481323){logger[_0x4259('0x23')](_0x481323[_0x4259('0x24')]);if(_0x481323[_0x4259('0x25')]){delete _0x481323['name'];}_0x46083b[_0x4259('0x16')](_0x92d306)[_0x4259('0x26')](_0x481323);};}exports[_0x4259('0x27')]=function(_0x46ea4b,_0x435f0a){var _0x2f93ff={},_0x56843a={},_0x2971c0={'count':0x0,'rows':[]};var _0x1f80f8=_['map'](db['Automation']['rawAttributes'],function(_0x507f51){return{'name':_0x507f51[_0x4259('0x28')],'type':_0x507f51['type'][_0x4259('0x29')]};});_0x56843a['model']=_['map'](_0x1f80f8,_0x4259('0x25'));_0x56843a[_0x4259('0x2a')]=_[_0x4259('0x2b')](_0x46ea4b[_0x4259('0x2a')]);_0x56843a[_0x4259('0x2c')]=_['intersection'](_0x56843a['model'],_0x56843a['query']);_0x2f93ff['attributes']=_[_0x4259('0x2d')](_0x56843a['model'],qs[_0x4259('0x2e')](_0x46ea4b[_0x4259('0x2a')][_0x4259('0x2e')]));_0x2f93ff['attributes']=_0x2f93ff[_0x4259('0x2f')][_0x4259('0x30')]?_0x2f93ff[_0x4259('0x2f')]:_0x56843a[_0x4259('0x31')];if(!_0x46ea4b[_0x4259('0x2a')]['hasOwnProperty']('nolimit')){_0x2f93ff[_0x4259('0x18')]=qs['limit'](_0x46ea4b['query']['limit']);_0x2f93ff[_0x4259('0x17')]=qs[_0x4259('0x17')](_0x46ea4b[_0x4259('0x2a')]['offset']);}_0x2f93ff[_0x4259('0x32')]=qs[_0x4259('0x33')](_0x46ea4b[_0x4259('0x2a')][_0x4259('0x33')]);_0x2f93ff[_0x4259('0x34')]=qs[_0x4259('0x2c')](_['pick'](_0x46ea4b[_0x4259('0x2a')],_0x56843a[_0x4259('0x2c')]),_0x1f80f8);if(_0x46ea4b[_0x4259('0x2a')][_0x4259('0x35')]){_0x2f93ff[_0x4259('0x34')]=_[_0x4259('0x36')](_0x2f93ff[_0x4259('0x34')],{'$or':_['map'](_0x1f80f8,function(_0x865b3a){if(_0x865b3a[_0x4259('0x37')]!==_0x4259('0x38')){var _0xdf39a4={};_0xdf39a4[_0x865b3a[_0x4259('0x25')]]={'$like':'%'+_0x46ea4b[_0x4259('0x2a')]['filter']+'%'};return _0xdf39a4;}})});}_0x2f93ff=_['merge']({},_0x2f93ff,_0x46ea4b[_0x4259('0x39')]);var _0x5a9ef0={'where':_0x2f93ff[_0x4259('0x34')]};return db[_0x4259('0x3a')][_0x4259('0x1a')](_0x5a9ef0)[_0x4259('0x21')](function(_0x326d0f){_0x2971c0['count']=_0x326d0f;if(_0x46ea4b[_0x4259('0x2a')]['includeAll']){_0x2f93ff[_0x4259('0x3b')]=[{'all':!![]}];}return db[_0x4259('0x3a')][_0x4259('0x3c')](_0x2f93ff);})['then'](function(_0x6f22d9){_0x2971c0['rows']=_0x6f22d9;return _0x2971c0;})[_0x4259('0x21')](respondWithFilteredResult(_0x435f0a,_0x2f93ff))[_0x4259('0x3d')](handleError(_0x435f0a,null));};exports[_0x4259('0x3e')]=function(_0x597e8c,_0x2c8deb){var _0x179489={'raw':![],'where':{'id':_0x597e8c['params']['id']}},_0x43aceb={};_0x43aceb[_0x4259('0x31')]=_[_0x4259('0x2b')](db[_0x4259('0x3a')][_0x4259('0x3f')]);_0x43aceb[_0x4259('0x2a')]=_[_0x4259('0x2b')](_0x597e8c[_0x4259('0x2a')]);_0x43aceb[_0x4259('0x2c')]=_[_0x4259('0x2d')](_0x43aceb[_0x4259('0x31')],_0x43aceb[_0x4259('0x2a')]);_0x179489[_0x4259('0x2f')]=_[_0x4259('0x2d')](_0x43aceb[_0x4259('0x31')],qs[_0x4259('0x2e')](_0x597e8c[_0x4259('0x2a')]['fields']));_0x179489[_0x4259('0x2f')]=_0x179489['attributes'][_0x4259('0x30')]?_0x179489[_0x4259('0x2f')]:_0x43aceb['model'];if(_0x597e8c[_0x4259('0x2a')][_0x4259('0x40')]){_0x179489[_0x4259('0x3b')]=[{'all':!![]}];}_0x179489=_[_0x4259('0x36')]({},_0x179489,_0x597e8c[_0x4259('0x39')]);return db[_0x4259('0x3a')]['find'](_0x179489)['then'](handleEntityNotFound(_0x2c8deb,null))[_0x4259('0x21')](respondWithResult(_0x2c8deb,null))[_0x4259('0x3d')](handleError(_0x2c8deb,null));};exports[_0x4259('0x41')]=function(_0x141f2c,_0x37a134){return db[_0x4259('0x3a')][_0x4259('0x41')](_0x141f2c[_0x4259('0x42')],{})[_0x4259('0x21')](respondWithResult(_0x37a134,0xc9))[_0x4259('0x3d')](handleError(_0x37a134,null));};exports[_0x4259('0x43')]=function(_0x28376a,_0x39c0f2){if(_0x28376a[_0x4259('0x42')]['id']){delete _0x28376a['body']['id'];}return db[_0x4259('0x3a')][_0x4259('0x44')]({'where':{'id':_0x28376a[_0x4259('0x45')]['id']}})['then'](handleEntityNotFound(_0x39c0f2,null))[_0x4259('0x21')](saveUpdates(_0x28376a[_0x4259('0x42')],null))['then'](respondWithResult(_0x39c0f2,null))[_0x4259('0x3d')](handleError(_0x39c0f2,null));};exports[_0x4259('0x46')]=function(_0x5bad6e,_0x1b15e2){return db[_0x4259('0x3a')][_0x4259('0x44')]({'where':{'id':_0x5bad6e[_0x4259('0x45')]['id']}})[_0x4259('0x21')](handleEntityNotFound(_0x1b15e2,null))[_0x4259('0x21')](removeEntity(_0x1b15e2,null))[_0x4259('0x3d')](handleError(_0x1b15e2,null));};exports[_0x4259('0x47')]=function(_0x46b386,_0x4a8cf2,_0x832fe4){return db[_0x4259('0x48')][_0x4259('0x44')]({'where':{'id':_0x46b386['params']['id']}})[_0x4259('0x21')](handleEntityNotFound(_0x4a8cf2,null))[_0x4259('0x21')](function(_0x43717d){if(_0x43717d){return _0x43717d[_0x4259('0x47')](_0x46b386['body'][_0x4259('0x49')],_['omit'](_0x46b386[_0x4259('0x42')],[_0x4259('0x49'),'id'])||{});}})[_0x4259('0x21')](respondWithResult(_0x4a8cf2,null))[_0x4259('0x3d')](handleError(_0x4a8cf2,null));};exports[_0x4259('0x4a')]=function(_0x3ac55d,_0x3970d3,_0x2252ac){var _0x38dbbe={};var _0x5576b1={};var _0x3a91b8;var _0x91af58;return db['Automation'][_0x4259('0x4b')]({'where':{'id':_0x3ac55d[_0x4259('0x45')]['id']}})[_0x4259('0x21')](handleEntityNotFound(_0x3970d3,null))['then'](function(_0x588509){if(_0x588509){_0x3a91b8=_0x588509;_0x5576b1[_0x4259('0x31')]=_['keys'](db[_0x4259('0x48')][_0x4259('0x3f')]);_0x5576b1[_0x4259('0x2a')]=_[_0x4259('0x2b')](_0x3ac55d[_0x4259('0x2a')]);_0x5576b1[_0x4259('0x2c')]=_[_0x4259('0x2d')](_0x5576b1[_0x4259('0x31')],_0x5576b1[_0x4259('0x2a')]);_0x38dbbe[_0x4259('0x2f')]=_['intersection'](_0x5576b1[_0x4259('0x31')],qs[_0x4259('0x2e')](_0x3ac55d[_0x4259('0x2a')][_0x4259('0x2e')]));_0x38dbbe[_0x4259('0x2f')]=_0x38dbbe[_0x4259('0x2f')]['length']?_0x38dbbe[_0x4259('0x2f')]:_0x5576b1[_0x4259('0x31')];_0x38dbbe[_0x4259('0x32')]=qs['sort'](_0x3ac55d[_0x4259('0x2a')][_0x4259('0x33')]);_0x38dbbe[_0x4259('0x34')]=qs[_0x4259('0x2c')](_[_0x4259('0x4c')](_0x3ac55d[_0x4259('0x2a')],_0x5576b1[_0x4259('0x2c')]));if(_0x3ac55d['query']['filter']){_0x38dbbe[_0x4259('0x34')]=_[_0x4259('0x36')](_0x38dbbe[_0x4259('0x34')],{'$or':_['map'](_0x38dbbe['attributes'],function(_0x3cefc3){var _0x416c67={};_0x416c67[_0x3cefc3]={'$like':'%'+_0x3ac55d[_0x4259('0x2a')][_0x4259('0x35')]+'%'};return _0x416c67;})});}_0x38dbbe=_[_0x4259('0x36')]({},_0x38dbbe,_0x3ac55d['options']);return _0x3a91b8[_0x4259('0x4a')](_0x38dbbe);}})[_0x4259('0x21')](function(_0x573860){if(_0x573860){_0x91af58=_0x573860[_0x4259('0x30')];if(!_0x3ac55d[_0x4259('0x2a')]['hasOwnProperty'](_0x4259('0x4d'))){_0x38dbbe['limit']=qs['limit'](_0x3ac55d[_0x4259('0x2a')][_0x4259('0x18')]);_0x38dbbe[_0x4259('0x17')]=qs['offset'](_0x3ac55d['query'][_0x4259('0x17')]);}return _0x3a91b8[_0x4259('0x4a')](_0x38dbbe);}})[_0x4259('0x21')](function(_0x51d118){if(_0x51d118){return _0x51d118?{'count':_0x91af58,'rows':_0x51d118}:null;}})[_0x4259('0x21')](respondWithResult(_0x3970d3,null))[_0x4259('0x3d')](handleError(_0x3970d3,null));};exports['addActions']=function(_0x9accce,_0x1ef384,_0x218649){return db[_0x4259('0x4e')][_0x4259('0x44')]({'where':{'id':_0x9accce['params']['id']}})[_0x4259('0x21')](handleEntityNotFound(_0x1ef384,null))[_0x4259('0x21')](function(_0x1f49dd){if(_0x1f49dd){return _0x1f49dd[_0x4259('0x4f')](_0x9accce['body'][_0x4259('0x49')],_[_0x4259('0x50')](_0x9accce[_0x4259('0x42')],[_0x4259('0x49'),'id'])||{});}})['then'](respondWithResult(_0x1ef384,null))[_0x4259('0x3d')](handleError(_0x1ef384,null));};exports[_0x4259('0x51')]=function(_0x37cf94,_0x59a99c,_0x38e9ea){var _0xff5986={};var _0x2054b9={};var _0xd4656;var _0x2d5ecf;return db[_0x4259('0x3a')][_0x4259('0x4b')]({'where':{'id':_0x37cf94['params']['id']}})[_0x4259('0x21')](handleEntityNotFound(_0x59a99c,null))[_0x4259('0x21')](function(_0x346882){if(_0x346882){_0xd4656=_0x346882;_0x2054b9['model']=_[_0x4259('0x2b')](db[_0x4259('0x4e')][_0x4259('0x3f')]);_0x2054b9[_0x4259('0x2a')]=_[_0x4259('0x2b')](_0x37cf94['query']);_0x2054b9['filters']=_[_0x4259('0x2d')](_0x2054b9[_0x4259('0x31')],_0x2054b9[_0x4259('0x2a')]);_0xff5986[_0x4259('0x2f')]=_['intersection'](_0x2054b9[_0x4259('0x31')],qs[_0x4259('0x2e')](_0x37cf94['query']['fields']));_0xff5986['attributes']=_0xff5986[_0x4259('0x2f')]['length']?_0xff5986[_0x4259('0x2f')]:_0x2054b9[_0x4259('0x31')];_0xff5986[_0x4259('0x32')]=qs[_0x4259('0x33')](_0x37cf94['query']['sort']);_0xff5986['where']=qs[_0x4259('0x2c')](_[_0x4259('0x4c')](_0x37cf94[_0x4259('0x2a')],_0x2054b9['filters']));if(_0x37cf94[_0x4259('0x2a')][_0x4259('0x35')]){_0xff5986[_0x4259('0x34')]=_[_0x4259('0x36')](_0xff5986[_0x4259('0x34')],{'$or':_['map'](_0xff5986[_0x4259('0x2f')],function(_0x3cda2a){var _0x3c836e={};_0x3c836e[_0x3cda2a]={'$like':'%'+_0x37cf94[_0x4259('0x2a')][_0x4259('0x35')]+'%'};return _0x3c836e;})});}_0xff5986=_[_0x4259('0x36')]({},_0xff5986,_0x37cf94[_0x4259('0x39')]);return _0xd4656['getActions'](_0xff5986);}})[_0x4259('0x21')](function(_0x5885dd){if(_0x5885dd){_0x2d5ecf=_0x5885dd[_0x4259('0x30')];if(!_0x37cf94[_0x4259('0x2a')][_0x4259('0x52')](_0x4259('0x4d'))){_0xff5986[_0x4259('0x18')]=qs['limit'](_0x37cf94[_0x4259('0x2a')][_0x4259('0x18')]);_0xff5986['offset']=qs['offset'](_0x37cf94[_0x4259('0x2a')]['offset']);}return _0xd4656[_0x4259('0x51')](_0xff5986);}})[_0x4259('0x21')](function(_0x11bb8a){if(_0x11bb8a){return _0x11bb8a?{'count':_0x2d5ecf,'rows':_0x11bb8a}:null;}})['then'](respondWithResult(_0x59a99c,null))['catch'](handleError(_0x59a99c,null));};
\ No newline at end of file
+var _0x5add=['model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','keys','include','find','create','body','params','Condition','addConditions','ids','getConditions','nolimit','addActions','Action','omit','getActions','findOne','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','update','then','destroy','name','send','index','map','Automation','rawAttributes','fieldName','type','key'];(function(_0x58baf3,_0x3ce651){var _0x1eb9b9=function(_0x40ddc9){while(--_0x40ddc9){_0x58baf3['push'](_0x58baf3['shift']());}};_0x1eb9b9(++_0x3ce651);}(_0x5add,0x124));var _0xd5ad=function(_0x3fcdb9,_0x142ed7){_0x3fcdb9=_0x3fcdb9-0x0;var _0x41da1a=_0x5add[_0x3fcdb9];return _0x41da1a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd5ad('0x0'));var zipdir=require(_0xd5ad('0x1'));var jsonpatch=require(_0xd5ad('0x2'));var rp=require(_0xd5ad('0x3'));var moment=require(_0xd5ad('0x4'));var BPromise=require(_0xd5ad('0x5'));var Mustache=require(_0xd5ad('0x6'));var util=require(_0xd5ad('0x7'));var path=require(_0xd5ad('0x8'));var sox=require(_0xd5ad('0x9'));var csv=require(_0xd5ad('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd5ad('0xb'));var _=require('lodash');var squel=require(_0xd5ad('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd5ad('0xd'));var toCsv=require(_0xd5ad('0xa'));var querystring=require(_0xd5ad('0xe'));var Papa=require('papaparse');var Redis=require(_0xd5ad('0xf'));var authService=require(_0xd5ad('0x10'));var qs=require(_0xd5ad('0x11'));var as=require(_0xd5ad('0x12'));var hardwareService=require(_0xd5ad('0x13'));var logger=require(_0xd5ad('0x14'))(_0xd5ad('0x15'));var utils=require(_0xd5ad('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd5ad('0x17'));var db=require(_0xd5ad('0x18'))['db'];function respondWithStatusCode(_0x1425dc,_0x184cbb){_0x184cbb=_0x184cbb||0xcc;return function(_0x5c9943){if(_0x5c9943){return _0x1425dc[_0xd5ad('0x19')](_0x184cbb);}return _0x1425dc[_0xd5ad('0x1a')](_0x184cbb)[_0xd5ad('0x1b')]();};}function respondWithResult(_0x2f2710,_0x5c4d92){_0x5c4d92=_0x5c4d92||0xc8;return function(_0x4ee5e9){if(_0x4ee5e9){return _0x2f2710[_0xd5ad('0x1a')](_0x5c4d92)['json'](_0x4ee5e9);}};}function respondWithFilteredResult(_0x3ab581,_0x362498){return function(_0x2a5209){if(_0x2a5209){var _0x3ef4af=typeof _0x362498[_0xd5ad('0x1c')]===_0xd5ad('0x1d')&&typeof _0x362498[_0xd5ad('0x1e')]===_0xd5ad('0x1d');var _0x2b85a8=_0x2a5209[_0xd5ad('0x1f')];var _0x3963ec=_0x3ef4af?0x0:_0x362498[_0xd5ad('0x1c')];var _0x83fb17=_0x3ef4af?_0x2a5209[_0xd5ad('0x1f')]:_0x362498[_0xd5ad('0x1c')]+_0x362498[_0xd5ad('0x1e')];var _0x43c36f;if(_0x83fb17>=_0x2b85a8){_0x83fb17=_0x2b85a8;_0x43c36f=0xc8;}else{_0x43c36f=0xce;}_0x3ab581[_0xd5ad('0x1a')](_0x43c36f);return _0x3ab581[_0xd5ad('0x20')]('Content-Range',_0x3963ec+'-'+_0x83fb17+'/'+_0x2b85a8)[_0xd5ad('0x21')](_0x2a5209);}return null;};}function patchUpdates(_0x3cb515){return function(_0x1a8d28){try{jsonpatch[_0xd5ad('0x22')](_0x1a8d28,_0x3cb515,!![]);}catch(_0x541d79){return BPromise[_0xd5ad('0x23')](_0x541d79);}return _0x1a8d28['save']();};}function saveUpdates(_0x69e410,_0x9e60db){return function(_0x3236a4){if(_0x3236a4){return _0x3236a4[_0xd5ad('0x24')](_0x69e410)[_0xd5ad('0x25')](function(_0x5e0b71){return _0x5e0b71;});}return null;};}function removeEntity(_0x4ce040,_0x3f0bdb){return function(_0x464b23){if(_0x464b23){return _0x464b23[_0xd5ad('0x26')]()['then'](function(){_0x4ce040[_0xd5ad('0x1a')](0xcc)[_0xd5ad('0x1b')]();});}};}function handleEntityNotFound(_0x30dbc9,_0x4dd593){return function(_0x3f1e4b){if(!_0x3f1e4b){_0x30dbc9[_0xd5ad('0x19')](0x194);}return _0x3f1e4b;};}function handleError(_0x285271,_0x5856eb){_0x5856eb=_0x5856eb||0x1f4;return function(_0x2072a3){logger['error'](_0x2072a3['stack']);if(_0x2072a3[_0xd5ad('0x27')]){delete _0x2072a3[_0xd5ad('0x27')];}_0x285271[_0xd5ad('0x1a')](_0x5856eb)[_0xd5ad('0x28')](_0x2072a3);};}exports[_0xd5ad('0x29')]=function(_0x54eac3,_0xf98395){var _0x3c5937={},_0x146e45={},_0x5b2f85={'count':0x0,'rows':[]};var _0x4291c4=_[_0xd5ad('0x2a')](db[_0xd5ad('0x2b')][_0xd5ad('0x2c')],function(_0xfa5e8f){return{'name':_0xfa5e8f[_0xd5ad('0x2d')],'type':_0xfa5e8f[_0xd5ad('0x2e')][_0xd5ad('0x2f')]};});_0x146e45[_0xd5ad('0x30')]=_[_0xd5ad('0x2a')](_0x4291c4,'name');_0x146e45[_0xd5ad('0x31')]=_['keys'](_0x54eac3[_0xd5ad('0x31')]);_0x146e45[_0xd5ad('0x32')]=_['intersection'](_0x146e45[_0xd5ad('0x30')],_0x146e45[_0xd5ad('0x31')]);_0x3c5937[_0xd5ad('0x33')]=_[_0xd5ad('0x34')](_0x146e45[_0xd5ad('0x30')],qs[_0xd5ad('0x35')](_0x54eac3[_0xd5ad('0x31')]['fields']));_0x3c5937[_0xd5ad('0x33')]=_0x3c5937['attributes'][_0xd5ad('0x36')]?_0x3c5937[_0xd5ad('0x33')]:_0x146e45['model'];if(!_0x54eac3[_0xd5ad('0x31')][_0xd5ad('0x37')]('nolimit')){_0x3c5937['limit']=qs[_0xd5ad('0x1e')](_0x54eac3['query'][_0xd5ad('0x1e')]);_0x3c5937['offset']=qs[_0xd5ad('0x1c')](_0x54eac3[_0xd5ad('0x31')][_0xd5ad('0x1c')]);}_0x3c5937[_0xd5ad('0x38')]=qs[_0xd5ad('0x39')](_0x54eac3[_0xd5ad('0x31')][_0xd5ad('0x39')]);_0x3c5937[_0xd5ad('0x3a')]=qs['filters'](_[_0xd5ad('0x3b')](_0x54eac3[_0xd5ad('0x31')],_0x146e45[_0xd5ad('0x32')]),_0x4291c4);if(_0x54eac3[_0xd5ad('0x31')][_0xd5ad('0x3c')]){_0x3c5937[_0xd5ad('0x3a')]=_[_0xd5ad('0x3d')](_0x3c5937[_0xd5ad('0x3a')],{'$or':_[_0xd5ad('0x2a')](_0x4291c4,function(_0x2fd6fb){if(_0x2fd6fb[_0xd5ad('0x2e')]!==_0xd5ad('0x3e')){var _0x182430={};_0x182430[_0x2fd6fb[_0xd5ad('0x27')]]={'$like':'%'+_0x54eac3['query'][_0xd5ad('0x3c')]+'%'};return _0x182430;}})});}_0x3c5937=_['merge']({},_0x3c5937,_0x54eac3[_0xd5ad('0x3f')]);var _0x1cd877={'where':_0x3c5937[_0xd5ad('0x3a')]};return db[_0xd5ad('0x2b')][_0xd5ad('0x1f')](_0x1cd877)[_0xd5ad('0x25')](function(_0x16b0c4){_0x5b2f85[_0xd5ad('0x1f')]=_0x16b0c4;if(_0x54eac3[_0xd5ad('0x31')][_0xd5ad('0x40')]){_0x3c5937['include']=[{'all':!![]}];}return db['Automation'][_0xd5ad('0x41')](_0x3c5937);})['then'](function(_0x1b9b94){_0x5b2f85[_0xd5ad('0x42')]=_0x1b9b94;return _0x5b2f85;})[_0xd5ad('0x25')](respondWithFilteredResult(_0xf98395,_0x3c5937))[_0xd5ad('0x43')](handleError(_0xf98395,null));};exports[_0xd5ad('0x44')]=function(_0x58092a,_0x5a5063){var _0x32c45e={'raw':![],'where':{'id':_0x58092a['params']['id']}},_0x42768d={};_0x42768d[_0xd5ad('0x30')]=_[_0xd5ad('0x45')](db[_0xd5ad('0x2b')][_0xd5ad('0x2c')]);_0x42768d[_0xd5ad('0x31')]=_['keys'](_0x58092a[_0xd5ad('0x31')]);_0x42768d[_0xd5ad('0x32')]=_[_0xd5ad('0x34')](_0x42768d['model'],_0x42768d[_0xd5ad('0x31')]);_0x32c45e[_0xd5ad('0x33')]=_[_0xd5ad('0x34')](_0x42768d[_0xd5ad('0x30')],qs[_0xd5ad('0x35')](_0x58092a[_0xd5ad('0x31')]['fields']));_0x32c45e[_0xd5ad('0x33')]=_0x32c45e[_0xd5ad('0x33')]['length']?_0x32c45e['attributes']:_0x42768d['model'];if(_0x58092a[_0xd5ad('0x31')]['includeAll']){_0x32c45e[_0xd5ad('0x46')]=[{'all':!![]}];}_0x32c45e=_[_0xd5ad('0x3d')]({},_0x32c45e,_0x58092a[_0xd5ad('0x3f')]);return db[_0xd5ad('0x2b')][_0xd5ad('0x47')](_0x32c45e)['then'](handleEntityNotFound(_0x5a5063,null))[_0xd5ad('0x25')](respondWithResult(_0x5a5063,null))[_0xd5ad('0x43')](handleError(_0x5a5063,null));};exports[_0xd5ad('0x48')]=function(_0x52c150,_0x2c1578){return db[_0xd5ad('0x2b')]['create'](_0x52c150['body'],{})[_0xd5ad('0x25')](respondWithResult(_0x2c1578,0xc9))[_0xd5ad('0x43')](handleError(_0x2c1578,null));};exports[_0xd5ad('0x24')]=function(_0x3a0b91,_0x323ccf){if(_0x3a0b91[_0xd5ad('0x49')]['id']){delete _0x3a0b91[_0xd5ad('0x49')]['id'];}return db[_0xd5ad('0x2b')][_0xd5ad('0x47')]({'where':{'id':_0x3a0b91[_0xd5ad('0x4a')]['id']}})[_0xd5ad('0x25')](handleEntityNotFound(_0x323ccf,null))[_0xd5ad('0x25')](saveUpdates(_0x3a0b91['body'],null))['then'](respondWithResult(_0x323ccf,null))[_0xd5ad('0x43')](handleError(_0x323ccf,null));};exports[_0xd5ad('0x26')]=function(_0x22afb0,_0x2b5590){return db['Automation'][_0xd5ad('0x47')]({'where':{'id':_0x22afb0[_0xd5ad('0x4a')]['id']}})[_0xd5ad('0x25')](handleEntityNotFound(_0x2b5590,null))[_0xd5ad('0x25')](removeEntity(_0x2b5590,null))[_0xd5ad('0x43')](handleError(_0x2b5590,null));};exports['addConditions']=function(_0x202bd2,_0x5e3b38,_0x73be65){return db[_0xd5ad('0x4b')][_0xd5ad('0x47')]({'where':{'id':_0x202bd2[_0xd5ad('0x4a')]['id']}})[_0xd5ad('0x25')](handleEntityNotFound(_0x5e3b38,null))['then'](function(_0x340115){if(_0x340115){return _0x340115[_0xd5ad('0x4c')](_0x202bd2[_0xd5ad('0x49')][_0xd5ad('0x4d')],_['omit'](_0x202bd2[_0xd5ad('0x49')],[_0xd5ad('0x4d'),'id'])||{});}})[_0xd5ad('0x25')](respondWithResult(_0x5e3b38,null))[_0xd5ad('0x43')](handleError(_0x5e3b38,null));};exports[_0xd5ad('0x4e')]=function(_0x4b322d,_0x135090,_0x28b8b1){var _0xbc546c={};var _0x16dc82={};var _0x4f28e5;var _0x1ef244;return db['Automation']['findOne']({'where':{'id':_0x4b322d[_0xd5ad('0x4a')]['id']}})[_0xd5ad('0x25')](handleEntityNotFound(_0x135090,null))[_0xd5ad('0x25')](function(_0x344628){if(_0x344628){_0x4f28e5=_0x344628;_0x16dc82[_0xd5ad('0x30')]=_[_0xd5ad('0x45')](db[_0xd5ad('0x4b')]['rawAttributes']);_0x16dc82[_0xd5ad('0x31')]=_['keys'](_0x4b322d[_0xd5ad('0x31')]);_0x16dc82['filters']=_[_0xd5ad('0x34')](_0x16dc82[_0xd5ad('0x30')],_0x16dc82[_0xd5ad('0x31')]);_0xbc546c['attributes']=_[_0xd5ad('0x34')](_0x16dc82[_0xd5ad('0x30')],qs[_0xd5ad('0x35')](_0x4b322d[_0xd5ad('0x31')]['fields']));_0xbc546c[_0xd5ad('0x33')]=_0xbc546c['attributes'][_0xd5ad('0x36')]?_0xbc546c[_0xd5ad('0x33')]:_0x16dc82['model'];_0xbc546c[_0xd5ad('0x38')]=qs[_0xd5ad('0x39')](_0x4b322d['query'][_0xd5ad('0x39')]);_0xbc546c[_0xd5ad('0x3a')]=qs[_0xd5ad('0x32')](_[_0xd5ad('0x3b')](_0x4b322d['query'],_0x16dc82[_0xd5ad('0x32')]));if(_0x4b322d['query'][_0xd5ad('0x3c')]){_0xbc546c[_0xd5ad('0x3a')]=_[_0xd5ad('0x3d')](_0xbc546c[_0xd5ad('0x3a')],{'$or':_['map'](_0xbc546c[_0xd5ad('0x33')],function(_0x13a6df){var _0x37808a={};_0x37808a[_0x13a6df]={'$like':'%'+_0x4b322d[_0xd5ad('0x31')][_0xd5ad('0x3c')]+'%'};return _0x37808a;})});}_0xbc546c=_[_0xd5ad('0x3d')]({},_0xbc546c,_0x4b322d[_0xd5ad('0x3f')]);return _0x4f28e5[_0xd5ad('0x4e')](_0xbc546c);}})[_0xd5ad('0x25')](function(_0x2e51da){if(_0x2e51da){_0x1ef244=_0x2e51da['length'];if(!_0x4b322d[_0xd5ad('0x31')][_0xd5ad('0x37')](_0xd5ad('0x4f'))){_0xbc546c[_0xd5ad('0x1e')]=qs['limit'](_0x4b322d[_0xd5ad('0x31')][_0xd5ad('0x1e')]);_0xbc546c['offset']=qs[_0xd5ad('0x1c')](_0x4b322d[_0xd5ad('0x31')]['offset']);}return _0x4f28e5[_0xd5ad('0x4e')](_0xbc546c);}})['then'](function(_0x3bb261){if(_0x3bb261){return _0x3bb261?{'count':_0x1ef244,'rows':_0x3bb261}:null;}})[_0xd5ad('0x25')](respondWithResult(_0x135090,null))[_0xd5ad('0x43')](handleError(_0x135090,null));};exports[_0xd5ad('0x50')]=function(_0x57fbd3,_0x38e3dc,_0x9c0e8b){return db[_0xd5ad('0x51')][_0xd5ad('0x47')]({'where':{'id':_0x57fbd3[_0xd5ad('0x4a')]['id']}})[_0xd5ad('0x25')](handleEntityNotFound(_0x38e3dc,null))[_0xd5ad('0x25')](function(_0x5079e7){if(_0x5079e7){return _0x5079e7[_0xd5ad('0x50')](_0x57fbd3[_0xd5ad('0x49')][_0xd5ad('0x4d')],_[_0xd5ad('0x52')](_0x57fbd3[_0xd5ad('0x49')],[_0xd5ad('0x4d'),'id'])||{});}})[_0xd5ad('0x25')](respondWithResult(_0x38e3dc,null))[_0xd5ad('0x43')](handleError(_0x38e3dc,null));};exports[_0xd5ad('0x53')]=function(_0x3139d5,_0x3d1328,_0xea4f6){var _0x1e1290={};var _0x25b269={};var _0x50de41;var _0x1aec95;return db['Automation'][_0xd5ad('0x54')]({'where':{'id':_0x3139d5[_0xd5ad('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3d1328,null))[_0xd5ad('0x25')](function(_0x23b050){if(_0x23b050){_0x50de41=_0x23b050;_0x25b269[_0xd5ad('0x30')]=_[_0xd5ad('0x45')](db[_0xd5ad('0x51')][_0xd5ad('0x2c')]);_0x25b269['query']=_[_0xd5ad('0x45')](_0x3139d5[_0xd5ad('0x31')]);_0x25b269[_0xd5ad('0x32')]=_[_0xd5ad('0x34')](_0x25b269['model'],_0x25b269[_0xd5ad('0x31')]);_0x1e1290[_0xd5ad('0x33')]=_[_0xd5ad('0x34')](_0x25b269[_0xd5ad('0x30')],qs[_0xd5ad('0x35')](_0x3139d5[_0xd5ad('0x31')][_0xd5ad('0x35')]));_0x1e1290[_0xd5ad('0x33')]=_0x1e1290['attributes'][_0xd5ad('0x36')]?_0x1e1290[_0xd5ad('0x33')]:_0x25b269[_0xd5ad('0x30')];_0x1e1290[_0xd5ad('0x38')]=qs[_0xd5ad('0x39')](_0x3139d5['query'][_0xd5ad('0x39')]);_0x1e1290[_0xd5ad('0x3a')]=qs[_0xd5ad('0x32')](_[_0xd5ad('0x3b')](_0x3139d5['query'],_0x25b269['filters']));if(_0x3139d5[_0xd5ad('0x31')][_0xd5ad('0x3c')]){_0x1e1290[_0xd5ad('0x3a')]=_['merge'](_0x1e1290[_0xd5ad('0x3a')],{'$or':_['map'](_0x1e1290[_0xd5ad('0x33')],function(_0x5ad5f0){var _0x119cd2={};_0x119cd2[_0x5ad5f0]={'$like':'%'+_0x3139d5['query'][_0xd5ad('0x3c')]+'%'};return _0x119cd2;})});}_0x1e1290=_['merge']({},_0x1e1290,_0x3139d5[_0xd5ad('0x3f')]);return _0x50de41[_0xd5ad('0x53')](_0x1e1290);}})[_0xd5ad('0x25')](function(_0x23186b){if(_0x23186b){_0x1aec95=_0x23186b[_0xd5ad('0x36')];if(!_0x3139d5['query'][_0xd5ad('0x37')]('nolimit')){_0x1e1290[_0xd5ad('0x1e')]=qs[_0xd5ad('0x1e')](_0x3139d5['query'][_0xd5ad('0x1e')]);_0x1e1290['offset']=qs[_0xd5ad('0x1c')](_0x3139d5[_0xd5ad('0x31')][_0xd5ad('0x1c')]);}return _0x50de41[_0xd5ad('0x53')](_0x1e1290);}})[_0xd5ad('0x25')](function(_0x1837c1){if(_0x1837c1){return _0x1837c1?{'count':_0x1aec95,'rows':_0x1837c1}:null;}})[_0xd5ad('0x25')](respondWithResult(_0x3d1328,null))[_0xd5ad('0x43')](handleError(_0x3d1328,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index e83d51c..75b8df4 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 _0x9f6c=['path','rimraf','../../config/environment','./automation.attributes','exports','Automation','tools_automations','lodash','util','../../config/logger','api','bluebird'];(function(_0x528023,_0x150351){var _0x20ed46=function(_0x4323fd){while(--_0x4323fd){_0x528023['push'](_0x528023['shift']());}};_0x20ed46(++_0x150351);}(_0x9f6c,0x1cf));var _0xc9f6=function(_0x501427,_0x3f9bc0){_0x501427=_0x501427-0x0;var _0x492f1d=_0x9f6c[_0x501427];return _0x492f1d;};'use strict';var _=require(_0xc9f6('0x0'));var util=require(_0xc9f6('0x1'));var logger=require(_0xc9f6('0x2'))(_0xc9f6('0x3'));var moment=require('moment');var BPromise=require(_0xc9f6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc9f6('0x5'));var rimraf=require(_0xc9f6('0x6'));var config=require(_0xc9f6('0x7'));var attributes=require(_0xc9f6('0x8'));module[_0xc9f6('0x9')]=function(_0x1f5fb8,_0x1e115d){return _0x1f5fb8['define'](_0xc9f6('0xa'),attributes,{'tableName':_0xc9f6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8b47=['exports','define','Automation','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./automation.attributes'];(function(_0x24cd8e,_0x14020c){var _0x830ece=function(_0x26fb7a){while(--_0x26fb7a){_0x24cd8e['push'](_0x24cd8e['shift']());}};_0x830ece(++_0x14020c);}(_0x8b47,0xcb));var _0x78b4=function(_0x5e3868,_0x5e9f11){_0x5e3868=_0x5e3868-0x0;var _0x1a005a=_0x8b47[_0x5e3868];return _0x1a005a;};'use strict';var _=require('lodash');var util=require(_0x78b4('0x0'));var logger=require(_0x78b4('0x1'))('api');var moment=require(_0x78b4('0x2'));var BPromise=require(_0x78b4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x78b4('0x4'));var config=require(_0x78b4('0x5'));var attributes=require(_0x78b4('0x6'));module[_0x78b4('0x7')]=function(_0xfb68ce,_0x3cb03b){return _0xfb68ce[_0x78b4('0x8')](_0x78b4('0x9'),attributes,{'tableName':'tools_automations','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 5575eee..9cec0d2 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 _0x3014=['request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Automation,\x20%s,\x20%s'];(function(_0x21b0d8,_0x1334ee){var _0x2e6f6a=function(_0x3dff3d){while(--_0x3dff3d){_0x21b0d8['push'](_0x21b0d8['shift']());}};_0x2e6f6a(++_0x1334ee);}(_0x3014,0x1d7));var _0x4301=function(_0x43a2fc,_0x589e0e){_0x43a2fc=_0x43a2fc-0x0;var _0x487ba1=_0x3014[_0x43a2fc];return _0x487ba1;};'use strict';var _=require(_0x4301('0x0'));var util=require(_0x4301('0x1'));var moment=require('moment');var BPromise=require(_0x4301('0x2'));var rs=require(_0x4301('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4301('0x4'));var logger=require(_0x4301('0x5'))(_0x4301('0x6'));var config=require(_0x4301('0x7'));var jayson=require(_0x4301('0x8'));var client=jayson[_0x4301('0x9')][_0x4301('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a6e61,_0x5013c,_0x1dc855){return new BPromise(function(_0x337800,_0x4d5020){return client['request'](_0x3a6e61,_0x1dc855)[_0x4301('0xb')](function(_0x2d6581){logger['info'](_0x4301('0xc'),_0x5013c,_0x4301('0xd'));logger[_0x4301('0xe')](_0x4301('0xf'),_0x5013c,'request\x20sent',JSON[_0x4301('0x10')](_0x2d6581));if(_0x2d6581['error']){if(_0x2d6581[_0x4301('0x11')][_0x4301('0x12')]===0x1f4){logger[_0x4301('0x11')](_0x4301('0xc'),_0x5013c,_0x2d6581[_0x4301('0x11')][_0x4301('0x13')]);return _0x4d5020(_0x2d6581[_0x4301('0x11')][_0x4301('0x13')]);}logger[_0x4301('0x11')](_0x4301('0xc'),_0x5013c,_0x2d6581[_0x4301('0x11')][_0x4301('0x13')]);return _0x337800(_0x2d6581[_0x4301('0x11')]['message']);}else{logger['info']('Automation,\x20%s,\x20%s',_0x5013c,_0x4301('0xd'));_0x337800(_0x2d6581[_0x4301('0x14')][_0x4301('0x13')]);}})[_0x4301('0x15')](function(_0x4da25c){logger['error'](_0x4301('0xc'),_0x5013c,_0x4da25c);_0x4d5020(_0x4da25c);});});}
\ No newline at end of file
+var _0x1c9a=['http','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x1c9a,0x98));var _0xa1c9=function(_0x34cefe,_0x2340aa){_0x34cefe=_0x34cefe-0x0;var _0x3bace2=_0x1c9a[_0x34cefe];return _0x3bace2;};'use strict';var _=require(_0xa1c9('0x0'));var util=require('util');var moment=require(_0xa1c9('0x1'));var BPromise=require('bluebird');var rs=require(_0xa1c9('0x2'));var fs=require('fs');var Redis=require(_0xa1c9('0x3'));var db=require(_0xa1c9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa1c9('0x5'))(_0xa1c9('0x6'));var config=require(_0xa1c9('0x7'));var jayson=require(_0xa1c9('0x8'));var client=jayson['client'][_0xa1c9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5448f2,_0x222624,_0x463c9c){return new BPromise(function(_0x3f07c2,_0x5059df){return client[_0xa1c9('0xa')](_0x5448f2,_0x463c9c)[_0xa1c9('0xb')](function(_0x24136d){logger[_0xa1c9('0xc')]('Automation,\x20%s,\x20%s',_0x222624,_0xa1c9('0xd'));logger[_0xa1c9('0xe')](_0xa1c9('0xf'),_0x222624,_0xa1c9('0xd'),JSON[_0xa1c9('0x10')](_0x24136d));if(_0x24136d[_0xa1c9('0x11')]){if(_0x24136d[_0xa1c9('0x11')][_0xa1c9('0x12')]===0x1f4){logger[_0xa1c9('0x11')](_0xa1c9('0x13'),_0x222624,_0x24136d['error'][_0xa1c9('0x14')]);return _0x5059df(_0x24136d[_0xa1c9('0x11')][_0xa1c9('0x14')]);}logger[_0xa1c9('0x11')](_0xa1c9('0x13'),_0x222624,_0x24136d['error'][_0xa1c9('0x14')]);return _0x3f07c2(_0x24136d[_0xa1c9('0x11')][_0xa1c9('0x14')]);}else{logger[_0xa1c9('0xc')](_0xa1c9('0x13'),_0x222624,_0xa1c9('0xd'));_0x3f07c2(_0x24136d[_0xa1c9('0x15')][_0xa1c9('0x14')]);}})[_0xa1c9('0x16')](function(_0x373f5d){logger['error'](_0xa1c9('0x13'),_0x222624,_0x373f5d);_0x5059df(_0x373f5d);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 3ee0cfe..da052b6 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 _0xdcd0=['create','addConditions','post','addActions','update','multer','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index','get','/:id','show','/:id/conditions','getConditions','/:id/actions'];(function(_0xb935b1,_0x54ed60){var _0x2bd5ce=function(_0x18f61a){while(--_0x18f61a){_0xb935b1['push'](_0xb935b1['shift']());}};_0x2bd5ce(++_0x54ed60);}(_0xdcd0,0xb9));var _0x0dcd=function(_0x2f2bac,_0x24a1da){_0x2f2bac=_0x2f2bac-0x0;var _0x3a4c06=_0xdcd0[_0x2f2bac];return _0x3a4c06;};'use strict';var multer=require(_0x0dcd('0x0'));var util=require('util');var path=require(_0x0dcd('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0dcd('0x2')]();var fs_extra=require(_0x0dcd('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0dcd('0x4'));var config=require(_0x0dcd('0x5'));var controller=require(_0x0dcd('0x6'));router['get']('/',auth[_0x0dcd('0x7')](),controller[_0x0dcd('0x8')]);router[_0x0dcd('0x9')](_0x0dcd('0xa'),auth['isAuthenticated'](),controller[_0x0dcd('0xb')]);router[_0x0dcd('0x9')](_0x0dcd('0xc'),auth[_0x0dcd('0x7')](),controller[_0x0dcd('0xd')]);router['get'](_0x0dcd('0xe'),auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller[_0x0dcd('0xf')]);router['post'](_0x0dcd('0xc'),auth[_0x0dcd('0x7')](),controller[_0x0dcd('0x10')]);router[_0x0dcd('0x11')](_0x0dcd('0xe'),auth[_0x0dcd('0x7')](),controller[_0x0dcd('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0dcd('0x13')]);router['delete']('/:id',auth[_0x0dcd('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xa049=['create','addConditions','addActions','put','/:id','update','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','index','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','getActions','post'];(function(_0x460ea6,_0x17998d){var _0x4962d2=function(_0x4ea96d){while(--_0x4ea96d){_0x460ea6['push'](_0x460ea6['shift']());}};_0x4962d2(++_0x17998d);}(_0xa049,0x1db));var _0x9a04=function(_0x56d591,_0x3191a3){_0x56d591=_0x56d591-0x0;var _0x4bf0ff=_0xa049[_0x56d591];return _0x4bf0ff;};'use strict';var multer=require(_0x9a04('0x0'));var util=require(_0x9a04('0x1'));var path=require('path');var timeout=require(_0x9a04('0x2'));var express=require(_0x9a04('0x3'));var router=express[_0x9a04('0x4')]();var fs_extra=require(_0x9a04('0x5'));var auth=require(_0x9a04('0x6'));var interaction=require(_0x9a04('0x7'));var config=require(_0x9a04('0x8'));var controller=require(_0x9a04('0x9'));router[_0x9a04('0xa')]('/',auth['isAuthenticated'](),controller[_0x9a04('0xb')]);router[_0x9a04('0xa')]('/:id',auth[_0x9a04('0xc')](),controller[_0x9a04('0xd')]);router[_0x9a04('0xa')](_0x9a04('0xe'),auth[_0x9a04('0xc')](),controller[_0x9a04('0xf')]);router['get'](_0x9a04('0x10'),auth[_0x9a04('0xc')](),controller[_0x9a04('0x11')]);router[_0x9a04('0x12')]('/',auth[_0x9a04('0xc')](),controller[_0x9a04('0x13')]);router['post'](_0x9a04('0xe'),auth[_0x9a04('0xc')](),controller[_0x9a04('0x14')]);router['post'](_0x9a04('0x10'),auth[_0x9a04('0xc')](),controller[_0x9a04('0x15')]);router[_0x9a04('0x16')](_0x9a04('0x17'),auth['isAuthenticated'](),controller[_0x9a04('0x18')]);router['delete'](_0x9a04('0x17'),auth[_0x9a04('0xc')](),controller['destroy']);module[_0x9a04('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 67c9a69..008d9de 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 _0x2ddd=['#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting'];(function(_0x1a379b,_0x507552){var _0x385502=function(_0x32491b){while(--_0x32491b){_0x1a379b['push'](_0x1a379b['shift']());}};_0x385502(++_0x507552);}(_0x2ddd,0x197));var _0xd2dd=function(_0x5a7d5f,_0x5695cb){_0x5a7d5f=_0x5a7d5f-0x0;var _0x5dcded=_0x2ddd[_0x5a7d5f];return _0x5dcded;};'use strict';var Sequelize=require(_0xd2dd('0x0'));module[_0xd2dd('0x1')]={'name':{'type':Sequelize[_0xd2dd('0x2')],'unique':_0xd2dd('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xd2dd('0x4')),'allowNull':![],'defaultValue':_0xd2dd('0x4')},'description':{'type':Sequelize[_0xd2dd('0x2')]},'active':{'type':Sequelize[_0xd2dd('0x5')],'defaultValue':0x0,'comment':_0xd2dd('0x6')},'limitCalls':{'type':Sequelize[_0xd2dd('0x7')](0x4)[_0xd2dd('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xd2dd('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0xd2dd('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xd2dd('0x7')](0x3)[_0xd2dd('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd2dd('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0xd2dd('0x7')](0x3)[_0xd2dd('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xd2dd('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd2dd('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xd2dd('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd2dd('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xd2dd('0x7')](0x5)[_0xd2dd('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd2dd('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd2dd('0x7')](0x3)[_0xd2dd('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xd2dd('0x7')](0x5)[_0xd2dd('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd2dd('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xd2dd('0xe')},'dialTimezone':{'type':Sequelize[_0xd2dd('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xd2dd('0x2')],'defaultValue':_0xd2dd('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xd2dd('0x10')](_0xd2dd('0x11'),_0xd2dd('0x12'),_0xd2dd('0x13')),'defaultValue':_0xd2dd('0x11')},'dialAMDActive':{'type':Sequelize[_0xd2dd('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xd2dd('0x7')](0x9)[_0xd2dd('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xd2dd('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xd2dd('0x7')](0x9)[_0xd2dd('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xd2dd('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xd2dd('0x7')](0x9)[_0xd2dd('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xd2dd('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xd2dd('0x7')](0x9)[_0xd2dd('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd2dd('0x17')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xd2dd('0x7')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xd2dd('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xd2dd('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xd2dd('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xd2dd('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xd2dd('0x7')](0x9)[_0xd2dd('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xd2dd('0x10')](_0xd2dd('0x1b'),_0xd2dd('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xd2dd('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xd2dd('0x7')](0x3)[_0xd2dd('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd2dd('0x1d')},'dialCutDigit':{'type':Sequelize[_0xd2dd('0x7')](0x3)[_0xd2dd('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xd2dd('0x7')](0x3)[_0xd2dd('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd2dd('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd2dd('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0xd2dd('0x7')](0x3)[_0xd2dd('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd2dd('0x20')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd2dd('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xd2dd('0x7')](0x3)[_0xd2dd('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd2dd('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd2dd('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xd2dd('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd2dd('0x23')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd2dd('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd2dd('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xd2dd('0x7')](0x3)[_0xd2dd('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd2dd('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd2dd('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd2dd('0x26')}};
\ No newline at end of file
+var _0xa587=['#NoAnswer\x20Retry\x20(min:1,\x20max:999)','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','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)'];(function(_0x500d35,_0x3f5d69){var _0x383af4=function(_0x22c7e9){while(--_0x22c7e9){_0x500d35['push'](_0x500d35['shift']());}};_0x383af4(++_0x3f5d69);}(_0xa587,0xa9));var _0x7a58=function(_0x15bd91,_0x333233){_0x15bd91=_0x15bd91-0x0;var _0x5e370d=_0xa587[_0x15bd91];return _0x5e370d;};'use strict';var Sequelize=require(_0x7a58('0x0'));module[_0x7a58('0x1')]={'name':{'type':Sequelize[_0x7a58('0x2')],'unique':_0x7a58('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x7a58('0x4')]('ivr'),'allowNull':![],'defaultValue':_0x7a58('0x5')},'description':{'type':Sequelize[_0x7a58('0x2')]},'active':{'type':Sequelize[_0x7a58('0x6')],'defaultValue':0x0,'comment':_0x7a58('0x7')},'limitCalls':{'type':Sequelize[_0x7a58('0x8')](0x4)[_0x7a58('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x7a58('0xa')},'dialOriginateCallerIdName':{'type':Sequelize[_0x7a58('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x7a58('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x7a58('0x8')](0x3)[_0x7a58('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7a58('0xb')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7a58('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7a58('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7a58('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7a58('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0x7a58('0x8')](0x3)[_0x7a58('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7a58('0xe')},'dialBusyRetryFrequency':{'type':Sequelize[_0x7a58('0x8')](0x5)[_0x7a58('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7a58('0xf')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x7a58('0x8')](0x3)[_0x7a58('0x9')],'defaultValue':0x3,'comment':_0x7a58('0x10')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x7a58('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x7a58('0x8')](0x3)[_0x7a58('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x7a58('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x7a58('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x7a58('0x4')]('always',_0x7a58('0x11'),_0x7a58('0x12')),'defaultValue':_0x7a58('0x13')},'dialAMDActive':{'type':Sequelize[_0x7a58('0x6')],'defaultValue':0x0,'comment':_0x7a58('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x7a58('0x8')](0x9)[_0x7a58('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x7a58('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x7a58('0x8')](0x9)[_0x7a58('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x7a58('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x7a58('0x8')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x7a58('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x7a58('0x8')](0x9)[_0x7a58('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x7a58('0x8')](0x9)[_0x7a58('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x7a58('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x7a58('0x8')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x7a58('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x7a58('0x8')](0x9)[_0x7a58('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x7a58('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x7a58('0x8')](0x5)[_0x7a58('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x7a58('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x7a58('0x8')](0x9)[_0x7a58('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7a58('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0x7a58('0x4')]('DESC','ASC'),'defaultValue':_0x7a58('0x1d')},'dialPrefix':{'type':Sequelize[_0x7a58('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x7a58('0x8')](0x3)[_0x7a58('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x7a58('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x7a58('0x8')](0x3)[_0x7a58('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7a58('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x7a58('0x8')](0x5)[_0x7a58('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x7a58('0x8')](0x3)[_0x7a58('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x7a58('0x8')](0x5)[_0x7a58('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7a58('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x7a58('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7a58('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x7a58('0x8')](0x5)[_0x7a58('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7a58('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0x7a58('0x8')](0x3)[_0x7a58('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7a58('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0x7a58('0x8')](0x5)[_0x7a58('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7a58('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x7a58('0x8')](0x3)[_0x7a58('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x7a58('0x8')](0x5)[_0x7a58('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7a58('0x24')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 850c1c9..7298386 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 _0x0d7b=['onlyIfOpen','fromQuery','cm_hopper','deletedAt\x20IS\x20NULL','push','sequelize','all','removeLists','getBlackLists','addBlackLists','ids','cm_hopper_black','removeBlackLists','eml-format','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','sendStatus','error','stack','name','index','map','Campaign','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','clone','omit','createdAt','updatedAt','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','CmHopper','order','pick','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','spread','dialCheckDuplicateType','always','insert','into','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)'];(function(_0x2e4587,_0x7bf8bd){var _0x422eb7=function(_0x16a22b){while(--_0x16a22b){_0x2e4587['push'](_0x2e4587['shift']());}};_0x422eb7(++_0x7bf8bd);}(_0x0d7b,0x92));var _0xb0d7=function(_0x21615e,_0x1fd2bb){_0x21615e=_0x21615e-0x0;var _0x2b91bc=_0x0d7b[_0x21615e];return _0x2b91bc;};'use strict';var emlformat=require(_0xb0d7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb0d7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb0d7('0x2'));var moment=require(_0xb0d7('0x3'));var BPromise=require(_0xb0d7('0x4'));var Mustache=require('mustache');var util=require(_0xb0d7('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xb0d7('0x6'));var ejs=require(_0xb0d7('0x7'));var fs=require('fs');var fs_extra=require(_0xb0d7('0x8'));var _=require('lodash');var squel=require(_0xb0d7('0x9'));var crypto=require(_0xb0d7('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb0d7('0x6'));var querystring=require('querystring');var Papa=require(_0xb0d7('0xb'));var Redis=require(_0xb0d7('0xc'));var authService=require(_0xb0d7('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xb0d7('0xe'));var hardwareService=require(_0xb0d7('0xf'));var logger=require(_0xb0d7('0x10'))('api');var utils=require(_0xb0d7('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xb0d7('0x12'));var db=require(_0xb0d7('0x13'))['db'];function respondWithStatusCode(_0x54c376,_0x5979d8){_0x5979d8=_0x5979d8||0xcc;return function(_0xb4104){if(_0xb4104){return _0x54c376['sendStatus'](_0x5979d8);}return _0x54c376[_0xb0d7('0x14')](_0x5979d8)[_0xb0d7('0x15')]();};}function respondWithResult(_0x4a42da,_0x197ebc){_0x197ebc=_0x197ebc||0xc8;return function(_0x7cde45){if(_0x7cde45){return _0x4a42da[_0xb0d7('0x14')](_0x197ebc)[_0xb0d7('0x16')](_0x7cde45);}};}function respondWithFilteredResult(_0x46fbb8,_0x315dbb){return function(_0x2c99b4){if(_0x2c99b4){var _0x2e22d1=typeof _0x315dbb[_0xb0d7('0x17')]===_0xb0d7('0x18')&&typeof _0x315dbb[_0xb0d7('0x19')]===_0xb0d7('0x18');var _0x340cf0=_0x2c99b4[_0xb0d7('0x1a')];var _0x1a72df=_0x2e22d1?0x0:_0x315dbb[_0xb0d7('0x17')];var _0x2b83b6=_0x2e22d1?_0x2c99b4['count']:_0x315dbb[_0xb0d7('0x17')]+_0x315dbb[_0xb0d7('0x19')];var _0x240784;if(_0x2b83b6>=_0x340cf0){_0x2b83b6=_0x340cf0;_0x240784=0xc8;}else{_0x240784=0xce;}_0x46fbb8[_0xb0d7('0x14')](_0x240784);return _0x46fbb8['set'](_0xb0d7('0x1b'),_0x1a72df+'-'+_0x2b83b6+'/'+_0x340cf0)[_0xb0d7('0x16')](_0x2c99b4);}return null;};}function patchUpdates(_0x462653){return function(_0x4db315){try{jsonpatch[_0xb0d7('0x1c')](_0x4db315,_0x462653,!![]);}catch(_0x1d696c){return BPromise[_0xb0d7('0x1d')](_0x1d696c);}return _0x4db315[_0xb0d7('0x1e')]();};}function saveUpdates(_0x3ce333,_0x55e3bf){return function(_0x293581){if(_0x293581){return _0x293581[_0xb0d7('0x1f')](_0x3ce333)[_0xb0d7('0x20')](function(_0x5f2caf){return _0x5f2caf;});}return null;};}function removeEntity(_0x1cc003,_0x30610f){return function(_0x337780){if(_0x337780){return _0x337780[_0xb0d7('0x21')]()[_0xb0d7('0x20')](function(){var _0x343e48=_0x337780[_0xb0d7('0x22')]({'plain':!![]});var _0x551f83=_0xb0d7('0x23');return db['UserProfileResource']['destroy']({'where':{'type':_0x551f83,'resourceId':_0x343e48['id']}})[_0xb0d7('0x20')](function(){return _0x337780;});})[_0xb0d7('0x20')](function(){_0x1cc003[_0xb0d7('0x14')](0xcc)[_0xb0d7('0x15')]();});}};}function handleEntityNotFound(_0x1b749c,_0x25cdd6){return function(_0x5cdd14){if(!_0x5cdd14){_0x1b749c[_0xb0d7('0x24')](0x194);}return _0x5cdd14;};}function handleError(_0x28b6f5,_0x46dcb9){_0x46dcb9=_0x46dcb9||0x1f4;return function(_0x2aecd9){logger[_0xb0d7('0x25')](_0x2aecd9[_0xb0d7('0x26')]);if(_0x2aecd9[_0xb0d7('0x27')]){delete _0x2aecd9[_0xb0d7('0x27')];}_0x28b6f5['status'](_0x46dcb9)['send'](_0x2aecd9);};}exports[_0xb0d7('0x28')]=function(_0x473e8a,_0x268c9d){var _0x1a8fc0={},_0x3f436e={},_0x16274d={'count':0x0,'rows':[]};var _0x9347a5=_[_0xb0d7('0x29')](db[_0xb0d7('0x2a')][_0xb0d7('0x2b')],function(_0xe8fbb7){return{'name':_0xe8fbb7[_0xb0d7('0x2c')],'type':_0xe8fbb7[_0xb0d7('0x2d')][_0xb0d7('0x2e')]};});_0x3f436e['model']=_[_0xb0d7('0x29')](_0x9347a5,_0xb0d7('0x27'));_0x3f436e[_0xb0d7('0x2f')]=_[_0xb0d7('0x30')](_0x473e8a[_0xb0d7('0x2f')]);_0x3f436e[_0xb0d7('0x31')]=_[_0xb0d7('0x32')](_0x3f436e[_0xb0d7('0x33')],_0x3f436e[_0xb0d7('0x2f')]);_0x1a8fc0[_0xb0d7('0x34')]=_['intersection'](_0x3f436e[_0xb0d7('0x33')],qs[_0xb0d7('0x35')](_0x473e8a[_0xb0d7('0x2f')][_0xb0d7('0x35')]));_0x1a8fc0[_0xb0d7('0x34')]=_0x1a8fc0[_0xb0d7('0x34')]['length']?_0x1a8fc0[_0xb0d7('0x34')]:_0x3f436e['model'];if(!_0x473e8a[_0xb0d7('0x2f')][_0xb0d7('0x36')](_0xb0d7('0x37'))){_0x1a8fc0[_0xb0d7('0x19')]=qs[_0xb0d7('0x19')](_0x473e8a[_0xb0d7('0x2f')][_0xb0d7('0x19')]);_0x1a8fc0[_0xb0d7('0x17')]=qs['offset'](_0x473e8a['query'][_0xb0d7('0x17')]);}_0x1a8fc0['order']=qs[_0xb0d7('0x38')](_0x473e8a[_0xb0d7('0x2f')][_0xb0d7('0x38')]);_0x1a8fc0[_0xb0d7('0x39')]=qs['filters'](_['pick'](_0x473e8a[_0xb0d7('0x2f')],_0x3f436e['filters']),_0x9347a5);if(_0x473e8a[_0xb0d7('0x2f')][_0xb0d7('0x3a')]){_0x1a8fc0['where']=_[_0xb0d7('0x3b')](_0x1a8fc0[_0xb0d7('0x39')],{'$or':_[_0xb0d7('0x29')](_0x9347a5,function(_0x33374a){if(_0x33374a[_0xb0d7('0x2d')]!==_0xb0d7('0x3c')){var _0x2e8965={};_0x2e8965[_0x33374a[_0xb0d7('0x27')]]={'$like':'%'+_0x473e8a['query'][_0xb0d7('0x3a')]+'%'};return _0x2e8965;}})});}_0x1a8fc0=_[_0xb0d7('0x3b')]({},_0x1a8fc0,_0x473e8a[_0xb0d7('0x3d')]);var _0x210ba8={'where':_0x1a8fc0['where']};return db[_0xb0d7('0x2a')][_0xb0d7('0x1a')](_0x210ba8)[_0xb0d7('0x20')](function(_0x578897){_0x16274d[_0xb0d7('0x1a')]=_0x578897;if(_0x473e8a['query'][_0xb0d7('0x3e')]){_0x1a8fc0[_0xb0d7('0x3f')]=[{'all':!![]}];}return db[_0xb0d7('0x2a')][_0xb0d7('0x40')](_0x1a8fc0);})[_0xb0d7('0x20')](function(_0x5bd932){_0x16274d[_0xb0d7('0x41')]=_0x5bd932;return _0x16274d;})[_0xb0d7('0x20')](respondWithFilteredResult(_0x268c9d,_0x1a8fc0))[_0xb0d7('0x42')](handleError(_0x268c9d,null));};exports[_0xb0d7('0x43')]=function(_0x4201f0,_0x5571e0){var _0x3bc74a={'raw':![],'where':{'id':_0x4201f0[_0xb0d7('0x44')]['id']}},_0x10c59c={};_0x10c59c[_0xb0d7('0x33')]=_[_0xb0d7('0x30')](db['Campaign'][_0xb0d7('0x2b')]);_0x10c59c[_0xb0d7('0x2f')]=_[_0xb0d7('0x30')](_0x4201f0['query']);_0x10c59c[_0xb0d7('0x31')]=_[_0xb0d7('0x32')](_0x10c59c[_0xb0d7('0x33')],_0x10c59c[_0xb0d7('0x2f')]);_0x3bc74a[_0xb0d7('0x34')]=_['intersection'](_0x10c59c[_0xb0d7('0x33')],qs[_0xb0d7('0x35')](_0x4201f0[_0xb0d7('0x2f')][_0xb0d7('0x35')]));_0x3bc74a[_0xb0d7('0x34')]=_0x3bc74a[_0xb0d7('0x34')][_0xb0d7('0x45')]?_0x3bc74a[_0xb0d7('0x34')]:_0x10c59c[_0xb0d7('0x33')];if(_0x4201f0['query'][_0xb0d7('0x3e')]){_0x3bc74a[_0xb0d7('0x3f')]=[{'all':!![]}];}_0x3bc74a=_['merge']({},_0x3bc74a,_0x4201f0[_0xb0d7('0x3d')]);return db[_0xb0d7('0x2a')][_0xb0d7('0x46')](_0x3bc74a)[_0xb0d7('0x20')](handleEntityNotFound(_0x5571e0,null))[_0xb0d7('0x20')](respondWithResult(_0x5571e0,null))[_0xb0d7('0x42')](handleError(_0x5571e0,null));};exports[_0xb0d7('0x47')]=function(_0x4cd7f5,_0x3fa8b8){return db[_0xb0d7('0x2a')][_0xb0d7('0x47')](_0x4cd7f5[_0xb0d7('0x48')],{})[_0xb0d7('0x20')](function(_0x9b43bf){var _0x3ed37c=_0x4cd7f5[_0xb0d7('0x49')]['get']({'plain':!![]});if(!_0x3ed37c)throw new Error(_0xb0d7('0x4a'));if(_0x3ed37c['role']===_0xb0d7('0x49')){var _0x1d0580=_0x9b43bf['get']({'plain':!![]});var _0x5943d6=_0xb0d7('0x23');return db[_0xb0d7('0x4b')][_0xb0d7('0x46')]({'where':{'name':_0x5943d6,'userProfileId':_0x3ed37c[_0xb0d7('0x4c')]},'raw':!![]})[_0xb0d7('0x20')](function(_0x68673b){if(_0x68673b&&_0x68673b['autoAssociation']===0x0){return db[_0xb0d7('0x4d')]['create']({'name':_0x1d0580[_0xb0d7('0x27')],'resourceId':_0x1d0580['id'],'type':_0x68673b['name'],'sectionId':_0x68673b['id']},{})[_0xb0d7('0x20')](function(){return _0x9b43bf;});}else{return _0x9b43bf;}})['catch'](function(_0x56ceae){logger[_0xb0d7('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56ceae);throw _0x56ceae;});}return _0x9b43bf;})[_0xb0d7('0x20')](respondWithResult(_0x3fa8b8,0xc9))[_0xb0d7('0x42')](handleError(_0x3fa8b8,null));};exports[_0xb0d7('0x4e')]=function(_0x1f21f8,_0x302e97){var _0x3239b9={'where':{'id':_0x1f21f8[_0xb0d7('0x44')]['id']}},_0x761b47={};_0x761b47[_0xb0d7('0x33')]=_['keys'](db[_0xb0d7('0x2a')][_0xb0d7('0x2b')]);_0x3239b9[_0xb0d7('0x34')]=_[_0xb0d7('0x32')](_0x761b47[_0xb0d7('0x33')],qs[_0xb0d7('0x35')](_0x1f21f8[_0xb0d7('0x2f')][_0xb0d7('0x35')]));_0x3239b9[_0xb0d7('0x34')]=_0x3239b9[_0xb0d7('0x34')]['length']?_0x3239b9['attributes']:_0x761b47[_0xb0d7('0x33')];if(_0x1f21f8[_0xb0d7('0x2f')][_0xb0d7('0x3e')]){_0x3239b9[_0xb0d7('0x3f')]=[{'all':!![]}];}_0x3239b9=_[_0xb0d7('0x3b')]({},_0x3239b9,_0x1f21f8[_0xb0d7('0x3d')]);return db[_0xb0d7('0x2a')][_0xb0d7('0x46')](_0x3239b9)['then'](handleEntityNotFound(_0x302e97,null))[_0xb0d7('0x20')](function(_0x4f270e){if(_0x4f270e){var _0x36c54f=_0x4f270e[_0xb0d7('0x22')]({'plain':!![]});_0x36c54f=qs[_0xb0d7('0x4f')](_0x36c54f,['id',_0xb0d7('0x50'),'updatedAt']);_0x1f21f8['body']=_[_0xb0d7('0x4f')](_0x1f21f8[_0xb0d7('0x48')],['id',_0xb0d7('0x50'),_0xb0d7('0x51')]);return db[_0xb0d7('0x2a')][_0xb0d7('0x47')](_[_0xb0d7('0x3b')](_0x36c54f,_0x1f21f8[_0xb0d7('0x48')]),{'include':_0x1f21f8['query'][_0xb0d7('0x3e')]?[{'all':!![]}]:undefined})[_0xb0d7('0x20')](function(_0x41803b){var _0x32fb5e=_0x1f21f8['user']['get']({'plain':!![]});if(!_0x32fb5e)throw new Error(_0xb0d7('0x4a'));if(_0x32fb5e[_0xb0d7('0x52')]===_0xb0d7('0x49')){var _0x2e2d11=_0x41803b[_0xb0d7('0x22')]({'plain':!![]});var _0x98130e=_0xb0d7('0x23');return db['UserProfileSection'][_0xb0d7('0x46')]({'where':{'name':_0x98130e,'userProfileId':_0x32fb5e[_0xb0d7('0x4c')]},'raw':!![]})[_0xb0d7('0x20')](function(_0x2e7648){if(_0x2e7648&&_0x2e7648[_0xb0d7('0x53')]===0x0){return db[_0xb0d7('0x4d')][_0xb0d7('0x47')]({'name':_0x2e2d11[_0xb0d7('0x27')],'resourceId':_0x2e2d11['id'],'type':_0x2e7648[_0xb0d7('0x27')],'sectionId':_0x2e7648['id']},{})[_0xb0d7('0x20')](function(){return _0x41803b;});}else{return _0x41803b;}})[_0xb0d7('0x42')](function(_0x3d1a44){logger[_0xb0d7('0x25')](_0xb0d7('0x54'),_0x3d1a44);throw _0x3d1a44;});}return _0x41803b;});}})['then'](respondWithResult(_0x302e97,0xc9))[_0xb0d7('0x42')](handleError(_0x302e97,null));};exports[_0xb0d7('0x1f')]=function(_0x18b48a,_0x345c77){if(_0x18b48a[_0xb0d7('0x48')]['id']){delete _0x18b48a[_0xb0d7('0x48')]['id'];}return db['Campaign'][_0xb0d7('0x46')]({'where':{'id':_0x18b48a[_0xb0d7('0x44')]['id']}})[_0xb0d7('0x20')](handleEntityNotFound(_0x345c77,null))[_0xb0d7('0x20')](saveUpdates(_0x18b48a['body'],null))[_0xb0d7('0x20')](respondWithResult(_0x345c77,null))[_0xb0d7('0x42')](handleError(_0x345c77,null));};exports[_0xb0d7('0x21')]=function(_0x35bb0a,_0x34e8e7){return db['Campaign']['find']({'where':{'id':_0x35bb0a[_0xb0d7('0x44')]['id']}})['then'](handleEntityNotFound(_0x34e8e7,null))[_0xb0d7('0x20')](removeEntity(_0x34e8e7,null))['catch'](handleError(_0x34e8e7,null));};exports['getHoppers']=function(_0x46f23d,_0x472a5d,_0xa95c2a){var _0x58c894={'raw':!![],'where':{}};var _0x5f0efd={};var _0x8347b2={'count':0x0,'rows':[]};return db[_0xb0d7('0x2a')][_0xb0d7('0x55')]({'where':{'id':_0x46f23d['params']['id']}})[_0xb0d7('0x20')](handleEntityNotFound(_0x472a5d,null))[_0xb0d7('0x20')](function(_0x33bec9){if(_0x33bec9){_0x5f0efd[_0xb0d7('0x33')]=_[_0xb0d7('0x30')](db[_0xb0d7('0x56')][_0xb0d7('0x2b')]);_0x5f0efd['query']=_[_0xb0d7('0x30')](_0x46f23d[_0xb0d7('0x2f')]);_0x5f0efd['filters']=_[_0xb0d7('0x32')](_0x5f0efd[_0xb0d7('0x33')],_0x5f0efd['query']);_0x58c894[_0xb0d7('0x34')]=_['intersection'](_0x5f0efd['model'],qs['fields'](_0x46f23d[_0xb0d7('0x2f')][_0xb0d7('0x35')]));_0x58c894[_0xb0d7('0x34')]=_0x58c894['attributes']['length']?_0x58c894[_0xb0d7('0x34')]:_0x5f0efd['model'];if(!_0x46f23d[_0xb0d7('0x2f')][_0xb0d7('0x36')](_0xb0d7('0x37'))){_0x58c894[_0xb0d7('0x19')]=qs['limit'](_0x46f23d[_0xb0d7('0x2f')][_0xb0d7('0x19')]);_0x58c894[_0xb0d7('0x17')]=qs[_0xb0d7('0x17')](_0x46f23d[_0xb0d7('0x2f')]['offset']);}_0x58c894[_0xb0d7('0x57')]=qs[_0xb0d7('0x38')](_0x46f23d[_0xb0d7('0x2f')][_0xb0d7('0x38')]);_0x58c894[_0xb0d7('0x39')]=qs[_0xb0d7('0x31')](_[_0xb0d7('0x58')](_0x46f23d[_0xb0d7('0x2f')],_0x5f0efd['filters']));_0x58c894[_0xb0d7('0x39')][_0xb0d7('0x59')]=_0x33bec9['id'];if(_0x46f23d['query'][_0xb0d7('0x3a')]){_0x58c894[_0xb0d7('0x39')]=_[_0xb0d7('0x3b')](_0x58c894[_0xb0d7('0x39')],{'$or':_[_0xb0d7('0x29')](_0x58c894['attributes'],function(_0x204eb2){var _0x127717={};_0x127717[_0x204eb2]={'$like':'%'+_0x46f23d['query'][_0xb0d7('0x3a')]+'%'};return _0x127717;})});}_0x58c894=_[_0xb0d7('0x3b')]({},_0x58c894,_0x46f23d[_0xb0d7('0x3d')]);return db['CmHopper'][_0xb0d7('0x1a')]({'where':_0x58c894['where']})[_0xb0d7('0x20')](function(_0x576300){_0x8347b2[_0xb0d7('0x1a')]=_0x576300;if(_0x46f23d[_0xb0d7('0x2f')][_0xb0d7('0x3e')]){_0x58c894[_0xb0d7('0x3f')]=[{'all':!![]}];}return db[_0xb0d7('0x56')][_0xb0d7('0x40')](_0x58c894);})[_0xb0d7('0x20')](function(_0x2804e0){_0x8347b2[_0xb0d7('0x41')]=_0x2804e0;return _0x8347b2;});}})[_0xb0d7('0x20')](respondWithFilteredResult(_0x472a5d,_0x58c894))['catch'](handleError(_0x472a5d,null));};exports[_0xb0d7('0x5a')]=function(_0x3ebc48,_0x222382,_0x6bbe20){var _0x486a34={'raw':!![],'where':{}};var _0x4e76e6={};var _0x2ace15={'count':0x0,'rows':[]};return db[_0xb0d7('0x2a')][_0xb0d7('0x55')]({'where':{'id':_0x3ebc48[_0xb0d7('0x44')]['id']}})['then'](handleEntityNotFound(_0x222382,null))[_0xb0d7('0x20')](function(_0x207253){if(_0x207253){_0x4e76e6[_0xb0d7('0x33')]=_[_0xb0d7('0x30')](db[_0xb0d7('0x5b')][_0xb0d7('0x2b')]);_0x4e76e6['query']=_[_0xb0d7('0x30')](_0x3ebc48[_0xb0d7('0x2f')]);_0x4e76e6['filters']=_[_0xb0d7('0x32')](_0x4e76e6[_0xb0d7('0x33')],_0x4e76e6[_0xb0d7('0x2f')]);_0x486a34[_0xb0d7('0x34')]=_[_0xb0d7('0x32')](_0x4e76e6[_0xb0d7('0x33')],qs[_0xb0d7('0x35')](_0x3ebc48[_0xb0d7('0x2f')][_0xb0d7('0x35')]));_0x486a34[_0xb0d7('0x34')]=_0x486a34[_0xb0d7('0x34')][_0xb0d7('0x45')]?_0x486a34[_0xb0d7('0x34')]:_0x4e76e6['model'];if(!_0x3ebc48[_0xb0d7('0x2f')][_0xb0d7('0x36')]('nolimit')){_0x486a34['limit']=qs[_0xb0d7('0x19')](_0x3ebc48['query'][_0xb0d7('0x19')]);_0x486a34['offset']=qs[_0xb0d7('0x17')](_0x3ebc48[_0xb0d7('0x2f')][_0xb0d7('0x17')]);}_0x486a34[_0xb0d7('0x57')]=qs[_0xb0d7('0x38')](_0x3ebc48[_0xb0d7('0x2f')]['sort']);_0x486a34[_0xb0d7('0x39')]=qs[_0xb0d7('0x31')](_[_0xb0d7('0x58')](_0x3ebc48['query'],_0x4e76e6[_0xb0d7('0x31')]));_0x486a34[_0xb0d7('0x39')][_0xb0d7('0x59')]=_0x207253['id'];if(_0x3ebc48[_0xb0d7('0x2f')][_0xb0d7('0x3a')]){_0x486a34['where']=_['merge'](_0x486a34[_0xb0d7('0x39')],{'$or':_['map'](_0x486a34[_0xb0d7('0x34')],function(_0x2c8fe9){var _0x16fee1={};_0x16fee1[_0x2c8fe9]={'$like':'%'+_0x3ebc48[_0xb0d7('0x2f')][_0xb0d7('0x3a')]+'%'};return _0x16fee1;})});}_0x486a34=_[_0xb0d7('0x3b')]({},_0x486a34,_0x3ebc48['options']);return db[_0xb0d7('0x5b')][_0xb0d7('0x1a')]({'where':_0x486a34[_0xb0d7('0x39')]})[_0xb0d7('0x20')](function(_0x156293){_0x2ace15['count']=_0x156293;if(_0x3ebc48['query'][_0xb0d7('0x3e')]){_0x486a34[_0xb0d7('0x3f')]=[{'all':!![]}];}return db[_0xb0d7('0x5b')][_0xb0d7('0x40')](_0x486a34);})[_0xb0d7('0x20')](function(_0x5f1fe8){_0x2ace15[_0xb0d7('0x41')]=_0x5f1fe8;return _0x2ace15;});}})['then'](respondWithFilteredResult(_0x222382,_0x486a34))['catch'](handleError(_0x222382,null));};exports[_0xb0d7('0x5c')]=function(_0x55f0fd,_0x1c023b,_0x5988b2){var _0x4c0b8b={'raw':!![],'where':{}};var _0x525011={};var _0x488c2a={'count':0x0,'rows':[]};return db[_0xb0d7('0x2a')][_0xb0d7('0x55')]({'where':{'id':_0x55f0fd[_0xb0d7('0x44')]['id']}})[_0xb0d7('0x20')](handleEntityNotFound(_0x1c023b,null))[_0xb0d7('0x20')](function(_0x130d98){if(_0x130d98){_0x525011[_0xb0d7('0x33')]=_[_0xb0d7('0x30')](db[_0xb0d7('0x5d')][_0xb0d7('0x2b')]);_0x525011['query']=_[_0xb0d7('0x30')](_0x55f0fd['query']);_0x525011['filters']=_[_0xb0d7('0x32')](_0x525011['model'],_0x525011[_0xb0d7('0x2f')]);_0x4c0b8b[_0xb0d7('0x34')]=_[_0xb0d7('0x32')](_0x525011[_0xb0d7('0x33')],qs['fields'](_0x55f0fd[_0xb0d7('0x2f')][_0xb0d7('0x35')]));_0x4c0b8b['attributes']=_0x4c0b8b[_0xb0d7('0x34')][_0xb0d7('0x45')]?_0x4c0b8b['attributes']:_0x525011[_0xb0d7('0x33')];if(!_0x55f0fd[_0xb0d7('0x2f')]['hasOwnProperty'](_0xb0d7('0x37'))){_0x4c0b8b[_0xb0d7('0x19')]=qs[_0xb0d7('0x19')](_0x55f0fd[_0xb0d7('0x2f')][_0xb0d7('0x19')]);_0x4c0b8b[_0xb0d7('0x17')]=qs[_0xb0d7('0x17')](_0x55f0fd[_0xb0d7('0x2f')][_0xb0d7('0x17')]);}_0x4c0b8b[_0xb0d7('0x57')]=qs[_0xb0d7('0x38')](_0x55f0fd[_0xb0d7('0x2f')][_0xb0d7('0x38')]);_0x4c0b8b[_0xb0d7('0x39')]=qs['filters'](_[_0xb0d7('0x58')](_0x55f0fd['query'],_0x525011[_0xb0d7('0x31')]));_0x4c0b8b[_0xb0d7('0x39')][_0xb0d7('0x59')]=_0x130d98['id'];if(_0x55f0fd[_0xb0d7('0x2f')][_0xb0d7('0x3a')]){_0x4c0b8b[_0xb0d7('0x39')]=_['merge'](_0x4c0b8b[_0xb0d7('0x39')],{'$or':_[_0xb0d7('0x29')](_0x4c0b8b[_0xb0d7('0x34')],function(_0x20dcea){var _0x4e09bf={};_0x4e09bf[_0x20dcea]={'$like':'%'+_0x55f0fd[_0xb0d7('0x2f')][_0xb0d7('0x3a')]+'%'};return _0x4e09bf;})});}_0x4c0b8b=_['merge']({},_0x4c0b8b,_0x55f0fd['options']);return db[_0xb0d7('0x5d')][_0xb0d7('0x1a')]({'where':_0x4c0b8b[_0xb0d7('0x39')]})[_0xb0d7('0x20')](function(_0x52bea4){_0x488c2a[_0xb0d7('0x1a')]=_0x52bea4;if(_0x55f0fd['query'][_0xb0d7('0x3e')]){_0x4c0b8b['include']=[{'all':!![]}];}return db[_0xb0d7('0x5d')][_0xb0d7('0x40')](_0x4c0b8b);})['then'](function(_0x2a2b38){_0x488c2a['rows']=_0x2a2b38;return _0x488c2a;});}})[_0xb0d7('0x20')](respondWithFilteredResult(_0x1c023b,_0x4c0b8b))[_0xb0d7('0x42')](handleError(_0x1c023b,null));};exports[_0xb0d7('0x5e')]=function(_0x48a98c,_0x216c48,_0x110b20){var _0x1374c3={'raw':!![],'where':{}};var _0x35b1ff={};var _0x18166a={'count':0x0,'rows':[]};return db[_0xb0d7('0x2a')][_0xb0d7('0x55')]({'where':{'id':_0x48a98c[_0xb0d7('0x44')]['id']}})[_0xb0d7('0x20')](handleEntityNotFound(_0x216c48,null))[_0xb0d7('0x20')](function(_0x1f502d){if(_0x1f502d){_0x35b1ff['model']=_['keys'](db[_0xb0d7('0x5f')][_0xb0d7('0x2b')]);_0x35b1ff[_0xb0d7('0x2f')]=_[_0xb0d7('0x30')](_0x48a98c[_0xb0d7('0x2f')]);_0x35b1ff[_0xb0d7('0x31')]=_[_0xb0d7('0x32')](_0x35b1ff[_0xb0d7('0x33')],_0x35b1ff[_0xb0d7('0x2f')]);_0x1374c3[_0xb0d7('0x34')]=_[_0xb0d7('0x32')](_0x35b1ff[_0xb0d7('0x33')],qs[_0xb0d7('0x35')](_0x48a98c[_0xb0d7('0x2f')]['fields']));_0x1374c3[_0xb0d7('0x34')]=_0x1374c3[_0xb0d7('0x34')][_0xb0d7('0x45')]?_0x1374c3['attributes']:_0x35b1ff['model'];if(!_0x48a98c[_0xb0d7('0x2f')][_0xb0d7('0x36')](_0xb0d7('0x37'))){_0x1374c3[_0xb0d7('0x19')]=qs['limit'](_0x48a98c[_0xb0d7('0x2f')][_0xb0d7('0x19')]);_0x1374c3['offset']=qs[_0xb0d7('0x17')](_0x48a98c[_0xb0d7('0x2f')][_0xb0d7('0x17')]);}_0x1374c3[_0xb0d7('0x57')]=qs[_0xb0d7('0x38')](_0x48a98c[_0xb0d7('0x2f')][_0xb0d7('0x38')]);_0x1374c3['where']=qs['filters'](_[_0xb0d7('0x58')](_0x48a98c[_0xb0d7('0x2f')],_0x35b1ff[_0xb0d7('0x31')]));_0x1374c3[_0xb0d7('0x39')][_0xb0d7('0x59')]=_0x1f502d['id'];if(_0x48a98c[_0xb0d7('0x2f')][_0xb0d7('0x3a')]){_0x1374c3[_0xb0d7('0x39')]=_[_0xb0d7('0x3b')](_0x1374c3['where'],{'$or':_['map'](_0x1374c3[_0xb0d7('0x34')],function(_0x2c111e){var _0x29924f={};_0x29924f[_0x2c111e]={'$like':'%'+_0x48a98c[_0xb0d7('0x2f')]['filter']+'%'};return _0x29924f;})});}_0x1374c3=_[_0xb0d7('0x3b')]({},_0x1374c3,_0x48a98c[_0xb0d7('0x3d')]);return db[_0xb0d7('0x5f')][_0xb0d7('0x1a')]({'where':_0x1374c3['where']})['then'](function(_0x4b680c){_0x18166a['count']=_0x4b680c;if(_0x48a98c[_0xb0d7('0x2f')][_0xb0d7('0x3e')]){_0x1374c3['include']=[{'all':!![]}];}return db[_0xb0d7('0x5f')]['findAll'](_0x1374c3);})['then'](function(_0x30f530){_0x18166a[_0xb0d7('0x41')]=_0x30f530;return _0x18166a;});}})[_0xb0d7('0x20')](respondWithFilteredResult(_0x216c48,_0x1374c3))[_0xb0d7('0x42')](handleError(_0x216c48,null));};exports['getLists']=function(_0x106d78,_0x421323,_0x111948){var _0x171ea9={};var _0x4ccab1={};var _0x5093c1;var _0x567c00;return db['Campaign']['findOne']({'where':{'id':_0x106d78[_0xb0d7('0x44')]['id']}})[_0xb0d7('0x20')](handleEntityNotFound(_0x421323,null))[_0xb0d7('0x20')](function(_0x5ab7c0){if(_0x5ab7c0){_0x5093c1=_0x5ab7c0;_0x4ccab1['model']=_[_0xb0d7('0x30')](db['CmList'][_0xb0d7('0x2b')]);_0x4ccab1[_0xb0d7('0x2f')]=_['keys'](_0x106d78['query']);_0x4ccab1[_0xb0d7('0x31')]=_[_0xb0d7('0x32')](_0x4ccab1[_0xb0d7('0x33')],_0x4ccab1[_0xb0d7('0x2f')]);_0x171ea9[_0xb0d7('0x34')]=_[_0xb0d7('0x32')](_0x4ccab1[_0xb0d7('0x33')],qs[_0xb0d7('0x35')](_0x106d78['query'][_0xb0d7('0x35')]));_0x171ea9['attributes']=_0x171ea9[_0xb0d7('0x34')]['length']?_0x171ea9[_0xb0d7('0x34')]:_0x4ccab1['model'];_0x171ea9[_0xb0d7('0x57')]=qs[_0xb0d7('0x38')](_0x106d78[_0xb0d7('0x2f')][_0xb0d7('0x38')]);_0x171ea9['where']=qs[_0xb0d7('0x31')](_['pick'](_0x106d78['query'],_0x4ccab1['filters']));if(_0x106d78[_0xb0d7('0x2f')][_0xb0d7('0x3a')]){_0x171ea9[_0xb0d7('0x39')]=_[_0xb0d7('0x3b')](_0x171ea9['where'],{'$or':_[_0xb0d7('0x29')](_0x171ea9[_0xb0d7('0x34')],function(_0x477c77){var _0x10d410={};_0x10d410[_0x477c77]={'$like':'%'+_0x106d78[_0xb0d7('0x2f')][_0xb0d7('0x3a')]+'%'};return _0x10d410;})});}_0x171ea9=_[_0xb0d7('0x3b')]({},_0x171ea9,_0x106d78[_0xb0d7('0x3d')]);return _0x5093c1[_0xb0d7('0x60')](_0x171ea9);}})[_0xb0d7('0x20')](function(_0x2f0c8d){if(_0x2f0c8d){_0x567c00=_0x2f0c8d[_0xb0d7('0x45')];if(!_0x106d78[_0xb0d7('0x2f')][_0xb0d7('0x36')](_0xb0d7('0x37'))){_0x171ea9[_0xb0d7('0x19')]=qs['limit'](_0x106d78[_0xb0d7('0x2f')][_0xb0d7('0x19')]);_0x171ea9[_0xb0d7('0x17')]=qs[_0xb0d7('0x17')](_0x106d78[_0xb0d7('0x2f')][_0xb0d7('0x17')]);}return _0x5093c1['getLists'](_0x171ea9);}})['then'](function(_0x31e949){if(_0x31e949){return _0x31e949?{'count':_0x567c00,'rows':_0x31e949}:null;}})[_0xb0d7('0x20')](respondWithResult(_0x421323,null))[_0xb0d7('0x42')](handleError(_0x421323,null));};exports[_0xb0d7('0x61')]=function(_0x533435,_0x4cfd6d,_0x1d20f0){var _0x2ba765,_0x427251;return db['Campaign'][_0xb0d7('0x46')]({'where':{'id':_0x533435[_0xb0d7('0x44')]['id']}})['then'](handleEntityNotFound(_0x4cfd6d,null))[_0xb0d7('0x20')](function(_0x4cdb8d){if(_0x4cdb8d){_0x427251=_0x4cdb8d;return _0x4cdb8d[_0xb0d7('0x61')](_0x533435[_0xb0d7('0x48')]['ids'],_[_0xb0d7('0x4f')](_0x533435[_0xb0d7('0x48')],['ids','id'])||{});}return null;})[_0xb0d7('0x62')](function(_0x145a6c){var _0x5c07f3;_0x2ba765=_0x145a6c||[];var _0x166686=[];if(_0x145a6c){for(var _0x300bc9=0x0;_0x300bc9<_0x145a6c['length'];_0x300bc9+=0x1){var _0x556016=_0x145a6c[_0x300bc9][_0xb0d7('0x22')]({'plain':!![]});_0x427251['dialCheckDuplicateType']=_0x533435[_0xb0d7('0x48')][_0xb0d7('0x63')]?_0x533435[_0xb0d7('0x48')][_0xb0d7('0x63')]:_0x427251[_0xb0d7('0x63')];switch(_0x427251[_0xb0d7('0x63')]){case _0xb0d7('0x64'):_0x5c07f3=squel[_0xb0d7('0x65')]()[_0xb0d7('0x66')]('cm_hopper')['fromQuery']([_0xb0d7('0x67'),_0xb0d7('0x68'),_0xb0d7('0x69'),_0xb0d7('0x6a'),_0xb0d7('0x59'),_0xb0d7('0x50'),_0xb0d7('0x51')],squel[_0xb0d7('0x6b')]()[_0xb0d7('0x6c')]('phone','phone')[_0xb0d7('0x6c')](_0xb0d7('0x6d'),'scheduledAt')[_0xb0d7('0x6c')]('id','ContactId')[_0xb0d7('0x6c')](_0x556016[_0xb0d7('0x6e')][_0xb0d7('0x6f')](),_0xb0d7('0x6a'))['field'](_0x533435[_0xb0d7('0x44')]['id'][_0xb0d7('0x6f')](),'CampaignId')['field'](_0xb0d7('0x6d'),_0xb0d7('0x50'))[_0xb0d7('0x6c')](_0xb0d7('0x6d'),_0xb0d7('0x51'))[_0xb0d7('0x70')](_0xb0d7('0x71'))[_0xb0d7('0x39')]('deletedAt\x20IS\x20NULL')[_0xb0d7('0x39')](_0xb0d7('0x72'),_0x556016[_0xb0d7('0x6e')][_0xb0d7('0x6f')]())[_0xb0d7('0x39')](_0xb0d7('0x73'))[_0xb0d7('0x39')](_0xb0d7('0x74'),squel['select']()['field']('COALESCE(calleridnum,\x27\x27)')['from'](_0xb0d7('0x75'))[_0xb0d7('0x39')](_0xb0d7('0x76'),_0x533435[_0xb0d7('0x44')]['id'][_0xb0d7('0x6f')]()))[_0xb0d7('0x39')]('phone\x20NOT\x20IN\x20(?)',squel[_0xb0d7('0x6b')]()[_0xb0d7('0x6c')](_0xb0d7('0x77'))[_0xb0d7('0x70')]('cm_hopper')[_0xb0d7('0x39')](_0xb0d7('0x76'),_0x533435[_0xb0d7('0x44')]['id']['toString']())))[_0xb0d7('0x6f')]();break;case _0xb0d7('0x78'):_0x5c07f3=squel[_0xb0d7('0x65')]()[_0xb0d7('0x66')]('cm_hopper')[_0xb0d7('0x79')]([_0xb0d7('0x67'),_0xb0d7('0x68'),_0xb0d7('0x69'),_0xb0d7('0x6a'),'CampaignId',_0xb0d7('0x50'),_0xb0d7('0x51')],squel[_0xb0d7('0x6b')]()[_0xb0d7('0x6c')](_0xb0d7('0x67'),'phone')[_0xb0d7('0x6c')](_0xb0d7('0x6d'),_0xb0d7('0x68'))[_0xb0d7('0x6c')]('id',_0xb0d7('0x69'))[_0xb0d7('0x6c')](_0x556016[_0xb0d7('0x6e')][_0xb0d7('0x6f')](),_0xb0d7('0x6a'))['field'](_0x533435['params']['id'][_0xb0d7('0x6f')](),'CampaignId')[_0xb0d7('0x6c')](_0xb0d7('0x6d'),_0xb0d7('0x50'))[_0xb0d7('0x6c')](_0xb0d7('0x6d'),_0xb0d7('0x51'))[_0xb0d7('0x70')](_0xb0d7('0x71'))[_0xb0d7('0x39')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x556016[_0xb0d7('0x6e')][_0xb0d7('0x6f')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xb0d7('0x39')](_0xb0d7('0x74'),squel[_0xb0d7('0x6b')]()['field']('COALESCE(phone,\x27\x27)')[_0xb0d7('0x70')]('cm_hopper')[_0xb0d7('0x39')](_0xb0d7('0x76'),_0x533435[_0xb0d7('0x44')]['id'][_0xb0d7('0x6f')]())))[_0xb0d7('0x6f')]();break;default:_0x5c07f3=squel[_0xb0d7('0x65')]()[_0xb0d7('0x66')](_0xb0d7('0x7a'))[_0xb0d7('0x79')]([_0xb0d7('0x67'),_0xb0d7('0x68'),_0xb0d7('0x69'),_0xb0d7('0x6a'),_0xb0d7('0x59'),_0xb0d7('0x50'),'updatedAt'],squel[_0xb0d7('0x6b')]()['field']('phone',_0xb0d7('0x67'))[_0xb0d7('0x6c')](_0xb0d7('0x6d'),_0xb0d7('0x68'))[_0xb0d7('0x6c')]('id',_0xb0d7('0x69'))[_0xb0d7('0x6c')](_0x556016[_0xb0d7('0x6e')][_0xb0d7('0x6f')](),_0xb0d7('0x6a'))['field'](_0x533435[_0xb0d7('0x44')]['id'][_0xb0d7('0x6f')](),_0xb0d7('0x59'))[_0xb0d7('0x6c')](_0xb0d7('0x6d'),_0xb0d7('0x50'))[_0xb0d7('0x6c')](_0xb0d7('0x6d'),'updatedAt')[_0xb0d7('0x70')](_0xb0d7('0x71'))[_0xb0d7('0x39')](_0xb0d7('0x7b'))[_0xb0d7('0x39')]('ListId\x20=\x20?',_0x556016[_0xb0d7('0x6e')]['toString']())[_0xb0d7('0x39')](_0xb0d7('0x73')))[_0xb0d7('0x6f')]();}_0x166686[_0xb0d7('0x7c')](db[_0xb0d7('0x7d')][_0xb0d7('0x2f')](_0x5c07f3));}return BPromise[_0xb0d7('0x7e')](_0x166686);}})[_0xb0d7('0x20')](function(){return _0x2ba765;})[_0xb0d7('0x20')](respondWithResult(_0x4cfd6d,null))['catch'](handleError(_0x4cfd6d,null));};exports['removeLists']=function(_0x1c436b,_0x63d46c,_0x43dd51){return db[_0xb0d7('0x2a')][_0xb0d7('0x46')]({'where':{'id':_0x1c436b[_0xb0d7('0x44')]['id']}})[_0xb0d7('0x20')](handleEntityNotFound(_0x63d46c,null))[_0xb0d7('0x20')](function(_0x55b3bd){if(_0x55b3bd){return _0x55b3bd[_0xb0d7('0x7f')](_0x1c436b[_0xb0d7('0x2f')]['ids']);}})[_0xb0d7('0x20')](function(_0x1bbf9f){if(_0x1bbf9f){return db['CmHopper'][_0xb0d7('0x21')]({'where':{'ListId':_0x1c436b[_0xb0d7('0x2f')]['ids'],'CampaignId':_0x1c436b[_0xb0d7('0x44')]['id']}})[_0xb0d7('0x20')](function(){return _0x1bbf9f;});}})[_0xb0d7('0x20')](respondWithStatusCode(_0x63d46c,null))[_0xb0d7('0x42')](handleError(_0x63d46c,null));};exports['getBlackLists']=function(_0x513ccc,_0x59d696,_0x1b642e){var _0x2afdba={};var _0x517a19={};var _0x3131e0;var _0x24801d;return db['Campaign'][_0xb0d7('0x55')]({'where':{'id':_0x513ccc[_0xb0d7('0x44')]['id']}})[_0xb0d7('0x20')](handleEntityNotFound(_0x59d696,null))[_0xb0d7('0x20')](function(_0x5dbfaf){if(_0x5dbfaf){_0x3131e0=_0x5dbfaf;_0x517a19[_0xb0d7('0x33')]=_[_0xb0d7('0x30')](db['CmList'][_0xb0d7('0x2b')]);_0x517a19[_0xb0d7('0x2f')]=_['keys'](_0x513ccc['query']);_0x517a19[_0xb0d7('0x31')]=_['intersection'](_0x517a19[_0xb0d7('0x33')],_0x517a19[_0xb0d7('0x2f')]);_0x2afdba[_0xb0d7('0x34')]=_[_0xb0d7('0x32')](_0x517a19['model'],qs['fields'](_0x513ccc[_0xb0d7('0x2f')][_0xb0d7('0x35')]));_0x2afdba['attributes']=_0x2afdba[_0xb0d7('0x34')][_0xb0d7('0x45')]?_0x2afdba[_0xb0d7('0x34')]:_0x517a19[_0xb0d7('0x33')];_0x2afdba[_0xb0d7('0x57')]=qs['sort'](_0x513ccc['query'][_0xb0d7('0x38')]);_0x2afdba[_0xb0d7('0x39')]=qs[_0xb0d7('0x31')](_[_0xb0d7('0x58')](_0x513ccc['query'],_0x517a19['filters']));if(_0x513ccc[_0xb0d7('0x2f')][_0xb0d7('0x3a')]){_0x2afdba[_0xb0d7('0x39')]=_[_0xb0d7('0x3b')](_0x2afdba[_0xb0d7('0x39')],{'$or':_['map'](_0x2afdba[_0xb0d7('0x34')],function(_0x213f35){var _0x1ef8a2={};_0x1ef8a2[_0x213f35]={'$like':'%'+_0x513ccc['query'][_0xb0d7('0x3a')]+'%'};return _0x1ef8a2;})});}_0x2afdba=_[_0xb0d7('0x3b')]({},_0x2afdba,_0x513ccc['options']);return _0x3131e0[_0xb0d7('0x80')](_0x2afdba);}})[_0xb0d7('0x20')](function(_0x1dc4b5){if(_0x1dc4b5){_0x24801d=_0x1dc4b5[_0xb0d7('0x45')];if(!_0x513ccc['query'][_0xb0d7('0x36')]('nolimit')){_0x2afdba[_0xb0d7('0x19')]=qs['limit'](_0x513ccc[_0xb0d7('0x2f')][_0xb0d7('0x19')]);_0x2afdba[_0xb0d7('0x17')]=qs[_0xb0d7('0x17')](_0x513ccc['query'][_0xb0d7('0x17')]);}return _0x3131e0[_0xb0d7('0x80')](_0x2afdba);}})[_0xb0d7('0x20')](function(_0x5dcfa2){if(_0x5dcfa2){return _0x5dcfa2?{'count':_0x24801d,'rows':_0x5dcfa2}:null;}})[_0xb0d7('0x20')](respondWithResult(_0x59d696,null))[_0xb0d7('0x42')](handleError(_0x59d696,null));};exports[_0xb0d7('0x81')]=function(_0x40efb7,_0x4c0aa1,_0x5cf758){var _0x2f16ae,_0x84916c;return db[_0xb0d7('0x2a')][_0xb0d7('0x46')]({'where':{'id':_0x40efb7['params']['id']}})[_0xb0d7('0x20')](handleEntityNotFound(_0x4c0aa1,null))[_0xb0d7('0x20')](function(_0x4d1108){if(_0x4d1108){_0x84916c=_0x4d1108;return _0x4d1108['addBlackLists'](_0x40efb7['body'][_0xb0d7('0x82')],_[_0xb0d7('0x4f')](_0x40efb7[_0xb0d7('0x48')],[_0xb0d7('0x82'),'id'])||{});}return null;})[_0xb0d7('0x62')](function(_0x27a70c){var _0xa5b8e;_0x2f16ae=_0x27a70c||[];var _0x43c7d1=[];if(_0x27a70c){for(var _0x20fd69=0x0;_0x20fd69<_0x27a70c[_0xb0d7('0x45')];_0x20fd69+=0x1){var _0x4bfe50=_0x27a70c[_0x20fd69]['get']({'plain':!![]});_0xa5b8e=squel[_0xb0d7('0x65')]()[_0xb0d7('0x66')](_0xb0d7('0x83'))[_0xb0d7('0x79')]([_0xb0d7('0x67'),_0xb0d7('0x69'),'ListId',_0xb0d7('0x59'),_0xb0d7('0x50'),_0xb0d7('0x51')],squel['select']()[_0xb0d7('0x6c')](_0xb0d7('0x67'),_0xb0d7('0x67'))[_0xb0d7('0x6c')]('id',_0xb0d7('0x69'))['field'](_0x4bfe50[_0xb0d7('0x6e')]['toString'](),_0xb0d7('0x6a'))[_0xb0d7('0x6c')](_0x40efb7['params']['id'][_0xb0d7('0x6f')](),_0xb0d7('0x59'))[_0xb0d7('0x6c')](_0xb0d7('0x6d'),'createdAt')[_0xb0d7('0x6c')](_0xb0d7('0x6d'),'updatedAt')[_0xb0d7('0x70')](_0xb0d7('0x71'))[_0xb0d7('0x39')](_0xb0d7('0x7b'))['where']('ListId\x20=\x20?',_0x4bfe50[_0xb0d7('0x6e')][_0xb0d7('0x6f')]())['where'](_0xb0d7('0x73')))['toString']();_0x43c7d1[_0xb0d7('0x7c')](db[_0xb0d7('0x7d')][_0xb0d7('0x2f')](_0xa5b8e));}return BPromise[_0xb0d7('0x7e')](_0x43c7d1);}})[_0xb0d7('0x20')](function(){return _0x2f16ae;})[_0xb0d7('0x20')](respondWithResult(_0x4c0aa1,null))[_0xb0d7('0x42')](handleError(_0x4c0aa1,null));};exports[_0xb0d7('0x84')]=function(_0xd6b871,_0x5967c3,_0xac1b5){return db[_0xb0d7('0x2a')]['find']({'where':{'id':_0xd6b871[_0xb0d7('0x44')]['id']}})[_0xb0d7('0x20')](handleEntityNotFound(_0x5967c3,null))[_0xb0d7('0x20')](function(_0x275a4f){if(_0x275a4f){return _0x275a4f['removeBlackLists'](_0xd6b871[_0xb0d7('0x2f')][_0xb0d7('0x82')]);}})[_0xb0d7('0x20')](function(_0x4cadd5){if(_0x4cadd5){return db[_0xb0d7('0x5f')][_0xb0d7('0x21')]({'where':{'ListId':_0xd6b871[_0xb0d7('0x2f')][_0xb0d7('0x82')],'CampaignId':_0xd6b871['params']['id']}})[_0xb0d7('0x20')](function(){return _0x4cadd5;});}})[_0xb0d7('0x20')](respondWithStatusCode(_0x5967c3,null))[_0xb0d7('0x42')](handleError(_0x5967c3,null));};
\ No newline at end of file
+var _0xedf1=['removeLists','getBlackLists','addBlackLists','cm_hopper_black','push','all','removeBlackLists','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','get','IvrCampaigns','stack','name','send','index','map','Campaign','rawAttributes','type','model','query','keys','intersection','attributes','hasOwnProperty','nolimit','sort','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','fields','length','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','userProfileId','UserProfileResource','create','error','clone','omit','createdAt','updatedAt','body','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getHoppers','findOne','order','CmHopper','getHopperHistories','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','dialCheckDuplicateType','always','into','cm_hopper','phone','scheduledAt','ContactId','select','field','NOW()','ListId','toString','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','insert','fromQuery','CmListId','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xedf1,0x11f));var _0x1edf=function(_0x33f8ae,_0x313780){_0x33f8ae=_0x33f8ae-0x0;var _0x526d4d=_0xedf1[_0x33f8ae];return _0x526d4d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1edf('0x0'));var jsonpatch=require(_0x1edf('0x1'));var rp=require(_0x1edf('0x2'));var moment=require(_0x1edf('0x3'));var BPromise=require(_0x1edf('0x4'));var Mustache=require(_0x1edf('0x5'));var util=require(_0x1edf('0x6'));var path=require('path');var sox=require(_0x1edf('0x7'));var csv=require(_0x1edf('0x8'));var ejs=require(_0x1edf('0x9'));var fs=require('fs');var fs_extra=require(_0x1edf('0xa'));var _=require(_0x1edf('0xb'));var squel=require(_0x1edf('0xc'));var crypto=require(_0x1edf('0xd'));var jsforce=require(_0x1edf('0xe'));var deskjs=require(_0x1edf('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1edf('0x10'));var Papa=require(_0x1edf('0x11'));var Redis=require(_0x1edf('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1edf('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1edf('0x14'));var logger=require(_0x1edf('0x15'))('api');var utils=require(_0x1edf('0x16'));var config=require(_0x1edf('0x17'));var licenseUtil=require(_0x1edf('0x18'));var db=require(_0x1edf('0x19'))['db'];function respondWithStatusCode(_0x28a87a,_0x315c55){_0x315c55=_0x315c55||0xcc;return function(_0x3508f9){if(_0x3508f9){return _0x28a87a[_0x1edf('0x1a')](_0x315c55);}return _0x28a87a[_0x1edf('0x1b')](_0x315c55)[_0x1edf('0x1c')]();};}function respondWithResult(_0x5aad1d,_0x348444){_0x348444=_0x348444||0xc8;return function(_0x462f4b){if(_0x462f4b){return _0x5aad1d[_0x1edf('0x1b')](_0x348444)[_0x1edf('0x1d')](_0x462f4b);}};}function respondWithFilteredResult(_0x387b27,_0x24db37){return function(_0x1d192c){if(_0x1d192c){var _0x50d440=typeof _0x24db37['offset']===_0x1edf('0x1e')&&typeof _0x24db37[_0x1edf('0x1f')]===_0x1edf('0x1e');var _0x47d619=_0x1d192c[_0x1edf('0x20')];var _0x424f50=_0x50d440?0x0:_0x24db37[_0x1edf('0x21')];var _0x497d6c=_0x50d440?_0x1d192c[_0x1edf('0x20')]:_0x24db37[_0x1edf('0x21')]+_0x24db37[_0x1edf('0x1f')];var _0x17c026;if(_0x497d6c>=_0x47d619){_0x497d6c=_0x47d619;_0x17c026=0xc8;}else{_0x17c026=0xce;}_0x387b27[_0x1edf('0x1b')](_0x17c026);return _0x387b27[_0x1edf('0x22')](_0x1edf('0x23'),_0x424f50+'-'+_0x497d6c+'/'+_0x47d619)['json'](_0x1d192c);}return null;};}function patchUpdates(_0x186d55){return function(_0x3f696b){try{jsonpatch[_0x1edf('0x24')](_0x3f696b,_0x186d55,!![]);}catch(_0x509338){return BPromise[_0x1edf('0x25')](_0x509338);}return _0x3f696b[_0x1edf('0x26')]();};}function saveUpdates(_0x338281,_0x54c463){return function(_0xd674f2){if(_0xd674f2){return _0xd674f2['update'](_0x338281)[_0x1edf('0x27')](function(_0x27f96a){return _0x27f96a;});}return null;};}function removeEntity(_0x57c1ba,_0x5857c9){return function(_0x11d479){if(_0x11d479){return _0x11d479[_0x1edf('0x28')]()[_0x1edf('0x27')](function(){var _0x2a2606=_0x11d479[_0x1edf('0x29')]({'plain':!![]});var _0x545b99=_0x1edf('0x2a');return db['UserProfileResource'][_0x1edf('0x28')]({'where':{'type':_0x545b99,'resourceId':_0x2a2606['id']}})['then'](function(){return _0x11d479;});})[_0x1edf('0x27')](function(){_0x57c1ba[_0x1edf('0x1b')](0xcc)[_0x1edf('0x1c')]();});}};}function handleEntityNotFound(_0x177cf4,_0x3eca37){return function(_0x14bcec){if(!_0x14bcec){_0x177cf4['sendStatus'](0x194);}return _0x14bcec;};}function handleError(_0x3a2828,_0x388fac){_0x388fac=_0x388fac||0x1f4;return function(_0x3d66de){logger['error'](_0x3d66de[_0x1edf('0x2b')]);if(_0x3d66de['name']){delete _0x3d66de[_0x1edf('0x2c')];}_0x3a2828[_0x1edf('0x1b')](_0x388fac)[_0x1edf('0x2d')](_0x3d66de);};}exports[_0x1edf('0x2e')]=function(_0x4c9b1d,_0x1a02ba){var _0x1c7e84={},_0x3a191d={},_0x714308={'count':0x0,'rows':[]};var _0x16241e=_[_0x1edf('0x2f')](db[_0x1edf('0x30')][_0x1edf('0x31')],function(_0x1b3dd4){return{'name':_0x1b3dd4['fieldName'],'type':_0x1b3dd4[_0x1edf('0x32')]['key']};});_0x3a191d[_0x1edf('0x33')]=_[_0x1edf('0x2f')](_0x16241e,'name');_0x3a191d[_0x1edf('0x34')]=_[_0x1edf('0x35')](_0x4c9b1d[_0x1edf('0x34')]);_0x3a191d['filters']=_[_0x1edf('0x36')](_0x3a191d[_0x1edf('0x33')],_0x3a191d[_0x1edf('0x34')]);_0x1c7e84['attributes']=_['intersection'](_0x3a191d[_0x1edf('0x33')],qs['fields'](_0x4c9b1d['query']['fields']));_0x1c7e84[_0x1edf('0x37')]=_0x1c7e84[_0x1edf('0x37')]['length']?_0x1c7e84['attributes']:_0x3a191d[_0x1edf('0x33')];if(!_0x4c9b1d['query'][_0x1edf('0x38')](_0x1edf('0x39'))){_0x1c7e84[_0x1edf('0x1f')]=qs[_0x1edf('0x1f')](_0x4c9b1d['query'][_0x1edf('0x1f')]);_0x1c7e84[_0x1edf('0x21')]=qs[_0x1edf('0x21')](_0x4c9b1d[_0x1edf('0x34')][_0x1edf('0x21')]);}_0x1c7e84['order']=qs[_0x1edf('0x3a')](_0x4c9b1d[_0x1edf('0x34')][_0x1edf('0x3a')]);_0x1c7e84['where']=qs[_0x1edf('0x3b')](_[_0x1edf('0x3c')](_0x4c9b1d[_0x1edf('0x34')],_0x3a191d[_0x1edf('0x3b')]),_0x16241e);if(_0x4c9b1d[_0x1edf('0x34')]['filter']){_0x1c7e84[_0x1edf('0x3d')]=_[_0x1edf('0x3e')](_0x1c7e84[_0x1edf('0x3d')],{'$or':_[_0x1edf('0x2f')](_0x16241e,function(_0x5c25ae){if(_0x5c25ae[_0x1edf('0x32')]!==_0x1edf('0x3f')){var _0x1981fa={};_0x1981fa[_0x5c25ae[_0x1edf('0x2c')]]={'$like':'%'+_0x4c9b1d['query'][_0x1edf('0x40')]+'%'};return _0x1981fa;}})});}_0x1c7e84=_[_0x1edf('0x3e')]({},_0x1c7e84,_0x4c9b1d[_0x1edf('0x41')]);var _0xba2b2f={'where':_0x1c7e84['where']};return db[_0x1edf('0x30')]['count'](_0xba2b2f)[_0x1edf('0x27')](function(_0x5f3c87){_0x714308['count']=_0x5f3c87;if(_0x4c9b1d[_0x1edf('0x34')][_0x1edf('0x42')]){_0x1c7e84[_0x1edf('0x43')]=[{'all':!![]}];}return db[_0x1edf('0x30')][_0x1edf('0x44')](_0x1c7e84);})[_0x1edf('0x27')](function(_0x1dbf22){_0x714308[_0x1edf('0x45')]=_0x1dbf22;return _0x714308;})['then'](respondWithFilteredResult(_0x1a02ba,_0x1c7e84))[_0x1edf('0x46')](handleError(_0x1a02ba,null));};exports[_0x1edf('0x47')]=function(_0x45dc41,_0x434380){var _0x55ab44={'raw':![],'where':{'id':_0x45dc41[_0x1edf('0x48')]['id']}},_0x33ffbf={};_0x33ffbf[_0x1edf('0x33')]=_[_0x1edf('0x35')](db['Campaign']['rawAttributes']);_0x33ffbf['query']=_[_0x1edf('0x35')](_0x45dc41[_0x1edf('0x34')]);_0x33ffbf[_0x1edf('0x3b')]=_['intersection'](_0x33ffbf[_0x1edf('0x33')],_0x33ffbf[_0x1edf('0x34')]);_0x55ab44[_0x1edf('0x37')]=_['intersection'](_0x33ffbf[_0x1edf('0x33')],qs[_0x1edf('0x49')](_0x45dc41['query'][_0x1edf('0x49')]));_0x55ab44[_0x1edf('0x37')]=_0x55ab44[_0x1edf('0x37')][_0x1edf('0x4a')]?_0x55ab44[_0x1edf('0x37')]:_0x33ffbf[_0x1edf('0x33')];if(_0x45dc41[_0x1edf('0x34')]['includeAll']){_0x55ab44['include']=[{'all':!![]}];}_0x55ab44=_[_0x1edf('0x3e')]({},_0x55ab44,_0x45dc41[_0x1edf('0x41')]);return db[_0x1edf('0x30')]['find'](_0x55ab44)['then'](handleEntityNotFound(_0x434380,null))[_0x1edf('0x27')](respondWithResult(_0x434380,null))[_0x1edf('0x46')](handleError(_0x434380,null));};exports['create']=function(_0x548d1b,_0x50f4ba){return db[_0x1edf('0x30')]['create'](_0x548d1b['body'],{})[_0x1edf('0x27')](function(_0x497a01){var _0x3eb1bf=_0x548d1b['user'][_0x1edf('0x29')]({'plain':!![]});if(!_0x3eb1bf)throw new Error(_0x1edf('0x4b'));if(_0x3eb1bf[_0x1edf('0x4c')]===_0x1edf('0x4d')){var _0x15be89=_0x497a01[_0x1edf('0x29')]({'plain':!![]});var _0x3b73bd=_0x1edf('0x2a');return db['UserProfileSection'][_0x1edf('0x4e')]({'where':{'name':_0x3b73bd,'userProfileId':_0x3eb1bf[_0x1edf('0x4f')]},'raw':!![]})['then'](function(_0x47decf){if(_0x47decf&&_0x47decf['autoAssociation']===0x0){return db[_0x1edf('0x50')][_0x1edf('0x51')]({'name':_0x15be89['name'],'resourceId':_0x15be89['id'],'type':_0x47decf[_0x1edf('0x2c')],'sectionId':_0x47decf['id']},{})[_0x1edf('0x27')](function(){return _0x497a01;});}else{return _0x497a01;}})[_0x1edf('0x46')](function(_0x4a5807){logger[_0x1edf('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a5807);throw _0x4a5807;});}return _0x497a01;})['then'](respondWithResult(_0x50f4ba,0xc9))[_0x1edf('0x46')](handleError(_0x50f4ba,null));};exports[_0x1edf('0x53')]=function(_0x255e90,_0xda02bb){var _0x3261b1={'where':{'id':_0x255e90[_0x1edf('0x48')]['id']}},_0x1ad7ac={};_0x1ad7ac[_0x1edf('0x33')]=_[_0x1edf('0x35')](db[_0x1edf('0x30')][_0x1edf('0x31')]);_0x3261b1[_0x1edf('0x37')]=_[_0x1edf('0x36')](_0x1ad7ac[_0x1edf('0x33')],qs[_0x1edf('0x49')](_0x255e90[_0x1edf('0x34')][_0x1edf('0x49')]));_0x3261b1[_0x1edf('0x37')]=_0x3261b1['attributes'][_0x1edf('0x4a')]?_0x3261b1[_0x1edf('0x37')]:_0x1ad7ac[_0x1edf('0x33')];if(_0x255e90[_0x1edf('0x34')][_0x1edf('0x42')]){_0x3261b1[_0x1edf('0x43')]=[{'all':!![]}];}_0x3261b1=_[_0x1edf('0x3e')]({},_0x3261b1,_0x255e90[_0x1edf('0x41')]);return db[_0x1edf('0x30')][_0x1edf('0x4e')](_0x3261b1)[_0x1edf('0x27')](handleEntityNotFound(_0xda02bb,null))['then'](function(_0x50bea3){if(_0x50bea3){var _0x13bba0=_0x50bea3[_0x1edf('0x29')]({'plain':!![]});_0x13bba0=qs[_0x1edf('0x54')](_0x13bba0,['id',_0x1edf('0x55'),_0x1edf('0x56')]);_0x255e90[_0x1edf('0x57')]=_[_0x1edf('0x54')](_0x255e90[_0x1edf('0x57')],['id',_0x1edf('0x55'),_0x1edf('0x56')]);return db['Campaign'][_0x1edf('0x51')](_['merge'](_0x13bba0,_0x255e90[_0x1edf('0x57')]),{'include':_0x255e90[_0x1edf('0x34')][_0x1edf('0x42')]?[{'all':!![]}]:undefined})['then'](function(_0x39db8e){var _0x3ec265=_0x255e90[_0x1edf('0x4d')]['get']({'plain':!![]});if(!_0x3ec265)throw new Error(_0x1edf('0x4b'));if(_0x3ec265[_0x1edf('0x4c')]===_0x1edf('0x4d')){var _0x393b0a=_0x39db8e[_0x1edf('0x29')]({'plain':!![]});var _0x7f6276='IvrCampaigns';return db['UserProfileSection'][_0x1edf('0x4e')]({'where':{'name':_0x7f6276,'userProfileId':_0x3ec265[_0x1edf('0x4f')]},'raw':!![]})[_0x1edf('0x27')](function(_0x4b82a3){if(_0x4b82a3&&_0x4b82a3[_0x1edf('0x58')]===0x0){return db['UserProfileResource'][_0x1edf('0x51')]({'name':_0x393b0a[_0x1edf('0x2c')],'resourceId':_0x393b0a['id'],'type':_0x4b82a3[_0x1edf('0x2c')],'sectionId':_0x4b82a3['id']},{})[_0x1edf('0x27')](function(){return _0x39db8e;});}else{return _0x39db8e;}})[_0x1edf('0x46')](function(_0x3fd832){logger[_0x1edf('0x52')](_0x1edf('0x59'),_0x3fd832);throw _0x3fd832;});}return _0x39db8e;});}})[_0x1edf('0x27')](respondWithResult(_0xda02bb,0xc9))['catch'](handleError(_0xda02bb,null));};exports[_0x1edf('0x5a')]=function(_0x36bc6b,_0x1888a4){if(_0x36bc6b['body']['id']){delete _0x36bc6b['body']['id'];}return db[_0x1edf('0x30')][_0x1edf('0x4e')]({'where':{'id':_0x36bc6b[_0x1edf('0x48')]['id']}})[_0x1edf('0x27')](handleEntityNotFound(_0x1888a4,null))[_0x1edf('0x27')](saveUpdates(_0x36bc6b[_0x1edf('0x57')],null))['then'](respondWithResult(_0x1888a4,null))[_0x1edf('0x46')](handleError(_0x1888a4,null));};exports[_0x1edf('0x28')]=function(_0xd6da3f,_0x2eae0c){return db[_0x1edf('0x30')]['find']({'where':{'id':_0xd6da3f[_0x1edf('0x48')]['id']}})[_0x1edf('0x27')](handleEntityNotFound(_0x2eae0c,null))['then'](removeEntity(_0x2eae0c,null))[_0x1edf('0x46')](handleError(_0x2eae0c,null));};exports[_0x1edf('0x5b')]=function(_0x217f0f,_0x417bfa,_0x42b5f2){var _0x45b471={'raw':!![],'where':{}};var _0x22243b={};var _0x36eb81={'count':0x0,'rows':[]};return db['Campaign'][_0x1edf('0x5c')]({'where':{'id':_0x217f0f[_0x1edf('0x48')]['id']}})[_0x1edf('0x27')](handleEntityNotFound(_0x417bfa,null))[_0x1edf('0x27')](function(_0xbc11cf){if(_0xbc11cf){_0x22243b[_0x1edf('0x33')]=_['keys'](db['CmHopper'][_0x1edf('0x31')]);_0x22243b['query']=_[_0x1edf('0x35')](_0x217f0f[_0x1edf('0x34')]);_0x22243b['filters']=_[_0x1edf('0x36')](_0x22243b[_0x1edf('0x33')],_0x22243b[_0x1edf('0x34')]);_0x45b471['attributes']=_[_0x1edf('0x36')](_0x22243b[_0x1edf('0x33')],qs[_0x1edf('0x49')](_0x217f0f[_0x1edf('0x34')]['fields']));_0x45b471['attributes']=_0x45b471[_0x1edf('0x37')]['length']?_0x45b471[_0x1edf('0x37')]:_0x22243b[_0x1edf('0x33')];if(!_0x217f0f[_0x1edf('0x34')][_0x1edf('0x38')](_0x1edf('0x39'))){_0x45b471[_0x1edf('0x1f')]=qs[_0x1edf('0x1f')](_0x217f0f[_0x1edf('0x34')][_0x1edf('0x1f')]);_0x45b471[_0x1edf('0x21')]=qs[_0x1edf('0x21')](_0x217f0f[_0x1edf('0x34')][_0x1edf('0x21')]);}_0x45b471[_0x1edf('0x5d')]=qs[_0x1edf('0x3a')](_0x217f0f[_0x1edf('0x34')][_0x1edf('0x3a')]);_0x45b471[_0x1edf('0x3d')]=qs['filters'](_[_0x1edf('0x3c')](_0x217f0f[_0x1edf('0x34')],_0x22243b[_0x1edf('0x3b')]));_0x45b471[_0x1edf('0x3d')]['CampaignId']=_0xbc11cf['id'];if(_0x217f0f[_0x1edf('0x34')][_0x1edf('0x40')]){_0x45b471[_0x1edf('0x3d')]=_[_0x1edf('0x3e')](_0x45b471[_0x1edf('0x3d')],{'$or':_[_0x1edf('0x2f')](_0x45b471[_0x1edf('0x37')],function(_0x2b1fdf){var _0x209d52={};_0x209d52[_0x2b1fdf]={'$like':'%'+_0x217f0f[_0x1edf('0x34')][_0x1edf('0x40')]+'%'};return _0x209d52;})});}_0x45b471=_['merge']({},_0x45b471,_0x217f0f[_0x1edf('0x41')]);return db['CmHopper']['count']({'where':_0x45b471['where']})['then'](function(_0x420f87){_0x36eb81[_0x1edf('0x20')]=_0x420f87;if(_0x217f0f[_0x1edf('0x34')][_0x1edf('0x42')]){_0x45b471[_0x1edf('0x43')]=[{'all':!![]}];}return db[_0x1edf('0x5e')][_0x1edf('0x44')](_0x45b471);})['then'](function(_0xb820bc){_0x36eb81[_0x1edf('0x45')]=_0xb820bc;return _0x36eb81;});}})['then'](respondWithFilteredResult(_0x417bfa,_0x45b471))[_0x1edf('0x46')](handleError(_0x417bfa,null));};exports[_0x1edf('0x5f')]=function(_0x3d46b9,_0xfcf855,_0x1848f0){var _0x4a02f9={'raw':!![],'where':{}};var _0x5a4cc7={};var _0x38aa47={'count':0x0,'rows':[]};return db['Campaign'][_0x1edf('0x5c')]({'where':{'id':_0x3d46b9[_0x1edf('0x48')]['id']}})['then'](handleEntityNotFound(_0xfcf855,null))[_0x1edf('0x27')](function(_0x3ef66f){if(_0x3ef66f){_0x5a4cc7['model']=_[_0x1edf('0x35')](db[_0x1edf('0x60')][_0x1edf('0x31')]);_0x5a4cc7['query']=_['keys'](_0x3d46b9[_0x1edf('0x34')]);_0x5a4cc7[_0x1edf('0x3b')]=_[_0x1edf('0x36')](_0x5a4cc7['model'],_0x5a4cc7['query']);_0x4a02f9['attributes']=_[_0x1edf('0x36')](_0x5a4cc7[_0x1edf('0x33')],qs[_0x1edf('0x49')](_0x3d46b9['query'][_0x1edf('0x49')]));_0x4a02f9[_0x1edf('0x37')]=_0x4a02f9[_0x1edf('0x37')][_0x1edf('0x4a')]?_0x4a02f9[_0x1edf('0x37')]:_0x5a4cc7[_0x1edf('0x33')];if(!_0x3d46b9[_0x1edf('0x34')][_0x1edf('0x38')](_0x1edf('0x39'))){_0x4a02f9[_0x1edf('0x1f')]=qs[_0x1edf('0x1f')](_0x3d46b9['query'][_0x1edf('0x1f')]);_0x4a02f9[_0x1edf('0x21')]=qs[_0x1edf('0x21')](_0x3d46b9['query'][_0x1edf('0x21')]);}_0x4a02f9[_0x1edf('0x5d')]=qs[_0x1edf('0x3a')](_0x3d46b9[_0x1edf('0x34')][_0x1edf('0x3a')]);_0x4a02f9['where']=qs[_0x1edf('0x3b')](_[_0x1edf('0x3c')](_0x3d46b9[_0x1edf('0x34')],_0x5a4cc7[_0x1edf('0x3b')]));_0x4a02f9[_0x1edf('0x3d')][_0x1edf('0x61')]=_0x3ef66f['id'];if(_0x3d46b9[_0x1edf('0x34')]['filter']){_0x4a02f9[_0x1edf('0x3d')]=_[_0x1edf('0x3e')](_0x4a02f9[_0x1edf('0x3d')],{'$or':_[_0x1edf('0x2f')](_0x4a02f9[_0x1edf('0x37')],function(_0x5e6288){var _0x314144={};_0x314144[_0x5e6288]={'$like':'%'+_0x3d46b9[_0x1edf('0x34')][_0x1edf('0x40')]+'%'};return _0x314144;})});}_0x4a02f9=_['merge']({},_0x4a02f9,_0x3d46b9['options']);return db[_0x1edf('0x60')][_0x1edf('0x20')]({'where':_0x4a02f9[_0x1edf('0x3d')]})['then'](function(_0x1f1c0d){_0x38aa47['count']=_0x1f1c0d;if(_0x3d46b9['query']['includeAll']){_0x4a02f9[_0x1edf('0x43')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x4a02f9);})[_0x1edf('0x27')](function(_0x242e81){_0x38aa47[_0x1edf('0x45')]=_0x242e81;return _0x38aa47;});}})[_0x1edf('0x27')](respondWithFilteredResult(_0xfcf855,_0x4a02f9))[_0x1edf('0x46')](handleError(_0xfcf855,null));};exports[_0x1edf('0x62')]=function(_0x5a692a,_0x4ff030,_0x220e70){var _0x3a90be={'raw':!![],'where':{}};var _0x303153={};var _0x25eab7={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x5a692a[_0x1edf('0x48')]['id']}})[_0x1edf('0x27')](handleEntityNotFound(_0x4ff030,null))[_0x1edf('0x27')](function(_0x16e685){if(_0x16e685){_0x303153[_0x1edf('0x33')]=_['keys'](db[_0x1edf('0x63')]['rawAttributes']);_0x303153[_0x1edf('0x34')]=_[_0x1edf('0x35')](_0x5a692a[_0x1edf('0x34')]);_0x303153['filters']=_['intersection'](_0x303153[_0x1edf('0x33')],_0x303153[_0x1edf('0x34')]);_0x3a90be['attributes']=_[_0x1edf('0x36')](_0x303153[_0x1edf('0x33')],qs[_0x1edf('0x49')](_0x5a692a[_0x1edf('0x34')][_0x1edf('0x49')]));_0x3a90be[_0x1edf('0x37')]=_0x3a90be[_0x1edf('0x37')][_0x1edf('0x4a')]?_0x3a90be[_0x1edf('0x37')]:_0x303153[_0x1edf('0x33')];if(!_0x5a692a['query'][_0x1edf('0x38')](_0x1edf('0x39'))){_0x3a90be[_0x1edf('0x1f')]=qs[_0x1edf('0x1f')](_0x5a692a[_0x1edf('0x34')][_0x1edf('0x1f')]);_0x3a90be[_0x1edf('0x21')]=qs[_0x1edf('0x21')](_0x5a692a['query']['offset']);}_0x3a90be[_0x1edf('0x5d')]=qs['sort'](_0x5a692a[_0x1edf('0x34')][_0x1edf('0x3a')]);_0x3a90be[_0x1edf('0x3d')]=qs['filters'](_['pick'](_0x5a692a['query'],_0x303153['filters']));_0x3a90be[_0x1edf('0x3d')][_0x1edf('0x61')]=_0x16e685['id'];if(_0x5a692a[_0x1edf('0x34')][_0x1edf('0x40')]){_0x3a90be[_0x1edf('0x3d')]=_[_0x1edf('0x3e')](_0x3a90be[_0x1edf('0x3d')],{'$or':_[_0x1edf('0x2f')](_0x3a90be[_0x1edf('0x37')],function(_0x31de99){var _0x3dc040={};_0x3dc040[_0x31de99]={'$like':'%'+_0x5a692a[_0x1edf('0x34')][_0x1edf('0x40')]+'%'};return _0x3dc040;})});}_0x3a90be=_[_0x1edf('0x3e')]({},_0x3a90be,_0x5a692a[_0x1edf('0x41')]);return db[_0x1edf('0x63')]['count']({'where':_0x3a90be[_0x1edf('0x3d')]})[_0x1edf('0x27')](function(_0x20ccca){_0x25eab7[_0x1edf('0x20')]=_0x20ccca;if(_0x5a692a['query'][_0x1edf('0x42')]){_0x3a90be[_0x1edf('0x43')]=[{'all':!![]}];}return db[_0x1edf('0x63')]['findAll'](_0x3a90be);})['then'](function(_0x202d70){_0x25eab7[_0x1edf('0x45')]=_0x202d70;return _0x25eab7;});}})[_0x1edf('0x27')](respondWithFilteredResult(_0x4ff030,_0x3a90be))[_0x1edf('0x46')](handleError(_0x4ff030,null));};exports[_0x1edf('0x64')]=function(_0x412a0e,_0x1d385d,_0x4eb690){var _0x50273a={'raw':!![],'where':{}};var _0x39f81f={};var _0x195497={'count':0x0,'rows':[]};return db['Campaign'][_0x1edf('0x5c')]({'where':{'id':_0x412a0e[_0x1edf('0x48')]['id']}})['then'](handleEntityNotFound(_0x1d385d,null))['then'](function(_0x56e1d3){if(_0x56e1d3){_0x39f81f[_0x1edf('0x33')]=_['keys'](db[_0x1edf('0x65')][_0x1edf('0x31')]);_0x39f81f['query']=_['keys'](_0x412a0e[_0x1edf('0x34')]);_0x39f81f['filters']=_[_0x1edf('0x36')](_0x39f81f[_0x1edf('0x33')],_0x39f81f[_0x1edf('0x34')]);_0x50273a[_0x1edf('0x37')]=_[_0x1edf('0x36')](_0x39f81f[_0x1edf('0x33')],qs[_0x1edf('0x49')](_0x412a0e['query'][_0x1edf('0x49')]));_0x50273a['attributes']=_0x50273a[_0x1edf('0x37')][_0x1edf('0x4a')]?_0x50273a[_0x1edf('0x37')]:_0x39f81f['model'];if(!_0x412a0e[_0x1edf('0x34')][_0x1edf('0x38')](_0x1edf('0x39'))){_0x50273a[_0x1edf('0x1f')]=qs[_0x1edf('0x1f')](_0x412a0e[_0x1edf('0x34')][_0x1edf('0x1f')]);_0x50273a[_0x1edf('0x21')]=qs[_0x1edf('0x21')](_0x412a0e['query'][_0x1edf('0x21')]);}_0x50273a[_0x1edf('0x5d')]=qs[_0x1edf('0x3a')](_0x412a0e[_0x1edf('0x34')][_0x1edf('0x3a')]);_0x50273a['where']=qs[_0x1edf('0x3b')](_['pick'](_0x412a0e[_0x1edf('0x34')],_0x39f81f[_0x1edf('0x3b')]));_0x50273a['where'][_0x1edf('0x61')]=_0x56e1d3['id'];if(_0x412a0e[_0x1edf('0x34')][_0x1edf('0x40')]){_0x50273a[_0x1edf('0x3d')]=_[_0x1edf('0x3e')](_0x50273a[_0x1edf('0x3d')],{'$or':_[_0x1edf('0x2f')](_0x50273a[_0x1edf('0x37')],function(_0x36cd99){var _0x5bad39={};_0x5bad39[_0x36cd99]={'$like':'%'+_0x412a0e['query']['filter']+'%'};return _0x5bad39;})});}_0x50273a=_[_0x1edf('0x3e')]({},_0x50273a,_0x412a0e[_0x1edf('0x41')]);return db[_0x1edf('0x65')]['count']({'where':_0x50273a[_0x1edf('0x3d')]})['then'](function(_0x5376ef){_0x195497['count']=_0x5376ef;if(_0x412a0e['query']['includeAll']){_0x50273a[_0x1edf('0x43')]=[{'all':!![]}];}return db[_0x1edf('0x65')][_0x1edf('0x44')](_0x50273a);})[_0x1edf('0x27')](function(_0x54d156){_0x195497[_0x1edf('0x45')]=_0x54d156;return _0x195497;});}})['then'](respondWithFilteredResult(_0x1d385d,_0x50273a))[_0x1edf('0x46')](handleError(_0x1d385d,null));};exports[_0x1edf('0x66')]=function(_0xa90e04,_0x13d2a5,_0xc904af){var _0x14a427={};var _0x2cb705={};var _0xb2113a;var _0x1df7e3;return db[_0x1edf('0x30')][_0x1edf('0x5c')]({'where':{'id':_0xa90e04[_0x1edf('0x48')]['id']}})[_0x1edf('0x27')](handleEntityNotFound(_0x13d2a5,null))['then'](function(_0x12e06c){if(_0x12e06c){_0xb2113a=_0x12e06c;_0x2cb705[_0x1edf('0x33')]=_['keys'](db[_0x1edf('0x67')]['rawAttributes']);_0x2cb705[_0x1edf('0x34')]=_[_0x1edf('0x35')](_0xa90e04[_0x1edf('0x34')]);_0x2cb705[_0x1edf('0x3b')]=_[_0x1edf('0x36')](_0x2cb705[_0x1edf('0x33')],_0x2cb705[_0x1edf('0x34')]);_0x14a427[_0x1edf('0x37')]=_[_0x1edf('0x36')](_0x2cb705[_0x1edf('0x33')],qs[_0x1edf('0x49')](_0xa90e04[_0x1edf('0x34')]['fields']));_0x14a427['attributes']=_0x14a427[_0x1edf('0x37')][_0x1edf('0x4a')]?_0x14a427[_0x1edf('0x37')]:_0x2cb705[_0x1edf('0x33')];_0x14a427[_0x1edf('0x5d')]=qs[_0x1edf('0x3a')](_0xa90e04[_0x1edf('0x34')][_0x1edf('0x3a')]);_0x14a427['where']=qs[_0x1edf('0x3b')](_[_0x1edf('0x3c')](_0xa90e04['query'],_0x2cb705['filters']));if(_0xa90e04[_0x1edf('0x34')][_0x1edf('0x40')]){_0x14a427['where']=_[_0x1edf('0x3e')](_0x14a427['where'],{'$or':_[_0x1edf('0x2f')](_0x14a427[_0x1edf('0x37')],function(_0x94fe09){var _0x3c5689={};_0x3c5689[_0x94fe09]={'$like':'%'+_0xa90e04[_0x1edf('0x34')][_0x1edf('0x40')]+'%'};return _0x3c5689;})});}_0x14a427=_[_0x1edf('0x3e')]({},_0x14a427,_0xa90e04['options']);return _0xb2113a[_0x1edf('0x66')](_0x14a427);}})[_0x1edf('0x27')](function(_0x4d0133){if(_0x4d0133){_0x1df7e3=_0x4d0133['length'];if(!_0xa90e04[_0x1edf('0x34')]['hasOwnProperty'](_0x1edf('0x39'))){_0x14a427[_0x1edf('0x1f')]=qs[_0x1edf('0x1f')](_0xa90e04[_0x1edf('0x34')][_0x1edf('0x1f')]);_0x14a427[_0x1edf('0x21')]=qs[_0x1edf('0x21')](_0xa90e04['query'][_0x1edf('0x21')]);}return _0xb2113a[_0x1edf('0x66')](_0x14a427);}})['then'](function(_0x4405ff){if(_0x4405ff){return _0x4405ff?{'count':_0x1df7e3,'rows':_0x4405ff}:null;}})[_0x1edf('0x27')](respondWithResult(_0x13d2a5,null))[_0x1edf('0x46')](handleError(_0x13d2a5,null));};exports[_0x1edf('0x68')]=function(_0x8f8a5d,_0x32746d,_0x1cd881){var _0x3e5620,_0x3fc73d;return db[_0x1edf('0x30')][_0x1edf('0x4e')]({'where':{'id':_0x8f8a5d['params']['id']}})['then'](handleEntityNotFound(_0x32746d,null))['then'](function(_0xa059ab){if(_0xa059ab){_0x3fc73d=_0xa059ab;return _0xa059ab[_0x1edf('0x68')](_0x8f8a5d[_0x1edf('0x57')][_0x1edf('0x69')],_['omit'](_0x8f8a5d[_0x1edf('0x57')],[_0x1edf('0x69'),'id'])||{});}return null;})['spread'](function(_0x5402fd){var _0xafc874;_0x3e5620=_0x5402fd||[];var _0x3997fe=[];if(_0x5402fd){for(var _0x2f36ff=0x0;_0x2f36ff<_0x5402fd[_0x1edf('0x4a')];_0x2f36ff+=0x1){var _0x459192=_0x5402fd[_0x2f36ff][_0x1edf('0x29')]({'plain':!![]});_0x3fc73d[_0x1edf('0x6a')]=_0x8f8a5d[_0x1edf('0x57')]['dialCheckDuplicateType']?_0x8f8a5d['body'][_0x1edf('0x6a')]:_0x3fc73d[_0x1edf('0x6a')];switch(_0x3fc73d['dialCheckDuplicateType']){case _0x1edf('0x6b'):_0xafc874=squel['insert']()[_0x1edf('0x6c')](_0x1edf('0x6d'))['fromQuery']([_0x1edf('0x6e'),_0x1edf('0x6f'),_0x1edf('0x70'),'ListId',_0x1edf('0x61'),_0x1edf('0x55'),_0x1edf('0x56')],squel[_0x1edf('0x71')]()[_0x1edf('0x72')](_0x1edf('0x6e'),_0x1edf('0x6e'))[_0x1edf('0x72')](_0x1edf('0x73'),'scheduledAt')[_0x1edf('0x72')]('id','ContactId')[_0x1edf('0x72')](_0x459192['CmListId']['toString'](),_0x1edf('0x74'))[_0x1edf('0x72')](_0x8f8a5d[_0x1edf('0x48')]['id'][_0x1edf('0x75')](),'CampaignId')[_0x1edf('0x72')](_0x1edf('0x73'),_0x1edf('0x55'))[_0x1edf('0x72')]('NOW()',_0x1edf('0x56'))['from'](_0x1edf('0x76'))[_0x1edf('0x3d')](_0x1edf('0x77'))[_0x1edf('0x3d')](_0x1edf('0x78'),_0x459192['CmListId'][_0x1edf('0x75')]())[_0x1edf('0x3d')](_0x1edf('0x79'))[_0x1edf('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel[_0x1edf('0x71')]()[_0x1edf('0x72')](_0x1edf('0x7a'))[_0x1edf('0x7b')](_0x1edf('0x7c'))[_0x1edf('0x3d')](_0x1edf('0x7d'),_0x8f8a5d[_0x1edf('0x48')]['id']['toString']()))[_0x1edf('0x3d')](_0x1edf('0x7e'),squel[_0x1edf('0x71')]()[_0x1edf('0x72')](_0x1edf('0x7f'))[_0x1edf('0x7b')](_0x1edf('0x6d'))[_0x1edf('0x3d')](_0x1edf('0x7d'),_0x8f8a5d[_0x1edf('0x48')]['id'][_0x1edf('0x75')]())))[_0x1edf('0x75')]();break;case _0x1edf('0x80'):_0xafc874=squel[_0x1edf('0x81')]()[_0x1edf('0x6c')]('cm_hopper')[_0x1edf('0x82')](['phone',_0x1edf('0x6f'),'ContactId',_0x1edf('0x74'),_0x1edf('0x61'),_0x1edf('0x55'),'updatedAt'],squel[_0x1edf('0x71')]()[_0x1edf('0x72')](_0x1edf('0x6e'),'phone')[_0x1edf('0x72')](_0x1edf('0x73'),_0x1edf('0x6f'))[_0x1edf('0x72')]('id','ContactId')[_0x1edf('0x72')](_0x459192['CmListId'][_0x1edf('0x75')](),_0x1edf('0x74'))[_0x1edf('0x72')](_0x8f8a5d[_0x1edf('0x48')]['id'][_0x1edf('0x75')](),_0x1edf('0x61'))[_0x1edf('0x72')]('NOW()',_0x1edf('0x55'))[_0x1edf('0x72')](_0x1edf('0x73'),'updatedAt')[_0x1edf('0x7b')](_0x1edf('0x76'))['where'](_0x1edf('0x77'))[_0x1edf('0x3d')]('ListId\x20=\x20?',_0x459192[_0x1edf('0x83')][_0x1edf('0x75')]())[_0x1edf('0x3d')](_0x1edf('0x79'))[_0x1edf('0x3d')](_0x1edf('0x7e'),squel[_0x1edf('0x71')]()['field'](_0x1edf('0x7f'))[_0x1edf('0x7b')](_0x1edf('0x6d'))[_0x1edf('0x3d')](_0x1edf('0x7d'),_0x8f8a5d[_0x1edf('0x48')]['id'][_0x1edf('0x75')]())))[_0x1edf('0x75')]();break;default:_0xafc874=squel[_0x1edf('0x81')]()[_0x1edf('0x6c')](_0x1edf('0x6d'))[_0x1edf('0x82')]([_0x1edf('0x6e'),'scheduledAt',_0x1edf('0x70'),_0x1edf('0x74'),'CampaignId','createdAt',_0x1edf('0x56')],squel['select']()[_0x1edf('0x72')](_0x1edf('0x6e'),'phone')[_0x1edf('0x72')](_0x1edf('0x73'),_0x1edf('0x6f'))[_0x1edf('0x72')]('id',_0x1edf('0x70'))[_0x1edf('0x72')](_0x459192[_0x1edf('0x83')]['toString'](),_0x1edf('0x74'))[_0x1edf('0x72')](_0x8f8a5d['params']['id'][_0x1edf('0x75')](),'CampaignId')['field']('NOW()',_0x1edf('0x55'))[_0x1edf('0x72')](_0x1edf('0x73'),_0x1edf('0x56'))['from']('cm_contacts')[_0x1edf('0x3d')](_0x1edf('0x77'))[_0x1edf('0x3d')]('ListId\x20=\x20?',_0x459192[_0x1edf('0x83')][_0x1edf('0x75')]())[_0x1edf('0x3d')](_0x1edf('0x79')))[_0x1edf('0x75')]();}_0x3997fe['push'](db[_0x1edf('0x84')]['query'](_0xafc874));}return BPromise['all'](_0x3997fe);}})['then'](function(){return _0x3e5620;})['then'](respondWithResult(_0x32746d,null))['catch'](handleError(_0x32746d,null));};exports[_0x1edf('0x85')]=function(_0x5131f3,_0x560fc8,_0x18e77c){return db['Campaign'][_0x1edf('0x4e')]({'where':{'id':_0x5131f3[_0x1edf('0x48')]['id']}})[_0x1edf('0x27')](handleEntityNotFound(_0x560fc8,null))['then'](function(_0x31af44){if(_0x31af44){return _0x31af44['removeLists'](_0x5131f3[_0x1edf('0x34')]['ids']);}})[_0x1edf('0x27')](function(_0x3a7322){if(_0x3a7322){return db[_0x1edf('0x5e')][_0x1edf('0x28')]({'where':{'ListId':_0x5131f3['query'][_0x1edf('0x69')],'CampaignId':_0x5131f3['params']['id']}})[_0x1edf('0x27')](function(){return _0x3a7322;});}})[_0x1edf('0x27')](respondWithStatusCode(_0x560fc8,null))[_0x1edf('0x46')](handleError(_0x560fc8,null));};exports['getBlackLists']=function(_0x31844e,_0x358dba,_0x329418){var _0x17af59={};var _0x3fb0f0={};var _0x1c02fd;var _0x425bf8;return db['Campaign'][_0x1edf('0x5c')]({'where':{'id':_0x31844e[_0x1edf('0x48')]['id']}})[_0x1edf('0x27')](handleEntityNotFound(_0x358dba,null))['then'](function(_0x59a8fd){if(_0x59a8fd){_0x1c02fd=_0x59a8fd;_0x3fb0f0[_0x1edf('0x33')]=_['keys'](db[_0x1edf('0x67')][_0x1edf('0x31')]);_0x3fb0f0[_0x1edf('0x34')]=_['keys'](_0x31844e[_0x1edf('0x34')]);_0x3fb0f0['filters']=_[_0x1edf('0x36')](_0x3fb0f0[_0x1edf('0x33')],_0x3fb0f0['query']);_0x17af59[_0x1edf('0x37')]=_[_0x1edf('0x36')](_0x3fb0f0[_0x1edf('0x33')],qs[_0x1edf('0x49')](_0x31844e[_0x1edf('0x34')]['fields']));_0x17af59['attributes']=_0x17af59[_0x1edf('0x37')][_0x1edf('0x4a')]?_0x17af59['attributes']:_0x3fb0f0['model'];_0x17af59[_0x1edf('0x5d')]=qs[_0x1edf('0x3a')](_0x31844e[_0x1edf('0x34')][_0x1edf('0x3a')]);_0x17af59[_0x1edf('0x3d')]=qs[_0x1edf('0x3b')](_[_0x1edf('0x3c')](_0x31844e[_0x1edf('0x34')],_0x3fb0f0[_0x1edf('0x3b')]));if(_0x31844e[_0x1edf('0x34')]['filter']){_0x17af59[_0x1edf('0x3d')]=_['merge'](_0x17af59[_0x1edf('0x3d')],{'$or':_[_0x1edf('0x2f')](_0x17af59['attributes'],function(_0x1a56ac){var _0x4a0059={};_0x4a0059[_0x1a56ac]={'$like':'%'+_0x31844e[_0x1edf('0x34')][_0x1edf('0x40')]+'%'};return _0x4a0059;})});}_0x17af59=_[_0x1edf('0x3e')]({},_0x17af59,_0x31844e[_0x1edf('0x41')]);return _0x1c02fd['getBlackLists'](_0x17af59);}})['then'](function(_0x5139cb){if(_0x5139cb){_0x425bf8=_0x5139cb[_0x1edf('0x4a')];if(!_0x31844e[_0x1edf('0x34')][_0x1edf('0x38')](_0x1edf('0x39'))){_0x17af59[_0x1edf('0x1f')]=qs[_0x1edf('0x1f')](_0x31844e[_0x1edf('0x34')][_0x1edf('0x1f')]);_0x17af59['offset']=qs[_0x1edf('0x21')](_0x31844e[_0x1edf('0x34')]['offset']);}return _0x1c02fd[_0x1edf('0x86')](_0x17af59);}})[_0x1edf('0x27')](function(_0xded008){if(_0xded008){return _0xded008?{'count':_0x425bf8,'rows':_0xded008}:null;}})[_0x1edf('0x27')](respondWithResult(_0x358dba,null))['catch'](handleError(_0x358dba,null));};exports['addBlackLists']=function(_0x580558,_0x131bcd,_0x4365c4){var _0x25b495,_0x5576be;return db[_0x1edf('0x30')]['find']({'where':{'id':_0x580558[_0x1edf('0x48')]['id']}})[_0x1edf('0x27')](handleEntityNotFound(_0x131bcd,null))[_0x1edf('0x27')](function(_0x1580c8){if(_0x1580c8){_0x5576be=_0x1580c8;return _0x1580c8[_0x1edf('0x87')](_0x580558[_0x1edf('0x57')][_0x1edf('0x69')],_['omit'](_0x580558[_0x1edf('0x57')],['ids','id'])||{});}return null;})['spread'](function(_0x11f560){var _0x2ae08f;_0x25b495=_0x11f560||[];var _0x35ef47=[];if(_0x11f560){for(var _0x2c872d=0x0;_0x2c872d<_0x11f560[_0x1edf('0x4a')];_0x2c872d+=0x1){var _0x3468c1=_0x11f560[_0x2c872d][_0x1edf('0x29')]({'plain':!![]});_0x2ae08f=squel[_0x1edf('0x81')]()[_0x1edf('0x6c')](_0x1edf('0x88'))[_0x1edf('0x82')]([_0x1edf('0x6e'),_0x1edf('0x70'),_0x1edf('0x74'),'CampaignId',_0x1edf('0x55'),'updatedAt'],squel[_0x1edf('0x71')]()['field']('phone',_0x1edf('0x6e'))['field']('id','ContactId')['field'](_0x3468c1[_0x1edf('0x83')][_0x1edf('0x75')](),_0x1edf('0x74'))[_0x1edf('0x72')](_0x580558[_0x1edf('0x48')]['id']['toString'](),_0x1edf('0x61'))[_0x1edf('0x72')](_0x1edf('0x73'),_0x1edf('0x55'))['field']('NOW()',_0x1edf('0x56'))[_0x1edf('0x7b')](_0x1edf('0x76'))[_0x1edf('0x3d')](_0x1edf('0x77'))[_0x1edf('0x3d')]('ListId\x20=\x20?',_0x3468c1[_0x1edf('0x83')][_0x1edf('0x75')]())[_0x1edf('0x3d')]('phone\x20IS\x20NOT\x20NULL'))[_0x1edf('0x75')]();_0x35ef47[_0x1edf('0x89')](db[_0x1edf('0x84')][_0x1edf('0x34')](_0x2ae08f));}return BPromise[_0x1edf('0x8a')](_0x35ef47);}})[_0x1edf('0x27')](function(){return _0x25b495;})['then'](respondWithResult(_0x131bcd,null))[_0x1edf('0x46')](handleError(_0x131bcd,null));};exports[_0x1edf('0x8b')]=function(_0x2f0028,_0xc33859,_0x34a165){return db[_0x1edf('0x30')][_0x1edf('0x4e')]({'where':{'id':_0x2f0028['params']['id']}})['then'](handleEntityNotFound(_0xc33859,null))['then'](function(_0x26d029){if(_0x26d029){return _0x26d029[_0x1edf('0x8b')](_0x2f0028['query'][_0x1edf('0x69')]);}})[_0x1edf('0x27')](function(_0x15f67b){if(_0x15f67b){return db['CmHopperBlack'][_0x1edf('0x28')]({'where':{'ListId':_0x2f0028[_0x1edf('0x34')][_0x1edf('0x69')],'CampaignId':_0x2f0028['params']['id']}})['then'](function(){return _0x15f67b;});}})[_0x1edf('0x27')](respondWithStatusCode(_0xc33859,null))['catch'](handleError(_0xc33859,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 61727ab..d5e3f38 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(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_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(_0x4ea972,_0xde1d16){var _0x34db41=function(_0x3487ef){while(--_0x3487ef){_0x4ea972['push'](_0x4ea972['shift']());}};_0x34db41(++_0xde1d16);}(_0x7a54,0x106));var _0x47a5=function(_0x937c76,_0x5a1f2d){_0x937c76=_0x937c76-0x0;var _0x1c408f=_0x7a54[_0x937c76];return _0x1c408f;};'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 abafa7e..b50d5eb 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 _0x21a3=['include','model','GetCampaign','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','Campaign','findAll','options','raw','where','attributes','limit','map'];(function(_0x38d7f9,_0x4562bb){var _0x38d3f2=function(_0x53a0a5){while(--_0x53a0a5){_0x38d7f9['push'](_0x38d7f9['shift']());}};_0x38d3f2(++_0x4562bb);}(_0x21a3,0x66));var _0x321a=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x21a3[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0x321a('0x0'));var util=require('util');var moment=require(_0x321a('0x1'));var BPromise=require(_0x321a('0x2'));var rs=require(_0x321a('0x3'));var fs=require('fs');var Redis=require(_0x321a('0x4'));var db=require(_0x321a('0x5'))['db'];var utils=require(_0x321a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x321a('0x7'));var jayson=require(_0x321a('0x8'));var client=jayson[_0x321a('0x9')][_0x321a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f3b81,_0x388901,_0x24a04c){return new BPromise(function(_0x10c1d3,_0xdfd6b8){return client[_0x321a('0xb')](_0x5f3b81,_0x24a04c)[_0x321a('0xc')](function(_0x2c52dc){logger[_0x321a('0xd')](_0x321a('0xe'),_0x388901,_0x321a('0xf'));logger[_0x321a('0x10')](_0x321a('0x11'),_0x388901,'request\x20sent',JSON[_0x321a('0x12')](_0x2c52dc));if(_0x2c52dc[_0x321a('0x13')]){if(_0x2c52dc['error']['code']===0x1f4){logger[_0x321a('0x13')]('Campaign,\x20%s,\x20%s',_0x388901,_0x2c52dc[_0x321a('0x13')][_0x321a('0x14')]);return _0xdfd6b8(_0x2c52dc['error']['message']);}logger[_0x321a('0x13')](_0x321a('0xe'),_0x388901,_0x2c52dc[_0x321a('0x13')][_0x321a('0x14')]);return _0x10c1d3(_0x2c52dc[_0x321a('0x13')][_0x321a('0x14')]);}else{logger[_0x321a('0xd')](_0x321a('0xe'),_0x388901,'request\x20sent');_0x10c1d3(_0x2c52dc[_0x321a('0x15')][_0x321a('0x14')]);}})['catch'](function(_0x45ceb2){logger[_0x321a('0x13')](_0x321a('0xe'),_0x388901,_0x45ceb2);_0xdfd6b8(_0x45ceb2);});});}exports['GetCampaign']=function(_0x5b1810){var _0x464bd7=this;return new Promise(function(_0x35fd6f,_0x58595b){return db[_0x321a('0x16')][_0x321a('0x17')]({'raw':_0x5b1810[_0x321a('0x18')]?_0x5b1810['options'][_0x321a('0x19')]===undefined?!![]:![]:!![],'where':_0x5b1810[_0x321a('0x18')]?_0x5b1810[_0x321a('0x18')][_0x321a('0x1a')]||null:null,'attributes':_0x5b1810[_0x321a('0x18')]?_0x5b1810[_0x321a('0x18')][_0x321a('0x1b')]||null:null,'limit':_0x5b1810[_0x321a('0x18')]?_0x5b1810[_0x321a('0x18')][_0x321a('0x1c')]||null:null,'include':_0x5b1810[_0x321a('0x18')]?_0x5b1810[_0x321a('0x18')]['include']?_[_0x321a('0x1d')](_0x5b1810[_0x321a('0x18')][_0x321a('0x1e')],function(_0x5ae154){return{'model':db[_0x5ae154[_0x321a('0x1f')]],'as':_0x5ae154['as'],'attributes':_0x5ae154[_0x321a('0x1b')],'include':_0x5ae154['include']?_['map'](_0x5ae154[_0x321a('0x1e')],function(_0x5a66c2){return{'model':db[_0x5a66c2[_0x321a('0x1f')]],'as':_0x5a66c2['as'],'attributes':_0x5a66c2[_0x321a('0x1b')],'include':_0x5a66c2[_0x321a('0x1e')]?_[_0x321a('0x1d')](_0x5a66c2[_0x321a('0x1e')],function(_0xdce138){return{'model':db[_0xdce138['model']],'as':_0xdce138['as'],'attributes':_0xdce138['attributes']};}):[]};}):[]};}):[]:[]})[_0x321a('0xc')](function(_0x105216){logger[_0x321a('0xd')]('GetCampaign',_0x5b1810);logger[_0x321a('0x10')](_0x321a('0x20'),_0x5b1810,JSON[_0x321a('0x12')](_0x105216));_0x35fd6f(_0x105216);})['catch'](function(_0x8a09bb){logger[_0x321a('0x13')](_0x321a('0x20'),_0x8a09bb[_0x321a('0x14')],_0x5b1810);_0x58595b(_0x464bd7[_0x321a('0x13')](0x1f4,_0x8a09bb[_0x321a('0x14')]));});});};
\ No newline at end of file
+var _0x8c99=['limit','include','model','map','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCampaign','findAll','options','raw','attributes'];(function(_0x356cd9,_0x425e8a){var _0x4c081d=function(_0x2f3f98){while(--_0x2f3f98){_0x356cd9['push'](_0x356cd9['shift']());}};_0x4c081d(++_0x425e8a);}(_0x8c99,0x1a8));var _0x98c9=function(_0x4ed1d4,_0x512d9a){_0x4ed1d4=_0x4ed1d4-0x0;var _0x28e363=_0x8c99[_0x4ed1d4];return _0x28e363;};'use strict';var _=require(_0x98c9('0x0'));var util=require(_0x98c9('0x1'));var moment=require(_0x98c9('0x2'));var BPromise=require(_0x98c9('0x3'));var rs=require(_0x98c9('0x4'));var fs=require('fs');var Redis=require(_0x98c9('0x5'));var db=require(_0x98c9('0x6'))['db'];var utils=require(_0x98c9('0x7'));var logger=require(_0x98c9('0x8'))(_0x98c9('0x9'));var config=require(_0x98c9('0xa'));var jayson=require(_0x98c9('0xb'));var client=jayson['client'][_0x98c9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ed2b6,_0x538465,_0x4af8a6){return new BPromise(function(_0x5b983e,_0xc789b1){return client[_0x98c9('0xd')](_0x2ed2b6,_0x4af8a6)[_0x98c9('0xe')](function(_0x4052cf){logger[_0x98c9('0xf')](_0x98c9('0x10'),_0x538465,_0x98c9('0x11'));logger[_0x98c9('0x12')](_0x98c9('0x13'),_0x538465,_0x98c9('0x11'),JSON[_0x98c9('0x14')](_0x4052cf));if(_0x4052cf['error']){if(_0x4052cf[_0x98c9('0x15')][_0x98c9('0x16')]===0x1f4){logger[_0x98c9('0x15')](_0x98c9('0x10'),_0x538465,_0x4052cf['error'][_0x98c9('0x17')]);return _0xc789b1(_0x4052cf[_0x98c9('0x15')][_0x98c9('0x17')]);}logger[_0x98c9('0x15')](_0x98c9('0x10'),_0x538465,_0x4052cf['error'][_0x98c9('0x17')]);return _0x5b983e(_0x4052cf[_0x98c9('0x15')][_0x98c9('0x17')]);}else{logger[_0x98c9('0xf')](_0x98c9('0x10'),_0x538465,_0x98c9('0x11'));_0x5b983e(_0x4052cf[_0x98c9('0x18')][_0x98c9('0x17')]);}})[_0x98c9('0x19')](function(_0x2bb8b6){logger[_0x98c9('0x15')](_0x98c9('0x10'),_0x538465,_0x2bb8b6);_0xc789b1(_0x2bb8b6);});});}exports[_0x98c9('0x1a')]=function(_0x39ed74){var _0x534903=this;return new Promise(function(_0x351254,_0x22fe71){return db['Campaign'][_0x98c9('0x1b')]({'raw':_0x39ed74['options']?_0x39ed74[_0x98c9('0x1c')][_0x98c9('0x1d')]===undefined?!![]:![]:!![],'where':_0x39ed74[_0x98c9('0x1c')]?_0x39ed74[_0x98c9('0x1c')]['where']||null:null,'attributes':_0x39ed74[_0x98c9('0x1c')]?_0x39ed74[_0x98c9('0x1c')][_0x98c9('0x1e')]||null:null,'limit':_0x39ed74[_0x98c9('0x1c')]?_0x39ed74['options'][_0x98c9('0x1f')]||null:null,'include':_0x39ed74[_0x98c9('0x1c')]?_0x39ed74[_0x98c9('0x1c')][_0x98c9('0x20')]?_['map'](_0x39ed74['options'][_0x98c9('0x20')],function(_0x4373cc){return{'model':db[_0x4373cc[_0x98c9('0x21')]],'as':_0x4373cc['as'],'attributes':_0x4373cc['attributes'],'include':_0x4373cc['include']?_['map'](_0x4373cc[_0x98c9('0x20')],function(_0x1653e0){return{'model':db[_0x1653e0['model']],'as':_0x1653e0['as'],'attributes':_0x1653e0[_0x98c9('0x1e')],'include':_0x1653e0[_0x98c9('0x20')]?_[_0x98c9('0x22')](_0x1653e0[_0x98c9('0x20')],function(_0x3f503a){return{'model':db[_0x3f503a[_0x98c9('0x21')]],'as':_0x3f503a['as'],'attributes':_0x3f503a['attributes']};}):[]};}):[]};}):[]:[]})[_0x98c9('0xe')](function(_0x361305){logger[_0x98c9('0xf')](_0x98c9('0x1a'),_0x39ed74);logger[_0x98c9('0x12')]('GetCampaign',_0x39ed74,JSON[_0x98c9('0x14')](_0x361305));_0x351254(_0x361305);})[_0x98c9('0x19')](function(_0x58c6e3){logger[_0x98c9('0x15')]('GetCampaign',_0x58c6e3['message'],_0x39ed74);_0x22fe71(_0x534903[_0x98c9('0x15')](0x1f4,_0x58c6e3['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 3f0fb35..ab4de60 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 _0x94cc=['getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','create','post','clone','addLists','addBlackLists','put','/:id','update','delete','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','show','/:id/hoppers','getHoppers'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x94cc,0x133));var _0xc94c=function(_0x54d5db,_0x49c239){_0x54d5db=_0x54d5db-0x0;var _0x38956f=_0x94cc[_0x54d5db];return _0x38956f;};'use strict';var multer=require(_0xc94c('0x0'));var util=require(_0xc94c('0x1'));var path=require(_0xc94c('0x2'));var timeout=require(_0xc94c('0x3'));var express=require('express');var router=express[_0xc94c('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc94c('0x5'));var config=require(_0xc94c('0x6'));var controller=require(_0xc94c('0x7'));router[_0xc94c('0x8')]('/',auth[_0xc94c('0x9')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xc94c('0xa')]);router[_0xc94c('0x8')](_0xc94c('0xb'),auth[_0xc94c('0x9')](),controller[_0xc94c('0xc')]);router[_0xc94c('0x8')]('/:id/hopper_histories',auth[_0xc94c('0x9')](),controller[_0xc94c('0xd')]);router[_0xc94c('0x8')](_0xc94c('0xe'),auth[_0xc94c('0x9')](),controller[_0xc94c('0xf')]);router['get']('/:id/hopper_black',auth[_0xc94c('0x9')](),controller[_0xc94c('0x10')]);router[_0xc94c('0x8')](_0xc94c('0x11'),auth[_0xc94c('0x9')](),controller['getLists']);router['get'](_0xc94c('0x12'),auth['isAuthenticated'](),controller[_0xc94c('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc94c('0x14')]);router[_0xc94c('0x15')]('/:id/clone',auth[_0xc94c('0x9')](),controller[_0xc94c('0x16')]);router[_0xc94c('0x15')](_0xc94c('0x11'),auth[_0xc94c('0x9')](),controller[_0xc94c('0x17')]);router[_0xc94c('0x15')](_0xc94c('0x12'),auth[_0xc94c('0x9')](),controller[_0xc94c('0x18')]);router[_0xc94c('0x19')](_0xc94c('0x1a'),auth[_0xc94c('0x9')](),controller[_0xc94c('0x1b')]);router['delete'](_0xc94c('0x1a'),auth[_0xc94c('0x9')](),controller['destroy']);router[_0xc94c('0x1c')]('/:id/lists',auth['isAuthenticated'](),controller[_0xc94c('0x1d')]);router['delete'](_0xc94c('0x12'),auth[_0xc94c('0x9')](),controller[_0xc94c('0x1e')]);module[_0xc94c('0x1f')]=router;
\ No newline at end of file
+var _0x5a38=['get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','put','delete','destroy','removeLists','removeBlackLists','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller'];(function(_0x5a08dd,_0x244946){var _0x28f5cf=function(_0x53670c){while(--_0x53670c){_0x5a08dd['push'](_0x5a08dd['shift']());}};_0x28f5cf(++_0x244946);}(_0x5a38,0xaf));var _0x85a3=function(_0x19258b,_0x22e850){_0x19258b=_0x19258b-0x0;var _0x5be66a=_0x5a38[_0x19258b];return _0x5be66a;};'use strict';var multer=require(_0x85a3('0x0'));var util=require(_0x85a3('0x1'));var path=require(_0x85a3('0x2'));var timeout=require(_0x85a3('0x3'));var express=require(_0x85a3('0x4'));var router=express[_0x85a3('0x5')]();var fs_extra=require(_0x85a3('0x6'));var auth=require(_0x85a3('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x85a3('0x8'));var controller=require(_0x85a3('0x9'));router[_0x85a3('0xa')]('/',auth[_0x85a3('0xb')](),controller[_0x85a3('0xc')]);router[_0x85a3('0xa')](_0x85a3('0xd'),auth[_0x85a3('0xb')](),controller[_0x85a3('0xe')]);router[_0x85a3('0xa')](_0x85a3('0xf'),auth[_0x85a3('0xb')](),controller[_0x85a3('0x10')]);router[_0x85a3('0xa')](_0x85a3('0x11'),auth[_0x85a3('0xb')](),controller[_0x85a3('0x12')]);router[_0x85a3('0xa')](_0x85a3('0x13'),auth[_0x85a3('0xb')](),controller[_0x85a3('0x14')]);router['get'](_0x85a3('0x15'),auth[_0x85a3('0xb')](),controller[_0x85a3('0x16')]);router['get'](_0x85a3('0x17'),auth[_0x85a3('0xb')](),controller[_0x85a3('0x18')]);router[_0x85a3('0xa')](_0x85a3('0x19'),auth[_0x85a3('0xb')](),controller[_0x85a3('0x1a')]);router[_0x85a3('0x1b')]('/',auth[_0x85a3('0xb')](),controller[_0x85a3('0x1c')]);router[_0x85a3('0x1b')](_0x85a3('0x1d'),auth[_0x85a3('0xb')](),controller[_0x85a3('0x1e')]);router[_0x85a3('0x1b')](_0x85a3('0x17'),auth[_0x85a3('0xb')](),controller[_0x85a3('0x1f')]);router[_0x85a3('0x1b')](_0x85a3('0x19'),auth[_0x85a3('0xb')](),controller['addBlackLists']);router[_0x85a3('0x20')](_0x85a3('0xd'),auth[_0x85a3('0xb')](),controller['update']);router[_0x85a3('0x21')](_0x85a3('0xd'),auth[_0x85a3('0xb')](),controller[_0x85a3('0x22')]);router[_0x85a3('0x21')](_0x85a3('0x17'),auth[_0x85a3('0xb')](),controller[_0x85a3('0x23')]);router[_0x85a3('0x21')](_0x85a3('0x19'),auth[_0x85a3('0xb')](),controller[_0x85a3('0x24')]);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 a27e5f8..aaebbfe 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 _0xdf9a=['getDataValue','sequelize','STRING','TEXT','VIRTUAL'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0xdf9a,0xce));var _0xadf9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdf9a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xadf9('0x0'));module['exports']={'key':{'type':Sequelize[_0xadf9('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xadf9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xadf9('0x3')],'get':function(){return this[_0xadf9('0x4')]('key');}}};
\ No newline at end of file
+var _0x4de7=['sequelize','exports','STRING','VIRTUAL','getDataValue','key'];(function(_0xe1f268,_0x2150ab){var _0x572864=function(_0x4727b0){while(--_0x4727b0){_0xe1f268['push'](_0xe1f268['shift']());}};_0x572864(++_0x2150ab);}(_0x4de7,0x1ce));var _0x74de=function(_0x130f7b,_0x495691){_0x130f7b=_0x130f7b-0x0;var _0x1f2239=_0x4de7[_0x130f7b];return _0x1f2239;};'use strict';var Sequelize=require(_0x74de('0x0'));module[_0x74de('0x1')]={'key':{'type':Sequelize[_0x74de('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x74de('0x3')],'get':function(){return this[_0x74de('0x4')](_0x74de('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 152fd7e..d4ee582 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 _0x3e8e=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','save','update','then','get','CannedAnswers','UserProfileResource','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','filters','filter','where','merge','includeAll','findAll','rows','catch','show','params','length','include','options','find','body','destroy','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x3149c6,_0x54f974){var _0x4f4dc9=function(_0x17a268){while(--_0x17a268){_0x3149c6['push'](_0x3149c6['shift']());}};_0x4f4dc9(++_0x54f974);}(_0x3e8e,0x152));var _0xe3e8=function(_0x54ca2c,_0xcae620){_0x54ca2c=_0x54ca2c-0x0;var _0x60ef93=_0x3e8e[_0x54ca2c];return _0x60ef93;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe3e8('0x0'));var zipdir=require(_0xe3e8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe3e8('0x2'));var moment=require(_0xe3e8('0x3'));var BPromise=require(_0xe3e8('0x4'));var Mustache=require(_0xe3e8('0x5'));var util=require(_0xe3e8('0x6'));var path=require(_0xe3e8('0x7'));var sox=require(_0xe3e8('0x8'));var csv=require('to-csv');var ejs=require(_0xe3e8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe3e8('0xa'));var crypto=require(_0xe3e8('0xb'));var jsforce=require(_0xe3e8('0xc'));var deskjs=require(_0xe3e8('0xd'));var toCsv=require(_0xe3e8('0xe'));var querystring=require(_0xe3e8('0xf'));var Papa=require('papaparse');var Redis=require(_0xe3e8('0x10'));var authService=require(_0xe3e8('0x11'));var qs=require(_0xe3e8('0x12'));var as=require(_0xe3e8('0x13'));var hardwareService=require(_0xe3e8('0x14'));var logger=require(_0xe3e8('0x15'))('api');var utils=require(_0xe3e8('0x16'));var config=require(_0xe3e8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe3e8('0x18'))['db'];function respondWithStatusCode(_0x161edd,_0x4ac162){_0x4ac162=_0x4ac162||0xcc;return function(_0xc07280){if(_0xc07280){return _0x161edd[_0xe3e8('0x19')](_0x4ac162);}return _0x161edd[_0xe3e8('0x1a')](_0x4ac162)[_0xe3e8('0x1b')]();};}function respondWithResult(_0x3253d7,_0xa73cd5){_0xa73cd5=_0xa73cd5||0xc8;return function(_0x26aa3f){if(_0x26aa3f){return _0x3253d7[_0xe3e8('0x1a')](_0xa73cd5)[_0xe3e8('0x1c')](_0x26aa3f);}};}function respondWithFilteredResult(_0x10edb6,_0x2b75f8){return function(_0x446d63){if(_0x446d63){var _0x1aaefd=typeof _0x2b75f8[_0xe3e8('0x1d')]===_0xe3e8('0x1e')&&typeof _0x2b75f8['limit']==='undefined';var _0xb153c3=_0x446d63[_0xe3e8('0x1f')];var _0x514dca=_0x1aaefd?0x0:_0x2b75f8['offset'];var _0x3ed325=_0x1aaefd?_0x446d63[_0xe3e8('0x1f')]:_0x2b75f8[_0xe3e8('0x1d')]+_0x2b75f8[_0xe3e8('0x20')];var _0x52ee86;if(_0x3ed325>=_0xb153c3){_0x3ed325=_0xb153c3;_0x52ee86=0xc8;}else{_0x52ee86=0xce;}_0x10edb6[_0xe3e8('0x1a')](_0x52ee86);return _0x10edb6[_0xe3e8('0x21')](_0xe3e8('0x22'),_0x514dca+'-'+_0x3ed325+'/'+_0xb153c3)[_0xe3e8('0x1c')](_0x446d63);}return null;};}function patchUpdates(_0x1f10e2){return function(_0x11a552){try{jsonpatch['apply'](_0x11a552,_0x1f10e2,!![]);}catch(_0x399da7){return BPromise['reject'](_0x399da7);}return _0x11a552[_0xe3e8('0x23')]();};}function saveUpdates(_0x2c3f2b,_0x3677bf){return function(_0x48d1d1){if(_0x48d1d1){return _0x48d1d1[_0xe3e8('0x24')](_0x2c3f2b)[_0xe3e8('0x25')](function(_0x635db6){return _0x635db6;});}return null;};}function removeEntity(_0x3c318a,_0x4fdedf){return function(_0x550b4b){if(_0x550b4b){return _0x550b4b['destroy']()[_0xe3e8('0x25')](function(){var _0x56372a=_0x550b4b[_0xe3e8('0x26')]({'plain':!![]});var _0xbf8836=_0xe3e8('0x27');return db[_0xe3e8('0x28')]['destroy']({'where':{'type':_0xbf8836,'resourceId':_0x56372a['id']}})[_0xe3e8('0x25')](function(){return _0x550b4b;});})[_0xe3e8('0x25')](function(){_0x3c318a[_0xe3e8('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f1e93,_0x263b9e){return function(_0x4fcfd0){if(!_0x4fcfd0){_0x1f1e93[_0xe3e8('0x19')](0x194);}return _0x4fcfd0;};}function handleError(_0x16b341,_0x2abfb4){_0x2abfb4=_0x2abfb4||0x1f4;return function(_0x1cd936){logger['error'](_0x1cd936[_0xe3e8('0x29')]);if(_0x1cd936['name']){delete _0x1cd936[_0xe3e8('0x2a')];}_0x16b341[_0xe3e8('0x1a')](_0x2abfb4)[_0xe3e8('0x2b')](_0x1cd936);};}exports[_0xe3e8('0x2c')]=function(_0x3a53fc,_0x3ec98){var _0x10c092={},_0x2faa05={},_0x1bd98f={'count':0x0,'rows':[]};var _0x1a7966=_[_0xe3e8('0x2d')](db[_0xe3e8('0x2e')][_0xe3e8('0x2f')],function(_0x396179){return{'name':_0x396179[_0xe3e8('0x30')],'type':_0x396179[_0xe3e8('0x31')][_0xe3e8('0x32')]};});_0x2faa05[_0xe3e8('0x33')]=_[_0xe3e8('0x2d')](_0x1a7966,'name');_0x2faa05[_0xe3e8('0x34')]=_[_0xe3e8('0x35')](_0x3a53fc['query']);_0x2faa05['filters']=_[_0xe3e8('0x36')](_0x2faa05[_0xe3e8('0x33')],_0x2faa05[_0xe3e8('0x34')]);_0x10c092[_0xe3e8('0x37')]=_[_0xe3e8('0x36')](_0x2faa05[_0xe3e8('0x33')],qs['fields'](_0x3a53fc['query'][_0xe3e8('0x38')]));_0x10c092[_0xe3e8('0x37')]=_0x10c092[_0xe3e8('0x37')]['length']?_0x10c092['attributes']:_0x2faa05[_0xe3e8('0x33')];if(!_0x3a53fc[_0xe3e8('0x34')][_0xe3e8('0x39')]('nolimit')){_0x10c092[_0xe3e8('0x20')]=qs['limit'](_0x3a53fc[_0xe3e8('0x34')][_0xe3e8('0x20')]);_0x10c092['offset']=qs[_0xe3e8('0x1d')](_0x3a53fc[_0xe3e8('0x34')][_0xe3e8('0x1d')]);}_0x10c092[_0xe3e8('0x3a')]=qs[_0xe3e8('0x3b')](_0x3a53fc['query'][_0xe3e8('0x3b')]);_0x10c092['where']=qs[_0xe3e8('0x3c')](_['pick'](_0x3a53fc['query'],_0x2faa05['filters']),_0x1a7966);if(_0x3a53fc['query'][_0xe3e8('0x3d')]){_0x10c092[_0xe3e8('0x3e')]=_['merge'](_0x10c092[_0xe3e8('0x3e')],{'$or':[{'key':{'$like':'%'+_0x3a53fc[_0xe3e8('0x34')][_0xe3e8('0x3d')]+'%'}},{'value':{'$like':'%'+_0x3a53fc[_0xe3e8('0x34')][_0xe3e8('0x3d')]+'%'}}]});}_0x10c092=_[_0xe3e8('0x3f')]({},_0x10c092,_0x3a53fc['options']);var _0x33ade0={'where':_0x10c092[_0xe3e8('0x3e')]};return db['CannedAnswer'][_0xe3e8('0x1f')](_0x33ade0)[_0xe3e8('0x25')](function(_0xcaabd4){_0x1bd98f[_0xe3e8('0x1f')]=_0xcaabd4;if(_0x3a53fc[_0xe3e8('0x34')][_0xe3e8('0x40')]){_0x10c092['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xe3e8('0x41')](_0x10c092);})[_0xe3e8('0x25')](function(_0x640a31){_0x1bd98f[_0xe3e8('0x42')]=_0x640a31;return _0x1bd98f;})[_0xe3e8('0x25')](respondWithFilteredResult(_0x3ec98,_0x10c092))[_0xe3e8('0x43')](handleError(_0x3ec98,null));};exports[_0xe3e8('0x44')]=function(_0x458ed5,_0x7d2b24){var _0x3d2565={'raw':!![],'where':{'id':_0x458ed5[_0xe3e8('0x45')]['id']}},_0x56e101={};_0x56e101['model']=_[_0xe3e8('0x35')](db[_0xe3e8('0x2e')]['rawAttributes']);_0x56e101['query']=_[_0xe3e8('0x35')](_0x458ed5['query']);_0x56e101[_0xe3e8('0x3c')]=_[_0xe3e8('0x36')](_0x56e101['model'],_0x56e101[_0xe3e8('0x34')]);_0x3d2565[_0xe3e8('0x37')]=_['intersection'](_0x56e101[_0xe3e8('0x33')],qs[_0xe3e8('0x38')](_0x458ed5[_0xe3e8('0x34')][_0xe3e8('0x38')]));_0x3d2565[_0xe3e8('0x37')]=_0x3d2565[_0xe3e8('0x37')][_0xe3e8('0x46')]?_0x3d2565['attributes']:_0x56e101['model'];if(_0x458ed5['query'][_0xe3e8('0x40')]){_0x3d2565[_0xe3e8('0x47')]=[{'all':!![]}];}_0x3d2565=_[_0xe3e8('0x3f')]({},_0x3d2565,_0x458ed5[_0xe3e8('0x48')]);return db[_0xe3e8('0x2e')][_0xe3e8('0x49')](_0x3d2565)[_0xe3e8('0x25')](handleEntityNotFound(_0x7d2b24,null))[_0xe3e8('0x25')](respondWithResult(_0x7d2b24,null))[_0xe3e8('0x43')](handleError(_0x7d2b24,null));};exports[_0xe3e8('0x24')]=function(_0x1a41ca,_0x4de655){if(_0x1a41ca['body']['id']){delete _0x1a41ca[_0xe3e8('0x4a')]['id'];}return db[_0xe3e8('0x2e')][_0xe3e8('0x49')]({'where':{'id':_0x1a41ca[_0xe3e8('0x45')]['id']}})[_0xe3e8('0x25')](handleEntityNotFound(_0x4de655,null))[_0xe3e8('0x25')](saveUpdates(_0x1a41ca[_0xe3e8('0x4a')],null))[_0xe3e8('0x25')](respondWithResult(_0x4de655,null))[_0xe3e8('0x43')](handleError(_0x4de655,null));};exports[_0xe3e8('0x4b')]=function(_0x2c0d1a,_0xfafff){return db[_0xe3e8('0x2e')][_0xe3e8('0x49')]({'where':{'id':_0x2c0d1a[_0xe3e8('0x45')]['id']}})[_0xe3e8('0x25')](handleEntityNotFound(_0xfafff,null))[_0xe3e8('0x25')](removeEntity(_0xfafff,null))[_0xe3e8('0x43')](handleError(_0xfafff,null));};exports[_0xe3e8('0x4c')]=function(_0x6c0339,_0x3d95a3){var _0x1af860={'key':_0x6c0339[_0xe3e8('0x4a')]['key']};if(_0x6c0339[_0xe3e8('0x4a')][_0xe3e8('0x4d')]){_0x1af860[_0xe3e8('0x4d')]=_0x6c0339[_0xe3e8('0x4a')][_0xe3e8('0x4d')];}else if(_0x6c0339[_0xe3e8('0x4a')][_0xe3e8('0x4e')]){_0x1af860['SmsAccountId']=_0x6c0339['body'][_0xe3e8('0x4e')];}else if(_0x6c0339['body'][_0xe3e8('0x4f')]){_0x1af860[_0xe3e8('0x4f')]=_0x6c0339['body'][_0xe3e8('0x4f')];}else if(_0x6c0339[_0xe3e8('0x4a')][_0xe3e8('0x50')]){_0x1af860['ChatWebsiteId']=_0x6c0339[_0xe3e8('0x4a')][_0xe3e8('0x50')];}return db['CannedAnswer'][_0xe3e8('0x49')]({'where':_0x1af860})[_0xe3e8('0x25')](function(_0x3310b5){if(_0x3310b5){throw new db[(_0xe3e8('0x51'))][(_0xe3e8('0x52'))](_0xe3e8('0x53'));}return db[_0xe3e8('0x2e')]['create'](_0x6c0339[_0xe3e8('0x4a')]);})[_0xe3e8('0x25')](function(_0x5dd140){var _0x40b1de=_0x6c0339[_0xe3e8('0x54')][_0xe3e8('0x26')]({'plain':!![]});if(!_0x40b1de)throw new Error(_0xe3e8('0x55'));if(_0x40b1de[_0xe3e8('0x56')]==='user'){var _0x440371=_0x5dd140[_0xe3e8('0x26')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xe3e8('0x27'),'userProfileId':_0x40b1de[_0xe3e8('0x57')]},'raw':!![]})[_0xe3e8('0x25')](function(_0x2e8f30){if(_0x2e8f30&&_0x2e8f30['autoAssociation']===0x0){return db[_0xe3e8('0x28')][_0xe3e8('0x4c')]({'name':_0x440371['name'],'resourceId':_0x440371['id'],'type':_0x2e8f30[_0xe3e8('0x2a')],'sectionId':_0x2e8f30['id']},{})[_0xe3e8('0x25')](function(){return _0x5dd140;});}else{return _0x5dd140;}})['catch'](function(_0x5a9155){logger[_0xe3e8('0x58')](_0xe3e8('0x59'),_0x5a9155);throw _0x5a9155;});}return _0x5dd140;})[_0xe3e8('0x25')](respondWithResult(_0x3d95a3,0xc9))[_0xe3e8('0x43')](handleError(_0x3d95a3,null));};
\ No newline at end of file
+var _0x1a0f=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','get','CannedAnswers','UserProfileResource','end','name','send','index','map','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','where','filter','merge','options','CannedAnswer','includeAll','findAll','rows','params','find','catch','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x1a0f,0x1ed));var _0xf1a0=function(_0xc08f00,_0x28067f){_0xc08f00=_0xc08f00-0x0;var _0x8649f7=_0x1a0f[_0xc08f00];return _0x8649f7;};'use strict';var emlformat=require(_0xf1a0('0x0'));var rimraf=require(_0xf1a0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf1a0('0x2'));var moment=require(_0xf1a0('0x3'));var BPromise=require(_0xf1a0('0x4'));var Mustache=require(_0xf1a0('0x5'));var util=require('util');var path=require('path');var sox=require(_0xf1a0('0x6'));var csv=require(_0xf1a0('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf1a0('0x8'));var _=require(_0xf1a0('0x9'));var squel=require(_0xf1a0('0xa'));var crypto=require('crypto');var jsforce=require(_0xf1a0('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf1a0('0x7'));var querystring=require(_0xf1a0('0xc'));var Papa=require(_0xf1a0('0xd'));var Redis=require('ioredis');var authService=require(_0xf1a0('0xe'));var qs=require(_0xf1a0('0xf'));var as=require(_0xf1a0('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf1a0('0x11'))(_0xf1a0('0x12'));var utils=require('../../config/utils');var config=require(_0xf1a0('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xf1a0('0x14'))['db'];function respondWithStatusCode(_0x3c3400,_0x44cb04){_0x44cb04=_0x44cb04||0xcc;return function(_0x43fa73){if(_0x43fa73){return _0x3c3400[_0xf1a0('0x15')](_0x44cb04);}return _0x3c3400[_0xf1a0('0x16')](_0x44cb04)['end']();};}function respondWithResult(_0x4676ad,_0x255778){_0x255778=_0x255778||0xc8;return function(_0x15e10c){if(_0x15e10c){return _0x4676ad['status'](_0x255778)['json'](_0x15e10c);}};}function respondWithFilteredResult(_0x55c0f2,_0x27de89){return function(_0x584618){if(_0x584618){var _0x5f2e65=typeof _0x27de89[_0xf1a0('0x17')]===_0xf1a0('0x18')&&typeof _0x27de89['limit']===_0xf1a0('0x18');var _0x55938d=_0x584618[_0xf1a0('0x19')];var _0x38d6ee=_0x5f2e65?0x0:_0x27de89[_0xf1a0('0x17')];var _0x105e65=_0x5f2e65?_0x584618['count']:_0x27de89[_0xf1a0('0x17')]+_0x27de89[_0xf1a0('0x1a')];var _0x2adbb7;if(_0x105e65>=_0x55938d){_0x105e65=_0x55938d;_0x2adbb7=0xc8;}else{_0x2adbb7=0xce;}_0x55c0f2['status'](_0x2adbb7);return _0x55c0f2[_0xf1a0('0x1b')](_0xf1a0('0x1c'),_0x38d6ee+'-'+_0x105e65+'/'+_0x55938d)['json'](_0x584618);}return null;};}function patchUpdates(_0x9f0bce){return function(_0xa3d1e3){try{jsonpatch[_0xf1a0('0x1d')](_0xa3d1e3,_0x9f0bce,!![]);}catch(_0x5f4542){return BPromise[_0xf1a0('0x1e')](_0x5f4542);}return _0xa3d1e3['save']();};}function saveUpdates(_0x2020ec,_0x190236){return function(_0x35ad71){if(_0x35ad71){return _0x35ad71['update'](_0x2020ec)[_0xf1a0('0x1f')](function(_0x3afbd9){return _0x3afbd9;});}return null;};}function removeEntity(_0x1b3270,_0xe4623d){return function(_0x4722fc){if(_0x4722fc){return _0x4722fc[_0xf1a0('0x20')]()[_0xf1a0('0x1f')](function(){var _0x2c2186=_0x4722fc[_0xf1a0('0x21')]({'plain':!![]});var _0x16b632=_0xf1a0('0x22');return db[_0xf1a0('0x23')]['destroy']({'where':{'type':_0x16b632,'resourceId':_0x2c2186['id']}})[_0xf1a0('0x1f')](function(){return _0x4722fc;});})[_0xf1a0('0x1f')](function(){_0x1b3270[_0xf1a0('0x16')](0xcc)[_0xf1a0('0x24')]();});}};}function handleEntityNotFound(_0x26d186,_0x1dd501){return function(_0x29f55a){if(!_0x29f55a){_0x26d186['sendStatus'](0x194);}return _0x29f55a;};}function handleError(_0x5dc1ce,_0x5b5506){_0x5b5506=_0x5b5506||0x1f4;return function(_0x4fcfa6){logger['error'](_0x4fcfa6['stack']);if(_0x4fcfa6[_0xf1a0('0x25')]){delete _0x4fcfa6[_0xf1a0('0x25')];}_0x5dc1ce[_0xf1a0('0x16')](_0x5b5506)[_0xf1a0('0x26')](_0x4fcfa6);};}exports[_0xf1a0('0x27')]=function(_0x16f214,_0x415eb5){var _0x5ef68f={},_0x41f91d={},_0x12afff={'count':0x0,'rows':[]};var _0x250fab=_[_0xf1a0('0x28')](db['CannedAnswer'][_0xf1a0('0x29')],function(_0x408cac){return{'name':_0x408cac['fieldName'],'type':_0x408cac[_0xf1a0('0x2a')][_0xf1a0('0x2b')]};});_0x41f91d['model']=_[_0xf1a0('0x28')](_0x250fab,_0xf1a0('0x25'));_0x41f91d['query']=_[_0xf1a0('0x2c')](_0x16f214[_0xf1a0('0x2d')]);_0x41f91d[_0xf1a0('0x2e')]=_[_0xf1a0('0x2f')](_0x41f91d[_0xf1a0('0x30')],_0x41f91d[_0xf1a0('0x2d')]);_0x5ef68f[_0xf1a0('0x31')]=_[_0xf1a0('0x2f')](_0x41f91d[_0xf1a0('0x30')],qs['fields'](_0x16f214[_0xf1a0('0x2d')][_0xf1a0('0x32')]));_0x5ef68f[_0xf1a0('0x31')]=_0x5ef68f[_0xf1a0('0x31')][_0xf1a0('0x33')]?_0x5ef68f['attributes']:_0x41f91d['model'];if(!_0x16f214[_0xf1a0('0x2d')]['hasOwnProperty'](_0xf1a0('0x34'))){_0x5ef68f['limit']=qs[_0xf1a0('0x1a')](_0x16f214[_0xf1a0('0x2d')][_0xf1a0('0x1a')]);_0x5ef68f['offset']=qs[_0xf1a0('0x17')](_0x16f214[_0xf1a0('0x2d')][_0xf1a0('0x17')]);}_0x5ef68f[_0xf1a0('0x35')]=qs['sort'](_0x16f214[_0xf1a0('0x2d')]['sort']);_0x5ef68f[_0xf1a0('0x36')]=qs['filters'](_['pick'](_0x16f214[_0xf1a0('0x2d')],_0x41f91d[_0xf1a0('0x2e')]),_0x250fab);if(_0x16f214[_0xf1a0('0x2d')][_0xf1a0('0x37')]){_0x5ef68f[_0xf1a0('0x36')]=_[_0xf1a0('0x38')](_0x5ef68f[_0xf1a0('0x36')],{'$or':[{'key':{'$like':'%'+_0x16f214['query'][_0xf1a0('0x37')]+'%'}},{'value':{'$like':'%'+_0x16f214[_0xf1a0('0x2d')]['filter']+'%'}}]});}_0x5ef68f=_[_0xf1a0('0x38')]({},_0x5ef68f,_0x16f214[_0xf1a0('0x39')]);var _0x4c76e2={'where':_0x5ef68f[_0xf1a0('0x36')]};return db[_0xf1a0('0x3a')]['count'](_0x4c76e2)[_0xf1a0('0x1f')](function(_0x4ea119){_0x12afff[_0xf1a0('0x19')]=_0x4ea119;if(_0x16f214[_0xf1a0('0x2d')][_0xf1a0('0x3b')]){_0x5ef68f['include']=[{'all':!![]}];}return db[_0xf1a0('0x3a')][_0xf1a0('0x3c')](_0x5ef68f);})[_0xf1a0('0x1f')](function(_0x367eb9){_0x12afff[_0xf1a0('0x3d')]=_0x367eb9;return _0x12afff;})[_0xf1a0('0x1f')](respondWithFilteredResult(_0x415eb5,_0x5ef68f))['catch'](handleError(_0x415eb5,null));};exports['show']=function(_0x3085be,_0x31983b){var _0x542c1a={'raw':!![],'where':{'id':_0x3085be[_0xf1a0('0x3e')]['id']}},_0x6e92a={};_0x6e92a[_0xf1a0('0x30')]=_['keys'](db[_0xf1a0('0x3a')][_0xf1a0('0x29')]);_0x6e92a[_0xf1a0('0x2d')]=_[_0xf1a0('0x2c')](_0x3085be[_0xf1a0('0x2d')]);_0x6e92a['filters']=_[_0xf1a0('0x2f')](_0x6e92a[_0xf1a0('0x30')],_0x6e92a[_0xf1a0('0x2d')]);_0x542c1a['attributes']=_[_0xf1a0('0x2f')](_0x6e92a[_0xf1a0('0x30')],qs[_0xf1a0('0x32')](_0x3085be['query'][_0xf1a0('0x32')]));_0x542c1a['attributes']=_0x542c1a[_0xf1a0('0x31')][_0xf1a0('0x33')]?_0x542c1a[_0xf1a0('0x31')]:_0x6e92a['model'];if(_0x3085be[_0xf1a0('0x2d')][_0xf1a0('0x3b')]){_0x542c1a['include']=[{'all':!![]}];}_0x542c1a=_[_0xf1a0('0x38')]({},_0x542c1a,_0x3085be[_0xf1a0('0x39')]);return db[_0xf1a0('0x3a')][_0xf1a0('0x3f')](_0x542c1a)['then'](handleEntityNotFound(_0x31983b,null))[_0xf1a0('0x1f')](respondWithResult(_0x31983b,null))[_0xf1a0('0x40')](handleError(_0x31983b,null));};exports[_0xf1a0('0x41')]=function(_0x59ea35,_0x238923){if(_0x59ea35[_0xf1a0('0x42')]['id']){delete _0x59ea35['body']['id'];}return db[_0xf1a0('0x3a')][_0xf1a0('0x3f')]({'where':{'id':_0x59ea35[_0xf1a0('0x3e')]['id']}})[_0xf1a0('0x1f')](handleEntityNotFound(_0x238923,null))[_0xf1a0('0x1f')](saveUpdates(_0x59ea35[_0xf1a0('0x42')],null))[_0xf1a0('0x1f')](respondWithResult(_0x238923,null))[_0xf1a0('0x40')](handleError(_0x238923,null));};exports[_0xf1a0('0x20')]=function(_0x1c5451,_0x12c29d){return db[_0xf1a0('0x3a')][_0xf1a0('0x3f')]({'where':{'id':_0x1c5451[_0xf1a0('0x3e')]['id']}})[_0xf1a0('0x1f')](handleEntityNotFound(_0x12c29d,null))[_0xf1a0('0x1f')](removeEntity(_0x12c29d,null))['catch'](handleError(_0x12c29d,null));};exports[_0xf1a0('0x43')]=function(_0x45960b,_0x53fc21){var _0x4f713e={'key':_0x45960b[_0xf1a0('0x42')][_0xf1a0('0x2b')]};if(_0x45960b['body'][_0xf1a0('0x44')]){_0x4f713e[_0xf1a0('0x44')]=_0x45960b[_0xf1a0('0x42')][_0xf1a0('0x44')];}else if(_0x45960b[_0xf1a0('0x42')]['SmsAccountId']){_0x4f713e[_0xf1a0('0x45')]=_0x45960b[_0xf1a0('0x42')][_0xf1a0('0x45')];}else if(_0x45960b[_0xf1a0('0x42')][_0xf1a0('0x46')]){_0x4f713e['OpenchannelAccountId']=_0x45960b[_0xf1a0('0x42')][_0xf1a0('0x46')];}else if(_0x45960b[_0xf1a0('0x42')][_0xf1a0('0x47')]){_0x4f713e[_0xf1a0('0x47')]=_0x45960b['body'][_0xf1a0('0x47')];}return db[_0xf1a0('0x3a')]['find']({'where':_0x4f713e})[_0xf1a0('0x1f')](function(_0x4adade){if(_0x4adade){throw new db[(_0xf1a0('0x48'))]['ValidationError'](_0xf1a0('0x49'));}return db[_0xf1a0('0x3a')]['create'](_0x45960b[_0xf1a0('0x42')]);})[_0xf1a0('0x1f')](function(_0x1ebd1e){var _0x4b08c8=_0x45960b[_0xf1a0('0x4a')][_0xf1a0('0x21')]({'plain':!![]});if(!_0x4b08c8)throw new Error(_0xf1a0('0x4b'));if(_0x4b08c8[_0xf1a0('0x4c')]==='user'){var _0x243db5=_0x1ebd1e[_0xf1a0('0x21')]({'plain':!![]});return db[_0xf1a0('0x4d')][_0xf1a0('0x3f')]({'where':{'name':_0xf1a0('0x22'),'userProfileId':_0x4b08c8[_0xf1a0('0x4e')]},'raw':!![]})[_0xf1a0('0x1f')](function(_0x438756){if(_0x438756&&_0x438756[_0xf1a0('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x243db5[_0xf1a0('0x25')],'resourceId':_0x243db5['id'],'type':_0x438756['name'],'sectionId':_0x438756['id']},{})[_0xf1a0('0x1f')](function(){return _0x1ebd1e;});}else{return _0x1ebd1e;}})['catch'](function(_0x4c6221){logger[_0xf1a0('0x50')](_0xf1a0('0x51'),_0x4c6221);throw _0x4c6221;});}return _0x1ebd1e;})['then'](respondWithResult(_0x53fc21,0xc9))[_0xf1a0('0x40')](handleError(_0x53fc21,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 46bd1c9..bcbecb2 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 _0x56c8=['CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./cannedAnswer.attributes','exports'];(function(_0x273417,_0x23d212){var _0x3fdfc1=function(_0x5a13f6){while(--_0x5a13f6){_0x273417['push'](_0x273417['shift']());}};_0x3fdfc1(++_0x23d212);}(_0x56c8,0x170));var _0x856c=function(_0x428a54,_0x5f003f){_0x428a54=_0x428a54-0x0;var _0x5d9462=_0x56c8[_0x428a54];return _0x5d9462;};'use strict';var _=require('lodash');var util=require(_0x856c('0x0'));var logger=require(_0x856c('0x1'))(_0x856c('0x2'));var moment=require(_0x856c('0x3'));var BPromise=require(_0x856c('0x4'));var rp=require(_0x856c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x856c('0x6'));var attributes=require(_0x856c('0x7'));module[_0x856c('0x8')]=function(_0x5dce8c,_0x54b3fc){return _0x5dce8c['define'](_0x856c('0x9'),attributes,{'tableName':_0x856c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x856c('0xb'),'collate':_0x856c('0xc')});};
\ No newline at end of file
+var _0xb78f=['path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise'];(function(_0x1e822d,_0x59a706){var _0x4d85b8=function(_0x1a1b64){while(--_0x1a1b64){_0x1e822d['push'](_0x1e822d['shift']());}};_0x4d85b8(++_0x59a706);}(_0xb78f,0x128));var _0xfb78=function(_0x25f1ef,_0x7a9334){_0x25f1ef=_0x25f1ef-0x0;var _0x548661=_0xb78f[_0x25f1ef];return _0x548661;};'use strict';var _=require(_0xfb78('0x0'));var util=require('util');var logger=require(_0xfb78('0x1'))('api');var moment=require(_0xfb78('0x2'));var BPromise=require('bluebird');var rp=require(_0xfb78('0x3'));var fs=require('fs');var path=require(_0xfb78('0x4'));var rimraf=require(_0xfb78('0x5'));var config=require(_0xfb78('0x6'));var attributes=require(_0xfb78('0x7'));module[_0xfb78('0x8')]=function(_0x1d7c51,_0x4409d0){return _0x1d7c51['define'](_0xfb78('0x9'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfb78('0xa'),'collate':_0xfb78('0xb')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 21570e4..e2b9de7 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(_0x576562,_0x2e5c9d){var _0x589e8d=function(_0x5de7e6){while(--_0x5de7e6){_0x576562['push'](_0x576562['shift']());}};_0x589e8d(++_0x2e5c9d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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(_0x1f907c,_0x1a4eca){var _0x2f6001=function(_0x489c7e){while(--_0x489c7e){_0x1f907c['push'](_0x1f907c['shift']());}};_0x2f6001(++_0x1a4eca);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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 bf1445b..688cb92 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 _0x290a=['exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','/:id','show','post','create','put','delete','destroy'];(function(_0x3b1440,_0x493da1){var _0x3c56c5=function(_0x5e656c){while(--_0x5e656c){_0x3b1440['push'](_0x3b1440['shift']());}};_0x3c56c5(++_0x493da1);}(_0x290a,0x9a));var _0xa290=function(_0x3f9e11,_0x12005e){_0x3f9e11=_0x3f9e11-0x0;var _0x548e82=_0x290a[_0x3f9e11];return _0x548e82;};'use strict';var multer=require(_0xa290('0x0'));var util=require('util');var path=require(_0xa290('0x1'));var timeout=require('connect-timeout');var express=require(_0xa290('0x2'));var router=express['Router']();var fs_extra=require(_0xa290('0x3'));var auth=require(_0xa290('0x4'));var interaction=require(_0xa290('0x5'));var config=require('../../config/environment');var controller=require(_0xa290('0x6'));router[_0xa290('0x7')]('/',auth[_0xa290('0x8')](),controller['index']);router[_0xa290('0x7')](_0xa290('0x9'),auth['isAuthenticated'](),controller[_0xa290('0xa')]);router[_0xa290('0xb')]('/',auth[_0xa290('0x8')](),controller[_0xa290('0xc')]);router[_0xa290('0xd')]('/:id',auth[_0xa290('0x8')](),controller['update']);router[_0xa290('0xe')]('/:id',auth[_0xa290('0x8')](),controller[_0xa290('0xf')]);module[_0xa290('0x10')]=router;
\ No newline at end of file
+var _0x1aa0=['exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get','/:id','post','put','update','delete'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x1aa0,0x17b));var _0x01aa=function(_0x1ebd10,_0x4914b4){_0x1ebd10=_0x1ebd10-0x0;var _0x1004d3=_0x1aa0[_0x1ebd10];return _0x1004d3;};'use strict';var multer=require(_0x01aa('0x0'));var util=require('util');var path=require(_0x01aa('0x1'));var timeout=require(_0x01aa('0x2'));var express=require('express');var router=express[_0x01aa('0x3')]();var fs_extra=require(_0x01aa('0x4'));var auth=require(_0x01aa('0x5'));var interaction=require(_0x01aa('0x6'));var config=require(_0x01aa('0x7'));var controller=require(_0x01aa('0x8'));router['get']('/',auth[_0x01aa('0x9')](),controller[_0x01aa('0xa')]);router[_0x01aa('0xb')](_0x01aa('0xc'),auth[_0x01aa('0x9')](),controller['show']);router[_0x01aa('0xd')]('/',auth[_0x01aa('0x9')](),controller['create']);router[_0x01aa('0xe')](_0x01aa('0xc'),auth['isAuthenticated'](),controller[_0x01aa('0xf')]);router[_0x01aa('0x10')](_0x01aa('0xc'),auth[_0x01aa('0x9')](),controller['destroy']);module[_0x01aa('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index b6be1c1..ac827a5 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 _0xdeb7=['exports','DATE','STRING','INTEGER','sequelize'];(function(_0x597bd0,_0x25db46){var _0x97ae53=function(_0xb33418){while(--_0xb33418){_0x597bd0['push'](_0x597bd0['shift']());}};_0x97ae53(++_0x25db46);}(_0xdeb7,0x77));var _0x7deb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdeb7[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x7deb('0x0'));module[_0x7deb('0x1')]={'calldate':{'type':Sequelize[_0x7deb('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x7deb('0x3')]},'src':{'type':Sequelize[_0x7deb('0x3')]},'dst':{'type':Sequelize[_0x7deb('0x3')]},'dcontext':{'type':Sequelize[_0x7deb('0x3')]},'channel':{'type':Sequelize[_0x7deb('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x7deb('0x3')]},'lastdata':{'type':Sequelize[_0x7deb('0x3')]},'duration':{'type':Sequelize[_0x7deb('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x7deb('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x7deb('0x3')]},'amaflags':{'type':Sequelize[_0x7deb('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x7deb('0x3')]},'uniqueid':{'type':Sequelize[_0x7deb('0x3')]},'linkedid':{'type':Sequelize[_0x7deb('0x3')]},'sequence':{'type':Sequelize[_0x7deb('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x7deb('0x3')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xe8cd=['STRING','INTEGER','DATE','1970-01-01\x2000:00:01'];(function(_0x21a361,_0x364fdd){var _0xc220a5=function(_0x2adac6){while(--_0x2adac6){_0x21a361['push'](_0x21a361['shift']());}};_0xc220a5(++_0x364fdd);}(_0xe8cd,0x152));var _0xde8c=function(_0xacb1e2,_0x55e0ab){_0xacb1e2=_0xacb1e2-0x0;var _0x463815=_0xe8cd[_0xacb1e2];return _0x463815;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0xde8c('0x0')],'allowNull':![],'defaultValue':_0xde8c('0x1')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xde8c('0x2')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xde8c('0x2')]},'channel':{'type':Sequelize[_0xde8c('0x2')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xde8c('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xde8c('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xde8c('0x2')]},'uniqueid':{'type':Sequelize[_0xde8c('0x2')]},'linkedid':{'type':Sequelize[_0xde8c('0x2')]},'sequence':{'type':Sequelize[_0xde8c('0x2')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xde8c('0x2')]},'tag':{'type':Sequelize[_0xde8c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 874224e..6abab5f 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 _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','Cdr','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x55ca,0x126));var _0xa55c=function(_0x30c2ae,_0x4c98a2){_0x30c2ae=_0x30c2ae-0x0;var _0x1ee1cc=_0x55ca[_0x30c2ae];return _0x1ee1cc;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['Cdr'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));};
\ No newline at end of file
+var _0x236d=['undefined','limit','count','set','apply','save','update','then','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','create','body','catch','destroy','params','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x2dbf6d,_0x1ed975){var _0x269475=function(_0x217213){while(--_0x217213){_0x2dbf6d['push'](_0x2dbf6d['shift']());}};_0x269475(++_0x1ed975);}(_0x236d,0x7e));var _0xd236=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x236d[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xd236('0x0'));var rimraf=require(_0xd236('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd236('0x2'));var rp=require('request-promise');var moment=require(_0xd236('0x3'));var BPromise=require(_0xd236('0x4'));var Mustache=require(_0xd236('0x5'));var util=require(_0xd236('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xd236('0x7'));var ejs=require(_0xd236('0x8'));var fs=require('fs');var fs_extra=require(_0xd236('0x9'));var _=require(_0xd236('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd236('0xb'));var deskjs=require(_0xd236('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd236('0xd'));var Papa=require(_0xd236('0xe'));var Redis=require('ioredis');var authService=require(_0xd236('0xf'));var qs=require(_0xd236('0x10'));var as=require(_0xd236('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd236('0x12'))(_0xd236('0x13'));var utils=require(_0xd236('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xd236('0x15'));var db=require(_0xd236('0x16'))['db'];function respondWithStatusCode(_0x3d1076,_0x160cb1){_0x160cb1=_0x160cb1||0xcc;return function(_0x21f27b){if(_0x21f27b){return _0x3d1076[_0xd236('0x17')](_0x160cb1);}return _0x3d1076[_0xd236('0x18')](_0x160cb1)[_0xd236('0x19')]();};}function respondWithResult(_0x22435c,_0x3d7465){_0x3d7465=_0x3d7465||0xc8;return function(_0x348734){if(_0x348734){return _0x22435c[_0xd236('0x18')](_0x3d7465)[_0xd236('0x1a')](_0x348734);}};}function respondWithFilteredResult(_0x3b60a7,_0xd851b5){return function(_0x3b2535){if(_0x3b2535){var _0x2a076d=typeof _0xd851b5[_0xd236('0x1b')]===_0xd236('0x1c')&&typeof _0xd851b5[_0xd236('0x1d')]==='undefined';var _0x4f06c6=_0x3b2535[_0xd236('0x1e')];var _0x1b02a5=_0x2a076d?0x0:_0xd851b5['offset'];var _0x11c6ec=_0x2a076d?_0x3b2535[_0xd236('0x1e')]:_0xd851b5[_0xd236('0x1b')]+_0xd851b5['limit'];var _0x355b65;if(_0x11c6ec>=_0x4f06c6){_0x11c6ec=_0x4f06c6;_0x355b65=0xc8;}else{_0x355b65=0xce;}_0x3b60a7[_0xd236('0x18')](_0x355b65);return _0x3b60a7[_0xd236('0x1f')]('Content-Range',_0x1b02a5+'-'+_0x11c6ec+'/'+_0x4f06c6)[_0xd236('0x1a')](_0x3b2535);}return null;};}function patchUpdates(_0x3b0a27){return function(_0x26c758){try{jsonpatch[_0xd236('0x20')](_0x26c758,_0x3b0a27,!![]);}catch(_0x2f512d){return BPromise['reject'](_0x2f512d);}return _0x26c758[_0xd236('0x21')]();};}function saveUpdates(_0x30e7aa,_0x1e4ddb){return function(_0x3d1e4e){if(_0x3d1e4e){return _0x3d1e4e[_0xd236('0x22')](_0x30e7aa)['then'](function(_0x4a35d0){return _0x4a35d0;});}return null;};}function removeEntity(_0x257f27,_0x4be5ac){return function(_0x22924d){if(_0x22924d){return _0x22924d['destroy']()[_0xd236('0x23')](function(){_0x257f27[_0xd236('0x18')](0xcc)[_0xd236('0x19')]();});}};}function handleEntityNotFound(_0x49d822,_0x41049a){return function(_0x339b08){if(!_0x339b08){_0x49d822[_0xd236('0x17')](0x194);}return _0x339b08;};}function handleError(_0x13ba7a,_0x3a30d8){_0x3a30d8=_0x3a30d8||0x1f4;return function(_0x17f927){logger[_0xd236('0x24')](_0x17f927[_0xd236('0x25')]);if(_0x17f927[_0xd236('0x26')]){delete _0x17f927[_0xd236('0x26')];}_0x13ba7a[_0xd236('0x18')](_0x3a30d8)[_0xd236('0x27')](_0x17f927);};}exports[_0xd236('0x28')]=function(_0x23714d,_0x3108f4){var _0x28175d={},_0x436a19={},_0x471ed6={'count':0x0,'rows':[]};var _0x463fc8=_[_0xd236('0x29')](db[_0xd236('0x2a')][_0xd236('0x2b')],function(_0x3c1617){return{'name':_0x3c1617[_0xd236('0x2c')],'type':_0x3c1617[_0xd236('0x2d')][_0xd236('0x2e')]};});_0x436a19[_0xd236('0x2f')]=_[_0xd236('0x29')](_0x463fc8,_0xd236('0x26'));_0x436a19['query']=_[_0xd236('0x30')](_0x23714d['query']);_0x436a19[_0xd236('0x31')]=_[_0xd236('0x32')](_0x436a19[_0xd236('0x2f')],_0x436a19['query']);_0x28175d[_0xd236('0x33')]=_[_0xd236('0x32')](_0x436a19[_0xd236('0x2f')],qs[_0xd236('0x34')](_0x23714d[_0xd236('0x35')][_0xd236('0x34')]));_0x28175d[_0xd236('0x33')]=_0x28175d['attributes'][_0xd236('0x36')]?_0x28175d['attributes']:_0x436a19[_0xd236('0x2f')];if(!_0x23714d['query'][_0xd236('0x37')](_0xd236('0x38'))){_0x28175d[_0xd236('0x1d')]=qs[_0xd236('0x1d')](_0x23714d[_0xd236('0x35')][_0xd236('0x1d')]);_0x28175d[_0xd236('0x1b')]=qs[_0xd236('0x1b')](_0x23714d[_0xd236('0x35')][_0xd236('0x1b')]);}_0x28175d[_0xd236('0x39')]=qs[_0xd236('0x3a')](_0x23714d[_0xd236('0x35')]['sort']);_0x28175d[_0xd236('0x3b')]=qs[_0xd236('0x31')](_[_0xd236('0x3c')](_0x23714d['query'],_0x436a19[_0xd236('0x31')]),_0x463fc8);if(_0x23714d[_0xd236('0x35')][_0xd236('0x3d')]){_0x28175d[_0xd236('0x3b')]=_[_0xd236('0x3e')](_0x28175d[_0xd236('0x3b')],{'$or':_['map'](_0x463fc8,function(_0x696bed){if(_0x696bed[_0xd236('0x2d')]!==_0xd236('0x3f')){var _0x3c798f={};_0x3c798f[_0x696bed[_0xd236('0x26')]]={'$like':'%'+_0x23714d[_0xd236('0x35')]['filter']+'%'};return _0x3c798f;}})});}_0x28175d=_[_0xd236('0x3e')]({},_0x28175d,_0x23714d[_0xd236('0x40')]);var _0x2ba3ae={'where':_0x28175d['where']};return db[_0xd236('0x2a')]['count'](_0x2ba3ae)[_0xd236('0x23')](function(_0x5793bf){_0x471ed6['count']=_0x5793bf;if(_0x23714d[_0xd236('0x35')][_0xd236('0x41')]){_0x28175d[_0xd236('0x42')]=[{'all':!![]}];}return db[_0xd236('0x2a')][_0xd236('0x43')](_0x28175d);})['then'](function(_0x4d0d65){_0x471ed6[_0xd236('0x44')]=_0x4d0d65;return _0x471ed6;})[_0xd236('0x23')](respondWithFilteredResult(_0x3108f4,_0x28175d))['catch'](handleError(_0x3108f4,null));};exports[_0xd236('0x45')]=function(_0x342fd5,_0x2d815b){var _0x55007d={'raw':!![],'where':{'id':_0x342fd5['params']['id']}},_0x58a93a={};_0x58a93a[_0xd236('0x2f')]=_['keys'](db['Cdr'][_0xd236('0x2b')]);_0x58a93a[_0xd236('0x35')]=_[_0xd236('0x30')](_0x342fd5[_0xd236('0x35')]);_0x58a93a[_0xd236('0x31')]=_['intersection'](_0x58a93a['model'],_0x58a93a[_0xd236('0x35')]);_0x55007d[_0xd236('0x33')]=_[_0xd236('0x32')](_0x58a93a[_0xd236('0x2f')],qs[_0xd236('0x34')](_0x342fd5[_0xd236('0x35')]['fields']));_0x55007d[_0xd236('0x33')]=_0x55007d['attributes'][_0xd236('0x36')]?_0x55007d[_0xd236('0x33')]:_0x58a93a['model'];if(_0x342fd5['query']['includeAll']){_0x55007d['include']=[{'all':!![]}];}_0x55007d=_[_0xd236('0x3e')]({},_0x55007d,_0x342fd5[_0xd236('0x40')]);return db[_0xd236('0x2a')][_0xd236('0x46')](_0x55007d)[_0xd236('0x23')](handleEntityNotFound(_0x2d815b,null))['then'](respondWithResult(_0x2d815b,null))['catch'](handleError(_0x2d815b,null));};exports[_0xd236('0x47')]=function(_0x7c0650,_0xbf4ba9){return db[_0xd236('0x2a')][_0xd236('0x47')](_0x7c0650[_0xd236('0x48')],{})['then'](respondWithResult(_0xbf4ba9,0xc9))[_0xd236('0x49')](handleError(_0xbf4ba9,null));};exports['update']=function(_0x223a14,_0x2c8861){if(_0x223a14['body']['id']){delete _0x223a14[_0xd236('0x48')]['id'];}return db[_0xd236('0x2a')]['find']({'where':{'id':_0x223a14['params']['id']}})[_0xd236('0x23')](handleEntityNotFound(_0x2c8861,null))[_0xd236('0x23')](saveUpdates(_0x223a14[_0xd236('0x48')],null))[_0xd236('0x23')](respondWithResult(_0x2c8861,null))['catch'](handleError(_0x2c8861,null));};exports[_0xd236('0x4a')]=function(_0x43c12b,_0x3d8ca6){return db[_0xd236('0x2a')][_0xd236('0x46')]({'where':{'id':_0x43c12b[_0xd236('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3d8ca6,null))['then'](removeEntity(_0x3d8ca6,null))[_0xd236('0x49')](handleError(_0x3d8ca6,null));};exports['describe']=function(_0xa39da6,_0x30c336){return db['Cdr'][_0xd236('0x4c')]()[_0xd236('0x23')](respondWithResult(_0x30c336,null))['catch'](handleError(_0x30c336,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index dc42364..76259b9 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0xa99ff1,_0x4b2416){var _0x4594ba=function(_0x5e547e){while(--_0x5e547e){_0xa99ff1['push'](_0xa99ff1['shift']());}};_0x4594ba(++_0x4b2416);}(_0x7a54,0x106));var _0x47a5=function(_0x2f8df5,_0x23b09e){_0x2f8df5=_0x2f8df5-0x0;var _0x10c3fb=_0x7a54[_0x2f8df5];return _0x10c3fb;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x277ed4,_0x2b0a9e){var _0x280790=function(_0x34daf3){while(--_0x34daf3){_0x277ed4['push'](_0x277ed4['shift']());}};_0x280790(++_0x2b0a9e);}(_0x7a54,0x106));var _0x47a5=function(_0x4e4fe4,_0x5cf4da){_0x4e4fe4=_0x4e4fe4-0x0;var _0xb97609=_0x7a54[_0x4e4fe4];return _0xb97609;};'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 5c9da86..d7a9209 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 _0x9f99=['error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x19e939,_0x301940){var _0x27567c=function(_0x67d3f4){while(--_0x67d3f4){_0x19e939['push'](_0x19e939['shift']());}};_0x27567c(++_0x301940);}(_0x9f99,0x16c));var _0x99f9=function(_0x562844,_0x96767f){_0x562844=_0x562844-0x0;var _0x3d65ae=_0x9f99[_0x562844];return _0x3d65ae;};'use strict';var _=require(_0x99f9('0x0'));var util=require(_0x99f9('0x1'));var moment=require(_0x99f9('0x2'));var BPromise=require(_0x99f9('0x3'));var rs=require(_0x99f9('0x4'));var fs=require('fs');var Redis=require(_0x99f9('0x5'));var db=require(_0x99f9('0x6'))['db'];var utils=require(_0x99f9('0x7'));var logger=require(_0x99f9('0x8'))(_0x99f9('0x9'));var config=require('../../config/environment');var jayson=require(_0x99f9('0xa'));var client=jayson['client'][_0x99f9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13f423,_0x53e259,_0x5e710a){return new BPromise(function(_0x393425,_0x3a83b2){return client[_0x99f9('0xc')](_0x13f423,_0x5e710a)[_0x99f9('0xd')](function(_0x1156c8){logger[_0x99f9('0xe')](_0x99f9('0xf'),_0x53e259,_0x99f9('0x10'));logger[_0x99f9('0x11')](_0x99f9('0x12'),_0x53e259,_0x99f9('0x10'),JSON[_0x99f9('0x13')](_0x1156c8));if(_0x1156c8[_0x99f9('0x14')]){if(_0x1156c8['error'][_0x99f9('0x15')]===0x1f4){logger[_0x99f9('0x14')](_0x99f9('0xf'),_0x53e259,_0x1156c8[_0x99f9('0x14')]['message']);return _0x3a83b2(_0x1156c8[_0x99f9('0x14')]['message']);}logger[_0x99f9('0x14')]('Cdr,\x20%s,\x20%s',_0x53e259,_0x1156c8[_0x99f9('0x14')][_0x99f9('0x16')]);return _0x393425(_0x1156c8[_0x99f9('0x14')][_0x99f9('0x16')]);}else{logger[_0x99f9('0xe')](_0x99f9('0xf'),_0x53e259,'request\x20sent');_0x393425(_0x1156c8[_0x99f9('0x17')][_0x99f9('0x16')]);}})['catch'](function(_0x422cdd){logger[_0x99f9('0x14')](_0x99f9('0xf'),_0x53e259,_0x422cdd);_0x3a83b2(_0x422cdd);});});}
\ No newline at end of file
+var _0xcd90=['stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xcd90,0xec));var _0x0cd9=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xcd90[_0x2bf141];return _0x48277b;};'use strict';var _=require(_0x0cd9('0x0'));var util=require(_0x0cd9('0x1'));var moment=require(_0x0cd9('0x2'));var BPromise=require(_0x0cd9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0cd9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0cd9('0x5'));var logger=require(_0x0cd9('0x6'))(_0x0cd9('0x7'));var config=require(_0x0cd9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0cd9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bc7b8,_0x219a52,_0xcf4ee5){return new BPromise(function(_0x8cb888,_0x387c29){return client[_0x0cd9('0xa')](_0x1bc7b8,_0xcf4ee5)['then'](function(_0x3cab5b){logger[_0x0cd9('0xb')](_0x0cd9('0xc'),_0x219a52,_0x0cd9('0xd'));logger[_0x0cd9('0xe')](_0x0cd9('0xf'),_0x219a52,_0x0cd9('0xd'),JSON[_0x0cd9('0x10')](_0x3cab5b));if(_0x3cab5b['error']){if(_0x3cab5b[_0x0cd9('0x11')][_0x0cd9('0x12')]===0x1f4){logger[_0x0cd9('0x11')]('Cdr,\x20%s,\x20%s',_0x219a52,_0x3cab5b['error']['message']);return _0x387c29(_0x3cab5b[_0x0cd9('0x11')]['message']);}logger[_0x0cd9('0x11')](_0x0cd9('0xc'),_0x219a52,_0x3cab5b[_0x0cd9('0x11')]['message']);return _0x8cb888(_0x3cab5b[_0x0cd9('0x11')][_0x0cd9('0x13')]);}else{logger[_0x0cd9('0xb')](_0x0cd9('0xc'),_0x219a52,_0x0cd9('0xd'));_0x8cb888(_0x3cab5b[_0x0cd9('0x14')][_0x0cd9('0x13')]);}})['catch'](function(_0x13a6de){logger[_0x0cd9('0x11')](_0x0cd9('0xc'),_0x219a52,_0x13a6de);_0x387c29(_0x13a6de);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index b6930d6..e0d44d3 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0xfa2f68,_0x23836e){var _0x252d9a=function(_0x285e61){while(--_0x285e61){_0xfa2f68['push'](_0xfa2f68['shift']());}};_0x252d9a(++_0x23836e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x434467,_0x2c6a75){var _0x5248ba=function(_0x5a3811){while(--_0x5a3811){_0x434467['push'](_0x434467['shift']());}};_0x5248ba(++_0x2c6a75);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index c915b86..6657d57 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 _0x9c85=['exports','INTEGER','noop','STRING','*,*,*,*','sequelize'];(function(_0x278b5f,_0x451f15){var _0xd1251b=function(_0x1e770c){while(--_0x1e770c){_0x278b5f['push'](_0x278b5f['shift']());}};_0xd1251b(++_0x451f15);}(_0x9c85,0xf5));var _0x59c8=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x9c85[_0x4e676e];return _0x336a3c;};'use strict';var Sequelize=require(_0x59c8('0x0'));module[_0x59c8('0x1')]={'priority':{'type':Sequelize[_0x59c8('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x59c8('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x59c8('0x4')]},'interval':{'type':Sequelize[_0x59c8('0x4')],'defaultValue':_0x59c8('0x5')}};
\ No newline at end of file
+var _0xad98=['INTEGER','noop','STRING','sequelize'];(function(_0x4e0f9b,_0x1a7855){var _0x41d7fd=function(_0x431134){while(--_0x431134){_0x4e0f9b['push'](_0x4e0f9b['shift']());}};_0x41d7fd(++_0x1a7855);}(_0xad98,0x1df));var _0x8ad9=function(_0x245f64,_0x4ae342){_0x245f64=_0x245f64-0x0;var _0x3447e0=_0xad98[_0x245f64];return _0x3447e0;};'use strict';var Sequelize=require(_0x8ad9('0x0'));module['exports']={'priority':{'type':Sequelize[_0x8ad9('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8ad9('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x8ad9('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 96e6fad..68fd296 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 _0x44d4=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','count','offset','limit','Content-Range','json','apply','reject','then','destroy','name','send','model','ChatApplication','query','keys','filters','intersection','attributes','fields','include','merge','options','find','update','body','params','catch','eml-format','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x44d4,0x161));var _0x444d=function(_0x5d2dc8,_0x4088bb){_0x5d2dc8=_0x5d2dc8-0x0;var _0x2e6a66=_0x44d4[_0x5d2dc8];return _0x2e6a66;};'use strict';var emlformat=require(_0x444d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x444d('0x1'));var moment=require(_0x444d('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x444d('0x3'));var sox=require(_0x444d('0x4'));var csv=require(_0x444d('0x5'));var ejs=require(_0x444d('0x6'));var fs=require('fs');var fs_extra=require(_0x444d('0x7'));var _=require(_0x444d('0x8'));var squel=require(_0x444d('0x9'));var crypto=require('crypto');var jsforce=require(_0x444d('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x444d('0x5'));var querystring=require(_0x444d('0xb'));var Papa=require(_0x444d('0xc'));var Redis=require(_0x444d('0xd'));var authService=require(_0x444d('0xe'));var qs=require(_0x444d('0xf'));var as=require(_0x444d('0x10'));var hardwareService=require(_0x444d('0x11'));var logger=require(_0x444d('0x12'))(_0x444d('0x13'));var utils=require(_0x444d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x444d('0x15'));var db=require(_0x444d('0x16'))['db'];function respondWithStatusCode(_0x4a997f,_0x11db08){_0x11db08=_0x11db08||0xcc;return function(_0x3a2d03){if(_0x3a2d03){return _0x4a997f[_0x444d('0x17')](_0x11db08);}return _0x4a997f['status'](_0x11db08)[_0x444d('0x18')]();};}function respondWithResult(_0x41b794,_0x390231){_0x390231=_0x390231||0xc8;return function(_0x545a4b){if(_0x545a4b){return _0x41b794[_0x444d('0x19')](_0x390231)['json'](_0x545a4b);}};}function respondWithFilteredResult(_0x40bdbb,_0x43210d){return function(_0x21cbb0){if(_0x21cbb0){var _0x1bd5db=typeof _0x43210d['offset']==='undefined'&&typeof _0x43210d['limit']==='undefined';var _0x1a0e21=_0x21cbb0[_0x444d('0x1a')];var _0x171c35=_0x1bd5db?0x0:_0x43210d['offset'];var _0x54e12a=_0x1bd5db?_0x21cbb0[_0x444d('0x1a')]:_0x43210d[_0x444d('0x1b')]+_0x43210d[_0x444d('0x1c')];var _0x42b26d;if(_0x54e12a>=_0x1a0e21){_0x54e12a=_0x1a0e21;_0x42b26d=0xc8;}else{_0x42b26d=0xce;}_0x40bdbb[_0x444d('0x19')](_0x42b26d);return _0x40bdbb['set'](_0x444d('0x1d'),_0x171c35+'-'+_0x54e12a+'/'+_0x1a0e21)[_0x444d('0x1e')](_0x21cbb0);}return null;};}function patchUpdates(_0x2c0e2a){return function(_0x3bac2f){try{jsonpatch[_0x444d('0x1f')](_0x3bac2f,_0x2c0e2a,!![]);}catch(_0x25e6ae){return BPromise[_0x444d('0x20')](_0x25e6ae);}return _0x3bac2f['save']();};}function saveUpdates(_0x5e071f,_0xe2cd4d){return function(_0x4ef57b){if(_0x4ef57b){return _0x4ef57b['update'](_0x5e071f)[_0x444d('0x21')](function(_0x11563d){return _0x11563d;});}return null;};}function removeEntity(_0x546a9f,_0x5bbc84){return function(_0x17cc83){if(_0x17cc83){return _0x17cc83[_0x444d('0x22')]()[_0x444d('0x21')](function(){_0x546a9f[_0x444d('0x19')](0xcc)[_0x444d('0x18')]();});}};}function handleEntityNotFound(_0x2faf9e,_0x4016b8){return function(_0x394d06){if(!_0x394d06){_0x2faf9e[_0x444d('0x17')](0x194);}return _0x394d06;};}function handleError(_0x49c2fd,_0x5b8f14){_0x5b8f14=_0x5b8f14||0x1f4;return function(_0x240c32){logger['error'](_0x240c32['stack']);if(_0x240c32[_0x444d('0x23')]){delete _0x240c32['name'];}_0x49c2fd[_0x444d('0x19')](_0x5b8f14)[_0x444d('0x24')](_0x240c32);};}exports['show']=function(_0x1f6a96,_0x262fd2){var _0x3a4806={'raw':!![],'where':{'id':_0x1f6a96['params']['id']}},_0xea2b0b={};_0xea2b0b[_0x444d('0x25')]=_['keys'](db[_0x444d('0x26')]['rawAttributes']);_0xea2b0b[_0x444d('0x27')]=_[_0x444d('0x28')](_0x1f6a96[_0x444d('0x27')]);_0xea2b0b[_0x444d('0x29')]=_[_0x444d('0x2a')](_0xea2b0b['model'],_0xea2b0b[_0x444d('0x27')]);_0x3a4806[_0x444d('0x2b')]=_[_0x444d('0x2a')](_0xea2b0b[_0x444d('0x25')],qs[_0x444d('0x2c')](_0x1f6a96[_0x444d('0x27')][_0x444d('0x2c')]));_0x3a4806[_0x444d('0x2b')]=_0x3a4806[_0x444d('0x2b')]['length']?_0x3a4806['attributes']:_0xea2b0b[_0x444d('0x25')];if(_0x1f6a96[_0x444d('0x27')]['includeAll']){_0x3a4806[_0x444d('0x2d')]=[{'all':!![]}];}_0x3a4806=_[_0x444d('0x2e')]({},_0x3a4806,_0x1f6a96[_0x444d('0x2f')]);return db[_0x444d('0x26')][_0x444d('0x30')](_0x3a4806)['then'](handleEntityNotFound(_0x262fd2,null))['then'](respondWithResult(_0x262fd2,null))['catch'](handleError(_0x262fd2,null));};exports[_0x444d('0x31')]=function(_0x3e4658,_0x5935d9){if(_0x3e4658[_0x444d('0x32')]['id']){delete _0x3e4658['body']['id'];}return db[_0x444d('0x26')][_0x444d('0x30')]({'where':{'id':_0x3e4658[_0x444d('0x33')]['id']}})[_0x444d('0x21')](handleEntityNotFound(_0x5935d9,null))[_0x444d('0x21')](saveUpdates(_0x3e4658['body'],null))['then'](respondWithResult(_0x5935d9,null))[_0x444d('0x34')](handleError(_0x5935d9,null));};exports[_0x444d('0x22')]=function(_0x42cfff,_0x2297d3){return db[_0x444d('0x26')][_0x444d('0x30')]({'where':{'id':_0x42cfff[_0x444d('0x33')]['id']}})['then'](handleEntityNotFound(_0x2297d3,null))[_0x444d('0x21')](removeEntity(_0x2297d3,null))[_0x444d('0x34')](handleError(_0x2297d3,null));};
\ No newline at end of file
+var _0x67da=['end','sendStatus','error','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','find','catch','update','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','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/license/util','../../mysqldb','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x67da,0x192));var _0xa67d=function(_0x241fc2,_0xe233db){_0x241fc2=_0x241fc2-0x0;var _0x3b15d9=_0x67da[_0x241fc2];return _0x3b15d9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa67d('0x0'));var zipdir=require(_0xa67d('0x1'));var jsonpatch=require(_0xa67d('0x2'));var rp=require(_0xa67d('0x3'));var moment=require(_0xa67d('0x4'));var BPromise=require(_0xa67d('0x5'));var Mustache=require(_0xa67d('0x6'));var util=require(_0xa67d('0x7'));var path=require(_0xa67d('0x8'));var sox=require(_0xa67d('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa67d('0xa'));var _=require('lodash');var squel=require(_0xa67d('0xb'));var crypto=require(_0xa67d('0xc'));var jsforce=require(_0xa67d('0xd'));var deskjs=require(_0xa67d('0xe'));var toCsv=require(_0xa67d('0xf'));var querystring=require(_0xa67d('0x10'));var Papa=require(_0xa67d('0x11'));var Redis=require(_0xa67d('0x12'));var authService=require(_0xa67d('0x13'));var qs=require(_0xa67d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa67d('0x15'));var logger=require(_0xa67d('0x16'))(_0xa67d('0x17'));var utils=require(_0xa67d('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xa67d('0x19'));var db=require(_0xa67d('0x1a'))['db'];function respondWithStatusCode(_0x560485,_0x4e86f6){_0x4e86f6=_0x4e86f6||0xcc;return function(_0x304ee2){if(_0x304ee2){return _0x560485['sendStatus'](_0x4e86f6);}return _0x560485[_0xa67d('0x1b')](_0x4e86f6)['end']();};}function respondWithResult(_0x5d757b,_0x22dcc7){_0x22dcc7=_0x22dcc7||0xc8;return function(_0x3b99e3){if(_0x3b99e3){return _0x5d757b['status'](_0x22dcc7)[_0xa67d('0x1c')](_0x3b99e3);}};}function respondWithFilteredResult(_0x267a67,_0x1cfe81){return function(_0x288e5f){if(_0x288e5f){var _0x5a47de=typeof _0x1cfe81['offset']==='undefined'&&typeof _0x1cfe81['limit']===_0xa67d('0x1d');var _0x553811=_0x288e5f[_0xa67d('0x1e')];var _0xf8422c=_0x5a47de?0x0:_0x1cfe81[_0xa67d('0x1f')];var _0x1b58c3=_0x5a47de?_0x288e5f[_0xa67d('0x1e')]:_0x1cfe81[_0xa67d('0x1f')]+_0x1cfe81[_0xa67d('0x20')];var _0x5538a5;if(_0x1b58c3>=_0x553811){_0x1b58c3=_0x553811;_0x5538a5=0xc8;}else{_0x5538a5=0xce;}_0x267a67[_0xa67d('0x1b')](_0x5538a5);return _0x267a67[_0xa67d('0x21')](_0xa67d('0x22'),_0xf8422c+'-'+_0x1b58c3+'/'+_0x553811)[_0xa67d('0x1c')](_0x288e5f);}return null;};}function patchUpdates(_0x28f38b){return function(_0x1c3498){try{jsonpatch['apply'](_0x1c3498,_0x28f38b,!![]);}catch(_0x3f1898){return BPromise[_0xa67d('0x23')](_0x3f1898);}return _0x1c3498[_0xa67d('0x24')]();};}function saveUpdates(_0xed6c3e,_0x48f240){return function(_0x276ef7){if(_0x276ef7){return _0x276ef7['update'](_0xed6c3e)[_0xa67d('0x25')](function(_0x415141){return _0x415141;});}return null;};}function removeEntity(_0x46bbc8,_0x9c2935){return function(_0x559009){if(_0x559009){return _0x559009[_0xa67d('0x26')]()[_0xa67d('0x25')](function(){_0x46bbc8['status'](0xcc)[_0xa67d('0x27')]();});}};}function handleEntityNotFound(_0x3dd0b9,_0x2b890c){return function(_0xe0c7b2){if(!_0xe0c7b2){_0x3dd0b9[_0xa67d('0x28')](0x194);}return _0xe0c7b2;};}function handleError(_0x1d6e68,_0x5ef92a){_0x5ef92a=_0x5ef92a||0x1f4;return function(_0x435e56){logger[_0xa67d('0x29')](_0x435e56['stack']);if(_0x435e56[_0xa67d('0x2a')]){delete _0x435e56[_0xa67d('0x2a')];}_0x1d6e68[_0xa67d('0x1b')](_0x5ef92a)[_0xa67d('0x2b')](_0x435e56);};}exports[_0xa67d('0x2c')]=function(_0x8793cf,_0x42c858){var _0xf4fc64={'raw':!![],'where':{'id':_0x8793cf[_0xa67d('0x2d')]['id']}},_0x204f83={};_0x204f83[_0xa67d('0x2e')]=_[_0xa67d('0x2f')](db[_0xa67d('0x30')][_0xa67d('0x31')]);_0x204f83['query']=_[_0xa67d('0x2f')](_0x8793cf[_0xa67d('0x32')]);_0x204f83[_0xa67d('0x33')]=_[_0xa67d('0x34')](_0x204f83[_0xa67d('0x2e')],_0x204f83['query']);_0xf4fc64[_0xa67d('0x35')]=_[_0xa67d('0x34')](_0x204f83[_0xa67d('0x2e')],qs[_0xa67d('0x36')](_0x8793cf[_0xa67d('0x32')][_0xa67d('0x36')]));_0xf4fc64[_0xa67d('0x35')]=_0xf4fc64[_0xa67d('0x35')][_0xa67d('0x37')]?_0xf4fc64[_0xa67d('0x35')]:_0x204f83['model'];if(_0x8793cf[_0xa67d('0x32')]['includeAll']){_0xf4fc64[_0xa67d('0x38')]=[{'all':!![]}];}_0xf4fc64=_[_0xa67d('0x39')]({},_0xf4fc64,_0x8793cf[_0xa67d('0x3a')]);return db['ChatApplication'][_0xa67d('0x3b')](_0xf4fc64)[_0xa67d('0x25')](handleEntityNotFound(_0x42c858,null))[_0xa67d('0x25')](respondWithResult(_0x42c858,null))[_0xa67d('0x3c')](handleError(_0x42c858,null));};exports[_0xa67d('0x3d')]=function(_0x199e8f,_0x4ded76){if(_0x199e8f[_0xa67d('0x3e')]['id']){delete _0x199e8f[_0xa67d('0x3e')]['id'];}return db['ChatApplication']['find']({'where':{'id':_0x199e8f['params']['id']}})[_0xa67d('0x25')](handleEntityNotFound(_0x4ded76,null))['then'](saveUpdates(_0x199e8f[_0xa67d('0x3e')],null))[_0xa67d('0x25')](respondWithResult(_0x4ded76,null))[_0xa67d('0x3c')](handleError(_0x4ded76,null));};exports[_0xa67d('0x26')]=function(_0x35a0a0,_0x44310e){return db[_0xa67d('0x30')][_0xa67d('0x3b')]({'where':{'id':_0x35a0a0[_0xa67d('0x2d')]['id']}})[_0xa67d('0x25')](handleEntityNotFound(_0x44310e,null))[_0xa67d('0x25')](removeEntity(_0x44310e,null))[_0xa67d('0x3c')](handleError(_0x44310e,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 8b9f7ee..d13df6c 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 _0xbef6=['ChatApplication','utf8mb4_unicode_ci','lodash','util','api','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x3fd921,_0x4c4b58){var _0x386b5e=function(_0x96ae3b){while(--_0x96ae3b){_0x3fd921['push'](_0x3fd921['shift']());}};_0x386b5e(++_0x4c4b58);}(_0xbef6,0x1b0));var _0x6bef=function(_0x1c7a24,_0xdca25a){_0x1c7a24=_0x1c7a24-0x0;var _0xde3e84=_0xbef6[_0x1c7a24];return _0xde3e84;};'use strict';var _=require(_0x6bef('0x0'));var util=require(_0x6bef('0x1'));var logger=require('../../config/logger')(_0x6bef('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6bef('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6bef('0x4'));var config=require(_0x6bef('0x5'));var attributes=require('./chatApplication.attributes');module[_0x6bef('0x6')]=function(_0x307f07,_0x5f2fcf){return _0x307f07[_0x6bef('0x7')](_0x6bef('0x8'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x6bef('0x9')});};
\ No newline at end of file
+var _0xf296=['define','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','request-promise','path','../../config/environment','./chatApplication.attributes','exports'];(function(_0x19373c,_0x3eb198){var _0x564519=function(_0x25f53d){while(--_0x25f53d){_0x19373c['push'](_0x19373c['shift']());}};_0x564519(++_0x3eb198);}(_0xf296,0x94));var _0x6f29=function(_0xf458be,_0x1cf158){_0xf458be=_0xf458be-0x0;var _0x52b318=_0xf296[_0xf458be];return _0x52b318;};'use strict';var _=require(_0x6f29('0x0'));var util=require(_0x6f29('0x1'));var logger=require('../../config/logger')(_0x6f29('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6f29('0x3'));var fs=require('fs');var path=require(_0x6f29('0x4'));var rimraf=require('rimraf');var config=require(_0x6f29('0x5'));var attributes=require(_0x6f29('0x6'));module[_0x6f29('0x7')]=function(_0x4f0712,_0x1d9c3f){return _0x4f0712[_0x6f29('0x8')]('ChatApplication',attributes,{'tableName':_0x6f29('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6f29('0xa'),'collate':_0x6f29('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 5f9f832..684b1b5 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 _0xabc8=['rpc','../../config/environment','jayson/promise','client','http','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x1098db,_0x39ba6b){var _0x14f090=function(_0x473ffe){while(--_0x473ffe){_0x1098db['push'](_0x1098db['shift']());}};_0x14f090(++_0x39ba6b);}(_0xabc8,0x1c7));var _0x8abc=function(_0x13524d,_0x505b49){_0x13524d=_0x13524d-0x0;var _0x9918b4=_0xabc8[_0x13524d];return _0x9918b4;};'use strict';var _=require(_0x8abc('0x0'));var util=require(_0x8abc('0x1'));var moment=require(_0x8abc('0x2'));var BPromise=require(_0x8abc('0x3'));var rs=require(_0x8abc('0x4'));var fs=require('fs');var Redis=require(_0x8abc('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8abc('0x6'));var logger=require('../../config/logger')(_0x8abc('0x7'));var config=require(_0x8abc('0x8'));var jayson=require(_0x8abc('0x9'));var client=jayson[_0x8abc('0xa')][_0x8abc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5188de,_0x339162,_0x46f7ec){return new BPromise(function(_0x5eaadd,_0x2b5abf){return client[_0x8abc('0xc')](_0x5188de,_0x46f7ec)[_0x8abc('0xd')](function(_0x460e9b){logger['info'](_0x8abc('0xe'),_0x339162,_0x8abc('0xf'));logger['debug'](_0x8abc('0x10'),_0x339162,'request\x20sent',JSON['stringify'](_0x460e9b));if(_0x460e9b['error']){if(_0x460e9b[_0x8abc('0x11')][_0x8abc('0x12')]===0x1f4){logger['error'](_0x8abc('0xe'),_0x339162,_0x460e9b[_0x8abc('0x11')][_0x8abc('0x13')]);return _0x2b5abf(_0x460e9b[_0x8abc('0x11')][_0x8abc('0x13')]);}logger[_0x8abc('0x11')](_0x8abc('0xe'),_0x339162,_0x460e9b[_0x8abc('0x11')]['message']);return _0x5eaadd(_0x460e9b['error'][_0x8abc('0x13')]);}else{logger[_0x8abc('0x14')]('ChatApplication,\x20%s,\x20%s',_0x339162,_0x8abc('0xf'));_0x5eaadd(_0x460e9b['result'][_0x8abc('0x13')]);}})[_0x8abc('0x15')](function(_0x22cd05){logger[_0x8abc('0x11')]('ChatApplication,\x20%s,\x20%s',_0x339162,_0x22cd05);_0x2b5abf(_0x22cd05);});});}
\ No newline at end of file
+var _0x39be=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x4d2073,_0x37d13c){var _0x132940=function(_0x402e78){while(--_0x402e78){_0x4d2073['push'](_0x4d2073['shift']());}};_0x132940(++_0x37d13c);}(_0x39be,0x83));var _0xe39b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x39be[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe39b('0x0'));var util=require(_0xe39b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe39b('0x2'));var fs=require('fs');var Redis=require(_0xe39b('0x3'));var db=require(_0xe39b('0x4'))['db'];var utils=require(_0xe39b('0x5'));var logger=require(_0xe39b('0x6'))('rpc');var config=require(_0xe39b('0x7'));var jayson=require(_0xe39b('0x8'));var client=jayson['client'][_0xe39b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x126235,_0x5c02bc,_0x59c896){return new BPromise(function(_0xb05a31,_0x76acf1){return client[_0xe39b('0xa')](_0x126235,_0x59c896)[_0xe39b('0xb')](function(_0x24b84e){logger['info'](_0xe39b('0xc'),_0x5c02bc,_0xe39b('0xd'));logger[_0xe39b('0xe')](_0xe39b('0xf'),_0x5c02bc,_0xe39b('0xd'),JSON[_0xe39b('0x10')](_0x24b84e));if(_0x24b84e[_0xe39b('0x11')]){if(_0x24b84e[_0xe39b('0x11')][_0xe39b('0x12')]===0x1f4){logger[_0xe39b('0x11')](_0xe39b('0xc'),_0x5c02bc,_0x24b84e[_0xe39b('0x11')][_0xe39b('0x13')]);return _0x76acf1(_0x24b84e[_0xe39b('0x11')][_0xe39b('0x13')]);}logger[_0xe39b('0x11')](_0xe39b('0xc'),_0x5c02bc,_0x24b84e[_0xe39b('0x11')][_0xe39b('0x13')]);return _0xb05a31(_0x24b84e['error'][_0xe39b('0x13')]);}else{logger['info'](_0xe39b('0xc'),_0x5c02bc,_0xe39b('0xd'));_0xb05a31(_0x24b84e[_0xe39b('0x14')]['message']);}})[_0xe39b('0x15')](function(_0x5d93f5){logger[_0xe39b('0x11')](_0xe39b('0xc'),_0x5c02bc,_0x5d93f5);_0x76acf1(_0x5d93f5);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 9ba2755..4745da5 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 _0x3080=['get','/:id','isAuthenticated','show','update','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x3080,0x1c8));var _0x0308=function(_0x24a91c,_0x1b3580){_0x24a91c=_0x24a91c-0x0;var _0x209a66=_0x3080[_0x24a91c];return _0x209a66;};'use strict';var multer=require('multer');var util=require(_0x0308('0x0'));var path=require('path');var timeout=require(_0x0308('0x1'));var express=require(_0x0308('0x2'));var router=express['Router']();var fs_extra=require(_0x0308('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0308('0x4'));var config=require(_0x0308('0x5'));var controller=require('./chatApplication.controller');router[_0x0308('0x6')](_0x0308('0x7'),auth[_0x0308('0x8')](),controller[_0x0308('0x9')]);router['put'](_0x0308('0x7'),auth['isAuthenticated'](),controller[_0x0308('0xa')]);router[_0x0308('0xb')](_0x0308('0x7'),auth[_0x0308('0x8')](),controller[_0x0308('0xc')]);module[_0x0308('0xd')]=router;
\ No newline at end of file
+var _0x28ce=['util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','/:id','isAuthenticated','delete','exports','multer'];(function(_0x43cd40,_0x5c21d2){var _0x58122c=function(_0x1409ec){while(--_0x1409ec){_0x43cd40['push'](_0x43cd40['shift']());}};_0x58122c(++_0x5c21d2);}(_0x28ce,0x1ee));var _0xe28c=function(_0x45187f,_0x203811){_0x45187f=_0x45187f-0x0;var _0x1f8e4b=_0x28ce[_0x45187f];return _0x1f8e4b;};'use strict';var multer=require(_0xe28c('0x0'));var util=require(_0xe28c('0x1'));var path=require('path');var timeout=require(_0xe28c('0x2'));var express=require('express');var router=express[_0xe28c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe28c('0x4'));var interaction=require(_0xe28c('0x5'));var config=require('../../config/environment');var controller=require(_0xe28c('0x6'));router['get'](_0xe28c('0x7'),auth[_0xe28c('0x8')](),controller['show']);router['put']('/:id',auth[_0xe28c('0x8')](),controller['update']);router[_0xe28c('0x9')](_0xe28c('0x7'),auth[_0xe28c('0x8')](),controller['destroy']);module[_0xe28c('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index df1b610..de55ee4 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 _0xfce5=['STRING','sequelize','exports'];(function(_0x5df3f4,_0xf5a26){var _0x21715b=function(_0x9604fc){while(--_0x9604fc){_0x5df3f4['push'](_0x5df3f4['shift']());}};_0x21715b(++_0xf5a26);}(_0xfce5,0x1d5));var _0x5fce=function(_0x5df3ab,_0x4a0a7e){_0x5df3ab=_0x5df3ab-0x0;var _0x42cce5=_0xfce5[_0x5df3ab];return _0x42cce5;};'use strict';var Sequelize=require(_0x5fce('0x0'));module[_0x5fce('0x1')]={'name':{'type':Sequelize[_0x5fce('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5fce('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0xb1b9=['exports','BOOLEAN'];(function(_0x430a84,_0x9b2ae){var _0x454377=function(_0x34da81){while(--_0x34da81){_0x430a84['push'](_0x430a84['shift']());}};_0x454377(++_0x9b2ae);}(_0xb1b9,0x186));var _0x9b1b=function(_0x2ddc5e,_0x4958ef){_0x2ddc5e=_0x2ddc5e-0x0;var _0xb196a0=_0xb1b9[_0x2ddc5e];return _0xb196a0;};'use strict';var Sequelize=require('sequelize');module[_0x9b1b('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x9b1b('0x1')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 945f825..3417b36 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 _0xe150=['util','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','then','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','findAll','rows','catch','show','includeAll','include','find','create','body','params','destroy','getUnread','user','toInteger','addMembers','getMembers','findOne','User','removeMembers','addMessage','ChatInternalMessage','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','request-promise','moment','mustache'];(function(_0xe9ce81,_0x4d48bb){var _0x27c089=function(_0x27a214){while(--_0x27a214){_0xe9ce81['push'](_0xe9ce81['shift']());}};_0x27c089(++_0x4d48bb);}(_0xe150,0xb3));var _0x0e15=function(_0x3216f5,_0xe32e8a){_0x3216f5=_0x3216f5-0x0;var _0x17035a=_0xe150[_0x3216f5];return _0x17035a;};'use strict';var emlformat=require(_0x0e15('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0e15('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0e15('0x2'));var moment=require(_0x0e15('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0e15('0x4'));var util=require(_0x0e15('0x5'));var path=require(_0x0e15('0x6'));var sox=require('sox');var csv=require(_0x0e15('0x7'));var ejs=require(_0x0e15('0x8'));var fs=require('fs');var fs_extra=require(_0x0e15('0x9'));var _=require('lodash');var squel=require(_0x0e15('0xa'));var crypto=require('crypto');var jsforce=require(_0x0e15('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0e15('0x7'));var querystring=require(_0x0e15('0xc'));var Papa=require(_0x0e15('0xd'));var Redis=require(_0x0e15('0xe'));var authService=require(_0x0e15('0xf'));var qs=require(_0x0e15('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0e15('0x11'));var logger=require(_0x0e15('0x12'))(_0x0e15('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0e15('0x14'));var db=require(_0x0e15('0x15'))['db'];config[_0x0e15('0x16')]=_[_0x0e15('0x17')](config[_0x0e15('0x16')],{'host':_0x0e15('0x18'),'port':0x18eb});var socket=require(_0x0e15('0x19'))(new Redis(config[_0x0e15('0x16')]));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x2b954a,_0x1581ef){_0x1581ef=_0x1581ef||0xcc;return function(_0x32878a){if(_0x32878a){return _0x2b954a[_0x0e15('0x1a')](_0x1581ef);}return _0x2b954a[_0x0e15('0x1b')](_0x1581ef)[_0x0e15('0x1c')]();};}function respondWithResult(_0x42b753,_0x1546f5){_0x1546f5=_0x1546f5||0xc8;return function(_0x5d0025){if(_0x5d0025){return _0x42b753[_0x0e15('0x1b')](_0x1546f5)[_0x0e15('0x1d')](_0x5d0025);}};}function respondWithFilteredResult(_0x178977,_0x5e4c8b){return function(_0x135981){if(_0x135981){var _0x2e5694=typeof _0x5e4c8b[_0x0e15('0x1e')]==='undefined'&&typeof _0x5e4c8b[_0x0e15('0x1f')]===_0x0e15('0x20');var _0x4b1689=_0x135981['count'];var _0x567235=_0x2e5694?0x0:_0x5e4c8b[_0x0e15('0x1e')];var _0x1dad43=_0x2e5694?_0x135981[_0x0e15('0x21')]:_0x5e4c8b[_0x0e15('0x1e')]+_0x5e4c8b[_0x0e15('0x1f')];var _0x1fd86c;if(_0x1dad43>=_0x4b1689){_0x1dad43=_0x4b1689;_0x1fd86c=0xc8;}else{_0x1fd86c=0xce;}_0x178977['status'](_0x1fd86c);return _0x178977[_0x0e15('0x22')](_0x0e15('0x23'),_0x567235+'-'+_0x1dad43+'/'+_0x4b1689)[_0x0e15('0x1d')](_0x135981);}return null;};}function patchUpdates(_0x4360ae){return function(_0x3f412d){try{jsonpatch['apply'](_0x3f412d,_0x4360ae,!![]);}catch(_0x36c841){return BPromise['reject'](_0x36c841);}return _0x3f412d[_0x0e15('0x24')]();};}function saveUpdates(_0x1a5f6c,_0x2e7222){return function(_0x3f4234){if(_0x3f4234){return _0x3f4234[_0x0e15('0x25')](_0x1a5f6c)[_0x0e15('0x26')](function(_0x26453a){return _0x26453a;});}return null;};}function removeEntity(_0x498731,_0x2f524d){return function(_0x876b2b){if(_0x876b2b){return _0x876b2b['destroy']()[_0x0e15('0x26')](function(){_0x498731[_0x0e15('0x1b')](0xcc)[_0x0e15('0x1c')]();});}};}function handleEntityNotFound(_0x26ac88,_0x5bce4d){return function(_0x27759b){if(!_0x27759b){_0x26ac88['sendStatus'](0x194);}return _0x27759b;};}function handleError(_0x4d81f1,_0x2dbe7a){_0x2dbe7a=_0x2dbe7a||0x1f4;return function(_0x10f372){logger['error'](_0x10f372[_0x0e15('0x27')]);if(_0x10f372[_0x0e15('0x28')]){delete _0x10f372[_0x0e15('0x28')];}_0x4d81f1[_0x0e15('0x1b')](_0x2dbe7a)[_0x0e15('0x29')](_0x10f372);};}exports[_0x0e15('0x2a')]=function(_0x445c18,_0x58db16){var _0x122af0={},_0x1cc483={},_0x1f8d35={'count':0x0,'rows':[]};var _0x5ee5a2=_[_0x0e15('0x2b')](db[_0x0e15('0x2c')][_0x0e15('0x2d')],function(_0x599927){return{'name':_0x599927[_0x0e15('0x2e')],'type':_0x599927['type'][_0x0e15('0x2f')]};});_0x1cc483['model']=_[_0x0e15('0x2b')](_0x5ee5a2,'name');_0x1cc483[_0x0e15('0x30')]=_[_0x0e15('0x31')](_0x445c18[_0x0e15('0x30')]);_0x1cc483[_0x0e15('0x32')]=_['intersection'](_0x1cc483[_0x0e15('0x33')],_0x1cc483['query']);_0x122af0[_0x0e15('0x34')]=_[_0x0e15('0x35')](_0x1cc483[_0x0e15('0x33')],qs['fields'](_0x445c18[_0x0e15('0x30')][_0x0e15('0x36')]));_0x122af0[_0x0e15('0x34')]=_0x122af0[_0x0e15('0x34')][_0x0e15('0x37')]?_0x122af0['attributes']:_0x1cc483[_0x0e15('0x33')];if(!_0x445c18[_0x0e15('0x30')][_0x0e15('0x38')](_0x0e15('0x39'))){_0x122af0[_0x0e15('0x1f')]=qs[_0x0e15('0x1f')](_0x445c18[_0x0e15('0x30')][_0x0e15('0x1f')]);_0x122af0[_0x0e15('0x1e')]=qs[_0x0e15('0x1e')](_0x445c18['query'][_0x0e15('0x1e')]);}_0x122af0[_0x0e15('0x3a')]=qs[_0x0e15('0x3b')](_0x445c18['query'][_0x0e15('0x3b')]);_0x122af0['where']=qs[_0x0e15('0x32')](_[_0x0e15('0x3c')](_0x445c18[_0x0e15('0x30')],_0x1cc483[_0x0e15('0x32')]),_0x5ee5a2);if(_0x445c18[_0x0e15('0x30')][_0x0e15('0x3d')]){_0x122af0[_0x0e15('0x3e')]=_[_0x0e15('0x3f')](_0x122af0[_0x0e15('0x3e')],{'$or':_[_0x0e15('0x2b')](_0x5ee5a2,function(_0x59844d){if(_0x59844d[_0x0e15('0x40')]!==_0x0e15('0x41')){var _0x55c928={};_0x55c928[_0x59844d[_0x0e15('0x28')]]={'$like':'%'+_0x445c18[_0x0e15('0x30')][_0x0e15('0x3d')]+'%'};return _0x55c928;}})});}_0x122af0=_['merge']({},_0x122af0,_0x445c18[_0x0e15('0x42')]);var _0x364e19={'where':_0x122af0[_0x0e15('0x3e')]};return db[_0x0e15('0x2c')][_0x0e15('0x21')](_0x364e19)[_0x0e15('0x26')](function(_0x5d1500){_0x1f8d35[_0x0e15('0x21')]=_0x5d1500;if(_0x445c18[_0x0e15('0x30')]['includeAll']){_0x122af0['include']=[{'all':!![]}];}return db[_0x0e15('0x2c')][_0x0e15('0x43')](_0x122af0);})[_0x0e15('0x26')](function(_0x2e3348){_0x1f8d35[_0x0e15('0x44')]=_0x2e3348;return _0x1f8d35;})['then'](respondWithFilteredResult(_0x58db16,_0x122af0))[_0x0e15('0x45')](handleError(_0x58db16,null));};exports[_0x0e15('0x46')]=function(_0x274752,_0x576711){var _0x544994={'raw':!![],'where':{'id':_0x274752['params']['id']}},_0x199de1={};_0x199de1['model']=_[_0x0e15('0x31')](db[_0x0e15('0x2c')][_0x0e15('0x2d')]);_0x199de1[_0x0e15('0x30')]=_['keys'](_0x274752[_0x0e15('0x30')]);_0x199de1[_0x0e15('0x32')]=_[_0x0e15('0x35')](_0x199de1[_0x0e15('0x33')],_0x199de1[_0x0e15('0x30')]);_0x544994[_0x0e15('0x34')]=_[_0x0e15('0x35')](_0x199de1[_0x0e15('0x33')],qs[_0x0e15('0x36')](_0x274752['query'][_0x0e15('0x36')]));_0x544994[_0x0e15('0x34')]=_0x544994['attributes'][_0x0e15('0x37')]?_0x544994['attributes']:_0x199de1[_0x0e15('0x33')];if(_0x274752['query'][_0x0e15('0x47')]){_0x544994[_0x0e15('0x48')]=[{'all':!![]}];}_0x544994=_[_0x0e15('0x3f')]({},_0x544994,_0x274752['options']);return db[_0x0e15('0x2c')][_0x0e15('0x49')](_0x544994)[_0x0e15('0x26')](handleEntityNotFound(_0x576711,null))[_0x0e15('0x26')](respondWithResult(_0x576711,null))['catch'](handleError(_0x576711,null));};exports[_0x0e15('0x4a')]=function(_0x51951f,_0x491428){return db[_0x0e15('0x2c')][_0x0e15('0x4a')](_0x51951f[_0x0e15('0x4b')],{})[_0x0e15('0x26')](respondWithResult(_0x491428,0xc9))[_0x0e15('0x45')](handleError(_0x491428,null));};exports[_0x0e15('0x25')]=function(_0x4b64ea,_0x43ea03){if(_0x4b64ea[_0x0e15('0x4b')]['id']){delete _0x4b64ea[_0x0e15('0x4b')]['id'];}return db[_0x0e15('0x2c')][_0x0e15('0x49')]({'where':{'id':_0x4b64ea[_0x0e15('0x4c')]['id']}})[_0x0e15('0x26')](handleEntityNotFound(_0x43ea03,null))[_0x0e15('0x26')](saveUpdates(_0x4b64ea[_0x0e15('0x4b')],null))[_0x0e15('0x26')](respondWithResult(_0x43ea03,null))['catch'](handleError(_0x43ea03,null));};exports[_0x0e15('0x4d')]=function(_0x349454,_0x2b945c){return db[_0x0e15('0x2c')][_0x0e15('0x49')]({'where':{'id':_0x349454[_0x0e15('0x4c')]['id']}})[_0x0e15('0x26')](handleEntityNotFound(_0x2b945c,null))[_0x0e15('0x26')](removeEntity(_0x2b945c,null))[_0x0e15('0x45')](handleError(_0x2b945c,null));};exports['describe']=function(_0x3e4d92,_0x164da4){return db[_0x0e15('0x2c')]['describe']()[_0x0e15('0x26')](respondWithResult(_0x164da4,null))[_0x0e15('0x45')](handleError(_0x164da4,null));};exports[_0x0e15('0x4e')]=function(_0x51d38d,_0x5e9a52,_0x494299){return db['ChatInternalMessage'][_0x0e15('0x21')]({'where':{'ChatGroupId':_0x51d38d['params']['id'],'ToId':_0x51d38d[_0x0e15('0x4f')]['id'],'read':![]}})[_0x0e15('0x26')](function(_0x41df40){return{'id':_[_0x0e15('0x50')](_0x51d38d['params']['id']),'count':_0x41df40};})[_0x0e15('0x26')](respondWithResult(_0x5e9a52,null))['catch'](handleError(_0x5e9a52,null));};exports[_0x0e15('0x51')]=function(_0x13a459,_0x1b1e84,_0x44d177){return db[_0x0e15('0x2c')][_0x0e15('0x49')]({'where':{'id':_0x13a459['params']['id']}})[_0x0e15('0x26')](handleEntityNotFound(_0x1b1e84,null))[_0x0e15('0x26')](function(_0x419492){if(_0x419492){return _0x419492['addMembers'](_0x13a459[_0x0e15('0x4b')]['ids'],_['omit'](_0x13a459['body'],['ids','id'])||{});}})[_0x0e15('0x26')](respondWithResult(_0x1b1e84,null))[_0x0e15('0x45')](handleError(_0x1b1e84,null));};exports[_0x0e15('0x52')]=function(_0x2bc9d8,_0x47cd83,_0x553a75){var _0x28e917={};var _0x2efb3e={};var _0x31f10c;var _0xe828ac;return db[_0x0e15('0x2c')][_0x0e15('0x53')]({'where':{'id':_0x2bc9d8['params']['id']}})['then'](handleEntityNotFound(_0x47cd83,null))[_0x0e15('0x26')](function(_0x1c11e5){if(_0x1c11e5){_0x31f10c=_0x1c11e5;_0x2efb3e['model']=_[_0x0e15('0x31')](db[_0x0e15('0x54')][_0x0e15('0x2d')]);_0x2efb3e[_0x0e15('0x30')]=_[_0x0e15('0x31')](_0x2bc9d8['query']);_0x2efb3e['filters']=_[_0x0e15('0x35')](_0x2efb3e[_0x0e15('0x33')],_0x2efb3e[_0x0e15('0x30')]);_0x28e917[_0x0e15('0x34')]=_[_0x0e15('0x35')](_0x2efb3e[_0x0e15('0x33')],qs['fields'](_0x2bc9d8[_0x0e15('0x30')][_0x0e15('0x36')]));_0x28e917[_0x0e15('0x34')]=_0x28e917[_0x0e15('0x34')][_0x0e15('0x37')]?_0x28e917[_0x0e15('0x34')]:_0x2efb3e[_0x0e15('0x33')];_0x28e917['order']=qs[_0x0e15('0x3b')](_0x2bc9d8[_0x0e15('0x30')][_0x0e15('0x3b')]);_0x28e917[_0x0e15('0x3e')]=qs[_0x0e15('0x32')](_[_0x0e15('0x3c')](_0x2bc9d8[_0x0e15('0x30')],_0x2efb3e[_0x0e15('0x32')]));if(_0x2bc9d8[_0x0e15('0x30')][_0x0e15('0x3d')]){_0x28e917[_0x0e15('0x3e')]=_[_0x0e15('0x3f')](_0x28e917[_0x0e15('0x3e')],{'$or':_['map'](_0x28e917['attributes'],function(_0x50f21d){var _0x31c5cf={};_0x31c5cf[_0x50f21d]={'$like':'%'+_0x2bc9d8['query'][_0x0e15('0x3d')]+'%'};return _0x31c5cf;})});}_0x28e917=_['merge']({},_0x28e917,_0x2bc9d8[_0x0e15('0x42')]);return _0x31f10c[_0x0e15('0x52')](_0x28e917);}})[_0x0e15('0x26')](function(_0x5acc18){if(_0x5acc18){_0xe828ac=_0x5acc18['length'];if(!_0x2bc9d8['query'][_0x0e15('0x38')](_0x0e15('0x39'))){_0x28e917[_0x0e15('0x1f')]=qs[_0x0e15('0x1f')](_0x2bc9d8['query'][_0x0e15('0x1f')]);_0x28e917[_0x0e15('0x1e')]=qs[_0x0e15('0x1e')](_0x2bc9d8['query']['offset']);}return _0x31f10c[_0x0e15('0x52')](_0x28e917);}})['then'](function(_0x3d3dae){if(_0x3d3dae){return _0x3d3dae?{'count':_0xe828ac,'rows':_0x3d3dae}:null;}})[_0x0e15('0x26')](respondWithResult(_0x47cd83,null))[_0x0e15('0x45')](handleError(_0x47cd83,null));};exports[_0x0e15('0x55')]=function(_0x54581e,_0x391078,_0x1ffad2){return db[_0x0e15('0x2c')][_0x0e15('0x49')]({'where':{'id':_0x54581e['params']['id']}})['then'](handleEntityNotFound(_0x391078,null))['then'](function(_0x3406ea){if(_0x3406ea){return _0x3406ea['removeMembers'](_0x54581e['query']['ids']);}})[_0x0e15('0x26')](respondWithStatusCode(_0x391078,null))[_0x0e15('0x45')](handleError(_0x391078,null));};exports[_0x0e15('0x56')]=function(_0x411f94,_0x50e23e,_0x175768){if(_0x411f94[_0x0e15('0x4b')]['id']){delete _0x411f94['body']['id'];}return db['ChatGroup']['find']({'where':{'id':_0x411f94[_0x0e15('0x4c')]['id']}})[_0x0e15('0x26')](handleEntityNotFound(_0x50e23e,null))[_0x0e15('0x26')](function(_0xfc4930){if(_0xfc4930){_0x411f94[_0x0e15('0x4b')]['ChatGroupId']=_0xfc4930['id'];return db[_0x0e15('0x57')]['create'](_0x411f94[_0x0e15('0x4b')]);}})[_0x0e15('0x26')](respondWithResult(_0x50e23e,null))['catch'](handleError(_0x50e23e,null));};exports[_0x0e15('0x58')]=function(_0x31c1c0,_0x1f54c3,_0x3e069f){var _0x3cacd3={};var _0x40e03e={};var _0xa9f77a;var _0xfbe72d;return db[_0x0e15('0x2c')]['findOne']({'where':{'id':_0x31c1c0['params']['id']}})[_0x0e15('0x26')](handleEntityNotFound(_0x1f54c3,null))[_0x0e15('0x26')](function(_0x5b6722){if(_0x5b6722){_0xa9f77a=_0x5b6722;_0x40e03e['model']=_['keys'](db[_0x0e15('0x57')]['rawAttributes']);_0x40e03e['query']=_[_0x0e15('0x31')](_0x31c1c0['query']);_0x40e03e[_0x0e15('0x32')]=_['intersection'](_0x40e03e[_0x0e15('0x33')],_0x40e03e[_0x0e15('0x30')]);_0x3cacd3[_0x0e15('0x34')]=_[_0x0e15('0x35')](_0x40e03e[_0x0e15('0x33')],qs[_0x0e15('0x36')](_0x31c1c0['query'][_0x0e15('0x36')]));_0x3cacd3['attributes']=_0x3cacd3[_0x0e15('0x34')][_0x0e15('0x37')]?_0x3cacd3[_0x0e15('0x34')]:_0x40e03e[_0x0e15('0x33')];_0x3cacd3[_0x0e15('0x3a')]=qs[_0x0e15('0x3b')](_0x31c1c0[_0x0e15('0x30')][_0x0e15('0x3b')]);_0x3cacd3[_0x0e15('0x3e')]=qs[_0x0e15('0x32')](_['pick'](_0x31c1c0[_0x0e15('0x30')],_0x40e03e[_0x0e15('0x32')]));if(_0x31c1c0[_0x0e15('0x30')][_0x0e15('0x3d')]){_0x3cacd3[_0x0e15('0x3e')]=_['merge'](_0x3cacd3[_0x0e15('0x3e')],{'$or':_[_0x0e15('0x2b')](_0x3cacd3['attributes'],function(_0x459b61){var _0xeab4e3={};_0xeab4e3[_0x459b61]={'$like':'%'+_0x31c1c0['query'][_0x0e15('0x3d')]+'%'};return _0xeab4e3;})});}if(_0x31c1c0[_0x0e15('0x30')][_0x0e15('0x59')]){var _0x234b23=_0x31c1c0[_0x0e15('0x30')][_0x0e15('0x59')]['split'](',');var _0x1ae245={};_0x1ae245[_0x234b23[0x0]]={'$gte':moment(_0x234b23[0x1])[_0x0e15('0x5a')](_0x0e15('0x5b'))};_0x3cacd3[_0x0e15('0x3e')]=_['merge'](_0x3cacd3[_0x0e15('0x3e')],_0x1ae245);}_0x3cacd3=_[_0x0e15('0x3f')]({},_0x3cacd3,_0x31c1c0[_0x0e15('0x42')]);return _0xa9f77a[_0x0e15('0x58')](_0x3cacd3);}})['then'](function(_0x29f4ba){if(_0x29f4ba){_0xfbe72d=_0x29f4ba[_0x0e15('0x37')];if(!_0x31c1c0[_0x0e15('0x30')][_0x0e15('0x38')](_0x0e15('0x39'))){_0x3cacd3[_0x0e15('0x1f')]=qs[_0x0e15('0x1f')](_0x31c1c0[_0x0e15('0x30')][_0x0e15('0x1f')]);_0x3cacd3[_0x0e15('0x1e')]=qs[_0x0e15('0x1e')](_0x31c1c0['query'][_0x0e15('0x1e')]);}return _0xa9f77a[_0x0e15('0x58')](_0x3cacd3);}})['then'](function(_0x605dcf){if(_0x605dcf){return _0x605dcf?{'count':_0xfbe72d,'rows':_0x605dcf}:null;}})[_0x0e15('0x26')](respondWithResult(_0x1f54c3,null))['catch'](handleError(_0x1f54c3,null));};
\ No newline at end of file
+var _0x039a=['VIRTUAL','options','include','rows','catch','show','params','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','getMembers','findOne','order','removeMembers','ids','addMessage','ChatGroupId','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./chatGroup.socket','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','name','send','map','ChatGroup','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type'];(function(_0x14a8c3,_0x3c7e62){var _0x3c1898=function(_0x1581f9){while(--_0x1581f9){_0x14a8c3['push'](_0x14a8c3['shift']());}};_0x3c1898(++_0x3c7e62);}(_0x039a,0x78));var _0xa039=function(_0x44e4f8,_0x4af8bd){_0x44e4f8=_0x44e4f8-0x0;var _0x310967=_0x039a[_0x44e4f8];return _0x310967;};'use strict';var emlformat=require(_0xa039('0x0'));var rimraf=require(_0xa039('0x1'));var zipdir=require(_0xa039('0x2'));var jsonpatch=require(_0xa039('0x3'));var rp=require(_0xa039('0x4'));var moment=require(_0xa039('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa039('0x6'));var util=require(_0xa039('0x7'));var path=require(_0xa039('0x8'));var sox=require('sox');var csv=require(_0xa039('0x9'));var ejs=require(_0xa039('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa039('0xb'));var squel=require(_0xa039('0xc'));var crypto=require('crypto');var jsforce=require(_0xa039('0xd'));var deskjs=require(_0xa039('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa039('0xf'));var Papa=require('papaparse');var Redis=require(_0xa039('0x10'));var authService=require(_0xa039('0x11'));var qs=require(_0xa039('0x12'));var as=require(_0xa039('0x13'));var hardwareService=require(_0xa039('0x14'));var logger=require(_0xa039('0x15'))(_0xa039('0x16'));var utils=require(_0xa039('0x17'));var config=require(_0xa039('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xa039('0x19'))['db'];config[_0xa039('0x1a')]=_[_0xa039('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa039('0x1a')]));require(_0xa039('0x1c'))['register'](socket);function respondWithStatusCode(_0x3b09ba,_0x205a3f){_0x205a3f=_0x205a3f||0xcc;return function(_0x47585b){if(_0x47585b){return _0x3b09ba[_0xa039('0x1d')](_0x205a3f);}return _0x3b09ba[_0xa039('0x1e')](_0x205a3f)[_0xa039('0x1f')]();};}function respondWithResult(_0x21a2d8,_0x341d5b){_0x341d5b=_0x341d5b||0xc8;return function(_0x28e341){if(_0x28e341){return _0x21a2d8[_0xa039('0x1e')](_0x341d5b)[_0xa039('0x20')](_0x28e341);}};}function respondWithFilteredResult(_0x2ee7f5,_0x2d2a6f){return function(_0x2912c5){if(_0x2912c5){var _0x420835=typeof _0x2d2a6f[_0xa039('0x21')]===_0xa039('0x22')&&typeof _0x2d2a6f[_0xa039('0x23')]===_0xa039('0x22');var _0x168038=_0x2912c5['count'];var _0x3cec19=_0x420835?0x0:_0x2d2a6f[_0xa039('0x21')];var _0x471a0c=_0x420835?_0x2912c5[_0xa039('0x24')]:_0x2d2a6f['offset']+_0x2d2a6f[_0xa039('0x23')];var _0x53029c;if(_0x471a0c>=_0x168038){_0x471a0c=_0x168038;_0x53029c=0xc8;}else{_0x53029c=0xce;}_0x2ee7f5[_0xa039('0x1e')](_0x53029c);return _0x2ee7f5['set'](_0xa039('0x25'),_0x3cec19+'-'+_0x471a0c+'/'+_0x168038)[_0xa039('0x20')](_0x2912c5);}return null;};}function patchUpdates(_0x27b70f){return function(_0x27e759){try{jsonpatch[_0xa039('0x26')](_0x27e759,_0x27b70f,!![]);}catch(_0x402b2f){return BPromise[_0xa039('0x27')](_0x402b2f);}return _0x27e759[_0xa039('0x28')]();};}function saveUpdates(_0xa2ebb9,_0x19745b){return function(_0x2e7011){if(_0x2e7011){return _0x2e7011[_0xa039('0x29')](_0xa2ebb9)[_0xa039('0x2a')](function(_0x5511df){return _0x5511df;});}return null;};}function removeEntity(_0x2400c3,_0xb317ed){return function(_0x163372){if(_0x163372){return _0x163372['destroy']()[_0xa039('0x2a')](function(){_0x2400c3[_0xa039('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42d602,_0xc7463d){return function(_0x47c1f3){if(!_0x47c1f3){_0x42d602['sendStatus'](0x194);}return _0x47c1f3;};}function handleError(_0x5a68b0,_0x280d80){_0x280d80=_0x280d80||0x1f4;return function(_0x432e33){logger[_0xa039('0x2b')](_0x432e33['stack']);if(_0x432e33[_0xa039('0x2c')]){delete _0x432e33[_0xa039('0x2c')];}_0x5a68b0[_0xa039('0x1e')](_0x280d80)[_0xa039('0x2d')](_0x432e33);};}exports['index']=function(_0x4d39b2,_0x289399){var _0x4db35c={},_0x56cb51={},_0x1c0fdf={'count':0x0,'rows':[]};var _0x90aa3=_[_0xa039('0x2e')](db[_0xa039('0x2f')][_0xa039('0x30')],function(_0x55efaa){return{'name':_0x55efaa[_0xa039('0x31')],'type':_0x55efaa['type'][_0xa039('0x32')]};});_0x56cb51[_0xa039('0x33')]=_['map'](_0x90aa3,_0xa039('0x2c'));_0x56cb51[_0xa039('0x34')]=_[_0xa039('0x35')](_0x4d39b2[_0xa039('0x34')]);_0x56cb51[_0xa039('0x36')]=_[_0xa039('0x37')](_0x56cb51[_0xa039('0x33')],_0x56cb51[_0xa039('0x34')]);_0x4db35c[_0xa039('0x38')]=_[_0xa039('0x37')](_0x56cb51['model'],qs['fields'](_0x4d39b2['query'][_0xa039('0x39')]));_0x4db35c[_0xa039('0x38')]=_0x4db35c[_0xa039('0x38')][_0xa039('0x3a')]?_0x4db35c[_0xa039('0x38')]:_0x56cb51['model'];if(!_0x4d39b2[_0xa039('0x34')][_0xa039('0x3b')]('nolimit')){_0x4db35c['limit']=qs[_0xa039('0x23')](_0x4d39b2[_0xa039('0x34')][_0xa039('0x23')]);_0x4db35c['offset']=qs[_0xa039('0x21')](_0x4d39b2['query'][_0xa039('0x21')]);}_0x4db35c['order']=qs[_0xa039('0x3c')](_0x4d39b2['query'][_0xa039('0x3c')]);_0x4db35c[_0xa039('0x3d')]=qs[_0xa039('0x36')](_[_0xa039('0x3e')](_0x4d39b2[_0xa039('0x34')],_0x56cb51[_0xa039('0x36')]),_0x90aa3);if(_0x4d39b2[_0xa039('0x34')][_0xa039('0x3f')]){_0x4db35c[_0xa039('0x3d')]=_[_0xa039('0x40')](_0x4db35c[_0xa039('0x3d')],{'$or':_[_0xa039('0x2e')](_0x90aa3,function(_0x4a24e1){if(_0x4a24e1[_0xa039('0x41')]!==_0xa039('0x42')){var _0x228747={};_0x228747[_0x4a24e1[_0xa039('0x2c')]]={'$like':'%'+_0x4d39b2['query']['filter']+'%'};return _0x228747;}})});}_0x4db35c=_[_0xa039('0x40')]({},_0x4db35c,_0x4d39b2[_0xa039('0x43')]);var _0x2ea838={'where':_0x4db35c['where']};return db['ChatGroup']['count'](_0x2ea838)[_0xa039('0x2a')](function(_0x299e00){_0x1c0fdf['count']=_0x299e00;if(_0x4d39b2['query']['includeAll']){_0x4db35c[_0xa039('0x44')]=[{'all':!![]}];}return db[_0xa039('0x2f')]['findAll'](_0x4db35c);})[_0xa039('0x2a')](function(_0x1fe4f1){_0x1c0fdf[_0xa039('0x45')]=_0x1fe4f1;return _0x1c0fdf;})['then'](respondWithFilteredResult(_0x289399,_0x4db35c))[_0xa039('0x46')](handleError(_0x289399,null));};exports[_0xa039('0x47')]=function(_0x1d211a,_0x417be4){var _0x59fa1b={'raw':!![],'where':{'id':_0x1d211a[_0xa039('0x48')]['id']}},_0x11674a={};_0x11674a[_0xa039('0x33')]=_['keys'](db['ChatGroup'][_0xa039('0x30')]);_0x11674a['query']=_[_0xa039('0x35')](_0x1d211a[_0xa039('0x34')]);_0x11674a[_0xa039('0x36')]=_['intersection'](_0x11674a['model'],_0x11674a['query']);_0x59fa1b['attributes']=_[_0xa039('0x37')](_0x11674a[_0xa039('0x33')],qs[_0xa039('0x39')](_0x1d211a[_0xa039('0x34')][_0xa039('0x39')]));_0x59fa1b[_0xa039('0x38')]=_0x59fa1b[_0xa039('0x38')][_0xa039('0x3a')]?_0x59fa1b[_0xa039('0x38')]:_0x11674a[_0xa039('0x33')];if(_0x1d211a[_0xa039('0x34')]['includeAll']){_0x59fa1b[_0xa039('0x44')]=[{'all':!![]}];}_0x59fa1b=_[_0xa039('0x40')]({},_0x59fa1b,_0x1d211a[_0xa039('0x43')]);return db['ChatGroup'][_0xa039('0x49')](_0x59fa1b)['then'](handleEntityNotFound(_0x417be4,null))[_0xa039('0x2a')](respondWithResult(_0x417be4,null))['catch'](handleError(_0x417be4,null));};exports[_0xa039('0x4a')]=function(_0x1a0691,_0x7a9916){return db[_0xa039('0x2f')][_0xa039('0x4a')](_0x1a0691[_0xa039('0x4b')],{})['then'](respondWithResult(_0x7a9916,0xc9))['catch'](handleError(_0x7a9916,null));};exports[_0xa039('0x29')]=function(_0x5c5d75,_0x297942){if(_0x5c5d75[_0xa039('0x4b')]['id']){delete _0x5c5d75['body']['id'];}return db[_0xa039('0x2f')][_0xa039('0x49')]({'where':{'id':_0x5c5d75[_0xa039('0x48')]['id']}})[_0xa039('0x2a')](handleEntityNotFound(_0x297942,null))[_0xa039('0x2a')](saveUpdates(_0x5c5d75['body'],null))[_0xa039('0x2a')](respondWithResult(_0x297942,null))[_0xa039('0x46')](handleError(_0x297942,null));};exports['destroy']=function(_0x42d6e6,_0x53264c){return db['ChatGroup'][_0xa039('0x49')]({'where':{'id':_0x42d6e6[_0xa039('0x48')]['id']}})[_0xa039('0x2a')](handleEntityNotFound(_0x53264c,null))[_0xa039('0x2a')](removeEntity(_0x53264c,null))['catch'](handleError(_0x53264c,null));};exports[_0xa039('0x4c')]=function(_0x541002,_0x1e5b1e){return db['ChatGroup']['describe']()[_0xa039('0x2a')](respondWithResult(_0x1e5b1e,null))[_0xa039('0x46')](handleError(_0x1e5b1e,null));};exports[_0xa039('0x4d')]=function(_0x2786b8,_0x6efd9c,_0x127c41){return db[_0xa039('0x4e')]['count']({'where':{'ChatGroupId':_0x2786b8[_0xa039('0x48')]['id'],'ToId':_0x2786b8[_0xa039('0x4f')]['id'],'read':![]}})['then'](function(_0x3965ae){return{'id':_[_0xa039('0x50')](_0x2786b8[_0xa039('0x48')]['id']),'count':_0x3965ae};})[_0xa039('0x2a')](respondWithResult(_0x6efd9c,null))[_0xa039('0x46')](handleError(_0x6efd9c,null));};exports[_0xa039('0x51')]=function(_0x5f519c,_0x178e92,_0x30071d){return db[_0xa039('0x2f')][_0xa039('0x49')]({'where':{'id':_0x5f519c[_0xa039('0x48')]['id']}})['then'](handleEntityNotFound(_0x178e92,null))['then'](function(_0x34ac32){if(_0x34ac32){return _0x34ac32['addMembers'](_0x5f519c['body']['ids'],_['omit'](_0x5f519c[_0xa039('0x4b')],['ids','id'])||{});}})[_0xa039('0x2a')](respondWithResult(_0x178e92,null))[_0xa039('0x46')](handleError(_0x178e92,null));};exports[_0xa039('0x52')]=function(_0x91d885,_0x183d00,_0x245623){var _0x58b67a={};var _0x5e6162={};var _0xae1cf4;var _0x5182f5;return db[_0xa039('0x2f')][_0xa039('0x53')]({'where':{'id':_0x91d885['params']['id']}})[_0xa039('0x2a')](handleEntityNotFound(_0x183d00,null))[_0xa039('0x2a')](function(_0x341df2){if(_0x341df2){_0xae1cf4=_0x341df2;_0x5e6162['model']=_[_0xa039('0x35')](db['User']['rawAttributes']);_0x5e6162[_0xa039('0x34')]=_[_0xa039('0x35')](_0x91d885[_0xa039('0x34')]);_0x5e6162['filters']=_[_0xa039('0x37')](_0x5e6162[_0xa039('0x33')],_0x5e6162[_0xa039('0x34')]);_0x58b67a[_0xa039('0x38')]=_[_0xa039('0x37')](_0x5e6162[_0xa039('0x33')],qs[_0xa039('0x39')](_0x91d885['query'][_0xa039('0x39')]));_0x58b67a[_0xa039('0x38')]=_0x58b67a[_0xa039('0x38')]['length']?_0x58b67a['attributes']:_0x5e6162[_0xa039('0x33')];_0x58b67a[_0xa039('0x54')]=qs[_0xa039('0x3c')](_0x91d885[_0xa039('0x34')]['sort']);_0x58b67a[_0xa039('0x3d')]=qs[_0xa039('0x36')](_[_0xa039('0x3e')](_0x91d885[_0xa039('0x34')],_0x5e6162[_0xa039('0x36')]));if(_0x91d885[_0xa039('0x34')][_0xa039('0x3f')]){_0x58b67a['where']=_[_0xa039('0x40')](_0x58b67a[_0xa039('0x3d')],{'$or':_[_0xa039('0x2e')](_0x58b67a[_0xa039('0x38')],function(_0x5d0e25){var _0x38ad93={};_0x38ad93[_0x5d0e25]={'$like':'%'+_0x91d885[_0xa039('0x34')][_0xa039('0x3f')]+'%'};return _0x38ad93;})});}_0x58b67a=_['merge']({},_0x58b67a,_0x91d885[_0xa039('0x43')]);return _0xae1cf4[_0xa039('0x52')](_0x58b67a);}})[_0xa039('0x2a')](function(_0x9e463c){if(_0x9e463c){_0x5182f5=_0x9e463c[_0xa039('0x3a')];if(!_0x91d885[_0xa039('0x34')][_0xa039('0x3b')]('nolimit')){_0x58b67a['limit']=qs['limit'](_0x91d885['query'][_0xa039('0x23')]);_0x58b67a[_0xa039('0x21')]=qs[_0xa039('0x21')](_0x91d885['query'][_0xa039('0x21')]);}return _0xae1cf4[_0xa039('0x52')](_0x58b67a);}})['then'](function(_0x3b9076){if(_0x3b9076){return _0x3b9076?{'count':_0x5182f5,'rows':_0x3b9076}:null;}})[_0xa039('0x2a')](respondWithResult(_0x183d00,null))['catch'](handleError(_0x183d00,null));};exports[_0xa039('0x55')]=function(_0x416336,_0x1e19d7,_0x27ed4c){return db[_0xa039('0x2f')]['find']({'where':{'id':_0x416336[_0xa039('0x48')]['id']}})['then'](handleEntityNotFound(_0x1e19d7,null))[_0xa039('0x2a')](function(_0x241dd8){if(_0x241dd8){return _0x241dd8[_0xa039('0x55')](_0x416336[_0xa039('0x34')][_0xa039('0x56')]);}})[_0xa039('0x2a')](respondWithStatusCode(_0x1e19d7,null))['catch'](handleError(_0x1e19d7,null));};exports[_0xa039('0x57')]=function(_0x383a92,_0x24fc74,_0x1250c0){if(_0x383a92[_0xa039('0x4b')]['id']){delete _0x383a92[_0xa039('0x4b')]['id'];}return db[_0xa039('0x2f')][_0xa039('0x49')]({'where':{'id':_0x383a92['params']['id']}})['then'](handleEntityNotFound(_0x24fc74,null))[_0xa039('0x2a')](function(_0x31e3d9){if(_0x31e3d9){_0x383a92[_0xa039('0x4b')][_0xa039('0x58')]=_0x31e3d9['id'];return db[_0xa039('0x4e')][_0xa039('0x4a')](_0x383a92[_0xa039('0x4b')]);}})['then'](respondWithResult(_0x24fc74,null))['catch'](handleError(_0x24fc74,null));};exports[_0xa039('0x59')]=function(_0x4addb4,_0x1a1868,_0xdd13fb){var _0x612478={};var _0x2b2b88={};var _0x582f60;var _0x19c745;return db[_0xa039('0x2f')][_0xa039('0x53')]({'where':{'id':_0x4addb4['params']['id']}})[_0xa039('0x2a')](handleEntityNotFound(_0x1a1868,null))[_0xa039('0x2a')](function(_0x2dba84){if(_0x2dba84){_0x582f60=_0x2dba84;_0x2b2b88['model']=_['keys'](db[_0xa039('0x4e')][_0xa039('0x30')]);_0x2b2b88[_0xa039('0x34')]=_[_0xa039('0x35')](_0x4addb4[_0xa039('0x34')]);_0x2b2b88[_0xa039('0x36')]=_[_0xa039('0x37')](_0x2b2b88[_0xa039('0x33')],_0x2b2b88[_0xa039('0x34')]);_0x612478[_0xa039('0x38')]=_[_0xa039('0x37')](_0x2b2b88[_0xa039('0x33')],qs[_0xa039('0x39')](_0x4addb4[_0xa039('0x34')][_0xa039('0x39')]));_0x612478[_0xa039('0x38')]=_0x612478[_0xa039('0x38')][_0xa039('0x3a')]?_0x612478['attributes']:_0x2b2b88[_0xa039('0x33')];_0x612478['order']=qs[_0xa039('0x3c')](_0x4addb4['query'][_0xa039('0x3c')]);_0x612478[_0xa039('0x3d')]=qs[_0xa039('0x36')](_['pick'](_0x4addb4[_0xa039('0x34')],_0x2b2b88['filters']));if(_0x4addb4[_0xa039('0x34')]['filter']){_0x612478[_0xa039('0x3d')]=_[_0xa039('0x40')](_0x612478[_0xa039('0x3d')],{'$or':_['map'](_0x612478[_0xa039('0x38')],function(_0xca3525){var _0x38eddb={};_0x38eddb[_0xca3525]={'$like':'%'+_0x4addb4['query'][_0xa039('0x3f')]+'%'};return _0x38eddb;})});}if(_0x4addb4[_0xa039('0x34')][_0xa039('0x5a')]){var _0x5f0ac9=_0x4addb4[_0xa039('0x34')][_0xa039('0x5a')]['split'](',');var _0x1e4d9c={};_0x1e4d9c[_0x5f0ac9[0x0]]={'$gte':moment(_0x5f0ac9[0x1])['format'](_0xa039('0x5b'))};_0x612478['where']=_['merge'](_0x612478['where'],_0x1e4d9c);}_0x612478=_[_0xa039('0x40')]({},_0x612478,_0x4addb4['options']);return _0x582f60[_0xa039('0x59')](_0x612478);}})[_0xa039('0x2a')](function(_0x52c48f){if(_0x52c48f){_0x19c745=_0x52c48f['length'];if(!_0x4addb4[_0xa039('0x34')][_0xa039('0x3b')](_0xa039('0x5c'))){_0x612478[_0xa039('0x23')]=qs[_0xa039('0x23')](_0x4addb4[_0xa039('0x34')][_0xa039('0x23')]);_0x612478[_0xa039('0x21')]=qs['offset'](_0x4addb4[_0xa039('0x34')][_0xa039('0x21')]);}return _0x582f60['getMessages'](_0x612478);}})['then'](function(_0x8d4356){if(_0x8d4356){return _0x8d4356?{'count':_0x19c745,'rows':_0x8d4356}:null;}})[_0xa039('0x2a')](respondWithResult(_0x1a1868,null))[_0xa039('0x46')](handleError(_0x1a1868,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 8f6be04..7303283 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 _0x8512=['hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0x8512,0x70));var _0x2851=function(_0x7af2ae,_0x846e8a){_0x7af2ae=_0x7af2ae-0x0;var _0x17a7c5=_0x8512[_0x7af2ae];return _0x17a7c5;};'use strict';var EventEmitter=require(_0x2851('0x0'));var ChatGroup=require(_0x2851('0x1'))['db'][_0x2851('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x2851('0x3')](0x0);var events={'afterCreate':_0x2851('0x4'),'afterUpdate':_0x2851('0x5'),'afterDestroy':_0x2851('0x6')};function emitEvent(_0x28fcac){return function(_0x138d42,_0x550320,_0x58bf75){ChatGroupEvents[_0x2851('0x7')](_0x28fcac+':'+_0x138d42['id'],_0x138d42);ChatGroupEvents['emit'](_0x28fcac,_0x138d42);_0x58bf75(null);};}for(var e in events){if(events[_0x2851('0x8')](e)){var event=events[e];ChatGroup[_0x2851('0x9')](e,emitEvent(event));}}module[_0x2851('0xa')]=ChatGroupEvents;
\ No newline at end of file
+var _0xcf96=['hook','exports','events','ChatGroup','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x59bab9,_0x518fa0){var _0x1fb1ed=function(_0x5b558f){while(--_0x5b558f){_0x59bab9['push'](_0x59bab9['shift']());}};_0x1fb1ed(++_0x518fa0);}(_0xcf96,0xf5));var _0x6cf9=function(_0x12ef39,_0x18d320){_0x12ef39=_0x12ef39-0x0;var _0x47a734=_0xcf96[_0x12ef39];return _0x47a734;};'use strict';var EventEmitter=require(_0x6cf9('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x6cf9('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x6cf9('0x2')](0x0);var events={'afterCreate':_0x6cf9('0x3'),'afterUpdate':_0x6cf9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x15481e){return function(_0x1fcd2a,_0x38adf0,_0x26dfc2){ChatGroupEvents['emit'](_0x15481e+':'+_0x1fcd2a['id'],_0x1fcd2a);ChatGroupEvents[_0x6cf9('0x5')](_0x15481e,_0x1fcd2a);_0x26dfc2(null);};}for(var e in events){if(events[_0x6cf9('0x6')](e)){var event=events[e];ChatGroup[_0x6cf9('0x7')](e,emitEvent(event));}}module[_0x6cf9('0x8')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index aa3f6bc..59a9277 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 _0x2381=['define','ChatGroup','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x569a11,_0x9ec478){var _0xcf15b5=function(_0x5ac163){while(--_0x5ac163){_0x569a11['push'](_0x569a11['shift']());}};_0xcf15b5(++_0x9ec478);}(_0x2381,0xbd));var _0x1238=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x2381[_0x2dea24];return _0x309d58;};'use strict';var _=require(_0x1238('0x0'));var util=require(_0x1238('0x1'));var logger=require(_0x1238('0x2'))('api');var moment=require(_0x1238('0x3'));var BPromise=require(_0x1238('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1238('0x5'));var rimraf=require(_0x1238('0x6'));var config=require(_0x1238('0x7'));var attributes=require('./chatGroup.attributes');module[_0x1238('0x8')]=function(_0x413b47,_0x168e41){return _0x413b47[_0x1238('0x9')](_0x1238('0xa'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x065b=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatGroup','lodash','util','../../config/logger','api','moment'];(function(_0x436def,_0x8b44dc){var _0x1223b2=function(_0x4abc61){while(--_0x4abc61){_0x436def['push'](_0x436def['shift']());}};_0x1223b2(++_0x8b44dc);}(_0x065b,0x1dc));var _0xb065=function(_0x1f8784,_0x285f48){_0x1f8784=_0x1f8784-0x0;var _0x2a4e3e=_0x065b[_0x1f8784];return _0x2a4e3e;};'use strict';var _=require(_0xb065('0x0'));var util=require(_0xb065('0x1'));var logger=require(_0xb065('0x2'))(_0xb065('0x3'));var moment=require(_0xb065('0x4'));var BPromise=require(_0xb065('0x5'));var rp=require(_0xb065('0x6'));var fs=require('fs');var path=require(_0xb065('0x7'));var rimraf=require(_0xb065('0x8'));var config=require(_0xb065('0x9'));var attributes=require('./chatGroup.attributes');module[_0xb065('0xa')]=function(_0x4ee352,_0x3811c5){return _0x4ee352[_0xb065('0xb')](_0xb065('0xc'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index 1688793..5581469 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 _0x8d0e=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','error'];(function(_0x25d1a5,_0x507038){var _0x189bc3=function(_0x3c9537){while(--_0x3c9537){_0x25d1a5['push'](_0x25d1a5['shift']());}};_0x189bc3(++_0x507038);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x397b30,_0x553395){_0x397b30=_0x397b30-0x0;var _0x1bcf08=_0x8d0e[_0x397b30];return _0x1bcf08;};'use strict';var _=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var moment=require(_0xe8d0('0x2'));var BPromise=require(_0xe8d0('0x3'));var rs=require(_0xe8d0('0x4'));var fs=require('fs');var Redis=require(_0xe8d0('0x5'));var db=require(_0xe8d0('0x6'))['db'];var utils=require(_0xe8d0('0x7'));var logger=require(_0xe8d0('0x8'))('rpc');var config=require(_0xe8d0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe8d0('0xa')]({'port':0x232a});config[_0xe8d0('0xb')]=_[_0xe8d0('0xc')](config[_0xe8d0('0xb')],{'host':_0xe8d0('0xd'),'port':0x18eb});var socket=require(_0xe8d0('0xe'))(new Redis(config[_0xe8d0('0xb')]));require(_0xe8d0('0xf'))['register'](socket);function respondWithRpcPromise(_0x10e56c,_0x19c3d0,_0x463159){return new BPromise(function(_0x599bc3,_0x580aab){return client[_0xe8d0('0x10')](_0x10e56c,_0x463159)[_0xe8d0('0x11')](function(_0x3da047){logger[_0xe8d0('0x12')](_0xe8d0('0x13'),_0x19c3d0,_0xe8d0('0x14'));logger['debug'](_0xe8d0('0x15'),_0x19c3d0,_0xe8d0('0x14'),JSON['stringify'](_0x3da047));if(_0x3da047[_0xe8d0('0x16')]){if(_0x3da047['error']['code']===0x1f4){logger[_0xe8d0('0x16')](_0xe8d0('0x13'),_0x19c3d0,_0x3da047[_0xe8d0('0x16')][_0xe8d0('0x17')]);return _0x580aab(_0x3da047[_0xe8d0('0x16')][_0xe8d0('0x17')]);}logger['error'](_0xe8d0('0x13'),_0x19c3d0,_0x3da047['error'][_0xe8d0('0x17')]);return _0x599bc3(_0x3da047[_0xe8d0('0x16')][_0xe8d0('0x17')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x19c3d0,'request\x20sent');_0x599bc3(_0x3da047[_0xe8d0('0x18')][_0xe8d0('0x17')]);}})[_0xe8d0('0x19')](function(_0x44bbe4){logger[_0xe8d0('0x16')]('ChatGroup,\x20%s,\x20%s',_0x19c3d0,_0x44bbe4);_0x580aab(_0x44bbe4);});});}
\ No newline at end of file
+var _0x3379=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./chatGroup.socket','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment'];(function(_0x1f6553,_0x278aa0){var _0x5206da=function(_0x22510d){while(--_0x22510d){_0x1f6553['push'](_0x1f6553['shift']());}};_0x5206da(++_0x278aa0);}(_0x3379,0x115));var _0x9337=function(_0x5d343d,_0x40789f){_0x5d343d=_0x5d343d-0x0;var _0x46758e=_0x3379[_0x5d343d];return _0x46758e;};'use strict';var _=require(_0x9337('0x0'));var util=require(_0x9337('0x1'));var moment=require(_0x9337('0x2'));var BPromise=require(_0x9337('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9337('0x4'));var db=require(_0x9337('0x5'))['db'];var utils=require(_0x9337('0x6'));var logger=require(_0x9337('0x7'))('rpc');var config=require(_0x9337('0x8'));var jayson=require(_0x9337('0x9'));var client=jayson[_0x9337('0xa')][_0x9337('0xb')]({'port':0x232a});config['redis']=_[_0x9337('0xc')](config['redis'],{'host':_0x9337('0xd'),'port':0x18eb});var socket=require(_0x9337('0xe'))(new Redis(config[_0x9337('0xf')]));require(_0x9337('0x10'))[_0x9337('0x11')](socket);function respondWithRpcPromise(_0x55ea19,_0xd9b084,_0x1630bf){return new BPromise(function(_0xc985d1,_0x9a2dcc){return client[_0x9337('0x12')](_0x55ea19,_0x1630bf)['then'](function(_0x2ee523){logger[_0x9337('0x13')](_0x9337('0x14'),_0xd9b084,_0x9337('0x15'));logger[_0x9337('0x16')](_0x9337('0x17'),_0xd9b084,_0x9337('0x15'),JSON['stringify'](_0x2ee523));if(_0x2ee523['error']){if(_0x2ee523[_0x9337('0x18')][_0x9337('0x19')]===0x1f4){logger[_0x9337('0x18')](_0x9337('0x14'),_0xd9b084,_0x2ee523['error']['message']);return _0x9a2dcc(_0x2ee523[_0x9337('0x18')]['message']);}logger['error'](_0x9337('0x14'),_0xd9b084,_0x2ee523[_0x9337('0x18')][_0x9337('0x1a')]);return _0xc985d1(_0x2ee523['error'][_0x9337('0x1a')]);}else{logger[_0x9337('0x13')]('ChatGroup,\x20%s,\x20%s',_0xd9b084,'request\x20sent');_0xc985d1(_0x2ee523[_0x9337('0x1b')][_0x9337('0x1a')]);}})['catch'](function(_0x1bae86){logger[_0x9337('0x18')]('ChatGroup,\x20%s,\x20%s',_0xd9b084,_0x1bae86);_0x9a2dcc(_0x1bae86);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 4abca5d..2b64720 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 _0x71c5=['removeListener','length','chatGroup:','./chatGroup.events','save','remove'];(function(_0x2d4b98,_0x513897){var _0x109161=function(_0x259674){while(--_0x259674){_0x2d4b98['push'](_0x2d4b98['shift']());}};_0x109161(++_0x513897);}(_0x71c5,0x12f));var _0x571c=function(_0x54b078,_0xde2eba){_0x54b078=_0x54b078-0x0;var _0x46de84=_0x71c5[_0x54b078];return _0x46de84;};'use strict';var ChatGroupEvents=require(_0x571c('0x0'));var events=[_0x571c('0x1'),_0x571c('0x2'),'update'];function createListener(_0x25b7b2,_0x12de22){return function(_0x57e03f){_0x12de22['emit'](_0x25b7b2,_0x57e03f);};}function removeListener(_0x10e5bb,_0x126c00){return function(){ChatGroupEvents[_0x571c('0x3')](_0x10e5bb,_0x126c00);};}exports['register']=function(_0xb4ee84){for(var _0x542e03=0x0,_0x4ea49a=events[_0x571c('0x4')];_0x542e03<_0x4ea49a;_0x542e03++){var _0x142a3c=events[_0x542e03];var _0x437f76=createListener(_0x571c('0x5')+_0x142a3c,_0xb4ee84);ChatGroupEvents['on'](_0x142a3c,_0x437f76);}};
\ No newline at end of file
+var _0x25fa=['emit','removeListener','register','length','chatGroup:','./chatGroup.events','save','remove','update'];(function(_0x1c3c6c,_0xb3eb41){var _0xc2dcae=function(_0x1231fb){while(--_0x1231fb){_0x1c3c6c['push'](_0x1c3c6c['shift']());}};_0xc2dcae(++_0xb3eb41);}(_0x25fa,0x152));var _0xa25f=function(_0x142e41,_0x361a58){_0x142e41=_0x142e41-0x0;var _0x488a86=_0x25fa[_0x142e41];return _0x488a86;};'use strict';var ChatGroupEvents=require(_0xa25f('0x0'));var events=[_0xa25f('0x1'),_0xa25f('0x2'),_0xa25f('0x3')];function createListener(_0x37002e,_0x4f6ed8){return function(_0x3d23f5){_0x4f6ed8[_0xa25f('0x4')](_0x37002e,_0x3d23f5);};}function removeListener(_0x20b187,_0x3ea162){return function(){ChatGroupEvents[_0xa25f('0x5')](_0x20b187,_0x3ea162);};}exports[_0xa25f('0x6')]=function(_0x54024e){for(var _0x47a62a=0x0,_0x112986=events[_0xa25f('0x7')];_0x47a62a<_0x112986;_0x47a62a++){var _0x77511f=events[_0x47a62a];var _0xc501aa=createListener(_0xa25f('0x8')+_0x77511f,_0x54024e);ChatGroupEvents['on'](_0x77511f,_0xc501aa);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 8190067..9f29a93 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 _0xabb6=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','describe','/:id/unread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','/:id','update','delete','removeMembers','exports'];(function(_0x39fabb,_0x2744b1){var _0x48361=function(_0xa60722){while(--_0xa60722){_0x39fabb['push'](_0x39fabb['shift']());}};_0x48361(++_0x2744b1);}(_0xabb6,0x195));var _0x6abb=function(_0x3591dc,_0x2b1429){_0x3591dc=_0x3591dc-0x0;var _0x40cddd=_0xabb6[_0x3591dc];return _0x40cddd;};'use strict';var multer=require(_0x6abb('0x0'));var util=require(_0x6abb('0x1'));var path=require(_0x6abb('0x2'));var timeout=require(_0x6abb('0x3'));var express=require(_0x6abb('0x4'));var router=express['Router']();var fs_extra=require(_0x6abb('0x5'));var auth=require(_0x6abb('0x6'));var interaction=require(_0x6abb('0x7'));var config=require(_0x6abb('0x8'));var controller=require(_0x6abb('0x9'));router[_0x6abb('0xa')]('/',auth[_0x6abb('0xb')](),controller['index']);router[_0x6abb('0xa')]('/describe',auth[_0x6abb('0xb')](),controller[_0x6abb('0xc')]);router['get']('/:id',auth[_0x6abb('0xb')](),controller['show']);router[_0x6abb('0xa')](_0x6abb('0xd'),auth[_0x6abb('0xb')](),controller['getUnread']);router[_0x6abb('0xa')](_0x6abb('0xe'),auth[_0x6abb('0xb')](),controller[_0x6abb('0xf')]);router[_0x6abb('0xa')](_0x6abb('0x10'),auth[_0x6abb('0xb')](),controller[_0x6abb('0x11')]);router[_0x6abb('0x12')]('/',auth[_0x6abb('0xb')](),controller[_0x6abb('0x13')]);router[_0x6abb('0x12')](_0x6abb('0xe'),auth[_0x6abb('0xb')](),controller[_0x6abb('0x14')]);router[_0x6abb('0x12')]('/:id/messages',auth['isAuthenticated'](),controller[_0x6abb('0x15')]);router['put'](_0x6abb('0x16'),auth['isAuthenticated'](),controller[_0x6abb('0x17')]);router['delete'](_0x6abb('0x16'),auth[_0x6abb('0xb')](),controller['destroy']);router[_0x6abb('0x18')](_0x6abb('0xe'),auth[_0x6abb('0xb')](),controller[_0x6abb('0x19')]);module[_0x6abb('0x1a')]=router;
\ No newline at end of file
+var _0x100a=['destroy','removeMembers','exports','multer','util','path','express','fs-extra','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','/describe','describe','show','/:id/unread','/:id/members','post','create','/:id/messages','addMessage','put','/:id','update','delete'];(function(_0x595dba,_0x5c482d){var _0x5d24b6=function(_0x4ded8d){while(--_0x4ded8d){_0x595dba['push'](_0x595dba['shift']());}};_0x5d24b6(++_0x5c482d);}(_0x100a,0x116));var _0xa100=function(_0xc9fdaa,_0x123fbe){_0xc9fdaa=_0xc9fdaa-0x0;var _0x3c0094=_0x100a[_0xc9fdaa];return _0x3c0094;};'use strict';var multer=require(_0xa100('0x0'));var util=require(_0xa100('0x1'));var path=require(_0xa100('0x2'));var timeout=require('connect-timeout');var express=require(_0xa100('0x3'));var router=express['Router']();var fs_extra=require(_0xa100('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa100('0x5'));var config=require('../../config/environment');var controller=require(_0xa100('0x6'));router[_0xa100('0x7')]('/',auth[_0xa100('0x8')](),controller['index']);router['get'](_0xa100('0x9'),auth[_0xa100('0x8')](),controller[_0xa100('0xa')]);router[_0xa100('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xa100('0xb')]);router['get'](_0xa100('0xc'),auth[_0xa100('0x8')](),controller['getUnread']);router[_0xa100('0x7')](_0xa100('0xd'),auth[_0xa100('0x8')](),controller['getMembers']);router[_0xa100('0x7')]('/:id/messages',auth[_0xa100('0x8')](),controller['getMessages']);router[_0xa100('0xe')]('/',auth['isAuthenticated'](),controller[_0xa100('0xf')]);router[_0xa100('0xe')](_0xa100('0xd'),auth['isAuthenticated'](),controller['addMembers']);router[_0xa100('0xe')](_0xa100('0x10'),auth[_0xa100('0x8')](),controller[_0xa100('0x11')]);router[_0xa100('0x12')](_0xa100('0x13'),auth[_0xa100('0x8')](),controller[_0xa100('0x14')]);router[_0xa100('0x15')](_0xa100('0x13'),auth[_0xa100('0x8')](),controller[_0xa100('0x16')]);router['delete']('/:id/members',auth[_0xa100('0x8')](),controller[_0xa100('0x17')]);module[_0xa100('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 5de2ea9..c719b66 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 _0x4024=['long','DATE','sequelize','exports','INTEGER','ENUM','thumb','TEXT','STRING'];(function(_0x6b6e9,_0x23f0e3){var _0x16e0ba=function(_0x485e33){while(--_0x485e33){_0x6b6e9['push'](_0x6b6e9['shift']());}};_0x16e0ba(++_0x23f0e3);}(_0x4024,0x89));var _0x4402=function(_0xe00024,_0x4e8cd1){_0xe00024=_0xe00024-0x0;var _0x455ba0=_0x4024[_0xe00024];return _0x455ba0;};'use strict';var Sequelize=require(_0x4402('0x0'));module[_0x4402('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x4402('0x2')]},'ratingType':{'type':Sequelize[_0x4402('0x3')]('star',_0x4402('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x4402('0x5')]},'pathTranscript':{'type':Sequelize[_0x4402('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x4402('0x6')]},'secondDisposition':{'type':Sequelize[_0x4402('0x6')]},'thirdDisposition':{'type':Sequelize[_0x4402('0x6')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x4402('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x4402('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x4402('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x4402('0x6')]},'formData':{'type':Sequelize['TEXT'](_0x4402('0x7'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x4402('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x4402('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x4402('0x6')]},'customerPort':{'type':Sequelize[_0x4402('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x4402('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xc29b=['out','sequelize','exports','BOOLEAN','ENUM','star','TEXT','STRING','DATE','long'];(function(_0x57a4f2,_0x29f351){var _0x298f82=function(_0x131d4b){while(--_0x131d4b){_0x57a4f2['push'](_0x57a4f2['shift']());}};_0x298f82(++_0x29f351);}(_0xc29b,0x12d));var _0xbc29=function(_0x1a0c08,_0x525715){_0x1a0c08=_0x1a0c08-0x0;var _0x22a682=_0xc29b[_0x1a0c08];return _0x22a682;};'use strict';var Sequelize=require(_0xbc29('0x0'));module[_0xbc29('0x1')]={'closed':{'type':Sequelize[_0xbc29('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xbc29('0x3')](_0xbc29('0x4'),'thumb'),'defaultValue':_0xbc29('0x4')},'ratingMessage':{'type':Sequelize[_0xbc29('0x5')]},'pathTranscript':{'type':Sequelize[_0xbc29('0x5')]},'mailTranscript':{'type':Sequelize[_0xbc29('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xbc29('0x7')]},'disposition':{'type':Sequelize[_0xbc29('0x6')]},'secondDisposition':{'type':Sequelize[_0xbc29('0x6')]},'thirdDisposition':{'type':Sequelize[_0xbc29('0x6')]},'note':{'type':Sequelize[_0xbc29('0x6')]},'browserName':{'type':Sequelize[_0xbc29('0x6')]},'browserVersion':{'type':Sequelize[_0xbc29('0x6')]},'osName':{'type':Sequelize[_0xbc29('0x6')]},'osVersion':{'type':Sequelize[_0xbc29('0x6')]},'deviceModel':{'type':Sequelize[_0xbc29('0x6')]},'deviceVendor':{'type':Sequelize[_0xbc29('0x6')]},'deviceType':{'type':Sequelize[_0xbc29('0x6')]},'referer':{'type':Sequelize[_0xbc29('0x5')]},'customerIp':{'type':Sequelize[_0xbc29('0x6')]},'formData':{'type':Sequelize[_0xbc29('0x5')](_0xbc29('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0xbc29('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xbc29('0x3')]('in',_0xbc29('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xbc29('0x6')]},'customerPort':{'type':Sequelize[_0xbc29('0x6')]},'vidaooSessionId':{'type':Sequelize[_0xbc29('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0xbc29('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index a3d5a22..a7f1413 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 _0xdd4f=['i.ChatWebsiteId\x20IN\x20?','toString','sequelize','ChatInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','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','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','all','rows','includeAll','include','options','create','params','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','follow','isNull','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','file','basename','mimetype','attachmentDownload','closed','Unauthorized','Attachment','ChatOfflineMessageId','server/files/attachments/','join','offline-chat/','download','close','mailTranscript','root','server/files/chat/upload/','transcript-%s.txt','pathTranscript','Messages','format','%s%d','agentAlias','System','customer','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','pass','SendMail','sendMail','Mail\x20Transcript','addMessage','ids','omit','nolimit','sort','ChatInteractionId','$gte','getMyMessages','filter','findAll','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','attachments','transcript-%d-%s.zip','lastName','ChatWebsite','Account','get','mkdirSync','Chat','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','referer','customerPort','existsSync','createReadStream','pipe','createWriteStream','out','firstName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','err','eml-format','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','update','destroy','stack','name','send','render','merge','body','interaction','account','Users','map','fullname','Tags','TagIds','split','forEach','push','rawAttributes','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','pick','field','from','tools_tags','select','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','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','text','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','compact','isEmpty','ChatWebsiteId','where','concat','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','isNumeric','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','clone','order','contactName','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','i.ChatWebsiteId\x20IS\x20NULL'];(function(_0x391ae4,_0x477af5){var _0x189442=function(_0x108e89){while(--_0x108e89){_0x391ae4['push'](_0x391ae4['shift']());}};_0x189442(++_0x477af5);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x10b5d7,_0x49d478){_0x10b5d7=_0x10b5d7-0x0;var _0x3338c6=_0xdd4f[_0x10b5d7];return _0x3338c6;};'use strict';var emlformat=require(_0xfdd4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfdd4('0x1'));var moment=require(_0xfdd4('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xfdd4('0x3'));var util=require(_0xfdd4('0x4'));var path=require(_0xfdd4('0x5'));var sox=require('sox');var csv=require(_0xfdd4('0x6'));var ejs=require(_0xfdd4('0x7'));var fs=require('fs');var fs_extra=require(_0xfdd4('0x8'));var _=require(_0xfdd4('0x9'));var squel=require(_0xfdd4('0xa'));var crypto=require('crypto');var jsforce=require(_0xfdd4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xfdd4('0x6'));var querystring=require(_0xfdd4('0xc'));var Papa=require(_0xfdd4('0xd'));var Redis=require('ioredis');var authService=require(_0xfdd4('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xfdd4('0xf'));var pdf=require(_0xfdd4('0x10'));var hardwareService=require(_0xfdd4('0x11'));var logger=require(_0xfdd4('0x12'))(_0xfdd4('0x13'));var utils=require(_0xfdd4('0x14'));var config=require(_0xfdd4('0x15'));var licenseUtil=require(_0xfdd4('0x16'));var db=require(_0xfdd4('0x17'))['db'];config[_0xfdd4('0x18')]=_[_0xfdd4('0x19')](config['redis'],{'host':_0xfdd4('0x1a'),'port':0x18eb});var socket=require(_0xfdd4('0x1b'))(new Redis(config[_0xfdd4('0x18')]));require('./chatInteraction.socket')[_0xfdd4('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xfdd4('0x1d')][_0xfdd4('0x1e')]({'port':0x232b});var client9004=jayson[_0xfdd4('0x1d')][_0xfdd4('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x37b05f,_0x52cf2c,_0x47ed1d,_0x559c77){return new BPromise(function(_0x3a966d,_0x216c7e){var _0x2eb174=_0x559c77||client;return _0x2eb174[_0xfdd4('0x1f')](_0x37b05f,_0x47ed1d)[_0xfdd4('0x20')](function(_0x33d752){logger[_0xfdd4('0x21')](_0xfdd4('0x22'),_0x52cf2c,_0xfdd4('0x23'));logger['debug'](_0xfdd4('0x24'),_0x52cf2c,_0xfdd4('0x23'),JSON[_0xfdd4('0x25')](_0x33d752));if(_0x33d752[_0xfdd4('0x26')]){if(_0x33d752[_0xfdd4('0x26')][_0xfdd4('0x27')]===0x1f4){logger[_0xfdd4('0x26')](_0xfdd4('0x22'),_0x52cf2c,_0x33d752['error'][_0xfdd4('0x28')]);return _0x216c7e(_0x33d752[_0xfdd4('0x26')][_0xfdd4('0x28')]);}logger[_0xfdd4('0x26')](_0xfdd4('0x22'),_0x52cf2c,_0x33d752[_0xfdd4('0x26')][_0xfdd4('0x28')]);return _0x3a966d(_0x33d752[_0xfdd4('0x26')]['message']);}else{logger[_0xfdd4('0x21')](_0xfdd4('0x22'),_0x52cf2c,_0xfdd4('0x23'));_0x3a966d(_0x33d752['result'][_0xfdd4('0x28')]);}})[_0xfdd4('0x29')](function(_0xf9c346){logger[_0xfdd4('0x26')](_0xfdd4('0x22'),_0x52cf2c,_0xf9c346);_0x216c7e(_0xf9c346);});});}function respondWithStatusCode(_0x4a8790,_0x18bafb){_0x18bafb=_0x18bafb||0xcc;return function(_0x2c88ad){if(_0x2c88ad){return _0x4a8790[_0xfdd4('0x2a')](_0x18bafb);}return _0x4a8790[_0xfdd4('0x2b')](_0x18bafb)[_0xfdd4('0x2c')]();};}function respondWithResult(_0x192471,_0x453a48){_0x453a48=_0x453a48||0xc8;return function(_0x37b7a2){if(_0x37b7a2){return _0x192471['status'](_0x453a48)[_0xfdd4('0x2d')](_0x37b7a2);}};}function respondWithFilteredResult(_0x39981f,_0x385a68){return function(_0xef012e){if(_0xef012e){var _0x2207ae=typeof _0x385a68['offset']===_0xfdd4('0x2e')&&typeof _0x385a68[_0xfdd4('0x2f')]===_0xfdd4('0x2e');var _0x2bb793=_0xef012e[_0xfdd4('0x30')];var _0x4d64ce=_0x2207ae?0x0:_0x385a68[_0xfdd4('0x31')];var _0x315568=_0x2207ae?_0xef012e[_0xfdd4('0x30')]:_0x385a68['offset']+_0x385a68[_0xfdd4('0x2f')];var _0x502776;if(_0x315568>=_0x2bb793){_0x315568=_0x2bb793;_0x502776=0xc8;}else{_0x502776=0xce;}_0x39981f[_0xfdd4('0x2b')](_0x502776);return _0x39981f[_0xfdd4('0x32')]('Content-Range',_0x4d64ce+'-'+_0x315568+'/'+_0x2bb793)['json'](_0xef012e);}return null;};}function patchUpdates(_0x41dae6){return function(_0x289f16){try{jsonpatch['apply'](_0x289f16,_0x41dae6,!![]);}catch(_0x557d7b){return BPromise[_0xfdd4('0x33')](_0x557d7b);}return _0x289f16[_0xfdd4('0x34')]();};}function saveUpdates(_0x39eedb,_0x24b1fa){return function(_0x3247f4){if(_0x3247f4){return _0x3247f4[_0xfdd4('0x35')](_0x39eedb)[_0xfdd4('0x20')](function(_0x4734ed){return _0x4734ed;});}return null;};}function removeEntity(_0x3e6bc5,_0x457ab5){return function(_0x6ffe30){if(_0x6ffe30){return _0x6ffe30[_0xfdd4('0x36')]()[_0xfdd4('0x20')](function(){_0x3e6bc5[_0xfdd4('0x2b')](0xcc)[_0xfdd4('0x2c')]();});}};}function handleEntityNotFound(_0x3f5c5a,_0x261d87){return function(_0x3a0102){if(!_0x3a0102){_0x3f5c5a[_0xfdd4('0x2a')](0x194);}return _0x3a0102;};}function handleError(_0x4037c4,_0xc9549b){_0xc9549b=_0xc9549b||0x1f4;return function(_0x2e4c8c){logger[_0xfdd4('0x26')](_0x2e4c8c[_0xfdd4('0x37')]);if(_0x2e4c8c[_0xfdd4('0x38')]){delete _0x2e4c8c[_0xfdd4('0x38')];}_0x4037c4['status'](_0xc9549b)[_0xfdd4('0x39')](_0x2e4c8c);};}function getMustacheRender(_0x3716da,_0x42dc1a){return Mustache[_0xfdd4('0x3a')](_0x3716da,_[_0xfdd4('0x3b')](_0x42dc1a[_0xfdd4('0x3c')],{'contact':_0x42dc1a['contact'],'message':_0x42dc1a[_0xfdd4('0x28')],'agent':_0x42dc1a['agent'],'interaction':_0x42dc1a[_0xfdd4('0x3d')],'account':_0x42dc1a[_0xfdd4('0x3e')]}))||'';}function getInteractionUsers(_0x6a79eb,_0x13efe8){return new BPromise(function(_0x4cccab,_0x1c6f43){try{if(_0x13efe8[_0x6a79eb['id']]){_0x6a79eb[_0xfdd4('0x3f')]=_[_0xfdd4('0x40')](_0x13efe8[_0x6a79eb['id']],function(_0x2ee857){return{'id':_0x2ee857['id'],'fullname':_0x2ee857[_0xfdd4('0x41')]};});}}catch(_0x7e171){_0x1c6f43(_0x7e171);}_0x4cccab(_0x6a79eb);});}function getInteractionTags(_0x28e5e2,_0x55fcec){return new BPromise(function(_0xe65944,_0x83673d){try{if(_0x28e5e2['TagIds']){_0x28e5e2[_0xfdd4('0x42')]=[];_0x28e5e2[_0xfdd4('0x43')][_0xfdd4('0x44')](',')[_0xfdd4('0x45')](function(_0x5173db){_0x28e5e2[_0xfdd4('0x42')][_0xfdd4('0x46')](_0x55fcec[_0x5173db]);});}delete _0x28e5e2[_0xfdd4('0x43')];}catch(_0x2341e5){_0x83673d(_0x2341e5);}_0xe65944(_0x28e5e2);});}function updateChatInteraction(_0x362c4f,_0x496747,_0x1411e0){return new BPromise(function(_0x23af2a,_0xd3780d){return getInteractionUsers(_0x362c4f,_0x1411e0)[_0xfdd4('0x20')](function(_0x912520){return getInteractionTags(_0x912520,_0x496747);})[_0xfdd4('0x20')](function(_0x3d1051){_0x23af2a(_0x3d1051);})['catch'](function(_0x2dd3fa){_0xd3780d(_0x2dd3fa);});});}exports['index']=function(_0x3a0de9,_0x11f241){var _0x3f7273={},_0x137d41={},_0x5367aa={'count':0x0,'rows':[]};var _0x419578=_[_0xfdd4('0x40')](db['ChatInteraction'][_0xfdd4('0x47')],function(_0xbfaa53){return{'name':_0xbfaa53['fieldName'],'type':_0xbfaa53[_0xfdd4('0x48')]['key']};});_0x137d41['model']=_['map'](_0x419578,_0xfdd4('0x38'));_0x137d41[_0xfdd4('0x49')]=_[_0xfdd4('0x4a')](_0x3a0de9['query']);_0x137d41[_0xfdd4('0x4b')]=_[_0xfdd4('0x4c')](_0x137d41['model'],_0x137d41[_0xfdd4('0x49')]);_0x3f7273[_0xfdd4('0x4d')]=_[_0xfdd4('0x4c')](_0x137d41[_0xfdd4('0x4e')],qs[_0xfdd4('0x4f')](_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x4f')]));_0x3f7273[_0xfdd4('0x4d')]=_0x3f7273[_0xfdd4('0x4d')][_0xfdd4('0x50')]?_0x3f7273[_0xfdd4('0x4d')]:_0x137d41[_0xfdd4('0x4e')];if(!_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x51')]('nolimit')){_0x3f7273['limit']=qs[_0xfdd4('0x2f')](_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x2f')]);_0x3f7273[_0xfdd4('0x31')]=qs['offset'](_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x31')]);}_0x3f7273['order']=qs['sort'](_0x3a0de9['query']['sort']);_0x3f7273['where']=qs[_0xfdd4('0x4b')](_[_0xfdd4('0x52')](_0x3a0de9[_0xfdd4('0x49')],_0x137d41[_0xfdd4('0x4b')]),_0x419578);var _0x35c032=[];var _0x49bc61=squel['select']()[_0xfdd4('0x53')]('id')[_0xfdd4('0x53')](_0xfdd4('0x38'))[_0xfdd4('0x53')]('color')[_0xfdd4('0x54')](_0xfdd4('0x55'));var _0x4addd6=squel[_0xfdd4('0x56')]()[_0xfdd4('0x53')]('u.id')['field'](_0xfdd4('0x57'))[_0xfdd4('0x53')](_0xfdd4('0x58'))[_0xfdd4('0x54')](_0xfdd4('0x59'),'ui')[_0xfdd4('0x5a')](_0xfdd4('0x5b'),'u',_0xfdd4('0x5c'));var _0x5848e1=squel[_0xfdd4('0x56')]()['from']('chat_interactions','i')[_0xfdd4('0x5a')](_0xfdd4('0x5d'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o',_0xfdd4('0x5e'))[_0xfdd4('0x5a')]('chat_websites','a',_0xfdd4('0x5f'))[_0xfdd4('0x5a')](_0xfdd4('0x60'),'me',_0xfdd4('0x61'))[_0xfdd4('0x5a')]('chat_interaction_has_tags','it','it.ChatInteractionId\x20=\x20i.id')['left_join']('tools_tags','t',_0xfdd4('0x62'));var _0x14d07e=squel['expr']();var _0x1eee3d=[];var _0x2abe50=squel['expr']();var _0x45dcc8;if(_0x3a0de9[_0xfdd4('0x49')]['search']){_0x45dcc8=as[_0xfdd4('0x63')](_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x64')]);var _0x4a5fe6=_0x45dcc8[_0xfdd4('0x65')];for(var _0x3417dd=0x0;_0x3417dd<_0x45dcc8[_0xfdd4('0x66')][_0xfdd4('0x50')];_0x3417dd++){var _0x5c7be=_0x45dcc8['conditions'][_0x3417dd];var _0x2cc3e2='i';var _0x2ee4b6=_[_0xfdd4('0x67')](_0x419578,[_0xfdd4('0x38'),_0x5c7be[_0xfdd4('0x53')]]);if(!_0x2ee4b6){switch(_0x5c7be[_0xfdd4('0x53')]){case _0xfdd4('0x68'):if(_0x5c7be[_0xfdd4('0x69')]==0x1){_0x5848e1[_0xfdd4('0x6a')]('`'+_0x5c7be['field']+_0xfdd4('0x6b'));}else{_0x5848e1[_0xfdd4('0x6a')]('`'+_0x5c7be[_0xfdd4('0x53')]+_0xfdd4('0x6c'));}break;case _0xfdd4('0x6d'):if(_0x5c7be['operator']===_0xfdd4('0x6e')){if(_0x5c7be[_0xfdd4('0x69')][_0xfdd4('0x44')]('\x20')[_0xfdd4('0x50')]>0x1){_0x14d07e[_0x4a5fe6](_0xfdd4('0x6f'),qs[_0xfdd4('0x70')](_0x5c7be[_0xfdd4('0x69')]),null);}else{var _0x276e9='%'+_0x5c7be[_0xfdd4('0x69')]+'%';_0x14d07e[_0x4a5fe6](_0xfdd4('0x71'),_0x276e9,_0x276e9,_0x276e9);}}else{_0x2ee4b6=_[_0xfdd4('0x67')](_0x419578,[_0xfdd4('0x38'),_0xfdd4('0x72')]);_0x5c7be['field']=_0xfdd4('0x72');_0xa55e0f=as['buildExpression'](_0x2cc3e2,_0x2ee4b6[_0xfdd4('0x48')],_0x5c7be);_0x14d07e[_0x4a5fe6](_0xa55e0f[_0xfdd4('0x73')],_0xa55e0f[_0xfdd4('0x69')][_0xfdd4('0x74')],_0xa55e0f[_0xfdd4('0x69')][_0xfdd4('0x2c')]);}break;case _0xfdd4('0x75'):var _0xb0bb50=_0x5c7be[_0xfdd4('0x69')][_0xfdd4('0x44')](',')[_0xfdd4('0x40')](function(_0x207a4c){return Number(_0x207a4c);});_0xb0bb50['forEach'](function(_0x4bac59){_0x2abe50['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4bac59+',%');});_0x1eee3d=_[_0xfdd4('0x76')](_0x1eee3d,_0xb0bb50);break;case _0xfdd4('0x77'):if(_0x5c7be['operator']===_0xfdd4('0x6e')){_0x14d07e[_0x4a5fe6](_0xfdd4('0x78'),'%'+_0x5c7be[_0xfdd4('0x69')]+'%',null);}else{_0x2ee4b6=_[_0xfdd4('0x67')](_0x419578,[_0xfdd4('0x38'),'UserId']);_0x5c7be[_0xfdd4('0x53')]=_0xfdd4('0x79');_0xa55e0f=as[_0xfdd4('0x7a')](_0x2cc3e2,_0x2ee4b6['type'],_0x5c7be);_0x14d07e[_0x4a5fe6](_0xa55e0f[_0xfdd4('0x73')],_0xa55e0f['value'][_0xfdd4('0x74')],_0xa55e0f[_0xfdd4('0x69')][_0xfdd4('0x2c')]);}break;case _0xfdd4('0x3c'):_0xa55e0f=as['buildExpression']('me',null,_0x5c7be);_0x14d07e[_0x4a5fe6](_0xa55e0f[_0xfdd4('0x73')],_0xa55e0f[_0xfdd4('0x69')]['start'],_0xa55e0f[_0xfdd4('0x69')][_0xfdd4('0x2c')]);break;}}else{var _0xa55e0f=as['buildExpression'](_0x2cc3e2,_0x2ee4b6[_0xfdd4('0x48')],_0x5c7be);_0x14d07e[_0x4a5fe6](_0xa55e0f[_0xfdd4('0x73')],_0xa55e0f[_0xfdd4('0x69')]['start'],_0xa55e0f[_0xfdd4('0x69')][_0xfdd4('0x2c')]);}}}else{var _0x427ded=_(_0x3a0de9[_0xfdd4('0x49')])[_0xfdd4('0x4a')]()[_0xfdd4('0x40')](function(_0x185226){return _['some'](_0x419578,[_0xfdd4('0x38'),_0x185226])?_0x185226:undefined;})[_0xfdd4('0x7b')]()[_0xfdd4('0x69')]();if(!_[_0xfdd4('0x7c')](_0x427ded)){_0x427ded[_0xfdd4('0x45')](function(_0x2cbd27){if(_0x2cbd27===_0xfdd4('0x7d')){_0x5848e1[_0xfdd4('0x7e')]('i.ChatWebsiteId\x20IN\x20?',[][_0xfdd4('0x7f')](_0x3a0de9['query'][_0x2cbd27]));}else if(_0x2cbd27==='createdAt'){var _0x40b2e8=JSON['parse'](_0x3a0de9[_0xfdd4('0x49')][_0x2cbd27])['$gte'];var _0x4576ce=JSON[_0xfdd4('0x80')](_0x3a0de9[_0xfdd4('0x49')][_0x2cbd27])[_0xfdd4('0x81')];_0x5848e1[_0xfdd4('0x7e')](_0xfdd4('0x82'),_0x40b2e8,_0x4576ce);}else{if(_0x3a0de9[_0xfdd4('0x49')][_0x2cbd27]==='null'){_0x5848e1['where']('i.'+_0x2cbd27+_0xfdd4('0x83'));}else{_0x5848e1['where']('i.'+_0x2cbd27+_0xfdd4('0x84'),_0x3a0de9[_0xfdd4('0x49')][_0x2cbd27]);}}});}if(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x85')]){if(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x85')]==0x1){_0x5848e1[_0xfdd4('0x6a')]('`unreadMessages`\x20=\x200');}else{_0x5848e1['having'](_0xfdd4('0x86'));}}if(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x87')]){_0x1eee3d=_[_0xfdd4('0x88')](_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x87')])?_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x87')]:new Array(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x87')]);_0x1eee3d[_0xfdd4('0x45')](function(_0x32abf5){_0x2abe50['or'](_0xfdd4('0x89'),'%,'+_0x32abf5+',%');});}if(_0x3a0de9['query']['filter']){var _0x3761f2=_0x3a0de9[_0xfdd4('0x49')]['filter']['replace']('\x5c','\x5c\x5c')[_0xfdd4('0x8a')](/'/g,'\x27\x27');if(qs[_0xfdd4('0x8b')](_0x3761f2)){_0x14d07e['or']('i.id\x20LIKE\x20?',_0x3761f2+'%');}else{_0x14d07e['or'](_0xfdd4('0x8c'),qs[_0xfdd4('0x70')](_0x3761f2))['or'](_0xfdd4('0x8d'),_0x3761f2+'%');}}}_0x5848e1[_0xfdd4('0x7e')](_0x14d07e);_0x5848e1[_0xfdd4('0x8e')](_0xfdd4('0x8f'));var _0x5d356c={'type':db[_0xfdd4('0x90')][_0xfdd4('0x91')][_0xfdd4('0x92')],'raw':!![]};var _0x2f8001=_0x5848e1[_0xfdd4('0x93')]();_0x2f8001[_0xfdd4('0x53')](_0xfdd4('0x8f'));_0x2f8001[_0xfdd4('0x53')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x3f7273[_0xfdd4('0x94')]){_0x3f7273['order'][_0xfdd4('0x45')](function(_0x1b4f61){var _0x298906=_0x1b4f61[0x0]===_0xfdd4('0x95')?_0x1b4f61[0x0]:'i.'+_0x1b4f61[0x0];_0x5848e1[_0xfdd4('0x94')](_0x298906,_0x1b4f61[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x1eee3d)){_0x5848e1[_0xfdd4('0x6a')](_0x2abe50);_0x2f8001['where'](_0xfdd4('0x96'),_0x1eee3d);}BPromise['resolve']()[_0xfdd4('0x20')](function(){if(!_0x45dcc8){if(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x7d')])return;_0x2f8001[_0xfdd4('0x7e')](_0xfdd4('0x97'));_0x5848e1[_0xfdd4('0x7e')](_0xfdd4('0x97'));return;}if(_0x3a0de9[_0xfdd4('0x98')][_0xfdd4('0x99')]!==_0xfdd4('0x9a'))return;return _0x3a0de9[_0xfdd4('0x98')]['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0xfdd4('0x20')](function(_0x1f9e08){if(_[_0xfdd4('0x7c')](_0x1f9e08)){_0x2f8001[_0xfdd4('0x7e')](_0xfdd4('0x9b'));_0x5848e1[_0xfdd4('0x7e')](_0xfdd4('0x9b'));}else{_0x2f8001[_0xfdd4('0x7e')](_0xfdd4('0x9c'),_['map'](_0x1f9e08,'id'));_0x5848e1['where'](_0xfdd4('0x9c'),_[_0xfdd4('0x40')](_0x1f9e08,'id'));}});})[_0xfdd4('0x20')](function(){if(_0x3a0de9['user'][_0xfdd4('0x99')]===_0xfdd4('0x9a')&&!_0x45dcc8&&!_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x7d')])return[];return db['sequelize']['query'](_0x2f8001[_0xfdd4('0x9d')](),_0x5d356c);})[_0xfdd4('0x20')](function(_0x3b75bf){_0x5367aa['count']=_0x3b75bf[_0xfdd4('0x50')];if(_0x5367aa[_0xfdd4('0x30')]===0x0)return[];return db[_0xfdd4('0x9e')][_0xfdd4('0x49')](_0x49bc61[_0xfdd4('0x9d')](),_0x5d356c)[_0xfdd4('0x20')](function(_0x524a8f){_0x35c032=_['keyBy'](_0x524a8f,'id');_0x5d356c=_[_0xfdd4('0x3b')](_0x5d356c,{'model':db[_0xfdd4('0x9f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x4f')]){_0x3f7273[_0xfdd4('0x4d')][_0xfdd4('0x45')](function(_0x46edc9){_0x5848e1[_0xfdd4('0x53')]('i.'+_0x46edc9);});}else{_0x5848e1['field'](_0xfdd4('0xa0'),'unreadMessages');_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xa1'),'Account.key');_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xa2'),_0xfdd4('0xa3'));_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xa4'),_0xfdd4('0x95'));_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xa5'));_0x5848e1[_0xfdd4('0x53')]('c.firstName',_0xfdd4('0xa6'));_0x5848e1['field'](_0xfdd4('0xa7'),'Contact.lastName');_0x5848e1['field'](_0xfdd4('0xa8'),_0xfdd4('0xa9'));_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xaa'),_0xfdd4('0xab'));_0x5848e1['field'](_0xfdd4('0xac'),_0xfdd4('0xad'));_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xae'),_0xfdd4('0xaf'));_0x5848e1[_0xfdd4('0x53')]('o.fullname',_0xfdd4('0xb0'));_0x5848e1[_0xfdd4('0x53')]('o.internal','Owner.internal');_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xb1'),_0xfdd4('0x43'));}if(_0x3f7273['limit'])_0x5848e1['limit'](_0x3f7273[_0xfdd4('0x2f')]);if(_0x3f7273[_0xfdd4('0x31')])_0x5848e1[_0xfdd4('0x31')](_0x3f7273['offset']);return db['sequelize'][_0xfdd4('0x49')](_0x5848e1[_0xfdd4('0x9d')](),_0x5d356c);})[_0xfdd4('0x20')](function(_0x4bfb31){if(_0x4bfb31[_0xfdd4('0x50')]>0x0)_0x4addd6['where'](_0xfdd4('0xb2'),_[_0xfdd4('0x40')](_0x4bfb31,'id'));return db[_0xfdd4('0x9e')]['query'](_0x4addd6[_0xfdd4('0x9d')](),_0x5d356c)[_0xfdd4('0x20')](function(_0x1efb08){var _0xe3296c=_[_0xfdd4('0xb3')](_0x1efb08,'ChatInteractionId');var _0x19de84=[];_0x4bfb31[_0xfdd4('0x45')](function(_0x133f56){_0x19de84['push'](updateChatInteraction(_0x133f56,_0x35c032,_0xe3296c));});return BPromise[_0xfdd4('0xb4')](_0x19de84);});});})[_0xfdd4('0x20')](function(_0xb9cb69){_0x5367aa[_0xfdd4('0xb5')]=_0xb9cb69;return _0x5367aa;})['then'](respondWithFilteredResult(_0x11f241,_0x3f7273))[_0xfdd4('0x29')](handleError(_0x11f241,null));};exports['show']=function(_0x4f5ca3,_0x528004){var _0x206a59={'raw':![],'where':{'id':_0x4f5ca3['params']['id']}},_0x545475={};_0x545475['model']=_[_0xfdd4('0x4a')](db[_0xfdd4('0x9f')][_0xfdd4('0x47')]);_0x545475[_0xfdd4('0x49')]=_[_0xfdd4('0x4a')](_0x4f5ca3[_0xfdd4('0x49')]);_0x545475[_0xfdd4('0x4b')]=_[_0xfdd4('0x4c')](_0x545475[_0xfdd4('0x4e')],_0x545475[_0xfdd4('0x49')]);_0x206a59[_0xfdd4('0x4d')]=_[_0xfdd4('0x4c')](_0x545475[_0xfdd4('0x4e')],qs[_0xfdd4('0x4f')](_0x4f5ca3[_0xfdd4('0x49')][_0xfdd4('0x4f')]));_0x206a59[_0xfdd4('0x4d')]=_0x206a59[_0xfdd4('0x4d')][_0xfdd4('0x50')]?_0x206a59[_0xfdd4('0x4d')]:_0x545475[_0xfdd4('0x4e')];if(_0x4f5ca3[_0xfdd4('0x49')][_0xfdd4('0xb6')]){_0x206a59[_0xfdd4('0xb7')]=[{'all':!![]}];}_0x206a59=_[_0xfdd4('0x3b')]({},_0x206a59,_0x4f5ca3[_0xfdd4('0xb8')]);return db['ChatInteraction'][_0xfdd4('0x67')](_0x206a59)[_0xfdd4('0x20')](handleEntityNotFound(_0x528004,null))[_0xfdd4('0x20')](respondWithResult(_0x528004,null))[_0xfdd4('0x29')](handleError(_0x528004,null));};exports[_0xfdd4('0xb9')]=function(_0x577bef,_0x3616e3){return db[_0xfdd4('0x9f')][_0xfdd4('0xb9')](_0x577bef[_0xfdd4('0x3c')],{})[_0xfdd4('0x20')](respondWithResult(_0x3616e3,0xc9))[_0xfdd4('0x29')](handleError(_0x3616e3,null));};exports['update']=function(_0x186d86,_0x1a9e62){if(_0x186d86[_0xfdd4('0x3c')]['id']){delete _0x186d86[_0xfdd4('0x3c')]['id'];}return db[_0xfdd4('0x9f')][_0xfdd4('0x67')]({'where':{'id':_0x186d86['params']['id']}})[_0xfdd4('0x20')](handleEntityNotFound(_0x1a9e62,null))[_0xfdd4('0x20')](saveUpdates(_0x186d86[_0xfdd4('0x3c')],null))['then'](respondWithResult(_0x1a9e62,null))[_0xfdd4('0x29')](handleError(_0x1a9e62,null));};exports[_0xfdd4('0x36')]=function(_0x4de363,_0x5159a5){return db[_0xfdd4('0x9f')][_0xfdd4('0x67')]({'where':{'id':_0x4de363[_0xfdd4('0xba')]['id']}})[_0xfdd4('0x20')](handleEntityNotFound(_0x5159a5,null))['then'](removeEntity(_0x5159a5,null))[_0xfdd4('0x29')](handleError(_0x5159a5,null));};exports['describe']=function(_0xc9955e,_0x42204a){return db[_0xfdd4('0x9f')][_0xfdd4('0xbb')]()[_0xfdd4('0x20')](respondWithResult(_0x42204a,null))[_0xfdd4('0x29')](handleError(_0x42204a,null));};exports[_0xfdd4('0xbc')]=function(_0x46e3ad,_0x29fcd4){var _0xe32bfc=_0x46e3ad[_0xfdd4('0xba')]['id'];var _0x5015a1;var _0xca4f26;var _0x42a3dc;return db[_0xfdd4('0x9f')][_0xfdd4('0xbd')]({'where':{'id':_0xe32bfc}})[_0xfdd4('0x20')](function(_0x4512b0){_0x5015a1=_0x4512b0;return db['ChatWebsite'][_0xfdd4('0xbd')]({'where':{'id':_0x4512b0[_0xfdd4('0x7d')]},'attributes':['id',_0xfdd4('0xbe'),_0xfdd4('0xbf'),'vidaooTopic',_0xfdd4('0xc0'),_0xfdd4('0xc1')],'raw':!![]});})['then'](function(_0x2d506e){if(_0x2d506e&&_0x2d506e[_0xfdd4('0xbe')]&&_0x2d506e[_0xfdd4('0xbf')]){_0xca4f26=_0x2d506e;var _0x204975={'interaction':{'id':_0xe32bfc},'agent':{'id':_0x46e3ad[_0xfdd4('0x98')]['id'],'name':_0x46e3ad[_0xfdd4('0x98')][_0xfdd4('0x38')],'fullname':_0x46e3ad[_0xfdd4('0x98')][_0xfdd4('0x41')],'email':_0x46e3ad[_0xfdd4('0x98')][_0xfdd4('0xc2')]},'contact':_0x46e3ad[_0xfdd4('0x3c')][_0xfdd4('0xc3')],'account':_0x46e3ad[_0xfdd4('0x3c')]['account']};var _0x42253b={'rejectUnauthorized':![],'method':_0xfdd4('0xc4'),'url':_0xfdd4('0xc5'),'headers':{'X-APIKEY':_0x2d506e[_0xfdd4('0xbe')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x46e3ad['user'][_0xfdd4('0xc2')]],'buttons':null,'topic':_0xca4f26[_0xfdd4('0xc6')],'note':_['isNull'](_0xca4f26[_0xfdd4('0xc0')])?null:getMustacheRender(_0xca4f26[_0xfdd4('0xc0')],_0x204975),'metadata':null},'redirect':_0xfdd4('0xc7'),'json':!![]};try{if(!_[_0xfdd4('0xc8')](_0xca4f26['vidaooMetadata'])){var _0x227fcf=getMustacheRender(_0xca4f26['vidaooMetadata'],_0x204975);var _0x2aa3d3=JSON[_0xfdd4('0x80')](_0x227fcf);_0x42253b['body'][_0xfdd4('0xc9')]=_0x2aa3d3;}}catch(_0x5e058b){throw new db['Sequelize'][(_0xfdd4('0xca'))](_0xfdd4('0xcb'));}return rp(_0x42253b);}else{throw new db[(_0xfdd4('0x90'))][(_0xfdd4('0xca'))]('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x28df36){_0x42a3dc=_0x28df36;if(_0x42a3dc['id']){var _0x1bb704={'body':_0x42a3dc['join_url'],'ChatWebsiteId':_0xca4f26['id'],'ChatInteractionId':_0x5015a1['id'],'direction':'out','UserId':_0x46e3ad[_0xfdd4('0x98')]['id']};return db[_0xfdd4('0xcc')][_0xfdd4('0xb9')](_0x1bb704,{});}else{throw new db['Sequelize'][(_0xfdd4('0xca'))](_0xfdd4('0xcd'));}})[_0xfdd4('0x20')](function(){return _0x5015a1[_0xfdd4('0xce')]({'vidaooSessionId':_0x42a3dc['id']});})['then'](respondWithResult(_0x29fcd4,null))[_0xfdd4('0x29')](handleError(_0x29fcd4,null));};exports[_0xfdd4('0xcf')]=function(_0x23dd10,_0x23746f){if(_0x23dd10[_0xfdd4('0x3c')]['id']){delete _0x23dd10['body']['id'];}return db[_0xfdd4('0x9f')][_0xfdd4('0x67')]({'where':{'id':_0x23dd10['params']['id']},'include':[{'model':db[_0xfdd4('0xd0')],'as':_0xfdd4('0x6d')}]})[_0xfdd4('0x20')](handleEntityNotFound(_0x23746f,null))[_0xfdd4('0x20')](saveUpdates(_0x23dd10[_0xfdd4('0x3c')],null))[_0xfdd4('0x20')](respondWithResult(_0x23746f,null))[_0xfdd4('0x29')](handleError(_0x23746f,null));};exports[_0xfdd4('0xd1')]=function(_0x3b6cfc,_0x20b6b1,_0x308201){if(_0x3b6cfc[_0xfdd4('0x3c')]['id']){delete _0x3b6cfc[_0xfdd4('0x3c')]['id'];}return db[_0xfdd4('0x9f')][_0xfdd4('0x67')]({'where':{'id':_0x3b6cfc['params']['id']}})['then'](function(_0x44b024){if(!_0x44b024){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xfdd4('0xd1'),0x194,_0xfdd4('0xd2'));_0x20b6b1[_0xfdd4('0x2a')](0x194);}else{if(_0x44b024[_0xfdd4('0x79')]){throw new db[(_0xfdd4('0x90'))][(_0xfdd4('0xca'))](_0xfdd4('0xd3'));}}return _0x44b024;})['then'](function(_0x24e4be){if(_0x24e4be){return _0x24e4be[_0xfdd4('0x35')]({'closed':_0x3b6cfc['body']['closed'],'disposition':_0x3b6cfc['body'][_0xfdd4('0xd4')]})['then'](function(_0x28d8d9){return _0x28d8d9;});}})['then'](function(_0x52ff15){return respondWithRpcPromise(_0xfdd4('0xd5'),_0xfdd4('0xd1'),_0x3b6cfc[_0xfdd4('0x3c')],client9004);})[_0xfdd4('0x20')](respondWithResult(_0x20b6b1,null))[_0xfdd4('0x29')](handleError(_0x20b6b1,null));};exports[_0xfdd4('0xd6')]=function(_0x461070,_0x17f504,_0x156173){_0x461070['body'][_0xfdd4('0x38')]=_0x461070[_0xfdd4('0xd7')]['originalname'];_0x461070[_0xfdd4('0x3c')][_0xfdd4('0xd8')]=_0x461070['file']['filename'];_0x461070['body']['type']=_0x461070[_0xfdd4('0xd7')][_0xfdd4('0xd9')];return db['Attachment'][_0xfdd4('0xb9')](_0x461070['body'])[_0xfdd4('0x20')](respondWithResult(_0x17f504,0xc9))[_0xfdd4('0x29')](handleError(_0x17f504,null));};exports[_0xfdd4('0xda')]=function(_0x2093a5,_0x2c36a3,_0x45fa09){return db[_0xfdd4('0x9f')]['findOne']({'where':{'id':_0x2093a5['params']['id']},'raw':!![]})[_0xfdd4('0x20')](handleEntityNotFound(_0x2c36a3,null))[_0xfdd4('0x20')](function(_0x2b65d7){if(_0x2b65d7){if(_0x2b65d7[_0xfdd4('0xdb')]){return _0x2c36a3[_0xfdd4('0x2b')](0x193)['json']({'status':0x193,'message':_0xfdd4('0xdc')});}return db[_0xfdd4('0xdd')][_0xfdd4('0xbd')]({'where':{'id':_0x2093a5['query']['attachId']},'raw':!![]})[_0xfdd4('0x20')](handleEntityNotFound(_0x2c36a3,null));}})[_0xfdd4('0x20')](function(_0x2f6456){if(_0x2f6456){var _0x1ff8d6=_0x2f6456[_0xfdd4('0xde')]!==null;var _0xa64a3b=path['join'](config['root'],_0xfdd4('0xdf'));if(_0x1ff8d6){_0xa64a3b=path[_0xfdd4('0xe0')](_0xa64a3b,_0xfdd4('0xe1'));}var _0x5a4bd4=path[_0xfdd4('0xe0')](_0xa64a3b,_0x2f6456['basename']);return _0x2c36a3[_0xfdd4('0xe2')](_0x5a4bd4);}})['catch'](handleError(_0x2c36a3,null));};exports[_0xfdd4('0xe3')]=function(_0x12beac,_0x5a78bc){var _0x2d1810=null;var _0x308050=null;var _0x1f1ec8=null;var _0x2e3342=null;if(_0x12beac['body']['id']){delete _0x12beac[_0xfdd4('0x3c')]['id'];}if(_0x12beac[_0xfdd4('0x3c')][_0xfdd4('0xe4')]){_0x2e3342=path[_0xfdd4('0xe0')](config[_0xfdd4('0xe5')],_0xfdd4('0xe6'),util['format'](_0xfdd4('0xe7'),Date['now']()));_0x12beac[_0xfdd4('0x3c')][_0xfdd4('0xe8')]=_0x2e3342;}return db[_0xfdd4('0x9f')][_0xfdd4('0x67')]({'where':{'id':_0x12beac[_0xfdd4('0xba')]['id']},'include':[{'model':db[_0xfdd4('0xcc')],'as':_0xfdd4('0xe9'),'include':[{'model':db[_0xfdd4('0x77')],'as':_0xfdd4('0x77')}]}]})[_0xfdd4('0x20')](handleEntityNotFound(_0x5a78bc,null))[_0xfdd4('0x20')](saveUpdates(_0x12beac[_0xfdd4('0x3c')],null))['then'](function(_0x13df51){if(_0x13df51){_0x2d1810=_0x13df51;return db['ChatWebsite'][_0xfdd4('0x67')]({'where':{'id':_0x2d1810['ChatWebsiteId']}});}})['then'](function(_0x17da2a){if(_0x17da2a){_0x1f1ec8=_0x17da2a;return db[_0xfdd4('0xd0')][_0xfdd4('0x67')]({'where':{'id':_0x2d1810[_0xfdd4('0x72')]}});}})[_0xfdd4('0x20')](function(_0x1cf955){if(_0x1cf955){_0x308050=_0x1cf955;if(_0x2e3342){var _0x2d74d1=null;for(var _0x5c70bf=0x1;_0x5c70bf<_0x2d1810[_0xfdd4('0xe9')][_0xfdd4('0x50')];++_0x5c70bf){_0x2d74d1=_0x2d1810[_0xfdd4('0xe9')][_0x5c70bf];var _0x5a7c66=_0x2d74d1[_0xfdd4('0x79')]?util[_0xfdd4('0xea')](_0xfdd4('0xeb'),_0x1f1ec8[_0xfdd4('0xec')],_0x2d74d1[_0xfdd4('0x79')]):_0xfdd4('0xed');var _0x43c681=_0x12beac[_0xfdd4('0x3c')][_0xfdd4('0xee')]||util[_0xfdd4('0xea')](_0xfdd4('0xeb'),'Visitor',_0x2d74d1['ContactId']);switch(_0x1f1ec8[_0xfdd4('0xef')]){case _0xfdd4('0xf0'):_0x5a7c66=_0x2d74d1[_0xfdd4('0x79')]?util[_0xfdd4('0xea')]('%s%d',_0x1f1ec8[_0xfdd4('0xec')],_0x2d74d1['UserId']):_0xfdd4('0xed');break;case _0xfdd4('0xf1'):_0x5a7c66=_0x2d74d1[_0xfdd4('0x79')]?_0x2d74d1['User'][_0xfdd4('0xf2')]||_0x2d74d1[_0xfdd4('0x77')][_0xfdd4('0x41')]:_0xfdd4('0xed');break;case _0xfdd4('0xf3'):_0x5a7c66=_0x2d74d1[_0xfdd4('0x79')]?_0x2d74d1[_0xfdd4('0x77')][_0xfdd4('0x41')]:_0xfdd4('0xed');break;default:_0x5a7c66=_0x2d74d1[_0xfdd4('0x79')]?util[_0xfdd4('0xea')]('%s%d',_0x1f1ec8[_0xfdd4('0xec')],_0x2d74d1[_0xfdd4('0x79')]):'System';}var _0x3621f3=util[_0xfdd4('0xea')](_0xfdd4('0xf4'),moment(_0x2d74d1[_0xfdd4('0xf5')])['format'](_0xfdd4('0xf6')),_0x2d74d1[_0xfdd4('0xf7')]==='in'?_0x43c681:_0x5a7c66,_0x2d74d1[_0xfdd4('0x3c')]);if(!_0x2d74d1[_0xfdd4('0xf8')]){fs[_0xfdd4('0xf9')](_0x2e3342,_0x3621f3);}}return db[_0xfdd4('0xfa')][_0xfdd4('0xbd')]({'where':{'service':!![]},'include':[{'model':db[_0xfdd4('0xfb')],'as':'Smtp','raw':!![]}]});}}})[_0xfdd4('0x20')](function(_0x4c248e){if(_0x4c248e&&_0x4c248e[_0xfdd4('0xfc')]&&_0x12beac['body']){var _0x5e8af7={'tls':{'rejectUnauthorized':![]}};if(_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0xfd')]){_0x5e8af7[_0xfdd4('0xfd')]=_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0xfd')];}else{_0x5e8af7[_0xfdd4('0xfe')]=_0x4c248e[_0xfdd4('0xfc')]['host'];_0x5e8af7[_0xfdd4('0xff')]=_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0xff')];_0x5e8af7[_0xfdd4('0x100')]=_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0x100')];}if(_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0x101')]){_0x5e8af7['auth']={'user':_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0x98')],'pass':_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0x102')]};}return respondWithRpcPromise(_0xfdd4('0x103'),_0xfdd4('0x104'),{'account':_0x5e8af7,'message':{'from':util[_0xfdd4('0xea')]('\x22%s\x22\x20<%s>',_0x4c248e['name'],_0x4c248e[_0xfdd4('0xc2')]||_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0x98')]),'to':_0x12beac[_0xfdd4('0x3c')][_0xfdd4('0xe4')],'subject':_0xfdd4('0x105'),'text':util[_0xfdd4('0xea')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x12beac[_0xfdd4('0x3c')][_0xfdd4('0xe4')]),'attachments':[{'path':_0x2e3342}]}})['then'](function(){return _0x2d1810;})['catch'](function(_0x1336e1){console[_0xfdd4('0x26')](_0x1336e1);});}else{return _0x2d1810;}})[_0xfdd4('0x20')](respondWithStatusCode(_0x5a78bc,0xc8))[_0xfdd4('0x29')](handleError(_0x5a78bc,null));};exports[_0xfdd4('0x106')]=function(_0x25656c,_0x5f51e6,_0x4fbd83){return db[_0xfdd4('0xcc')][_0xfdd4('0x67')]({'where':{'id':_0x25656c['params']['id']}})[_0xfdd4('0x20')](handleEntityNotFound(_0x5f51e6,null))['then'](function(_0x13cf75){if(_0x13cf75){return _0x13cf75[_0xfdd4('0x106')](_0x25656c[_0xfdd4('0x3c')][_0xfdd4('0x107')],_[_0xfdd4('0x108')](_0x25656c['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x5f51e6,null))[_0xfdd4('0x29')](handleError(_0x5f51e6,null));};exports['getMessages']=function(_0x106064,_0x536c4b,_0x7101d2){var _0x317d77={'raw':![],'where':{}};var _0x599d63={};var _0x529474={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xfdd4('0xbd')]({'where':{'id':_0x106064[_0xfdd4('0xba')]['id']}})[_0xfdd4('0x20')](handleEntityNotFound(_0x536c4b,null))[_0xfdd4('0x20')](function(_0x4c33bc){if(_0x4c33bc){_0x599d63['model']=_[_0xfdd4('0x4a')](db[_0xfdd4('0xcc')][_0xfdd4('0x47')]);_0x599d63[_0xfdd4('0x49')]=_[_0xfdd4('0x4a')](_0x106064[_0xfdd4('0x49')]);_0x599d63['filters']=_[_0xfdd4('0x4c')](_0x599d63[_0xfdd4('0x4e')],_0x599d63['query']);_0x317d77[_0xfdd4('0x4d')]=_['intersection'](_0x599d63[_0xfdd4('0x4e')],qs[_0xfdd4('0x4f')](_0x106064[_0xfdd4('0x49')][_0xfdd4('0x4f')]));_0x317d77[_0xfdd4('0x4d')]=_0x317d77[_0xfdd4('0x4d')][_0xfdd4('0x50')]?_0x317d77[_0xfdd4('0x4d')]:_0x599d63['model'];if(!_0x106064[_0xfdd4('0x49')][_0xfdd4('0x51')](_0xfdd4('0x109'))){_0x317d77[_0xfdd4('0x2f')]=qs['limit'](_0x106064[_0xfdd4('0x49')]['limit']);_0x317d77[_0xfdd4('0x31')]=qs[_0xfdd4('0x31')](_0x106064[_0xfdd4('0x49')]['offset']);}_0x317d77['order']=qs[_0xfdd4('0x10a')](_0x106064[_0xfdd4('0x49')]['sort']);_0x317d77[_0xfdd4('0x7e')]=qs['filters'](_['pick'](_0x106064[_0xfdd4('0x49')],_0x599d63[_0xfdd4('0x4b')]));_0x317d77[_0xfdd4('0x7e')][_0xfdd4('0x10b')]=_0x4c33bc['id'];if(_0x106064['query']['filter']){_0x317d77[_0xfdd4('0x7e')]=_[_0xfdd4('0x3b')](_0x317d77[_0xfdd4('0x7e')],{'$or':_['map'](_0x317d77[_0xfdd4('0x4d')],function(_0x2b1f92){var _0x57c9bb={};_0x57c9bb[_0x2b1f92]={'$like':'%'+_0x106064[_0xfdd4('0x49')]['filter']+'%'};return _0x57c9bb;})});}if(_0x106064[_0xfdd4('0x49')][_0xfdd4('0x10c')]){var _0x4b97fa=_0x106064['query']['$gte']['split'](',');var _0x54fec8={};_0x54fec8[_0x4b97fa[0x0]]={'$gte':moment(_0x4b97fa[0x1])[_0xfdd4('0xea')]('YYYY-MM-DD\x20HH:mm:ss')};_0x317d77[_0xfdd4('0x7e')]=_[_0xfdd4('0x3b')](_0x317d77[_0xfdd4('0x7e')],_0x54fec8);}_0x317d77=_[_0xfdd4('0x3b')]({},_0x317d77,_0x106064[_0xfdd4('0xb8')]);return db['ChatMessage']['count']({'where':_0x317d77[_0xfdd4('0x7e')]})[_0xfdd4('0x20')](function(_0x22c2b9){_0x529474[_0xfdd4('0x30')]=_0x22c2b9;if(_0x106064[_0xfdd4('0x49')][_0xfdd4('0xb6')]){_0x317d77[_0xfdd4('0xb7')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x317d77);})[_0xfdd4('0x20')](function(_0xa129e4){_0x529474[_0xfdd4('0xb5')]=_0xa129e4;return _0x529474;});}})[_0xfdd4('0x20')](respondWithFilteredResult(_0x536c4b,_0x317d77))[_0xfdd4('0x29')](handleError(_0x536c4b,null));};exports[_0xfdd4('0x10d')]=function(_0x18ad0c,_0x5ba916,_0x2d3c9f){var _0x5de8d0={'where':{}},_0x4f2eea={},_0x3341ae={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xfdd4('0xbd')]({'where':{'id':_0x18ad0c[_0xfdd4('0xba')]['id']}})['then'](handleEntityNotFound(_0x5ba916,null))[_0xfdd4('0x20')](function(_0x20c9f6){if(_0x20c9f6){_0x4f2eea[_0xfdd4('0x4e')]=_[_0xfdd4('0x4a')](db[_0xfdd4('0xcc')]['rawAttributes']);_0x4f2eea[_0xfdd4('0x49')]=_[_0xfdd4('0x4a')](_0x18ad0c[_0xfdd4('0x49')]);_0x4f2eea['filters']=_[_0xfdd4('0x4c')](_0x4f2eea[_0xfdd4('0x4e')],_0x4f2eea['query']);_0x5de8d0[_0xfdd4('0x4d')]=_[_0xfdd4('0x4c')](_0x4f2eea[_0xfdd4('0x4e')],qs[_0xfdd4('0x4f')](_0x18ad0c['query']['fields']));_0x5de8d0[_0xfdd4('0x4d')]=_0x5de8d0['attributes'][_0xfdd4('0x50')]?_0x5de8d0[_0xfdd4('0x4d')]:_0x4f2eea[_0xfdd4('0x4e')];if(!_0x18ad0c[_0xfdd4('0x49')][_0xfdd4('0x51')]('nolimit')){_0x5de8d0[_0xfdd4('0x2f')]=qs[_0xfdd4('0x2f')](_0x18ad0c['query'][_0xfdd4('0x2f')]);_0x5de8d0[_0xfdd4('0x31')]=qs[_0xfdd4('0x31')](_0x18ad0c['query'][_0xfdd4('0x31')]);}_0x5de8d0['order']=qs[_0xfdd4('0x10a')](_0x18ad0c['query']['sort']);_0x5de8d0[_0xfdd4('0x7e')]=qs[_0xfdd4('0x4b')](_[_0xfdd4('0x52')](_0x18ad0c[_0xfdd4('0x49')],_0x4f2eea[_0xfdd4('0x4b')]));_0x5de8d0[_0xfdd4('0x7e')]['ChatInteractionId']=_0x20c9f6['id'];if(_0x18ad0c[_0xfdd4('0x49')][_0xfdd4('0x10e')]){_0x5de8d0[_0xfdd4('0x7e')]=_['merge'](_0x5de8d0['where'],{'$or':_[_0xfdd4('0x40')](_0x5de8d0['attributes'],function(_0xa03de8){var _0x141042={};_0x141042[_0xa03de8]={'$like':'%'+_0x18ad0c[_0xfdd4('0x49')]['filter']+'%'};return _0x141042;})});}_0x5de8d0['where'][_0xfdd4('0xf8')]=![];if(_0x18ad0c[_0xfdd4('0x49')]['id']){_0x5de8d0[_0xfdd4('0x7e')]['id']={'$gt':_0x18ad0c[_0xfdd4('0x49')]['id']};}_0x5de8d0=_[_0xfdd4('0x3b')]({},_0x5de8d0,_0x18ad0c[_0xfdd4('0xb8')]);return db[_0xfdd4('0xcc')][_0xfdd4('0x30')]({'where':_0x5de8d0[_0xfdd4('0x7e')]})[_0xfdd4('0x20')](function(_0x21e917){_0x3341ae['count']=_0x21e917;_0x5de8d0[_0xfdd4('0xb7')]=[];if(_0x18ad0c[_0xfdd4('0x49')]['includeAgent']){_0x5de8d0[_0xfdd4('0xb7')][_0xfdd4('0x46')]({'model':db[_0xfdd4('0x77')],'as':_0xfdd4('0x77'),'attributes':['id',_0xfdd4('0x41'),_0xfdd4('0xf2')]});}if(_0x18ad0c[_0xfdd4('0x49')][_0xfdd4('0xb6')]){_0x5de8d0[_0xfdd4('0xb7')]=[{'all':!![]}];}return db[_0xfdd4('0xcc')][_0xfdd4('0x10f')](_0x5de8d0);})[_0xfdd4('0x20')](function(_0x1c18f8){_0x3341ae['rows']=_0x1c18f8;return _0x3341ae;});}})[_0xfdd4('0x20')](respondWithFilteredResult(_0x5ba916,_0x5de8d0))[_0xfdd4('0x29')](handleError(_0x5ba916,null));};exports['addTags']=function(_0x31db99,_0x692aa1,_0x1003d4){return db['ChatInteraction'][_0xfdd4('0x67')]({'where':{'id':_0x31db99[_0xfdd4('0xba')]['id']}})[_0xfdd4('0x20')](handleEntityNotFound(_0x692aa1,null))['then'](function(_0x5b5edb){if(_0x5b5edb){return _0x5b5edb[_0xfdd4('0x110')](_0x31db99[_0xfdd4('0x3c')][_0xfdd4('0x107')],_[_0xfdd4('0x108')](_0x31db99[_0xfdd4('0x3c')],[_0xfdd4('0x107'),'id'])||{})[_0xfdd4('0x111')](function(){return db[_0xfdd4('0x75')][_0xfdd4('0x10f')]({'attributes':['id',_0xfdd4('0x38'),'color'],'where':{'id':_0x31db99['body']['ids']}});})[_0xfdd4('0x20')](function(_0x1a8c71){socket[_0xfdd4('0x112')](_0xfdd4('0x113'),{'id':Number(_0x31db99[_0xfdd4('0xba')]['id']),'tags':_0x1a8c71||[]});return{'id':Number(_0x31db99[_0xfdd4('0xba')]['id']),'tags':_0x1a8c71||[]};});}})[_0xfdd4('0x20')](respondWithResult(_0x692aa1,null))['catch'](handleError(_0x692aa1,null));};exports[_0xfdd4('0x114')]=function(_0x456534,_0x1178b3,_0x272948){return db[_0xfdd4('0x9f')]['find']({'where':{'id':_0x456534[_0xfdd4('0xba')]['id']}})['then'](handleEntityNotFound(_0x1178b3,null))['then'](function(_0x360298){if(_0x360298){return _0x360298['removeTags'](_0x456534['query'][_0xfdd4('0x107')]);}})['then'](respondWithStatusCode(_0x1178b3,null))[_0xfdd4('0x29')](handleError(_0x1178b3,null));};exports[_0xfdd4('0xe2')]=function(_0x39f38f,_0x4a9e25){var _0x535d2b=moment()[_0xfdd4('0x115')]()[_0xfdd4('0x9d')]();var _0x24b726=path[_0xfdd4('0xe0')](config[_0xfdd4('0xe5')],'server','files',_0xfdd4('0x116'));var _0x260fe6=path[_0xfdd4('0xe0')](config[_0xfdd4('0xe5')],_0xfdd4('0x117'),_0xfdd4('0x118'),_0xfdd4('0x119'));var _0x4d52d3=path['join'](_0x24b726,_0x535d2b);var _0x31124f=util['format'](_0xfdd4('0x11a'),_0x39f38f['params']['id'],_0x535d2b);var _0x38e24c=path[_0xfdd4('0xe0')](_0x24b726,_0x31124f);var _0x25f9c9=[];_0x25f9c9[_0xfdd4('0x46')]({'model':db['User'],'as':_0xfdd4('0x77'),'attributes':['id',_0xfdd4('0x41')],'raw':!![]});_0x25f9c9['push']({'model':db[_0xfdd4('0xd0')],'as':'Contact','attributes':['id','firstName',_0xfdd4('0x11b')],'raw':!![]});if(_0x39f38f['query'][_0xfdd4('0x119')]){_0x25f9c9[_0xfdd4('0x46')]({'model':db[_0xfdd4('0xdd')],'as':_0xfdd4('0xdd'),'raw':!![]});}var _0x1a5c91=[{'model':db[_0xfdd4('0xcc')],'as':_0xfdd4('0xe9'),'attributes':['id','body',_0xfdd4('0xf5'),_0xfdd4('0xf7'),'secret','read'],'include':_0x25f9c9}];_0x1a5c91[_0xfdd4('0x46')]({'model':db[_0xfdd4('0x11c')],'as':_0xfdd4('0x11d'),'attributes':['id','name']});_0x1a5c91[_0xfdd4('0x46')]({'model':db[_0xfdd4('0x77')],'as':'Owner','attributes':['id','fullname']});return db[_0xfdd4('0x9f')]['find']({'where':{'id':_0x39f38f['params']['id']},'include':_0x1a5c91})[_0xfdd4('0x20')](handleEntityNotFound(_0x4a9e25,null))[_0xfdd4('0x20')](function(_0xbde236){if(_0xbde236){var _0x2de8b3=_0xbde236[_0xfdd4('0x11e')]({'plain':!![]});fs[_0xfdd4('0x11f')](_0x4d52d3);var _0x1563a5={'channel':_0xfdd4('0x120'),'account':_0x2de8b3[_0xfdd4('0x11d')][_0xfdd4('0x38')],'agent':_0x2de8b3[_0xfdd4('0x121')]?_0x2de8b3[_0xfdd4('0x121')]['fullname']:_0xfdd4('0x122'),'createdAt':moment(_0x2de8b3[_0xfdd4('0xf5')])[_0xfdd4('0xea')](_0xfdd4('0x123'))[_0xfdd4('0x9d')](),'closedAt':_0x2de8b3['closed']?moment(_0x2de8b3[_0xfdd4('0x124')])[_0xfdd4('0xea')]('YYYY-MM-DD\x20HH:mm:ss')[_0xfdd4('0x9d')]():'','disposition':_0x2de8b3['disposition'],'chatInfo':{'browser':_0x2de8b3[_0xfdd4('0x125')],'os':_0x2de8b3[_0xfdd4('0x126')],'referer':_0x2de8b3[_0xfdd4('0x127')],'customerIp':_0x2de8b3['customerIp'],'customerPort':_0x2de8b3[_0xfdd4('0x128')]?_0x2de8b3[_0xfdd4('0x128')]:_0xfdd4('0x122')},'messages':_(_0x2de8b3[_0xfdd4('0xe9')])['tail']()[_0xfdd4('0x10e')]({'secret':![]})[_0xfdd4('0x40')](function(_0x46e0e2){if(_0x46e0e2['Attachment']){var _0x306fc1=path[_0xfdd4('0xe0')](_0x260fe6,_0x46e0e2['Attachment'][_0xfdd4('0xd8')]);if(fs[_0xfdd4('0x129')](_0x306fc1)){fs[_0xfdd4('0x12a')](_0x306fc1)[_0xfdd4('0x12b')](fs[_0xfdd4('0x12c')](path['join'](_0x4d52d3,_0x46e0e2[_0xfdd4('0xdd')][_0xfdd4('0xd8')])));}}return{'date':moment(_0x46e0e2['createdAt'])[_0xfdd4('0xea')](_0xfdd4('0x123'))[_0xfdd4('0x9d')](),'sender':_0x46e0e2[_0xfdd4('0xf7')]===_0xfdd4('0x12d')?_0x46e0e2[_0xfdd4('0x77')]?_0x46e0e2[_0xfdd4('0x77')][_0xfdd4('0x41')]:'System':_0x46e0e2['Contact'][_0xfdd4('0x12e')]+(_0x46e0e2['Contact']['lastName']?'\x20'+_0x46e0e2[_0xfdd4('0x6d')]['lastName']:''),'body':_0x46e0e2[_0xfdd4('0xdd')]?_0x46e0e2[_0xfdd4('0xdd')]['basename']:_0x46e0e2[_0xfdd4('0x3c')],'direction':_0x46e0e2[_0xfdd4('0xf7')]===_0xfdd4('0x12d')?'A':'C','secret':_0x46e0e2[_0xfdd4('0xf8')],'read':_0x46e0e2[_0xfdd4('0x85')],'attachment':_0x46e0e2['Attachment']};})[_0xfdd4('0x69')]()};return ejs[_0xfdd4('0x12f')](path[_0xfdd4('0xe0')](config[_0xfdd4('0xe5')],_0xfdd4('0x117'),_0xfdd4('0x130'),_0xfdd4('0x131')),{'interaction':_0x1563a5})[_0xfdd4('0x20')](function(_0x5ac931){var _0x2b8e2b=path['join'](_0x4d52d3,_0xfdd4('0x132')+_0x2de8b3['id']+'-'+_0x535d2b+_0xfdd4('0x133'));var _0x4d5a93={'path':_0x2b8e2b,'channel':'Chat','interactionId':_0x2de8b3['id']};return pdf['createPdfFromHTML'](_0x5ac931,_0x4d5a93);})[_0xfdd4('0x20')](function(){return new BPromise(function(_0x4a323c,_0x384933){zipdir(_0x4d52d3,{'saveTo':_0x38e24c},function(_0x13a826,_0x4ce772){if(_0x13a826)return _0x384933(_0x13a826);return _0x4a323c(_0x4ce772);});})['then'](function(){return new BPromise(function(_0x199881,_0x1fa795){rimraf(_0x4d52d3,function(_0x453527){if(_0x453527)_0x1fa795(_0x453527);return _0x199881();});});})[_0xfdd4('0x20')](function(){return _0x4a9e25[_0xfdd4('0xe2')](_0x38e24c,_0x31124f,function(_0x4fa06b){if(_0x4fa06b){console['log'](_0xfdd4('0x134'),_0x4fa06b);}else{fs['unlinkSync'](_0x38e24c);}});});});}else{return _0x4a9e25[_0xfdd4('0x2a')](0xc8);}})[_0xfdd4('0x29')](handleError(_0x4a9e25,null));};
\ No newline at end of file
+var _0xbaf0=['../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','body','contact','agent','interaction','account','Users','map','fullname','TagIds','Tags','split','forEach','push','index','ChatInteraction','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','tools_tags','u.id','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','having','`\x20=\x200','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','value','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','compact','isEmpty','ChatWebsiteId','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\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','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','merge','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.*','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','c.mobile','Contact.mobile','c.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','params','rawAttributes','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','email','POST','isNull','vidaooNote','follow','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','updateAttributes','CmContact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','AbandonInteraction','file','originalname','basename','filename','mimetype','attachId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','format','transcript-%s.txt','pathTranscript','ChatMessage','Messages','User','%s%d','agentAlias','System','customer','website_alias','agent_alias','alias','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','pass','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','findAll','getMyMessages','includeAgent','addTags','setTags','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','attachments','firstName','lastName','Attachment','Owner','get','mkdirSync','Chat','YYYY-MM-DD\x20HH:mm:ss','disposition','browserName','osName','referer','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','pipe','createWriteStream','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x42a0c3,_0x29bac6){var _0x2c0678=function(_0xae2ed){while(--_0xae2ed){_0x42a0c3['push'](_0x42a0c3['shift']());}};_0x2c0678(++_0x29bac6);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0baf('0x0'));var zipdir=require(_0x0baf('0x1'));var jsonpatch=require(_0x0baf('0x2'));var rp=require(_0x0baf('0x3'));var moment=require(_0x0baf('0x4'));var BPromise=require(_0x0baf('0x5'));var Mustache=require('mustache');var util=require(_0x0baf('0x6'));var path=require(_0x0baf('0x7'));var sox=require(_0x0baf('0x8'));var csv=require(_0x0baf('0x9'));var ejs=require(_0x0baf('0xa'));var fs=require('fs');var fs_extra=require(_0x0baf('0xb'));var _=require(_0x0baf('0xc'));var squel=require(_0x0baf('0xd'));var crypto=require(_0x0baf('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0baf('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0baf('0x10'));var Papa=require(_0x0baf('0x11'));var Redis=require(_0x0baf('0x12'));var authService=require(_0x0baf('0x13'));var qs=require(_0x0baf('0x14'));var as=require(_0x0baf('0x15'));var pdf=require(_0x0baf('0x16'));var hardwareService=require(_0x0baf('0x17'));var logger=require(_0x0baf('0x18'))(_0x0baf('0x19'));var utils=require(_0x0baf('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0baf('0x1b'))['db'];config[_0x0baf('0x1c')]=_[_0x0baf('0x1d')](config[_0x0baf('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x0baf('0x1e'))(new Redis(config['redis']));require(_0x0baf('0x1f'))[_0x0baf('0x20')](socket);var jayson=require(_0x0baf('0x21'));var client=jayson[_0x0baf('0x22')][_0x0baf('0x23')]({'port':0x232b});var client9004=jayson[_0x0baf('0x22')]['http']({'port':0x232c});function respondWithRpcPromise(_0x4cd79d,_0x2312c7,_0x38395b,_0x283408){return new BPromise(function(_0x3d83a3,_0x2cf7da){var _0x288a98=_0x283408||client;return _0x288a98['request'](_0x4cd79d,_0x38395b)[_0x0baf('0x24')](function(_0xfbecec){logger[_0x0baf('0x25')](_0x0baf('0x26'),_0x2312c7,_0x0baf('0x27'));logger[_0x0baf('0x28')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2312c7,'request\x20sent',JSON[_0x0baf('0x29')](_0xfbecec));if(_0xfbecec[_0x0baf('0x2a')]){if(_0xfbecec[_0x0baf('0x2a')][_0x0baf('0x2b')]===0x1f4){logger[_0x0baf('0x2a')](_0x0baf('0x26'),_0x2312c7,_0xfbecec[_0x0baf('0x2a')][_0x0baf('0x2c')]);return _0x2cf7da(_0xfbecec[_0x0baf('0x2a')][_0x0baf('0x2c')]);}logger['error'](_0x0baf('0x26'),_0x2312c7,_0xfbecec['error'][_0x0baf('0x2c')]);return _0x3d83a3(_0xfbecec['error']['message']);}else{logger[_0x0baf('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x2312c7,'request\x20sent');_0x3d83a3(_0xfbecec[_0x0baf('0x2d')][_0x0baf('0x2c')]);}})[_0x0baf('0x2e')](function(_0x19d9fd){logger[_0x0baf('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x2312c7,_0x19d9fd);_0x2cf7da(_0x19d9fd);});});}function respondWithStatusCode(_0x448617,_0x4681c5){_0x4681c5=_0x4681c5||0xcc;return function(_0x1ca35a){if(_0x1ca35a){return _0x448617[_0x0baf('0x2f')](_0x4681c5);}return _0x448617[_0x0baf('0x30')](_0x4681c5)[_0x0baf('0x31')]();};}function respondWithResult(_0x453525,_0x549fd0){_0x549fd0=_0x549fd0||0xc8;return function(_0x1590b4){if(_0x1590b4){return _0x453525[_0x0baf('0x30')](_0x549fd0)[_0x0baf('0x32')](_0x1590b4);}};}function respondWithFilteredResult(_0x265915,_0x55c715){return function(_0x29dbdf){if(_0x29dbdf){var _0x34a58a=typeof _0x55c715['offset']===_0x0baf('0x33')&&typeof _0x55c715[_0x0baf('0x34')]===_0x0baf('0x33');var _0xb4dbb1=_0x29dbdf[_0x0baf('0x35')];var _0x366924=_0x34a58a?0x0:_0x55c715[_0x0baf('0x36')];var _0x57476f=_0x34a58a?_0x29dbdf[_0x0baf('0x35')]:_0x55c715[_0x0baf('0x36')]+_0x55c715[_0x0baf('0x34')];var _0x3ed995;if(_0x57476f>=_0xb4dbb1){_0x57476f=_0xb4dbb1;_0x3ed995=0xc8;}else{_0x3ed995=0xce;}_0x265915[_0x0baf('0x30')](_0x3ed995);return _0x265915[_0x0baf('0x37')](_0x0baf('0x38'),_0x366924+'-'+_0x57476f+'/'+_0xb4dbb1)[_0x0baf('0x32')](_0x29dbdf);}return null;};}function patchUpdates(_0x59431b){return function(_0x3ded64){try{jsonpatch[_0x0baf('0x39')](_0x3ded64,_0x59431b,!![]);}catch(_0x165d14){return BPromise[_0x0baf('0x3a')](_0x165d14);}return _0x3ded64[_0x0baf('0x3b')]();};}function saveUpdates(_0x57a6bb,_0x2fd426){return function(_0x53ae1d){if(_0x53ae1d){return _0x53ae1d[_0x0baf('0x3c')](_0x57a6bb)[_0x0baf('0x24')](function(_0x35e534){return _0x35e534;});}return null;};}function removeEntity(_0x3d65f2,_0x5300a5){return function(_0x1a2b03){if(_0x1a2b03){return _0x1a2b03[_0x0baf('0x3d')]()['then'](function(){_0x3d65f2[_0x0baf('0x30')](0xcc)[_0x0baf('0x31')]();});}};}function handleEntityNotFound(_0x62a2ed,_0xbaa9a7){return function(_0x1f60bd){if(!_0x1f60bd){_0x62a2ed[_0x0baf('0x2f')](0x194);}return _0x1f60bd;};}function handleError(_0xe03d82,_0x675461){_0x675461=_0x675461||0x1f4;return function(_0x4aa6ed){logger[_0x0baf('0x2a')](_0x4aa6ed[_0x0baf('0x3e')]);if(_0x4aa6ed['name']){delete _0x4aa6ed[_0x0baf('0x3f')];}_0xe03d82['status'](_0x675461)['send'](_0x4aa6ed);};}function getMustacheRender(_0x11bc49,_0x81af83){return Mustache['render'](_0x11bc49,_['merge'](_0x81af83[_0x0baf('0x40')],{'contact':_0x81af83[_0x0baf('0x41')],'message':_0x81af83[_0x0baf('0x2c')],'agent':_0x81af83[_0x0baf('0x42')],'interaction':_0x81af83[_0x0baf('0x43')],'account':_0x81af83[_0x0baf('0x44')]}))||'';}function getInteractionUsers(_0x290464,_0x37c038){return new BPromise(function(_0x631f74,_0x36c6d2){try{if(_0x37c038[_0x290464['id']]){_0x290464[_0x0baf('0x45')]=_[_0x0baf('0x46')](_0x37c038[_0x290464['id']],function(_0x354cb1){return{'id':_0x354cb1['id'],'fullname':_0x354cb1[_0x0baf('0x47')]};});}}catch(_0x53d6b7){_0x36c6d2(_0x53d6b7);}_0x631f74(_0x290464);});}function getInteractionTags(_0x3573ce,_0x1435d5){return new BPromise(function(_0x4f1de9,_0x38006a){try{if(_0x3573ce[_0x0baf('0x48')]){_0x3573ce[_0x0baf('0x49')]=[];_0x3573ce[_0x0baf('0x48')][_0x0baf('0x4a')](',')[_0x0baf('0x4b')](function(_0x57b581){_0x3573ce[_0x0baf('0x49')][_0x0baf('0x4c')](_0x1435d5[_0x57b581]);});}delete _0x3573ce['TagIds'];}catch(_0x35d442){_0x38006a(_0x35d442);}_0x4f1de9(_0x3573ce);});}function updateChatInteraction(_0x412e6f,_0x45c6aa,_0x57903e){return new BPromise(function(_0x504031,_0x193fd3){return getInteractionUsers(_0x412e6f,_0x57903e)[_0x0baf('0x24')](function(_0x301412){return getInteractionTags(_0x301412,_0x45c6aa);})[_0x0baf('0x24')](function(_0x2b6d54){_0x504031(_0x2b6d54);})[_0x0baf('0x2e')](function(_0x33da34){_0x193fd3(_0x33da34);});});}exports[_0x0baf('0x4d')]=function(_0xce1bf0,_0x355033){var _0x56270e={},_0x2a2a7c={},_0x2bc755={'count':0x0,'rows':[]};var _0x1daf1d=_[_0x0baf('0x46')](db[_0x0baf('0x4e')]['rawAttributes'],function(_0x1e7364){return{'name':_0x1e7364[_0x0baf('0x4f')],'type':_0x1e7364[_0x0baf('0x50')][_0x0baf('0x51')]};});_0x2a2a7c[_0x0baf('0x52')]=_['map'](_0x1daf1d,_0x0baf('0x3f'));_0x2a2a7c[_0x0baf('0x53')]=_[_0x0baf('0x54')](_0xce1bf0[_0x0baf('0x53')]);_0x2a2a7c[_0x0baf('0x55')]=_[_0x0baf('0x56')](_0x2a2a7c[_0x0baf('0x52')],_0x2a2a7c['query']);_0x56270e[_0x0baf('0x57')]=_[_0x0baf('0x56')](_0x2a2a7c[_0x0baf('0x52')],qs['fields'](_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x58')]));_0x56270e[_0x0baf('0x57')]=_0x56270e[_0x0baf('0x57')][_0x0baf('0x59')]?_0x56270e[_0x0baf('0x57')]:_0x2a2a7c[_0x0baf('0x52')];if(!_0xce1bf0['query'][_0x0baf('0x5a')](_0x0baf('0x5b'))){_0x56270e[_0x0baf('0x34')]=qs[_0x0baf('0x34')](_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x34')]);_0x56270e[_0x0baf('0x36')]=qs[_0x0baf('0x36')](_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x36')]);}_0x56270e[_0x0baf('0x5c')]=qs['sort'](_0xce1bf0['query'][_0x0baf('0x5d')]);_0x56270e[_0x0baf('0x5e')]=qs[_0x0baf('0x55')](_[_0x0baf('0x5f')](_0xce1bf0[_0x0baf('0x53')],_0x2a2a7c[_0x0baf('0x55')]),_0x1daf1d);var _0x3403d5=[];var _0x4b492c=squel[_0x0baf('0x60')]()[_0x0baf('0x61')]('id')[_0x0baf('0x61')](_0x0baf('0x3f'))[_0x0baf('0x61')](_0x0baf('0x62'))['from'](_0x0baf('0x63'));var _0x5f123c=squel[_0x0baf('0x60')]()['field'](_0x0baf('0x64'))['field'](_0x0baf('0x65'))['field'](_0x0baf('0x66'))[_0x0baf('0x67')](_0x0baf('0x68'),'ui')[_0x0baf('0x69')](_0x0baf('0x6a'),'u','u.id\x20=\x20ui.UserId');var _0x21f179=squel[_0x0baf('0x60')]()[_0x0baf('0x67')](_0x0baf('0x6b'),'i')[_0x0baf('0x69')](_0x0baf('0x6c'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x0baf('0x69')](_0x0baf('0x6a'),'o',_0x0baf('0x6d'))[_0x0baf('0x69')](_0x0baf('0x6e'),'a',_0x0baf('0x6f'))[_0x0baf('0x69')]('chat_messages','me','me.ChatInteractionId\x20=\x20i.id')[_0x0baf('0x69')](_0x0baf('0x70'),'it',_0x0baf('0x71'))[_0x0baf('0x69')](_0x0baf('0x63'),'t',_0x0baf('0x72'));var _0xaa4293=squel[_0x0baf('0x73')]();var _0x3d9a32=[];var _0x585969=squel[_0x0baf('0x73')]();var _0x268be8;if(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x74')]){_0x268be8=as[_0x0baf('0x75')](_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x74')]);var _0x51d75f=_0x268be8[_0x0baf('0x76')];for(var _0x27f580=0x0;_0x27f580<_0x268be8[_0x0baf('0x77')][_0x0baf('0x59')];_0x27f580++){var _0x1c7d88=_0x268be8[_0x0baf('0x77')][_0x27f580];var _0x14e6d0='i';var _0x12543e=_['find'](_0x1daf1d,[_0x0baf('0x3f'),_0x1c7d88['field']]);if(!_0x12543e){switch(_0x1c7d88[_0x0baf('0x61')]){case'unreadMessages':if(_0x1c7d88['value']==0x1){_0x21f179[_0x0baf('0x78')]('`'+_0x1c7d88['field']+_0x0baf('0x79'));}else{_0x21f179[_0x0baf('0x78')]('`'+_0x1c7d88['field']+_0x0baf('0x7a'));}break;case _0x0baf('0x7b'):if(_0x1c7d88[_0x0baf('0x7c')]==='$substring'){if(_0x1c7d88['value'][_0x0baf('0x4a')]('\x20')[_0x0baf('0x59')]>0x1){_0xaa4293[_0x51d75f](_0x0baf('0x7d'),qs[_0x0baf('0x7e')](_0x1c7d88[_0x0baf('0x7f')]),null);}else{var _0x588b88='%'+_0x1c7d88[_0x0baf('0x7f')]+'%';_0xaa4293[_0x51d75f]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x588b88,_0x588b88,_0x588b88);}}else{_0x12543e=_['find'](_0x1daf1d,['name',_0x0baf('0x80')]);_0x1c7d88['field']='ContactId';_0xf45ec3=as[_0x0baf('0x81')](_0x14e6d0,_0x12543e[_0x0baf('0x50')],_0x1c7d88);_0xaa4293[_0x51d75f](_0xf45ec3[_0x0baf('0x82')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x83')],_0xf45ec3[_0x0baf('0x7f')]['end']);}break;case _0x0baf('0x84'):var _0x1a0a67=_0x1c7d88[_0x0baf('0x7f')][_0x0baf('0x4a')](',')[_0x0baf('0x46')](function(_0x1273f4){return Number(_0x1273f4);});_0x1a0a67['forEach'](function(_0x42e8ad){_0x585969['or'](_0x0baf('0x85'),'%,'+_0x42e8ad+',%');});_0x3d9a32=_[_0x0baf('0x86')](_0x3d9a32,_0x1a0a67);break;case'User':if(_0x1c7d88[_0x0baf('0x7c')]===_0x0baf('0x87')){_0xaa4293[_0x51d75f](_0x0baf('0x88'),'%'+_0x1c7d88[_0x0baf('0x7f')]+'%',null);}else{_0x12543e=_[_0x0baf('0x89')](_0x1daf1d,[_0x0baf('0x3f'),_0x0baf('0x8a')]);_0x1c7d88['field']='UserId';_0xf45ec3=as['buildExpression'](_0x14e6d0,_0x12543e[_0x0baf('0x50')],_0x1c7d88);_0xaa4293[_0x51d75f](_0xf45ec3[_0x0baf('0x82')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x83')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x31')]);}break;case'body':_0xf45ec3=as['buildExpression']('me',null,_0x1c7d88);_0xaa4293[_0x51d75f](_0xf45ec3[_0x0baf('0x82')],_0xf45ec3['value'][_0x0baf('0x83')],_0xf45ec3[_0x0baf('0x7f')]['end']);break;}}else{var _0xf45ec3=as[_0x0baf('0x81')](_0x14e6d0,_0x12543e[_0x0baf('0x50')],_0x1c7d88);_0xaa4293[_0x51d75f](_0xf45ec3[_0x0baf('0x82')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x83')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x31')]);}}}else{var _0xfcc697=_(_0xce1bf0['query'])['keys']()['map'](function(_0x493784){return _['some'](_0x1daf1d,[_0x0baf('0x3f'),_0x493784])?_0x493784:undefined;})[_0x0baf('0x8b')]()[_0x0baf('0x7f')]();if(!_[_0x0baf('0x8c')](_0xfcc697)){_0xfcc697['forEach'](function(_0x1be7f2){if(_0x1be7f2===_0x0baf('0x8d')){_0x21f179['where']('i.ChatWebsiteId\x20IN\x20?',[][_0x0baf('0x8e')](_0xce1bf0[_0x0baf('0x53')][_0x1be7f2]));}else if(_0x1be7f2===_0x0baf('0x8f')){var _0x442e5f=JSON[_0x0baf('0x90')](_0xce1bf0[_0x0baf('0x53')][_0x1be7f2])[_0x0baf('0x91')];var _0x399f40=JSON['parse'](_0xce1bf0[_0x0baf('0x53')][_0x1be7f2])[_0x0baf('0x92')];_0x21f179['where'](_0x0baf('0x93'),_0x442e5f,_0x399f40);}else{if(_0xce1bf0[_0x0baf('0x53')][_0x1be7f2]==='null'){_0x21f179[_0x0baf('0x5e')]('i.'+_0x1be7f2+_0x0baf('0x94'));}else{_0x21f179[_0x0baf('0x5e')]('i.'+_0x1be7f2+_0x0baf('0x95'),_0xce1bf0[_0x0baf('0x53')][_0x1be7f2]);}}});}if(_0xce1bf0['query']['read']){if(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x96')]==0x1){_0x21f179['having'](_0x0baf('0x97'));}else{_0x21f179[_0x0baf('0x78')](_0x0baf('0x98'));}}if(_0xce1bf0['query'][_0x0baf('0x99')]){_0x3d9a32=_[_0x0baf('0x9a')](_0xce1bf0[_0x0baf('0x53')]['tag'])?_0xce1bf0[_0x0baf('0x53')]['tag']:new Array(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x99')]);_0x3d9a32[_0x0baf('0x4b')](function(_0x2f009f){_0x585969['or'](_0x0baf('0x85'),'%,'+_0x2f009f+',%');});}if(_0xce1bf0['query'][_0x0baf('0x9b')]){var _0x57f33c=_0xce1bf0['query'][_0x0baf('0x9b')][_0x0baf('0x9c')]('\x5c','\x5c\x5c')[_0x0baf('0x9c')](/'/g,'\x27\x27');if(qs[_0x0baf('0x9d')](_0x57f33c)){_0xaa4293['or'](_0x0baf('0x9e'),_0x57f33c+'%');}else{_0xaa4293['or'](_0x0baf('0x9f'),qs[_0x0baf('0x7e')](_0x57f33c))['or'](_0x0baf('0xa0'),_0x57f33c+'%');}}}_0x21f179[_0x0baf('0x5e')](_0xaa4293);_0x21f179[_0x0baf('0xa1')](_0x0baf('0xa2'));var _0x2c2f09={'type':db['Sequelize']['QueryTypes'][_0x0baf('0xa3')],'raw':!![]};var _0x322a09=_0x21f179[_0x0baf('0xa4')]();_0x322a09['field']('i.id');_0x322a09[_0x0baf('0x61')](_0x0baf('0xa5'),_0x0baf('0xa6'));if(_0x56270e[_0x0baf('0x5c')]){_0x56270e[_0x0baf('0x5c')][_0x0baf('0x4b')](function(_0x191d35){var _0xa2d315=_0x191d35[0x0]===_0x0baf('0xa7')?_0x191d35[0x0]:'i.'+_0x191d35[0x0];_0x21f179['order'](_0xa2d315,_0x191d35[0x1]===_0x0baf('0xa8')?![]:!![]);});}if(!_[_0x0baf('0x8c')](_0x3d9a32)){_0x21f179[_0x0baf('0x78')](_0x585969);_0x322a09[_0x0baf('0x5e')]('t.id\x20IN\x20?',_0x3d9a32);}BPromise['resolve']()['then'](function(){if(!_0x268be8){if(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x8d')])return;_0x322a09['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x21f179[_0x0baf('0x5e')](_0x0baf('0xa9'));return;}if(_0xce1bf0['user'][_0x0baf('0xaa')]!==_0x0baf('0x42'))return;return _0xce1bf0[_0x0baf('0xab')][_0x0baf('0xac')]({'attributes':['id'],'raw':!![]})[_0x0baf('0x24')](function(_0x25081e){if(_[_0x0baf('0x8c')](_0x25081e)){_0x322a09[_0x0baf('0x5e')](_0x0baf('0xad'));_0x21f179[_0x0baf('0x5e')](_0x0baf('0xad'));}else{_0x322a09[_0x0baf('0x5e')]('i.ChatWebsiteId\x20IN\x20?',_[_0x0baf('0x46')](_0x25081e,'id'));_0x21f179[_0x0baf('0x5e')](_0x0baf('0xae'),_[_0x0baf('0x46')](_0x25081e,'id'));}});})[_0x0baf('0x24')](function(){if(_0xce1bf0[_0x0baf('0xab')]['role']===_0x0baf('0x42')&&!_0x268be8&&!_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x8d')])return[];return db[_0x0baf('0xaf')][_0x0baf('0x53')](_0x322a09['toString'](),_0x2c2f09);})[_0x0baf('0x24')](function(_0x30eac8){_0x2bc755[_0x0baf('0x35')]=_0x30eac8[_0x0baf('0x59')];if(_0x2bc755[_0x0baf('0x35')]===0x0)return[];return db['sequelize']['query'](_0x4b492c[_0x0baf('0xb0')](),_0x2c2f09)['then'](function(_0x477cd5){_0x3403d5=_['keyBy'](_0x477cd5,'id');_0x2c2f09=_[_0x0baf('0xb1')](_0x2c2f09,{'model':db[_0x0baf('0x4e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x58')]){_0x56270e['attributes'][_0x0baf('0x4b')](function(_0x106ffa){_0x21f179[_0x0baf('0x61')]('i.'+_0x106ffa);});}else{_0x21f179['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x21f179['field'](_0x0baf('0xb2'),_0x0baf('0xb3'));_0x21f179[_0x0baf('0x61')](_0x0baf('0xb4'),'Account.mandatoryDisposition');_0x21f179[_0x0baf('0x61')](_0x0baf('0xb5'),_0x0baf('0xa7'));_0x21f179['field'](_0x0baf('0xb6'));_0x21f179[_0x0baf('0x61')]('c.firstName',_0x0baf('0xb7'));_0x21f179['field'](_0x0baf('0xb8'),_0x0baf('0xb9'));_0x21f179[_0x0baf('0x61')](_0x0baf('0xba'),'Contact.email');_0x21f179['field'](_0x0baf('0xbb'),'Contact.phone');_0x21f179[_0x0baf('0x61')](_0x0baf('0xbc'),_0x0baf('0xbd'));_0x21f179[_0x0baf('0x61')](_0x0baf('0xbe'),'Contact.fax');_0x21f179[_0x0baf('0x61')]('o.fullname',_0x0baf('0xbf'));_0x21f179['field'](_0x0baf('0xc0'),'Owner.internal');_0x21f179[_0x0baf('0x61')](_0x0baf('0xc1'),_0x0baf('0x48'));}if(_0x56270e['limit'])_0x21f179['limit'](_0x56270e[_0x0baf('0x34')]);if(_0x56270e[_0x0baf('0x36')])_0x21f179[_0x0baf('0x36')](_0x56270e[_0x0baf('0x36')]);return db[_0x0baf('0xaf')][_0x0baf('0x53')](_0x21f179['toString'](),_0x2c2f09);})[_0x0baf('0x24')](function(_0x5ee37f){if(_0x5ee37f[_0x0baf('0x59')]>0x0)_0x5f123c['where'](_0x0baf('0xc2'),_[_0x0baf('0x46')](_0x5ee37f,'id'));return db[_0x0baf('0xaf')]['query'](_0x5f123c[_0x0baf('0xb0')](),_0x2c2f09)[_0x0baf('0x24')](function(_0x4879b4){var _0x544498=_[_0x0baf('0xc3')](_0x4879b4,_0x0baf('0xc4'));var _0x20dd04=[];_0x5ee37f[_0x0baf('0x4b')](function(_0x4823a3){_0x20dd04['push'](updateChatInteraction(_0x4823a3,_0x3403d5,_0x544498));});return BPromise[_0x0baf('0xc5')](_0x20dd04);});});})[_0x0baf('0x24')](function(_0x116d52){_0x2bc755[_0x0baf('0xc6')]=_0x116d52;return _0x2bc755;})[_0x0baf('0x24')](respondWithFilteredResult(_0x355033,_0x56270e))[_0x0baf('0x2e')](handleError(_0x355033,null));};exports[_0x0baf('0xc7')]=function(_0xe0b67c,_0x205de6){var _0x2369f0={'raw':![],'where':{'id':_0xe0b67c[_0x0baf('0xc8')]['id']}},_0x58f95c={};_0x58f95c['model']=_[_0x0baf('0x54')](db[_0x0baf('0x4e')][_0x0baf('0xc9')]);_0x58f95c[_0x0baf('0x53')]=_['keys'](_0xe0b67c[_0x0baf('0x53')]);_0x58f95c[_0x0baf('0x55')]=_[_0x0baf('0x56')](_0x58f95c[_0x0baf('0x52')],_0x58f95c[_0x0baf('0x53')]);_0x2369f0[_0x0baf('0x57')]=_[_0x0baf('0x56')](_0x58f95c[_0x0baf('0x52')],qs[_0x0baf('0x58')](_0xe0b67c['query'][_0x0baf('0x58')]));_0x2369f0[_0x0baf('0x57')]=_0x2369f0['attributes'][_0x0baf('0x59')]?_0x2369f0[_0x0baf('0x57')]:_0x58f95c[_0x0baf('0x52')];if(_0xe0b67c[_0x0baf('0x53')][_0x0baf('0xca')]){_0x2369f0[_0x0baf('0xcb')]=[{'all':!![]}];}_0x2369f0=_[_0x0baf('0xb1')]({},_0x2369f0,_0xe0b67c[_0x0baf('0xcc')]);return db[_0x0baf('0x4e')]['find'](_0x2369f0)[_0x0baf('0x24')](handleEntityNotFound(_0x205de6,null))[_0x0baf('0x24')](respondWithResult(_0x205de6,null))[_0x0baf('0x2e')](handleError(_0x205de6,null));};exports[_0x0baf('0xcd')]=function(_0x4328d5,_0x270d69){return db['ChatInteraction'][_0x0baf('0xcd')](_0x4328d5[_0x0baf('0x40')],{})[_0x0baf('0x24')](respondWithResult(_0x270d69,0xc9))['catch'](handleError(_0x270d69,null));};exports['update']=function(_0x5adbd9,_0x1adb84){if(_0x5adbd9[_0x0baf('0x40')]['id']){delete _0x5adbd9['body']['id'];}return db[_0x0baf('0x4e')]['find']({'where':{'id':_0x5adbd9[_0x0baf('0xc8')]['id']}})['then'](handleEntityNotFound(_0x1adb84,null))[_0x0baf('0x24')](saveUpdates(_0x5adbd9[_0x0baf('0x40')],null))['then'](respondWithResult(_0x1adb84,null))[_0x0baf('0x2e')](handleError(_0x1adb84,null));};exports[_0x0baf('0x3d')]=function(_0x25d25e,_0x4494de){return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x25d25e[_0x0baf('0xc8')]['id']}})['then'](handleEntityNotFound(_0x4494de,null))[_0x0baf('0x24')](removeEntity(_0x4494de,null))[_0x0baf('0x2e')](handleError(_0x4494de,null));};exports[_0x0baf('0xce')]=function(_0x2e1629,_0x275cc4){return db[_0x0baf('0x4e')][_0x0baf('0xce')]()[_0x0baf('0x24')](respondWithResult(_0x275cc4,null))[_0x0baf('0x2e')](handleError(_0x275cc4,null));};exports[_0x0baf('0xcf')]=function(_0x308b3f,_0xae8bc2){var _0x1390cd=_0x308b3f[_0x0baf('0xc8')]['id'];var _0x59dd6c;var _0x57b64b;var _0x1cd215;return db[_0x0baf('0x4e')][_0x0baf('0xd0')]({'where':{'id':_0x1390cd}})[_0x0baf('0x24')](function(_0x52e98a){_0x59dd6c=_0x52e98a;return db[_0x0baf('0xd1')][_0x0baf('0xd0')]({'where':{'id':_0x52e98a[_0x0baf('0x8d')]},'attributes':['id',_0x0baf('0xd2'),_0x0baf('0xd3'),_0x0baf('0xd4'),'vidaooNote',_0x0baf('0xd5')],'raw':!![]});})[_0x0baf('0x24')](function(_0x347c39){if(_0x347c39&&_0x347c39['vidaooApiKey']&&_0x347c39[_0x0baf('0xd3')]){_0x57b64b=_0x347c39;var _0x106c6e={'interaction':{'id':_0x1390cd},'agent':{'id':_0x308b3f[_0x0baf('0xab')]['id'],'name':_0x308b3f['user']['name'],'fullname':_0x308b3f['user'][_0x0baf('0x47')],'email':_0x308b3f['user'][_0x0baf('0xd6')]},'contact':_0x308b3f[_0x0baf('0x40')]['contact'],'account':_0x308b3f[_0x0baf('0x40')]['account']};var _0x5737b0={'rejectUnauthorized':![],'method':_0x0baf('0xd7'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x347c39[_0x0baf('0xd2')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x308b3f['user']['email']],'buttons':null,'topic':_0x57b64b['vidaooTopic'],'note':_[_0x0baf('0xd8')](_0x57b64b[_0x0baf('0xd9')])?null:getMustacheRender(_0x57b64b[_0x0baf('0xd9')],_0x106c6e),'metadata':null},'redirect':_0x0baf('0xda'),'json':!![]};try{if(!_[_0x0baf('0xd8')](_0x57b64b[_0x0baf('0xd5')])){var _0x20582a=getMustacheRender(_0x57b64b['vidaooMetadata'],_0x106c6e);var _0x36cd08=JSON[_0x0baf('0x90')](_0x20582a);_0x5737b0[_0x0baf('0x40')]['metadata']=_0x36cd08;}}catch(_0x24672f){throw new db[(_0x0baf('0xdb'))][(_0x0baf('0xdc'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x5737b0);}else{throw new db[(_0x0baf('0xdb'))]['ValidationError'](_0x0baf('0xdd'));}})[_0x0baf('0x24')](function(_0x57846e){_0x1cd215=_0x57846e;if(_0x1cd215['id']){var _0xd4ed40={'body':_0x1cd215[_0x0baf('0xde')],'ChatWebsiteId':_0x57b64b['id'],'ChatInteractionId':_0x59dd6c['id'],'direction':_0x0baf('0xdf'),'UserId':_0x308b3f[_0x0baf('0xab')]['id']};return db['ChatMessage'][_0x0baf('0xcd')](_0xd4ed40,{});}else{throw new db[(_0x0baf('0xdb'))]['ValidationError']('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x0baf('0x24')](function(){return _0x59dd6c[_0x0baf('0xe0')]({'vidaooSessionId':_0x1cd215['id']});})[_0x0baf('0x24')](respondWithResult(_0xae8bc2,null))[_0x0baf('0x2e')](handleError(_0xae8bc2,null));};exports['customUpdate']=function(_0x5571d4,_0x16579f){if(_0x5571d4[_0x0baf('0x40')]['id']){delete _0x5571d4[_0x0baf('0x40')]['id'];}return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x5571d4['params']['id']},'include':[{'model':db[_0x0baf('0xe1')],'as':_0x0baf('0x7b')}]})['then'](handleEntityNotFound(_0x16579f,null))[_0x0baf('0x24')](saveUpdates(_0x5571d4[_0x0baf('0x40')],null))['then'](respondWithResult(_0x16579f,null))[_0x0baf('0x2e')](handleError(_0x16579f,null));};exports[_0x0baf('0xe2')]=function(_0x19457c,_0x1f0b00,_0x2484d4){if(_0x19457c[_0x0baf('0x40')]['id']){delete _0x19457c[_0x0baf('0x40')]['id'];}return db[_0x0baf('0x4e')]['find']({'where':{'id':_0x19457c[_0x0baf('0xc8')]['id']}})[_0x0baf('0x24')](function(_0x226edd){if(!_0x226edd){logger[_0x0baf('0x2a')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x0baf('0xe2'),0x194,_0x0baf('0xe3'));_0x1f0b00['sendStatus'](0x194);}else{if(_0x226edd[_0x0baf('0x8a')]){throw new db[(_0x0baf('0xdb'))][(_0x0baf('0xdc'))](_0x0baf('0xe4'));}}return _0x226edd;})['then'](function(_0x3ca1a6){if(_0x3ca1a6){return _0x3ca1a6[_0x0baf('0x3c')]({'closed':_0x19457c[_0x0baf('0x40')][_0x0baf('0xe5')],'disposition':_0x19457c[_0x0baf('0x40')]['disposition']})[_0x0baf('0x24')](function(_0xc5ec1a){return _0xc5ec1a;});}})[_0x0baf('0x24')](function(_0x5d33b4){return respondWithRpcPromise(_0x0baf('0xe6'),_0x0baf('0xe2'),_0x19457c[_0x0baf('0x40')],client9004);})[_0x0baf('0x24')](respondWithResult(_0x1f0b00,null))[_0x0baf('0x2e')](handleError(_0x1f0b00,null));};exports['attachmentUpload']=function(_0x553084,_0x19898e,_0x315ada){_0x553084[_0x0baf('0x40')]['name']=_0x553084[_0x0baf('0xe7')][_0x0baf('0xe8')];_0x553084[_0x0baf('0x40')][_0x0baf('0xe9')]=_0x553084[_0x0baf('0xe7')][_0x0baf('0xea')];_0x553084[_0x0baf('0x40')][_0x0baf('0x50')]=_0x553084[_0x0baf('0xe7')][_0x0baf('0xeb')];return db['Attachment'][_0x0baf('0xcd')](_0x553084[_0x0baf('0x40')])[_0x0baf('0x24')](respondWithResult(_0x19898e,0xc9))[_0x0baf('0x2e')](handleError(_0x19898e,null));};exports['attachmentDownload']=function(_0x413d0d,_0x3d7667,_0x386928){return db['ChatInteraction'][_0x0baf('0xd0')]({'where':{'id':_0x413d0d[_0x0baf('0xc8')]['id']},'raw':!![]})[_0x0baf('0x24')](handleEntityNotFound(_0x3d7667,null))[_0x0baf('0x24')](function(_0x1e4bf1){if(_0x1e4bf1){if(_0x1e4bf1['closed']){return _0x3d7667[_0x0baf('0x30')](0x193)[_0x0baf('0x32')]({'status':0x193,'message':'Unauthorized'});}return db['Attachment'][_0x0baf('0xd0')]({'where':{'id':_0x413d0d[_0x0baf('0x53')][_0x0baf('0xec')]},'raw':!![]})[_0x0baf('0x24')](handleEntityNotFound(_0x3d7667,null));}})[_0x0baf('0x24')](function(_0xb22125){if(_0xb22125){var _0x37c83a=_0xb22125['ChatOfflineMessageId']!==null;var _0x5deb7b=path[_0x0baf('0xed')](config[_0x0baf('0xee')],_0x0baf('0xef'));if(_0x37c83a){_0x5deb7b=path['join'](_0x5deb7b,_0x0baf('0xf0'));}var _0x3a6bf8=path['join'](_0x5deb7b,_0xb22125[_0x0baf('0xe9')]);return _0x3d7667[_0x0baf('0xf1')](_0x3a6bf8);}})['catch'](handleError(_0x3d7667,null));};exports[_0x0baf('0xf2')]=function(_0x9d6974,_0x939365){var _0x4d6ac4=null;var _0x1d86c9=null;var _0x95fe84=null;var _0x2a7138=null;if(_0x9d6974[_0x0baf('0x40')]['id']){delete _0x9d6974[_0x0baf('0x40')]['id'];}if(_0x9d6974[_0x0baf('0x40')][_0x0baf('0xf3')]){_0x2a7138=path['join'](config[_0x0baf('0xee')],'server/files/chat/upload/',util[_0x0baf('0xf4')](_0x0baf('0xf5'),Date['now']()));_0x9d6974['body'][_0x0baf('0xf6')]=_0x2a7138;}return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x9d6974['params']['id']},'include':[{'model':db[_0x0baf('0xf7')],'as':_0x0baf('0xf8'),'include':[{'model':db[_0x0baf('0xf9')],'as':_0x0baf('0xf9')}]}]})[_0x0baf('0x24')](handleEntityNotFound(_0x939365,null))[_0x0baf('0x24')](saveUpdates(_0x9d6974[_0x0baf('0x40')],null))[_0x0baf('0x24')](function(_0x5f3691){if(_0x5f3691){_0x4d6ac4=_0x5f3691;return db['ChatWebsite'][_0x0baf('0x89')]({'where':{'id':_0x4d6ac4[_0x0baf('0x8d')]}});}})['then'](function(_0x210047){if(_0x210047){_0x95fe84=_0x210047;return db[_0x0baf('0xe1')][_0x0baf('0x89')]({'where':{'id':_0x4d6ac4[_0x0baf('0x80')]}});}})[_0x0baf('0x24')](function(_0x8806f9){if(_0x8806f9){_0x1d86c9=_0x8806f9;if(_0x2a7138){var _0x1cb69a=null;for(var _0x4bc31f=0x1;_0x4bc31f<_0x4d6ac4[_0x0baf('0xf8')]['length'];++_0x4bc31f){_0x1cb69a=_0x4d6ac4[_0x0baf('0xf8')][_0x4bc31f];var _0x32abf2=_0x1cb69a['UserId']?util['format'](_0x0baf('0xfa'),_0x95fe84[_0x0baf('0xfb')],_0x1cb69a[_0x0baf('0x8a')]):_0x0baf('0xfc');var _0x4759d5=_0x9d6974[_0x0baf('0x40')][_0x0baf('0xfd')]||util['format']('%s%d','Visitor',_0x1cb69a[_0x0baf('0x80')]);switch(_0x95fe84['agentIdentifier']){case _0x0baf('0xfe'):_0x32abf2=_0x1cb69a[_0x0baf('0x8a')]?util['format']('%s%d',_0x95fe84[_0x0baf('0xfb')],_0x1cb69a[_0x0baf('0x8a')]):_0x0baf('0xfc');break;case _0x0baf('0xff'):_0x32abf2=_0x1cb69a[_0x0baf('0x8a')]?_0x1cb69a['User'][_0x0baf('0x100')]||_0x1cb69a[_0x0baf('0xf9')][_0x0baf('0x47')]:_0x0baf('0xfc');break;case _0x0baf('0x101'):_0x32abf2=_0x1cb69a[_0x0baf('0x8a')]?_0x1cb69a['User'][_0x0baf('0x47')]:_0x0baf('0xfc');break;default:_0x32abf2=_0x1cb69a[_0x0baf('0x8a')]?util['format'](_0x0baf('0xfa'),_0x95fe84[_0x0baf('0xfb')],_0x1cb69a['UserId']):_0x0baf('0xfc');}var _0xe93008=util[_0x0baf('0xf4')](_0x0baf('0x102'),moment(_0x1cb69a['createdAt'])['format'](_0x0baf('0x103')),_0x1cb69a[_0x0baf('0x104')]==='in'?_0x4759d5:_0x32abf2,_0x1cb69a['body']);if(!_0x1cb69a[_0x0baf('0x105')]){fs[_0x0baf('0x106')](_0x2a7138,_0xe93008);}}return db[_0x0baf('0x107')][_0x0baf('0xd0')]({'where':{'service':!![]},'include':[{'model':db[_0x0baf('0x108')],'as':'Smtp','raw':!![]}]});}}})[_0x0baf('0x24')](function(_0x1fe362){if(_0x1fe362&&_0x1fe362[_0x0baf('0x109')]&&_0x9d6974[_0x0baf('0x40')]){var _0x51287e={'tls':{'rejectUnauthorized':![]}};if(_0x1fe362[_0x0baf('0x109')]['service']){_0x51287e[_0x0baf('0x10a')]=_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10a')];}else{_0x51287e['host']=_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10b')];_0x51287e[_0x0baf('0x10c')]=_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10c')];_0x51287e[_0x0baf('0x10d')]=_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10d')];}if(_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10e')]){_0x51287e[_0x0baf('0x10f')]={'user':_0x1fe362[_0x0baf('0x109')]['user'],'pass':_0x1fe362['Smtp'][_0x0baf('0x110')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x51287e,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x1fe362[_0x0baf('0x3f')],_0x1fe362[_0x0baf('0xd6')]||_0x1fe362['Smtp']['user']),'to':_0x9d6974['body']['mailTranscript'],'subject':_0x0baf('0x111'),'text':util['format'](_0x0baf('0x112'),_0x9d6974[_0x0baf('0x40')][_0x0baf('0xf3')]),'attachments':[{'path':_0x2a7138}]}})[_0x0baf('0x24')](function(){return _0x4d6ac4;})[_0x0baf('0x2e')](function(_0x292469){console[_0x0baf('0x2a')](_0x292469);});}else{return _0x4d6ac4;}})[_0x0baf('0x24')](respondWithStatusCode(_0x939365,0xc8))['catch'](handleError(_0x939365,null));};exports['addMessage']=function(_0x2d7ec3,_0x2a4d79,_0x5ebcad){return db[_0x0baf('0xf7')]['find']({'where':{'id':_0x2d7ec3[_0x0baf('0xc8')]['id']}})['then'](handleEntityNotFound(_0x2a4d79,null))['then'](function(_0x4621ba){if(_0x4621ba){return _0x4621ba[_0x0baf('0x113')](_0x2d7ec3[_0x0baf('0x40')][_0x0baf('0x114')],_[_0x0baf('0x115')](_0x2d7ec3[_0x0baf('0x40')],[_0x0baf('0x114'),'id'])||{});}})[_0x0baf('0x24')](respondWithResult(_0x2a4d79,null))[_0x0baf('0x2e')](handleError(_0x2a4d79,null));};exports[_0x0baf('0x116')]=function(_0x425869,_0x4059e1,_0x2c94ff){var _0x738da0={'raw':![],'where':{}};var _0x268a1c={};var _0x34cb32={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x0baf('0xd0')]({'where':{'id':_0x425869[_0x0baf('0xc8')]['id']}})['then'](handleEntityNotFound(_0x4059e1,null))[_0x0baf('0x24')](function(_0x39526b){if(_0x39526b){_0x268a1c['model']=_[_0x0baf('0x54')](db['ChatMessage'][_0x0baf('0xc9')]);_0x268a1c['query']=_[_0x0baf('0x54')](_0x425869['query']);_0x268a1c[_0x0baf('0x55')]=_[_0x0baf('0x56')](_0x268a1c[_0x0baf('0x52')],_0x268a1c[_0x0baf('0x53')]);_0x738da0['attributes']=_[_0x0baf('0x56')](_0x268a1c[_0x0baf('0x52')],qs[_0x0baf('0x58')](_0x425869[_0x0baf('0x53')]['fields']));_0x738da0['attributes']=_0x738da0[_0x0baf('0x57')][_0x0baf('0x59')]?_0x738da0[_0x0baf('0x57')]:_0x268a1c[_0x0baf('0x52')];if(!_0x425869['query'][_0x0baf('0x5a')](_0x0baf('0x5b'))){_0x738da0[_0x0baf('0x34')]=qs['limit'](_0x425869['query'][_0x0baf('0x34')]);_0x738da0['offset']=qs[_0x0baf('0x36')](_0x425869['query'][_0x0baf('0x36')]);}_0x738da0[_0x0baf('0x5c')]=qs[_0x0baf('0x5d')](_0x425869['query'][_0x0baf('0x5d')]);_0x738da0[_0x0baf('0x5e')]=qs['filters'](_['pick'](_0x425869[_0x0baf('0x53')],_0x268a1c['filters']));_0x738da0[_0x0baf('0x5e')][_0x0baf('0xc4')]=_0x39526b['id'];if(_0x425869['query']['filter']){_0x738da0[_0x0baf('0x5e')]=_[_0x0baf('0xb1')](_0x738da0['where'],{'$or':_[_0x0baf('0x46')](_0x738da0['attributes'],function(_0x309220){var _0x376eb3={};_0x376eb3[_0x309220]={'$like':'%'+_0x425869['query'][_0x0baf('0x9b')]+'%'};return _0x376eb3;})});}if(_0x425869[_0x0baf('0x53')][_0x0baf('0x91')]){var _0x2ef76b=_0x425869[_0x0baf('0x53')]['$gte'][_0x0baf('0x4a')](',');var _0x4ca9ea={};_0x4ca9ea[_0x2ef76b[0x0]]={'$gte':moment(_0x2ef76b[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x738da0[_0x0baf('0x5e')]=_[_0x0baf('0xb1')](_0x738da0['where'],_0x4ca9ea);}_0x738da0=_[_0x0baf('0xb1')]({},_0x738da0,_0x425869[_0x0baf('0xcc')]);return db['ChatMessage'][_0x0baf('0x35')]({'where':_0x738da0[_0x0baf('0x5e')]})[_0x0baf('0x24')](function(_0x3d6ece){_0x34cb32[_0x0baf('0x35')]=_0x3d6ece;if(_0x425869[_0x0baf('0x53')][_0x0baf('0xca')]){_0x738da0[_0x0baf('0xcb')]=[{'all':!![]}];}return db[_0x0baf('0xf7')][_0x0baf('0x117')](_0x738da0);})['then'](function(_0x19727f){_0x34cb32[_0x0baf('0xc6')]=_0x19727f;return _0x34cb32;});}})[_0x0baf('0x24')](respondWithFilteredResult(_0x4059e1,_0x738da0))[_0x0baf('0x2e')](handleError(_0x4059e1,null));};exports[_0x0baf('0x118')]=function(_0x57b26e,_0x3a0a2f,_0x5b676d){var _0x298155={'where':{}},_0xff9b69={},_0x5398c6={'count':0x0,'rows':[]};return db[_0x0baf('0x4e')][_0x0baf('0xd0')]({'where':{'id':_0x57b26e[_0x0baf('0xc8')]['id']}})[_0x0baf('0x24')](handleEntityNotFound(_0x3a0a2f,null))['then'](function(_0x2edcf9){if(_0x2edcf9){_0xff9b69[_0x0baf('0x52')]=_[_0x0baf('0x54')](db[_0x0baf('0xf7')][_0x0baf('0xc9')]);_0xff9b69[_0x0baf('0x53')]=_[_0x0baf('0x54')](_0x57b26e[_0x0baf('0x53')]);_0xff9b69[_0x0baf('0x55')]=_[_0x0baf('0x56')](_0xff9b69[_0x0baf('0x52')],_0xff9b69[_0x0baf('0x53')]);_0x298155[_0x0baf('0x57')]=_[_0x0baf('0x56')](_0xff9b69[_0x0baf('0x52')],qs[_0x0baf('0x58')](_0x57b26e[_0x0baf('0x53')][_0x0baf('0x58')]));_0x298155['attributes']=_0x298155[_0x0baf('0x57')][_0x0baf('0x59')]?_0x298155[_0x0baf('0x57')]:_0xff9b69[_0x0baf('0x52')];if(!_0x57b26e[_0x0baf('0x53')][_0x0baf('0x5a')](_0x0baf('0x5b'))){_0x298155['limit']=qs[_0x0baf('0x34')](_0x57b26e[_0x0baf('0x53')][_0x0baf('0x34')]);_0x298155[_0x0baf('0x36')]=qs[_0x0baf('0x36')](_0x57b26e[_0x0baf('0x53')][_0x0baf('0x36')]);}_0x298155['order']=qs[_0x0baf('0x5d')](_0x57b26e[_0x0baf('0x53')][_0x0baf('0x5d')]);_0x298155[_0x0baf('0x5e')]=qs[_0x0baf('0x55')](_[_0x0baf('0x5f')](_0x57b26e['query'],_0xff9b69[_0x0baf('0x55')]));_0x298155[_0x0baf('0x5e')][_0x0baf('0xc4')]=_0x2edcf9['id'];if(_0x57b26e[_0x0baf('0x53')][_0x0baf('0x9b')]){_0x298155['where']=_['merge'](_0x298155[_0x0baf('0x5e')],{'$or':_[_0x0baf('0x46')](_0x298155[_0x0baf('0x57')],function(_0x2d43ac){var _0x34126b={};_0x34126b[_0x2d43ac]={'$like':'%'+_0x57b26e[_0x0baf('0x53')][_0x0baf('0x9b')]+'%'};return _0x34126b;})});}_0x298155[_0x0baf('0x5e')][_0x0baf('0x105')]=![];if(_0x57b26e[_0x0baf('0x53')]['id']){_0x298155[_0x0baf('0x5e')]['id']={'$gt':_0x57b26e[_0x0baf('0x53')]['id']};}_0x298155=_[_0x0baf('0xb1')]({},_0x298155,_0x57b26e[_0x0baf('0xcc')]);return db[_0x0baf('0xf7')][_0x0baf('0x35')]({'where':_0x298155[_0x0baf('0x5e')]})[_0x0baf('0x24')](function(_0x18d219){_0x5398c6[_0x0baf('0x35')]=_0x18d219;_0x298155[_0x0baf('0xcb')]=[];if(_0x57b26e[_0x0baf('0x53')][_0x0baf('0x119')]){_0x298155[_0x0baf('0xcb')][_0x0baf('0x4c')]({'model':db[_0x0baf('0xf9')],'as':_0x0baf('0xf9'),'attributes':['id','fullname',_0x0baf('0x100')]});}if(_0x57b26e[_0x0baf('0x53')][_0x0baf('0xca')]){_0x298155[_0x0baf('0xcb')]=[{'all':!![]}];}return db[_0x0baf('0xf7')]['findAll'](_0x298155);})[_0x0baf('0x24')](function(_0x344fef){_0x5398c6[_0x0baf('0xc6')]=_0x344fef;return _0x5398c6;});}})[_0x0baf('0x24')](respondWithFilteredResult(_0x3a0a2f,_0x298155))[_0x0baf('0x2e')](handleError(_0x3a0a2f,null));};exports[_0x0baf('0x11a')]=function(_0x3358f5,_0x237a20,_0x26dd4c){return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x3358f5[_0x0baf('0xc8')]['id']}})[_0x0baf('0x24')](handleEntityNotFound(_0x237a20,null))[_0x0baf('0x24')](function(_0x2867b7){if(_0x2867b7){return _0x2867b7[_0x0baf('0x11b')](_0x3358f5[_0x0baf('0x40')][_0x0baf('0x114')],_['omit'](_0x3358f5[_0x0baf('0x40')],['ids','id'])||{})['spread'](function(){return db[_0x0baf('0x84')][_0x0baf('0x117')]({'attributes':['id',_0x0baf('0x3f'),'color'],'where':{'id':_0x3358f5[_0x0baf('0x40')][_0x0baf('0x114')]}});})[_0x0baf('0x24')](function(_0x24bc8f){socket[_0x0baf('0x11c')](_0x0baf('0x11d'),{'id':Number(_0x3358f5['params']['id']),'tags':_0x24bc8f||[]});return{'id':Number(_0x3358f5[_0x0baf('0xc8')]['id']),'tags':_0x24bc8f||[]};});}})[_0x0baf('0x24')](respondWithResult(_0x237a20,null))[_0x0baf('0x2e')](handleError(_0x237a20,null));};exports[_0x0baf('0x11e')]=function(_0x262063,_0x216897,_0x4c2bae){return db[_0x0baf('0x4e')]['find']({'where':{'id':_0x262063[_0x0baf('0xc8')]['id']}})[_0x0baf('0x24')](handleEntityNotFound(_0x216897,null))['then'](function(_0x56da3e){if(_0x56da3e){return _0x56da3e[_0x0baf('0x11e')](_0x262063[_0x0baf('0x53')][_0x0baf('0x114')]);}})['then'](respondWithStatusCode(_0x216897,null))[_0x0baf('0x2e')](handleError(_0x216897,null));};exports[_0x0baf('0xf1')]=function(_0x51d2aa,_0x26d73d){var _0x20cc18=moment()[_0x0baf('0x11f')]()[_0x0baf('0xb0')]();var _0x3fa8eb=path[_0x0baf('0xed')](config[_0x0baf('0xee')],'server','files',_0x0baf('0x120'));var _0x1bd67f=path[_0x0baf('0xed')](config[_0x0baf('0xee')],_0x0baf('0x121'),_0x0baf('0x122'),_0x0baf('0x123'));var _0x4316c5=path[_0x0baf('0xed')](_0x3fa8eb,_0x20cc18);var _0x1d5b73=util['format']('transcript-%d-%s.zip',_0x51d2aa[_0x0baf('0xc8')]['id'],_0x20cc18);var _0x2a84f8=path[_0x0baf('0xed')](_0x3fa8eb,_0x1d5b73);var _0x552504=[];_0x552504['push']({'model':db[_0x0baf('0xf9')],'as':_0x0baf('0xf9'),'attributes':['id',_0x0baf('0x47')],'raw':!![]});_0x552504[_0x0baf('0x4c')]({'model':db['CmContact'],'as':_0x0baf('0x7b'),'attributes':['id',_0x0baf('0x124'),_0x0baf('0x125')],'raw':!![]});if(_0x51d2aa[_0x0baf('0x53')][_0x0baf('0x123')]){_0x552504[_0x0baf('0x4c')]({'model':db[_0x0baf('0x126')],'as':_0x0baf('0x126'),'raw':!![]});}var _0x5bbd33=[{'model':db[_0x0baf('0xf7')],'as':_0x0baf('0xf8'),'attributes':['id',_0x0baf('0x40'),_0x0baf('0x8f'),_0x0baf('0x104'),_0x0baf('0x105'),'read'],'include':_0x552504}];_0x5bbd33[_0x0baf('0x4c')]({'model':db[_0x0baf('0xd1')],'as':'Account','attributes':['id','name']});_0x5bbd33[_0x0baf('0x4c')]({'model':db['User'],'as':_0x0baf('0x127'),'attributes':['id',_0x0baf('0x47')]});return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x51d2aa['params']['id']},'include':_0x5bbd33})[_0x0baf('0x24')](handleEntityNotFound(_0x26d73d,null))[_0x0baf('0x24')](function(_0x32c2a8){if(_0x32c2a8){var _0x58fea2=_0x32c2a8[_0x0baf('0x128')]({'plain':!![]});fs[_0x0baf('0x129')](_0x4316c5);var _0x5f5d45={'channel':_0x0baf('0x12a'),'account':_0x58fea2['Account'][_0x0baf('0x3f')],'agent':_0x58fea2[_0x0baf('0x127')]?_0x58fea2[_0x0baf('0x127')][_0x0baf('0x47')]:'N.A.','createdAt':moment(_0x58fea2[_0x0baf('0x8f')])[_0x0baf('0xf4')]('YYYY-MM-DD\x20HH:mm:ss')[_0x0baf('0xb0')](),'closedAt':_0x58fea2[_0x0baf('0xe5')]?moment(_0x58fea2['closedAt'])[_0x0baf('0xf4')](_0x0baf('0x12b'))['toString']():'','disposition':_0x58fea2[_0x0baf('0x12c')],'chatInfo':{'browser':_0x58fea2[_0x0baf('0x12d')],'os':_0x58fea2[_0x0baf('0x12e')],'referer':_0x58fea2[_0x0baf('0x12f')],'customerIp':_0x58fea2[_0x0baf('0x130')],'customerPort':_0x58fea2[_0x0baf('0x131')]?_0x58fea2['customerPort']:_0x0baf('0x132')},'messages':_(_0x58fea2[_0x0baf('0xf8')])[_0x0baf('0x133')]()[_0x0baf('0x9b')]({'secret':![]})[_0x0baf('0x46')](function(_0x1ca912){if(_0x1ca912[_0x0baf('0x126')]){var _0x70e2e=path[_0x0baf('0xed')](_0x1bd67f,_0x1ca912[_0x0baf('0x126')][_0x0baf('0xe9')]);if(fs[_0x0baf('0x134')](_0x70e2e)){fs[_0x0baf('0x135')](_0x70e2e)[_0x0baf('0x136')](fs[_0x0baf('0x137')](path[_0x0baf('0xed')](_0x4316c5,_0x1ca912[_0x0baf('0x126')][_0x0baf('0xe9')])));}}return{'date':moment(_0x1ca912[_0x0baf('0x8f')])[_0x0baf('0xf4')](_0x0baf('0x12b'))[_0x0baf('0xb0')](),'sender':_0x1ca912['direction']===_0x0baf('0xdf')?_0x1ca912[_0x0baf('0xf9')]?_0x1ca912['User']['fullname']:'System':_0x1ca912[_0x0baf('0x7b')]['firstName']+(_0x1ca912['Contact']['lastName']?'\x20'+_0x1ca912[_0x0baf('0x7b')][_0x0baf('0x125')]:''),'body':_0x1ca912[_0x0baf('0x126')]?_0x1ca912['Attachment'][_0x0baf('0xe9')]:_0x1ca912['body'],'direction':_0x1ca912['direction']===_0x0baf('0xdf')?'A':'C','secret':_0x1ca912[_0x0baf('0x105')],'read':_0x1ca912[_0x0baf('0x96')],'attachment':_0x1ca912['Attachment']};})['value']()};return ejs[_0x0baf('0x138')](path[_0x0baf('0xed')](config[_0x0baf('0xee')],_0x0baf('0x121'),_0x0baf('0x139'),_0x0baf('0x13a')),{'interaction':_0x5f5d45})['then'](function(_0x4c1f01){var _0x217cd8=path[_0x0baf('0xed')](_0x4316c5,'transcript-'+_0x58fea2['id']+'-'+_0x20cc18+_0x0baf('0x13b'));var _0x223d32={'path':_0x217cd8,'channel':_0x0baf('0x12a'),'interactionId':_0x58fea2['id']};return pdf[_0x0baf('0x13c')](_0x4c1f01,_0x223d32);})['then'](function(){return new BPromise(function(_0xcca408,_0x557ec9){zipdir(_0x4316c5,{'saveTo':_0x2a84f8},function(_0x479231,_0x320409){if(_0x479231)return _0x557ec9(_0x479231);return _0xcca408(_0x320409);});})['then'](function(){return new BPromise(function(_0x4a0f32,_0xc6fc4d){rimraf(_0x4316c5,function(_0x46b904){if(_0x46b904)_0xc6fc4d(_0x46b904);return _0x4a0f32();});});})['then'](function(){return _0x26d73d[_0x0baf('0xf1')](_0x2a84f8,_0x1d5b73,function(_0x2dea20){if(_0x2dea20){console[_0x0baf('0x13d')](_0x0baf('0x13e'),_0x2dea20);}else{fs[_0x0baf('0x13f')](_0x2a84f8);}});});});}else{return _0x26d73d[_0x0baf('0x2f')](0xc8);}})['catch'](handleError(_0x26d73d,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 619f80f..8bbb9ca 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 _0xf1ee=['length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','Users','findAll','unreadMessages'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0xf1ee,0xa8));var _0xef1e=function(_0x433df9,_0x5808c7){_0x433df9=_0x433df9-0x0;var _0x2574cf=_0xf1ee[_0x433df9];return _0x2574cf;};'use strict';var EventEmitter=require(_0xef1e('0x0'));var ChatInteraction=require(_0xef1e('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xef1e('0x1'))['db'][_0xef1e('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xef1e('0x3')](0x0);var events={'afterCreate':_0xef1e('0x4'),'afterUpdate':_0xef1e('0x5'),'afterDestroy':_0xef1e('0x6')};function emitEvent(_0x28fe93){return function(_0x10b998,_0x5a2787,_0x1ca7db){_0x10b998[_0xef1e('0x7')]({'attributes':['id'],'raw':!![]})[_0xef1e('0x8')](function(_0x541401){_0x10b998['setDataValue'](_0xef1e('0x9'),_0x541401['map'](function(_0x19c6c8){return{'id':_0x19c6c8['id']};}));return ChatMessage[_0xef1e('0xa')]({'where':{'ChatInteractionId':_0x10b998['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2a25c7){_0x10b998['setDataValue'](_0xef1e('0xb'),_0x2a25c7[_0xef1e('0xc')]);ChatInteractionEvents['emit'](_0x28fe93+':'+_0x10b998['id'],_0x10b998);ChatInteractionEvents[_0xef1e('0xd')](_0x28fe93,_0x10b998);_0x1ca7db(null);})[_0xef1e('0xe')](_0x1ca7db(null));};}for(var e in events){if(events[_0xef1e('0xf')](e)){var event=events[e];ChatInteraction[_0xef1e('0x10')](e,emitEvent(event));}}module[_0xef1e('0x11')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x7cef=['ChatInteraction','../../mysqldb','ChatMessage','update','remove','getUsers','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events'];(function(_0x211bcb,_0x40f1b5){var _0x3de2f0=function(_0x2810ff){while(--_0x2810ff){_0x211bcb['push'](_0x211bcb['shift']());}};_0x3de2f0(++_0x40f1b5);}(_0x7cef,0x6b));var _0xf7ce=function(_0x1b1f54,_0x54bdc6){_0x1b1f54=_0x1b1f54-0x0;var _0x39e3dc=_0x7cef[_0x1b1f54];return _0x39e3dc;};'use strict';var EventEmitter=require(_0xf7ce('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0xf7ce('0x1')];var ChatMessage=require(_0xf7ce('0x2'))['db'][_0xf7ce('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xf7ce('0x4'),'afterDestroy':_0xf7ce('0x5')};function emitEvent(_0x5c71f7){return function(_0x4512b2,_0x1987ec,_0x444593){_0x4512b2[_0xf7ce('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x19c6b1){_0x4512b2[_0xf7ce('0x7')](_0xf7ce('0x8'),_0x19c6b1[_0xf7ce('0x9')](function(_0x4b79e9){return{'id':_0x4b79e9['id']};}));return ChatMessage[_0xf7ce('0xa')]({'where':{'ChatInteractionId':_0x4512b2['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3a8ac1){_0x4512b2[_0xf7ce('0x7')](_0xf7ce('0xb'),_0x3a8ac1[_0xf7ce('0xc')]);ChatInteractionEvents['emit'](_0x5c71f7+':'+_0x4512b2['id'],_0x4512b2);ChatInteractionEvents[_0xf7ce('0xd')](_0x5c71f7,_0x4512b2);_0x444593(null);})[_0xf7ce('0xe')](_0x444593(null));};}for(var e in events){if(events[_0xf7ce('0xf')](e)){var event=events[e];ChatInteraction[_0xf7ce('0x10')](e,emitEvent(event));}}module[_0xf7ce('0x11')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index c7506fc..98517fd 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 _0xbe1c=['../../config/environment','./chatInteraction.attributes','exports','define','changed','closed','format','utf8mb4_unicode_ci','../../config/logger','api','bluebird','path'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xbe1c,0xec));var _0xcbe1=function(_0x204836,_0x34d172){_0x204836=_0x204836-0x0;var _0x335884=_0xbe1c[_0x204836];return _0x335884;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcbe1('0x0'))(_0xcbe1('0x1'));var moment=require('moment');var BPromise=require(_0xcbe1('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcbe1('0x3'));var rimraf=require('rimraf');var config=require(_0xcbe1('0x4'));var attributes=require(_0xcbe1('0x5'));module[_0xcbe1('0x6')]=function(_0x164677,_0x259967){return _0x164677[_0xcbe1('0x7')]('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1197b2,_0x21e5c0,_0x3f6c1a){if(_0x1197b2[_0xcbe1('0x8')](_0xcbe1('0x9'))){_0x1197b2['closedAt']=moment()[_0xcbe1('0xa')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3f6c1a(null,_0x1197b2);}},'charset':'utf8mb4','collate':_0xcbe1('0xb')});};
\ No newline at end of file
+var _0x1aca=['closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','ChatInteraction','chat_interactions','changed'];(function(_0x5ef7b8,_0x15cc07){var _0x2c7148=function(_0x398519){while(--_0x398519){_0x5ef7b8['push'](_0x5ef7b8['shift']());}};_0x2c7148(++_0x15cc07);}(_0x1aca,0x115));var _0xa1ac=function(_0x7ff50b,_0x399dc0){_0x7ff50b=_0x7ff50b-0x0;var _0x43e570=_0x1aca[_0x7ff50b];return _0x43e570;};'use strict';var _=require('lodash');var util=require(_0xa1ac('0x0'));var logger=require(_0xa1ac('0x1'))(_0xa1ac('0x2'));var moment=require(_0xa1ac('0x3'));var BPromise=require('bluebird');var rp=require(_0xa1ac('0x4'));var fs=require('fs');var path=require(_0xa1ac('0x5'));var rimraf=require(_0xa1ac('0x6'));var config=require(_0xa1ac('0x7'));var attributes=require('./chatInteraction.attributes');module[_0xa1ac('0x8')]=function(_0x141cb4,_0x30ac82){return _0x141cb4['define'](_0xa1ac('0x9'),attributes,{'tableName':_0xa1ac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3a36af,_0x1fbdf0,_0x40dabb){if(_0x3a36af[_0xa1ac('0xb')](_0xa1ac('0xc'))){_0x3a36af['closedAt']=moment()[_0xa1ac('0xd')](_0xa1ac('0xe'));}_0x40dabb(null,_0x3a36af);}},'charset':_0xa1ac('0xf'),'collate':_0xa1ac('0x10')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 693c29e..1b9983d 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 _0x6254=['info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','ChatInteraction','update','options','attributes','limit','UpdateChatInteraction','catch','AddTagsToChatInteraction','find','body','ids','omit','spread','AddTags','lodash','util','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','then'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x6254,0x128));var _0x4625=function(_0x5ad07c,_0x324dcd){_0x5ad07c=_0x5ad07c-0x0;var _0x204bae=_0x6254[_0x5ad07c];return _0x204bae;};'use strict';var _=require(_0x4625('0x0'));var util=require(_0x4625('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4625('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x4625('0x3'))(_0x4625('0x4'));var config=require(_0x4625('0x5'));var jayson=require(_0x4625('0x6'));var client=jayson[_0x4625('0x7')][_0x4625('0x8')]({'port':0x232a});config[_0x4625('0x9')]=_[_0x4625('0xa')](config[_0x4625('0x9')],{'host':_0x4625('0xb'),'port':0x18eb});var socket=require(_0x4625('0xc'))(new Redis(config[_0x4625('0x9')]));require(_0x4625('0xd'))[_0x4625('0xe')](socket);function respondWithRpcPromise(_0x5287cb,_0x2a5a61,_0x3bdb96){return new BPromise(function(_0x3a4e3f,_0x14db75){return client['request'](_0x5287cb,_0x3bdb96)[_0x4625('0xf')](function(_0x530660){logger[_0x4625('0x10')](_0x4625('0x11'),_0x2a5a61,_0x4625('0x12'));logger[_0x4625('0x13')](_0x4625('0x14'),_0x2a5a61,_0x4625('0x12'),JSON[_0x4625('0x15')](_0x530660));if(_0x530660[_0x4625('0x16')]){if(_0x530660['error']['code']===0x1f4){logger[_0x4625('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x2a5a61,_0x530660[_0x4625('0x16')][_0x4625('0x17')]);return _0x14db75(_0x530660['error'][_0x4625('0x17')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x2a5a61,_0x530660[_0x4625('0x16')][_0x4625('0x17')]);return _0x3a4e3f(_0x530660[_0x4625('0x16')]['message']);}else{logger[_0x4625('0x10')](_0x4625('0x11'),_0x2a5a61,_0x4625('0x12'));_0x3a4e3f(_0x530660[_0x4625('0x18')][_0x4625('0x17')]);}})['catch'](function(_0x3415b6){logger[_0x4625('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x2a5a61,_0x3415b6);_0x14db75(_0x3415b6);});});}exports['UpdateChatInteraction']=function(_0x104e2a){var _0x5a5d2f=this;return new Promise(function(_0xa632d5,_0x1c73c2){return db[_0x4625('0x19')][_0x4625('0x1a')](_0x104e2a['body'],{'raw':_0x104e2a['options']?_0x104e2a[_0x4625('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x104e2a['options']?_0x104e2a[_0x4625('0x1b')]['where']||null:null,'attributes':_0x104e2a['options']?_0x104e2a[_0x4625('0x1b')][_0x4625('0x1c')]||null:null,'limit':_0x104e2a[_0x4625('0x1b')]?_0x104e2a[_0x4625('0x1b')][_0x4625('0x1d')]||null:null})[_0x4625('0xf')](function(_0x401049){logger['info']('UpdateChatInteraction',_0x104e2a);logger['debug'](_0x4625('0x1e'),_0x104e2a,JSON['stringify'](_0x401049));_0xa632d5(_0x401049);})[_0x4625('0x1f')](function(_0x5a3927){logger['error'](_0x4625('0x1e'),_0x5a3927[_0x4625('0x17')],_0x104e2a);_0x1c73c2(_0x5a5d2f[_0x4625('0x16')](0x1f4,_0x5a3927[_0x4625('0x17')]));});});};exports[_0x4625('0x20')]=function(_0x37f0a7){return new Promise(function(_0x2c9d25,_0x15c56b){return db[_0x4625('0x19')][_0x4625('0x21')]({'where':_0x37f0a7[_0x4625('0x1b')]?_0x37f0a7[_0x4625('0x1b')]['where']||null:null})['then'](function(_0x4d78a8){if(_0x4d78a8){return _0x4d78a8['addTags'](_0x37f0a7[_0x4625('0x22')][_0x4625('0x23')],_[_0x4625('0x24')](_0x37f0a7['body'],[_0x4625('0x23'),'id'])||{});}})[_0x4625('0x25')](function(_0x27e8fb){logger['info'](_0x4625('0x26'),_0x37f0a7);logger[_0x4625('0x13')](_0x4625('0x26'),_0x37f0a7,JSON[_0x4625('0x15')](_0x27e8fb));_0x2c9d25(_0x27e8fb);})['catch'](function(_0x3a7173){logger['error'](_0x4625('0x26'),_0x3a7173[_0x4625('0x17')],_0x37f0a7);_0x15c56b(_this[_0x4625('0x16')](0x1f4,_0x3a7173['message']));});});};
\ No newline at end of file
+var _0x275d=['result','UpdateChatInteraction','update','options','where','attributes','limit','catch','ChatInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','register','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0x3c5ec,_0x58c840){var _0xdb14d2=function(_0x5d8fa8){while(--_0x5d8fa8){_0x3c5ec['push'](_0x3c5ec['shift']());}};_0xdb14d2(++_0x58c840);}(_0x275d,0x1a0));var _0xd275=function(_0x207811,_0x3420a6){_0x207811=_0x207811-0x0;var _0x170d56=_0x275d[_0x207811];return _0x170d56;};'use strict';var _=require(_0xd275('0x0'));var util=require('util');var moment=require(_0xd275('0x1'));var BPromise=require(_0xd275('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd275('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd275('0x4'));var logger=require(_0xd275('0x5'))(_0xd275('0x6'));var config=require(_0xd275('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd275('0x8')][_0xd275('0x9')]({'port':0x232a});config[_0xd275('0xa')]=_[_0xd275('0xb')](config[_0xd275('0xa')],{'host':_0xd275('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd275('0xa')]));require('./chatInteraction.socket')[_0xd275('0xd')](socket);function respondWithRpcPromise(_0xd2d2eb,_0x199396,_0x8c5ee1){return new BPromise(function(_0x360fcc,_0x5cae32){return client[_0xd275('0xe')](_0xd2d2eb,_0x8c5ee1)[_0xd275('0xf')](function(_0x45f6f2){logger[_0xd275('0x10')](_0xd275('0x11'),_0x199396,'request\x20sent');logger[_0xd275('0x12')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x199396,_0xd275('0x13'),JSON[_0xd275('0x14')](_0x45f6f2));if(_0x45f6f2[_0xd275('0x15')]){if(_0x45f6f2[_0xd275('0x15')][_0xd275('0x16')]===0x1f4){logger[_0xd275('0x15')](_0xd275('0x11'),_0x199396,_0x45f6f2[_0xd275('0x15')][_0xd275('0x17')]);return _0x5cae32(_0x45f6f2['error'][_0xd275('0x17')]);}logger[_0xd275('0x15')](_0xd275('0x11'),_0x199396,_0x45f6f2['error'][_0xd275('0x17')]);return _0x360fcc(_0x45f6f2[_0xd275('0x15')][_0xd275('0x17')]);}else{logger[_0xd275('0x10')](_0xd275('0x11'),_0x199396,_0xd275('0x13'));_0x360fcc(_0x45f6f2[_0xd275('0x18')][_0xd275('0x17')]);}})['catch'](function(_0x23da3a){logger[_0xd275('0x15')](_0xd275('0x11'),_0x199396,_0x23da3a);_0x5cae32(_0x23da3a);});});}exports[_0xd275('0x19')]=function(_0x5039b6){var _0x3034e2=this;return new Promise(function(_0x43305f,_0x489ec0){return db['ChatInteraction'][_0xd275('0x1a')](_0x5039b6['body'],{'raw':_0x5039b6[_0xd275('0x1b')]?_0x5039b6[_0xd275('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5039b6[_0xd275('0x1b')]?_0x5039b6[_0xd275('0x1b')][_0xd275('0x1c')]||null:null,'attributes':_0x5039b6['options']?_0x5039b6[_0xd275('0x1b')][_0xd275('0x1d')]||null:null,'limit':_0x5039b6[_0xd275('0x1b')]?_0x5039b6[_0xd275('0x1b')][_0xd275('0x1e')]||null:null})[_0xd275('0xf')](function(_0x7aaa30){logger['info'](_0xd275('0x19'),_0x5039b6);logger[_0xd275('0x12')](_0xd275('0x19'),_0x5039b6,JSON[_0xd275('0x14')](_0x7aaa30));_0x43305f(_0x7aaa30);})[_0xd275('0x1f')](function(_0x140bdd){logger[_0xd275('0x15')]('UpdateChatInteraction',_0x140bdd[_0xd275('0x17')],_0x5039b6);_0x489ec0(_0x3034e2['error'](0x1f4,_0x140bdd[_0xd275('0x17')]));});});};exports['AddTagsToChatInteraction']=function(_0x37b291){return new Promise(function(_0xbc28c7,_0xf14311){return db[_0xd275('0x20')][_0xd275('0x21')]({'where':_0x37b291[_0xd275('0x1b')]?_0x37b291[_0xd275('0x1b')][_0xd275('0x1c')]||null:null})[_0xd275('0xf')](function(_0x4fa97a){if(_0x4fa97a){return _0x4fa97a[_0xd275('0x22')](_0x37b291[_0xd275('0x23')][_0xd275('0x24')],_[_0xd275('0x25')](_0x37b291['body'],[_0xd275('0x24'),'id'])||{});}})[_0xd275('0x26')](function(_0x5226eb){logger[_0xd275('0x10')](_0xd275('0x27'),_0x37b291);logger[_0xd275('0x12')]('AddTags',_0x37b291,JSON['stringify'](_0x5226eb));_0xbc28c7(_0x5226eb);})[_0xd275('0x1f')](function(_0x43487e){logger[_0xd275('0x15')](_0xd275('0x27'),_0x43487e[_0xd275('0x17')],_0x37b291);_0xf14311(_this[_0xd275('0x15')](0x1f4,_0x43487e[_0xd275('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 08f41bb..2a2e8ac 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 _0x5243=['update','emit','removeListener','length','chatInteraction:','./chatInteraction.events'];(function(_0x39f9f2,_0x1d6714){var _0xff574e=function(_0x28728d){while(--_0x28728d){_0x39f9f2['push'](_0x39f9f2['shift']());}};_0xff574e(++_0x1d6714);}(_0x5243,0x71));var _0x3524=function(_0x3a9b20,_0x2e5be1){_0x3a9b20=_0x3a9b20-0x0;var _0x525273=_0x5243[_0x3a9b20];return _0x525273;};'use strict';var ChatInteractionEvents=require(_0x3524('0x0'));var events=['save','remove',_0x3524('0x1')];function createListener(_0x14d26d,_0x496f0f){return function(_0x5449cf){_0x496f0f[_0x3524('0x2')](_0x14d26d,_0x5449cf);};}function removeListener(_0x34bba7,_0x4855ea){return function(){ChatInteractionEvents[_0x3524('0x3')](_0x34bba7,_0x4855ea);};}exports['register']=function(_0x2d8995){for(var _0x564239=0x0,_0x375729=events[_0x3524('0x4')];_0x564239<_0x375729;_0x564239++){var _0x1e9bf9=events[_0x564239];var _0x371171=createListener(_0x3524('0x5')+_0x1e9bf9,_0x2d8995);ChatInteractionEvents['on'](_0x1e9bf9,_0x371171);}};
\ No newline at end of file
+var _0xe2c8=['removeListener','register','length','./chatInteraction.events','remove','update','emit'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xe2c8,0x17d));var _0x8e2c=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xe2c8[_0x1035c1];return _0x308d67;};'use strict';var ChatInteractionEvents=require(_0x8e2c('0x0'));var events=['save',_0x8e2c('0x1'),_0x8e2c('0x2')];function createListener(_0x1bb98c,_0x5b2266){return function(_0x180c8c){_0x5b2266[_0x8e2c('0x3')](_0x1bb98c,_0x180c8c);};}function removeListener(_0x5cb28e,_0x42e5f6){return function(){ChatInteractionEvents[_0x8e2c('0x4')](_0x5cb28e,_0x42e5f6);};}exports[_0x8e2c('0x5')]=function(_0x23b07a){for(var _0x35ecae=0x0,_0x4c7fcb=events[_0x8e2c('0x6')];_0x35ecae<_0x4c7fcb;_0x35ecae++){var _0x1b15e1=events[_0x35ecae];var _0x52d958=createListener('chatInteraction:'+_0x1b15e1,_0x23b07a);ChatInteractionEvents['on'](_0x1b15e1,_0x52d958);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 467feef..f40272d 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 _0x6494=['/:id/custom_update','/:id/abandon','abandon','/:id/close','close','chatinteraction:destroy','delete','removeTags','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','getMessages','getMyMessages','post','create','createVidaooSession','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','/:id','chatinteraction:update','update'];(function(_0x17c5d8,_0x294ae5){var _0x3613ee=function(_0x45d8a8){while(--_0x45d8a8){_0x17c5d8['push'](_0x17c5d8['shift']());}};_0x3613ee(++_0x294ae5);}(_0x6494,0xa8));var _0x4649=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6494[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x4649('0x0'));var util=require(_0x4649('0x1'));var path=require(_0x4649('0x2'));var timeout=require(_0x4649('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4649('0x4'));var auth=require(_0x4649('0x5'));var interaction=require(_0x4649('0x6'));var config=require(_0x4649('0x7'));var controller=require(_0x4649('0x8'));router[_0x4649('0x9')]('/',auth[_0x4649('0xa')](),controller[_0x4649('0xb')]);router[_0x4649('0x9')](_0x4649('0xc'),auth['isAuthenticated'](),controller[_0x4649('0xd')]);router['get']('/:id',auth[_0x4649('0xe')](),controller[_0x4649('0xf')]);router['get'](_0x4649('0x10'),auth[_0x4649('0xe')](),controller['attachmentDownload']);router[_0x4649('0x9')](_0x4649('0x11'),auth[_0x4649('0xa')](),controller[_0x4649('0x12')]);router[_0x4649('0x9')]('/:id/my_messages',auth[_0x4649('0xe')](),controller[_0x4649('0x13')]);router[_0x4649('0x9')]('/:id/download',auth[_0x4649('0xa')](),controller['download']);router[_0x4649('0x14')]('/',auth[_0x4649('0xa')](),controller[_0x4649('0x15')]);router[_0x4649('0x14')]('/:id/vidaoo',auth[_0x4649('0xa')](),controller[_0x4649('0x16')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xe3b3fa,_0x17fe4f,_0x7c1ca4){_0x7c1ca4(null,path['join'](config[_0x4649('0x17')],_0x4649('0x18')));},'filename':function(_0x29bbcd,_0x577134,_0x1d768e){_0x1d768e(null,util[_0x4649('0x19')](_0x4649('0x1a'),Date[_0x4649('0x1b')](),_0x577134[_0x4649('0x1c')][_0x4649('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x4649('0x14')](_0x4649('0x1e'),upload[_0x4649('0x1f')](_0x4649('0x20')),controller[_0x4649('0x21')]);router[_0x4649('0x14')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0x4649('0x22')]);router[_0x4649('0x14')](_0x4649('0x23'),auth[_0x4649('0xa')](),interaction[_0x4649('0x24')](_0x4649('0x25'),_0x4649('0x26')),controller[_0x4649('0x27')]);router[_0x4649('0x28')](_0x4649('0x29'),auth[_0x4649('0xa')](),interaction[_0x4649('0x24')](_0x4649('0x25'),_0x4649('0x2a')),controller[_0x4649('0x2b')]);router['put'](_0x4649('0x2c'),controller['customUpdate']);router[_0x4649('0x28')](_0x4649('0x2d'),auth[_0x4649('0xe')](),controller[_0x4649('0x2e')]);router['put'](_0x4649('0x2f'),controller[_0x4649('0x30')]);router['delete'](_0x4649('0x29'),auth[_0x4649('0xa')](),interaction['tracked']('chat',_0x4649('0x31')),controller['destroy']);router[_0x4649('0x32')](_0x4649('0x23'),auth[_0x4649('0xa')](),controller[_0x4649('0x33')]);module[_0x4649('0x34')]=router;
\ No newline at end of file
+var _0xe2cc=['show','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','create','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','isChatInteractionAuthorized'];(function(_0x2f57db,_0x318730){var _0x5ee309=function(_0x5b73a5){while(--_0x5b73a5){_0x2f57db['push'](_0x2f57db['shift']());}};_0x5ee309(++_0x318730);}(_0xe2cc,0x102));var _0xce2c=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xe2cc[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0xce2c('0x0'));var util=require(_0xce2c('0x1'));var path=require(_0xce2c('0x2'));var timeout=require(_0xce2c('0x3'));var express=require(_0xce2c('0x4'));var router=express[_0xce2c('0x5')]();var fs_extra=require(_0xce2c('0x6'));var auth=require(_0xce2c('0x7'));var interaction=require(_0xce2c('0x8'));var config=require(_0xce2c('0x9'));var controller=require('./chatInteraction.controller');router[_0xce2c('0xa')]('/',auth['isAuthenticated'](),controller[_0xce2c('0xb')]);router[_0xce2c('0xa')](_0xce2c('0xc'),auth[_0xce2c('0xd')](),controller[_0xce2c('0xe')]);router['get'](_0xce2c('0xf'),auth[_0xce2c('0x10')](),controller[_0xce2c('0x11')]);router[_0xce2c('0xa')](_0xce2c('0x12'),auth[_0xce2c('0x10')](),controller['attachmentDownload']);router['get'](_0xce2c('0x13'),auth[_0xce2c('0xd')](),controller[_0xce2c('0x14')]);router[_0xce2c('0xa')](_0xce2c('0x15'),auth[_0xce2c('0x10')](),controller[_0xce2c('0x16')]);router[_0xce2c('0xa')](_0xce2c('0x17'),auth[_0xce2c('0xd')](),controller['download']);router[_0xce2c('0x18')]('/',auth['isAuthenticated'](),controller[_0xce2c('0x19')]);router['post']('/:id/vidaoo',auth[_0xce2c('0xd')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xce2c('0x1a')]({'destination':function(_0x5573e6,_0x18c738,_0x194ad7){_0x194ad7(null,path[_0xce2c('0x1b')](config[_0xce2c('0x1c')],_0xce2c('0x1d')));},'filename':function(_0x19c0ad,_0x2eaed8,_0xf617bd){_0xf617bd(null,util[_0xce2c('0x1e')](_0xce2c('0x1f'),Date[_0xce2c('0x20')](),_0x2eaed8[_0xce2c('0x21')][_0xce2c('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xce2c('0x18')](_0xce2c('0x23'),upload['single'](_0xce2c('0x24')),controller[_0xce2c('0x25')]);router[_0xce2c('0x18')](_0xce2c('0x13'),auth['isChatInteractionAuthorized'](),controller[_0xce2c('0x26')]);router[_0xce2c('0x18')](_0xce2c('0x27'),auth[_0xce2c('0xd')](),interaction[_0xce2c('0x28')](_0xce2c('0x29'),'chatinteraction:addtags'),controller[_0xce2c('0x2a')]);router[_0xce2c('0x2b')](_0xce2c('0xf'),auth[_0xce2c('0xd')](),interaction['tracked'](_0xce2c('0x29'),_0xce2c('0x2c')),controller[_0xce2c('0x2d')]);router['put'](_0xce2c('0x2e'),controller[_0xce2c('0x2f')]);router[_0xce2c('0x2b')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0xce2c('0x30')]);router[_0xce2c('0x2b')](_0xce2c('0x31'),controller[_0xce2c('0x32')]);router[_0xce2c('0x33')]('/:id',auth['isAuthenticated'](),interaction[_0xce2c('0x28')](_0xce2c('0x29'),_0xce2c('0x34')),controller[_0xce2c('0x35')]);router[_0xce2c('0x33')](_0xce2c('0x27'),auth[_0xce2c('0xd')](),controller[_0xce2c('0x36')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index d189dce..9e49620 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 _0x8fc2=['INTEGER','sequelize','exports','medium','BOOLEAN'];(function(_0x4a1cc1,_0x169f19){var _0x583943=function(_0x363585){while(--_0x363585){_0x4a1cc1['push'](_0x4a1cc1['shift']());}};_0x583943(++_0x169f19);}(_0x8fc2,0xf6));var _0x28fc=function(_0xd29631,_0x4d7de9){_0xd29631=_0xd29631-0x0;var _0x223b4f=_0x8fc2[_0xd29631];return _0x223b4f;};'use strict';var Sequelize=require(_0x28fc('0x0'));module[_0x28fc('0x1')]={'body':{'type':Sequelize['TEXT'](_0x28fc('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x28fc('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x28fc('0x4')]}};
\ No newline at end of file
+var _0x72ec=['medium','INTEGER','exports','TEXT'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x72ec,0x82));var _0xc72e=function(_0x47d060,_0x4a2b1d){_0x47d060=_0x47d060-0x0;var _0xb2d051=_0x72ec[_0x47d060];return _0xb2d051;};'use strict';var Sequelize=require('sequelize');module[_0xc72e('0x0')]={'body':{'type':Sequelize[_0xc72e('0x1')](_0xc72e('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xc72e('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 45e9041..fcd3bae 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 _0x381f=['all','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','reject','save','then','error','stack','name','send','index','ChatInternalMessage','rawAttributes','fieldName','type','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','include','rows','catch','show','params','keys','includeAll','find','create','body','update','destroy','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','admin','fullname','role','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','get','user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','findAll','isEmpty','push','messages','createdAt','FromId','ToId','read'];(function(_0x59070e,_0x456189){var _0x597e37=function(_0x5daab7){while(--_0x5daab7){_0x59070e['push'](_0x59070e['shift']());}};_0x597e37(++_0x456189);}(_0x381f,0xeb));var _0xf381=function(_0x2770f2,_0x37e3b5){_0x2770f2=_0x2770f2-0x0;var _0x3ffabd=_0x381f[_0x2770f2];return _0x3ffabd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf381('0x0'));var zipdir=require(_0xf381('0x1'));var jsonpatch=require(_0xf381('0x2'));var rp=require(_0xf381('0x3'));var moment=require(_0xf381('0x4'));var BPromise=require(_0xf381('0x5'));var Mustache=require(_0xf381('0x6'));var util=require(_0xf381('0x7'));var path=require(_0xf381('0x8'));var sox=require(_0xf381('0x9'));var csv=require(_0xf381('0xa'));var ejs=require(_0xf381('0xb'));var fs=require('fs');var fs_extra=require(_0xf381('0xc'));var _=require('lodash');var squel=require(_0xf381('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf381('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf381('0xf'));var Papa=require(_0xf381('0x10'));var Redis=require(_0xf381('0x11'));var authService=require(_0xf381('0x12'));var qs=require(_0xf381('0x13'));var as=require(_0xf381('0x14'));var hardwareService=require(_0xf381('0x15'));var logger=require(_0xf381('0x16'))(_0xf381('0x17'));var utils=require(_0xf381('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xf381('0x19'));var db=require(_0xf381('0x1a'))['db'];config[_0xf381('0x1b')]=_[_0xf381('0x1c')](config['redis'],{'host':_0xf381('0x1d'),'port':0x18eb});var socket=require(_0xf381('0x1e'))(new Redis(config[_0xf381('0x1b')]));require(_0xf381('0x1f'))[_0xf381('0x20')](socket);function respondWithStatusCode(_0x5a13dd,_0x4410e9){_0x4410e9=_0x4410e9||0xcc;return function(_0x5d523c){if(_0x5d523c){return _0x5a13dd[_0xf381('0x21')](_0x4410e9);}return _0x5a13dd[_0xf381('0x22')](_0x4410e9)[_0xf381('0x23')]();};}function respondWithResult(_0x31dbca,_0x43fd2a){_0x43fd2a=_0x43fd2a||0xc8;return function(_0x4260dd){if(_0x4260dd){return _0x31dbca['status'](_0x43fd2a)['json'](_0x4260dd);}};}function respondWithFilteredResult(_0x131015,_0x127fa1){return function(_0x40bce3){if(_0x40bce3){var _0x249a41=typeof _0x127fa1['offset']===_0xf381('0x24')&&typeof _0x127fa1[_0xf381('0x25')]===_0xf381('0x24');var _0x56c28b=_0x40bce3[_0xf381('0x26')];var _0x2b4733=_0x249a41?0x0:_0x127fa1['offset'];var _0x1302eb=_0x249a41?_0x40bce3[_0xf381('0x26')]:_0x127fa1[_0xf381('0x27')]+_0x127fa1[_0xf381('0x25')];var _0x18c40c;if(_0x1302eb>=_0x56c28b){_0x1302eb=_0x56c28b;_0x18c40c=0xc8;}else{_0x18c40c=0xce;}_0x131015['status'](_0x18c40c);return _0x131015[_0xf381('0x28')]('Content-Range',_0x2b4733+'-'+_0x1302eb+'/'+_0x56c28b)[_0xf381('0x29')](_0x40bce3);}return null;};}function patchUpdates(_0xadcc7){return function(_0x395f29){try{jsonpatch[_0xf381('0x2a')](_0x395f29,_0xadcc7,!![]);}catch(_0x236d59){return BPromise[_0xf381('0x2b')](_0x236d59);}return _0x395f29[_0xf381('0x2c')]();};}function saveUpdates(_0x1e8fc4,_0x5a32aa){return function(_0x2b6ca1){if(_0x2b6ca1){return _0x2b6ca1['update'](_0x1e8fc4)[_0xf381('0x2d')](function(_0x499a45){return _0x499a45;});}return null;};}function removeEntity(_0x4f5e06,_0xa403dd){return function(_0x2ec09f){if(_0x2ec09f){return _0x2ec09f['destroy']()['then'](function(){_0x4f5e06[_0xf381('0x22')](0xcc)[_0xf381('0x23')]();});}};}function handleEntityNotFound(_0x412850,_0x15595c){return function(_0x4c8d68){if(!_0x4c8d68){_0x412850[_0xf381('0x21')](0x194);}return _0x4c8d68;};}function handleError(_0x2fdf9d,_0x403379){_0x403379=_0x403379||0x1f4;return function(_0x39617b){logger[_0xf381('0x2e')](_0x39617b[_0xf381('0x2f')]);if(_0x39617b[_0xf381('0x30')]){delete _0x39617b[_0xf381('0x30')];}_0x2fdf9d['status'](_0x403379)[_0xf381('0x31')](_0x39617b);};}exports[_0xf381('0x32')]=function(_0x20a5c7,_0x579848){var _0x474c1b={},_0x5313ca={},_0x408e96={'count':0x0,'rows':[]};var _0x1a3364=_['map'](db[_0xf381('0x33')][_0xf381('0x34')],function(_0x3c779b){return{'name':_0x3c779b[_0xf381('0x35')],'type':_0x3c779b[_0xf381('0x36')]['key']};});_0x5313ca[_0xf381('0x37')]=_['map'](_0x1a3364,'name');_0x5313ca['query']=_['keys'](_0x20a5c7['query']);_0x5313ca[_0xf381('0x38')]=_[_0xf381('0x39')](_0x5313ca[_0xf381('0x37')],_0x5313ca[_0xf381('0x3a')]);_0x474c1b[_0xf381('0x3b')]=_['intersection'](_0x5313ca[_0xf381('0x37')],qs['fields'](_0x20a5c7[_0xf381('0x3a')][_0xf381('0x3c')]));_0x474c1b['attributes']=_0x474c1b[_0xf381('0x3b')][_0xf381('0x3d')]?_0x474c1b['attributes']:_0x5313ca[_0xf381('0x37')];if(!_0x20a5c7[_0xf381('0x3a')][_0xf381('0x3e')](_0xf381('0x3f'))){_0x474c1b['limit']=qs[_0xf381('0x25')](_0x20a5c7[_0xf381('0x3a')]['limit']);_0x474c1b['offset']=qs[_0xf381('0x27')](_0x20a5c7[_0xf381('0x3a')][_0xf381('0x27')]);}_0x474c1b[_0xf381('0x40')]=qs[_0xf381('0x41')](_0x20a5c7['query'][_0xf381('0x41')]);_0x474c1b[_0xf381('0x42')]=qs['filters'](_[_0xf381('0x43')](_0x20a5c7[_0xf381('0x3a')],_0x5313ca['filters']),_0x1a3364);if(_0x20a5c7[_0xf381('0x3a')][_0xf381('0x44')]){_0x474c1b[_0xf381('0x42')]=_[_0xf381('0x45')](_0x474c1b[_0xf381('0x42')],{'$or':_[_0xf381('0x46')](_0x1a3364,function(_0x392bbb){if(_0x392bbb[_0xf381('0x36')]!==_0xf381('0x47')){var _0x38cfcc={};_0x38cfcc[_0x392bbb['name']]={'$like':'%'+_0x20a5c7[_0xf381('0x3a')][_0xf381('0x44')]+'%'};return _0x38cfcc;}})});}_0x474c1b=_[_0xf381('0x45')]({},_0x474c1b,_0x20a5c7[_0xf381('0x48')]);var _0x3dad7d={'where':_0x474c1b['where']};return db[_0xf381('0x33')][_0xf381('0x26')](_0x3dad7d)['then'](function(_0x1116df){_0x408e96['count']=_0x1116df;if(_0x20a5c7[_0xf381('0x3a')]['includeAll']){_0x474c1b[_0xf381('0x49')]=[{'all':!![]}];}return db[_0xf381('0x33')]['findAll'](_0x474c1b);})[_0xf381('0x2d')](function(_0x144b96){_0x408e96[_0xf381('0x4a')]=_0x144b96;return _0x408e96;})[_0xf381('0x2d')](respondWithFilteredResult(_0x579848,_0x474c1b))[_0xf381('0x4b')](handleError(_0x579848,null));};exports[_0xf381('0x4c')]=function(_0xfd2705,_0x19c972){var _0x17b6f8={'raw':!![],'where':{'id':_0xfd2705[_0xf381('0x4d')]['id']}},_0x3dc283={};_0x3dc283[_0xf381('0x37')]=_['keys'](db[_0xf381('0x33')][_0xf381('0x34')]);_0x3dc283['query']=_[_0xf381('0x4e')](_0xfd2705['query']);_0x3dc283[_0xf381('0x38')]=_[_0xf381('0x39')](_0x3dc283['model'],_0x3dc283[_0xf381('0x3a')]);_0x17b6f8[_0xf381('0x3b')]=_['intersection'](_0x3dc283[_0xf381('0x37')],qs['fields'](_0xfd2705[_0xf381('0x3a')][_0xf381('0x3c')]));_0x17b6f8[_0xf381('0x3b')]=_0x17b6f8[_0xf381('0x3b')][_0xf381('0x3d')]?_0x17b6f8['attributes']:_0x3dc283[_0xf381('0x37')];if(_0xfd2705[_0xf381('0x3a')][_0xf381('0x4f')]){_0x17b6f8[_0xf381('0x49')]=[{'all':!![]}];}_0x17b6f8=_[_0xf381('0x45')]({},_0x17b6f8,_0xfd2705[_0xf381('0x48')]);return db[_0xf381('0x33')][_0xf381('0x50')](_0x17b6f8)[_0xf381('0x2d')](handleEntityNotFound(_0x19c972,null))[_0xf381('0x2d')](respondWithResult(_0x19c972,null))[_0xf381('0x4b')](handleError(_0x19c972,null));};exports[_0xf381('0x51')]=function(_0x21d620,_0x3f031e){return db[_0xf381('0x33')][_0xf381('0x51')](_0x21d620[_0xf381('0x52')],{})[_0xf381('0x2d')](respondWithResult(_0x3f031e,0xc9))[_0xf381('0x4b')](handleError(_0x3f031e,null));};exports[_0xf381('0x53')]=function(_0x4626da,_0x486a9d){if(_0x4626da[_0xf381('0x52')]['id']){delete _0x4626da['body']['id'];}return db['ChatInternalMessage'][_0xf381('0x50')]({'where':{'id':_0x4626da['params']['id']}})['then'](handleEntityNotFound(_0x486a9d,null))[_0xf381('0x2d')](saveUpdates(_0x4626da['body'],null))[_0xf381('0x2d')](respondWithResult(_0x486a9d,null))['catch'](handleError(_0x486a9d,null));};exports[_0xf381('0x54')]=function(_0x1eb672,_0xefebc9){return db[_0xf381('0x33')][_0xf381('0x50')]({'where':{'id':_0x1eb672[_0xf381('0x4d')]['id']}})[_0xf381('0x2d')](handleEntityNotFound(_0xefebc9,null))[_0xf381('0x2d')](removeEntity(_0xefebc9,null))['catch'](handleError(_0xefebc9,null));};exports['describe']=function(_0x4efe50,_0x5b9bb7){return db[_0xf381('0x33')]['describe']()[_0xf381('0x2d')](respondWithResult(_0x5b9bb7,null))[_0xf381('0x4b')](handleError(_0x5b9bb7,null));};function wrapUser(_0x439334){return function(_0x2fbcc2){var _0x36dd15=_0x439334['get']({'plain':!![]});_0x36dd15['messages']=[];if(_0x2fbcc2){_0x36dd15[_0xf381('0x55')]=_0x2fbcc2['createdAt'];_0x36dd15['lastMessage']=_0x2fbcc2;}else{_0x36dd15['lastMessageAt']=moment(0x0)[_0xf381('0x56')](_0xf381('0x57'));_0x36dd15[_0xf381('0x58')]={};}return _0x36dd15;};}exports[_0xf381('0x59')]=function(_0x384c17,_0x2df2de,_0x11e31c){var _0x116f50=[];return db[_0xf381('0x5a')]['findAll']({'where':{'role':[_0xf381('0x5b'),_0xf381('0x5c'),'user']},'attributes':['id',_0xf381('0x5d'),_0xf381('0x30'),_0xf381('0x5e'),'userpic',_0xf381('0x5f'),_0xf381('0x60'),_0xf381('0x61'),_0xf381('0x62'),_0xf381('0x63')],'order':qs[_0xf381('0x41')](_0xf381('0x64')),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id',_0xf381('0x30'),_0xf381('0x36')],'through':{'attributes':[]}}]})[_0xf381('0x2d')](function(_0x53b3f3){if(_0x53b3f3){var _0x3aef1e=_0x384c17['user'][_0xf381('0x65')]({'plain':!![]});if(!_0x3aef1e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3aef1e[_0xf381('0x5e')]===_0xf381('0x66')){return db[_0xf381('0x67')][_0xf381('0x50')]({'where':{'name':_0xf381('0x68'),'userProfileId':_0x3aef1e[_0xf381('0x69')]},'raw':!![]})['then'](function(_0x4a8d0e){if(_0x4a8d0e){if(_0x4a8d0e[_0xf381('0x6a')]===0x0){return db[_0xf381('0x6b')][_0xf381('0x6c')]({'where':{'sectionId':_0x4a8d0e['id']},'raw':!![]})[_0xf381('0x2d')](function(_0x7de01a){var _0x2ab7ce=[];if(_[_0xf381('0x6d')](_0x7de01a)){_0x2ab7ce=_[_0xf381('0x44')](_0x53b3f3,function(_0xb0197a){if(_0xb0197a[_0xf381('0x5e')]!=='agent'){return _0xb0197a;}});return _0x2ab7ce;}else{for(var _0xb89723=0x0;_0xb89723<_0x53b3f3[_0xf381('0x3d')];_0xb89723++){var _0x752af8=_0x53b3f3[_0xb89723];if(_0x752af8[_0xf381('0x5e')]===_0xf381('0x5b')){var _0x5f0d5d=_[_0xf381('0x50')](_0x7de01a,function(_0x5d78df){return _0x5d78df['resourceId']===_0x752af8['id'];});if(_0x5f0d5d)_0x2ab7ce[_0xf381('0x6e')](_0x752af8);}else{_0x2ab7ce[_0xf381('0x6e')](_0x752af8);}}return _0x2ab7ce;}});}else{return _0x53b3f3;}}else{var _0x4e546f=_['filter'](_0x53b3f3,function(_0x26a965){if(_0x26a965[_0xf381('0x5e')]!==_0xf381('0x5b')){return _0x26a965;}});return _0x4e546f;}});}else{return _0x53b3f3;}}})[_0xf381('0x2d')](function(_0x571ccd){var _0x1c70ae=[];if(_0x571ccd){_0x116f50=_0x571ccd;for(var _0x33b780=0x0;_0x33b780<_0x571ccd[_0xf381('0x3d')];_0x33b780+=0x1){_0x116f50[_0x33b780][_0xf381('0x6f')]=[];_0x1c70ae[_0xf381('0x6e')](db[_0xf381('0x33')][_0xf381('0x50')]({'where':{'FromId':[_0x384c17[_0xf381('0x66')]['id'],_0x571ccd[_0x33b780]['id']],'ToId':[_0x384c17[_0xf381('0x66')]['id'],_0x571ccd[_0x33b780]['id']],'ChatGroupId':null},'attributes':['id',_0xf381('0x70'),_0xf381('0x71'),_0xf381('0x72'),_0xf381('0x73'),_0xf381('0x52')],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xf381('0x2d')](wrapUser(_0x571ccd[_0x33b780])));}return BPromise[_0xf381('0x74')](_0x1c70ae);}return[];})[_0xf381('0x2d')](function(_0x1333dc){return{'rows':_0x1333dc,'count':_0x1333dc['length']};})[_0xf381('0x2d')](respondWithResult(_0x2df2de,null))[_0xf381('0x4b')](handleError(_0x2df2de,null));};
\ No newline at end of file
+var _0xa1a4=['format','User','agent','admin','user','fullname','userpic','internal','online','showWebBar','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','messages','FromId','ToId','read','-createdAt','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','save','update','then','destroy','stack','name','index','map','ChatInternalMessage','rawAttributes','type','query','model','attributes','intersection','fields','length','limit','order','sort','filters','pick','filter','VIRTUAL','merge','where','includeAll','include','findAll','catch','show','params','options','find','create','body','describe','lastMessageAt','createdAt','lastMessage'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xa1a4,0x14b));var _0x4a1a=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xa1a4[_0x27af45];return _0x18df21;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4a1a('0x0'));var moment=require(_0x4a1a('0x1'));var BPromise=require(_0x4a1a('0x2'));var Mustache=require(_0x4a1a('0x3'));var util=require('util');var path=require(_0x4a1a('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4a1a('0x5'));var fs=require('fs');var fs_extra=require(_0x4a1a('0x6'));var _=require(_0x4a1a('0x7'));var squel=require(_0x4a1a('0x8'));var crypto=require(_0x4a1a('0x9'));var jsforce=require(_0x4a1a('0xa'));var deskjs=require(_0x4a1a('0xb'));var toCsv=require(_0x4a1a('0xc'));var querystring=require(_0x4a1a('0xd'));var Papa=require('papaparse');var Redis=require(_0x4a1a('0xe'));var authService=require(_0x4a1a('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4a1a('0x10'));var logger=require('../../config/logger')(_0x4a1a('0x11'));var utils=require(_0x4a1a('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x4a1a('0x13'));var db=require(_0x4a1a('0x14'))['db'];config[_0x4a1a('0x15')]=_[_0x4a1a('0x16')](config[_0x4a1a('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4a1a('0x15')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x53c82b,_0x57ae5f){_0x57ae5f=_0x57ae5f||0xcc;return function(_0xe550c7){if(_0xe550c7){return _0x53c82b[_0x4a1a('0x17')](_0x57ae5f);}return _0x53c82b[_0x4a1a('0x18')](_0x57ae5f)[_0x4a1a('0x19')]();};}function respondWithResult(_0xba17d4,_0x43f393){_0x43f393=_0x43f393||0xc8;return function(_0x3a14a3){if(_0x3a14a3){return _0xba17d4['status'](_0x43f393)[_0x4a1a('0x1a')](_0x3a14a3);}};}function respondWithFilteredResult(_0x7a5f83,_0x110534){return function(_0x2f3cc9){if(_0x2f3cc9){var _0x224409=typeof _0x110534[_0x4a1a('0x1b')]===_0x4a1a('0x1c')&&typeof _0x110534['limit']===_0x4a1a('0x1c');var _0x141279=_0x2f3cc9[_0x4a1a('0x1d')];var _0x2f121a=_0x224409?0x0:_0x110534[_0x4a1a('0x1b')];var _0x29c83d=_0x224409?_0x2f3cc9[_0x4a1a('0x1d')]:_0x110534[_0x4a1a('0x1b')]+_0x110534['limit'];var _0x17eb5a;if(_0x29c83d>=_0x141279){_0x29c83d=_0x141279;_0x17eb5a=0xc8;}else{_0x17eb5a=0xce;}_0x7a5f83[_0x4a1a('0x18')](_0x17eb5a);return _0x7a5f83[_0x4a1a('0x1e')]('Content-Range',_0x2f121a+'-'+_0x29c83d+'/'+_0x141279)[_0x4a1a('0x1a')](_0x2f3cc9);}return null;};}function patchUpdates(_0x7d9a3c){return function(_0x28158e){try{jsonpatch[_0x4a1a('0x1f')](_0x28158e,_0x7d9a3c,!![]);}catch(_0x356eec){return BPromise[_0x4a1a('0x20')](_0x356eec);}return _0x28158e[_0x4a1a('0x21')]();};}function saveUpdates(_0x54ec3f,_0x540fcb){return function(_0x226f0a){if(_0x226f0a){return _0x226f0a[_0x4a1a('0x22')](_0x54ec3f)[_0x4a1a('0x23')](function(_0x44f2ce){return _0x44f2ce;});}return null;};}function removeEntity(_0x3eaa4f,_0x31dff3){return function(_0x242579){if(_0x242579){return _0x242579[_0x4a1a('0x24')]()[_0x4a1a('0x23')](function(){_0x3eaa4f['status'](0xcc)[_0x4a1a('0x19')]();});}};}function handleEntityNotFound(_0x443517,_0xf3ea79){return function(_0x306471){if(!_0x306471){_0x443517[_0x4a1a('0x17')](0x194);}return _0x306471;};}function handleError(_0x280c5f,_0x381dca){_0x381dca=_0x381dca||0x1f4;return function(_0x2d7fbc){logger['error'](_0x2d7fbc[_0x4a1a('0x25')]);if(_0x2d7fbc['name']){delete _0x2d7fbc[_0x4a1a('0x26')];}_0x280c5f['status'](_0x381dca)['send'](_0x2d7fbc);};}exports[_0x4a1a('0x27')]=function(_0x3f2461,_0x9329){var _0x345217={},_0x385e84={},_0x3d40d1={'count':0x0,'rows':[]};var _0x1540eb=_[_0x4a1a('0x28')](db[_0x4a1a('0x29')][_0x4a1a('0x2a')],function(_0x5a994d){return{'name':_0x5a994d['fieldName'],'type':_0x5a994d[_0x4a1a('0x2b')]['key']};});_0x385e84['model']=_[_0x4a1a('0x28')](_0x1540eb,'name');_0x385e84[_0x4a1a('0x2c')]=_['keys'](_0x3f2461[_0x4a1a('0x2c')]);_0x385e84['filters']=_['intersection'](_0x385e84[_0x4a1a('0x2d')],_0x385e84[_0x4a1a('0x2c')]);_0x345217[_0x4a1a('0x2e')]=_[_0x4a1a('0x2f')](_0x385e84[_0x4a1a('0x2d')],qs[_0x4a1a('0x30')](_0x3f2461[_0x4a1a('0x2c')][_0x4a1a('0x30')]));_0x345217[_0x4a1a('0x2e')]=_0x345217['attributes'][_0x4a1a('0x31')]?_0x345217['attributes']:_0x385e84['model'];if(!_0x3f2461[_0x4a1a('0x2c')]['hasOwnProperty']('nolimit')){_0x345217[_0x4a1a('0x32')]=qs[_0x4a1a('0x32')](_0x3f2461[_0x4a1a('0x2c')]['limit']);_0x345217[_0x4a1a('0x1b')]=qs[_0x4a1a('0x1b')](_0x3f2461[_0x4a1a('0x2c')]['offset']);}_0x345217[_0x4a1a('0x33')]=qs[_0x4a1a('0x34')](_0x3f2461['query'][_0x4a1a('0x34')]);_0x345217['where']=qs[_0x4a1a('0x35')](_[_0x4a1a('0x36')](_0x3f2461[_0x4a1a('0x2c')],_0x385e84[_0x4a1a('0x35')]),_0x1540eb);if(_0x3f2461[_0x4a1a('0x2c')][_0x4a1a('0x37')]){_0x345217['where']=_['merge'](_0x345217['where'],{'$or':_[_0x4a1a('0x28')](_0x1540eb,function(_0x43d87d){if(_0x43d87d[_0x4a1a('0x2b')]!==_0x4a1a('0x38')){var _0x29d472={};_0x29d472[_0x43d87d[_0x4a1a('0x26')]]={'$like':'%'+_0x3f2461[_0x4a1a('0x2c')][_0x4a1a('0x37')]+'%'};return _0x29d472;}})});}_0x345217=_[_0x4a1a('0x39')]({},_0x345217,_0x3f2461['options']);var _0x3cc098={'where':_0x345217[_0x4a1a('0x3a')]};return db[_0x4a1a('0x29')]['count'](_0x3cc098)['then'](function(_0x1679fe){_0x3d40d1['count']=_0x1679fe;if(_0x3f2461['query'][_0x4a1a('0x3b')]){_0x345217[_0x4a1a('0x3c')]=[{'all':!![]}];}return db[_0x4a1a('0x29')][_0x4a1a('0x3d')](_0x345217);})[_0x4a1a('0x23')](function(_0x9a72f6){_0x3d40d1['rows']=_0x9a72f6;return _0x3d40d1;})[_0x4a1a('0x23')](respondWithFilteredResult(_0x9329,_0x345217))[_0x4a1a('0x3e')](handleError(_0x9329,null));};exports[_0x4a1a('0x3f')]=function(_0x1fd7b3,_0x357728){var _0x58ebb4={'raw':!![],'where':{'id':_0x1fd7b3[_0x4a1a('0x40')]['id']}},_0x2fc3da={};_0x2fc3da[_0x4a1a('0x2d')]=_['keys'](db['ChatInternalMessage'][_0x4a1a('0x2a')]);_0x2fc3da[_0x4a1a('0x2c')]=_['keys'](_0x1fd7b3['query']);_0x2fc3da[_0x4a1a('0x35')]=_[_0x4a1a('0x2f')](_0x2fc3da[_0x4a1a('0x2d')],_0x2fc3da[_0x4a1a('0x2c')]);_0x58ebb4[_0x4a1a('0x2e')]=_[_0x4a1a('0x2f')](_0x2fc3da[_0x4a1a('0x2d')],qs[_0x4a1a('0x30')](_0x1fd7b3[_0x4a1a('0x2c')][_0x4a1a('0x30')]));_0x58ebb4[_0x4a1a('0x2e')]=_0x58ebb4['attributes']['length']?_0x58ebb4[_0x4a1a('0x2e')]:_0x2fc3da['model'];if(_0x1fd7b3[_0x4a1a('0x2c')][_0x4a1a('0x3b')]){_0x58ebb4['include']=[{'all':!![]}];}_0x58ebb4=_[_0x4a1a('0x39')]({},_0x58ebb4,_0x1fd7b3[_0x4a1a('0x41')]);return db[_0x4a1a('0x29')][_0x4a1a('0x42')](_0x58ebb4)['then'](handleEntityNotFound(_0x357728,null))[_0x4a1a('0x23')](respondWithResult(_0x357728,null))['catch'](handleError(_0x357728,null));};exports['create']=function(_0x2bc112,_0x12179d){return db[_0x4a1a('0x29')][_0x4a1a('0x43')](_0x2bc112['body'],{})[_0x4a1a('0x23')](respondWithResult(_0x12179d,0xc9))['catch'](handleError(_0x12179d,null));};exports['update']=function(_0x512c7e,_0x45fc76){if(_0x512c7e[_0x4a1a('0x44')]['id']){delete _0x512c7e['body']['id'];}return db[_0x4a1a('0x29')][_0x4a1a('0x42')]({'where':{'id':_0x512c7e[_0x4a1a('0x40')]['id']}})['then'](handleEntityNotFound(_0x45fc76,null))[_0x4a1a('0x23')](saveUpdates(_0x512c7e[_0x4a1a('0x44')],null))['then'](respondWithResult(_0x45fc76,null))[_0x4a1a('0x3e')](handleError(_0x45fc76,null));};exports[_0x4a1a('0x24')]=function(_0x3e8899,_0xf08687){return db['ChatInternalMessage']['find']({'where':{'id':_0x3e8899[_0x4a1a('0x40')]['id']}})[_0x4a1a('0x23')](handleEntityNotFound(_0xf08687,null))[_0x4a1a('0x23')](removeEntity(_0xf08687,null))[_0x4a1a('0x3e')](handleError(_0xf08687,null));};exports['describe']=function(_0x5de905,_0x427b3c){return db[_0x4a1a('0x29')][_0x4a1a('0x45')]()[_0x4a1a('0x23')](respondWithResult(_0x427b3c,null))[_0x4a1a('0x3e')](handleError(_0x427b3c,null));};function wrapUser(_0x14ddde){return function(_0x843586){var _0x58bc06=_0x14ddde['get']({'plain':!![]});_0x58bc06['messages']=[];if(_0x843586){_0x58bc06[_0x4a1a('0x46')]=_0x843586[_0x4a1a('0x47')];_0x58bc06[_0x4a1a('0x48')]=_0x843586;}else{_0x58bc06[_0x4a1a('0x46')]=moment(0x0)[_0x4a1a('0x49')]('YYYY-MM-DD\x20HH:mm:ss');_0x58bc06[_0x4a1a('0x48')]={};}return _0x58bc06;};}exports['getUsers']=function(_0xa2e32e,_0x219901,_0x4b7ad4){var _0x49ad63=[];return db[_0x4a1a('0x4a')]['findAll']({'where':{'role':[_0x4a1a('0x4b'),_0x4a1a('0x4c'),_0x4a1a('0x4d')]},'attributes':['id',_0x4a1a('0x4e'),'name','role',_0x4a1a('0x4f'),_0x4a1a('0x50'),_0x4a1a('0x51'),'lastLoginAt','allowmessenger',_0x4a1a('0x52')],'order':qs[_0x4a1a('0x34')](_0x4a1a('0x53')),'include':[{'model':db[_0x4a1a('0x54')],'as':_0x4a1a('0x55'),'attributes':['id',_0x4a1a('0x26'),_0x4a1a('0x2b')],'through':{'attributes':[]}}]})[_0x4a1a('0x23')](function(_0xc86608){if(_0xc86608){var _0x3c8f6c=_0xa2e32e[_0x4a1a('0x4d')][_0x4a1a('0x56')]({'plain':!![]});if(!_0x3c8f6c)throw new Error(_0x4a1a('0x57'));if(_0x3c8f6c[_0x4a1a('0x58')]==='user'){return db['UserProfileSection'][_0x4a1a('0x42')]({'where':{'name':_0x4a1a('0x59'),'userProfileId':_0x3c8f6c[_0x4a1a('0x5a')]},'raw':!![]})[_0x4a1a('0x23')](function(_0x5c07b2){if(_0x5c07b2){if(_0x5c07b2[_0x4a1a('0x5b')]===0x0){return db[_0x4a1a('0x5c')][_0x4a1a('0x3d')]({'where':{'sectionId':_0x5c07b2['id']},'raw':!![]})[_0x4a1a('0x23')](function(_0xbe2941){var _0x4f5692=[];if(_[_0x4a1a('0x5d')](_0xbe2941)){_0x4f5692=_['filter'](_0xc86608,function(_0x2bf3b2){if(_0x2bf3b2[_0x4a1a('0x58')]!=='agent'){return _0x2bf3b2;}});return _0x4f5692;}else{for(var _0x391f12=0x0;_0x391f12<_0xc86608[_0x4a1a('0x31')];_0x391f12++){var _0x369412=_0xc86608[_0x391f12];if(_0x369412[_0x4a1a('0x58')]===_0x4a1a('0x4b')){var _0x55112b=_['find'](_0xbe2941,function(_0x3a63c5){return _0x3a63c5[_0x4a1a('0x5e')]===_0x369412['id'];});if(_0x55112b)_0x4f5692[_0x4a1a('0x5f')](_0x369412);}else{_0x4f5692['push'](_0x369412);}}return _0x4f5692;}});}else{return _0xc86608;}}else{var _0x6c6b8e=_[_0x4a1a('0x37')](_0xc86608,function(_0x5c997c){if(_0x5c997c[_0x4a1a('0x58')]!==_0x4a1a('0x4b')){return _0x5c997c;}});return _0x6c6b8e;}});}else{return _0xc86608;}}})[_0x4a1a('0x23')](function(_0x312db6){var _0x380939=[];if(_0x312db6){_0x49ad63=_0x312db6;for(var _0x282cba=0x0;_0x282cba<_0x312db6[_0x4a1a('0x31')];_0x282cba+=0x1){_0x49ad63[_0x282cba][_0x4a1a('0x60')]=[];_0x380939[_0x4a1a('0x5f')](db[_0x4a1a('0x29')][_0x4a1a('0x42')]({'where':{'FromId':[_0xa2e32e[_0x4a1a('0x4d')]['id'],_0x312db6[_0x282cba]['id']],'ToId':[_0xa2e32e[_0x4a1a('0x4d')]['id'],_0x312db6[_0x282cba]['id']],'ChatGroupId':null},'attributes':['id',_0x4a1a('0x47'),_0x4a1a('0x61'),_0x4a1a('0x62'),_0x4a1a('0x63'),'body'],'order':qs[_0x4a1a('0x34')](_0x4a1a('0x64')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x4a1a('0x23')](wrapUser(_0x312db6[_0x282cba])));}return BPromise['all'](_0x380939);}return[];})[_0x4a1a('0x23')](function(_0x23ad35){return{'rows':_0x23ad35,'count':_0x23ad35[_0x4a1a('0x31')]};})[_0x4a1a('0x23')](respondWithResult(_0x219901,null))[_0x4a1a('0x3e')](handleError(_0x219901,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index cefb6ba..80e2118 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 _0x8a17=['hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove','emit'];(function(_0x5c3a5a,_0x2330d8){var _0x58b45b=function(_0x575d94){while(--_0x575d94){_0x5c3a5a['push'](_0x5c3a5a['shift']());}};_0x58b45b(++_0x2330d8);}(_0x8a17,0x135));var _0x78a1=function(_0x28b0a1,_0x99bd0a){_0x28b0a1=_0x28b0a1-0x0;var _0x21470c=_0x8a17[_0x28b0a1];return _0x21470c;};'use strict';var EventEmitter=require(_0x78a1('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x78a1('0x1')](0x0);var events={'afterCreate':_0x78a1('0x2'),'afterUpdate':_0x78a1('0x3'),'afterDestroy':_0x78a1('0x4')};function emitEvent(_0x4a92b9){return function(_0x2dee4d,_0x168b2c,_0x30124e){ChatInternalMessageEvents[_0x78a1('0x5')](_0x4a92b9+':'+_0x2dee4d['id'],_0x2dee4d);ChatInternalMessageEvents[_0x78a1('0x5')](_0x4a92b9,_0x2dee4d);_0x30124e(null);};}for(var e in events){if(events[_0x78a1('0x6')](e)){var event=events[e];ChatInternalMessage[_0x78a1('0x7')](e,emitEvent(event));}}module[_0x78a1('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x5d2b=['remove','emit','hook','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save'];(function(_0x1cd116,_0xbc2217){var _0x20f460=function(_0x51f507){while(--_0x51f507){_0x1cd116['push'](_0x1cd116['shift']());}};_0x20f460(++_0xbc2217);}(_0x5d2b,0xbb));var _0xb5d2=function(_0x281e8f,_0x439162){_0x281e8f=_0x281e8f-0x0;var _0x35ca96=_0x5d2b[_0x281e8f];return _0x35ca96;};'use strict';var EventEmitter=require(_0xb5d2('0x0'));var ChatInternalMessage=require(_0xb5d2('0x1'))['db'][_0xb5d2('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xb5d2('0x3')](0x0);var events={'afterCreate':_0xb5d2('0x4'),'afterUpdate':'update','afterDestroy':_0xb5d2('0x5')};function emitEvent(_0x5f5aa4){return function(_0x1120e4,_0x2b622b,_0x267a25){ChatInternalMessageEvents[_0xb5d2('0x6')](_0x5f5aa4+':'+_0x1120e4['id'],_0x1120e4);ChatInternalMessageEvents[_0xb5d2('0x6')](_0x5f5aa4,_0x1120e4);_0x267a25(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xb5d2('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 2ed3cab..1566ae5 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 _0x97cd=['rimraf','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4','util','../../config/logger','api','request-promise'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x97cd,0x1aa));var _0xd97c=function(_0x16b97e,_0x33bb22){_0x16b97e=_0x16b97e-0x0;var _0x232f4d=_0x97cd[_0x16b97e];return _0x232f4d;};'use strict';var _=require('lodash');var util=require(_0xd97c('0x0'));var logger=require(_0xd97c('0x1'))(_0xd97c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd97c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd97c('0x4'));var config=require('../../config/environment');var attributes=require(_0xd97c('0x5'));module[_0xd97c('0x6')]=function(_0x4f3b78,_0xc6a418){return _0x4f3b78[_0xd97c('0x7')](_0xd97c('0x8'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd97c('0x9'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xd44a=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash'];(function(_0x52ddc8,_0xada5d6){var _0x41e9c3=function(_0x432441){while(--_0x432441){_0x52ddc8['push'](_0x52ddc8['shift']());}};_0x41e9c3(++_0xada5d6);}(_0xd44a,0x149));var _0xad44=function(_0x144795,_0x3ffe44){_0x144795=_0x144795-0x0;var _0x2f3227=_0xd44a[_0x144795];return _0x2f3227;};'use strict';var _=require(_0xad44('0x0'));var util=require('util');var logger=require(_0xad44('0x1'))(_0xad44('0x2'));var moment=require(_0xad44('0x3'));var BPromise=require(_0xad44('0x4'));var rp=require(_0xad44('0x5'));var fs=require('fs');var path=require(_0xad44('0x6'));var rimraf=require(_0xad44('0x7'));var config=require(_0xad44('0x8'));var attributes=require(_0xad44('0x9'));module[_0xad44('0xa')]=function(_0x378562,_0x170f53){return _0x378562[_0xad44('0xb')](_0xad44('0xc'),attributes,{'tableName':_0xad44('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xad44('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 84f5a2c..b10b881 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 _0x98ea=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','request','then','info','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x428310,_0x16977c){var _0x4eae4f=function(_0x444bb9){while(--_0x444bb9){_0x428310['push'](_0x428310['shift']());}};_0x4eae4f(++_0x16977c);}(_0x98ea,0x164));var _0xa98e=function(_0x5ac4d3,_0x5456e9){_0x5ac4d3=_0x5ac4d3-0x0;var _0x186a90=_0x98ea[_0x5ac4d3];return _0x186a90;};'use strict';var _=require(_0xa98e('0x0'));var util=require(_0xa98e('0x1'));var moment=require(_0xa98e('0x2'));var BPromise=require(_0xa98e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa98e('0x4'));var db=require(_0xa98e('0x5'))['db'];var utils=require(_0xa98e('0x6'));var logger=require(_0xa98e('0x7'))(_0xa98e('0x8'));var config=require(_0xa98e('0x9'));var jayson=require(_0xa98e('0xa'));var client=jayson[_0xa98e('0xb')][_0xa98e('0xc')]({'port':0x232a});config[_0xa98e('0xd')]=_[_0xa98e('0xe')](config[_0xa98e('0xd')],{'host':_0xa98e('0xf'),'port':0x18eb});var socket=require(_0xa98e('0x10'))(new Redis(config['redis']));require(_0xa98e('0x11'))['register'](socket);function respondWithRpcPromise(_0x2cd653,_0x1357bd,_0x2f6c60){return new BPromise(function(_0x15a499,_0x22b4f9){return client[_0xa98e('0x12')](_0x2cd653,_0x2f6c60)[_0xa98e('0x13')](function(_0x1fd92d){logger[_0xa98e('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x1357bd,_0xa98e('0x15'));logger['debug'](_0xa98e('0x16'),_0x1357bd,_0xa98e('0x15'),JSON['stringify'](_0x1fd92d));if(_0x1fd92d[_0xa98e('0x17')]){if(_0x1fd92d[_0xa98e('0x17')]['code']===0x1f4){logger[_0xa98e('0x17')](_0xa98e('0x18'),_0x1357bd,_0x1fd92d[_0xa98e('0x17')][_0xa98e('0x19')]);return _0x22b4f9(_0x1fd92d[_0xa98e('0x17')][_0xa98e('0x19')]);}logger['error'](_0xa98e('0x18'),_0x1357bd,_0x1fd92d['error'][_0xa98e('0x19')]);return _0x15a499(_0x1fd92d[_0xa98e('0x17')][_0xa98e('0x19')]);}else{logger[_0xa98e('0x14')](_0xa98e('0x18'),_0x1357bd,_0xa98e('0x15'));_0x15a499(_0x1fd92d[_0xa98e('0x1a')][_0xa98e('0x19')]);}})[_0xa98e('0x1b')](function(_0x3ad305){logger[_0xa98e('0x17')](_0xa98e('0x18'),_0x1357bd,_0x3ad305);_0x22b4f9(_0x3ad305);});});}
\ No newline at end of file
+var _0x44f6=['stringify','error','message','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s'];(function(_0x4a5871,_0x5bbf39){var _0xd0f956=function(_0x1adf6d){while(--_0x1adf6d){_0x4a5871['push'](_0x4a5871['shift']());}};_0xd0f956(++_0x5bbf39);}(_0x44f6,0xa4));var _0x644f=function(_0x2132a3,_0x4639e9){_0x2132a3=_0x2132a3-0x0;var _0x21890c=_0x44f6[_0x2132a3];return _0x21890c;};'use strict';var _=require(_0x644f('0x0'));var util=require(_0x644f('0x1'));var moment=require(_0x644f('0x2'));var BPromise=require(_0x644f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x644f('0x4'))['db'];var utils=require(_0x644f('0x5'));var logger=require(_0x644f('0x6'))(_0x644f('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x644f('0x8')][_0x644f('0x9')]({'port':0x232a});config[_0x644f('0xa')]=_[_0x644f('0xb')](config[_0x644f('0xa')],{'host':_0x644f('0xc'),'port':0x18eb});var socket=require(_0x644f('0xd'))(new Redis(config['redis']));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x18eee9,_0x12210d,_0x1b7bc9){return new BPromise(function(_0x485c0a,_0x486476){return client[_0x644f('0xe')](_0x18eee9,_0x1b7bc9)[_0x644f('0xf')](function(_0x2e8c6b){logger[_0x644f('0x10')](_0x644f('0x11'),_0x12210d,_0x644f('0x12'));logger['debug'](_0x644f('0x13'),_0x12210d,_0x644f('0x12'),JSON[_0x644f('0x14')](_0x2e8c6b));if(_0x2e8c6b[_0x644f('0x15')]){if(_0x2e8c6b[_0x644f('0x15')]['code']===0x1f4){logger['error'](_0x644f('0x11'),_0x12210d,_0x2e8c6b[_0x644f('0x15')][_0x644f('0x16')]);return _0x486476(_0x2e8c6b[_0x644f('0x15')][_0x644f('0x16')]);}logger[_0x644f('0x15')](_0x644f('0x11'),_0x12210d,_0x2e8c6b[_0x644f('0x15')][_0x644f('0x16')]);return _0x485c0a(_0x2e8c6b[_0x644f('0x15')][_0x644f('0x16')]);}else{logger['info'](_0x644f('0x11'),_0x12210d,_0x644f('0x12'));_0x485c0a(_0x2e8c6b['result'][_0x644f('0x16')]);}})['catch'](function(_0x15a0a2){logger[_0x644f('0x15')](_0x644f('0x11'),_0x12210d,_0x15a0a2);_0x486476(_0x15a0a2);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 3c431a4..9d3ca69 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 _0xada5=['emit','length','chatInternalMessage:','update'];(function(_0x43e854,_0x3daa61){var _0x52409b=function(_0x46e66c){while(--_0x46e66c){_0x43e854['push'](_0x43e854['shift']());}};_0x52409b(++_0x3daa61);}(_0xada5,0xd7));var _0x5ada=function(_0x23fe4a,_0x5e6044){_0x23fe4a=_0x23fe4a-0x0;var _0x13ff94=_0xada5[_0x23fe4a];return _0x13ff94;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save','remove',_0x5ada('0x0')];function createListener(_0x4fe421,_0xf27179){return function(_0x1a7a84){_0xf27179[_0x5ada('0x1')](_0x4fe421,_0x1a7a84);};}function removeListener(_0x193eca,_0x500e2a){return function(){ChatInternalMessageEvents['removeListener'](_0x193eca,_0x500e2a);};}exports['register']=function(_0x18949){for(var _0x48a6bf=0x0,_0x3d725f=events[_0x5ada('0x2')];_0x48a6bf<_0x3d725f;_0x48a6bf++){var _0x159b79=events[_0x48a6bf];var _0x2932af=createListener(_0x5ada('0x3')+_0x159b79,_0x18949);ChatInternalMessageEvents['on'](_0x159b79,_0x2932af);}};
\ No newline at end of file
+var _0x2df5=['remove','emit','removeListener','register','length','save'];(function(_0x36690b,_0x12e879){var _0x45d7dd=function(_0x132709){while(--_0x132709){_0x36690b['push'](_0x36690b['shift']());}};_0x45d7dd(++_0x12e879);}(_0x2df5,0x89));var _0x52df=function(_0x34000d,_0x15d6ba){_0x34000d=_0x34000d-0x0;var _0x34a9b7=_0x2df5[_0x34000d];return _0x34a9b7;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x52df('0x0'),_0x52df('0x1'),'update'];function createListener(_0x5fbcf5,_0x45b835){return function(_0x425b68){_0x45b835[_0x52df('0x2')](_0x5fbcf5,_0x425b68);};}function removeListener(_0x3932e3,_0x4d6d45){return function(){ChatInternalMessageEvents[_0x52df('0x3')](_0x3932e3,_0x4d6d45);};}exports[_0x52df('0x4')]=function(_0xcd9119){for(var _0x4867c6=0x0,_0x59730a=events[_0x52df('0x5')];_0x4867c6<_0x59730a;_0x4867c6++){var _0xcf7b69=events[_0x4867c6];var _0x4cbfc4=createListener('chatInternalMessage:'+_0xcf7b69,_0xcd9119);ChatInternalMessageEvents['on'](_0xcf7b69,_0x4cbfc4);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 8974f07..0cbb8c4 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 _0x0e4a=['describe','/users','/:id','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','get','/describe','isAuthenticated'];(function(_0x1cca49,_0x46800d){var _0x64efae=function(_0x280e75){while(--_0x280e75){_0x1cca49['push'](_0x1cca49['shift']());}};_0x64efae(++_0x46800d);}(_0x0e4a,0xc7));var _0xa0e4=function(_0x383d53,_0x3374dd){_0x383d53=_0x383d53-0x0;var _0x3a6eb9=_0x0e4a[_0x383d53];return _0x3a6eb9;};'use strict';var multer=require(_0xa0e4('0x0'));var util=require(_0xa0e4('0x1'));var path=require(_0xa0e4('0x2'));var timeout=require(_0xa0e4('0x3'));var express=require(_0xa0e4('0x4'));var router=express[_0xa0e4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa0e4('0x6'));var controller=require('./chatInternalMessage.controller');router[_0xa0e4('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xa0e4('0x8'),auth[_0xa0e4('0x9')](),controller[_0xa0e4('0xa')]);router[_0xa0e4('0x7')](_0xa0e4('0xb'),auth[_0xa0e4('0x9')](),controller['getUsers']);router[_0xa0e4('0x7')](_0xa0e4('0xc'),auth[_0xa0e4('0x9')](),controller['show']);router[_0xa0e4('0xd')]('/',auth[_0xa0e4('0x9')](),controller[_0xa0e4('0xe')]);router[_0xa0e4('0xf')](_0xa0e4('0xc'),controller[_0xa0e4('0x10')]);router['delete'](_0xa0e4('0xc'),auth[_0xa0e4('0x9')](),controller[_0xa0e4('0x11')]);module[_0xa0e4('0x12')]=router;
\ No newline at end of file
+var _0x9559=['util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','/users','getUsers','/:id','create','update','delete','multer'];(function(_0x30cc1a,_0x162bbc){var _0xb3f18f=function(_0x26bdfe){while(--_0x26bdfe){_0x30cc1a['push'](_0x30cc1a['shift']());}};_0xb3f18f(++_0x162bbc);}(_0x9559,0x1c7));var _0x9955=function(_0x2f62aa,_0x108e95){_0x2f62aa=_0x2f62aa-0x0;var _0x1a341f=_0x9559[_0x2f62aa];return _0x1a341f;};'use strict';var multer=require(_0x9955('0x0'));var util=require(_0x9955('0x1'));var path=require(_0x9955('0x2'));var timeout=require(_0x9955('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9955('0x4'));var auth=require(_0x9955('0x5'));var interaction=require(_0x9955('0x6'));var config=require(_0x9955('0x7'));var controller=require(_0x9955('0x8'));router[_0x9955('0x9')]('/',auth[_0x9955('0xa')](),controller[_0x9955('0xb')]);router['get'](_0x9955('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x9955('0x9')](_0x9955('0xd'),auth[_0x9955('0xa')](),controller[_0x9955('0xe')]);router[_0x9955('0x9')](_0x9955('0xf'),auth[_0x9955('0xa')](),controller['show']);router['post']('/',auth[_0x9955('0xa')](),controller[_0x9955('0x10')]);router['put'](_0x9955('0xf'),controller[_0x9955('0x11')]);router[_0x9955('0x12')](_0x9955('0xf'),auth[_0x9955('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 0916445..60d647f 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 _0xefe2=['TEXT','sequelize','exports','medium','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x5235a6,_0x680b76){var _0x1cf37e=function(_0x31c173){while(--_0x31c173){_0x5235a6['push'](_0x5235a6['shift']());}};_0x1cf37e(++_0x680b76);}(_0xefe2,0xd9));var _0x2efe=function(_0x4809b9,_0x2b1841){_0x4809b9=_0x4809b9-0x0;var _0x466a1b=_0xefe2[_0x4809b9];return _0x466a1b;};'use strict';var Sequelize=require(_0x2efe('0x0'));module[_0x2efe('0x1')]={'body':{'type':Sequelize['TEXT'](_0x2efe('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x2efe('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x2efe('0x4')]('in','out'),'defaultValue':_0x2efe('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x2efe('0x6')]},'providerName':{'type':Sequelize[_0x2efe('0x7')]},'providerResponse':{'type':Sequelize[_0x2efe('0x8')]}};
\ No newline at end of file
+var _0x5a13=['TEXT','sequelize','exports','medium','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0xdc4ef4,_0x48ffd4){var _0x136eeb=function(_0x471d9f){while(--_0x471d9f){_0xdc4ef4['push'](_0xdc4ef4['shift']());}};_0x136eeb(++_0x48ffd4);}(_0x5a13,0x145));var _0x35a1=function(_0x3fb324,_0x5f5908){_0x3fb324=_0x3fb324-0x0;var _0x583007=_0x5a13[_0x3fb324];return _0x583007;};'use strict';var Sequelize=require(_0x35a1('0x0'));module[_0x35a1('0x1')]={'body':{'type':Sequelize['TEXT'](_0x35a1('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x35a1('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x35a1('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x35a1('0x4')]('in',_0x35a1('0x5')),'defaultValue':_0x35a1('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x35a1('0x6')]},'providerName':{'type':Sequelize[_0x35a1('0x7')]},'providerResponse':{'type':Sequelize[_0x35a1('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 4f31926..421e79e 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 _0x0a63=['create','body','update','destroy','describe','chat-interactions','accept','chat','read','format','UserId','user','agent','get','ChatInteraction','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','SELECT','contact','User','fullname','email','manual','SIP/%s','channel','motionChannel','EventManager','parse','formData','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','ContactId','QueryTypes','internal','interface','event','rejectmessage','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./chatMessage.socket','jayson/promise','client','http','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','ChatMessage,\x20%s,\x20%s','result','catch','sendStatus','status','offset','undefined','count','limit','set','Content-Range','apply','reject','end','stack','name','send','index','map','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','ChatMessage','include','findAll','rows','show','params','keys','find'];(function(_0x2fd5e4,_0x1f80a2){var _0x1d9d38=function(_0x1fe481){while(--_0x1fe481){_0x2fd5e4['push'](_0x2fd5e4['shift']());}};_0x1d9d38(++_0x1f80a2);}(_0x0a63,0xb5));var _0x30a6=function(_0x5c49b4,_0x4d1512){_0x5c49b4=_0x5c49b4-0x0;var _0x54113d=_0x0a63[_0x5c49b4];return _0x54113d;};'use strict';var emlformat=require(_0x30a6('0x0'));var rimraf=require(_0x30a6('0x1'));var zipdir=require(_0x30a6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x30a6('0x3'));var moment=require('moment');var BPromise=require(_0x30a6('0x4'));var Mustache=require(_0x30a6('0x5'));var util=require(_0x30a6('0x6'));var path=require(_0x30a6('0x7'));var sox=require(_0x30a6('0x8'));var csv=require(_0x30a6('0x9'));var ejs=require(_0x30a6('0xa'));var fs=require('fs');var fs_extra=require(_0x30a6('0xb'));var _=require(_0x30a6('0xc'));var squel=require(_0x30a6('0xd'));var crypto=require('crypto');var jsforce=require(_0x30a6('0xe'));var deskjs=require(_0x30a6('0xf'));var toCsv=require(_0x30a6('0x9'));var querystring=require(_0x30a6('0x10'));var Papa=require('papaparse');var Redis=require(_0x30a6('0x11'));var authService=require(_0x30a6('0x12'));var qs=require(_0x30a6('0x13'));var as=require(_0x30a6('0x14'));var hardwareService=require(_0x30a6('0x15'));var logger=require(_0x30a6('0x16'))(_0x30a6('0x17'));var utils=require(_0x30a6('0x18'));var config=require(_0x30a6('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x30a6('0x1a'))['db'];config['redis']=_[_0x30a6('0x1b')](config[_0x30a6('0x1c')],{'host':_0x30a6('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x30a6('0x1e'))['register'](socket);var jayson=require(_0x30a6('0x1f'));var client=jayson[_0x30a6('0x20')]['http']({'port':0x232c});var client9002=jayson['client'][_0x30a6('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x53da8c,_0x253daa,_0x341865,_0x2b8e5c){return new BPromise(function(_0x3941b5,_0x4b5df5){var _0x433b27=_0x2b8e5c||client;return _0x433b27['request'](_0x53da8c,_0x341865)[_0x30a6('0x22')](function(_0x471583){logger[_0x30a6('0x23')]('ChatMessage,\x20%s,\x20%s',_0x253daa,_0x30a6('0x24'));logger[_0x30a6('0x25')](_0x30a6('0x26'),_0x253daa,'request\x20sent',JSON['stringify'](_0x471583));if(_0x471583[_0x30a6('0x27')]){if(_0x471583[_0x30a6('0x27')][_0x30a6('0x28')]===0x1f4){logger[_0x30a6('0x27')]('ChatMessage,\x20%s,\x20%s',_0x253daa,_0x471583['error'][_0x30a6('0x29')]);return _0x4b5df5(_0x471583['error'][_0x30a6('0x29')]);}logger[_0x30a6('0x27')](_0x30a6('0x2a'),_0x253daa,_0x471583[_0x30a6('0x27')]['message']);return _0x3941b5(_0x471583[_0x30a6('0x27')]['message']);}else{logger[_0x30a6('0x23')](_0x30a6('0x2a'),_0x253daa,'request\x20sent');_0x3941b5(_0x471583[_0x30a6('0x2b')][_0x30a6('0x29')]);}})[_0x30a6('0x2c')](function(_0x2d9889){logger[_0x30a6('0x27')](_0x30a6('0x2a'),_0x253daa,_0x2d9889);_0x4b5df5(_0x2d9889);});});}function respondWithStatusCode(_0x48aee6,_0xf5640b){_0xf5640b=_0xf5640b||0xcc;return function(_0x1beb7e){if(_0x1beb7e){return _0x48aee6[_0x30a6('0x2d')](_0xf5640b);}return _0x48aee6[_0x30a6('0x2e')](_0xf5640b)['end']();};}function respondWithResult(_0x49e7a7,_0x313d92){_0x313d92=_0x313d92||0xc8;return function(_0x113934){if(_0x113934){return _0x49e7a7[_0x30a6('0x2e')](_0x313d92)['json'](_0x113934);}};}function respondWithFilteredResult(_0x4a3053,_0xe08c88){return function(_0x68fd68){if(_0x68fd68){var _0x535ee0=typeof _0xe08c88[_0x30a6('0x2f')]===_0x30a6('0x30')&&typeof _0xe08c88['limit']===_0x30a6('0x30');var _0x2f9092=_0x68fd68[_0x30a6('0x31')];var _0x8599e7=_0x535ee0?0x0:_0xe08c88[_0x30a6('0x2f')];var _0xe04b23=_0x535ee0?_0x68fd68[_0x30a6('0x31')]:_0xe08c88[_0x30a6('0x2f')]+_0xe08c88[_0x30a6('0x32')];var _0x1b82ae;if(_0xe04b23>=_0x2f9092){_0xe04b23=_0x2f9092;_0x1b82ae=0xc8;}else{_0x1b82ae=0xce;}_0x4a3053['status'](_0x1b82ae);return _0x4a3053[_0x30a6('0x33')](_0x30a6('0x34'),_0x8599e7+'-'+_0xe04b23+'/'+_0x2f9092)['json'](_0x68fd68);}return null;};}function patchUpdates(_0x2d8fcd){return function(_0x1000b4){try{jsonpatch[_0x30a6('0x35')](_0x1000b4,_0x2d8fcd,!![]);}catch(_0x149e85){return BPromise[_0x30a6('0x36')](_0x149e85);}return _0x1000b4['save']();};}function saveUpdates(_0x41a4bf,_0x5b331d){return function(_0x2c54a9){if(_0x2c54a9){return _0x2c54a9['update'](_0x41a4bf)[_0x30a6('0x22')](function(_0x59f7fd){return _0x59f7fd;});}return null;};}function removeEntity(_0x1e0526,_0x25c3ee){return function(_0x4c810d){if(_0x4c810d){return _0x4c810d['destroy']()[_0x30a6('0x22')](function(){_0x1e0526[_0x30a6('0x2e')](0xcc)[_0x30a6('0x37')]();});}};}function handleEntityNotFound(_0x1841e1,_0x783e8){return function(_0x5016ca){if(!_0x5016ca){_0x1841e1['sendStatus'](0x194);}return _0x5016ca;};}function handleError(_0x17784e,_0x55fff1){_0x55fff1=_0x55fff1||0x1f4;return function(_0x592693){logger[_0x30a6('0x27')](_0x592693[_0x30a6('0x38')]);if(_0x592693[_0x30a6('0x39')]){delete _0x592693[_0x30a6('0x39')];}_0x17784e['status'](_0x55fff1)[_0x30a6('0x3a')](_0x592693);};}exports[_0x30a6('0x3b')]=function(_0x224e4d,_0x1ef7ac){var _0x9a5167={},_0xc4394f={},_0x49952a={'count':0x0,'rows':[]};var _0x67ccbd=_[_0x30a6('0x3c')](db['ChatMessage'][_0x30a6('0x3d')],function(_0x272acb){return{'name':_0x272acb['fieldName'],'type':_0x272acb['type'][_0x30a6('0x3e')]};});_0xc4394f[_0x30a6('0x3f')]=_[_0x30a6('0x3c')](_0x67ccbd,'name');_0xc4394f[_0x30a6('0x40')]=_['keys'](_0x224e4d['query']);_0xc4394f[_0x30a6('0x41')]=_[_0x30a6('0x42')](_0xc4394f[_0x30a6('0x3f')],_0xc4394f[_0x30a6('0x40')]);_0x9a5167[_0x30a6('0x43')]=_['intersection'](_0xc4394f[_0x30a6('0x3f')],qs[_0x30a6('0x44')](_0x224e4d[_0x30a6('0x40')][_0x30a6('0x44')]));_0x9a5167['attributes']=_0x9a5167[_0x30a6('0x43')][_0x30a6('0x45')]?_0x9a5167[_0x30a6('0x43')]:_0xc4394f[_0x30a6('0x3f')];if(!_0x224e4d['query'][_0x30a6('0x46')](_0x30a6('0x47'))){_0x9a5167[_0x30a6('0x32')]=qs[_0x30a6('0x32')](_0x224e4d['query'][_0x30a6('0x32')]);_0x9a5167['offset']=qs['offset'](_0x224e4d[_0x30a6('0x40')][_0x30a6('0x2f')]);}_0x9a5167[_0x30a6('0x48')]=qs[_0x30a6('0x49')](_0x224e4d[_0x30a6('0x40')]['sort']);_0x9a5167[_0x30a6('0x4a')]=qs[_0x30a6('0x41')](_[_0x30a6('0x4b')](_0x224e4d[_0x30a6('0x40')],_0xc4394f['filters']),_0x67ccbd);if(_0x224e4d[_0x30a6('0x40')]['filter']){_0x9a5167[_0x30a6('0x4a')]=_[_0x30a6('0x4c')](_0x9a5167[_0x30a6('0x4a')],{'$or':_['map'](_0x67ccbd,function(_0x167af4){if(_0x167af4[_0x30a6('0x4d')]!==_0x30a6('0x4e')){var _0x2318e6={};_0x2318e6[_0x167af4['name']]={'$like':'%'+_0x224e4d['query'][_0x30a6('0x4f')]+'%'};return _0x2318e6;}})});}_0x9a5167=_[_0x30a6('0x4c')]({},_0x9a5167,_0x224e4d[_0x30a6('0x50')]);var _0xeacced={'where':_0x9a5167[_0x30a6('0x4a')]};return db[_0x30a6('0x51')][_0x30a6('0x31')](_0xeacced)[_0x30a6('0x22')](function(_0x1332a1){_0x49952a[_0x30a6('0x31')]=_0x1332a1;if(_0x224e4d[_0x30a6('0x40')]['includeAll']){_0x9a5167[_0x30a6('0x52')]=[{'all':!![]}];}return db[_0x30a6('0x51')][_0x30a6('0x53')](_0x9a5167);})[_0x30a6('0x22')](function(_0x2a8bca){_0x49952a[_0x30a6('0x54')]=_0x2a8bca;return _0x49952a;})[_0x30a6('0x22')](respondWithFilteredResult(_0x1ef7ac,_0x9a5167))[_0x30a6('0x2c')](handleError(_0x1ef7ac,null));};exports[_0x30a6('0x55')]=function(_0x13ae56,_0x4aaa67){var _0x19ba56={'raw':!![],'where':{'id':_0x13ae56[_0x30a6('0x56')]['id']}},_0x229ea0={};_0x229ea0[_0x30a6('0x3f')]=_[_0x30a6('0x57')](db[_0x30a6('0x51')][_0x30a6('0x3d')]);_0x229ea0[_0x30a6('0x40')]=_[_0x30a6('0x57')](_0x13ae56['query']);_0x229ea0[_0x30a6('0x41')]=_[_0x30a6('0x42')](_0x229ea0[_0x30a6('0x3f')],_0x229ea0[_0x30a6('0x40')]);_0x19ba56[_0x30a6('0x43')]=_[_0x30a6('0x42')](_0x229ea0['model'],qs[_0x30a6('0x44')](_0x13ae56[_0x30a6('0x40')]['fields']));_0x19ba56[_0x30a6('0x43')]=_0x19ba56[_0x30a6('0x43')][_0x30a6('0x45')]?_0x19ba56[_0x30a6('0x43')]:_0x229ea0[_0x30a6('0x3f')];if(_0x13ae56[_0x30a6('0x40')]['includeAll']){_0x19ba56[_0x30a6('0x52')]=[{'all':!![]}];}_0x19ba56=_['merge']({},_0x19ba56,_0x13ae56[_0x30a6('0x50')]);return db[_0x30a6('0x51')][_0x30a6('0x58')](_0x19ba56)[_0x30a6('0x22')](handleEntityNotFound(_0x4aaa67,null))['then'](respondWithResult(_0x4aaa67,null))[_0x30a6('0x2c')](handleError(_0x4aaa67,null));};exports[_0x30a6('0x59')]=function(_0x258214,_0x2abc17){return db[_0x30a6('0x51')][_0x30a6('0x59')](_0x258214[_0x30a6('0x5a')],{})[_0x30a6('0x22')](respondWithResult(_0x2abc17,0xc9))['catch'](handleError(_0x2abc17,null));};exports[_0x30a6('0x5b')]=function(_0x38caf3,_0x5c5c57){if(_0x38caf3[_0x30a6('0x5a')]['id']){delete _0x38caf3[_0x30a6('0x5a')]['id'];}return db['ChatMessage'][_0x30a6('0x58')]({'where':{'id':_0x38caf3[_0x30a6('0x56')]['id']}})[_0x30a6('0x22')](handleEntityNotFound(_0x5c5c57,null))[_0x30a6('0x22')](saveUpdates(_0x38caf3[_0x30a6('0x5a')],null))[_0x30a6('0x22')](respondWithResult(_0x5c5c57,null))[_0x30a6('0x2c')](handleError(_0x5c5c57,null));};exports[_0x30a6('0x5c')]=function(_0x323008,_0x470c78){return db['ChatMessage'][_0x30a6('0x58')]({'where':{'id':_0x323008[_0x30a6('0x56')]['id']}})[_0x30a6('0x22')](handleEntityNotFound(_0x470c78,null))['then'](removeEntity(_0x470c78,null))['catch'](handleError(_0x470c78,null));};exports[_0x30a6('0x5d')]=function(_0x919297,_0x2d3c2d){return db[_0x30a6('0x51')][_0x30a6('0x5d')]()[_0x30a6('0x22')](respondWithResult(_0x2d3c2d,null))[_0x30a6('0x2c')](handleError(_0x2d3c2d,null));};var interaction_log=require(_0x30a6('0x16'))(_0x30a6('0x5e'));exports[_0x30a6('0x5f')]=function(_0x359074,_0x1c35c6,_0x583527){var _0x1020ed={'agent':{},'channel':_0x30a6('0x60')};if(_0x359074[_0x30a6('0x5a')]['id']){delete _0x359074[_0x30a6('0x5a')]['id'];}_0x359074[_0x30a6('0x5a')][_0x30a6('0x61')]=!![];_0x359074[_0x30a6('0x5a')]['readAt']=moment()[_0x30a6('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x359074[_0x30a6('0x5a')][_0x30a6('0x63')]=_0x359074['body']['UserId']||_0x359074[_0x30a6('0x64')]['id'];_0x1020ed[_0x30a6('0x65')]['id']=_0x359074['body'][_0x30a6('0x63')];return db['ChatMessage']['find']({'where':{'id':_0x359074[_0x30a6('0x56')]['id'],'UserId':null}})[_0x30a6('0x22')](handleEntityNotFound(_0x1c35c6,null))[_0x30a6('0x22')](saveUpdates(_0x359074[_0x30a6('0x5a')],null))[_0x30a6('0x22')](function(_0x19e6c5){if(_0x19e6c5){_0x1020ed[_0x30a6('0x29')]=_0x19e6c5[_0x30a6('0x66')]({'plain':!![]});return db[_0x30a6('0x67')][_0x30a6('0x58')]({'where':{'id':_0x19e6c5['ChatInteractionId']}});}return null;})[_0x30a6('0x22')](handleEntityNotFound(_0x1c35c6,null))['then'](function(_0xa7fc91){if(_0xa7fc91){return _0xa7fc91[_0x30a6('0x5b')]({'UserId':_0x359074[_0x30a6('0x5a')][_0x30a6('0x63')],'read1stAt':_[_0x30a6('0x68')](_0xa7fc91[_0x30a6('0x69')])?moment()[_0x30a6('0x62')](_0x30a6('0x6a')):undefined});}return null;})[_0x30a6('0x22')](function(_0x60db73){if(_0x60db73){_0x1020ed[_0x30a6('0x6b')]=_0x60db73[_0x30a6('0x66')]({'plain':!![]});interaction_log[_0x30a6('0x23')](_0x30a6('0x6c'),_0x359074[_0x30a6('0x64')]['id'],_0x359074['user'][_0x30a6('0x39')],_0x359074[_0x30a6('0x64')][_0x30a6('0x6d')],_0x1020ed[_0x30a6('0x6b')]['id'],_0x359074[_0x30a6('0x5a')]?JSON['stringify'](_0x359074[_0x30a6('0x5a')]):_0x30a6('0x6e'));return respondWithRpcPromise('AcceptMessage',_0x30a6('0x6f'),_0x1020ed);}return null;})['then'](function(_0xdff0a9){var _0x381150=_0x30a6('0x70')+_0xdff0a9[_0x30a6('0x29')]['ContactId'];return db[_0x30a6('0x71')][_0x30a6('0x40')](_0x381150,{'type':db['Sequelize']['QueryTypes'][_0x30a6('0x72')],'raw':!![]})[_0x30a6('0x22')](function(_0x2868b0){return _0x2868b0;});})[_0x30a6('0x22')](function(_0x24689f){if(_0x24689f){_0x1020ed[_0x30a6('0x29')][_0x30a6('0x73')]=_0x24689f[0x0];if(!_0x359074[_0x30a6('0x5a')][_0x30a6('0x63')])return;return db[_0x30a6('0x74')][_0x30a6('0x58')]({'where':{'id':_0x359074['body'][_0x30a6('0x63')],'role':_0x30a6('0x65')},'attributes':['id',_0x30a6('0x39'),_0x30a6('0x75'),_0x30a6('0x76'),'internal'],'raw':!![]});}return null;})['then'](function(_0x504a81){if(!_0x504a81)return null;_0x1020ed[_0x30a6('0x29')]['agent']=_0x504a81;return _0x1020ed;})['then'](function(_0x4f94cb){if(_0x4f94cb){if(_0x359074['body'][_0x30a6('0x77')]){_0x1020ed['message']['interface']=util[_0x30a6('0x62')](_0x30a6('0x78'),_0x359074[_0x30a6('0x64')][_0x30a6('0x39')]);_0x1020ed[_0x30a6('0x29')][_0x30a6('0x79')]=_0x1020ed['channel'];_0x1020ed[_0x30a6('0x29')][_0x30a6('0x7a')]=_0x1020ed[_0x30a6('0x79')];_0x1020ed[_0x30a6('0x29')]['event']=_0x30a6('0x5f');return respondWithRpcPromise('EventManager',_0x30a6('0x7b'),{'event':'acceptmessage','message':_['merge'](_0x1020ed['message'],JSON[_0x30a6('0x7c')](_0x1020ed[_0x30a6('0x6b')][_0x30a6('0x7d')]))},client9002)[_0x30a6('0x22')](function(){return _0x1020ed;});}return _0x1020ed;}return null;})[_0x30a6('0x22')](respondWithResult(_0x1c35c6,null))[_0x30a6('0x2c')](handleError(_0x1c35c6,null));};var interaction_log=require('../../config/logger')(_0x30a6('0x5e'));exports['reject']=function(_0x367a03,_0x26888a,_0x124a82){var _0x4599f4={'agent':{},'channel':_0x30a6('0x60')};if(_0x367a03['body']['id']){delete _0x367a03[_0x30a6('0x5a')]['id'];}_0x367a03[_0x30a6('0x5a')]['UserId']=_0x367a03['body'][_0x30a6('0x63')]||_0x367a03[_0x30a6('0x64')]['id'];_0x4599f4[_0x30a6('0x65')]['id']=_0x367a03[_0x30a6('0x5a')]['UserId'];return db[_0x30a6('0x51')]['find']({'where':{'id':_0x367a03[_0x30a6('0x56')]['id'],'UserId':null}})[_0x30a6('0x22')](handleEntityNotFound(_0x26888a,null))['then'](function(_0x48cd4f){if(_0x48cd4f){_0x4599f4[_0x30a6('0x29')]=_0x48cd4f[_0x30a6('0x66')]({'plain':!![]});return db[_0x30a6('0x67')][_0x30a6('0x58')]({'where':{'id':_0x48cd4f[_0x30a6('0x7e')]}});}return null;})[_0x30a6('0x22')](handleEntityNotFound(_0x26888a,null))[_0x30a6('0x22')](function(_0x53aa02){if(_0x53aa02){_0x4599f4[_0x30a6('0x6b')]=_0x53aa02[_0x30a6('0x66')]({'plain':!![]});interaction_log[_0x30a6('0x23')](_0x30a6('0x7f'),_0x367a03['user']['id'],_0x367a03[_0x30a6('0x64')][_0x30a6('0x39')],_0x367a03['user'][_0x30a6('0x6d')],_0x4599f4[_0x30a6('0x6b')]['id'],_0x367a03[_0x30a6('0x5a')]?JSON['stringify'](_0x367a03[_0x30a6('0x5a')]):_0x30a6('0x6e'));return respondWithRpcPromise(_0x30a6('0x80'),'rejectMessage',_0x4599f4);}return null;})['then'](function(_0x4be72a){var _0x291b66=_0x30a6('0x70')+_0x4be72a['message'][_0x30a6('0x81')];return db['sequelize'][_0x30a6('0x40')](_0x291b66,{'type':db['Sequelize'][_0x30a6('0x82')][_0x30a6('0x72')],'raw':!![]})[_0x30a6('0x22')](function(_0x197df9){return _0x197df9;});})['then'](function(_0x31753e){if(_0x31753e){_0x4599f4['message'][_0x30a6('0x73')]=_0x31753e[0x0];if(!_0x367a03['body'][_0x30a6('0x63')])return;return db['User'][_0x30a6('0x58')]({'where':{'id':_0x367a03[_0x30a6('0x5a')][_0x30a6('0x63')],'role':'agent'},'attributes':['id','name','fullname',_0x30a6('0x76'),_0x30a6('0x83')],'raw':!![]});}return null;})[_0x30a6('0x22')](function(_0x1b7757){if(!_0x1b7757)return null;_0x4599f4[_0x30a6('0x29')][_0x30a6('0x65')]=_0x1b7757;return _0x4599f4;})[_0x30a6('0x22')](function(_0x2cbad5){if(_0x2cbad5){_0x2cbad5[_0x30a6('0x29')][_0x30a6('0x84')]=util[_0x30a6('0x62')]('SIP/%s',_0x367a03['user'][_0x30a6('0x39')]);_0x2cbad5[_0x30a6('0x29')][_0x30a6('0x79')]=_0x4599f4['channel'];_0x2cbad5['message']['motionChannel']=_0x4599f4['channel'];_0x2cbad5[_0x30a6('0x29')][_0x30a6('0x85')]=_0x30a6('0x36');respondWithRpcPromise(_0x30a6('0x7b'),_0x30a6('0x7b'),{'event':_0x30a6('0x86'),'message':_[_0x30a6('0x4c')](_0x4599f4[_0x30a6('0x29')],JSON['parse'](_0x4599f4[_0x30a6('0x6b')][_0x30a6('0x7d')]))},client9002);return _0x4599f4;}return null;})[_0x30a6('0x22')](respondWithResult(_0x26888a,null))['catch'](handleError(_0x26888a,null));};
\ No newline at end of file
+var _0x3311=['SELECT','User','fullname','internal','manual','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','formData','chat-interactions','reject','chat','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','RejectMessage','rejectMessage','contact','email','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','offset','undefined','limit','count','Content-Range','apply','update','destroy','sendStatus','name','send','index','map','ChatMessage','fieldName','type','key','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','keys','rawAttributes','intersection','find','catch','create','body','params','describe','../../config/logger','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','isNil','read1stAt','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x3311,0x12c));var _0x1331=function(_0x557e88,_0x52423b){_0x557e88=_0x557e88-0x0;var _0x55ae36=_0x3311[_0x557e88];return _0x55ae36;};'use strict';var emlformat=require(_0x1331('0x0'));var rimraf=require(_0x1331('0x1'));var zipdir=require(_0x1331('0x2'));var jsonpatch=require(_0x1331('0x3'));var rp=require(_0x1331('0x4'));var moment=require(_0x1331('0x5'));var BPromise=require(_0x1331('0x6'));var Mustache=require(_0x1331('0x7'));var util=require(_0x1331('0x8'));var path=require(_0x1331('0x9'));var sox=require('sox');var csv=require(_0x1331('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1331('0xb'));var _=require(_0x1331('0xc'));var squel=require(_0x1331('0xd'));var crypto=require(_0x1331('0xe'));var jsforce=require(_0x1331('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1331('0x10'));var Papa=require(_0x1331('0x11'));var Redis=require(_0x1331('0x12'));var authService=require(_0x1331('0x13'));var qs=require(_0x1331('0x14'));var as=require(_0x1331('0x15'));var hardwareService=require(_0x1331('0x16'));var logger=require('../../config/logger')(_0x1331('0x17'));var utils=require('../../config/utils');var config=require(_0x1331('0x18'));var licenseUtil=require(_0x1331('0x19'));var db=require(_0x1331('0x1a'))['db'];config[_0x1331('0x1b')]=_[_0x1331('0x1c')](config['redis'],{'host':_0x1331('0x1d'),'port':0x18eb});var socket=require(_0x1331('0x1e'))(new Redis(config['redis']));require('./chatMessage.socket')[_0x1331('0x1f')](socket);var jayson=require(_0x1331('0x20'));var client=jayson[_0x1331('0x21')][_0x1331('0x22')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x6ceb26,_0x3db63d,_0x4beabd,_0x329b73){return new BPromise(function(_0x1e3792,_0x56effb){var _0x241dfc=_0x329b73||client;return _0x241dfc[_0x1331('0x23')](_0x6ceb26,_0x4beabd)[_0x1331('0x24')](function(_0x41c016){logger[_0x1331('0x25')](_0x1331('0x26'),_0x3db63d,_0x1331('0x27'));logger[_0x1331('0x28')](_0x1331('0x29'),_0x3db63d,_0x1331('0x27'),JSON[_0x1331('0x2a')](_0x41c016));if(_0x41c016[_0x1331('0x2b')]){if(_0x41c016['error'][_0x1331('0x2c')]===0x1f4){logger[_0x1331('0x2b')](_0x1331('0x26'),_0x3db63d,_0x41c016[_0x1331('0x2b')][_0x1331('0x2d')]);return _0x56effb(_0x41c016['error'][_0x1331('0x2d')]);}logger[_0x1331('0x2b')]('ChatMessage,\x20%s,\x20%s',_0x3db63d,_0x41c016[_0x1331('0x2b')][_0x1331('0x2d')]);return _0x1e3792(_0x41c016[_0x1331('0x2b')][_0x1331('0x2d')]);}else{logger[_0x1331('0x25')](_0x1331('0x26'),_0x3db63d,_0x1331('0x27'));_0x1e3792(_0x41c016[_0x1331('0x2e')][_0x1331('0x2d')]);}})['catch'](function(_0x5ecd1b){logger[_0x1331('0x2b')](_0x1331('0x26'),_0x3db63d,_0x5ecd1b);_0x56effb(_0x5ecd1b);});});}function respondWithStatusCode(_0x50ff11,_0xf35ae8){_0xf35ae8=_0xf35ae8||0xcc;return function(_0x3908cb){if(_0x3908cb){return _0x50ff11['sendStatus'](_0xf35ae8);}return _0x50ff11[_0x1331('0x2f')](_0xf35ae8)[_0x1331('0x30')]();};}function respondWithResult(_0x305d3b,_0x32117d){_0x32117d=_0x32117d||0xc8;return function(_0x5b56ea){if(_0x5b56ea){return _0x305d3b[_0x1331('0x2f')](_0x32117d)[_0x1331('0x31')](_0x5b56ea);}};}function respondWithFilteredResult(_0x2d7cbd,_0x690c9c){return function(_0x27ee85){if(_0x27ee85){var _0x49dbbf=typeof _0x690c9c[_0x1331('0x32')]===_0x1331('0x33')&&typeof _0x690c9c[_0x1331('0x34')]===_0x1331('0x33');var _0x1558dd=_0x27ee85['count'];var _0x13fc4e=_0x49dbbf?0x0:_0x690c9c[_0x1331('0x32')];var _0x4f4cbf=_0x49dbbf?_0x27ee85[_0x1331('0x35')]:_0x690c9c[_0x1331('0x32')]+_0x690c9c[_0x1331('0x34')];var _0x440e86;if(_0x4f4cbf>=_0x1558dd){_0x4f4cbf=_0x1558dd;_0x440e86=0xc8;}else{_0x440e86=0xce;}_0x2d7cbd[_0x1331('0x2f')](_0x440e86);return _0x2d7cbd['set'](_0x1331('0x36'),_0x13fc4e+'-'+_0x4f4cbf+'/'+_0x1558dd)[_0x1331('0x31')](_0x27ee85);}return null;};}function patchUpdates(_0x454e95){return function(_0xf7d7f0){try{jsonpatch[_0x1331('0x37')](_0xf7d7f0,_0x454e95,!![]);}catch(_0x29228a){return BPromise['reject'](_0x29228a);}return _0xf7d7f0['save']();};}function saveUpdates(_0x1588d2,_0xf0e19b){return function(_0x1388d3){if(_0x1388d3){return _0x1388d3[_0x1331('0x38')](_0x1588d2)[_0x1331('0x24')](function(_0x322944){return _0x322944;});}return null;};}function removeEntity(_0x12cb06,_0x5e3fd4){return function(_0x5af617){if(_0x5af617){return _0x5af617[_0x1331('0x39')]()['then'](function(){_0x12cb06[_0x1331('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x478026,_0x2b5e6c){return function(_0x2c083a){if(!_0x2c083a){_0x478026[_0x1331('0x3a')](0x194);}return _0x2c083a;};}function handleError(_0x5e9e54,_0x1972d0){_0x1972d0=_0x1972d0||0x1f4;return function(_0x2a3d80){logger[_0x1331('0x2b')](_0x2a3d80['stack']);if(_0x2a3d80[_0x1331('0x3b')]){delete _0x2a3d80['name'];}_0x5e9e54['status'](_0x1972d0)[_0x1331('0x3c')](_0x2a3d80);};}exports[_0x1331('0x3d')]=function(_0x19fa9a,_0x2d2272){var _0x11eaab={},_0x4f1311={},_0x41a02e={'count':0x0,'rows':[]};var _0x377663=_[_0x1331('0x3e')](db[_0x1331('0x3f')]['rawAttributes'],function(_0x1212c4){return{'name':_0x1212c4[_0x1331('0x40')],'type':_0x1212c4[_0x1331('0x41')][_0x1331('0x42')]};});_0x4f1311[_0x1331('0x43')]=_['map'](_0x377663,_0x1331('0x3b'));_0x4f1311['query']=_['keys'](_0x19fa9a[_0x1331('0x44')]);_0x4f1311['filters']=_['intersection'](_0x4f1311[_0x1331('0x43')],_0x4f1311[_0x1331('0x44')]);_0x11eaab[_0x1331('0x45')]=_['intersection'](_0x4f1311[_0x1331('0x43')],qs[_0x1331('0x46')](_0x19fa9a[_0x1331('0x44')][_0x1331('0x46')]));_0x11eaab['attributes']=_0x11eaab[_0x1331('0x45')]['length']?_0x11eaab[_0x1331('0x45')]:_0x4f1311['model'];if(!_0x19fa9a[_0x1331('0x44')][_0x1331('0x47')](_0x1331('0x48'))){_0x11eaab[_0x1331('0x34')]=qs['limit'](_0x19fa9a['query'][_0x1331('0x34')]);_0x11eaab[_0x1331('0x32')]=qs['offset'](_0x19fa9a[_0x1331('0x44')][_0x1331('0x32')]);}_0x11eaab[_0x1331('0x49')]=qs[_0x1331('0x4a')](_0x19fa9a[_0x1331('0x44')][_0x1331('0x4a')]);_0x11eaab[_0x1331('0x4b')]=qs[_0x1331('0x4c')](_['pick'](_0x19fa9a['query'],_0x4f1311[_0x1331('0x4c')]),_0x377663);if(_0x19fa9a[_0x1331('0x44')][_0x1331('0x4d')]){_0x11eaab['where']=_[_0x1331('0x4e')](_0x11eaab[_0x1331('0x4b')],{'$or':_['map'](_0x377663,function(_0x1c76f8){if(_0x1c76f8[_0x1331('0x41')]!==_0x1331('0x4f')){var _0x6b152b={};_0x6b152b[_0x1c76f8[_0x1331('0x3b')]]={'$like':'%'+_0x19fa9a[_0x1331('0x44')][_0x1331('0x4d')]+'%'};return _0x6b152b;}})});}_0x11eaab=_['merge']({},_0x11eaab,_0x19fa9a[_0x1331('0x50')]);var _0x5d17b7={'where':_0x11eaab[_0x1331('0x4b')]};return db['ChatMessage'][_0x1331('0x35')](_0x5d17b7)[_0x1331('0x24')](function(_0xb13f13){_0x41a02e[_0x1331('0x35')]=_0xb13f13;if(_0x19fa9a['query'][_0x1331('0x51')]){_0x11eaab[_0x1331('0x52')]=[{'all':!![]}];}return db[_0x1331('0x3f')]['findAll'](_0x11eaab);})[_0x1331('0x24')](function(_0x30dd47){_0x41a02e['rows']=_0x30dd47;return _0x41a02e;})[_0x1331('0x24')](respondWithFilteredResult(_0x2d2272,_0x11eaab))['catch'](handleError(_0x2d2272,null));};exports['show']=function(_0x4e9d81,_0x431fae){var _0x23db12={'raw':!![],'where':{'id':_0x4e9d81['params']['id']}},_0x2c8f03={};_0x2c8f03['model']=_[_0x1331('0x53')](db[_0x1331('0x3f')][_0x1331('0x54')]);_0x2c8f03[_0x1331('0x44')]=_['keys'](_0x4e9d81[_0x1331('0x44')]);_0x2c8f03[_0x1331('0x4c')]=_[_0x1331('0x55')](_0x2c8f03[_0x1331('0x43')],_0x2c8f03['query']);_0x23db12[_0x1331('0x45')]=_[_0x1331('0x55')](_0x2c8f03[_0x1331('0x43')],qs[_0x1331('0x46')](_0x4e9d81['query'][_0x1331('0x46')]));_0x23db12[_0x1331('0x45')]=_0x23db12[_0x1331('0x45')]['length']?_0x23db12[_0x1331('0x45')]:_0x2c8f03[_0x1331('0x43')];if(_0x4e9d81[_0x1331('0x44')][_0x1331('0x51')]){_0x23db12[_0x1331('0x52')]=[{'all':!![]}];}_0x23db12=_[_0x1331('0x4e')]({},_0x23db12,_0x4e9d81[_0x1331('0x50')]);return db['ChatMessage'][_0x1331('0x56')](_0x23db12)[_0x1331('0x24')](handleEntityNotFound(_0x431fae,null))[_0x1331('0x24')](respondWithResult(_0x431fae,null))[_0x1331('0x57')](handleError(_0x431fae,null));};exports[_0x1331('0x58')]=function(_0x3365e7,_0x190288){return db[_0x1331('0x3f')][_0x1331('0x58')](_0x3365e7[_0x1331('0x59')],{})[_0x1331('0x24')](respondWithResult(_0x190288,0xc9))['catch'](handleError(_0x190288,null));};exports[_0x1331('0x38')]=function(_0x333b4c,_0x4dd70d){if(_0x333b4c[_0x1331('0x59')]['id']){delete _0x333b4c['body']['id'];}return db[_0x1331('0x3f')][_0x1331('0x56')]({'where':{'id':_0x333b4c[_0x1331('0x5a')]['id']}})[_0x1331('0x24')](handleEntityNotFound(_0x4dd70d,null))[_0x1331('0x24')](saveUpdates(_0x333b4c[_0x1331('0x59')],null))['then'](respondWithResult(_0x4dd70d,null))[_0x1331('0x57')](handleError(_0x4dd70d,null));};exports[_0x1331('0x39')]=function(_0x4dc689,_0x299c08){return db[_0x1331('0x3f')]['find']({'where':{'id':_0x4dc689[_0x1331('0x5a')]['id']}})[_0x1331('0x24')](handleEntityNotFound(_0x299c08,null))['then'](removeEntity(_0x299c08,null))['catch'](handleError(_0x299c08,null));};exports['describe']=function(_0x150581,_0x5eb7ce){return db[_0x1331('0x3f')][_0x1331('0x5b')]()[_0x1331('0x24')](respondWithResult(_0x5eb7ce,null))[_0x1331('0x57')](handleError(_0x5eb7ce,null));};var interaction_log=require(_0x1331('0x5c'))('chat-interactions');exports['accept']=function(_0x43fb66,_0xb03fbb,_0x40b638){var _0x1ab6a4={'agent':{},'channel':'chat'};if(_0x43fb66[_0x1331('0x59')]['id']){delete _0x43fb66[_0x1331('0x59')]['id'];}_0x43fb66[_0x1331('0x59')][_0x1331('0x5d')]=!![];_0x43fb66['body'][_0x1331('0x5e')]=moment()[_0x1331('0x5f')](_0x1331('0x60'));_0x43fb66['body'][_0x1331('0x61')]=_0x43fb66[_0x1331('0x59')][_0x1331('0x61')]||_0x43fb66[_0x1331('0x62')]['id'];_0x1ab6a4[_0x1331('0x63')]['id']=_0x43fb66[_0x1331('0x59')][_0x1331('0x61')];return db['ChatMessage'][_0x1331('0x56')]({'where':{'id':_0x43fb66[_0x1331('0x5a')]['id'],'UserId':null}})[_0x1331('0x24')](handleEntityNotFound(_0xb03fbb,null))['then'](saveUpdates(_0x43fb66[_0x1331('0x59')],null))[_0x1331('0x24')](function(_0xefb4d9){if(_0xefb4d9){_0x1ab6a4[_0x1331('0x2d')]=_0xefb4d9[_0x1331('0x64')]({'plain':!![]});return db[_0x1331('0x65')][_0x1331('0x56')]({'where':{'id':_0xefb4d9['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0xb03fbb,null))['then'](function(_0x29979d){if(_0x29979d){return _0x29979d['update']({'UserId':_0x43fb66['body'][_0x1331('0x61')],'read1stAt':_[_0x1331('0x66')](_0x29979d[_0x1331('0x67')])?moment()[_0x1331('0x5f')](_0x1331('0x60')):undefined});}return null;})[_0x1331('0x24')](function(_0x35a6ee){if(_0x35a6ee){_0x1ab6a4['interaction']=_0x35a6ee[_0x1331('0x64')]({'plain':!![]});interaction_log[_0x1331('0x25')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x43fb66['user']['id'],_0x43fb66['user'][_0x1331('0x3b')],_0x43fb66[_0x1331('0x62')][_0x1331('0x68')],_0x1ab6a4['interaction']['id'],_0x43fb66[_0x1331('0x59')]?JSON[_0x1331('0x2a')](_0x43fb66[_0x1331('0x59')]):'null');return respondWithRpcPromise(_0x1331('0x69'),'acceptMessage',_0x1ab6a4);}return null;})['then'](function(_0x22ddeb){var _0x2f042b=_0x1331('0x6a')+_0x22ddeb['message'][_0x1331('0x6b')];return db[_0x1331('0x6c')][_0x1331('0x44')](_0x2f042b,{'type':db[_0x1331('0x6d')][_0x1331('0x6e')][_0x1331('0x6f')],'raw':!![]})['then'](function(_0x258d65){return _0x258d65;});})[_0x1331('0x24')](function(_0x205724){if(_0x205724){_0x1ab6a4[_0x1331('0x2d')]['contact']=_0x205724[0x0];if(!_0x43fb66[_0x1331('0x59')][_0x1331('0x61')])return;return db[_0x1331('0x70')]['find']({'where':{'id':_0x43fb66[_0x1331('0x59')][_0x1331('0x61')],'role':_0x1331('0x63')},'attributes':['id',_0x1331('0x3b'),_0x1331('0x71'),'email',_0x1331('0x72')],'raw':!![]});}return null;})[_0x1331('0x24')](function(_0x470b00){if(!_0x470b00)return null;_0x1ab6a4[_0x1331('0x2d')][_0x1331('0x63')]=_0x470b00;return _0x1ab6a4;})[_0x1331('0x24')](function(_0xd96175){if(_0xd96175){if(_0x43fb66['body'][_0x1331('0x73')]){_0x1ab6a4[_0x1331('0x2d')][_0x1331('0x74')]=util[_0x1331('0x5f')](_0x1331('0x75'),_0x43fb66[_0x1331('0x62')][_0x1331('0x3b')]);_0x1ab6a4[_0x1331('0x2d')][_0x1331('0x76')]=_0x1ab6a4['channel'];_0x1ab6a4['message']['motionChannel']=_0x1ab6a4['channel'];_0x1ab6a4[_0x1331('0x2d')][_0x1331('0x77')]=_0x1331('0x78');return respondWithRpcPromise(_0x1331('0x79'),_0x1331('0x79'),{'event':_0x1331('0x7a'),'message':_[_0x1331('0x4e')](_0x1ab6a4[_0x1331('0x2d')],JSON['parse'](_0x1ab6a4['interaction'][_0x1331('0x7b')]))},client9002)['then'](function(){return _0x1ab6a4;});}return _0x1ab6a4;}return null;})[_0x1331('0x24')](respondWithResult(_0xb03fbb,null))['catch'](handleError(_0xb03fbb,null));};var interaction_log=require(_0x1331('0x5c'))(_0x1331('0x7c'));exports[_0x1331('0x7d')]=function(_0x247dc7,_0x5255ae,_0x4b91a7){var _0x3f0cc9={'agent':{},'channel':_0x1331('0x7e')};if(_0x247dc7[_0x1331('0x59')]['id']){delete _0x247dc7[_0x1331('0x59')]['id'];}_0x247dc7[_0x1331('0x59')]['UserId']=_0x247dc7[_0x1331('0x59')][_0x1331('0x61')]||_0x247dc7['user']['id'];_0x3f0cc9['agent']['id']=_0x247dc7[_0x1331('0x59')]['UserId'];return db[_0x1331('0x3f')]['find']({'where':{'id':_0x247dc7[_0x1331('0x5a')]['id'],'UserId':null}})[_0x1331('0x24')](handleEntityNotFound(_0x5255ae,null))[_0x1331('0x24')](function(_0x2a766b){if(_0x2a766b){_0x3f0cc9['message']=_0x2a766b['get']({'plain':!![]});return db[_0x1331('0x65')][_0x1331('0x56')]({'where':{'id':_0x2a766b[_0x1331('0x7f')]}});}return null;})[_0x1331('0x24')](handleEntityNotFound(_0x5255ae,null))['then'](function(_0xe46a57){if(_0xe46a57){_0x3f0cc9['interaction']=_0xe46a57[_0x1331('0x64')]({'plain':!![]});interaction_log['info'](_0x1331('0x80'),_0x247dc7[_0x1331('0x62')]['id'],_0x247dc7['user'][_0x1331('0x3b')],_0x247dc7[_0x1331('0x62')][_0x1331('0x68')],_0x3f0cc9[_0x1331('0x81')]['id'],_0x247dc7['body']?JSON['stringify'](_0x247dc7['body']):_0x1331('0x82'));return respondWithRpcPromise(_0x1331('0x83'),_0x1331('0x84'),_0x3f0cc9);}return null;})[_0x1331('0x24')](function(_0x48126e){var _0x39de17=_0x1331('0x6a')+_0x48126e[_0x1331('0x2d')]['ContactId'];return db[_0x1331('0x6c')][_0x1331('0x44')](_0x39de17,{'type':db[_0x1331('0x6d')]['QueryTypes'][_0x1331('0x6f')],'raw':!![]})[_0x1331('0x24')](function(_0xa71e7){return _0xa71e7;});})['then'](function(_0x1bec32){if(_0x1bec32){_0x3f0cc9[_0x1331('0x2d')][_0x1331('0x85')]=_0x1bec32[0x0];if(!_0x247dc7[_0x1331('0x59')]['UserId'])return;return db[_0x1331('0x70')][_0x1331('0x56')]({'where':{'id':_0x247dc7[_0x1331('0x59')][_0x1331('0x61')],'role':_0x1331('0x63')},'attributes':['id',_0x1331('0x3b'),_0x1331('0x71'),_0x1331('0x86'),_0x1331('0x72')],'raw':!![]});}return null;})['then'](function(_0x222652){if(!_0x222652)return null;_0x3f0cc9[_0x1331('0x2d')][_0x1331('0x63')]=_0x222652;return _0x3f0cc9;})[_0x1331('0x24')](function(_0x5ae7de){if(_0x5ae7de){_0x5ae7de[_0x1331('0x2d')][_0x1331('0x74')]=util[_0x1331('0x5f')]('SIP/%s',_0x247dc7['user']['name']);_0x5ae7de[_0x1331('0x2d')]['channel']=_0x3f0cc9[_0x1331('0x76')];_0x5ae7de[_0x1331('0x2d')][_0x1331('0x87')]=_0x3f0cc9[_0x1331('0x76')];_0x5ae7de[_0x1331('0x2d')][_0x1331('0x77')]=_0x1331('0x7d');respondWithRpcPromise(_0x1331('0x79'),_0x1331('0x79'),{'event':_0x1331('0x88'),'message':_[_0x1331('0x4e')](_0x3f0cc9[_0x1331('0x2d')],JSON['parse'](_0x3f0cc9['interaction']['formData']))},client9002);return _0x3f0cc9;}return null;})['then'](respondWithResult(_0x5255ae,null))[_0x1331('0x57')](handleError(_0x5255ae,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index b05a034..1c228c1 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 _0xd069=['events','../../mysqldb','setMaxListeners','save','emit','hasOwnProperty','hook','exports'];(function(_0x593190,_0x4c846c){var _0x1a62ed=function(_0x506d3c){while(--_0x506d3c){_0x593190['push'](_0x593190['shift']());}};_0x1a62ed(++_0x4c846c);}(_0xd069,0x1e8));var _0x9d06=function(_0x2a9951,_0xfd2eb3){_0x2a9951=_0x2a9951-0x0;var _0x31592c=_0xd069[_0x2a9951];return _0x31592c;};'use strict';var EventEmitter=require(_0x9d06('0x0'));var ChatMessage=require(_0x9d06('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x9d06('0x2')](0x0);var events={'afterCreate':_0x9d06('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xa48a54){return function(_0x754f45,_0x1cc8a8,_0x5836dd){ChatMessageEvents[_0x9d06('0x4')](_0xa48a54+':'+_0x754f45['id'],_0x754f45);ChatMessageEvents[_0x9d06('0x4')](_0xa48a54,_0x754f45);_0x5836dd(null);};}for(var e in events){if(events[_0x9d06('0x5')](e)){var event=events[e];ChatMessage[_0x9d06('0x6')](e,emitEvent(event));}}module[_0x9d06('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0xba01=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5ddbcc,_0x1a00e8){var _0x317e4c=function(_0x364d2b){while(--_0x364d2b){_0x5ddbcc['push'](_0x5ddbcc['shift']());}};_0x317e4c(++_0x1a00e8);}(_0xba01,0x104));var _0x1ba0=function(_0x457b9b,_0x40b09d){_0x457b9b=_0x457b9b-0x0;var _0x99a651=_0xba01[_0x457b9b];return _0x99a651;};'use strict';var EventEmitter=require(_0x1ba0('0x0'));var ChatMessage=require(_0x1ba0('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x1ba0('0x2')](0x0);var events={'afterCreate':_0x1ba0('0x3'),'afterUpdate':_0x1ba0('0x4'),'afterDestroy':_0x1ba0('0x5')};function emitEvent(_0x5af83f){return function(_0x1d31f6,_0x538f51,_0x5adfc6){ChatMessageEvents['emit'](_0x5af83f+':'+_0x1d31f6['id'],_0x1d31f6);ChatMessageEvents[_0x1ba0('0x6')](_0x5af83f,_0x1d31f6);_0x5adfc6(null);};}for(var e in events){if(events[_0x1ba0('0x7')](e)){var event=events[e];ChatMessage[_0x1ba0('0x8')](e,emitEvent(event));}}module[_0x1ba0('0x9')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 0ef77b8..253b45c 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 _0x43f3=['findOne','ChatInteractionId','update','createdAt','utf8mb4','util','bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction'];(function(_0x1c992f,_0x2adab3){var _0x1e9eb6=function(_0x321c15){while(--_0x321c15){_0x1c992f['push'](_0x1c992f['shift']());}};_0x1e9eb6(++_0x2adab3);}(_0x43f3,0x16d));var _0x343f=function(_0x1d87fc,_0x1e5321){_0x1d87fc=_0x1d87fc-0x0;var _0x492b56=_0x43f3[_0x1d87fc];return _0x492b56;};'use strict';var _=require('lodash');var util=require(_0x343f('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x343f('0x1'));var rp=require(_0x343f('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x343f('0x3'));var config=require(_0x343f('0x4'));var attributes=require(_0x343f('0x5'));module[_0x343f('0x6')]=function(_0x5e7e30,_0x4bcbf7){return _0x5e7e30['define'](_0x343f('0x7'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x343f('0x8'),'fields':[_0x343f('0x9')],'type':_0x343f('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3bef74,_0x541771,_0x46e2e3){var _0x4e3edd=_0x5e7e30[_0x343f('0xb')];var _0xe6f334=_0x3bef74['get']({'plain':!![]});if(_0xe6f334['direction']['toLowerCase']()==='in'||_0xe6f334[_0x343f('0xc')][_0x343f('0xd')]()===_0x343f('0xe')&&!_0xe6f334[_0x343f('0xf')]&&!_[_0x343f('0x10')](_0xe6f334[_0x343f('0x11')])){_0x4e3edd[_0x343f('0x12')][_0x343f('0x13')]({'where':{'id':_0xe6f334[_0x343f('0x14')]}})['then'](function(_0x160e9e){if(_0x160e9e){_0x160e9e[_0x343f('0x15')]({'lastMsgAt':_0xe6f334[_0x343f('0x16')],'lastMsgDirection':_0xe6f334['direction'][_0x343f('0xd')]()});}})['catch'](function(_0x350504){console['error'](_0x350504);});}_0x46e2e3();}},'charset':_0x343f('0x17'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x0d0b=['rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','path'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x0d0b,0x88));var _0xb0d0=function(_0x93704d,_0x400342){_0x93704d=_0x93704d-0x0;var _0x8f7204=_0x0d0b[_0x93704d];return _0x8f7204;};'use strict';var _=require(_0xb0d0('0x0'));var util=require(_0xb0d0('0x1'));var logger=require('../../config/logger')(_0xb0d0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb0d0('0x3'));var rimraf=require(_0xb0d0('0x4'));var config=require(_0xb0d0('0x5'));var attributes=require(_0xb0d0('0x6'));module[_0xb0d0('0x7')]=function(_0x4aa00e,_0x1f70a7){return _0x4aa00e[_0xb0d0('0x8')](_0xb0d0('0x9'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xb0d0('0xa'),'fields':[_0xb0d0('0xb')],'type':_0xb0d0('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4902ef,_0x589232,_0x4655ac){var _0x21f13e=_0x4aa00e[_0xb0d0('0xd')];var _0x55e86f=_0x4902ef[_0xb0d0('0xe')]({'plain':!![]});if(_0x55e86f[_0xb0d0('0xf')]['toLowerCase']()==='in'||_0x55e86f[_0xb0d0('0xf')][_0xb0d0('0x10')]()===_0xb0d0('0x11')&&!_0x55e86f[_0xb0d0('0x12')]&&!_[_0xb0d0('0x13')](_0x55e86f[_0xb0d0('0x14')])){_0x21f13e[_0xb0d0('0x15')]['findOne']({'where':{'id':_0x55e86f[_0xb0d0('0x16')]}})[_0xb0d0('0x17')](function(_0x3cc3a0){if(_0x3cc3a0){_0x3cc3a0[_0xb0d0('0x18')]({'lastMsgAt':_0x55e86f[_0xb0d0('0x19')],'lastMsgDirection':_0x55e86f[_0xb0d0('0xf')][_0xb0d0('0x10')]()});}})['catch'](function(_0x3f9281){console['error'](_0x3f9281);});}_0x4655ac();}},'charset':_0xb0d0('0x1a'),'collate':_0xb0d0('0x1b')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 10982a3..3859aa6 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 _0x66ab=['info','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage','ChatMessage','body','options','raw','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then'];(function(_0x50cfc3,_0x526cc6){var _0x5c11ef=function(_0xeaf96a){while(--_0xeaf96a){_0x50cfc3['push'](_0x50cfc3['shift']());}};_0x5c11ef(++_0x526cc6);}(_0x66ab,0x128));var _0xb66a=function(_0x468238,_0x392f32){_0x468238=_0x468238-0x0;var _0x43b942=_0x66ab[_0x468238];return _0x43b942;};'use strict';var _=require(_0xb66a('0x0'));var util=require(_0xb66a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb66a('0x2'));var fs=require('fs');var Redis=require(_0xb66a('0x3'));var db=require(_0xb66a('0x4'))['db'];var utils=require(_0xb66a('0x5'));var logger=require(_0xb66a('0x6'))(_0xb66a('0x7'));var config=require(_0xb66a('0x8'));var jayson=require(_0xb66a('0x9'));var client=jayson['client'][_0xb66a('0xa')]({'port':0x232a});config[_0xb66a('0xb')]=_[_0xb66a('0xc')](config[_0xb66a('0xb')],{'host':_0xb66a('0xd'),'port':0x18eb});var socket=require(_0xb66a('0xe'))(new Redis(config['redis']));require(_0xb66a('0xf'))[_0xb66a('0x10')](socket);function respondWithRpcPromise(_0x5c0e56,_0x4e459a,_0x470f22){return new BPromise(function(_0x4e1fbd,_0x4cd1e8){return client[_0xb66a('0x11')](_0x5c0e56,_0x470f22)[_0xb66a('0x12')](function(_0x3fc43a){logger[_0xb66a('0x13')]('ChatMessage,\x20%s,\x20%s',_0x4e459a,'request\x20sent');logger[_0xb66a('0x14')](_0xb66a('0x15'),_0x4e459a,_0xb66a('0x16'),JSON[_0xb66a('0x17')](_0x3fc43a));if(_0x3fc43a[_0xb66a('0x18')]){if(_0x3fc43a['error'][_0xb66a('0x19')]===0x1f4){logger[_0xb66a('0x18')](_0xb66a('0x1a'),_0x4e459a,_0x3fc43a[_0xb66a('0x18')][_0xb66a('0x1b')]);return _0x4cd1e8(_0x3fc43a['error'][_0xb66a('0x1b')]);}logger[_0xb66a('0x18')](_0xb66a('0x1a'),_0x4e459a,_0x3fc43a['error'][_0xb66a('0x1b')]);return _0x4e1fbd(_0x3fc43a[_0xb66a('0x18')][_0xb66a('0x1b')]);}else{logger[_0xb66a('0x13')](_0xb66a('0x1a'),_0x4e459a,_0xb66a('0x16'));_0x4e1fbd(_0x3fc43a[_0xb66a('0x1c')][_0xb66a('0x1b')]);}})[_0xb66a('0x1d')](function(_0x17b962){logger['error'](_0xb66a('0x1a'),_0x4e459a,_0x17b962);_0x4cd1e8(_0x17b962);});});}exports[_0xb66a('0x1e')]=function(_0xd82c99){var _0x11c90f=this;return new Promise(function(_0x541aab,_0x3c8f29){return db[_0xb66a('0x1f')]['create'](_0xd82c99[_0xb66a('0x20')],{'raw':_0xd82c99[_0xb66a('0x21')]?_0xd82c99[_0xb66a('0x21')][_0xb66a('0x22')]===undefined?!![]:![]:!![]})[_0xb66a('0x12')](function(_0x2f5d1a){logger['info'](_0xb66a('0x1e'),_0xd82c99);logger[_0xb66a('0x14')](_0xb66a('0x1e'),_0xd82c99,JSON[_0xb66a('0x17')](_0x2f5d1a));_0x541aab(_0x2f5d1a);})[_0xb66a('0x1d')](function(_0x1090b6){logger[_0xb66a('0x18')](_0xb66a('0x1e'),_0x1090b6[_0xb66a('0x1b')],_0xd82c99);_0x3c8f29(_0x11c90f['error'](0x1f4,_0x1090b6[_0xb66a('0x1b')]));});});};
\ No newline at end of file
+var _0x9e78=['../../config/environment','jayson/promise','client','http','redis','localhost','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','CreateChatMessage','ChatMessage','create','body','raw','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x450076,_0x10983b){var _0x2029cc=function(_0x4a5e76){while(--_0x4a5e76){_0x450076['push'](_0x450076['shift']());}};_0x2029cc(++_0x10983b);}(_0x9e78,0xb8));var _0x89e7=function(_0x4bb145,_0x3e7d33){_0x4bb145=_0x4bb145-0x0;var _0x4db596=_0x9e78[_0x4bb145];return _0x4db596;};'use strict';var _=require(_0x89e7('0x0'));var util=require(_0x89e7('0x1'));var moment=require(_0x89e7('0x2'));var BPromise=require(_0x89e7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x89e7('0x4'))['db'];var utils=require(_0x89e7('0x5'));var logger=require(_0x89e7('0x6'))(_0x89e7('0x7'));var config=require(_0x89e7('0x8'));var jayson=require(_0x89e7('0x9'));var client=jayson[_0x89e7('0xa')][_0x89e7('0xb')]({'port':0x232a});config[_0x89e7('0xc')]=_['defaults'](config[_0x89e7('0xc')],{'host':_0x89e7('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x89e7('0xc')]));require(_0x89e7('0xe'))[_0x89e7('0xf')](socket);function respondWithRpcPromise(_0x9cdf7c,_0x4ebe94,_0x3e44e2){return new BPromise(function(_0x5c34bf,_0x269c1a){return client[_0x89e7('0x10')](_0x9cdf7c,_0x3e44e2)[_0x89e7('0x11')](function(_0x1c20db){logger[_0x89e7('0x12')](_0x89e7('0x13'),_0x4ebe94,_0x89e7('0x14'));logger[_0x89e7('0x15')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x4ebe94,_0x89e7('0x14'),JSON[_0x89e7('0x16')](_0x1c20db));if(_0x1c20db[_0x89e7('0x17')]){if(_0x1c20db[_0x89e7('0x17')][_0x89e7('0x18')]===0x1f4){logger[_0x89e7('0x17')](_0x89e7('0x13'),_0x4ebe94,_0x1c20db[_0x89e7('0x17')][_0x89e7('0x19')]);return _0x269c1a(_0x1c20db[_0x89e7('0x17')][_0x89e7('0x19')]);}logger[_0x89e7('0x17')]('ChatMessage,\x20%s,\x20%s',_0x4ebe94,_0x1c20db[_0x89e7('0x17')][_0x89e7('0x19')]);return _0x5c34bf(_0x1c20db[_0x89e7('0x17')][_0x89e7('0x19')]);}else{logger[_0x89e7('0x12')](_0x89e7('0x13'),_0x4ebe94,_0x89e7('0x14'));_0x5c34bf(_0x1c20db['result'][_0x89e7('0x19')]);}})['catch'](function(_0x303047){logger['error'](_0x89e7('0x13'),_0x4ebe94,_0x303047);_0x269c1a(_0x303047);});});}exports[_0x89e7('0x1a')]=function(_0x30f5ab){var _0x491003=this;return new Promise(function(_0x2a4c90,_0x1996af){return db[_0x89e7('0x1b')][_0x89e7('0x1c')](_0x30f5ab[_0x89e7('0x1d')],{'raw':_0x30f5ab['options']?_0x30f5ab['options'][_0x89e7('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x592213){logger[_0x89e7('0x12')](_0x89e7('0x1a'),_0x30f5ab);logger[_0x89e7('0x15')](_0x89e7('0x1a'),_0x30f5ab,JSON[_0x89e7('0x16')](_0x592213));_0x2a4c90(_0x592213);})[_0x89e7('0x1f')](function(_0x482209){logger[_0x89e7('0x17')](_0x89e7('0x1a'),_0x482209[_0x89e7('0x19')],_0x30f5ab);_0x1996af(_0x491003['error'](0x1f4,_0x482209[_0x89e7('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 5a4df36..c9c60d1 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 _0x1670=['./chatMessage.events','save','update','emit','register','length','chatMessage:'];(function(_0x263f4c,_0x438626){var _0x3a78d3=function(_0xbdb00f){while(--_0xbdb00f){_0x263f4c['push'](_0x263f4c['shift']());}};_0x3a78d3(++_0x438626);}(_0x1670,0x9a));var _0x0167=function(_0x9758d1,_0x120d87){_0x9758d1=_0x9758d1-0x0;var _0x479675=_0x1670[_0x9758d1];return _0x479675;};'use strict';var ChatMessageEvents=require(_0x0167('0x0'));var events=[_0x0167('0x1'),'remove',_0x0167('0x2')];function createListener(_0x4dc6f6,_0x1c7a08){return function(_0x45bbfd){_0x1c7a08[_0x0167('0x3')](_0x4dc6f6,_0x45bbfd);};}function removeListener(_0x6f87ae,_0x5786d8){return function(){ChatMessageEvents['removeListener'](_0x6f87ae,_0x5786d8);};}exports[_0x0167('0x4')]=function(_0x1ae650){for(var _0x295e51=0x0,_0x3e1507=events[_0x0167('0x5')];_0x295e51<_0x3e1507;_0x295e51++){var _0x149956=events[_0x295e51];var _0xcdfc5=createListener(_0x0167('0x6')+_0x149956,_0x1ae650);ChatMessageEvents['on'](_0x149956,_0xcdfc5);}};
\ No newline at end of file
+var _0xbcba=['length','./chatMessage.events','save','update','emit','register'];(function(_0x326c6c,_0x4b67cb){var _0x1e9fff=function(_0x28eb32){while(--_0x28eb32){_0x326c6c['push'](_0x326c6c['shift']());}};_0x1e9fff(++_0x4b67cb);}(_0xbcba,0x6d));var _0xabcb=function(_0x34ecb6,_0x2afd7c){_0x34ecb6=_0x34ecb6-0x0;var _0x17cc8f=_0xbcba[_0x34ecb6];return _0x17cc8f;};'use strict';var ChatMessageEvents=require(_0xabcb('0x0'));var events=[_0xabcb('0x1'),'remove',_0xabcb('0x2')];function createListener(_0x2c9ee7,_0x2034d2){return function(_0xcbe337){_0x2034d2[_0xabcb('0x3')](_0x2c9ee7,_0xcbe337);};}function removeListener(_0x3e3b9b,_0x5e10df){return function(){ChatMessageEvents['removeListener'](_0x3e3b9b,_0x5e10df);};}exports[_0xabcb('0x4')]=function(_0x1290b2){for(var _0x5c706e=0x0,_0x5322e7=events[_0xabcb('0x5')];_0x5c706e<_0x5322e7;_0x5c706e++){var _0x192b36=events[_0x5c706e];var _0x5e693d=createListener('chatMessage:'+_0x192b36,_0x1290b2);ChatMessageEvents['on'](_0x192b36,_0x5e693d);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index f95c2a3..f9a1ea8 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 _0xb64b=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','chat','chatmessage:create','create','update','put','/:id/accept','accept','/:id/reject','reject'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb64b,0x1c3));var _0xbb64=function(_0xc6b104,_0x1d805a){_0xc6b104=_0xc6b104-0x0;var _0x1c6fce=_0xb64b[_0xc6b104];return _0x1c6fce;};'use strict';var multer=require(_0xbb64('0x0'));var util=require(_0xbb64('0x1'));var path=require(_0xbb64('0x2'));var timeout=require(_0xbb64('0x3'));var express=require(_0xbb64('0x4'));var router=express[_0xbb64('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbb64('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbb64('0x7'));var controller=require(_0xbb64('0x8'));router[_0xbb64('0x9')]('/',auth[_0xbb64('0xa')](),controller[_0xbb64('0xb')]);router['get'](_0xbb64('0xc'),auth[_0xbb64('0xa')](),controller[_0xbb64('0xd')]);router[_0xbb64('0x9')](_0xbb64('0xe'),auth[_0xbb64('0xa')](),controller[_0xbb64('0xf')]);router['post']('/',auth[_0xbb64('0xa')](),interaction['tracked'](_0xbb64('0x10'),_0xbb64('0x11')),controller[_0xbb64('0x12')]);router['put'](_0xbb64('0xe'),controller[_0xbb64('0x13')]);router[_0xbb64('0x14')](_0xbb64('0x15'),auth['isAuthenticated'](),controller[_0xbb64('0x16')]);router[_0xbb64('0x14')](_0xbb64('0x17'),auth['isAuthenticated'](),controller[_0xbb64('0x18')]);router[_0xbb64('0x19')](_0xbb64('0xe'),auth[_0xbb64('0xa')](),controller[_0xbb64('0x1a')]);module[_0xbb64('0x1b')]=router;
\ No newline at end of file
+var _0xedc2=['tracked','chat','put','update','accept','/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','describe','/:id','show','post'];(function(_0x2b6b89,_0x172ec0){var _0x5aa6af=function(_0x19cd5e){while(--_0x19cd5e){_0x2b6b89['push'](_0x2b6b89['shift']());}};_0x5aa6af(++_0x172ec0);}(_0xedc2,0xd2));var _0x2edc=function(_0x5339c7,_0x3ff7a8){_0x5339c7=_0x5339c7-0x0;var _0x5ca169=_0xedc2[_0x5339c7];return _0x5ca169;};'use strict';var multer=require('multer');var util=require(_0x2edc('0x0'));var path=require(_0x2edc('0x1'));var timeout=require(_0x2edc('0x2'));var express=require(_0x2edc('0x3'));var router=express[_0x2edc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2edc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2edc('0x6'));var controller=require(_0x2edc('0x7'));router[_0x2edc('0x8')]('/',auth[_0x2edc('0x9')](),controller[_0x2edc('0xa')]);router[_0x2edc('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x2edc('0xb')]);router[_0x2edc('0x8')](_0x2edc('0xc'),auth[_0x2edc('0x9')](),controller[_0x2edc('0xd')]);router[_0x2edc('0xe')]('/',auth[_0x2edc('0x9')](),interaction[_0x2edc('0xf')](_0x2edc('0x10'),'chatmessage:create'),controller['create']);router[_0x2edc('0x11')](_0x2edc('0xc'),controller[_0x2edc('0x12')]);router[_0x2edc('0x11')]('/:id/accept',auth[_0x2edc('0x9')](),controller[_0x2edc('0x13')]);router[_0x2edc('0x11')](_0x2edc('0x14'),auth[_0x2edc('0x9')](),controller[_0x2edc('0x15')]);router[_0x2edc('0x16')](_0x2edc('0xc'),auth['isAuthenticated'](),controller[_0x2edc('0x17')]);module[_0x2edc('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 90dacfe..573fa42 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 _0x15fe=['sequelize','exports','TEXT','medium'];(function(_0x2f31f6,_0x3b03f0){var _0x3ed300=function(_0x59f294){while(--_0x59f294){_0x2f31f6['push'](_0x2f31f6['shift']());}};_0x3ed300(++_0x3b03f0);}(_0x15fe,0x158));var _0xe15f=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x15fe[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0xe15f('0x0'));module[_0xe15f('0x1')]={'body':{'type':Sequelize[_0xe15f('0x2')](_0xe15f('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0x80bd=['medium','TEXT'];(function(_0x2eee78,_0x4b063f){var _0x6d5f74=function(_0x39e867){while(--_0x39e867){_0x2eee78['push'](_0x2eee78['shift']());}};_0x6d5f74(++_0x4b063f);}(_0x80bd,0x1bf));var _0xd80b=function(_0x54325a,_0x2836c6){_0x54325a=_0x54325a-0x0;var _0x2d4460=_0x80bd[_0x54325a];return _0x2d4460;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xd80b('0x0')](_0xd80b('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 4878788..40a95e5 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(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0x7a54,0x106));var _0x47a5=function(_0x10495d,_0x531159){_0x10495d=_0x10495d-0x0;var _0x43dc6e=_0x7a54[_0x10495d];return _0x43dc6e;};'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(_0x97ad7a,_0x521838){var _0x408c10=function(_0xa52479){while(--_0xa52479){_0x97ad7a['push'](_0x97ad7a['shift']());}};_0x408c10(++_0x521838);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 298ed06..3fd1e00 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 _0x5ed6=['request-promise','path','rimraf','../../config/environment','exports','define','utf8mb4','lodash','util','../../config/logger','moment','bluebird'];(function(_0x4ef826,_0x2e0ac8){var _0x154b8=function(_0x4fae58){while(--_0x4fae58){_0x4ef826['push'](_0x4ef826['shift']());}};_0x154b8(++_0x2e0ac8);}(_0x5ed6,0xd3));var _0x65ed=function(_0x503ffd,_0x8ecde){_0x503ffd=_0x503ffd-0x0;var _0x160437=_0x5ed6[_0x503ffd];return _0x160437;};'use strict';var _=require(_0x65ed('0x0'));var util=require(_0x65ed('0x1'));var logger=require(_0x65ed('0x2'))('api');var moment=require(_0x65ed('0x3'));var BPromise=require(_0x65ed('0x4'));var rp=require(_0x65ed('0x5'));var fs=require('fs');var path=require(_0x65ed('0x6'));var rimraf=require(_0x65ed('0x7'));var config=require(_0x65ed('0x8'));var attributes=require('./chatOfflineMessage.attributes');module[_0x65ed('0x9')]=function(_0x372c5,_0x5178b3){return _0x372c5[_0x65ed('0xa')]('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x65ed('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x71f4=['chat_offline_messages','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0x32c92a,_0x26ec67){var _0x130f0b=function(_0x323a9d){while(--_0x323a9d){_0x32c92a['push'](_0x32c92a['shift']());}};_0x130f0b(++_0x26ec67);}(_0x71f4,0xe2));var _0x471f=function(_0x396e98,_0x528852){_0x396e98=_0x396e98-0x0;var _0x24ded2=_0x71f4[_0x396e98];return _0x24ded2;};'use strict';var _=require(_0x471f('0x0'));var util=require(_0x471f('0x1'));var logger=require(_0x471f('0x2'))(_0x471f('0x3'));var moment=require(_0x471f('0x4'));var BPromise=require(_0x471f('0x5'));var rp=require(_0x471f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x471f('0x7'));var config=require('../../config/environment');var attributes=require(_0x471f('0x8'));module[_0x471f('0x9')]=function(_0x42c4a6,_0x22445e){return _0x42c4a6[_0x471f('0xa')](_0x471f('0xb'),attributes,{'tableName':_0x471f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x471f('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 7690b24..0266fc2 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 _0x108e=['../../mysqldb','../../config/logger','jayson/promise','client','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','randomstring'];(function(_0x2886a3,_0x129ac5){var _0x1887bb=function(_0x57e9c6){while(--_0x57e9c6){_0x2886a3['push'](_0x2886a3['shift']());}};_0x1887bb(++_0x129ac5);}(_0x108e,0x141));var _0xe108=function(_0x4da21c,_0x31c55f){_0x4da21c=_0x4da21c-0x0;var _0x401291=_0x108e[_0x4da21c];return _0x401291;};'use strict';var _=require('lodash');var util=require(_0xe108('0x0'));var moment=require(_0xe108('0x1'));var BPromise=require('bluebird');var rs=require(_0xe108('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe108('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe108('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe108('0x5'));var client=jayson[_0xe108('0x6')][_0xe108('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x280efa,_0x3dc105,_0x31ab24){return new BPromise(function(_0xcdd046,_0x1f0046){return client[_0xe108('0x8')](_0x280efa,_0x31ab24)['then'](function(_0x3c2b24){logger[_0xe108('0x9')](_0xe108('0xa'),_0x3dc105,'request\x20sent');logger['debug'](_0xe108('0xb'),_0x3dc105,_0xe108('0xc'),JSON[_0xe108('0xd')](_0x3c2b24));if(_0x3c2b24['error']){if(_0x3c2b24[_0xe108('0xe')][_0xe108('0xf')]===0x1f4){logger[_0xe108('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3dc105,_0x3c2b24['error']['message']);return _0x1f0046(_0x3c2b24[_0xe108('0xe')][_0xe108('0x10')]);}logger[_0xe108('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3dc105,_0x3c2b24['error']['message']);return _0xcdd046(_0x3c2b24['error'][_0xe108('0x10')]);}else{logger[_0xe108('0x9')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3dc105,'request\x20sent');_0xcdd046(_0x3c2b24[_0xe108('0x11')][_0xe108('0x10')]);}})['catch'](function(_0x209541){logger['error'](_0xe108('0xa'),_0x3dc105,_0x209541);_0x1f0046(_0x209541);});});}
\ No newline at end of file
+var _0x20e7=['request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s'];(function(_0x30283b,_0x2de9b8){var _0x47defa=function(_0x3e9df0){while(--_0x3e9df0){_0x30283b['push'](_0x30283b['shift']());}};_0x47defa(++_0x2de9b8);}(_0x20e7,0x178));var _0x720e=function(_0xb7fa0f,_0x2687e5){_0xb7fa0f=_0xb7fa0f-0x0;var _0x28fdb1=_0x20e7[_0xb7fa0f];return _0x28fdb1;};'use strict';var _=require(_0x720e('0x0'));var util=require(_0x720e('0x1'));var moment=require('moment');var BPromise=require(_0x720e('0x2'));var rs=require(_0x720e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x720e('0x4'))['db'];var utils=require(_0x720e('0x5'));var logger=require(_0x720e('0x6'))(_0x720e('0x7'));var config=require(_0x720e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x720e('0x9')][_0x720e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf9e10c,_0xe610bc,_0x1a5c02){return new BPromise(function(_0x15355f,_0x54e5d7){return client[_0x720e('0xb')](_0xf9e10c,_0x1a5c02)[_0x720e('0xc')](function(_0x2a1540){logger[_0x720e('0xd')](_0x720e('0xe'),_0xe610bc,_0x720e('0xf'));logger[_0x720e('0x10')](_0x720e('0x11'),_0xe610bc,_0x720e('0xf'),JSON[_0x720e('0x12')](_0x2a1540));if(_0x2a1540[_0x720e('0x13')]){if(_0x2a1540[_0x720e('0x13')][_0x720e('0x14')]===0x1f4){logger[_0x720e('0x13')](_0x720e('0xe'),_0xe610bc,_0x2a1540['error'][_0x720e('0x15')]);return _0x54e5d7(_0x2a1540[_0x720e('0x13')]['message']);}logger[_0x720e('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0xe610bc,_0x2a1540[_0x720e('0x13')][_0x720e('0x15')]);return _0x15355f(_0x2a1540[_0x720e('0x13')][_0x720e('0x15')]);}else{logger[_0x720e('0xd')](_0x720e('0xe'),_0xe610bc,_0x720e('0xf'));_0x15355f(_0x2a1540['result']['message']);}})[_0x720e('0x16')](function(_0x4ea471){logger['error'](_0x720e('0xe'),_0xe610bc,_0x4ea471);_0x54e5d7(_0x4ea471);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 9349401..c799761 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 _0x7e78=['/:id','show','create','put','update','delete','destroy','exports','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x4ea0e3,_0x3e3d31){var _0x32128b=function(_0x58f5d9){while(--_0x58f5d9){_0x4ea0e3['push'](_0x4ea0e3['shift']());}};_0x32128b(++_0x3e3d31);}(_0x7e78,0x15e));var _0x87e7=function(_0x2c6bcd,_0x4235eb){_0x2c6bcd=_0x2c6bcd-0x0;var _0x550e57=_0x7e78[_0x2c6bcd];return _0x550e57;};'use strict';var multer=require('multer');var util=require(_0x87e7('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x87e7('0x1')]();var fs_extra=require(_0x87e7('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x87e7('0x3'));var config=require(_0x87e7('0x4'));var controller=require(_0x87e7('0x5'));router[_0x87e7('0x6')]('/',auth[_0x87e7('0x7')](),controller[_0x87e7('0x8')]);router[_0x87e7('0x6')](_0x87e7('0x9'),auth[_0x87e7('0x7')](),controller[_0x87e7('0xa')]);router[_0x87e7('0x6')](_0x87e7('0xb'),auth[_0x87e7('0x7')](),controller[_0x87e7('0xc')]);router['post']('/',auth[_0x87e7('0x7')](),controller[_0x87e7('0xd')]);router[_0x87e7('0xe')](_0x87e7('0xb'),auth['isAuthenticated'](),controller[_0x87e7('0xf')]);router[_0x87e7('0x10')](_0x87e7('0xb'),auth[_0x87e7('0x7')](),controller[_0x87e7('0x11')]);module[_0x87e7('0x12')]=router;
\ No newline at end of file
+var _0xe044=['describe','/:id','show','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x40bd60,_0x3a7bcd){var _0x4f4185=function(_0x9cba77){while(--_0x9cba77){_0x40bd60['push'](_0x40bd60['shift']());}};_0x4f4185(++_0x3a7bcd);}(_0xe044,0x1d6));var _0x4e04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe044[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x4e04('0x0'));var util=require(_0x4e04('0x1'));var path=require(_0x4e04('0x2'));var timeout=require(_0x4e04('0x3'));var express=require(_0x4e04('0x4'));var router=express[_0x4e04('0x5')]();var fs_extra=require(_0x4e04('0x6'));var auth=require(_0x4e04('0x7'));var interaction=require(_0x4e04('0x8'));var config=require(_0x4e04('0x9'));var controller=require('./chatOfflineMessage.controller');router[_0x4e04('0xa')]('/',auth[_0x4e04('0xb')](),controller[_0x4e04('0xc')]);router[_0x4e04('0xa')](_0x4e04('0xd'),auth[_0x4e04('0xb')](),controller[_0x4e04('0xe')]);router[_0x4e04('0xa')](_0x4e04('0xf'),auth['isAuthenticated'](),controller[_0x4e04('0x10')]);router[_0x4e04('0x11')]('/',auth[_0x4e04('0xb')](),controller[_0x4e04('0x12')]);router[_0x4e04('0x13')](_0x4e04('0xf'),auth[_0x4e04('0xb')](),controller['update']);router[_0x4e04('0x14')](_0x4e04('0xf'),auth[_0x4e04('0xb')](),controller['destroy']);module[_0x4e04('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 28075f4..5ae43f7 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 _0x3faf=['STRING','ENUM','mouseOver','timeout','INTEGER','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3faf,0x1be));var _0xf3fa=function(_0x1d8c32,_0x37c21c){_0x1d8c32=_0x1d8c32-0x0;var _0x9e0ded=_0x3faf[_0x1d8c32];return _0x9e0ded;};'use strict';var Sequelize=require(_0xf3fa('0x0'));module[_0xf3fa('0x1')]={'name':{'type':Sequelize[_0xf3fa('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf3fa('0x3')](_0xf3fa('0x4'),_0xf3fa('0x5')),'defaultValue':_0xf3fa('0x4')},'selector':{'type':Sequelize[_0xf3fa('0x2')]},'timeout':{'type':Sequelize[_0xf3fa('0x6')]}};
\ No newline at end of file
+var _0x4554=['STRING','sequelize','exports','mouseOver','timeout'];(function(_0x5e1cf5,_0x1e5149){var _0x4fa568=function(_0x19dae9){while(--_0x19dae9){_0x5e1cf5['push'](_0x5e1cf5['shift']());}};_0x4fa568(++_0x1e5149);}(_0x4554,0xa1));var _0x4455=function(_0x5cabdb,_0x1cad25){_0x5cabdb=_0x5cabdb-0x0;var _0x3dfec4=_0x4554[_0x5cabdb];return _0x3dfec4;};'use strict';var Sequelize=require(_0x4455('0x0'));module[_0x4455('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x4455('0x2'),_0x4455('0x3')),'defaultValue':_0x4455('0x2')},'selector':{'type':Sequelize[_0x4455('0x4')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index a3142c9..7a92410 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 _0xd8a7=['end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','show','model','ChatProactiveAction','rawAttributes','query','keys','filters','intersection','attributes','fields','includeAll','include','options','find','catch','create','body','update','params','eml-format','request-promise','moment','bluebird','util','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x5c8098,_0x366b7c){var _0x506d53=function(_0x28e730){while(--_0x28e730){_0x5c8098['push'](_0x5c8098['shift']());}};_0x506d53(++_0x366b7c);}(_0xd8a7,0xdf));var _0x7d8a=function(_0x213a20,_0x311649){_0x213a20=_0x213a20-0x0;var _0x156913=_0xd8a7[_0x213a20];return _0x156913;};'use strict';var emlformat=require(_0x7d8a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7d8a('0x1'));var moment=require(_0x7d8a('0x2'));var BPromise=require(_0x7d8a('0x3'));var Mustache=require('mustache');var util=require(_0x7d8a('0x4'));var path=require('path');var sox=require(_0x7d8a('0x5'));var csv=require('to-csv');var ejs=require(_0x7d8a('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7d8a('0x7'));var squel=require(_0x7d8a('0x8'));var crypto=require(_0x7d8a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x7d8a('0xa'));var toCsv=require(_0x7d8a('0xb'));var querystring=require(_0x7d8a('0xc'));var Papa=require(_0x7d8a('0xd'));var Redis=require(_0x7d8a('0xe'));var authService=require(_0x7d8a('0xf'));var qs=require(_0x7d8a('0x10'));var as=require(_0x7d8a('0x11'));var hardwareService=require(_0x7d8a('0x12'));var logger=require(_0x7d8a('0x13'))(_0x7d8a('0x14'));var utils=require(_0x7d8a('0x15'));var config=require(_0x7d8a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7d8a('0x17'))['db'];function respondWithStatusCode(_0xd57f7d,_0x400bd6){_0x400bd6=_0x400bd6||0xcc;return function(_0x1ca39e){if(_0x1ca39e){return _0xd57f7d[_0x7d8a('0x18')](_0x400bd6);}return _0xd57f7d['status'](_0x400bd6)[_0x7d8a('0x19')]();};}function respondWithResult(_0x5a9b2c,_0x14caed){_0x14caed=_0x14caed||0xc8;return function(_0x506c6c){if(_0x506c6c){return _0x5a9b2c[_0x7d8a('0x1a')](_0x14caed)['json'](_0x506c6c);}};}function respondWithFilteredResult(_0x290d0a,_0x164c6c){return function(_0x52ec93){if(_0x52ec93){var _0x12516d=typeof _0x164c6c[_0x7d8a('0x1b')]===_0x7d8a('0x1c')&&typeof _0x164c6c[_0x7d8a('0x1d')]==='undefined';var _0x39fec5=_0x52ec93[_0x7d8a('0x1e')];var _0x5916ed=_0x12516d?0x0:_0x164c6c[_0x7d8a('0x1b')];var _0xcc3354=_0x12516d?_0x52ec93['count']:_0x164c6c[_0x7d8a('0x1b')]+_0x164c6c[_0x7d8a('0x1d')];var _0x4202e1;if(_0xcc3354>=_0x39fec5){_0xcc3354=_0x39fec5;_0x4202e1=0xc8;}else{_0x4202e1=0xce;}_0x290d0a[_0x7d8a('0x1a')](_0x4202e1);return _0x290d0a[_0x7d8a('0x1f')](_0x7d8a('0x20'),_0x5916ed+'-'+_0xcc3354+'/'+_0x39fec5)[_0x7d8a('0x21')](_0x52ec93);}return null;};}function patchUpdates(_0x18c8d1){return function(_0x428aa8){try{jsonpatch[_0x7d8a('0x22')](_0x428aa8,_0x18c8d1,!![]);}catch(_0x33c69f){return BPromise[_0x7d8a('0x23')](_0x33c69f);}return _0x428aa8[_0x7d8a('0x24')]();};}function saveUpdates(_0x4cc9ec,_0x478375){return function(_0x4acdfc){if(_0x4acdfc){return _0x4acdfc['update'](_0x4cc9ec)[_0x7d8a('0x25')](function(_0x1481b2){return _0x1481b2;});}return null;};}function removeEntity(_0xfaf23f,_0x9b324d){return function(_0x51c12d){if(_0x51c12d){return _0x51c12d[_0x7d8a('0x26')]()['then'](function(){_0xfaf23f[_0x7d8a('0x1a')](0xcc)[_0x7d8a('0x19')]();});}};}function handleEntityNotFound(_0x5b57a1,_0x124016){return function(_0x4c6b4f){if(!_0x4c6b4f){_0x5b57a1['sendStatus'](0x194);}return _0x4c6b4f;};}function handleError(_0x2f6720,_0x5c7aef){_0x5c7aef=_0x5c7aef||0x1f4;return function(_0x260eb3){logger[_0x7d8a('0x27')](_0x260eb3[_0x7d8a('0x28')]);if(_0x260eb3[_0x7d8a('0x29')]){delete _0x260eb3['name'];}_0x2f6720[_0x7d8a('0x1a')](_0x5c7aef)[_0x7d8a('0x2a')](_0x260eb3);};}exports[_0x7d8a('0x2b')]=function(_0x124fab,_0x2031c7){var _0x3b7bd8={'raw':!![],'where':{'id':_0x124fab['params']['id']}},_0x370ee6={};_0x370ee6[_0x7d8a('0x2c')]=_['keys'](db[_0x7d8a('0x2d')][_0x7d8a('0x2e')]);_0x370ee6[_0x7d8a('0x2f')]=_[_0x7d8a('0x30')](_0x124fab['query']);_0x370ee6[_0x7d8a('0x31')]=_[_0x7d8a('0x32')](_0x370ee6['model'],_0x370ee6['query']);_0x3b7bd8[_0x7d8a('0x33')]=_[_0x7d8a('0x32')](_0x370ee6[_0x7d8a('0x2c')],qs[_0x7d8a('0x34')](_0x124fab['query'][_0x7d8a('0x34')]));_0x3b7bd8[_0x7d8a('0x33')]=_0x3b7bd8[_0x7d8a('0x33')]['length']?_0x3b7bd8[_0x7d8a('0x33')]:_0x370ee6[_0x7d8a('0x2c')];if(_0x124fab[_0x7d8a('0x2f')][_0x7d8a('0x35')]){_0x3b7bd8[_0x7d8a('0x36')]=[{'all':!![]}];}_0x3b7bd8=_['merge']({},_0x3b7bd8,_0x124fab[_0x7d8a('0x37')]);return db[_0x7d8a('0x2d')][_0x7d8a('0x38')](_0x3b7bd8)[_0x7d8a('0x25')](handleEntityNotFound(_0x2031c7,null))[_0x7d8a('0x25')](respondWithResult(_0x2031c7,null))[_0x7d8a('0x39')](handleError(_0x2031c7,null));};exports[_0x7d8a('0x3a')]=function(_0x1c1d83,_0x3c8ba5){return db[_0x7d8a('0x2d')][_0x7d8a('0x3a')](_0x1c1d83[_0x7d8a('0x3b')],{})[_0x7d8a('0x25')](respondWithResult(_0x3c8ba5,0xc9))[_0x7d8a('0x39')](handleError(_0x3c8ba5,null));};exports[_0x7d8a('0x3c')]=function(_0x4459fb,_0x3321c3){if(_0x4459fb[_0x7d8a('0x3b')]['id']){delete _0x4459fb[_0x7d8a('0x3b')]['id'];}return db[_0x7d8a('0x2d')][_0x7d8a('0x38')]({'where':{'id':_0x4459fb[_0x7d8a('0x3d')]['id']}})[_0x7d8a('0x25')](handleEntityNotFound(_0x3321c3,null))['then'](saveUpdates(_0x4459fb['body'],null))[_0x7d8a('0x25')](respondWithResult(_0x3321c3,null))[_0x7d8a('0x39')](handleError(_0x3321c3,null));};exports[_0x7d8a('0x26')]=function(_0x4c6836,_0x383620){return db['ChatProactiveAction']['find']({'where':{'id':_0x4c6836['params']['id']}})[_0x7d8a('0x25')](handleEntityNotFound(_0x383620,null))[_0x7d8a('0x25')](removeEntity(_0x383620,null))[_0x7d8a('0x39')](handleError(_0x383620,null));};
\ No newline at end of file
+var _0xd1f9=['query','filters','intersection','model','fields','attributes','includeAll','merge','find','catch','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','error','stack','send','show','params','keys','ChatProactiveAction','rawAttributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd1f9,0x88));var _0x9d1f=function(_0x4e0863,_0x1ec822){_0x4e0863=_0x4e0863-0x0;var _0x3133d7=_0xd1f9[_0x4e0863];return _0x3133d7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9d1f('0x0'));var jsonpatch=require(_0x9d1f('0x1'));var rp=require(_0x9d1f('0x2'));var moment=require(_0x9d1f('0x3'));var BPromise=require(_0x9d1f('0x4'));var Mustache=require(_0x9d1f('0x5'));var util=require(_0x9d1f('0x6'));var path=require(_0x9d1f('0x7'));var sox=require(_0x9d1f('0x8'));var csv=require('to-csv');var ejs=require(_0x9d1f('0x9'));var fs=require('fs');var fs_extra=require(_0x9d1f('0xa'));var _=require(_0x9d1f('0xb'));var squel=require(_0x9d1f('0xc'));var crypto=require(_0x9d1f('0xd'));var jsforce=require(_0x9d1f('0xe'));var deskjs=require(_0x9d1f('0xf'));var toCsv=require(_0x9d1f('0x10'));var querystring=require(_0x9d1f('0x11'));var Papa=require(_0x9d1f('0x12'));var Redis=require(_0x9d1f('0x13'));var authService=require(_0x9d1f('0x14'));var qs=require(_0x9d1f('0x15'));var as=require(_0x9d1f('0x16'));var hardwareService=require(_0x9d1f('0x17'));var logger=require(_0x9d1f('0x18'))(_0x9d1f('0x19'));var utils=require(_0x9d1f('0x1a'));var config=require(_0x9d1f('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x9d1f('0x1c'))['db'];function respondWithStatusCode(_0x15a999,_0x7edbfa){_0x7edbfa=_0x7edbfa||0xcc;return function(_0x5a4d43){if(_0x5a4d43){return _0x15a999[_0x9d1f('0x1d')](_0x7edbfa);}return _0x15a999['status'](_0x7edbfa)['end']();};}function respondWithResult(_0x71e9c9,_0x38395d){_0x38395d=_0x38395d||0xc8;return function(_0x25c0b0){if(_0x25c0b0){return _0x71e9c9[_0x9d1f('0x1e')](_0x38395d)[_0x9d1f('0x1f')](_0x25c0b0);}};}function respondWithFilteredResult(_0x40a87f,_0x9f8cfc){return function(_0x2488a3){if(_0x2488a3){var _0x24cd8a=typeof _0x9f8cfc[_0x9d1f('0x20')]===_0x9d1f('0x21')&&typeof _0x9f8cfc[_0x9d1f('0x22')]===_0x9d1f('0x21');var _0x57ba11=_0x2488a3[_0x9d1f('0x23')];var _0x42a2b4=_0x24cd8a?0x0:_0x9f8cfc['offset'];var _0x329b69=_0x24cd8a?_0x2488a3['count']:_0x9f8cfc['offset']+_0x9f8cfc['limit'];var _0x2d39f3;if(_0x329b69>=_0x57ba11){_0x329b69=_0x57ba11;_0x2d39f3=0xc8;}else{_0x2d39f3=0xce;}_0x40a87f[_0x9d1f('0x1e')](_0x2d39f3);return _0x40a87f[_0x9d1f('0x24')]('Content-Range',_0x42a2b4+'-'+_0x329b69+'/'+_0x57ba11)[_0x9d1f('0x1f')](_0x2488a3);}return null;};}function patchUpdates(_0x4cfcf5){return function(_0x1c0280){try{jsonpatch['apply'](_0x1c0280,_0x4cfcf5,!![]);}catch(_0x552a84){return BPromise[_0x9d1f('0x25')](_0x552a84);}return _0x1c0280[_0x9d1f('0x26')]();};}function saveUpdates(_0x35a80d,_0x2d861b){return function(_0x44ef15){if(_0x44ef15){return _0x44ef15[_0x9d1f('0x27')](_0x35a80d)[_0x9d1f('0x28')](function(_0x3b10f7){return _0x3b10f7;});}return null;};}function removeEntity(_0x2c6417,_0xc05aa){return function(_0x1ab0f4){if(_0x1ab0f4){return _0x1ab0f4[_0x9d1f('0x29')]()[_0x9d1f('0x28')](function(){_0x2c6417[_0x9d1f('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b234d,_0xa2392f){return function(_0x48245c){if(!_0x48245c){_0x2b234d['sendStatus'](0x194);}return _0x48245c;};}function handleError(_0x1f2b0e,_0xfdd4ae){_0xfdd4ae=_0xfdd4ae||0x1f4;return function(_0x3ca450){logger[_0x9d1f('0x2a')](_0x3ca450[_0x9d1f('0x2b')]);if(_0x3ca450['name']){delete _0x3ca450['name'];}_0x1f2b0e[_0x9d1f('0x1e')](_0xfdd4ae)[_0x9d1f('0x2c')](_0x3ca450);};}exports[_0x9d1f('0x2d')]=function(_0x44515d,_0x1df1b8){var _0x1d8ffe={'raw':!![],'where':{'id':_0x44515d[_0x9d1f('0x2e')]['id']}},_0x48fbf5={};_0x48fbf5['model']=_[_0x9d1f('0x2f')](db[_0x9d1f('0x30')][_0x9d1f('0x31')]);_0x48fbf5[_0x9d1f('0x32')]=_[_0x9d1f('0x2f')](_0x44515d['query']);_0x48fbf5[_0x9d1f('0x33')]=_[_0x9d1f('0x34')](_0x48fbf5[_0x9d1f('0x35')],_0x48fbf5['query']);_0x1d8ffe['attributes']=_[_0x9d1f('0x34')](_0x48fbf5[_0x9d1f('0x35')],qs['fields'](_0x44515d[_0x9d1f('0x32')][_0x9d1f('0x36')]));_0x1d8ffe[_0x9d1f('0x37')]=_0x1d8ffe[_0x9d1f('0x37')]['length']?_0x1d8ffe[_0x9d1f('0x37')]:_0x48fbf5[_0x9d1f('0x35')];if(_0x44515d[_0x9d1f('0x32')][_0x9d1f('0x38')]){_0x1d8ffe['include']=[{'all':!![]}];}_0x1d8ffe=_[_0x9d1f('0x39')]({},_0x1d8ffe,_0x44515d['options']);return db[_0x9d1f('0x30')][_0x9d1f('0x3a')](_0x1d8ffe)[_0x9d1f('0x28')](handleEntityNotFound(_0x1df1b8,null))['then'](respondWithResult(_0x1df1b8,null))[_0x9d1f('0x3b')](handleError(_0x1df1b8,null));};exports[_0x9d1f('0x3c')]=function(_0x324242,_0x236ca3){return db[_0x9d1f('0x30')]['create'](_0x324242[_0x9d1f('0x3d')],{})[_0x9d1f('0x28')](respondWithResult(_0x236ca3,0xc9))[_0x9d1f('0x3b')](handleError(_0x236ca3,null));};exports[_0x9d1f('0x27')]=function(_0x245675,_0x381654){if(_0x245675[_0x9d1f('0x3d')]['id']){delete _0x245675['body']['id'];}return db[_0x9d1f('0x30')][_0x9d1f('0x3a')]({'where':{'id':_0x245675[_0x9d1f('0x2e')]['id']}})[_0x9d1f('0x28')](handleEntityNotFound(_0x381654,null))['then'](saveUpdates(_0x245675[_0x9d1f('0x3d')],null))['then'](respondWithResult(_0x381654,null))['catch'](handleError(_0x381654,null));};exports['destroy']=function(_0x3c9a17,_0x1253e2){return db['ChatProactiveAction'][_0x9d1f('0x3a')]({'where':{'id':_0x3c9a17[_0x9d1f('0x2e')]['id']}})[_0x9d1f('0x28')](handleEntityNotFound(_0x1253e2,null))[_0x9d1f('0x28')](removeEntity(_0x1253e2,null))[_0x9d1f('0x3b')](handleError(_0x1253e2,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 5938bc2..f2c76e1 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 _0x76c2=['lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions'];(function(_0xd16b5f,_0x47b868){var _0x49d80c=function(_0x245068){while(--_0x245068){_0xd16b5f['push'](_0xd16b5f['shift']());}};_0x49d80c(++_0x47b868);}(_0x76c2,0x78));var _0x276c=function(_0x73f519,_0x15fa15){_0x73f519=_0x73f519-0x0;var _0x410358=_0x76c2[_0x73f519];return _0x410358;};'use strict';var _=require(_0x276c('0x0'));var util=require(_0x276c('0x1'));var logger=require(_0x276c('0x2'))(_0x276c('0x3'));var moment=require(_0x276c('0x4'));var BPromise=require('bluebird');var rp=require(_0x276c('0x5'));var fs=require('fs');var path=require(_0x276c('0x6'));var rimraf=require('rimraf');var config=require(_0x276c('0x7'));var attributes=require(_0x276c('0x8'));module['exports']=function(_0x1373f0,_0x32a1b2){return _0x1373f0[_0x276c('0x9')](_0x276c('0xa'),attributes,{'tableName':_0x276c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6f78=['bluebird','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment'];(function(_0x3ba0cb,_0x1b6b79){var _0x13d4b1=function(_0xeb3351){while(--_0xeb3351){_0x3ba0cb['push'](_0x3ba0cb['shift']());}};_0x13d4b1(++_0x1b6b79);}(_0x6f78,0x103));var _0x86f7=function(_0x4a1a0f,_0x322831){_0x4a1a0f=_0x4a1a0f-0x0;var _0x3ee36f=_0x6f78[_0x4a1a0f];return _0x3ee36f;};'use strict';var _=require(_0x86f7('0x0'));var util=require(_0x86f7('0x1'));var logger=require(_0x86f7('0x2'))(_0x86f7('0x3'));var moment=require(_0x86f7('0x4'));var BPromise=require(_0x86f7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x86f7('0x6'));var config=require(_0x86f7('0x7'));var attributes=require(_0x86f7('0x8'));module[_0x86f7('0x9')]=function(_0xa397c1,_0x46a8a1){return _0xa397c1['define'](_0x86f7('0xa'),attributes,{'tableName':_0x86f7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 235f54d..3adcc9f 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 _0x1af4=['then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x34a5eb,_0x9361be){var _0x427afb=function(_0x368d3e){while(--_0x368d3e){_0x34a5eb['push'](_0x34a5eb['shift']());}};_0x427afb(++_0x9361be);}(_0x1af4,0x78));var _0x41af=function(_0x5b92df,_0x19a2ab){_0x5b92df=_0x5b92df-0x0;var _0xfbd4d4=_0x1af4[_0x5b92df];return _0xfbd4d4;};'use strict';var _=require(_0x41af('0x0'));var util=require('util');var moment=require(_0x41af('0x1'));var BPromise=require(_0x41af('0x2'));var rs=require(_0x41af('0x3'));var fs=require('fs');var Redis=require(_0x41af('0x4'));var db=require(_0x41af('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x41af('0x6'))(_0x41af('0x7'));var config=require(_0x41af('0x8'));var jayson=require(_0x41af('0x9'));var client=jayson['client'][_0x41af('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ebdb5,_0x5d4be8,_0x54d853){return new BPromise(function(_0x16df69,_0x339b01){return client[_0x41af('0xb')](_0x5ebdb5,_0x54d853)[_0x41af('0xc')](function(_0x42bdbc){logger['info'](_0x41af('0xd'),_0x5d4be8,_0x41af('0xe'));logger[_0x41af('0xf')](_0x41af('0x10'),_0x5d4be8,_0x41af('0xe'),JSON[_0x41af('0x11')](_0x42bdbc));if(_0x42bdbc[_0x41af('0x12')]){if(_0x42bdbc['error']['code']===0x1f4){logger[_0x41af('0x12')](_0x41af('0xd'),_0x5d4be8,_0x42bdbc[_0x41af('0x12')][_0x41af('0x13')]);return _0x339b01(_0x42bdbc[_0x41af('0x12')]['message']);}logger[_0x41af('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x5d4be8,_0x42bdbc[_0x41af('0x12')][_0x41af('0x13')]);return _0x16df69(_0x42bdbc['error'][_0x41af('0x13')]);}else{logger[_0x41af('0x14')](_0x41af('0xd'),_0x5d4be8,'request\x20sent');_0x16df69(_0x42bdbc['result'][_0x41af('0x13')]);}})[_0x41af('0x15')](function(_0x1658e0){logger[_0x41af('0x12')](_0x41af('0xd'),_0x5d4be8,_0x1658e0);_0x339b01(_0x1658e0);});});}
\ No newline at end of file
+var _0xf43e=['jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x32729c,_0xf5afd8){var _0x482cfd=function(_0x231471){while(--_0x231471){_0x32729c['push'](_0x32729c['shift']());}};_0x482cfd(++_0xf5afd8);}(_0xf43e,0x66));var _0xef43=function(_0xb88792,_0x3408d5){_0xb88792=_0xb88792-0x0;var _0x4f8d68=_0xf43e[_0xb88792];return _0x4f8d68;};'use strict';var _=require(_0xef43('0x0'));var util=require(_0xef43('0x1'));var moment=require('moment');var BPromise=require(_0xef43('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xef43('0x3'));var db=require(_0xef43('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xef43('0x5'))(_0xef43('0x6'));var config=require(_0xef43('0x7'));var jayson=require(_0xef43('0x8'));var client=jayson[_0xef43('0x9')][_0xef43('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1264a8,_0x1b7036,_0x129499){return new BPromise(function(_0x226eb8,_0x2d0efa){return client[_0xef43('0xb')](_0x1264a8,_0x129499)['then'](function(_0xe0e2c7){logger[_0xef43('0xc')](_0xef43('0xd'),_0x1b7036,_0xef43('0xe'));logger['debug'](_0xef43('0xf'),_0x1b7036,_0xef43('0xe'),JSON[_0xef43('0x10')](_0xe0e2c7));if(_0xe0e2c7[_0xef43('0x11')]){if(_0xe0e2c7[_0xef43('0x11')][_0xef43('0x12')]===0x1f4){logger[_0xef43('0x11')](_0xef43('0xd'),_0x1b7036,_0xe0e2c7[_0xef43('0x11')][_0xef43('0x13')]);return _0x2d0efa(_0xe0e2c7[_0xef43('0x11')]['message']);}logger['error'](_0xef43('0xd'),_0x1b7036,_0xe0e2c7[_0xef43('0x11')][_0xef43('0x13')]);return _0x226eb8(_0xe0e2c7[_0xef43('0x11')][_0xef43('0x13')]);}else{logger[_0xef43('0xc')](_0xef43('0xd'),_0x1b7036,_0xef43('0xe'));_0x226eb8(_0xe0e2c7[_0xef43('0x14')]['message']);}})[_0xef43('0x15')](function(_0x10e124){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x1b7036,_0x10e124);_0x2d0efa(_0x10e124);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index da8ab3d..158b035 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 _0xdbf5=['post','put','update','delete','destroy','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x24e880,_0x466f47){var _0x45c13d=function(_0x294c7d){while(--_0x294c7d){_0x24e880['push'](_0x24e880['shift']());}};_0x45c13d(++_0x466f47);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x37df85,_0x394d8c){_0x37df85=_0x37df85-0x0;var _0x2d7292=_0xdbf5[_0x37df85];return _0x2d7292;};'use strict';var multer=require('multer');var util=require(_0x5dbf('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5dbf('0x1'));var router=express[_0x5dbf('0x2')]();var fs_extra=require(_0x5dbf('0x3'));var auth=require(_0x5dbf('0x4'));var interaction=require(_0x5dbf('0x5'));var config=require(_0x5dbf('0x6'));var controller=require(_0x5dbf('0x7'));router[_0x5dbf('0x8')](_0x5dbf('0x9'),auth[_0x5dbf('0xa')](),controller[_0x5dbf('0xb')]);router[_0x5dbf('0xc')]('/',auth[_0x5dbf('0xa')](),controller['create']);router[_0x5dbf('0xd')]('/:id',auth[_0x5dbf('0xa')](),controller[_0x5dbf('0xe')]);router[_0x5dbf('0xf')](_0x5dbf('0x9'),auth['isAuthenticated'](),controller[_0x5dbf('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x3eea=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','post','create','update','isAuthenticated','destroy','multer'];(function(_0x16ae27,_0x3d0212){var _0x4871c5=function(_0x1f226c){while(--_0x1f226c){_0x16ae27['push'](_0x16ae27['shift']());}};_0x4871c5(++_0x3d0212);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x1837ac,_0x3f8d60){_0x1837ac=_0x1837ac-0x0;var _0x50d21e=_0x3eea[_0x1837ac];return _0x50d21e;};'use strict';var multer=require(_0xa3ee('0x0'));var util=require('util');var path=require(_0xa3ee('0x1'));var timeout=require(_0xa3ee('0x2'));var express=require(_0xa3ee('0x3'));var router=express[_0xa3ee('0x4')]();var fs_extra=require(_0xa3ee('0x5'));var auth=require(_0xa3ee('0x6'));var interaction=require(_0xa3ee('0x7'));var config=require(_0xa3ee('0x8'));var controller=require(_0xa3ee('0x9'));router[_0xa3ee('0xa')](_0xa3ee('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xa3ee('0xc')]('/',auth['isAuthenticated'](),controller[_0xa3ee('0xd')]);router['put'](_0xa3ee('0xb'),auth['isAuthenticated'](),controller[_0xa3ee('0xe')]);router['delete'](_0xa3ee('0xb'),auth[_0xa3ee('0xf')](),controller[_0xa3ee('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index e141b70..644e626 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 _0xc4d5=['ENUM','rrmemory','beepall','sequelize','exports','STRING','name','INTEGER'];(function(_0x3493e3,_0x4e11ff){var _0x377c4d=function(_0x3f3aec){while(--_0x3f3aec){_0x3493e3['push'](_0x3493e3['shift']());}};_0x377c4d(++_0x4e11ff);}(_0xc4d5,0xc3));var _0x5c4d=function(_0x3f578f,_0x51f172){_0x3f578f=_0x3f578f-0x0;var _0x32c754=_0xc4d5[_0x3f578f];return _0x32c754;};'use strict';var Sequelize=require(_0x5c4d('0x0'));module[_0x5c4d('0x1')]={'name':{'type':Sequelize[_0x5c4d('0x2')],'unique':_0x5c4d('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5c4d('0x2')]},'timeout':{'type':Sequelize[_0x5c4d('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5c4d('0x5')](_0x5c4d('0x6'),_0x5c4d('0x7'),'roundrobin')}};
\ No newline at end of file
+var _0xddc2=['sequelize','exports','STRING','name','ENUM','beepall'];(function(_0x38f374,_0x4b1d43){var _0x3c78a0=function(_0x4cbb16){while(--_0x4cbb16){_0x38f374['push'](_0x38f374['shift']());}};_0x3c78a0(++_0x4b1d43);}(_0xddc2,0x78));var _0x2ddc=function(_0x2edd6a,_0x5e6d1a){_0x2edd6a=_0x2edd6a-0x0;var _0x5b7047=_0xddc2[_0x2edd6a];return _0x5b7047;};'use strict';var Sequelize=require(_0x2ddc('0x0'));module[_0x2ddc('0x1')]={'name':{'type':Sequelize[_0x2ddc('0x2')],'unique':_0x2ddc('0x3'),'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[_0x2ddc('0x4')]('rrmemory',_0x2ddc('0x5'),'roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 5a0d245..ab8b2d0 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 _0x5fff=['body','find','params','describe','getMembers','findOne','ChatQueueId','UserChatQueue','User','chatPause','updatedAt','createdAt','rows','format','SIP','getTeams','nolimit','ids','findAll','Agents','online','interface','sequelize','transaction','each','findOrCreate','forEach','userChatQueue:save','removeTeams','Team','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','omit','getAgents','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','get','ChatQueues','stack','name','send','index','map','ChatQueue','rawAttributes','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x38cd0f,_0x37a639){var _0x4727df=function(_0x133d5d){while(--_0x133d5d){_0x38cd0f['push'](_0x38cd0f['shift']());}};_0x4727df(++_0x37a639);}(_0x5fff,0xd1));var _0xf5ff=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5fff[_0x5f0089];return _0x193892;};'use strict';var emlformat=require(_0xf5ff('0x0'));var rimraf=require(_0xf5ff('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf5ff('0x2'));var moment=require(_0xf5ff('0x3'));var BPromise=require(_0xf5ff('0x4'));var Mustache=require(_0xf5ff('0x5'));var util=require('util');var path=require(_0xf5ff('0x6'));var sox=require('sox');var csv=require(_0xf5ff('0x7'));var ejs=require(_0xf5ff('0x8'));var fs=require('fs');var fs_extra=require(_0xf5ff('0x9'));var _=require(_0xf5ff('0xa'));var squel=require('squel');var crypto=require(_0xf5ff('0xb'));var jsforce=require(_0xf5ff('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf5ff('0xd'));var Papa=require(_0xf5ff('0xe'));var Redis=require(_0xf5ff('0xf'));var authService=require(_0xf5ff('0x10'));var qs=require(_0xf5ff('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf5ff('0x12'));var logger=require(_0xf5ff('0x13'))(_0xf5ff('0x14'));var utils=require(_0xf5ff('0x15'));var config=require(_0xf5ff('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf5ff('0x17'))['db'];config[_0xf5ff('0x18')]=_[_0xf5ff('0x19')](config[_0xf5ff('0x18')],{'host':_0xf5ff('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf5ff('0x18')]));require(_0xf5ff('0x1b'))[_0xf5ff('0x1c')](socket);var jayson=require(_0xf5ff('0x1d'));var client=jayson[_0xf5ff('0x1e')][_0xf5ff('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x5b24e7,_0x28add6,_0x4b4cbd,_0x495e53){return new BPromise(function(_0xac4101,_0x467d01){var _0x199309=_0x495e53||client;return _0x199309[_0xf5ff('0x20')](_0x5b24e7,_0x4b4cbd)[_0xf5ff('0x21')](function(_0x2bc39b){logger[_0xf5ff('0x22')]('ChatQueue,\x20%s,\x20%s',_0x28add6,_0xf5ff('0x23'));logger[_0xf5ff('0x24')](_0xf5ff('0x25'),_0x28add6,_0xf5ff('0x23'),JSON['stringify'](_0x2bc39b));if(_0x2bc39b[_0xf5ff('0x26')]){if(_0x2bc39b[_0xf5ff('0x26')][_0xf5ff('0x27')]===0x1f4){logger[_0xf5ff('0x26')](_0xf5ff('0x28'),_0x28add6,_0x2bc39b[_0xf5ff('0x26')][_0xf5ff('0x29')]);return _0x467d01(_0x2bc39b[_0xf5ff('0x26')][_0xf5ff('0x29')]);}logger[_0xf5ff('0x26')](_0xf5ff('0x28'),_0x28add6,_0x2bc39b[_0xf5ff('0x26')][_0xf5ff('0x29')]);return _0xac4101(_0x2bc39b[_0xf5ff('0x26')][_0xf5ff('0x29')]);}else{logger['info'](_0xf5ff('0x28'),_0x28add6,'request\x20sent');_0xac4101(_0x2bc39b[_0xf5ff('0x2a')]['message']);}})[_0xf5ff('0x2b')](function(_0x12bf00){logger[_0xf5ff('0x26')](_0xf5ff('0x28'),_0x28add6,_0x12bf00);_0x467d01(_0x12bf00);});});}function respondWithStatusCode(_0x4a08d4,_0x20e086){_0x20e086=_0x20e086||0xcc;return function(_0x4747f0){if(_0x4747f0){return _0x4a08d4[_0xf5ff('0x2c')](_0x20e086);}return _0x4a08d4[_0xf5ff('0x2d')](_0x20e086)[_0xf5ff('0x2e')]();};}function respondWithResult(_0x1367a6,_0x3eee06){_0x3eee06=_0x3eee06||0xc8;return function(_0xb98881){if(_0xb98881){return _0x1367a6[_0xf5ff('0x2d')](_0x3eee06)[_0xf5ff('0x2f')](_0xb98881);}};}function respondWithFilteredResult(_0x3fe789,_0x1c98af){return function(_0x51a235){if(_0x51a235){var _0x136dde=typeof _0x1c98af[_0xf5ff('0x30')]===_0xf5ff('0x31')&&typeof _0x1c98af[_0xf5ff('0x32')]===_0xf5ff('0x31');var _0x2909a3=_0x51a235[_0xf5ff('0x33')];var _0x20124d=_0x136dde?0x0:_0x1c98af[_0xf5ff('0x30')];var _0x555432=_0x136dde?_0x51a235[_0xf5ff('0x33')]:_0x1c98af[_0xf5ff('0x30')]+_0x1c98af['limit'];var _0x4296e5;if(_0x555432>=_0x2909a3){_0x555432=_0x2909a3;_0x4296e5=0xc8;}else{_0x4296e5=0xce;}_0x3fe789[_0xf5ff('0x2d')](_0x4296e5);return _0x3fe789[_0xf5ff('0x34')](_0xf5ff('0x35'),_0x20124d+'-'+_0x555432+'/'+_0x2909a3)[_0xf5ff('0x2f')](_0x51a235);}return null;};}function patchUpdates(_0x25ffc2){return function(_0x1cb656){try{jsonpatch[_0xf5ff('0x36')](_0x1cb656,_0x25ffc2,!![]);}catch(_0x31dd96){return BPromise[_0xf5ff('0x37')](_0x31dd96);}return _0x1cb656['save']();};}function saveUpdates(_0x39e66b,_0x36eb42){return function(_0x52e705){if(_0x52e705){return _0x52e705[_0xf5ff('0x38')](_0x39e66b)[_0xf5ff('0x21')](function(_0x3e0064){return _0x3e0064;});}return null;};}function removeEntity(_0x55eaab,_0x5c61fe){return function(_0xd23180){if(_0xd23180){return _0xd23180[_0xf5ff('0x39')]()['then'](function(){var _0xd486e=_0xd23180[_0xf5ff('0x3a')]({'plain':!![]});var _0x317418=_0xf5ff('0x3b');return db['UserProfileResource'][_0xf5ff('0x39')]({'where':{'type':_0x317418,'resourceId':_0xd486e['id']}})[_0xf5ff('0x21')](function(){return _0xd23180;});})[_0xf5ff('0x21')](function(){_0x55eaab[_0xf5ff('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x120e28,_0x3bca8e){return function(_0x1862f4){if(!_0x1862f4){_0x120e28[_0xf5ff('0x2c')](0x194);}return _0x1862f4;};}function handleError(_0x540d17,_0x5b829a){_0x5b829a=_0x5b829a||0x1f4;return function(_0x1c523b){logger['error'](_0x1c523b[_0xf5ff('0x3c')]);if(_0x1c523b[_0xf5ff('0x3d')]){delete _0x1c523b['name'];}_0x540d17[_0xf5ff('0x2d')](_0x5b829a)[_0xf5ff('0x3e')](_0x1c523b);};}exports[_0xf5ff('0x3f')]=function(_0x4c6863,_0x414c15){var _0xde0a7={},_0x11fead={},_0x2a2b6d={'count':0x0,'rows':[]};var _0x1fb4f1=_[_0xf5ff('0x40')](db[_0xf5ff('0x41')][_0xf5ff('0x42')],function(_0x3e0d77){return{'name':_0x3e0d77['fieldName'],'type':_0x3e0d77['type'][_0xf5ff('0x43')]};});_0x11fead['model']=_[_0xf5ff('0x40')](_0x1fb4f1,_0xf5ff('0x3d'));_0x11fead[_0xf5ff('0x44')]=_[_0xf5ff('0x45')](_0x4c6863['query']);_0x11fead[_0xf5ff('0x46')]=_['intersection'](_0x11fead[_0xf5ff('0x47')],_0x11fead[_0xf5ff('0x44')]);_0xde0a7[_0xf5ff('0x48')]=_[_0xf5ff('0x49')](_0x11fead[_0xf5ff('0x47')],qs[_0xf5ff('0x4a')](_0x4c6863[_0xf5ff('0x44')][_0xf5ff('0x4a')]));_0xde0a7[_0xf5ff('0x48')]=_0xde0a7['attributes'][_0xf5ff('0x4b')]?_0xde0a7[_0xf5ff('0x48')]:_0x11fead[_0xf5ff('0x47')];if(!_0x4c6863[_0xf5ff('0x44')][_0xf5ff('0x4c')]('nolimit')){_0xde0a7['limit']=qs[_0xf5ff('0x32')](_0x4c6863[_0xf5ff('0x44')]['limit']);_0xde0a7[_0xf5ff('0x30')]=qs[_0xf5ff('0x30')](_0x4c6863[_0xf5ff('0x44')][_0xf5ff('0x30')]);}_0xde0a7[_0xf5ff('0x4d')]=qs[_0xf5ff('0x4e')](_0x4c6863['query'][_0xf5ff('0x4e')]);_0xde0a7[_0xf5ff('0x4f')]=qs['filters'](_[_0xf5ff('0x50')](_0x4c6863[_0xf5ff('0x44')],_0x11fead[_0xf5ff('0x46')]),_0x1fb4f1);if(_0x4c6863[_0xf5ff('0x44')][_0xf5ff('0x51')]){_0xde0a7[_0xf5ff('0x4f')]=_[_0xf5ff('0x52')](_0xde0a7[_0xf5ff('0x4f')],{'$or':_[_0xf5ff('0x40')](_0x1fb4f1,function(_0x47481c){if(_0x47481c[_0xf5ff('0x53')]!==_0xf5ff('0x54')){var _0x5c7729={};_0x5c7729[_0x47481c['name']]={'$like':'%'+_0x4c6863[_0xf5ff('0x44')][_0xf5ff('0x51')]+'%'};return _0x5c7729;}})});}_0xde0a7=_[_0xf5ff('0x52')]({},_0xde0a7,_0x4c6863[_0xf5ff('0x55')]);var _0x2e881d={'where':_0xde0a7['where']};return db[_0xf5ff('0x41')]['count'](_0x2e881d)['then'](function(_0x3e7563){_0x2a2b6d[_0xf5ff('0x33')]=_0x3e7563;if(_0x4c6863[_0xf5ff('0x44')][_0xf5ff('0x56')]){_0xde0a7[_0xf5ff('0x57')]=[{'all':!![]}];}return db[_0xf5ff('0x41')]['findAll'](_0xde0a7);})['then'](function(_0x358d5f){_0x2a2b6d['rows']=_0x358d5f;return _0x2a2b6d;})[_0xf5ff('0x21')](respondWithFilteredResult(_0x414c15,_0xde0a7))['catch'](handleError(_0x414c15,null));};exports['show']=function(_0x188b0a,_0x44beb4){var _0x76d700={'raw':!![],'where':{'id':_0x188b0a['params']['id']}},_0x35c8db={};_0x35c8db[_0xf5ff('0x47')]=_[_0xf5ff('0x45')](db[_0xf5ff('0x41')][_0xf5ff('0x42')]);_0x35c8db[_0xf5ff('0x44')]=_[_0xf5ff('0x45')](_0x188b0a[_0xf5ff('0x44')]);_0x35c8db[_0xf5ff('0x46')]=_['intersection'](_0x35c8db[_0xf5ff('0x47')],_0x35c8db[_0xf5ff('0x44')]);_0x76d700['attributes']=_[_0xf5ff('0x49')](_0x35c8db['model'],qs[_0xf5ff('0x4a')](_0x188b0a['query'][_0xf5ff('0x4a')]));_0x76d700['attributes']=_0x76d700[_0xf5ff('0x48')][_0xf5ff('0x4b')]?_0x76d700[_0xf5ff('0x48')]:_0x35c8db[_0xf5ff('0x47')];if(_0x188b0a[_0xf5ff('0x44')][_0xf5ff('0x56')]){_0x76d700[_0xf5ff('0x57')]=[{'all':!![]}];}_0x76d700=_[_0xf5ff('0x52')]({},_0x76d700,_0x188b0a[_0xf5ff('0x55')]);return db[_0xf5ff('0x41')]['find'](_0x76d700)[_0xf5ff('0x21')](handleEntityNotFound(_0x44beb4,null))['then'](respondWithResult(_0x44beb4,null))[_0xf5ff('0x2b')](handleError(_0x44beb4,null));};exports[_0xf5ff('0x58')]=function(_0x5627de,_0x2bd286){return db[_0xf5ff('0x41')][_0xf5ff('0x58')](_0x5627de['body'],{})[_0xf5ff('0x21')](function(_0x112467){var _0x27430c=_0x5627de[_0xf5ff('0x59')][_0xf5ff('0x3a')]({'plain':!![]});if(!_0x27430c)throw new Error(_0xf5ff('0x5a'));if(_0x27430c[_0xf5ff('0x5b')]===_0xf5ff('0x59')){var _0x5ca10a=_0x112467['get']({'plain':!![]});var _0x340554=_0xf5ff('0x3b');return db[_0xf5ff('0x5c')]['find']({'where':{'name':_0x340554,'userProfileId':_0x27430c[_0xf5ff('0x5d')]},'raw':!![]})[_0xf5ff('0x21')](function(_0x2b4972){if(_0x2b4972&&_0x2b4972[_0xf5ff('0x5e')]===0x0){return db[_0xf5ff('0x5f')][_0xf5ff('0x58')]({'name':_0x5ca10a[_0xf5ff('0x3d')],'resourceId':_0x5ca10a['id'],'type':_0x2b4972[_0xf5ff('0x3d')],'sectionId':_0x2b4972['id']},{})[_0xf5ff('0x21')](function(){return _0x112467;});}else{return _0x112467;}})['catch'](function(_0x57a72c){logger[_0xf5ff('0x26')](_0xf5ff('0x60'),_0x57a72c);throw _0x57a72c;});}return _0x112467;})['then'](respondWithResult(_0x2bd286,0xc9))['catch'](handleError(_0x2bd286,null));};exports['update']=function(_0x153656,_0x44303a){if(_0x153656[_0xf5ff('0x61')]['id']){delete _0x153656[_0xf5ff('0x61')]['id'];}return db[_0xf5ff('0x41')][_0xf5ff('0x62')]({'where':{'id':_0x153656[_0xf5ff('0x63')]['id']}})[_0xf5ff('0x21')](handleEntityNotFound(_0x44303a,null))[_0xf5ff('0x21')](saveUpdates(_0x153656[_0xf5ff('0x61')],null))[_0xf5ff('0x21')](respondWithResult(_0x44303a,null))[_0xf5ff('0x2b')](handleError(_0x44303a,null));};exports[_0xf5ff('0x39')]=function(_0x5bcdfc,_0x584772){return db[_0xf5ff('0x41')][_0xf5ff('0x62')]({'where':{'id':_0x5bcdfc['params']['id']}})[_0xf5ff('0x21')](handleEntityNotFound(_0x584772,null))['then'](removeEntity(_0x584772,null))[_0xf5ff('0x2b')](handleError(_0x584772,null));};exports[_0xf5ff('0x64')]=function(_0x4baa75,_0x1cb4e0){return db[_0xf5ff('0x41')][_0xf5ff('0x64')]()['then'](respondWithResult(_0x1cb4e0,null))[_0xf5ff('0x2b')](handleError(_0x1cb4e0,null));};exports[_0xf5ff('0x65')]=function(_0x1755c2,_0x1c4266,_0x26131a){var _0x1cb52e={'raw':!![],'where':{}},_0x4c7a12={},_0x491d20;return db['ChatQueue'][_0xf5ff('0x66')]({'where':{'id':_0x1755c2[_0xf5ff('0x63')]['id']}})[_0xf5ff('0x21')](handleEntityNotFound(_0x1c4266,null))[_0xf5ff('0x21')](function(_0x5494a3){if(_0x5494a3){_0x491d20=_0x5494a3[_0xf5ff('0x3a')]({'plain':!![]});_0x4c7a12[_0xf5ff('0x47')]=_[_0xf5ff('0x45')](db['UserChatQueue']['rawAttributes']);_0x4c7a12[_0xf5ff('0x44')]=_[_0xf5ff('0x45')](_0x1755c2[_0xf5ff('0x44')]);_0x4c7a12[_0xf5ff('0x46')]=_[_0xf5ff('0x49')](_0x4c7a12[_0xf5ff('0x47')],_0x4c7a12['query']);_0x1cb52e[_0xf5ff('0x48')]=_[_0xf5ff('0x49')](_0x4c7a12[_0xf5ff('0x47')],qs[_0xf5ff('0x4a')](_0x1755c2['query'][_0xf5ff('0x4a')]));_0x1cb52e['attributes']=_0x1cb52e[_0xf5ff('0x48')][_0xf5ff('0x4b')]?_0x1cb52e[_0xf5ff('0x48')]:_0x4c7a12[_0xf5ff('0x47')];if(!_0x1755c2['query'][_0xf5ff('0x4c')]('nolimit')){_0x1cb52e['limit']=qs[_0xf5ff('0x32')](_0x1755c2[_0xf5ff('0x44')][_0xf5ff('0x32')]);_0x1cb52e[_0xf5ff('0x30')]=qs[_0xf5ff('0x30')](_0x1755c2[_0xf5ff('0x44')][_0xf5ff('0x30')]);}_0x1cb52e[_0xf5ff('0x4d')]=qs[_0xf5ff('0x4e')](_0x1755c2['query'][_0xf5ff('0x4e')]);_0x1cb52e[_0xf5ff('0x4f')]=qs[_0xf5ff('0x46')](_[_0xf5ff('0x50')](_0x1755c2[_0xf5ff('0x44')],_0x4c7a12[_0xf5ff('0x46')]));_0x1cb52e['where'][_0xf5ff('0x67')]=_0x5494a3['id'];if(_0x1755c2[_0xf5ff('0x44')][_0xf5ff('0x51')]){_0x1cb52e[_0xf5ff('0x4f')]=_[_0xf5ff('0x52')](_0x1cb52e[_0xf5ff('0x4f')],{'$or':_['map'](_0x1cb52e[_0xf5ff('0x48')],function(_0x241ea7){var _0xe08e63={};_0xe08e63[_0x241ea7]={'$like':'%'+_0x1755c2[_0xf5ff('0x44')]['filter']+'%'};return _0xe08e63;})});}_0x1cb52e=_[_0xf5ff('0x52')]({},_0x1cb52e,_0x1755c2[_0xf5ff('0x55')]);return db[_0xf5ff('0x68')]['findAll'](_0x1cb52e);}})[_0xf5ff('0x21')](function(_0x40c3d7){if(_0x40c3d7){return db[_0xf5ff('0x69')]['findAndCountAll']({'where':{'id':_[_0xf5ff('0x40')](_0x40c3d7,'UserId'),'role':'agent'},'attributes':['id',_0xf5ff('0x3d'),_0xf5ff('0x6a'),_0xf5ff('0x6b'),_0xf5ff('0x6c')]});}})[_0xf5ff('0x21')](function(_0x525b87){if(_0x525b87){return{'count':_0x525b87['count'],'rows':_['map'](_0x525b87[_0xf5ff('0x6d')],function(_0x4f1b47){return{'membername':_0x4f1b47[_0xf5ff('0x3d')],'UserId':_0x4f1b47['id'],'queue_name':_0x491d20[_0xf5ff('0x3d')],'ChatQueueId':_0x491d20['id'],'interface':util[_0xf5ff('0x6e')]('%s/%s',_0xf5ff('0x6f'),_0x4f1b47[_0xf5ff('0x3d')]),'penalty':0x0,'paused':_0x4f1b47[_0xf5ff('0x6a')],'createdAt':_0x4f1b47[_0xf5ff('0x6c')],'updatedAt':_0x4f1b47[_0xf5ff('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf5ff('0x21')](respondWithFilteredResult(_0x1c4266,_0x1cb52e))[_0xf5ff('0x2b')](handleError(_0x1c4266,null));};exports[_0xf5ff('0x70')]=function(_0x352c0d,_0x246ba2,_0x2c3543){var _0xaca333={};var _0x135533={};var _0x448525;var _0x4c6a1a;return db[_0xf5ff('0x41')][_0xf5ff('0x66')]({'where':{'id':_0x352c0d[_0xf5ff('0x63')]['id']}})['then'](handleEntityNotFound(_0x246ba2,null))[_0xf5ff('0x21')](function(_0x15351b){if(_0x15351b){_0x448525=_0x15351b;_0x135533[_0xf5ff('0x47')]=_['keys'](db['Team'][_0xf5ff('0x42')]);_0x135533['query']=_['keys'](_0x352c0d[_0xf5ff('0x44')]);_0x135533[_0xf5ff('0x46')]=_[_0xf5ff('0x49')](_0x135533[_0xf5ff('0x47')],_0x135533[_0xf5ff('0x44')]);_0xaca333[_0xf5ff('0x48')]=_[_0xf5ff('0x49')](_0x135533[_0xf5ff('0x47')],qs['fields'](_0x352c0d[_0xf5ff('0x44')][_0xf5ff('0x4a')]));_0xaca333[_0xf5ff('0x48')]=_0xaca333[_0xf5ff('0x48')][_0xf5ff('0x4b')]?_0xaca333[_0xf5ff('0x48')]:_0x135533['model'];_0xaca333[_0xf5ff('0x4d')]=qs['sort'](_0x352c0d[_0xf5ff('0x44')][_0xf5ff('0x4e')]);_0xaca333[_0xf5ff('0x4f')]=qs[_0xf5ff('0x46')](_['pick'](_0x352c0d['query'],_0x135533['filters']));if(_0x352c0d['query'][_0xf5ff('0x51')]){_0xaca333[_0xf5ff('0x4f')]=_['merge'](_0xaca333[_0xf5ff('0x4f')],{'$or':_[_0xf5ff('0x40')](_0xaca333[_0xf5ff('0x48')],function(_0x376941){var _0x2a30f1={};_0x2a30f1[_0x376941]={'$like':'%'+_0x352c0d[_0xf5ff('0x44')][_0xf5ff('0x51')]+'%'};return _0x2a30f1;})});}_0xaca333=_[_0xf5ff('0x52')]({},_0xaca333,_0x352c0d[_0xf5ff('0x55')]);return _0x448525[_0xf5ff('0x70')](_0xaca333);}})[_0xf5ff('0x21')](function(_0x4e1aca){if(_0x4e1aca){_0x4c6a1a=_0x4e1aca[_0xf5ff('0x4b')];if(!_0x352c0d['query'][_0xf5ff('0x4c')](_0xf5ff('0x71'))){_0xaca333[_0xf5ff('0x32')]=qs[_0xf5ff('0x32')](_0x352c0d[_0xf5ff('0x44')][_0xf5ff('0x32')]);_0xaca333[_0xf5ff('0x30')]=qs[_0xf5ff('0x30')](_0x352c0d[_0xf5ff('0x44')][_0xf5ff('0x30')]);}return _0x448525[_0xf5ff('0x70')](_0xaca333);}})['then'](function(_0x2e2e0a){if(_0x2e2e0a){return _0x2e2e0a?{'count':_0x4c6a1a,'rows':_0x2e2e0a}:null;}})[_0xf5ff('0x21')](respondWithResult(_0x246ba2,null))[_0xf5ff('0x2b')](handleError(_0x246ba2,null));};exports['addTeams']=function(_0x4d173c,_0x3ed8df,_0x30cc76){var _0x4e963f=_0x4d173c[_0xf5ff('0x61')][_0xf5ff('0x72')];return db['Team'][_0xf5ff('0x73')]({'where':{'id':_0x4e963f},'attributes':['id'],'include':[{'model':db[_0xf5ff('0x69')],'as':_0xf5ff('0x74'),'attributes':['id',_0xf5ff('0x3d'),_0xf5ff('0x75'),'voicePause',_0xf5ff('0x76')],'raw':!![]}]})[_0xf5ff('0x21')](function(_0x19a3a4){if(_0x19a3a4){var _0x15fe6e=_['flatMap'](_0x19a3a4,function(_0x51f096){var _0x3a638e=_0x51f096['get']({'plain':!![]});return _0x3a638e[_0xf5ff('0x74')];});return db['ChatQueue'][_0xf5ff('0x62')]({'where':{'id':_0x4d173c[_0xf5ff('0x63')]['id']}})['then'](function(_0x5341e4){return db[_0xf5ff('0x77')][_0xf5ff('0x78')](function(_0x555c74){return _0x5341e4['addTeams'](_0x4e963f,{'transaction':_0x555c74})[_0xf5ff('0x21')](function(){return BPromise[_0xf5ff('0x79')](_0x15fe6e,function(_0x1d3557){return db['UserChatQueue'][_0xf5ff('0x7a')]({'where':{'UserId':_0x1d3557['id'],'ChatQueueId':_0x4d173c[_0xf5ff('0x63')]['id']},'transaction':_0x555c74});});})['then'](function(){_0x15fe6e[_0xf5ff('0x7b')](function(_0x4121b3){socket['emit'](_0xf5ff('0x7c'),{'UserId':_0x4121b3['id'],'ChatQueueId':_0x5341e4['id']});});});});});}})[_0xf5ff('0x21')](respondWithStatusCode(_0x3ed8df,null))[_0xf5ff('0x2b')](handleError(_0x3ed8df,null));};exports[_0xf5ff('0x7d')]=function(_0x330203,_0x489153,_0x375853){return db[_0xf5ff('0x7e')][_0xf5ff('0x73')]({'where':{'id':_0x330203[_0xf5ff('0x44')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf5ff('0x74'),'attributes':['id'],'raw':!![]}]})[_0xf5ff('0x21')](handleEntityNotFound(_0x489153,null))[_0xf5ff('0x21')](function(_0xf35705){var _0x3293d6=_['map'](_0xf35705,'id');var _0x517e44=[];var _0x2ab075=[];var _0x13113f=squel[_0xf5ff('0x7f')]();_0x13113f[_0xf5ff('0x80')](_0xf5ff('0x81'))[_0xf5ff('0x82')]('team_has_chat_queues','tq')[_0xf5ff('0x83')](_0xf5ff('0x84'),'ut',_0xf5ff('0x85'))[_0xf5ff('0x4f')](_0xf5ff('0x86'),_0x330203['params']['id']);for(var _0x3f504c=0x0;_0x3f504c<_0xf35705[_0xf5ff('0x4b')];_0x3f504c+=0x1){let _0x5cd5b7=_0xf35705[_0x3f504c];for(var _0x45d2a6=0x0;_0x45d2a6<_0x5cd5b7[_0xf5ff('0x74')][_0xf5ff('0x4b')];_0x45d2a6+=0x1){let _0x5b4dfc=_0x5cd5b7[_0xf5ff('0x74')][_0x45d2a6];var _0x11485c=_0x13113f[_0xf5ff('0x87')]();_0x11485c[_0xf5ff('0x4f')](_0xf5ff('0x88'),_0x5b4dfc['id']);_0x2ab075['push'](db[_0xf5ff('0x77')][_0xf5ff('0x44')](_0x11485c[_0xf5ff('0x89')](),{'type':db[_0xf5ff('0x77')][_0xf5ff('0x8a')][_0xf5ff('0x8b')]})[_0xf5ff('0x21')](function(_0x57e552){if(_0x57e552[_0xf5ff('0x4b')]===0x1){return _0x5b4dfc['id'];}else{var _0x4bb31b=_[_0xf5ff('0x8c')](_[_0xf5ff('0x40')](_0x57e552,_0xf5ff('0x8d')),function(_0x4d6874){return _[_0xf5ff('0x8e')](_0x3293d6,_0x4d6874);});if(_0x4bb31b){return _0x5b4dfc['id'];}}}));}}return BPromise['all'](_0x2ab075)[_0xf5ff('0x21')](function(_0x3f91ed){_0x517e44=_(_0x517e44)[_0xf5ff('0x8f')](_0x3f91ed)[_0xf5ff('0x90')]()[_0xf5ff('0x91')]();return db[_0xf5ff('0x41')][_0xf5ff('0x62')]({'where':{'id':_0x330203[_0xf5ff('0x63')]['id']}})[_0xf5ff('0x21')](function(_0x3ed309){return db['sequelize']['transaction'](function(_0x3864f6){return _0x3ed309['removeTeams'](_0x330203[_0xf5ff('0x44')][_0xf5ff('0x72')],{'transaction':_0x3864f6})['then'](function(){if(!_[_0xf5ff('0x92')](_0x517e44)){return _0x3ed309[_0xf5ff('0x93')](_0x517e44,{'transaction':_0x3864f6});}})[_0xf5ff('0x21')](function(){_0x517e44['forEach'](function(_0x4cbf53){socket[_0xf5ff('0x94')](_0xf5ff('0x95'),{'UserId':_0x4cbf53,'ChatQueueId':_0x3ed309['id']});});});});});});})[_0xf5ff('0x21')](respondWithStatusCode(_0x489153,null))['catch'](handleError(_0x489153,null));};exports[_0xf5ff('0x96')]=function(_0x293862,_0x4e212d,_0x50d740){return db[_0xf5ff('0x41')][_0xf5ff('0x62')]({'where':{'id':_0x293862['params']['id']}})['then'](handleEntityNotFound(_0x4e212d,null))['then'](function(_0x66ffc8){if(_0x66ffc8){return _0x66ffc8['addAgents'](_0x293862[_0xf5ff('0x61')]['ids'],_[_0xf5ff('0x97')](_0x293862[_0xf5ff('0x61')],[_0xf5ff('0x72'),'id'])||{})['spread'](function(_0x14ccfc){for(var _0x241707=0x0;_0x241707<_0x293862[_0xf5ff('0x61')]['ids'][_0xf5ff('0x4b')];_0x241707+=0x1){socket[_0xf5ff('0x94')](_0xf5ff('0x7c'),{'UserId':Number(_0x293862[_0xf5ff('0x61')][_0xf5ff('0x72')][_0x241707]),'ChatQueueId':Number(_0x293862['params']['id'])});}return _0x14ccfc;});}})[_0xf5ff('0x21')](respondWithResult(_0x4e212d,null))[_0xf5ff('0x2b')](handleError(_0x4e212d,null));};exports[_0xf5ff('0x93')]=function(_0x17332e,_0x249625,_0x38d4d0){return db[_0xf5ff('0x41')]['find']({'where':{'id':_0x17332e[_0xf5ff('0x63')]['id']}})[_0xf5ff('0x21')](handleEntityNotFound(_0x249625,null))[_0xf5ff('0x21')](function(_0x3f0c3c){if(_0x3f0c3c){return _0x3f0c3c['removeAgents'](_0x17332e[_0xf5ff('0x44')]['ids'])['then'](function(){if(_['isArray'](_0x17332e['query'][_0xf5ff('0x72')])){for(var _0xaafb70=0x0;_0xaafb70<_0x17332e[_0xf5ff('0x44')][_0xf5ff('0x72')][_0xf5ff('0x4b')];_0xaafb70+=0x1){socket[_0xf5ff('0x94')](_0xf5ff('0x95'),{'UserId':Number(_0x17332e['query'][_0xf5ff('0x72')][_0xaafb70]),'ChatQueueId':Number(_0x17332e[_0xf5ff('0x63')]['id'])});}}else{socket[_0xf5ff('0x94')](_0xf5ff('0x95'),{'UserId':Number(_0x17332e[_0xf5ff('0x44')][_0xf5ff('0x72')]),'ChatQueueId':Number(_0x17332e[_0xf5ff('0x63')]['id'])});}});}})[_0xf5ff('0x21')](respondWithStatusCode(_0x249625,null))['catch'](handleError(_0x249625,null));};exports[_0xf5ff('0x98')]=function(_0x2e6004,_0x15c155,_0x43227c){var _0x70958f={};var _0x3dac8e={};var _0x3b7f7e;var _0x71a73b;return db[_0xf5ff('0x41')][_0xf5ff('0x66')]({'where':{'id':_0x2e6004[_0xf5ff('0x63')]['id']}})[_0xf5ff('0x21')](handleEntityNotFound(_0x15c155,null))[_0xf5ff('0x21')](function(_0x5cc0f5){if(_0x5cc0f5){_0x3b7f7e=_0x5cc0f5;_0x3dac8e['model']=_['keys'](db[_0xf5ff('0x69')][_0xf5ff('0x42')]);_0x3dac8e[_0xf5ff('0x44')]=_[_0xf5ff('0x45')](_0x2e6004[_0xf5ff('0x44')]);_0x3dac8e[_0xf5ff('0x46')]=_[_0xf5ff('0x49')](_0x3dac8e['model'],_0x3dac8e['query']);_0x70958f[_0xf5ff('0x48')]=_[_0xf5ff('0x49')](_0x3dac8e[_0xf5ff('0x47')],qs[_0xf5ff('0x4a')](_0x2e6004[_0xf5ff('0x44')]['fields']));_0x70958f[_0xf5ff('0x48')]=_0x70958f[_0xf5ff('0x48')][_0xf5ff('0x4b')]?_0x70958f[_0xf5ff('0x48')]:_0x3dac8e[_0xf5ff('0x47')];_0x70958f['order']=qs[_0xf5ff('0x4e')](_0x2e6004['query'][_0xf5ff('0x4e')]);_0x70958f['where']=qs[_0xf5ff('0x46')](_[_0xf5ff('0x50')](_0x2e6004[_0xf5ff('0x44')],_0x3dac8e[_0xf5ff('0x46')]));if(_0x2e6004[_0xf5ff('0x44')][_0xf5ff('0x51')]){_0x70958f['where']=_[_0xf5ff('0x52')](_0x70958f[_0xf5ff('0x4f')],{'$or':_[_0xf5ff('0x40')](_0x70958f['attributes'],function(_0x5ec7bd){var _0x11fb97={};_0x11fb97[_0x5ec7bd]={'$like':'%'+_0x2e6004[_0xf5ff('0x44')][_0xf5ff('0x51')]+'%'};return _0x11fb97;})});}_0x70958f=_['merge']({},_0x70958f,_0x2e6004[_0xf5ff('0x55')]);return _0x3b7f7e[_0xf5ff('0x98')](_0x70958f);}})['then'](function(_0x57875e){if(_0x57875e){_0x71a73b=_0x57875e[_0xf5ff('0x4b')];if(!_0x2e6004[_0xf5ff('0x44')][_0xf5ff('0x4c')](_0xf5ff('0x71'))){_0x70958f['limit']=qs['limit'](_0x2e6004[_0xf5ff('0x44')][_0xf5ff('0x32')]);_0x70958f['offset']=qs[_0xf5ff('0x30')](_0x2e6004[_0xf5ff('0x44')]['offset']);}return _0x3b7f7e[_0xf5ff('0x98')](_0x70958f);}})[_0xf5ff('0x21')](function(_0x4b9c02){if(_0x4b9c02){return _0x4b9c02?{'count':_0x71a73b,'rows':_0x4b9c02}:null;}})[_0xf5ff('0x21')](respondWithResult(_0x15c155,null))[_0xf5ff('0x2b')](handleError(_0x15c155,null));};
\ No newline at end of file
+var _0x5c10=['fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','sequelize','transaction','each','findOrCreate','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','every','TeamId','includes','all','value','removeAgents','forEach','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','redis','register','client','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','destroy','get','stack','name','send','index','map','ChatQueue'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x5c10,0x183));var _0x05c1=function(_0x4c159d,_0x362975){_0x4c159d=_0x4c159d-0x0;var _0x363683=_0x5c10[_0x4c159d];return _0x363683;};'use strict';var emlformat=require(_0x05c1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x05c1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x05c1('0x2'));var BPromise=require(_0x05c1('0x3'));var Mustache=require('mustache');var util=require(_0x05c1('0x4'));var path=require(_0x05c1('0x5'));var sox=require('sox');var csv=require(_0x05c1('0x6'));var ejs=require(_0x05c1('0x7'));var fs=require('fs');var fs_extra=require(_0x05c1('0x8'));var _=require(_0x05c1('0x9'));var squel=require('squel');var crypto=require(_0x05c1('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x05c1('0xb'));var toCsv=require(_0x05c1('0x6'));var querystring=require('querystring');var Papa=require(_0x05c1('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x05c1('0xd'));var as=require(_0x05c1('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x05c1('0xf'));var config=require(_0x05c1('0x10'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x05c1('0x11')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x05c1('0x11')]));require('./chatQueue.socket')[_0x05c1('0x12')](socket);var jayson=require('jayson/promise');var client=jayson[_0x05c1('0x13')]['http']({'port':0x232a});function respondWithRpcPromise(_0x83f51,_0x5f38c9,_0x2839ca,_0x7993dd){return new BPromise(function(_0x36bd4f,_0x838b48){var _0x405c3d=_0x7993dd||client;return _0x405c3d[_0x05c1('0x14')](_0x83f51,_0x2839ca)[_0x05c1('0x15')](function(_0x575b8d){logger[_0x05c1('0x16')](_0x05c1('0x17'),_0x5f38c9,_0x05c1('0x18'));logger['debug'](_0x05c1('0x19'),_0x5f38c9,'request\x20sent',JSON[_0x05c1('0x1a')](_0x575b8d));if(_0x575b8d[_0x05c1('0x1b')]){if(_0x575b8d[_0x05c1('0x1b')][_0x05c1('0x1c')]===0x1f4){logger[_0x05c1('0x1b')](_0x05c1('0x17'),_0x5f38c9,_0x575b8d[_0x05c1('0x1b')]['message']);return _0x838b48(_0x575b8d[_0x05c1('0x1b')]['message']);}logger['error'](_0x05c1('0x17'),_0x5f38c9,_0x575b8d[_0x05c1('0x1b')][_0x05c1('0x1d')]);return _0x36bd4f(_0x575b8d[_0x05c1('0x1b')]['message']);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x5f38c9,_0x05c1('0x18'));_0x36bd4f(_0x575b8d['result'][_0x05c1('0x1d')]);}})['catch'](function(_0x3175e6){logger['error'](_0x05c1('0x17'),_0x5f38c9,_0x3175e6);_0x838b48(_0x3175e6);});});}function respondWithStatusCode(_0x41720d,_0x4abc1d){_0x4abc1d=_0x4abc1d||0xcc;return function(_0x833a6b){if(_0x833a6b){return _0x41720d[_0x05c1('0x1e')](_0x4abc1d);}return _0x41720d[_0x05c1('0x1f')](_0x4abc1d)[_0x05c1('0x20')]();};}function respondWithResult(_0x1ef51f,_0x38237e){_0x38237e=_0x38237e||0xc8;return function(_0x39f1a7){if(_0x39f1a7){return _0x1ef51f[_0x05c1('0x1f')](_0x38237e)[_0x05c1('0x21')](_0x39f1a7);}};}function respondWithFilteredResult(_0x16d4c1,_0x4872e3){return function(_0x233577){if(_0x233577){var _0x239255=typeof _0x4872e3[_0x05c1('0x22')]==='undefined'&&typeof _0x4872e3[_0x05c1('0x23')]===_0x05c1('0x24');var _0x469d88=_0x233577[_0x05c1('0x25')];var _0x3a41a3=_0x239255?0x0:_0x4872e3['offset'];var _0x156e6c=_0x239255?_0x233577[_0x05c1('0x25')]:_0x4872e3[_0x05c1('0x22')]+_0x4872e3[_0x05c1('0x23')];var _0x1b8da3;if(_0x156e6c>=_0x469d88){_0x156e6c=_0x469d88;_0x1b8da3=0xc8;}else{_0x1b8da3=0xce;}_0x16d4c1[_0x05c1('0x1f')](_0x1b8da3);return _0x16d4c1[_0x05c1('0x26')](_0x05c1('0x27'),_0x3a41a3+'-'+_0x156e6c+'/'+_0x469d88)[_0x05c1('0x21')](_0x233577);}return null;};}function patchUpdates(_0x252e41){return function(_0x265467){try{jsonpatch[_0x05c1('0x28')](_0x265467,_0x252e41,!![]);}catch(_0x29e690){return BPromise[_0x05c1('0x29')](_0x29e690);}return _0x265467['save']();};}function saveUpdates(_0x587d47,_0x2d2805){return function(_0x22266d){if(_0x22266d){return _0x22266d[_0x05c1('0x2a')](_0x587d47)[_0x05c1('0x15')](function(_0x3c715e){return _0x3c715e;});}return null;};}function removeEntity(_0x61ca37,_0x1f9970){return function(_0x4e658b){if(_0x4e658b){return _0x4e658b[_0x05c1('0x2b')]()[_0x05c1('0x15')](function(){var _0x4c2f9c=_0x4e658b[_0x05c1('0x2c')]({'plain':!![]});var _0x420e60='ChatQueues';return db['UserProfileResource'][_0x05c1('0x2b')]({'where':{'type':_0x420e60,'resourceId':_0x4c2f9c['id']}})[_0x05c1('0x15')](function(){return _0x4e658b;});})[_0x05c1('0x15')](function(){_0x61ca37[_0x05c1('0x1f')](0xcc)[_0x05c1('0x20')]();});}};}function handleEntityNotFound(_0x9b3796,_0x3c139e){return function(_0x5fc8f1){if(!_0x5fc8f1){_0x9b3796[_0x05c1('0x1e')](0x194);}return _0x5fc8f1;};}function handleError(_0x1b20de,_0x2a4f34){_0x2a4f34=_0x2a4f34||0x1f4;return function(_0x113ce3){logger[_0x05c1('0x1b')](_0x113ce3[_0x05c1('0x2d')]);if(_0x113ce3[_0x05c1('0x2e')]){delete _0x113ce3[_0x05c1('0x2e')];}_0x1b20de[_0x05c1('0x1f')](_0x2a4f34)[_0x05c1('0x2f')](_0x113ce3);};}exports[_0x05c1('0x30')]=function(_0x57e7e3,_0x44be9f){var _0x24f2fe={},_0x45b7b3={},_0x35d855={'count':0x0,'rows':[]};var _0x359c56=_[_0x05c1('0x31')](db[_0x05c1('0x32')]['rawAttributes'],function(_0x4b3f7e){return{'name':_0x4b3f7e[_0x05c1('0x33')],'type':_0x4b3f7e[_0x05c1('0x34')][_0x05c1('0x35')]};});_0x45b7b3[_0x05c1('0x36')]=_['map'](_0x359c56,_0x05c1('0x2e'));_0x45b7b3['query']=_[_0x05c1('0x37')](_0x57e7e3[_0x05c1('0x38')]);_0x45b7b3['filters']=_[_0x05c1('0x39')](_0x45b7b3['model'],_0x45b7b3['query']);_0x24f2fe[_0x05c1('0x3a')]=_[_0x05c1('0x39')](_0x45b7b3[_0x05c1('0x36')],qs[_0x05c1('0x3b')](_0x57e7e3[_0x05c1('0x38')][_0x05c1('0x3b')]));_0x24f2fe[_0x05c1('0x3a')]=_0x24f2fe[_0x05c1('0x3a')][_0x05c1('0x3c')]?_0x24f2fe[_0x05c1('0x3a')]:_0x45b7b3[_0x05c1('0x36')];if(!_0x57e7e3['query'][_0x05c1('0x3d')](_0x05c1('0x3e'))){_0x24f2fe['limit']=qs[_0x05c1('0x23')](_0x57e7e3[_0x05c1('0x38')]['limit']);_0x24f2fe[_0x05c1('0x22')]=qs['offset'](_0x57e7e3[_0x05c1('0x38')]['offset']);}_0x24f2fe[_0x05c1('0x3f')]=qs[_0x05c1('0x40')](_0x57e7e3['query'][_0x05c1('0x40')]);_0x24f2fe[_0x05c1('0x41')]=qs[_0x05c1('0x42')](_[_0x05c1('0x43')](_0x57e7e3[_0x05c1('0x38')],_0x45b7b3[_0x05c1('0x42')]),_0x359c56);if(_0x57e7e3[_0x05c1('0x38')][_0x05c1('0x44')]){_0x24f2fe[_0x05c1('0x41')]=_[_0x05c1('0x45')](_0x24f2fe[_0x05c1('0x41')],{'$or':_[_0x05c1('0x31')](_0x359c56,function(_0x4d4db0){if(_0x4d4db0['type']!==_0x05c1('0x46')){var _0x129b04={};_0x129b04[_0x4d4db0[_0x05c1('0x2e')]]={'$like':'%'+_0x57e7e3[_0x05c1('0x38')]['filter']+'%'};return _0x129b04;}})});}_0x24f2fe=_[_0x05c1('0x45')]({},_0x24f2fe,_0x57e7e3[_0x05c1('0x47')]);var _0x21c562={'where':_0x24f2fe[_0x05c1('0x41')]};return db[_0x05c1('0x32')]['count'](_0x21c562)[_0x05c1('0x15')](function(_0xa16f77){_0x35d855[_0x05c1('0x25')]=_0xa16f77;if(_0x57e7e3['query'][_0x05c1('0x48')]){_0x24f2fe[_0x05c1('0x49')]=[{'all':!![]}];}return db[_0x05c1('0x32')][_0x05c1('0x4a')](_0x24f2fe);})[_0x05c1('0x15')](function(_0xf359d9){_0x35d855[_0x05c1('0x4b')]=_0xf359d9;return _0x35d855;})[_0x05c1('0x15')](respondWithFilteredResult(_0x44be9f,_0x24f2fe))[_0x05c1('0x4c')](handleError(_0x44be9f,null));};exports[_0x05c1('0x4d')]=function(_0x1dc4cb,_0x4bde06){var _0x2c0c6b={'raw':!![],'where':{'id':_0x1dc4cb[_0x05c1('0x4e')]['id']}},_0x916b07={};_0x916b07[_0x05c1('0x36')]=_['keys'](db[_0x05c1('0x32')][_0x05c1('0x4f')]);_0x916b07[_0x05c1('0x38')]=_[_0x05c1('0x37')](_0x1dc4cb[_0x05c1('0x38')]);_0x916b07[_0x05c1('0x42')]=_[_0x05c1('0x39')](_0x916b07[_0x05c1('0x36')],_0x916b07[_0x05c1('0x38')]);_0x2c0c6b[_0x05c1('0x3a')]=_['intersection'](_0x916b07[_0x05c1('0x36')],qs[_0x05c1('0x3b')](_0x1dc4cb['query'][_0x05c1('0x3b')]));_0x2c0c6b[_0x05c1('0x3a')]=_0x2c0c6b[_0x05c1('0x3a')]['length']?_0x2c0c6b[_0x05c1('0x3a')]:_0x916b07[_0x05c1('0x36')];if(_0x1dc4cb['query'][_0x05c1('0x48')]){_0x2c0c6b[_0x05c1('0x49')]=[{'all':!![]}];}_0x2c0c6b=_[_0x05c1('0x45')]({},_0x2c0c6b,_0x1dc4cb[_0x05c1('0x47')]);return db[_0x05c1('0x32')][_0x05c1('0x50')](_0x2c0c6b)[_0x05c1('0x15')](handleEntityNotFound(_0x4bde06,null))['then'](respondWithResult(_0x4bde06,null))[_0x05c1('0x4c')](handleError(_0x4bde06,null));};exports[_0x05c1('0x51')]=function(_0x106d18,_0x37fdd5){return db[_0x05c1('0x32')][_0x05c1('0x51')](_0x106d18[_0x05c1('0x52')],{})[_0x05c1('0x15')](function(_0x20d433){var _0x1dc0dd=_0x106d18[_0x05c1('0x53')]['get']({'plain':!![]});if(!_0x1dc0dd)throw new Error(_0x05c1('0x54'));if(_0x1dc0dd[_0x05c1('0x55')]===_0x05c1('0x53')){var _0x4628fb=_0x20d433[_0x05c1('0x2c')]({'plain':!![]});var _0x24f28f=_0x05c1('0x56');return db[_0x05c1('0x57')][_0x05c1('0x50')]({'where':{'name':_0x24f28f,'userProfileId':_0x1dc0dd[_0x05c1('0x58')]},'raw':!![]})[_0x05c1('0x15')](function(_0xccd1de){if(_0xccd1de&&_0xccd1de[_0x05c1('0x59')]===0x0){return db[_0x05c1('0x5a')][_0x05c1('0x51')]({'name':_0x4628fb[_0x05c1('0x2e')],'resourceId':_0x4628fb['id'],'type':_0xccd1de['name'],'sectionId':_0xccd1de['id']},{})[_0x05c1('0x15')](function(){return _0x20d433;});}else{return _0x20d433;}})[_0x05c1('0x4c')](function(_0x5514f9){logger[_0x05c1('0x1b')](_0x05c1('0x5b'),_0x5514f9);throw _0x5514f9;});}return _0x20d433;})['then'](respondWithResult(_0x37fdd5,0xc9))[_0x05c1('0x4c')](handleError(_0x37fdd5,null));};exports[_0x05c1('0x2a')]=function(_0x7cfc55,_0x372bb4){if(_0x7cfc55[_0x05c1('0x52')]['id']){delete _0x7cfc55[_0x05c1('0x52')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0x7cfc55['params']['id']}})[_0x05c1('0x15')](handleEntityNotFound(_0x372bb4,null))[_0x05c1('0x15')](saveUpdates(_0x7cfc55[_0x05c1('0x52')],null))[_0x05c1('0x15')](respondWithResult(_0x372bb4,null))[_0x05c1('0x4c')](handleError(_0x372bb4,null));};exports[_0x05c1('0x2b')]=function(_0x350c6e,_0x1f01f6){return db[_0x05c1('0x32')][_0x05c1('0x50')]({'where':{'id':_0x350c6e[_0x05c1('0x4e')]['id']}})[_0x05c1('0x15')](handleEntityNotFound(_0x1f01f6,null))[_0x05c1('0x15')](removeEntity(_0x1f01f6,null))['catch'](handleError(_0x1f01f6,null));};exports[_0x05c1('0x5c')]=function(_0x3cf522,_0x14fccd){return db['ChatQueue'][_0x05c1('0x5c')]()['then'](respondWithResult(_0x14fccd,null))[_0x05c1('0x4c')](handleError(_0x14fccd,null));};exports[_0x05c1('0x5d')]=function(_0x3e601d,_0x2d4327,_0x27fadf){var _0x2b5e1d={'raw':!![],'where':{}},_0x416541={},_0x3f06fc;return db[_0x05c1('0x32')][_0x05c1('0x5e')]({'where':{'id':_0x3e601d[_0x05c1('0x4e')]['id']}})[_0x05c1('0x15')](handleEntityNotFound(_0x2d4327,null))[_0x05c1('0x15')](function(_0x559a1a){if(_0x559a1a){_0x3f06fc=_0x559a1a[_0x05c1('0x2c')]({'plain':!![]});_0x416541[_0x05c1('0x36')]=_[_0x05c1('0x37')](db[_0x05c1('0x5f')][_0x05c1('0x4f')]);_0x416541[_0x05c1('0x38')]=_[_0x05c1('0x37')](_0x3e601d[_0x05c1('0x38')]);_0x416541['filters']=_[_0x05c1('0x39')](_0x416541[_0x05c1('0x36')],_0x416541[_0x05c1('0x38')]);_0x2b5e1d[_0x05c1('0x3a')]=_[_0x05c1('0x39')](_0x416541[_0x05c1('0x36')],qs[_0x05c1('0x3b')](_0x3e601d[_0x05c1('0x38')][_0x05c1('0x3b')]));_0x2b5e1d['attributes']=_0x2b5e1d[_0x05c1('0x3a')]['length']?_0x2b5e1d[_0x05c1('0x3a')]:_0x416541['model'];if(!_0x3e601d[_0x05c1('0x38')][_0x05c1('0x3d')](_0x05c1('0x3e'))){_0x2b5e1d['limit']=qs[_0x05c1('0x23')](_0x3e601d[_0x05c1('0x38')][_0x05c1('0x23')]);_0x2b5e1d['offset']=qs['offset'](_0x3e601d['query'][_0x05c1('0x22')]);}_0x2b5e1d[_0x05c1('0x3f')]=qs[_0x05c1('0x40')](_0x3e601d['query'][_0x05c1('0x40')]);_0x2b5e1d[_0x05c1('0x41')]=qs[_0x05c1('0x42')](_['pick'](_0x3e601d['query'],_0x416541[_0x05c1('0x42')]));_0x2b5e1d['where'][_0x05c1('0x60')]=_0x559a1a['id'];if(_0x3e601d['query']['filter']){_0x2b5e1d[_0x05c1('0x41')]=_[_0x05c1('0x45')](_0x2b5e1d[_0x05c1('0x41')],{'$or':_[_0x05c1('0x31')](_0x2b5e1d[_0x05c1('0x3a')],function(_0x3fa30b){var _0x1595d1={};_0x1595d1[_0x3fa30b]={'$like':'%'+_0x3e601d[_0x05c1('0x38')][_0x05c1('0x44')]+'%'};return _0x1595d1;})});}_0x2b5e1d=_[_0x05c1('0x45')]({},_0x2b5e1d,_0x3e601d[_0x05c1('0x47')]);return db['UserChatQueue'][_0x05c1('0x4a')](_0x2b5e1d);}})['then'](function(_0xf43f9b){if(_0xf43f9b){return db[_0x05c1('0x61')][_0x05c1('0x62')]({'where':{'id':_['map'](_0xf43f9b,_0x05c1('0x63')),'role':_0x05c1('0x64')},'attributes':['id',_0x05c1('0x2e'),_0x05c1('0x65'),_0x05c1('0x66'),_0x05c1('0x67')]});}})[_0x05c1('0x15')](function(_0x36fe84){if(_0x36fe84){return{'count':_0x36fe84[_0x05c1('0x25')],'rows':_['map'](_0x36fe84[_0x05c1('0x4b')],function(_0x4f25f9){return{'membername':_0x4f25f9[_0x05c1('0x2e')],'UserId':_0x4f25f9['id'],'queue_name':_0x3f06fc['name'],'ChatQueueId':_0x3f06fc['id'],'interface':util[_0x05c1('0x68')](_0x05c1('0x69'),_0x05c1('0x6a'),_0x4f25f9[_0x05c1('0x2e')]),'penalty':0x0,'paused':_0x4f25f9['chatPause'],'createdAt':_0x4f25f9[_0x05c1('0x67')],'updatedAt':_0x4f25f9[_0x05c1('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2d4327,_0x2b5e1d))[_0x05c1('0x4c')](handleError(_0x2d4327,null));};exports[_0x05c1('0x6b')]=function(_0xebbf8,_0x57b128,_0x1ad7a2){var _0x832685={};var _0x5a4628={};var _0x2863ab;var _0x1a9a4d;return db[_0x05c1('0x32')]['findOne']({'where':{'id':_0xebbf8[_0x05c1('0x4e')]['id']}})[_0x05c1('0x15')](handleEntityNotFound(_0x57b128,null))[_0x05c1('0x15')](function(_0x9fcfc5){if(_0x9fcfc5){_0x2863ab=_0x9fcfc5;_0x5a4628['model']=_[_0x05c1('0x37')](db[_0x05c1('0x6c')][_0x05c1('0x4f')]);_0x5a4628['query']=_[_0x05c1('0x37')](_0xebbf8[_0x05c1('0x38')]);_0x5a4628['filters']=_[_0x05c1('0x39')](_0x5a4628[_0x05c1('0x36')],_0x5a4628['query']);_0x832685[_0x05c1('0x3a')]=_[_0x05c1('0x39')](_0x5a4628[_0x05c1('0x36')],qs[_0x05c1('0x3b')](_0xebbf8[_0x05c1('0x38')]['fields']));_0x832685[_0x05c1('0x3a')]=_0x832685[_0x05c1('0x3a')]['length']?_0x832685[_0x05c1('0x3a')]:_0x5a4628[_0x05c1('0x36')];_0x832685[_0x05c1('0x3f')]=qs[_0x05c1('0x40')](_0xebbf8[_0x05c1('0x38')][_0x05c1('0x40')]);_0x832685['where']=qs[_0x05c1('0x42')](_[_0x05c1('0x43')](_0xebbf8['query'],_0x5a4628[_0x05c1('0x42')]));if(_0xebbf8[_0x05c1('0x38')]['filter']){_0x832685[_0x05c1('0x41')]=_[_0x05c1('0x45')](_0x832685['where'],{'$or':_[_0x05c1('0x31')](_0x832685[_0x05c1('0x3a')],function(_0x1e3beb){var _0x72ddd3={};_0x72ddd3[_0x1e3beb]={'$like':'%'+_0xebbf8[_0x05c1('0x38')][_0x05c1('0x44')]+'%'};return _0x72ddd3;})});}_0x832685=_[_0x05c1('0x45')]({},_0x832685,_0xebbf8[_0x05c1('0x47')]);return _0x2863ab[_0x05c1('0x6b')](_0x832685);}})[_0x05c1('0x15')](function(_0x52739b){if(_0x52739b){_0x1a9a4d=_0x52739b[_0x05c1('0x3c')];if(!_0xebbf8[_0x05c1('0x38')][_0x05c1('0x3d')](_0x05c1('0x3e'))){_0x832685[_0x05c1('0x23')]=qs['limit'](_0xebbf8[_0x05c1('0x38')][_0x05c1('0x23')]);_0x832685[_0x05c1('0x22')]=qs[_0x05c1('0x22')](_0xebbf8[_0x05c1('0x38')][_0x05c1('0x22')]);}return _0x2863ab[_0x05c1('0x6b')](_0x832685);}})[_0x05c1('0x15')](function(_0x30419c){if(_0x30419c){return _0x30419c?{'count':_0x1a9a4d,'rows':_0x30419c}:null;}})[_0x05c1('0x15')](respondWithResult(_0x57b128,null))[_0x05c1('0x4c')](handleError(_0x57b128,null));};exports[_0x05c1('0x6d')]=function(_0x5e83cc,_0x2e2a12,_0x334273){var _0x483350=_0x5e83cc[_0x05c1('0x52')][_0x05c1('0x6e')];return db[_0x05c1('0x6c')][_0x05c1('0x4a')]({'where':{'id':_0x483350},'attributes':['id'],'include':[{'model':db[_0x05c1('0x61')],'as':_0x05c1('0x6f'),'attributes':['id',_0x05c1('0x2e'),_0x05c1('0x70'),_0x05c1('0x71'),'interface'],'raw':!![]}]})[_0x05c1('0x15')](function(_0x10b734){if(_0x10b734){var _0x271200=_['flatMap'](_0x10b734,function(_0xfd66d7){var _0x17d933=_0xfd66d7[_0x05c1('0x2c')]({'plain':!![]});return _0x17d933[_0x05c1('0x6f')];});return db['ChatQueue']['find']({'where':{'id':_0x5e83cc[_0x05c1('0x4e')]['id']}})['then'](function(_0x54788d){return db[_0x05c1('0x72')][_0x05c1('0x73')](function(_0xb35018){return _0x54788d['addTeams'](_0x483350,{'transaction':_0xb35018})[_0x05c1('0x15')](function(){return BPromise[_0x05c1('0x74')](_0x271200,function(_0x246fd9){return db[_0x05c1('0x5f')][_0x05c1('0x75')]({'where':{'UserId':_0x246fd9['id'],'ChatQueueId':_0x5e83cc['params']['id']},'transaction':_0xb35018});});})['then'](function(){_0x271200['forEach'](function(_0x424e23){socket[_0x05c1('0x76')](_0x05c1('0x77'),{'UserId':_0x424e23['id'],'ChatQueueId':_0x54788d['id']});});});});});}})[_0x05c1('0x15')](respondWithStatusCode(_0x2e2a12,null))['catch'](handleError(_0x2e2a12,null));};exports[_0x05c1('0x78')]=function(_0x8d484a,_0x412846,_0x4e2975){return db[_0x05c1('0x6c')][_0x05c1('0x4a')]({'where':{'id':_0x8d484a[_0x05c1('0x38')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x05c1('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x05c1('0x15')](handleEntityNotFound(_0x412846,null))[_0x05c1('0x15')](function(_0xebe717){var _0x984e5e=_[_0x05c1('0x31')](_0xebe717,'id');var _0x5c0c79=[];var _0x4d0c9f=[];var _0x110823=squel[_0x05c1('0x79')]();_0x110823[_0x05c1('0x7a')](_0x05c1('0x7b'))[_0x05c1('0x7c')](_0x05c1('0x7d'),'tq')[_0x05c1('0x7e')](_0x05c1('0x7f'),'ut',_0x05c1('0x80'))['where']('ChatQueueId\x20=\x20?',_0x8d484a[_0x05c1('0x4e')]['id']);for(var _0x34ed34=0x0;_0x34ed34<_0xebe717[_0x05c1('0x3c')];_0x34ed34+=0x1){let _0x1acfec=_0xebe717[_0x34ed34];for(var _0x14eb5e=0x0;_0x14eb5e<_0x1acfec['Agents']['length'];_0x14eb5e+=0x1){let _0x348876=_0x1acfec['Agents'][_0x14eb5e];var _0x30fb28=_0x110823[_0x05c1('0x81')]();_0x30fb28[_0x05c1('0x41')](_0x05c1('0x82'),_0x348876['id']);_0x4d0c9f[_0x05c1('0x83')](db[_0x05c1('0x72')][_0x05c1('0x38')](_0x30fb28[_0x05c1('0x84')](),{'type':db[_0x05c1('0x72')]['QueryTypes']['SELECT']})[_0x05c1('0x15')](function(_0x1ec977){if(_0x1ec977['length']===0x1){return _0x348876['id'];}else{var _0x55159c=_[_0x05c1('0x85')](_[_0x05c1('0x31')](_0x1ec977,_0x05c1('0x86')),function(_0x394cc6){return _[_0x05c1('0x87')](_0x984e5e,_0x394cc6);});if(_0x55159c){return _0x348876['id'];}}}));}}return BPromise[_0x05c1('0x88')](_0x4d0c9f)[_0x05c1('0x15')](function(_0x132b8a){_0x5c0c79=_(_0x5c0c79)['union'](_0x132b8a)['compact']()[_0x05c1('0x89')]();return db[_0x05c1('0x32')]['find']({'where':{'id':_0x8d484a[_0x05c1('0x4e')]['id']}})['then'](function(_0x3803f6){return db[_0x05c1('0x72')][_0x05c1('0x73')](function(_0x1c54a5){return _0x3803f6[_0x05c1('0x78')](_0x8d484a['query'][_0x05c1('0x6e')],{'transaction':_0x1c54a5})[_0x05c1('0x15')](function(){if(!_['isEmpty'](_0x5c0c79)){return _0x3803f6[_0x05c1('0x8a')](_0x5c0c79,{'transaction':_0x1c54a5});}})['then'](function(){_0x5c0c79[_0x05c1('0x8b')](function(_0x1ca6ff){socket[_0x05c1('0x76')](_0x05c1('0x8c'),{'UserId':_0x1ca6ff,'ChatQueueId':_0x3803f6['id']});});});});});});})[_0x05c1('0x15')](respondWithStatusCode(_0x412846,null))[_0x05c1('0x4c')](handleError(_0x412846,null));};exports[_0x05c1('0x8d')]=function(_0x29e749,_0x5643ac,_0x318abc){return db[_0x05c1('0x32')]['find']({'where':{'id':_0x29e749[_0x05c1('0x4e')]['id']}})[_0x05c1('0x15')](handleEntityNotFound(_0x5643ac,null))[_0x05c1('0x15')](function(_0x46522e){if(_0x46522e){return _0x46522e['addAgents'](_0x29e749['body'][_0x05c1('0x6e')],_[_0x05c1('0x8e')](_0x29e749[_0x05c1('0x52')],[_0x05c1('0x6e'),'id'])||{})[_0x05c1('0x8f')](function(_0x8c8e8f){for(var _0x5e65ff=0x0;_0x5e65ff<_0x29e749[_0x05c1('0x52')][_0x05c1('0x6e')][_0x05c1('0x3c')];_0x5e65ff+=0x1){socket[_0x05c1('0x76')](_0x05c1('0x77'),{'UserId':Number(_0x29e749['body'][_0x05c1('0x6e')][_0x5e65ff]),'ChatQueueId':Number(_0x29e749['params']['id'])});}return _0x8c8e8f;});}})['then'](respondWithResult(_0x5643ac,null))[_0x05c1('0x4c')](handleError(_0x5643ac,null));};exports[_0x05c1('0x8a')]=function(_0x2c4b6e,_0x48092f,_0x4826a6){return db[_0x05c1('0x32')][_0x05c1('0x50')]({'where':{'id':_0x2c4b6e[_0x05c1('0x4e')]['id']}})[_0x05c1('0x15')](handleEntityNotFound(_0x48092f,null))[_0x05c1('0x15')](function(_0x5b389e){if(_0x5b389e){return _0x5b389e[_0x05c1('0x8a')](_0x2c4b6e[_0x05c1('0x38')][_0x05c1('0x6e')])[_0x05c1('0x15')](function(){if(_[_0x05c1('0x90')](_0x2c4b6e[_0x05c1('0x38')][_0x05c1('0x6e')])){for(var _0x107b54=0x0;_0x107b54<_0x2c4b6e[_0x05c1('0x38')]['ids'][_0x05c1('0x3c')];_0x107b54+=0x1){socket['emit'](_0x05c1('0x8c'),{'UserId':Number(_0x2c4b6e[_0x05c1('0x38')][_0x05c1('0x6e')][_0x107b54]),'ChatQueueId':Number(_0x2c4b6e[_0x05c1('0x4e')]['id'])});}}else{socket[_0x05c1('0x76')](_0x05c1('0x8c'),{'UserId':Number(_0x2c4b6e[_0x05c1('0x38')][_0x05c1('0x6e')]),'ChatQueueId':Number(_0x2c4b6e[_0x05c1('0x4e')]['id'])});}});}})['then'](respondWithStatusCode(_0x48092f,null))[_0x05c1('0x4c')](handleError(_0x48092f,null));};exports[_0x05c1('0x91')]=function(_0x1778ba,_0x38bb2b,_0x3d6651){var _0x3fcf41={};var _0x1bcc87={};var _0xe70001;var _0x568a9d;return db[_0x05c1('0x32')]['findOne']({'where':{'id':_0x1778ba[_0x05c1('0x4e')]['id']}})[_0x05c1('0x15')](handleEntityNotFound(_0x38bb2b,null))[_0x05c1('0x15')](function(_0x2c06e9){if(_0x2c06e9){_0xe70001=_0x2c06e9;_0x1bcc87[_0x05c1('0x36')]=_['keys'](db[_0x05c1('0x61')][_0x05c1('0x4f')]);_0x1bcc87[_0x05c1('0x38')]=_['keys'](_0x1778ba['query']);_0x1bcc87['filters']=_['intersection'](_0x1bcc87[_0x05c1('0x36')],_0x1bcc87[_0x05c1('0x38')]);_0x3fcf41['attributes']=_[_0x05c1('0x39')](_0x1bcc87[_0x05c1('0x36')],qs[_0x05c1('0x3b')](_0x1778ba[_0x05c1('0x38')]['fields']));_0x3fcf41[_0x05c1('0x3a')]=_0x3fcf41[_0x05c1('0x3a')][_0x05c1('0x3c')]?_0x3fcf41[_0x05c1('0x3a')]:_0x1bcc87[_0x05c1('0x36')];_0x3fcf41[_0x05c1('0x3f')]=qs['sort'](_0x1778ba['query'][_0x05c1('0x40')]);_0x3fcf41[_0x05c1('0x41')]=qs[_0x05c1('0x42')](_[_0x05c1('0x43')](_0x1778ba['query'],_0x1bcc87[_0x05c1('0x42')]));if(_0x1778ba[_0x05c1('0x38')][_0x05c1('0x44')]){_0x3fcf41[_0x05c1('0x41')]=_[_0x05c1('0x45')](_0x3fcf41[_0x05c1('0x41')],{'$or':_[_0x05c1('0x31')](_0x3fcf41['attributes'],function(_0x3fe1ed){var _0x4344ff={};_0x4344ff[_0x3fe1ed]={'$like':'%'+_0x1778ba[_0x05c1('0x38')][_0x05c1('0x44')]+'%'};return _0x4344ff;})});}_0x3fcf41=_[_0x05c1('0x45')]({},_0x3fcf41,_0x1778ba[_0x05c1('0x47')]);return _0xe70001[_0x05c1('0x91')](_0x3fcf41);}})['then'](function(_0x4001c6){if(_0x4001c6){_0x568a9d=_0x4001c6[_0x05c1('0x3c')];if(!_0x1778ba[_0x05c1('0x38')]['hasOwnProperty'](_0x05c1('0x3e'))){_0x3fcf41[_0x05c1('0x23')]=qs[_0x05c1('0x23')](_0x1778ba['query']['limit']);_0x3fcf41['offset']=qs[_0x05c1('0x22')](_0x1778ba[_0x05c1('0x38')][_0x05c1('0x22')]);}return _0xe70001[_0x05c1('0x91')](_0x3fcf41);}})[_0x05c1('0x15')](function(_0x4a1c5a){if(_0x4a1c5a){return _0x4a1c5a?{'count':_0x568a9d,'rows':_0x4a1c5a}:null;}})['then'](respondWithResult(_0x38bb2b,null))[_0x05c1('0x4c')](handleError(_0x38bb2b,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 13d820e..4e85683 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 _0x0b64=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatQueue','save'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x0b64,0x9d));var _0x40b6=function(_0x2c861b,_0x15b01c){_0x2c861b=_0x2c861b-0x0;var _0x2f57f4=_0x0b64[_0x2c861b];return _0x2f57f4;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x40b6('0x0'))['db'][_0x40b6('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x40b6('0x2'),'afterUpdate':_0x40b6('0x3'),'afterDestroy':'remove'};function emitEvent(_0x950296){return function(_0xc1068a,_0x274cd4,_0xa7098a){ChatQueueEvents[_0x40b6('0x4')](_0x950296+':'+_0xc1068a['id'],_0xc1068a);ChatQueueEvents[_0x40b6('0x4')](_0x950296,_0xc1068a);_0xa7098a(null);};}for(var e in events){if(events[_0x40b6('0x5')](e)){var event=events[e];ChatQueue[_0x40b6('0x6')](e,emitEvent(event));}}module[_0x40b6('0x7')]=ChatQueueEvents;
\ No newline at end of file
+var _0x36b9=['ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','events'];(function(_0x1cca56,_0x5e0aa0){var _0xe8ceed=function(_0x59a59c){while(--_0x59a59c){_0x1cca56['push'](_0x1cca56['shift']());}};_0xe8ceed(++_0x5e0aa0);}(_0x36b9,0xe7));var _0x936b=function(_0x338661,_0x9d526c){_0x338661=_0x338661-0x0;var _0x32ca43=_0x36b9[_0x338661];return _0x32ca43;};'use strict';var EventEmitter=require(_0x936b('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x936b('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x936b('0x2')](0x0);var events={'afterCreate':_0x936b('0x3'),'afterUpdate':_0x936b('0x4'),'afterDestroy':_0x936b('0x5')};function emitEvent(_0x4b4226){return function(_0x23a549,_0x24f9d7,_0x17e2a4){ChatQueueEvents[_0x936b('0x6')](_0x4b4226+':'+_0x23a549['id'],_0x23a549);ChatQueueEvents[_0x936b('0x6')](_0x4b4226,_0x23a549);_0x17e2a4(null);};}for(var e in events){if(events[_0x936b('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 92af8cd..e9180bc 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 _0x7a3d=['bluebird','request-promise','rimraf','../../config/environment','exports','util','api','moment'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x7a3d,0x1bd));var _0xd7a3=function(_0x2eb066,_0x2cd4c4){_0x2eb066=_0x2eb066-0x0;var _0x5c87e6=_0x7a3d[_0x2eb066];return _0x5c87e6;};'use strict';var _=require('lodash');var util=require(_0xd7a3('0x0'));var logger=require('../../config/logger')(_0xd7a3('0x1'));var moment=require(_0xd7a3('0x2'));var BPromise=require(_0xd7a3('0x3'));var rp=require(_0xd7a3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd7a3('0x5'));var config=require(_0xd7a3('0x6'));var attributes=require('./chatQueue.attributes');module[_0xd7a3('0x7')]=function(_0x2e8717,_0x1752fc){return _0x2e8717['define']('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1f9f=['define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports'];(function(_0x48168a,_0xf9dfe5){var _0x346d98=function(_0x22e41f){while(--_0x22e41f){_0x48168a['push'](_0x48168a['shift']());}};_0x346d98(++_0xf9dfe5);}(_0x1f9f,0x102));var _0xf1f9=function(_0x40b43c,_0x269319){_0x40b43c=_0x40b43c-0x0;var _0x1d31b7=_0x1f9f[_0x40b43c];return _0x1d31b7;};'use strict';var _=require(_0xf1f9('0x0'));var util=require(_0xf1f9('0x1'));var logger=require(_0xf1f9('0x2'))(_0xf1f9('0x3'));var moment=require(_0xf1f9('0x4'));var BPromise=require(_0xf1f9('0x5'));var rp=require(_0xf1f9('0x6'));var fs=require('fs');var path=require(_0xf1f9('0x7'));var rimraf=require(_0xf1f9('0x8'));var config=require(_0xf1f9('0x9'));var attributes=require(_0xf1f9('0xa'));module[_0xf1f9('0xb')]=function(_0x3ca706,_0x2169c4){return _0x3ca706[_0xf1f9('0xc')](_0xf1f9('0xd'),attributes,{'tableName':_0xf1f9('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 2eb3372..1dbbbdb 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 _0xdc25=['code','ChatQueue,\x20%s,\x20%s','message','catch','GetChatQueue','ChatQueue','findAll','options','where','include','map','model','attributes','then','debug','ShowChatQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','info','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x10c814,_0x2c5349){var _0x3620e8=function(_0x2da52a){while(--_0x2da52a){_0x10c814['push'](_0x10c814['shift']());}};_0x3620e8(++_0x2c5349);}(_0xdc25,0x128));var _0x5dc2=function(_0x3d8005,_0x2a097e){_0x3d8005=_0x3d8005-0x0;var _0x1f3563=_0xdc25[_0x3d8005];return _0x1f3563;};'use strict';var _=require(_0x5dc2('0x0'));var util=require(_0x5dc2('0x1'));var moment=require(_0x5dc2('0x2'));var BPromise=require(_0x5dc2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5dc2('0x4'));var db=require(_0x5dc2('0x5'))['db'];var utils=require(_0x5dc2('0x6'));var logger=require(_0x5dc2('0x7'))(_0x5dc2('0x8'));var config=require(_0x5dc2('0x9'));var jayson=require(_0x5dc2('0xa'));var client=jayson[_0x5dc2('0xb')][_0x5dc2('0xc')]({'port':0x232a});config[_0x5dc2('0xd')]=_[_0x5dc2('0xe')](config[_0x5dc2('0xd')],{'host':_0x5dc2('0xf'),'port':0x18eb});var socket=require(_0x5dc2('0x10'))(new Redis(config['redis']));require(_0x5dc2('0x11'))['register'](socket);function respondWithRpcPromise(_0x10133e,_0x3ef210,_0x280171){return new BPromise(function(_0x513d9d,_0x3724fd){return client[_0x5dc2('0x12')](_0x10133e,_0x280171)['then'](function(_0x2c7a15){logger[_0x5dc2('0x13')]('ChatQueue,\x20%s,\x20%s',_0x3ef210,'request\x20sent');logger['debug'](_0x5dc2('0x14'),_0x3ef210,_0x5dc2('0x15'),JSON[_0x5dc2('0x16')](_0x2c7a15));if(_0x2c7a15[_0x5dc2('0x17')]){if(_0x2c7a15[_0x5dc2('0x17')][_0x5dc2('0x18')]===0x1f4){logger['error'](_0x5dc2('0x19'),_0x3ef210,_0x2c7a15['error'][_0x5dc2('0x1a')]);return _0x3724fd(_0x2c7a15[_0x5dc2('0x17')][_0x5dc2('0x1a')]);}logger[_0x5dc2('0x17')](_0x5dc2('0x19'),_0x3ef210,_0x2c7a15[_0x5dc2('0x17')][_0x5dc2('0x1a')]);return _0x513d9d(_0x2c7a15[_0x5dc2('0x17')]['message']);}else{logger[_0x5dc2('0x13')](_0x5dc2('0x19'),_0x3ef210,_0x5dc2('0x15'));_0x513d9d(_0x2c7a15['result'][_0x5dc2('0x1a')]);}})[_0x5dc2('0x1b')](function(_0x42d9ae){logger['error'](_0x5dc2('0x19'),_0x3ef210,_0x42d9ae);_0x3724fd(_0x42d9ae);});});}exports[_0x5dc2('0x1c')]=function(_0x3b2a67){var _0xcea44a=this;return new Promise(function(_0x596a24,_0xa92a14){return db[_0x5dc2('0x1d')][_0x5dc2('0x1e')]({'raw':_0x3b2a67[_0x5dc2('0x1f')]?_0x3b2a67[_0x5dc2('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x3b2a67[_0x5dc2('0x1f')]?_0x3b2a67[_0x5dc2('0x1f')][_0x5dc2('0x20')]||null:null,'attributes':_0x3b2a67['options']?_0x3b2a67[_0x5dc2('0x1f')]['attributes']||null:null,'limit':_0x3b2a67[_0x5dc2('0x1f')]?_0x3b2a67[_0x5dc2('0x1f')]['limit']||null:null,'include':_0x3b2a67['options']?_0x3b2a67['options'][_0x5dc2('0x21')]?_[_0x5dc2('0x22')](_0x3b2a67[_0x5dc2('0x1f')]['include'],function(_0xa43df2){return{'model':db[_0xa43df2[_0x5dc2('0x23')]],'as':_0xa43df2['as'],'attributes':_0xa43df2['attributes'],'include':_0xa43df2[_0x5dc2('0x21')]?_[_0x5dc2('0x22')](_0xa43df2['include'],function(_0x100db4){return{'model':db[_0x100db4[_0x5dc2('0x23')]],'as':_0x100db4['as'],'attributes':_0x100db4[_0x5dc2('0x24')],'include':_0x100db4['include']?_[_0x5dc2('0x22')](_0x100db4[_0x5dc2('0x21')],function(_0x7e8a44){return{'model':db[_0x7e8a44[_0x5dc2('0x23')]],'as':_0x7e8a44['as'],'attributes':_0x7e8a44[_0x5dc2('0x24')]};}):[]};}):[]};}):[]:[]})[_0x5dc2('0x25')](function(_0xd641b3){logger[_0x5dc2('0x13')]('GetChatQueue',_0x3b2a67);logger[_0x5dc2('0x26')](_0x5dc2('0x1c'),_0x3b2a67,JSON[_0x5dc2('0x16')](_0xd641b3));_0x596a24(_0xd641b3);})[_0x5dc2('0x1b')](function(_0x3c7dbc){logger[_0x5dc2('0x17')](_0x5dc2('0x1c'),_0x3c7dbc[_0x5dc2('0x1a')],_0x3b2a67);_0xa92a14(_0xcea44a[_0x5dc2('0x17')](0x1f4,_0x3c7dbc['message']));});});};exports['ShowChatQueue']=function(_0x46de8f){var _0x599171=this;return new Promise(function(_0x22f6c6,_0x1470c8){return db[_0x5dc2('0x1d')]['find']({'raw':_0x46de8f[_0x5dc2('0x1f')]?_0x46de8f[_0x5dc2('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x46de8f['options']?_0x46de8f[_0x5dc2('0x1f')]['where']||null:null,'attributes':_0x46de8f['options']?_0x46de8f['options']['attributes']||null:null,'include':_0x46de8f[_0x5dc2('0x1f')]?_0x46de8f['options']['include']?_[_0x5dc2('0x22')](_0x46de8f['options'][_0x5dc2('0x21')],function(_0x2e16ed){return{'model':db[_0x2e16ed[_0x5dc2('0x23')]],'as':_0x2e16ed['as'],'attributes':_0x2e16ed['attributes'],'include':_0x2e16ed['include']?_['map'](_0x2e16ed[_0x5dc2('0x21')],function(_0x4ae354){return{'model':db[_0x4ae354[_0x5dc2('0x23')]],'as':_0x4ae354['as'],'attributes':_0x4ae354['attributes'],'include':_0x4ae354['include']?_[_0x5dc2('0x22')](_0x4ae354['include'],function(_0x1f1f8e){return{'model':db[_0x1f1f8e[_0x5dc2('0x23')]],'as':_0x1f1f8e['as'],'attributes':_0x1f1f8e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x569889){logger[_0x5dc2('0x13')](_0x5dc2('0x27'),_0x46de8f);logger[_0x5dc2('0x26')]('ShowChatQueue',_0x46de8f,JSON[_0x5dc2('0x16')](_0x569889));_0x22f6c6(_0x569889);})['catch'](function(_0x75491c){logger[_0x5dc2('0x17')](_0x5dc2('0x27'),_0x75491c[_0x5dc2('0x1a')],_0x46de8f);_0x1470c8(_0x599171['error'](0x1f4,_0x75491c[_0x5dc2('0x1a')]));});});};
\ No newline at end of file
+var _0x0d74=['jayson/promise','defaults','localhost','socket.io-emitter','./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','options','raw','where','attributes','limit','include','map','model','ShowChatQueue','ChatQueue','find','lodash','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0xb0ef6,_0x53cd27){var _0x30a8ff=function(_0x1df3c3){while(--_0x1df3c3){_0xb0ef6['push'](_0xb0ef6['shift']());}};_0x30a8ff(++_0x53cd27);}(_0x0d74,0x146));var _0x40d7=function(_0x291dc6,_0x1109ff){_0x291dc6=_0x291dc6-0x0;var _0x54d7cc=_0x0d74[_0x291dc6];return _0x54d7cc;};'use strict';var _=require(_0x40d7('0x0'));var util=require(_0x40d7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x40d7('0x2'));var fs=require('fs');var Redis=require(_0x40d7('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x40d7('0x4'))(_0x40d7('0x5'));var config=require(_0x40d7('0x6'));var jayson=require(_0x40d7('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x40d7('0x8')](config['redis'],{'host':_0x40d7('0x9'),'port':0x18eb});var socket=require(_0x40d7('0xa'))(new Redis(config['redis']));require(_0x40d7('0xb'))[_0x40d7('0xc')](socket);function respondWithRpcPromise(_0x354f80,_0x2bae78,_0xcb37e3){return new BPromise(function(_0x517d88,_0x5208be){return client[_0x40d7('0xd')](_0x354f80,_0xcb37e3)[_0x40d7('0xe')](function(_0x229937){logger[_0x40d7('0xf')](_0x40d7('0x10'),_0x2bae78,'request\x20sent');logger[_0x40d7('0x11')](_0x40d7('0x12'),_0x2bae78,_0x40d7('0x13'),JSON[_0x40d7('0x14')](_0x229937));if(_0x229937['error']){if(_0x229937[_0x40d7('0x15')][_0x40d7('0x16')]===0x1f4){logger[_0x40d7('0x15')](_0x40d7('0x10'),_0x2bae78,_0x229937[_0x40d7('0x15')][_0x40d7('0x17')]);return _0x5208be(_0x229937[_0x40d7('0x15')][_0x40d7('0x17')]);}logger[_0x40d7('0x15')]('ChatQueue,\x20%s,\x20%s',_0x2bae78,_0x229937['error']['message']);return _0x517d88(_0x229937[_0x40d7('0x15')][_0x40d7('0x17')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x2bae78,_0x40d7('0x13'));_0x517d88(_0x229937['result']['message']);}})[_0x40d7('0x18')](function(_0x22de5a){logger[_0x40d7('0x15')](_0x40d7('0x10'),_0x2bae78,_0x22de5a);_0x5208be(_0x22de5a);});});}exports[_0x40d7('0x19')]=function(_0x28bbc0){var _0x3d2afa=this;return new Promise(function(_0x3ec437,_0x5eb3c1){return db['ChatQueue']['findAll']({'raw':_0x28bbc0[_0x40d7('0x1a')]?_0x28bbc0['options'][_0x40d7('0x1b')]===undefined?!![]:![]:!![],'where':_0x28bbc0[_0x40d7('0x1a')]?_0x28bbc0[_0x40d7('0x1a')][_0x40d7('0x1c')]||null:null,'attributes':_0x28bbc0[_0x40d7('0x1a')]?_0x28bbc0[_0x40d7('0x1a')][_0x40d7('0x1d')]||null:null,'limit':_0x28bbc0[_0x40d7('0x1a')]?_0x28bbc0[_0x40d7('0x1a')][_0x40d7('0x1e')]||null:null,'include':_0x28bbc0[_0x40d7('0x1a')]?_0x28bbc0['options'][_0x40d7('0x1f')]?_[_0x40d7('0x20')](_0x28bbc0[_0x40d7('0x1a')][_0x40d7('0x1f')],function(_0x528ab5){return{'model':db[_0x528ab5['model']],'as':_0x528ab5['as'],'attributes':_0x528ab5[_0x40d7('0x1d')],'include':_0x528ab5['include']?_['map'](_0x528ab5[_0x40d7('0x1f')],function(_0x1ef074){return{'model':db[_0x1ef074[_0x40d7('0x21')]],'as':_0x1ef074['as'],'attributes':_0x1ef074[_0x40d7('0x1d')],'include':_0x1ef074['include']?_['map'](_0x1ef074[_0x40d7('0x1f')],function(_0x2b5f11){return{'model':db[_0x2b5f11[_0x40d7('0x21')]],'as':_0x2b5f11['as'],'attributes':_0x2b5f11['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1102d3){logger[_0x40d7('0xf')]('GetChatQueue',_0x28bbc0);logger[_0x40d7('0x11')](_0x40d7('0x19'),_0x28bbc0,JSON[_0x40d7('0x14')](_0x1102d3));_0x3ec437(_0x1102d3);})[_0x40d7('0x18')](function(_0x555a3b){logger['error'](_0x40d7('0x19'),_0x555a3b[_0x40d7('0x17')],_0x28bbc0);_0x5eb3c1(_0x3d2afa[_0x40d7('0x15')](0x1f4,_0x555a3b[_0x40d7('0x17')]));});});};exports[_0x40d7('0x22')]=function(_0x4a2bc2){var _0x23e560=this;return new Promise(function(_0x5af456,_0x22edd1){return db[_0x40d7('0x23')][_0x40d7('0x24')]({'raw':_0x4a2bc2['options']?_0x4a2bc2[_0x40d7('0x1a')][_0x40d7('0x1b')]===undefined?!![]:![]:!![],'where':_0x4a2bc2[_0x40d7('0x1a')]?_0x4a2bc2[_0x40d7('0x1a')][_0x40d7('0x1c')]||null:null,'attributes':_0x4a2bc2[_0x40d7('0x1a')]?_0x4a2bc2[_0x40d7('0x1a')]['attributes']||null:null,'include':_0x4a2bc2[_0x40d7('0x1a')]?_0x4a2bc2[_0x40d7('0x1a')][_0x40d7('0x1f')]?_[_0x40d7('0x20')](_0x4a2bc2[_0x40d7('0x1a')][_0x40d7('0x1f')],function(_0x1e6f08){return{'model':db[_0x1e6f08[_0x40d7('0x21')]],'as':_0x1e6f08['as'],'attributes':_0x1e6f08['attributes'],'include':_0x1e6f08['include']?_[_0x40d7('0x20')](_0x1e6f08[_0x40d7('0x1f')],function(_0x4902a1){return{'model':db[_0x4902a1['model']],'as':_0x4902a1['as'],'attributes':_0x4902a1['attributes'],'include':_0x4902a1[_0x40d7('0x1f')]?_['map'](_0x4902a1[_0x40d7('0x1f')],function(_0x56b17c){return{'model':db[_0x56b17c[_0x40d7('0x21')]],'as':_0x56b17c['as'],'attributes':_0x56b17c[_0x40d7('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x40d7('0xe')](function(_0x2e4ccb){logger[_0x40d7('0xf')]('ShowChatQueue',_0x4a2bc2);logger[_0x40d7('0x11')](_0x40d7('0x22'),_0x4a2bc2,JSON[_0x40d7('0x14')](_0x2e4ccb));_0x5af456(_0x2e4ccb);})[_0x40d7('0x18')](function(_0x21a675){logger['error']('ShowChatQueue',_0x21a675['message'],_0x4a2bc2);_0x22edd1(_0x23e560[_0x40d7('0x15')](0x1f4,_0x21a675['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 51a9a1d..295b412 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 _0xb7c8=['chatQueue:','save','remove','update','emit','removeListener','register','length'];(function(_0x114590,_0x592c84){var _0x5d4db5=function(_0x48920d){while(--_0x48920d){_0x114590['push'](_0x114590['shift']());}};_0x5d4db5(++_0x592c84);}(_0xb7c8,0x119));var _0x8b7c=function(_0xb3b23f,_0x4afa3f){_0xb3b23f=_0xb3b23f-0x0;var _0x2404e6=_0xb7c8[_0xb3b23f];return _0x2404e6;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x8b7c('0x0'),_0x8b7c('0x1'),_0x8b7c('0x2')];function createListener(_0x3a84fc,_0x1dceff){return function(_0x31ad24){_0x1dceff[_0x8b7c('0x3')](_0x3a84fc,_0x31ad24);};}function removeListener(_0x50113e,_0x38672b){return function(){ChatQueueEvents[_0x8b7c('0x4')](_0x50113e,_0x38672b);};}exports[_0x8b7c('0x5')]=function(_0x440900){for(var _0x107428=0x0,_0x12665c=events[_0x8b7c('0x6')];_0x107428<_0x12665c;_0x107428++){var _0x3c8fd6=events[_0x107428];var _0x6afb55=createListener(_0x8b7c('0x7')+_0x3c8fd6,_0x440900);ChatQueueEvents['on'](_0x3c8fd6,_0x6afb55);}};
\ No newline at end of file
+var _0xadb8=['emit','removeListener','length','chatQueue:','remove'];(function(_0x4fe19c,_0x45d0fe){var _0x952ac7=function(_0x274a16){while(--_0x274a16){_0x4fe19c['push'](_0x4fe19c['shift']());}};_0x952ac7(++_0x45d0fe);}(_0xadb8,0x1d0));var _0x8adb=function(_0x20aae1,_0x51efd4){_0x20aae1=_0x20aae1-0x0;var _0x510601=_0xadb8[_0x20aae1];return _0x510601;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0x8adb('0x0'),'update'];function createListener(_0x2b8a76,_0x2a0b30){return function(_0x24f912){_0x2a0b30[_0x8adb('0x1')](_0x2b8a76,_0x24f912);};}function removeListener(_0x44fdf7,_0x2baedb){return function(){ChatQueueEvents[_0x8adb('0x2')](_0x44fdf7,_0x2baedb);};}exports['register']=function(_0x15bc63){for(var _0x1a5f36=0x0,_0x9f435=events[_0x8adb('0x3')];_0x1a5f36<_0x9f435;_0x1a5f36++){var _0x271bed=events[_0x1a5f36];var _0x16b932=createListener(_0x8adb('0x4')+_0x271bed,_0x15bc63);ChatQueueEvents['on'](_0x271bed,_0x16b932);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 2ec4838..e0be9cc 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x58c044,_0x1e781d){var _0xf763ac=function(_0x8c0b97){while(--_0x8c0b97){_0x58c044['push'](_0x58c044['shift']());}};_0xf763ac(++_0x1e781d);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x4237da,_0x48b1fd){var _0x343b83=function(_0x515574){while(--_0x515574){_0x4237da['push'](_0x4237da['shift']());}};_0x343b83(++_0x48b1fd);}(_0xe14b,0x93));var _0xbe14=function(_0x4269bc,_0x5a094c){_0x4269bc=_0x4269bc-0x0;var _0x53b296=_0xe14b[_0x4269bc];return _0x53b296;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index c80de0b..c9b48f8 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 _0x27c0=['sequelize','STRING','DATE','moment'];(function(_0x3fe393,_0x234a3a){var _0x534d14=function(_0x277fab){while(--_0x277fab){_0x3fe393['push'](_0x3fe393['shift']());}};_0x534d14(++_0x234a3a);}(_0x27c0,0x1bb));var _0x027c=function(_0x22f082,_0x40fee4){_0x22f082=_0x22f082-0x0;var _0x66507b=_0x27c0[_0x22f082];return _0x66507b;};'use strict';var moment=require(_0x027c('0x0'));var Sequelize=require(_0x027c('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x027c('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x027c('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x027c('0x3')]},'exitAt':{'type':Sequelize[_0x027c('0x3')]},'reason':{'type':Sequelize[_0x027c('0x2')]}};
\ No newline at end of file
+var _0xe1e4=['STRING','DATE','moment','sequelize'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xe1e4,0x18e));var _0x4e1e=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xe1e4[_0x599f41];return _0x2e4d58;};'use strict';var moment=require(_0x4e1e('0x0'));var Sequelize=require(_0x4e1e('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x4e1e('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x4e1e('0x2')]},'joinAt':{'type':Sequelize[_0x4e1e('0x3')]},'leaveAt':{'type':Sequelize[_0x4e1e('0x3')]},'acceptAt':{'type':Sequelize[_0x4e1e('0x3')]},'exitAt':{'type':Sequelize[_0x4e1e('0x3')]},'reason':{'type':Sequelize[_0x4e1e('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 392a32c..d2217b4 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 _0xac6a=['apply','reject','save','then','sendStatus','name','send','index','ChatQueueReport','rawAttributes','fieldName','type','map','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','filter','where','merge','options','findAll','rows','show','params','keys','includeAll','include','catch','create','body','update','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range'];(function(_0x21b359,_0x4dc80e){var _0x57b8e7=function(_0x135adb){while(--_0x135adb){_0x21b359['push'](_0x21b359['shift']());}};_0x57b8e7(++_0x4dc80e);}(_0xac6a,0xc2));var _0xaac6=function(_0x96012a,_0x557faa){_0x96012a=_0x96012a-0x0;var _0x22c728=_0xac6a[_0x96012a];return _0x22c728;};'use strict';var emlformat=require(_0xaac6('0x0'));var rimraf=require(_0xaac6('0x1'));var zipdir=require(_0xaac6('0x2'));var jsonpatch=require(_0xaac6('0x3'));var rp=require(_0xaac6('0x4'));var moment=require('moment');var BPromise=require(_0xaac6('0x5'));var Mustache=require('mustache');var util=require(_0xaac6('0x6'));var path=require(_0xaac6('0x7'));var sox=require(_0xaac6('0x8'));var csv=require(_0xaac6('0x9'));var ejs=require(_0xaac6('0xa'));var fs=require('fs');var fs_extra=require(_0xaac6('0xb'));var _=require(_0xaac6('0xc'));var squel=require(_0xaac6('0xd'));var crypto=require(_0xaac6('0xe'));var jsforce=require(_0xaac6('0xf'));var deskjs=require(_0xaac6('0x10'));var toCsv=require(_0xaac6('0x9'));var querystring=require('querystring');var Papa=require(_0xaac6('0x11'));var Redis=require(_0xaac6('0x12'));var authService=require(_0xaac6('0x13'));var qs=require(_0xaac6('0x14'));var as=require(_0xaac6('0x15'));var hardwareService=require(_0xaac6('0x16'));var logger=require('../../config/logger')(_0xaac6('0x17'));var utils=require(_0xaac6('0x18'));var config=require(_0xaac6('0x19'));var licenseUtil=require(_0xaac6('0x1a'));var db=require(_0xaac6('0x1b'))['db'];function respondWithStatusCode(_0x57869f,_0x551fea){_0x551fea=_0x551fea||0xcc;return function(_0x1efac6){if(_0x1efac6){return _0x57869f['sendStatus'](_0x551fea);}return _0x57869f['status'](_0x551fea)[_0xaac6('0x1c')]();};}function respondWithResult(_0xcdfe7c,_0x2a074a){_0x2a074a=_0x2a074a||0xc8;return function(_0x404d82){if(_0x404d82){return _0xcdfe7c[_0xaac6('0x1d')](_0x2a074a)[_0xaac6('0x1e')](_0x404d82);}};}function respondWithFilteredResult(_0x130152,_0xc873f9){return function(_0x1c42fe){if(_0x1c42fe){var _0x1ceeca=typeof _0xc873f9[_0xaac6('0x1f')]===_0xaac6('0x20')&&typeof _0xc873f9['limit']==='undefined';var _0x8d0c31=_0x1c42fe[_0xaac6('0x21')];var _0x3cce6f=_0x1ceeca?0x0:_0xc873f9[_0xaac6('0x1f')];var _0x3d234a=_0x1ceeca?_0x1c42fe['count']:_0xc873f9[_0xaac6('0x1f')]+_0xc873f9[_0xaac6('0x22')];var _0x26dd96;if(_0x3d234a>=_0x8d0c31){_0x3d234a=_0x8d0c31;_0x26dd96=0xc8;}else{_0x26dd96=0xce;}_0x130152[_0xaac6('0x1d')](_0x26dd96);return _0x130152[_0xaac6('0x23')](_0xaac6('0x24'),_0x3cce6f+'-'+_0x3d234a+'/'+_0x8d0c31)[_0xaac6('0x1e')](_0x1c42fe);}return null;};}function patchUpdates(_0x4a6064){return function(_0x3fcc7b){try{jsonpatch[_0xaac6('0x25')](_0x3fcc7b,_0x4a6064,!![]);}catch(_0x276123){return BPromise[_0xaac6('0x26')](_0x276123);}return _0x3fcc7b[_0xaac6('0x27')]();};}function saveUpdates(_0x12682c,_0x2afe80){return function(_0x4f7089){if(_0x4f7089){return _0x4f7089['update'](_0x12682c)[_0xaac6('0x28')](function(_0x54592c){return _0x54592c;});}return null;};}function removeEntity(_0x18c220,_0x12dfa5){return function(_0x326238){if(_0x326238){return _0x326238['destroy']()[_0xaac6('0x28')](function(){_0x18c220['status'](0xcc)[_0xaac6('0x1c')]();});}};}function handleEntityNotFound(_0x943dc9,_0x21ea41){return function(_0x335300){if(!_0x335300){_0x943dc9[_0xaac6('0x29')](0x194);}return _0x335300;};}function handleError(_0x58dfb3,_0xc4b235){_0xc4b235=_0xc4b235||0x1f4;return function(_0x321cbc){logger['error'](_0x321cbc['stack']);if(_0x321cbc[_0xaac6('0x2a')]){delete _0x321cbc['name'];}_0x58dfb3[_0xaac6('0x1d')](_0xc4b235)[_0xaac6('0x2b')](_0x321cbc);};}exports[_0xaac6('0x2c')]=function(_0x3b63f3,_0x19f0c0){var _0x5d6950={},_0x19ebcf={},_0xb02a9b={'count':0x0,'rows':[]};var _0x32f29b=_['map'](db[_0xaac6('0x2d')][_0xaac6('0x2e')],function(_0x43c46e){return{'name':_0x43c46e[_0xaac6('0x2f')],'type':_0x43c46e[_0xaac6('0x30')]['key']};});_0x19ebcf['model']=_[_0xaac6('0x31')](_0x32f29b,_0xaac6('0x2a'));_0x19ebcf[_0xaac6('0x32')]=_['keys'](_0x3b63f3[_0xaac6('0x32')]);_0x19ebcf[_0xaac6('0x33')]=_[_0xaac6('0x34')](_0x19ebcf['model'],_0x19ebcf[_0xaac6('0x32')]);_0x5d6950[_0xaac6('0x35')]=_[_0xaac6('0x34')](_0x19ebcf[_0xaac6('0x36')],qs[_0xaac6('0x37')](_0x3b63f3['query'][_0xaac6('0x37')]));_0x5d6950[_0xaac6('0x35')]=_0x5d6950['attributes'][_0xaac6('0x38')]?_0x5d6950[_0xaac6('0x35')]:_0x19ebcf['model'];if(!_0x3b63f3[_0xaac6('0x32')][_0xaac6('0x39')](_0xaac6('0x3a'))){_0x5d6950[_0xaac6('0x22')]=qs[_0xaac6('0x22')](_0x3b63f3['query'][_0xaac6('0x22')]);_0x5d6950[_0xaac6('0x1f')]=qs[_0xaac6('0x1f')](_0x3b63f3[_0xaac6('0x32')][_0xaac6('0x1f')]);}_0x5d6950['order']=qs['sort'](_0x3b63f3['query']['sort']);_0x5d6950['where']=qs[_0xaac6('0x33')](_['pick'](_0x3b63f3[_0xaac6('0x32')],_0x19ebcf[_0xaac6('0x33')]),_0x32f29b);if(_0x3b63f3[_0xaac6('0x32')][_0xaac6('0x3b')]){_0x5d6950[_0xaac6('0x3c')]=_[_0xaac6('0x3d')](_0x5d6950[_0xaac6('0x3c')],{'$or':_[_0xaac6('0x31')](_0x32f29b,function(_0x185659){if(_0x185659[_0xaac6('0x30')]!=='VIRTUAL'){var _0x55da98={};_0x55da98[_0x185659['name']]={'$like':'%'+_0x3b63f3[_0xaac6('0x32')][_0xaac6('0x3b')]+'%'};return _0x55da98;}})});}_0x5d6950=_['merge']({},_0x5d6950,_0x3b63f3[_0xaac6('0x3e')]);var _0x3d5807={'where':_0x5d6950[_0xaac6('0x3c')]};return db[_0xaac6('0x2d')][_0xaac6('0x21')](_0x3d5807)['then'](function(_0x296ce6){_0xb02a9b[_0xaac6('0x21')]=_0x296ce6;if(_0x3b63f3[_0xaac6('0x32')]['includeAll']){_0x5d6950['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0xaac6('0x3f')](_0x5d6950);})[_0xaac6('0x28')](function(_0x1cdcca){_0xb02a9b[_0xaac6('0x40')]=_0x1cdcca;return _0xb02a9b;})['then'](respondWithFilteredResult(_0x19f0c0,_0x5d6950))['catch'](handleError(_0x19f0c0,null));};exports[_0xaac6('0x41')]=function(_0xfbab0c,_0x217e6e){var _0x365e0e={'raw':!![],'where':{'id':_0xfbab0c[_0xaac6('0x42')]['id']}},_0x40d21a={};_0x40d21a[_0xaac6('0x36')]=_[_0xaac6('0x43')](db['ChatQueueReport'][_0xaac6('0x2e')]);_0x40d21a[_0xaac6('0x32')]=_[_0xaac6('0x43')](_0xfbab0c[_0xaac6('0x32')]);_0x40d21a[_0xaac6('0x33')]=_[_0xaac6('0x34')](_0x40d21a[_0xaac6('0x36')],_0x40d21a[_0xaac6('0x32')]);_0x365e0e['attributes']=_[_0xaac6('0x34')](_0x40d21a['model'],qs[_0xaac6('0x37')](_0xfbab0c[_0xaac6('0x32')][_0xaac6('0x37')]));_0x365e0e[_0xaac6('0x35')]=_0x365e0e[_0xaac6('0x35')]['length']?_0x365e0e[_0xaac6('0x35')]:_0x40d21a[_0xaac6('0x36')];if(_0xfbab0c[_0xaac6('0x32')][_0xaac6('0x44')]){_0x365e0e[_0xaac6('0x45')]=[{'all':!![]}];}_0x365e0e=_[_0xaac6('0x3d')]({},_0x365e0e,_0xfbab0c[_0xaac6('0x3e')]);return db[_0xaac6('0x2d')]['find'](_0x365e0e)[_0xaac6('0x28')](handleEntityNotFound(_0x217e6e,null))[_0xaac6('0x28')](respondWithResult(_0x217e6e,null))[_0xaac6('0x46')](handleError(_0x217e6e,null));};exports['create']=function(_0x15d695,_0x1b53f5){return db[_0xaac6('0x2d')][_0xaac6('0x47')](_0x15d695[_0xaac6('0x48')],{})[_0xaac6('0x28')](respondWithResult(_0x1b53f5,0xc9))['catch'](handleError(_0x1b53f5,null));};exports[_0xaac6('0x49')]=function(_0x2af290,_0x644ec3){if(_0x2af290[_0xaac6('0x48')]['id']){delete _0x2af290['body']['id'];}return db['ChatQueueReport'][_0xaac6('0x4a')]({'where':{'id':_0x2af290[_0xaac6('0x42')]['id']}})['then'](handleEntityNotFound(_0x644ec3,null))[_0xaac6('0x28')](saveUpdates(_0x2af290[_0xaac6('0x48')],null))[_0xaac6('0x28')](respondWithResult(_0x644ec3,null))[_0xaac6('0x46')](handleError(_0x644ec3,null));};exports[_0xaac6('0x4b')]=function(_0x265850,_0x593179){return db[_0xaac6('0x2d')][_0xaac6('0x4a')]({'where':{'id':_0x265850['params']['id']}})[_0xaac6('0x28')](handleEntityNotFound(_0x593179,null))[_0xaac6('0x28')](removeEntity(_0x593179,null))['catch'](handleError(_0x593179,null));};exports['describe']=function(_0x101078,_0x16a6f0){return db['ChatQueueReport'][_0xaac6('0x4c')]()[_0xaac6('0x28')](respondWithResult(_0x16a6f0,null))[_0xaac6('0x46')](handleError(_0x16a6f0,null));};
\ No newline at end of file
+var _0x8cad=['intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','params','create','update','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','error','name','send','map','ChatQueueReport','rawAttributes','fieldName','type','key','query','keys','filters'];(function(_0x42deb9,_0xa48420){var _0x393e3f=function(_0x350e3b){while(--_0x350e3b){_0x42deb9['push'](_0x42deb9['shift']());}};_0x393e3f(++_0xa48420);}(_0x8cad,0xfe));var _0xd8ca=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x8cad[_0x3740fe];return _0x55492b;};'use strict';var emlformat=require(_0xd8ca('0x0'));var rimraf=require(_0xd8ca('0x1'));var zipdir=require(_0xd8ca('0x2'));var jsonpatch=require(_0xd8ca('0x3'));var rp=require(_0xd8ca('0x4'));var moment=require(_0xd8ca('0x5'));var BPromise=require(_0xd8ca('0x6'));var Mustache=require(_0xd8ca('0x7'));var util=require(_0xd8ca('0x8'));var path=require(_0xd8ca('0x9'));var sox=require(_0xd8ca('0xa'));var csv=require(_0xd8ca('0xb'));var ejs=require(_0xd8ca('0xc'));var fs=require('fs');var fs_extra=require(_0xd8ca('0xd'));var _=require('lodash');var squel=require(_0xd8ca('0xe'));var crypto=require(_0xd8ca('0xf'));var jsforce=require(_0xd8ca('0x10'));var deskjs=require(_0xd8ca('0x11'));var toCsv=require(_0xd8ca('0xb'));var querystring=require('querystring');var Papa=require(_0xd8ca('0x12'));var Redis=require('ioredis');var authService=require(_0xd8ca('0x13'));var qs=require(_0xd8ca('0x14'));var as=require(_0xd8ca('0x15'));var hardwareService=require(_0xd8ca('0x16'));var logger=require(_0xd8ca('0x17'))(_0xd8ca('0x18'));var utils=require('../../config/utils');var config=require(_0xd8ca('0x19'));var licenseUtil=require(_0xd8ca('0x1a'));var db=require(_0xd8ca('0x1b'))['db'];function respondWithStatusCode(_0x102b16,_0x326272){_0x326272=_0x326272||0xcc;return function(_0x2bb191){if(_0x2bb191){return _0x102b16[_0xd8ca('0x1c')](_0x326272);}return _0x102b16[_0xd8ca('0x1d')](_0x326272)[_0xd8ca('0x1e')]();};}function respondWithResult(_0x52726a,_0x58969b){_0x58969b=_0x58969b||0xc8;return function(_0x12d3f8){if(_0x12d3f8){return _0x52726a[_0xd8ca('0x1d')](_0x58969b)[_0xd8ca('0x1f')](_0x12d3f8);}};}function respondWithFilteredResult(_0x647962,_0x177367){return function(_0x17330a){if(_0x17330a){var _0x3013f2=typeof _0x177367[_0xd8ca('0x20')]===_0xd8ca('0x21')&&typeof _0x177367['limit']===_0xd8ca('0x21');var _0x3c67fc=_0x17330a[_0xd8ca('0x22')];var _0x437ac5=_0x3013f2?0x0:_0x177367['offset'];var _0x47e368=_0x3013f2?_0x17330a[_0xd8ca('0x22')]:_0x177367['offset']+_0x177367[_0xd8ca('0x23')];var _0x35a3a1;if(_0x47e368>=_0x3c67fc){_0x47e368=_0x3c67fc;_0x35a3a1=0xc8;}else{_0x35a3a1=0xce;}_0x647962[_0xd8ca('0x1d')](_0x35a3a1);return _0x647962[_0xd8ca('0x24')](_0xd8ca('0x25'),_0x437ac5+'-'+_0x47e368+'/'+_0x3c67fc)[_0xd8ca('0x1f')](_0x17330a);}return null;};}function patchUpdates(_0x56ea7e){return function(_0xa18ac1){try{jsonpatch[_0xd8ca('0x26')](_0xa18ac1,_0x56ea7e,!![]);}catch(_0xd5e6c6){return BPromise[_0xd8ca('0x27')](_0xd5e6c6);}return _0xa18ac1['save']();};}function saveUpdates(_0x23854a,_0x3053f0){return function(_0x1d1367){if(_0x1d1367){return _0x1d1367['update'](_0x23854a)[_0xd8ca('0x28')](function(_0x341807){return _0x341807;});}return null;};}function removeEntity(_0xb42d0c,_0xbf3254){return function(_0x424d81){if(_0x424d81){return _0x424d81[_0xd8ca('0x29')]()[_0xd8ca('0x28')](function(){_0xb42d0c['status'](0xcc)[_0xd8ca('0x1e')]();});}};}function handleEntityNotFound(_0x3f8e42,_0x4eded9){return function(_0x3bd963){if(!_0x3bd963){_0x3f8e42[_0xd8ca('0x1c')](0x194);}return _0x3bd963;};}function handleError(_0x32ba25,_0xaeff64){_0xaeff64=_0xaeff64||0x1f4;return function(_0x15a71d){logger[_0xd8ca('0x2a')](_0x15a71d['stack']);if(_0x15a71d[_0xd8ca('0x2b')]){delete _0x15a71d['name'];}_0x32ba25[_0xd8ca('0x1d')](_0xaeff64)[_0xd8ca('0x2c')](_0x15a71d);};}exports['index']=function(_0x5260c3,_0x1ab436){var _0x4641af={},_0x3b1098={},_0x3bd4c4={'count':0x0,'rows':[]};var _0xab5ffe=_[_0xd8ca('0x2d')](db[_0xd8ca('0x2e')][_0xd8ca('0x2f')],function(_0x52369d){return{'name':_0x52369d[_0xd8ca('0x30')],'type':_0x52369d[_0xd8ca('0x31')][_0xd8ca('0x32')]};});_0x3b1098['model']=_['map'](_0xab5ffe,_0xd8ca('0x2b'));_0x3b1098[_0xd8ca('0x33')]=_[_0xd8ca('0x34')](_0x5260c3[_0xd8ca('0x33')]);_0x3b1098[_0xd8ca('0x35')]=_[_0xd8ca('0x36')](_0x3b1098[_0xd8ca('0x37')],_0x3b1098[_0xd8ca('0x33')]);_0x4641af['attributes']=_[_0xd8ca('0x36')](_0x3b1098[_0xd8ca('0x37')],qs[_0xd8ca('0x38')](_0x5260c3[_0xd8ca('0x33')][_0xd8ca('0x38')]));_0x4641af[_0xd8ca('0x39')]=_0x4641af[_0xd8ca('0x39')][_0xd8ca('0x3a')]?_0x4641af['attributes']:_0x3b1098[_0xd8ca('0x37')];if(!_0x5260c3[_0xd8ca('0x33')][_0xd8ca('0x3b')]('nolimit')){_0x4641af[_0xd8ca('0x23')]=qs[_0xd8ca('0x23')](_0x5260c3[_0xd8ca('0x33')]['limit']);_0x4641af[_0xd8ca('0x20')]=qs['offset'](_0x5260c3[_0xd8ca('0x33')]['offset']);}_0x4641af[_0xd8ca('0x3c')]=qs[_0xd8ca('0x3d')](_0x5260c3[_0xd8ca('0x33')]['sort']);_0x4641af[_0xd8ca('0x3e')]=qs[_0xd8ca('0x35')](_['pick'](_0x5260c3[_0xd8ca('0x33')],_0x3b1098[_0xd8ca('0x35')]),_0xab5ffe);if(_0x5260c3['query'][_0xd8ca('0x3f')]){_0x4641af[_0xd8ca('0x3e')]=_['merge'](_0x4641af[_0xd8ca('0x3e')],{'$or':_[_0xd8ca('0x2d')](_0xab5ffe,function(_0x225794){if(_0x225794['type']!=='VIRTUAL'){var _0x1779a5={};_0x1779a5[_0x225794['name']]={'$like':'%'+_0x5260c3[_0xd8ca('0x33')]['filter']+'%'};return _0x1779a5;}})});}_0x4641af=_[_0xd8ca('0x40')]({},_0x4641af,_0x5260c3[_0xd8ca('0x41')]);var _0x22f15b={'where':_0x4641af[_0xd8ca('0x3e')]};return db['ChatQueueReport'][_0xd8ca('0x22')](_0x22f15b)[_0xd8ca('0x28')](function(_0x2f971a){_0x3bd4c4['count']=_0x2f971a;if(_0x5260c3['query'][_0xd8ca('0x42')]){_0x4641af[_0xd8ca('0x43')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xd8ca('0x44')](_0x4641af);})[_0xd8ca('0x28')](function(_0x43fcee){_0x3bd4c4[_0xd8ca('0x45')]=_0x43fcee;return _0x3bd4c4;})[_0xd8ca('0x28')](respondWithFilteredResult(_0x1ab436,_0x4641af))[_0xd8ca('0x46')](handleError(_0x1ab436,null));};exports['show']=function(_0x387309,_0x2d10b3){var _0x15d671={'raw':!![],'where':{'id':_0x387309[_0xd8ca('0x47')]['id']}},_0x2dffca={};_0x2dffca[_0xd8ca('0x37')]=_[_0xd8ca('0x34')](db[_0xd8ca('0x2e')]['rawAttributes']);_0x2dffca[_0xd8ca('0x33')]=_[_0xd8ca('0x34')](_0x387309['query']);_0x2dffca['filters']=_[_0xd8ca('0x36')](_0x2dffca[_0xd8ca('0x37')],_0x2dffca[_0xd8ca('0x33')]);_0x15d671[_0xd8ca('0x39')]=_[_0xd8ca('0x36')](_0x2dffca[_0xd8ca('0x37')],qs[_0xd8ca('0x38')](_0x387309[_0xd8ca('0x33')]['fields']));_0x15d671[_0xd8ca('0x39')]=_0x15d671[_0xd8ca('0x39')][_0xd8ca('0x3a')]?_0x15d671[_0xd8ca('0x39')]:_0x2dffca[_0xd8ca('0x37')];if(_0x387309[_0xd8ca('0x33')][_0xd8ca('0x42')]){_0x15d671[_0xd8ca('0x43')]=[{'all':!![]}];}_0x15d671=_['merge']({},_0x15d671,_0x387309[_0xd8ca('0x41')]);return db[_0xd8ca('0x2e')]['find'](_0x15d671)[_0xd8ca('0x28')](handleEntityNotFound(_0x2d10b3,null))[_0xd8ca('0x28')](respondWithResult(_0x2d10b3,null))[_0xd8ca('0x46')](handleError(_0x2d10b3,null));};exports[_0xd8ca('0x48')]=function(_0x449758,_0x31ca73){return db[_0xd8ca('0x2e')][_0xd8ca('0x48')](_0x449758['body'],{})[_0xd8ca('0x28')](respondWithResult(_0x31ca73,0xc9))[_0xd8ca('0x46')](handleError(_0x31ca73,null));};exports[_0xd8ca('0x49')]=function(_0x513b2e,_0x346497){if(_0x513b2e[_0xd8ca('0x4a')]['id']){delete _0x513b2e[_0xd8ca('0x4a')]['id'];}return db[_0xd8ca('0x2e')][_0xd8ca('0x4b')]({'where':{'id':_0x513b2e[_0xd8ca('0x47')]['id']}})[_0xd8ca('0x28')](handleEntityNotFound(_0x346497,null))[_0xd8ca('0x28')](saveUpdates(_0x513b2e[_0xd8ca('0x4a')],null))[_0xd8ca('0x28')](respondWithResult(_0x346497,null))[_0xd8ca('0x46')](handleError(_0x346497,null));};exports['destroy']=function(_0xfd8ad6,_0x3c1808){return db['ChatQueueReport'][_0xd8ca('0x4b')]({'where':{'id':_0xfd8ad6[_0xd8ca('0x47')]['id']}})[_0xd8ca('0x28')](handleEntityNotFound(_0x3c1808,null))[_0xd8ca('0x28')](removeEntity(_0x3c1808,null))[_0xd8ca('0x46')](handleError(_0x3c1808,null));};exports[_0xd8ca('0x4c')]=function(_0xd6d446,_0x43d3ef){return db[_0xd8ca('0x2e')]['describe']()['then'](respondWithResult(_0x43d3ef,null))[_0xd8ca('0x46')](handleError(_0x43d3ef,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index e9cb429..20e2157 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(_0x539b22,_0x5541b6){var _0x5adc6e=function(_0x2bfff0){while(--_0x2bfff0){_0x539b22['push'](_0x539b22['shift']());}};_0x5adc6e(++_0x5541b6);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x29210d,_0x45648b){var _0x4a66e6=function(_0x1ec623){while(--_0x1ec623){_0x29210d['push'](_0x29210d['shift']());}};_0x4a66e6(++_0x45648b);}(_0xe706,0xa3));var _0x6e70=function(_0xa1181c,_0x1724a4){_0xa1181c=_0xa1181c-0x0;var _0x1ef296=_0xe706[_0xa1181c];return _0x1ef296;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 3e4c2b4..1f2e1e7 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 _0xdc35=['request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','update','where','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http'];(function(_0x28b018,_0x4fbe0d){var _0x9c8f15=function(_0x1fb613){while(--_0x1fb613){_0x28b018['push'](_0x28b018['shift']());}};_0x9c8f15(++_0x4fbe0d);}(_0xdc35,0xd6));var _0x5dc3=function(_0x57aed8,_0x6fb70b){_0x57aed8=_0x57aed8-0x0;var _0x4a9c3b=_0xdc35[_0x57aed8];return _0x4a9c3b;};'use strict';var _=require(_0x5dc3('0x0'));var util=require('util');var moment=require(_0x5dc3('0x1'));var BPromise=require(_0x5dc3('0x2'));var rs=require(_0x5dc3('0x3'));var fs=require('fs');var Redis=require(_0x5dc3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5dc3('0x5'));var logger=require(_0x5dc3('0x6'))('rpc');var config=require(_0x5dc3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5dc3('0x8')][_0x5dc3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x44f0f1,_0x452fe4,_0x162980){return new BPromise(function(_0x1146dc,_0x472506){return client[_0x5dc3('0xa')](_0x44f0f1,_0x162980)[_0x5dc3('0xb')](function(_0x24f17e){logger[_0x5dc3('0xc')](_0x5dc3('0xd'),_0x452fe4,_0x5dc3('0xe'));logger[_0x5dc3('0xf')](_0x5dc3('0x10'),_0x452fe4,_0x5dc3('0xe'),JSON[_0x5dc3('0x11')](_0x24f17e));if(_0x24f17e[_0x5dc3('0x12')]){if(_0x24f17e[_0x5dc3('0x12')][_0x5dc3('0x13')]===0x1f4){logger[_0x5dc3('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x452fe4,_0x24f17e[_0x5dc3('0x12')][_0x5dc3('0x14')]);return _0x472506(_0x24f17e[_0x5dc3('0x12')][_0x5dc3('0x14')]);}logger['error'](_0x5dc3('0xd'),_0x452fe4,_0x24f17e[_0x5dc3('0x12')]['message']);return _0x1146dc(_0x24f17e[_0x5dc3('0x12')][_0x5dc3('0x14')]);}else{logger[_0x5dc3('0xc')](_0x5dc3('0xd'),_0x452fe4,_0x5dc3('0xe'));_0x1146dc(_0x24f17e['result'][_0x5dc3('0x14')]);}})[_0x5dc3('0x15')](function(_0x2aab46){logger['error'](_0x5dc3('0xd'),_0x452fe4,_0x2aab46);_0x472506(_0x2aab46);});});}exports[_0x5dc3('0x16')]=function(_0x1218ad){var _0x4b5107=this;return new Promise(function(_0x3da36e,_0x582442){return db[_0x5dc3('0x17')][_0x5dc3('0x18')](_0x1218ad[_0x5dc3('0x19')],{'raw':_0x1218ad['options']?_0x1218ad[_0x5dc3('0x1a')][_0x5dc3('0x1b')]===undefined?!![]:![]:!![]})[_0x5dc3('0xb')](function(_0x3e51b4){logger[_0x5dc3('0xc')](_0x5dc3('0x16'),_0x1218ad);logger['debug'](_0x5dc3('0x16'),_0x1218ad,JSON['stringify'](_0x3e51b4));_0x3da36e(_0x3e51b4);})['catch'](function(_0x5d11bb){logger[_0x5dc3('0x12')](_0x5dc3('0x16'),_0x5d11bb[_0x5dc3('0x14')],_0x1218ad);_0x582442(_0x4b5107[_0x5dc3('0x12')](0x1f4,_0x5d11bb[_0x5dc3('0x14')]));});});};exports[_0x5dc3('0x1c')]=function(_0x3927ee){var _0x47a0c3=this;return new Promise(function(_0xcbe2f2,_0x14dc54){return db[_0x5dc3('0x17')][_0x5dc3('0x1d')](_0x3927ee[_0x5dc3('0x19')],{'raw':_0x3927ee['options']?_0x3927ee[_0x5dc3('0x1a')][_0x5dc3('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3927ee[_0x5dc3('0x1a')]?_0x3927ee[_0x5dc3('0x1a')][_0x5dc3('0x1e')]||null:null,'attributes':_0x3927ee[_0x5dc3('0x1a')]?_0x3927ee[_0x5dc3('0x1a')]['attributes']||null:null,'limit':_0x3927ee[_0x5dc3('0x1a')]?_0x3927ee[_0x5dc3('0x1a')][_0x5dc3('0x1f')]||null:null})[_0x5dc3('0xb')](function(_0x15091d){logger['info']('UpdateChatQueueReport',_0x3927ee);logger[_0x5dc3('0xf')](_0x5dc3('0x1c'),_0x3927ee,JSON[_0x5dc3('0x11')](_0x15091d));_0xcbe2f2(_0x15091d);})[_0x5dc3('0x15')](function(_0x1d44f3){logger[_0x5dc3('0x12')](_0x5dc3('0x1c'),_0x1d44f3[_0x5dc3('0x14')],_0x3927ee);_0x14dc54(_0x47a0c3[_0x5dc3('0x12')](0x1f4,_0x1d44f3['message']));});});};
\ No newline at end of file
+var _0x5780=['UpdateChatQueueReport','update','raw','where','attributes','limit','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','ChatQueueReport','body','options','CreateChatQueueReport','catch'];(function(_0x514167,_0xfc1d16){var _0x3a88e2=function(_0x5fb554){while(--_0x5fb554){_0x514167['push'](_0x514167['shift']());}};_0x3a88e2(++_0xfc1d16);}(_0x5780,0xed));var _0x0578=function(_0x189978,_0x48d117){_0x189978=_0x189978-0x0;var _0x1a7dc8=_0x5780[_0x189978];return _0x1a7dc8;};'use strict';var _=require('lodash');var util=require(_0x0578('0x0'));var moment=require(_0x0578('0x1'));var BPromise=require(_0x0578('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0578('0x3'));var db=require(_0x0578('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0578('0x5'))(_0x0578('0x6'));var config=require('../../config/environment');var jayson=require(_0x0578('0x7'));var client=jayson[_0x0578('0x8')][_0x0578('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4de26f,_0x35bbdc,_0x23d3c5){return new BPromise(function(_0x2d8c67,_0x4ef661){return client[_0x0578('0xa')](_0x4de26f,_0x23d3c5)[_0x0578('0xb')](function(_0x3152ec){logger['info'](_0x0578('0xc'),_0x35bbdc,_0x0578('0xd'));logger[_0x0578('0xe')](_0x0578('0xf'),_0x35bbdc,_0x0578('0xd'),JSON[_0x0578('0x10')](_0x3152ec));if(_0x3152ec[_0x0578('0x11')]){if(_0x3152ec[_0x0578('0x11')][_0x0578('0x12')]===0x1f4){logger[_0x0578('0x11')](_0x0578('0xc'),_0x35bbdc,_0x3152ec[_0x0578('0x11')][_0x0578('0x13')]);return _0x4ef661(_0x3152ec[_0x0578('0x11')][_0x0578('0x13')]);}logger[_0x0578('0x11')](_0x0578('0xc'),_0x35bbdc,_0x3152ec[_0x0578('0x11')][_0x0578('0x13')]);return _0x2d8c67(_0x3152ec[_0x0578('0x11')][_0x0578('0x13')]);}else{logger[_0x0578('0x14')](_0x0578('0xc'),_0x35bbdc,_0x0578('0xd'));_0x2d8c67(_0x3152ec[_0x0578('0x15')]['message']);}})['catch'](function(_0x2965f6){logger[_0x0578('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x35bbdc,_0x2965f6);_0x4ef661(_0x2965f6);});});}exports['CreateChatQueueReport']=function(_0x10afba){var _0x3eebd0=this;return new Promise(function(_0x4ece78,_0x2615d0){return db[_0x0578('0x16')]['create'](_0x10afba[_0x0578('0x17')],{'raw':_0x10afba[_0x0578('0x18')]?_0x10afba[_0x0578('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x0578('0xb')](function(_0x3d8d62){logger[_0x0578('0x14')](_0x0578('0x19'),_0x10afba);logger[_0x0578('0xe')](_0x0578('0x19'),_0x10afba,JSON[_0x0578('0x10')](_0x3d8d62));_0x4ece78(_0x3d8d62);})[_0x0578('0x1a')](function(_0x3298ad){logger[_0x0578('0x11')]('CreateChatQueueReport',_0x3298ad[_0x0578('0x13')],_0x10afba);_0x2615d0(_0x3eebd0[_0x0578('0x11')](0x1f4,_0x3298ad['message']));});});};exports[_0x0578('0x1b')]=function(_0x400135){var _0x1d540b=this;return new Promise(function(_0x5774f6,_0x5277a4){return db['ChatQueueReport'][_0x0578('0x1c')](_0x400135[_0x0578('0x17')],{'raw':_0x400135['options']?_0x400135['options'][_0x0578('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x400135[_0x0578('0x18')]?_0x400135[_0x0578('0x18')][_0x0578('0x1e')]||null:null,'attributes':_0x400135[_0x0578('0x18')]?_0x400135['options'][_0x0578('0x1f')]||null:null,'limit':_0x400135[_0x0578('0x18')]?_0x400135[_0x0578('0x18')][_0x0578('0x20')]||null:null})[_0x0578('0xb')](function(_0x3dbbc3){logger[_0x0578('0x14')](_0x0578('0x1b'),_0x400135);logger[_0x0578('0xe')]('UpdateChatQueueReport',_0x400135,JSON[_0x0578('0x10')](_0x3dbbc3));_0x5774f6(_0x3dbbc3);})['catch'](function(_0x40f014){logger[_0x0578('0x11')](_0x0578('0x1b'),_0x40f014[_0x0578('0x13')],_0x400135);_0x5277a4(_0x1d540b[_0x0578('0x11')](0x1f4,_0x40f014[_0x0578('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 66ecd58..0c6b8d2 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 _0xb220=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','index','/describe','isAuthenticated','/:id','post','create','put','destroy','exports','multer','path','connect-timeout'];(function(_0x333714,_0x3370ac){var _0x4c211e=function(_0x34219b){while(--_0x34219b){_0x333714['push'](_0x333714['shift']());}};_0x4c211e(++_0x3370ac);}(_0xb220,0x153));var _0x0b22=function(_0x486d6f,_0x101ab0){_0x486d6f=_0x486d6f-0x0;var _0x413481=_0xb220[_0x486d6f];return _0x413481;};'use strict';var multer=require(_0x0b22('0x0'));var util=require('util');var path=require(_0x0b22('0x1'));var timeout=require(_0x0b22('0x2'));var express=require(_0x0b22('0x3'));var router=express[_0x0b22('0x4')]();var fs_extra=require(_0x0b22('0x5'));var auth=require(_0x0b22('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0b22('0x7'));var controller=require(_0x0b22('0x8'));router[_0x0b22('0x9')]('/',auth['isAuthenticated'](),controller[_0x0b22('0xa')]);router[_0x0b22('0x9')](_0x0b22('0xb'),auth[_0x0b22('0xc')](),controller['describe']);router['get'](_0x0b22('0xd'),auth[_0x0b22('0xc')](),controller['show']);router[_0x0b22('0xe')]('/',auth[_0x0b22('0xc')](),controller[_0x0b22('0xf')]);router[_0x0b22('0x10')](_0x0b22('0xd'),auth[_0x0b22('0xc')](),controller['update']);router['delete']('/:id',auth[_0x0b22('0xc')](),controller[_0x0b22('0x11')]);module[_0x0b22('0x12')]=router;
\ No newline at end of file
+var _0x1c8e=['update','destroy','exports','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put'];(function(_0xa1422,_0x4a7809){var _0x3b87fb=function(_0x1a921d){while(--_0x1a921d){_0xa1422['push'](_0xa1422['shift']());}};_0x3b87fb(++_0x4a7809);}(_0x1c8e,0x159));var _0xe1c8=function(_0x5b6670,_0x10fa2c){_0x5b6670=_0x5b6670-0x0;var _0x11714c=_0x1c8e[_0x5b6670];return _0x11714c;};'use strict';var multer=require('multer');var util=require(_0xe1c8('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe1c8('0x1'));var router=express[_0xe1c8('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xe1c8('0x3'));var interaction=require(_0xe1c8('0x4'));var config=require(_0xe1c8('0x5'));var controller=require(_0xe1c8('0x6'));router[_0xe1c8('0x7')]('/',auth[_0xe1c8('0x8')](),controller[_0xe1c8('0x9')]);router[_0xe1c8('0x7')](_0xe1c8('0xa'),auth[_0xe1c8('0x8')](),controller['describe']);router['get'](_0xe1c8('0xb'),auth['isAuthenticated'](),controller[_0xe1c8('0xc')]);router[_0xe1c8('0xd')]('/',auth['isAuthenticated'](),controller[_0xe1c8('0xe')]);router[_0xe1c8('0xf')](_0xe1c8('0xb'),auth[_0xe1c8('0x8')](),controller[_0xe1c8('0x10')]);router['delete'](_0xe1c8('0xb'),auth[_0xe1c8('0x8')](),controller[_0xe1c8('0x11')]);module[_0xe1c8('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 653e674..988487b 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 _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x41d938,_0x107a5b){var _0x38e26b=function(_0x5b4caf){while(--_0x5b4caf){_0x41d938['push'](_0x41d938['shift']());}};_0x38e26b(++_0x107a5b);}(_0xe706,0xa3));var _0x6e70=function(_0x3645e5,_0x1e9457){_0x3645e5=_0x3645e5-0x0;var _0x25f856=_0xe706[_0x3645e5];return _0x25f856;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}};
\ No newline at end of file
+var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x1d383c,_0x3e832f){var _0x31f35e=function(_0x1f7b1c){while(--_0x1f7b1c){_0x1d383c['push'](_0x1d383c['shift']());}};_0x31f35e(++_0x3e832f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3fe6df,_0x5a04d4){_0x3fe6df=_0x3fe6df-0x0;var _0x372a0e=_0xcb91[_0x3fe6df];return _0x372a0e;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index f8d9638..d187704 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 _0x3e7a=['apply','reject','save','then','destroy','error','name','index','map','ChatTransferReport','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch','mustache','util','sox','ejs','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range'];(function(_0x2f1a92,_0x2eff28){var _0x279dd1=function(_0x254ec8){while(--_0x254ec8){_0x2f1a92['push'](_0x2f1a92['shift']());}};_0x279dd1(++_0x2eff28);}(_0x3e7a,0xb1));var _0xa3e7=function(_0x41c996,_0xa79e16){_0x41c996=_0x41c996-0x0;var _0x10cd4d=_0x3e7a[_0x41c996];return _0x10cd4d;};'use strict';var emlformat=require(_0xa3e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa3e7('0x1'));var jsonpatch=require(_0xa3e7('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa3e7('0x3'));var util=require(_0xa3e7('0x4'));var path=require('path');var sox=require(_0xa3e7('0x5'));var csv=require('to-csv');var ejs=require(_0xa3e7('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa3e7('0x7'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa3e7('0x8'));var Papa=require(_0xa3e7('0x9'));var Redis=require(_0xa3e7('0xa'));var authService=require(_0xa3e7('0xb'));var qs=require('../../components/parsers/qs');var as=require(_0xa3e7('0xc'));var hardwareService=require(_0xa3e7('0xd'));var logger=require(_0xa3e7('0xe'))(_0xa3e7('0xf'));var utils=require(_0xa3e7('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa3e7('0x11'))['db'];function respondWithStatusCode(_0x759c77,_0x47b29e){_0x47b29e=_0x47b29e||0xcc;return function(_0x2c8bde){if(_0x2c8bde){return _0x759c77[_0xa3e7('0x12')](_0x47b29e);}return _0x759c77[_0xa3e7('0x13')](_0x47b29e)[_0xa3e7('0x14')]();};}function respondWithResult(_0x3d5783,_0x65b366){_0x65b366=_0x65b366||0xc8;return function(_0x48a0cf){if(_0x48a0cf){return _0x3d5783[_0xa3e7('0x13')](_0x65b366)[_0xa3e7('0x15')](_0x48a0cf);}};}function respondWithFilteredResult(_0x2578bb,_0x58f08c){return function(_0x304719){if(_0x304719){var _0x29ec40=typeof _0x58f08c[_0xa3e7('0x16')]==='undefined'&&typeof _0x58f08c['limit']===_0xa3e7('0x17');var _0x338308=_0x304719[_0xa3e7('0x18')];var _0xa7f81f=_0x29ec40?0x0:_0x58f08c[_0xa3e7('0x16')];var _0x192258=_0x29ec40?_0x304719['count']:_0x58f08c[_0xa3e7('0x16')]+_0x58f08c[_0xa3e7('0x19')];var _0x577a25;if(_0x192258>=_0x338308){_0x192258=_0x338308;_0x577a25=0xc8;}else{_0x577a25=0xce;}_0x2578bb['status'](_0x577a25);return _0x2578bb['set'](_0xa3e7('0x1a'),_0xa7f81f+'-'+_0x192258+'/'+_0x338308)[_0xa3e7('0x15')](_0x304719);}return null;};}function patchUpdates(_0x47fd87){return function(_0x2f1635){try{jsonpatch[_0xa3e7('0x1b')](_0x2f1635,_0x47fd87,!![]);}catch(_0x2a14c5){return BPromise[_0xa3e7('0x1c')](_0x2a14c5);}return _0x2f1635[_0xa3e7('0x1d')]();};}function saveUpdates(_0x5471a0,_0x279077){return function(_0x29e15c){if(_0x29e15c){return _0x29e15c['update'](_0x5471a0)[_0xa3e7('0x1e')](function(_0xd3e144){return _0xd3e144;});}return null;};}function removeEntity(_0x245a47,_0x44a802){return function(_0x801b00){if(_0x801b00){return _0x801b00[_0xa3e7('0x1f')]()[_0xa3e7('0x1e')](function(){_0x245a47[_0xa3e7('0x13')](0xcc)[_0xa3e7('0x14')]();});}};}function handleEntityNotFound(_0xb8a2c2,_0x4d9313){return function(_0x43b115){if(!_0x43b115){_0xb8a2c2[_0xa3e7('0x12')](0x194);}return _0x43b115;};}function handleError(_0x4646b0,_0x15702e){_0x15702e=_0x15702e||0x1f4;return function(_0x17cbd9){logger[_0xa3e7('0x20')](_0x17cbd9['stack']);if(_0x17cbd9[_0xa3e7('0x21')]){delete _0x17cbd9[_0xa3e7('0x21')];}_0x4646b0['status'](_0x15702e)['send'](_0x17cbd9);};}exports[_0xa3e7('0x22')]=function(_0x579c11,_0x414b40){var _0x32e16a={},_0x3e7d91={},_0x4106ef={'count':0x0,'rows':[]};var _0x55303d=_[_0xa3e7('0x23')](db[_0xa3e7('0x24')][_0xa3e7('0x25')],function(_0x2210d5){return{'name':_0x2210d5[_0xa3e7('0x26')],'type':_0x2210d5['type'][_0xa3e7('0x27')]};});_0x3e7d91[_0xa3e7('0x28')]=_['map'](_0x55303d,_0xa3e7('0x21'));_0x3e7d91[_0xa3e7('0x29')]=_['keys'](_0x579c11['query']);_0x3e7d91[_0xa3e7('0x2a')]=_['intersection'](_0x3e7d91['model'],_0x3e7d91['query']);_0x32e16a['attributes']=_[_0xa3e7('0x2b')](_0x3e7d91[_0xa3e7('0x28')],qs[_0xa3e7('0x2c')](_0x579c11['query']['fields']));_0x32e16a['attributes']=_0x32e16a[_0xa3e7('0x2d')][_0xa3e7('0x2e')]?_0x32e16a[_0xa3e7('0x2d')]:_0x3e7d91[_0xa3e7('0x28')];if(!_0x579c11[_0xa3e7('0x29')][_0xa3e7('0x2f')]('nolimit')){_0x32e16a[_0xa3e7('0x19')]=qs[_0xa3e7('0x19')](_0x579c11[_0xa3e7('0x29')][_0xa3e7('0x19')]);_0x32e16a['offset']=qs['offset'](_0x579c11[_0xa3e7('0x29')][_0xa3e7('0x16')]);}_0x32e16a['order']=qs['sort'](_0x579c11[_0xa3e7('0x29')]['sort']);_0x32e16a[_0xa3e7('0x30')]=qs[_0xa3e7('0x2a')](_[_0xa3e7('0x31')](_0x579c11[_0xa3e7('0x29')],_0x3e7d91[_0xa3e7('0x2a')]),_0x55303d);if(_0x579c11[_0xa3e7('0x29')][_0xa3e7('0x32')]){_0x32e16a[_0xa3e7('0x30')]=_[_0xa3e7('0x33')](_0x32e16a[_0xa3e7('0x30')],{'$or':_['map'](_0x55303d,function(_0x5ac925){if(_0x5ac925[_0xa3e7('0x34')]!==_0xa3e7('0x35')){var _0x25e848={};_0x25e848[_0x5ac925['name']]={'$like':'%'+_0x579c11[_0xa3e7('0x29')][_0xa3e7('0x32')]+'%'};return _0x25e848;}})});}_0x32e16a=_[_0xa3e7('0x33')]({},_0x32e16a,_0x579c11[_0xa3e7('0x36')]);var _0x59e48b={'where':_0x32e16a[_0xa3e7('0x30')]};return db[_0xa3e7('0x24')][_0xa3e7('0x18')](_0x59e48b)[_0xa3e7('0x1e')](function(_0x523c29){_0x4106ef[_0xa3e7('0x18')]=_0x523c29;if(_0x579c11[_0xa3e7('0x29')][_0xa3e7('0x37')]){_0x32e16a['include']=[{'all':!![]}];}return db[_0xa3e7('0x24')][_0xa3e7('0x38')](_0x32e16a);})['then'](function(_0x1d041d){_0x4106ef[_0xa3e7('0x39')]=_0x1d041d;return _0x4106ef;})['then'](respondWithFilteredResult(_0x414b40,_0x32e16a))[_0xa3e7('0x3a')](handleError(_0x414b40,null));};exports[_0xa3e7('0x3b')]=function(_0x59989c,_0x12631e){var _0x3ef93f={'raw':!![],'where':{'id':_0x59989c[_0xa3e7('0x3c')]['id']}},_0x3529ea={};_0x3529ea[_0xa3e7('0x28')]=_[_0xa3e7('0x3d')](db[_0xa3e7('0x24')][_0xa3e7('0x25')]);_0x3529ea['query']=_[_0xa3e7('0x3d')](_0x59989c[_0xa3e7('0x29')]);_0x3529ea[_0xa3e7('0x2a')]=_[_0xa3e7('0x2b')](_0x3529ea[_0xa3e7('0x28')],_0x3529ea[_0xa3e7('0x29')]);_0x3ef93f[_0xa3e7('0x2d')]=_['intersection'](_0x3529ea[_0xa3e7('0x28')],qs[_0xa3e7('0x2c')](_0x59989c[_0xa3e7('0x29')][_0xa3e7('0x2c')]));_0x3ef93f[_0xa3e7('0x2d')]=_0x3ef93f['attributes'][_0xa3e7('0x2e')]?_0x3ef93f[_0xa3e7('0x2d')]:_0x3529ea[_0xa3e7('0x28')];if(_0x59989c[_0xa3e7('0x29')][_0xa3e7('0x37')]){_0x3ef93f[_0xa3e7('0x3e')]=[{'all':!![]}];}_0x3ef93f=_['merge']({},_0x3ef93f,_0x59989c[_0xa3e7('0x36')]);return db['ChatTransferReport'][_0xa3e7('0x3f')](_0x3ef93f)[_0xa3e7('0x1e')](handleEntityNotFound(_0x12631e,null))[_0xa3e7('0x1e')](respondWithResult(_0x12631e,null))['catch'](handleError(_0x12631e,null));};exports['create']=function(_0x1598da,_0x53cd45){return db[_0xa3e7('0x24')][_0xa3e7('0x40')](_0x1598da[_0xa3e7('0x41')],{})['then'](respondWithResult(_0x53cd45,0xc9))[_0xa3e7('0x3a')](handleError(_0x53cd45,null));};exports[_0xa3e7('0x42')]=function(_0x691281,_0x4a0e71){if(_0x691281[_0xa3e7('0x41')]['id']){delete _0x691281['body']['id'];}return db[_0xa3e7('0x24')][_0xa3e7('0x3f')]({'where':{'id':_0x691281['params']['id']}})[_0xa3e7('0x1e')](handleEntityNotFound(_0x4a0e71,null))[_0xa3e7('0x1e')](saveUpdates(_0x691281[_0xa3e7('0x41')],null))[_0xa3e7('0x1e')](respondWithResult(_0x4a0e71,null))[_0xa3e7('0x3a')](handleError(_0x4a0e71,null));};exports[_0xa3e7('0x1f')]=function(_0x55589e,_0x325087){return db[_0xa3e7('0x24')][_0xa3e7('0x3f')]({'where':{'id':_0x55589e['params']['id']}})['then'](handleEntityNotFound(_0x325087,null))[_0xa3e7('0x1e')](removeEntity(_0x325087,null))[_0xa3e7('0x3a')](handleError(_0x325087,null));};exports['describe']=function(_0x762158,_0x371532){return db[_0xa3e7('0x24')][_0xa3e7('0x43')]()[_0xa3e7('0x1e')](respondWithResult(_0x371532,null))['catch'](handleError(_0x371532,null));};
\ No newline at end of file
+var _0x3af0=['count','set','Content-Range','json','apply','then','destroy','sendStatus','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','options','include','findAll','catch','show','params','keys','includeAll','merge','find','create','body','update','describe','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','status','end','offset','undefined','limit'];(function(_0x4d3bcb,_0x5af0fe){var _0x594212=function(_0x3cd28d){while(--_0x3cd28d){_0x4d3bcb['push'](_0x4d3bcb['shift']());}};_0x594212(++_0x5af0fe);}(_0x3af0,0x7a));var _0x03af=function(_0x38ba95,_0x2771ae){_0x38ba95=_0x38ba95-0x0;var _0x1f1d33=_0x3af0[_0x38ba95];return _0x1f1d33;};'use strict';var emlformat=require(_0x03af('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x03af('0x1'));var moment=require(_0x03af('0x2'));var BPromise=require(_0x03af('0x3'));var Mustache=require(_0x03af('0x4'));var util=require(_0x03af('0x5'));var path=require(_0x03af('0x6'));var sox=require(_0x03af('0x7'));var csv=require(_0x03af('0x8'));var ejs=require(_0x03af('0x9'));var fs=require('fs');var fs_extra=require(_0x03af('0xa'));var _=require(_0x03af('0xb'));var squel=require('squel');var crypto=require(_0x03af('0xc'));var jsforce=require(_0x03af('0xd'));var deskjs=require(_0x03af('0xe'));var toCsv=require(_0x03af('0x8'));var querystring=require(_0x03af('0xf'));var Papa=require(_0x03af('0x10'));var Redis=require(_0x03af('0x11'));var authService=require(_0x03af('0x12'));var qs=require(_0x03af('0x13'));var as=require(_0x03af('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x03af('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x03af('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xdd0da,_0x2f2ee0){_0x2f2ee0=_0x2f2ee0||0xcc;return function(_0x211204){if(_0x211204){return _0xdd0da['sendStatus'](_0x2f2ee0);}return _0xdd0da[_0x03af('0x17')](_0x2f2ee0)[_0x03af('0x18')]();};}function respondWithResult(_0x4ae4af,_0x242b38){_0x242b38=_0x242b38||0xc8;return function(_0x29faa6){if(_0x29faa6){return _0x4ae4af[_0x03af('0x17')](_0x242b38)['json'](_0x29faa6);}};}function respondWithFilteredResult(_0x1ec51a,_0x3b09ba){return function(_0x505ffc){if(_0x505ffc){var _0x5acac4=typeof _0x3b09ba[_0x03af('0x19')]===_0x03af('0x1a')&&typeof _0x3b09ba[_0x03af('0x1b')]===_0x03af('0x1a');var _0x2ff018=_0x505ffc[_0x03af('0x1c')];var _0x2764c6=_0x5acac4?0x0:_0x3b09ba[_0x03af('0x19')];var _0x3403d9=_0x5acac4?_0x505ffc[_0x03af('0x1c')]:_0x3b09ba[_0x03af('0x19')]+_0x3b09ba[_0x03af('0x1b')];var _0x406c72;if(_0x3403d9>=_0x2ff018){_0x3403d9=_0x2ff018;_0x406c72=0xc8;}else{_0x406c72=0xce;}_0x1ec51a[_0x03af('0x17')](_0x406c72);return _0x1ec51a[_0x03af('0x1d')](_0x03af('0x1e'),_0x2764c6+'-'+_0x3403d9+'/'+_0x2ff018)[_0x03af('0x1f')](_0x505ffc);}return null;};}function patchUpdates(_0x14ec3f){return function(_0x5409c9){try{jsonpatch[_0x03af('0x20')](_0x5409c9,_0x14ec3f,!![]);}catch(_0x2a9402){return BPromise['reject'](_0x2a9402);}return _0x5409c9['save']();};}function saveUpdates(_0x1002ec,_0xa5a2be){return function(_0x4f30a7){if(_0x4f30a7){return _0x4f30a7['update'](_0x1002ec)[_0x03af('0x21')](function(_0x175e16){return _0x175e16;});}return null;};}function removeEntity(_0x11ba0f,_0x11ef06){return function(_0x514d46){if(_0x514d46){return _0x514d46[_0x03af('0x22')]()[_0x03af('0x21')](function(){_0x11ba0f[_0x03af('0x17')](0xcc)[_0x03af('0x18')]();});}};}function handleEntityNotFound(_0x1a8690,_0x1fc081){return function(_0x47fd73){if(!_0x47fd73){_0x1a8690[_0x03af('0x23')](0x194);}return _0x47fd73;};}function handleError(_0x65c145,_0x34274a){_0x34274a=_0x34274a||0x1f4;return function(_0x1205aa){logger[_0x03af('0x24')](_0x1205aa[_0x03af('0x25')]);if(_0x1205aa['name']){delete _0x1205aa[_0x03af('0x26')];}_0x65c145[_0x03af('0x17')](_0x34274a)[_0x03af('0x27')](_0x1205aa);};}exports[_0x03af('0x28')]=function(_0x1ba3c1,_0x33b6b9){var _0x5b4049={},_0x3e4a3b={},_0x54813e={'count':0x0,'rows':[]};var _0x91fa85=_[_0x03af('0x29')](db[_0x03af('0x2a')][_0x03af('0x2b')],function(_0xe8f5d){return{'name':_0xe8f5d[_0x03af('0x2c')],'type':_0xe8f5d[_0x03af('0x2d')][_0x03af('0x2e')]};});_0x3e4a3b[_0x03af('0x2f')]=_[_0x03af('0x29')](_0x91fa85,_0x03af('0x26'));_0x3e4a3b['query']=_['keys'](_0x1ba3c1['query']);_0x3e4a3b[_0x03af('0x30')]=_[_0x03af('0x31')](_0x3e4a3b['model'],_0x3e4a3b[_0x03af('0x32')]);_0x5b4049[_0x03af('0x33')]=_['intersection'](_0x3e4a3b['model'],qs[_0x03af('0x34')](_0x1ba3c1['query']['fields']));_0x5b4049[_0x03af('0x33')]=_0x5b4049[_0x03af('0x33')][_0x03af('0x35')]?_0x5b4049['attributes']:_0x3e4a3b[_0x03af('0x2f')];if(!_0x1ba3c1[_0x03af('0x32')][_0x03af('0x36')](_0x03af('0x37'))){_0x5b4049[_0x03af('0x1b')]=qs[_0x03af('0x1b')](_0x1ba3c1[_0x03af('0x32')][_0x03af('0x1b')]);_0x5b4049[_0x03af('0x19')]=qs[_0x03af('0x19')](_0x1ba3c1['query'][_0x03af('0x19')]);}_0x5b4049[_0x03af('0x38')]=qs[_0x03af('0x39')](_0x1ba3c1['query'][_0x03af('0x39')]);_0x5b4049['where']=qs[_0x03af('0x30')](_[_0x03af('0x3a')](_0x1ba3c1['query'],_0x3e4a3b['filters']),_0x91fa85);if(_0x1ba3c1[_0x03af('0x32')][_0x03af('0x3b')]){_0x5b4049[_0x03af('0x3c')]=_['merge'](_0x5b4049[_0x03af('0x3c')],{'$or':_[_0x03af('0x29')](_0x91fa85,function(_0xefba7){if(_0xefba7[_0x03af('0x2d')]!=='VIRTUAL'){var _0x30351f={};_0x30351f[_0xefba7[_0x03af('0x26')]]={'$like':'%'+_0x1ba3c1[_0x03af('0x32')][_0x03af('0x3b')]+'%'};return _0x30351f;}})});}_0x5b4049=_['merge']({},_0x5b4049,_0x1ba3c1[_0x03af('0x3d')]);var _0x5f23cf={'where':_0x5b4049['where']};return db['ChatTransferReport'][_0x03af('0x1c')](_0x5f23cf)[_0x03af('0x21')](function(_0x3bcb89){_0x54813e[_0x03af('0x1c')]=_0x3bcb89;if(_0x1ba3c1['query']['includeAll']){_0x5b4049[_0x03af('0x3e')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x03af('0x3f')](_0x5b4049);})[_0x03af('0x21')](function(_0x2226e7){_0x54813e['rows']=_0x2226e7;return _0x54813e;})['then'](respondWithFilteredResult(_0x33b6b9,_0x5b4049))[_0x03af('0x40')](handleError(_0x33b6b9,null));};exports[_0x03af('0x41')]=function(_0x51196c,_0x4f0b0f){var _0x5485c3={'raw':!![],'where':{'id':_0x51196c[_0x03af('0x42')]['id']}},_0x554363={};_0x554363[_0x03af('0x2f')]=_[_0x03af('0x43')](db['ChatTransferReport']['rawAttributes']);_0x554363[_0x03af('0x32')]=_[_0x03af('0x43')](_0x51196c[_0x03af('0x32')]);_0x554363[_0x03af('0x30')]=_[_0x03af('0x31')](_0x554363['model'],_0x554363[_0x03af('0x32')]);_0x5485c3[_0x03af('0x33')]=_[_0x03af('0x31')](_0x554363['model'],qs[_0x03af('0x34')](_0x51196c[_0x03af('0x32')]['fields']));_0x5485c3[_0x03af('0x33')]=_0x5485c3[_0x03af('0x33')]['length']?_0x5485c3['attributes']:_0x554363['model'];if(_0x51196c['query'][_0x03af('0x44')]){_0x5485c3[_0x03af('0x3e')]=[{'all':!![]}];}_0x5485c3=_[_0x03af('0x45')]({},_0x5485c3,_0x51196c[_0x03af('0x3d')]);return db[_0x03af('0x2a')][_0x03af('0x46')](_0x5485c3)[_0x03af('0x21')](handleEntityNotFound(_0x4f0b0f,null))['then'](respondWithResult(_0x4f0b0f,null))['catch'](handleError(_0x4f0b0f,null));};exports[_0x03af('0x47')]=function(_0x428834,_0x2af36){return db[_0x03af('0x2a')][_0x03af('0x47')](_0x428834[_0x03af('0x48')],{})[_0x03af('0x21')](respondWithResult(_0x2af36,0xc9))[_0x03af('0x40')](handleError(_0x2af36,null));};exports[_0x03af('0x49')]=function(_0x161394,_0x582141){if(_0x161394['body']['id']){delete _0x161394[_0x03af('0x48')]['id'];}return db[_0x03af('0x2a')]['find']({'where':{'id':_0x161394[_0x03af('0x42')]['id']}})[_0x03af('0x21')](handleEntityNotFound(_0x582141,null))[_0x03af('0x21')](saveUpdates(_0x161394[_0x03af('0x48')],null))[_0x03af('0x21')](respondWithResult(_0x582141,null))[_0x03af('0x40')](handleError(_0x582141,null));};exports[_0x03af('0x22')]=function(_0x4a706a,_0x520247){return db[_0x03af('0x2a')][_0x03af('0x46')]({'where':{'id':_0x4a706a[_0x03af('0x42')]['id']}})[_0x03af('0x21')](handleEntityNotFound(_0x520247,null))['then'](removeEntity(_0x520247,null))[_0x03af('0x40')](handleError(_0x520247,null));};exports['describe']=function(_0x282a5f,_0x58585d){return db[_0x03af('0x2a')][_0x03af('0x4a')]()[_0x03af('0x21')](respondWithResult(_0x58585d,null))['catch'](handleError(_0x58585d,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 1186da4..9c787fa 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 _0x10dc=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger'];(function(_0x3e2d67,_0x3b781a){var _0x429d2a=function(_0x53879f){while(--_0x53879f){_0x3e2d67['push'](_0x3e2d67['shift']());}};_0x429d2a(++_0x3b781a);}(_0x10dc,0x1cc));var _0xc10d=function(_0x15af2f,_0x3c0a01){_0x15af2f=_0x15af2f-0x0;var _0x359239=_0x10dc[_0x15af2f];return _0x359239;};'use strict';var _=require('lodash');var util=require(_0xc10d('0x0'));var logger=require(_0xc10d('0x1'))(_0xc10d('0x2'));var moment=require(_0xc10d('0x3'));var BPromise=require(_0xc10d('0x4'));var rp=require(_0xc10d('0x5'));var fs=require('fs');var path=require(_0xc10d('0x6'));var rimraf=require(_0xc10d('0x7'));var config=require(_0xc10d('0x8'));var attributes=require(_0xc10d('0x9'));module[_0xc10d('0xa')]=function(_0x415277,_0x34785d){return _0x415277['define'](_0xc10d('0xb'),attributes,{'tableName':_0xc10d('0xc'),'paranoid':![],'indexes':[{'name':_0xc10d('0xd'),'fields':[_0xc10d('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x883b=['../../config/environment','./chatTransferReport.attributes','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1cb1a0,_0x538a27){var _0x23d48e=function(_0x101f74){while(--_0x101f74){_0x1cb1a0['push'](_0x1cb1a0['shift']());}};_0x23d48e(++_0x538a27);}(_0x883b,0x12b));var _0xb883=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x883b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb883('0x0'));var util=require(_0xb883('0x1'));var logger=require(_0xb883('0x2'))(_0xb883('0x3'));var moment=require(_0xb883('0x4'));var BPromise=require(_0xb883('0x5'));var rp=require(_0xb883('0x6'));var fs=require('fs');var path=require(_0xb883('0x7'));var rimraf=require(_0xb883('0x8'));var config=require(_0xb883('0x9'));var attributes=require(_0xb883('0xa'));module['exports']=function(_0x5d4493,_0x43871e){return _0x5d4493['define'](_0xb883('0xb'),attributes,{'tableName':_0xb883('0xc'),'paranoid':![],'indexes':[{'name':_0xb883('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index b2dd787..ad5623f 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 _0x0f8e=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','bluebird','randomstring'];(function(_0x203387,_0x25ee77){var _0x358e6b=function(_0xf5b2ff){while(--_0xf5b2ff){_0x203387['push'](_0x203387['shift']());}};_0x358e6b(++_0x25ee77);}(_0x0f8e,0x1d8));var _0xe0f8=function(_0x121336,_0x3370ea){_0x121336=_0x121336-0x0;var _0x53ff9f=_0x0f8e[_0x121336];return _0x53ff9f;};'use strict';var _=require('lodash');var util=require(_0xe0f8('0x0'));var moment=require('moment');var BPromise=require(_0xe0f8('0x1'));var rs=require(_0xe0f8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe0f8('0x3'));var logger=require(_0xe0f8('0x4'))(_0xe0f8('0x5'));var config=require(_0xe0f8('0x6'));var jayson=require(_0xe0f8('0x7'));var client=jayson[_0xe0f8('0x8')][_0xe0f8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f6fa2,_0x4e5c06,_0x2d09f4){return new BPromise(function(_0x3bf20,_0x2eab67){return client[_0xe0f8('0xa')](_0x3f6fa2,_0x2d09f4)['then'](function(_0x54642d){logger[_0xe0f8('0xb')](_0xe0f8('0xc'),_0x4e5c06,_0xe0f8('0xd'));logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x4e5c06,_0xe0f8('0xd'),JSON[_0xe0f8('0xe')](_0x54642d));if(_0x54642d[_0xe0f8('0xf')]){if(_0x54642d['error'][_0xe0f8('0x10')]===0x1f4){logger[_0xe0f8('0xf')](_0xe0f8('0xc'),_0x4e5c06,_0x54642d[_0xe0f8('0xf')]['message']);return _0x2eab67(_0x54642d['error'][_0xe0f8('0x11')]);}logger[_0xe0f8('0xf')](_0xe0f8('0xc'),_0x4e5c06,_0x54642d['error'][_0xe0f8('0x11')]);return _0x3bf20(_0x54642d['error'][_0xe0f8('0x11')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x4e5c06,_0xe0f8('0xd'));_0x3bf20(_0x54642d[_0xe0f8('0x12')][_0xe0f8('0x11')]);}})['catch'](function(_0x1deacb){logger[_0xe0f8('0xf')](_0xe0f8('0xc'),_0x4e5c06,_0x1deacb);_0x2eab67(_0x1deacb);});});}
\ No newline at end of file
+var _0xca00=['stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x481f56,_0x3bf561){var _0x573804=function(_0x4d85f7){while(--_0x4d85f7){_0x481f56['push'](_0x481f56['shift']());}};_0x573804(++_0x3bf561);}(_0xca00,0xa0));var _0x0ca0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xca00[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0ca0('0x0'));var util=require(_0x0ca0('0x1'));var moment=require('moment');var BPromise=require(_0x0ca0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ca0('0x3'));var db=require(_0x0ca0('0x4'))['db'];var utils=require(_0x0ca0('0x5'));var logger=require('../../config/logger')(_0x0ca0('0x6'));var config=require('../../config/environment');var jayson=require(_0x0ca0('0x7'));var client=jayson[_0x0ca0('0x8')][_0x0ca0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x453331,_0x36e26e,_0x24c2eb){return new BPromise(function(_0x237e8a,_0x69d38c){return client[_0x0ca0('0xa')](_0x453331,_0x24c2eb)['then'](function(_0x26c848){logger[_0x0ca0('0xb')](_0x0ca0('0xc'),_0x36e26e,_0x0ca0('0xd'));logger[_0x0ca0('0xe')](_0x0ca0('0xf'),_0x36e26e,'request\x20sent',JSON[_0x0ca0('0x10')](_0x26c848));if(_0x26c848[_0x0ca0('0x11')]){if(_0x26c848[_0x0ca0('0x11')][_0x0ca0('0x12')]===0x1f4){logger[_0x0ca0('0x11')](_0x0ca0('0xc'),_0x36e26e,_0x26c848[_0x0ca0('0x11')][_0x0ca0('0x13')]);return _0x69d38c(_0x26c848[_0x0ca0('0x11')][_0x0ca0('0x13')]);}logger[_0x0ca0('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x36e26e,_0x26c848['error']['message']);return _0x237e8a(_0x26c848[_0x0ca0('0x11')][_0x0ca0('0x13')]);}else{logger[_0x0ca0('0xb')](_0x0ca0('0xc'),_0x36e26e,'request\x20sent');_0x237e8a(_0x26c848[_0x0ca0('0x14')][_0x0ca0('0x13')]);}})[_0x0ca0('0x15')](function(_0x5c3de4){logger[_0x0ca0('0x11')](_0x0ca0('0xc'),_0x36e26e,_0x5c3de4);_0x69d38c(_0x5c3de4);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 3c52ca0..5579c00 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 _0x671f=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','post','create','put','/:id','update','delete','destroy','multer','util'];(function(_0x28422e,_0xc26e22){var _0x40eb0c=function(_0x2e6798){while(--_0x2e6798){_0x28422e['push'](_0x28422e['shift']());}};_0x40eb0c(++_0xc26e22);}(_0x671f,0x139));var _0xf671=function(_0x2f9d5e,_0x32c2c2){_0x2f9d5e=_0x2f9d5e-0x0;var _0x1ed863=_0x671f[_0x2f9d5e];return _0x1ed863;};'use strict';var multer=require(_0xf671('0x0'));var util=require(_0xf671('0x1'));var path=require('path');var timeout=require(_0xf671('0x2'));var express=require(_0xf671('0x3'));var router=express[_0xf671('0x4')]();var fs_extra=require(_0xf671('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf671('0x6'));var config=require(_0xf671('0x7'));var controller=require(_0xf671('0x8'));router[_0xf671('0x9')]('/',auth[_0xf671('0xa')](),controller[_0xf671('0xb')]);router[_0xf671('0x9')](_0xf671('0xc'),auth['isAuthenticated'](),controller[_0xf671('0xd')]);router[_0xf671('0x9')]('/:id',auth[_0xf671('0xa')](),controller['show']);router[_0xf671('0xe')]('/',auth[_0xf671('0xa')](),controller[_0xf671('0xf')]);router[_0xf671('0x10')](_0xf671('0x11'),auth[_0xf671('0xa')](),controller[_0xf671('0x12')]);router[_0xf671('0x13')](_0xf671('0x11'),auth[_0xf671('0xa')](),controller[_0xf671('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x5700=['update','delete','/:id','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index','get','/describe','describe','show','post','create','put'];(function(_0x58eed6,_0x49a046){var _0x381fa7=function(_0x1ebf98){while(--_0x1ebf98){_0x58eed6['push'](_0x58eed6['shift']());}};_0x381fa7(++_0x49a046);}(_0x5700,0x191));var _0x0570=function(_0xce8629,_0x530a76){_0xce8629=_0xce8629-0x0;var _0x649762=_0x5700[_0xce8629];return _0x649762;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0570('0x0'));var timeout=require(_0x0570('0x1'));var express=require('express');var router=express[_0x0570('0x2')]();var fs_extra=require(_0x0570('0x3'));var auth=require(_0x0570('0x4'));var interaction=require(_0x0570('0x5'));var config=require(_0x0570('0x6'));var controller=require(_0x0570('0x7'));router['get']('/',auth[_0x0570('0x8')](),controller[_0x0570('0x9')]);router[_0x0570('0xa')](_0x0570('0xb'),auth[_0x0570('0x8')](),controller[_0x0570('0xc')]);router[_0x0570('0xa')]('/:id',auth[_0x0570('0x8')](),controller[_0x0570('0xd')]);router[_0x0570('0xe')]('/',auth[_0x0570('0x8')](),controller[_0x0570('0xf')]);router[_0x0570('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x0570('0x11')]);router[_0x0570('0x12')](_0x0570('0x13'),auth[_0x0570('0x8')](),controller[_0x0570('0x14')]);module[_0x0570('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 7e6b880..f59dd4b 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 _0x86d1=['alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Skip','star','thumb','input','name','onlineForm','parse','getDataValue','setDataValue','stringify','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','website_alias','bottom_right'];(function(_0xcdc75,_0x4990c6){var _0x51d75c=function(_0xa56b12){while(--_0xa56b12){_0xcdc75['push'](_0xcdc75['shift']());}};_0x51d75c(++_0x4990c6);}(_0x86d1,0x149));var _0x186d=function(_0x2db265,_0x3ecc75){_0x2db265=_0x2db265-0x0;var _0x4dbb5e=_0x86d1[_0x2db265];return _0x4dbb5e;};'use strict';var Sequelize=require(_0x186d('0x0'));var rs=require('randomstring');module[_0x186d('0x1')]={'name':{'type':Sequelize[_0x186d('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x186d('0x3')},'description':{'type':Sequelize[_0x186d('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0x4')},'key':{'type':Sequelize[_0x186d('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0x5')},'customerAlias':{'type':Sequelize[_0x186d('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x186d('0x2')],'allowNull':![],'defaultValue':_0x186d('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x186d('0x2')],'allowNull':![],'defaultValue':_0x186d('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x186d('0x2')],'allowNull':![],'defaultValue':_0x186d('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x186d('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x186d('0x2')]},'animation':{'type':Sequelize[_0x186d('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x186d('0xa')](_0x186d('0xb'),_0x186d('0xc')),'defaultValue':_0x186d('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x186d('0xd')},'start_chat_button':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0xe')},'offline_chat_button':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0xf')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x186d('0x10')},'download_transcript':{'type':Sequelize[_0x186d('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x186d('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x186d('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x186d('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x186d('0x11')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0x13')},'noteTitle':{'type':Sequelize[_0x186d('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x186d('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0xf')},'skipMessageButton':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0x14')},'conditionAgreement':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x186d('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x186d('0xa')](_0x186d('0x15'),_0x186d('0x16')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x186d('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x186d('0x17'),'variable':null,'config':{'placeholder':_0x186d('0x18'),'type':'text','required':!![]},'props':{'title':_0x186d('0x18'),'helpText':''}},{'type':_0x186d('0x17'),'props':{'title':_0x186d('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x186d('0x4'),'type':_0x186d('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x186d('0x19'))?JSON[_0x186d('0x1a')](this[_0x186d('0x1b')](_0x186d('0x19'))):{};},'set':function(_0x422898){return this[_0x186d('0x1c')](_0x186d('0x19'),JSON[_0x186d('0x1d')](_0x422898));}},'offlineForm':{'type':Sequelize[_0x186d('0x11')],'defaultValue':function(){return JSON[_0x186d('0x1d')]({'items':[{'type':_0x186d('0x17'),'props':{'title':_0x186d('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x186d('0x4'),'type':_0x186d('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0x186d('0x1e'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x186d('0x1b')](_0x186d('0x1f'))?JSON[_0x186d('0x1a')](this[_0x186d('0x1b')](_0x186d('0x1f'))):{};},'set':function(_0x11092c){return this[_0x186d('0x1c')](_0x186d('0x1f'),JSON[_0x186d('0x1d')](_0x11092c));}},'token':{'type':Sequelize[_0x186d('0x2')],'defaultValue':function(){return rs[_0x186d('0x20')]();}},'autoclose':{'type':Sequelize[_0x186d('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x186d('0x2')]},'forwardOffline':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0x21')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x186d('0x22')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x186d('0x23')},'offlineMessageBody':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0x24')},'enableUnmanagedNote':{'type':Sequelize[_0x186d('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x186d('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0x14')},'sendUnmanaged':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0xf')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x186d('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x186d('0x2')]},'notificationTemplate':{'type':Sequelize[_0x186d('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x186d('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x186d('0x25')},'waitForTheAssignedAgent':{'type':Sequelize[_0x186d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x186d('0x26')},'verticalAlignment':{'type':Sequelize[_0x186d('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0x27')},'defaultTitle':{'type':Sequelize[_0x186d('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x186d('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x186d('0x2')],'allowNull':![],'defaultValue':_0x186d('0x28'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x186d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0x29')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x186d('0x8')],'comment':_0x186d('0x2a')},'mandatoryDisposition':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x63327f){if(!_0x63327f)this[_0x186d('0x1c')](_0x186d('0x2b'),null);this[_0x186d('0x1c')](_0x186d('0x2c'),_0x63327f);}},'vidaooEscalation':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x186d('0x2')]},'vidaooTopic':{'type':Sequelize[_0x186d('0x2')],'allowNull':![],'defaultValue':_0x186d('0x2d')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x186d('0x11')]}};
\ No newline at end of file
+var _0xfcb7=['We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','stringify','input','name','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared'];(function(_0x11e6d6,_0x93cb1){var _0x4df6bb=function(_0x3866c9){while(--_0x3866c9){_0x11e6d6['push'](_0x11e6d6['shift']());}};_0x4df6bb(++_0x93cb1);}(_0xfcb7,0x1c7));var _0x7fcb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfcb7[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7fcb('0x0'));var rs=require('randomstring');module[_0x7fcb('0x1')]={'name':{'type':Sequelize[_0x7fcb('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7fcb('0x3')},'description':{'type':Sequelize[_0x7fcb('0x2')]},'mapKey':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x7fcb('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0x5')},'customerAlias':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7fcb('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x7fcb('0x2')],'allowNull':![],'defaultValue':_0x7fcb('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x7fcb('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x7fcb('0x2')]},'animation':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x7fcb('0xa')](_0x7fcb('0xb'),_0x7fcb('0xc')),'defaultValue':_0x7fcb('0xb')},'header_online':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0xd')},'start_chat_button':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0xe')},'offline_chat_button':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0xf')},'header_offline':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0x10')},'download_transcript':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x7fcb('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0x11')},'defaultWhiteLabel':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x7fcb('0x12')]},'closingQuestion':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0x13')},'formSubmitSuccessMessage':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0x14')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0x15')},'placeholderMessage':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0x16')},'closingMessage':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0x17')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0x18')},'ratingType':{'type':Sequelize['ENUM'](_0x7fcb('0x19'),_0x7fcb('0x1a')),'defaultValue':_0x7fcb('0x19')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x7fcb('0x12')],'defaultValue':function(){return JSON[_0x7fcb('0x1b')]({'items':[{'type':_0x7fcb('0x1c'),'variable':null,'config':{'placeholder':_0x7fcb('0x1d'),'type':'text','required':!![]},'props':{'title':_0x7fcb('0x1d'),'helpText':''}},{'type':_0x7fcb('0x1c'),'props':{'title':_0x7fcb('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x7fcb('0x1e')](_0x7fcb('0x1f'))?JSON[_0x7fcb('0x20')](this[_0x7fcb('0x1e')](_0x7fcb('0x1f'))):{};},'set':function(_0x4aeaff){return this[_0x7fcb('0x21')](_0x7fcb('0x1f'),JSON[_0x7fcb('0x1b')](_0x4aeaff));}},'offlineForm':{'type':Sequelize[_0x7fcb('0x12')],'defaultValue':function(){return JSON[_0x7fcb('0x1b')]({'items':[{'type':_0x7fcb('0x1c'),'props':{'title':_0x7fcb('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x7fcb('0x4'),'type':_0x7fcb('0x4')},'variable':null},{'type':_0x7fcb('0x22'),'config':{'placeholder':_0x7fcb('0x23')},'props':{'title':_0x7fcb('0x23'),'helpText':_0x7fcb('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0x7fcb('0x1e')](_0x7fcb('0x25'))?JSON[_0x7fcb('0x20')](this['getDataValue'](_0x7fcb('0x25'))):{};},'set':function(_0x359aee){return this[_0x7fcb('0x21')](_0x7fcb('0x25'),JSON[_0x7fcb('0x1b')](_0x359aee));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x7fcb('0x2')]},'forwardOffline':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x7fcb('0x2')]},'waitingTitle':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0x26')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x7fcb('0x27')},'offlineMessageSubject':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0x28')},'offlineMessageBody':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x7fcb('0x2a')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x7fcb('0xf')},'enableCustomerAttachment':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x7fcb('0x12')]},'showAgentAvatar':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x7fcb('0x2')]},'notificationTemplate':{'type':Sequelize[_0x7fcb('0x12')],'defaultValue':function(){return _0x7fcb('0x2b');}},'notificationSound':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0x7fcb('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0x2d')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0x2e')},'defaultTitle':{'type':Sequelize[_0x7fcb('0x2')]},'customerAvatar':{'type':Sequelize[_0x7fcb('0x12')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x7fcb('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7fcb('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0x2f')},'systemAvatar':{'type':Sequelize[_0x7fcb('0x12')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7fcb('0x8')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':![],'comment':_0x7fcb('0x30'),'set':function(_0x4ec051){if(!_0x4ec051)this[_0x7fcb('0x21')](_0x7fcb('0x31'),null);this['setDataValue']('mandatoryDisposition',_0x4ec051);}},'vidaooEscalation':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x7fcb('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7fcb('0x32')},'vidaooNote':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':function(){return _0x7fcb('0x33');}},'vidaooMetadata':{'type':Sequelize[_0x7fcb('0x12')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x7fcb('0x12')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 6bfb6e0..ef48c90 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 _0xaa04=['device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','messageId','created','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','includes','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','ListId','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','offline-chat','basename','sequelize','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','host','port','secure','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','email','openNewInteraction','MailAccountId','mapValues','subjectOffline','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','Interval','getProactiveActions','virtual','custom','increment','chatLicenseExceeded','Intervals','push','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','referer','replace','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','transaction','ChatApplication','getApplications','addProactiveActions','ChatProactiveAction','online','false','offlineForm','items','fromKey','Attachment','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','register','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','result','catch','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','include','rows','show','includeAll','merge','find','create','body','user','role','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findAll','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','addLogo','sitepic','file','filename','addAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','../../config/license/util','isNil','existsSync','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','user-agent-parser','setUA','headers','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','Applications','account','applications','list','orderBy','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','browser','version','unknown','format','%s\x20%s'];(function(_0x1393cc,_0x3d0294){var _0x4fd93f=function(_0xe8c979){while(--_0xe8c979){_0x1393cc['push'](_0x1393cc['shift']());}};_0x4fd93f(++_0x3d0294);}(_0xaa04,0x81));var _0x4aa0=function(_0x3fbce4,_0xbef8bb){_0x3fbce4=_0x3fbce4-0x0;var _0x9ba40f=_0xaa04[_0x3fbce4];return _0x9ba40f;};'use strict';var emlformat=require(_0x4aa0('0x0'));var rimraf=require(_0x4aa0('0x1'));var zipdir=require(_0x4aa0('0x2'));var jsonpatch=require(_0x4aa0('0x3'));var rp=require(_0x4aa0('0x4'));var moment=require(_0x4aa0('0x5'));var BPromise=require(_0x4aa0('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4aa0('0x7'));var sox=require('sox');var csv=require(_0x4aa0('0x8'));var ejs=require(_0x4aa0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4aa0('0xa'));var crypto=require(_0x4aa0('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4aa0('0xc'));var toCsv=require(_0x4aa0('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4aa0('0xd'));var qs=require(_0x4aa0('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4aa0('0xf'));var logger=require('../../config/logger')(_0x4aa0('0x10'));var utils=require(_0x4aa0('0x11'));var config=require(_0x4aa0('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x4aa0('0x13'))['db'];config[_0x4aa0('0x14')]=_[_0x4aa0('0x15')](config[_0x4aa0('0x14')],{'host':_0x4aa0('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4aa0('0x17'))[_0x4aa0('0x18')](socket);var jayson=require(_0x4aa0('0x19'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x4aa0('0x1a')][_0x4aa0('0x1b')]({'port':0x232a});var client9003=jayson[_0x4aa0('0x1a')][_0x4aa0('0x1b')]({'port':0x232b});var client9001=jayson[_0x4aa0('0x1a')][_0x4aa0('0x1b')]({'port':0x2329});function respondWithRpcPromise(_0x3633e1,_0x37f871,_0x374437,_0x1bb649){return new BPromise(function(_0x44eba1,_0xe2494){var _0x53927a=_0x1bb649||client;return _0x53927a[_0x4aa0('0x1c')](_0x3633e1,_0x374437)[_0x4aa0('0x1d')](function(_0x59888b){logger[_0x4aa0('0x1e')](_0x4aa0('0x1f'),_0x37f871,_0x4aa0('0x20'));logger[_0x4aa0('0x21')](_0x4aa0('0x22'),_0x37f871,_0x4aa0('0x20'),JSON[_0x4aa0('0x23')](_0x59888b));if(_0x59888b[_0x4aa0('0x24')]){if(_0x59888b[_0x4aa0('0x24')][_0x4aa0('0x25')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x37f871,_0x59888b[_0x4aa0('0x24')][_0x4aa0('0x26')]);return _0xe2494(_0x59888b[_0x4aa0('0x24')][_0x4aa0('0x26')]);}logger[_0x4aa0('0x24')](_0x4aa0('0x1f'),_0x37f871,_0x59888b[_0x4aa0('0x24')][_0x4aa0('0x26')]);return _0x44eba1(_0x59888b[_0x4aa0('0x24')][_0x4aa0('0x26')]);}else{logger[_0x4aa0('0x1e')](_0x4aa0('0x1f'),_0x37f871,_0x4aa0('0x20'));_0x44eba1(_0x59888b[_0x4aa0('0x27')][_0x4aa0('0x26')]);}})[_0x4aa0('0x28')](function(_0x281973){logger[_0x4aa0('0x24')](_0x4aa0('0x1f'),_0x37f871,_0x281973);_0xe2494(_0x281973);});});}function respondWithStatusCode(_0x3b1289,_0x26498b){_0x26498b=_0x26498b||0xcc;return function(_0x1ca7f4){if(_0x1ca7f4){return _0x3b1289[_0x4aa0('0x29')](_0x26498b);}return _0x3b1289[_0x4aa0('0x2a')](_0x26498b)[_0x4aa0('0x2b')]();};}function respondWithResult(_0x19e11d,_0x4844cd){_0x4844cd=_0x4844cd||0xc8;return function(_0x3b59a8){if(_0x3b59a8){return _0x19e11d[_0x4aa0('0x2a')](_0x4844cd)['json'](_0x3b59a8);}};}function respondWithFilteredResult(_0x7eece4,_0x33fcd3){return function(_0x164f2c){if(_0x164f2c){var _0x422acc=typeof _0x33fcd3[_0x4aa0('0x2c')]==='undefined'&&typeof _0x33fcd3[_0x4aa0('0x2d')]===_0x4aa0('0x2e');var _0x81c22b=_0x164f2c['count'];var _0x2fee9b=_0x422acc?0x0:_0x33fcd3[_0x4aa0('0x2c')];var _0x2761de=_0x422acc?_0x164f2c[_0x4aa0('0x2f')]:_0x33fcd3[_0x4aa0('0x2c')]+_0x33fcd3[_0x4aa0('0x2d')];var _0x416608;if(_0x2761de>=_0x81c22b){_0x2761de=_0x81c22b;_0x416608=0xc8;}else{_0x416608=0xce;}_0x7eece4[_0x4aa0('0x2a')](_0x416608);return _0x7eece4[_0x4aa0('0x30')](_0x4aa0('0x31'),_0x2fee9b+'-'+_0x2761de+'/'+_0x81c22b)[_0x4aa0('0x32')](_0x164f2c);}return null;};}function patchUpdates(_0x248c09){return function(_0x1b6ce6){try{jsonpatch[_0x4aa0('0x33')](_0x1b6ce6,_0x248c09,!![]);}catch(_0x41b566){return BPromise[_0x4aa0('0x34')](_0x41b566);}return _0x1b6ce6[_0x4aa0('0x35')]();};}function saveUpdates(_0x3e2b45,_0x25dd80){return function(_0x140b6d){if(_0x140b6d){return _0x140b6d[_0x4aa0('0x36')](_0x3e2b45)['then'](function(_0xd871ff){return _0xd871ff;});}return null;};}function removeEntity(_0x1123de,_0x5177e5){return function(_0x1bcc3d){if(_0x1bcc3d){return _0x1bcc3d[_0x4aa0('0x37')]()[_0x4aa0('0x1d')](function(){var _0x210196=_0x1bcc3d[_0x4aa0('0x38')]({'plain':!![]});var _0x1f96a8='ChatWebsites';return db[_0x4aa0('0x39')][_0x4aa0('0x37')]({'where':{'type':_0x1f96a8,'resourceId':_0x210196['id']}})[_0x4aa0('0x1d')](function(){return _0x1bcc3d;});})['then'](function(){_0x1123de['status'](0xcc)[_0x4aa0('0x2b')]();});}};}function handleEntityNotFound(_0x4e738d,_0x3ffb21){return function(_0x48113e){if(!_0x48113e){_0x4e738d['sendStatus'](0x194);}return _0x48113e;};}function handleError(_0x2b095e,_0x1d342d){_0x1d342d=_0x1d342d||0x1f4;return function(_0x219762){logger[_0x4aa0('0x24')](_0x219762[_0x4aa0('0x3a')]);if(_0x219762[_0x4aa0('0x3b')]){delete _0x219762[_0x4aa0('0x3b')];}_0x2b095e[_0x4aa0('0x2a')](_0x1d342d)[_0x4aa0('0x3c')](_0x219762);};}exports[_0x4aa0('0x3d')]=function(_0x5cc43e,_0x566105){var _0x35bdb6={'include':[{'model':db[_0x4aa0('0x3e')],'as':_0x4aa0('0x3f')}]},_0x3acfc9={},_0x375a09={'count':0x0,'rows':[]};var _0x2708f8=_['map'](db[_0x4aa0('0x40')][_0x4aa0('0x41')],function(_0x1886c6){return{'name':_0x1886c6[_0x4aa0('0x42')],'type':_0x1886c6[_0x4aa0('0x43')][_0x4aa0('0x44')]};});_0x3acfc9[_0x4aa0('0x45')]=_[_0x4aa0('0x46')](_0x2708f8,_0x4aa0('0x3b'));_0x3acfc9[_0x4aa0('0x47')]=_[_0x4aa0('0x48')](_0x5cc43e[_0x4aa0('0x47')]);_0x3acfc9[_0x4aa0('0x49')]=_[_0x4aa0('0x4a')](_0x3acfc9[_0x4aa0('0x45')],_0x3acfc9[_0x4aa0('0x47')]);_0x35bdb6[_0x4aa0('0x4b')]=_[_0x4aa0('0x4a')](_0x3acfc9[_0x4aa0('0x45')],qs[_0x4aa0('0x4c')](_0x5cc43e[_0x4aa0('0x47')][_0x4aa0('0x4c')]));_0x35bdb6[_0x4aa0('0x4b')]=_0x35bdb6[_0x4aa0('0x4b')][_0x4aa0('0x4d')]?_0x35bdb6['attributes']:_0x3acfc9[_0x4aa0('0x45')];if(!_0x5cc43e[_0x4aa0('0x47')][_0x4aa0('0x4e')](_0x4aa0('0x4f'))){_0x35bdb6['limit']=qs['limit'](_0x5cc43e[_0x4aa0('0x47')]['limit']);_0x35bdb6[_0x4aa0('0x2c')]=qs[_0x4aa0('0x2c')](_0x5cc43e[_0x4aa0('0x47')][_0x4aa0('0x2c')]);}_0x35bdb6[_0x4aa0('0x50')]=qs['sort'](_0x5cc43e[_0x4aa0('0x47')][_0x4aa0('0x51')]);_0x35bdb6[_0x4aa0('0x52')]=qs[_0x4aa0('0x49')](_[_0x4aa0('0x53')](_0x5cc43e[_0x4aa0('0x47')],_0x3acfc9[_0x4aa0('0x49')]),_0x2708f8);if(_0x5cc43e['query'][_0x4aa0('0x54')]){_0x35bdb6[_0x4aa0('0x52')]=_['merge'](_0x35bdb6['where'],{'$or':_[_0x4aa0('0x46')](_0x2708f8,function(_0x51c71c){if(_0x51c71c[_0x4aa0('0x43')]!==_0x4aa0('0x55')){var _0x3e5d79={};_0x3e5d79[_0x51c71c[_0x4aa0('0x3b')]]={'$like':'%'+_0x5cc43e['query']['filter']+'%'};return _0x3e5d79;}})});}_0x35bdb6=_['merge']({},_0x35bdb6,_0x5cc43e[_0x4aa0('0x56')]);var _0x30ee67={'where':_0x35bdb6[_0x4aa0('0x52')]};return db['ChatWebsite']['count'](_0x30ee67)[_0x4aa0('0x1d')](function(_0x1fc47f){_0x375a09[_0x4aa0('0x2f')]=_0x1fc47f;if(_0x5cc43e['query']['includeAll']){_0x35bdb6[_0x4aa0('0x57')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x35bdb6);})['then'](function(_0x7be635){_0x375a09[_0x4aa0('0x58')]=_0x7be635;return _0x375a09;})[_0x4aa0('0x1d')](respondWithFilteredResult(_0x566105,_0x35bdb6))['catch'](handleError(_0x566105,null));};exports[_0x4aa0('0x59')]=function(_0x144af8,_0x752c52){var _0x79d32c={'raw':![],'where':{'id':_0x144af8['params']['id']},'include':[{'model':db[_0x4aa0('0x3e')],'as':_0x4aa0('0x3f')}]},_0x441cca={};_0x441cca[_0x4aa0('0x45')]=_[_0x4aa0('0x48')](db[_0x4aa0('0x40')][_0x4aa0('0x41')]);_0x441cca[_0x4aa0('0x47')]=_[_0x4aa0('0x48')](_0x144af8[_0x4aa0('0x47')]);_0x441cca['filters']=_[_0x4aa0('0x4a')](_0x441cca[_0x4aa0('0x45')],_0x441cca['query']);_0x79d32c[_0x4aa0('0x4b')]=_[_0x4aa0('0x4a')](_0x441cca[_0x4aa0('0x45')],qs[_0x4aa0('0x4c')](_0x144af8[_0x4aa0('0x47')][_0x4aa0('0x4c')]));_0x79d32c[_0x4aa0('0x4b')]=_0x79d32c[_0x4aa0('0x4b')][_0x4aa0('0x4d')]?_0x79d32c[_0x4aa0('0x4b')]:_0x441cca['model'];if(_0x144af8[_0x4aa0('0x47')][_0x4aa0('0x5a')]){_0x79d32c[_0x4aa0('0x57')]=[{'all':!![]}];}_0x79d32c=_[_0x4aa0('0x5b')]({},_0x79d32c,_0x144af8[_0x4aa0('0x56')]);return db[_0x4aa0('0x40')][_0x4aa0('0x5c')](_0x79d32c)[_0x4aa0('0x1d')](handleEntityNotFound(_0x752c52,null))[_0x4aa0('0x1d')](respondWithResult(_0x752c52,null))[_0x4aa0('0x28')](handleError(_0x752c52,null));};exports[_0x4aa0('0x5d')]=function(_0x6557e4,_0x884673){return db[_0x4aa0('0x40')][_0x4aa0('0x5d')](_0x6557e4[_0x4aa0('0x5e')],{})[_0x4aa0('0x1d')](function(_0x4dd5cd){var _0x82c3ee=_0x6557e4[_0x4aa0('0x5f')][_0x4aa0('0x38')]({'plain':!![]});if(!_0x82c3ee)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x82c3ee[_0x4aa0('0x60')]==='user'){var _0x1c4620=_0x4dd5cd[_0x4aa0('0x38')]({'plain':!![]});var _0x312025=_0x4aa0('0x61');return db[_0x4aa0('0x62')]['find']({'where':{'name':_0x312025,'userProfileId':_0x82c3ee[_0x4aa0('0x63')]},'raw':!![]})[_0x4aa0('0x1d')](function(_0x4cb7fc){if(_0x4cb7fc&&_0x4cb7fc[_0x4aa0('0x64')]===0x0){return db[_0x4aa0('0x39')]['create']({'name':_0x1c4620['name'],'resourceId':_0x1c4620['id'],'type':_0x4cb7fc[_0x4aa0('0x3b')],'sectionId':_0x4cb7fc['id']},{})[_0x4aa0('0x1d')](function(){return _0x4dd5cd;});}else{return _0x4dd5cd;}})[_0x4aa0('0x28')](function(_0x57cb73){logger[_0x4aa0('0x24')](_0x4aa0('0x65'),_0x57cb73);throw _0x57cb73;});}return _0x4dd5cd;})[_0x4aa0('0x1d')](respondWithResult(_0x884673,0xc9))[_0x4aa0('0x28')](handleError(_0x884673,null));};exports[_0x4aa0('0x36')]=function(_0x5aede6,_0x4dce37){if(_0x5aede6[_0x4aa0('0x5e')]['id']){delete _0x5aede6[_0x4aa0('0x5e')]['id'];}return db[_0x4aa0('0x40')][_0x4aa0('0x5c')]({'where':{'id':_0x5aede6[_0x4aa0('0x66')]['id']},'include':[{'model':db[_0x4aa0('0x3e')],'as':'mandatoryDispositionPause'}]})[_0x4aa0('0x1d')](handleEntityNotFound(_0x4dce37,null))[_0x4aa0('0x1d')](saveUpdates(_0x5aede6['body'],null))[_0x4aa0('0x1d')](respondWithResult(_0x4dce37,null))['catch'](handleError(_0x4dce37,null));};exports[_0x4aa0('0x37')]=function(_0x4aa441,_0x557be1){return db[_0x4aa0('0x40')][_0x4aa0('0x5c')]({'where':{'id':_0x4aa441['params']['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x557be1,null))[_0x4aa0('0x1d')](removeEntity(_0x557be1,null))[_0x4aa0('0x28')](handleError(_0x557be1,null));};exports[_0x4aa0('0x67')]=function(_0x3c2b3f,_0x313bb3){return db[_0x4aa0('0x40')][_0x4aa0('0x67')]()[_0x4aa0('0x1d')](respondWithResult(_0x313bb3,null))[_0x4aa0('0x28')](handleError(_0x313bb3,null));};exports[_0x4aa0('0x68')]=function(_0x5039bd,_0x376d3c,_0xd9b30){if(_0x5039bd[_0x4aa0('0x5e')]['id']){delete _0x5039bd['body']['id'];}return db[_0x4aa0('0x40')][_0x4aa0('0x5c')]({'where':{'id':_0x5039bd['params']['id']}})['then'](handleEntityNotFound(_0x376d3c,null))['then'](function(_0x4a73c5){if(_0x4a73c5){_0x5039bd['body'][_0x4aa0('0x69')]=_0x4a73c5['id'];return db[_0x4aa0('0x6a')]['create'](_0x5039bd[_0x4aa0('0x5e')]);}})['then'](respondWithResult(_0x376d3c,null))[_0x4aa0('0x28')](handleError(_0x376d3c,null));};exports[_0x4aa0('0x6b')]=function(_0x32b25a,_0x123964,_0xe44d4c){var _0x1b5386={'raw':![],'where':{}};var _0x1ac92c={};var _0x51b86b={'count':0x0,'rows':[]};return db[_0x4aa0('0x40')]['findOne']({'where':{'id':_0x32b25a[_0x4aa0('0x66')]['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x123964,null))[_0x4aa0('0x1d')](function(_0x1758c4){if(_0x1758c4){_0x1ac92c[_0x4aa0('0x45')]=_[_0x4aa0('0x48')](db[_0x4aa0('0x6a')][_0x4aa0('0x41')]);_0x1ac92c['query']=_[_0x4aa0('0x48')](_0x32b25a['query']);_0x1ac92c[_0x4aa0('0x49')]=_['intersection'](_0x1ac92c[_0x4aa0('0x45')],_0x1ac92c['query']);_0x1b5386[_0x4aa0('0x4b')]=_[_0x4aa0('0x4a')](_0x1ac92c[_0x4aa0('0x45')],qs[_0x4aa0('0x4c')](_0x32b25a[_0x4aa0('0x47')]['fields']));_0x1b5386['attributes']=_0x1b5386[_0x4aa0('0x4b')][_0x4aa0('0x4d')]?_0x1b5386[_0x4aa0('0x4b')]:_0x1ac92c[_0x4aa0('0x45')];if(!_0x32b25a[_0x4aa0('0x47')]['hasOwnProperty']('nolimit')){_0x1b5386[_0x4aa0('0x2d')]=qs['limit'](_0x32b25a[_0x4aa0('0x47')][_0x4aa0('0x2d')]);_0x1b5386[_0x4aa0('0x2c')]=qs[_0x4aa0('0x2c')](_0x32b25a[_0x4aa0('0x47')][_0x4aa0('0x2c')]);}_0x1b5386[_0x4aa0('0x50')]=qs[_0x4aa0('0x51')](_0x32b25a[_0x4aa0('0x47')][_0x4aa0('0x51')]);_0x1b5386[_0x4aa0('0x52')]=qs[_0x4aa0('0x49')](_[_0x4aa0('0x53')](_0x32b25a[_0x4aa0('0x47')],_0x1ac92c[_0x4aa0('0x49')]));_0x1b5386[_0x4aa0('0x52')][_0x4aa0('0x69')]=_0x1758c4['id'];if(_0x32b25a[_0x4aa0('0x47')]['filter']){_0x1b5386['where']=_[_0x4aa0('0x5b')](_0x1b5386[_0x4aa0('0x52')],{'$or':_[_0x4aa0('0x46')](_0x1b5386[_0x4aa0('0x4b')],function(_0x255a9c){var _0x6f6122={};_0x6f6122[_0x255a9c]={'$like':'%'+_0x32b25a[_0x4aa0('0x47')][_0x4aa0('0x54')]+'%'};return _0x6f6122;})});}_0x1b5386=_[_0x4aa0('0x5b')]({},_0x1b5386,_0x32b25a[_0x4aa0('0x56')]);return db[_0x4aa0('0x6a')]['count']({'where':_0x1b5386[_0x4aa0('0x52')]})[_0x4aa0('0x1d')](function(_0x9f9297){_0x51b86b[_0x4aa0('0x2f')]=_0x9f9297;if(_0x32b25a['query'][_0x4aa0('0x5a')]){_0x1b5386[_0x4aa0('0x57')]=[{'all':!![]}];}return db[_0x4aa0('0x6a')][_0x4aa0('0x6c')](_0x1b5386);})[_0x4aa0('0x1d')](function(_0x17ed78){_0x51b86b[_0x4aa0('0x58')]=_0x17ed78;return _0x51b86b;});}})[_0x4aa0('0x1d')](respondWithFilteredResult(_0x123964,_0x1b5386))['catch'](handleError(_0x123964,null));};exports[_0x4aa0('0x6d')]=function(_0x6f864,_0x1d0038,_0x5754ba){return db['ChatWebsite'][_0x4aa0('0x5c')]({'where':{'id':_0x6f864['params']['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x1d0038,null))[_0x4aa0('0x1d')](function(_0x2eaba5){if(_0x2eaba5){return _0x2eaba5['removeDispositions'](_0x6f864[_0x4aa0('0x47')][_0x4aa0('0x6e')]);}})[_0x4aa0('0x1d')](respondWithStatusCode(_0x1d0038,null))['catch'](handleError(_0x1d0038,null));};exports[_0x4aa0('0x6f')]=function(_0x3d60ff,_0x54d4c7,_0x3c4d74){if(_0x3d60ff[_0x4aa0('0x5e')]['id']){delete _0x3d60ff[_0x4aa0('0x5e')]['id'];}return db[_0x4aa0('0x40')][_0x4aa0('0x5c')]({'where':{'id':_0x3d60ff[_0x4aa0('0x66')]['id']}})['then'](handleEntityNotFound(_0x54d4c7,null))['then'](function(_0x5fb62d){if(_0x5fb62d){_0x3d60ff[_0x4aa0('0x5e')][_0x4aa0('0x69')]=_0x5fb62d['id'];return db[_0x4aa0('0x70')][_0x4aa0('0x5d')](_0x3d60ff['body']);}})[_0x4aa0('0x1d')](respondWithResult(_0x54d4c7,null))['catch'](handleError(_0x54d4c7,null));};exports['getAnswers']=function(_0x209d98,_0x12b55c,_0x29941b){var _0x521540={'raw':![],'where':{}};var _0xcff7d9={};var _0x4a1b3b={'count':0x0,'rows':[]};return db[_0x4aa0('0x40')][_0x4aa0('0x71')]({'where':{'id':_0x209d98['params']['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x12b55c,null))[_0x4aa0('0x1d')](function(_0x2c516b){if(_0x2c516b){_0xcff7d9[_0x4aa0('0x45')]=_[_0x4aa0('0x48')](db['CannedAnswer'][_0x4aa0('0x41')]);_0xcff7d9[_0x4aa0('0x47')]=_[_0x4aa0('0x48')](_0x209d98['query']);_0xcff7d9[_0x4aa0('0x49')]=_[_0x4aa0('0x4a')](_0xcff7d9['model'],_0xcff7d9[_0x4aa0('0x47')]);_0x521540['attributes']=_[_0x4aa0('0x4a')](_0xcff7d9[_0x4aa0('0x45')],qs[_0x4aa0('0x4c')](_0x209d98[_0x4aa0('0x47')][_0x4aa0('0x4c')]));_0x521540[_0x4aa0('0x4b')]=_0x521540[_0x4aa0('0x4b')][_0x4aa0('0x4d')]?_0x521540[_0x4aa0('0x4b')]:_0xcff7d9[_0x4aa0('0x45')];if(!_0x209d98['query'][_0x4aa0('0x4e')](_0x4aa0('0x4f'))){_0x521540[_0x4aa0('0x2d')]=qs[_0x4aa0('0x2d')](_0x209d98[_0x4aa0('0x47')][_0x4aa0('0x2d')]);_0x521540[_0x4aa0('0x2c')]=qs[_0x4aa0('0x2c')](_0x209d98[_0x4aa0('0x47')][_0x4aa0('0x2c')]);}_0x521540[_0x4aa0('0x50')]=qs['sort'](_0x209d98['query'][_0x4aa0('0x51')]);_0x521540[_0x4aa0('0x52')]=qs[_0x4aa0('0x49')](_[_0x4aa0('0x53')](_0x209d98['query'],_0xcff7d9['filters']));_0x521540[_0x4aa0('0x52')]['ChatWebsiteId']=_0x2c516b['id'];if(_0x209d98[_0x4aa0('0x47')][_0x4aa0('0x54')]){_0x521540[_0x4aa0('0x52')]=_[_0x4aa0('0x5b')](_0x521540[_0x4aa0('0x52')],{'$or':_[_0x4aa0('0x46')](_0x521540[_0x4aa0('0x4b')],function(_0x5a614b){var _0x542e90={};_0x542e90[_0x5a614b]={'$like':'%'+_0x209d98['query'][_0x4aa0('0x54')]+'%'};return _0x542e90;})});}_0x521540=_[_0x4aa0('0x5b')]({},_0x521540,_0x209d98['options']);return db[_0x4aa0('0x70')][_0x4aa0('0x2f')]({'where':_0x521540[_0x4aa0('0x52')]})['then'](function(_0x13569b){_0x4a1b3b[_0x4aa0('0x2f')]=_0x13569b;if(_0x209d98[_0x4aa0('0x47')][_0x4aa0('0x5a')]){_0x521540[_0x4aa0('0x57')]=[{'all':!![]}];}return db[_0x4aa0('0x70')][_0x4aa0('0x6c')](_0x521540);})[_0x4aa0('0x1d')](function(_0x58cf70){_0x4a1b3b[_0x4aa0('0x58')]=_0x58cf70;return _0x4a1b3b;});}})['then'](respondWithFilteredResult(_0x12b55c,_0x521540))[_0x4aa0('0x28')](handleError(_0x12b55c,null));};exports['removeAnswers']=function(_0x5b8345,_0xe07622,_0xaac065){return db[_0x4aa0('0x40')]['find']({'where':{'id':_0x5b8345[_0x4aa0('0x66')]['id']}})['then'](handleEntityNotFound(_0xe07622,null))[_0x4aa0('0x1d')](function(_0x300b8b){if(_0x300b8b){return _0x300b8b[_0x4aa0('0x72')](_0x5b8345[_0x4aa0('0x47')]['ids']);}})[_0x4aa0('0x1d')](respondWithStatusCode(_0xe07622,null))['catch'](handleError(_0xe07622,null));};exports[_0x4aa0('0x73')]=function(_0xa2f2c,_0x587440,_0x40093a){_0xa2f2c[_0x4aa0('0x5e')][_0x4aa0('0x74')]=_0xa2f2c[_0x4aa0('0x75')][_0x4aa0('0x76')];return db[_0x4aa0('0x40')][_0x4aa0('0x5c')]({'where':{'id':_0xa2f2c[_0x4aa0('0x66')]['id']}})['then'](handleEntityNotFound(_0x587440,null))[_0x4aa0('0x1d')](saveUpdates(_0xa2f2c['body'],null))['then'](respondWithResult(_0x587440,null))[_0x4aa0('0x28')](handleError(_0x587440,null));};exports[_0x4aa0('0x77')]=function(_0x5bbedd,_0x4df569,_0x48f041){_0x5bbedd[_0x4aa0('0x5e')]['agentAvatar']=_0x5bbedd[_0x4aa0('0x75')]['filename'];return db['ChatWebsite'][_0x4aa0('0x5c')]({'where':{'id':_0x5bbedd['params']['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x4df569,null))['then'](saveUpdates(_0x5bbedd['body'],null))[_0x4aa0('0x1d')](respondWithResult(_0x4df569,null))[_0x4aa0('0x28')](handleError(_0x4df569,null));};exports[_0x4aa0('0x78')]=function(_0x5665ca,_0x26e058,_0x2915b0){_0x5665ca['body'][_0x4aa0('0x79')]=_0x5665ca[_0x4aa0('0x75')][_0x4aa0('0x76')];return db[_0x4aa0('0x40')][_0x4aa0('0x5c')]({'where':{'id':_0x5665ca['params']['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x26e058,null))[_0x4aa0('0x1d')](saveUpdates(_0x5665ca[_0x4aa0('0x5e')],null))[_0x4aa0('0x1d')](respondWithResult(_0x26e058,null))[_0x4aa0('0x28')](handleError(_0x26e058,null));};exports[_0x4aa0('0x7a')]=function(_0x5d83a4,_0x1885c7,_0xc9c45c){_0x5d83a4['body']['systemAvatar']=_0x5d83a4[_0x4aa0('0x75')][_0x4aa0('0x76')];return db[_0x4aa0('0x40')]['find']({'where':{'id':_0x5d83a4[_0x4aa0('0x66')]['id']}})['then'](handleEntityNotFound(_0x1885c7,null))[_0x4aa0('0x1d')](saveUpdates(_0x5d83a4[_0x4aa0('0x5e')],null))[_0x4aa0('0x1d')](respondWithResult(_0x1885c7,null))[_0x4aa0('0x28')](handleError(_0x1885c7,null));};exports[_0x4aa0('0x7b')]=function(_0x5b2798,_0x12adc9,_0x4a9ecb){var _0x2e9dc7=path[_0x4aa0('0x7c')](config['root'],_0x4aa0('0x7d'));var _0x35027b={'where':{'id':_0x5b2798[_0x4aa0('0x66')]['id']},'attributes':['id',_0x4aa0('0x74')],'raw':!![]};var _0x4496d2=![];return require(_0x4aa0('0x7e'))['getLicense']()[_0x4aa0('0x1d')](function(_0x5e38a1){if(_0x5e38a1){_0x4496d2=_0x5e38a1['custom'];}})[_0x4aa0('0x1d')](function(){return db[_0x4aa0('0x40')][_0x4aa0('0x5c')](_0x35027b);})['then'](handleEntityNotFound(_0x12adc9,null))[_0x4aa0('0x1d')](function(_0x349701){if(_0x349701){if(!_[_0x4aa0('0x7f')](_0x349701[_0x4aa0('0x74')])){if(fs[_0x4aa0('0x80')](path[_0x4aa0('0x7c')](config[_0x4aa0('0x81')],_0x4aa0('0x82'),_0x349701[_0x4aa0('0x74')]))&&_0x4496d2){_0x2e9dc7=path[_0x4aa0('0x7c')](config['root'],_0x4aa0('0x82'),_0x349701[_0x4aa0('0x74')]);}}return _0x12adc9[_0x4aa0('0x83')](_0x2e9dc7);}})[_0x4aa0('0x28')](handleError(_0x12adc9,null));};exports[_0x4aa0('0x84')]=function(_0x1d990c,_0x11cac3,_0x1d49db){var _0x5ed8f8=path['join'](config['root'],_0x4aa0('0x85'));var _0x3bb803={'where':{'id':_0x1d990c[_0x4aa0('0x66')]['id']},'attributes':['id',_0x4aa0('0x86')],'raw':!![]};return db['ChatWebsite'][_0x4aa0('0x5c')](_0x3bb803)[_0x4aa0('0x1d')](handleEntityNotFound(_0x11cac3,null))['then'](function(_0x8a1b8){if(_0x8a1b8){if(!_[_0x4aa0('0x7f')](_0x8a1b8['agentAvatar'])){if(fs[_0x4aa0('0x80')](path[_0x4aa0('0x7c')](config['root'],_0x4aa0('0x87'),_0x8a1b8[_0x4aa0('0x86')]))){_0x5ed8f8=path[_0x4aa0('0x7c')](config[_0x4aa0('0x81')],_0x4aa0('0x87'),_0x8a1b8[_0x4aa0('0x86')]);}}return _0x11cac3['download'](_0x5ed8f8);}})[_0x4aa0('0x28')](handleError(_0x11cac3,null));};exports[_0x4aa0('0x88')]=function(_0x6fd01c,_0x395b39,_0x24f88d){var _0x540786=path[_0x4aa0('0x7c')](config['root'],_0x4aa0('0x89'));var _0x57a379={'where':{'id':_0x6fd01c[_0x4aa0('0x66')]['id']},'attributes':['id',_0x4aa0('0x79'),_0x4aa0('0x8a')],'raw':!![]};return db[_0x4aa0('0x40')][_0x4aa0('0x5c')](_0x57a379)['then'](handleEntityNotFound(_0x395b39,null))[_0x4aa0('0x1d')](function(_0x11149b){if(_0x11149b){if(!_[_0x4aa0('0x7f')](_0x11149b[_0x4aa0('0x79')])){if(fs['existsSync'](path['join'](config[_0x4aa0('0x81')],'server/files/images/avatars/',_0x11149b[_0x4aa0('0x79')]))&&_0x11149b[_0x4aa0('0x8a')]){_0x540786=path['join'](config[_0x4aa0('0x81')],_0x4aa0('0x87'),_0x11149b[_0x4aa0('0x79')]);}}return _0x395b39[_0x4aa0('0x83')](_0x540786);}})[_0x4aa0('0x28')](handleError(_0x395b39,null));};exports[_0x4aa0('0x8b')]=function(_0x592a04,_0x420d46,_0x2e4efa){var _0x14b485=path[_0x4aa0('0x7c')](config[_0x4aa0('0x81')],_0x4aa0('0x8c'));var _0x4472b1={'where':{'id':_0x592a04[_0x4aa0('0x66')]['id']},'attributes':['id',_0x4aa0('0x8d')],'raw':!![]};return db['ChatWebsite'][_0x4aa0('0x5c')](_0x4472b1)[_0x4aa0('0x1d')](handleEntityNotFound(_0x420d46,null))[_0x4aa0('0x1d')](function(_0x5702b9){if(_0x5702b9){if(!_[_0x4aa0('0x7f')](_0x5702b9[_0x4aa0('0x8d')])){if(fs[_0x4aa0('0x80')](path['join'](config['root'],'server/files/images/avatars/',_0x5702b9[_0x4aa0('0x8d')]))){_0x14b485=path[_0x4aa0('0x7c')](config[_0x4aa0('0x81')],'server/files/images/avatars/',_0x5702b9['systemAvatar']);}}return _0x420d46[_0x4aa0('0x83')](_0x14b485);}})[_0x4aa0('0x28')](handleError(_0x420d46,null));};exports['notify']=function(_0x3c0573,_0x488336,_0x290a1e){var _0x45709c=require(_0x4aa0('0x8e'));var _0x87eb9d=new _0x45709c();var _0x5235cb=_0x87eb9d[_0x4aa0('0x8f')](_0x3c0573[_0x4aa0('0x90')][_0x4aa0('0x91')])['getResult']();var _0x19474a={'body':_0x3c0573['body'],'channel':_0x4aa0('0x92')};var _0x582ead=[];var _0x28623c=[];var _0xce6cbe={};var _0x907b4c=![];return db[_0x4aa0('0x93')][_0x4aa0('0x67')]()[_0x4aa0('0x1d')](function(_0x4010b8){if(!_0x4010b8){throw new db[(_0x4aa0('0x94'))][(_0x4aa0('0x95'))](_0x4aa0('0x96'));}_0x582ead=_[_0x4aa0('0x97')](_[_0x4aa0('0x48')](_0x4010b8),[_0x4aa0('0x98'),_0x4aa0('0x99')]);_0x28623c=_['difference'](_[_0x4aa0('0x48')](_0x4010b8),['createdAt','updatedAt','CompanyId','ListId']);if(_0x3c0573[_0x4aa0('0x5e')]['id']){delete _0x3c0573[_0x4aa0('0x5e')]['id'];}if(_['isNil'](_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0x9a')])){throw new db['Sequelize'][(_0x4aa0('0x95'))](_0x4aa0('0x9b'));}if(_[_0x4aa0('0x7f')](_0x3c0573[_0x4aa0('0x5e')]['body'])||_0x3c0573[_0x4aa0('0x5e')]['body']===''){throw new db[(_0x4aa0('0x94'))][(_0x4aa0('0x95'))](_0x4aa0('0x9c'));}if(_['isNil'](_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0x9d')])){throw new db[(_0x4aa0('0x94'))]['ValidationError'](_0x4aa0('0x9e')+_0x28623c);}if(!_['includes'](_0x28623c,_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0x9d')])){throw new db[(_0x4aa0('0x94'))][(_0x4aa0('0x95'))](_0x4aa0('0x9f')+_0x28623c);}_0xce6cbe[_0x3c0573[_0x4aa0('0x5e')]['mapKey']]=_0x3c0573['body']['from'];})[_0x4aa0('0x1d')](function(){return db[_0x4aa0('0x40')][_0x4aa0('0x5c')]({'where':{'id':_0x3c0573[_0x4aa0('0x66')]['id']},'include':[{'model':db[_0x4aa0('0xa0')],'as':_0x4aa0('0xa1'),'include':[{'model':db['CmContact'],'as':_0x4aa0('0xa2'),'where':_0xce6cbe,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['ChatApplication'],'as':_0x4aa0('0xa3')}]});})[_0x4aa0('0x1d')](handleEntityNotFound(_0x488336,null))[_0x4aa0('0x1d')](function(_0x40a20f){if(_0x40a20f&&_0x40a20f[_0x4aa0('0xa1')]){_0x19474a[_0x4aa0('0xa4')]=_0x40a20f;_0x19474a[_0x4aa0('0xa5')]=_0x40a20f[_0x4aa0('0xa3')];_0x19474a[_0x4aa0('0xa6')]=_0x40a20f['List'];_0x19474a['applications']=_[_0x4aa0('0xa7')](_0x19474a[_0x4aa0('0xa5')],['priority'],['asc']);if(_0x19474a[_0x4aa0('0xa4')][_0x4aa0('0xa3')]){delete _0x19474a[_0x4aa0('0xa4')][_0x4aa0('0xa3')];}if(_0x19474a[_0x4aa0('0xa4')]['List']&&_0x19474a[_0x4aa0('0xa4')][_0x4aa0('0xa1')][_0x4aa0('0xa2')][_0x4aa0('0x4d')]){return _0x19474a[_0x4aa0('0xa4')]['List'][_0x4aa0('0xa2')][0x0];}var _0x15dcdf=_['defaults'](_0x3c0573[_0x4aa0('0x5e')],{'firstName':_0x3c0573[_0x4aa0('0x5e')]['from'],'ListId':_0x40a20f['ListId']});_0x15dcdf[_0x3c0573['body']['mapKey']]=_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0x9a')];return db['CmContact'][_0x4aa0('0x5d')](_0x15dcdf,{'fields':_0x582ead,'raw':!![]});}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x488336,null))[_0x4aa0('0x1d')](function(_0x2d2242){_0x19474a[_0x4aa0('0xa8')]=_0x2d2242;var _0x21f76e=_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0xa9')];if(_0x3c0573[_0x4aa0('0x90')][_0x4aa0('0xaa')]){_0x21f76e=_0x3c0573[_0x4aa0('0x90')][_0x4aa0('0xaa')];}else if(_0x3c0573[_0x4aa0('0x90')]['x-forwarded-for']){_0x21f76e=_[_0x4aa0('0xab')](_0x3c0573[_0x4aa0('0x90')][_0x4aa0('0xac')][_0x4aa0('0xad')](','));}if(_0x2d2242){var _0x22f3d2={'ContactId':_0x2d2242['id'],'ChatWebsiteId':_0x3c0573[_0x4aa0('0x66')]['id'],'from':(_0x2d2242[_0x4aa0('0xae')]||'')+'\x20'+(_0x2d2242[_0x4aa0('0xaf')]||''),'customerIp':_0x21f76e,'customerPort':_0x3c0573[_0x4aa0('0x90')][_0x4aa0('0xb0')]?_0x3c0573[_0x4aa0('0x90')][_0x4aa0('0xb0')]:null,'referer':_0x3c0573[_0x4aa0('0x5e')]['referer'],'browserName':_0x5235cb[_0x4aa0('0xb1')][_0x4aa0('0x3b')]&&_0x5235cb[_0x4aa0('0xb1')]['version']?util['format']('%s\x20%s',_0x5235cb[_0x4aa0('0xb1')]['name'],_0x5235cb[_0x4aa0('0xb1')]['version']):'unknown','browserVersion':_0x5235cb[_0x4aa0('0xb1')][_0x4aa0('0xb2')]||_0x4aa0('0xb3'),'osName':util[_0x4aa0('0xb4')](_0x4aa0('0xb5'),_0x5235cb['os'][_0x4aa0('0x3b')],_0x5235cb['os'][_0x4aa0('0xb2')]),'osVersion':_0x5235cb['os'][_0x4aa0('0xb2')],'deviceModel':_0x5235cb['device'][_0x4aa0('0x45')]&&_0x5235cb[_0x4aa0('0xb6')][_0x4aa0('0xb7')]?util[_0x4aa0('0xb4')](_0x4aa0('0xb8'),_0x5235cb['device'][_0x4aa0('0x45')],_0x5235cb['device'][_0x4aa0('0xb7')],_0x5235cb['device']['type']):null,'deviceVendor':_0x5235cb[_0x4aa0('0xb6')][_0x4aa0('0xb7')],'deviceType':_0x5235cb[_0x4aa0('0xb6')]['type'],'formData':JSON[_0x4aa0('0x23')](_0x3c0573[_0x4aa0('0x5e')])};var _0x5ab0d2={'ChatWebsiteId':_0x3c0573[_0x4aa0('0x66')]['id'],'closed':![]};if(_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0xb9')]){_0x5ab0d2[_0x4aa0('0xb9')]=_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0xb9')];return db[_0x4aa0('0xba')][_0x4aa0('0x5c')]({'where':_0x5ab0d2})[_0x4aa0('0x1d')](function(_0x1ca1ea){if(_0x1ca1ea){return[_0x1ca1ea,![]];}_0x22f3d2['threadId']=_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0xb9')];_0x22f3d2[_0x4aa0('0xbb')]=_0x3c0573[_0x4aa0('0x5e')]['externalUrl'];return db[_0x4aa0('0xba')][_0x4aa0('0x5d')](_0x22f3d2)[_0x4aa0('0x1d')](function(_0x211908){return[_0x211908,!![]];});});}_0x5ab0d2['ContactId']=_0x2d2242['id'];if(_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0xbc')]&&_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0xbc')]['id']){_0x5ab0d2['id']=_0x3c0573['body']['interaction']['id'];return db['ChatInteraction']['find']({'where':_0x5ab0d2})['then'](function(_0x3ab77e){if(_0x3ab77e){return[_0x3ab77e,![]];}return db[_0x4aa0('0xba')][_0x4aa0('0x5d')](_0x22f3d2)[_0x4aa0('0x1d')](function(_0x3f4008){return[_0x3f4008,!![]];});});}return db[_0x4aa0('0xba')][_0x4aa0('0x5d')](_0x22f3d2)['then'](function(_0x57bf89){return[_0x57bf89,!![]];});}})['spread'](function(_0xef2882,_0x4083ff){if(_0xef2882){_0x907b4c=_0x4083ff;if(!_0x4083ff){var _0x191a45={'from':(_0x19474a[_0x4aa0('0xa8')][_0x4aa0('0xae')]||'')+'\x20'+(_0x19474a[_0x4aa0('0xa8')][_0x4aa0('0xaf')]||'')};if(_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0xb9')]&&_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0xbd')]&&_0x3c0573['body']['threadId']!=_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0xbd')]){_0x191a45[_0x4aa0('0xb9')]=_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0xbd')];}return _0xef2882[_0x4aa0('0x36')](_0x191a45);}else{return _0xef2882;}}})[_0x4aa0('0x1d')](function(_0x37f876){_0x19474a['interaction']=_0x37f876[_0x4aa0('0x38')]({'plain':!![]});_0x19474a[_0x4aa0('0xbc')][_0x4aa0('0xbe')]=_0x907b4c;if(_0x19474a['interaction'][_0x4aa0('0xbe')]){if(_0x19474a[_0x4aa0('0xa4')]['autoclose']){_0x19474a[_0x4aa0('0xa5')]['push']({'id':0x0,'priority':_0x19474a[_0x4aa0('0xa5')][_0x4aa0('0x4d')]+0x1,'app':'close','appdata':_0x4aa0('0xbf'),'interval':_0x4aa0('0xc0')});}}return db[_0x4aa0('0xc1')][_0x4aa0('0x5d')]({'body':_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0x5e')],'ChatWebsiteId':_0x3c0573[_0x4aa0('0x66')]['id'],'ChatInteractionId':_0x37f876['id'],'direction':'in','ContactId':_0x19474a[_0x4aa0('0xa8')]['id'],'AttachmentId':_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0xc2')]});})[_0x4aa0('0x1d')](function(_0x5a2e0b){_0x19474a[_0x4aa0('0x26')]=_0x5a2e0b;if(_0x19474a[_0x4aa0('0xbc')][_0x4aa0('0xc3')]){return db['User'][_0x4aa0('0x5c')]({'attributes':['id',_0x4aa0('0x3b')],'where':{'id':_0x19474a[_0x4aa0('0xbc')][_0x4aa0('0xc3')]}})['then'](function(_0x27d7d8){if(_0x27d7d8){_0x19474a[_0x4aa0('0xa5')][_0x4aa0('0xc4')]({'id':0x0,'priority':0x0,'app':_0x4aa0('0xc5'),'appdata':_0x27d7d8[_0x4aa0('0x3b')]+','+(_0x19474a['account'][_0x4aa0('0xc6')]||0xa),'interval':_0x4aa0('0xc0')});_0x19474a[_0x4aa0('0xc7')]=!![];}return respondWithRpcPromise('Start','startRouting',_0x19474a);});}return respondWithRpcPromise(_0x4aa0('0xc8'),_0x4aa0('0xc9'),_0x19474a);})['then'](function(_0x3a3546){respondWithRpcPromise(_0x4aa0('0xca'),'EventManager',{'event':_0x4aa0('0xcb'),'message':_0x3a3546},client9002);return _0x3a3546;})['then'](respondWithResult(_0x488336,null))[_0x4aa0('0x28')](handleError(_0x488336,null));};exports[_0x4aa0('0xcc')]=function(_0x4f69c3,_0x452a99,_0x5b8276){var _0xa84bcb,_0x47c316,_0x4ee32e;var _0x4db1ee=[];var _0x1e5b95=[];var _0x3baebe={};var _0x3b2138=_0x4f69c3[_0x4aa0('0xcd')]||[];var _0xa14da7=[];var _0xf705da;return db[_0x4aa0('0x93')][_0x4aa0('0x67')]()[_0x4aa0('0x1d')](function(_0x1a32c0){if(!_0x1a32c0){throw new db[(_0x4aa0('0x94'))][(_0x4aa0('0x95'))]('no\x20available\x20attributes');}_0x1e5b95=_[_0x4aa0('0x97')](_[_0x4aa0('0x48')](_0x1a32c0),[_0x4aa0('0x98'),_0x4aa0('0x99')]);_0x4db1ee=_[_0x4aa0('0x97')](_[_0x4aa0('0x48')](_0x1a32c0),[_0x4aa0('0x98'),_0x4aa0('0x99'),'CompanyId','ListId']);if(_0x4f69c3['body']['id']){delete _0x4f69c3['body']['id'];}if(_['isNil'](_0x4f69c3['body'][_0x4aa0('0x9a')])){throw _0x452a99[_0x4aa0('0x2a')](0x1f4)[_0x4aa0('0x3c')](new db[(_0x4aa0('0x94'))][(_0x4aa0('0x95'))](_0x4aa0('0x9b')));}if(_[_0x4aa0('0x7f')](_0x4f69c3[_0x4aa0('0x5e')][_0x4aa0('0x5e')])||_0x4f69c3['body'][_0x4aa0('0x5e')]===''){throw _0x452a99[_0x4aa0('0x2a')](0x1f4)[_0x4aa0('0x3c')](new db[(_0x4aa0('0x94'))][(_0x4aa0('0x95'))](_0x4aa0('0x9c')));}if(_[_0x4aa0('0x7f')](_0x4f69c3[_0x4aa0('0x5e')]['mapKeyOffline'])){throw _0x452a99[_0x4aa0('0x2a')](0x1f4)[_0x4aa0('0x3c')](new db[(_0x4aa0('0x94'))][(_0x4aa0('0x95'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4db1ee));}if(!_[_0x4aa0('0xce')](_0x4db1ee,_0x4f69c3['body'][_0x4aa0('0xcf')])){throw _0x452a99[_0x4aa0('0x2a')](0x1f4)[_0x4aa0('0x3c')](new db[(_0x4aa0('0x94'))][(_0x4aa0('0x95'))](_0x4aa0('0xd0')+_0x4db1ee));}_0x3baebe[_0x4f69c3[_0x4aa0('0x5e')]['mapKeyOffline']]=_0x4f69c3[_0x4aa0('0x5e')][_0x4aa0('0x9a')];})[_0x4aa0('0x1d')](function(){return db[_0x4aa0('0x40')][_0x4aa0('0x5c')]({'where':{'id':_0x4f69c3[_0x4aa0('0x66')]['id']},'include':[{'model':db['CmList'],'as':_0x4aa0('0xa1')},{'model':db[_0x4aa0('0xd1')],'as':_0x4aa0('0xd1')}]});})[_0x4aa0('0x1d')](handleEntityNotFound(_0x452a99,null))[_0x4aa0('0x1d')](function(_0x45bc7a){if(_0x45bc7a&&_0x45bc7a[_0x4aa0('0xa1')]){_0x47c316=_0x45bc7a;var _0x2c4985=_[_0x4aa0('0x15')](_0x4f69c3[_0x4aa0('0x5e')],{'firstName':_0x4f69c3[_0x4aa0('0x5e')][_0x4aa0('0x9a')],'phone':_0x4f69c3[_0x4aa0('0x5e')][_0x4aa0('0x9a')],'ListId':_0x45bc7a[_0x4aa0('0xd2')]});_0x2c4985[_0x4f69c3[_0x4aa0('0x5e')][_0x4aa0('0xcf')]]=_0x4f69c3[_0x4aa0('0x5e')][_0x4aa0('0x9a')];return db[_0x4aa0('0x93')][_0x4aa0('0xd3')]({'where':_0x3baebe,'defaults':_0x2c4985});}})['spread'](function(_0xd89ee7){if(_0xd89ee7){_0x4ee32e=_0xd89ee7;var _0x32dbe5=fs[_0x4aa0('0xd4')](path[_0x4aa0('0x7c')](config[_0x4aa0('0x81')],_0x4aa0('0xd5')),'utf8');var _0x124d68=ejs[_0x4aa0('0xd6')](_0x32dbe5,{'body':_[_0x4aa0('0xd7')](_0x4f69c3[_0x4aa0('0x5e')][_0x4aa0('0x5e')]),'bodyTitle':_0x47c316[_0x4aa0('0xd8')]});return db[_0x4aa0('0xd9')][_0x4aa0('0x5d')]({'body':_0x124d68,'ContactId':_0xd89ee7['id'],'ChatWebsiteId':_0x47c316['id']});}})['then'](function(_0x1cf361){_0xf705da=_0x1cf361;if(_0x3b2138['length']){var _0x1f45cc=_0x3b2138[_0x4aa0('0x46')](function(_0x4ed590){return{'name':_0x4ed590[_0x4aa0('0xda')],'basename':_0x4ed590[_0x4aa0('0x76')],'type':_0x4ed590[_0x4aa0('0xdb')],'ChatOfflineMessageId':_0x1cf361['id']};});_0xa14da7=_0x1f45cc[_0x4aa0('0x46')](_0x2bc653=>{var _0x40f291={'filename':_0x2bc653[_0x4aa0('0x3b')],'path':path['join'](config[_0x4aa0('0x81')],_0x4aa0('0xdc'),'files','attachments',_0x4aa0('0xdd'),_0x2bc653[_0x4aa0('0xde')])};return _0x40f291;});if(!_0x47c316['openNewInteraction']){return db[_0x4aa0('0xdf')]['transaction'](function(_0x17075c){return db['Attachment']['bulkCreate'](_0x1f45cc,{'transaction':_0x17075c});});}}})['then'](function(){if(_0xf705da){_0xa84bcb=_0xf705da;return db['MailAccount']['findOne']({'where':{'active':!![]},'include':[{'model':db[_0x4aa0('0xe0')],'as':_0x4aa0('0xe1'),'raw':!![]}]});}})[_0x4aa0('0x1d')](function(_0xfd9b56){if(_0xfd9b56&&_0xfd9b56[_0x4aa0('0xe1')]&&_0x47c316[_0x4aa0('0xe2')]&&_0x47c316[_0x4aa0('0xe3')]){var _0x4e946c={'tls':{'rejectUnauthorized':![]}};if(_0xfd9b56['Smtp']['service']){_0x4e946c['service']=_0xfd9b56[_0x4aa0('0xe1')]['service'];}else{_0x4e946c[_0x4aa0('0xe4')]=_0xfd9b56[_0x4aa0('0xe1')][_0x4aa0('0xe4')];_0x4e946c[_0x4aa0('0xe5')]=_0xfd9b56[_0x4aa0('0xe1')]['port'];_0x4e946c[_0x4aa0('0xe6')]=_0xfd9b56['Smtp'][_0x4aa0('0xe6')];}if(_0xfd9b56[_0x4aa0('0xe1')]['authentication']){_0x4e946c[_0x4aa0('0xe7')]={'user':_0xfd9b56['Smtp'][_0x4aa0('0x5f')],'pass':_0xfd9b56[_0x4aa0('0xe1')]['pass']};}return respondWithRpcPromise(_0x4aa0('0xe8'),_0x4aa0('0xe9'),{'account':_0x4e946c,'message':{'from':util['format'](_0x4aa0('0xea'),_0xfd9b56['name'],_0xfd9b56[_0x4aa0('0xeb')]||_0xfd9b56[_0x4aa0('0xe1')][_0x4aa0('0x5f')]),'to':_0x47c316['forwardOfflineAddress'],'subject':_0x47c316['offlineMessageSubject'],'html':_0xa84bcb[_0x4aa0('0x5e')],'attachments':_0xa14da7}},client9003)[_0x4aa0('0x1d')](function(){return _0xa84bcb;})['catch'](function(_0x227ce1){console['error'](_0x227ce1);});}})[_0x4aa0('0x1d')](function(){if(_0x47c316&&_0x47c316[_0x4aa0('0xec')]&&_0x47c316[_0x4aa0('0xed')]){var _0x274538=[];if(_0x3b2138[_0x4aa0('0x4d')]){_0x274538=_0x3b2138['map'](function(_0x201256){return{'name':_0x201256[_0x4aa0('0xda')],'basename':_0x201256['filename'],'type':_0x201256[_0x4aa0('0xdb')],'ChatOfflineMessageId':_0xf705da['id']};});}var _0x42d815;if(!_[_0x4aa0('0x7f')](_0x47c316['subjectOffline'])){var _0x47bd70=_[_0x4aa0('0x46')](_0x4f69c3[_0x4aa0('0x5e')],function(_0x467e6f){return _0x467e6f;});var _0x36c419=_['toPairsIn'](_0x47bd70)[0x0];var _0x4f5560=_[_0x4aa0('0xee')](_0x36c419,function(_0x2317bb){return _0x2317bb;});_0x42d815=_0x4f5560[0x1][_0x47c316[_0x4aa0('0xef')]];}var _0x3d9d6a={'from':_0x4ee32e['email'],'firstName':_0x4ee32e[_0x4aa0('0xae')],'lastName':_0x4ee32e[_0x4aa0('0xaf')],'mapKey':_0x4aa0('0xeb'),'message':{'from':_0x4ee32e[_0x4aa0('0xeb')],'to':_0x47c316[_0x4aa0('0xd1')]['email'],'cc':'','subject':_[_0x4aa0('0x7f')](_0x42d815)?_0x47c316[_0x4aa0('0xf0')]:_0x42d815,'messageId':'','sentAt':new Date(),'attach':_0x274538[_0x4aa0('0x4d')],'attachments':_0x274538,'originChannel':_0x4aa0('0xf1'),'ChatWebsiteId':_0x47c316['id'],'ChatOfflineMessageId':_0xa84bcb['id'],'originTo':_0x47c316[_0x4aa0('0xd1')][_0x4aa0('0xeb')]},'body':_0xa84bcb[_0x4aa0('0x5e')]};var _0x16ed1e={'account':{'id':_0x47c316[_0x4aa0('0xed')]},'body':_0x3d9d6a,'log':_0x4aa0('0xf2')};return respondWithRpcPromise('NotifyMailAccount',_0x4aa0('0xf3'),_0x16ed1e,client9001)['then'](function(){return _0xa84bcb;})['catch'](function(_0xb477f0){console['error'](_0xb477f0);});}return;})[_0x4aa0('0x1d')](function(){if(_0xa84bcb){return _0xa84bcb;}})['then'](respondWithResult(_0x452a99,null))['catch'](function(_0x4e3599){console[_0x4aa0('0x24')](_0x4aa0('0x28'),_0x4e3599);for(var _0x216083 of _0x3b2138){var _0x2b5e81=path[_0x4aa0('0x7c')](config[_0x4aa0('0x81')],_0x4aa0('0xdc'),_0x4aa0('0xcd'),'attachments',_0x4aa0('0xdd'),_0x216083[_0x4aa0('0x76')]);fs_extra[_0x4aa0('0xf4')](_0x2b5e81)['catch'](function(_0x35d64d){console[_0x4aa0('0x24')](_0x4aa0('0xf5'),_0x2b5e81,_0x35d64d);});}});};exports[_0x4aa0('0xf6')]=function(_0x480814,_0x4cb595,_0x1b05be){return db[_0x4aa0('0xba')][_0x4aa0('0x5c')]({'where':{'id':_0x480814[_0x4aa0('0x66')]['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x4cb595,null))[_0x4aa0('0x1d')](function(_0x2aa96b){if(_0x2aa96b){return _0x2aa96b[_0x4aa0('0xf6')](_0x480814[_0x4aa0('0x5e')]['ids'],_[_0x4aa0('0xf7')](_0x480814[_0x4aa0('0x5e')],[_0x4aa0('0x6e'),'id'])||{});}})['then'](respondWithResult(_0x4cb595,null))[_0x4aa0('0x28')](handleError(_0x4cb595,null));};exports[_0x4aa0('0xf8')]=function(_0x27e6a1,_0x56f6de,_0x187b35){var _0x4152a1={'raw':![],'where':{}};var _0x25d4f6={};var _0x511468={'count':0x0,'rows':[]};return db[_0x4aa0('0x40')][_0x4aa0('0x71')]({'where':{'id':_0x27e6a1[_0x4aa0('0x66')]['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x56f6de,null))[_0x4aa0('0x1d')](function(_0x116379){if(_0x116379){_0x25d4f6[_0x4aa0('0x45')]=_[_0x4aa0('0x48')](db[_0x4aa0('0xba')]['rawAttributes']);_0x25d4f6[_0x4aa0('0x47')]=_[_0x4aa0('0x48')](_0x27e6a1[_0x4aa0('0x47')]);_0x25d4f6[_0x4aa0('0x49')]=_[_0x4aa0('0x4a')](_0x25d4f6[_0x4aa0('0x45')],_0x25d4f6[_0x4aa0('0x47')]);_0x4152a1['attributes']=_[_0x4aa0('0x4a')](_0x25d4f6[_0x4aa0('0x45')],qs['fields'](_0x27e6a1['query'][_0x4aa0('0x4c')]));_0x4152a1[_0x4aa0('0x4b')]=_0x4152a1[_0x4aa0('0x4b')][_0x4aa0('0x4d')]?_0x4152a1[_0x4aa0('0x4b')]:_0x25d4f6['model'];if(!_0x27e6a1[_0x4aa0('0x47')][_0x4aa0('0x4e')](_0x4aa0('0x4f'))){_0x4152a1[_0x4aa0('0x2d')]=qs[_0x4aa0('0x2d')](_0x27e6a1['query']['limit']);_0x4152a1['offset']=qs[_0x4aa0('0x2c')](_0x27e6a1[_0x4aa0('0x47')]['offset']);}_0x4152a1[_0x4aa0('0x50')]=qs[_0x4aa0('0x51')](_0x27e6a1[_0x4aa0('0x47')]['sort']);_0x4152a1[_0x4aa0('0x52')]=qs[_0x4aa0('0x49')](_[_0x4aa0('0x53')](_0x27e6a1[_0x4aa0('0x47')],_0x25d4f6[_0x4aa0('0x49')]));_0x4152a1[_0x4aa0('0x52')][_0x4aa0('0x69')]=_0x116379['id'];if(_0x27e6a1[_0x4aa0('0x47')][_0x4aa0('0x54')]){_0x4152a1['where']=_[_0x4aa0('0x5b')](_0x4152a1[_0x4aa0('0x52')],{'$or':_[_0x4aa0('0x46')](_0x4152a1[_0x4aa0('0x4b')],function(_0x22005e){var _0x2c6a05={};_0x2c6a05[_0x22005e]={'$like':'%'+_0x27e6a1[_0x4aa0('0x47')][_0x4aa0('0x54')]+'%'};return _0x2c6a05;})});}_0x4152a1=_[_0x4aa0('0x5b')]({},_0x4152a1,_0x27e6a1[_0x4aa0('0x56')]);return db[_0x4aa0('0xba')][_0x4aa0('0x2f')]({'where':_0x4152a1[_0x4aa0('0x52')]})['then'](function(_0x1f67b5){_0x511468[_0x4aa0('0x2f')]=_0x1f67b5;if(_0x27e6a1[_0x4aa0('0x47')]['includeAll']){_0x4152a1['include']=[{'model':db[_0x4aa0('0x93')],'as':_0x4aa0('0xf9'),'required':![]},{'model':db['User'],'as':_0x4aa0('0xfa'),'attributes':[_0x4aa0('0x3b'),_0x4aa0('0xfb'),'internal'],'required':![]},{'model':db[_0x4aa0('0xfc')],'as':_0x4aa0('0xfd'),'attributes':['id',_0x4aa0('0x3b'),_0x4aa0('0xfe')],'where':_0x27e6a1[_0x4aa0('0x47')][_0x4aa0('0xff')]?{'id':_0x27e6a1['query'][_0x4aa0('0xff')]}:undefined,'required':_0x27e6a1[_0x4aa0('0x47')]['tag']?!![]:![]}];}return db[_0x4aa0('0xba')][_0x4aa0('0x6c')](_0x4152a1);})[_0x4aa0('0x1d')](function(_0x56c5db){_0x511468[_0x4aa0('0x58')]=_0x56c5db;return _0x511468;});}})[_0x4aa0('0x1d')](respondWithFilteredResult(_0x56f6de,_0x4152a1))['catch'](handleError(_0x56f6de,null));};function iftimePromise(_0x55b3f5,_0xf7953c){return respondWithRpcPromise(_0x4aa0('0x100'),_0x4aa0('0x101'),{'command':_0xf7953c['timezone']?util['format'](_0x4aa0('0x102'),_0x55b3f5[_0x4aa0('0x103')],_0xf7953c[_0x4aa0('0x104')]):util['format'](_0x4aa0('0x105'),_0x55b3f5[_0x4aa0('0x103')])},client9002)['then'](function(_0x41a576){var _0x83c8e0=_0x41a576&&_0x41a576[_0x4aa0('0x106')](_0x4aa0('0x107'))>=0x0?!![]:![];logger[_0x4aa0('0x1e')](_0x4aa0('0x108'),_0xf7953c['id'],_0x55b3f5['id'],_0x55b3f5['interval'],_0x83c8e0?_0x4aa0('0x109'):_0x4aa0('0x10a'),_0xf7953c[_0x4aa0('0x104')]?_0xf7953c[_0x4aa0('0x104')]:_0x4aa0('0x10b'));return _0x83c8e0;})[_0x4aa0('0x28')](function(_0x192a48){logger[_0x4aa0('0x24')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0xf7953c['id'],_0x55b3f5['id'],_0x55b3f5[_0x4aa0('0x103')],util['inspect'](_0x192a48,{'showHidden':![],'depth':null}),_0xf7953c[_0x4aa0('0x104')]?_0xf7953c[_0x4aa0('0x104')]:_0x4aa0('0x10b'));return![];});}exports[_0x4aa0('0x101')]=function(_0x513dff,_0x33b196,_0x89b64d){var _0x27516c=0x0;var _0x4ae21b=0x0;var _0x3a121a=![];var _0x50090a;var _0x4b1a1e;return db['ChatWebsite'][_0x4aa0('0x5c')]({'where':{'id':_0x513dff[_0x4aa0('0x66')]['id']},'include':[{'model':db['Interval'],'as':_0x4aa0('0x10c'),'include':[{'model':db[_0x4aa0('0x10c')],'as':'Intervals','attributes':['id',_0x4aa0('0x103')],'raw':!![]}]}]})[_0x4aa0('0x1d')](handleEntityNotFound(_0x33b196,null))[_0x4aa0('0x1d')](function(_0x4beab9){if(_0x4beab9){_0x50090a=_0x4beab9;return _0x4beab9[_0x4aa0('0x10d')]({'raw':!![]});}})[_0x4aa0('0x1d')](function(_0x1fef3d){if(_0x50090a){if(_0x1fef3d){_0x4b1a1e=_0x1fef3d;}}return require(_0x4aa0('0x7e'))['getLicense']();})[_0x4aa0('0x1d')](function(_0x303d42){if(_0x303d42){_0x4ae21b=_0x303d42[_0x4aa0('0x10e')];_0x3a121a=_0x303d42[_0x4aa0('0x10f')];}})[_0x4aa0('0x1d')](function(){return db[_0x4aa0('0xba')][_0x4aa0('0x2f')]({'where':{'closed':![]}});})['then'](function(_0x4837b2){_0x27516c=_0x4837b2;if(_0x4ae21b&&_0x4837b2>_0x4ae21b){return db['License']['findOne']({'where':{'id':0x1}})[_0x4aa0('0x1d')](function(_0x3c134f){if(_0x3c134f){_0x3c134f[_0x4aa0('0x110')](_0x4aa0('0x111'));}});}})[_0x4aa0('0x1d')](function(){if(_0x50090a[_0x4aa0('0x10c')]&&_0x50090a['Interval'][_0x4aa0('0x112')]){var _0x5173f3=[];for(var _0x59f21e=0x0;_0x59f21e<_0x50090a[_0x4aa0('0x10c')][_0x4aa0('0x112')][_0x4aa0('0x4d')];_0x59f21e++){var _0x5e1f71=_0x50090a[_0x4aa0('0x10c')][_0x4aa0('0x112')][_0x59f21e]['get']({'plain':!![]});_0x5173f3[_0x4aa0('0x113')](iftimePromise(_0x5e1f71,_0x50090a));}return BPromise[_0x4aa0('0x114')](_0x5173f3)[_0x4aa0('0x1d')](function(_0x68a497){return _[_0x4aa0('0x115')](_0x68a497);});}else{return!![];}})['then'](function(_0x2592a4){var _0x200989=fs['readFileSync'](path[_0x4aa0('0x7c')](config[_0x4aa0('0x81')],_0x4aa0('0x116')),'utf8');var _0x1b2e4f={'remote':_0x50090a[_0x4aa0('0x117')],'query':querystring[_0x4aa0('0x23')](_[_0x4aa0('0x5b')](_0x50090a[_0x4aa0('0x38')]({'plain':!![]}),{'customerIp':_0x513dff[_0x4aa0('0x90')][_0x4aa0('0xac')]||_0x513dff['headers'][_0x4aa0('0x118')]||_0x513dff[_0x4aa0('0x119')][_0x4aa0('0x11a')]||_0x513dff['ip'],'referer':_0x513dff[_0x4aa0('0x90')][_0x4aa0('0x11b')],'openedInteractions':_0x27516c,'maxInteractions':_0x4ae21b,'virtual':_0x3a121a['virtual'],'online':_0x2592a4,'custom':_0x3a121a}))[_0x4aa0('0x11c')](/'/g,'\x5c\x27')};_0x33b196['send'](ejs[_0x4aa0('0xd6')](Mustache['render'](_0x200989,_0x1b2e4f),{'proactiveActions':_0x4b1a1e,'alignment':_0x50090a[_0x4aa0('0x11d')],'verticalAlignment':_0x50090a[_0x4aa0('0x11e')],'div_color':_0x50090a[_0x4aa0('0xfe')],'text_color':_0x50090a[_0x4aa0('0x11f')],'button_color':_0x50090a[_0x4aa0('0x120')],'background_color':_0x50090a[_0x4aa0('0x121')]}));})['catch'](handleError(_0x33b196,null));};exports[_0x4aa0('0x122')]=function(_0x4491e3,_0x4cb784,_0x37b43d){return db[_0x4aa0('0x40')][_0x4aa0('0x71')]({'where':{'id':_0x4491e3[_0x4aa0('0x66')]['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x4cb784,null))[_0x4aa0('0x1d')](function(_0x4effa9){if(_0x4effa9){return db[_0x4aa0('0xdf')][_0x4aa0('0x123')](function(_0x8c292a){return db[_0x4aa0('0x124')][_0x4aa0('0x37')]({'where':{'ChatWebsiteId':_0x4491e3['params']['id']},'transaction':_0x8c292a})[_0x4aa0('0x1d')](function(_0x165199){var _0x2f1166=_[_0x4aa0('0x46')](_0x4491e3['body'],function(_0x2f2ebd){_0x2f2ebd[_0x4aa0('0x69')]=_0x4491e3[_0x4aa0('0x66')]['id'];return _0x2f2ebd;});return db[_0x4aa0('0x124')]['bulkCreate'](_0x2f1166,{'transaction':_0x8c292a});});})['then'](function(){return db[_0x4aa0('0x124')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x4491e3[_0x4aa0('0x66')]['id']},'order':'priority'});});}})[_0x4aa0('0x1d')](respondWithResult(_0x4cb784,null))[_0x4aa0('0x28')](handleError(_0x4cb784,null));};exports['getApplications']=function(_0x2eebb8,_0x49ccbd,_0x129ee3){var _0x3acc0a={};var _0x57233a={};var _0x38ee26;var _0x2a773b;return db[_0x4aa0('0x40')][_0x4aa0('0x71')]({'where':{'id':_0x2eebb8[_0x4aa0('0x66')]['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x49ccbd,null))['then'](function(_0x5c1ddb){if(_0x5c1ddb){_0x38ee26=_0x5c1ddb;_0x57233a['model']=_[_0x4aa0('0x48')](db['ChatApplication']['rawAttributes']);_0x57233a[_0x4aa0('0x47')]=_['keys'](_0x2eebb8[_0x4aa0('0x47')]);_0x57233a[_0x4aa0('0x49')]=_['intersection'](_0x57233a[_0x4aa0('0x45')],_0x57233a[_0x4aa0('0x47')]);_0x3acc0a[_0x4aa0('0x4b')]=_[_0x4aa0('0x4a')](_0x57233a[_0x4aa0('0x45')],qs[_0x4aa0('0x4c')](_0x2eebb8[_0x4aa0('0x47')][_0x4aa0('0x4c')]));_0x3acc0a['attributes']=_0x3acc0a[_0x4aa0('0x4b')][_0x4aa0('0x4d')]?_0x3acc0a[_0x4aa0('0x4b')]:_0x57233a[_0x4aa0('0x45')];_0x3acc0a[_0x4aa0('0x50')]=qs['sort'](_0x2eebb8[_0x4aa0('0x47')][_0x4aa0('0x51')]);_0x3acc0a[_0x4aa0('0x52')]=qs[_0x4aa0('0x49')](_[_0x4aa0('0x53')](_0x2eebb8['query'],_0x57233a[_0x4aa0('0x49')]));if(_0x2eebb8['query'][_0x4aa0('0x54')]){_0x3acc0a[_0x4aa0('0x52')]=_['merge'](_0x3acc0a[_0x4aa0('0x52')],{'$or':_['map'](_0x3acc0a[_0x4aa0('0x4b')],function(_0x422d39){var _0x58f76c={};_0x58f76c[_0x422d39]={'$like':'%'+_0x2eebb8[_0x4aa0('0x47')]['filter']+'%'};return _0x58f76c;})});}_0x3acc0a=_[_0x4aa0('0x5b')]({},_0x3acc0a,_0x2eebb8['options']);return _0x38ee26[_0x4aa0('0x125')](_0x3acc0a);}})[_0x4aa0('0x1d')](function(_0x4ace94){if(_0x4ace94){_0x2a773b=_0x4ace94[_0x4aa0('0x4d')];if(!_0x2eebb8[_0x4aa0('0x47')][_0x4aa0('0x4e')]('nolimit')){_0x3acc0a[_0x4aa0('0x2d')]=qs[_0x4aa0('0x2d')](_0x2eebb8[_0x4aa0('0x47')][_0x4aa0('0x2d')]);_0x3acc0a[_0x4aa0('0x2c')]=qs['offset'](_0x2eebb8['query'][_0x4aa0('0x2c')]);}return _0x38ee26['getApplications'](_0x3acc0a);}})[_0x4aa0('0x1d')](function(_0x100d03){if(_0x100d03){return _0x100d03?{'count':_0x2a773b,'rows':_0x100d03}:null;}})['then'](respondWithResult(_0x49ccbd,null))[_0x4aa0('0x28')](handleError(_0x49ccbd,null));};exports[_0x4aa0('0x126')]=function(_0x4d34fd,_0x5a618a,_0x3d0444){return db['chatProactiveAction']['find']({'where':{'id':_0x4d34fd[_0x4aa0('0x66')]['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x5a618a,null))[_0x4aa0('0x1d')](function(_0x968761){if(_0x968761){return _0x968761[_0x4aa0('0x126')](_0x4d34fd['body'][_0x4aa0('0x6e')],_[_0x4aa0('0xf7')](_0x4d34fd['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x5a618a,null))[_0x4aa0('0x28')](handleError(_0x5a618a,null));};exports[_0x4aa0('0x10d')]=function(_0x371685,_0x29cf9a,_0x161916){var _0x23bead={};var _0x111dcc={};var _0x1e180b;var _0x40f21b;return db[_0x4aa0('0x40')]['findOne']({'where':{'id':_0x371685[_0x4aa0('0x66')]['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x29cf9a,null))[_0x4aa0('0x1d')](function(_0x971177){if(_0x971177){_0x1e180b=_0x971177;_0x111dcc[_0x4aa0('0x45')]=_[_0x4aa0('0x48')](db[_0x4aa0('0x127')][_0x4aa0('0x41')]);_0x111dcc[_0x4aa0('0x47')]=_[_0x4aa0('0x48')](_0x371685[_0x4aa0('0x47')]);_0x111dcc['filters']=_[_0x4aa0('0x4a')](_0x111dcc['model'],_0x111dcc[_0x4aa0('0x47')]);_0x23bead[_0x4aa0('0x4b')]=_[_0x4aa0('0x4a')](_0x111dcc[_0x4aa0('0x45')],qs[_0x4aa0('0x4c')](_0x371685['query'][_0x4aa0('0x4c')]));_0x23bead['attributes']=_0x23bead[_0x4aa0('0x4b')][_0x4aa0('0x4d')]?_0x23bead[_0x4aa0('0x4b')]:_0x111dcc[_0x4aa0('0x45')];_0x23bead[_0x4aa0('0x50')]=qs[_0x4aa0('0x51')](_0x371685[_0x4aa0('0x47')][_0x4aa0('0x51')]);_0x23bead[_0x4aa0('0x52')]=qs['filters'](_[_0x4aa0('0x53')](_0x371685[_0x4aa0('0x47')],_0x111dcc[_0x4aa0('0x49')]));if(_0x371685[_0x4aa0('0x47')][_0x4aa0('0x54')]){_0x23bead[_0x4aa0('0x52')]=_['merge'](_0x23bead['where'],{'$or':_[_0x4aa0('0x46')](_0x23bead[_0x4aa0('0x4b')],function(_0x1d0dc1){var _0x144c2e={};_0x144c2e[_0x1d0dc1]={'$like':'%'+_0x371685[_0x4aa0('0x47')]['filter']+'%'};return _0x144c2e;})});}_0x23bead=_[_0x4aa0('0x5b')]({},_0x23bead,_0x371685[_0x4aa0('0x56')]);return _0x1e180b[_0x4aa0('0x10d')](_0x23bead);}})['then'](function(_0x29c834){if(_0x29c834){_0x40f21b=_0x29c834['length'];if(!_0x371685[_0x4aa0('0x47')][_0x4aa0('0x4e')]('nolimit')){_0x23bead['limit']=qs[_0x4aa0('0x2d')](_0x371685['query']['limit']);_0x23bead[_0x4aa0('0x2c')]=qs[_0x4aa0('0x2c')](_0x371685[_0x4aa0('0x47')]['offset']);}return _0x1e180b[_0x4aa0('0x10d')](_0x23bead);}})[_0x4aa0('0x1d')](function(_0x431d4b){if(_0x431d4b){return _0x431d4b?{'count':_0x40f21b,'rows':_0x431d4b}:null;}})[_0x4aa0('0x1d')](respondWithResult(_0x29cf9a,null))[_0x4aa0('0x28')](handleError(_0x29cf9a,null));};exports['getFields']=function(_0x4097c6,_0x328744,_0x58b2e2){var _0x12db7b=_0x4097c6[_0x4aa0('0x47')][_0x4aa0('0x128')]===_0x4aa0('0x129')?_0x4aa0('0x12a'):'onlineForm';return db['ChatWebsite']['find']({'attributes':['id',_0x12db7b],'where':{'id':_0x4097c6[_0x4aa0('0x66')]['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x328744,null))[_0x4aa0('0x1d')](function(_0x1cbead){if(_0x1cbead){var _0x366d2f=_0x1cbead[_0x12db7b];var _0x3d7cc5=_0x366d2f&&_0x366d2f[_0x4aa0('0x12b')]?_0x366d2f['items']:[];_0x328744[_0x4aa0('0x3c')]({'fromKey':_[_0x4aa0('0x7f')](_0x366d2f[_0x4aa0('0x12c')])?undefined:_0x366d2f[_0x4aa0('0x12c')],'count':_0x3d7cc5[_0x4aa0('0x4d')],'rows':_0x3d7cc5});}})[_0x4aa0('0x28')](handleError(_0x328744,null));};exports['getOfflineMessages']=function(_0x57027a,_0x43a0c7,_0x55bf10){var _0x2497e5={'raw':![],'where':{}};var _0x616ad5={};var _0x2b9cdf={'count':0x0,'rows':[]};return db[_0x4aa0('0x40')][_0x4aa0('0x71')]({'where':{'id':_0x57027a[_0x4aa0('0x66')]['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x43a0c7,null))[_0x4aa0('0x1d')](function(_0x44e4ec){if(_0x44e4ec){_0x616ad5[_0x4aa0('0x45')]=_[_0x4aa0('0x48')](db['ChatOfflineMessage'][_0x4aa0('0x41')]);_0x616ad5['query']=_[_0x4aa0('0x48')](_0x57027a[_0x4aa0('0x47')]);_0x616ad5[_0x4aa0('0x49')]=_[_0x4aa0('0x4a')](_0x616ad5[_0x4aa0('0x45')],_0x616ad5[_0x4aa0('0x47')]);_0x2497e5[_0x4aa0('0x4b')]=_[_0x4aa0('0x4a')](_0x616ad5['model'],qs[_0x4aa0('0x4c')](_0x57027a[_0x4aa0('0x47')][_0x4aa0('0x4c')]));_0x2497e5[_0x4aa0('0x4b')]=_0x2497e5[_0x4aa0('0x4b')]['length']?_0x2497e5['attributes']:_0x616ad5['model'];if(!_0x57027a[_0x4aa0('0x47')][_0x4aa0('0x4e')](_0x4aa0('0x4f'))){_0x2497e5[_0x4aa0('0x2d')]=qs[_0x4aa0('0x2d')](_0x57027a[_0x4aa0('0x47')][_0x4aa0('0x2d')]);_0x2497e5[_0x4aa0('0x2c')]=qs[_0x4aa0('0x2c')](_0x57027a[_0x4aa0('0x47')][_0x4aa0('0x2c')]);}_0x2497e5[_0x4aa0('0x50')]=qs['sort'](_0x57027a[_0x4aa0('0x47')][_0x4aa0('0x51')]);_0x2497e5[_0x4aa0('0x52')]=qs[_0x4aa0('0x49')](_[_0x4aa0('0x53')](_0x57027a[_0x4aa0('0x47')],_0x616ad5['filters']));_0x2497e5[_0x4aa0('0x52')]['ChatWebsiteId']=_0x44e4ec['id'];if(_0x57027a[_0x4aa0('0x47')][_0x4aa0('0x54')]){_0x2497e5[_0x4aa0('0x52')]=_[_0x4aa0('0x5b')](_0x2497e5[_0x4aa0('0x52')],{'$or':_[_0x4aa0('0x46')](_0x2497e5[_0x4aa0('0x4b')],function(_0x59f3a3){var _0x3bd7ee={};_0x3bd7ee[_0x59f3a3]={'$like':'%'+_0x57027a['query'][_0x4aa0('0x54')]+'%'};return _0x3bd7ee;})});}_0x2497e5=_[_0x4aa0('0x5b')]({},_0x2497e5,_0x57027a[_0x4aa0('0x56')]);return db[_0x4aa0('0xd9')][_0x4aa0('0x2f')]({'where':_0x2497e5[_0x4aa0('0x52')]})[_0x4aa0('0x1d')](function(_0x31fda9){_0x2b9cdf[_0x4aa0('0x2f')]=_0x31fda9;if(_0x57027a['query'][_0x4aa0('0x5a')]){_0x2497e5['include']=[{'all':!![]}];}else{_0x2497e5['include']=[{'model':db[_0x4aa0('0x93')],'as':_0x4aa0('0xf9'),'required':![]},{'model':db[_0x4aa0('0x12d')],'as':_0x4aa0('0x12e'),'required':![]}];}return db[_0x4aa0('0xd9')]['findAll'](_0x2497e5);})[_0x4aa0('0x1d')](function(_0x1d5fd2){_0x2b9cdf[_0x4aa0('0x58')]=_0x1d5fd2;return _0x2b9cdf;});}})['then'](respondWithFilteredResult(_0x43a0c7,_0x2497e5))[_0x4aa0('0x28')](handleError(_0x43a0c7,null));};exports[_0x4aa0('0x12f')]=function(_0x12152c,_0x30bcb2,_0x3443c2){return db['ChatWebsite'][_0x4aa0('0x5c')]({'where':{'id':_0x12152c[_0x4aa0('0x66')]['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x30bcb2,null))[_0x4aa0('0x1d')](function(_0x892b51){if(_0x892b51){return _0x892b51[_0x4aa0('0x12f')](_0x12152c['body']['ids'],_['omit'](_0x12152c[_0x4aa0('0x5e')],[_0x4aa0('0x6e'),'id'])||{})['spread'](function(_0x218c4a){for(var _0x16cd20=0x0;_0x16cd20<_0x12152c[_0x4aa0('0x5e')][_0x4aa0('0x6e')][_0x4aa0('0x4d')];_0x16cd20+=0x1){socket[_0x4aa0('0x130')](_0x4aa0('0x131'),{'UserId':Number(_0x12152c[_0x4aa0('0x5e')][_0x4aa0('0x6e')][_0x16cd20]),'ChatWebsiteId':Number(_0x12152c[_0x4aa0('0x66')]['id'])});}return _0x218c4a;});}})['then'](respondWithResult(_0x30bcb2,null))['catch'](handleError(_0x30bcb2,null));};exports[_0x4aa0('0x132')]=function(_0x53a688,_0x1f98b1,_0x44f1a6){return db[_0x4aa0('0x40')][_0x4aa0('0x5c')]({'where':{'id':_0x53a688[_0x4aa0('0x66')]['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x1f98b1,null))['then'](function(_0x19143a){if(_0x19143a){return _0x19143a['removeAgents'](_0x53a688['query'][_0x4aa0('0x6e')])[_0x4aa0('0x1d')](function(){if(_[_0x4aa0('0x133')](_0x53a688[_0x4aa0('0x47')][_0x4aa0('0x6e')])){for(var _0x1b0097=0x0;_0x1b0097<_0x53a688['query']['ids']['length'];_0x1b0097+=0x1){socket[_0x4aa0('0x130')](_0x4aa0('0x134'),{'UserId':Number(_0x53a688['query'][_0x4aa0('0x6e')][_0x1b0097]),'ChatWebsiteId':Number(_0x53a688['params']['id'])});}}else{socket[_0x4aa0('0x130')]('userChatWebsite:remove',{'UserId':Number(_0x53a688[_0x4aa0('0x47')][_0x4aa0('0x6e')]),'ChatWebsiteId':Number(_0x53a688['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1f98b1,null))[_0x4aa0('0x28')](handleError(_0x1f98b1,null));};exports[_0x4aa0('0x135')]=function(_0x1017b2,_0x2677a6,_0x2b4d14){var _0x4585a3={};var _0x40565b={};var _0x305844;var _0x21b263;return db[_0x4aa0('0x40')][_0x4aa0('0x71')]({'where':{'id':_0x1017b2['params']['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x2677a6,null))[_0x4aa0('0x1d')](function(_0xabcac6){if(_0xabcac6){_0x305844=_0xabcac6;_0x40565b[_0x4aa0('0x45')]=_[_0x4aa0('0x48')](db[_0x4aa0('0x136')][_0x4aa0('0x41')]);_0x40565b[_0x4aa0('0x47')]=_[_0x4aa0('0x48')](_0x1017b2['query']);_0x40565b['filters']=_['intersection'](_0x40565b[_0x4aa0('0x45')],_0x40565b['query']);_0x4585a3[_0x4aa0('0x4b')]=_[_0x4aa0('0x4a')](_0x40565b[_0x4aa0('0x45')],qs[_0x4aa0('0x4c')](_0x1017b2[_0x4aa0('0x47')]['fields']));_0x4585a3['attributes']=_0x4585a3['attributes'][_0x4aa0('0x4d')]?_0x4585a3[_0x4aa0('0x4b')]:_0x40565b['model'];_0x4585a3[_0x4aa0('0x50')]=qs[_0x4aa0('0x51')](_0x1017b2[_0x4aa0('0x47')]['sort']);_0x4585a3[_0x4aa0('0x52')]=qs[_0x4aa0('0x49')](_[_0x4aa0('0x53')](_0x1017b2[_0x4aa0('0x47')],_0x40565b[_0x4aa0('0x49')]));if(_0x1017b2[_0x4aa0('0x47')][_0x4aa0('0x54')]){_0x4585a3['where']=_[_0x4aa0('0x5b')](_0x4585a3[_0x4aa0('0x52')],{'$or':_[_0x4aa0('0x46')](_0x4585a3[_0x4aa0('0x4b')],function(_0x508e24){var _0x981117={};_0x981117[_0x508e24]={'$like':'%'+_0x1017b2[_0x4aa0('0x47')][_0x4aa0('0x54')]+'%'};return _0x981117;})});}_0x4585a3=_[_0x4aa0('0x5b')]({},_0x4585a3,_0x1017b2[_0x4aa0('0x56')]);return _0x305844[_0x4aa0('0x135')](_0x4585a3);}})[_0x4aa0('0x1d')](function(_0x749aa0){if(_0x749aa0){_0x21b263=_0x749aa0[_0x4aa0('0x4d')];if(!_0x1017b2['query'][_0x4aa0('0x4e')]('nolimit')){_0x4585a3[_0x4aa0('0x2d')]=qs[_0x4aa0('0x2d')](_0x1017b2['query']['limit']);_0x4585a3[_0x4aa0('0x2c')]=qs[_0x4aa0('0x2c')](_0x1017b2[_0x4aa0('0x47')][_0x4aa0('0x2c')]);}return _0x305844['getAgents'](_0x4585a3);}})[_0x4aa0('0x1d')](function(_0x586771){if(_0x586771){return _0x586771?{'count':_0x21b263,'rows':_0x586771}:null;}})[_0x4aa0('0x1d')](respondWithResult(_0x2677a6,null))['catch'](handleError(_0x2677a6,null));};
\ No newline at end of file
+var _0xd020=['ids','addLogo','sitepic','file','filename','addAvatar','agentAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','custom','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','no\x20available\x20attributes','updatedAt','difference','createdAt','CompanyId','ListId','from','Sequelize','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','ChatApplication','List','account','applications','Applications','orderBy','priority','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','stringify','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','messageId','created','autoclose','push','unmanaged','ChatMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','notify','offline','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','toPairs','ChatOfflineMessage','originalname','server','files','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','service','host','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','mimetype','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','remove','addInteraction','getInteractions','Owner','fullname','internal','Tag','color','tag','Command','getSnippet','timezone','iftime\x20%s','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','interval','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','getLicense','virtual','chatLicenseExceeded','all','some','utf8','remote','connection','remoteAddress','render','alignment','verticalAlignment','textColor','backgroundColor','addApplications','findAndCountAll','getApplications','chatProactiveAction','addProactiveActions','omit','ChatProactiveAction','getFields','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Contact','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','jayson/promise','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','end','status','json','offset','limit','count','set','apply','reject','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','map','ChatWebsite','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','show','params','mandatoryDispositionPause','rawAttributes','find','create','body','user','ChatWebsites','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','options','rows','removeDispositions','addAnswer','ChatWebsiteId','CannedAnswer','getAnswers','removeAnswers'];(function(_0xf442cb,_0x48c503){var _0x1d6c69=function(_0xeb6bd1){while(--_0xeb6bd1){_0xf442cb['push'](_0xf442cb['shift']());}};_0x1d6c69(++_0x48c503);}(_0xd020,0xc1));var _0x0d02=function(_0x3d8f92,_0x14017a){_0x3d8f92=_0x3d8f92-0x0;var _0x1e7b44=_0xd020[_0x3d8f92];return _0x1e7b44;};'use strict';var emlformat=require(_0x0d02('0x0'));var rimraf=require(_0x0d02('0x1'));var zipdir=require(_0x0d02('0x2'));var jsonpatch=require(_0x0d02('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0d02('0x4'));var Mustache=require(_0x0d02('0x5'));var util=require(_0x0d02('0x6'));var path=require(_0x0d02('0x7'));var sox=require(_0x0d02('0x8'));var csv=require(_0x0d02('0x9'));var ejs=require(_0x0d02('0xa'));var fs=require('fs');var fs_extra=require(_0x0d02('0xb'));var _=require('lodash');var squel=require(_0x0d02('0xc'));var crypto=require(_0x0d02('0xd'));var jsforce=require(_0x0d02('0xe'));var deskjs=require(_0x0d02('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0d02('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0d02('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0d02('0x12'));var hardwareService=require(_0x0d02('0x13'));var logger=require(_0x0d02('0x14'))(_0x0d02('0x15'));var utils=require(_0x0d02('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0d02('0x17'));var db=require('../../mysqldb')['db'];config[_0x0d02('0x18')]=_[_0x0d02('0x19')](config['redis'],{'host':_0x0d02('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0d02('0x18')]));require('./chatWebsite.socket')['register'](socket);var jayson=require(_0x0d02('0x1b'));var client=jayson['client'][_0x0d02('0x1c')]({'port':0x232c});var client9002=jayson[_0x0d02('0x1d')][_0x0d02('0x1c')]({'port':0x232a});var client9003=jayson[_0x0d02('0x1d')][_0x0d02('0x1c')]({'port':0x232b});var client9001=jayson[_0x0d02('0x1d')]['http']({'port':0x2329});function respondWithRpcPromise(_0x5a8151,_0x3dba0e,_0x1abef1,_0x30a106){return new BPromise(function(_0xac97a4,_0x27d49f){var _0x1067ad=_0x30a106||client;return _0x1067ad[_0x0d02('0x1e')](_0x5a8151,_0x1abef1)[_0x0d02('0x1f')](function(_0x56fbb9){logger[_0x0d02('0x20')](_0x0d02('0x21'),_0x3dba0e,_0x0d02('0x22'));logger[_0x0d02('0x23')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x3dba0e,_0x0d02('0x22'),JSON['stringify'](_0x56fbb9));if(_0x56fbb9[_0x0d02('0x24')]){if(_0x56fbb9[_0x0d02('0x24')][_0x0d02('0x25')]===0x1f4){logger['error'](_0x0d02('0x21'),_0x3dba0e,_0x56fbb9['error']['message']);return _0x27d49f(_0x56fbb9[_0x0d02('0x24')]['message']);}logger[_0x0d02('0x24')]('ChatWebsite,\x20%s,\x20%s',_0x3dba0e,_0x56fbb9[_0x0d02('0x24')][_0x0d02('0x26')]);return _0xac97a4(_0x56fbb9[_0x0d02('0x24')]['message']);}else{logger[_0x0d02('0x20')](_0x0d02('0x21'),_0x3dba0e,_0x0d02('0x22'));_0xac97a4(_0x56fbb9[_0x0d02('0x27')]['message']);}})[_0x0d02('0x28')](function(_0x4188bb){logger[_0x0d02('0x24')](_0x0d02('0x21'),_0x3dba0e,_0x4188bb);_0x27d49f(_0x4188bb);});});}function respondWithStatusCode(_0x5d1e86,_0x39e4aa){_0x39e4aa=_0x39e4aa||0xcc;return function(_0x16ee6a){if(_0x16ee6a){return _0x5d1e86[_0x0d02('0x29')](_0x39e4aa);}return _0x5d1e86['status'](_0x39e4aa)[_0x0d02('0x2a')]();};}function respondWithResult(_0x27d0aa,_0x49dc1){_0x49dc1=_0x49dc1||0xc8;return function(_0x314d6f){if(_0x314d6f){return _0x27d0aa[_0x0d02('0x2b')](_0x49dc1)[_0x0d02('0x2c')](_0x314d6f);}};}function respondWithFilteredResult(_0x50c068,_0xab0add){return function(_0x195dc4){if(_0x195dc4){var _0x835714=typeof _0xab0add[_0x0d02('0x2d')]==='undefined'&&typeof _0xab0add[_0x0d02('0x2e')]==='undefined';var _0x9121b4=_0x195dc4['count'];var _0x2fef79=_0x835714?0x0:_0xab0add['offset'];var _0x242220=_0x835714?_0x195dc4[_0x0d02('0x2f')]:_0xab0add[_0x0d02('0x2d')]+_0xab0add['limit'];var _0x3ee0a2;if(_0x242220>=_0x9121b4){_0x242220=_0x9121b4;_0x3ee0a2=0xc8;}else{_0x3ee0a2=0xce;}_0x50c068[_0x0d02('0x2b')](_0x3ee0a2);return _0x50c068[_0x0d02('0x30')]('Content-Range',_0x2fef79+'-'+_0x242220+'/'+_0x9121b4)[_0x0d02('0x2c')](_0x195dc4);}return null;};}function patchUpdates(_0x2b095f){return function(_0x57d6c3){try{jsonpatch[_0x0d02('0x31')](_0x57d6c3,_0x2b095f,!![]);}catch(_0x4b1ac1){return BPromise[_0x0d02('0x32')](_0x4b1ac1);}return _0x57d6c3['save']();};}function saveUpdates(_0x5cb65c,_0x35c9d0){return function(_0x4e4469){if(_0x4e4469){return _0x4e4469[_0x0d02('0x33')](_0x5cb65c)[_0x0d02('0x1f')](function(_0x9a0076){return _0x9a0076;});}return null;};}function removeEntity(_0x58c671,_0x2867ba){return function(_0x12ec02){if(_0x12ec02){return _0x12ec02[_0x0d02('0x34')]()[_0x0d02('0x1f')](function(){var _0x3acd7d=_0x12ec02[_0x0d02('0x35')]({'plain':!![]});var _0x5c2670='ChatWebsites';return db[_0x0d02('0x36')]['destroy']({'where':{'type':_0x5c2670,'resourceId':_0x3acd7d['id']}})[_0x0d02('0x1f')](function(){return _0x12ec02;});})[_0x0d02('0x1f')](function(){_0x58c671[_0x0d02('0x2b')](0xcc)[_0x0d02('0x2a')]();});}};}function handleEntityNotFound(_0x5895e3,_0x1f98e0){return function(_0x219282){if(!_0x219282){_0x5895e3['sendStatus'](0x194);}return _0x219282;};}function handleError(_0x257c64,_0x18593d){_0x18593d=_0x18593d||0x1f4;return function(_0x44bffb){logger['error'](_0x44bffb[_0x0d02('0x37')]);if(_0x44bffb[_0x0d02('0x38')]){delete _0x44bffb['name'];}_0x257c64[_0x0d02('0x2b')](_0x18593d)[_0x0d02('0x39')](_0x44bffb);};}exports[_0x0d02('0x3a')]=function(_0x36dba8,_0x9001bf){var _0x3a55c1={'include':[{'model':db[_0x0d02('0x3b')],'as':'mandatoryDispositionPause'}]},_0x3f21e8={},_0x229fa4={'count':0x0,'rows':[]};var _0x2adb31=_[_0x0d02('0x3c')](db[_0x0d02('0x3d')]['rawAttributes'],function(_0x16eff3){return{'name':_0x16eff3['fieldName'],'type':_0x16eff3[_0x0d02('0x3e')][_0x0d02('0x3f')]};});_0x3f21e8[_0x0d02('0x40')]=_[_0x0d02('0x3c')](_0x2adb31,_0x0d02('0x38'));_0x3f21e8[_0x0d02('0x41')]=_[_0x0d02('0x42')](_0x36dba8[_0x0d02('0x41')]);_0x3f21e8[_0x0d02('0x43')]=_[_0x0d02('0x44')](_0x3f21e8[_0x0d02('0x40')],_0x3f21e8['query']);_0x3a55c1[_0x0d02('0x45')]=_['intersection'](_0x3f21e8[_0x0d02('0x40')],qs[_0x0d02('0x46')](_0x36dba8[_0x0d02('0x41')][_0x0d02('0x46')]));_0x3a55c1[_0x0d02('0x45')]=_0x3a55c1[_0x0d02('0x45')][_0x0d02('0x47')]?_0x3a55c1[_0x0d02('0x45')]:_0x3f21e8['model'];if(!_0x36dba8[_0x0d02('0x41')][_0x0d02('0x48')](_0x0d02('0x49'))){_0x3a55c1[_0x0d02('0x2e')]=qs['limit'](_0x36dba8[_0x0d02('0x41')][_0x0d02('0x2e')]);_0x3a55c1[_0x0d02('0x2d')]=qs[_0x0d02('0x2d')](_0x36dba8['query'][_0x0d02('0x2d')]);}_0x3a55c1[_0x0d02('0x4a')]=qs[_0x0d02('0x4b')](_0x36dba8[_0x0d02('0x41')][_0x0d02('0x4b')]);_0x3a55c1[_0x0d02('0x4c')]=qs[_0x0d02('0x43')](_[_0x0d02('0x4d')](_0x36dba8[_0x0d02('0x41')],_0x3f21e8[_0x0d02('0x43')]),_0x2adb31);if(_0x36dba8[_0x0d02('0x41')][_0x0d02('0x4e')]){_0x3a55c1['where']=_['merge'](_0x3a55c1[_0x0d02('0x4c')],{'$or':_[_0x0d02('0x3c')](_0x2adb31,function(_0x460756){if(_0x460756[_0x0d02('0x3e')]!==_0x0d02('0x4f')){var _0x5ded71={};_0x5ded71[_0x460756[_0x0d02('0x38')]]={'$like':'%'+_0x36dba8['query'][_0x0d02('0x4e')]+'%'};return _0x5ded71;}})});}_0x3a55c1=_[_0x0d02('0x50')]({},_0x3a55c1,_0x36dba8['options']);var _0x4f14a3={'where':_0x3a55c1['where']};return db[_0x0d02('0x3d')]['count'](_0x4f14a3)['then'](function(_0x587237){_0x229fa4[_0x0d02('0x2f')]=_0x587237;if(_0x36dba8[_0x0d02('0x41')][_0x0d02('0x51')]){_0x3a55c1[_0x0d02('0x52')]=[{'all':!![]}];}return db['ChatWebsite'][_0x0d02('0x53')](_0x3a55c1);})[_0x0d02('0x1f')](function(_0x1a52da){_0x229fa4['rows']=_0x1a52da;return _0x229fa4;})[_0x0d02('0x1f')](respondWithFilteredResult(_0x9001bf,_0x3a55c1))[_0x0d02('0x28')](handleError(_0x9001bf,null));};exports[_0x0d02('0x54')]=function(_0x4ba734,_0x44c5bf){var _0xfc3caf={'raw':![],'where':{'id':_0x4ba734[_0x0d02('0x55')]['id']},'include':[{'model':db[_0x0d02('0x3b')],'as':_0x0d02('0x56')}]},_0x291c25={};_0x291c25[_0x0d02('0x40')]=_['keys'](db[_0x0d02('0x3d')][_0x0d02('0x57')]);_0x291c25['query']=_[_0x0d02('0x42')](_0x4ba734[_0x0d02('0x41')]);_0x291c25['filters']=_['intersection'](_0x291c25[_0x0d02('0x40')],_0x291c25[_0x0d02('0x41')]);_0xfc3caf['attributes']=_[_0x0d02('0x44')](_0x291c25[_0x0d02('0x40')],qs['fields'](_0x4ba734['query'][_0x0d02('0x46')]));_0xfc3caf[_0x0d02('0x45')]=_0xfc3caf[_0x0d02('0x45')][_0x0d02('0x47')]?_0xfc3caf[_0x0d02('0x45')]:_0x291c25[_0x0d02('0x40')];if(_0x4ba734[_0x0d02('0x41')][_0x0d02('0x51')]){_0xfc3caf[_0x0d02('0x52')]=[{'all':!![]}];}_0xfc3caf=_[_0x0d02('0x50')]({},_0xfc3caf,_0x4ba734['options']);return db['ChatWebsite'][_0x0d02('0x58')](_0xfc3caf)['then'](handleEntityNotFound(_0x44c5bf,null))[_0x0d02('0x1f')](respondWithResult(_0x44c5bf,null))['catch'](handleError(_0x44c5bf,null));};exports[_0x0d02('0x59')]=function(_0x431ff1,_0x2acd08){return db[_0x0d02('0x3d')][_0x0d02('0x59')](_0x431ff1[_0x0d02('0x5a')],{})['then'](function(_0x3ee9c6){var _0x2b82fc=_0x431ff1[_0x0d02('0x5b')][_0x0d02('0x35')]({'plain':!![]});if(!_0x2b82fc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b82fc['role']===_0x0d02('0x5b')){var _0x6da06b=_0x3ee9c6[_0x0d02('0x35')]({'plain':!![]});var _0x408ccf=_0x0d02('0x5c');return db[_0x0d02('0x5d')][_0x0d02('0x58')]({'where':{'name':_0x408ccf,'userProfileId':_0x2b82fc[_0x0d02('0x5e')]},'raw':!![]})['then'](function(_0x5256ae){if(_0x5256ae&&_0x5256ae['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x6da06b[_0x0d02('0x38')],'resourceId':_0x6da06b['id'],'type':_0x5256ae['name'],'sectionId':_0x5256ae['id']},{})[_0x0d02('0x1f')](function(){return _0x3ee9c6;});}else{return _0x3ee9c6;}})[_0x0d02('0x28')](function(_0x23903d){logger[_0x0d02('0x24')](_0x0d02('0x5f'),_0x23903d);throw _0x23903d;});}return _0x3ee9c6;})[_0x0d02('0x1f')](respondWithResult(_0x2acd08,0xc9))[_0x0d02('0x28')](handleError(_0x2acd08,null));};exports['update']=function(_0x448fec,_0x126ab2){if(_0x448fec[_0x0d02('0x5a')]['id']){delete _0x448fec['body']['id'];}return db['ChatWebsite'][_0x0d02('0x58')]({'where':{'id':_0x448fec[_0x0d02('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0x0d02('0x56')}]})[_0x0d02('0x1f')](handleEntityNotFound(_0x126ab2,null))[_0x0d02('0x1f')](saveUpdates(_0x448fec[_0x0d02('0x5a')],null))[_0x0d02('0x1f')](respondWithResult(_0x126ab2,null))[_0x0d02('0x28')](handleError(_0x126ab2,null));};exports[_0x0d02('0x34')]=function(_0x245c84,_0x598cf7){return db['ChatWebsite'][_0x0d02('0x58')]({'where':{'id':_0x245c84['params']['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0x598cf7,null))[_0x0d02('0x1f')](removeEntity(_0x598cf7,null))[_0x0d02('0x28')](handleError(_0x598cf7,null));};exports[_0x0d02('0x60')]=function(_0xb267c3,_0x460b79){return db['ChatWebsite']['describe']()[_0x0d02('0x1f')](respondWithResult(_0x460b79,null))[_0x0d02('0x28')](handleError(_0x460b79,null));};exports[_0x0d02('0x61')]=function(_0x5e14da,_0x446a97,_0xa79c6b){if(_0x5e14da[_0x0d02('0x5a')]['id']){delete _0x5e14da[_0x0d02('0x5a')]['id'];}return db[_0x0d02('0x3d')][_0x0d02('0x58')]({'where':{'id':_0x5e14da['params']['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0x446a97,null))[_0x0d02('0x1f')](function(_0x3e0450){if(_0x3e0450){_0x5e14da[_0x0d02('0x5a')]['ChatWebsiteId']=_0x3e0450['id'];return db[_0x0d02('0x62')]['create'](_0x5e14da[_0x0d02('0x5a')]);}})[_0x0d02('0x1f')](respondWithResult(_0x446a97,null))[_0x0d02('0x28')](handleError(_0x446a97,null));};exports[_0x0d02('0x63')]=function(_0x1d59b0,_0x510099,_0x11fb0e){var _0x177151={'raw':![],'where':{}};var _0x57a16a={};var _0x2a93e3={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0d02('0x64')]({'where':{'id':_0x1d59b0[_0x0d02('0x55')]['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0x510099,null))[_0x0d02('0x1f')](function(_0x3dbe3e){if(_0x3dbe3e){_0x57a16a[_0x0d02('0x40')]=_[_0x0d02('0x42')](db[_0x0d02('0x62')]['rawAttributes']);_0x57a16a['query']=_[_0x0d02('0x42')](_0x1d59b0['query']);_0x57a16a[_0x0d02('0x43')]=_[_0x0d02('0x44')](_0x57a16a[_0x0d02('0x40')],_0x57a16a[_0x0d02('0x41')]);_0x177151[_0x0d02('0x45')]=_[_0x0d02('0x44')](_0x57a16a[_0x0d02('0x40')],qs['fields'](_0x1d59b0[_0x0d02('0x41')][_0x0d02('0x46')]));_0x177151['attributes']=_0x177151[_0x0d02('0x45')]['length']?_0x177151[_0x0d02('0x45')]:_0x57a16a[_0x0d02('0x40')];if(!_0x1d59b0['query'][_0x0d02('0x48')](_0x0d02('0x49'))){_0x177151[_0x0d02('0x2e')]=qs[_0x0d02('0x2e')](_0x1d59b0[_0x0d02('0x41')][_0x0d02('0x2e')]);_0x177151[_0x0d02('0x2d')]=qs[_0x0d02('0x2d')](_0x1d59b0[_0x0d02('0x41')][_0x0d02('0x2d')]);}_0x177151[_0x0d02('0x4a')]=qs[_0x0d02('0x4b')](_0x1d59b0['query'][_0x0d02('0x4b')]);_0x177151[_0x0d02('0x4c')]=qs[_0x0d02('0x43')](_[_0x0d02('0x4d')](_0x1d59b0[_0x0d02('0x41')],_0x57a16a[_0x0d02('0x43')]));_0x177151['where']['ChatWebsiteId']=_0x3dbe3e['id'];if(_0x1d59b0[_0x0d02('0x41')][_0x0d02('0x4e')]){_0x177151[_0x0d02('0x4c')]=_[_0x0d02('0x50')](_0x177151[_0x0d02('0x4c')],{'$or':_['map'](_0x177151[_0x0d02('0x45')],function(_0x5c0268){var _0xe1f4e8={};_0xe1f4e8[_0x5c0268]={'$like':'%'+_0x1d59b0[_0x0d02('0x41')][_0x0d02('0x4e')]+'%'};return _0xe1f4e8;})});}_0x177151=_[_0x0d02('0x50')]({},_0x177151,_0x1d59b0[_0x0d02('0x65')]);return db['Disposition']['count']({'where':_0x177151['where']})[_0x0d02('0x1f')](function(_0x1de735){_0x2a93e3[_0x0d02('0x2f')]=_0x1de735;if(_0x1d59b0[_0x0d02('0x41')]['includeAll']){_0x177151['include']=[{'all':!![]}];}return db[_0x0d02('0x62')][_0x0d02('0x53')](_0x177151);})[_0x0d02('0x1f')](function(_0x2d699a){_0x2a93e3[_0x0d02('0x66')]=_0x2d699a;return _0x2a93e3;});}})[_0x0d02('0x1f')](respondWithFilteredResult(_0x510099,_0x177151))['catch'](handleError(_0x510099,null));};exports[_0x0d02('0x67')]=function(_0x1736be,_0x49e068,_0x30b046){return db[_0x0d02('0x3d')][_0x0d02('0x58')]({'where':{'id':_0x1736be['params']['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0x49e068,null))[_0x0d02('0x1f')](function(_0x19a47e){if(_0x19a47e){return _0x19a47e[_0x0d02('0x67')](_0x1736be['query']['ids']);}})[_0x0d02('0x1f')](respondWithStatusCode(_0x49e068,null))[_0x0d02('0x28')](handleError(_0x49e068,null));};exports[_0x0d02('0x68')]=function(_0xe4644,_0x161b21,_0x381868){if(_0xe4644['body']['id']){delete _0xe4644[_0x0d02('0x5a')]['id'];}return db[_0x0d02('0x3d')]['find']({'where':{'id':_0xe4644['params']['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0x161b21,null))[_0x0d02('0x1f')](function(_0x34a89e){if(_0x34a89e){_0xe4644[_0x0d02('0x5a')][_0x0d02('0x69')]=_0x34a89e['id'];return db[_0x0d02('0x6a')][_0x0d02('0x59')](_0xe4644['body']);}})[_0x0d02('0x1f')](respondWithResult(_0x161b21,null))[_0x0d02('0x28')](handleError(_0x161b21,null));};exports[_0x0d02('0x6b')]=function(_0x3bd06e,_0x49a8f1,_0x15773a){var _0x92182b={'raw':![],'where':{}};var _0x3297f6={};var _0x3e288a={'count':0x0,'rows':[]};return db[_0x0d02('0x3d')][_0x0d02('0x64')]({'where':{'id':_0x3bd06e['params']['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0x49a8f1,null))[_0x0d02('0x1f')](function(_0x47600a){if(_0x47600a){_0x3297f6[_0x0d02('0x40')]=_[_0x0d02('0x42')](db['CannedAnswer'][_0x0d02('0x57')]);_0x3297f6['query']=_[_0x0d02('0x42')](_0x3bd06e['query']);_0x3297f6[_0x0d02('0x43')]=_[_0x0d02('0x44')](_0x3297f6[_0x0d02('0x40')],_0x3297f6[_0x0d02('0x41')]);_0x92182b[_0x0d02('0x45')]=_[_0x0d02('0x44')](_0x3297f6[_0x0d02('0x40')],qs[_0x0d02('0x46')](_0x3bd06e['query']['fields']));_0x92182b[_0x0d02('0x45')]=_0x92182b[_0x0d02('0x45')][_0x0d02('0x47')]?_0x92182b[_0x0d02('0x45')]:_0x3297f6['model'];if(!_0x3bd06e[_0x0d02('0x41')][_0x0d02('0x48')](_0x0d02('0x49'))){_0x92182b[_0x0d02('0x2e')]=qs[_0x0d02('0x2e')](_0x3bd06e[_0x0d02('0x41')]['limit']);_0x92182b[_0x0d02('0x2d')]=qs['offset'](_0x3bd06e[_0x0d02('0x41')]['offset']);}_0x92182b[_0x0d02('0x4a')]=qs[_0x0d02('0x4b')](_0x3bd06e[_0x0d02('0x41')][_0x0d02('0x4b')]);_0x92182b[_0x0d02('0x4c')]=qs[_0x0d02('0x43')](_[_0x0d02('0x4d')](_0x3bd06e['query'],_0x3297f6[_0x0d02('0x43')]));_0x92182b[_0x0d02('0x4c')][_0x0d02('0x69')]=_0x47600a['id'];if(_0x3bd06e['query']['filter']){_0x92182b[_0x0d02('0x4c')]=_[_0x0d02('0x50')](_0x92182b[_0x0d02('0x4c')],{'$or':_[_0x0d02('0x3c')](_0x92182b['attributes'],function(_0x2e188a){var _0x43c2f8={};_0x43c2f8[_0x2e188a]={'$like':'%'+_0x3bd06e[_0x0d02('0x41')][_0x0d02('0x4e')]+'%'};return _0x43c2f8;})});}_0x92182b=_[_0x0d02('0x50')]({},_0x92182b,_0x3bd06e['options']);return db[_0x0d02('0x6a')][_0x0d02('0x2f')]({'where':_0x92182b[_0x0d02('0x4c')]})[_0x0d02('0x1f')](function(_0x47b716){_0x3e288a['count']=_0x47b716;if(_0x3bd06e[_0x0d02('0x41')][_0x0d02('0x51')]){_0x92182b[_0x0d02('0x52')]=[{'all':!![]}];}return db[_0x0d02('0x6a')][_0x0d02('0x53')](_0x92182b);})[_0x0d02('0x1f')](function(_0x12c85e){_0x3e288a[_0x0d02('0x66')]=_0x12c85e;return _0x3e288a;});}})[_0x0d02('0x1f')](respondWithFilteredResult(_0x49a8f1,_0x92182b))[_0x0d02('0x28')](handleError(_0x49a8f1,null));};exports['removeAnswers']=function(_0x2fa6c4,_0x1201e3,_0x33db06){return db['ChatWebsite']['find']({'where':{'id':_0x2fa6c4[_0x0d02('0x55')]['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0x1201e3,null))[_0x0d02('0x1f')](function(_0x157de7){if(_0x157de7){return _0x157de7[_0x0d02('0x6c')](_0x2fa6c4[_0x0d02('0x41')][_0x0d02('0x6d')]);}})['then'](respondWithStatusCode(_0x1201e3,null))['catch'](handleError(_0x1201e3,null));};exports[_0x0d02('0x6e')]=function(_0x2b3e9d,_0x1cd490,_0x4d7055){_0x2b3e9d[_0x0d02('0x5a')][_0x0d02('0x6f')]=_0x2b3e9d[_0x0d02('0x70')][_0x0d02('0x71')];return db[_0x0d02('0x3d')][_0x0d02('0x58')]({'where':{'id':_0x2b3e9d[_0x0d02('0x55')]['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0x1cd490,null))[_0x0d02('0x1f')](saveUpdates(_0x2b3e9d[_0x0d02('0x5a')],null))[_0x0d02('0x1f')](respondWithResult(_0x1cd490,null))[_0x0d02('0x28')](handleError(_0x1cd490,null));};exports[_0x0d02('0x72')]=function(_0x35abc1,_0x5bd245,_0x27cc0a){_0x35abc1[_0x0d02('0x5a')][_0x0d02('0x73')]=_0x35abc1[_0x0d02('0x70')][_0x0d02('0x71')];return db[_0x0d02('0x3d')]['find']({'where':{'id':_0x35abc1[_0x0d02('0x55')]['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0x5bd245,null))['then'](saveUpdates(_0x35abc1[_0x0d02('0x5a')],null))['then'](respondWithResult(_0x5bd245,null))[_0x0d02('0x28')](handleError(_0x5bd245,null));};exports['addCustomerAvatar']=function(_0x5c352d,_0x476362,_0x4fe81e){_0x5c352d['body'][_0x0d02('0x74')]=_0x5c352d[_0x0d02('0x70')][_0x0d02('0x71')];return db[_0x0d02('0x3d')][_0x0d02('0x58')]({'where':{'id':_0x5c352d[_0x0d02('0x55')]['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0x476362,null))['then'](saveUpdates(_0x5c352d[_0x0d02('0x5a')],null))[_0x0d02('0x1f')](respondWithResult(_0x476362,null))[_0x0d02('0x28')](handleError(_0x476362,null));};exports[_0x0d02('0x75')]=function(_0x5de6d6,_0x12970e,_0x197382){_0x5de6d6[_0x0d02('0x5a')][_0x0d02('0x76')]=_0x5de6d6[_0x0d02('0x70')][_0x0d02('0x71')];return db['ChatWebsite'][_0x0d02('0x58')]({'where':{'id':_0x5de6d6[_0x0d02('0x55')]['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0x12970e,null))[_0x0d02('0x1f')](saveUpdates(_0x5de6d6[_0x0d02('0x5a')],null))[_0x0d02('0x1f')](respondWithResult(_0x12970e,null))[_0x0d02('0x28')](handleError(_0x12970e,null));};exports['getLogo']=function(_0x1b9678,_0x5c2f17,_0xbd3f1){var _0x42fbb6=path[_0x0d02('0x77')](config[_0x0d02('0x78')],_0x0d02('0x79'));var _0x3273dd={'where':{'id':_0x1b9678['params']['id']},'attributes':['id',_0x0d02('0x6f')],'raw':!![]};var _0x2fc6a0=![];return require(_0x0d02('0x17'))['getLicense']()[_0x0d02('0x1f')](function(_0x50a2cf){if(_0x50a2cf){_0x2fc6a0=_0x50a2cf[_0x0d02('0x7a')];}})[_0x0d02('0x1f')](function(){return db[_0x0d02('0x3d')][_0x0d02('0x58')](_0x3273dd);})['then'](handleEntityNotFound(_0x5c2f17,null))[_0x0d02('0x1f')](function(_0x29c9cd){if(_0x29c9cd){if(!_[_0x0d02('0x7b')](_0x29c9cd[_0x0d02('0x6f')])){if(fs['existsSync'](path['join'](config['root'],_0x0d02('0x7c'),_0x29c9cd[_0x0d02('0x6f')]))&&_0x2fc6a0){_0x42fbb6=path[_0x0d02('0x77')](config[_0x0d02('0x78')],'server/files/images/logos/',_0x29c9cd[_0x0d02('0x6f')]);}}return _0x5c2f17[_0x0d02('0x7d')](_0x42fbb6);}})[_0x0d02('0x28')](handleError(_0x5c2f17,null));};exports[_0x0d02('0x7e')]=function(_0x2e649f,_0x2fdb7c,_0x2c52e8){var _0x34b614=path[_0x0d02('0x77')](config[_0x0d02('0x78')],_0x0d02('0x7f'));var _0x59dc6b={'where':{'id':_0x2e649f[_0x0d02('0x55')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x0d02('0x3d')][_0x0d02('0x58')](_0x59dc6b)['then'](handleEntityNotFound(_0x2fdb7c,null))[_0x0d02('0x1f')](function(_0x4c183e){if(_0x4c183e){if(!_[_0x0d02('0x7b')](_0x4c183e[_0x0d02('0x73')])){if(fs[_0x0d02('0x80')](path[_0x0d02('0x77')](config[_0x0d02('0x78')],'server/files/images/avatars/',_0x4c183e[_0x0d02('0x73')]))){_0x34b614=path[_0x0d02('0x77')](config['root'],_0x0d02('0x81'),_0x4c183e[_0x0d02('0x73')]);}}return _0x2fdb7c[_0x0d02('0x7d')](_0x34b614);}})['catch'](handleError(_0x2fdb7c,null));};exports['getCustomerAvatar']=function(_0x16ba30,_0x489bc0,_0x7f88d1){var _0x2f38c1=path[_0x0d02('0x77')](config[_0x0d02('0x78')],_0x0d02('0x82'));var _0x97e73c={'where':{'id':_0x16ba30[_0x0d02('0x55')]['id']},'attributes':['id',_0x0d02('0x74'),_0x0d02('0x83')],'raw':!![]};return db[_0x0d02('0x3d')][_0x0d02('0x58')](_0x97e73c)[_0x0d02('0x1f')](handleEntityNotFound(_0x489bc0,null))[_0x0d02('0x1f')](function(_0x3087e4){if(_0x3087e4){if(!_[_0x0d02('0x7b')](_0x3087e4[_0x0d02('0x74')])){if(fs['existsSync'](path['join'](config[_0x0d02('0x78')],_0x0d02('0x81'),_0x3087e4['customerAvatar']))&&_0x3087e4[_0x0d02('0x83')]){_0x2f38c1=path[_0x0d02('0x77')](config['root'],_0x0d02('0x81'),_0x3087e4[_0x0d02('0x74')]);}}return _0x489bc0[_0x0d02('0x7d')](_0x2f38c1);}})[_0x0d02('0x28')](handleError(_0x489bc0,null));};exports['getSystemAvatar']=function(_0x1895a6,_0x1d16ce,_0x341c79){var _0x517d83=path[_0x0d02('0x77')](config['root'],_0x0d02('0x84'));var _0x1e6722={'where':{'id':_0x1895a6['params']['id']},'attributes':['id',_0x0d02('0x76')],'raw':!![]};return db[_0x0d02('0x3d')][_0x0d02('0x58')](_0x1e6722)[_0x0d02('0x1f')](handleEntityNotFound(_0x1d16ce,null))[_0x0d02('0x1f')](function(_0x48f2fd){if(_0x48f2fd){if(!_[_0x0d02('0x7b')](_0x48f2fd[_0x0d02('0x76')])){if(fs['existsSync'](path[_0x0d02('0x77')](config[_0x0d02('0x78')],_0x0d02('0x81'),_0x48f2fd[_0x0d02('0x76')]))){_0x517d83=path[_0x0d02('0x77')](config[_0x0d02('0x78')],_0x0d02('0x81'),_0x48f2fd[_0x0d02('0x76')]);}}return _0x1d16ce['download'](_0x517d83);}})[_0x0d02('0x28')](handleError(_0x1d16ce,null));};exports['notify']=function(_0x32a6a6,_0x550442,_0x324f70){var _0x5870c2=require(_0x0d02('0x85'));var _0xbf3318=new _0x5870c2();var _0x24ee28=_0xbf3318[_0x0d02('0x86')](_0x32a6a6[_0x0d02('0x87')][_0x0d02('0x88')])[_0x0d02('0x89')]();var _0x58d0a5={'body':_0x32a6a6['body'],'channel':_0x0d02('0x8a')};var _0x354127=[];var _0xdcbe12=[];var _0x4fe7d6={};var _0x522a51=![];return db[_0x0d02('0x8b')][_0x0d02('0x60')]()[_0x0d02('0x1f')](function(_0x4c4c64){if(!_0x4c4c64){throw new db['Sequelize']['ValidationError'](_0x0d02('0x8c'));}_0x354127=_['difference'](_[_0x0d02('0x42')](_0x4c4c64),['createdAt',_0x0d02('0x8d')]);_0xdcbe12=_[_0x0d02('0x8e')](_[_0x0d02('0x42')](_0x4c4c64),[_0x0d02('0x8f'),'updatedAt',_0x0d02('0x90'),_0x0d02('0x91')]);if(_0x32a6a6[_0x0d02('0x5a')]['id']){delete _0x32a6a6['body']['id'];}if(_['isNil'](_0x32a6a6['body'][_0x0d02('0x92')])){throw new db[(_0x0d02('0x93'))][(_0x0d02('0x94'))]('from\x20is\x20mandatory');}if(_[_0x0d02('0x7b')](_0x32a6a6[_0x0d02('0x5a')]['body'])||_0x32a6a6[_0x0d02('0x5a')][_0x0d02('0x5a')]===''){throw new db[(_0x0d02('0x93'))]['ValidationError'](_0x0d02('0x95'));}if(_[_0x0d02('0x7b')](_0x32a6a6[_0x0d02('0x5a')][_0x0d02('0x96')])){throw new db[(_0x0d02('0x93'))][(_0x0d02('0x94'))](_0x0d02('0x97')+_0xdcbe12);}if(!_[_0x0d02('0x98')](_0xdcbe12,_0x32a6a6[_0x0d02('0x5a')][_0x0d02('0x96')])){throw new db[(_0x0d02('0x93'))][(_0x0d02('0x94'))](_0x0d02('0x99')+_0xdcbe12);}_0x4fe7d6[_0x32a6a6['body'][_0x0d02('0x96')]]=_0x32a6a6[_0x0d02('0x5a')][_0x0d02('0x92')];})[_0x0d02('0x1f')](function(){return db[_0x0d02('0x3d')][_0x0d02('0x58')]({'where':{'id':_0x32a6a6[_0x0d02('0x55')]['id']},'include':[{'model':db[_0x0d02('0x9a')],'as':'List','include':[{'model':db['CmContact'],'as':_0x0d02('0x9b'),'where':_0x4fe7d6,'limit':0x1,'order':[[_0x0d02('0x8d'),_0x0d02('0x9c')]]}]},{'model':db[_0x0d02('0x9d')],'as':'Applications'}]});})[_0x0d02('0x1f')](handleEntityNotFound(_0x550442,null))[_0x0d02('0x1f')](function(_0x262030){if(_0x262030&&_0x262030[_0x0d02('0x9e')]){_0x58d0a5[_0x0d02('0x9f')]=_0x262030;_0x58d0a5[_0x0d02('0xa0')]=_0x262030[_0x0d02('0xa1')];_0x58d0a5['list']=_0x262030[_0x0d02('0x9e')];_0x58d0a5['applications']=_[_0x0d02('0xa2')](_0x58d0a5['applications'],[_0x0d02('0xa3')],[_0x0d02('0xa4')]);if(_0x58d0a5[_0x0d02('0x9f')]['Applications']){delete _0x58d0a5['account'][_0x0d02('0xa1')];}if(_0x58d0a5[_0x0d02('0x9f')]['List']&&_0x58d0a5[_0x0d02('0x9f')][_0x0d02('0x9e')][_0x0d02('0x9b')][_0x0d02('0x47')]){return _0x58d0a5[_0x0d02('0x9f')][_0x0d02('0x9e')][_0x0d02('0x9b')][0x0];}var _0x34cad7=_['defaults'](_0x32a6a6['body'],{'firstName':_0x32a6a6[_0x0d02('0x5a')][_0x0d02('0x92')],'ListId':_0x262030[_0x0d02('0x91')]});_0x34cad7[_0x32a6a6['body']['mapKey']]=_0x32a6a6[_0x0d02('0x5a')]['from'];return db[_0x0d02('0x8b')][_0x0d02('0x59')](_0x34cad7,{'fields':_0x354127,'raw':!![]});}})[_0x0d02('0x1f')](handleEntityNotFound(_0x550442,null))[_0x0d02('0x1f')](function(_0x1e3675){_0x58d0a5[_0x0d02('0xa5')]=_0x1e3675;var _0x5b9bfb=_0x32a6a6[_0x0d02('0x5a')][_0x0d02('0xa6')];if(_0x32a6a6['headers'][_0x0d02('0xa7')]){_0x5b9bfb=_0x32a6a6[_0x0d02('0x87')][_0x0d02('0xa7')];}else if(_0x32a6a6[_0x0d02('0x87')][_0x0d02('0xa8')]){_0x5b9bfb=_['first'](_0x32a6a6['headers'][_0x0d02('0xa8')]['split'](','));}if(_0x1e3675){var _0x22ee8e={'ContactId':_0x1e3675['id'],'ChatWebsiteId':_0x32a6a6['params']['id'],'from':(_0x1e3675[_0x0d02('0xa9')]||'')+'\x20'+(_0x1e3675[_0x0d02('0xaa')]||''),'customerIp':_0x5b9bfb,'customerPort':_0x32a6a6[_0x0d02('0x87')][_0x0d02('0xab')]?_0x32a6a6[_0x0d02('0x87')]['x-real-port']:null,'referer':_0x32a6a6[_0x0d02('0x5a')][_0x0d02('0xac')],'browserName':_0x24ee28[_0x0d02('0xad')][_0x0d02('0x38')]&&_0x24ee28[_0x0d02('0xad')][_0x0d02('0xae')]?util[_0x0d02('0xaf')](_0x0d02('0xb0'),_0x24ee28['browser'][_0x0d02('0x38')],_0x24ee28['browser']['version']):_0x0d02('0xb1'),'browserVersion':_0x24ee28['browser'][_0x0d02('0xae')]||_0x0d02('0xb1'),'osName':util['format'](_0x0d02('0xb0'),_0x24ee28['os'][_0x0d02('0x38')],_0x24ee28['os'][_0x0d02('0xae')]),'osVersion':_0x24ee28['os']['version'],'deviceModel':_0x24ee28[_0x0d02('0xb2')][_0x0d02('0x40')]&&_0x24ee28[_0x0d02('0xb2')][_0x0d02('0xb3')]?util[_0x0d02('0xaf')](_0x0d02('0xb4'),_0x24ee28[_0x0d02('0xb2')][_0x0d02('0x40')],_0x24ee28['device']['vendor'],_0x24ee28[_0x0d02('0xb2')][_0x0d02('0x3e')]):null,'deviceVendor':_0x24ee28['device'][_0x0d02('0xb3')],'deviceType':_0x24ee28[_0x0d02('0xb2')][_0x0d02('0x3e')],'formData':JSON[_0x0d02('0xb5')](_0x32a6a6[_0x0d02('0x5a')])};var _0x44f004={'ChatWebsiteId':_0x32a6a6['params']['id'],'closed':![]};if(_0x32a6a6[_0x0d02('0x5a')][_0x0d02('0xb6')]){_0x44f004['threadId']=_0x32a6a6[_0x0d02('0x5a')][_0x0d02('0xb6')];return db['ChatInteraction']['find']({'where':_0x44f004})['then'](function(_0x350454){if(_0x350454){return[_0x350454,![]];}_0x22ee8e[_0x0d02('0xb6')]=_0x32a6a6['body'][_0x0d02('0xb6')];_0x22ee8e[_0x0d02('0xb7')]=_0x32a6a6['body'][_0x0d02('0xb7')];return db[_0x0d02('0xb8')][_0x0d02('0x59')](_0x22ee8e)[_0x0d02('0x1f')](function(_0x46fc69){return[_0x46fc69,!![]];});});}_0x44f004[_0x0d02('0xb9')]=_0x1e3675['id'];if(_0x32a6a6[_0x0d02('0x5a')][_0x0d02('0xba')]&&_0x32a6a6[_0x0d02('0x5a')][_0x0d02('0xba')]['id']){_0x44f004['id']=_0x32a6a6['body'][_0x0d02('0xba')]['id'];return db[_0x0d02('0xb8')][_0x0d02('0x58')]({'where':_0x44f004})['then'](function(_0x54d701){if(_0x54d701){return[_0x54d701,![]];}return db['ChatInteraction'][_0x0d02('0x59')](_0x22ee8e)[_0x0d02('0x1f')](function(_0x273966){return[_0x273966,!![]];});});}return db['ChatInteraction'][_0x0d02('0x59')](_0x22ee8e)[_0x0d02('0x1f')](function(_0x34f9e4){return[_0x34f9e4,!![]];});}})[_0x0d02('0xbb')](function(_0x3cb0b8,_0x7041c1){if(_0x3cb0b8){_0x522a51=_0x7041c1;if(!_0x7041c1){var _0x3003b1={'from':(_0x58d0a5[_0x0d02('0xa5')]['firstName']||'')+'\x20'+(_0x58d0a5[_0x0d02('0xa5')][_0x0d02('0xaa')]||'')};if(_0x32a6a6[_0x0d02('0x5a')]['threadId']&&_0x32a6a6['body'][_0x0d02('0xbc')]&&_0x32a6a6[_0x0d02('0x5a')][_0x0d02('0xb6')]!=_0x32a6a6[_0x0d02('0x5a')]['messageId']){_0x3003b1[_0x0d02('0xb6')]=_0x32a6a6['body']['messageId'];}return _0x3cb0b8[_0x0d02('0x33')](_0x3003b1);}else{return _0x3cb0b8;}}})[_0x0d02('0x1f')](function(_0x10bd7e){_0x58d0a5[_0x0d02('0xba')]=_0x10bd7e[_0x0d02('0x35')]({'plain':!![]});_0x58d0a5['interaction'][_0x0d02('0xbd')]=_0x522a51;if(_0x58d0a5[_0x0d02('0xba')][_0x0d02('0xbd')]){if(_0x58d0a5[_0x0d02('0x9f')][_0x0d02('0xbe')]){_0x58d0a5['applications'][_0x0d02('0xbf')]({'id':0x0,'priority':_0x58d0a5[_0x0d02('0xa0')]['length']+0x1,'app':'close','appdata':_0x0d02('0xc0'),'interval':'*,*,*,*'});}}return db[_0x0d02('0xc1')][_0x0d02('0x59')]({'body':_0x32a6a6[_0x0d02('0x5a')]['body'],'ChatWebsiteId':_0x32a6a6['params']['id'],'ChatInteractionId':_0x10bd7e['id'],'direction':'in','ContactId':_0x58d0a5['contact']['id'],'AttachmentId':_0x32a6a6['body']['AttachmentId']});})[_0x0d02('0x1f')](function(_0x33a8f7){_0x58d0a5[_0x0d02('0x26')]=_0x33a8f7;if(_0x58d0a5['interaction'][_0x0d02('0xc2')]){return db[_0x0d02('0xc3')]['find']({'attributes':['id',_0x0d02('0x38')],'where':{'id':_0x58d0a5[_0x0d02('0xba')]['UserId']}})[_0x0d02('0x1f')](function(_0x312b41){if(_0x312b41){_0x58d0a5[_0x0d02('0xa0')][_0x0d02('0xc4')]({'id':0x0,'priority':0x0,'app':_0x0d02('0xc5'),'appdata':_0x312b41[_0x0d02('0x38')]+','+(_0x58d0a5['account'][_0x0d02('0xc6')]||0xa),'interval':_0x0d02('0xc7')});_0x58d0a5[_0x0d02('0xc8')]=!![];}return respondWithRpcPromise(_0x0d02('0xc9'),_0x0d02('0xca'),_0x58d0a5);});}return respondWithRpcPromise(_0x0d02('0xc9'),_0x0d02('0xca'),_0x58d0a5);})[_0x0d02('0x1f')](function(_0x23b96c){respondWithRpcPromise('EventManager','EventManager',{'event':_0x0d02('0xcb'),'message':_0x23b96c},client9002);return _0x23b96c;})['then'](respondWithResult(_0x550442,null))[_0x0d02('0x28')](handleError(_0x550442,null));};exports[_0x0d02('0xcc')]=function(_0x5d00b9,_0x385c75,_0x51310c){var _0x5cd080,_0x294474,_0x10f3e2;var _0x6385a9=[];var _0xb7e130=[];var _0x351c36={};var _0x1b58f0=_0x5d00b9['files']||[];var _0x356bb4=[];var _0x2dc9aa;return db['CmContact'][_0x0d02('0x60')]()[_0x0d02('0x1f')](function(_0x2a3616){if(!_0x2a3616){throw new db[(_0x0d02('0x93'))][(_0x0d02('0x94'))](_0x0d02('0x8c'));}_0xb7e130=_['difference'](_[_0x0d02('0x42')](_0x2a3616),['createdAt',_0x0d02('0x8d')]);_0x6385a9=_[_0x0d02('0x8e')](_[_0x0d02('0x42')](_0x2a3616),[_0x0d02('0x8f'),_0x0d02('0x8d'),_0x0d02('0x90'),_0x0d02('0x91')]);if(_0x5d00b9['body']['id']){delete _0x5d00b9['body']['id'];}if(_[_0x0d02('0x7b')](_0x5d00b9[_0x0d02('0x5a')]['from'])){throw _0x385c75[_0x0d02('0x2b')](0x1f4)[_0x0d02('0x39')](new db[(_0x0d02('0x93'))][(_0x0d02('0x94'))](_0x0d02('0xcd')));}if(_[_0x0d02('0x7b')](_0x5d00b9['body'][_0x0d02('0x5a')])||_0x5d00b9[_0x0d02('0x5a')][_0x0d02('0x5a')]===''){throw _0x385c75[_0x0d02('0x2b')](0x1f4)[_0x0d02('0x39')](new db[(_0x0d02('0x93'))][(_0x0d02('0x94'))](_0x0d02('0x95')));}if(_[_0x0d02('0x7b')](_0x5d00b9['body'][_0x0d02('0xce')])){throw _0x385c75[_0x0d02('0x2b')](0x1f4)[_0x0d02('0x39')](new db[(_0x0d02('0x93'))][(_0x0d02('0x94'))](_0x0d02('0xcf')+_0x6385a9));}if(!_[_0x0d02('0x98')](_0x6385a9,_0x5d00b9[_0x0d02('0x5a')][_0x0d02('0xce')])){throw _0x385c75[_0x0d02('0x2b')](0x1f4)[_0x0d02('0x39')](new db[(_0x0d02('0x93'))]['ValidationError'](_0x0d02('0xd0')+_0x6385a9));}_0x351c36[_0x5d00b9['body'][_0x0d02('0xce')]]=_0x5d00b9['body'][_0x0d02('0x92')];})[_0x0d02('0x1f')](function(){return db[_0x0d02('0x3d')][_0x0d02('0x58')]({'where':{'id':_0x5d00b9[_0x0d02('0x55')]['id']},'include':[{'model':db['CmList'],'as':_0x0d02('0x9e')},{'model':db[_0x0d02('0xd1')],'as':_0x0d02('0xd1')}]});})[_0x0d02('0x1f')](handleEntityNotFound(_0x385c75,null))['then'](function(_0x5327dd){if(_0x5327dd&&_0x5327dd[_0x0d02('0x9e')]){_0x294474=_0x5327dd;var _0x1d9b71=_['defaults'](_0x5d00b9[_0x0d02('0x5a')],{'firstName':_0x5d00b9['body'][_0x0d02('0x92')],'phone':_0x5d00b9[_0x0d02('0x5a')][_0x0d02('0x92')],'ListId':_0x5327dd['ListId']});_0x1d9b71[_0x5d00b9['body'][_0x0d02('0xce')]]=_0x5d00b9[_0x0d02('0x5a')]['from'];return db[_0x0d02('0x8b')][_0x0d02('0xd2')]({'where':_0x351c36,'defaults':_0x1d9b71});}})[_0x0d02('0xbb')](function(_0x269389){if(_0x269389){_0x10f3e2=_0x269389;var _0x48055d=fs[_0x0d02('0xd3')](path[_0x0d02('0x77')](config['root'],'server/files/templates/chatOfflineMessage.ejs'),'utf8');var _0x49c4d6=ejs['render'](_0x48055d,{'body':_[_0x0d02('0xd4')](_0x5d00b9[_0x0d02('0x5a')][_0x0d02('0x5a')]),'bodyTitle':_0x294474['offlineMessageBody']});return db[_0x0d02('0xd5')][_0x0d02('0x59')]({'body':_0x49c4d6,'ContactId':_0x269389['id'],'ChatWebsiteId':_0x294474['id']});}})[_0x0d02('0x1f')](function(_0x253437){_0x2dc9aa=_0x253437;if(_0x1b58f0[_0x0d02('0x47')]){var _0x57b039=_0x1b58f0[_0x0d02('0x3c')](function(_0x59cb39){return{'name':_0x59cb39[_0x0d02('0xd6')],'basename':_0x59cb39['filename'],'type':_0x59cb39['mimetype'],'ChatOfflineMessageId':_0x253437['id']};});_0x356bb4=_0x57b039[_0x0d02('0x3c')](_0x451830=>{var _0x149d4e={'filename':_0x451830[_0x0d02('0x38')],'path':path['join'](config[_0x0d02('0x78')],_0x0d02('0xd7'),_0x0d02('0xd8'),'attachments',_0x0d02('0xd9'),_0x451830[_0x0d02('0xda')])};return _0x149d4e;});if(!_0x294474[_0x0d02('0xdb')]){return db[_0x0d02('0xdc')][_0x0d02('0xdd')](function(_0xe17b4a){return db[_0x0d02('0xde')][_0x0d02('0xdf')](_0x57b039,{'transaction':_0xe17b4a});});}}})['then'](function(){if(_0x2dc9aa){_0x5cd080=_0x2dc9aa;return db['MailAccount'][_0x0d02('0x64')]({'where':{'active':!![]},'include':[{'model':db[_0x0d02('0xe0')],'as':_0x0d02('0xe1'),'raw':!![]}]});}})[_0x0d02('0x1f')](function(_0x512cfd){if(_0x512cfd&&_0x512cfd['Smtp']&&_0x294474[_0x0d02('0xe2')]&&_0x294474['forwardOfflineAddress']){var _0x44ed90={'tls':{'rejectUnauthorized':![]}};if(_0x512cfd[_0x0d02('0xe1')][_0x0d02('0xe3')]){_0x44ed90[_0x0d02('0xe3')]=_0x512cfd[_0x0d02('0xe1')][_0x0d02('0xe3')];}else{_0x44ed90[_0x0d02('0xe4')]=_0x512cfd[_0x0d02('0xe1')][_0x0d02('0xe4')];_0x44ed90[_0x0d02('0xe5')]=_0x512cfd['Smtp'][_0x0d02('0xe5')];_0x44ed90[_0x0d02('0xe6')]=_0x512cfd[_0x0d02('0xe1')][_0x0d02('0xe6')];}if(_0x512cfd[_0x0d02('0xe1')][_0x0d02('0xe7')]){_0x44ed90[_0x0d02('0xe8')]={'user':_0x512cfd[_0x0d02('0xe1')][_0x0d02('0x5b')],'pass':_0x512cfd[_0x0d02('0xe1')]['pass']};}return respondWithRpcPromise(_0x0d02('0xe9'),_0x0d02('0xea'),{'account':_0x44ed90,'message':{'from':util[_0x0d02('0xaf')](_0x0d02('0xeb'),_0x512cfd[_0x0d02('0x38')],_0x512cfd[_0x0d02('0xec')]||_0x512cfd[_0x0d02('0xe1')][_0x0d02('0x5b')]),'to':_0x294474[_0x0d02('0xed')],'subject':_0x294474[_0x0d02('0xee')],'html':_0x5cd080[_0x0d02('0x5a')],'attachments':_0x356bb4}},client9003)[_0x0d02('0x1f')](function(){return _0x5cd080;})['catch'](function(_0x5dec39){console['error'](_0x5dec39);});}})[_0x0d02('0x1f')](function(){if(_0x294474&&_0x294474['openNewInteraction']&&_0x294474[_0x0d02('0xef')]){var _0x195bb6=[];if(_0x1b58f0[_0x0d02('0x47')]){_0x195bb6=_0x1b58f0[_0x0d02('0x3c')](function(_0x2876ab){return{'name':_0x2876ab[_0x0d02('0xd6')],'basename':_0x2876ab[_0x0d02('0x71')],'type':_0x2876ab[_0x0d02('0xf0')],'ChatOfflineMessageId':_0x2dc9aa['id']};});}var _0x3eefc4;if(!_[_0x0d02('0x7b')](_0x294474[_0x0d02('0xf1')])){var _0x19a4c0=_[_0x0d02('0x3c')](_0x5d00b9['body'],function(_0x3824db){return _0x3824db;});var _0x399643=_[_0x0d02('0xf2')](_0x19a4c0)[0x0];var _0x2ef4c3=_[_0x0d02('0xf3')](_0x399643,function(_0x1c85c0){return _0x1c85c0;});_0x3eefc4=_0x2ef4c3[0x1][_0x294474[_0x0d02('0xf1')]];}var _0x3e4319={'from':_0x10f3e2[_0x0d02('0xec')],'firstName':_0x10f3e2[_0x0d02('0xa9')],'lastName':_0x10f3e2['lastName'],'mapKey':_0x0d02('0xec'),'message':{'from':_0x10f3e2[_0x0d02('0xec')],'to':_0x294474[_0x0d02('0xd1')][_0x0d02('0xec')],'cc':'','subject':_[_0x0d02('0x7b')](_0x3eefc4)?_0x294474[_0x0d02('0xee')]:_0x3eefc4,'messageId':'','sentAt':new Date(),'attach':_0x195bb6['length'],'attachments':_0x195bb6,'originChannel':_0x0d02('0xf4'),'ChatWebsiteId':_0x294474['id'],'ChatOfflineMessageId':_0x5cd080['id'],'originTo':_0x294474[_0x0d02('0xd1')][_0x0d02('0xec')]},'body':_0x5cd080[_0x0d02('0x5a')]};var _0x44c720={'account':{'id':_0x294474[_0x0d02('0xef')]},'body':_0x3e4319,'log':_0x0d02('0xf5')};return respondWithRpcPromise(_0x0d02('0xf5'),'notifyMail',_0x44c720,client9001)[_0x0d02('0x1f')](function(){return _0x5cd080;})[_0x0d02('0x28')](function(_0x90c989){console['error'](_0x90c989);});}return;})[_0x0d02('0x1f')](function(){if(_0x5cd080){return _0x5cd080;}})[_0x0d02('0x1f')](respondWithResult(_0x385c75,null))[_0x0d02('0x28')](function(_0x513e59){console[_0x0d02('0x24')]('catch',_0x513e59);for(var _0x1a4d4b of _0x1b58f0){var _0x1d315d=path['join'](config[_0x0d02('0x78')],_0x0d02('0xd7'),_0x0d02('0xd8'),'attachments','offline-chat',_0x1a4d4b[_0x0d02('0x71')]);fs_extra[_0x0d02('0xf6')](_0x1d315d)[_0x0d02('0x28')](function(_0x1b3d30){console[_0x0d02('0x24')]('Could\x20not\x20remove\x20attachment\x20file',_0x1d315d,_0x1b3d30);});}});};exports[_0x0d02('0xf7')]=function(_0x4d96e3,_0x4a4a0f,_0x85f4a0){return db[_0x0d02('0xb8')][_0x0d02('0x58')]({'where':{'id':_0x4d96e3[_0x0d02('0x55')]['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0x4a4a0f,null))['then'](function(_0x2a076a){if(_0x2a076a){return _0x2a076a[_0x0d02('0xf7')](_0x4d96e3['body'][_0x0d02('0x6d')],_['omit'](_0x4d96e3[_0x0d02('0x5a')],[_0x0d02('0x6d'),'id'])||{});}})['then'](respondWithResult(_0x4a4a0f,null))[_0x0d02('0x28')](handleError(_0x4a4a0f,null));};exports[_0x0d02('0xf8')]=function(_0x36615a,_0x450cf7,_0x41b1e2){var _0x4caf23={'raw':![],'where':{}};var _0x531983={};var _0x2376b1={'count':0x0,'rows':[]};return db[_0x0d02('0x3d')]['findOne']({'where':{'id':_0x36615a[_0x0d02('0x55')]['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0x450cf7,null))['then'](function(_0x252f50){if(_0x252f50){_0x531983['model']=_[_0x0d02('0x42')](db[_0x0d02('0xb8')][_0x0d02('0x57')]);_0x531983[_0x0d02('0x41')]=_['keys'](_0x36615a[_0x0d02('0x41')]);_0x531983[_0x0d02('0x43')]=_[_0x0d02('0x44')](_0x531983[_0x0d02('0x40')],_0x531983[_0x0d02('0x41')]);_0x4caf23['attributes']=_['intersection'](_0x531983[_0x0d02('0x40')],qs[_0x0d02('0x46')](_0x36615a[_0x0d02('0x41')][_0x0d02('0x46')]));_0x4caf23['attributes']=_0x4caf23[_0x0d02('0x45')][_0x0d02('0x47')]?_0x4caf23[_0x0d02('0x45')]:_0x531983[_0x0d02('0x40')];if(!_0x36615a[_0x0d02('0x41')][_0x0d02('0x48')](_0x0d02('0x49'))){_0x4caf23[_0x0d02('0x2e')]=qs[_0x0d02('0x2e')](_0x36615a[_0x0d02('0x41')][_0x0d02('0x2e')]);_0x4caf23[_0x0d02('0x2d')]=qs[_0x0d02('0x2d')](_0x36615a[_0x0d02('0x41')]['offset']);}_0x4caf23[_0x0d02('0x4a')]=qs['sort'](_0x36615a['query'][_0x0d02('0x4b')]);_0x4caf23[_0x0d02('0x4c')]=qs[_0x0d02('0x43')](_[_0x0d02('0x4d')](_0x36615a[_0x0d02('0x41')],_0x531983[_0x0d02('0x43')]));_0x4caf23['where'][_0x0d02('0x69')]=_0x252f50['id'];if(_0x36615a[_0x0d02('0x41')][_0x0d02('0x4e')]){_0x4caf23[_0x0d02('0x4c')]=_[_0x0d02('0x50')](_0x4caf23[_0x0d02('0x4c')],{'$or':_[_0x0d02('0x3c')](_0x4caf23[_0x0d02('0x45')],function(_0x9949af){var _0x54e144={};_0x54e144[_0x9949af]={'$like':'%'+_0x36615a[_0x0d02('0x41')][_0x0d02('0x4e')]+'%'};return _0x54e144;})});}_0x4caf23=_[_0x0d02('0x50')]({},_0x4caf23,_0x36615a[_0x0d02('0x65')]);return db[_0x0d02('0xb8')][_0x0d02('0x2f')]({'where':_0x4caf23['where']})['then'](function(_0x5aba8c){_0x2376b1[_0x0d02('0x2f')]=_0x5aba8c;if(_0x36615a[_0x0d02('0x41')]['includeAll']){_0x4caf23[_0x0d02('0x52')]=[{'model':db[_0x0d02('0x8b')],'as':'Contact','required':![]},{'model':db[_0x0d02('0xc3')],'as':_0x0d02('0xf9'),'attributes':[_0x0d02('0x38'),_0x0d02('0xfa'),_0x0d02('0xfb')],'required':![]},{'model':db[_0x0d02('0xfc')],'as':'Tags','attributes':['id',_0x0d02('0x38'),_0x0d02('0xfd')],'where':_0x36615a[_0x0d02('0x41')][_0x0d02('0xfe')]?{'id':_0x36615a[_0x0d02('0x41')]['tag']}:undefined,'required':_0x36615a[_0x0d02('0x41')]['tag']?!![]:![]}];}return db['ChatInteraction'][_0x0d02('0x53')](_0x4caf23);})['then'](function(_0x2fb159){_0x2376b1['rows']=_0x2fb159;return _0x2376b1;});}})['then'](respondWithFilteredResult(_0x450cf7,_0x4caf23))[_0x0d02('0x28')](handleError(_0x450cf7,null));};function iftimePromise(_0x2426da,_0x4ab61f){return respondWithRpcPromise(_0x0d02('0xff'),_0x0d02('0x100'),{'command':_0x4ab61f[_0x0d02('0x101')]?util[_0x0d02('0xaf')]('iftime\x20%s,%s',_0x2426da['interval'],_0x4ab61f[_0x0d02('0x101')]):util[_0x0d02('0xaf')](_0x0d02('0x102'),_0x2426da['interval'])},client9002)['then'](function(_0x37199e){var _0x118f75=_0x37199e&&_0x37199e['indexOf']('true')>=0x0?!![]:![];logger[_0x0d02('0x20')](_0x0d02('0x103'),_0x4ab61f['id'],_0x2426da['id'],_0x2426da[_0x0d02('0x104')],_0x118f75?'ONLINE':_0x0d02('0x105'),_0x4ab61f[_0x0d02('0x101')]?_0x4ab61f[_0x0d02('0x101')]:_0x0d02('0x106'));return _0x118f75;})[_0x0d02('0x28')](function(_0x35a4ae){logger['error'](_0x0d02('0x103'),_0x4ab61f['id'],_0x2426da['id'],_0x2426da['interval'],util[_0x0d02('0x107')](_0x35a4ae,{'showHidden':![],'depth':null}),_0x4ab61f[_0x0d02('0x101')]?_0x4ab61f[_0x0d02('0x101')]:_0x0d02('0x106'));return![];});}exports['getSnippet']=function(_0x467877,_0xb53a7c,_0x58c54c){var _0x45db58=0x0;var _0x25ba1e=0x0;var _0x58bd70=![];var _0x310f97;var _0x2d3952;return db[_0x0d02('0x3d')][_0x0d02('0x58')]({'where':{'id':_0x467877[_0x0d02('0x55')]['id']},'include':[{'model':db[_0x0d02('0x108')],'as':_0x0d02('0x108'),'include':[{'model':db['Interval'],'as':_0x0d02('0x109'),'attributes':['id','interval'],'raw':!![]}]}]})['then'](handleEntityNotFound(_0xb53a7c,null))['then'](function(_0x2bf036){if(_0x2bf036){_0x310f97=_0x2bf036;return _0x2bf036[_0x0d02('0x10a')]({'raw':!![]});}})[_0x0d02('0x1f')](function(_0x1b798f){if(_0x310f97){if(_0x1b798f){_0x2d3952=_0x1b798f;}}return require(_0x0d02('0x17'))[_0x0d02('0x10b')]();})[_0x0d02('0x1f')](function(_0x27ce12){if(_0x27ce12){_0x25ba1e=_0x27ce12[_0x0d02('0x10c')];_0x58bd70=_0x27ce12['custom'];}})[_0x0d02('0x1f')](function(){return db[_0x0d02('0xb8')][_0x0d02('0x2f')]({'where':{'closed':![]}});})[_0x0d02('0x1f')](function(_0x4513c1){_0x45db58=_0x4513c1;if(_0x25ba1e&&_0x4513c1>_0x25ba1e){return db['License'][_0x0d02('0x64')]({'where':{'id':0x1}})[_0x0d02('0x1f')](function(_0x4eff2a){if(_0x4eff2a){_0x4eff2a['increment'](_0x0d02('0x10d'));}});}})[_0x0d02('0x1f')](function(){if(_0x310f97[_0x0d02('0x108')]&&_0x310f97[_0x0d02('0x108')][_0x0d02('0x109')]){var _0x1a877e=[];for(var _0x283a8c=0x0;_0x283a8c<_0x310f97[_0x0d02('0x108')][_0x0d02('0x109')][_0x0d02('0x47')];_0x283a8c++){var _0x18d709=_0x310f97[_0x0d02('0x108')][_0x0d02('0x109')][_0x283a8c][_0x0d02('0x35')]({'plain':!![]});_0x1a877e['push'](iftimePromise(_0x18d709,_0x310f97));}return BPromise[_0x0d02('0x10e')](_0x1a877e)['then'](function(_0x4c171a){return _[_0x0d02('0x10f')](_0x4c171a);});}else{return!![];}})[_0x0d02('0x1f')](function(_0x56a135){var _0x47e832=fs['readFileSync'](path[_0x0d02('0x77')](config['root'],'server/files/chat/iframe.ejs'),_0x0d02('0x110'));var _0x5533cd={'remote':_0x310f97[_0x0d02('0x111')],'query':querystring[_0x0d02('0xb5')](_[_0x0d02('0x50')](_0x310f97[_0x0d02('0x35')]({'plain':!![]}),{'customerIp':_0x467877[_0x0d02('0x87')]['x-forwarded-for']||_0x467877[_0x0d02('0x87')]['x-real-ip']||_0x467877[_0x0d02('0x112')][_0x0d02('0x113')]||_0x467877['ip'],'referer':_0x467877['headers']['referer'],'openedInteractions':_0x45db58,'maxInteractions':_0x25ba1e,'virtual':_0x58bd70[_0x0d02('0x10c')],'online':_0x56a135,'custom':_0x58bd70}))['replace'](/'/g,'\x5c\x27')};_0xb53a7c[_0x0d02('0x39')](ejs[_0x0d02('0x114')](Mustache['render'](_0x47e832,_0x5533cd),{'proactiveActions':_0x2d3952,'alignment':_0x310f97[_0x0d02('0x115')],'verticalAlignment':_0x310f97[_0x0d02('0x116')],'div_color':_0x310f97[_0x0d02('0xfd')],'text_color':_0x310f97[_0x0d02('0x117')],'button_color':_0x310f97['color_button'],'background_color':_0x310f97[_0x0d02('0x118')]}));})[_0x0d02('0x28')](handleError(_0xb53a7c,null));};exports[_0x0d02('0x119')]=function(_0x5f3aad,_0x4ac90c,_0x53ab7c){return db['ChatWebsite'][_0x0d02('0x64')]({'where':{'id':_0x5f3aad['params']['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0x4ac90c,null))[_0x0d02('0x1f')](function(_0x297743){if(_0x297743){return db[_0x0d02('0xdc')][_0x0d02('0xdd')](function(_0x42260b){return db[_0x0d02('0x9d')][_0x0d02('0x34')]({'where':{'ChatWebsiteId':_0x5f3aad[_0x0d02('0x55')]['id']},'transaction':_0x42260b})[_0x0d02('0x1f')](function(_0x41d3b3){var _0x4612f3=_[_0x0d02('0x3c')](_0x5f3aad[_0x0d02('0x5a')],function(_0x10ccc1){_0x10ccc1[_0x0d02('0x69')]=_0x5f3aad[_0x0d02('0x55')]['id'];return _0x10ccc1;});return db['ChatApplication'][_0x0d02('0xdf')](_0x4612f3,{'transaction':_0x42260b});});})['then'](function(){return db[_0x0d02('0x9d')][_0x0d02('0x11a')]({'where':{'ChatWebsiteId':_0x5f3aad[_0x0d02('0x55')]['id']},'order':'priority'});});}})[_0x0d02('0x1f')](respondWithResult(_0x4ac90c,null))[_0x0d02('0x28')](handleError(_0x4ac90c,null));};exports[_0x0d02('0x11b')]=function(_0x4f5fe0,_0x259767,_0x37b697){var _0x13c480={};var _0x5dd7fc={};var _0x48432b;var _0x38ee05;return db[_0x0d02('0x3d')][_0x0d02('0x64')]({'where':{'id':_0x4f5fe0['params']['id']}})['then'](handleEntityNotFound(_0x259767,null))[_0x0d02('0x1f')](function(_0x12ab2d){if(_0x12ab2d){_0x48432b=_0x12ab2d;_0x5dd7fc[_0x0d02('0x40')]=_[_0x0d02('0x42')](db[_0x0d02('0x9d')][_0x0d02('0x57')]);_0x5dd7fc[_0x0d02('0x41')]=_[_0x0d02('0x42')](_0x4f5fe0[_0x0d02('0x41')]);_0x5dd7fc[_0x0d02('0x43')]=_[_0x0d02('0x44')](_0x5dd7fc[_0x0d02('0x40')],_0x5dd7fc[_0x0d02('0x41')]);_0x13c480[_0x0d02('0x45')]=_[_0x0d02('0x44')](_0x5dd7fc[_0x0d02('0x40')],qs[_0x0d02('0x46')](_0x4f5fe0[_0x0d02('0x41')]['fields']));_0x13c480['attributes']=_0x13c480[_0x0d02('0x45')][_0x0d02('0x47')]?_0x13c480[_0x0d02('0x45')]:_0x5dd7fc['model'];_0x13c480[_0x0d02('0x4a')]=qs[_0x0d02('0x4b')](_0x4f5fe0[_0x0d02('0x41')][_0x0d02('0x4b')]);_0x13c480['where']=qs[_0x0d02('0x43')](_[_0x0d02('0x4d')](_0x4f5fe0[_0x0d02('0x41')],_0x5dd7fc[_0x0d02('0x43')]));if(_0x4f5fe0['query'][_0x0d02('0x4e')]){_0x13c480[_0x0d02('0x4c')]=_[_0x0d02('0x50')](_0x13c480[_0x0d02('0x4c')],{'$or':_[_0x0d02('0x3c')](_0x13c480[_0x0d02('0x45')],function(_0x5f4fbf){var _0x4c456a={};_0x4c456a[_0x5f4fbf]={'$like':'%'+_0x4f5fe0[_0x0d02('0x41')][_0x0d02('0x4e')]+'%'};return _0x4c456a;})});}_0x13c480=_['merge']({},_0x13c480,_0x4f5fe0[_0x0d02('0x65')]);return _0x48432b[_0x0d02('0x11b')](_0x13c480);}})[_0x0d02('0x1f')](function(_0x49129c){if(_0x49129c){_0x38ee05=_0x49129c['length'];if(!_0x4f5fe0[_0x0d02('0x41')][_0x0d02('0x48')](_0x0d02('0x49'))){_0x13c480[_0x0d02('0x2e')]=qs['limit'](_0x4f5fe0[_0x0d02('0x41')][_0x0d02('0x2e')]);_0x13c480[_0x0d02('0x2d')]=qs[_0x0d02('0x2d')](_0x4f5fe0[_0x0d02('0x41')][_0x0d02('0x2d')]);}return _0x48432b[_0x0d02('0x11b')](_0x13c480);}})[_0x0d02('0x1f')](function(_0x130dae){if(_0x130dae){return _0x130dae?{'count':_0x38ee05,'rows':_0x130dae}:null;}})[_0x0d02('0x1f')](respondWithResult(_0x259767,null))['catch'](handleError(_0x259767,null));};exports['addProactiveActions']=function(_0x212863,_0x18f5fb,_0x3442d9){return db[_0x0d02('0x11c')][_0x0d02('0x58')]({'where':{'id':_0x212863[_0x0d02('0x55')]['id']}})['then'](handleEntityNotFound(_0x18f5fb,null))['then'](function(_0x12ce55){if(_0x12ce55){return _0x12ce55[_0x0d02('0x11d')](_0x212863[_0x0d02('0x5a')][_0x0d02('0x6d')],_[_0x0d02('0x11e')](_0x212863[_0x0d02('0x5a')],[_0x0d02('0x6d'),'id'])||{});}})[_0x0d02('0x1f')](respondWithResult(_0x18f5fb,null))[_0x0d02('0x28')](handleError(_0x18f5fb,null));};exports['getProactiveActions']=function(_0x2faa0b,_0x2d7ef0,_0x1ad508){var _0xc215b8={};var _0x9917b8={};var _0xe8b061;var _0x3627ea;return db[_0x0d02('0x3d')][_0x0d02('0x64')]({'where':{'id':_0x2faa0b['params']['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0x2d7ef0,null))[_0x0d02('0x1f')](function(_0x1df536){if(_0x1df536){_0xe8b061=_0x1df536;_0x9917b8[_0x0d02('0x40')]=_[_0x0d02('0x42')](db[_0x0d02('0x11f')][_0x0d02('0x57')]);_0x9917b8[_0x0d02('0x41')]=_[_0x0d02('0x42')](_0x2faa0b[_0x0d02('0x41')]);_0x9917b8['filters']=_[_0x0d02('0x44')](_0x9917b8['model'],_0x9917b8[_0x0d02('0x41')]);_0xc215b8[_0x0d02('0x45')]=_[_0x0d02('0x44')](_0x9917b8[_0x0d02('0x40')],qs['fields'](_0x2faa0b[_0x0d02('0x41')][_0x0d02('0x46')]));_0xc215b8[_0x0d02('0x45')]=_0xc215b8['attributes'][_0x0d02('0x47')]?_0xc215b8[_0x0d02('0x45')]:_0x9917b8['model'];_0xc215b8[_0x0d02('0x4a')]=qs[_0x0d02('0x4b')](_0x2faa0b[_0x0d02('0x41')][_0x0d02('0x4b')]);_0xc215b8[_0x0d02('0x4c')]=qs[_0x0d02('0x43')](_['pick'](_0x2faa0b[_0x0d02('0x41')],_0x9917b8[_0x0d02('0x43')]));if(_0x2faa0b[_0x0d02('0x41')][_0x0d02('0x4e')]){_0xc215b8[_0x0d02('0x4c')]=_[_0x0d02('0x50')](_0xc215b8[_0x0d02('0x4c')],{'$or':_[_0x0d02('0x3c')](_0xc215b8[_0x0d02('0x45')],function(_0x999e7a){var _0x313827={};_0x313827[_0x999e7a]={'$like':'%'+_0x2faa0b['query']['filter']+'%'};return _0x313827;})});}_0xc215b8=_[_0x0d02('0x50')]({},_0xc215b8,_0x2faa0b[_0x0d02('0x65')]);return _0xe8b061[_0x0d02('0x10a')](_0xc215b8);}})[_0x0d02('0x1f')](function(_0x560e65){if(_0x560e65){_0x3627ea=_0x560e65[_0x0d02('0x47')];if(!_0x2faa0b['query'][_0x0d02('0x48')](_0x0d02('0x49'))){_0xc215b8[_0x0d02('0x2e')]=qs[_0x0d02('0x2e')](_0x2faa0b[_0x0d02('0x41')]['limit']);_0xc215b8[_0x0d02('0x2d')]=qs[_0x0d02('0x2d')](_0x2faa0b['query'][_0x0d02('0x2d')]);}return _0xe8b061[_0x0d02('0x10a')](_0xc215b8);}})[_0x0d02('0x1f')](function(_0x2b86c5){if(_0x2b86c5){return _0x2b86c5?{'count':_0x3627ea,'rows':_0x2b86c5}:null;}})[_0x0d02('0x1f')](respondWithResult(_0x2d7ef0,null))[_0x0d02('0x28')](handleError(_0x2d7ef0,null));};exports[_0x0d02('0x120')]=function(_0x4ce7a7,_0x5b9839,_0x5768f5){var _0x44f9ef=_0x4ce7a7[_0x0d02('0x41')]['online']==='false'?_0x0d02('0x121'):_0x0d02('0x122');return db[_0x0d02('0x3d')][_0x0d02('0x58')]({'attributes':['id',_0x44f9ef],'where':{'id':_0x4ce7a7[_0x0d02('0x55')]['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0x5b9839,null))[_0x0d02('0x1f')](function(_0x14ea53){if(_0x14ea53){var _0x22a1be=_0x14ea53[_0x44f9ef];var _0x251b9a=_0x22a1be&&_0x22a1be[_0x0d02('0x123')]?_0x22a1be[_0x0d02('0x123')]:[];_0x5b9839[_0x0d02('0x39')]({'fromKey':_[_0x0d02('0x7b')](_0x22a1be[_0x0d02('0x124')])?undefined:_0x22a1be[_0x0d02('0x124')],'count':_0x251b9a[_0x0d02('0x47')],'rows':_0x251b9a});}})['catch'](handleError(_0x5b9839,null));};exports[_0x0d02('0x125')]=function(_0x2678ee,_0x4e090e,_0x298859){var _0x4e4732={'raw':![],'where':{}};var _0x2c6f93={};var _0x51d48c={'count':0x0,'rows':[]};return db[_0x0d02('0x3d')]['findOne']({'where':{'id':_0x2678ee[_0x0d02('0x55')]['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0x4e090e,null))[_0x0d02('0x1f')](function(_0x808cd3){if(_0x808cd3){_0x2c6f93[_0x0d02('0x40')]=_[_0x0d02('0x42')](db[_0x0d02('0xd5')][_0x0d02('0x57')]);_0x2c6f93[_0x0d02('0x41')]=_[_0x0d02('0x42')](_0x2678ee[_0x0d02('0x41')]);_0x2c6f93[_0x0d02('0x43')]=_[_0x0d02('0x44')](_0x2c6f93[_0x0d02('0x40')],_0x2c6f93[_0x0d02('0x41')]);_0x4e4732[_0x0d02('0x45')]=_['intersection'](_0x2c6f93[_0x0d02('0x40')],qs[_0x0d02('0x46')](_0x2678ee[_0x0d02('0x41')][_0x0d02('0x46')]));_0x4e4732[_0x0d02('0x45')]=_0x4e4732[_0x0d02('0x45')][_0x0d02('0x47')]?_0x4e4732[_0x0d02('0x45')]:_0x2c6f93[_0x0d02('0x40')];if(!_0x2678ee[_0x0d02('0x41')][_0x0d02('0x48')]('nolimit')){_0x4e4732[_0x0d02('0x2e')]=qs[_0x0d02('0x2e')](_0x2678ee['query'][_0x0d02('0x2e')]);_0x4e4732[_0x0d02('0x2d')]=qs[_0x0d02('0x2d')](_0x2678ee[_0x0d02('0x41')][_0x0d02('0x2d')]);}_0x4e4732[_0x0d02('0x4a')]=qs['sort'](_0x2678ee['query'][_0x0d02('0x4b')]);_0x4e4732['where']=qs[_0x0d02('0x43')](_[_0x0d02('0x4d')](_0x2678ee[_0x0d02('0x41')],_0x2c6f93[_0x0d02('0x43')]));_0x4e4732['where']['ChatWebsiteId']=_0x808cd3['id'];if(_0x2678ee['query'][_0x0d02('0x4e')]){_0x4e4732[_0x0d02('0x4c')]=_[_0x0d02('0x50')](_0x4e4732[_0x0d02('0x4c')],{'$or':_[_0x0d02('0x3c')](_0x4e4732[_0x0d02('0x45')],function(_0x54ba11){var _0x511763={};_0x511763[_0x54ba11]={'$like':'%'+_0x2678ee[_0x0d02('0x41')][_0x0d02('0x4e')]+'%'};return _0x511763;})});}_0x4e4732=_[_0x0d02('0x50')]({},_0x4e4732,_0x2678ee[_0x0d02('0x65')]);return db[_0x0d02('0xd5')]['count']({'where':_0x4e4732['where']})['then'](function(_0x4bb8a5){_0x51d48c[_0x0d02('0x2f')]=_0x4bb8a5;if(_0x2678ee[_0x0d02('0x41')][_0x0d02('0x51')]){_0x4e4732['include']=[{'all':!![]}];}else{_0x4e4732['include']=[{'model':db[_0x0d02('0x8b')],'as':_0x0d02('0x126'),'required':![]},{'model':db[_0x0d02('0xde')],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage'][_0x0d02('0x53')](_0x4e4732);})['then'](function(_0x2a6cb0){_0x51d48c[_0x0d02('0x66')]=_0x2a6cb0;return _0x51d48c;});}})[_0x0d02('0x1f')](respondWithFilteredResult(_0x4e090e,_0x4e4732))['catch'](handleError(_0x4e090e,null));};exports[_0x0d02('0x127')]=function(_0x31d24f,_0xc410b5,_0x5c837f){return db[_0x0d02('0x3d')][_0x0d02('0x58')]({'where':{'id':_0x31d24f[_0x0d02('0x55')]['id']}})['then'](handleEntityNotFound(_0xc410b5,null))[_0x0d02('0x1f')](function(_0x4232c9){if(_0x4232c9){return _0x4232c9[_0x0d02('0x127')](_0x31d24f[_0x0d02('0x5a')][_0x0d02('0x6d')],_[_0x0d02('0x11e')](_0x31d24f[_0x0d02('0x5a')],[_0x0d02('0x6d'),'id'])||{})[_0x0d02('0xbb')](function(_0x4e6c58){for(var _0x417316=0x0;_0x417316<_0x31d24f[_0x0d02('0x5a')][_0x0d02('0x6d')][_0x0d02('0x47')];_0x417316+=0x1){socket['emit'](_0x0d02('0x128'),{'UserId':Number(_0x31d24f['body'][_0x0d02('0x6d')][_0x417316]),'ChatWebsiteId':Number(_0x31d24f[_0x0d02('0x55')]['id'])});}return _0x4e6c58;});}})[_0x0d02('0x1f')](respondWithResult(_0xc410b5,null))[_0x0d02('0x28')](handleError(_0xc410b5,null));};exports[_0x0d02('0x129')]=function(_0x2363d5,_0x550ebf,_0xc6f8c3){return db['ChatWebsite'][_0x0d02('0x58')]({'where':{'id':_0x2363d5[_0x0d02('0x55')]['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0x550ebf,null))[_0x0d02('0x1f')](function(_0x20103a){if(_0x20103a){return _0x20103a[_0x0d02('0x129')](_0x2363d5[_0x0d02('0x41')]['ids'])['then'](function(){if(_[_0x0d02('0x12a')](_0x2363d5[_0x0d02('0x41')][_0x0d02('0x6d')])){for(var _0x2039ca=0x0;_0x2039ca<_0x2363d5[_0x0d02('0x41')][_0x0d02('0x6d')][_0x0d02('0x47')];_0x2039ca+=0x1){socket[_0x0d02('0x12b')](_0x0d02('0x12c'),{'UserId':Number(_0x2363d5['query'][_0x0d02('0x6d')][_0x2039ca]),'ChatWebsiteId':Number(_0x2363d5[_0x0d02('0x55')]['id'])});}}else{socket[_0x0d02('0x12b')](_0x0d02('0x12c'),{'UserId':Number(_0x2363d5['query'][_0x0d02('0x6d')]),'ChatWebsiteId':Number(_0x2363d5[_0x0d02('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x550ebf,null))[_0x0d02('0x28')](handleError(_0x550ebf,null));};exports[_0x0d02('0x12d')]=function(_0x11066f,_0xd76976,_0x82c20){var _0x2ebeec={};var _0x5299f9={};var _0x36f1e3;var _0x59cfc1;return db[_0x0d02('0x3d')]['findOne']({'where':{'id':_0x11066f[_0x0d02('0x55')]['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0xd76976,null))[_0x0d02('0x1f')](function(_0x17c08d){if(_0x17c08d){_0x36f1e3=_0x17c08d;_0x5299f9[_0x0d02('0x40')]=_[_0x0d02('0x42')](db[_0x0d02('0xc3')]['rawAttributes']);_0x5299f9['query']=_[_0x0d02('0x42')](_0x11066f[_0x0d02('0x41')]);_0x5299f9[_0x0d02('0x43')]=_[_0x0d02('0x44')](_0x5299f9['model'],_0x5299f9[_0x0d02('0x41')]);_0x2ebeec[_0x0d02('0x45')]=_[_0x0d02('0x44')](_0x5299f9[_0x0d02('0x40')],qs['fields'](_0x11066f[_0x0d02('0x41')]['fields']));_0x2ebeec[_0x0d02('0x45')]=_0x2ebeec[_0x0d02('0x45')][_0x0d02('0x47')]?_0x2ebeec[_0x0d02('0x45')]:_0x5299f9['model'];_0x2ebeec[_0x0d02('0x4a')]=qs[_0x0d02('0x4b')](_0x11066f[_0x0d02('0x41')][_0x0d02('0x4b')]);_0x2ebeec[_0x0d02('0x4c')]=qs[_0x0d02('0x43')](_['pick'](_0x11066f[_0x0d02('0x41')],_0x5299f9[_0x0d02('0x43')]));if(_0x11066f[_0x0d02('0x41')][_0x0d02('0x4e')]){_0x2ebeec[_0x0d02('0x4c')]=_['merge'](_0x2ebeec[_0x0d02('0x4c')],{'$or':_[_0x0d02('0x3c')](_0x2ebeec[_0x0d02('0x45')],function(_0x5c1900){var _0x41742c={};_0x41742c[_0x5c1900]={'$like':'%'+_0x11066f['query']['filter']+'%'};return _0x41742c;})});}_0x2ebeec=_[_0x0d02('0x50')]({},_0x2ebeec,_0x11066f['options']);return _0x36f1e3['getAgents'](_0x2ebeec);}})[_0x0d02('0x1f')](function(_0x1a1451){if(_0x1a1451){_0x59cfc1=_0x1a1451[_0x0d02('0x47')];if(!_0x11066f['query'][_0x0d02('0x48')]('nolimit')){_0x2ebeec[_0x0d02('0x2e')]=qs['limit'](_0x11066f[_0x0d02('0x41')][_0x0d02('0x2e')]);_0x2ebeec['offset']=qs[_0x0d02('0x2d')](_0x11066f[_0x0d02('0x41')][_0x0d02('0x2d')]);}return _0x36f1e3[_0x0d02('0x12d')](_0x2ebeec);}})[_0x0d02('0x1f')](function(_0x47ed31){if(_0x47ed31){return _0x47ed31?{'count':_0x59cfc1,'rows':_0x47ed31}:null;}})['then'](respondWithResult(_0xd76976,null))[_0x0d02('0x28')](handleError(_0xd76976,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 85a929c..8dcaf14 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 _0xaefc=['events','../../mysqldb','ChatWebsite','save','update','emit','hasOwnProperty','exports'];(function(_0x40bc9c,_0x3f50d7){var _0x3e78c9=function(_0x1372c7){while(--_0x1372c7){_0x40bc9c['push'](_0x40bc9c['shift']());}};_0x3e78c9(++_0x3f50d7);}(_0xaefc,0xc8));var _0xcaef=function(_0x332d7b,_0x12ac04){_0x332d7b=_0x332d7b-0x0;var _0x3fc593=_0xaefc[_0x332d7b];return _0x3fc593;};'use strict';var EventEmitter=require(_0xcaef('0x0'));var ChatWebsite=require(_0xcaef('0x1'))['db'][_0xcaef('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcaef('0x3'),'afterUpdate':_0xcaef('0x4'),'afterDestroy':'remove'};function emitEvent(_0x575523){return function(_0x37a134,_0x46a35e,_0x5f160f){ChatWebsiteEvents['emit'](_0x575523+':'+_0x37a134['id'],_0x37a134);ChatWebsiteEvents[_0xcaef('0x5')](_0x575523,_0x37a134);_0x5f160f(null);};}for(var e in events){if(events[_0xcaef('0x6')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xcaef('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xe8f7=['update','remove','emit','hook','exports','events','ChatWebsite','setMaxListeners','save'];(function(_0x2b8ff7,_0xe6be23){var _0x3e4d44=function(_0x334256){while(--_0x334256){_0x2b8ff7['push'](_0x2b8ff7['shift']());}};_0x3e4d44(++_0xe6be23);}(_0xe8f7,0x137));var _0x7e8f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe8f7[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0x7e8f('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x7e8f('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x7e8f('0x2')](0x0);var events={'afterCreate':_0x7e8f('0x3'),'afterUpdate':_0x7e8f('0x4'),'afterDestroy':_0x7e8f('0x5')};function emitEvent(_0xa9b6b5){return function(_0x4249af,_0x47c258,_0x4dcc25){ChatWebsiteEvents[_0x7e8f('0x6')](_0xa9b6b5+':'+_0x4249af['id'],_0x4249af);ChatWebsiteEvents[_0x7e8f('0x6')](_0xa9b6b5,_0x4249af);_0x4dcc25(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x7e8f('0x7')](e,emitEvent(event));}}module[_0x7e8f('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 af66c46..75587e0 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 _0xd676=['path','rimraf','../../config/environment','./chatWebsite.attributes','exports','ChatWebsite','chat_websites','lodash','util','../../config/logger','api'];(function(_0x13a08a,_0x52da1c){var _0x152014=function(_0x18d227){while(--_0x18d227){_0x13a08a['push'](_0x13a08a['shift']());}};_0x152014(++_0x52da1c);}(_0xd676,0x151));var _0x6d67=function(_0x585234,_0x3ae470){_0x585234=_0x585234-0x0;var _0x28b8a7=_0xd676[_0x585234];return _0x28b8a7;};'use strict';var _=require(_0x6d67('0x0'));var util=require(_0x6d67('0x1'));var logger=require(_0x6d67('0x2'))(_0x6d67('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6d67('0x4'));var rimraf=require(_0x6d67('0x5'));var config=require(_0x6d67('0x6'));var attributes=require(_0x6d67('0x7'));module[_0x6d67('0x8')]=function(_0x1b1861,_0x12ae1d){return _0x1b1861['define'](_0x6d67('0x9'),attributes,{'tableName':_0x6d67('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x298d=['path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','../../config/logger','api','bluebird','request-promise'];(function(_0x9ef580,_0xebf6ec){var _0xd72525=function(_0x4b9267){while(--_0x4b9267){_0x9ef580['push'](_0x9ef580['shift']());}};_0xd72525(++_0xebf6ec);}(_0x298d,0x134));var _0xd298=function(_0x23f5cc,_0x2171fb){_0x23f5cc=_0x23f5cc-0x0;var _0x5a7c76=_0x298d[_0x23f5cc];return _0x5a7c76;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd298('0x0'))(_0xd298('0x1'));var moment=require('moment');var BPromise=require(_0xd298('0x2'));var rp=require(_0xd298('0x3'));var fs=require('fs');var path=require(_0xd298('0x4'));var rimraf=require(_0xd298('0x5'));var config=require(_0xd298('0x6'));var attributes=require(_0xd298('0x7'));module[_0xd298('0x8')]=function(_0x2ab842,_0x3143ae){return _0x2ab842[_0xd298('0x9')](_0xd298('0xa'),attributes,{'tableName':_0xd298('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 77f701e..d9ba8db 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 _0x6b5d=['defaults','localhost','socket.io-emitter','register','request','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','ChatWebsite,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x6b5d,0x116));var _0xd6b5=function(_0x19b98c,_0x4cc35d){_0x19b98c=_0x19b98c-0x0;var _0x361c7e=_0x6b5d[_0x19b98c];return _0x361c7e;};'use strict';var _=require(_0xd6b5('0x0'));var util=require(_0xd6b5('0x1'));var moment=require('moment');var BPromise=require(_0xd6b5('0x2'));var rs=require(_0xd6b5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd6b5('0x4'));var logger=require('../../config/logger')(_0xd6b5('0x5'));var config=require(_0xd6b5('0x6'));var jayson=require(_0xd6b5('0x7'));var client=jayson['client'][_0xd6b5('0x8')]({'port':0x232a});config[_0xd6b5('0x9')]=_[_0xd6b5('0xa')](config['redis'],{'host':_0xd6b5('0xb'),'port':0x18eb});var socket=require(_0xd6b5('0xc'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0xd6b5('0xd')](socket);function respondWithRpcPromise(_0x582f63,_0x25245d,_0x4c280e){return new BPromise(function(_0x2e8583,_0x77d9f){return client[_0xd6b5('0xe')](_0x582f63,_0x4c280e)['then'](function(_0x305864){logger[_0xd6b5('0xf')]('ChatWebsite,\x20%s,\x20%s',_0x25245d,_0xd6b5('0x10'));logger[_0xd6b5('0x11')](_0xd6b5('0x12'),_0x25245d,_0xd6b5('0x10'),JSON[_0xd6b5('0x13')](_0x305864));if(_0x305864['error']){if(_0x305864['error']['code']===0x1f4){logger[_0xd6b5('0x14')](_0xd6b5('0x15'),_0x25245d,_0x305864['error'][_0xd6b5('0x16')]);return _0x77d9f(_0x305864[_0xd6b5('0x14')][_0xd6b5('0x16')]);}logger['error'](_0xd6b5('0x15'),_0x25245d,_0x305864['error'][_0xd6b5('0x16')]);return _0x2e8583(_0x305864['error']['message']);}else{logger['info'](_0xd6b5('0x15'),_0x25245d,_0xd6b5('0x10'));_0x2e8583(_0x305864['result'][_0xd6b5('0x16')]);}})[_0xd6b5('0x17')](function(_0x1cbfc8){logger[_0xd6b5('0x14')](_0xd6b5('0x15'),_0x25245d,_0x1cbfc8);_0x77d9f(_0x1cbfc8);});});}
\ No newline at end of file
+var _0xbbd2=['request\x20sent','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x40ebff,_0x1dd15e){var _0x40122a=function(_0xae6174){while(--_0xae6174){_0x40ebff['push'](_0x40ebff['shift']());}};_0x40122a(++_0x1dd15e);}(_0xbbd2,0x1e9));var _0x2bbd=function(_0x504df1,_0x289598){_0x504df1=_0x504df1-0x0;var _0x1063b5=_0xbbd2[_0x504df1];return _0x1063b5;};'use strict';var _=require(_0x2bbd('0x0'));var util=require(_0x2bbd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2bbd('0x2'));var fs=require('fs');var Redis=require(_0x2bbd('0x3'));var db=require(_0x2bbd('0x4'))['db'];var utils=require(_0x2bbd('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x2bbd('0x6'));var jayson=require(_0x2bbd('0x7'));var client=jayson[_0x2bbd('0x8')][_0x2bbd('0x9')]({'port':0x232a});config[_0x2bbd('0xa')]=_['defaults'](config[_0x2bbd('0xa')],{'host':_0x2bbd('0xb'),'port':0x18eb});var socket=require(_0x2bbd('0xc'))(new Redis(config[_0x2bbd('0xa')]));require(_0x2bbd('0xd'))['register'](socket);function respondWithRpcPromise(_0x5ac1d4,_0x5db9ac,_0x2ab0d0){return new BPromise(function(_0x3b2b4b,_0x1231e4){return client[_0x2bbd('0xe')](_0x5ac1d4,_0x2ab0d0)[_0x2bbd('0xf')](function(_0x49bd9c){logger[_0x2bbd('0x10')](_0x2bbd('0x11'),_0x5db9ac,'request\x20sent');logger[_0x2bbd('0x12')](_0x2bbd('0x13'),_0x5db9ac,'request\x20sent',JSON[_0x2bbd('0x14')](_0x49bd9c));if(_0x49bd9c[_0x2bbd('0x15')]){if(_0x49bd9c[_0x2bbd('0x15')][_0x2bbd('0x16')]===0x1f4){logger[_0x2bbd('0x15')](_0x2bbd('0x11'),_0x5db9ac,_0x49bd9c[_0x2bbd('0x15')][_0x2bbd('0x17')]);return _0x1231e4(_0x49bd9c[_0x2bbd('0x15')]['message']);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x5db9ac,_0x49bd9c[_0x2bbd('0x15')][_0x2bbd('0x17')]);return _0x3b2b4b(_0x49bd9c['error'][_0x2bbd('0x17')]);}else{logger[_0x2bbd('0x10')](_0x2bbd('0x11'),_0x5db9ac,_0x2bbd('0x18'));_0x3b2b4b(_0x49bd9c[_0x2bbd('0x19')][_0x2bbd('0x17')]);}})[_0x2bbd('0x1a')](function(_0x3e02d4){logger['error'](_0x2bbd('0x11'),_0x5db9ac,_0x3e02d4);_0x1231e4(_0x3e02d4);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index bbd5d8d..44f7974 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 _0x1eb5=['./chatWebsite.events','save','remove','update','emit','removeListener','register','length','chatWebsite:'];(function(_0x3def3c,_0x1d66d2){var _0x9cc736=function(_0x304f9b){while(--_0x304f9b){_0x3def3c['push'](_0x3def3c['shift']());}};_0x9cc736(++_0x1d66d2);}(_0x1eb5,0xea));var _0x51eb=function(_0x3fe227,_0x52d34f){_0x3fe227=_0x3fe227-0x0;var _0x34e8dc=_0x1eb5[_0x3fe227];return _0x34e8dc;};'use strict';var ChatWebsiteEvents=require(_0x51eb('0x0'));var events=[_0x51eb('0x1'),_0x51eb('0x2'),_0x51eb('0x3')];function createListener(_0x3815ed,_0x3c0af9){return function(_0x1aa631){_0x3c0af9[_0x51eb('0x4')](_0x3815ed,_0x1aa631);};}function removeListener(_0xf077a8,_0x4d6d2f){return function(){ChatWebsiteEvents[_0x51eb('0x5')](_0xf077a8,_0x4d6d2f);};}exports[_0x51eb('0x6')]=function(_0x5ef655){for(var _0x118991=0x0,_0x3db9d6=events[_0x51eb('0x7')];_0x118991<_0x3db9d6;_0x118991++){var _0x36a109=events[_0x118991];var _0x4c6d06=createListener(_0x51eb('0x8')+_0x36a109,_0x5ef655);ChatWebsiteEvents['on'](_0x36a109,_0x4c6d06);}};
\ No newline at end of file
+var _0xe3af=['./chatWebsite.events','remove','update','removeListener','register','length'];(function(_0x21134e,_0x148b0e){var _0x791b59=function(_0x195ef3){while(--_0x195ef3){_0x21134e['push'](_0x21134e['shift']());}};_0x791b59(++_0x148b0e);}(_0xe3af,0x19e));var _0xfe3a=function(_0xd2cd94,_0x3bf735){_0xd2cd94=_0xd2cd94-0x0;var _0x844eaa=_0xe3af[_0xd2cd94];return _0x844eaa;};'use strict';var ChatWebsiteEvents=require(_0xfe3a('0x0'));var events=['save',_0xfe3a('0x1'),_0xfe3a('0x2')];function createListener(_0x348cc4,_0xfee7a9){return function(_0x237fe0){_0xfee7a9['emit'](_0x348cc4,_0x237fe0);};}function removeListener(_0x24633d,_0x3de65b){return function(){ChatWebsiteEvents[_0xfe3a('0x3')](_0x24633d,_0x3de65b);};}exports[_0xfe3a('0x4')]=function(_0x556619){for(var _0x586c74=0x0,_0x3e388e=events[_0xfe3a('0x5')];_0x586c74<_0x3e388e;_0x586c74++){var _0x2bf7be=events[_0x586c74];var _0x17cf5e=createListener('chatWebsite:'+_0x2bf7be,_0x556619);ChatWebsiteEvents['on'](_0x2bf7be,_0x17cf5e);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 4a7e2cb..f894a98 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 _0x6bac=['post','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','server/files/images/avatars/','addAvatar','/:id/customer_avatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','/:id/offline','any','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeAnswers','/:id/users','removeAgents','multer','util','connect-timeout','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getFields','getAgents'];(function(_0x50ee83,_0x106751){var _0x3099ea=function(_0x1d38a4){while(--_0x1d38a4){_0x50ee83['push'](_0x50ee83['shift']());}};_0x3099ea(++_0x106751);}(_0x6bac,0xf2));var _0xc6ba=function(_0x1aaed2,_0x559e12){_0x1aaed2=_0x1aaed2-0x0;var _0x346822=_0x6bac[_0x1aaed2];return _0x346822;};'use strict';var multer=require(_0xc6ba('0x0'));var util=require(_0xc6ba('0x1'));var path=require('path');var timeout=require(_0xc6ba('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc6ba('0x3'));var config=require(_0xc6ba('0x4'));var controller=require('./chatWebsite.controller');router[_0xc6ba('0x5')]('/',auth['isAuthenticated'](),controller[_0xc6ba('0x6')]);router['get'](_0xc6ba('0x7'),auth[_0xc6ba('0x8')](),controller[_0xc6ba('0x9')]);router[_0xc6ba('0x5')](_0xc6ba('0xa'),auth[_0xc6ba('0x8')](),controller[_0xc6ba('0xb')]);router[_0xc6ba('0x5')](_0xc6ba('0xc'),auth[_0xc6ba('0x8')](),controller[_0xc6ba('0xd')]);router[_0xc6ba('0x5')](_0xc6ba('0xe'),auth['isAuthenticated'](),controller[_0xc6ba('0xf')]);router[_0xc6ba('0x5')](_0xc6ba('0x10'),controller[_0xc6ba('0x11')]);router[_0xc6ba('0x5')](_0xc6ba('0x12'),controller[_0xc6ba('0x13')]);router[_0xc6ba('0x5')]('/:id/customer_avatar',controller[_0xc6ba('0x14')]);router[_0xc6ba('0x5')]('/:id/system_avatar',controller[_0xc6ba('0x15')]);router['get'](_0xc6ba('0x16'),auth[_0xc6ba('0x8')](),controller[_0xc6ba('0x17')]);router[_0xc6ba('0x5')]('/:id/snippet',controller[_0xc6ba('0x18')]);router[_0xc6ba('0x5')](_0xc6ba('0x19'),auth[_0xc6ba('0x8')](),controller[_0xc6ba('0x1a')]);router[_0xc6ba('0x5')](_0xc6ba('0x1b'),auth[_0xc6ba('0x8')](),controller['getProactiveActions']);router[_0xc6ba('0x5')]('/:id/fields',controller[_0xc6ba('0x1c')]);router[_0xc6ba('0x5')]('/:id/offline_messages',auth[_0xc6ba('0x8')](),controller['getOfflineMessages']);router[_0xc6ba('0x5')]('/:id/users',auth[_0xc6ba('0x8')](),controller[_0xc6ba('0x1d')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xc6ba('0xc'),auth[_0xc6ba('0x8')](),controller['addDisposition']);router[_0xc6ba('0x1e')](_0xc6ba('0xe'),auth[_0xc6ba('0x8')](),controller[_0xc6ba('0x1f')]);var upload=multer({'storage':multer[_0xc6ba('0x20')]({'destination':function(_0x429e50,_0x179f5e,_0xf2001d){_0xf2001d(null,path[_0xc6ba('0x21')](config[_0xc6ba('0x22')],_0xc6ba('0x23')));},'filename':function(_0x9226c2,_0x13b47b,_0x546082){_0x546082(null,util[_0xc6ba('0x24')](_0xc6ba('0x25'),Date[_0xc6ba('0x26')](),_0x13b47b[_0xc6ba('0x27')]));}})});router[_0xc6ba('0x1e')](_0xc6ba('0x10'),upload[_0xc6ba('0x28')](_0xc6ba('0x29')),controller['addLogo']);var upload=multer({'storage':multer[_0xc6ba('0x20')]({'destination':function(_0x420410,_0x568fd4,_0x30a9c2){_0x30a9c2(null,path[_0xc6ba('0x21')](config[_0xc6ba('0x22')],_0xc6ba('0x2a')));},'filename':function(_0xe83e55,_0x2b24ce,_0x2913b5){_0x2913b5(null,util[_0xc6ba('0x24')]('%s-%s',Date[_0xc6ba('0x26')](),_0x2b24ce[_0xc6ba('0x27')]));}})});router['post'](_0xc6ba('0x12'),upload[_0xc6ba('0x28')](_0xc6ba('0x29')),controller[_0xc6ba('0x2b')]);var upload=multer({'storage':multer[_0xc6ba('0x20')]({'destination':function(_0x23195c,_0x2cdb14,_0x580e80){_0x580e80(null,path[_0xc6ba('0x21')](config['root'],_0xc6ba('0x2a')));},'filename':function(_0xcf3342,_0x463a16,_0x2deff4){_0x2deff4(null,util[_0xc6ba('0x24')](_0xc6ba('0x25'),Date[_0xc6ba('0x26')](),_0x463a16['originalname']));}})});router['post'](_0xc6ba('0x2c'),upload[_0xc6ba('0x28')](_0xc6ba('0x29')),controller[_0xc6ba('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4d4e66,_0x2be187,_0x1a0d3d){_0x1a0d3d(null,path['join'](config[_0xc6ba('0x22')],_0xc6ba('0x2a')));},'filename':function(_0x2ea2da,_0x450696,_0xebfc5){_0xebfc5(null,util[_0xc6ba('0x24')](_0xc6ba('0x25'),Date[_0xc6ba('0x26')](),_0x450696[_0xc6ba('0x27')]));}})});router['post'](_0xc6ba('0x2e'),upload['single'](_0xc6ba('0x29')),controller[_0xc6ba('0x2f')]);router[_0xc6ba('0x1e')](_0xc6ba('0x30'),controller[_0xc6ba('0x31')]);const offlineUploadMulter=multer({'storage':multer[_0xc6ba('0x20')]({'destination':function(_0x3bc5f3,_0x32575f,_0x5c5046){const _0x28bde7=path['join'](config[_0xc6ba('0x22')],_0xc6ba('0x32'),_0xc6ba('0x33'),_0xc6ba('0x34'));fs_extra[_0xc6ba('0x35')](_0x28bde7,function(){_0x5c5046(null,_0x28bde7);});},'filename':function(_0x4c36b1,_0x2cd4b9,_0x3792a9){const _0xf33d66=_0x2cd4b9[_0xc6ba('0x27')][_0xc6ba('0x36')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3a91ea=path['extname'](_0xf33d66);const _0x51a865=Date[_0xc6ba('0x26')]()+'-'+_0xf33d66[_0xc6ba('0x36')](_0x3a91ea,'')+_0x3a91ea;_0x3792a9(null,_0x51a865);}})});router['post'](_0xc6ba('0x37'),offlineUploadMulter[_0xc6ba('0x38')](),controller['offline']);router[_0xc6ba('0x1e')](_0xc6ba('0x16'),auth[_0xc6ba('0x8')](),controller[_0xc6ba('0x39')]);router[_0xc6ba('0x1e')](_0xc6ba('0x19'),auth[_0xc6ba('0x8')](),controller[_0xc6ba('0x3a')]);router[_0xc6ba('0x1e')](_0xc6ba('0x1b'),auth[_0xc6ba('0x8')](),controller[_0xc6ba('0x3b')]);router[_0xc6ba('0x1e')]('/:id/users',auth[_0xc6ba('0x8')](),controller[_0xc6ba('0x3c')]);router[_0xc6ba('0x3d')](_0xc6ba('0xa'),auth['isAuthenticated'](),controller[_0xc6ba('0x3e')]);router[_0xc6ba('0x3f')](_0xc6ba('0xa'),auth['isAuthenticated'](),controller[_0xc6ba('0x40')]);router['delete'](_0xc6ba('0xc'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0xc6ba('0x3f')]('/:id/canned_answers',auth[_0xc6ba('0x8')](),controller[_0xc6ba('0x41')]);router['delete'](_0xc6ba('0x42'),auth[_0xc6ba('0x8')](),controller[_0xc6ba('0x43')]);module['exports']=router;
\ No newline at end of file
+var _0xf821=['replace','extname','/:id/offline','offline','addInteraction','addApplications','addProactiveActions','put','/:id','delete','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','isAuthenticated','describe','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addDisposition','addAnswer','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','diskStorage','server/files/images/avatars/','/:id/notify','notify','server/files','ensureDir'];(function(_0x3a93fc,_0x18d256){var _0x67898f=function(_0x99946b){while(--_0x99946b){_0x3a93fc['push'](_0x3a93fc['shift']());}};_0x67898f(++_0x18d256);}(_0xf821,0xd0));var _0x1f82=function(_0x20a573,_0x3328b4){_0x20a573=_0x20a573-0x0;var _0x399adf=_0xf821[_0x20a573];return _0x399adf;};'use strict';var multer=require(_0x1f82('0x0'));var util=require('util');var path=require(_0x1f82('0x1'));var timeout=require(_0x1f82('0x2'));var express=require(_0x1f82('0x3'));var router=express[_0x1f82('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1f82('0x5'));var interaction=require(_0x1f82('0x6'));var config=require(_0x1f82('0x7'));var controller=require(_0x1f82('0x8'));router[_0x1f82('0x9')]('/',auth['isAuthenticated'](),controller[_0x1f82('0xa')]);router['get']('/describe',auth[_0x1f82('0xb')](),controller[_0x1f82('0xc')]);router[_0x1f82('0x9')]('/:id',auth[_0x1f82('0xb')](),controller['show']);router[_0x1f82('0x9')](_0x1f82('0xd'),auth[_0x1f82('0xb')](),controller[_0x1f82('0xe')]);router[_0x1f82('0x9')](_0x1f82('0xf'),auth[_0x1f82('0xb')](),controller['getAnswers']);router[_0x1f82('0x9')](_0x1f82('0x10'),controller['getLogo']);router[_0x1f82('0x9')](_0x1f82('0x11'),controller[_0x1f82('0x12')]);router[_0x1f82('0x9')](_0x1f82('0x13'),controller['getCustomerAvatar']);router[_0x1f82('0x9')](_0x1f82('0x14'),controller[_0x1f82('0x15')]);router[_0x1f82('0x9')](_0x1f82('0x16'),auth['isAuthenticated'](),controller[_0x1f82('0x17')]);router[_0x1f82('0x9')](_0x1f82('0x18'),controller[_0x1f82('0x19')]);router['get']('/:id/applications',auth['isAuthenticated'](),controller[_0x1f82('0x1a')]);router[_0x1f82('0x9')](_0x1f82('0x1b'),auth[_0x1f82('0xb')](),controller[_0x1f82('0x1c')]);router[_0x1f82('0x9')]('/:id/fields',controller['getFields']);router['get'](_0x1f82('0x1d'),auth[_0x1f82('0xb')](),controller[_0x1f82('0x1e')]);router['get'](_0x1f82('0x1f'),auth[_0x1f82('0xb')](),controller[_0x1f82('0x20')]);router[_0x1f82('0x21')]('/',auth[_0x1f82('0xb')](),controller['create']);router[_0x1f82('0x21')](_0x1f82('0xd'),auth[_0x1f82('0xb')](),controller[_0x1f82('0x22')]);router[_0x1f82('0x21')]('/:id/canned_answers',auth[_0x1f82('0xb')](),controller[_0x1f82('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x42bdfc,_0x16ec12,_0x47f89e){_0x47f89e(null,path[_0x1f82('0x24')](config[_0x1f82('0x25')],_0x1f82('0x26')));},'filename':function(_0x120cf1,_0x3e2fc6,_0x31f292){_0x31f292(null,util[_0x1f82('0x27')](_0x1f82('0x28'),Date[_0x1f82('0x29')](),_0x3e2fc6[_0x1f82('0x2a')]));}})});router['post']('/:id/logo',upload[_0x1f82('0x2b')](_0x1f82('0x2c')),controller[_0x1f82('0x2d')]);var upload=multer({'storage':multer[_0x1f82('0x2e')]({'destination':function(_0x50a730,_0x31cf3a,_0x52c943){_0x52c943(null,path[_0x1f82('0x24')](config[_0x1f82('0x25')],_0x1f82('0x2f')));},'filename':function(_0x254e70,_0x5b9554,_0x45e20d){_0x45e20d(null,util[_0x1f82('0x27')]('%s-%s',Date[_0x1f82('0x29')](),_0x5b9554[_0x1f82('0x2a')]));}})});router[_0x1f82('0x21')](_0x1f82('0x11'),upload['single'](_0x1f82('0x2c')),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x152baf,_0xf7d6b3,_0x1bf0db){_0x1bf0db(null,path['join'](config[_0x1f82('0x25')],_0x1f82('0x2f')));},'filename':function(_0x4b8c61,_0x4a4c54,_0x54e6e0){_0x54e6e0(null,util[_0x1f82('0x27')](_0x1f82('0x28'),Date[_0x1f82('0x29')](),_0x4a4c54['originalname']));}})});router[_0x1f82('0x21')]('/:id/customer_avatar',upload[_0x1f82('0x2b')]('file'),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4b3876,_0x46e4d5,_0x3ff8ca){_0x3ff8ca(null,path['join'](config['root'],_0x1f82('0x2f')));},'filename':function(_0x10d4eb,_0x5b40d4,_0x19e9ed){_0x19e9ed(null,util['format'](_0x1f82('0x28'),Date[_0x1f82('0x29')](),_0x5b40d4[_0x1f82('0x2a')]));}})});router['post'](_0x1f82('0x14'),upload[_0x1f82('0x2b')](_0x1f82('0x2c')),controller['addSystemAvatar']);router[_0x1f82('0x21')](_0x1f82('0x30'),controller[_0x1f82('0x31')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x1c1e00,_0x48661e,_0x520cfc){const _0x132eb7=path[_0x1f82('0x24')](config[_0x1f82('0x25')],_0x1f82('0x32'),'attachments','offline-chat');fs_extra[_0x1f82('0x33')](_0x132eb7,function(){_0x520cfc(null,_0x132eb7);});},'filename':function(_0x3310ff,_0x157497,_0x4c07e0){const _0x479bf9=_0x157497[_0x1f82('0x2a')][_0x1f82('0x34')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x39bac3=path[_0x1f82('0x35')](_0x479bf9);const _0x23002e=Date[_0x1f82('0x29')]()+'-'+_0x479bf9[_0x1f82('0x34')](_0x39bac3,'')+_0x39bac3;_0x4c07e0(null,_0x23002e);}})});router[_0x1f82('0x21')](_0x1f82('0x36'),offlineUploadMulter['any'](),controller[_0x1f82('0x37')]);router['post'](_0x1f82('0x16'),auth[_0x1f82('0xb')](),controller[_0x1f82('0x38')]);router['post']('/:id/applications',auth[_0x1f82('0xb')](),controller[_0x1f82('0x39')]);router[_0x1f82('0x21')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x1f82('0x3a')]);router[_0x1f82('0x21')](_0x1f82('0x1f'),auth['isAuthenticated'](),controller['addAgents']);router[_0x1f82('0x3b')](_0x1f82('0x3c'),auth[_0x1f82('0xb')](),controller['update']);router[_0x1f82('0x3d')](_0x1f82('0x3c'),auth[_0x1f82('0xb')](),controller['destroy']);router['delete']('/:id/dispositions',auth[_0x1f82('0xb')](),controller['removeDispositions']);router[_0x1f82('0x3d')](_0x1f82('0xf'),auth[_0x1f82('0xb')](),controller[_0x1f82('0x3e')]);router['delete']('/:id/users',auth[_0x1f82('0xb')](),controller[_0x1f82('0x3f')]);module[_0x1f82('0x40')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 742774f..2b6d5c5 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 _0x5db2=['STRING','AmazonAWS','Google','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5db2,0xf3));var _0x25db=function(_0x3adc99,_0x20689e){_0x3adc99=_0x3adc99-0x0;var _0x26fa68=_0x5db2[_0x3adc99];return _0x26fa68;};'use strict';var Sequelize=require(_0x25db('0x0'));module[_0x25db('0x1')]={'name':{'type':Sequelize[_0x25db('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x25db('0x3'),_0x25db('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x25db('0x2')]},'data2':{'type':Sequelize[_0x25db('0x2')]}};
\ No newline at end of file
+var _0x7c1f=['exports','STRING','ENUM','AmazonAWS','sequelize'];(function(_0x373e2d,_0x5053c6){var _0x5dc7be=function(_0x3ccfd8){while(--_0x3ccfd8){_0x373e2d['push'](_0x373e2d['shift']());}};_0x5dc7be(++_0x5053c6);}(_0x7c1f,0x194));var _0xf7c1=function(_0x5e69be,_0x298d40){_0x5e69be=_0x5e69be-0x0;var _0xf6bc5e=_0x7c1f[_0x5e69be];return _0xf6bc5e;};'use strict';var Sequelize=require(_0xf7c1('0x0'));module[_0xf7c1('0x1')]={'name':{'type':Sequelize[_0xf7c1('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xf7c1('0x3')](_0xf7c1('0x4'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xf7c1('0x2')]},'data2':{'type':Sequelize[_0xf7c1('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index f144f8a..8bcf00d 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 _0x2032=['body','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','CloudProvider','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','rows','show','params','keys','rawAttributes','includeAll','find','catch'];(function(_0x2ba5db,_0x4d9a5f){var _0x4cd936=function(_0x33f7e4){while(--_0x33f7e4){_0x2ba5db['push'](_0x2ba5db['shift']());}};_0x4cd936(++_0x4d9a5f);}(_0x2032,0xd9));var _0x2203=function(_0x30e4e8,_0x27dfdb){_0x30e4e8=_0x30e4e8-0x0;var _0x15b632=_0x2032[_0x30e4e8];return _0x15b632;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'all':!![]}];}return db[_0x2203('0x2c')]['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x446209){_0x34b8ba[_0x2203('0x3f')]=_0x446209;return _0x34b8ba;})['then'](respondWithFilteredResult(_0x1df508,_0x9c53f))['catch'](handleError(_0x1df508,null));};exports[_0x2203('0x40')]=function(_0x3739f6,_0x368444){var _0x1e09f3={'raw':!![],'where':{'id':_0x3739f6[_0x2203('0x41')]['id']}},_0x372709={};_0x372709['model']=_[_0x2203('0x42')](db[_0x2203('0x2c')][_0x2203('0x43')]);_0x372709[_0x2203('0x30')]=_[_0x2203('0x42')](_0x3739f6[_0x2203('0x30')]);_0x372709[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],_0x372709[_0x2203('0x30')]);_0x1e09f3['attributes']=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],qs[_0x2203('0x34')](_0x3739f6[_0x2203('0x30')]['fields']));_0x1e09f3['attributes']=_0x1e09f3[_0x2203('0x32')]['length']?_0x1e09f3[_0x2203('0x32')]:_0x372709[_0x2203('0x31')];if(_0x3739f6[_0x2203('0x30')][_0x2203('0x44')]){_0x1e09f3['include']=[{'all':!![]}];}_0x1e09f3=_[_0x2203('0x3c')]({},_0x1e09f3,_0x3739f6[_0x2203('0x3e')]);return db['CloudProvider'][_0x2203('0x45')](_0x1e09f3)[_0x2203('0x23')](handleEntityNotFound(_0x368444,null))[_0x2203('0x23')](respondWithResult(_0x368444,null))[_0x2203('0x46')](handleError(_0x368444,null));};exports['create']=function(_0x4c1a29,_0x21b8ab){return db['CloudProvider']['create'](_0x4c1a29[_0x2203('0x47')],{})[_0x2203('0x23')](respondWithResult(_0x21b8ab,0xc9))[_0x2203('0x46')](handleError(_0x21b8ab,null));};exports['update']=function(_0x4c1496,_0x131aec){if(_0x4c1496[_0x2203('0x47')]['id']){delete _0x4c1496[_0x2203('0x47')]['id'];}return db[_0x2203('0x2c')][_0x2203('0x45')]({'where':{'id':_0x4c1496[_0x2203('0x41')]['id']}})['then'](handleEntityNotFound(_0x131aec,null))[_0x2203('0x23')](saveUpdates(_0x4c1496['body'],null))[_0x2203('0x23')](respondWithResult(_0x131aec,null))[_0x2203('0x46')](handleError(_0x131aec,null));};exports[_0x2203('0x24')]=function(_0x1e49dd,_0x58b9bb){return db['CloudProvider'][_0x2203('0x45')]({'where':{'id':_0x1e49dd[_0x2203('0x41')]['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x58b9bb,null))[_0x2203('0x23')](removeEntity(_0x58b9bb,null))['catch'](handleError(_0x58b9bb,null));};
\ No newline at end of file
+var _0x2ef3=['update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','CloudProvider','then','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0xd8ab28,_0x5ed6f6){var _0x84a78c=function(_0x34c505){while(--_0x34c505){_0xd8ab28['push'](_0xd8ab28['shift']());}};_0x84a78c(++_0x5ed6f6);}(_0x2ef3,0xba));var _0x32ef=function(_0x33c441,_0x4942e3){_0x33c441=_0x33c441-0x0;var _0xb535ef=_0x2ef3[_0x33c441];return _0xb535ef;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['CloudProvider'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'all':!![]}];}return db[_0x32ef('0x3d')][_0x32ef('0x41')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x3c0e44){_0x3c569d['rows']=_0x3c0e44;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x42')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x43')]=function(_0x2a33dd,_0x765c63){var _0x5dca14={'raw':!![],'where':{'id':_0x2a33dd[_0x32ef('0x44')]['id']}},_0x2901a1={};_0x2901a1['model']=_[_0x32ef('0x45')](db['CloudProvider'][_0x32ef('0x2a')]);_0x2901a1[_0x32ef('0x2f')]=_[_0x32ef('0x45')](_0x2a33dd[_0x32ef('0x2f')]);_0x2901a1[_0x32ef('0x30')]=_[_0x32ef('0x32')](_0x2901a1[_0x32ef('0x2e')],_0x2901a1[_0x32ef('0x2f')]);_0x5dca14[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2901a1['model'],qs[_0x32ef('0x33')](_0x2a33dd['query'][_0x32ef('0x33')]));_0x5dca14[_0x32ef('0x31')]=_0x5dca14[_0x32ef('0x31')]['length']?_0x5dca14[_0x32ef('0x31')]:_0x2901a1[_0x32ef('0x2e')];if(_0x2a33dd[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5dca14[_0x32ef('0x40')]=[{'all':!![]}];}_0x5dca14=_[_0x32ef('0x3b')]({},_0x5dca14,_0x2a33dd[_0x32ef('0x3c')]);return db['CloudProvider']['find'](_0x5dca14)[_0x32ef('0x3e')](handleEntityNotFound(_0x765c63,null))[_0x32ef('0x3e')](respondWithResult(_0x765c63,null))[_0x32ef('0x42')](handleError(_0x765c63,null));};exports[_0x32ef('0x46')]=function(_0x209361,_0xd67dc9){return db[_0x32ef('0x3d')][_0x32ef('0x46')](_0x209361[_0x32ef('0x47')],{})[_0x32ef('0x3e')](respondWithResult(_0xd67dc9,0xc9))[_0x32ef('0x42')](handleError(_0xd67dc9,null));};exports[_0x32ef('0x24')]=function(_0x36a65c,_0x4c2534){if(_0x36a65c[_0x32ef('0x47')]['id']){delete _0x36a65c[_0x32ef('0x47')]['id'];}return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x36a65c[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x3e')](saveUpdates(_0x36a65c[_0x32ef('0x47')],null))[_0x32ef('0x3e')](respondWithResult(_0x4c2534,null))[_0x32ef('0x42')](handleError(_0x4c2534,null));};exports[_0x32ef('0x49')]=function(_0x29d456,_0x272377){return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x29d456[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x272377,null))[_0x32ef('0x3e')](removeEntity(_0x272377,null))['catch'](handleError(_0x272377,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 7ee3adc..cefd8e7 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 _0x4d8a=['rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','api','moment','request-promise','path'];(function(_0x2a9202,_0x5e68cb){var _0x316625=function(_0x4ae297){while(--_0x4ae297){_0x2a9202['push'](_0x2a9202['shift']());}};_0x316625(++_0x5e68cb);}(_0x4d8a,0x1e8));var _0xa4d8=function(_0x4ea576,_0x46e67a){_0x4ea576=_0x4ea576-0x0;var _0xc48ceb=_0x4d8a[_0x4ea576];return _0xc48ceb;};'use strict';var _=require(_0xa4d8('0x0'));var util=require(_0xa4d8('0x1'));var logger=require('../../config/logger')(_0xa4d8('0x2'));var moment=require(_0xa4d8('0x3'));var BPromise=require('bluebird');var rp=require(_0xa4d8('0x4'));var fs=require('fs');var path=require(_0xa4d8('0x5'));var rimraf=require(_0xa4d8('0x6'));var config=require(_0xa4d8('0x7'));var attributes=require(_0xa4d8('0x8'));module[_0xa4d8('0x9')]=function(_0x60cd93,_0x59d88e){return _0x60cd93[_0xa4d8('0xa')](_0xa4d8('0xb'),attributes,{'tableName':_0xa4d8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd9e4=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','define','CloudProvider','cloud_providers','lodash'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xd9e4,0x77));var _0x4d9e=function(_0xa76f70,_0x115a75){_0xa76f70=_0xa76f70-0x0;var _0x24459b=_0xd9e4[_0xa76f70];return _0x24459b;};'use strict';var _=require(_0x4d9e('0x0'));var util=require(_0x4d9e('0x1'));var logger=require(_0x4d9e('0x2'))(_0x4d9e('0x3'));var moment=require(_0x4d9e('0x4'));var BPromise=require(_0x4d9e('0x5'));var rp=require(_0x4d9e('0x6'));var fs=require('fs');var path=require(_0x4d9e('0x7'));var rimraf=require(_0x4d9e('0x8'));var config=require('../../config/environment');var attributes=require('./cloudProvider.attributes');module['exports']=function(_0x4808d8,_0x246601){return _0x4808d8[_0x4d9e('0x9')](_0x4d9e('0xa'),attributes,{'tableName':_0x4d9e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index aa326d1..a4eb5ad 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 _0xa5c1=['../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../config/utils'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xa5c1,0x19f));var _0x1a5c=function(_0x10e9e7,_0x199cbd){_0x10e9e7=_0x10e9e7-0x0;var _0x4e187a=_0xa5c1[_0x10e9e7];return _0x4e187a;};'use strict';var _=require(_0x1a5c('0x0'));var util=require(_0x1a5c('0x1'));var moment=require(_0x1a5c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a5c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a5c('0x4'));var logger=require(_0x1a5c('0x5'))(_0x1a5c('0x6'));var config=require(_0x1a5c('0x7'));var jayson=require(_0x1a5c('0x8'));var client=jayson[_0x1a5c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9853,_0x580a2e,_0x438f8f){return new BPromise(function(_0x43a2ed,_0x1702ce){return client['request'](_0x9853,_0x438f8f)[_0x1a5c('0xa')](function(_0x4c0bd2){logger[_0x1a5c('0xb')](_0x1a5c('0xc'),_0x580a2e,'request\x20sent');logger[_0x1a5c('0xd')](_0x1a5c('0xe'),_0x580a2e,'request\x20sent',JSON[_0x1a5c('0xf')](_0x4c0bd2));if(_0x4c0bd2[_0x1a5c('0x10')]){if(_0x4c0bd2[_0x1a5c('0x10')][_0x1a5c('0x11')]===0x1f4){logger[_0x1a5c('0x10')](_0x1a5c('0xc'),_0x580a2e,_0x4c0bd2[_0x1a5c('0x10')]['message']);return _0x1702ce(_0x4c0bd2[_0x1a5c('0x10')][_0x1a5c('0x12')]);}logger['error'](_0x1a5c('0xc'),_0x580a2e,_0x4c0bd2[_0x1a5c('0x10')]['message']);return _0x43a2ed(_0x4c0bd2[_0x1a5c('0x10')][_0x1a5c('0x12')]);}else{logger[_0x1a5c('0xb')](_0x1a5c('0xc'),_0x580a2e,'request\x20sent');_0x43a2ed(_0x4c0bd2[_0x1a5c('0x13')]['message']);}})[_0x1a5c('0x14')](function(_0x44648a){logger[_0x1a5c('0x10')]('CloudProvider,\x20%s,\x20%s',_0x580a2e,_0x44648a);_0x1702ce(_0x44648a);});});}
\ No newline at end of file
+var _0x42f4=['jayson/promise','http','then','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment'];(function(_0x33a017,_0xfa348c){var _0x147e22=function(_0x42f8b9){while(--_0x42f8b9){_0x33a017['push'](_0x33a017['shift']());}};_0x147e22(++_0xfa348c);}(_0x42f4,0x19d));var _0x442f=function(_0x3ae2b2,_0x2d936f){_0x3ae2b2=_0x3ae2b2-0x0;var _0x1dbf00=_0x42f4[_0x3ae2b2];return _0x1dbf00;};'use strict';var _=require(_0x442f('0x0'));var util=require('util');var moment=require(_0x442f('0x1'));var BPromise=require(_0x442f('0x2'));var rs=require(_0x442f('0x3'));var fs=require('fs');var Redis=require(_0x442f('0x4'));var db=require(_0x442f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x442f('0x6'));var jayson=require(_0x442f('0x7'));var client=jayson['client'][_0x442f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x11b450,_0x23c5ba,_0x37dfe7){return new BPromise(function(_0x6c0b4b,_0x476480){return client['request'](_0x11b450,_0x37dfe7)[_0x442f('0x9')](function(_0x4e32af){logger['info']('CloudProvider,\x20%s,\x20%s',_0x23c5ba,_0x442f('0xa'));logger[_0x442f('0xb')](_0x442f('0xc'),_0x23c5ba,_0x442f('0xa'),JSON[_0x442f('0xd')](_0x4e32af));if(_0x4e32af[_0x442f('0xe')]){if(_0x4e32af[_0x442f('0xe')][_0x442f('0xf')]===0x1f4){logger[_0x442f('0xe')](_0x442f('0x10'),_0x23c5ba,_0x4e32af['error'][_0x442f('0x11')]);return _0x476480(_0x4e32af[_0x442f('0xe')][_0x442f('0x11')]);}logger[_0x442f('0xe')](_0x442f('0x10'),_0x23c5ba,_0x4e32af[_0x442f('0xe')][_0x442f('0x11')]);return _0x6c0b4b(_0x4e32af[_0x442f('0xe')][_0x442f('0x11')]);}else{logger[_0x442f('0x12')](_0x442f('0x10'),_0x23c5ba,_0x442f('0xa'));_0x6c0b4b(_0x4e32af[_0x442f('0x13')][_0x442f('0x11')]);}})[_0x442f('0x14')](function(_0x3ff2b1){logger['error'](_0x442f('0x10'),_0x23c5ba,_0x3ff2b1);_0x476480(_0x3ff2b1);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 998e6c6..9e3906b 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 _0xf811=['show','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id'];(function(_0x21b99d,_0x46fbc9){var _0x31335a=function(_0x3985a8){while(--_0x3985a8){_0x21b99d['push'](_0x21b99d['shift']());}};_0x31335a(++_0x46fbc9);}(_0xf811,0x6f));var _0x1f81=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xf811[_0x42245d];return _0x4b211a;};'use strict';var multer=require(_0x1f81('0x0'));var util=require(_0x1f81('0x1'));var path=require(_0x1f81('0x2'));var timeout=require(_0x1f81('0x3'));var express=require(_0x1f81('0x4'));var router=express[_0x1f81('0x5')]();var fs_extra=require(_0x1f81('0x6'));var auth=require(_0x1f81('0x7'));var interaction=require(_0x1f81('0x8'));var config=require(_0x1f81('0x9'));var controller=require(_0x1f81('0xa'));router[_0x1f81('0xb')]('/',auth[_0x1f81('0xc')](),controller[_0x1f81('0xd')]);router['get'](_0x1f81('0xe'),auth[_0x1f81('0xc')](),controller[_0x1f81('0xf')]);router['post']('/',auth[_0x1f81('0xc')](),controller[_0x1f81('0x10')]);router['put'](_0x1f81('0xe'),auth['isAuthenticated'](),controller[_0x1f81('0x11')]);router[_0x1f81('0x12')](_0x1f81('0xe'),auth[_0x1f81('0xc')](),controller[_0x1f81('0x13')]);module[_0x1f81('0x14')]=router;
\ No newline at end of file
+var _0x62fd=['show','post','create','put','update','delete','destroy','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x2338ae,_0x1896f8){var _0x4adad9=function(_0x1f6ed1){while(--_0x1f6ed1){_0x2338ae['push'](_0x2338ae['shift']());}};_0x4adad9(++_0x1896f8);}(_0x62fd,0x14b));var _0xd62f=function(_0x20a2a0,_0x36e98e){_0x20a2a0=_0x20a2a0-0x0;var _0x525739=_0x62fd[_0x20a2a0];return _0x525739;};'use strict';var multer=require(_0xd62f('0x0'));var util=require('util');var path=require(_0xd62f('0x1'));var timeout=require('connect-timeout');var express=require(_0xd62f('0x2'));var router=express['Router']();var fs_extra=require(_0xd62f('0x3'));var auth=require(_0xd62f('0x4'));var interaction=require(_0xd62f('0x5'));var config=require(_0xd62f('0x6'));var controller=require('./cloudProvider.controller');router[_0xd62f('0x7')]('/',auth[_0xd62f('0x8')](),controller[_0xd62f('0x9')]);router[_0xd62f('0x7')](_0xd62f('0xa'),auth[_0xd62f('0x8')](),controller[_0xd62f('0xb')]);router[_0xd62f('0xc')]('/',auth[_0xd62f('0x8')](),controller[_0xd62f('0xd')]);router[_0xd62f('0xe')]('/:id',auth[_0xd62f('0x8')](),controller[_0xd62f('0xf')]);router[_0xd62f('0x10')]('/:id',auth[_0xd62f('0x8')](),controller[_0xd62f('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index fbaf563..44eb7b2 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 _0x84fe=['exports','STRING','name','sequelize'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x84fe,0xdb));var _0xe84f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x84fe[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xe84f('0x0'));module[_0xe84f('0x1')]={'name':{'type':Sequelize[_0xe84f('0x2')],'unique':_0xe84f('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xe84f('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xe84f('0x2')]},'fax':{'type':Sequelize[_0xe84f('0x2')]},'type':{'type':Sequelize[_0xe84f('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xe84f('0x2')]},'city':{'type':Sequelize[_0xe84f('0x2')]},'country':{'type':Sequelize[_0xe84f('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xe84f('0x2')]},'sStreet':{'type':Sequelize[_0xe84f('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xe84f('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x6819=['STRING','name','sequelize','exports'];(function(_0x290cc3,_0x7d6950){var _0x422574=function(_0x4725a9){while(--_0x4725a9){_0x290cc3['push'](_0x290cc3['shift']());}};_0x422574(++_0x7d6950);}(_0x6819,0x8a));var _0x9681=function(_0x26b44c,_0x407707){_0x26b44c=_0x26b44c-0x0;var _0x40981c=_0x6819[_0x26b44c];return _0x40981c;};'use strict';var Sequelize=require(_0x9681('0x0'));module[_0x9681('0x1')]={'name':{'type':Sequelize[_0x9681('0x2')],'unique':_0x9681('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x9681('0x2')]},'companyId':{'type':Sequelize[_0x9681('0x2')]},'website':{'type':Sequelize[_0x9681('0x2')]},'phone':{'type':Sequelize[_0x9681('0x2')]},'fax':{'type':Sequelize[_0x9681('0x2')]},'type':{'type':Sequelize[_0x9681('0x2')]},'street':{'type':Sequelize[_0x9681('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x9681('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x9681('0x2')]},'sStreet':{'type':Sequelize[_0x9681('0x2')]},'sPostalCode':{'type':Sequelize[_0x9681('0x2')]},'sCity':{'type':Sequelize[_0x9681('0x2')]},'sCountry':{'type':Sequelize[_0x9681('0x2')]},'description':{'type':Sequelize[_0x9681('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index c0cdf3c..7d31cf6 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 _0x7bbc=['sox','to-csv','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','update','destroy','then','get','UserProfileResource','sendStatus','error','stack','name','send','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','options','includeAll','findAll','rows','catch','show','params','rawAttributes','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Companies','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','ids','omit','getContacts','findOne','CmContact','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path'];(function(_0x361dfc,_0x340a4a){var _0x1e1bf2=function(_0x74ba1c){while(--_0x74ba1c){_0x361dfc['push'](_0x361dfc['shift']());}};_0x1e1bf2(++_0x340a4a);}(_0x7bbc,0x148));var _0xc7bb=function(_0x2f0f20,_0xe6bbea){_0x2f0f20=_0x2f0f20-0x0;var _0x2c342e=_0x7bbc[_0x2f0f20];return _0x2c342e;};'use strict';var emlformat=require(_0xc7bb('0x0'));var rimraf=require(_0xc7bb('0x1'));var zipdir=require(_0xc7bb('0x2'));var jsonpatch=require(_0xc7bb('0x3'));var rp=require(_0xc7bb('0x4'));var moment=require(_0xc7bb('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc7bb('0x6'));var path=require(_0xc7bb('0x7'));var sox=require(_0xc7bb('0x8'));var csv=require(_0xc7bb('0x9'));var ejs=require(_0xc7bb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc7bb('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc7bb('0xc'));var toCsv=require(_0xc7bb('0x9'));var querystring=require(_0xc7bb('0xd'));var Papa=require(_0xc7bb('0xe'));var Redis=require(_0xc7bb('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc7bb('0x10'));var as=require(_0xc7bb('0x11'));var hardwareService=require(_0xc7bb('0x12'));var logger=require(_0xc7bb('0x13'))(_0xc7bb('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc7bb('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x301acf,_0x24853c){_0x24853c=_0x24853c||0xcc;return function(_0x15c1a7){if(_0x15c1a7){return _0x301acf['sendStatus'](_0x24853c);}return _0x301acf[_0xc7bb('0x16')](_0x24853c)[_0xc7bb('0x17')]();};}function respondWithResult(_0x2f0c02,_0x125b74){_0x125b74=_0x125b74||0xc8;return function(_0x448e4a){if(_0x448e4a){return _0x2f0c02[_0xc7bb('0x16')](_0x125b74)['json'](_0x448e4a);}};}function respondWithFilteredResult(_0x3dc185,_0x10b5ff){return function(_0x1f85fd){if(_0x1f85fd){var _0x2b7649=typeof _0x10b5ff[_0xc7bb('0x18')]===_0xc7bb('0x19')&&typeof _0x10b5ff[_0xc7bb('0x1a')]===_0xc7bb('0x19');var _0x5d5136=_0x1f85fd[_0xc7bb('0x1b')];var _0x1c7740=_0x2b7649?0x0:_0x10b5ff[_0xc7bb('0x18')];var _0x3f8cb9=_0x2b7649?_0x1f85fd['count']:_0x10b5ff[_0xc7bb('0x18')]+_0x10b5ff['limit'];var _0x3ed0f2;if(_0x3f8cb9>=_0x5d5136){_0x3f8cb9=_0x5d5136;_0x3ed0f2=0xc8;}else{_0x3ed0f2=0xce;}_0x3dc185[_0xc7bb('0x16')](_0x3ed0f2);return _0x3dc185['set'](_0xc7bb('0x1c'),_0x1c7740+'-'+_0x3f8cb9+'/'+_0x5d5136)[_0xc7bb('0x1d')](_0x1f85fd);}return null;};}function patchUpdates(_0x1293f4){return function(_0x1547e5){try{jsonpatch[_0xc7bb('0x1e')](_0x1547e5,_0x1293f4,!![]);}catch(_0x1a9350){return BPromise['reject'](_0x1a9350);}return _0x1547e5[_0xc7bb('0x1f')]();};}function saveUpdates(_0x17228f,_0x41b2e7){return function(_0x2ad6e9){if(_0x2ad6e9){return _0x2ad6e9[_0xc7bb('0x20')](_0x17228f)['then'](function(_0x2c1754){return _0x2c1754;});}return null;};}function removeEntity(_0x2a64ce,_0x25c444){return function(_0x44ec9e){if(_0x44ec9e){return _0x44ec9e[_0xc7bb('0x21')]()[_0xc7bb('0x22')](function(){var _0x30b30d=_0x44ec9e[_0xc7bb('0x23')]({'plain':!![]});var _0x137713='Companies';return db[_0xc7bb('0x24')][_0xc7bb('0x21')]({'where':{'type':_0x137713,'resourceId':_0x30b30d['id']}})['then'](function(){return _0x44ec9e;});})[_0xc7bb('0x22')](function(){_0x2a64ce[_0xc7bb('0x16')](0xcc)[_0xc7bb('0x17')]();});}};}function handleEntityNotFound(_0x431c2d,_0x392330){return function(_0x14108d){if(!_0x14108d){_0x431c2d[_0xc7bb('0x25')](0x194);}return _0x14108d;};}function handleError(_0x4386d4,_0x48cc44){_0x48cc44=_0x48cc44||0x1f4;return function(_0x12b6f3){logger[_0xc7bb('0x26')](_0x12b6f3[_0xc7bb('0x27')]);if(_0x12b6f3[_0xc7bb('0x28')]){delete _0x12b6f3['name'];}_0x4386d4[_0xc7bb('0x16')](_0x48cc44)[_0xc7bb('0x29')](_0x12b6f3);};}exports['index']=function(_0x2588e3,_0x29e6a6){var _0x195ed3={},_0x28f04d={},_0x177d11={'count':0x0,'rows':[]};return db[_0xc7bb('0x2a')][_0xc7bb('0x2b')]()[_0xc7bb('0x22')](function(_0x4198c2){_0x28f04d[_0xc7bb('0x2c')]=_[_0xc7bb('0x2d')](_0x4198c2);_0x28f04d[_0xc7bb('0x2e')]=_['keys'](_0x2588e3[_0xc7bb('0x2e')]);_0x28f04d[_0xc7bb('0x2f')]=_[_0xc7bb('0x30')](_0x28f04d[_0xc7bb('0x2c')],_0x28f04d[_0xc7bb('0x2e')]);_0x195ed3[_0xc7bb('0x31')]=_[_0xc7bb('0x30')](_0x28f04d[_0xc7bb('0x2c')],qs[_0xc7bb('0x32')](_0x2588e3[_0xc7bb('0x2e')]['fields']));_0x195ed3['attributes']=_0x195ed3['attributes'][_0xc7bb('0x33')]?_0x195ed3['attributes']:_0x28f04d[_0xc7bb('0x2c')];if(!_0x2588e3['query'][_0xc7bb('0x34')](_0xc7bb('0x35'))){_0x195ed3[_0xc7bb('0x1a')]=qs[_0xc7bb('0x1a')](_0x2588e3[_0xc7bb('0x2e')][_0xc7bb('0x1a')]);_0x195ed3[_0xc7bb('0x18')]=qs[_0xc7bb('0x18')](_0x2588e3[_0xc7bb('0x2e')][_0xc7bb('0x18')]);}_0x195ed3['order']=qs[_0xc7bb('0x36')](_0x2588e3['query'][_0xc7bb('0x36')]);_0x195ed3[_0xc7bb('0x37')]=qs[_0xc7bb('0x2f')](_[_0xc7bb('0x38')](_0x2588e3[_0xc7bb('0x2e')],_0x28f04d[_0xc7bb('0x2f')]),_0x4198c2);if(_0x2588e3[_0xc7bb('0x2e')][_0xc7bb('0x39')]){_0x195ed3['where']=_[_0xc7bb('0x3a')](_0x195ed3[_0xc7bb('0x37')],{'$or':_[_0xc7bb('0x3b')](_0x195ed3[_0xc7bb('0x31')],function(_0xf3867d){var _0x270f26={};_0x270f26[_0xf3867d]={'$like':'%'+_0x2588e3[_0xc7bb('0x2e')][_0xc7bb('0x39')]+'%'};return _0x270f26;})});}_0x195ed3=_[_0xc7bb('0x3a')]({},_0x195ed3,_0x2588e3[_0xc7bb('0x3c')]);var _0x3dc31c={'where':_0x195ed3[_0xc7bb('0x37')]};return db['CmCompany'][_0xc7bb('0x1b')](_0x3dc31c)[_0xc7bb('0x22')](function(_0x49afe9){_0x177d11[_0xc7bb('0x1b')]=_0x49afe9;if(_0x2588e3[_0xc7bb('0x2e')][_0xc7bb('0x3d')]){_0x195ed3['include']=[{'all':!![]}];}return db['CmCompany'][_0xc7bb('0x3e')](_0x195ed3);})[_0xc7bb('0x22')](function(_0x2dd8e5){_0x177d11[_0xc7bb('0x3f')]=_0x2dd8e5;return _0x177d11;})[_0xc7bb('0x22')](respondWithFilteredResult(_0x29e6a6,_0x195ed3))[_0xc7bb('0x40')](handleError(_0x29e6a6,null));})[_0xc7bb('0x40')](handleError(_0x29e6a6,null));};exports[_0xc7bb('0x41')]=function(_0x17fa39,_0x5f60f5){var _0x42cc07={'raw':![],'where':{'id':_0x17fa39[_0xc7bb('0x42')]['id']}},_0x211655={};_0x211655['model']=_[_0xc7bb('0x2d')](db[_0xc7bb('0x2a')][_0xc7bb('0x43')]);_0x211655[_0xc7bb('0x2e')]=_[_0xc7bb('0x2d')](_0x17fa39[_0xc7bb('0x2e')]);_0x211655[_0xc7bb('0x2f')]=_[_0xc7bb('0x30')](_0x211655[_0xc7bb('0x2c')],_0x211655[_0xc7bb('0x2e')]);_0x42cc07['attributes']=_['intersection'](_0x211655[_0xc7bb('0x2c')],qs['fields'](_0x17fa39[_0xc7bb('0x2e')][_0xc7bb('0x32')]));_0x42cc07[_0xc7bb('0x31')]=_0x42cc07['attributes'][_0xc7bb('0x33')]?_0x42cc07[_0xc7bb('0x31')]:_0x211655[_0xc7bb('0x2c')];if(_0x17fa39['query']['includeAll']){_0x42cc07['include']=[{'all':!![]}];}_0x42cc07=_['merge']({},_0x42cc07,_0x17fa39[_0xc7bb('0x3c')]);return db[_0xc7bb('0x2a')]['find'](_0x42cc07)['then'](handleEntityNotFound(_0x5f60f5,null))['then'](respondWithResult(_0x5f60f5,null))['catch'](handleError(_0x5f60f5,null));};exports['create']=function(_0x4c9ff7,_0x364445){return db['CmCompany'][_0xc7bb('0x44')](_0x4c9ff7[_0xc7bb('0x45')],{})['then'](function(_0x2881d3){var _0x20f1ac=_0x4c9ff7['user'][_0xc7bb('0x23')]({'plain':!![]});if(!_0x20f1ac)throw new Error(_0xc7bb('0x46'));if(_0x20f1ac[_0xc7bb('0x47')]===_0xc7bb('0x48')){var _0x1c9e50=_0x2881d3[_0xc7bb('0x23')]({'plain':!![]});var _0x154279=_0xc7bb('0x49');return db[_0xc7bb('0x4a')][_0xc7bb('0x4b')]({'where':{'name':_0x154279,'userProfileId':_0x20f1ac['userProfileId']},'raw':!![]})[_0xc7bb('0x22')](function(_0x54e3da){if(_0x54e3da&&_0x54e3da['autoAssociation']===0x0){return db[_0xc7bb('0x24')][_0xc7bb('0x44')]({'name':_0x1c9e50[_0xc7bb('0x28')],'resourceId':_0x1c9e50['id'],'type':_0x54e3da[_0xc7bb('0x28')],'sectionId':_0x54e3da['id']},{})['then'](function(){return _0x2881d3;});}else{return _0x2881d3;}})['catch'](function(_0xe3ae2b){logger[_0xc7bb('0x26')](_0xc7bb('0x4c'),_0xe3ae2b);throw _0xe3ae2b;});}return _0x2881d3;})[_0xc7bb('0x22')](respondWithResult(_0x364445,0xc9))['catch'](handleError(_0x364445,null));};exports[_0xc7bb('0x20')]=function(_0x31fb60,_0x34f281){if(_0x31fb60[_0xc7bb('0x45')]['id']){delete _0x31fb60[_0xc7bb('0x45')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x31fb60[_0xc7bb('0x42')]['id']}})[_0xc7bb('0x22')](handleEntityNotFound(_0x34f281,null))[_0xc7bb('0x22')](saveUpdates(_0x31fb60['body'],null))[_0xc7bb('0x22')](respondWithResult(_0x34f281,null))['catch'](handleError(_0x34f281,null));};exports['destroy']=function(_0x3c225c,_0x3fe6bf){return db[_0xc7bb('0x2a')][_0xc7bb('0x4b')]({'where':{'id':_0x3c225c[_0xc7bb('0x42')]['id']}})['then'](handleEntityNotFound(_0x3fe6bf,null))[_0xc7bb('0x22')](removeEntity(_0x3fe6bf,null))[_0xc7bb('0x40')](handleError(_0x3fe6bf,null));};exports['describe']=function(_0x320e76,_0x20319d){return db[_0xc7bb('0x2a')][_0xc7bb('0x2b')]()[_0xc7bb('0x22')](respondWithResult(_0x20319d,null))[_0xc7bb('0x40')](handleError(_0x20319d,null));};exports[_0xc7bb('0x4d')]=function(_0x41689e,_0x306a81,_0x3a7918){return db['CmContact'][_0xc7bb('0x4b')]({'where':{'id':_0x41689e['params']['id']}})['then'](handleEntityNotFound(_0x306a81,null))['then'](function(_0x54b3b4){if(_0x54b3b4){return _0x54b3b4[_0xc7bb('0x4d')](_0x41689e['body'][_0xc7bb('0x4e')],_[_0xc7bb('0x4f')](_0x41689e[_0xc7bb('0x45')],[_0xc7bb('0x4e'),'id'])||{});}})['then'](respondWithResult(_0x306a81,null))[_0xc7bb('0x40')](handleError(_0x306a81,null));};exports[_0xc7bb('0x50')]=function(_0x534652,_0x45eafb,_0x1decb1){var _0x58c189={};var _0x485aa8={};var _0x583eb8;var _0x73da9b;return db[_0xc7bb('0x2a')][_0xc7bb('0x51')]({'where':{'id':_0x534652[_0xc7bb('0x42')]['id']}})['then'](handleEntityNotFound(_0x45eafb,null))['then'](function(_0x5b0bcc){if(_0x5b0bcc){_0x583eb8=_0x5b0bcc;_0x485aa8[_0xc7bb('0x2c')]=_[_0xc7bb('0x2d')](db[_0xc7bb('0x52')][_0xc7bb('0x43')]);_0x485aa8['query']=_[_0xc7bb('0x2d')](_0x534652[_0xc7bb('0x2e')]);_0x485aa8[_0xc7bb('0x2f')]=_[_0xc7bb('0x30')](_0x485aa8[_0xc7bb('0x2c')],_0x485aa8[_0xc7bb('0x2e')]);_0x58c189[_0xc7bb('0x31')]=_['intersection'](_0x485aa8[_0xc7bb('0x2c')],qs[_0xc7bb('0x32')](_0x534652[_0xc7bb('0x2e')]['fields']));_0x58c189['attributes']=_0x58c189['attributes']['length']?_0x58c189[_0xc7bb('0x31')]:_0x485aa8['model'];_0x58c189[_0xc7bb('0x53')]=qs[_0xc7bb('0x36')](_0x534652[_0xc7bb('0x2e')][_0xc7bb('0x36')]);_0x58c189[_0xc7bb('0x37')]=qs['filters'](_[_0xc7bb('0x38')](_0x534652[_0xc7bb('0x2e')],_0x485aa8[_0xc7bb('0x2f')]));if(_0x534652[_0xc7bb('0x2e')][_0xc7bb('0x39')]){_0x58c189['where']=_[_0xc7bb('0x3a')](_0x58c189[_0xc7bb('0x37')],{'$or':_[_0xc7bb('0x3b')](_0x58c189[_0xc7bb('0x31')],function(_0x3801b3){var _0x5a5826={};_0x5a5826[_0x3801b3]={'$like':'%'+_0x534652[_0xc7bb('0x2e')][_0xc7bb('0x39')]+'%'};return _0x5a5826;})});}_0x58c189=_[_0xc7bb('0x3a')]({},_0x58c189,_0x534652[_0xc7bb('0x3c')]);return _0x583eb8['getContacts'](_0x58c189);}})['then'](function(_0x126326){if(_0x126326){_0x73da9b=_0x126326[_0xc7bb('0x33')];if(!_0x534652[_0xc7bb('0x2e')][_0xc7bb('0x34')]('nolimit')){_0x58c189[_0xc7bb('0x1a')]=qs['limit'](_0x534652[_0xc7bb('0x2e')][_0xc7bb('0x1a')]);_0x58c189['offset']=qs[_0xc7bb('0x18')](_0x534652[_0xc7bb('0x2e')]['offset']);}return _0x583eb8[_0xc7bb('0x50')](_0x58c189);}})[_0xc7bb('0x22')](function(_0x221cd7){if(_0x221cd7){return _0x221cd7?{'count':_0x73da9b,'rows':_0x221cd7}:null;}})[_0xc7bb('0x22')](respondWithResult(_0x45eafb,null))['catch'](handleError(_0x45eafb,null));};
\ No newline at end of file
+var _0xc196=['save','update','then','get','Companies','UserProfileResource','destroy','end','error','name','index','CmCompany','describe','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','catch','show','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','CmContact','omit','ids','getContacts','findOne','map','hasOwnProperty','eml-format','zip-dir','moment','util','path','to-csv','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x366496,_0x38619f){var _0xf77cdf=function(_0xee78c9){while(--_0xee78c9){_0x366496['push'](_0x366496['shift']());}};_0xf77cdf(++_0x38619f);}(_0xc196,0xdd));var _0x6c19=function(_0x3e6441,_0x248ed3){_0x3e6441=_0x3e6441-0x0;var _0x16aa65=_0xc196[_0x3e6441];return _0x16aa65;};'use strict';var emlformat=require(_0x6c19('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6c19('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6c19('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6c19('0x3'));var path=require(_0x6c19('0x4'));var sox=require('sox');var csv=require(_0x6c19('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6c19('0x6'));var crypto=require('crypto');var jsforce=require(_0x6c19('0x7'));var deskjs=require(_0x6c19('0x8'));var toCsv=require(_0x6c19('0x5'));var querystring=require('querystring');var Papa=require(_0x6c19('0x9'));var Redis=require(_0x6c19('0xa'));var authService=require(_0x6c19('0xb'));var qs=require(_0x6c19('0xc'));var as=require(_0x6c19('0xd'));var hardwareService=require(_0x6c19('0xe'));var logger=require('../../config/logger')(_0x6c19('0xf'));var utils=require(_0x6c19('0x10'));var config=require(_0x6c19('0x11'));var licenseUtil=require(_0x6c19('0x12'));var db=require(_0x6c19('0x13'))['db'];function respondWithStatusCode(_0x530cf8,_0xeac3e6){_0xeac3e6=_0xeac3e6||0xcc;return function(_0x517fe2){if(_0x517fe2){return _0x530cf8[_0x6c19('0x14')](_0xeac3e6);}return _0x530cf8[_0x6c19('0x15')](_0xeac3e6)['end']();};}function respondWithResult(_0x20e2cd,_0x278602){_0x278602=_0x278602||0xc8;return function(_0x3b0c87){if(_0x3b0c87){return _0x20e2cd['status'](_0x278602)[_0x6c19('0x16')](_0x3b0c87);}};}function respondWithFilteredResult(_0x12ac1d,_0x3182ab){return function(_0x5380ee){if(_0x5380ee){var _0x2553bc=typeof _0x3182ab[_0x6c19('0x17')]===_0x6c19('0x18')&&typeof _0x3182ab[_0x6c19('0x19')]===_0x6c19('0x18');var _0x42c353=_0x5380ee['count'];var _0x5ae036=_0x2553bc?0x0:_0x3182ab[_0x6c19('0x17')];var _0x37bcf2=_0x2553bc?_0x5380ee[_0x6c19('0x1a')]:_0x3182ab[_0x6c19('0x17')]+_0x3182ab['limit'];var _0x218f5b;if(_0x37bcf2>=_0x42c353){_0x37bcf2=_0x42c353;_0x218f5b=0xc8;}else{_0x218f5b=0xce;}_0x12ac1d['status'](_0x218f5b);return _0x12ac1d[_0x6c19('0x1b')](_0x6c19('0x1c'),_0x5ae036+'-'+_0x37bcf2+'/'+_0x42c353)[_0x6c19('0x16')](_0x5380ee);}return null;};}function patchUpdates(_0x4825c3){return function(_0x53ecfd){try{jsonpatch[_0x6c19('0x1d')](_0x53ecfd,_0x4825c3,!![]);}catch(_0x5d8e77){return BPromise[_0x6c19('0x1e')](_0x5d8e77);}return _0x53ecfd[_0x6c19('0x1f')]();};}function saveUpdates(_0x1f404f,_0x1003a2){return function(_0x4fb816){if(_0x4fb816){return _0x4fb816[_0x6c19('0x20')](_0x1f404f)['then'](function(_0x2fef5e){return _0x2fef5e;});}return null;};}function removeEntity(_0x363c12,_0x427d5c){return function(_0x557597){if(_0x557597){return _0x557597['destroy']()[_0x6c19('0x21')](function(){var _0x5b0579=_0x557597[_0x6c19('0x22')]({'plain':!![]});var _0xb45cf5=_0x6c19('0x23');return db[_0x6c19('0x24')][_0x6c19('0x25')]({'where':{'type':_0xb45cf5,'resourceId':_0x5b0579['id']}})[_0x6c19('0x21')](function(){return _0x557597;});})['then'](function(){_0x363c12['status'](0xcc)[_0x6c19('0x26')]();});}};}function handleEntityNotFound(_0x5acd98,_0x294331){return function(_0x521234){if(!_0x521234){_0x5acd98['sendStatus'](0x194);}return _0x521234;};}function handleError(_0x402283,_0x2972a3){_0x2972a3=_0x2972a3||0x1f4;return function(_0x295436){logger[_0x6c19('0x27')](_0x295436['stack']);if(_0x295436[_0x6c19('0x28')]){delete _0x295436[_0x6c19('0x28')];}_0x402283['status'](_0x2972a3)['send'](_0x295436);};}exports[_0x6c19('0x29')]=function(_0x1dc6f9,_0x21e78d){var _0x52cc1a={},_0x51f2e2={},_0x36fa41={'count':0x0,'rows':[]};return db[_0x6c19('0x2a')][_0x6c19('0x2b')]()[_0x6c19('0x21')](function(_0x1975a9){_0x51f2e2['model']=_[_0x6c19('0x2c')](_0x1975a9);_0x51f2e2[_0x6c19('0x2d')]=_['keys'](_0x1dc6f9[_0x6c19('0x2d')]);_0x51f2e2[_0x6c19('0x2e')]=_[_0x6c19('0x2f')](_0x51f2e2[_0x6c19('0x30')],_0x51f2e2[_0x6c19('0x2d')]);_0x52cc1a[_0x6c19('0x31')]=_['intersection'](_0x51f2e2['model'],qs[_0x6c19('0x32')](_0x1dc6f9[_0x6c19('0x2d')][_0x6c19('0x32')]));_0x52cc1a[_0x6c19('0x31')]=_0x52cc1a['attributes'][_0x6c19('0x33')]?_0x52cc1a['attributes']:_0x51f2e2[_0x6c19('0x30')];if(!_0x1dc6f9[_0x6c19('0x2d')]['hasOwnProperty'](_0x6c19('0x34'))){_0x52cc1a[_0x6c19('0x19')]=qs['limit'](_0x1dc6f9[_0x6c19('0x2d')]['limit']);_0x52cc1a[_0x6c19('0x17')]=qs[_0x6c19('0x17')](_0x1dc6f9[_0x6c19('0x2d')][_0x6c19('0x17')]);}_0x52cc1a[_0x6c19('0x35')]=qs[_0x6c19('0x36')](_0x1dc6f9[_0x6c19('0x2d')]['sort']);_0x52cc1a[_0x6c19('0x37')]=qs[_0x6c19('0x2e')](_[_0x6c19('0x38')](_0x1dc6f9[_0x6c19('0x2d')],_0x51f2e2[_0x6c19('0x2e')]),_0x1975a9);if(_0x1dc6f9['query'][_0x6c19('0x39')]){_0x52cc1a[_0x6c19('0x37')]=_[_0x6c19('0x3a')](_0x52cc1a['where'],{'$or':_['map'](_0x52cc1a[_0x6c19('0x31')],function(_0x2a5548){var _0x5eac41={};_0x5eac41[_0x2a5548]={'$like':'%'+_0x1dc6f9[_0x6c19('0x2d')]['filter']+'%'};return _0x5eac41;})});}_0x52cc1a=_[_0x6c19('0x3a')]({},_0x52cc1a,_0x1dc6f9[_0x6c19('0x3b')]);var _0x2e51f3={'where':_0x52cc1a['where']};return db[_0x6c19('0x2a')][_0x6c19('0x1a')](_0x2e51f3)[_0x6c19('0x21')](function(_0x3f1928){_0x36fa41[_0x6c19('0x1a')]=_0x3f1928;if(_0x1dc6f9[_0x6c19('0x2d')][_0x6c19('0x3c')]){_0x52cc1a['include']=[{'all':!![]}];}return db[_0x6c19('0x2a')][_0x6c19('0x3d')](_0x52cc1a);})[_0x6c19('0x21')](function(_0x420e81){_0x36fa41['rows']=_0x420e81;return _0x36fa41;})[_0x6c19('0x21')](respondWithFilteredResult(_0x21e78d,_0x52cc1a))[_0x6c19('0x3e')](handleError(_0x21e78d,null));})[_0x6c19('0x3e')](handleError(_0x21e78d,null));};exports[_0x6c19('0x3f')]=function(_0x1370b8,_0x57f8a5){var _0xc38102={'raw':![],'where':{'id':_0x1370b8['params']['id']}},_0x1e1ca0={};_0x1e1ca0[_0x6c19('0x30')]=_[_0x6c19('0x2c')](db[_0x6c19('0x2a')][_0x6c19('0x40')]);_0x1e1ca0['query']=_[_0x6c19('0x2c')](_0x1370b8[_0x6c19('0x2d')]);_0x1e1ca0['filters']=_[_0x6c19('0x2f')](_0x1e1ca0[_0x6c19('0x30')],_0x1e1ca0['query']);_0xc38102[_0x6c19('0x31')]=_['intersection'](_0x1e1ca0[_0x6c19('0x30')],qs[_0x6c19('0x32')](_0x1370b8[_0x6c19('0x2d')][_0x6c19('0x32')]));_0xc38102[_0x6c19('0x31')]=_0xc38102[_0x6c19('0x31')][_0x6c19('0x33')]?_0xc38102[_0x6c19('0x31')]:_0x1e1ca0[_0x6c19('0x30')];if(_0x1370b8['query'][_0x6c19('0x3c')]){_0xc38102[_0x6c19('0x41')]=[{'all':!![]}];}_0xc38102=_[_0x6c19('0x3a')]({},_0xc38102,_0x1370b8['options']);return db[_0x6c19('0x2a')][_0x6c19('0x42')](_0xc38102)[_0x6c19('0x21')](handleEntityNotFound(_0x57f8a5,null))['then'](respondWithResult(_0x57f8a5,null))[_0x6c19('0x3e')](handleError(_0x57f8a5,null));};exports['create']=function(_0x4e5a4e,_0xb99be5){return db[_0x6c19('0x2a')][_0x6c19('0x43')](_0x4e5a4e[_0x6c19('0x44')],{})['then'](function(_0x1a5123){var _0x52d81c=_0x4e5a4e[_0x6c19('0x45')][_0x6c19('0x22')]({'plain':!![]});if(!_0x52d81c)throw new Error(_0x6c19('0x46'));if(_0x52d81c['role']===_0x6c19('0x45')){var _0x226864=_0x1a5123[_0x6c19('0x22')]({'plain':!![]});var _0x1ac281=_0x6c19('0x23');return db[_0x6c19('0x47')][_0x6c19('0x42')]({'where':{'name':_0x1ac281,'userProfileId':_0x52d81c[_0x6c19('0x48')]},'raw':!![]})['then'](function(_0x126df1){if(_0x126df1&&_0x126df1[_0x6c19('0x49')]===0x0){return db['UserProfileResource']['create']({'name':_0x226864[_0x6c19('0x28')],'resourceId':_0x226864['id'],'type':_0x126df1[_0x6c19('0x28')],'sectionId':_0x126df1['id']},{})['then'](function(){return _0x1a5123;});}else{return _0x1a5123;}})[_0x6c19('0x3e')](function(_0xc1cacd){logger['error'](_0x6c19('0x4a'),_0xc1cacd);throw _0xc1cacd;});}return _0x1a5123;})[_0x6c19('0x21')](respondWithResult(_0xb99be5,0xc9))[_0x6c19('0x3e')](handleError(_0xb99be5,null));};exports[_0x6c19('0x20')]=function(_0x1e89b3,_0x5e026b){if(_0x1e89b3['body']['id']){delete _0x1e89b3[_0x6c19('0x44')]['id'];}return db[_0x6c19('0x2a')][_0x6c19('0x42')]({'where':{'id':_0x1e89b3[_0x6c19('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5e026b,null))[_0x6c19('0x21')](saveUpdates(_0x1e89b3['body'],null))[_0x6c19('0x21')](respondWithResult(_0x5e026b,null))[_0x6c19('0x3e')](handleError(_0x5e026b,null));};exports[_0x6c19('0x25')]=function(_0x16374a,_0x5977e1){return db[_0x6c19('0x2a')][_0x6c19('0x42')]({'where':{'id':_0x16374a[_0x6c19('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5977e1,null))[_0x6c19('0x21')](removeEntity(_0x5977e1,null))[_0x6c19('0x3e')](handleError(_0x5977e1,null));};exports[_0x6c19('0x2b')]=function(_0x288872,_0x2f476a){return db['CmCompany'][_0x6c19('0x2b')]()[_0x6c19('0x21')](respondWithResult(_0x2f476a,null))[_0x6c19('0x3e')](handleError(_0x2f476a,null));};exports[_0x6c19('0x4c')]=function(_0x4bc9d5,_0x57e365,_0x1905f5){return db[_0x6c19('0x4d')]['find']({'where':{'id':_0x4bc9d5['params']['id']}})['then'](handleEntityNotFound(_0x57e365,null))['then'](function(_0x136f4d){if(_0x136f4d){return _0x136f4d[_0x6c19('0x4c')](_0x4bc9d5[_0x6c19('0x44')]['ids'],_[_0x6c19('0x4e')](_0x4bc9d5[_0x6c19('0x44')],[_0x6c19('0x4f'),'id'])||{});}})[_0x6c19('0x21')](respondWithResult(_0x57e365,null))[_0x6c19('0x3e')](handleError(_0x57e365,null));};exports[_0x6c19('0x50')]=function(_0x524652,_0x3bebe4,_0x266392){var _0x5511b3={};var _0x4776a9={};var _0x5531a4;var _0x3d52e5;return db[_0x6c19('0x2a')][_0x6c19('0x51')]({'where':{'id':_0x524652[_0x6c19('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3bebe4,null))['then'](function(_0x2a8b56){if(_0x2a8b56){_0x5531a4=_0x2a8b56;_0x4776a9[_0x6c19('0x30')]=_[_0x6c19('0x2c')](db[_0x6c19('0x4d')]['rawAttributes']);_0x4776a9[_0x6c19('0x2d')]=_[_0x6c19('0x2c')](_0x524652['query']);_0x4776a9[_0x6c19('0x2e')]=_[_0x6c19('0x2f')](_0x4776a9[_0x6c19('0x30')],_0x4776a9[_0x6c19('0x2d')]);_0x5511b3[_0x6c19('0x31')]=_[_0x6c19('0x2f')](_0x4776a9[_0x6c19('0x30')],qs[_0x6c19('0x32')](_0x524652['query'][_0x6c19('0x32')]));_0x5511b3[_0x6c19('0x31')]=_0x5511b3['attributes'][_0x6c19('0x33')]?_0x5511b3[_0x6c19('0x31')]:_0x4776a9[_0x6c19('0x30')];_0x5511b3[_0x6c19('0x35')]=qs[_0x6c19('0x36')](_0x524652[_0x6c19('0x2d')][_0x6c19('0x36')]);_0x5511b3[_0x6c19('0x37')]=qs['filters'](_[_0x6c19('0x38')](_0x524652[_0x6c19('0x2d')],_0x4776a9[_0x6c19('0x2e')]));if(_0x524652['query'][_0x6c19('0x39')]){_0x5511b3[_0x6c19('0x37')]=_[_0x6c19('0x3a')](_0x5511b3[_0x6c19('0x37')],{'$or':_[_0x6c19('0x52')](_0x5511b3[_0x6c19('0x31')],function(_0x239f0b){var _0x4c5ce6={};_0x4c5ce6[_0x239f0b]={'$like':'%'+_0x524652[_0x6c19('0x2d')][_0x6c19('0x39')]+'%'};return _0x4c5ce6;})});}_0x5511b3=_['merge']({},_0x5511b3,_0x524652[_0x6c19('0x3b')]);return _0x5531a4[_0x6c19('0x50')](_0x5511b3);}})[_0x6c19('0x21')](function(_0x57185c){if(_0x57185c){_0x3d52e5=_0x57185c['length'];if(!_0x524652[_0x6c19('0x2d')][_0x6c19('0x53')]('nolimit')){_0x5511b3[_0x6c19('0x19')]=qs[_0x6c19('0x19')](_0x524652[_0x6c19('0x2d')]['limit']);_0x5511b3[_0x6c19('0x17')]=qs[_0x6c19('0x17')](_0x524652[_0x6c19('0x2d')][_0x6c19('0x17')]);}return _0x5531a4[_0x6c19('0x50')](_0x5511b3);}})['then'](function(_0x2e249e){if(_0x2e249e){return _0x2e249e?{'count':_0x3d52e5,'rows':_0x2e249e}:null;}})[_0x6c19('0x21')](respondWithResult(_0x3bebe4,null))[_0x6c19('0x3e')](handleError(_0x3bebe4,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index ae1d1bb..f8459f2 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 _0x8740=['CmCompany','lodash','../../config/logger','moment','path','../../config/environment','./cmCompany.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8740,0x1f2));var _0x0874=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x8740[_0xbd08b4];return _0x314f1e;};'use strict';var _=require(_0x0874('0x0'));var util=require('util');var logger=require(_0x0874('0x1'))('api');var moment=require(_0x0874('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0874('0x3'));var rimraf=require('rimraf');var config=require(_0x0874('0x4'));var attributes=require(_0x0874('0x5'));module['exports']=function(_0x3acc4d,_0x180c8e){return _0x3acc4d['define'](_0x0874('0x6'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x99f2=['CmCompany','cm_companies','util','../../config/logger','api','bluebird','path','../../config/environment','./cmCompany.attributes','exports','define'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x99f2,0x141));var _0x299f=function(_0x9c7389,_0x3e8c68){_0x9c7389=_0x9c7389-0x0;var _0x7b51be=_0x99f2[_0x9c7389];return _0x7b51be;};'use strict';var _=require('lodash');var util=require(_0x299f('0x0'));var logger=require(_0x299f('0x1'))(_0x299f('0x2'));var moment=require('moment');var BPromise=require(_0x299f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x299f('0x4'));var rimraf=require('rimraf');var config=require(_0x299f('0x5'));var attributes=require(_0x299f('0x6'));module[_0x299f('0x7')]=function(_0x5d6b60,_0x5e4c4c){return _0x5d6b60[_0x299f('0x8')](_0x299f('0x9'),attributes,{'tableName':_0x299f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index 00637f7..b372a42 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 _0x3c7d=['result','catch','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x5f2073,_0x2199e7){var _0x5034ec=function(_0xeab6cb){while(--_0xeab6cb){_0x5f2073['push'](_0x5f2073['shift']());}};_0x5034ec(++_0x2199e7);}(_0x3c7d,0x6b));var _0xd3c7=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x3c7d[_0x255d5b];return _0x3e141a;};'use strict';var _=require('lodash');var util=require(_0xd3c7('0x0'));var moment=require('moment');var BPromise=require(_0xd3c7('0x1'));var rs=require(_0xd3c7('0x2'));var fs=require('fs');var Redis=require(_0xd3c7('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd3c7('0x4'))(_0xd3c7('0x5'));var config=require(_0xd3c7('0x6'));var jayson=require(_0xd3c7('0x7'));var client=jayson[_0xd3c7('0x8')][_0xd3c7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19c093,_0x6c4bb5,_0x12b727){return new BPromise(function(_0x4c5f4b,_0x141f94){return client[_0xd3c7('0xa')](_0x19c093,_0x12b727)[_0xd3c7('0xb')](function(_0x591f6c){logger[_0xd3c7('0xc')](_0xd3c7('0xd'),_0x6c4bb5,_0xd3c7('0xe'));logger['debug'](_0xd3c7('0xf'),_0x6c4bb5,_0xd3c7('0xe'),JSON['stringify'](_0x591f6c));if(_0x591f6c[_0xd3c7('0x10')]){if(_0x591f6c[_0xd3c7('0x10')][_0xd3c7('0x11')]===0x1f4){logger['error'](_0xd3c7('0xd'),_0x6c4bb5,_0x591f6c[_0xd3c7('0x10')][_0xd3c7('0x12')]);return _0x141f94(_0x591f6c[_0xd3c7('0x10')]['message']);}logger['error']('CmCompany,\x20%s,\x20%s',_0x6c4bb5,_0x591f6c[_0xd3c7('0x10')]['message']);return _0x4c5f4b(_0x591f6c[_0xd3c7('0x10')]['message']);}else{logger[_0xd3c7('0xc')]('CmCompany,\x20%s,\x20%s',_0x6c4bb5,_0xd3c7('0xe'));_0x4c5f4b(_0x591f6c[_0xd3c7('0x13')][_0xd3c7('0x12')]);}})[_0xd3c7('0x14')](function(_0x36f5f1){logger[_0xd3c7('0x10')](_0xd3c7('0xd'),_0x6c4bb5,_0x36f5f1);_0x141f94(_0x36f5f1);});});}
\ No newline at end of file
+var _0xecf0=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','error','code','CmCompany,\x20%s,\x20%s','message','catch','moment','bluebird','randomstring'];(function(_0x1e30ae,_0x31fb63){var _0x572148=function(_0x4e8737){while(--_0x4e8737){_0x1e30ae['push'](_0x1e30ae['shift']());}};_0x572148(++_0x31fb63);}(_0xecf0,0xf4));var _0x0ecf=function(_0x249c8c,_0x532d6e){_0x249c8c=_0x249c8c-0x0;var _0x2591aa=_0xecf0[_0x249c8c];return _0x2591aa;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0ecf('0x0'));var BPromise=require(_0x0ecf('0x1'));var rs=require(_0x0ecf('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0ecf('0x3'));var logger=require(_0x0ecf('0x4'))(_0x0ecf('0x5'));var config=require(_0x0ecf('0x6'));var jayson=require(_0x0ecf('0x7'));var client=jayson[_0x0ecf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fffcc,_0x2f052b,_0x2a8913){return new BPromise(function(_0x1b36c3,_0x1841cf){return client[_0x0ecf('0x9')](_0x2fffcc,_0x2a8913)[_0x0ecf('0xa')](function(_0x47cd8e){logger[_0x0ecf('0xb')]('CmCompany,\x20%s,\x20%s',_0x2f052b,_0x0ecf('0xc'));logger['debug'](_0x0ecf('0xd'),_0x2f052b,'request\x20sent',JSON['stringify'](_0x47cd8e));if(_0x47cd8e[_0x0ecf('0xe')]){if(_0x47cd8e[_0x0ecf('0xe')][_0x0ecf('0xf')]===0x1f4){logger[_0x0ecf('0xe')](_0x0ecf('0x10'),_0x2f052b,_0x47cd8e[_0x0ecf('0xe')][_0x0ecf('0x11')]);return _0x1841cf(_0x47cd8e['error'][_0x0ecf('0x11')]);}logger[_0x0ecf('0xe')](_0x0ecf('0x10'),_0x2f052b,_0x47cd8e[_0x0ecf('0xe')]['message']);return _0x1b36c3(_0x47cd8e[_0x0ecf('0xe')][_0x0ecf('0x11')]);}else{logger[_0x0ecf('0xb')](_0x0ecf('0x10'),_0x2f052b,'request\x20sent');_0x1b36c3(_0x47cd8e['result'][_0x0ecf('0x11')]);}})[_0x0ecf('0x12')](function(_0x56ff1d){logger[_0x0ecf('0xe')]('CmCompany,\x20%s,\x20%s',_0x2f052b,_0x56ff1d);_0x1841cf(_0x56ff1d);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 16e0e68..7878be0 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 _0xc8a8=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','update','destroy','exports','multer','util'];(function(_0x4b224f,_0x31706d){var _0x40043f=function(_0x2c8a4e){while(--_0x2c8a4e){_0x4b224f['push'](_0x4b224f['shift']());}};_0x40043f(++_0x31706d);}(_0xc8a8,0x1d2));var _0x8c8a=function(_0x1757f2,_0x1b09fa){_0x1757f2=_0x1757f2-0x0;var _0x5e7212=_0xc8a8[_0x1757f2];return _0x5e7212;};'use strict';var multer=require(_0x8c8a('0x0'));var util=require(_0x8c8a('0x1'));var path=require(_0x8c8a('0x2'));var timeout=require(_0x8c8a('0x3'));var express=require(_0x8c8a('0x4'));var router=express[_0x8c8a('0x5')]();var fs_extra=require(_0x8c8a('0x6'));var auth=require(_0x8c8a('0x7'));var interaction=require(_0x8c8a('0x8'));var config=require(_0x8c8a('0x9'));var controller=require(_0x8c8a('0xa'));router[_0x8c8a('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8c8a('0xb')](_0x8c8a('0xc'),auth[_0x8c8a('0xd')](),controller[_0x8c8a('0xe')]);router[_0x8c8a('0xb')](_0x8c8a('0xf'),auth[_0x8c8a('0xd')](),controller[_0x8c8a('0x10')]);router['get'](_0x8c8a('0x11'),auth[_0x8c8a('0xd')](),controller[_0x8c8a('0x12')]);router[_0x8c8a('0x13')]('/',auth[_0x8c8a('0xd')](),controller[_0x8c8a('0x14')]);router[_0x8c8a('0x13')](_0x8c8a('0x11'),auth['isAuthenticated'](),controller[_0x8c8a('0x15')]);router[_0x8c8a('0x16')]('/:id',auth[_0x8c8a('0xd')](),controller[_0x8c8a('0x17')]);router['delete'](_0x8c8a('0xf'),auth[_0x8c8a('0xd')](),controller[_0x8c8a('0x18')]);module[_0x8c8a('0x19')]=router;
\ No newline at end of file
+var _0x3b98=['./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','post','create','put','update','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4ec520,_0x15fee2){var _0xed49d7=function(_0x3031f2){while(--_0x3031f2){_0x4ec520['push'](_0x4ec520['shift']());}};_0xed49d7(++_0x15fee2);}(_0x3b98,0xd5));var _0x83b9=function(_0x3f49b3,_0x1897a7){_0x3f49b3=_0x3f49b3-0x0;var _0x2c14ff=_0x3b98[_0x3f49b3];return _0x2c14ff;};'use strict';var multer=require(_0x83b9('0x0'));var util=require('util');var path=require(_0x83b9('0x1'));var timeout=require('connect-timeout');var express=require(_0x83b9('0x2'));var router=express[_0x83b9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x83b9('0x4'));var interaction=require(_0x83b9('0x5'));var config=require(_0x83b9('0x6'));var controller=require(_0x83b9('0x7'));router[_0x83b9('0x8')]('/',auth[_0x83b9('0x9')](),controller[_0x83b9('0xa')]);router[_0x83b9('0x8')](_0x83b9('0xb'),auth['isAuthenticated'](),controller[_0x83b9('0xc')]);router[_0x83b9('0x8')](_0x83b9('0xd'),auth[_0x83b9('0x9')](),controller[_0x83b9('0xe')]);router[_0x83b9('0x8')](_0x83b9('0xf'),auth[_0x83b9('0x9')](),controller['getContacts']);router[_0x83b9('0x10')]('/',auth['isAuthenticated'](),controller[_0x83b9('0x11')]);router[_0x83b9('0x10')](_0x83b9('0xf'),auth[_0x83b9('0x9')](),controller['addContacts']);router[_0x83b9('0x12')](_0x83b9('0xd'),auth['isAuthenticated'](),controller[_0x83b9('0x13')]);router['delete'](_0x83b9('0xd'),auth[_0x83b9('0x9')](),controller[_0x83b9('0x14')]);module[_0x83b9('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index eafa269..e5afdaf 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 _0xcb1f=['sequelize','STRING','INTEGER','NOW','lodash'];(function(_0xd07878,_0x5c6aa9){var _0x317960=function(_0x3746d0){while(--_0x3746d0){_0xd07878['push'](_0xd07878['shift']());}};_0x317960(++_0x5c6aa9);}(_0xcb1f,0x1e9));var _0xfcb1=function(_0x6abbf3,_0x37eef1){_0x6abbf3=_0x6abbf3-0x0;var _0x36738e=_0xcb1f[_0x6abbf3];return _0x36738e;};'use strict';var _=require(_0xfcb1('0x0'));var Sequelize=require(_0xfcb1('0x1'));module['exports']={'firstName':{'type':Sequelize[_0xfcb1('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xfcb1('0x2')]},'postalCode':{'type':Sequelize[_0xfcb1('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xfcb1('0x2')]},'dateOfBirth':{'type':Sequelize[_0xfcb1('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xfcb1('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xfcb1('0x2')]},'email':{'type':Sequelize[_0xfcb1('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xfcb1('0x2')]},'teams':{'type':Sequelize[_0xfcb1('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xfcb1('0x2')]},'wechat':{'type':Sequelize[_0xfcb1('0x2')]},'telegram':{'type':Sequelize[_0xfcb1('0x2')]},'UserId':{'type':Sequelize[_0xfcb1('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xfcb1('0x4')]}};
\ No newline at end of file
+var _0x08f4=['lodash','sequelize','exports','STRING','TEXT','INTEGER','DATE','NOW'];(function(_0x1fd3c9,_0x111a41){var _0xfd8683=function(_0x2b0528){while(--_0x2b0528){_0x1fd3c9['push'](_0x1fd3c9['shift']());}};_0xfd8683(++_0x111a41);}(_0x08f4,0x120));var _0x408f=function(_0x42f208,_0x5d07c9){_0x42f208=_0x42f208-0x0;var _0x3ffa5e=_0x08f4[_0x42f208];return _0x3ffa5e;};'use strict';var _=require(_0x408f('0x0'));var Sequelize=require(_0x408f('0x1'));module[_0x408f('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x408f('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x408f('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x408f('0x3')]},'dateOfBirth':{'type':Sequelize[_0x408f('0x3')]},'description':{'type':Sequelize[_0x408f('0x4')]},'phone':{'type':Sequelize[_0x408f('0x3')]},'mobile':{'type':Sequelize[_0x408f('0x3')]},'fax':{'type':Sequelize[_0x408f('0x3')]},'email':{'type':Sequelize[_0x408f('0x3')]},'url':{'type':Sequelize[_0x408f('0x3')]},'facebook':{'type':Sequelize[_0x408f('0x3')]},'fb_data':{'type':Sequelize[_0x408f('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x408f('0x3')]},'teams':{'type':Sequelize[_0x408f('0x3')]},'viber':{'type':Sequelize[_0x408f('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x408f('0x3')]},'UserId':{'type':Sequelize[_0x408f('0x5')]},'priority':{'type':Sequelize[_0x408f('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x408f('0x6')],'defaultValue':Sequelize[_0x408f('0x7')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index f2d4eb5..837433b 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 _0xb37c=['ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','error','stack','name','send','index','CmContact','describe','keys','length','push','CmCustomField','findOne','cf_','model','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','select','field','color','from','tools_tags','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','parseSearch','search','sqlOperator','conditions','find','Tag','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','and','uc.UserId\x20=\x20?','value','castTo','DATE','buildExpression','type','text','start','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','\x20=\x20?','tag','isArray','filter','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.phone\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.id','Sequelize','QueryTypes','SELECT','clone','order','DESC','having','t.id\x20IN\x20?','resolve','user','role','some','getLists','c.ListId\x20IS\x20NULL','agent','sequelize','toString','keyBy','merge','c.firstName','c.phone','c.mobile','c.fax','c.createdAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','tags','startsWith','columnName','findAll','values','hasOwnProperty','body','get','mergeWith','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','destroy','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatOfflineMessage','MailMessage','MailInteraction','FaxInteraction','FaxMessage','OpenchannelInteraction','CmHopperFinal','CmHopperHistory','VoiceCallReport','MailQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','duplicates','$or','findOrCreate','spread','$and','omit','format','pickBy','cf_%d','table','cm_contacts','setFields','id\x20=\x20?','toParam','phone','getTags','rawAttributes','options','setTags','getHoppers','ContactId','includeAll','include','getHopperHistories','getHopperFinals','getJscriptySessions','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','zipObject','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','../../components/import/cm/csv','CompanyId','socket_timestamp','File\x20uploaded\x20correctly!','pid','parse','meta','binding','No\x20phone\x20column\x20specified','child_process','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','getJourney','mail','fax','whatsapp','voice','-createdAt','includes','channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','starttime','endtime','duration','note','createdAt','userDisposition','userThirdDisposition','UserId','alias','findAndCountAll','fullname','chat','Website','Account','closed','disposition','thirdDisposition','key','Owner','customerIp','customerPort','deviceModel','ratingMessage','ratingType','ratingValue','referer','subject','substatus','openchannel','externalUrl','threadId','startCase','Interaction','flatten','sortBy','reverse','slice','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse'];(function(_0x551611,_0x5c0b14){var _0x258a91=function(_0x4c3fc3){while(--_0x4c3fc3){_0x551611['push'](_0x551611['shift']());}};_0x258a91(++_0x5c0b14);}(_0xb37c,0x110));var _0xcb37=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xb37c[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcb37('0x0'));var zipdir=require(_0xcb37('0x1'));var jsonpatch=require(_0xcb37('0x2'));var rp=require(_0xcb37('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcb37('0x4'));var util=require(_0xcb37('0x5'));var path=require(_0xcb37('0x6'));var sox=require(_0xcb37('0x7'));var csv=require(_0xcb37('0x8'));var ejs=require(_0xcb37('0x9'));var fs=require('fs');var fs_extra=require(_0xcb37('0xa'));var _=require(_0xcb37('0xb'));var squel=require('squel');var crypto=require(_0xcb37('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcb37('0x8'));var querystring=require(_0xcb37('0xd'));var Papa=require(_0xcb37('0xe'));var Redis=require(_0xcb37('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcb37('0x10'));var hardwareService=require(_0xcb37('0x11'));var logger=require(_0xcb37('0x12'))(_0xcb37('0x13'));var utils=require(_0xcb37('0x14'));var config=require(_0xcb37('0x15'));var licenseUtil=require(_0xcb37('0x16'));var db=require('../../mysqldb')['db'];config[_0xcb37('0x17')]=_['defaults'](config['redis'],{'host':_0xcb37('0x18'),'port':0x18eb});var socket=require(_0xcb37('0x19'))(new Redis(config[_0xcb37('0x17')]));require('./cmContact.socket')[_0xcb37('0x1a')](socket);function respondWithStatusCode(_0x53bd52,_0x4fd66f){_0x4fd66f=_0x4fd66f||0xcc;return function(_0x2e498e){if(_0x2e498e){return _0x53bd52[_0xcb37('0x1b')](_0x4fd66f);}return _0x53bd52[_0xcb37('0x1c')](_0x4fd66f)[_0xcb37('0x1d')]();};}function respondWithResult(_0x42f1cf,_0x52dbd4){_0x52dbd4=_0x52dbd4||0xc8;return function(_0x34597d){if(_0x34597d){return _0x42f1cf[_0xcb37('0x1c')](_0x52dbd4)[_0xcb37('0x1e')](_0x34597d);}};}function respondWithFilteredResult(_0x277afd,_0x46c925){return function(_0x846e03){if(_0x846e03){var _0x237c76=typeof _0x46c925[_0xcb37('0x1f')]===_0xcb37('0x20')&&typeof _0x46c925['limit']==='undefined';var _0x17280c=_0x846e03[_0xcb37('0x21')];var _0x27cfd4=_0x237c76?0x0:_0x46c925[_0xcb37('0x1f')];var _0x32e2da=_0x237c76?_0x846e03['count']:_0x46c925[_0xcb37('0x1f')]+_0x46c925[_0xcb37('0x22')];var _0x2505a8;if(_0x32e2da>=_0x17280c){_0x32e2da=_0x17280c;_0x2505a8=0xc8;}else{_0x2505a8=0xce;}_0x277afd[_0xcb37('0x1c')](_0x2505a8);return _0x277afd[_0xcb37('0x23')](_0xcb37('0x24'),_0x27cfd4+'-'+_0x32e2da+'/'+_0x17280c)[_0xcb37('0x1e')](_0x846e03);}return null;};}function patchUpdates(_0x1a4b7d){return function(_0x280a78){try{jsonpatch[_0xcb37('0x25')](_0x280a78,_0x1a4b7d,!![]);}catch(_0x49be21){return BPromise['reject'](_0x49be21);}return _0x280a78[_0xcb37('0x26')]();};}function saveUpdates(_0x9a4b04,_0x143aed){return function(_0x42b933){if(_0x42b933){return _0x42b933[_0xcb37('0x27')](_0x9a4b04)[_0xcb37('0x28')](function(_0x13411e){return _0x13411e;});}return null;};}function removeEntity(_0x261b4c,_0x3274c6){return function(_0x38eec0){if(_0x38eec0){return _0x38eec0['destroy']()[_0xcb37('0x28')](function(){_0x261b4c[_0xcb37('0x1c')](0xcc)[_0xcb37('0x1d')]();});}};}function handleEntityNotFound(_0x304b28,_0x3fc045){return function(_0x9f5e18){if(!_0x9f5e18){_0x304b28['sendStatus'](0x194);}return _0x9f5e18;};}function handleError(_0x267b14,_0x35f533){_0x35f533=_0x35f533||0x1f4;return function(_0x3a48e4){logger[_0xcb37('0x29')](_0x3a48e4[_0xcb37('0x2a')]);if(_0x3a48e4[_0xcb37('0x2b')]){delete _0x3a48e4[_0xcb37('0x2b')];}_0x267b14['status'](_0x35f533)[_0xcb37('0x2c')](_0x3a48e4);};}exports[_0xcb37('0x2d')]=function(_0x394863,_0x3823ef){var _0xeacf82={},_0x3f6cca={},_0x57417b={'count':0x0,'rows':[]};return db[_0xcb37('0x2e')][_0xcb37('0x2f')]()[_0xcb37('0x28')](function(_0x59dc52){var _0xa4e5ab=[];for(var _0x2f749a=0x0;_0x2f749a
','Attachments','Title'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x32b6,0x1d1));var _0x632b=function(_0x2bb36d,_0x34f88d){_0x2bb36d=_0x2bb36d-0x0;var _0x283da3=_0x32b6[_0x2bb36d];return _0x283da3;};'use strict';var _=require(_0x632b('0x0'));var moment=require(_0x632b('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x632b('0x2'));var util=require(_0x632b('0x3'));var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0x632b('0x4'));var config=require(_0x632b('0x5'));function getAddress(_0x3ba3a7){var _0x3a0e0e=_[_0x632b('0x6')](_0x3ba3a7[_0x632b('0x7')]);return _0x3a0e0e&&_0x3a0e0e[_0x632b('0x8')]?_0x3a0e0e[_0x632b('0x8')]:_0x632b('0x9')+random[_0x632b('0xa')](0x6)+'@xcally.com';}function getFirstName(_0x33d711){var _0x173270=_[_0x632b('0x6')](_0x33d711[_0x632b('0x7')]);if(_0x173270&&_0x173270['name']){if(_0x173270['name']==_0x173270['address']){return _0x173270[_0x632b('0xb')]['substring'](0x0,_0x173270[_0x632b('0xb')][_0x632b('0xc')]('@'));}var _0x2eca51=_0x173270[_0x632b('0xb')][_0x632b('0xd')](/\s+/);return _0x2eca51[_0x632b('0xe')]>0x1?_0x2eca51[_0x632b('0xf')](0x0,-0x1)[_0x632b('0x10')]('\x20'):_0x173270[_0x632b('0xb')];}return'Anonymous';}function getLastName(_0xb5416c){var _0x286f75=_[_0x632b('0x6')](_0xb5416c['value']);if(_0x286f75&&_0x286f75[_0x632b('0xb')]){var _0x1a3a60=_0x286f75[_0x632b('0xb')][_0x632b('0xd')](/\s+/);return _0x1a3a60[_0x632b('0xe')]>0x1?_0x1a3a60[_0x632b('0x11')]():'';}return'';}function getMails(_0x4efe39,_0x17ddc5){var _0x52f353='';for(var _0x4fdef2=0x0;_0x4fdef2<_0x17ddc5[_0x632b('0x7')]['length'];_0x4fdef2+=0x1){if(_0x17ddc5[_0x632b('0x7')][_0x4fdef2][_0x632b('0x8')]!==_0x4efe39){if(!_[_0x632b('0x12')](_0x52f353)){_0x52f353+=',';}_0x52f353+=_0x17ddc5['value'][_0x4fdef2][_0x632b('0xb')]||_0x17ddc5[_0x632b('0x7')][_0x4fdef2][_0x632b('0x8')]||'';_0x52f353+='\x20<';_0x52f353+=_0x17ddc5[_0x632b('0x7')][_0x4fdef2]['address']?_0x17ddc5[_0x632b('0x7')][_0x4fdef2][_0x632b('0x8')]:'anonymous'+random[_0x632b('0xa')](0x6)+'@xcally.com';_0x52f353+='>';}}return _0x52f353;}function parseEmail(_0x4b5618,_0x1b1092,_0x5ce3fa){if(_0x1b1092[_0x632b('0x13')]){var _0x1c4530=/